@orca-so/whirlpools-automation 0.2.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 +2980 -2310
  35. package/dist/index.node.js +2969 -2302
  36. package/dist/pda.d.ts +17 -2
  37. package/dist/staging.d.ts +1 -1
  38. package/package.json +4 -3
  39. package/CHANGELOG.md +0 -7
@@ -1,57 +1,166 @@
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 REMOVE_AUTOMATIONS_DISCRIMINATOR = 3;
5
20
  export declare function getRemoveAutomationsDiscriminatorBytes(): ReadonlyUint8Array;
6
- export type RemoveAutomationsInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountPositionOwner extends string | AccountMeta<string> = string, TAccountPositionOwnerTokenAccountA extends string | AccountMeta<string> = string, TAccountPositionOwnerTokenAccountB extends string | AccountMeta<string> = string, TAccountPositionTokenAccount 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<[
7
- TAccountPositionOwner extends string ? WritableSignerAccount<TAccountPositionOwner> & AccountSignerMeta<TAccountPositionOwner> : TAccountPositionOwner,
8
- TAccountPositionOwnerTokenAccountA extends string ? WritableAccount<TAccountPositionOwnerTokenAccountA> : TAccountPositionOwnerTokenAccountA,
9
- TAccountPositionOwnerTokenAccountB extends string ? WritableAccount<TAccountPositionOwnerTokenAccountB> : TAccountPositionOwnerTokenAccountB,
10
- TAccountPositionTokenAccount extends string ? ReadonlyAccount<TAccountPositionTokenAccount> : TAccountPositionTokenAccount,
11
- TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
12
- TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
13
- TAccountTokenProgramA extends string ? ReadonlyAccount<TAccountTokenProgramA> : TAccountTokenProgramA,
14
- TAccountTokenProgramB extends string ? ReadonlyAccount<TAccountTokenProgramB> : TAccountTokenProgramB,
15
- TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
16
- TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
17
- ...TRemainingAccounts
18
- ]>;
21
+ export type RemoveAutomationsInstruction<
22
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
23
+ TAccountPositionOwner extends string | AccountMeta<string> = string,
24
+ TAccountPositionOwnerTokenAccountA extends string | AccountMeta<string> = string,
25
+ TAccountPositionOwnerTokenAccountB extends string | AccountMeta<string> = string,
26
+ TAccountPositionTokenAccount extends string | AccountMeta<string> = string,
27
+ TAccountTokenMintA extends string | AccountMeta<string> = string,
28
+ TAccountTokenMintB extends string | AccountMeta<string> = string,
29
+ TAccountTokenProgramA extends string | AccountMeta<string> = string,
30
+ TAccountTokenProgramB extends string | AccountMeta<string> = string,
31
+ TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
32
+ TAccountAtaProgram extends string | AccountMeta<string> =
33
+ 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
34
+ TRemainingAccounts extends readonly AccountMeta<string>[] = [],
35
+ > = Instruction<TProgram> &
36
+ InstructionWithData<ReadonlyUint8Array> &
37
+ InstructionWithAccounts<
38
+ [
39
+ TAccountPositionOwner extends string
40
+ ? WritableSignerAccount<TAccountPositionOwner> & AccountSignerMeta<TAccountPositionOwner>
41
+ : TAccountPositionOwner,
42
+ TAccountPositionOwnerTokenAccountA extends string
43
+ ? WritableAccount<TAccountPositionOwnerTokenAccountA>
44
+ : TAccountPositionOwnerTokenAccountA,
45
+ TAccountPositionOwnerTokenAccountB extends string
46
+ ? WritableAccount<TAccountPositionOwnerTokenAccountB>
47
+ : TAccountPositionOwnerTokenAccountB,
48
+ TAccountPositionTokenAccount extends string
49
+ ? ReadonlyAccount<TAccountPositionTokenAccount>
50
+ : TAccountPositionTokenAccount,
51
+ TAccountTokenMintA extends string ? WritableAccount<TAccountTokenMintA> : TAccountTokenMintA,
52
+ TAccountTokenMintB extends string ? WritableAccount<TAccountTokenMintB> : TAccountTokenMintB,
53
+ TAccountTokenProgramA extends string
54
+ ? ReadonlyAccount<TAccountTokenProgramA>
55
+ : TAccountTokenProgramA,
56
+ TAccountTokenProgramB extends string
57
+ ? ReadonlyAccount<TAccountTokenProgramB>
58
+ : TAccountTokenProgramB,
59
+ TAccountSystemProgram extends string
60
+ ? ReadonlyAccount<TAccountSystemProgram>
61
+ : TAccountSystemProgram,
62
+ TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
63
+ ...TRemainingAccounts,
64
+ ]
65
+ >;
19
66
  export type RemoveAutomationsInstructionData = {
20
- discriminator: number;
67
+ discriminator: number;
21
68
  };
