@orca-so/whirlpools-automation 0.3.0 → 0.4.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 (39) hide show
  1. package/README.md +2 -1
  2. package/dist/generated/accounts/automation.d.ts +72 -35
  3. package/dist/generated/accounts/globalConfig.d.ts +52 -19
  4. package/dist/generated/errors/whirlpoolsAutomationProgram.d.ts +54 -8
  5. package/dist/generated/instructions/createAutomation.d.ts +197 -66
  6. package/dist/generated/instructions/fundAutomation.d.ts +86 -27
  7. package/dist/generated/instructions/harvestAndReinvest.d.ts +286 -85
  8. package/dist/generated/instructions/harvestSwapAndReinvestPost.d.ts +278 -82
  9. package/dist/generated/instructions/harvestSwapAndReinvestPre.d.ts +259 -78
  10. package/dist/generated/instructions/initializeGlobalConfig.d.ts +90 -30
  11. package/dist/generated/instructions/removeAutomations.d.ts +154 -45
  12. package/dist/generated/instructions/updateGlobalConfig.d.ts +79 -24
  13. package/dist/generated/programs/whirlpoolsAutomationProgram.d.ts +58 -33
  14. package/dist/generated/shared/index.d.ts +34 -10
  15. package/dist/generated/types/accountDiscriminator.d.ts +8 -5
  16. package/dist/generated/types/action.d.ts +3 -3
  17. package/dist/generated/types/condition.d.ts +63 -33
  18. package/dist/generated/types/event.d.ts +205 -137
  19. package/dist/generated/types/fundAutomationMethod.d.ts +6 -3
  20. package/dist/generated/types/fundAutomationVariant.d.ts +33 -13
  21. package/dist/generated/types/increaseLiquidityByTokenAmountsAccountsType.d.ts +15 -11
  22. package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsInfo.d.ts +10 -4
  23. package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsSlice.d.ts +12 -6
  24. package/dist/generated/types/increaseLiquidityMethod.d.ts +30 -15
  25. package/dist/generated/types/nonZeroU32.d.ts +6 -2
  26. package/dist/generated/types/position.d.ts +22 -22
  27. package/dist/generated/types/positionRewardInfo.d.ts +8 -5
  28. package/dist/generated/types/tokenAccount.d.ts +22 -22
  29. package/dist/generated/types/tokenAccountState.d.ts +7 -4
  30. package/dist/generated/types/tokenMint.d.ts +14 -14
  31. package/dist/generated/types/updateGlobalConfigVariant.d.ts +58 -20
  32. package/dist/generated/types/whirlpool.d.ts +40 -40
  33. package/dist/generated/types/whirlpoolRewardInfo.d.ts +14 -11
  34. package/dist/index.browser.js +2490 -2092
  35. package/dist/index.node.js +2497 -2102
  36. package/dist/pda.d.ts +16 -4
  37. package/dist/staging.d.ts +1 -1
  38. package/package.json +3 -3
  39. package/CHANGELOG.md +0 -13
