pump-kit 0.1.0 → 0.1.3
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 +13 -40
- package/dist/index.js +12 -12
- package/dist/types/ammsdk/generated/accounts/globalConfig.d.ts +4 -6
- package/dist/types/ammsdk/generated/accounts/index.d.ts +0 -4
- package/dist/types/ammsdk/generated/accounts/pool.d.ts +0 -2
- package/dist/types/ammsdk/generated/errors/pumpAmm.d.ts +29 -55
- package/dist/types/ammsdk/generated/index.d.ts +1 -1
- package/dist/types/ammsdk/generated/instructions/buy.d.ts +14 -67
- package/dist/types/ammsdk/generated/instructions/createConfig.d.ts +5 -26
- package/dist/types/ammsdk/generated/instructions/createPool.d.ts +12 -42
- package/dist/types/ammsdk/generated/instructions/deposit.d.ts +10 -33
- package/dist/types/ammsdk/generated/instructions/disable.d.ts +2 -16
- package/dist/types/ammsdk/generated/instructions/extendAccount.d.ts +2 -12
- package/dist/types/ammsdk/generated/instructions/index.d.ts +0 -9
- package/dist/types/ammsdk/generated/instructions/sell.d.ts +14 -54
- package/dist/types/ammsdk/generated/instructions/updateAdmin.d.ts +2 -12
- package/dist/types/ammsdk/generated/instructions/updateFeeConfig.d.ts +2 -22
- package/dist/types/ammsdk/generated/instructions/withdraw.d.ts +10 -33
- package/dist/types/ammsdk/generated/programs/pumpAmm.d.ts +15 -46
- package/dist/types/ammsdk/generated/types/buyEvent.d.ts +4 -25
- package/dist/types/ammsdk/generated/types/createConfigEvent.d.ts +0 -4
- package/dist/types/ammsdk/generated/types/createPoolEvent.d.ts +0 -2
- package/dist/types/ammsdk/generated/types/globalConfig.d.ts +49 -0
- package/dist/types/ammsdk/generated/types/index.d.ts +2 -12
- package/dist/types/ammsdk/generated/types/pool.d.ts +35 -0
- package/dist/types/ammsdk/generated/types/sellEvent.d.ts +0 -6
- package/dist/types/ammsdk/generated/types/updateFeeConfigEvent.d.ts +0 -4
- package/dist/types/clients/amm.d.ts +10 -2
- package/dist/types/pda/pumpAmm.d.ts +4 -0
- package/dist/types/pumpsdk/generated/index.d.ts +1 -1
- package/dist/types/swap/curve.d.ts +1 -4
- package/dist/types/swap.d.ts +7 -23
- package/package.json +1 -1
- package/dist/types/ammsdk/generated/accounts/bondingCurve.d.ts +0 -39
- package/dist/types/ammsdk/generated/accounts/feeConfig.d.ts +0 -33
- package/dist/types/ammsdk/generated/accounts/globalVolumeAccumulator.d.ts +0 -37
- package/dist/types/ammsdk/generated/accounts/userVolumeAccumulator.d.ts +0 -39
- package/dist/types/ammsdk/generated/instructions/adminSetCoinCreator.d.ts +0 -63
- package/dist/types/ammsdk/generated/instructions/adminUpdateTokenIncentives.d.ts +0 -99
- package/dist/types/ammsdk/generated/instructions/buyExactQuoteIn.d.ts +0 -144
- package/dist/types/ammsdk/generated/instructions/claimTokenIncentives.d.ts +0 -86
- package/dist/types/ammsdk/generated/instructions/closeUserVolumeAccumulator.d.ts +0 -54
- package/dist/types/ammsdk/generated/instructions/collectCoinCreatorFee.d.ts +0 -70
- package/dist/types/ammsdk/generated/instructions/initUserVolumeAccumulator.d.ts +0 -62
- package/dist/types/ammsdk/generated/instructions/setCoinCreator.d.ts +0 -58
- package/dist/types/ammsdk/generated/instructions/syncUserVolumeAccumulator.d.ts +0 -58
- package/dist/types/ammsdk/generated/types/adminSetCoinCreatorEvent.d.ts +0 -27
- package/dist/types/ammsdk/generated/types/adminUpdateTokenIncentivesEvent.d.ts +0 -29
- package/dist/types/ammsdk/generated/types/claimTokenIncentivesEvent.d.ts +0 -27
- package/dist/types/ammsdk/generated/types/closeUserVolumeAccumulatorEvent.d.ts +0 -27
- package/dist/types/ammsdk/generated/types/collectCoinCreatorFeeEvent.d.ts +0 -25
- package/dist/types/ammsdk/generated/types/feeTier.d.ts +0 -20
- package/dist/types/ammsdk/generated/types/fees.d.ts +0 -21
- package/dist/types/ammsdk/generated/types/initUserVolumeAccumulatorEvent.d.ts +0 -21
- package/dist/types/ammsdk/generated/types/optionBool.d.ts +0 -13
- package/dist/types/ammsdk/generated/types/setBondingCurveCoinCreatorEvent.d.ts +0 -25
- package/dist/types/ammsdk/generated/types/setMetaplexCoinCreatorEvent.d.ts +0 -25
- package/dist/types/ammsdk/generated/types/syncUserVolumeAccumulatorEvent.d.ts +0 -23
|
@@ -12,7 +12,9 @@ export type GlobalConfig = {
|
|
|
12
12
|
discriminator: ReadonlyUint8Array;
|
|
13
13
|
/** The admin pubkey */
|
|
14
14
|
admin: Address;
|
|
15
|
+
/** The lp fee in basis points (0.01%) */
|
|
15
16
|
lpFeeBasisPoints: bigint;
|
|
17
|
+
/** The protocol fee in basis points (0.01%) */
|
|
16
18
|
protocolFeeBasisPoints: bigint;
|
|
17
19
|
/**
|
|
18
20
|
* Flags to disable certain functionality
|
|
@@ -25,14 +27,13 @@ export type GlobalConfig = {
|
|
|
25
27
|
disableFlags: number;
|
|
26
28
|
/** Addresses of the protocol fee recipients */
|
|
27
29
|
protocolFeeRecipients: Array<Address>;
|
|
28
|
-
coinCreatorFeeBasisPoints: bigint;
|
|
29
|
-
/** The admin authority for setting coin creators */
|
|
30
|
-
adminSetCoinCreatorAuthority: Address;
|
|
31
30
|
};
|
|
32
31
|
export type GlobalConfigArgs = {
|
|
33
32
|
/** The admin pubkey */
|
|
34
33
|
admin: Address;
|
|
34
|
+
/** The lp fee in basis points (0.01%) */
|
|
35
35
|
lpFeeBasisPoints: number | bigint;
|
|
36
|
+
/** The protocol fee in basis points (0.01%) */
|
|
36
37
|
protocolFeeBasisPoints: number | bigint;
|
|
37
38
|
/**
|
|
38
39
|
* Flags to disable certain functionality
|
|
@@ -45,9 +46,6 @@ export type GlobalConfigArgs = {
|
|
|
45
46
|
disableFlags: number;
|
|
46
47
|
/** Addresses of the protocol fee recipients */
|
|
47
48
|
protocolFeeRecipients: Array<Address>;
|
|
48
|
-
coinCreatorFeeBasisPoints: number | bigint;
|
|
49
|
-
/** The admin authority for setting coin creators */
|
|
50
|
-
adminSetCoinCreatorAuthority: Address;
|
|
51
49
|
};
|
|
52
50
|
export declare function getGlobalConfigEncoder(): FixedSizeEncoder<GlobalConfigArgs>;
|
|
53
51
|
export declare function getGlobalConfigDecoder(): FixedSizeDecoder<GlobalConfig>;
|
|
@@ -5,9 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
export * from './bondingCurve';
|
|
9
|
-
export * from './feeConfig';
|
|
10
8
|
export * from './globalConfig';
|
|
11
|
-
export * from './globalVolumeAccumulator';
|
|
12
9
|
export * from './pool';
|
|
13
|
-
export * from './userVolumeAccumulator';
|
|
@@ -20,7 +20,6 @@ export type Pool = {
|
|
|
20
20
|
poolQuoteTokenAccount: Address;
|
|
21
21
|
/** True circulating supply without burns and lock-ups */
|
|
22
22
|
lpSupply: bigint;
|
|
23
|
-
coinCreator: Address;
|
|
24
23
|
};
|
|
25
24
|
export type PoolArgs = {
|
|
26
25
|
poolBump: number;
|
|
@@ -33,7 +32,6 @@ export type PoolArgs = {
|
|
|
33
32
|
poolQuoteTokenAccount: Address;
|
|
34
33
|
/** True circulating supply without burns and lock-ups */
|
|
35
34
|
lpSupply: number | bigint;
|
|
36
|
-
coinCreator: Address;
|
|
37
35
|
};
|
|
38
36
|
export declare function getPoolEncoder(): FixedSizeEncoder<PoolArgs>;
|
|
39
37
|
export declare function getPoolDecoder(): FixedSizeDecoder<Pool>;
|
|
@@ -6,89 +6,63 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
|
|
9
|
-
/** FeeBasisPointsExceedsMaximum
|
|
9
|
+
/** FeeBasisPointsExceedsMaximum */
|
|
10
10
|
export declare const PUMP_AMM_ERROR__FEE_BASIS_POINTS_EXCEEDS_MAXIMUM = 6000;
|
|
11
|
-
/** ZeroBaseAmount
|
|
11
|
+
/** ZeroBaseAmount */
|
|
12
12
|
export declare const PUMP_AMM_ERROR__ZERO_BASE_AMOUNT = 6001;
|
|
13
|
-
/** ZeroQuoteAmount
|
|
13
|
+
/** ZeroQuoteAmount */
|
|
14
14
|
export declare const PUMP_AMM_ERROR__ZERO_QUOTE_AMOUNT = 6002;
|
|
15
|
-
/** TooLittlePoolTokenLiquidity
|
|
15
|
+
/** TooLittlePoolTokenLiquidity */
|
|
16
16
|
export declare const PUMP_AMM_ERROR__TOO_LITTLE_POOL_TOKEN_LIQUIDITY = 6003;
|
|
17
|
-
/** ExceededSlippage
|
|
17
|
+
/** ExceededSlippage */
|
|
18
18
|
export declare const PUMP_AMM_ERROR__EXCEEDED_SLIPPAGE = 6004;
|
|
19
|
-
/** InvalidAdmin
|
|
19
|
+
/** InvalidAdmin */
|
|
20
20
|
export declare const PUMP_AMM_ERROR__INVALID_ADMIN = 6005;
|
|
21
|
-
/** UnsupportedBaseMint
|
|
21
|
+
/** UnsupportedBaseMint */
|
|
22
22
|
export declare const PUMP_AMM_ERROR__UNSUPPORTED_BASE_MINT = 6006;
|
|
23
|
-
/** UnsupportedQuoteMint
|
|
23
|
+
/** UnsupportedQuoteMint */
|
|
24
24
|
export declare const PUMP_AMM_ERROR__UNSUPPORTED_QUOTE_MINT = 6007;
|
|
25
|
-
/** InvalidBaseMint
|
|
25
|
+
/** InvalidBaseMint */
|
|
26
26
|
export declare const PUMP_AMM_ERROR__INVALID_BASE_MINT = 6008;
|
|
27
|
-
/** InvalidQuoteMint
|
|
27
|
+
/** InvalidQuoteMint */
|
|
28
28
|
export declare const PUMP_AMM_ERROR__INVALID_QUOTE_MINT = 6009;
|
|
29
|
-
/** InvalidLpMint
|
|
29
|
+
/** InvalidLpMint */
|
|
30
30
|
export declare const PUMP_AMM_ERROR__INVALID_LP_MINT = 6010;
|
|
31
|
-
/** AllProtocolFeeRecipientsShouldBeNonZero
|
|
31
|
+
/** AllProtocolFeeRecipientsShouldBeNonZero */
|
|
32
32
|
export declare const PUMP_AMM_ERROR__ALL_PROTOCOL_FEE_RECIPIENTS_SHOULD_BE_NON_ZERO = 6011;
|
|
33
|
-
/** UnsortedNotUniqueProtocolFeeRecipients
|
|
33
|
+
/** UnsortedNotUniqueProtocolFeeRecipients */
|
|
34
34
|
export declare const PUMP_AMM_ERROR__UNSORTED_NOT_UNIQUE_PROTOCOL_FEE_RECIPIENTS = 6012;
|
|
35
|
-
/** InvalidProtocolFeeRecipient
|
|
35
|
+
/** InvalidProtocolFeeRecipient */
|
|
36
36
|
export declare const PUMP_AMM_ERROR__INVALID_PROTOCOL_FEE_RECIPIENT = 6013;
|
|
37
|
-
/** InvalidPoolBaseTokenAccount
|
|
37
|
+
/** InvalidPoolBaseTokenAccount */
|
|
38
38
|
export declare const PUMP_AMM_ERROR__INVALID_POOL_BASE_TOKEN_ACCOUNT = 6014;
|
|
39
|
-
/** InvalidPoolQuoteTokenAccount
|
|
39
|
+
/** InvalidPoolQuoteTokenAccount */
|
|
40
40
|
export declare const PUMP_AMM_ERROR__INVALID_POOL_QUOTE_TOKEN_ACCOUNT = 6015;
|
|
41
|
-
/** BuyMoreBaseAmountThanPoolReserves
|
|
41
|
+
/** BuyMoreBaseAmountThanPoolReserves */
|
|
42
42
|
export declare const PUMP_AMM_ERROR__BUY_MORE_BASE_AMOUNT_THAN_POOL_RESERVES = 6016;
|
|
43
|
-
/** DisabledCreatePool
|
|
43
|
+
/** DisabledCreatePool */
|
|
44
44
|
export declare const PUMP_AMM_ERROR__DISABLED_CREATE_POOL = 6017;
|
|
45
|
-
/** DisabledDeposit
|
|
45
|
+
/** DisabledDeposit */
|
|
46
46
|
export declare const PUMP_AMM_ERROR__DISABLED_DEPOSIT = 6018;
|
|
47
|
-
/** DisabledWithdraw
|
|
47
|
+
/** DisabledWithdraw */
|
|
48
48
|
export declare const PUMP_AMM_ERROR__DISABLED_WITHDRAW = 6019;
|
|
49
|
-
/** DisabledBuy
|
|
49
|
+
/** DisabledBuy */
|
|
50
50
|
export declare const PUMP_AMM_ERROR__DISABLED_BUY = 6020;
|
|
51
|
-
/** DisabledSell
|
|
51
|
+
/** DisabledSell */
|
|
52
52
|
export declare const PUMP_AMM_ERROR__DISABLED_SELL = 6021;
|
|
53
|
-
/** SameMint
|
|
53
|
+
/** SameMint */
|
|
54
54
|
export declare const PUMP_AMM_ERROR__SAME_MINT = 6022;
|
|
55
|
-
/** Overflow
|
|
55
|
+
/** Overflow */
|
|
56
56
|
export declare const PUMP_AMM_ERROR__OVERFLOW = 6023;
|
|
57
|
-
/** Truncation
|
|
57
|
+
/** Truncation */
|
|
58
58
|
export declare const PUMP_AMM_ERROR__TRUNCATION = 6024;
|
|
59
|
-
/** DivisionByZero
|
|
59
|
+
/** DivisionByZero */
|
|
60
60
|
export declare const PUMP_AMM_ERROR__DIVISION_BY_ZERO = 6025;
|
|
61
|
-
/** NewSizeLessThanCurrentSize
|
|
61
|
+
/** NewSizeLessThanCurrentSize */
|
|
62
62
|
export declare const PUMP_AMM_ERROR__NEW_SIZE_LESS_THAN_CURRENT_SIZE = 6026;
|
|
63
|
-
/** AccountTypeNotSupported
|
|
63
|
+
/** AccountTypeNotSupported */
|
|
64
64
|
export declare const PUMP_AMM_ERROR__ACCOUNT_TYPE_NOT_SUPPORTED = 6027;
|
|
65
|
-
|
|
66
|
-
export declare const PUMP_AMM_ERROR__ONLY_CANONICAL_PUMP_POOLS_CAN_HAVE_COIN_CREATOR = 6028;
|
|
67
|
-
/** InvalidAdminSetCoinCreatorAuthority: */
|
|
68
|
-
export declare const PUMP_AMM_ERROR__INVALID_ADMIN_SET_COIN_CREATOR_AUTHORITY = 6029;
|
|
69
|
-
/** StartTimeInThePast: */
|
|
70
|
-
export declare const PUMP_AMM_ERROR__START_TIME_IN_THE_PAST = 6030;
|
|
71
|
-
/** EndTimeInThePast: */
|
|
72
|
-
export declare const PUMP_AMM_ERROR__END_TIME_IN_THE_PAST = 6031;
|
|
73
|
-
/** EndTimeBeforeStartTime: */
|
|
74
|
-
export declare const PUMP_AMM_ERROR__END_TIME_BEFORE_START_TIME = 6032;
|
|
75
|
-
/** TimeRangeTooLarge: */
|
|
76
|
-
export declare const PUMP_AMM_ERROR__TIME_RANGE_TOO_LARGE = 6033;
|
|
77
|
-
/** EndTimeBeforeCurrentDay: */
|
|
78
|
-
export declare const PUMP_AMM_ERROR__END_TIME_BEFORE_CURRENT_DAY = 6034;
|
|
79
|
-
/** SupplyUpdateForFinishedRange: */
|
|
80
|
-
export declare const PUMP_AMM_ERROR__SUPPLY_UPDATE_FOR_FINISHED_RANGE = 6035;
|
|
81
|
-
/** DayIndexAfterEndIndex: */
|
|
82
|
-
export declare const PUMP_AMM_ERROR__DAY_INDEX_AFTER_END_INDEX = 6036;
|
|
83
|
-
/** DayInActiveRange: */
|
|
84
|
-
export declare const PUMP_AMM_ERROR__DAY_IN_ACTIVE_RANGE = 6037;
|
|
85
|
-
/** InvalidIncentiveMint: */
|
|
86
|
-
export declare const PUMP_AMM_ERROR__INVALID_INCENTIVE_MINT = 6038;
|
|
87
|
-
/** BuyNotEnoughQuoteTokensToCoverFees: buy: Not enough quote tokens to cover for fees. */
|
|
88
|
-
export declare const PUMP_AMM_ERROR__BUY_NOT_ENOUGH_QUOTE_TOKENS_TO_COVER_FEES = 6039;
|
|
89
|
-
/** BuySlippageBelowMinBaseAmountOut: buy: slippage - would buy less tokens than expected min_base_amount_out */
|
|
90
|
-
export declare const PUMP_AMM_ERROR__BUY_SLIPPAGE_BELOW_MIN_BASE_AMOUNT_OUT = 6040;
|
|
91
|
-
export type PumpAmmError = typeof PUMP_AMM_ERROR__ACCOUNT_TYPE_NOT_SUPPORTED | typeof PUMP_AMM_ERROR__ALL_PROTOCOL_FEE_RECIPIENTS_SHOULD_BE_NON_ZERO | typeof PUMP_AMM_ERROR__BUY_MORE_BASE_AMOUNT_THAN_POOL_RESERVES | typeof PUMP_AMM_ERROR__BUY_NOT_ENOUGH_QUOTE_TOKENS_TO_COVER_FEES | typeof PUMP_AMM_ERROR__BUY_SLIPPAGE_BELOW_MIN_BASE_AMOUNT_OUT | typeof PUMP_AMM_ERROR__DAY_IN_ACTIVE_RANGE | typeof PUMP_AMM_ERROR__DAY_INDEX_AFTER_END_INDEX | typeof PUMP_AMM_ERROR__DISABLED_BUY | typeof PUMP_AMM_ERROR__DISABLED_CREATE_POOL | typeof PUMP_AMM_ERROR__DISABLED_DEPOSIT | typeof PUMP_AMM_ERROR__DISABLED_SELL | typeof PUMP_AMM_ERROR__DISABLED_WITHDRAW | typeof PUMP_AMM_ERROR__DIVISION_BY_ZERO | typeof PUMP_AMM_ERROR__END_TIME_BEFORE_CURRENT_DAY | typeof PUMP_AMM_ERROR__END_TIME_BEFORE_START_TIME | typeof PUMP_AMM_ERROR__END_TIME_IN_THE_PAST | typeof PUMP_AMM_ERROR__EXCEEDED_SLIPPAGE | typeof PUMP_AMM_ERROR__FEE_BASIS_POINTS_EXCEEDS_MAXIMUM | typeof PUMP_AMM_ERROR__INVALID_ADMIN | typeof PUMP_AMM_ERROR__INVALID_ADMIN_SET_COIN_CREATOR_AUTHORITY | typeof PUMP_AMM_ERROR__INVALID_BASE_MINT | typeof PUMP_AMM_ERROR__INVALID_INCENTIVE_MINT | typeof PUMP_AMM_ERROR__INVALID_LP_MINT | typeof PUMP_AMM_ERROR__INVALID_POOL_BASE_TOKEN_ACCOUNT | typeof PUMP_AMM_ERROR__INVALID_POOL_QUOTE_TOKEN_ACCOUNT | typeof PUMP_AMM_ERROR__INVALID_PROTOCOL_FEE_RECIPIENT | typeof PUMP_AMM_ERROR__INVALID_QUOTE_MINT | typeof PUMP_AMM_ERROR__NEW_SIZE_LESS_THAN_CURRENT_SIZE | typeof PUMP_AMM_ERROR__ONLY_CANONICAL_PUMP_POOLS_CAN_HAVE_COIN_CREATOR | typeof PUMP_AMM_ERROR__OVERFLOW | typeof PUMP_AMM_ERROR__SAME_MINT | typeof PUMP_AMM_ERROR__START_TIME_IN_THE_PAST | typeof PUMP_AMM_ERROR__SUPPLY_UPDATE_FOR_FINISHED_RANGE | typeof PUMP_AMM_ERROR__TIME_RANGE_TOO_LARGE | typeof PUMP_AMM_ERROR__TOO_LITTLE_POOL_TOKEN_LIQUIDITY | typeof PUMP_AMM_ERROR__TRUNCATION | typeof PUMP_AMM_ERROR__UNSORTED_NOT_UNIQUE_PROTOCOL_FEE_RECIPIENTS | typeof PUMP_AMM_ERROR__UNSUPPORTED_BASE_MINT | typeof PUMP_AMM_ERROR__UNSUPPORTED_QUOTE_MINT | typeof PUMP_AMM_ERROR__ZERO_BASE_AMOUNT | typeof PUMP_AMM_ERROR__ZERO_QUOTE_AMOUNT;
|
|
65
|
+
export type PumpAmmError = typeof PUMP_AMM_ERROR__ACCOUNT_TYPE_NOT_SUPPORTED | typeof PUMP_AMM_ERROR__ALL_PROTOCOL_FEE_RECIPIENTS_SHOULD_BE_NON_ZERO | typeof PUMP_AMM_ERROR__BUY_MORE_BASE_AMOUNT_THAN_POOL_RESERVES | typeof PUMP_AMM_ERROR__DISABLED_BUY | typeof PUMP_AMM_ERROR__DISABLED_CREATE_POOL | typeof PUMP_AMM_ERROR__DISABLED_DEPOSIT | typeof PUMP_AMM_ERROR__DISABLED_SELL | typeof PUMP_AMM_ERROR__DISABLED_WITHDRAW | typeof PUMP_AMM_ERROR__DIVISION_BY_ZERO | typeof PUMP_AMM_ERROR__EXCEEDED_SLIPPAGE | typeof PUMP_AMM_ERROR__FEE_BASIS_POINTS_EXCEEDS_MAXIMUM | typeof PUMP_AMM_ERROR__INVALID_ADMIN | typeof PUMP_AMM_ERROR__INVALID_BASE_MINT | typeof PUMP_AMM_ERROR__INVALID_LP_MINT | typeof PUMP_AMM_ERROR__INVALID_POOL_BASE_TOKEN_ACCOUNT | typeof PUMP_AMM_ERROR__INVALID_POOL_QUOTE_TOKEN_ACCOUNT | typeof PUMP_AMM_ERROR__INVALID_PROTOCOL_FEE_RECIPIENT | typeof PUMP_AMM_ERROR__INVALID_QUOTE_MINT | typeof PUMP_AMM_ERROR__NEW_SIZE_LESS_THAN_CURRENT_SIZE | typeof PUMP_AMM_ERROR__OVERFLOW | typeof PUMP_AMM_ERROR__SAME_MINT | typeof PUMP_AMM_ERROR__TOO_LITTLE_POOL_TOKEN_LIQUIDITY | typeof PUMP_AMM_ERROR__TRUNCATION | typeof PUMP_AMM_ERROR__UNSORTED_NOT_UNIQUE_PROTOCOL_FEE_RECIPIENTS | typeof PUMP_AMM_ERROR__UNSUPPORTED_BASE_MINT | typeof PUMP_AMM_ERROR__UNSUPPORTED_QUOTE_MINT | typeof PUMP_AMM_ERROR__ZERO_BASE_AMOUNT | typeof PUMP_AMM_ERROR__ZERO_QUOTE_AMOUNT;
|
|
92
66
|
export declare function getPumpAmmErrorMessage(code: PumpAmmError): string;
|
|
93
67
|
export declare function isPumpAmmError<TProgramErrorCode extends PumpAmmError>(error: unknown, transactionMessage: {
|
|
94
68
|
instructions: Record<number, {
|
|
@@ -5,83 +5,43 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner } from '@solana/kit';
|
|
9
9
|
import { PUMP_AMM_PROGRAM_ADDRESS } from '../programs';
|
|
10
|
-
import { type OptionBool, type OptionBoolArgs } from '../types';
|
|
11
10
|
export declare const BUY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
12
11
|
export declare function getBuyDiscriminatorBytes(): ReadonlyUint8Array;
|
|
13
|
-
export type BuyInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountPool extends string | AccountMeta<string> = string, TAccountUser extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountUserBaseTokenAccount extends string | AccountMeta<string> = string, TAccountUserQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountPoolBaseTokenAccount extends string | AccountMeta<string> = string, TAccountPoolQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountProtocolFeeRecipient extends string | AccountMeta<string> = string, TAccountProtocolFeeRecipientTokenAccount extends string | AccountMeta<string> = string, TAccountBaseTokenProgram extends string | AccountMeta<string> = string, TAccountQuoteTokenProgram extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountAssociatedTokenProgram extends string | AccountMeta<string> =
|
|
14
|
-
TAccountPool extends string ?
|
|
15
|
-
TAccountUser extends string ?
|
|
12
|
+
export type BuyInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountPool extends string | AccountMeta<string> = string, TAccountUser extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountUserBaseTokenAccount extends string | AccountMeta<string> = string, TAccountUserQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountPoolBaseTokenAccount extends string | AccountMeta<string> = string, TAccountPoolQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountProtocolFeeRecipient extends string | AccountMeta<string> = string, TAccountProtocolFeeRecipientTokenAccount extends string | AccountMeta<string> = string, TAccountBaseTokenProgram extends string | AccountMeta<string> = string, TAccountQuoteTokenProgram extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountAssociatedTokenProgram extends string | AccountMeta<string> = string, TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
+
TAccountPool extends string ? ReadonlyAccount<TAccountPool> : TAccountPool,
|
|
14
|
+
TAccountUser extends string ? ReadonlySignerAccount<TAccountUser> & AccountSignerMeta<TAccountUser> : TAccountUser,
|
|
16
15
|
TAccountGlobalConfig extends string ? ReadonlyAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
|
|
17
16
|
TAccountBaseMint extends string ? ReadonlyAccount<TAccountBaseMint> : TAccountBaseMint,
|
|
18
17
|
TAccountQuoteMint extends string ? ReadonlyAccount<TAccountQuoteMint> : TAccountQuoteMint,
|
|
19
|
-
TAccountUserBaseTokenAccount extends string ?
|
|
20
|
-
TAccountUserQuoteTokenAccount extends string ?
|
|
21
|
-
TAccountPoolBaseTokenAccount extends string ?
|
|
22
|
-
TAccountPoolQuoteTokenAccount extends string ?
|
|
18
|
+
TAccountUserBaseTokenAccount extends string ? ReadonlyAccount<TAccountUserBaseTokenAccount> : TAccountUserBaseTokenAccount,
|
|
19
|
+
TAccountUserQuoteTokenAccount extends string ? ReadonlyAccount<TAccountUserQuoteTokenAccount> : TAccountUserQuoteTokenAccount,
|
|
20
|
+
TAccountPoolBaseTokenAccount extends string ? ReadonlyAccount<TAccountPoolBaseTokenAccount> : TAccountPoolBaseTokenAccount,
|
|
21
|
+
TAccountPoolQuoteTokenAccount extends string ? ReadonlyAccount<TAccountPoolQuoteTokenAccount> : TAccountPoolQuoteTokenAccount,
|
|
23
22
|
TAccountProtocolFeeRecipient extends string ? ReadonlyAccount<TAccountProtocolFeeRecipient> : TAccountProtocolFeeRecipient,
|
|
24
|
-
TAccountProtocolFeeRecipientTokenAccount extends string ?
|
|
23
|
+
TAccountProtocolFeeRecipientTokenAccount extends string ? ReadonlyAccount<TAccountProtocolFeeRecipientTokenAccount> : TAccountProtocolFeeRecipientTokenAccount,
|
|
25
24
|
TAccountBaseTokenProgram extends string ? ReadonlyAccount<TAccountBaseTokenProgram> : TAccountBaseTokenProgram,
|
|
26
25
|
TAccountQuoteTokenProgram extends string ? ReadonlyAccount<TAccountQuoteTokenProgram> : TAccountQuoteTokenProgram,
|
|
27
26
|
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
28
27
|
TAccountAssociatedTokenProgram extends string ? ReadonlyAccount<TAccountAssociatedTokenProgram> : TAccountAssociatedTokenProgram,
|
|
29
28
|
TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
|
|
30
29
|
TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
|
|
31
|
-
TAccountCoinCreatorVaultAta extends string ? WritableAccount<TAccountCoinCreatorVaultAta> : TAccountCoinCreatorVaultAta,
|
|
32
|
-
TAccountCoinCreatorVaultAuthority extends string ? ReadonlyAccount<TAccountCoinCreatorVaultAuthority> : TAccountCoinCreatorVaultAuthority,
|
|
33
|
-
TAccountGlobalVolumeAccumulator extends string ? WritableAccount<TAccountGlobalVolumeAccumulator> : TAccountGlobalVolumeAccumulator,
|
|
34
|
-
TAccountUserVolumeAccumulator extends string ? WritableAccount<TAccountUserVolumeAccumulator> : TAccountUserVolumeAccumulator,
|
|
35
|
-
TAccountFeeConfig extends string ? ReadonlyAccount<TAccountFeeConfig> : TAccountFeeConfig,
|
|
36
|
-
TAccountFeeProgram extends string ? ReadonlyAccount<TAccountFeeProgram> : TAccountFeeProgram,
|
|
37
30
|
...TRemainingAccounts
|
|
38
31
|
]>;
|
|
39
32
|
export type BuyInstructionData = {
|
|
40
33
|
discriminator: ReadonlyUint8Array;
|
|
41
34
|
baseAmountOut: bigint;
|
|
42
35
|
maxQuoteAmountIn: bigint;
|
|
43
|
-
trackVolume: OptionBool;
|
|
44
36
|
};
|
|
45
37
|
export type BuyInstructionDataArgs = {
|
|
46
38
|
baseAmountOut: number | bigint;
|
|
47
39
|
maxQuoteAmountIn: number | bigint;
|
|
48
|
-
trackVolume: OptionBoolArgs;
|
|
49
40
|
};
|
|
50
41
|
export declare function getBuyInstructionDataEncoder(): FixedSizeEncoder<BuyInstructionDataArgs>;
|
|
51
42
|
export declare function getBuyInstructionDataDecoder(): FixedSizeDecoder<BuyInstructionData>;
|
|
52
43
|
export declare function getBuyInstructionDataCodec(): FixedSizeCodec<BuyInstructionDataArgs, BuyInstructionData>;
|
|
53
|
-
export type
|
|
54
|
-
pool: Address<TAccountPool>;
|
|
55
|
-
user: TransactionSigner<TAccountUser>;
|
|
56
|
-
globalConfig: Address<TAccountGlobalConfig>;
|
|
57
|
-
baseMint: Address<TAccountBaseMint>;
|
|
58
|
-
quoteMint: Address<TAccountQuoteMint>;
|
|
59
|
-
userBaseTokenAccount: Address<TAccountUserBaseTokenAccount>;
|
|
60
|
-
userQuoteTokenAccount: Address<TAccountUserQuoteTokenAccount>;
|
|
61
|
-
poolBaseTokenAccount: Address<TAccountPoolBaseTokenAccount>;
|
|
62
|
-
poolQuoteTokenAccount: Address<TAccountPoolQuoteTokenAccount>;
|
|
63
|
-
protocolFeeRecipient: Address<TAccountProtocolFeeRecipient>;
|
|
64
|
-
protocolFeeRecipientTokenAccount?: Address<TAccountProtocolFeeRecipientTokenAccount>;
|
|
65
|
-
baseTokenProgram: Address<TAccountBaseTokenProgram>;
|
|
66
|
-
quoteTokenProgram: Address<TAccountQuoteTokenProgram>;
|
|
67
|
-
systemProgram?: Address<TAccountSystemProgram>;
|
|
68
|
-
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
69
|
-
eventAuthority?: Address<TAccountEventAuthority>;
|
|
70
|
-
program?: Address<TAccountProgram>;
|
|
71
|
-
coinCreatorVaultAta?: Address<TAccountCoinCreatorVaultAta>;
|
|
72
|
-
coinCreatorVaultAuthority: Address<TAccountCoinCreatorVaultAuthority>;
|
|
73
|
-
globalVolumeAccumulator?: Address<TAccountGlobalVolumeAccumulator>;
|
|
74
|
-
userVolumeAccumulator?: Address<TAccountUserVolumeAccumulator>;
|
|
75
|
-
feeConfig?: Address<TAccountFeeConfig>;
|
|
76
|
-
feeProgram?: Address<TAccountFeeProgram>;
|
|
77
|
-
baseAmountOut: BuyInstructionDataArgs['baseAmountOut'];
|
|
78
|
-
maxQuoteAmountIn: BuyInstructionDataArgs['maxQuoteAmountIn'];
|
|
79
|
-
trackVolume: BuyInstructionDataArgs['trackVolume'];
|
|
80
|
-
};
|
|
81
|
-
export declare function getBuyInstructionAsync<TAccountPool extends string, TAccountUser extends string, TAccountGlobalConfig extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountUserBaseTokenAccount extends string, TAccountUserQuoteTokenAccount extends string, TAccountPoolBaseTokenAccount extends string, TAccountPoolQuoteTokenAccount extends string, TAccountProtocolFeeRecipient extends string, TAccountProtocolFeeRecipientTokenAccount extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TAccountSystemProgram extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TAccountCoinCreatorVaultAta extends string, TAccountCoinCreatorVaultAuthority extends string, TAccountGlobalVolumeAccumulator extends string, TAccountUserVolumeAccumulator extends string, TAccountFeeConfig extends string, TAccountFeeProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: BuyAsyncInput<TAccountPool, TAccountUser, TAccountGlobalConfig, TAccountBaseMint, TAccountQuoteMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountProtocolFeeRecipient, TAccountProtocolFeeRecipientTokenAccount, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountSystemProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram, TAccountCoinCreatorVaultAta, TAccountCoinCreatorVaultAuthority, TAccountGlobalVolumeAccumulator, TAccountUserVolumeAccumulator, TAccountFeeConfig, TAccountFeeProgram>, config?: {
|
|
82
|
-
programAddress?: TProgramAddress;
|
|
83
|
-
}): Promise<BuyInstruction<TProgramAddress, TAccountPool, TAccountUser, TAccountGlobalConfig, TAccountBaseMint, TAccountQuoteMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountProtocolFeeRecipient, TAccountProtocolFeeRecipientTokenAccount, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountSystemProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram, TAccountCoinCreatorVaultAta, TAccountCoinCreatorVaultAuthority, TAccountGlobalVolumeAccumulator, TAccountUserVolumeAccumulator, TAccountFeeConfig, TAccountFeeProgram>>;
|
|
84
|
-
export type BuyInput<TAccountPool extends string = string, TAccountUser extends string = string, TAccountGlobalConfig extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountUserBaseTokenAccount extends string = string, TAccountUserQuoteTokenAccount extends string = string, TAccountPoolBaseTokenAccount extends string = string, TAccountPoolQuoteTokenAccount extends string = string, TAccountProtocolFeeRecipient extends string = string, TAccountProtocolFeeRecipientTokenAccount extends string = string, TAccountBaseTokenProgram extends string = string, TAccountQuoteTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string, TAccountCoinCreatorVaultAta extends string = string, TAccountCoinCreatorVaultAuthority extends string = string, TAccountGlobalVolumeAccumulator extends string = string, TAccountUserVolumeAccumulator extends string = string, TAccountFeeConfig extends string = string, TAccountFeeProgram extends string = string> = {
|
|
44
|
+
export type BuyInput<TAccountPool extends string = string, TAccountUser extends string = string, TAccountGlobalConfig extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountUserBaseTokenAccount extends string = string, TAccountUserQuoteTokenAccount extends string = string, TAccountPoolBaseTokenAccount extends string = string, TAccountPoolQuoteTokenAccount extends string = string, TAccountProtocolFeeRecipient extends string = string, TAccountProtocolFeeRecipientTokenAccount extends string = string, TAccountBaseTokenProgram extends string = string, TAccountQuoteTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
|
|
85
45
|
pool: Address<TAccountPool>;
|
|
86
46
|
user: TransactionSigner<TAccountUser>;
|
|
87
47
|
globalConfig: Address<TAccountGlobalConfig>;
|
|
@@ -96,22 +56,15 @@ export type BuyInput<TAccountPool extends string = string, TAccountUser extends
|
|
|
96
56
|
baseTokenProgram: Address<TAccountBaseTokenProgram>;
|
|
97
57
|
quoteTokenProgram: Address<TAccountQuoteTokenProgram>;
|
|
98
58
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
99
|
-
associatedTokenProgram
|
|
59
|
+
associatedTokenProgram: Address<TAccountAssociatedTokenProgram>;
|
|
100
60
|
eventAuthority: Address<TAccountEventAuthority>;
|
|
101
|
-
program
|
|
102
|
-
coinCreatorVaultAta: Address<TAccountCoinCreatorVaultAta>;
|
|
103
|
-
coinCreatorVaultAuthority: Address<TAccountCoinCreatorVaultAuthority>;
|
|
104
|
-
globalVolumeAccumulator: Address<TAccountGlobalVolumeAccumulator>;
|
|
105
|
-
userVolumeAccumulator: Address<TAccountUserVolumeAccumulator>;
|
|
106
|
-
feeConfig: Address<TAccountFeeConfig>;
|
|
107
|
-
feeProgram?: Address<TAccountFeeProgram>;
|
|
61
|
+
program: Address<TAccountProgram>;
|
|
108
62
|
baseAmountOut: BuyInstructionDataArgs['baseAmountOut'];
|
|
109
63
|
maxQuoteAmountIn: BuyInstructionDataArgs['maxQuoteAmountIn'];
|
|
110
|
-
trackVolume: BuyInstructionDataArgs['trackVolume'];
|
|
111
64
|
};
|
|
112
|
-
export declare function getBuyInstruction<TAccountPool extends string, TAccountUser extends string, TAccountGlobalConfig extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountUserBaseTokenAccount extends string, TAccountUserQuoteTokenAccount extends string, TAccountPoolBaseTokenAccount extends string, TAccountPoolQuoteTokenAccount extends string, TAccountProtocolFeeRecipient extends string, TAccountProtocolFeeRecipientTokenAccount extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TAccountSystemProgram extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string,
|
|
65
|
+
export declare function getBuyInstruction<TAccountPool extends string, TAccountUser extends string, TAccountGlobalConfig extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountUserBaseTokenAccount extends string, TAccountUserQuoteTokenAccount extends string, TAccountPoolBaseTokenAccount extends string, TAccountPoolQuoteTokenAccount extends string, TAccountProtocolFeeRecipient extends string, TAccountProtocolFeeRecipientTokenAccount extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TAccountSystemProgram extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: BuyInput<TAccountPool, TAccountUser, TAccountGlobalConfig, TAccountBaseMint, TAccountQuoteMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountProtocolFeeRecipient, TAccountProtocolFeeRecipientTokenAccount, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountSystemProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
113
66
|
programAddress?: TProgramAddress;
|
|
114
|
-
}): BuyInstruction<TProgramAddress, TAccountPool, TAccountUser, TAccountGlobalConfig, TAccountBaseMint, TAccountQuoteMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountProtocolFeeRecipient, TAccountProtocolFeeRecipientTokenAccount, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountSystemProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram
|
|
67
|
+
}): BuyInstruction<TProgramAddress, TAccountPool, TAccountUser, TAccountGlobalConfig, TAccountBaseMint, TAccountQuoteMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountProtocolFeeRecipient, TAccountProtocolFeeRecipientTokenAccount, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountSystemProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram>;
|
|
115
68
|
export type ParsedBuyInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
116
69
|
programAddress: Address<TProgram>;
|
|
117
70
|
accounts: {
|
|
@@ -132,12 +85,6 @@ export type ParsedBuyInstruction<TProgram extends string = typeof PUMP_AMM_PROGR
|
|
|
132
85
|
associatedTokenProgram: TAccountMetas[14];
|
|
133
86
|
eventAuthority: TAccountMetas[15];
|
|
134
87
|
program: TAccountMetas[16];
|
|
135
|
-
coinCreatorVaultAta: TAccountMetas[17];
|
|
136
|
-
coinCreatorVaultAuthority: TAccountMetas[18];
|
|
137
|
-
globalVolumeAccumulator: TAccountMetas[19];
|
|
138
|
-
userVolumeAccumulator: TAccountMetas[20];
|
|
139
|
-
feeConfig: TAccountMetas[21];
|
|
140
|
-
feeProgram: TAccountMetas[22];
|
|
141
88
|
};
|
|
142
89
|
data: BuyInstructionData;
|
|
143
90
|
};
|
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner } from '@solana/kit';
|
|
9
9
|
import { PUMP_AMM_PROGRAM_ADDRESS } from '../programs';
|
|
10
10
|
export declare const CREATE_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
11
|
export declare function getCreateConfigDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type CreateConfigInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountAdmin extends string | AccountMeta<string> =
|
|
13
|
-
TAccountAdmin extends string ?
|
|
14
|
-
TAccountGlobalConfig extends string ?
|
|
12
|
+
export type CreateConfigInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountAdmin extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
+
TAccountAdmin extends string ? ReadonlySignerAccount<TAccountAdmin> & AccountSignerMeta<TAccountAdmin> : TAccountAdmin,
|
|
14
|
+
TAccountGlobalConfig extends string ? ReadonlyAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
|
|
15
15
|
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
16
16
|
TAccountEventAuthority extends string ? ReadonlyAccount<TAccountEventAuthority> : TAccountEventAuthority,
|
|
17
17
|
TAccountProgram extends string ? ReadonlyAccount<TAccountProgram> : TAccountProgram,
|
|
@@ -22,36 +22,17 @@ export type CreateConfigInstructionData = {
|
|
|
22
22
|
lpFeeBasisPoints: bigint;
|
|
23
23
|
protocolFeeBasisPoints: bigint;
|
|
24
24
|
protocolFeeRecipients: Array<Address>;
|
|
25
|
-
coinCreatorFeeBasisPoints: bigint;
|
|
26
|
-
adminSetCoinCreatorAuthority: Address;
|
|
27
25
|
};
|
|
28
26
|
export type CreateConfigInstructionDataArgs = {
|
|
29
27
|
lpFeeBasisPoints: number | bigint;
|
|
30
28
|
protocolFeeBasisPoints: number | bigint;
|
|
31
29
|
protocolFeeRecipients: Array<Address>;
|
|
32
|
-
coinCreatorFeeBasisPoints: number | bigint;
|
|
33
|
-
adminSetCoinCreatorAuthority: Address;
|
|
34
30
|
};
|
|
35
31
|
export declare function getCreateConfigInstructionDataEncoder(): FixedSizeEncoder<CreateConfigInstructionDataArgs>;
|
|
36
32
|
export declare function getCreateConfigInstructionDataDecoder(): FixedSizeDecoder<CreateConfigInstructionData>;
|
|
37
33
|
export declare function getCreateConfigInstructionDataCodec(): FixedSizeCodec<CreateConfigInstructionDataArgs, CreateConfigInstructionData>;
|
|
38
|
-
export type CreateConfigAsyncInput<TAccountAdmin extends string = string, TAccountGlobalConfig extends string = string, TAccountSystemProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
|
|
39
|
-
admin?: TransactionSigner<TAccountAdmin>;
|
|
40
|
-
globalConfig?: Address<TAccountGlobalConfig>;
|
|
41
|
-
systemProgram?: Address<TAccountSystemProgram>;
|
|
42
|
-
eventAuthority?: Address<TAccountEventAuthority>;
|
|
43
|
-
program: Address<TAccountProgram>;
|
|
44
|
-
lpFeeBasisPoints: CreateConfigInstructionDataArgs['lpFeeBasisPoints'];
|
|
45
|
-
protocolFeeBasisPoints: CreateConfigInstructionDataArgs['protocolFeeBasisPoints'];
|
|
46
|
-
protocolFeeRecipients: CreateConfigInstructionDataArgs['protocolFeeRecipients'];
|
|
47
|
-
coinCreatorFeeBasisPoints: CreateConfigInstructionDataArgs['coinCreatorFeeBasisPoints'];
|
|
48
|
-
adminSetCoinCreatorAuthority: CreateConfigInstructionDataArgs['adminSetCoinCreatorAuthority'];
|
|
49
|
-
};
|
|
50
|
-
export declare function getCreateConfigInstructionAsync<TAccountAdmin extends string, TAccountGlobalConfig extends string, TAccountSystemProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: CreateConfigAsyncInput<TAccountAdmin, TAccountGlobalConfig, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
51
|
-
programAddress?: TProgramAddress;
|
|
52
|
-
}): Promise<CreateConfigInstruction<TProgramAddress, TAccountAdmin, TAccountGlobalConfig, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>>;
|
|
53
34
|
export type CreateConfigInput<TAccountAdmin extends string = string, TAccountGlobalConfig extends string = string, TAccountSystemProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
|
|
54
|
-
admin
|
|
35
|
+
admin: TransactionSigner<TAccountAdmin>;
|
|
55
36
|
globalConfig: Address<TAccountGlobalConfig>;
|
|
56
37
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
57
38
|
eventAuthority: Address<TAccountEventAuthority>;
|
|
@@ -59,8 +40,6 @@ export type CreateConfigInput<TAccountAdmin extends string = string, TAccountGlo
|
|
|
59
40
|
lpFeeBasisPoints: CreateConfigInstructionDataArgs['lpFeeBasisPoints'];
|
|
60
41
|
protocolFeeBasisPoints: CreateConfigInstructionDataArgs['protocolFeeBasisPoints'];
|
|
61
42
|
protocolFeeRecipients: CreateConfigInstructionDataArgs['protocolFeeRecipients'];
|
|
62
|
-
coinCreatorFeeBasisPoints: CreateConfigInstructionDataArgs['coinCreatorFeeBasisPoints'];
|
|
63
|
-
adminSetCoinCreatorAuthority: CreateConfigInstructionDataArgs['adminSetCoinCreatorAuthority'];
|
|
64
43
|
};
|
|
65
44
|
export declare function getCreateConfigInstruction<TAccountAdmin extends string, TAccountGlobalConfig extends string, TAccountSystemProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: CreateConfigInput<TAccountAdmin, TAccountGlobalConfig, TAccountSystemProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
66
45
|
programAddress?: TProgramAddress;
|
|
@@ -5,22 +5,22 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
|
-
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type
|
|
8
|
+
import { type AccountMeta, type AccountSignerMeta, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type Instruction, type InstructionWithAccounts, type InstructionWithData, type ReadonlyAccount, type ReadonlySignerAccount, type ReadonlyUint8Array, type TransactionSigner } from '@solana/kit';
|
|
9
9
|
import { PUMP_AMM_PROGRAM_ADDRESS } from '../programs';
|
|
10
10
|
export declare const CREATE_POOL_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
11
11
|
export declare function getCreatePoolDiscriminatorBytes(): ReadonlyUint8Array;
|
|
12
|
-
export type CreatePoolInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountPool extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountLpMint extends string | AccountMeta<string> = string, TAccountUserBaseTokenAccount extends string | AccountMeta<string> = string, TAccountUserQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountUserPoolTokenAccount extends string | AccountMeta<string> = string, TAccountPoolBaseTokenAccount extends string | AccountMeta<string> = string, TAccountPoolQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountToken2022Program extends string | AccountMeta<string> =
|
|
13
|
-
TAccountPool extends string ?
|
|
12
|
+
export type CreatePoolInstruction<TProgram extends string = typeof PUMP_AMM_PROGRAM_ADDRESS, TAccountPool extends string | AccountMeta<string> = string, TAccountGlobalConfig extends string | AccountMeta<string> = string, TAccountCreator extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountLpMint extends string | AccountMeta<string> = string, TAccountUserBaseTokenAccount extends string | AccountMeta<string> = string, TAccountUserQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountUserPoolTokenAccount extends string | AccountMeta<string> = string, TAccountPoolBaseTokenAccount extends string | AccountMeta<string> = string, TAccountPoolQuoteTokenAccount extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountToken2022Program extends string | AccountMeta<string> = string, TAccountBaseTokenProgram extends string | AccountMeta<string> = string, TAccountQuoteTokenProgram extends string | AccountMeta<string> = string, TAccountAssociatedTokenProgram extends string | AccountMeta<string> = string, TAccountEventAuthority extends string | AccountMeta<string> = string, TAccountProgram extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
13
|
+
TAccountPool extends string ? ReadonlyAccount<TAccountPool> : TAccountPool,
|
|
14
14
|
TAccountGlobalConfig extends string ? ReadonlyAccount<TAccountGlobalConfig> : TAccountGlobalConfig,
|
|
15
|
-
TAccountCreator extends string ?
|
|
15
|
+
TAccountCreator extends string ? ReadonlySignerAccount<TAccountCreator> & AccountSignerMeta<TAccountCreator> : TAccountCreator,
|
|
16
16
|
TAccountBaseMint extends string ? ReadonlyAccount<TAccountBaseMint> : TAccountBaseMint,
|
|
17
17
|
TAccountQuoteMint extends string ? ReadonlyAccount<TAccountQuoteMint> : TAccountQuoteMint,
|
|
18
|
-
TAccountLpMint extends string ?
|
|
19
|
-
TAccountUserBaseTokenAccount extends string ?
|
|
20
|
-
TAccountUserQuoteTokenAccount extends string ?
|
|
21
|
-
TAccountUserPoolTokenAccount extends string ?
|
|
22
|
-
TAccountPoolBaseTokenAccount extends string ?
|
|
23
|
-
TAccountPoolQuoteTokenAccount extends string ?
|
|
18
|
+
TAccountLpMint extends string ? ReadonlyAccount<TAccountLpMint> : TAccountLpMint,
|
|
19
|
+
TAccountUserBaseTokenAccount extends string ? ReadonlyAccount<TAccountUserBaseTokenAccount> : TAccountUserBaseTokenAccount,
|
|
20
|
+
TAccountUserQuoteTokenAccount extends string ? ReadonlyAccount<TAccountUserQuoteTokenAccount> : TAccountUserQuoteTokenAccount,
|
|
21
|
+
TAccountUserPoolTokenAccount extends string ? ReadonlyAccount<TAccountUserPoolTokenAccount> : TAccountUserPoolTokenAccount,
|
|
22
|
+
TAccountPoolBaseTokenAccount extends string ? ReadonlyAccount<TAccountPoolBaseTokenAccount> : TAccountPoolBaseTokenAccount,
|
|
23
|
+
TAccountPoolQuoteTokenAccount extends string ? ReadonlyAccount<TAccountPoolQuoteTokenAccount> : TAccountPoolQuoteTokenAccount,
|
|
24
24
|
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
25
25
|
TAccountToken2022Program extends string ? ReadonlyAccount<TAccountToken2022Program> : TAccountToken2022Program,
|
|
26
26
|
TAccountBaseTokenProgram extends string ? ReadonlyAccount<TAccountBaseTokenProgram> : TAccountBaseTokenProgram,
|
|
@@ -35,44 +35,15 @@ export type CreatePoolInstructionData = {
|
|
|
35
35
|
index: number;
|
|
36
36
|
baseAmountIn: bigint;
|
|
37
37
|
quoteAmountIn: bigint;
|
|
38
|
-
coinCreator: Address;
|
|
39
38
|
};
|
|
40
39
|
export type CreatePoolInstructionDataArgs = {
|
|
41
40
|
index: number;
|
|
42
41
|
baseAmountIn: number | bigint;
|
|
43
42
|
quoteAmountIn: number | bigint;
|
|
44
|
-
coinCreator: Address;
|
|
45
43
|
};
|
|
46
44
|
export declare function getCreatePoolInstructionDataEncoder(): FixedSizeEncoder<CreatePoolInstructionDataArgs>;
|
|
47
45
|
export declare function getCreatePoolInstructionDataDecoder(): FixedSizeDecoder<CreatePoolInstructionData>;
|
|
48
46
|
export declare function getCreatePoolInstructionDataCodec(): FixedSizeCodec<CreatePoolInstructionDataArgs, CreatePoolInstructionData>;
|
|
49
|
-
export type CreatePoolAsyncInput<TAccountPool extends string = string, TAccountGlobalConfig extends string = string, TAccountCreator extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountLpMint extends string = string, TAccountUserBaseTokenAccount extends string = string, TAccountUserQuoteTokenAccount extends string = string, TAccountUserPoolTokenAccount extends string = string, TAccountPoolBaseTokenAccount extends string = string, TAccountPoolQuoteTokenAccount extends string = string, TAccountSystemProgram extends string = string, TAccountToken2022Program extends string = string, TAccountBaseTokenProgram extends string = string, TAccountQuoteTokenProgram extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
|
|
50
|
-
pool?: Address<TAccountPool>;
|
|
51
|
-
globalConfig: Address<TAccountGlobalConfig>;
|
|
52
|
-
creator: TransactionSigner<TAccountCreator>;
|
|
53
|
-
baseMint: Address<TAccountBaseMint>;
|
|
54
|
-
quoteMint: Address<TAccountQuoteMint>;
|
|
55
|
-
lpMint?: Address<TAccountLpMint>;
|
|
56
|
-
userBaseTokenAccount: Address<TAccountUserBaseTokenAccount>;
|
|
57
|
-
userQuoteTokenAccount: Address<TAccountUserQuoteTokenAccount>;
|
|
58
|
-
userPoolTokenAccount?: Address<TAccountUserPoolTokenAccount>;
|
|
59
|
-
poolBaseTokenAccount?: Address<TAccountPoolBaseTokenAccount>;
|
|
60
|
-
poolQuoteTokenAccount?: Address<TAccountPoolQuoteTokenAccount>;
|
|
61
|
-
systemProgram?: Address<TAccountSystemProgram>;
|
|
62
|
-
token2022Program?: Address<TAccountToken2022Program>;
|
|
63
|
-
baseTokenProgram: Address<TAccountBaseTokenProgram>;
|
|
64
|
-
quoteTokenProgram: Address<TAccountQuoteTokenProgram>;
|
|
65
|
-
associatedTokenProgram?: Address<TAccountAssociatedTokenProgram>;
|
|
66
|
-
eventAuthority?: Address<TAccountEventAuthority>;
|
|
67
|
-
program: Address<TAccountProgram>;
|
|
68
|
-
index: CreatePoolInstructionDataArgs['index'];
|
|
69
|
-
baseAmountIn: CreatePoolInstructionDataArgs['baseAmountIn'];
|
|
70
|
-
quoteAmountIn: CreatePoolInstructionDataArgs['quoteAmountIn'];
|
|
71
|
-
coinCreator: CreatePoolInstructionDataArgs['coinCreator'];
|
|
72
|
-
};
|
|
73
|
-
export declare function getCreatePoolInstructionAsync<TAccountPool extends string, TAccountGlobalConfig extends string, TAccountCreator extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountLpMint extends string, TAccountUserBaseTokenAccount extends string, TAccountUserQuoteTokenAccount extends string, TAccountUserPoolTokenAccount extends string, TAccountPoolBaseTokenAccount extends string, TAccountPoolQuoteTokenAccount extends string, TAccountSystemProgram extends string, TAccountToken2022Program extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: CreatePoolAsyncInput<TAccountPool, TAccountGlobalConfig, TAccountCreator, TAccountBaseMint, TAccountQuoteMint, TAccountLpMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountUserPoolTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountSystemProgram, TAccountToken2022Program, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
74
|
-
programAddress?: TProgramAddress;
|
|
75
|
-
}): Promise<CreatePoolInstruction<TProgramAddress, TAccountPool, TAccountGlobalConfig, TAccountCreator, TAccountBaseMint, TAccountQuoteMint, TAccountLpMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountUserPoolTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountSystemProgram, TAccountToken2022Program, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram>>;
|
|
76
47
|
export type CreatePoolInput<TAccountPool extends string = string, TAccountGlobalConfig extends string = string, TAccountCreator extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountLpMint extends string = string, TAccountUserBaseTokenAccount extends string = string, TAccountUserQuoteTokenAccount extends string = string, TAccountUserPoolTokenAccount extends string = string, TAccountPoolBaseTokenAccount extends string = string, TAccountPoolQuoteTokenAccount extends string = string, TAccountSystemProgram extends string = string, TAccountToken2022Program extends string = string, TAccountBaseTokenProgram extends string = string, TAccountQuoteTokenProgram extends string = string, TAccountAssociatedTokenProgram extends string = string, TAccountEventAuthority extends string = string, TAccountProgram extends string = string> = {
|
|
77
48
|
pool: Address<TAccountPool>;
|
|
78
49
|
globalConfig: Address<TAccountGlobalConfig>;
|
|
@@ -86,16 +57,15 @@ export type CreatePoolInput<TAccountPool extends string = string, TAccountGlobal
|
|
|
86
57
|
poolBaseTokenAccount: Address<TAccountPoolBaseTokenAccount>;
|
|
87
58
|
poolQuoteTokenAccount: Address<TAccountPoolQuoteTokenAccount>;
|
|
88
59
|
systemProgram?: Address<TAccountSystemProgram>;
|
|
89
|
-
token2022Program
|
|
60
|
+
token2022Program: Address<TAccountToken2022Program>;
|
|
90
61
|
baseTokenProgram: Address<TAccountBaseTokenProgram>;
|
|
91
62
|
quoteTokenProgram: Address<TAccountQuoteTokenProgram>;
|
|
92
|
-
associatedTokenProgram
|
|
63
|
+
associatedTokenProgram: Address<TAccountAssociatedTokenProgram>;
|
|
93
64
|
eventAuthority: Address<TAccountEventAuthority>;
|
|
94
65
|
program: Address<TAccountProgram>;
|
|
95
66
|
index: CreatePoolInstructionDataArgs['index'];
|
|
96
67
|
baseAmountIn: CreatePoolInstructionDataArgs['baseAmountIn'];
|
|
97
68
|
quoteAmountIn: CreatePoolInstructionDataArgs['quoteAmountIn'];
|
|
98
|
-
coinCreator: CreatePoolInstructionDataArgs['coinCreator'];
|
|
99
69
|
};
|
|
100
70
|
export declare function getCreatePoolInstruction<TAccountPool extends string, TAccountGlobalConfig extends string, TAccountCreator extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountLpMint extends string, TAccountUserBaseTokenAccount extends string, TAccountUserQuoteTokenAccount extends string, TAccountUserPoolTokenAccount extends string, TAccountPoolBaseTokenAccount extends string, TAccountPoolQuoteTokenAccount extends string, TAccountSystemProgram extends string, TAccountToken2022Program extends string, TAccountBaseTokenProgram extends string, TAccountQuoteTokenProgram extends string, TAccountAssociatedTokenProgram extends string, TAccountEventAuthority extends string, TAccountProgram extends string, TProgramAddress extends Address = typeof PUMP_AMM_PROGRAM_ADDRESS>(input: CreatePoolInput<TAccountPool, TAccountGlobalConfig, TAccountCreator, TAccountBaseMint, TAccountQuoteMint, TAccountLpMint, TAccountUserBaseTokenAccount, TAccountUserQuoteTokenAccount, TAccountUserPoolTokenAccount, TAccountPoolBaseTokenAccount, TAccountPoolQuoteTokenAccount, TAccountSystemProgram, TAccountToken2022Program, TAccountBaseTokenProgram, TAccountQuoteTokenProgram, TAccountAssociatedTokenProgram, TAccountEventAuthority, TAccountProgram>, config?: {
|
|
101
71
|
programAddress?: TProgramAddress;
|