22
69
  export type RemoveAutomationsInstructionDataArgs = {};
23
70
  export declare function getRemoveAutomationsInstructionDataEncoder(): FixedSizeEncoder<RemoveAutomationsInstructionDataArgs>;
24
71
  export declare function getRemoveAutomationsInstructionDataDecoder(): FixedSizeDecoder<RemoveAutomationsInstructionData>;
25
- export declare function getRemoveAutomationsInstructionDataCodec(): FixedSizeCodec<RemoveAutomationsInstructionDataArgs, RemoveAutomationsInstructionData>;
26
- export type RemoveAutomationsInput<TAccountPositionOwner extends string = string, TAccountPositionOwnerTokenAccountA extends string = string, TAccountPositionOwnerTokenAccountB extends string = string, TAccountPositionTokenAccount 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> = {
27
- positionOwner: TransactionSigner<TAccountPositionOwner>;
28
- positionOwnerTokenAccountA: Address<TAccountPositionOwnerTokenAccountA>;
29
- positionOwnerTokenAccountB: Address<TAccountPositionOwnerTokenAccountB>;
30
- positionTokenAccount: Address<TAccountPositionTokenAccount>;
31
- tokenMintA: Address<TAccountTokenMintA>;
32
- tokenMintB: Address<TAccountTokenMintB>;
33
- tokenProgramA: Address<TAccountTokenProgramA>;
34
- tokenProgramB: Address<TAccountTokenProgramB>;
35
- systemProgram?: Address<TAccountSystemProgram>;
36
- ataProgram?: Address<TAccountAtaProgram>;
72
+ export declare function getRemoveAutomationsInstructionDataCodec(): FixedSizeCodec<
73
+ RemoveAutomationsInstructionDataArgs,
74
+ RemoveAutomationsInstructionData
75
+ >;
76
+ export type RemoveAutomationsInput<
77
+ TAccountPositionOwner extends string = string,
78
+ TAccountPositionOwnerTokenAccountA extends string = string,
79
+ TAccountPositionOwnerTokenAccountB extends string = string,
80
+ TAccountPositionTokenAccount extends string = string,
81
+ TAccountTokenMintA extends string = string,
82
+ TAccountTokenMintB extends string = string,
83
+ TAccountTokenProgramA extends string = string,
84
+ TAccountTokenProgramB extends string = string,
85
+ TAccountSystemProgram extends string = string,
86
+ TAccountAtaProgram extends string = string,
87
+ > = {
88
+ positionOwner: TransactionSigner<TAccountPositionOwner>;
89
+ positionOwnerTokenAccountA: Address<TAccountPositionOwnerTokenAccountA>;
90
+ positionOwnerTokenAccountB: Address<TAccountPositionOwnerTokenAccountB>;
91
+ positionTokenAccount: Address<TAccountPositionTokenAccount>;
92
+ tokenMintA: Address<TAccountTokenMintA>;
93
+ tokenMintB: Address<TAccountTokenMintB>;
94
+ tokenProgramA: Address<TAccountTokenProgramA>;
95
+ tokenProgramB: Address<TAccountTokenProgramB>;
96
+ systemProgram?: Address<TAccountSystemProgram>;
97
+ ataProgram?: Address<TAccountAtaProgram>;
37
98
  };
38
- export declare function getRemoveAutomationsInstruction<TAccountPositionOwner extends string, TAccountPositionOwnerTokenAccountA extends string, TAccountPositionOwnerTokenAccountB extends string, TAccountPositionTokenAccount 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: RemoveAutomationsInput<TAccountPositionOwner, TAccountPositionOwnerTokenAccountA, TAccountPositionOwnerTokenAccountB, TAccountPositionTokenAccount, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountSystemProgram, TAccountAtaProgram>, config?: {
99
+ export declare function getRemoveAutomationsInstruction<
100
+ TAccountPositionOwner extends string,
101
+ TAccountPositionOwnerTokenAccountA extends string,
102
+ TAccountPositionOwnerTokenAccountB extends string,
103
+ TAccountPositionTokenAccount extends string,
104
+ TAccountTokenMintA extends string,
105
+ TAccountTokenMintB extends string,
106
+ TAccountTokenProgramA extends string,
107
+ TAccountTokenProgramB extends string,
108
+ TAccountSystemProgram extends string,
109
+ TAccountAtaProgram extends string,
110
+ TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
111
+ >(
112
+ input: RemoveAutomationsInput<
113
+ TAccountPositionOwner,
114
+ TAccountPositionOwnerTokenAccountA,
115
+ TAccountPositionOwnerTokenAccountB,
116
+ TAccountPositionTokenAccount,
117
+ TAccountTokenMintA,
118
+ TAccountTokenMintB,
119
+ TAccountTokenProgramA,
120
+ TAccountTokenProgramB,
121
+ TAccountSystemProgram,
122
+ TAccountAtaProgram
123
+ >,
124
+ config?: {
39
125
  programAddress?: TProgramAddress;
40
- }): RemoveAutomationsInstruction<TProgramAddress, TAccountPositionOwner, TAccountPositionOwnerTokenAccountA, TAccountPositionOwnerTokenAccountB, TAccountPositionTokenAccount, TAccountTokenMintA, TAccountTokenMintB, TAccountTokenProgramA, TAccountTokenProgramB, TAccountSystemProgram, TAccountAtaProgram>;
41
- export type ParsedRemoveAutomationsInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
42
- programAddress: Address<TProgram>;
43
- accounts: {
44
- positionOwner: TAccountMetas[0];
45
- positionOwnerTokenAccountA: TAccountMetas[1];
46
- positionOwnerTokenAccountB: TAccountMetas[2];
47
- positionTokenAccount: TAccountMetas[3];
48
- tokenMintA: TAccountMetas[4];
49
- tokenMintB: TAccountMetas[5];
50
- tokenProgramA: TAccountMetas[6];
51
- tokenProgramB: TAccountMetas[7];
52
- systemProgram: TAccountMetas[8];
53
- ataProgram: TAccountMetas[9];
54
- };
55
- data: RemoveAutomationsInstructionData;
126
+ }
127
+ ): RemoveAutomationsInstruction<
128
+ TProgramAddress,
129
+ TAccountPositionOwner,
130
+ TAccountPositionOwnerTokenAccountA,
131
+ TAccountPositionOwnerTokenAccountB,
132
+ TAccountPositionTokenAccount,
133
+ TAccountTokenMintA,
134
+ TAccountTokenMintB,
135
+ TAccountTokenProgramA,
136
+ TAccountTokenProgramB,
137
+ TAccountSystemProgram,
138
+ TAccountAtaProgram
139
+ >;
140
+ export type ParsedRemoveAutomationsInstruction<
141
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
142
+ TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
143
+ > = {
144
+ programAddress: Address<TProgram>;
145
+ accounts: {
146
+ positionOwner: TAccountMetas[0];
147
+ positionOwnerTokenAccountA: TAccountMetas[1];
148
+ positionOwnerTokenAccountB: TAccountMetas[2];
149
+ positionTokenAccount: TAccountMetas[3];
150
+ tokenMintA: TAccountMetas[4];
151
+ tokenMintB: TAccountMetas[5];
152
+ tokenProgramA: TAccountMetas[6];
153
+ tokenProgramB: TAccountMetas[7];
154
+ systemProgram: TAccountMetas[8];
155
+ ataProgram: TAccountMetas[9];
156
+ };
157
+ data: RemoveAutomationsInstructionData;
56
158
  };