@@ -1,90 +1,271 @@
1
- import { AccountMeta, AccountSignerMeta, Address, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
1
+ import {
2
+ AccountMeta,
3
+ AccountSignerMeta,
4
+ Address,
5
+ FixedSizeCodec,
6
+ FixedSizeDecoder,
7
+ FixedSizeEncoder,
8
+ Instruction,
9
+ InstructionWithAccounts,
10
+ InstructionWithData,
11
+ ReadonlyAccount,
12
+ ReadonlyUint8Array,
13
+ TransactionSigner,
14
+ WritableAccount,
15
+ WritableSignerAccount,
16
+ } from '@solana/kit';
2
17
  import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
18
 
4
19
  export declare const HARVEST_SWAP_AND_REINVEST_PRE_DISCRIMINATOR = 6;
5
20
  export declare function getHarvestSwapAndReinvestPreDiscriminatorBytes(): ReadonlyUint8Array;
6
- export type HarvestSwapAndReinvestPreInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountCrankOperator extends string | AccountMeta<string> = string, TAccountCrankOperatorTokenAccountA extends string | AccountMeta<string> = string, TAccountCrankOperatorTokenAccountB extends string | AccountMeta<string> = string, TAccountAutomation extends string | AccountMeta<string> = string, TAccountAutomationAuthority extends string | AccountMeta<string> = string, TAccountPositionTokenAccount extends string | AccountMeta<string> = string, TAccountPosition extends string | AccountMeta<string> = string, TAccountWhirlpool extends string | AccountMeta<string> = string, 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, TAccountInstructionsSysvar extends string | AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', 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
- TAccountCrankOperatorTokenAccountA extends string ? WritableAccount<TAccountCrankOperatorTokenAccountA> : TAccountCrankOperatorTokenAccountA,
9
- TAccountCrankOperatorTokenAccountB extends string ? WritableAccount<TAccountCrankOperatorTokenAccountB> : TAccountCrankOperatorTokenAccountB,
10
- TAccountAutomation extends string ? ReadonlyAccount<TAccountAutomation> : TAccountAutomation,
11
- TAccountAutomationAuthority extends string ? ReadonlyAccount<TAccountAutomationAuthority> : TAccountAutomationAuthority,
12
- TAccountPositionTokenAccount extends string ? ReadonlyAccount<TAccountPositionTokenAccount> : TAccountPositionTokenAccount,
13
- TAccountPosition extends string ? WritableAccount<TAccountPosition> : TAccountPosition,
14
- TAccountWhirlpool extends string ? WritableAccount<TAccountWhirlpool> : TAccountWhirlpool,
15
- TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
16
- TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
17
- TAccountTokenVaultA extends string ? WritableAccount<TAccountTokenVaultA> : TAccountTokenVaultA,
18
- TAccountTokenVaultB extends string ? WritableAccount<TAccountTokenVaultB> : TAccountTokenVaultB,
19
- TAccountTokenProgramA extends string ? ReadonlyAccount<TAccountTokenProgramA> : TAccountTokenProgramA,
20
- TAccountTokenProgramB extends string ? ReadonlyAccount<TAccountTokenProgramB> : TAccountTokenProgramB,
21
- TAccountMemoProgram extends string ? ReadonlyAccount<TAccountMemoProgram> : TAccountMemoProgram,
22
- TAccountTickArrayLower extends string ? ReadonlyAccount<TAccountTickArrayLower> : TAccountTickArrayLower,
23
- TAccountTickArrayUpper extends string ? ReadonlyAccount<TAccountTickArrayUpper> : TAccountTickArrayUpper,
24
- TAccountWhirlpoolProgram extends string ? ReadonlyAccount<TAccountWhirlpoolProgram> : TAccountWhirlpoolProgram,
25
- TAccountInstructionsSysvar extends string ? ReadonlyAccount<TAccountInstructionsSysvar> : TAccountInstructionsSysvar,
26
- TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
27
- TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
28
- ...TRemainingAccounts
29
- ]>;
21
+ export type HarvestSwapAndReinvestPreInstruction<
22
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
23
+ TAccountCrankOperator extends string | AccountMeta<string> = string,
24
+ TAccountCrankOperatorTokenAccountA extends string | AccountMeta<string> = string,
25
+ TAccountCrankOperatorTokenAccountB extends string | AccountMeta<string> = string,
26
+ TAccountAutomation extends string | AccountMeta<string> = string,
27
+ TAccountAutomationAuthority extends string | AccountMeta<string> = string,
28
+ TAccountPositionTokenAccount extends string | AccountMeta<string> = string,
29
+ TAccountPosition extends string | AccountMeta<string> = string,
30
+ TAccountWhirlpool extends string | AccountMeta<string> = string,
31
+ TAccountTokenMintA extends string | AccountMeta<string> = string,
32
+ TAccountTokenMintB extends string | AccountMeta<string> = string,
33
+ TAccountTokenVaultA extends string | AccountMeta<string> = string,
34
+ TAccountTokenVaultB extends string | AccountMeta<string> = string,
35
+ TAccountTokenProgramA extends string | AccountMeta<string> = string,
36
+ TAccountTokenProgramB extends string | AccountMeta<string> = string,
37
+ TAccountMemoProgram extends string | AccountMeta<string> = string,
38
+ TAccountTickArrayLower extends string | AccountMeta<string> = string,
39
+ TAccountTickArrayUpper extends string | AccountMeta<string> = string,
40
+ TAccountWhirlpoolProgram extends string | AccountMeta<string> = string,
41
+ TAccountInstructionsSysvar extends string | AccountMeta<string> =
42
+ 'Sysvar1nstructions1111111111111111111111111',
43
+ TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
44
+ TAccountAtaProgram extends string | AccountMeta<string> =
45
+ 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
46
+ TRemainingAccounts extends readonly AccountMeta<string>[] = [],
47
+ > = Instruction<TProgram> &
48
+ InstructionWithData<ReadonlyUint8Array> &
49
+ InstructionWithAccounts<
50
+ [
51
+ TAccountCrankOperator extends string
52
+ ? WritableSignerAccount<TAccountCrankOperator> & AccountSignerMeta<TAccountCrankOperator>
53
+ : TAccountCrankOperator,
54
+ TAccountCrankOperatorTokenAccountA extends string
55
+ ? WritableAccount<TAccountCrankOperatorTokenAccountA>
56
+ : TAccountCrankOperatorTokenAccountA,
57
+ TAccountCrankOperatorTokenAccountB extends string
58
+ ? WritableAccount<TAccountCrankOperatorTokenAccountB>
59
+ : TAccountCrankOperatorTokenAccountB,
60
+ TAccountAutomation extends string ? ReadonlyAccount<TAccountAutomation> : TAccountAutomation,
61
+ TAccountAutomationAuthority extends string
62
+ ? ReadonlyAccount<TAccountAutomationAuthority>
63
+ : TAccountAutomationAuthority,
64
+ TAccountPositionTokenAccount extends string
65
+ ? ReadonlyAccount<TAccountPositionTokenAccount>
66
+ : TAccountPositionTokenAccount,
67
+ TAccountPosition extends string ? WritableAccount<TAccountPosition> : TAccountPosition,
68
+ TAccountWhirlpool extends string ? WritableAccount<TAccountWhirlpool> : TAccountWhirlpool,
69
+ TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
70
+ TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
71
+ TAccountTokenVaultA extends string
72
+ ? WritableAccount<TAccountTokenVaultA>
73
+ : TAccountTokenVaultA,
74
+ TAccountTokenVaultB extends string
75
+ ? WritableAccount<TAccountTokenVaultB>
76
+ : TAccountTokenVaultB,
77
+ TAccountTokenProgramA extends string
78
+ ? ReadonlyAccount<TAccountTokenProgramA>
79
+ : TAccountTokenProgramA,
80
+ TAccountTokenProgramB extends string
81
+ ? ReadonlyAccount<TAccountTokenProgramB>
82
+ : TAccountTokenProgramB,
83
+ TAccountMemoProgram extends string
84
+ ? ReadonlyAccount<TAccountMemoProgram>
85
+ : TAccountMemoProgram,
86
+ TAccountTickArrayLower extends string
87
+ ? ReadonlyAccount<TAccountTickArrayLower>
88
+ : TAccountTickArrayLower,
89
+ TAccountTickArrayUpper extends string
90
+ ? ReadonlyAccount<TAccountTickArrayUpper>
91
+ : TAccountTickArrayUpper,
92
+ TAccountWhirlpoolProgram extends string
93
+ ? ReadonlyAccount<TAccountWhirlpoolProgram>
94
+ : TAccountWhirlpoolProgram,
95
+ TAccountInstructionsSysvar extends string
96
+ ? ReadonlyAccount<TAccountInstructionsSysvar>
97
+ : TAccountInstructionsSysvar,
98
+ TAccountSystemProgram extends string
99
+ ? ReadonlyAccount<TAccountSystemProgram>
100
+ : TAccountSystemProgram,
101
+ TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
102
+ ...TRemainingAccounts,
103
+ ]
104
+ >;
30
105
  export type HarvestSwapAndReinvestPreInstructionData = {
31
- discriminator: number;
106
+ discriminator: number;
32
107
  };
