@orca-so/whirlpools-automation 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +42 -0
  2. package/dist/generated/accounts/automation.d.ts +44 -0
  3. package/dist/generated/accounts/globalConfig.d.ts +28 -0
  4. package/dist/generated/accounts/index.d.ts +2 -0
  5. package/dist/generated/accounts/scratchSpace.d.ts +57 -0
  6. package/dist/generated/accounts/state.d.ts +61 -0
  7. package/dist/generated/constants.d.ts +1 -0
  8. package/dist/generated/errors/index.d.ts +1 -0
  9. package/dist/generated/errors/whirlpoolsAutomationProgram.d.ts +45 -0
  10. package/dist/generated/index.d.ts +6 -0
  11. package/dist/generated/instructions/createAutomation.d.ts +80 -0
  12. package/dist/generated/instructions/fundAutomation.d.ts +41 -0
  13. package/dist/generated/instructions/harvestAndReinvest.d.ts +96 -0
  14. package/dist/generated/instructions/harvestSwapAndReinvestPost.d.ts +93 -0
  15. package/dist/generated/instructions/harvestSwapAndReinvestPre.d.ts +90 -0
  16. package/dist/generated/instructions/index.d.ts +8 -0
  17. package/dist/generated/instructions/initialize.d.ts +104 -0
  18. package/dist/generated/instructions/initializeGlobalConfig.d.ts +44 -0
  19. package/dist/generated/instructions/removeAutomations.d.ts +57 -0
  20. package/dist/generated/instructions/set.d.ts +89 -0
  21. package/dist/generated/instructions/updateGlobalConfig.d.ts +38 -0
  22. package/dist/generated/programs/index.d.ts +1 -0
  23. package/dist/generated/programs/whirlpoolsAutomationProgram.d.ts +39 -0
  24. package/dist/generated/shared/index.d.ts +15 -0
  25. package/dist/generated/types/accountDiscriminator.d.ts +12 -0
  26. package/dist/generated/types/action.d.ts +11 -0
  27. package/dist/generated/types/actionData.d.ts +12 -0
  28. package/dist/generated/types/actionLabel.d.ts +10 -0
  29. package/dist/generated/types/address.d.ts +4 -0
  30. package/dist/generated/types/collectFeesV2AccountsType.d.ts +20 -0
  31. package/dist/generated/types/collectFeesV2RemainingAccountsInfo.d.ts +15 -0
  32. package/dist/generated/types/collectFeesV2RemainingAccountsSlice.d.ts +17 -0
  33. package/dist/generated/types/condition.d.ts +39 -0
  34. package/dist/generated/types/conditionData.d.ts +37 -0
  35. package/dist/generated/types/conditionLabel.d.ts +20 -0
  36. package/dist/generated/types/event.d.ts +143 -0
  37. package/dist/generated/types/fundAutomationMethod.d.ts +10 -0
  38. package/dist/generated/types/fundAutomationVariant.d.ts +18 -0
  39. package/dist/generated/types/globalConfigUpdateInstruction.d.ts +65 -0
  40. package/dist/generated/types/increaseLiquidityByTokenAmountsAccountsType.d.ts +17 -0
  41. package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsInfo.d.ts +12 -0
  42. package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsSlice.d.ts +14 -0
  43. package/dist/generated/types/increaseLiquidityMethod.d.ts +23 -0
  44. package/dist/generated/types/index.d.ts +20 -0
  45. package/dist/generated/types/nonZeroU32.d.ts +4 -0
  46. package/dist/generated/types/position.d.ts +32 -0
  47. package/dist/generated/types/positionRewardInfo.d.ts +13 -0
  48. package/dist/generated/types/scratchSpacePayload.d.ts +53 -0
  49. package/dist/generated/types/stateUpdateInstruction.d.ts +55 -0
  50. package/dist/generated/types/tokenAccount.d.ts +32 -0
  51. package/dist/generated/types/tokenAccountState.d.ts +11 -0
  52. package/dist/generated/types/tokenMint.d.ts +24 -0
  53. package/dist/generated/types/updateGlobalConfigInstruction.d.ts +65 -0
  54. package/dist/generated/types/updateGlobalConfigVariant.d.ts +25 -0
  55. package/dist/generated/types/whirlpool.d.ts +50 -0
  56. package/dist/generated/types/whirlpoolRewardInfo.d.ts +20 -0
  57. package/dist/index.browser.js +2927 -0
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.node.js +2922 -0
  60. package/package.json +45 -0