57
- export declare function parseRemoveAutomationsInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedRemoveAutomationsInstruction<TProgram, TAccountMetas>;
159
+ export declare function parseRemoveAutomationsInstruction<
160
+ TProgram extends string,
161
+ TAccountMetas extends readonly AccountMeta[],
162
+ >(
163
+ instruction: Instruction<TProgram> &
164
+ InstructionWithAccounts<TAccountMetas> &
165
+ InstructionWithData<ReadonlyUint8Array>
166
+ ): ParsedRemoveAutomationsInstruction<TProgram, TAccountMetas>;
@@ -1,38 +1,93 @@
1
- import { Address, AccountMeta, AccountSignerMeta, Codec, Decoder, Encoder, Instruction, InstructionWithAccounts, InstructionWithData, ReadonlySignerAccount, ReadonlyUint8Array, TransactionSigner, WritableAccount } from '@solana/kit';
1
+ import {
2
+ Address,
3
+ AccountMeta,
4
+ AccountSignerMeta,
5
+ Codec,
6
+ Decoder,
7
+ Encoder,
8
+ Instruction,
9
+ InstructionWithAccounts,
10
+ InstructionWithData,
11
+ ReadonlySignerAccount,
12
+ ReadonlyUint8Array,
13
+ TransactionSigner,
14
+ WritableAccount,
15
+ } from '@solana/kit';
2
16
  import { WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS } from '../programs';