33
108
  export type HarvestSwapAndReinvestPreInstructionDataArgs = {};
34
109
  export declare function getHarvestSwapAndReinvestPreInstructionDataEncoder(): FixedSizeEncoder<HarvestSwapAndReinvestPreInstructionDataArgs>;
35
110
  export declare function getHarvestSwapAndReinvestPreInstructionDataDecoder(): FixedSizeDecoder<HarvestSwapAndReinvestPreInstructionData>;
36
- export declare function getHarvestSwapAndReinvestPreInstructionDataCodec(): FixedSizeCodec<HarvestSwapAndReinvestPreInstructionDataArgs, HarvestSwapAndReinvestPreInstructionData>;
37
- export type HarvestSwapAndReinvestPreInput<TAccountCrankOperator extends string = string, TAccountCrankOperatorTokenAccountA extends string = string, TAccountCrankOperatorTokenAccountB extends string = string, TAccountAutomation extends string = string, TAccountAutomationAuthority extends string = string, TAccountPositionTokenAccount extends string = string, TAccountPosition extends string = string, TAccountWhirlpool 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, TAccountInstructionsSysvar extends string = string, TAccountSystemProgram extends string = string, TAccountAtaProgram extends string = string> = {
38
- crankOperator: TransactionSigner<TAccountCrankOperator>;
39
- crankOperatorTokenAccountA: Address<TAccountCrankOperatorTokenAccountA>;
40
- crankOperatorTokenAccountB: Address<TAccountCrankOperatorTokenAccountB>;
41
- automation: Address<TAccountAutomation>;
42
- automationAuthority: Address<TAccountAutomationAuthority>;
43
- positionTokenAccount: Address<TAccountPositionTokenAccount>;
44
- position: Address<TAccountPosition>;
45
- whirlpool: Address<TAccountWhirlpool>;
46
- tokenMintA: Address<TAccountTokenMintA>;
47
- tokenMintB: Address<TAccountTokenMintB>;
48
- tokenVaultA: Address<TAccountTokenVaultA>;
49
- tokenVaultB: Address<TAccountTokenVaultB>;
50
- tokenProgramA: Address<TAccountTokenProgramA>;
51
- tokenProgramB: Address<TAccountTokenProgramB>;
52
- memoProgram: Address<TAccountMemoProgram>;
53
- tickArrayLower: Address<TAccountTickArrayLower>;
54
- tickArrayUpper: Address<TAccountTickArrayUpper>;
55
- whirlpoolProgram: Address<TAccountWhirlpoolProgram>;
56
- instructionsSysvar?: Address<TAccountInstructionsSysvar>;
57
- systemProgram?: Address<TAccountSystemProgram>;
58
- ataProgram?: Address<TAccountAtaProgram>;
111
+ export declare function getHarvestSwapAndReinvestPreInstructionDataCodec(): FixedSizeCodec<
112
+ HarvestSwapAndReinvestPreInstructionDataArgs,
113
+ HarvestSwapAndReinvestPreInstructionData
114
+ >;
115
+ export type HarvestSwapAndReinvestPreInput<
116
+ TAccountCrankOperator extends string = string,
117
+ TAccountCrankOperatorTokenAccountA extends string = string,
118
+ TAccountCrankOperatorTokenAccountB extends string = string,
119
+ TAccountAutomation extends string = string,
120
+ TAccountAutomationAuthority extends string = string,
121
+ TAccountPositionTokenAccount extends string = string,
122
+ TAccountPosition extends string = string,
123
+ TAccountWhirlpool extends string = string,
124
+ TAccountTokenMintA extends string = string,
125
+ TAccountTokenMintB extends string = string,
126
+ TAccountTokenVaultA extends string = string,
127
+ TAccountTokenVaultB extends string = string,
128
+ TAccountTokenProgramA extends string = string,
129
+ TAccountTokenProgramB extends string = string,
130
+ TAccountMemoProgram extends string = string,
131
+ TAccountTickArrayLower extends string = string,
132
+ TAccountTickArrayUpper extends string = string,
133
+ TAccountWhirlpoolProgram extends string = string,
134
+ TAccountInstructionsSysvar extends string = string,
135
+ TAccountSystemProgram extends string = string,
136
+ TAccountAtaProgram extends string = string,
137
+ > = {
138
+ crankOperator: TransactionSigner<TAccountCrankOperator>;
139
+ crankOperatorTokenAccountA: Address<TAccountCrankOperatorTokenAccountA>;
140
+ crankOperatorTokenAccountB: Address<TAccountCrankOperatorTokenAccountB>;
141
+ automation: Address<TAccountAutomation>;
142
+ automationAuthority: Address<TAccountAutomationAuthority>;
143
+ positionTokenAccount: Address<TAccountPositionTokenAccount>;
144
+ position: Address<TAccountPosition>;
145
+ whirlpool: Address<TAccountWhirlpool>;
146
+ tokenMintA: Address<TAccountTokenMintA>;
147
+ tokenMintB: Address<TAccountTokenMintB>;
148
+ tokenVaultA: Address<TAccountTokenVaultA>;
149
+ tokenVaultB: Address<TAccountTokenVaultB>;
150
+ tokenProgramA: Address<TAccountTokenProgramA>;
151
+ tokenProgramB: Address<TAccountTokenProgramB>;
152
+ memoProgram: Address<TAccountMemoProgram>;
153
+ tickArrayLower: Address<TAccountTickArrayLower>;
154
+ tickArrayUpper: Address<TAccountTickArrayUpper>;
155
+ whirlpoolProgram: Address<TAccountWhirlpoolProgram>;
156
+ instructionsSysvar?: Address<TAccountInstructionsSysvar>;
157
+ systemProgram?: Address<TAccountSystemProgram>;
158
+ ataProgram?: Address<TAccountAtaProgram>;
59
159
  };
60
- export declare function getHarvestSwapAndReinvestPreInstruction<TAccountCrankOperator extends string, TAccountCrankOperatorTokenAccountA extends string, TAccountCrankOperatorTokenAccountB extends string, TAccountAutomation extends string, TAccountAutomationAuthority extends string, TAccountPositionTokenAccount extends string, TAccountPosition extends string, TAccountWhirlpool 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, TAccountInstructionsSysvar extends string, TAccountSystemProgram extends string, TAccountAtaProgram extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: HarvestSwapAndReinvestPreInput<TAccountCrankOperator, TAccountCrankOperatorTokenAccountA, TAccountCrankOperatorTokenAccountB, TAccountAutomation, TAccountAutomationAuthority, TAccountPositionTokenAccount, TAccountPosition, TAccountWhirlpool, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenVaultA, TAccountTokenVaultB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountMemoProgram, TAccountTickArrayLower, TAccountTickArrayUpper, TAccountWhirlpoolProgram, TAccountInstructionsSysvar, TAccountSystemProgram, TAccountAtaProgram>, config?: {
160
+ export declare function getHarvestSwapAndReinvestPreInstruction<
161
+ TAccountCrankOperator extends string,
162
+ TAccountCrankOperatorTokenAccountA extends string,
163
+ TAccountCrankOperatorTokenAccountB extends string,
164
+ TAccountAutomation extends string,
165
+ TAccountAutomationAuthority extends string,
166
+ TAccountPositionTokenAccount extends string,
167
+ TAccountPosition extends string,
168
+ TAccountWhirlpool extends string,
169
+ TAccountTokenMintA extends string,
170
+ TAccountTokenMintB extends string,
171
+ TAccountTokenVaultA extends string,
172
+ TAccountTokenVaultB extends string,
173
+ TAccountTokenProgramA extends string,
174
+ TAccountTokenProgramB extends string,
175
+ TAccountMemoProgram extends string,
176
+ TAccountTickArrayLower extends string,
177
+ TAccountTickArrayUpper extends string,
178
+ TAccountWhirlpoolProgram extends string,
179
+ TAccountInstructionsSysvar extends string,
180
+ TAccountSystemProgram extends string,
181
+ TAccountAtaProgram extends string,
182
+ TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
183
+ >(
184
+ input: HarvestSwapAndReinvestPreInput<
185
+ TAccountCrankOperator,
186
+ TAccountCrankOperatorTokenAccountA,
187
+ TAccountCrankOperatorTokenAccountB,
188
+ TAccountAutomation,
189
+ TAccountAutomationAuthority,
190
+ TAccountPositionTokenAccount,
191
+ TAccountPosition,
192
+ TAccountWhirlpool,
193
+ TAccountTokenMintA,
194
+ TAccountTokenMintB,
195
+ TAccountTokenVaultA,
196
+ TAccountTokenVaultB,
197
+ TAccountTokenProgramA,
198
+ TAccountTokenProgramB,
199
+ TAccountMemoProgram,
200
+ TAccountTickArrayLower,
201
+ TAccountTickArrayUpper,
202
+ TAccountWhirlpoolProgram,
203
+ TAccountInstructionsSysvar,
204
+ TAccountSystemProgram,
205
+ TAccountAtaProgram
206
+ >,
207
+ config?: {
61
208
  programAddress?: TProgramAddress;
62
- }): HarvestSwapAndReinvestPreInstruction<TProgramAddress, TAccountCrankOperator, TAccountCrankOperatorTokenAccountA, TAccountCrankOperatorTokenAccountB, TAccountAutomation, TAccountAutomationAuthority, TAccountPositionTokenAccount, TAccountPosition, TAccountWhirlpool, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenVaultA, TAccountTokenVaultB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountMemoProgram, TAccountTickArrayLower, TAccountTickArrayUpper, TAccountWhirlpoolProgram, TAccountInstructionsSysvar, TAccountSystemProgram, TAccountAtaProgram>;
63
- export type ParsedHarvestSwapAndReinvestPreInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
64
- programAddress: Address<TProgram>;
65
- accounts: {
66
- crankOperator: TAccountMetas[0];
67
- crankOperatorTokenAccountA: TAccountMetas[1];
68
- crankOperatorTokenAccountB: TAccountMetas[2];
69
- automation: TAccountMetas[3];
70
- automationAuthority: TAccountMetas[4];
71
- positionTokenAccount: TAccountMetas[5];
72
- position: TAccountMetas[6];
73
- whirlpool: TAccountMetas[7];
74
- tokenMintA: TAccountMetas[8];
75
- tokenMintB: TAccountMetas[9];
76
- tokenVaultA: TAccountMetas[10];
77
- tokenVaultB: TAccountMetas[11];
78
- tokenProgramA: TAccountMetas[12];
79
- tokenProgramB: TAccountMetas[13];
80
- memoProgram: TAccountMetas[14];
81
- tickArrayLower: TAccountMetas[15];
82
- tickArrayUpper: TAccountMetas[16];
83
- whirlpoolProgram: TAccountMetas[17];
84
- instructionsSysvar: TAccountMetas[18];
85
- systemProgram: TAccountMetas[19];
86
- ataProgram: TAccountMetas[20];
87
- };
88
- data: HarvestSwapAndReinvestPreInstructionData;
209
+ }
210
+ ): HarvestSwapAndReinvestPreInstruction<
211
+ TProgramAddress,
212
+ TAccountCrankOperator,
213
+ TAccountCrankOperatorTokenAccountA,
214
+ TAccountCrankOperatorTokenAccountB,
215
+ TAccountAutomation,
216
+ TAccountAutomationAuthority,
217
+ TAccountPositionTokenAccount,
218
+ TAccountPosition,
219
+ TAccountWhirlpool,
220
+ TAccountTokenMintA,
221
+ TAccountTokenMintB,
222
+ TAccountTokenVaultA,
223
+ TAccountTokenVaultB,
224
+ TAccountTokenProgramA,
225
+ TAccountTokenProgramB,
226
+ TAccountMemoProgram,
227
+ TAccountTickArrayLower,
228
+ TAccountTickArrayUpper,
229
+ TAccountWhirlpoolProgram,
230
+ TAccountInstructionsSysvar,
231
+ TAccountSystemProgram,
232
+ TAccountAtaProgram
233
+ >;
234
+ export type ParsedHarvestSwapAndReinvestPreInstruction<
235
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
236
+ TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
237
+ > = {
238
+ programAddress: Address<TProgram>;
239
+ accounts: {
240
+ crankOperator: TAccountMetas[0];
241
+ crankOperatorTokenAccountA: TAccountMetas[1];
242
+ crankOperatorTokenAccountB: TAccountMetas[2];
243
+ automation: TAccountMetas[3];
244
+ automationAuthority: TAccountMetas[4];
245
+ positionTokenAccount: TAccountMetas[5];
246
+ position: TAccountMetas[6];
247
+ whirlpool: TAccountMetas[7];
248
+ tokenMintA: TAccountMetas[8];
249
+ tokenMintB: TAccountMetas[9];
250
+ tokenVaultA: TAccountMetas[10];
251
+ tokenVaultB: TAccountMetas[11];
252
+ tokenProgramA: TAccountMetas[12];
253
+ tokenProgramB: TAccountMetas[13];
254
+ memoProgram: TAccountMetas[14];
255
+ tickArrayLower: TAccountMetas[15];
256
+ tickArrayUpper: TAccountMetas[16];
257
+ whirlpoolProgram: TAccountMetas[17];
258
+ instructionsSysvar: TAccountMetas[18];
259
+ systemProgram: TAccountMetas[19];
260
+ ataProgram: TAccountMetas[20];
261
+ };
262
+ data: HarvestSwapAndReinvestPreInstructionData;
89
263
  };