package/LICENSE ADDED
@@ -0,0 +1,42 @@
1
+ Orca License
2
+
3
+ This Orca License is entered into by and between you and Orca Management Company S.A. (“Licensor”), and relates to accessing, downloading, copying, modifying, reading, viewing, using, or otherwise engaging with (collectively, “Use” or “Using”) the Orca software and smart contracts made available on Licensor’s GitHub repository to which this Agreement is posted (collectively, the “Software”).
4
+
5
+ If the user Uses the Software under authority from a different party or on another party’s behalf, then “you,” as used herein, refers to that person on whose behalf the Software is Used (e.g., an employer, a contractor, or other agent). If the person Using the Software is an individual, acting in their own individual capacity, then “you” refers to that individual. If you have anyone Using the Software on your behalf, you agree that you are responsible for the actions and inactions of all such persons, as if they were your own.
6
+
7
+ Please read this Orca License (the “Agreement”) carefully before you Use the Software in any way. By Using the Software, you accept and agree to be bound and abide by the terms of this Agreement. If you do not want to agree to the terms of this Agreement, you must not Use the Software.
8
+
9
+ By using the Software, you represent and warrant that you are of legal age and otherwise have all requisite legal authority to form a binding contract with Licensor. If you do not meet all of these requirements, you are not permitted to Use the Software in whole or in part.
10
+
11
+ 1. Non-Commercial Use License Grant
12
+
13
+ a. Subject to the provisions of section 2(b) below, and the remainder of the provisions of this Agreement, Licensor hereby grants you a limited, non-exclusive, non-sublicensable, non-transferable, revocable license, to Use the Software, solely for Authorized Non-Commercial Uses (as defined below). This license is further subject to the Apache 2.0 open-source license, published by The Apache Software Foundation (the “Apache License”) and the terms of this Agreement. If there is any conflict between the terms of the Apache License and those set forth in this Agreement, the provisions of this Agreement shall prevail. The “Authorized Non-Commercial Uses” are the following:
14
+ i. Educational Purposes: Using the Software in university courses, coding boot camps, or self-learning projects to teach blockchain development, provided such Use does not involve revenue generation or commercial exploitation.
15
+ ii. Research & Experimentation: Academics and developers Using the Software to test and research new decentralized finance (“DeFi”) models, security vulnerabilities, or governance mechanisms. Any research must clearly disclose its non-commercial nature.
16
+ iii. Personal Use: Deploying smart contracts for self-custody, portfolio tracking, or experimenting with personal finance automation without monetization, provided such Use does not involve revenue generation or commercial exploitation.
17
+ iv. Non-Profit Financial Services: Using the Software for decentralized microloans, donations, or mutual aid organizations, where all funds and activities serve a charitable purpose and do not generate any financial compensation for the operator.
18
+ v. Testing & Simulation: Using the Software to create testnet environments to evaluate new economic models, game theory applications, or tokenomics without real-world financial implications, provided such Use does not result in the eventual deployment in a production environment.
19
+
20
+ b. If any Use of the Software does or could benefit, directly or indirectly, a competitor of Licensor, such Use shall not be subject to Section 1(a), but instead, be subject to the provisions of Section 1(c) below. "Competitor" means any legal person, project, protocol, or platform that directly or indirectly offers, develops, operates, or facilitates services or functionalities similar to those provided by Licensor or its affiliates or other related entities or persons (collectively the “Licensor Parties”), including centralized exchanges, decentralized exchanges (DEXs), automated market makers (AMMs), liquidity protocols, token swap services, DeFi aggregators, bodies engaged in cryptocurrency trading, as well as legal persons, decentralized autonomous organizations or other bodies that develop, promote, or maintain software or protocols that could substitute, replicate, or substantially overlap with Licensor’s or the Licensor Parties’ services or its offered functionalities.
21
+
22
+ c. Any Use of the Software outside of the Authorized Non-Commercial Uses requires Licensor’s prior written consent in each instance, such consent to be granted or withheld at Licensor’s sole discretion. Such Use, if consented to by Licensor, shall be subject to the terms of this Agreement, and to the terms of any additional use grant documentation provided along with Licensor’s approval.
23
+
24
+ d. You acknowledge and agree that you are granted no rights to use the Software, except as set forth herein, unless explicitly authorized in writing by Licensor. In order to request such approval, please contact Licensor at IPLicensing@orca.so.
25
+
26
+ e. Licensor hereby reserves all rights not specifically granted herein.
27
+
28
+ 2. Miscellaneous
29
+
30
+ a. This Agreement does not grant you any rights to use any trademarks, logos or other designations of origin of Licensor or the Licensor Parties.
31
+
32
+ b. Licensor reserves the right to modify this Agreement at any time with or without notice. Each time you Use the Software, you agree to the terms of this Agreement as they exist on the date you Use such Software.
33
+
34
+ c. Except as otherwise set forth in this Agreement, (i) no failure to exercise, or delay in exercising, any right, remedy, power, or privilege arising from this Agreement will operate or be construed as a waiver thereof and (ii) no single or partial exercise of any right, remedy, power, or privilege hereunder will preclude any other or further exercise thereof or the exercise of any other right, remedy, power, or privilege.
35
+
36
+ d. If you violate the terms of this Agreement, your license to Use the Software shall immediately terminate.
37
+
38
+ e. This Agreement shall in all respects be governed by and construed in accordance with the laws of the Cayman Islands, without regard to any conflicts of law doctrines that would result in the application of the laws of another jurisdiction,
39
+
40
+ f. THE SOFTWARE IS PROVIDED “AS IS” AND LICENSOR HEREBY DISCLAIMS ALL WARRANTIES, WHETHER EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, AND ALL WARRANTIES ARISING FROM COURSE OF DEALING, USAGE, OR TRADE PRACTICE. LICENSOR MAKES NO WARRANTY OF ANY KIND THAT THE SOFTWARE, OR ANY PRODUCTS OR RESULTS OF THE USE THEREOF, WILL MEET YOUR OR ANY OTHER PERSON’S REQUIREMENTS, OPERATE WITHOUT INTERRUPTION, ACHIEVE ANY INTENDED RESULT, BE COMPATIBLE OR WORK WITH ANY SOFTWARE, SYSTEM OR OTHER SERVICES, OR BE SECURE, ACCURATE, COMPLETE, FREE OF HARMFUL CODE, OR ERROR FREE.
41
+
42
+ g. IN NO EVENT WILL LICENSOR, THE LICENSOR PARTIES, OR ANY OF THEIR RESPECTIVE LICENSORS, SERVICE PROVIDERS, OFFICERS, DIRECTORS, EMPLOYEES, CONTRACTORS, AGENTS, SUPPLIERS, SUCCESSORS, AND ASSIGNS BE LIABLE TO YOU OR ANY THIRD PARTY UNDER ANY THEORY, INCLUDING BREACH OF CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY, OR OTHERWISE, FOR ANY: (i) CONSEQUENTIAL, INCIDENTAL, INDIRECT, EXEMPLARY, SPECIAL, ENHANCED, OR PUNITIVE DAMAGES; (ii) INCREASED COSTS, DIMINUTION IN VALUE OR LOST BUSINESS, PRODUCTION, REVENUES, OR PROFITS; (iii) LOSS OF GOODWILL OR REPUTATION; (iv) USE, INABILITY TO USE, LOSS, INTERRUPTION, DELAY OR RECOVERY OF ANY DATA, OR BREACH OF DATA OR SYSTEM SECURITY; OR (v) COST OF REPLACEMENT GOODS OR SERVICES, OR ANY OTHER DAMAGES, IN EACH CASE REGARDLESS OF WHETHER LICENSOR WAS ADVISED OF THE POSSIBILITY OF SUCH LOSSES OR DAMAGES OR SUCH LOSSES OR DAMAGES WERE OTHERWISE FORESEEABLE.
@@ -0,0 +1,44 @@
1
+ import { fetchEncodedAccount, fetchEncodedAccounts, Account, Codec, Decoder, EncodedAccount, Encoder, FetchAccountConfig, FetchAccountsConfig, MaybeAccount, MaybeEncodedAccount, ReadonlyUint8Array } from '@solana/kit';
2
+ import { AccountDiscriminator, AccountDiscriminatorArgs, Address, AddressArgs } from '../types';
3
+
4
+ export type Automation = {
5
+ discriminator: AccountDiscriminator;
6
+ positionTokenAccount: Address;
7
+ actionData: ReadonlyUint8Array;
8
+ automationIndex: number;
9
+ conditionsData: ReadonlyUint8Array;
10
+ bump: number;
11
+ authorityBump: number;
12
+ padding: ReadonlyUint8Array;
13
+ crankReward: bigint;
14
+ automationTokenAccountA: Address;
15
+ automationTokenAccountB: Address;
16
+ tokenMintA: Address;
17
+ tokenMintB: Address;
18
+ reserved: ReadonlyUint8Array;
19
+ };
20
+ export type AutomationArgs = {
21
+ discriminator: AccountDiscriminatorArgs;
22
+ positionTokenAccount: AddressArgs;
23
+ actionData: ReadonlyUint8Array;
24
+ automationIndex: number;
25
+ conditionsData: ReadonlyUint8Array;
26
+ bump: number;
27
+ authorityBump: number;
28
+ padding: ReadonlyUint8Array;
29
+ crankReward: number | bigint;
30
+ automationTokenAccountA: AddressArgs;
31
+ automationTokenAccountB: AddressArgs;
32
+ tokenMintA: AddressArgs;
33
+ tokenMintB: AddressArgs;
34
+ reserved: ReadonlyUint8Array;
35
+ };
36
+ export declare function getAutomationEncoder(): Encoder<AutomationArgs>;
37
+ export declare function getAutomationDecoder(): Decoder<Automation>;
38
+ export declare function getAutomationCodec(): Codec<AutomationArgs, Automation>;
39
+ export declare function decodeAutomation<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Automation, TAddress>;
40
+ export declare function decodeAutomation<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Automation, TAddress>;
41
+ export declare function fetchAutomation<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Automation, TAddress>>;
42
+ export declare function fetchMaybeAutomation<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Automation, TAddress>>;
43
+ export declare function fetchAllAutomation(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Automation>[]>;
44
+ export declare function fetchAllMaybeAutomation(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Automation>[]>;
@@ -0,0 +1,28 @@
1
+ import { fetchEncodedAccount, fetchEncodedAccounts, Account, Codec, Decoder, EncodedAccount, Encoder, FetchAccountConfig, FetchAccountsConfig, MaybeAccount, MaybeEncodedAccount, ReadonlyUint8Array } from '@solana/kit';
2
+ import { AccountDiscriminator, AccountDiscriminatorArgs, Address, AddressArgs } from '../types';
3
+
4
+ export type GlobalConfig = {
5
+ discriminator: AccountDiscriminator;
6
+ bump: number;
7
+ padding: ReadonlyUint8Array;
8
+ globalConfigAuthority: Address;
9
+ crankRewardDefault: bigint;
10
+ reserved: ReadonlyUint8Array;
11
+ };
12
+ export type GlobalConfigArgs = {
13
+ discriminator: AccountDiscriminatorArgs;
14
+ bump: number;
15
+ padding: ReadonlyUint8Array;
16
+ globalConfigAuthority: AddressArgs;
17
+ crankRewardDefault: number | bigint;
18
+ reserved: ReadonlyUint8Array;
19
+ };
20
+ export declare function getGlobalConfigEncoder(): Encoder<GlobalConfigArgs>;
21
+ export declare function getGlobalConfigDecoder(): Decoder<GlobalConfig>;
22
+ export declare function getGlobalConfigCodec(): Codec<GlobalConfigArgs, GlobalConfig>;
23
+ export declare function decodeGlobalConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<GlobalConfig, TAddress>;
24
+ export declare function decodeGlobalConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<GlobalConfig, TAddress>;
25
+ export declare function fetchGlobalConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<GlobalConfig, TAddress>>;
26
+ export declare function fetchMaybeGlobalConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<GlobalConfig, TAddress>>;
27
+ export declare function fetchAllGlobalConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<GlobalConfig>[]>;
28
+ export declare function fetchAllMaybeGlobalConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<GlobalConfig>[]>;
@@ -0,0 +1,2 @@
1
+ export * from './automation';
2
+ export * from './globalConfig';
@@ -0,0 +1,57 @@
1
+ import {
2
+ Address,
3
+ fetchEncodedAccount,
4
+ fetchEncodedAccounts,
5
+ Account,
6
+ EncodedAccount,
7
+ FetchAccountConfig,
8
+ FetchAccountsConfig,
9
+ FixedSizeCodec,
10
+ FixedSizeDecoder,
11
+ FixedSizeEncoder,
12
+ MaybeAccount,
13
+ MaybeEncodedAccount,
14
+ ReadonlyUint8Array,
15
+ } from '@solana/kit';
16
+ import { AccountDiscriminator, AccountDiscriminatorArgs } from '../types';
17
+
18
+ export type ScratchSpace = {
19
+ discriminator: AccountDiscriminator;
20
+ bump: number;
21
+ payloadData: ReadonlyUint8Array;
22
+ };
23
+ export type ScratchSpaceArgs = {
24
+ discriminator: AccountDiscriminatorArgs;
25
+ bump: number;
26
+ payloadData: ReadonlyUint8Array;
27
+ };
28
+ export declare function getScratchSpaceEncoder(): FixedSizeEncoder<ScratchSpaceArgs>;
29
+ export declare function getScratchSpaceDecoder(): FixedSizeDecoder<ScratchSpace>;
30
+ export declare function getScratchSpaceCodec(): FixedSizeCodec<ScratchSpaceArgs, ScratchSpace>;
31
+ export declare function decodeScratchSpace<TAddress extends string = string>(
32
+ encodedAccount: EncodedAccount<TAddress>
33
+ ): Account<ScratchSpace, TAddress>;
34
+ export declare function decodeScratchSpace<TAddress extends string = string>(
35
+ encodedAccount: MaybeEncodedAccount<TAddress>
36
+ ): MaybeAccount<ScratchSpace, TAddress>;
37
+ export declare function fetchScratchSpace<TAddress extends string = string>(
38
+ rpc: Parameters<typeof fetchEncodedAccount>[0],
39
+ address: Address<TAddress>,
40
+ config?: FetchAccountConfig
41
+ ): Promise<Account<ScratchSpace, TAddress>>;
42
+ export declare function fetchMaybeScratchSpace<TAddress extends string = string>(
43
+ rpc: Parameters<typeof fetchEncodedAccount>[0],
44
+ address: Address<TAddress>,
45
+ config?: FetchAccountConfig
46
+ ): Promise<MaybeAccount<ScratchSpace, TAddress>>;
47
+ export declare function fetchAllScratchSpace(
48
+ rpc: Parameters<typeof fetchEncodedAccounts>[0],
49
+ addresses: Array<Address>,
50
+ config?: FetchAccountsConfig
51
+ ): Promise<Account<ScratchSpace>[]>;
52
+ export declare function fetchAllMaybeScratchSpace(
53
+ rpc: Parameters<typeof fetchEncodedAccounts>[0],
54
+ addresses: Array<Address>,
55
+ config?: FetchAccountsConfig
56
+ ): Promise<MaybeAccount<ScratchSpace>[]>;
57
+ export declare function getScratchSpaceSize(): number;
@@ -0,0 +1,61 @@
1
+ import {
2
+ fetchEncodedAccount,
3
+ fetchEncodedAccounts,
4
+ Account,
5
+ Codec,
6
+ Decoder,
7
+ EncodedAccount,
8
+ Encoder,
9
+ FetchAccountConfig,
10
+ FetchAccountsConfig,
11
+ MaybeAccount,
12
+ MaybeEncodedAccount,
13
+ ReadonlyUint8Array,
14
+ } from '@solana/kit';
15
+ import { AccountDiscriminator, AccountDiscriminatorArgs, Address, AddressArgs } from '../types';
16
+
17
+ export type State = {
18
+ discriminator: AccountDiscriminator;
19
+ bump: number;
20
+ padding: ReadonlyUint8Array;
21
+ updateAuthority: Address;
22
+ crankReward: bigint;
23
+ reserved: ReadonlyUint8Array;
24
+ };
25
+ export type StateArgs = {
26
+ discriminator: AccountDiscriminatorArgs;
27
+ bump: number;
28
+ padding: ReadonlyUint8Array;
29
+ updateAuthority: AddressArgs;
30
+ crankReward: number | bigint;
31
+ reserved: ReadonlyUint8Array;
32
+ };
33
+ export declare function getStateEncoder(): Encoder<StateArgs>;
34
+ export declare function getStateDecoder(): Decoder<State>;
35
+ export declare function getStateCodec(): Codec<StateArgs, State>;
36
+ export declare function decodeState<TAddress extends string = string>(
37
+ encodedAccount: EncodedAccount<TAddress>
38
+ ): Account<State, TAddress>;
39
+ export declare function decodeState<TAddress extends string = string>(
40
+ encodedAccount: MaybeEncodedAccount<TAddress>
41
+ ): MaybeAccount<State, TAddress>;
42
+ export declare function fetchState<TAddress extends string = string>(
43
+ rpc: Parameters<typeof fetchEncodedAccount>[0],
44
+ address: Address<TAddress>,
45
+ config?: FetchAccountConfig
46
+ ): Promise<Account<State, TAddress>>;
47
+ export declare function fetchMaybeState<TAddress extends string = string>(
48
+ rpc: Parameters<typeof fetchEncodedAccount>[0],
49
+ address: Address<TAddress>,
50
+ config?: FetchAccountConfig
51
+ ): Promise<MaybeAccount<State, TAddress>>;
52
+ export declare function fetchAllState(
53
+ rpc: Parameters<typeof fetchEncodedAccounts>[0],
54
+ addresses: Array<Address>,
55
+ config?: FetchAccountsConfig
56
+ ): Promise<Account<State>[]>;
57
+ export declare function fetchAllMaybeState(
58
+ rpc: Parameters<typeof fetchEncodedAccounts>[0],
59
+ addresses: Array<Address>,
60
+ config?: FetchAccountsConfig
61
+ ): Promise<MaybeAccount<State>[]>;
@@ -0,0 +1 @@
1
+ export declare const MAX_AUTOMATION_INDEX: 64;
@@ -0,0 +1 @@
1
+ export * from './whirlpoolsAutomationProgram';
@@ -0,0 +1,45 @@
1
+ import { Address, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, SolanaError } from '@solana/kit';
2
+
3
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__UNKNOWN_INSTRUCTION_DISCRIMINATOR = 6000;
4
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_PROGRAM_ID = 6001;
5
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__NOT_ENOUGH_ACCOUNT_KEYS = 6002;
6
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_ROLE = 6003;
7
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_OWNER = 6004;
8
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_SEEDS = 6005;
9
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_ACCOUNT_ADDRESS = 6006;
10
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_DATA = 6007;
11
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__EMIT_EVENT_ERROR = 6008;
12
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_ALREADY_INITIALIZED = 6009;
13
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_NOT_INITIALIZED = 6010;
14
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_POSITION_TOKEN_AMOUNT = 6011;
15
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION = 6012;
16
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION = 6013;
17
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_INDEX = 6014;
18
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION_DATA_LENGTH = 6015;
19
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION_DATA_LENGTH = 6016;
20
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_ACTION = 6017;
21
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ARITHMETIC_ERROR = 6018;
22
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_NEXT_VALID_EXECUTION_TIMESTAMP_CONDITION = 6019;
23
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AMOUNT_TO_FUND_AUTOMATION = 6020;
24
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__CONDITION_VIOLATION = 6021;
25
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_ACCOUNTS = 6022;
26
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_INSTRUCTION_DATA = 6023;
27
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CRANK_REWARD = 6024;
28
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__REDUNDANT_GLOBAL_CONFIG_UPDATE = 6025;
29
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_FUNDS_TO_PAY_CRANK_REWARD = 6026;
30
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_BEFORE = 6027;
31
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_AFTER = 6028;
32
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOMPANYING_INSTRUCTION = 6029;
33
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_INTERMEDIATE_SWAP = 6030;
34
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH = 6031;
35
+ export type WhirlpoolsAutomationProgramError = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_ALREADY_INITIALIZED | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_NOT_INITIALIZED | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ARITHMETIC_ERROR | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__CONDITION_VIOLATION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__EMIT_EVENT_ERROR | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_ACCOUNT_ADDRESS | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_OWNER | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_PROGRAM_ID | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_FUNDS_TO_PAY_CRANK_REWARD | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_AFTER | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_BEFORE | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOMPANYING_INSTRUCTION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_DATA | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_ROLE | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION_DATA_LENGTH | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AMOUNT_TO_FUND_AUTOMATION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_ACTION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_INDEX | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION_DATA_LENGTH | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_ACCOUNTS | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_INSTRUCTION_DATA | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CRANK_REWARD | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_INTERMEDIATE_SWAP | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_NEXT_VALID_EXECUTION_TIMESTAMP_CONDITION | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_POSITION_TOKEN_AMOUNT | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_SEEDS | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__NOT_ENOUGH_ACCOUNT_KEYS | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__REDUNDANT_GLOBAL_CONFIG_UPDATE | typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__UNKNOWN_INSTRUCTION_DISCRIMINATOR;
36
+ export declare function getWhirlpoolsAutomationProgramErrorMessage(code: WhirlpoolsAutomationProgramError): string;
37
+ export declare function isWhirlpoolsAutomationProgramError<TProgramErrorCode extends WhirlpoolsAutomationProgramError>(error: unknown, transactionMessage: {
38
+ instructions: Record<number, {
39
+ programAddress: Address;
40
+ }>;
41
+ }, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
42
+ context: Readonly<{
43
+ code: TProgramErrorCode;
44
+ }>;
45
+ }>;
@@ -0,0 +1,6 @@
1
+ export * from './accounts';
2
+ export * from './errors';
3
+ export * from './instructions';
4
+ export * from './programs';
5
+ export * from './types';
6
+ export * from './constants';
@@ -0,0 +1,80 @@
1
+ import { Address, AccountMeta, AccountSignerMeta, Codec, Decoder, Encoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
2
+ import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
+ import { Action, ActionArgs, Condition, ConditionArgs } from '../types';
4
+
5
+ export declare const CREATE_AUTOMATION_DISCRIMINATOR = 2;
6
+ export declare function getCreateAutomationDiscriminatorBytes(): ReadonlyUint8Array;
7
+ export type CreateAutomationInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountPositionOwner extends string | AccountMeta<string> = string, TAccountAutomation extends string | AccountMeta<string> = string, TAccountAutomationTokenAccountA extends string | AccountMeta<string> = string, TAccountAutomationTokenAccountB extends string | AccountMeta<string> = string, TAccountPosition extends string | AccountMeta<string> = string, TAccountPositionTokenAccount extends string | AccountMeta<string> = string, TAccountWhirlpool extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountTokenMintA extends string | AccountMeta<string> = string, TAccountTokenMintB extends string | AccountMeta<string> = string, TAccountTokenProgramA extends string | AccountMeta<string> = string, TAccountTokenProgramB extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountAtaProgram extends string | AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
8
+ TAccountPositionOwner extends string ? WritableSignerAccount<TAccountPositionOwner> & AccountSignerMeta<TAccountPositionOwner> : TAccountPositionOwner,
9
+ TAccountAutomation extends string ? WritableAccount<TAccountAutomation> : TAccountAutomation,
10
+ TAccountAutomationTokenAccountA extends string ? WritableAccount<TAccountAutomationTokenAccountA> : TAccountAutomationTokenAccountA,
11
+ TAccountAutomationTokenAccountB extends string ? WritableAccount<TAccountAutomationTokenAccountB> : TAccountAutomationTokenAccountB,
12
+ TAccountPosition extends string ? ReadonlyAccount<TAccountPosition> : TAccountPosition,
13
+ TAccountPositionTokenAccount extends string ? ReadonlyAccount<TAccountPositionTokenAccount> : TAccountPositionTokenAccount,
14
+ TAccountWhirlpool extends string ? ReadonlyAccount<TAccountWhirlpool> : TAccountWhirlpool,
15
+ TAccountGlobalConfig extends string ? ReadonlyAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
16
+ TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
17
+ TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
18
+ TAccountTokenProgramA extends string ? ReadonlyAccount<TAccountTokenProgramA> : TAccountTokenProgramA,
19
+ TAccountTokenProgramB extends string ? ReadonlyAccount<TAccountTokenProgramB> : TAccountTokenProgramB,
20
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
21
+ TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
22
+ ...TRemainingAccounts
23
+ ]>;
24
+ export type CreateAutomationInstructionData = {
25
+ discriminator: number;
26
+ action: Action;
27
+ automationIndex: number;
28
+ conditions: Array<Condition>;
29
+ };
30
+ export type CreateAutomationInstructionDataArgs = {
31
+ action: ActionArgs;
32
+ automationIndex: number;
33
+ conditions: Array<ConditionArgs>;
34
+ };
35
+ export declare function getCreateAutomationInstructionDataEncoder(): Encoder<CreateAutomationInstructionDataArgs>;
36
+ export declare function getCreateAutomationInstructionDataDecoder(): Decoder<CreateAutomationInstructionData>;
37
+ export declare function getCreateAutomationInstructionDataCodec(): Codec<CreateAutomationInstructionDataArgs, CreateAutomationInstructionData>;
38
+ export type CreateAutomationInput<TAccountPositionOwner extends string = string, TAccountAutomation extends string = string, TAccountAutomationTokenAccountA extends string = string, TAccountAutomationTokenAccountB extends string = string, TAccountPosition extends string = string, TAccountPositionTokenAccount extends string = string, TAccountWhirlpool extends string = string, TAccountGlobalConfig extends string = string, TAccountTokenMintA extends string = string, TAccountTokenMintB extends string = string, TAccountTokenProgramA extends string = string, TAccountTokenProgramB extends string = string, TAccountSystemProgram extends string = string, TAccountAtaProgram extends string = string> = {
39
+ positionOwner: TransactionSigner<TAccountPositionOwner>;
40
+ automation: Address<TAccountAutomation>;
41
+ automationTokenAccountA: Address<TAccountAutomationTokenAccountA>;
42
+ automationTokenAccountB: Address<TAccountAutomationTokenAccountB>;
43
+ position: Address<TAccountPosition>;
44
+ positionTokenAccount: Address<TAccountPositionTokenAccount>;
45
+ whirlpool: Address<TAccountWhirlpool>;
46
+ globalConfig: Address<TAccountGlobalConfig>;
47
+ tokenMintA: Address<TAccountTokenMintA>;
48
+ tokenMintB: Address<TAccountTokenMintB>;
49
+ tokenProgramA: Address<TAccountTokenProgramA>;
50
+ tokenProgramB: Address<TAccountTokenProgramB>;
51
+ systemProgram?: Address<TAccountSystemProgram>;
52
+ ataProgram?: Address<TAccountAtaProgram>;
53
+ action: CreateAutomationInstructionDataArgs['action'];
54
+ automationIndex: CreateAutomationInstructionDataArgs['automationIndex'];
55
+ conditions: CreateAutomationInstructionDataArgs['conditions'];
56
+ };
57
+ export declare function getCreateAutomationInstruction<TAccountPositionOwner extends string, TAccountAutomation extends string, TAccountAutomationTokenAccountA extends string, TAccountAutomationTokenAccountB extends string, TAccountPosition extends string, TAccountPositionTokenAccount extends string, TAccountWhirlpool extends string, TAccountGlobalConfig extends string, TAccountTokenMintA extends string, TAccountTokenMintB extends string, TAccountTokenProgramA extends string, TAccountTokenProgramB extends string, TAccountSystemProgram extends string, TAccountAtaProgram extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: CreateAutomationInput<TAccountPositionOwner, TAccountAutomation, TAccountAutomationTokenAccountA, TAccountAutomationTokenAccountB, TAccountPosition, TAccountPositionTokenAccount, TAccountWhirlpool, TAccountGlobalConfig, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountSystemProgram, TAccountAtaProgram>, config?: {
58
+ programAddress?: TProgramAddress;
59
+ }): CreateAutomationInstruction<TProgramAddress, TAccountPositionOwner, TAccountAutomation, TAccountAutomationTokenAccountA, TAccountAutomationTokenAccountB, TAccountPosition, TAccountPositionTokenAccount, TAccountWhirlpool, TAccountGlobalConfig, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountSystemProgram, TAccountAtaProgram>;
60
+ export type ParsedCreateAutomationInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
61
+ programAddress: Address<TProgram>;
62
+ accounts: {
63
+ positionOwner: TAccountMetas[0];
64
+ automation: TAccountMetas[1];
65
+ automationTokenAccountA: TAccountMetas[2];
66
+ automationTokenAccountB: TAccountMetas[3];
67
+ position: TAccountMetas[4];
68
+ positionTokenAccount: TAccountMetas[5];
69
+ whirlpool: TAccountMetas[6];
70
+ globalConfig: TAccountMetas[7];
71
+ tokenMintA: TAccountMetas[8];
72
+ tokenMintB: TAccountMetas[9];
73
+ tokenProgramA: TAccountMetas[10];
74
+ tokenProgramB: TAccountMetas[11];
75
+ systemProgram: TAccountMetas[12];
76
+ ataProgram: TAccountMetas[13];
77
+ };
78
+ data: CreateAutomationInstructionData;
79
+ };
80
+ export declare function parseCreateAutomationInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedCreateAutomationInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,41 @@
1
+ import { Address, AccountMeta, AccountSignerMeta, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
2
+ import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
+ import { FundAutomationVariant, FundAutomationVariantArgs } from '../types';
4
+
5
+ export declare const FUND_AUTOMATION_DISCRIMINATOR = 4;
6
+ export declare function getFundAutomationDiscriminatorBytes(): ReadonlyUint8Array;
7
+ export type FundAutomationInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountPayer extends string | AccountMeta<string> = string, TAccountAutomation extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
8
+ TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
9
+ TAccountAutomation extends string ? WritableAccount<TAccountAutomation> : TAccountAutomation,
10
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
11
+ ...TRemainingAccounts
12
+ ]>;
13
+ export type FundAutomationInstructionData = {
14
+ discriminator: number;
15
+ instructionData: FundAutomationVariant;
16
+ };
17
+ export type FundAutomationInstructionDataArgs = {
18
+ instructionData: FundAutomationVariantArgs;
19
+ };
20
+ export declare function getFundAutomationInstructionDataEncoder(): FixedSizeEncoder<FundAutomationInstructionDataArgs>;
21
+ export declare function getFundAutomationInstructionDataDecoder(): FixedSizeDecoder<FundAutomationInstructionData>;
22
+ export declare function getFundAutomationInstructionDataCodec(): FixedSizeCodec<FundAutomationInstructionDataArgs, FundAutomationInstructionData>;
23
+ export type FundAutomationInput<TAccountPayer extends string = string, TAccountAutomation extends string = string, TAccountSystemProgram extends string = string> = {
24
+ payer: TransactionSigner<TAccountPayer>;
25
+ automation: Address<TAccountAutomation>;
26
+ systemProgram?: Address<TAccountSystemProgram>;
27
+ instructionData: FundAutomationInstructionDataArgs['instructionData'];
28
+ };
29
+ export declare function getFundAutomationInstruction<TAccountPayer extends string, TAccountAutomation extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: FundAutomationInput<TAccountPayer, TAccountAutomation, TAccountSystemProgram>, config?: {
30
+ programAddress?: TProgramAddress;
31
+ }): FundAutomationInstruction<TProgramAddress, TAccountPayer, TAccountAutomation, TAccountSystemProgram>;
32
+ export type ParsedFundAutomationInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
33
+ programAddress: Address<TProgram>;
34
+ accounts: {
35
+ payer: TAccountMetas[0];
36
+ automation: TAccountMetas[1];
37
+ systemProgram: TAccountMetas[2];
38
+ };
39
+ data: FundAutomationInstructionData;
40
+ };
41
+ export declare function parseFundAutomationInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedFundAutomationInstruction<TProgram, TAccountMetas>;
@@ -0,0 +1,96 @@
1
+ import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
2
+ import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
+
4
+ export declare const HARVEST_AND_REINVEST_DISCRIMINATOR = 5;
5
+ export declare function getHarvestAndReinvestDiscriminatorBytes(): ReadonlyUint8Array;
6
+ export type HarvestAndReinvestInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountCrankOperator extends string | AccountMeta<string> = string, TAccountAutomation extends string | AccountMeta<string> = string, TAccountAutomationTokenAccountA extends string | AccountMeta<string> = string, TAccountAutomationTokenAccountB extends string | AccountMeta<string> = string, TAccountAutomationAuthority extends string | AccountMeta<string> = string, TAccountAutomationAuthorityTokenAccountA extends string | AccountMeta<string> = string, TAccountAutomationAuthorityTokenAccountB extends string | AccountMeta<string> = string, TAccountPositionTokenAccount extends string | AccountMeta<string> = string, TAccountPosition extends string | AccountMeta<string> = string, TAccountPositionOwner extends string | AccountMeta<string> = string, TAccountWhirlpool extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountTokenMintA extends string | AccountMeta<string> = string, TAccountTokenMintB extends string | AccountMeta<string> = string, TAccountTokenVaultA extends string | AccountMeta<string> = string, TAccountTokenVaultB extends string | AccountMeta<string> = string, TAccountTokenProgramA extends string | AccountMeta<string> = string, TAccountTokenProgramB extends string | AccountMeta<string> = string, TAccountMemoProgram extends string | AccountMeta<string> = string, TAccountTickArrayLower extends string | AccountMeta<string> = string, TAccountTickArrayUpper extends string | AccountMeta<string> = string, TAccountWhirlpoolProgram extends string | AccountMeta<string> = string, TAccountAtaProgram extends string | AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
7
+ TAccountCrankOperator extends string ? WritableSignerAccount<TAccountCrankOperator> & AccountSignerMeta<TAccountCrankOperator> : TAccountCrankOperator,
8
+ TAccountAutomation extends string ? WritableAccount<TAccountAutomation> : TAccountAutomation,
9
+ TAccountAutomationTokenAccountA extends string ? WritableAccount<TAccountAutomationTokenAccountA> : TAccountAutomationTokenAccountA,
10
+ TAccountAutomationTokenAccountB extends string ? WritableAccount<TAccountAutomationTokenAccountB> : TAccountAutomationTokenAccountB,
11
+ TAccountAutomationAuthority extends string ? ReadonlyAccount<TAccountAutomationAuthority> : TAccountAutomationAuthority,
12
+ TAccountAutomationAuthorityTokenAccountA extends string ? WritableAccount<TAccountAutomationAuthorityTokenAccountA> : TAccountAutomationAuthorityTokenAccountA,
13
+ TAccountAutomationAuthorityTokenAccountB extends string ? WritableAccount<TAccountAutomationAuthorityTokenAccountB> : TAccountAutomationAuthorityTokenAccountB,
14
+ TAccountPositionTokenAccount extends string ? ReadonlyAccount<TAccountPositionTokenAccount> : TAccountPositionTokenAccount,
15
+ TAccountPosition extends string ? WritableAccount<TAccountPosition> : TAccountPosition,
16
+ TAccountPositionOwner extends string ? ReadonlyAccount<TAccountPositionOwner> : TAccountPositionOwner,
17
+ TAccountWhirlpool extends string ? WritableAccount<TAccountWhirlpool> : TAccountWhirlpool,
18
+ TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
19
+ TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
20
+ TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
21
+ TAccountTokenVaultA extends string ? WritableAccount<TAccountTokenVaultA> : TAccountTokenVaultA,
22
+ TAccountTokenVaultB extends string ? WritableAccount<TAccountTokenVaultB> : TAccountTokenVaultB,
23
+ TAccountTokenProgramA extends string ? ReadonlyAccount<TAccountTokenProgramA> : TAccountTokenProgramA,
24
+ TAccountTokenProgramB extends string ? ReadonlyAccount<TAccountTokenProgramB> : TAccountTokenProgramB,
25
+ TAccountMemoProgram extends string ? ReadonlyAccount<TAccountMemoProgram> : TAccountMemoProgram,
26
+ TAccountTickArrayLower extends string ? WritableAccount<TAccountTickArrayLower> : TAccountTickArrayLower,
27
+ TAccountTickArrayUpper extends string ? WritableAccount<TAccountTickArrayUpper> : TAccountTickArrayUpper,
28
+ TAccountWhirlpoolProgram extends string ? ReadonlyAccount<TAccountWhirlpoolProgram> : TAccountWhirlpoolProgram,
29
+ TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
30
+ ...TRemainingAccounts
31
+ ]>;
32
+ export type HarvestAndReinvestInstructionData = {
33
+ discriminator: number;
34
+ };
35
+ export type HarvestAndReinvestInstructionDataArgs = {};
36
+ export declare function getHarvestAndReinvestInstructionDataEncoder(): FixedSizeEncoder<HarvestAndReinvestInstructionDataArgs>;
37
+ export declare function getHarvestAndReinvestInstructionDataDecoder(): FixedSizeDecoder<HarvestAndReinvestInstructionData>;
38
+ export declare function getHarvestAndReinvestInstructionDataCodec(): FixedSizeCodec<HarvestAndReinvestInstructionDataArgs, HarvestAndReinvestInstructionData>;
39
+ export type HarvestAndReinvestInput<TAccountCrankOperator extends string = string, TAccountAutomation extends string = string, TAccountAutomationTokenAccountA extends string = string, TAccountAutomationTokenAccountB extends string = string, TAccountAutomationAuthority extends string = string, TAccountAutomationAuthorityTokenAccountA extends string = string, TAccountAutomationAuthorityTokenAccountB extends string = string, TAccountPositionTokenAccount extends string = string, TAccountPosition extends string = string, TAccountPositionOwner extends string = string, TAccountWhirlpool extends string = string, TAccountSystemProgram extends string = string, TAccountTokenMintA extends string = string, TAccountTokenMintB extends string = string, TAccountTokenVaultA extends string = string, TAccountTokenVaultB extends string = string, TAccountTokenProgramA extends string = string, TAccountTokenProgramB extends string = string, TAccountMemoProgram extends string = string, TAccountTickArrayLower extends string = string, TAccountTickArrayUpper extends string = string, TAccountWhirlpoolProgram extends string = string, TAccountAtaProgram extends string = string> = {
40
+ crankOperator: TransactionSigner<TAccountCrankOperator>;
41
+ automation: Address<TAccountAutomation>;
42
+ automationTokenAccountA: Address<TAccountAutomationTokenAccountA>;
43
+ automationTokenAccountB: Address<TAccountAutomationTokenAccountB>;
44
+ automationAuthority: Address<TAccountAutomationAuthority>;
45
+ automationAuthorityTokenAccountA: Address<TAccountAutomationAuthorityTokenAccountA>;
46
+ automationAuthorityTokenAccountB: Address<TAccountAutomationAuthorityTokenAccountB>;
47
+ positionTokenAccount: Address<TAccountPositionTokenAccount>;
48
+ position: Address<TAccountPosition>;
49
+ positionOwner: Address<TAccountPositionOwner>;
50
+ whirlpool: Address<TAccountWhirlpool>;
51
+ systemProgram?: Address<TAccountSystemProgram>;
52
+ tokenMintA: Address<TAccountTokenMintA>;
53
+ tokenMintB: Address<TAccountTokenMintB>;
54
+ tokenVaultA: Address<TAccountTokenVaultA>;
55
+ tokenVaultB: Address<TAccountTokenVaultB>;
56
+ tokenProgramA: Address<TAccountTokenProgramA>;
57
+ tokenProgramB: Address<TAccountTokenProgramB>;
58
+ memoProgram: Address<TAccountMemoProgram>;
59
+ tickArrayLower: Address<TAccountTickArrayLower>;
60
+ tickArrayUpper: Address<TAccountTickArrayUpper>;
61
+ whirlpoolProgram: Address<TAccountWhirlpoolProgram>;
62
+ ataProgram?: Address<TAccountAtaProgram>;
63
+ };
64
+ export declare function getHarvestAndReinvestInstruction<TAccountCrankOperator extends string, TAccountAutomation extends string, TAccountAutomationTokenAccountA extends string, TAccountAutomationTokenAccountB extends string, TAccountAutomationAuthority extends string, TAccountAutomationAuthorityTokenAccountA extends string, TAccountAutomationAuthorityTokenAccountB extends string, TAccountPositionTokenAccount extends string, TAccountPosition extends string, TAccountPositionOwner extends string, TAccountWhirlpool extends string, TAccountSystemProgram extends string, TAccountTokenMintA extends string, TAccountTokenMintB extends string, TAccountTokenVaultA extends string, TAccountTokenVaultB extends string, TAccountTokenProgramA extends string, TAccountTokenProgramB extends string, TAccountMemoProgram extends string, TAccountTickArrayLower extends string, TAccountTickArrayUpper extends string, TAccountWhirlpoolProgram extends string, TAccountAtaProgram extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: HarvestAndReinvestInput<TAccountCrankOperator, TAccountAutomation, TAccountAutomationTokenAccountA, TAccountAutomationTokenAccountB, TAccountAutomationAuthority, TAccountAutomationAuthorityTokenAccountA, TAccountAutomationAuthorityTokenAccountB, TAccountPositionTokenAccount, TAccountPosition, TAccountPositionOwner, TAccountWhirlpool, TAccountSystemProgram, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenVaultA, TAccountTokenVaultB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountMemoProgram, TAccountTickArrayLower, TAccountTickArrayUpper, TAccountWhirlpoolProgram, TAccountAtaProgram>, config?: {
65
+ programAddress?: TProgramAddress;
66
+ }): HarvestAndReinvestInstruction<TProgramAddress, TAccountCrankOperator, TAccountAutomation, TAccountAutomationTokenAccountA, TAccountAutomationTokenAccountB, TAccountAutomationAuthority, TAccountAutomationAuthorityTokenAccountA, TAccountAutomationAuthorityTokenAccountB, TAccountPositionTokenAccount, TAccountPosition, TAccountPositionOwner, TAccountWhirlpool, TAccountSystemProgram, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenVaultA, TAccountTokenVaultB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountMemoProgram, TAccountTickArrayLower, TAccountTickArrayUpper, TAccountWhirlpoolProgram, TAccountAtaProgram>;
67
+ export type ParsedHarvestAndReinvestInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
68
+ programAddress: Address<TProgram>;
69
+ accounts: {
70
+ crankOperator: TAccountMetas[0];
71
+ automation: TAccountMetas[1];
72
+ automationTokenAccountA: TAccountMetas[2];
73
+ automationTokenAccountB: TAccountMetas[3];
74
+ automationAuthority: TAccountMetas[4];
75
+ automationAuthorityTokenAccountA: TAccountMetas[5];
76
+ automationAuthorityTokenAccountB: TAccountMetas[6];
77
+ positionTokenAccount: TAccountMetas[7];
78
+ position: TAccountMetas[8];
79
+ positionOwner: TAccountMetas[9];
80
+ whirlpool: TAccountMetas[10];
81
+ systemProgram: TAccountMetas[11];
82
+ tokenMintA: TAccountMetas[12];
83
+ tokenMintB: TAccountMetas[13];
84
+ tokenVaultA: TAccountMetas[14];
85
+ tokenVaultB: TAccountMetas[15];
86
+ tokenProgramA: TAccountMetas[16];
87
+ tokenProgramB: TAccountMetas[17];
88
+ memoProgram: TAccountMetas[18];
89
+ tickArrayLower: TAccountMetas[19];
90
+ tickArrayUpper: TAccountMetas[20];
91
+ whirlpoolProgram: TAccountMetas[21];
92
+ ataProgram: TAccountMetas[22];
93
+ };
94
+ data: HarvestAndReinvestInstructionData;
95
+ };
96
+ export declare function parseHarvestAndReinvestInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedHarvestAndReinvestInstruction<TProgram, TAccountMetas>;