3
17
  import { UpdateGlobalConfigVariant, UpdateGlobalConfigVariantArgs } from '../types';
4
18
 
5
19
  export declare const UPDATE_GLOBAL_CONFIG_DISCRIMINATOR = 1;
6
20
  export declare function getUpdateGlobalConfigDiscriminatorBytes(): ReadonlyUint8Array;
7
- export type UpdateGlobalConfigInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountGlobalConfigAuthority extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
8
- TAccountGlobalConfigAuthority extends string ? ReadonlySignerAccount<TAccountGlobalConfigAuthority> & AccountSignerMeta<TAccountGlobalConfigAuthority> : TAccountGlobalConfigAuthority,
9
- TAccountGlobalConfig extends string ? WritableAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
10
- ...TRemainingAccounts
11
- ]>;
21
+ export type UpdateGlobalConfigInstruction<
22
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
23
+ TAccountGlobalConfigAuthority extends string | AccountMeta<string> = string,
24
+ TAccountGlobalConfig extends string | AccountMeta<string> = string,
25
+ TRemainingAccounts extends readonly AccountMeta<string>[] = [],
26
+ > = Instruction<TProgram> &
27
+ InstructionWithData<ReadonlyUint8Array> &
28
+ InstructionWithAccounts<
29
+ [
30
+ TAccountGlobalConfigAuthority extends string
31
+ ? ReadonlySignerAccount<TAccountGlobalConfigAuthority> &
32
+ AccountSignerMeta<TAccountGlobalConfigAuthority>
33
+ : TAccountGlobalConfigAuthority,
34
+ TAccountGlobalConfig extends string
35
+ ? WritableAccount<TAccountGlobalConfig>
36
+ : TAccountGlobalConfig,
37
+ ...TRemainingAccounts,
38
+ ]
39
+ >;
12
40
  export type UpdateGlobalConfigInstructionData = {
13
- discriminator: number;
14
- instructionData: UpdateGlobalConfigVariant;
41
+ discriminator: number;
42
+ instructionData: UpdateGlobalConfigVariant;
15
43
  };
16
44
  export type UpdateGlobalConfigInstructionDataArgs = {
17
- instructionData: UpdateGlobalConfigVariantArgs;
45
+ instructionData: UpdateGlobalConfigVariantArgs;
18
46
  };
19
47
  export declare function getUpdateGlobalConfigInstructionDataEncoder(): Encoder<UpdateGlobalConfigInstructionDataArgs>;
20
48
  export declare function getUpdateGlobalConfigInstructionDataDecoder(): Decoder<UpdateGlobalConfigInstructionData>;