90
- export declare function parseHarvestSwapAndReinvestPreInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedHarvestSwapAndReinvestPreInstruction<TProgram, TAccountMetas>;
264
+ export declare function parseHarvestSwapAndReinvestPreInstruction<
265
+ TProgram extends string,
266
+ TAccountMetas extends readonly AccountMeta[],
267
+ >(
268
+ instruction: Instruction<TProgram> &
269
+ InstructionWithAccounts<TAccountMetas> &
270
+ InstructionWithData<ReadonlyUint8Array>
271
+ ): ParsedHarvestSwapAndReinvestPreInstruction<TProgram, TAccountMetas>;
@@ -1,44 +1,104 @@
1
- import { AccountMeta, AccountSignerMeta, Codec, Decoder, Encoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlyAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount, WritableSignerAccount } from '@solana/kit';
1
+ import {
2
+ AccountMeta,
3
+ AccountSignerMeta,
4
+ Codec,
5
+ Decoder,
6
+ Encoder,
7
+ Instruction,
8
+ InstructionWithAccounts,
9
+ InstructionWithData,
10
+ ReadonlyAccount,
11
+ ReadonlyUint8Array,
12
+ TransactionSigner,
13
+ WritableAccount,
14
+ WritableSignerAccount,
15
+ } from '@solana/kit';
2
16
  import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
