@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.
- package/README.md +2 -1
- package/dist/generated/accounts/automation.d.ts +72 -35
- package/dist/generated/accounts/globalConfig.d.ts +52 -19
- package/dist/generated/errors/whirlpoolsAutomationProgram.d.ts +54 -8
- package/dist/generated/instructions/createAutomation.d.ts +197 -66
- package/dist/generated/instructions/fundAutomation.d.ts +86 -27
- package/dist/generated/instructions/harvestAndReinvest.d.ts +286 -85
- package/dist/generated/instructions/harvestSwapAndReinvestPost.d.ts +278 -82
- package/dist/generated/instructions/harvestSwapAndReinvestPre.d.ts +259 -78
- package/dist/generated/instructions/initializeGlobalConfig.d.ts +90 -30
- package/dist/generated/instructions/removeAutomations.d.ts +154 -45
- package/dist/generated/instructions/updateGlobalConfig.d.ts +79 -24
- package/dist/generated/programs/whirlpoolsAutomationProgram.d.ts +58 -33
- package/dist/generated/shared/index.d.ts +34 -10
- package/dist/generated/types/accountDiscriminator.d.ts +8 -5
- package/dist/generated/types/action.d.ts +3 -3
- package/dist/generated/types/condition.d.ts +63 -33
- package/dist/generated/types/event.d.ts +205 -137
- package/dist/generated/types/fundAutomationMethod.d.ts +6 -3
- package/dist/generated/types/fundAutomationVariant.d.ts +33 -13
- package/dist/generated/types/increaseLiquidityByTokenAmountsAccountsType.d.ts +15 -11
- package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsInfo.d.ts +10 -4
- package/dist/generated/types/increaseLiquidityByTokenAmountsRemainingAccountsSlice.d.ts +12 -6
- package/dist/generated/types/increaseLiquidityMethod.d.ts +30 -15
- package/dist/generated/types/nonZeroU32.d.ts +6 -2
- package/dist/generated/types/position.d.ts +22 -22
- package/dist/generated/types/positionRewardInfo.d.ts +8 -5
- package/dist/generated/types/tokenAccount.d.ts +22 -22
- package/dist/generated/types/tokenAccountState.d.ts +7 -4
- package/dist/generated/types/tokenMint.d.ts +14 -14
- package/dist/generated/types/updateGlobalConfigVariant.d.ts +58 -20
- package/dist/generated/types/whirlpool.d.ts +40 -40
- package/dist/generated/types/whirlpoolRewardInfo.d.ts +14 -11
- package/dist/index.browser.js +2490 -2092
- package/dist/index.node.js +2497 -2102
- package/dist/pda.d.ts +16 -4
- package/dist/staging.d.ts +1 -1
- package/package.json +3 -3
- package/CHANGELOG.md +0 -13
package/README.md
CHANGED
|
@@ -1,44 +1,81 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
2
15
|
import { AccountDiscriminator, AccountDiscriminatorArgs, Address, AddressArgs } from '../types';
|
|
3
16
|
|
|
4
17
|
export type Automation = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
discriminator: AccountDiscriminator;
|
|
19
|
+
positionTokenAccount: Address;
|
|
20
|
+
actionData: ReadonlyUint8Array;
|
|
21
|
+
automationIndex: number;
|
|
22
|
+
conditionsData: ReadonlyUint8Array;
|
|
23
|
+
bump: number;
|
|
24
|
+
authorityBump: number;
|
|
25
|
+
padding: ReadonlyUint8Array;
|
|
26
|
+
crankReward: bigint;
|
|
27
|
+
automationTokenAccountA: Address;
|
|
28
|
+
automationTokenAccountB: Address;
|
|
29
|
+
tokenMintA: Address;
|
|
30
|
+
tokenMintB: Address;
|
|
31
|
+
owner: Address;
|
|
32
|
+
position: Address;
|
|
33
|
+
reserved: ReadonlyUint8Array;
|
|
19
34
|
};
|
|
20
35
|
export type AutomationArgs = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
discriminator: AccountDiscriminatorArgs;
|
|
37
|
+
positionTokenAccount: AddressArgs;
|
|
38
|
+
actionData: ReadonlyUint8Array;
|
|
39
|
+
automationIndex: number;
|
|
40
|
+
conditionsData: ReadonlyUint8Array;
|
|
41
|
+
bump: number;
|
|
42
|
+
authorityBump: number;
|
|
43
|
+
padding: ReadonlyUint8Array;
|
|
44
|
+
crankReward: number | bigint;
|
|
45
|
+
automationTokenAccountA: AddressArgs;
|
|
46
|
+
automationTokenAccountB: AddressArgs;
|
|
47
|
+
tokenMintA: AddressArgs;
|
|
48
|
+
tokenMintB: AddressArgs;
|
|
49
|
+
owner: AddressArgs;
|
|
50
|
+
position: AddressArgs;
|
|
51
|
+
reserved: ReadonlyUint8Array;
|
|
35
52
|
};
|
|
36
53
|
export declare function getAutomationEncoder(): Encoder<AutomationArgs>;
|
|
37
54
|
export declare function getAutomationDecoder(): Decoder<Automation>;
|
|
38
55
|
export declare function getAutomationCodec(): Codec<AutomationArgs, Automation>;
|
|
39
|
-
export declare function decodeAutomation<TAddress extends string = string>(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export declare function
|
|
43
|
-
|
|
44
|
-
|
|
56
|
+
export declare function decodeAutomation<TAddress extends string = string>(
|
|
57
|
+
encodedAccount: EncodedAccount<TAddress>
|
|
58
|
+
): Account<Automation, TAddress>;
|
|
59
|
+
export declare function decodeAutomation<TAddress extends string = string>(
|
|
60
|
+
encodedAccount: MaybeEncodedAccount<TAddress>
|
|
61
|
+
): MaybeAccount<Automation, TAddress>;
|
|
62
|
+
export declare function fetchAutomation<TAddress extends string = string>(
|
|
63
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
64
|
+
address: Address<TAddress>,
|
|
65
|
+
config?: FetchAccountConfig
|
|
66
|
+
): Promise<Account<Automation, TAddress>>;
|
|
67
|
+
export declare function fetchMaybeAutomation<TAddress extends string = string>(
|
|
68
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
69
|
+
address: Address<TAddress>,
|
|
70
|
+
config?: FetchAccountConfig
|
|
71
|
+
): Promise<MaybeAccount<Automation, TAddress>>;
|
|
72
|
+
export declare function fetchAllAutomation(
|
|
73
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
74
|
+
addresses: Array<Address>,
|
|
75
|
+
config?: FetchAccountsConfig
|
|
76
|
+
): Promise<Account<Automation>[]>;
|
|
77
|
+
export declare function fetchAllMaybeAutomation(
|
|
78
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
79
|
+
addresses: Array<Address>,
|
|
80
|
+
config?: FetchAccountsConfig
|
|
81
|
+
): Promise<MaybeAccount<Automation>[]>;
|
|
@@ -1,28 +1,61 @@
|
|
|
1
|
-
import {
|
|
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';
|
|
2
15
|
import { AccountDiscriminator, AccountDiscriminatorArgs, Address, AddressArgs } from '../types';
|
|
3
16
|
|
|
4
17
|
export type GlobalConfig = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
18
|
+
discriminator: AccountDiscriminator;
|
|
19
|
+
bump: number;
|
|
20
|
+
padding: ReadonlyUint8Array;
|
|
21
|
+
globalConfigAuthority: Address;
|
|
22
|
+
crankRewardDefault: bigint;
|
|
23
|
+
reserved: ReadonlyUint8Array;
|
|
11
24
|
};
|
|
12
25
|
export type GlobalConfigArgs = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
26
|
+
discriminator: AccountDiscriminatorArgs;
|
|
27
|
+
bump: number;
|
|
28
|
+
padding: ReadonlyUint8Array;
|
|
29
|
+
globalConfigAuthority: AddressArgs;
|
|
30
|
+
crankRewardDefault: number | bigint;
|
|
31
|
+
reserved: ReadonlyUint8Array;
|
|
19
32
|
};
|
|
20
33
|
export declare function getGlobalConfigEncoder(): Encoder<GlobalConfigArgs>;
|
|
21
34
|
export declare function getGlobalConfigDecoder(): Decoder<GlobalConfig>;
|
|
22
35
|
export declare function getGlobalConfigCodec(): Codec<GlobalConfigArgs, GlobalConfig>;
|
|
23
|
-
export declare function decodeGlobalConfig<TAddress extends string = string>(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export declare function
|
|
27
|
-
|
|
28
|
-
|
|
36
|
+
export declare function decodeGlobalConfig<TAddress extends string = string>(
|
|
37
|
+
encodedAccount: EncodedAccount<TAddress>
|
|
38
|
+
): Account<GlobalConfig, TAddress>;
|
|
39
|
+
export declare function decodeGlobalConfig<TAddress extends string = string>(
|
|
40
|
+
encodedAccount: MaybeEncodedAccount<TAddress>
|
|
41
|
+
): MaybeAccount<GlobalConfig, TAddress>;
|
|
42
|
+
export declare function fetchGlobalConfig<TAddress extends string = string>(
|
|
43
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
44
|
+
address: Address<TAddress>,
|
|
45
|
+
config?: FetchAccountConfig
|
|
46
|
+
): Promise<Account<GlobalConfig, TAddress>>;
|
|
47
|
+
export declare function fetchMaybeGlobalConfig<TAddress extends string = string>(
|
|
48
|
+
rpc: Parameters<typeof fetchEncodedAccount>[0],
|
|
49
|
+
address: Address<TAddress>,
|
|
50
|
+
config?: FetchAccountConfig
|
|
51
|
+
): Promise<MaybeAccount<GlobalConfig, TAddress>>;
|
|
52
|
+
export declare function fetchAllGlobalConfig(
|
|
53
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
54
|
+
addresses: Array<Address>,
|
|
55
|
+
config?: FetchAccountsConfig
|
|
56
|
+
): Promise<Account<GlobalConfig>[]>;
|
|
57
|
+
export declare function fetchAllMaybeGlobalConfig(
|
|
58
|
+
rpc: Parameters<typeof fetchEncodedAccounts>[0],
|
|
59
|
+
addresses: Array<Address>,
|
|
60
|
+
config?: FetchAccountsConfig
|
|
61
|
+
): Promise<MaybeAccount<GlobalConfig>[]>;
|
|
@@ -32,14 +32,60 @@ export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTI
|
|
|
32
32
|
export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOMPANYING_INSTRUCTION = 6029;
|
|
33
33
|
export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_INTERMEDIATE_SWAP = 6030;
|
|
34
34
|
export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH = 6031;
|
|
35
|
-
export
|
|
36
|
-
export
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
export declare const WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__UNSUPPORTED_TOKEN_EXTENSION = 6032;
|
|
36
|
+
export type WhirlpoolsAutomationProgramError =
|
|
37
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_ALREADY_INITIALIZED
|
|
38
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ACCOUNT_NOT_INITIALIZED
|
|
39
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__ARITHMETIC_ERROR
|
|
40
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__CONDITION_VIOLATION
|
|
41
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__EMIT_EVENT_ERROR
|
|
42
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_ACCOUNT_ADDRESS
|
|
43
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_OWNER
|
|
44
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INCORRECT_PROGRAM_ID
|
|
45
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_FUNDS_TO_PAY_CRANK_REWARD
|
|
46
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_AFTER
|
|
47
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INSUFFICIENT_INSTRUCTION_COUNT_BEFORE
|
|
48
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOMPANYING_INSTRUCTION
|
|
49
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_DATA
|
|
50
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACCOUNT_ROLE
|
|
51
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION
|
|
52
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_ACTION_DATA_LENGTH
|
|
53
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AMOUNT_TO_FUND_AUTOMATION
|
|
54
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_ACTION
|
|
55
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_AUTOMATION_INDEX
|
|
56
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION
|
|
57
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CONDITION_DATA_LENGTH
|
|
58
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_ACCOUNTS
|
|
59
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_C_P_I_INSTRUCTION_DATA
|
|
60
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_CRANK_REWARD
|
|
61
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_INTERMEDIATE_SWAP
|
|
62
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_NEXT_VALID_EXECUTION_TIMESTAMP_CONDITION
|
|
63
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_POSITION_TOKEN_AMOUNT
|
|
64
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_REMAINING_ACCOUNTS_LENGTH
|
|
65
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__INVALID_SEEDS
|
|
66
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__NOT_ENOUGH_ACCOUNT_KEYS
|
|
67
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__REDUNDANT_GLOBAL_CONFIG_UPDATE
|
|
68
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__UNKNOWN_INSTRUCTION_DISCRIMINATOR
|
|
69
|
+
| typeof WHIRLPOOLS_AUTOMATION_PROGRAM_ERROR__UNSUPPORTED_TOKEN_EXTENSION;
|
|
70
|
+
export declare function getWhirlpoolsAutomationProgramErrorMessage(
|
|
71
|
+
code: WhirlpoolsAutomationProgramError
|
|
72
|
+
): string;
|
|
73
|
+
export declare function isWhirlpoolsAutomationProgramError<
|
|
74
|
+
TProgramErrorCode extends WhirlpoolsAutomationProgramError,
|
|
75
|
+
>(
|
|
76
|
+
error: unknown,
|
|
77
|
+
transactionMessage: {
|
|
78
|
+
instructions: Record<
|
|
79
|
+
number,
|
|
80
|
+
{
|
|
39
81
|
programAddress: Address;
|
|
40
|
-
|
|
41
|
-
|
|
82
|
+
}
|
|
83
|
+
>;
|
|
84
|
+
},
|
|
85
|
+
code?: TProgramErrorCode
|
|
86
|
+
): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> &
|
|
87
|
+
Readonly<{
|
|
42
88
|
context: Readonly<{
|
|
43
|
-
|
|
89
|
+
code: TProgramErrorCode;
|
|
44
90
|
}>;
|
|
45
|
-
}>;
|
|
91
|
+
}>;
|
|
@@ -1,80 +1,211 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Address,
|
|
3
|
+
AccountMeta,
|
|
4
|
+
AccountSignerMeta,
|
|
5
|
+
Codec,
|
|
6
|
+
Decoder,
|
|
7
|
+
Encoder,
|
|
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
|
import { Action, ActionArgs, Condition, ConditionArgs } from '../types';
|
|
4
19
|
|
|
5
20
|
export declare const CREATE_AUTOMATION_DISCRIMINATOR = 2;
|
|
6
21
|
export declare function getCreateAutomationDiscriminatorBytes(): ReadonlyUint8Array;
|
|
7
|
-
export type CreateAutomationInstruction<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
export type CreateAutomationInstruction<
|
|
23
|
+
TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
|
|
24
|
+
TAccountPositionOwner extends string | AccountMeta<string> = string,
|
|
25
|
+
TAccountAutomation extends string | AccountMeta<string> = string,
|
|
26
|
+
TAccountAutomationTokenAccountA extends string | AccountMeta<string> = string,
|
|
27
|
+
TAccountAutomationTokenAccountB extends string | AccountMeta<string> = string,
|
|
28
|
+
TAccountPosition extends string | AccountMeta<string> = string,
|
|
29
|
+
TAccountPositionTokenAccount extends string | AccountMeta<string> = string,
|
|
30
|
+
TAccountWhirlpool extends string | AccountMeta<string> = string,
|
|
31
|
+
TAccountGlobalConfig extends string | AccountMeta<string> = string,
|
|
32
|
+
TAccountTokenMintA extends string | AccountMeta<string> = string,
|
|
33
|
+
TAccountTokenMintB extends string | AccountMeta<string> = string,
|
|
34
|
+
TAccountTokenProgramA extends string | AccountMeta<string> = string,
|
|
35
|
+
TAccountTokenProgramB extends string | AccountMeta<string> = string,
|
|
36
|
+
TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111',
|
|
37
|
+
TAccountAtaProgram extends string | AccountMeta<string> =
|
|
38
|
+
'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
|
|
39
|
+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
|
|
40
|
+
> = Instruction<TProgram> &
|
|
41
|
+
InstructionWithData<ReadonlyUint8Array> &
|
|
42
|
+
InstructionWithAccounts<
|
|
43
|
+
[
|
|
44
|
+
TAccountPositionOwner extends string
|
|
45
|
+
? WritableSignerAccount<TAccountPositionOwner> & AccountSignerMeta<TAccountPositionOwner>
|
|
46
|
+
: TAccountPositionOwner,
|
|
47
|
+
TAccountAutomation extends string ? WritableAccount<TAccountAutomation> : TAccountAutomation,
|
|
48
|
+
TAccountAutomationTokenAccountA extends string
|
|
49
|
+
? WritableAccount<TAccountAutomationTokenAccountA>
|
|
50
|
+
: TAccountAutomationTokenAccountA,
|
|
51
|
+
TAccountAutomationTokenAccountB extends string
|
|
52
|
+
? WritableAccount<TAccountAutomationTokenAccountB>
|
|
53
|
+
: TAccountAutomationTokenAccountB,
|
|
54
|
+
TAccountPosition extends string ? ReadonlyAccount<TAccountPosition> : TAccountPosition,
|
|
55
|
+
TAccountPositionTokenAccount extends string
|
|
56
|
+
? ReadonlyAccount<TAccountPositionTokenAccount>
|
|
57
|
+
: TAccountPositionTokenAccount,
|
|
58
|
+
TAccountWhirlpool extends string ? ReadonlyAccount<TAccountWhirlpool> : TAccountWhirlpool,
|
|
59
|
+
TAccountGlobalConfig extends string
|
|
60
|
+
? ReadonlyAccount<TAccountGlobalConfig>
|
|
61
|
+
: TAccountGlobalConfig,
|
|
62
|
+
TAccountTokenMintA extends string ? ReadonlyAccount<TAccountTokenMintA> : TAccountTokenMintA,
|
|
63
|
+
TAccountTokenMintB extends string ? ReadonlyAccount<TAccountTokenMintB> : TAccountTokenMintB,
|
|
64
|
+
TAccountTokenProgramA extends string
|
|
65
|
+
? ReadonlyAccount<TAccountTokenProgramA>
|
|
66
|
+
: TAccountTokenProgramA,
|
|
67
|
+
TAccountTokenProgramB extends string
|
|
68
|
+
? ReadonlyAccount<TAccountTokenProgramB>
|
|
69
|
+
: TAccountTokenProgramB,
|
|
70
|
+
TAccountSystemProgram extends string
|
|
71
|
+
? ReadonlyAccount<TAccountSystemProgram>
|
|
72
|
+
: TAccountSystemProgram,
|
|
73
|
+
TAccountAtaProgram extends string ? ReadonlyAccount<TAccountAtaProgram> : TAccountAtaProgram,
|
|
74
|
+
...TRemainingAccounts,
|
|
75
|
+
]
|
|
76
|
+
>;
|
|
24
77
|
export type CreateAutomationInstructionData = {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
78
|
+
discriminator: number;
|
|
79
|
+
action: Action;
|
|
80
|
+
automationIndex: number;
|
|
81
|
+
conditions: Array<Condition>;
|
|
29
82
|
};
|
|
30
83
|
export type CreateAutomationInstructionDataArgs = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
84
|
+
action: ActionArgs;
|
|
85
|
+
automationIndex: number;
|
|
86
|
+
conditions: Array<ConditionArgs>;
|
|
34
87
|
};
|
|
35
88
|
export declare function getCreateAutomationInstructionDataEncoder(): Encoder<CreateAutomationInstructionDataArgs>;
|
|
36
89
|
export declare function getCreateAutomationInstructionDataDecoder(): Decoder<CreateAutomationInstructionData>;
|
|
37
|
-
export declare function getCreateAutomationInstructionDataCodec(): Codec<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
90
|
+
export declare function getCreateAutomationInstructionDataCodec(): Codec<
|
|
91
|
+
CreateAutomationInstructionDataArgs,
|
|
92
|
+
CreateAutomationInstructionData
|
|
93
|
+
>;
|
|
94
|
+
export type CreateAutomationInput<
|
|
95
|
+
TAccountPositionOwner extends string = string,
|
|
96
|
+
TAccountAutomation extends string = string,
|
|
97
|
+
TAccountAutomationTokenAccountA extends string = string,
|
|
98
|
+
TAccountAutomationTokenAccountB extends string = string,
|
|
99
|
+
TAccountPosition extends string = string,
|
|
100
|
+
TAccountPositionTokenAccount extends string = string,
|
|
101
|
+
TAccountWhirlpool extends string = string,
|
|
102
|
+
TAccountGlobalConfig extends string = string,
|
|
103
|
+
TAccountTokenMintA extends string = string,
|
|
104
|
+
TAccountTokenMintB extends string = string,
|
|
105
|
+
TAccountTokenProgramA extends string = string,
|
|
106
|
+
TAccountTokenProgramB extends string = string,
|
|
107
|
+
TAccountSystemProgram extends string = string,
|
|
108
|
+
TAccountAtaProgram extends string = string,
|
|
109
|
+
> = {
|
|
110
|
+
positionOwner: TransactionSigner<TAccountPositionOwner>;
|
|
111
|
+
automation: Address<TAccountAutomation>;
|
|
112
|
+
automationTokenAccountA: Address<TAccountAutomationTokenAccountA>;
|
|
113
|
+
automationTokenAccountB: Address<TAccountAutomationTokenAccountB>;
|
|
114
|
+
position: Address<TAccountPosition>;
|
|
115
|
+
positionTokenAccount: Address<TAccountPositionTokenAccount>;
|
|
116
|
+
whirlpool: Address<TAccountWhirlpool>;
|
|
117
|
+
globalConfig: Address<TAccountGlobalConfig>;
|
|
118
|
+
tokenMintA: Address<TAccountTokenMintA>;
|
|
119
|
+
tokenMintB: Address<TAccountTokenMintB>;
|
|
120
|
+
tokenProgramA: Address<TAccountTokenProgramA>;
|
|
121
|
+
tokenProgramB: Address<TAccountTokenProgramB>;
|
|
122
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
123
|
+
ataProgram?: Address<TAccountAtaProgram>;
|
|
124
|
+
action: CreateAutomationInstructionDataArgs['action'];
|
|
125
|
+
automationIndex: CreateAutomationInstructionDataArgs['automationIndex'];
|
|
126
|
+
conditions: CreateAutomationInstructionDataArgs['conditions'];
|
|
56
127
|
};
|
|
57
|
-
export declare function getCreateAutomationInstruction<
|
|
128
|
+
export declare function getCreateAutomationInstruction<
|
|
129
|
+
TAccountPositionOwner extends string,
|
|
130
|
+
TAccountAutomation extends string,
|
|
131
|
+
TAccountAutomationTokenAccountA extends string,
|
|
132
|
+
TAccountAutomationTokenAccountB extends string,
|
|
133
|
+
TAccountPosition extends string,
|
|
134
|
+
TAccountPositionTokenAccount extends string,
|
|
135
|
+
TAccountWhirlpool extends string,
|
|
136
|
+
TAccountGlobalConfig extends string,
|
|
137
|
+
TAccountTokenMintA extends string,
|
|
138
|
+
TAccountTokenMintB extends string,
|
|
139
|
+
TAccountTokenProgramA extends string,
|
|
140
|
+
TAccountTokenProgramB extends string,
|
|
141
|
+
TAccountSystemProgram extends string,
|
|
142
|
+
TAccountAtaProgram extends string,
|
|
143
|
+
TProgramAddress extends Address = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
|
|
144
|
+
>(
|
|
145
|
+
input: CreateAutomationInput<
|
|
146
|
+
TAccountPositionOwner,
|
|
147
|
+
TAccountAutomation,
|
|
148
|
+
TAccountAutomationTokenAccountA,
|
|
149
|
+
TAccountAutomationTokenAccountB,
|
|
150
|
+
TAccountPosition,
|
|
151
|
+
TAccountPositionTokenAccount,
|
|
152
|
+
TAccountWhirlpool,
|
|
153
|
+
TAccountGlobalConfig,
|
|
154
|
+
TAccountTokenMintA,
|
|
155
|
+
TAccountTokenMintB,
|
|
156
|
+
TAccountTokenProgramA,
|
|
157
|
+
TAccountTokenProgramB,
|
|
158
|
+
TAccountSystemProgram,
|
|
159
|
+
TAccountAtaProgram
|
|
160
|
+
>,
|
|
161
|
+
config?: {
|
|
58
162
|
programAddress?: TProgramAddress;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
163
|
+
}
|
|
164
|
+
): CreateAutomationInstruction<
|
|
165
|
+
TProgramAddress,
|
|
166
|
+
TAccountPositionOwner,
|
|
167
|
+
TAccountAutomation,
|
|
168
|
+
TAccountAutomationTokenAccountA,
|
|
169
|
+
TAccountAutomationTokenAccountB,
|
|
170
|
+
TAccountPosition,
|
|
171
|
+
TAccountPositionTokenAccount,
|
|
172
|
+
TAccountWhirlpool,
|
|
173
|
+
TAccountGlobalConfig,
|
|
174
|
+
TAccountTokenMintA,
|
|
175
|
+
TAccountTokenMintB,
|
|
176
|
+
TAccountTokenProgramA,
|
|
177
|
+
TAccountTokenProgramB,
|
|
178
|
+
TAccountSystemProgram,
|
|
179
|
+
TAccountAtaProgram
|
|
180
|
+
>;
|
|
181
|
+
export type ParsedCreateAutomationInstruction<
|
|
182
|
+
TProgram extends string = typeof WHIRLPOOLS_AUTOMATION_PROGRAM_PROGRAM_ADDRESS,
|
|
183
|
+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
|
|
184
|
+
> = {
|
|
185
|
+
programAddress: Address<TProgram>;
|
|
186
|
+
accounts: {
|
|
187
|
+
positionOwner: TAccountMetas[0];
|
|
188
|
+
automation: TAccountMetas[1];
|
|
189
|
+
automationTokenAccountA: TAccountMetas[2];
|
|
190
|
+
automationTokenAccountB: TAccountMetas[3];
|
|
191
|
+
position: TAccountMetas[4];
|
|
192
|
+
positionTokenAccount: TAccountMetas[5];
|
|
193
|
+
whirlpool: TAccountMetas[6];
|
|
194
|
+
globalConfig: TAccountMetas[7];
|
|
195
|
+
tokenMintA: TAccountMetas[8];
|
|
196
|
+
tokenMintB: TAccountMetas[9];
|
|
197
|
+
tokenProgramA: TAccountMetas[10];
|
|
198
|
+
tokenProgramB: TAccountMetas[11];
|
|
199
|
+
systemProgram: TAccountMetas[12];
|
|
200
|
+
ataProgram: TAccountMetas[13];
|
|
201
|
+
};
|
|
202
|
+
data: CreateAutomationInstructionData;
|
|
79
203
|
};
|
|
80
|
-
export declare function parseCreateAutomationInstruction<
|
|
204
|
+
export declare function parseCreateAutomationInstruction<
|
|
205
|
+
TProgram extends string,
|
|
206
|
+
TAccountMetas extends readonly AccountMeta[],
|
|
207
|
+
>(
|
|
208
|
+
instruction: Instruction<TProgram> &
|
|
209
|
+
InstructionWithAccounts<TAccountMetas> &
|
|
210
|
+
InstructionWithData<ReadonlyUint8Array>
|
|
211
|
+
): ParsedCreateAutomationInstruction<TProgram, TAccountMetas>;
|