21
- export declare function getUpdateGlobalConfigInstructionDataCodec(): Codec<UpdateGlobalConfigInstructionDataArgs, UpdateGlobalConfigInstructionData>;
22
- export type UpdateGlobalConfigInput<TAccountGlobalConfigAuthority extends string = string, TAccountGlobalConfig extends string = string> = {
23
- globalConfigAuthority: TransactionSigner<TAccountGlobalConfigAuthority>;
24
- globalConfig: Address<TAccountGlobalConfig>;
25
- instructionData: UpdateGlobalConfigInstructionDataArgs['instructionData'];
49
+ export declare function getUpdateGlobalConfigInstructionDataCodec(): Codec<
50
+ UpdateGlobalConfigInstructionDataArgs,
51
+ UpdateGlobalConfigInstructionData
52
+ >;
53
+ export type UpdateGlobalConfigInput<
54
+ TAccountGlobalConfigAuthority extends string = string,
55
+ TAccountGlobalConfig extends string = string,
56
+ > = {
57
+ globalConfigAuthority: TransactionSigner<TAccountGlobalConfigAuthority>;
58
+ globalConfig: Address<TAccountGlobalConfig>;
59
+ instructionData: UpdateGlobalConfigInstructionDataArgs['instructionData'];
26
60
  };
27
- export declare function getUpdateGlobalConfigInstruction<TAccountGlobalConfigAuthority extends string, TAccountGlobalConfig extends string, TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS>(input: UpdateGlobalConfigInput<TAccountGlobalConfigAuthority, TAccountGlobalConfig>, config?: {
61
+ export declare function getUpdateGlobalConfigInstruction<
62
+ TAccountGlobalConfigAuthority extends string,
63
+ TAccountGlobalConfig extends string,
64
+ TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
65
+ >(
66
+ input: UpdateGlobalConfigInput<TAccountGlobalConfigAuthority, TAccountGlobalConfig>,
67
+ config?: {
28
68
  programAddress?: TProgramAddress;
29
- }): UpdateGlobalConfigInstruction<TProgramAddress, TAccountGlobalConfigAuthority, TAccountGlobalConfig>;
30
- export type ParsedUpdateGlobalConfigInstruction<TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
31
- programAddress: Address<TProgram>;
32
- accounts: {
33
- globalConfigAuthority: TAccountMetas[0];
34
- globalConfig: TAccountMetas[1];
35
- };
36
- data: UpdateGlobalConfigInstructionData;
69
+ }
70
+ ): UpdateGlobalConfigInstruction<
71
+ TProgramAddress,
72
+ TAccountGlobalConfigAuthority,
73
+ TAccountGlobalConfig
74
+ >;
75
+ export type ParsedUpdateGlobalConfigInstruction<
76
+ TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
77
+ TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
78
+ > = {
79
+ programAddress: Address<TProgram>;
80
+ accounts: {
81
+ globalConfigAuthority: TAccountMetas[0];
82
+ globalConfig: TAccountMetas[1];
83
+ };
84
+ data: UpdateGlobalConfigInstructionData;
37
85
  };
38
- export declare function parseUpdateGlobalConfigInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedUpdateGlobalConfigInstruction<TProgram, TAccountMetas>;
86
+ export declare function parseUpdateGlobalConfigInstruction<
87
+ TProgram extends string,
88
+ TAccountMetas extends readonly AccountMeta[],
89
+ >(
90
+ instruction: Instruction<TProgram> &
91
+ InstructionWithAccounts<TAccountMetas> &
92
+ InstructionWithData<ReadonlyUint8Array>
93
+ ): ParsedUpdateGlobalConfigInstruction<TProgram, TAccountMetas>;
@@ -1,39 +1,64 @@
1
1
  import { Address, Instruction, InstructionWithData, ReadonlyUint8Array } from '@solana/kit';
2
- import { ParsedCreateAutomationInstruction, ParsedFundAutomationInstruction, ParsedHarvestAndReinvestInstruction, ParsedHarvestSwapAndReinvestPostInstruction, ParsedHarvestSwapAndReinvestPreInstruction, ParsedInitializeGlobalConfigInstruction, ParsedRemoveAutomationsInstruction, ParsedUpdateGlobalConfigInstruction } from '../instructions';
2
+ import {
3
+ ParsedCreateAutomationInstruction,
4
+ ParsedFundAutomationInstruction,
5
+ ParsedHarvestAndReinvestInstruction,
6
+ ParsedHarvestSwapAndReinvestPostInstruction,
7
+ ParsedHarvestSwapAndReinvestPreInstruction,
8
+ ParsedInitializeGlobalConfigInstruction,
9
+ ParsedRemoveAutomationsInstruction,
10
+ ParsedUpdateGlobalConfigInstruction,
11
+ } from '../instructions';
3
12
 
4
- export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS: Address<"wpAutoU2kNC95CB9SzvSRmhC52ncPabVY225e3pfQA8">;
13
+ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS: Address<'wpAutoU2kNC95CB9SzvSRmhC52ncPabVY225e3pfQA8'>;
5
14
  export declare enum WhirlpoolsAutomationProgramAccount {
6
- Automation = 0,
7
- GlobalConfig = 1
15
+ Automation = 0,
16
+ GlobalConfig = 1,
8
17
  }
9
18
  export declare enum WhirlpoolsAutomationProgramInstruction {
10
- InitializeGlobalConfig = 0,
11
- UpdateGlobalConfig = 1,
12
- CreateAutomation = 2,
13
- RemoveAutomations = 3,
14
- FundAutomation = 4,
15
- HarvestAndReinvest = 5,
16
- HarvestSwapAndReinvestPre = 6,
17
- HarvestSwapAndReinvestPost = 7
19
+ InitializeGlobalConfig = 0,
20
+ UpdateGlobalConfig = 1,
21
+ CreateAutomation = 2,
22
+ RemoveAutomations = 3,
23
+ FundAutomation = 4,
24
+ HarvestAndReinvest = 5,
25
+ HarvestSwapAndReinvestPre = 6,
26
+ HarvestSwapAndReinvestPost = 7,
18
27
  }
19
- export declare function identifyWhirlpoolsAutomationProgramInstruction(instruction: {
20
- data: ReadonlyUint8Array;
21
- } | ReadonlyUint8Array): WhirlpoolsAutomationProgramInstruction;
22
- export type ParsedWhirlpoolsAutomationProgramInstruction<TProgram extends string = 'wpAutoU2kNC95CB9SzvSRmhC52ncPabVY225e3pfQA8'> = ({
23
- instructionType: WhirlpoolsAutomationProgramInstruction.InitializeGlobalConfig;
24
- } & ParsedInitializeGlobalConfigInstruction<TProgram>) | ({
25
- instructionType: WhirlpoolsAutomationProgramInstruction.UpdateGlobalConfig;
26
- } & ParsedUpdateGlobalConfigInstruction<TProgram>) | ({
27
- instructionType: WhirlpoolsAutomationProgramInstruction.CreateAutomation;
28
- } & ParsedCreateAutomationInstruction<TProgram>) | ({
29
- instructionType: WhirlpoolsAutomationProgramInstruction.RemoveAutomations;
30
- } & ParsedRemoveAutomationsInstruction<TProgram>) | ({
31
- instructionType: WhirlpoolsAutomationProgramInstruction.FundAutomation;
32
- } & ParsedFundAutomationInstruction<TProgram>) | ({
33
- instructionType: WhirlpoolsAutomationProgramInstruction.HarvestAndReinvest;
34
- } & ParsedHarvestAndReinvestInstruction<TProgram>) | ({
35
- instructionType: WhirlpoolsAutomationProgramInstruction.HarvestSwapAndReinvestPre;
36
- } & ParsedHarvestSwapAndReinvestPreInstruction<TProgram>) | ({
37
- instructionType: WhirlpoolsAutomationProgramInstruction.HarvestSwapAndReinvestPost;
38
- } & ParsedHarvestSwapAndReinvestPostInstruction<TProgram>);
39
- export declare function parseWhirlpoolsAutomationProgramInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedWhirlpoolsAutomationProgramInstruction<TProgram>;
28
+ export declare function identifyWhirlpoolsAutomationProgramInstruction(
29
+ instruction:
30
+ | {
31
+ data: ReadonlyUint8Array;
32
+ }
33
+ | ReadonlyUint8Array
34
+ ): WhirlpoolsAutomationProgramInstruction;
35
+ export type ParsedWhirlpoolsAutomationProgramInstruction<
36
+ TProgram extends string = 'wpAutoU2kNC95CB9SzvSRmhC52ncPabVY225e3pfQA8',
37
+ > =
38
+ | ({
39
+ instructionType: WhirlpoolsAutomationProgramInstruction.InitializeGlobalConfig;
40
+ } & ParsedInitializeGlobalConfigInstruction<TProgram>)
41
+ | ({
42
+ instructionType: WhirlpoolsAutomationProgramInstruction.UpdateGlobalConfig;
43
+ } & ParsedUpdateGlobalConfigInstruction<TProgram>)
44
+ | ({
45
+ instructionType: WhirlpoolsAutomationProgramInstruction.CreateAutomation;
46
+ } & ParsedCreateAutomationInstruction<TProgram>)
47
+ | ({
48
+ instructionType: WhirlpoolsAutomationProgramInstruction.RemoveAutomations;
49
+ } & ParsedRemoveAutomationsInstruction<TProgram>)
50
+ | ({
51
+ instructionType: WhirlpoolsAutomationProgramInstruction.FundAutomation;
52
+ } & ParsedFundAutomationInstruction<TProgram>)
53
+ | ({
54
+ instructionType: WhirlpoolsAutomationProgramInstruction.HarvestAndReinvest;
55
+ } & ParsedHarvestAndReinvestInstruction<TProgram>)
56
+ | ({
57
+ instructionType: WhirlpoolsAutomationProgramInstruction.HarvestSwapAndReinvestPre;
58
+ } & ParsedHarvestSwapAndReinvestPreInstruction<TProgram>)
59
+ | ({
60
+ instructionType: WhirlpoolsAutomationProgramInstruction.HarvestSwapAndReinvestPost;
61
+ } & ParsedHarvestSwapAndReinvestPostInstruction<TProgram>);
62
+ export declare function parseWhirlpoolsAutomationProgramInstruction<TProgram extends string>(
63
+ instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>
64
+ ): ParsedWhirlpoolsAutomationProgramInstruction<TProgram>;
@@ -1,15 +1,39 @@
1
- import { AccountMeta, AccountSignerMeta, Address, ProgramDerivedAddress, TransactionSigner } from '@solana/kit';
1
+ import {
2
+ AccountMeta,
3
+ AccountSignerMeta,
4
+ Address,
5
+ ProgramDerivedAddress,
6
+ TransactionSigner,
7
+ } from '@solana/kit';
2
8
 
3
9
  export declare function expectSome<T>(value: T | null | undefined): T;
4
- export declare function expectAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): Address<T>;
5
- export declare function expectProgramDerivedAddress<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): ProgramDerivedAddress<T>;
6
- export declare function expectTransactionSigner<T extends string = string>(value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined): TransactionSigner<T>;
7
- export type ResolvedAccount<T extends string = string, U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null = Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null> = {
8
- isWritable: boolean;
9
- value: U;
10
+ export declare function expectAddress<T extends string = string>(
11
+ value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined
12
+ ): Address<T>;
13
+ export declare function expectProgramDerivedAddress<T extends string = string>(
14
+ value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined
15
+ ): ProgramDerivedAddress<T>;
16
+ export declare function expectTransactionSigner<T extends string = string>(
17
+ value: Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null | undefined
18
+ ): TransactionSigner<T>;
19
+ export type ResolvedAccount<
20
+ T extends string = string,
21
+ U extends Address<T> | ProgramDerivedAddress<T> | TransactionSigner<T> | null =
22
+ | Address<T>
23
+ | ProgramDerivedAddress<T>
24
+ | TransactionSigner<T>
25
+ | null,
26
+ > = {
27
+ isWritable: boolean;
28
+ value: U;
10
29
  };
11
30
  export type InstructionWithByteDelta = {
12
- byteDelta: number;
31
+ byteDelta: number;
13
32
  };
14
- export declare function getAccountMetaFactory(programAddress: Address, optionalAccountStrategy: 'omitted' | 'programId'): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
15
- export declare function isTransactionSigner<TAddress extends string = string>(value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>): value is TransactionSigner<TAddress>;
33
+ export declare function getAccountMetaFactory(
34
+ programAddress: Address,
35
+ optionalAccountStrategy: 'omitted' | 'programId'
36
+ ): (account: ResolvedAccount) => AccountMeta | AccountSignerMeta | undefined;
37
+ export declare function isTransactionSigner<TAddress extends string = string>(
38
+ value: Address<TAddress> | ProgramDerivedAddress<TAddress> | TransactionSigner<TAddress>
39
+ ): value is TransactionSigner<TAddress>;
@@ -1,12 +1,15 @@
1
1
  import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/kit';
2
2
 
3
3
  export declare enum AccountDiscriminator {
4
- Uninitialized = 0,
5
- Closed = 1,
6
- GlobalConfig = 2,
7
- Automation = 3
4
+ Uninitialized = 0,
5
+ Closed = 1,
6
+ GlobalConfig = 2,
7
+ Automation = 3,
8
8
  }
9
9
  export type AccountDiscriminatorArgs = AccountDiscriminator;
10
10
  export declare function getAccountDiscriminatorEncoder(): FixedSizeEncoder<AccountDiscriminatorArgs>;
11
11
  export declare function getAccountDiscriminatorDecoder(): FixedSizeDecoder<AccountDiscriminator>;
12
- export declare function getAccountDiscriminatorCodec(): FixedSizeCodec<AccountDiscriminatorArgs, AccountDiscriminator>;
12
+ export declare function getAccountDiscriminatorCodec(): FixedSizeCodec<
13
+ AccountDiscriminatorArgs,
14
+ AccountDiscriminator
15
+ >;
@@ -1,9 +1,9 @@
1
1
  import { FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder } from '@solana/kit';
2
2
 
3
3
  export declare enum Action {
4
- Uninitialized = 0,
5
- HarvestAndReinvest = 1,
6
- HarvestSwapAndReinvest = 2
4
+ Uninitialized = 0,
5
+ HarvestAndReinvest = 1,
6
+ HarvestSwapAndReinvest = 2,
7
7
  }
8
8
  export type ActionArgs = Action;
9
9
  export declare function getActionEncoder(): FixedSizeEncoder<ActionArgs>;
@@ -1,39 +1,69 @@
1
- import { Codec, Decoder, Encoder, GetDiscriminatedUnionVariant, GetDiscriminatedUnionVariantContent, Option, OptionOrNullable } from '@solana/kit';
1
+ import {
2
+ Codec,
3
+ Decoder,
4
+ Encoder,
5
+ GetDiscriminatedUnionVariant,
6
+ GetDiscriminatedUnionVariantContent,
7
+ Option,
8
+ OptionOrNullable,
9
+ } from '@solana/kit';
2
10
  import { NonZeroU32, NonZeroU32Args } from '.';
3
11
 
4
- export type Condition = {
5
- __kind: 'None';
6
- } | {
7
- __kind: 'NextValidExecutionTimestamp';
8
- nextValidExecutionTimestamp: bigint;
9
- minIntervalSeconds: Option<NonZeroU32>;
10
- } | {
11
- __kind: 'MinFeesOwedA';
12
- minFeesOwedA: bigint;
13
- } | {
14
- __kind: 'MinFeesOwedB';
15
- minFeesOwedB: bigint;
16
- };
17
- export type ConditionArgs = {
18
- __kind: 'None';
19
- } | {
20
- __kind: 'NextValidExecutionTimestamp';
21
- nextValidExecutionTimestamp: number | bigint;
22
- minIntervalSeconds: OptionOrNullable<NonZeroU32Args>;
23
- } | {
24
- __kind: 'MinFeesOwedA';
25
- minFeesOwedA: number | bigint;
26
- } | {
27
- __kind: 'MinFeesOwedB';
28
- minFeesOwedB: number | bigint;
29
- };
12
+ export type Condition =
13
+ | {
14
+ __kind: 'None';
15
+ }
16
+ | {
17
+ __kind: 'NextValidExecutionTimestamp';
18
+ nextValidExecutionTimestamp: bigint;
19
+ minIntervalSeconds: Option<NonZeroU32>;
20
+ }
21
+ | {
22
+ __kind: 'MinFeesOwedA';
23
+ minFeesOwedA: bigint;
24
+ }
25
+ | {
26
+ __kind: 'MinFeesOwedB';
27
+ minFeesOwedB: bigint;
28
+ };
29
+ export type ConditionArgs =
30
+ | {
31
+ __kind: 'None';
32
+ }
33
+ | {
34
+ __kind: 'NextValidExecutionTimestamp';
35
+ nextValidExecutionTimestamp: number | bigint;
36
+ minIntervalSeconds: OptionOrNullable<NonZeroU32Args>;
37
+ }
38
+ | {
39
+ __kind: 'MinFeesOwedA';
40
+ minFeesOwedA: number | bigint;
41
+ }
42
+ | {
43
+ __kind: 'MinFeesOwedB';
44
+ minFeesOwedB: number | bigint;
45
+ };
30
46
  export declare function getConditionEncoder(): Encoder<ConditionArgs>;
31
47
  export declare function getConditionDecoder(): Decoder<Condition>;
32
48
  export declare function getConditionCodec(): Codec<ConditionArgs, Condition>;
33
- export declare function condition(kind: 'None'): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'None'>;
34
- export declare function condition(kind: 'NextValidExecutionTimestamp', data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'NextValidExecutionTimestamp'>): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'NextValidExecutionTimestamp'>;
35
- export declare function condition(kind: 'MinFeesOwedA', data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'MinFeesOwedA'>): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'MinFeesOwedA'>;
36
- export declare function condition(kind: 'MinFeesOwedB', data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'MinFeesOwedB'>): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'MinFeesOwedB'>;
37
- export declare function isCondition<K extends Condition['__kind']>(kind: K, value: Condition): value is Condition & {
38
- __kind: K;
49
+ export declare function condition(
50
+ kind: 'None'
51
+ ): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'None'>;
52
+ export declare function condition(
53
+ kind: 'NextValidExecutionTimestamp',
54
+ data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'NextValidExecutionTimestamp'>
55
+ ): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'NextValidExecutionTimestamp'>;
56
+ export declare function condition(
57
+ kind: 'MinFeesOwedA',
58
+ data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'MinFeesOwedA'>
59
+ ): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'MinFeesOwedA'>;
60
+ export declare function condition(
61
+ kind: 'MinFeesOwedB',
62
+ data: GetDiscriminatedUnionVariantContent<ConditionArgs, '__kind', 'MinFeesOwedB'>
63
+ ): GetDiscriminatedUnionVariant<ConditionArgs, '__kind', 'MinFeesOwedB'>;
64
+ export declare function isCondition<K extends Condition['__kind']>(
65
+ kind: K,
66
+ value: Condition
67
+ ): value is Condition & {
68
+ __kind: K;
39
69
  };