17
  import { Address, AddressArgs } from '../types';
4
18
 
5
19
  export declare const INITIALIZE_GLOBAL_CONFIG_DISCRIMINATOR = 0;
6
20
  export declare function getInitializeGlobalConfigDiscriminatorBytes(): ReadonlyUint8Array;
7
- export type InitializeGlobalConfigInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountDeployer extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
8
- TAccountDeployer extends string ? WritableSignerAccount<TAccountDeployer> & AccountSignerMeta<TAccountDeployer> : TAccountDeployer,
9
- TAccountGlobalConfig extends string ? WritableAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
10
- TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
11
- ...TRemainingAccounts
12
- ]>;
21
+ export type InitializeGlobalConfigInstruction<
22
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
23
+ TAccountDeployer extends string | AccountMeta<string> = string,
24
+ TAccountGlobalConfig extends string | AccountMeta<string> = string,
25
+ TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
26
+ TRemainingAccounts extends readonly AccountMeta<string>[] = [],
27
+ > = Instruction<TProgram> &
28
+ InstructionWithData<ReadonlyUint8Array> &
29
+ InstructionWithAccounts<
30
+ [
31
+ TAccountDeployer extends string
32
+ ? WritableSignerAccount<TAccountDeployer> & AccountSignerMeta<TAccountDeployer>
33
+ : TAccountDeployer,
34
+ TAccountGlobalConfig extends string
35
+ ? WritableAccount<TAccountGlobalConfig>
36
+ : TAccountGlobalConfig,
37
+ TAccountSystemProgram extends string
38
+ ? ReadonlyAccount<TAccountSystemProgram>
39
+ : TAccountSystemProgram,
40
+ ...TRemainingAccounts,
41
+ ]
42
+ >;
13
43
  export type InitializeGlobalConfigInstructionData = {
14
- discriminator: number;
15
- globalConfigAuthority: Address;
16
- crankRewardDefault: bigint;
44
+ discriminator: number;
45
+ globalConfigAuthority: Address;
46
+ crankRewardDefault: bigint;
17
47
  };
18
48
  export type InitializeGlobalConfigInstructionDataArgs = {
19
- globalConfigAuthority: AddressArgs;
20
- crankRewardDefault: number | bigint;
49
+ globalConfigAuthority: AddressArgs;
50
+ crankRewardDefault: number | bigint;
21
51
  };
22
52
  export declare function getInitializeGlobalConfigInstructionDataEncoder(): Encoder<InitializeGlobalConfigInstructionDataArgs>;
23
53
  export declare function getInitializeGlobalConfigInstructionDataDecoder(): Decoder<InitializeGlobalConfigInstructionData>;
24
- export declare function getInitializeGlobalConfigInstructionDataCodec(): Codec<InitializeGlobalConfigInstructionDataArgs, InitializeGlobalConfigInstructionData>;
25
- export type InitializeGlobalConfigInput<TAccountDeployer extends string = string, TAccountGlobalConfig extends string = string, TAccountSystemProgram extends string = string> = {
26
- deployer: TransactionSigner<TAccountDeployer>;
27
- globalConfig: Address<TAccountGlobalConfig>;
28
- systemProgram?: Address<TAccountSystemProgram>;
29
- globalConfigAuthority: InitializeGlobalConfigInstructionDataArgs['globalConfigAuthority'];
30
- crankRewardDefault: InitializeGlobalConfigInstructionDataArgs['crankRewardDefault'];
54
+ export declare function getInitializeGlobalConfigInstructionDataCodec(): Codec<
55
+ InitializeGlobalConfigInstructionDataArgs,
56
+ InitializeGlobalConfigInstructionData
57
+ >;
58
+ export type InitializeGlobalConfigInput<
59
+ TAccountDeployer extends string = string,
60
+ TAccountGlobalConfig extends string = string,
61
+ TAccountSystemProgram extends string = string,
62
+ > = {
63
+ deployer: TransactionSigner<TAccountDeployer>;
64
+ globalConfig: Address<TAccountGlobalConfig>;
65
+ systemProgram?: Address<TAccountSystemProgram>;
66
+ globalConfigAuthority: InitializeGlobalConfigInstructionDataArgs['globalConfigAuthority'];
67
+ crankRewardDefault: InitializeGlobalConfigInstructionDataArgs['crankRewardDefault'];
31
68
  };
32
- export declare function getInitializeGlobalConfigInstruction<TAccountDeployer extends string, TAccountGlobalConfig extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: InitializeGlobalConfigInput<TAccountDeployer, TAccountGlobalConfig, TAccountSystemProgram>, config?: {
69
+ export declare function getInitializeGlobalConfigInstruction<
70
+ TAccountDeployer extends string,
71
+ TAccountGlobalConfig extends string,
72
+ TAccountSystemProgram extends string,
73
+ TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
74
+ >(
75
+ input: InitializeGlobalConfigInput<TAccountDeployer, TAccountGlobalConfig, TAccountSystemProgram>,
76
+ config?: {
33
77
  programAddress?: TProgramAddress;
34
- }): InitializeGlobalConfigInstruction<TProgramAddress, TAccountDeployer, TAccountGlobalConfig, TAccountSystemProgram>;
35
- export type ParsedInitializeGlobalConfigInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
36
- programAddress: Address<TProgram>;
37
- accounts: {
38
- deployer: TAccountMetas[0];
39
- globalConfig: TAccountMetas[1];
40
- systemProgram: TAccountMetas[2];
41
- };
42
- data: InitializeGlobalConfigInstructionData;
78
+ }
79
+ ): InitializeGlobalConfigInstruction<
80
+ TProgramAddress,
81
+ TAccountDeployer,
82
+ TAccountGlobalConfig,
83
+ TAccountSystemProgram
84
+ >;
85
+ export type ParsedInitializeGlobalConfigInstruction<
86
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
87
+ TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
88
+ > = {
89
+ programAddress: Address<TProgram>;
90
+ accounts: {
91
+ deployer: TAccountMetas[0];
92
+ globalConfig: TAccountMetas[1];
93
+ systemProgram: TAccountMetas[2];
94
+ };
95
+ data: InitializeGlobalConfigInstructionData;
43
96
  };
44
- export declare function parseInitializeGlobalConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedInitializeGlobalConfigInstruction<TProgram, TAccountMetas>;
97
+ export declare function parseInitializeGlobalConfigInstruction<
98
+ TProgram extends string,
99
+ TAccountMetas extends readonly AccountMeta[],
100
+ >(
101
+ instruction: Instruction<TProgram> &
102
+ InstructionWithAccounts<TAccountMetas> &
103
+ InstructionWithData<ReadonlyUint8Array>
104
+ ): ParsedInitializeGlobalConfigInstruction<TProgram, TAccountMetas>;