@whetstone-research/doppler-sdk 1.0.28 → 1.0.30
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/dist/{chunk-U6B52TBT.cjs → chunk-4CI2M2F6.cjs} +27 -2
- package/dist/chunk-4CI2M2F6.cjs.map +1 -0
- package/dist/{chunk-4WY5GNZD.cjs → chunk-7PXLEMBJ.cjs} +336 -36
- package/dist/chunk-7PXLEMBJ.cjs.map +1 -0
- package/dist/{chunk-WD5VOZGI.js → chunk-AFXFT3BD.js} +24 -3
- package/dist/chunk-AFXFT3BD.js.map +1 -0
- package/dist/{chunk-AYVFWD5P.js → chunk-PSLY7M7C.js} +296 -4
- package/dist/chunk-PSLY7M7C.js.map +1 -0
- package/dist/{pda-H6VMGONM.cjs → pda-44IHEORD.cjs} +21 -17
- package/dist/pda-44IHEORD.cjs.map +1 -0
- package/dist/{pda-UJLXCO6I.js → pda-WJVDXQPW.js} +3 -3
- package/dist/pda-WJVDXQPW.js.map +1 -0
- package/dist/solana/index.cjs +1408 -1963
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +1294 -1376
- package/dist/solana/index.d.ts +1294 -1376
- package/dist/solana/index.js +1008 -1562
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +45 -45
- package/dist/solana/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-4WY5GNZD.cjs.map +0 -1
- package/dist/chunk-AYVFWD5P.js.map +0 -1
- package/dist/chunk-U6B52TBT.cjs.map +0 -1
- package/dist/chunk-WD5VOZGI.js.map +0 -1
- package/dist/pda-H6VMGONM.cjs.map +0 -1
- package/dist/pda-UJLXCO6I.js.map +0 -1
package/dist/solana/index.cjs
CHANGED
|
@@ -1,357 +1,368 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk7PXLEMBJ_cjs = require('../chunk-7PXLEMBJ.cjs');
|
|
4
|
+
var chunk4CI2M2F6_cjs = require('../chunk-4CI2M2F6.cjs');
|
|
5
5
|
var chunkQ7SFCCGT_cjs = require('../chunk-Q7SFCCGT.cjs');
|
|
6
6
|
var kit = require('@solana/kit');
|
|
7
7
|
var programClientCore = require('@solana/program-client-core');
|
|
8
8
|
var sha3_js = require('@noble/hashes/sha3.js');
|
|
9
9
|
var token = require('@solana-program/token');
|
|
10
|
-
var addressLookupTable = require('@solana-program/address-lookup-table');
|
|
11
10
|
var system = require('@solana-program/system');
|
|
11
|
+
var sysvars = require('@solana/sysvars');
|
|
12
|
+
var addressLookupTable = require('@solana-program/address-lookup-table');
|
|
12
13
|
|
|
13
14
|
// src/solana/cpmm/index.ts
|
|
14
15
|
var cpmm_exports = {};
|
|
15
16
|
chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
16
|
-
ACCOUNT_DISCRIMINATORS: () =>
|
|
17
|
-
ACCOUNT_VERSION: () =>
|
|
18
|
-
ADD_LIQUIDITY_DISCRIMINATOR: () =>
|
|
19
|
-
BPS_DENOM: () =>
|
|
20
|
-
CLOSE_POSITION_DISCRIMINATOR: () =>
|
|
21
|
-
COLLECT_FEES_DISCRIMINATOR: () =>
|
|
22
|
-
COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () =>
|
|
17
|
+
ACCOUNT_DISCRIMINATORS: () => chunk4CI2M2F6_cjs.ACCOUNT_DISCRIMINATORS,
|
|
18
|
+
ACCOUNT_VERSION: () => chunk4CI2M2F6_cjs.ACCOUNT_VERSION,
|
|
19
|
+
ADD_LIQUIDITY_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.ADD_LIQUIDITY_DISCRIMINATOR,
|
|
20
|
+
BPS_DENOM: () => chunk4CI2M2F6_cjs.BPS_DENOM,
|
|
21
|
+
CLOSE_POSITION_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.CLOSE_POSITION_DISCRIMINATOR,
|
|
22
|
+
COLLECT_FEES_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.COLLECT_FEES_DISCRIMINATOR,
|
|
23
|
+
COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.COLLECT_PROTOCOL_FEES_DISCRIMINATOR,
|
|
23
24
|
CPMM_ERROR_MESSAGES: () => CPMM_ERROR_MESSAGES,
|
|
24
|
-
CPMM_PROGRAM_ID: () =>
|
|
25
|
-
CREATE_POSITION_DISCRIMINATOR: () =>
|
|
25
|
+
CPMM_PROGRAM_ID: () => chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID,
|
|
26
|
+
CREATE_POSITION_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.CREATE_POSITION_DISCRIMINATOR,
|
|
26
27
|
CpmmError: () => CpmmError,
|
|
27
28
|
CpmmErrorCode: () => CpmmErrorCode,
|
|
28
|
-
HF_AFTER_ADD_LIQ: () =>
|
|
29
|
-
HF_AFTER_REMOVE_LIQ: () =>
|
|
30
|
-
HF_AFTER_SWAP: () =>
|
|
31
|
-
HF_BEFORE_ADD_LIQ: () =>
|
|
32
|
-
HF_BEFORE_REMOVE_LIQ: () =>
|
|
33
|
-
HF_BEFORE_SWAP: () =>
|
|
34
|
-
HF_FORWARD_READONLY_SIGNERS: () =>
|
|
35
|
-
HF_REQUIRE_ORACLE: () =>
|
|
36
|
-
HOOK_NO_CHANGE: () =>
|
|
37
|
-
INITIALIZE_CONFIG_DISCRIMINATOR: () =>
|
|
38
|
-
INITIALIZE_ORACLE_DISCRIMINATOR: () =>
|
|
39
|
-
INITIALIZE_POOL_DISCRIMINATOR: () =>
|
|
40
|
-
|
|
29
|
+
HF_AFTER_ADD_LIQ: () => chunk4CI2M2F6_cjs.HF_AFTER_ADD_LIQ,
|
|
30
|
+
HF_AFTER_REMOVE_LIQ: () => chunk4CI2M2F6_cjs.HF_AFTER_REMOVE_LIQ,
|
|
31
|
+
HF_AFTER_SWAP: () => chunk4CI2M2F6_cjs.HF_AFTER_SWAP,
|
|
32
|
+
HF_BEFORE_ADD_LIQ: () => chunk4CI2M2F6_cjs.HF_BEFORE_ADD_LIQ,
|
|
33
|
+
HF_BEFORE_REMOVE_LIQ: () => chunk4CI2M2F6_cjs.HF_BEFORE_REMOVE_LIQ,
|
|
34
|
+
HF_BEFORE_SWAP: () => chunk4CI2M2F6_cjs.HF_BEFORE_SWAP,
|
|
35
|
+
HF_FORWARD_READONLY_SIGNERS: () => chunk4CI2M2F6_cjs.HF_FORWARD_READONLY_SIGNERS,
|
|
36
|
+
HF_REQUIRE_ORACLE: () => chunk4CI2M2F6_cjs.HF_REQUIRE_ORACLE,
|
|
37
|
+
HOOK_NO_CHANGE: () => chunk4CI2M2F6_cjs.HOOK_NO_CHANGE,
|
|
38
|
+
INITIALIZE_CONFIG_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.INITIALIZE_CONFIG_DISCRIMINATOR,
|
|
39
|
+
INITIALIZE_ORACLE_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.INITIALIZE_ORACLE_DISCRIMINATOR,
|
|
40
|
+
INITIALIZE_POOL_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.INITIALIZE_POOL_DISCRIMINATOR,
|
|
41
|
+
INITIALIZE_SPOT_POOL_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.INITIALIZE_SPOT_POOL_DISCRIMINATOR,
|
|
42
|
+
INSTRUCTION_DISCRIMINATORS: () => chunk4CI2M2F6_cjs.INSTRUCTION_DISCRIMINATORS,
|
|
41
43
|
MAX_FEE_AMOUNT: () => MAX_FEE_AMOUNT,
|
|
42
|
-
MAX_HOOK_ALLOWLIST: () =>
|
|
43
|
-
MAX_ORACLE_OBSERVATIONS: () =>
|
|
44
|
-
ORACLE_CONSULT_DISCRIMINATOR: () =>
|
|
45
|
-
ORACLE_UPDATE_DISCRIMINATOR: () =>
|
|
46
|
-
PAUSE_DISCRIMINATOR: () =>
|
|
47
|
-
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () =>
|
|
48
|
-
Q64_ONE: () =>
|
|
49
|
-
REDEEM_PROTOCOL_SHARES_DISCRIMINATOR: () =>
|
|
50
|
-
REMOVE_LIQUIDITY_DISCRIMINATOR: () =>
|
|
51
|
-
SEED_AUTHORITY: () =>
|
|
52
|
-
SEED_CONFIG: () =>
|
|
53
|
-
SEED_ORACLE: () =>
|
|
54
|
-
SEED_POOL: () =>
|
|
55
|
-
SEED_POSITION: () =>
|
|
56
|
-
SEED_PROTOCOL_FEE_OWNER: () =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
44
|
+
MAX_HOOK_ALLOWLIST: () => chunk4CI2M2F6_cjs.MAX_HOOK_ALLOWLIST,
|
|
45
|
+
MAX_ORACLE_OBSERVATIONS: () => chunk4CI2M2F6_cjs.MAX_ORACLE_OBSERVATIONS,
|
|
46
|
+
ORACLE_CONSULT_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.ORACLE_CONSULT_DISCRIMINATOR,
|
|
47
|
+
ORACLE_UPDATE_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.ORACLE_UPDATE_DISCRIMINATOR,
|
|
48
|
+
PAUSE_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.PAUSE_DISCRIMINATOR,
|
|
49
|
+
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,
|
|
50
|
+
Q64_ONE: () => chunk4CI2M2F6_cjs.Q64_ONE,
|
|
51
|
+
REDEEM_PROTOCOL_SHARES_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.REDEEM_PROTOCOL_SHARES_DISCRIMINATOR,
|
|
52
|
+
REMOVE_LIQUIDITY_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.REMOVE_LIQUIDITY_DISCRIMINATOR,
|
|
53
|
+
SEED_AUTHORITY: () => chunk4CI2M2F6_cjs.SEED_AUTHORITY,
|
|
54
|
+
SEED_CONFIG: () => chunk4CI2M2F6_cjs.SEED_CONFIG,
|
|
55
|
+
SEED_ORACLE: () => chunk4CI2M2F6_cjs.SEED_ORACLE,
|
|
56
|
+
SEED_POOL: () => chunk4CI2M2F6_cjs.SEED_POOL,
|
|
57
|
+
SEED_POSITION: () => chunk4CI2M2F6_cjs.SEED_POSITION,
|
|
58
|
+
SEED_PROTOCOL_FEE_OWNER: () => chunk4CI2M2F6_cjs.SEED_PROTOCOL_FEE_OWNER,
|
|
59
|
+
SEED_SPOT_POOL: () => chunk4CI2M2F6_cjs.SEED_SPOT_POOL,
|
|
60
|
+
SET_FEES_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.SET_FEES_DISCRIMINATOR,
|
|
61
|
+
SET_HOOK_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.SET_HOOK_DISCRIMINATOR,
|
|
62
|
+
SWAP_EXACT_IN_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.SWAP_EXACT_IN_DISCRIMINATOR,
|
|
63
|
+
TOKEN_METADATA_PROGRAM_ID: () => chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
64
|
+
TRANSFER_ADMIN_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.TRANSFER_ADMIN_DISCRIMINATOR,
|
|
65
|
+
UNPAUSE_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.UNPAUSE_DISCRIMINATOR,
|
|
66
|
+
UPDATE_CONFIG_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.UPDATE_CONFIG_DISCRIMINATOR,
|
|
67
|
+
WITHDRAW_VAULT_EXCESS_DISCRIMINATOR: () => chunk7PXLEMBJ_cjs.WITHDRAW_VAULT_EXCESS_DISCRIMINATOR,
|
|
68
|
+
addLiquidityArgsCodec: () => chunk7PXLEMBJ_cjs.addLiquidityArgsCodec,
|
|
69
|
+
addressToBase58EncodedBytes: () => chunk7PXLEMBJ_cjs.addressToBase58EncodedBytes,
|
|
70
|
+
ammConfigDataCodec: () => chunk7PXLEMBJ_cjs.ammConfigDataCodec,
|
|
71
|
+
areMintsOrdered: () => chunk4CI2M2F6_cjs.areMintsOrdered,
|
|
72
|
+
base64ToBytes: () => chunk7PXLEMBJ_cjs.base64ToBytes,
|
|
73
|
+
bytesToBase64: () => chunk7PXLEMBJ_cjs.bytesToBase64,
|
|
74
|
+
bytesToBase64EncodedBytes: () => chunk7PXLEMBJ_cjs.bytesToBase64EncodedBytes,
|
|
75
|
+
calculateAccruedFees: () => chunk7PXLEMBJ_cjs.calculateAccruedFees,
|
|
76
|
+
calculateTwap: () => chunk7PXLEMBJ_cjs.calculateTwap,
|
|
77
|
+
calculateTwapNumber: () => chunk7PXLEMBJ_cjs.calculateTwapNumber,
|
|
78
|
+
ceilDiv: () => chunk7PXLEMBJ_cjs.ceilDiv,
|
|
79
|
+
collectFeesArgsCodec: () => chunk7PXLEMBJ_cjs.collectFeesArgsCodec,
|
|
80
|
+
collectProtocolFeesArgsCodec: () => chunk7PXLEMBJ_cjs.collectProtocolFeesArgsCodec,
|
|
81
|
+
comparePoolAndOraclePrices: () => chunk7PXLEMBJ_cjs.comparePoolAndOraclePrices,
|
|
82
|
+
computePrice0Q64: () => chunk7PXLEMBJ_cjs.computePrice0Q64,
|
|
83
|
+
computePrice1Q64: () => chunk7PXLEMBJ_cjs.computePrice1Q64,
|
|
84
|
+
consultTwap: () => chunk7PXLEMBJ_cjs.consultTwap,
|
|
85
|
+
createAccountMeta: () => chunk7PXLEMBJ_cjs.createAccountMeta,
|
|
86
|
+
createAddLiquidityInstruction: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstruction,
|
|
87
|
+
createClosePositionInstruction: () => chunk7PXLEMBJ_cjs.getClosePositionInstruction,
|
|
88
|
+
createCollectFeesInstruction: () => chunk7PXLEMBJ_cjs.getCollectFeesInstruction,
|
|
89
|
+
createCollectProtocolFeesInstruction: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstruction,
|
|
90
|
+
createCreatePositionInstruction: () => chunk7PXLEMBJ_cjs.getCreatePositionInstruction,
|
|
91
|
+
createInitializeConfigInstruction: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstruction,
|
|
92
|
+
createInitializeOracleInstruction: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstruction,
|
|
93
|
+
createInitializePoolInstruction: () => chunk7PXLEMBJ_cjs.getInitializePoolInstruction,
|
|
94
|
+
createOracleConsultInstruction: () => chunk7PXLEMBJ_cjs.getOracleConsultInstruction,
|
|
95
|
+
createOracleUpdateInstruction: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstruction,
|
|
96
|
+
createPauseInstruction: () => chunk7PXLEMBJ_cjs.getPauseInstruction,
|
|
97
|
+
createPositionArgsCodec: () => chunk7PXLEMBJ_cjs.createPositionArgsCodec,
|
|
98
|
+
createReadonlyRemainingAccountMeta: () => chunk7PXLEMBJ_cjs.createReadonlyRemainingAccountMeta,
|
|
99
|
+
createRemoveLiquidityInstruction: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstruction,
|
|
100
|
+
createSetFeesInstruction: () => chunk7PXLEMBJ_cjs.getSetFeesInstruction,
|
|
101
|
+
createSetHookInstruction: () => chunk7PXLEMBJ_cjs.getSetHookInstruction,
|
|
102
|
+
createSwapExactInInstruction: () => chunk7PXLEMBJ_cjs.getSwapExactInInstruction,
|
|
100
103
|
createSwapInstruction: () => createSwapInstruction,
|
|
101
|
-
createTransferAdminInstruction: () =>
|
|
102
|
-
createUnpauseInstruction: () =>
|
|
103
|
-
createWithdrawVaultExcessInstruction: () =>
|
|
104
|
+
createTransferAdminInstruction: () => chunk7PXLEMBJ_cjs.getTransferAdminInstruction,
|
|
105
|
+
createUnpauseInstruction: () => chunk7PXLEMBJ_cjs.getUnpauseInstruction,
|
|
106
|
+
createWithdrawVaultExcessInstruction: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstruction,
|
|
104
107
|
curveParamsToMarketCap: () => curveParamsToMarketCap,
|
|
105
|
-
decodeAmmConfig: () =>
|
|
106
|
-
decodeOracleState: () =>
|
|
107
|
-
decodePool: () =>
|
|
108
|
-
decodePosition: () =>
|
|
109
|
-
encodeAddLiquidityArgs: () =>
|
|
110
|
-
encodeCollectFeesArgs: () =>
|
|
111
|
-
encodeCollectProtocolFeesArgs: () =>
|
|
112
|
-
encodeCreatePositionArgs: () =>
|
|
113
|
-
encodeInitializeConfigArgs: () =>
|
|
114
|
-
encodeInitializeOracleArgs: () =>
|
|
115
|
-
encodeInitializePoolArgs: () =>
|
|
116
|
-
encodeInstructionData: () =>
|
|
117
|
-
encodeOracleConsultArgs: () =>
|
|
118
|
-
encodeRemoveLiquidityArgs: () =>
|
|
119
|
-
encodeSetFeesArgs: () =>
|
|
120
|
-
encodeSetHookArgs: () =>
|
|
121
|
-
encodeSwapExactInArgs: () =>
|
|
122
|
-
encodeTransferAdminArgs: () =>
|
|
123
|
-
fetchAllPools: () =>
|
|
108
|
+
decodeAmmConfig: () => chunk7PXLEMBJ_cjs.decodeAmmConfig,
|
|
109
|
+
decodeOracleState: () => chunk7PXLEMBJ_cjs.decodeOracleState,
|
|
110
|
+
decodePool: () => chunk7PXLEMBJ_cjs.decodePool,
|
|
111
|
+
decodePosition: () => chunk7PXLEMBJ_cjs.decodePosition,
|
|
112
|
+
encodeAddLiquidityArgs: () => chunk7PXLEMBJ_cjs.encodeAddLiquidityArgs,
|
|
113
|
+
encodeCollectFeesArgs: () => chunk7PXLEMBJ_cjs.encodeCollectFeesArgs,
|
|
114
|
+
encodeCollectProtocolFeesArgs: () => chunk7PXLEMBJ_cjs.encodeCollectProtocolFeesArgs,
|
|
115
|
+
encodeCreatePositionArgs: () => chunk7PXLEMBJ_cjs.encodeCreatePositionArgs,
|
|
116
|
+
encodeInitializeConfigArgs: () => chunk7PXLEMBJ_cjs.encodeInitializeConfigArgs,
|
|
117
|
+
encodeInitializeOracleArgs: () => chunk7PXLEMBJ_cjs.encodeInitializeOracleArgs,
|
|
118
|
+
encodeInitializePoolArgs: () => chunk7PXLEMBJ_cjs.encodeInitializePoolArgs,
|
|
119
|
+
encodeInstructionData: () => chunk7PXLEMBJ_cjs.encodeInstructionData,
|
|
120
|
+
encodeOracleConsultArgs: () => chunk7PXLEMBJ_cjs.encodeOracleConsultArgs,
|
|
121
|
+
encodeRemoveLiquidityArgs: () => chunk7PXLEMBJ_cjs.encodeRemoveLiquidityArgs,
|
|
122
|
+
encodeSetFeesArgs: () => chunk7PXLEMBJ_cjs.encodeSetFeesArgs,
|
|
123
|
+
encodeSetHookArgs: () => chunk7PXLEMBJ_cjs.encodeSetHookArgs,
|
|
124
|
+
encodeSwapExactInArgs: () => chunk7PXLEMBJ_cjs.encodeSwapExactInArgs,
|
|
125
|
+
encodeTransferAdminArgs: () => chunk7PXLEMBJ_cjs.encodeTransferAdminArgs,
|
|
126
|
+
fetchAllPools: () => chunk7PXLEMBJ_cjs.fetchAllPools,
|
|
124
127
|
fetchConfig: () => fetchConfig,
|
|
125
128
|
fetchConfigWithAddress: () => fetchConfigWithAddress,
|
|
126
|
-
fetchOracle: () =>
|
|
127
|
-
fetchOraclesBatch: () =>
|
|
128
|
-
fetchPool: () =>
|
|
129
|
-
fetchPoolPositions: () =>
|
|
130
|
-
fetchPoolsBatch: () =>
|
|
131
|
-
fetchPosition: () =>
|
|
132
|
-
fetchPositionByParams: () =>
|
|
133
|
-
fetchPositionsBatch: () =>
|
|
134
|
-
fetchUserPositions: () =>
|
|
135
|
-
filterActivePositions: () =>
|
|
136
|
-
filterPoolsByMint: () =>
|
|
137
|
-
getAddLiquidityDiscriminatorBytes: () =>
|
|
138
|
-
getAddLiquidityInstruction: () =>
|
|
139
|
-
getAddLiquidityInstructionAsync: () =>
|
|
140
|
-
getAddLiquidityInstructionDataCodec: () =>
|
|
141
|
-
getAddLiquidityInstructionDataDecoder: () =>
|
|
142
|
-
getAddLiquidityInstructionDataEncoder: () =>
|
|
143
|
-
getAddLiquidityQuote: () =>
|
|
144
|
-
getAddressFromAddressOrSigner: () =>
|
|
145
|
-
getAddressFromRemainingAccount: () =>
|
|
146
|
-
getClosePositionDiscriminatorBytes: () =>
|
|
147
|
-
getClosePositionInstruction: () =>
|
|
148
|
-
getClosePositionInstructionDataCodec: () =>
|
|
149
|
-
getClosePositionInstructionDataDecoder: () =>
|
|
150
|
-
getClosePositionInstructionDataEncoder: () =>
|
|
151
|
-
getCollectFeesDiscriminatorBytes: () =>
|
|
152
|
-
getCollectFeesInstruction: () =>
|
|
153
|
-
getCollectFeesInstructionAsync: () =>
|
|
154
|
-
getCollectFeesInstructionDataCodec: () =>
|
|
155
|
-
getCollectFeesInstructionDataDecoder: () =>
|
|
156
|
-
getCollectFeesInstructionDataEncoder: () =>
|
|
157
|
-
getCollectProtocolFeesDiscriminatorBytes: () =>
|
|
158
|
-
getCollectProtocolFeesInstruction: () =>
|
|
159
|
-
getCollectProtocolFeesInstructionAsync: () =>
|
|
160
|
-
getCollectProtocolFeesInstructionDataCodec: () =>
|
|
161
|
-
getCollectProtocolFeesInstructionDataDecoder: () =>
|
|
162
|
-
getCollectProtocolFeesInstructionDataEncoder: () =>
|
|
163
|
-
getConfigAddress: () =>
|
|
164
|
-
getCreatePositionDiscriminatorBytes: () =>
|
|
165
|
-
getCreatePositionInstruction: () =>
|
|
166
|
-
getCreatePositionInstructionAsync: () =>
|
|
167
|
-
getCreatePositionInstructionDataCodec: () =>
|
|
168
|
-
getCreatePositionInstructionDataDecoder: () =>
|
|
169
|
-
getCreatePositionInstructionDataEncoder: () =>
|
|
129
|
+
fetchOracle: () => chunk7PXLEMBJ_cjs.fetchOracle,
|
|
130
|
+
fetchOraclesBatch: () => chunk7PXLEMBJ_cjs.fetchOraclesBatch,
|
|
131
|
+
fetchPool: () => chunk7PXLEMBJ_cjs.fetchPool,
|
|
132
|
+
fetchPoolPositions: () => chunk7PXLEMBJ_cjs.fetchPoolPositions,
|
|
133
|
+
fetchPoolsBatch: () => chunk7PXLEMBJ_cjs.fetchPoolsBatch,
|
|
134
|
+
fetchPosition: () => chunk7PXLEMBJ_cjs.fetchPosition,
|
|
135
|
+
fetchPositionByParams: () => chunk7PXLEMBJ_cjs.fetchPositionByParams,
|
|
136
|
+
fetchPositionsBatch: () => chunk7PXLEMBJ_cjs.fetchPositionsBatch,
|
|
137
|
+
fetchUserPositions: () => chunk7PXLEMBJ_cjs.fetchUserPositions,
|
|
138
|
+
filterActivePositions: () => chunk7PXLEMBJ_cjs.filterActivePositions,
|
|
139
|
+
filterPoolsByMint: () => chunk7PXLEMBJ_cjs.filterPoolsByMint,
|
|
140
|
+
getAddLiquidityDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getAddLiquidityDiscriminatorBytes,
|
|
141
|
+
getAddLiquidityInstruction: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstruction,
|
|
142
|
+
getAddLiquidityInstructionAsync: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstructionAsync,
|
|
143
|
+
getAddLiquidityInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstructionDataCodec,
|
|
144
|
+
getAddLiquidityInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstructionDataDecoder,
|
|
145
|
+
getAddLiquidityInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getAddLiquidityInstructionDataEncoder,
|
|
146
|
+
getAddLiquidityQuote: () => chunk7PXLEMBJ_cjs.getAddLiquidityQuote,
|
|
147
|
+
getAddressFromAddressOrSigner: () => chunk7PXLEMBJ_cjs.getAddressFromAddressOrSigner,
|
|
148
|
+
getAddressFromRemainingAccount: () => chunk7PXLEMBJ_cjs.getAddressFromRemainingAccount,
|
|
149
|
+
getClosePositionDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getClosePositionDiscriminatorBytes,
|
|
150
|
+
getClosePositionInstruction: () => chunk7PXLEMBJ_cjs.getClosePositionInstruction,
|
|
151
|
+
getClosePositionInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getClosePositionInstructionDataCodec,
|
|
152
|
+
getClosePositionInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getClosePositionInstructionDataDecoder,
|
|
153
|
+
getClosePositionInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getClosePositionInstructionDataEncoder,
|
|
154
|
+
getCollectFeesDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getCollectFeesDiscriminatorBytes,
|
|
155
|
+
getCollectFeesInstruction: () => chunk7PXLEMBJ_cjs.getCollectFeesInstruction,
|
|
156
|
+
getCollectFeesInstructionAsync: () => chunk7PXLEMBJ_cjs.getCollectFeesInstructionAsync,
|
|
157
|
+
getCollectFeesInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getCollectFeesInstructionDataCodec,
|
|
158
|
+
getCollectFeesInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getCollectFeesInstructionDataDecoder,
|
|
159
|
+
getCollectFeesInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getCollectFeesInstructionDataEncoder,
|
|
160
|
+
getCollectProtocolFeesDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesDiscriminatorBytes,
|
|
161
|
+
getCollectProtocolFeesInstruction: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstruction,
|
|
162
|
+
getCollectProtocolFeesInstructionAsync: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstructionAsync,
|
|
163
|
+
getCollectProtocolFeesInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstructionDataCodec,
|
|
164
|
+
getCollectProtocolFeesInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstructionDataDecoder,
|
|
165
|
+
getCollectProtocolFeesInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getCollectProtocolFeesInstructionDataEncoder,
|
|
166
|
+
getConfigAddress: () => chunk4CI2M2F6_cjs.getConfigAddress,
|
|
167
|
+
getCreatePositionDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getCreatePositionDiscriminatorBytes,
|
|
168
|
+
getCreatePositionInstruction: () => chunk7PXLEMBJ_cjs.getCreatePositionInstruction,
|
|
169
|
+
getCreatePositionInstructionAsync: () => chunk7PXLEMBJ_cjs.getCreatePositionInstructionAsync,
|
|
170
|
+
getCreatePositionInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getCreatePositionInstructionDataCodec,
|
|
171
|
+
getCreatePositionInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getCreatePositionInstructionDataDecoder,
|
|
172
|
+
getCreatePositionInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getCreatePositionInstructionDataEncoder,
|
|
170
173
|
getErrorMessage: () => getErrorMessage,
|
|
171
|
-
getInitializeConfigDiscriminatorBytes: () =>
|
|
172
|
-
getInitializeConfigInstruction: () =>
|
|
173
|
-
getInitializeConfigInstructionAsync: () =>
|
|
174
|
-
getInitializeConfigInstructionDataCodec: () =>
|
|
175
|
-
getInitializeConfigInstructionDataDecoder: () =>
|
|
176
|
-
getInitializeConfigInstructionDataEncoder: () =>
|
|
177
|
-
getInitializeOracleDiscriminatorBytes: () =>
|
|
178
|
-
getInitializeOracleInstruction: () =>
|
|
179
|
-
getInitializeOracleInstructionAsync: () =>
|
|
180
|
-
getInitializeOracleInstructionDataCodec: () =>
|
|
181
|
-
getInitializeOracleInstructionDataDecoder: () =>
|
|
182
|
-
getInitializeOracleInstructionDataEncoder: () =>
|
|
183
|
-
getInitializePoolDiscriminatorBytes: () =>
|
|
184
|
-
getInitializePoolInstruction: () =>
|
|
185
|
-
getInitializePoolInstructionAsync: () =>
|
|
186
|
-
getInitializePoolInstructionDataCodec: () =>
|
|
187
|
-
getInitializePoolInstructionDataDecoder: () =>
|
|
188
|
-
getInitializePoolInstructionDataEncoder: () =>
|
|
189
|
-
|
|
190
|
-
|
|
174
|
+
getInitializeConfigDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getInitializeConfigDiscriminatorBytes,
|
|
175
|
+
getInitializeConfigInstruction: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstruction,
|
|
176
|
+
getInitializeConfigInstructionAsync: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstructionAsync,
|
|
177
|
+
getInitializeConfigInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstructionDataCodec,
|
|
178
|
+
getInitializeConfigInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstructionDataDecoder,
|
|
179
|
+
getInitializeConfigInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getInitializeConfigInstructionDataEncoder,
|
|
180
|
+
getInitializeOracleDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getInitializeOracleDiscriminatorBytes,
|
|
181
|
+
getInitializeOracleInstruction: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstruction,
|
|
182
|
+
getInitializeOracleInstructionAsync: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstructionAsync,
|
|
183
|
+
getInitializeOracleInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstructionDataCodec,
|
|
184
|
+
getInitializeOracleInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstructionDataDecoder,
|
|
185
|
+
getInitializeOracleInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getInitializeOracleInstructionDataEncoder,
|
|
186
|
+
getInitializePoolDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getInitializePoolDiscriminatorBytes,
|
|
187
|
+
getInitializePoolInstruction: () => chunk7PXLEMBJ_cjs.getInitializePoolInstruction,
|
|
188
|
+
getInitializePoolInstructionAsync: () => chunk7PXLEMBJ_cjs.getInitializePoolInstructionAsync,
|
|
189
|
+
getInitializePoolInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getInitializePoolInstructionDataCodec,
|
|
190
|
+
getInitializePoolInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getInitializePoolInstructionDataDecoder,
|
|
191
|
+
getInitializePoolInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getInitializePoolInstructionDataEncoder,
|
|
192
|
+
getInitializeSpotPoolDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolDiscriminatorBytes,
|
|
193
|
+
getInitializeSpotPoolInstruction: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolInstruction,
|
|
194
|
+
getInitializeSpotPoolInstructionAsync: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolInstructionAsync,
|
|
195
|
+
getInitializeSpotPoolInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolInstructionDataCodec,
|
|
196
|
+
getInitializeSpotPoolInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolInstructionDataDecoder,
|
|
197
|
+
getInitializeSpotPoolInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getInitializeSpotPoolInstructionDataEncoder,
|
|
198
|
+
getK: () => chunk7PXLEMBJ_cjs.getK,
|
|
199
|
+
getLiquidityAddresses: () => chunk4CI2M2F6_cjs.getLiquidityAddresses,
|
|
191
200
|
getMetadataAddress: () => getMetadataAddress,
|
|
192
|
-
getOracleAddress: () =>
|
|
193
|
-
getOracleAddressFromPool: () =>
|
|
194
|
-
getOracleAge: () =>
|
|
195
|
-
getOracleBufferStats: () =>
|
|
196
|
-
getOracleConsultDiscriminatorBytes: () =>
|
|
197
|
-
getOracleConsultInstruction: () =>
|
|
198
|
-
getOracleConsultInstructionAsync: () =>
|
|
199
|
-
getOracleConsultInstructionDataCodec: () =>
|
|
200
|
-
getOracleConsultInstructionDataDecoder: () =>
|
|
201
|
-
getOracleConsultInstructionDataEncoder: () =>
|
|
202
|
-
getOracleDeviation: () =>
|
|
203
|
-
getOracleForPool: () =>
|
|
204
|
-
getOracleSpotPrices: () =>
|
|
205
|
-
getOracleUpdateDiscriminatorBytes: () =>
|
|
206
|
-
getOracleUpdateInstruction: () =>
|
|
207
|
-
getOracleUpdateInstructionAsync: () =>
|
|
208
|
-
getOracleUpdateInstructionDataCodec: () =>
|
|
209
|
-
getOracleUpdateInstructionDataDecoder: () =>
|
|
210
|
-
getOracleUpdateInstructionDataEncoder: () =>
|
|
211
|
-
getPauseDiscriminatorBytes: () =>
|
|
212
|
-
getPauseInstruction: () =>
|
|
213
|
-
getPauseInstructionDataCodec: () =>
|
|
214
|
-
getPauseInstructionDataDecoder: () =>
|
|
215
|
-
getPauseInstructionDataEncoder: () =>
|
|
216
|
-
getPendingFees: () =>
|
|
217
|
-
getPoolAddress: () =>
|
|
218
|
-
getPoolAddressFromMints: () =>
|
|
219
|
-
getPoolAuthorityAddress: () =>
|
|
220
|
-
getPoolByMints: () =>
|
|
221
|
-
getPoolInitAddresses: () =>
|
|
222
|
-
getPoolVault0Address: () =>
|
|
223
|
-
getPoolVault1Address: () =>
|
|
224
|
-
getPositionAddress: () =>
|
|
225
|
-
getPositionAddressFromParams: () =>
|
|
226
|
-
getPositionValue: () =>
|
|
227
|
-
getPreviewSwapExactInDiscriminatorBytes: () =>
|
|
228
|
-
getPreviewSwapExactInInstruction: () =>
|
|
229
|
-
getPreviewSwapExactInInstructionDataCodec: () =>
|
|
230
|
-
getPreviewSwapExactInInstructionDataDecoder: () =>
|
|
231
|
-
getPreviewSwapExactInInstructionDataEncoder: () =>
|
|
232
|
-
getProtocolFeeOwnerAddress: () =>
|
|
233
|
-
getProtocolFeePositionAddress: () =>
|
|
234
|
-
getRedeemProtocolSharesDiscriminatorBytes: () =>
|
|
235
|
-
getRedeemProtocolSharesInstruction: () =>
|
|
236
|
-
getRedeemProtocolSharesInstructionAsync: () =>
|
|
237
|
-
getRedeemProtocolSharesInstructionDataCodec: () =>
|
|
238
|
-
getRedeemProtocolSharesInstructionDataDecoder: () =>
|
|
239
|
-
getRedeemProtocolSharesInstructionDataEncoder: () =>
|
|
240
|
-
getRemoveLiquidityDiscriminatorBytes: () =>
|
|
241
|
-
getRemoveLiquidityInstruction: () =>
|
|
242
|
-
getRemoveLiquidityInstructionAsync: () =>
|
|
243
|
-
getRemoveLiquidityInstructionDataCodec: () =>
|
|
244
|
-
getRemoveLiquidityInstructionDataDecoder: () =>
|
|
245
|
-
getRemoveLiquidityInstructionDataEncoder: () =>
|
|
246
|
-
getRemoveLiquidityQuote: () =>
|
|
247
|
-
getSetFeesDiscriminatorBytes: () =>
|
|
248
|
-
getSetFeesInstruction: () =>
|
|
249
|
-
getSetFeesInstructionDataCodec: () =>
|
|
250
|
-
getSetFeesInstructionDataDecoder: () =>
|
|
251
|
-
getSetFeesInstructionDataEncoder: () =>
|
|
252
|
-
getSetHookDiscriminatorBytes: () =>
|
|
253
|
-
getSetHookInstruction: () =>
|
|
254
|
-
getSetHookInstructionDataCodec: () =>
|
|
255
|
-
getSetHookInstructionDataDecoder: () =>
|
|
256
|
-
getSetHookInstructionDataEncoder: () =>
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
201
|
+
getOracleAddress: () => chunk4CI2M2F6_cjs.getOracleAddress,
|
|
202
|
+
getOracleAddressFromPool: () => chunk7PXLEMBJ_cjs.getOracleAddressFromPool,
|
|
203
|
+
getOracleAge: () => chunk7PXLEMBJ_cjs.getOracleAge,
|
|
204
|
+
getOracleBufferStats: () => chunk7PXLEMBJ_cjs.getOracleBufferStats,
|
|
205
|
+
getOracleConsultDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getOracleConsultDiscriminatorBytes,
|
|
206
|
+
getOracleConsultInstruction: () => chunk7PXLEMBJ_cjs.getOracleConsultInstruction,
|
|
207
|
+
getOracleConsultInstructionAsync: () => chunk7PXLEMBJ_cjs.getOracleConsultInstructionAsync,
|
|
208
|
+
getOracleConsultInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getOracleConsultInstructionDataCodec,
|
|
209
|
+
getOracleConsultInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getOracleConsultInstructionDataDecoder,
|
|
210
|
+
getOracleConsultInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getOracleConsultInstructionDataEncoder,
|
|
211
|
+
getOracleDeviation: () => chunk7PXLEMBJ_cjs.getOracleDeviation,
|
|
212
|
+
getOracleForPool: () => chunk7PXLEMBJ_cjs.getOracleForPool,
|
|
213
|
+
getOracleSpotPrices: () => chunk7PXLEMBJ_cjs.getOracleSpotPrices,
|
|
214
|
+
getOracleUpdateDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getOracleUpdateDiscriminatorBytes,
|
|
215
|
+
getOracleUpdateInstruction: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstruction,
|
|
216
|
+
getOracleUpdateInstructionAsync: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstructionAsync,
|
|
217
|
+
getOracleUpdateInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstructionDataCodec,
|
|
218
|
+
getOracleUpdateInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstructionDataDecoder,
|
|
219
|
+
getOracleUpdateInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getOracleUpdateInstructionDataEncoder,
|
|
220
|
+
getPauseDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getPauseDiscriminatorBytes,
|
|
221
|
+
getPauseInstruction: () => chunk7PXLEMBJ_cjs.getPauseInstruction,
|
|
222
|
+
getPauseInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getPauseInstructionDataCodec,
|
|
223
|
+
getPauseInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getPauseInstructionDataDecoder,
|
|
224
|
+
getPauseInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getPauseInstructionDataEncoder,
|
|
225
|
+
getPendingFees: () => chunk7PXLEMBJ_cjs.getPendingFees,
|
|
226
|
+
getPoolAddress: () => chunk4CI2M2F6_cjs.getPoolAddress,
|
|
227
|
+
getPoolAddressFromMints: () => chunk7PXLEMBJ_cjs.getPoolAddressFromMints,
|
|
228
|
+
getPoolAuthorityAddress: () => chunk4CI2M2F6_cjs.getPoolAuthorityAddress,
|
|
229
|
+
getPoolByMints: () => chunk7PXLEMBJ_cjs.getPoolByMints,
|
|
230
|
+
getPoolInitAddresses: () => chunk4CI2M2F6_cjs.getPoolInitAddresses,
|
|
231
|
+
getPoolVault0Address: () => chunk4CI2M2F6_cjs.getPoolVault0Address,
|
|
232
|
+
getPoolVault1Address: () => chunk4CI2M2F6_cjs.getPoolVault1Address,
|
|
233
|
+
getPositionAddress: () => chunk4CI2M2F6_cjs.getPositionAddress,
|
|
234
|
+
getPositionAddressFromParams: () => chunk7PXLEMBJ_cjs.getPositionAddressFromParams,
|
|
235
|
+
getPositionValue: () => chunk7PXLEMBJ_cjs.getPositionValue,
|
|
236
|
+
getPreviewSwapExactInDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getPreviewSwapExactInDiscriminatorBytes,
|
|
237
|
+
getPreviewSwapExactInInstruction: () => chunk7PXLEMBJ_cjs.getPreviewSwapExactInInstruction,
|
|
238
|
+
getPreviewSwapExactInInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getPreviewSwapExactInInstructionDataCodec,
|
|
239
|
+
getPreviewSwapExactInInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getPreviewSwapExactInInstructionDataDecoder,
|
|
240
|
+
getPreviewSwapExactInInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getPreviewSwapExactInInstructionDataEncoder,
|
|
241
|
+
getProtocolFeeOwnerAddress: () => chunk4CI2M2F6_cjs.getProtocolFeeOwnerAddress,
|
|
242
|
+
getProtocolFeePositionAddress: () => chunk4CI2M2F6_cjs.getProtocolFeePositionAddress,
|
|
243
|
+
getRedeemProtocolSharesDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesDiscriminatorBytes,
|
|
244
|
+
getRedeemProtocolSharesInstruction: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesInstruction,
|
|
245
|
+
getRedeemProtocolSharesInstructionAsync: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesInstructionAsync,
|
|
246
|
+
getRedeemProtocolSharesInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesInstructionDataCodec,
|
|
247
|
+
getRedeemProtocolSharesInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesInstructionDataDecoder,
|
|
248
|
+
getRedeemProtocolSharesInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getRedeemProtocolSharesInstructionDataEncoder,
|
|
249
|
+
getRemoveLiquidityDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityDiscriminatorBytes,
|
|
250
|
+
getRemoveLiquidityInstruction: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstruction,
|
|
251
|
+
getRemoveLiquidityInstructionAsync: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstructionAsync,
|
|
252
|
+
getRemoveLiquidityInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstructionDataCodec,
|
|
253
|
+
getRemoveLiquidityInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstructionDataDecoder,
|
|
254
|
+
getRemoveLiquidityInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityInstructionDataEncoder,
|
|
255
|
+
getRemoveLiquidityQuote: () => chunk7PXLEMBJ_cjs.getRemoveLiquidityQuote,
|
|
256
|
+
getSetFeesDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getSetFeesDiscriminatorBytes,
|
|
257
|
+
getSetFeesInstruction: () => chunk7PXLEMBJ_cjs.getSetFeesInstruction,
|
|
258
|
+
getSetFeesInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getSetFeesInstructionDataCodec,
|
|
259
|
+
getSetFeesInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getSetFeesInstructionDataDecoder,
|
|
260
|
+
getSetFeesInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getSetFeesInstructionDataEncoder,
|
|
261
|
+
getSetHookDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getSetHookDiscriminatorBytes,
|
|
262
|
+
getSetHookInstruction: () => chunk7PXLEMBJ_cjs.getSetHookInstruction,
|
|
263
|
+
getSetHookInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getSetHookInstructionDataCodec,
|
|
264
|
+
getSetHookInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getSetHookInstructionDataDecoder,
|
|
265
|
+
getSetHookInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getSetHookInstructionDataEncoder,
|
|
266
|
+
getSpotPoolAddress: () => chunk4CI2M2F6_cjs.getSpotPoolAddress,
|
|
267
|
+
getSpotPrice0: () => chunk7PXLEMBJ_cjs.getSpotPrice0,
|
|
268
|
+
getSpotPrice1: () => chunk7PXLEMBJ_cjs.getSpotPrice1,
|
|
269
|
+
getSwapAddresses: () => chunk4CI2M2F6_cjs.getSwapAddresses,
|
|
270
|
+
getSwapExactInDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getSwapExactInDiscriminatorBytes,
|
|
271
|
+
getSwapExactInInstruction: () => chunk7PXLEMBJ_cjs.getSwapExactInInstruction,
|
|
272
|
+
getSwapExactInInstructionAsync: () => chunk7PXLEMBJ_cjs.getSwapExactInInstructionAsync,
|
|
273
|
+
getSwapExactInInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getSwapExactInInstructionDataCodec,
|
|
274
|
+
getSwapExactInInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getSwapExactInInstructionDataDecoder,
|
|
275
|
+
getSwapExactInInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getSwapExactInInstructionDataEncoder,
|
|
276
|
+
getSwapQuote: () => chunk7PXLEMBJ_cjs.getSwapQuote,
|
|
277
|
+
getSwapQuoteExactOut: () => chunk7PXLEMBJ_cjs.getSwapQuoteExactOut,
|
|
278
|
+
getTransferAdminDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getTransferAdminDiscriminatorBytes,
|
|
279
|
+
getTransferAdminInstruction: () => chunk7PXLEMBJ_cjs.getTransferAdminInstruction,
|
|
280
|
+
getTransferAdminInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getTransferAdminInstructionDataCodec,
|
|
281
|
+
getTransferAdminInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getTransferAdminInstructionDataDecoder,
|
|
282
|
+
getTransferAdminInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getTransferAdminInstructionDataEncoder,
|
|
283
|
+
getTvl: () => chunk7PXLEMBJ_cjs.getTvl,
|
|
284
|
+
getUnpauseDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getUnpauseDiscriminatorBytes,
|
|
285
|
+
getUnpauseInstruction: () => chunk7PXLEMBJ_cjs.getUnpauseInstruction,
|
|
286
|
+
getUnpauseInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getUnpauseInstructionDataCodec,
|
|
287
|
+
getUnpauseInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getUnpauseInstructionDataDecoder,
|
|
288
|
+
getUnpauseInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getUnpauseInstructionDataEncoder,
|
|
289
|
+
getUpdateConfigDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getUpdateConfigDiscriminatorBytes,
|
|
290
|
+
getUpdateConfigInstruction: () => chunk7PXLEMBJ_cjs.getUpdateConfigInstruction,
|
|
291
|
+
getUpdateConfigInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getUpdateConfigInstructionDataCodec,
|
|
292
|
+
getUpdateConfigInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getUpdateConfigInstructionDataDecoder,
|
|
293
|
+
getUpdateConfigInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getUpdateConfigInstructionDataEncoder,
|
|
294
|
+
getWithdrawVaultExcessDiscriminatorBytes: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessDiscriminatorBytes,
|
|
295
|
+
getWithdrawVaultExcessInstruction: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstruction,
|
|
296
|
+
getWithdrawVaultExcessInstructionAsync: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstructionAsync,
|
|
297
|
+
getWithdrawVaultExcessInstructionDataCodec: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstructionDataCodec,
|
|
298
|
+
getWithdrawVaultExcessInstructionDataDecoder: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstructionDataDecoder,
|
|
299
|
+
getWithdrawVaultExcessInstructionDataEncoder: () => chunk7PXLEMBJ_cjs.getWithdrawVaultExcessInstructionDataEncoder,
|
|
300
|
+
initializeConfigArgsCodec: () => chunk7PXLEMBJ_cjs.initializeConfigArgsCodec,
|
|
301
|
+
initializeOracleArgsCodec: () => chunk7PXLEMBJ_cjs.initializeOracleArgsCodec,
|
|
302
|
+
initializePoolArgsCodec: () => chunk7PXLEMBJ_cjs.initializePoolArgsCodec,
|
|
293
303
|
isCpmmError: () => isCpmmError,
|
|
294
|
-
isOracleStale: () =>
|
|
295
|
-
isTransactionSigner: () =>
|
|
296
|
-
isqrt: () =>
|
|
304
|
+
isOracleStale: () => chunk7PXLEMBJ_cjs.isOracleStale,
|
|
305
|
+
isTransactionSigner: () => chunk7PXLEMBJ_cjs.isTransactionSigner,
|
|
306
|
+
isqrt: () => chunk7PXLEMBJ_cjs.isqrt,
|
|
297
307
|
marketCapToCurveParams: () => marketCapToCurveParams,
|
|
298
308
|
marketCapToSingleCurveParams: () => marketCapToSingleCurveParams,
|
|
299
309
|
marketCapToTokenPrice: () => marketCapToTokenPrice,
|
|
300
|
-
maxBigInt: () =>
|
|
301
|
-
minBigInt: () =>
|
|
302
|
-
normalizeProgramAccountsResponse: () =>
|
|
303
|
-
numberToQ64: () =>
|
|
304
|
-
observationCodec: () =>
|
|
305
|
-
oracleConsultArgsCodec: () =>
|
|
306
|
-
oracleStateDataCodec: () =>
|
|
307
|
-
parseAddLiquidityInstruction: () =>
|
|
308
|
-
parseClosePositionInstruction: () =>
|
|
309
|
-
parseCollectFeesInstruction: () =>
|
|
310
|
-
parseCollectProtocolFeesInstruction: () =>
|
|
311
|
-
parseCreatePositionInstruction: () =>
|
|
310
|
+
maxBigInt: () => chunk7PXLEMBJ_cjs.maxBigInt,
|
|
311
|
+
minBigInt: () => chunk7PXLEMBJ_cjs.minBigInt,
|
|
312
|
+
normalizeProgramAccountsResponse: () => chunk7PXLEMBJ_cjs.normalizeProgramAccountsResponse,
|
|
313
|
+
numberToQ64: () => chunk7PXLEMBJ_cjs.numberToQ64,
|
|
314
|
+
observationCodec: () => chunk7PXLEMBJ_cjs.observationCodec,
|
|
315
|
+
oracleConsultArgsCodec: () => chunk7PXLEMBJ_cjs.oracleConsultArgsCodec,
|
|
316
|
+
oracleStateDataCodec: () => chunk7PXLEMBJ_cjs.oracleStateDataCodec,
|
|
317
|
+
parseAddLiquidityInstruction: () => chunk7PXLEMBJ_cjs.parseAddLiquidityInstruction,
|
|
318
|
+
parseClosePositionInstruction: () => chunk7PXLEMBJ_cjs.parseClosePositionInstruction,
|
|
319
|
+
parseCollectFeesInstruction: () => chunk7PXLEMBJ_cjs.parseCollectFeesInstruction,
|
|
320
|
+
parseCollectProtocolFeesInstruction: () => chunk7PXLEMBJ_cjs.parseCollectProtocolFeesInstruction,
|
|
321
|
+
parseCreatePositionInstruction: () => chunk7PXLEMBJ_cjs.parseCreatePositionInstruction,
|
|
312
322
|
parseErrorFromLogs: () => parseErrorFromLogs,
|
|
313
|
-
parseInitializeConfigInstruction: () =>
|
|
314
|
-
parseInitializeOracleInstruction: () =>
|
|
315
|
-
parseInitializePoolInstruction: () =>
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
323
|
+
parseInitializeConfigInstruction: () => chunk7PXLEMBJ_cjs.parseInitializeConfigInstruction,
|
|
324
|
+
parseInitializeOracleInstruction: () => chunk7PXLEMBJ_cjs.parseInitializeOracleInstruction,
|
|
325
|
+
parseInitializePoolInstruction: () => chunk7PXLEMBJ_cjs.parseInitializePoolInstruction,
|
|
326
|
+
parseInitializeSpotPoolInstruction: () => chunk7PXLEMBJ_cjs.parseInitializeSpotPoolInstruction,
|
|
327
|
+
parseOracleConsultInstruction: () => chunk7PXLEMBJ_cjs.parseOracleConsultInstruction,
|
|
328
|
+
parseOracleUpdateInstruction: () => chunk7PXLEMBJ_cjs.parseOracleUpdateInstruction,
|
|
329
|
+
parsePauseInstruction: () => chunk7PXLEMBJ_cjs.parsePauseInstruction,
|
|
330
|
+
parsePreviewSwapExactInInstruction: () => chunk7PXLEMBJ_cjs.parsePreviewSwapExactInInstruction,
|
|
331
|
+
parseRedeemProtocolSharesInstruction: () => chunk7PXLEMBJ_cjs.parseRedeemProtocolSharesInstruction,
|
|
332
|
+
parseRemoveLiquidityInstruction: () => chunk7PXLEMBJ_cjs.parseRemoveLiquidityInstruction,
|
|
333
|
+
parseSetFeesInstruction: () => chunk7PXLEMBJ_cjs.parseSetFeesInstruction,
|
|
334
|
+
parseSetHookInstruction: () => chunk7PXLEMBJ_cjs.parseSetHookInstruction,
|
|
335
|
+
parseSwapExactInInstruction: () => chunk7PXLEMBJ_cjs.parseSwapExactInInstruction,
|
|
336
|
+
parseTransferAdminInstruction: () => chunk7PXLEMBJ_cjs.parseTransferAdminInstruction,
|
|
337
|
+
parseUnpauseInstruction: () => chunk7PXLEMBJ_cjs.parseUnpauseInstruction,
|
|
338
|
+
parseUpdateConfigInstruction: () => chunk7PXLEMBJ_cjs.parseUpdateConfigInstruction,
|
|
339
|
+
parseWithdrawVaultExcessInstruction: () => chunk7PXLEMBJ_cjs.parseWithdrawVaultExcessInstruction,
|
|
340
|
+
poolDataCodec: () => chunk7PXLEMBJ_cjs.poolDataCodec,
|
|
341
|
+
poolExists: () => chunk7PXLEMBJ_cjs.poolExists,
|
|
342
|
+
positionDataCodec: () => chunk7PXLEMBJ_cjs.positionDataCodec,
|
|
343
|
+
q64Div: () => chunk7PXLEMBJ_cjs.q64Div,
|
|
344
|
+
q64Mul: () => chunk7PXLEMBJ_cjs.q64Mul,
|
|
345
|
+
q64ToNumber: () => chunk7PXLEMBJ_cjs.q64ToNumber,
|
|
346
|
+
ratioToNumber: () => chunk7PXLEMBJ_cjs.ratioToNumber,
|
|
347
|
+
removeLiquidityArgsCodec: () => chunk7PXLEMBJ_cjs.removeLiquidityArgsCodec,
|
|
348
|
+
setFeesArgsCodec: () => chunk7PXLEMBJ_cjs.setFeesArgsCodec,
|
|
349
|
+
setHookArgsCodec: () => chunk7PXLEMBJ_cjs.setHookArgsCodec,
|
|
350
|
+
sortMints: () => chunk4CI2M2F6_cjs.sortMints,
|
|
351
|
+
sortPoolsByReserves: () => chunk7PXLEMBJ_cjs.sortPoolsByReserves,
|
|
352
|
+
sortPositionsByShares: () => chunk7PXLEMBJ_cjs.sortPositionsByShares,
|
|
353
|
+
swapExactInArgsCodec: () => chunk7PXLEMBJ_cjs.swapExactInArgsCodec,
|
|
354
|
+
transferAdminArgsCodec: () => chunk7PXLEMBJ_cjs.transferAdminArgsCodec,
|
|
344
355
|
validateMarketCapParameters: () => validateMarketCapParameters,
|
|
345
|
-
warnAccountDecodeFailure: () =>
|
|
356
|
+
warnAccountDecodeFailure: () => chunk7PXLEMBJ_cjs.warnAccountDecodeFailure
|
|
346
357
|
});
|
|
347
358
|
var addressCodec = kit.getAddressCodec();
|
|
348
359
|
var textEncoder = new TextEncoder();
|
|
349
360
|
async function getMetadataAddress(mint) {
|
|
350
361
|
return kit.getProgramDerivedAddress({
|
|
351
|
-
programAddress:
|
|
362
|
+
programAddress: chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
352
363
|
seeds: [
|
|
353
364
|
textEncoder.encode("metadata"),
|
|
354
|
-
addressCodec.encode(
|
|
365
|
+
addressCodec.encode(chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
355
366
|
addressCodec.encode(mint)
|
|
356
367
|
]
|
|
357
368
|
});
|
|
@@ -664,12 +675,12 @@ function createSwapInstruction(params) {
|
|
|
664
675
|
token0Program,
|
|
665
676
|
token1Program,
|
|
666
677
|
tokenProgram,
|
|
667
|
-
programId =
|
|
678
|
+
programId = chunk7PXLEMBJ_cjs.CPMM_PROGRAM_ADDRESS
|
|
668
679
|
} = params;
|
|
669
680
|
const trader = typeof user === "string" ? kit.createNoopSigner(user) : user;
|
|
670
681
|
const [vaultIn, vaultOut] = tradeDirection === 0 ? [vault0, vault1] : [vault1, vault0];
|
|
671
682
|
const [userIn, userOut] = tradeDirection === 0 ? [userToken0, userToken1] : [userToken1, userToken0];
|
|
672
|
-
const instruction =
|
|
683
|
+
const instruction = chunk7PXLEMBJ_cjs.getSwapExactInInstruction(
|
|
673
684
|
{
|
|
674
685
|
config,
|
|
675
686
|
pool,
|
|
@@ -681,8 +692,8 @@ function createSwapInstruction(params) {
|
|
|
681
692
|
userIn,
|
|
682
693
|
userOut,
|
|
683
694
|
trader,
|
|
684
|
-
token0Program: token0Program ?? tokenProgram ??
|
|
685
|
-
token1Program: token1Program ?? tokenProgram ??
|
|
695
|
+
token0Program: token0Program ?? tokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
696
|
+
token1Program: token1Program ?? tokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
686
697
|
oracle,
|
|
687
698
|
amountIn,
|
|
688
699
|
minAmountOut,
|
|
@@ -695,15 +706,15 @@ function createSwapInstruction(params) {
|
|
|
695
706
|
...instruction,
|
|
696
707
|
accounts: [
|
|
697
708
|
...instruction.accounts ?? [],
|
|
698
|
-
...remainingAccounts.map(
|
|
709
|
+
...remainingAccounts.map(chunk7PXLEMBJ_cjs.createReadonlyRemainingAccountMeta)
|
|
699
710
|
]
|
|
700
711
|
};
|
|
701
712
|
}
|
|
702
713
|
var MAX_FEE_AMOUNT = BigInt("18446744073709551615");
|
|
703
714
|
|
|
704
715
|
// src/solana/client/config.ts
|
|
705
|
-
async function fetchConfig(rpc, programId =
|
|
706
|
-
const [configAddress] = await
|
|
716
|
+
async function fetchConfig(rpc, programId = chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
717
|
+
const [configAddress] = await chunk4CI2M2F6_cjs.getConfigAddress(programId);
|
|
707
718
|
const response = await rpc.getAccountInfo(configAddress, {
|
|
708
719
|
encoding: "base64",
|
|
709
720
|
commitment
|
|
@@ -711,10 +722,10 @@ async function fetchConfig(rpc, programId = chunkU6B52TBT_cjs.CPMM_PROGRAM_ID, c
|
|
|
711
722
|
if (!response.value) {
|
|
712
723
|
return null;
|
|
713
724
|
}
|
|
714
|
-
return
|
|
725
|
+
return chunk7PXLEMBJ_cjs.decodeAmmConfig(chunk7PXLEMBJ_cjs.base64ToBytes(response.value.data[0]));
|
|
715
726
|
}
|
|
716
|
-
async function fetchConfigWithAddress(rpc, programId =
|
|
717
|
-
const [configAddress] = await
|
|
727
|
+
async function fetchConfigWithAddress(rpc, programId = chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
728
|
+
const [configAddress] = await chunk4CI2M2F6_cjs.getConfigAddress(programId);
|
|
718
729
|
const account = await fetchConfig(rpc, programId, commitment);
|
|
719
730
|
if (!account) {
|
|
720
731
|
return null;
|
|
@@ -722,22 +733,32 @@ async function fetchConfigWithAddress(rpc, programId = chunkU6B52TBT_cjs.CPMM_PR
|
|
|
722
733
|
return { address: configAddress, account };
|
|
723
734
|
}
|
|
724
735
|
|
|
725
|
-
// src/solana/
|
|
726
|
-
var
|
|
727
|
-
chunkQ7SFCCGT_cjs.__export(
|
|
736
|
+
// src/solana/cpmmHook/index.ts
|
|
737
|
+
var cpmmHook_exports = {};
|
|
738
|
+
chunkQ7SFCCGT_cjs.__export(cpmmHook_exports, {
|
|
728
739
|
ADD_COSIGNER_DISCRIMINATOR: () => ADD_COSIGNER_DISCRIMINATOR,
|
|
729
740
|
COSIGNER_CONFIG_DISCRIMINATOR: () => COSIGNER_CONFIG_DISCRIMINATOR,
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
+
CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW: () => CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW,
|
|
742
|
+
CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS: () => CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS,
|
|
743
|
+
CPMM_HOOK_ERROR__COSIGNER_LIST_FULL: () => CPMM_HOOK_ERROR__COSIGNER_LIST_FULL,
|
|
744
|
+
CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND: () => CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND,
|
|
745
|
+
CPMM_HOOK_ERROR__INVALID_AUTHORITY: () => CPMM_HOOK_ERROR__INVALID_AUTHORITY,
|
|
746
|
+
CPMM_HOOK_ERROR__INVALID_CONFIG: () => CPMM_HOOK_ERROR__INVALID_CONFIG,
|
|
747
|
+
CPMM_HOOK_ERROR__INVALID_COSIGNER: () => CPMM_HOOK_ERROR__INVALID_COSIGNER,
|
|
748
|
+
CPMM_HOOK_ERROR__INVALID_DURATION: () => CPMM_HOOK_ERROR__INVALID_DURATION,
|
|
749
|
+
CPMM_HOOK_ERROR__INVALID_FEE: () => CPMM_HOOK_ERROR__INVALID_FEE,
|
|
750
|
+
CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA: () => CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA,
|
|
751
|
+
CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA: () => CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA,
|
|
752
|
+
CPMM_HOOK_PROGRAM_ADDRESS: () => CPMM_HOOK_PROGRAM_ADDRESS,
|
|
753
|
+
CPMM_HOOK_PROGRAM_ID: () => CPMM_HOOK_PROGRAM_ID,
|
|
754
|
+
CpmmHookAccount: () => CpmmHookAccount,
|
|
755
|
+
CpmmHookInstruction: () => CpmmHookInstruction,
|
|
756
|
+
DEVNET_CPMM_HOOK_PROGRAM_ID: () => DEVNET_CPMM_HOOK_PROGRAM_ID,
|
|
757
|
+
DYNAMIC_FEE_SCHEDULE_HEADER_LEN: () => DYNAMIC_FEE_SCHEDULE_HEADER_LEN,
|
|
758
|
+
DYNAMIC_FEE_SCHEDULE_LEN: () => DYNAMIC_FEE_SCHEDULE_LEN,
|
|
759
|
+
DYNAMIC_FEE_SCHEDULE_MAGIC: () => DYNAMIC_FEE_SCHEDULE_MAGIC,
|
|
760
|
+
DYNAMIC_FEE_SCHEDULE_MAX_BPS: () => DYNAMIC_FEE_SCHEDULE_MAX_BPS,
|
|
761
|
+
DYNAMIC_FEE_SCHEDULE_VERSION: () => DYNAMIC_FEE_SCHEDULE_VERSION,
|
|
741
762
|
GATE_EXPIRY_DISABLED: () => GATE_EXPIRY_DISABLED,
|
|
742
763
|
GATE_EXPIRY_HEADER_LEN: () => GATE_EXPIRY_HEADER_LEN,
|
|
743
764
|
GATE_EXPIRY_PAYLOAD_LEN: () => GATE_EXPIRY_PAYLOAD_LEN,
|
|
@@ -747,12 +768,15 @@ chunkQ7SFCCGT_cjs.__export(cosignerHook_exports, {
|
|
|
747
768
|
INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR2,
|
|
748
769
|
MAX_COSIGNERS: () => MAX_COSIGNERS,
|
|
749
770
|
REMOVE_COSIGNER_DISCRIMINATOR: () => REMOVE_COSIGNER_DISCRIMINATOR,
|
|
750
|
-
|
|
771
|
+
SEED_CPMM_HOOK_CONFIG: () => SEED_CPMM_HOOK_CONFIG,
|
|
751
772
|
SET_AUTHORITY_DISCRIMINATOR: () => SET_AUTHORITY_DISCRIMINATOR,
|
|
752
|
-
|
|
773
|
+
cpmmHookProgram: () => cpmmHookProgram,
|
|
753
774
|
decodeCosignerConfig: () => decodeCosignerConfig,
|
|
754
775
|
decodeCosignerGateExpiryPayload: () => decodeCosignerGateExpiryPayload,
|
|
755
776
|
encodeCosignerGateExpiryPayload: () => encodeCosignerGateExpiryPayload,
|
|
777
|
+
encodeCpmmHookPayload: () => encodeCpmmHookPayload,
|
|
778
|
+
encodeDynamicFeeCosignerGatePayload: () => encodeDynamicFeeCosignerGatePayload,
|
|
779
|
+
encodeDynamicFeeSchedule: () => encodeDynamicFeeSchedule,
|
|
756
780
|
fetchAllCosignerConfig: () => fetchAllCosignerConfig,
|
|
757
781
|
fetchAllMaybeCosignerConfig: () => fetchAllMaybeCosignerConfig,
|
|
758
782
|
fetchCosignerConfig: () => fetchCosignerConfig,
|
|
@@ -772,9 +796,10 @@ chunkQ7SFCCGT_cjs.__export(cosignerHook_exports, {
|
|
|
772
796
|
getCosignerConfigEncoder: () => getCosignerConfigEncoder,
|
|
773
797
|
getCosignerConfigSize: () => getCosignerConfigSize,
|
|
774
798
|
getCosignerGateStatus: () => getCosignerGateStatus,
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
799
|
+
getCpmmHookConfigAddress: () => getCpmmHookConfigAddress,
|
|
800
|
+
getCpmmHookErrorMessage: () => getCpmmHookErrorMessage,
|
|
801
|
+
getCpmmHookRemainingAccountAddresses: () => getCpmmHookRemainingAccountAddresses,
|
|
802
|
+
getCpmmHookRemainingAccounts: () => getCpmmHookRemainingAccounts,
|
|
778
803
|
getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec,
|
|
779
804
|
getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder,
|
|
780
805
|
getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder,
|
|
@@ -799,15 +824,17 @@ chunkQ7SFCCGT_cjs.__export(cosignerHook_exports, {
|
|
|
799
824
|
getSetAuthorityInstructionDataCodec: () => getSetAuthorityInstructionDataCodec,
|
|
800
825
|
getSetAuthorityInstructionDataDecoder: () => getSetAuthorityInstructionDataDecoder,
|
|
801
826
|
getSetAuthorityInstructionDataEncoder: () => getSetAuthorityInstructionDataEncoder,
|
|
802
|
-
|
|
803
|
-
|
|
827
|
+
identifyCpmmHookAccount: () => identifyCpmmHookAccount,
|
|
828
|
+
identifyCpmmHookInstruction: () => identifyCpmmHookInstruction,
|
|
804
829
|
isCosignerGateEnforced: () => isCosignerGateEnforced,
|
|
805
|
-
|
|
830
|
+
isCpmmHookError: () => isCpmmHookError,
|
|
831
|
+
isDynamicFeeSchedulePayload: () => isDynamicFeeSchedulePayload,
|
|
806
832
|
parseAddCosignerInstruction: () => parseAddCosignerInstruction,
|
|
807
|
-
|
|
833
|
+
parseCpmmHookInstruction: () => parseCpmmHookInstruction,
|
|
808
834
|
parseInitializeConfigInstruction: () => parseInitializeConfigInstruction2,
|
|
809
835
|
parseRemoveCosignerInstruction: () => parseRemoveCosignerInstruction,
|
|
810
|
-
parseSetAuthorityInstruction: () => parseSetAuthorityInstruction
|
|
836
|
+
parseSetAuthorityInstruction: () => parseSetAuthorityInstruction,
|
|
837
|
+
validateDynamicFeeScheduleArgs: () => validateDynamicFeeScheduleArgs
|
|
811
838
|
});
|
|
812
839
|
var COSIGNER_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
813
840
|
133,
|
|
@@ -858,13 +885,13 @@ function decodeCosignerConfig(encodedAccount) {
|
|
|
858
885
|
getCosignerConfigDecoder()
|
|
859
886
|
);
|
|
860
887
|
}
|
|
861
|
-
async function fetchCosignerConfig(rpc,
|
|
862
|
-
const maybeAccount = await fetchMaybeCosignerConfig(rpc,
|
|
888
|
+
async function fetchCosignerConfig(rpc, address6, config) {
|
|
889
|
+
const maybeAccount = await fetchMaybeCosignerConfig(rpc, address6, config);
|
|
863
890
|
kit.assertAccountExists(maybeAccount);
|
|
864
891
|
return maybeAccount;
|
|
865
892
|
}
|
|
866
|
-
async function fetchMaybeCosignerConfig(rpc,
|
|
867
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
893
|
+
async function fetchMaybeCosignerConfig(rpc, address6, config) {
|
|
894
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
868
895
|
return decodeCosignerConfig(maybeAccount);
|
|
869
896
|
}
|
|
870
897
|
async function fetchAllCosignerConfig(rpc, addresses, config) {
|
|
@@ -922,7 +949,7 @@ function getAddCosignerInstructionDataCodec() {
|
|
|
922
949
|
);
|
|
923
950
|
}
|
|
924
951
|
async function getAddCosignerInstructionAsync(input, config) {
|
|
925
|
-
const programAddress = config?.programAddress ??
|
|
952
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
926
953
|
const originalAccounts = {
|
|
927
954
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
928
955
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -973,7 +1000,7 @@ async function getAddCosignerInstructionAsync(input, config) {
|
|
|
973
1000
|
});
|
|
974
1001
|
}
|
|
975
1002
|
function getAddCosignerInstruction(input, config) {
|
|
976
|
-
const programAddress = config?.programAddress ??
|
|
1003
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
977
1004
|
const originalAccounts = {
|
|
978
1005
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
979
1006
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -1004,9 +1031,9 @@ function parseAddCosignerInstruction(instruction) {
|
|
|
1004
1031
|
}
|
|
1005
1032
|
let accountIndex = 0;
|
|
1006
1033
|
const getNextAccount = () => {
|
|
1007
|
-
const
|
|
1034
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
1008
1035
|
accountIndex += 1;
|
|
1009
|
-
return
|
|
1036
|
+
return accountMeta2;
|
|
1010
1037
|
};
|
|
1011
1038
|
return {
|
|
1012
1039
|
programAddress: instruction.programAddress,
|
|
@@ -1051,7 +1078,7 @@ function getInitializeConfigInstructionDataCodec2() {
|
|
|
1051
1078
|
);
|
|
1052
1079
|
}
|
|
1053
1080
|
async function getInitializeConfigInstructionAsync2(input, config) {
|
|
1054
|
-
const programAddress = config?.programAddress ??
|
|
1081
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1055
1082
|
const originalAccounts = {
|
|
1056
1083
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
1057
1084
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
@@ -1111,7 +1138,7 @@ async function getInitializeConfigInstructionAsync2(input, config) {
|
|
|
1111
1138
|
});
|
|
1112
1139
|
}
|
|
1113
1140
|
function getInitializeConfigInstruction2(input, config) {
|
|
1114
|
-
const programAddress = config?.programAddress ??
|
|
1141
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1115
1142
|
const originalAccounts = {
|
|
1116
1143
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
1117
1144
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
@@ -1151,9 +1178,9 @@ function parseInitializeConfigInstruction2(instruction) {
|
|
|
1151
1178
|
}
|
|
1152
1179
|
let accountIndex = 0;
|
|
1153
1180
|
const getNextAccount = () => {
|
|
1154
|
-
const
|
|
1181
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
1155
1182
|
accountIndex += 1;
|
|
1156
|
-
return
|
|
1183
|
+
return accountMeta2;
|
|
1157
1184
|
};
|
|
1158
1185
|
return {
|
|
1159
1186
|
programAddress: instruction.programAddress,
|
|
@@ -1204,7 +1231,7 @@ function getRemoveCosignerInstructionDataCodec() {
|
|
|
1204
1231
|
);
|
|
1205
1232
|
}
|
|
1206
1233
|
async function getRemoveCosignerInstructionAsync(input, config) {
|
|
1207
|
-
const programAddress = config?.programAddress ??
|
|
1234
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1208
1235
|
const originalAccounts = {
|
|
1209
1236
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
1210
1237
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -1255,7 +1282,7 @@ async function getRemoveCosignerInstructionAsync(input, config) {
|
|
|
1255
1282
|
});
|
|
1256
1283
|
}
|
|
1257
1284
|
function getRemoveCosignerInstruction(input, config) {
|
|
1258
|
-
const programAddress = config?.programAddress ??
|
|
1285
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1259
1286
|
const originalAccounts = {
|
|
1260
1287
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
1261
1288
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -1286,9 +1313,9 @@ function parseRemoveCosignerInstruction(instruction) {
|
|
|
1286
1313
|
}
|
|
1287
1314
|
let accountIndex = 0;
|
|
1288
1315
|
const getNextAccount = () => {
|
|
1289
|
-
const
|
|
1316
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
1290
1317
|
accountIndex += 1;
|
|
1291
|
-
return
|
|
1318
|
+
return accountMeta2;
|
|
1292
1319
|
};
|
|
1293
1320
|
return {
|
|
1294
1321
|
programAddress: instruction.programAddress,
|
|
@@ -1333,7 +1360,7 @@ function getSetAuthorityInstructionDataCodec() {
|
|
|
1333
1360
|
);
|
|
1334
1361
|
}
|
|
1335
1362
|
async function getSetAuthorityInstructionAsync(input, config) {
|
|
1336
|
-
const programAddress = config?.programAddress ??
|
|
1363
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1337
1364
|
const originalAccounts = {
|
|
1338
1365
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
1339
1366
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -1384,7 +1411,7 @@ async function getSetAuthorityInstructionAsync(input, config) {
|
|
|
1384
1411
|
});
|
|
1385
1412
|
}
|
|
1386
1413
|
function getSetAuthorityInstruction(input, config) {
|
|
1387
|
-
const programAddress = config?.programAddress ??
|
|
1414
|
+
const programAddress = config?.programAddress ?? CPMM_HOOK_PROGRAM_ADDRESS;
|
|
1388
1415
|
const originalAccounts = {
|
|
1389
1416
|
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
1390
1417
|
config: { value: input.config ?? null, isWritable: true }
|
|
@@ -1415,9 +1442,9 @@ function parseSetAuthorityInstruction(instruction) {
|
|
|
1415
1442
|
}
|
|
1416
1443
|
let accountIndex = 0;
|
|
1417
1444
|
const getNextAccount = () => {
|
|
1418
|
-
const
|
|
1445
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
1419
1446
|
accountIndex += 1;
|
|
1420
|
-
return
|
|
1447
|
+
return accountMeta2;
|
|
1421
1448
|
};
|
|
1422
1449
|
return {
|
|
1423
1450
|
programAddress: instruction.programAddress,
|
|
@@ -1426,13 +1453,13 @@ function parseSetAuthorityInstruction(instruction) {
|
|
|
1426
1453
|
};
|
|
1427
1454
|
}
|
|
1428
1455
|
|
|
1429
|
-
// src/solana/generated/
|
|
1430
|
-
var
|
|
1431
|
-
var
|
|
1432
|
-
|
|
1433
|
-
return
|
|
1434
|
-
})(
|
|
1435
|
-
function
|
|
1456
|
+
// src/solana/generated/cpmmHook/programs/cpmmHook.ts
|
|
1457
|
+
var CPMM_HOOK_PROGRAM_ADDRESS = "HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i";
|
|
1458
|
+
var CpmmHookAccount = /* @__PURE__ */ ((CpmmHookAccount2) => {
|
|
1459
|
+
CpmmHookAccount2[CpmmHookAccount2["CosignerConfig"] = 0] = "CosignerConfig";
|
|
1460
|
+
return CpmmHookAccount2;
|
|
1461
|
+
})(CpmmHookAccount || {});
|
|
1462
|
+
function identifyCpmmHookAccount(account) {
|
|
1436
1463
|
const data = "data" in account ? account.data : account;
|
|
1437
1464
|
if (kit.containsBytes(
|
|
1438
1465
|
data,
|
|
@@ -1445,17 +1472,17 @@ function identifyCosignerHookAccount(account) {
|
|
|
1445
1472
|
}
|
|
1446
1473
|
throw new kit.SolanaError(
|
|
1447
1474
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,
|
|
1448
|
-
{ accountData: data, programName: "
|
|
1475
|
+
{ accountData: data, programName: "cpmmHook" }
|
|
1449
1476
|
);
|
|
1450
1477
|
}
|
|
1451
|
-
var
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
return
|
|
1457
|
-
})(
|
|
1458
|
-
function
|
|
1478
|
+
var CpmmHookInstruction = /* @__PURE__ */ ((CpmmHookInstruction2) => {
|
|
1479
|
+
CpmmHookInstruction2[CpmmHookInstruction2["AddCosigner"] = 0] = "AddCosigner";
|
|
1480
|
+
CpmmHookInstruction2[CpmmHookInstruction2["InitializeConfig"] = 1] = "InitializeConfig";
|
|
1481
|
+
CpmmHookInstruction2[CpmmHookInstruction2["RemoveCosigner"] = 2] = "RemoveCosigner";
|
|
1482
|
+
CpmmHookInstruction2[CpmmHookInstruction2["SetAuthority"] = 3] = "SetAuthority";
|
|
1483
|
+
return CpmmHookInstruction2;
|
|
1484
|
+
})(CpmmHookInstruction || {});
|
|
1485
|
+
function identifyCpmmHookInstruction(instruction) {
|
|
1459
1486
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
1460
1487
|
if (kit.containsBytes(
|
|
1461
1488
|
data,
|
|
@@ -1495,11 +1522,11 @@ function identifyCosignerHookInstruction(instruction) {
|
|
|
1495
1522
|
}
|
|
1496
1523
|
throw new kit.SolanaError(
|
|
1497
1524
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
|
|
1498
|
-
{ instructionData: data, programName: "
|
|
1525
|
+
{ instructionData: data, programName: "cpmmHook" }
|
|
1499
1526
|
);
|
|
1500
1527
|
}
|
|
1501
|
-
function
|
|
1502
|
-
const instructionType =
|
|
1528
|
+
function parseCpmmHookInstruction(instruction) {
|
|
1529
|
+
const instructionType = identifyCpmmHookInstruction(instruction);
|
|
1503
1530
|
switch (instructionType) {
|
|
1504
1531
|
case 0 /* AddCosigner */: {
|
|
1505
1532
|
kit.assertIsInstructionWithAccounts(instruction);
|
|
@@ -1532,18 +1559,15 @@ function parseCosignerHookInstruction(instruction) {
|
|
|
1532
1559
|
default:
|
|
1533
1560
|
throw new kit.SolanaError(
|
|
1534
1561
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
|
|
1535
|
-
{
|
|
1536
|
-
instructionType,
|
|
1537
|
-
programName: "cosignerHook"
|
|
1538
|
-
}
|
|
1562
|
+
{ instructionType, programName: "cpmmHook" }
|
|
1539
1563
|
);
|
|
1540
1564
|
}
|
|
1541
1565
|
}
|
|
1542
|
-
function
|
|
1566
|
+
function cpmmHookProgram() {
|
|
1543
1567
|
return (client) => {
|
|
1544
1568
|
return {
|
|
1545
1569
|
...client,
|
|
1546
|
-
|
|
1570
|
+
cpmmHook: {
|
|
1547
1571
|
accounts: {
|
|
1548
1572
|
cosignerConfig: programClientCore.addSelfFetchFunctions(
|
|
1549
1573
|
client,
|
|
@@ -1576,35 +1600,45 @@ function cosignerHookProgram() {
|
|
|
1576
1600
|
};
|
|
1577
1601
|
}
|
|
1578
1602
|
|
|
1579
|
-
// src/solana/generated/
|
|
1580
|
-
var
|
|
1581
|
-
var
|
|
1582
|
-
var
|
|
1583
|
-
var
|
|
1584
|
-
var
|
|
1585
|
-
var
|
|
1586
|
-
var
|
|
1603
|
+
// src/solana/generated/cpmmHook/errors/cpmmHook.ts
|
|
1604
|
+
var CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA = 6e3;
|
|
1605
|
+
var CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA = 6001;
|
|
1606
|
+
var CPMM_HOOK_ERROR__INVALID_FEE = 6002;
|
|
1607
|
+
var CPMM_HOOK_ERROR__INVALID_DURATION = 6003;
|
|
1608
|
+
var CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW = 6004;
|
|
1609
|
+
var CPMM_HOOK_ERROR__INVALID_AUTHORITY = 6005;
|
|
1610
|
+
var CPMM_HOOK_ERROR__INVALID_CONFIG = 6006;
|
|
1611
|
+
var CPMM_HOOK_ERROR__INVALID_COSIGNER = 6007;
|
|
1612
|
+
var CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS = 6008;
|
|
1613
|
+
var CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND = 6009;
|
|
1614
|
+
var CPMM_HOOK_ERROR__COSIGNER_LIST_FULL = 6010;
|
|
1615
|
+
var cpmmHookErrorMessages;
|
|
1587
1616
|
if (process.env.NODE_ENV !== "production") {
|
|
1588
|
-
|
|
1589
|
-
[
|
|
1590
|
-
[
|
|
1591
|
-
[
|
|
1592
|
-
[
|
|
1593
|
-
[
|
|
1594
|
-
[
|
|
1617
|
+
cpmmHookErrorMessages = {
|
|
1618
|
+
[CPMM_HOOK_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
|
|
1619
|
+
[CPMM_HOOK_ERROR__COSIGNER_ALREADY_EXISTS]: `Cosigner already exists`,
|
|
1620
|
+
[CPMM_HOOK_ERROR__COSIGNER_LIST_FULL]: `Cosigner list is full`,
|
|
1621
|
+
[CPMM_HOOK_ERROR__COSIGNER_NOT_FOUND]: `Cosigner not found`,
|
|
1622
|
+
[CPMM_HOOK_ERROR__INVALID_AUTHORITY]: `Invalid hook authority`,
|
|
1623
|
+
[CPMM_HOOK_ERROR__INVALID_CONFIG]: `Invalid cosigner hook config`,
|
|
1624
|
+
[CPMM_HOOK_ERROR__INVALID_COSIGNER]: `Invalid cosigner key`,
|
|
1625
|
+
[CPMM_HOOK_ERROR__INVALID_DURATION]: `Invalid fee duration`,
|
|
1626
|
+
[CPMM_HOOK_ERROR__INVALID_FEE]: `Invalid fee`,
|
|
1627
|
+
[CPMM_HOOK_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,
|
|
1628
|
+
[CPMM_HOOK_ERROR__INVALID_SCHEDULE_DATA]: `Invalid schedule payload`
|
|
1595
1629
|
};
|
|
1596
1630
|
}
|
|
1597
|
-
function
|
|
1631
|
+
function getCpmmHookErrorMessage(code) {
|
|
1598
1632
|
if (process.env.NODE_ENV !== "production") {
|
|
1599
|
-
return
|
|
1633
|
+
return cpmmHookErrorMessages[code];
|
|
1600
1634
|
}
|
|
1601
1635
|
return "Error message not available in production bundles.";
|
|
1602
1636
|
}
|
|
1603
|
-
function
|
|
1637
|
+
function isCpmmHookError(error, transactionMessage, code) {
|
|
1604
1638
|
return kit.isProgramError(
|
|
1605
1639
|
error,
|
|
1606
1640
|
transactionMessage,
|
|
1607
|
-
|
|
1641
|
+
CPMM_HOOK_PROGRAM_ADDRESS,
|
|
1608
1642
|
code
|
|
1609
1643
|
);
|
|
1610
1644
|
}
|
|
@@ -1645,11 +1679,11 @@ function getSetAuthorityArgsCodec() {
|
|
|
1645
1679
|
getSetAuthorityArgsDecoder()
|
|
1646
1680
|
);
|
|
1647
1681
|
}
|
|
1648
|
-
var
|
|
1649
|
-
"
|
|
1682
|
+
var DEVNET_CPMM_HOOK_PROGRAM_ID = kit.address(
|
|
1683
|
+
"HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i"
|
|
1650
1684
|
);
|
|
1651
|
-
var
|
|
1652
|
-
var
|
|
1685
|
+
var CPMM_HOOK_PROGRAM_ID = DEVNET_CPMM_HOOK_PROGRAM_ID;
|
|
1686
|
+
var SEED_CPMM_HOOK_CONFIG = "cosigner_hook_config";
|
|
1653
1687
|
var MAX_COSIGNERS = 32;
|
|
1654
1688
|
var GATE_EXPIRY_DISABLED = 0;
|
|
1655
1689
|
var GATE_EXPIRY_UNIX_TIMESTAMP = 1;
|
|
@@ -1657,15 +1691,146 @@ var GATE_EXPIRY_SLOT = 2;
|
|
|
1657
1691
|
var GATE_EXPIRY_PAYLOAD_VERSION = 1;
|
|
1658
1692
|
var GATE_EXPIRY_HEADER_LEN = 10;
|
|
1659
1693
|
var GATE_EXPIRY_PAYLOAD_LEN = 42;
|
|
1694
|
+
var DYNAMIC_FEE_SCHEDULE_MAGIC = new Uint8Array([
|
|
1695
|
+
68,
|
|
1696
|
+
70,
|
|
1697
|
+
69,
|
|
1698
|
+
69,
|
|
1699
|
+
86,
|
|
1700
|
+
49,
|
|
1701
|
+
95,
|
|
1702
|
+
95
|
|
1703
|
+
]);
|
|
1704
|
+
var DYNAMIC_FEE_SCHEDULE_VERSION = 1;
|
|
1705
|
+
var DYNAMIC_FEE_SCHEDULE_LEN = 32;
|
|
1706
|
+
var DYNAMIC_FEE_SCHEDULE_HEADER_LEN = 16;
|
|
1707
|
+
var DYNAMIC_FEE_SCHEDULE_MAX_BPS = 1e4;
|
|
1708
|
+
var MAX_U64 = (1n << 64n) - 1n;
|
|
1709
|
+
function toBigInt(value) {
|
|
1710
|
+
return typeof value === "bigint" ? value : BigInt(value);
|
|
1711
|
+
}
|
|
1712
|
+
function isValidExpiryMode(mode) {
|
|
1713
|
+
return mode === GATE_EXPIRY_UNIX_TIMESTAMP || mode === GATE_EXPIRY_SLOT;
|
|
1714
|
+
}
|
|
1715
|
+
function readU64Le(bytes, offset) {
|
|
1716
|
+
let value = 0n;
|
|
1717
|
+
for (let i = 0; i < 8; i++) {
|
|
1718
|
+
value |= BigInt(bytes[offset + i] ?? 0) << BigInt(i * 8);
|
|
1719
|
+
}
|
|
1720
|
+
return value;
|
|
1721
|
+
}
|
|
1722
|
+
function writeU64Le(bytes, offset, value) {
|
|
1723
|
+
for (let i = 0; i < 8; i++) {
|
|
1724
|
+
bytes[offset + i] = Number(value >> BigInt(i * 8) & 0xffn);
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
function encodeCosignerGateExpiryPayload(expiry) {
|
|
1728
|
+
if (expiry.mode === GATE_EXPIRY_DISABLED) {
|
|
1729
|
+
if (expiry.cosigner !== void 0) {
|
|
1730
|
+
throw new Error("Cosigner hint cannot be encoded for disabled gates");
|
|
1731
|
+
}
|
|
1732
|
+
return new Uint8Array();
|
|
1733
|
+
}
|
|
1734
|
+
if (!isValidExpiryMode(expiry.mode)) {
|
|
1735
|
+
throw new Error(`Invalid cosigner gate expiry mode: ${expiry.mode}`);
|
|
1736
|
+
}
|
|
1737
|
+
const value = toBigInt(expiry.value);
|
|
1738
|
+
if (value < 0n || value > MAX_U64) {
|
|
1739
|
+
throw new Error(`Invalid cosigner gate expiry value: ${expiry.value}`);
|
|
1740
|
+
}
|
|
1741
|
+
if (expiry.cosigner === void 0) {
|
|
1742
|
+
throw new Error("Cosigner hint is required for expiring gates");
|
|
1743
|
+
}
|
|
1744
|
+
const payload = new Uint8Array(GATE_EXPIRY_PAYLOAD_LEN);
|
|
1745
|
+
payload[0] = GATE_EXPIRY_PAYLOAD_VERSION;
|
|
1746
|
+
payload[1] = expiry.mode;
|
|
1747
|
+
writeU64Le(payload, 2, value);
|
|
1748
|
+
payload.set(
|
|
1749
|
+
kit.getAddressEncoder().encode(expiry.cosigner),
|
|
1750
|
+
GATE_EXPIRY_HEADER_LEN
|
|
1751
|
+
);
|
|
1752
|
+
return payload;
|
|
1753
|
+
}
|
|
1754
|
+
function decodeCosignerGateExpiryPayload(payload) {
|
|
1755
|
+
if (!payload || payload.length === 0) {
|
|
1756
|
+
return { mode: GATE_EXPIRY_DISABLED, value: 0n };
|
|
1757
|
+
}
|
|
1758
|
+
if (payload.length !== GATE_EXPIRY_PAYLOAD_LEN || payload[0] !== GATE_EXPIRY_PAYLOAD_VERSION) {
|
|
1759
|
+
return null;
|
|
1760
|
+
}
|
|
1761
|
+
const mode = payload[1] ?? GATE_EXPIRY_DISABLED;
|
|
1762
|
+
if (!isValidExpiryMode(mode)) {
|
|
1763
|
+
return null;
|
|
1764
|
+
}
|
|
1765
|
+
return {
|
|
1766
|
+
mode,
|
|
1767
|
+
value: readU64Le(payload, 2),
|
|
1768
|
+
cosigner: kit.getAddressDecoder().decode(
|
|
1769
|
+
payload.slice(GATE_EXPIRY_HEADER_LEN, GATE_EXPIRY_PAYLOAD_LEN)
|
|
1770
|
+
)
|
|
1771
|
+
};
|
|
1772
|
+
}
|
|
1773
|
+
function getCosignerGateStatus(hookPayload, clock = {}) {
|
|
1774
|
+
const expiry = decodeCosignerGateExpiryPayload(hookPayload);
|
|
1775
|
+
if (!expiry) {
|
|
1776
|
+
return {
|
|
1777
|
+
gateEnforced: true,
|
|
1778
|
+
expiryMode: GATE_EXPIRY_DISABLED,
|
|
1779
|
+
expiryValue: 0n,
|
|
1780
|
+
reason: "invalid_expiry_payload"
|
|
1781
|
+
};
|
|
1782
|
+
}
|
|
1783
|
+
if (expiry.mode === GATE_EXPIRY_DISABLED) {
|
|
1784
|
+
return {
|
|
1785
|
+
gateEnforced: true,
|
|
1786
|
+
expiryMode: expiry.mode,
|
|
1787
|
+
expiryValue: expiry.value,
|
|
1788
|
+
reason: "expiry_disabled"
|
|
1789
|
+
};
|
|
1790
|
+
}
|
|
1791
|
+
if (expiry.mode === GATE_EXPIRY_UNIX_TIMESTAMP) {
|
|
1792
|
+
const unixTimestamp = clock.unixTimestamp === void 0 ? BigInt(Math.floor(Date.now() / 1e3)) : toBigInt(clock.unixTimestamp);
|
|
1793
|
+
const expired = unixTimestamp >= expiry.value;
|
|
1794
|
+
return {
|
|
1795
|
+
gateEnforced: !expired,
|
|
1796
|
+
expiryMode: expiry.mode,
|
|
1797
|
+
expiryValue: expiry.value,
|
|
1798
|
+
reason: expired ? "timestamp_expired" : "timestamp_pending"
|
|
1799
|
+
};
|
|
1800
|
+
}
|
|
1801
|
+
if (expiry.mode === GATE_EXPIRY_SLOT) {
|
|
1802
|
+
if (clock.slot === void 0) {
|
|
1803
|
+
return {
|
|
1804
|
+
gateEnforced: true,
|
|
1805
|
+
expiryMode: expiry.mode,
|
|
1806
|
+
expiryValue: expiry.value,
|
|
1807
|
+
reason: "slot_unavailable"
|
|
1808
|
+
};
|
|
1809
|
+
}
|
|
1810
|
+
const expired = toBigInt(clock.slot) >= expiry.value;
|
|
1811
|
+
return {
|
|
1812
|
+
gateEnforced: !expired,
|
|
1813
|
+
expiryMode: expiry.mode,
|
|
1814
|
+
expiryValue: expiry.value,
|
|
1815
|
+
reason: expired ? "slot_expired" : "slot_pending"
|
|
1816
|
+
};
|
|
1817
|
+
}
|
|
1818
|
+
return {
|
|
1819
|
+
gateEnforced: true,
|
|
1820
|
+
expiryMode: expiry.mode,
|
|
1821
|
+
expiryValue: expiry.value,
|
|
1822
|
+
reason: "invalid_expiry_mode"
|
|
1823
|
+
};
|
|
1824
|
+
}
|
|
1825
|
+
function isCosignerGateEnforced(hookPayload, clock = {}) {
|
|
1826
|
+
return getCosignerGateStatus(hookPayload, clock).gateEnforced;
|
|
1827
|
+
}
|
|
1660
1828
|
var INITIALIZER_PROGRAM_ID = kit.address(
|
|
1661
1829
|
"4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1"
|
|
1662
1830
|
);
|
|
1663
1831
|
var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = kit.address(
|
|
1664
1832
|
"BPFLoaderUpgradeab1e11111111111111111111111"
|
|
1665
1833
|
);
|
|
1666
|
-
var CPMM_HOOK_PROGRAM_ID = kit.address(
|
|
1667
|
-
"2vJ1c62knEwZbxp3XdHB4RSmCfz55pA6tRkCho63gW7u"
|
|
1668
|
-
);
|
|
1669
1834
|
var PREDICTION_HOOK_PROGRAM_ID = kit.address(
|
|
1670
1835
|
"7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB"
|
|
1671
1836
|
);
|
|
@@ -1847,10 +2012,10 @@ function getCurveSwapFeeAmount(amountIn, swapFeeBps) {
|
|
|
1847
2012
|
if (amountIn < 0n) {
|
|
1848
2013
|
throw new Error("amountIn must be non-negative");
|
|
1849
2014
|
}
|
|
1850
|
-
if (!Number.isInteger(swapFeeBps) || swapFeeBps < 0 || swapFeeBps > Number(
|
|
2015
|
+
if (!Number.isInteger(swapFeeBps) || swapFeeBps < 0 || swapFeeBps > Number(chunk4CI2M2F6_cjs.BPS_DENOM)) {
|
|
1851
2016
|
throw new Error("swapFeeBps must be an integer from 0 to 10000");
|
|
1852
2017
|
}
|
|
1853
|
-
return
|
|
2018
|
+
return chunk7PXLEMBJ_cjs.ceilDiv(amountIn * BigInt(swapFeeBps), chunk4CI2M2F6_cjs.BPS_DENOM);
|
|
1854
2019
|
}
|
|
1855
2020
|
function phaseLabel(phase) {
|
|
1856
2021
|
switch (phase) {
|
|
@@ -1865,148 +2030,112 @@ function phaseLabel(phase) {
|
|
|
1865
2030
|
}
|
|
1866
2031
|
}
|
|
1867
2032
|
|
|
1868
|
-
// src/solana/
|
|
1869
|
-
var
|
|
1870
|
-
|
|
2033
|
+
// src/solana/cpmmHook/payload.ts
|
|
2034
|
+
var MAX_I64 = (1n << 63n) - 1n;
|
|
2035
|
+
var MAX_U32 = (1n << 32n) - 1n;
|
|
2036
|
+
function toBigInt2(value) {
|
|
1871
2037
|
return typeof value === "bigint" ? value : BigInt(value);
|
|
1872
2038
|
}
|
|
1873
|
-
function
|
|
1874
|
-
|
|
1875
|
-
}
|
|
1876
|
-
function readU64Le(bytes, offset) {
|
|
1877
|
-
let value = 0n;
|
|
1878
|
-
for (let i = 0; i < 8; i++) {
|
|
1879
|
-
value |= BigInt(bytes[offset + i] ?? 0) << BigInt(i * 8);
|
|
2039
|
+
function assertU16Bps(label, value) {
|
|
2040
|
+
if (!Number.isInteger(value) || value < 0 || value > DYNAMIC_FEE_SCHEDULE_MAX_BPS) {
|
|
2041
|
+
throw new Error(`${label} must be an integer between 0 and 10000`);
|
|
1880
2042
|
}
|
|
1881
|
-
return value;
|
|
1882
2043
|
}
|
|
1883
|
-
function
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
}
|
|
2044
|
+
function writeI64Le(bytes, offset, value) {
|
|
2045
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2046
|
+
view.setBigInt64(offset, value, true);
|
|
1887
2047
|
}
|
|
1888
|
-
function
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
2048
|
+
function writeU16Le(bytes, offset, value) {
|
|
2049
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2050
|
+
view.setUint16(offset, value, true);
|
|
2051
|
+
}
|
|
2052
|
+
function writeU32Le(bytes, offset, value) {
|
|
2053
|
+
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
2054
|
+
view.setUint32(offset, Number(value), true);
|
|
2055
|
+
}
|
|
2056
|
+
function validateDynamicFeeScheduleArgs(schedule) {
|
|
2057
|
+
const startingTime = toBigInt2(schedule.startingTime);
|
|
2058
|
+
if (startingTime < 0n || startingTime > MAX_I64) {
|
|
2059
|
+
throw new Error("startingTime must be between 0 and i64::MAX");
|
|
1894
2060
|
}
|
|
1895
|
-
|
|
1896
|
-
|
|
2061
|
+
assertU16Bps("startFeeBps", schedule.startFeeBps);
|
|
2062
|
+
assertU16Bps("endFeeBps", schedule.endFeeBps);
|
|
2063
|
+
if (schedule.endFeeBps > schedule.startFeeBps) {
|
|
2064
|
+
throw new Error("endFeeBps must be less than or equal to startFeeBps");
|
|
1897
2065
|
}
|
|
1898
|
-
const
|
|
1899
|
-
if (
|
|
1900
|
-
throw new Error(
|
|
2066
|
+
const durationSeconds = toBigInt2(schedule.durationSeconds);
|
|
2067
|
+
if (durationSeconds < 0n || durationSeconds > MAX_U32) {
|
|
2068
|
+
throw new Error("durationSeconds must be between 0 and u32::MAX");
|
|
1901
2069
|
}
|
|
1902
|
-
if (
|
|
1903
|
-
throw new Error("
|
|
2070
|
+
if (schedule.startFeeBps > schedule.endFeeBps && durationSeconds === 0n) {
|
|
2071
|
+
throw new Error("durationSeconds must be nonzero for decaying schedules");
|
|
1904
2072
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
payload
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
);
|
|
2073
|
+
return { startingTime, durationSeconds };
|
|
2074
|
+
}
|
|
2075
|
+
function encodeDynamicFeeSchedule(schedule) {
|
|
2076
|
+
const { startingTime, durationSeconds } = validateDynamicFeeScheduleArgs(schedule);
|
|
2077
|
+
const payload = new Uint8Array(DYNAMIC_FEE_SCHEDULE_LEN);
|
|
2078
|
+
payload.set(DYNAMIC_FEE_SCHEDULE_MAGIC, 0);
|
|
2079
|
+
payload[8] = DYNAMIC_FEE_SCHEDULE_VERSION;
|
|
2080
|
+
writeI64Le(payload, DYNAMIC_FEE_SCHEDULE_HEADER_LEN, startingTime);
|
|
2081
|
+
writeU16Le(payload, 24, schedule.startFeeBps);
|
|
2082
|
+
writeU16Le(payload, 26, schedule.endFeeBps);
|
|
2083
|
+
writeU32Le(payload, 28, durationSeconds);
|
|
1913
2084
|
return payload;
|
|
1914
2085
|
}
|
|
1915
|
-
function
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
2086
|
+
function encodeCpmmHookPayload(args = {}) {
|
|
2087
|
+
const schedulePayload = args.schedule ? encodeDynamicFeeSchedule(args.schedule) : new Uint8Array();
|
|
2088
|
+
const gatePayload = args.gateExpiry ? encodeCosignerGateExpiryPayload(args.gateExpiry) : new Uint8Array();
|
|
2089
|
+
const payload = new Uint8Array(schedulePayload.length + gatePayload.length);
|
|
2090
|
+
payload.set(schedulePayload, 0);
|
|
2091
|
+
payload.set(gatePayload, schedulePayload.length);
|
|
2092
|
+
return payload;
|
|
2093
|
+
}
|
|
2094
|
+
function encodeDynamicFeeCosignerGatePayload(args) {
|
|
2095
|
+
return encodeCosignerGateExpiryPayload(args);
|
|
2096
|
+
}
|
|
2097
|
+
function getCpmmHookRemainingAccounts({
|
|
2098
|
+
namespace,
|
|
2099
|
+
config,
|
|
2100
|
+
cosigner
|
|
2101
|
+
}) {
|
|
2102
|
+
const signedHookRemainingAccounts = [namespace];
|
|
2103
|
+
if (config && config !== namespace) {
|
|
2104
|
+
signedHookRemainingAccounts.push(config);
|
|
1921
2105
|
}
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
return null;
|
|
1925
|
-
}
|
|
1926
|
-
return {
|
|
1927
|
-
mode,
|
|
1928
|
-
value: readU64Le(payload, 2),
|
|
1929
|
-
cosigner: kit.getAddressDecoder().decode(
|
|
1930
|
-
payload.slice(GATE_EXPIRY_HEADER_LEN, GATE_EXPIRY_PAYLOAD_LEN)
|
|
1931
|
-
)
|
|
1932
|
-
};
|
|
1933
|
-
}
|
|
1934
|
-
function getCosignerGateStatus(hookPayload, clock = {}) {
|
|
1935
|
-
const expiry = decodeCosignerGateExpiryPayload(hookPayload);
|
|
1936
|
-
if (!expiry) {
|
|
1937
|
-
return {
|
|
1938
|
-
gateEnforced: true,
|
|
1939
|
-
expiryMode: GATE_EXPIRY_DISABLED,
|
|
1940
|
-
expiryValue: 0n,
|
|
1941
|
-
reason: "invalid_expiry_payload"
|
|
1942
|
-
};
|
|
1943
|
-
}
|
|
1944
|
-
if (expiry.mode === GATE_EXPIRY_DISABLED) {
|
|
1945
|
-
return {
|
|
1946
|
-
gateEnforced: true,
|
|
1947
|
-
expiryMode: expiry.mode,
|
|
1948
|
-
expiryValue: expiry.value,
|
|
1949
|
-
reason: "expiry_disabled"
|
|
1950
|
-
};
|
|
1951
|
-
}
|
|
1952
|
-
if (expiry.mode === GATE_EXPIRY_UNIX_TIMESTAMP) {
|
|
1953
|
-
const unixTimestamp = clock.unixTimestamp === void 0 ? BigInt(Math.floor(Date.now() / 1e3)) : toBigInt(clock.unixTimestamp);
|
|
1954
|
-
const expired = unixTimestamp >= expiry.value;
|
|
1955
|
-
return {
|
|
1956
|
-
gateEnforced: !expired,
|
|
1957
|
-
expiryMode: expiry.mode,
|
|
1958
|
-
expiryValue: expiry.value,
|
|
1959
|
-
reason: expired ? "timestamp_expired" : "timestamp_pending"
|
|
1960
|
-
};
|
|
1961
|
-
}
|
|
1962
|
-
if (expiry.mode === GATE_EXPIRY_SLOT) {
|
|
1963
|
-
if (clock.slot === void 0) {
|
|
1964
|
-
return {
|
|
1965
|
-
gateEnforced: true,
|
|
1966
|
-
expiryMode: expiry.mode,
|
|
1967
|
-
expiryValue: expiry.value,
|
|
1968
|
-
reason: "slot_unavailable"
|
|
1969
|
-
};
|
|
1970
|
-
}
|
|
1971
|
-
const expired = toBigInt(clock.slot) >= expiry.value;
|
|
1972
|
-
return {
|
|
1973
|
-
gateEnforced: !expired,
|
|
1974
|
-
expiryMode: expiry.mode,
|
|
1975
|
-
expiryValue: expiry.value,
|
|
1976
|
-
reason: expired ? "slot_expired" : "slot_pending"
|
|
1977
|
-
};
|
|
2106
|
+
if (cosigner) {
|
|
2107
|
+
signedHookRemainingAccounts.push(cosigner);
|
|
1978
2108
|
}
|
|
2109
|
+
const unsignedHookRemainingAccounts = signedHookRemainingAccounts.map(
|
|
2110
|
+
chunk7PXLEMBJ_cjs.getAddressFromRemainingAccount
|
|
2111
|
+
);
|
|
1979
2112
|
return {
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
2113
|
+
signedHookRemainingAccounts,
|
|
2114
|
+
unsignedHookRemainingAccounts,
|
|
2115
|
+
hookRemainingAccountsHash: computeRemainingAccountsHash(
|
|
2116
|
+
unsignedHookRemainingAccounts
|
|
2117
|
+
)
|
|
1984
2118
|
};
|
|
1985
2119
|
}
|
|
1986
|
-
function
|
|
1987
|
-
return getCosignerGateStatus(hookPayload, clock).gateEnforced;
|
|
1988
|
-
}
|
|
1989
|
-
function getCosignerHookRemainingAccounts({
|
|
2120
|
+
function getCpmmHookRemainingAccountAddresses({
|
|
1990
2121
|
namespace,
|
|
2122
|
+
config,
|
|
1991
2123
|
cosigner
|
|
1992
2124
|
}) {
|
|
1993
|
-
|
|
2125
|
+
return getCpmmHookRemainingAccounts({
|
|
1994
2126
|
namespace,
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
unsignedHookRemainingAccounts
|
|
2002
|
-
)
|
|
2003
|
-
};
|
|
2127
|
+
config,
|
|
2128
|
+
cosigner
|
|
2129
|
+
}).unsignedHookRemainingAccounts;
|
|
2130
|
+
}
|
|
2131
|
+
function isDynamicFeeSchedulePayload(payload) {
|
|
2132
|
+
return payload.length >= DYNAMIC_FEE_SCHEDULE_LEN && DYNAMIC_FEE_SCHEDULE_MAGIC.every((byte, index) => payload[index] === byte);
|
|
2004
2133
|
}
|
|
2005
2134
|
var textEncoder2 = new TextEncoder();
|
|
2006
|
-
async function
|
|
2135
|
+
async function getCpmmHookConfigAddress(programId = CPMM_HOOK_PROGRAM_ID) {
|
|
2007
2136
|
return kit.getProgramDerivedAddress({
|
|
2008
2137
|
programAddress: programId,
|
|
2009
|
-
seeds: [textEncoder2.encode(
|
|
2138
|
+
seeds: [textEncoder2.encode(SEED_CPMM_HOOK_CONFIG)]
|
|
2010
2139
|
});
|
|
2011
2140
|
}
|
|
2012
2141
|
|
|
@@ -2014,7 +2143,6 @@ async function getCosignerHookConfigAddress(programId = COSIGNER_HOOK_PROGRAM_ID
|
|
|
2014
2143
|
var initializer_exports = {};
|
|
2015
2144
|
chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
2016
2145
|
BPF_LOADER_UPGRADEABLE_PROGRAM_ID: () => BPF_LOADER_UPGRADEABLE_PROGRAM_ID,
|
|
2017
|
-
CPMM_HOOK_PROGRAM_ID: () => CPMM_HOOK_PROGRAM_ID,
|
|
2018
2146
|
CURVE_KIND_XYK: () => CURVE_KIND_XYK,
|
|
2019
2147
|
CURVE_PARAMS_FORMAT_XYK_V0: () => CURVE_PARAMS_FORMAT_XYK_V0,
|
|
2020
2148
|
DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND: () => DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND,
|
|
@@ -2072,6 +2200,7 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
2072
2200
|
getInitConfigCodec: () => getInitConfigCodec,
|
|
2073
2201
|
getInitConfigDecoder: () => getInitConfigDecoder,
|
|
2074
2202
|
getInitConfigEncoder: () => getInitConfigEncoder,
|
|
2203
|
+
getInitConfigSize: () => getInitConfigSize,
|
|
2075
2204
|
getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec2,
|
|
2076
2205
|
getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder2,
|
|
2077
2206
|
getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder2,
|
|
@@ -2110,43 +2239,55 @@ var INIT_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
|
2110
2239
|
126
|
|
2111
2240
|
]);
|
|
2112
2241
|
function getInitConfigEncoder() {
|
|
2113
|
-
return kit.
|
|
2114
|
-
kit.
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2242
|
+
return kit.fixEncoderSize(
|
|
2243
|
+
kit.transformEncoder(
|
|
2244
|
+
kit.getStructEncoder([
|
|
2245
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2246
|
+
["admin", kit.getAddressEncoder()],
|
|
2247
|
+
["migratorAllowlistLen", kit.getU8Encoder()],
|
|
2248
|
+
[
|
|
2249
|
+
"migratorAllowlist",
|
|
2250
|
+
kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })
|
|
2251
|
+
],
|
|
2252
|
+
["hookAllowlistLen", kit.getU8Encoder()],
|
|
2253
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
2254
|
+
["bump", kit.getU8Encoder()],
|
|
2255
|
+
["version", kit.getU8Encoder()],
|
|
2256
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
2257
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
2258
|
+
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
2259
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 24)]
|
|
2260
|
+
]),
|
|
2261
|
+
(value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR })
|
|
2262
|
+
),
|
|
2263
|
+
2123
|
|
2129
2264
|
);
|
|
2130
2265
|
}
|
|
2131
2266
|
function getInitConfigDecoder() {
|
|
2132
|
-
return kit.
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2267
|
+
return kit.fixDecoderSize(
|
|
2268
|
+
kit.getStructDecoder([
|
|
2269
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2270
|
+
["admin", kit.getAddressDecoder()],
|
|
2271
|
+
["migratorAllowlistLen", kit.getU8Decoder()],
|
|
2272
|
+
["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
2273
|
+
["hookAllowlistLen", kit.getU8Decoder()],
|
|
2274
|
+
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
2275
|
+
["bump", kit.getU8Decoder()],
|
|
2276
|
+
["version", kit.getU8Decoder()],
|
|
2277
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
2278
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
2279
|
+
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
2280
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 24)]
|
|
2281
|
+
]),
|
|
2282
|
+
2123
|
|
2283
|
+
);
|
|
2146
2284
|
}
|
|
2147
2285
|
function getInitConfigCodec() {
|
|
2148
2286
|
return kit.combineCodec(getInitConfigEncoder(), getInitConfigDecoder());
|
|
2149
2287
|
}
|
|
2288
|
+
function getInitConfigSize() {
|
|
2289
|
+
return 2123;
|
|
2290
|
+
}
|
|
2150
2291
|
function getFeeBeneficiaryEncoder() {
|
|
2151
2292
|
return kit.getStructEncoder([
|
|
2152
2293
|
["wallet", kit.getAddressEncoder()],
|
|
@@ -3136,10 +3277,10 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
3136
3277
|
admin,
|
|
3137
3278
|
config,
|
|
3138
3279
|
programData,
|
|
3139
|
-
systemProgram =
|
|
3280
|
+
systemProgram = chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
3140
3281
|
} = accounts;
|
|
3141
3282
|
const keys = [
|
|
3142
|
-
|
|
3283
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
3143
3284
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
3144
3285
|
{ address: programData, role: kit.AccountRole.READONLY },
|
|
3145
3286
|
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
@@ -3152,7 +3293,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
3152
3293
|
function createSetMigratorAllowlistInstruction(accounts, allowlist, programId = INITIALIZER_PROGRAM_ID) {
|
|
3153
3294
|
const { admin, config } = accounts;
|
|
3154
3295
|
const keys = [
|
|
3155
|
-
|
|
3296
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
3156
3297
|
{ address: config, role: kit.AccountRole.WRITABLE }
|
|
3157
3298
|
];
|
|
3158
3299
|
const data = new Uint8Array(
|
|
@@ -3163,7 +3304,7 @@ function createSetMigratorAllowlistInstruction(accounts, allowlist, programId =
|
|
|
3163
3304
|
function createSetHookAllowlistInstruction(accounts, allowlist, programId = INITIALIZER_PROGRAM_ID) {
|
|
3164
3305
|
const { admin, config } = accounts;
|
|
3165
3306
|
const keys = [
|
|
3166
|
-
|
|
3307
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
3167
3308
|
{ address: config, role: kit.AccountRole.WRITABLE }
|
|
3168
3309
|
];
|
|
3169
3310
|
const data = new Uint8Array(
|
|
@@ -3178,6 +3319,17 @@ var SEED_STATE = "state";
|
|
|
3178
3319
|
var SEED_MIGRATION_AUTHORITY = "migration_authority";
|
|
3179
3320
|
var MAX_RECIPIENTS = 2;
|
|
3180
3321
|
var CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS = {
|
|
3322
|
+
// SHA256("global:create_spot_pool")[0:8]
|
|
3323
|
+
createSpotPool: new Uint8Array([
|
|
3324
|
+
13,
|
|
3325
|
+
137,
|
|
3326
|
+
16,
|
|
3327
|
+
26,
|
|
3328
|
+
40,
|
|
3329
|
+
36,
|
|
3330
|
+
110,
|
|
3331
|
+
26
|
|
3332
|
+
]),
|
|
3181
3333
|
// SHA256("global:register_launch")[0:8]
|
|
3182
3334
|
registerLaunch: new Uint8Array([
|
|
3183
3335
|
114,
|
|
@@ -3268,13 +3420,13 @@ function decodeClaimReceipt(encodedAccount) {
|
|
|
3268
3420
|
getClaimReceiptDecoder()
|
|
3269
3421
|
);
|
|
3270
3422
|
}
|
|
3271
|
-
async function fetchClaimReceipt(rpc,
|
|
3272
|
-
const maybeAccount = await fetchMaybeClaimReceipt(rpc,
|
|
3423
|
+
async function fetchClaimReceipt(rpc, address6, config) {
|
|
3424
|
+
const maybeAccount = await fetchMaybeClaimReceipt(rpc, address6, config);
|
|
3273
3425
|
kit.assertAccountExists(maybeAccount);
|
|
3274
3426
|
return maybeAccount;
|
|
3275
3427
|
}
|
|
3276
|
-
async function fetchMaybeClaimReceipt(rpc,
|
|
3277
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
3428
|
+
async function fetchMaybeClaimReceipt(rpc, address6, config) {
|
|
3429
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3278
3430
|
return decodeClaimReceipt(maybeAccount);
|
|
3279
3431
|
}
|
|
3280
3432
|
async function fetchAllClaimReceipt(rpc, addresses, config) {
|
|
@@ -3338,13 +3490,13 @@ function decodeEntry(encodedAccount) {
|
|
|
3338
3490
|
getEntryDecoder()
|
|
3339
3491
|
);
|
|
3340
3492
|
}
|
|
3341
|
-
async function fetchEntry(rpc,
|
|
3342
|
-
const maybeAccount = await fetchMaybeEntry(rpc,
|
|
3493
|
+
async function fetchEntry(rpc, address6, config) {
|
|
3494
|
+
const maybeAccount = await fetchMaybeEntry(rpc, address6, config);
|
|
3343
3495
|
kit.assertAccountExists(maybeAccount);
|
|
3344
3496
|
return maybeAccount;
|
|
3345
3497
|
}
|
|
3346
|
-
async function fetchMaybeEntry(rpc,
|
|
3347
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
3498
|
+
async function fetchMaybeEntry(rpc, address6, config) {
|
|
3499
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3348
3500
|
return decodeEntry(maybeAccount);
|
|
3349
3501
|
}
|
|
3350
3502
|
async function fetchAllEntry(rpc, addresses, config) {
|
|
@@ -3406,13 +3558,13 @@ function decodeEntryByMint(encodedAccount) {
|
|
|
3406
3558
|
getEntryByMintDecoder()
|
|
3407
3559
|
);
|
|
3408
3560
|
}
|
|
3409
|
-
async function fetchEntryByMint(rpc,
|
|
3410
|
-
const maybeAccount = await fetchMaybeEntryByMint(rpc,
|
|
3561
|
+
async function fetchEntryByMint(rpc, address6, config) {
|
|
3562
|
+
const maybeAccount = await fetchMaybeEntryByMint(rpc, address6, config);
|
|
3411
3563
|
kit.assertAccountExists(maybeAccount);
|
|
3412
3564
|
return maybeAccount;
|
|
3413
3565
|
}
|
|
3414
|
-
async function fetchMaybeEntryByMint(rpc,
|
|
3415
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
3566
|
+
async function fetchMaybeEntryByMint(rpc, address6, config) {
|
|
3567
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3416
3568
|
return decodeEntryByMint(maybeAccount);
|
|
3417
3569
|
}
|
|
3418
3570
|
async function fetchAllEntryByMint(rpc, addresses, config) {
|
|
@@ -3441,39 +3593,48 @@ function getInitConfigDiscriminatorBytes() {
|
|
|
3441
3593
|
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(INIT_CONFIG_DISCRIMINATOR2);
|
|
3442
3594
|
}
|
|
3443
3595
|
function getInitConfigEncoder2() {
|
|
3444
|
-
return kit.
|
|
3445
|
-
kit.
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
|
|
3459
|
-
|
|
3596
|
+
return kit.fixEncoderSize(
|
|
3597
|
+
kit.transformEncoder(
|
|
3598
|
+
kit.getStructEncoder([
|
|
3599
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3600
|
+
["admin", kit.getAddressEncoder()],
|
|
3601
|
+
["migratorAllowlistLen", kit.getU8Encoder()],
|
|
3602
|
+
[
|
|
3603
|
+
"migratorAllowlist",
|
|
3604
|
+
kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })
|
|
3605
|
+
],
|
|
3606
|
+
["hookAllowlistLen", kit.getU8Encoder()],
|
|
3607
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
3608
|
+
["bump", kit.getU8Encoder()],
|
|
3609
|
+
["version", kit.getU8Encoder()],
|
|
3610
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
3611
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
3612
|
+
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
3613
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 24)]
|
|
3614
|
+
]),
|
|
3615
|
+
(value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR2 })
|
|
3616
|
+
),
|
|
3617
|
+
2123
|
|
3460
3618
|
);
|
|
3461
3619
|
}
|
|
3462
3620
|
function getInitConfigDecoder2() {
|
|
3463
|
-
return kit.
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
|
|
3468
|
-
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
|
|
3621
|
+
return kit.fixDecoderSize(
|
|
3622
|
+
kit.getStructDecoder([
|
|
3623
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3624
|
+
["admin", kit.getAddressDecoder()],
|
|
3625
|
+
["migratorAllowlistLen", kit.getU8Decoder()],
|
|
3626
|
+
["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
3627
|
+
["hookAllowlistLen", kit.getU8Decoder()],
|
|
3628
|
+
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
3629
|
+
["bump", kit.getU8Decoder()],
|
|
3630
|
+
["version", kit.getU8Decoder()],
|
|
3631
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
3632
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
3633
|
+
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
3634
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 24)]
|
|
3635
|
+
]),
|
|
3636
|
+
2123
|
|
3637
|
+
);
|
|
3477
3638
|
}
|
|
3478
3639
|
function getInitConfigCodec2() {
|
|
3479
3640
|
return kit.combineCodec(getInitConfigEncoder2(), getInitConfigDecoder2());
|
|
@@ -3484,13 +3645,13 @@ function decodeInitConfig(encodedAccount) {
|
|
|
3484
3645
|
getInitConfigDecoder2()
|
|
3485
3646
|
);
|
|
3486
3647
|
}
|
|
3487
|
-
async function fetchInitConfig(rpc,
|
|
3488
|
-
const maybeAccount = await fetchMaybeInitConfig(rpc,
|
|
3648
|
+
async function fetchInitConfig(rpc, address6, config) {
|
|
3649
|
+
const maybeAccount = await fetchMaybeInitConfig(rpc, address6, config);
|
|
3489
3650
|
kit.assertAccountExists(maybeAccount);
|
|
3490
3651
|
return maybeAccount;
|
|
3491
3652
|
}
|
|
3492
|
-
async function fetchMaybeInitConfig(rpc,
|
|
3493
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
3653
|
+
async function fetchMaybeInitConfig(rpc, address6, config) {
|
|
3654
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3494
3655
|
return decodeInitConfig(maybeAccount);
|
|
3495
3656
|
}
|
|
3496
3657
|
async function fetchAllInitConfig(rpc, addresses, config) {
|
|
@@ -3502,7 +3663,7 @@ async function fetchAllMaybeInitConfig(rpc, addresses, config) {
|
|
|
3502
3663
|
const maybeAccounts = await kit.fetchEncodedAccounts(rpc, addresses, config);
|
|
3503
3664
|
return maybeAccounts.map((maybeAccount) => decodeInitConfig(maybeAccount));
|
|
3504
3665
|
}
|
|
3505
|
-
function
|
|
3666
|
+
function getInitConfigSize2() {
|
|
3506
3667
|
return 2123;
|
|
3507
3668
|
}
|
|
3508
3669
|
function getAccumulatorUpdatedEncoder() {
|
|
@@ -3790,13 +3951,13 @@ function decodeLaunch(encodedAccount) {
|
|
|
3790
3951
|
getLaunchDecoder2()
|
|
3791
3952
|
);
|
|
3792
3953
|
}
|
|
3793
|
-
async function fetchLaunch(rpc,
|
|
3794
|
-
const maybeAccount = await fetchMaybeLaunch(rpc,
|
|
3954
|
+
async function fetchLaunch(rpc, address6, config) {
|
|
3955
|
+
const maybeAccount = await fetchMaybeLaunch(rpc, address6, config);
|
|
3795
3956
|
kit.assertAccountExists(maybeAccount);
|
|
3796
3957
|
return maybeAccount;
|
|
3797
3958
|
}
|
|
3798
|
-
async function fetchMaybeLaunch(rpc,
|
|
3799
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
3959
|
+
async function fetchMaybeLaunch(rpc, address6, config) {
|
|
3960
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3800
3961
|
return decodeLaunch(maybeAccount);
|
|
3801
3962
|
}
|
|
3802
3963
|
async function fetchAllLaunch(rpc, addresses, config) {
|
|
@@ -3870,13 +4031,13 @@ function decodeMarket(encodedAccount) {
|
|
|
3870
4031
|
getMarketDecoder()
|
|
3871
4032
|
);
|
|
3872
4033
|
}
|
|
3873
|
-
async function fetchMarket(rpc,
|
|
3874
|
-
const maybeAccount = await fetchMaybeMarket(rpc,
|
|
4034
|
+
async function fetchMarket(rpc, address6, config) {
|
|
4035
|
+
const maybeAccount = await fetchMaybeMarket(rpc, address6, config);
|
|
3875
4036
|
kit.assertAccountExists(maybeAccount);
|
|
3876
4037
|
return maybeAccount;
|
|
3877
4038
|
}
|
|
3878
|
-
async function fetchMaybeMarket(rpc,
|
|
3879
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
4039
|
+
async function fetchMaybeMarket(rpc, address6, config) {
|
|
4040
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3880
4041
|
return decodeMarket(maybeAccount);
|
|
3881
4042
|
}
|
|
3882
4043
|
async function fetchAllMarket(rpc, addresses, config) {
|
|
@@ -3942,13 +4103,13 @@ function decodeOracleState2(encodedAccount) {
|
|
|
3942
4103
|
getOracleStateDecoder()
|
|
3943
4104
|
);
|
|
3944
4105
|
}
|
|
3945
|
-
async function fetchOracleState(rpc,
|
|
3946
|
-
const maybeAccount = await fetchMaybeOracleState(rpc,
|
|
4106
|
+
async function fetchOracleState(rpc, address6, config) {
|
|
4107
|
+
const maybeAccount = await fetchMaybeOracleState(rpc, address6, config);
|
|
3947
4108
|
kit.assertAccountExists(maybeAccount);
|
|
3948
4109
|
return maybeAccount;
|
|
3949
4110
|
}
|
|
3950
|
-
async function fetchMaybeOracleState(rpc,
|
|
3951
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
4111
|
+
async function fetchMaybeOracleState(rpc, address6, config) {
|
|
4112
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
3952
4113
|
return decodeOracleState2(maybeAccount);
|
|
3953
4114
|
}
|
|
3954
4115
|
async function fetchAllOracleState(rpc, addresses, config) {
|
|
@@ -4218,9 +4379,9 @@ function parseClaimInstruction(instruction) {
|
|
|
4218
4379
|
}
|
|
4219
4380
|
let accountIndex = 0;
|
|
4220
4381
|
const getNextAccount = () => {
|
|
4221
|
-
const
|
|
4382
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
4222
4383
|
accountIndex += 1;
|
|
4223
|
-
return
|
|
4384
|
+
return accountMeta2;
|
|
4224
4385
|
};
|
|
4225
4386
|
return {
|
|
4226
4387
|
programAddress: instruction.programAddress,
|
|
@@ -4526,9 +4687,9 @@ function parseMigrateEntryInstruction(instruction) {
|
|
|
4526
4687
|
}
|
|
4527
4688
|
let accountIndex = 0;
|
|
4528
4689
|
const getNextAccount = () => {
|
|
4529
|
-
const
|
|
4690
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
4530
4691
|
accountIndex += 1;
|
|
4531
|
-
return
|
|
4692
|
+
return accountMeta2;
|
|
4532
4693
|
};
|
|
4533
4694
|
return {
|
|
4534
4695
|
programAddress: instruction.programAddress,
|
|
@@ -4628,9 +4789,9 @@ function parsePreviewPayoutIfWinnerInstruction(instruction) {
|
|
|
4628
4789
|
}
|
|
4629
4790
|
let accountIndex = 0;
|
|
4630
4791
|
const getNextAccount = () => {
|
|
4631
|
-
const
|
|
4792
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
4632
4793
|
accountIndex += 1;
|
|
4633
|
-
return
|
|
4794
|
+
return accountMeta2;
|
|
4634
4795
|
};
|
|
4635
4796
|
return {
|
|
4636
4797
|
programAddress: instruction.programAddress,
|
|
@@ -4939,9 +5100,9 @@ function parseRegisterEntryInstruction(instruction) {
|
|
|
4939
5100
|
}
|
|
4940
5101
|
let accountIndex = 0;
|
|
4941
5102
|
const getNextAccount = () => {
|
|
4942
|
-
const
|
|
5103
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
4943
5104
|
accountIndex += 1;
|
|
4944
|
-
return
|
|
5105
|
+
return accountMeta2;
|
|
4945
5106
|
};
|
|
4946
5107
|
return {
|
|
4947
5108
|
programAddress: instruction.programAddress,
|
|
@@ -5235,10 +5396,10 @@ async function getPredictionEntryByMintAddress(market, mint, programId = PREDICT
|
|
|
5235
5396
|
async function getTokenMetadataAddress(mint) {
|
|
5236
5397
|
const encoder = kit.getAddressEncoder();
|
|
5237
5398
|
const [metadataAddress] = await kit.getProgramDerivedAddress({
|
|
5238
|
-
programAddress:
|
|
5399
|
+
programAddress: chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
5239
5400
|
seeds: [
|
|
5240
5401
|
new TextEncoder().encode("metadata"),
|
|
5241
|
-
encoder.encode(
|
|
5402
|
+
encoder.encode(chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
5242
5403
|
encoder.encode(mint)
|
|
5243
5404
|
]
|
|
5244
5405
|
});
|
|
@@ -5269,18 +5430,18 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5269
5430
|
authority,
|
|
5270
5431
|
hookProgram,
|
|
5271
5432
|
migratorProgram,
|
|
5272
|
-
baseTokenProgram =
|
|
5273
|
-
quoteTokenProgram =
|
|
5274
|
-
systemProgram =
|
|
5433
|
+
baseTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5434
|
+
quoteTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5435
|
+
systemProgram = chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
5275
5436
|
rent,
|
|
5276
5437
|
metadataAccount,
|
|
5277
|
-
metadataProgram =
|
|
5438
|
+
metadataProgram = chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
5278
5439
|
hookCreateRemainingAccounts = []
|
|
5279
5440
|
} = accounts;
|
|
5280
5441
|
const withMetadata = Boolean(
|
|
5281
5442
|
args.metadataName && args.metadataName.length > 0
|
|
5282
5443
|
);
|
|
5283
|
-
const withToken2022Metadata = withMetadata && baseTokenProgram ===
|
|
5444
|
+
const withToken2022Metadata = withMetadata && baseTokenProgram === chunk4CI2M2F6_cjs.TOKEN_2022_PROGRAM_ADDRESS;
|
|
5284
5445
|
if (withMetadata && !metadataAccount) {
|
|
5285
5446
|
throw new Error(
|
|
5286
5447
|
"metadataName is set but metadataAccount was not provided. Derive it with await initializer.getTokenMetadataAddress(baseMintAddress)."
|
|
@@ -5288,7 +5449,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5288
5449
|
}
|
|
5289
5450
|
const createHooksEnabled = (args.hookFlags & (HF_BEFORE_CREATE | HF_AFTER_CREATE)) !== 0;
|
|
5290
5451
|
const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
|
|
5291
|
-
|
|
5452
|
+
chunk7PXLEMBJ_cjs.getAddressFromAddressOrSigner
|
|
5292
5453
|
);
|
|
5293
5454
|
const swapFeeBps = args.swapFeeBps ?? args.curveFeeBps;
|
|
5294
5455
|
if (swapFeeBps === void 0) {
|
|
@@ -5298,18 +5459,18 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5298
5459
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
5299
5460
|
{ address: launch, role: kit.AccountRole.WRITABLE },
|
|
5300
5461
|
{ address: launchAuthority, role: kit.AccountRole.READONLY },
|
|
5301
|
-
|
|
5462
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(baseMint, kit.AccountRole.WRITABLE_SIGNER),
|
|
5302
5463
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
5303
|
-
|
|
5304
|
-
|
|
5464
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(baseVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
5465
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(quoteVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
5305
5466
|
{
|
|
5306
5467
|
address: launchFeeState ?? (await getLaunchFeeStateAddress(launch, programId))[0],
|
|
5307
5468
|
role: kit.AccountRole.WRITABLE
|
|
5308
5469
|
},
|
|
5309
|
-
|
|
5470
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER)
|
|
5310
5471
|
];
|
|
5311
5472
|
keys.push(
|
|
5312
|
-
authority ?
|
|
5473
|
+
authority ? chunk7PXLEMBJ_cjs.createAccountMeta(authority, kit.AccountRole.READONLY_SIGNER) : { address: programId, role: kit.AccountRole.READONLY }
|
|
5313
5474
|
);
|
|
5314
5475
|
keys.push(
|
|
5315
5476
|
hookProgram ? { address: hookProgram, role: kit.AccountRole.READONLY } : { address: programId, role: kit.AccountRole.READONLY }
|
|
@@ -5342,15 +5503,15 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5342
5503
|
);
|
|
5343
5504
|
if (withToken2022Metadata) {
|
|
5344
5505
|
keys.push({
|
|
5345
|
-
address:
|
|
5506
|
+
address: chunk4CI2M2F6_cjs.SYSVAR_INSTRUCTIONS_ADDRESS,
|
|
5346
5507
|
role: kit.AccountRole.READONLY
|
|
5347
5508
|
});
|
|
5348
5509
|
}
|
|
5349
5510
|
keys.push(
|
|
5350
5511
|
...hookCreateRemainingAccounts.map(
|
|
5351
|
-
(account) =>
|
|
5512
|
+
(account) => chunk7PXLEMBJ_cjs.createAccountMeta(
|
|
5352
5513
|
account,
|
|
5353
|
-
|
|
5514
|
+
chunk7PXLEMBJ_cjs.isTransactionSigner(account) ? kit.AccountRole.READONLY_SIGNER : kit.AccountRole.READONLY
|
|
5354
5515
|
)
|
|
5355
5516
|
)
|
|
5356
5517
|
);
|
|
@@ -5374,7 +5535,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
5374
5535
|
if (migratorProgram === PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
5375
5536
|
const oracleState = args.namespace;
|
|
5376
5537
|
const entryId = args.launchId;
|
|
5377
|
-
const baseMintAddress =
|
|
5538
|
+
const baseMintAddress = chunk7PXLEMBJ_cjs.getAddressFromAddressOrSigner(baseMint);
|
|
5378
5539
|
const [market] = await getPredictionMarketAddress(oracleState, quoteMint);
|
|
5379
5540
|
const [potVault] = await getPredictionPotVaultAddress(market);
|
|
5380
5541
|
const [marketAuthority] = await getPredictionMarketAuthorityAddress(market);
|
|
@@ -5403,10 +5564,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
5403
5564
|
baseMint,
|
|
5404
5565
|
quoteMint,
|
|
5405
5566
|
user,
|
|
5406
|
-
hookProgram =
|
|
5567
|
+
hookProgram = chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
5407
5568
|
launchFeeState,
|
|
5408
|
-
baseTokenProgram =
|
|
5409
|
-
quoteTokenProgram =
|
|
5569
|
+
baseTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5570
|
+
quoteTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5410
5571
|
remainingAccounts = []
|
|
5411
5572
|
} = accounts;
|
|
5412
5573
|
const keys = [
|
|
@@ -5418,7 +5579,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
5418
5579
|
{ address: userQuoteAccount, role: kit.AccountRole.WRITABLE },
|
|
5419
5580
|
{ address: baseMint, role: kit.AccountRole.READONLY },
|
|
5420
5581
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
5421
|
-
|
|
5582
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(user, kit.AccountRole.READONLY_SIGNER),
|
|
5422
5583
|
// hook_program is Optional in the on-chain struct but still occupies a fixed
|
|
5423
5584
|
// slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
|
|
5424
5585
|
// no-op placeholder when no real hook is configured.
|
|
@@ -5426,7 +5587,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
5426
5587
|
{ address: launchFeeState, role: kit.AccountRole.WRITABLE },
|
|
5427
5588
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
5428
5589
|
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
5429
|
-
...remainingAccounts.map(
|
|
5590
|
+
...remainingAccounts.map(chunk7PXLEMBJ_cjs.createReadonlyRemainingAccountMeta)
|
|
5430
5591
|
];
|
|
5431
5592
|
const data = new Uint8Array(
|
|
5432
5593
|
getCurveSwapExactInInstructionDataEncoder().encode(args)
|
|
@@ -5445,9 +5606,9 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
5445
5606
|
launchFeeState,
|
|
5446
5607
|
migratorProgram,
|
|
5447
5608
|
payer,
|
|
5448
|
-
baseTokenProgram =
|
|
5449
|
-
quoteTokenProgram =
|
|
5450
|
-
systemProgram =
|
|
5609
|
+
baseTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5610
|
+
quoteTokenProgram = chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5611
|
+
systemProgram = chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
5451
5612
|
rent
|
|
5452
5613
|
} = accounts;
|
|
5453
5614
|
const keys = [
|
|
@@ -5460,13 +5621,13 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
5460
5621
|
{ address: quoteVault, role: kit.AccountRole.WRITABLE },
|
|
5461
5622
|
{ address: launchFeeState, role: kit.AccountRole.READONLY },
|
|
5462
5623
|
{ address: migratorProgram, role: kit.AccountRole.READONLY },
|
|
5463
|
-
|
|
5624
|
+
chunk7PXLEMBJ_cjs.createAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
5464
5625
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
5465
5626
|
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
5466
5627
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
5467
5628
|
{ address: rent, role: kit.AccountRole.READONLY }
|
|
5468
5629
|
];
|
|
5469
|
-
const data =
|
|
5630
|
+
const data = chunk7PXLEMBJ_cjs.encodeInstructionData(
|
|
5470
5631
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
|
|
5471
5632
|
);
|
|
5472
5633
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -5493,7 +5654,7 @@ function createPreviewSwapExactInInstruction(accounts, args, programId = INITIAL
|
|
|
5493
5654
|
const accountsList = hookProgram ? [...keys, { address: hookProgram, role: kit.AccountRole.READONLY }] : keys;
|
|
5494
5655
|
const accountsWithRemaining = [
|
|
5495
5656
|
...accountsList,
|
|
5496
|
-
...remainingAccounts.map(
|
|
5657
|
+
...remainingAccounts.map(chunk7PXLEMBJ_cjs.createReadonlyRemainingAccountMeta)
|
|
5497
5658
|
];
|
|
5498
5659
|
const data = new Uint8Array(
|
|
5499
5660
|
getPreviewSwapExactInInstructionDataEncoder2().encode(args)
|
|
@@ -5516,7 +5677,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
|
|
|
5516
5677
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
5517
5678
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
5518
5679
|
];
|
|
5519
|
-
const data =
|
|
5680
|
+
const data = chunk7PXLEMBJ_cjs.encodeInstructionData(
|
|
5520
5681
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
|
|
5521
5682
|
);
|
|
5522
5683
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -5525,1136 +5686,102 @@ function decodePreviewMigrationResult(data) {
|
|
|
5525
5686
|
return previewMigrationResultCodec.decode(data);
|
|
5526
5687
|
}
|
|
5527
5688
|
|
|
5528
|
-
// src/solana/
|
|
5529
|
-
var
|
|
5530
|
-
chunkQ7SFCCGT_cjs.__export(
|
|
5531
|
-
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
|
|
5539
|
-
|
|
5540
|
-
|
|
5541
|
-
|
|
5542
|
-
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
fetchMaybeCosignerConfig: () => fetchMaybeCosignerConfig2,
|
|
5568
|
-
getAddCosignerDiscriminatorBytes: () => getAddCosignerDiscriminatorBytes2,
|
|
5569
|
-
getAddCosignerInstruction: () => getAddCosignerInstruction2,
|
|
5570
|
-
getAddCosignerInstructionAsync: () => getAddCosignerInstructionAsync2,
|
|
5571
|
-
getAddCosignerInstructionDataCodec: () => getAddCosignerInstructionDataCodec2,
|
|
5572
|
-
getAddCosignerInstructionDataDecoder: () => getAddCosignerInstructionDataDecoder2,
|
|
5573
|
-
getAddCosignerInstructionDataEncoder: () => getAddCosignerInstructionDataEncoder2,
|
|
5574
|
-
getCosignerArgCodec: () => getCosignerArgCodec2,
|
|
5575
|
-
getCosignerArgDecoder: () => getCosignerArgDecoder2,
|
|
5576
|
-
getCosignerArgEncoder: () => getCosignerArgEncoder2,
|
|
5577
|
-
getCosignerConfigCodec: () => getCosignerConfigCodec2,
|
|
5578
|
-
getCosignerConfigDecoder: () => getCosignerConfigDecoder2,
|
|
5579
|
-
getCosignerConfigDiscriminatorBytes: () => getCosignerConfigDiscriminatorBytes2,
|
|
5580
|
-
getCosignerConfigEncoder: () => getCosignerConfigEncoder2,
|
|
5581
|
-
getCosignerConfigSize: () => getCosignerConfigSize2,
|
|
5582
|
-
getDynamicFeeHookConfigAddress: () => getDynamicFeeHookConfigAddress,
|
|
5583
|
-
getDynamicFeeHookErrorMessage: () => getDynamicFeeHookErrorMessage,
|
|
5584
|
-
getDynamicFeeHookRemainingAccountAddresses: () => getDynamicFeeHookRemainingAccountAddresses,
|
|
5585
|
-
getDynamicFeeHookRemainingAccounts: () => getDynamicFeeHookRemainingAccounts,
|
|
5586
|
-
getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec3,
|
|
5587
|
-
getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder3,
|
|
5588
|
-
getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder3,
|
|
5589
|
-
getInitializeConfigDiscriminatorBytes: () => getInitializeConfigDiscriminatorBytes3,
|
|
5590
|
-
getInitializeConfigInstruction: () => getInitializeConfigInstruction3,
|
|
5591
|
-
getInitializeConfigInstructionAsync: () => getInitializeConfigInstructionAsync4,
|
|
5592
|
-
getInitializeConfigInstructionDataCodec: () => getInitializeConfigInstructionDataCodec3,
|
|
5593
|
-
getInitializeConfigInstructionDataDecoder: () => getInitializeConfigInstructionDataDecoder3,
|
|
5594
|
-
getInitializeConfigInstructionDataEncoder: () => getInitializeConfigInstructionDataEncoder4,
|
|
5595
|
-
getRemoveCosignerDiscriminatorBytes: () => getRemoveCosignerDiscriminatorBytes2,
|
|
5596
|
-
getRemoveCosignerInstruction: () => getRemoveCosignerInstruction2,
|
|
5597
|
-
getRemoveCosignerInstructionAsync: () => getRemoveCosignerInstructionAsync2,
|
|
5598
|
-
getRemoveCosignerInstructionDataCodec: () => getRemoveCosignerInstructionDataCodec2,
|
|
5599
|
-
getRemoveCosignerInstructionDataDecoder: () => getRemoveCosignerInstructionDataDecoder2,
|
|
5600
|
-
getRemoveCosignerInstructionDataEncoder: () => getRemoveCosignerInstructionDataEncoder2,
|
|
5601
|
-
getSetAuthorityArgsCodec: () => getSetAuthorityArgsCodec2,
|
|
5602
|
-
getSetAuthorityArgsDecoder: () => getSetAuthorityArgsDecoder2,
|
|
5603
|
-
getSetAuthorityArgsEncoder: () => getSetAuthorityArgsEncoder2,
|
|
5604
|
-
getSetAuthorityDiscriminatorBytes: () => getSetAuthorityDiscriminatorBytes2,
|
|
5605
|
-
getSetAuthorityInstruction: () => getSetAuthorityInstruction2,
|
|
5606
|
-
getSetAuthorityInstructionAsync: () => getSetAuthorityInstructionAsync2,
|
|
5607
|
-
getSetAuthorityInstructionDataCodec: () => getSetAuthorityInstructionDataCodec2,
|
|
5608
|
-
getSetAuthorityInstructionDataDecoder: () => getSetAuthorityInstructionDataDecoder2,
|
|
5609
|
-
getSetAuthorityInstructionDataEncoder: () => getSetAuthorityInstructionDataEncoder2,
|
|
5610
|
-
identifyDynamicFeeHookAccount: () => identifyDynamicFeeHookAccount,
|
|
5611
|
-
identifyDynamicFeeHookInstruction: () => identifyDynamicFeeHookInstruction,
|
|
5612
|
-
isDynamicFeeHookError: () => isDynamicFeeHookError,
|
|
5613
|
-
isDynamicFeeSchedulePayload: () => isDynamicFeeSchedulePayload,
|
|
5614
|
-
parseAddCosignerInstruction: () => parseAddCosignerInstruction2,
|
|
5615
|
-
parseDynamicFeeHookInstruction: () => parseDynamicFeeHookInstruction,
|
|
5616
|
-
parseInitializeConfigInstruction: () => parseInitializeConfigInstruction4,
|
|
5617
|
-
parseRemoveCosignerInstruction: () => parseRemoveCosignerInstruction2,
|
|
5618
|
-
parseSetAuthorityInstruction: () => parseSetAuthorityInstruction2,
|
|
5619
|
-
validateDynamicFeeScheduleArgs: () => validateDynamicFeeScheduleArgs
|
|
5689
|
+
// src/solana/migrators/cpmmMigrator/index.ts
|
|
5690
|
+
var cpmmMigrator_exports = {};
|
|
5691
|
+
chunkQ7SFCCGT_cjs.__export(cpmmMigrator_exports, {
|
|
5692
|
+
CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: () => CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS,
|
|
5693
|
+
CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: () => CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS,
|
|
5694
|
+
CPMM_MIGRATOR_PROGRAM_ID: () => CPMM_MIGRATOR_PROGRAM_ID,
|
|
5695
|
+
MAX_RECIPIENTS: () => MAX_RECIPIENTS,
|
|
5696
|
+
SEED_MIGRATION_AUTHORITY: () => SEED_MIGRATION_AUTHORITY,
|
|
5697
|
+
SEED_STATE: () => SEED_STATE,
|
|
5698
|
+
buildCpmmMigrationRemainingAccounts: () => buildCpmmMigrationRemainingAccounts,
|
|
5699
|
+
buildCpmmMigrationRemainingAccountsHash: () => buildCpmmMigrationRemainingAccountsHash,
|
|
5700
|
+
createSpotPoolInstruction: () => createSpotPoolInstruction,
|
|
5701
|
+
deriveSpotPoolAccounts: () => deriveSpotPoolAccounts,
|
|
5702
|
+
encodeCreateSpotPoolPayload: () => encodeCreateSpotPoolPayload,
|
|
5703
|
+
encodeMigratePayload: () => encodeMigratePayload,
|
|
5704
|
+
encodeRegisterLaunchPayload: () => encodeRegisterLaunchPayload,
|
|
5705
|
+
fetchCpmmMigratorState: () => fetchCpmmMigratorState,
|
|
5706
|
+
getCpmmMigrationAuthorityAddress: () => getCpmmMigrationAuthorityAddress,
|
|
5707
|
+
getCpmmMigratorStateAddress: () => getCpmmMigratorStateAddress,
|
|
5708
|
+
getCpmmMigratorStateCodec: () => getCpmmMigratorStateCodec,
|
|
5709
|
+
getCpmmMigratorStateDecoder: () => getCpmmMigratorStateDecoder,
|
|
5710
|
+
getCpmmMigratorStateEncoder: () => getCpmmMigratorStateEncoder,
|
|
5711
|
+
getCreateSpotPoolArgsCodec: () => getCreateSpotPoolArgsCodec,
|
|
5712
|
+
getCreateSpotPoolArgsDecoder: () => getCreateSpotPoolArgsDecoder,
|
|
5713
|
+
getCreateSpotPoolArgsEncoder: () => getCreateSpotPoolArgsEncoder,
|
|
5714
|
+
getCreateSpotPoolInstruction: () => getCreateSpotPoolInstruction,
|
|
5715
|
+
getCreateSpotPoolInstructionAsync: () => getCreateSpotPoolInstructionAsync,
|
|
5716
|
+
getCreateSpotPoolInstructionDataCodec: () => getCreateSpotPoolInstructionDataCodec,
|
|
5717
|
+
getCreateSpotPoolInstructionDataDecoder: () => getCreateSpotPoolInstructionDataDecoder,
|
|
5718
|
+
getCreateSpotPoolInstructionDataEncoder: () => getCreateSpotPoolInstructionDataEncoder,
|
|
5719
|
+
getMigrateArgsCodec: () => getMigrateArgsCodec,
|
|
5720
|
+
getMigrateArgsDecoder: () => getMigrateArgsDecoder,
|
|
5721
|
+
getMigrateArgsEncoder: () => getMigrateArgsEncoder,
|
|
5722
|
+
getRecipientCodec: () => getRecipientCodec,
|
|
5723
|
+
getRecipientDecoder: () => getRecipientDecoder,
|
|
5724
|
+
getRecipientEncoder: () => getRecipientEncoder,
|
|
5725
|
+
getRegisterLaunchArgsCodec: () => getRegisterLaunchArgsCodec,
|
|
5726
|
+
getRegisterLaunchArgsDecoder: () => getRegisterLaunchArgsDecoder,
|
|
5727
|
+
getRegisterLaunchArgsEncoder: () => getRegisterLaunchArgsEncoder
|
|
5620
5728
|
});
|
|
5621
|
-
|
|
5622
|
-
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
183
|
|
5630
|
-
]);
|
|
5631
|
-
function getCosignerConfigDiscriminatorBytes2() {
|
|
5632
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
5633
|
-
COSIGNER_CONFIG_DISCRIMINATOR2
|
|
5634
|
-
);
|
|
5635
|
-
}
|
|
5636
|
-
function getCosignerConfigEncoder2() {
|
|
5637
|
-
return kit.transformEncoder(
|
|
5638
|
-
kit.getStructEncoder([
|
|
5639
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5640
|
-
["adminAuthority", kit.getAddressEncoder()],
|
|
5641
|
-
["cosignerCount", kit.getU8Encoder()],
|
|
5642
|
-
["bump", kit.getU8Encoder()],
|
|
5643
|
-
["version", kit.getU8Encoder()],
|
|
5644
|
-
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 37)],
|
|
5645
|
-
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })]
|
|
5646
|
-
]),
|
|
5647
|
-
(value) => ({ ...value, discriminator: COSIGNER_CONFIG_DISCRIMINATOR2 })
|
|
5648
|
-
);
|
|
5729
|
+
function getCreateSpotPoolArgsEncoder() {
|
|
5730
|
+
return kit.getStructEncoder([
|
|
5731
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
5732
|
+
["positionId", kit.getU64Encoder()],
|
|
5733
|
+
["amount0Max", kit.getU64Encoder()],
|
|
5734
|
+
["amount1Max", kit.getU64Encoder()],
|
|
5735
|
+
["minSharesOut", kit.getU128Encoder()]
|
|
5736
|
+
]);
|
|
5649
5737
|
}
|
|
5650
|
-
function
|
|
5738
|
+
function getCreateSpotPoolArgsDecoder() {
|
|
5651
5739
|
return kit.getStructDecoder([
|
|
5652
|
-
["
|
|
5653
|
-
["
|
|
5654
|
-
["
|
|
5655
|
-
["
|
|
5656
|
-
["
|
|
5657
|
-
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 37)],
|
|
5658
|
-
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })]
|
|
5740
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
5741
|
+
["positionId", kit.getU64Decoder()],
|
|
5742
|
+
["amount0Max", kit.getU64Decoder()],
|
|
5743
|
+
["amount1Max", kit.getU64Decoder()],
|
|
5744
|
+
["minSharesOut", kit.getU128Decoder()]
|
|
5659
5745
|
]);
|
|
5660
5746
|
}
|
|
5661
|
-
function
|
|
5662
|
-
return kit.combineCodec(
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
return kit.decodeAccount(
|
|
5666
|
-
encodedAccount,
|
|
5667
|
-
getCosignerConfigDecoder2()
|
|
5747
|
+
function getCreateSpotPoolArgsCodec() {
|
|
5748
|
+
return kit.combineCodec(
|
|
5749
|
+
getCreateSpotPoolArgsEncoder(),
|
|
5750
|
+
getCreateSpotPoolArgsDecoder()
|
|
5668
5751
|
);
|
|
5669
5752
|
}
|
|
5670
|
-
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5753
|
+
function getMigrateArgsEncoder() {
|
|
5754
|
+
return kit.getStructEncoder([
|
|
5755
|
+
["baseForDistribution", kit.getU64Encoder()],
|
|
5756
|
+
["baseForLiquidity", kit.getU64Encoder()]
|
|
5757
|
+
]);
|
|
5674
5758
|
}
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5759
|
+
function getMigrateArgsDecoder() {
|
|
5760
|
+
return kit.getStructDecoder([
|
|
5761
|
+
["baseForDistribution", kit.getU64Decoder()],
|
|
5762
|
+
["baseForLiquidity", kit.getU64Decoder()]
|
|
5763
|
+
]);
|
|
5678
5764
|
}
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
rpc,
|
|
5682
|
-
addresses,
|
|
5683
|
-
config
|
|
5684
|
-
);
|
|
5685
|
-
kit.assertAccountsExist(maybeAccounts);
|
|
5686
|
-
return maybeAccounts;
|
|
5765
|
+
function getMigrateArgsCodec() {
|
|
5766
|
+
return kit.combineCodec(getMigrateArgsEncoder(), getMigrateArgsDecoder());
|
|
5687
5767
|
}
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
);
|
|
5768
|
+
function getMigratedPoolHookConfigEncoder() {
|
|
5769
|
+
return kit.getStructEncoder([
|
|
5770
|
+
["hookProgram", kit.getAddressEncoder()],
|
|
5771
|
+
["hookFlags", kit.getU32Encoder()]
|
|
5772
|
+
]);
|
|
5693
5773
|
}
|
|
5694
|
-
function
|
|
5695
|
-
return
|
|
5774
|
+
function getMigratedPoolHookConfigDecoder() {
|
|
5775
|
+
return kit.getStructDecoder([
|
|
5776
|
+
["hookProgram", kit.getAddressDecoder()],
|
|
5777
|
+
["hookFlags", kit.getU32Decoder()]
|
|
5778
|
+
]);
|
|
5696
5779
|
}
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
202,
|
|
5703
|
-
255,
|
|
5704
|
-
218,
|
|
5705
|
-
233
|
|
5706
|
-
]);
|
|
5707
|
-
function getAddCosignerDiscriminatorBytes2() {
|
|
5708
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
5709
|
-
ADD_COSIGNER_DISCRIMINATOR2
|
|
5710
|
-
);
|
|
5711
|
-
}
|
|
5712
|
-
function getAddCosignerInstructionDataEncoder2() {
|
|
5713
|
-
return kit.transformEncoder(
|
|
5714
|
-
kit.getStructEncoder([
|
|
5715
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5716
|
-
["cosigner", kit.getAddressEncoder()]
|
|
5717
|
-
]),
|
|
5718
|
-
(value) => ({ ...value, discriminator: ADD_COSIGNER_DISCRIMINATOR2 })
|
|
5719
|
-
);
|
|
5720
|
-
}
|
|
5721
|
-
function getAddCosignerInstructionDataDecoder2() {
|
|
5722
|
-
return kit.getStructDecoder([
|
|
5723
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
5724
|
-
["cosigner", kit.getAddressDecoder()]
|
|
5725
|
-
]);
|
|
5726
|
-
}
|
|
5727
|
-
function getAddCosignerInstructionDataCodec2() {
|
|
5728
|
-
return kit.combineCodec(
|
|
5729
|
-
getAddCosignerInstructionDataEncoder2(),
|
|
5730
|
-
getAddCosignerInstructionDataDecoder2()
|
|
5731
|
-
);
|
|
5732
|
-
}
|
|
5733
|
-
async function getAddCosignerInstructionAsync2(input, config) {
|
|
5734
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
5735
|
-
const originalAccounts = {
|
|
5736
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
5737
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
5738
|
-
};
|
|
5739
|
-
const accounts = originalAccounts;
|
|
5740
|
-
const args = { ...input };
|
|
5741
|
-
if (!accounts.config.value) {
|
|
5742
|
-
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
5743
|
-
programAddress,
|
|
5744
|
-
seeds: [
|
|
5745
|
-
kit.getBytesEncoder().encode(
|
|
5746
|
-
new Uint8Array([
|
|
5747
|
-
99,
|
|
5748
|
-
111,
|
|
5749
|
-
115,
|
|
5750
|
-
105,
|
|
5751
|
-
103,
|
|
5752
|
-
110,
|
|
5753
|
-
101,
|
|
5754
|
-
114,
|
|
5755
|
-
95,
|
|
5756
|
-
104,
|
|
5757
|
-
111,
|
|
5758
|
-
111,
|
|
5759
|
-
107,
|
|
5760
|
-
95,
|
|
5761
|
-
99,
|
|
5762
|
-
111,
|
|
5763
|
-
110,
|
|
5764
|
-
102,
|
|
5765
|
-
105,
|
|
5766
|
-
103
|
|
5767
|
-
])
|
|
5768
|
-
)
|
|
5769
|
-
]
|
|
5770
|
-
});
|
|
5771
|
-
}
|
|
5772
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5773
|
-
return Object.freeze({
|
|
5774
|
-
accounts: [
|
|
5775
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
5776
|
-
getAccountMeta("config", accounts.config)
|
|
5777
|
-
],
|
|
5778
|
-
data: getAddCosignerInstructionDataEncoder2().encode(
|
|
5779
|
-
args
|
|
5780
|
-
),
|
|
5781
|
-
programAddress
|
|
5782
|
-
});
|
|
5783
|
-
}
|
|
5784
|
-
function getAddCosignerInstruction2(input, config) {
|
|
5785
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
5786
|
-
const originalAccounts = {
|
|
5787
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
5788
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
5789
|
-
};
|
|
5790
|
-
const accounts = originalAccounts;
|
|
5791
|
-
const args = { ...input };
|
|
5792
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5793
|
-
return Object.freeze({
|
|
5794
|
-
accounts: [
|
|
5795
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
5796
|
-
getAccountMeta("config", accounts.config)
|
|
5797
|
-
],
|
|
5798
|
-
data: getAddCosignerInstructionDataEncoder2().encode(
|
|
5799
|
-
args
|
|
5800
|
-
),
|
|
5801
|
-
programAddress
|
|
5802
|
-
});
|
|
5803
|
-
}
|
|
5804
|
-
function parseAddCosignerInstruction2(instruction) {
|
|
5805
|
-
if (instruction.accounts.length < 2) {
|
|
5806
|
-
throw new kit.SolanaError(
|
|
5807
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
5808
|
-
{
|
|
5809
|
-
actualAccountMetas: instruction.accounts.length,
|
|
5810
|
-
expectedAccountMetas: 2
|
|
5811
|
-
}
|
|
5812
|
-
);
|
|
5813
|
-
}
|
|
5814
|
-
let accountIndex = 0;
|
|
5815
|
-
const getNextAccount = () => {
|
|
5816
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
5817
|
-
accountIndex += 1;
|
|
5818
|
-
return accountMeta;
|
|
5819
|
-
};
|
|
5820
|
-
return {
|
|
5821
|
-
programAddress: instruction.programAddress,
|
|
5822
|
-
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
5823
|
-
data: getAddCosignerInstructionDataDecoder2().decode(instruction.data)
|
|
5824
|
-
};
|
|
5825
|
-
}
|
|
5826
|
-
var INITIALIZE_CONFIG_DISCRIMINATOR4 = new Uint8Array([
|
|
5827
|
-
208,
|
|
5828
|
-
127,
|
|
5829
|
-
21,
|
|
5830
|
-
1,
|
|
5831
|
-
194,
|
|
5832
|
-
190,
|
|
5833
|
-
196,
|
|
5834
|
-
70
|
|
5835
|
-
]);
|
|
5836
|
-
function getInitializeConfigDiscriminatorBytes3() {
|
|
5837
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
5838
|
-
INITIALIZE_CONFIG_DISCRIMINATOR4
|
|
5839
|
-
);
|
|
5840
|
-
}
|
|
5841
|
-
function getInitializeConfigInstructionDataEncoder4() {
|
|
5842
|
-
return kit.transformEncoder(
|
|
5843
|
-
kit.getStructEncoder([
|
|
5844
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5845
|
-
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
5846
|
-
]),
|
|
5847
|
-
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR4 })
|
|
5848
|
-
);
|
|
5849
|
-
}
|
|
5850
|
-
function getInitializeConfigInstructionDataDecoder3() {
|
|
5851
|
-
return kit.getStructDecoder([
|
|
5852
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
5853
|
-
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
5854
|
-
]);
|
|
5855
|
-
}
|
|
5856
|
-
function getInitializeConfigInstructionDataCodec3() {
|
|
5857
|
-
return kit.combineCodec(
|
|
5858
|
-
getInitializeConfigInstructionDataEncoder4(),
|
|
5859
|
-
getInitializeConfigInstructionDataDecoder3()
|
|
5860
|
-
);
|
|
5861
|
-
}
|
|
5862
|
-
async function getInitializeConfigInstructionAsync4(input, config) {
|
|
5863
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
5864
|
-
const originalAccounts = {
|
|
5865
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
5866
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
5867
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
5868
|
-
programData: { value: input.programData ?? null, isWritable: false },
|
|
5869
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
5870
|
-
};
|
|
5871
|
-
const accounts = originalAccounts;
|
|
5872
|
-
const args = { ...input };
|
|
5873
|
-
if (!accounts.config.value) {
|
|
5874
|
-
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
5875
|
-
programAddress,
|
|
5876
|
-
seeds: [
|
|
5877
|
-
kit.getBytesEncoder().encode(
|
|
5878
|
-
new Uint8Array([
|
|
5879
|
-
99,
|
|
5880
|
-
111,
|
|
5881
|
-
115,
|
|
5882
|
-
105,
|
|
5883
|
-
103,
|
|
5884
|
-
110,
|
|
5885
|
-
101,
|
|
5886
|
-
114,
|
|
5887
|
-
95,
|
|
5888
|
-
104,
|
|
5889
|
-
111,
|
|
5890
|
-
111,
|
|
5891
|
-
107,
|
|
5892
|
-
95,
|
|
5893
|
-
99,
|
|
5894
|
-
111,
|
|
5895
|
-
110,
|
|
5896
|
-
102,
|
|
5897
|
-
105,
|
|
5898
|
-
103
|
|
5899
|
-
])
|
|
5900
|
-
)
|
|
5901
|
-
]
|
|
5902
|
-
});
|
|
5903
|
-
}
|
|
5904
|
-
if (!accounts.systemProgram.value) {
|
|
5905
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
5906
|
-
}
|
|
5907
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5908
|
-
return Object.freeze({
|
|
5909
|
-
accounts: [
|
|
5910
|
-
getAccountMeta("payer", accounts.payer),
|
|
5911
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
5912
|
-
getAccountMeta("config", accounts.config),
|
|
5913
|
-
getAccountMeta("programData", accounts.programData),
|
|
5914
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
5915
|
-
],
|
|
5916
|
-
data: getInitializeConfigInstructionDataEncoder4().encode(
|
|
5917
|
-
args
|
|
5918
|
-
),
|
|
5919
|
-
programAddress
|
|
5920
|
-
});
|
|
5921
|
-
}
|
|
5922
|
-
function getInitializeConfigInstruction3(input, config) {
|
|
5923
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
5924
|
-
const originalAccounts = {
|
|
5925
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
5926
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
5927
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
5928
|
-
programData: { value: input.programData ?? null, isWritable: false },
|
|
5929
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
5930
|
-
};
|
|
5931
|
-
const accounts = originalAccounts;
|
|
5932
|
-
const args = { ...input };
|
|
5933
|
-
if (!accounts.systemProgram.value) {
|
|
5934
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
5935
|
-
}
|
|
5936
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5937
|
-
return Object.freeze({
|
|
5938
|
-
accounts: [
|
|
5939
|
-
getAccountMeta("payer", accounts.payer),
|
|
5940
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
5941
|
-
getAccountMeta("config", accounts.config),
|
|
5942
|
-
getAccountMeta("programData", accounts.programData),
|
|
5943
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
5944
|
-
],
|
|
5945
|
-
data: getInitializeConfigInstructionDataEncoder4().encode(
|
|
5946
|
-
args
|
|
5947
|
-
),
|
|
5948
|
-
programAddress
|
|
5949
|
-
});
|
|
5950
|
-
}
|
|
5951
|
-
function parseInitializeConfigInstruction4(instruction) {
|
|
5952
|
-
if (instruction.accounts.length < 5) {
|
|
5953
|
-
throw new kit.SolanaError(
|
|
5954
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
5955
|
-
{
|
|
5956
|
-
actualAccountMetas: instruction.accounts.length,
|
|
5957
|
-
expectedAccountMetas: 5
|
|
5958
|
-
}
|
|
5959
|
-
);
|
|
5960
|
-
}
|
|
5961
|
-
let accountIndex = 0;
|
|
5962
|
-
const getNextAccount = () => {
|
|
5963
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
5964
|
-
accountIndex += 1;
|
|
5965
|
-
return accountMeta;
|
|
5966
|
-
};
|
|
5967
|
-
return {
|
|
5968
|
-
programAddress: instruction.programAddress,
|
|
5969
|
-
accounts: {
|
|
5970
|
-
payer: getNextAccount(),
|
|
5971
|
-
adminAuthority: getNextAccount(),
|
|
5972
|
-
config: getNextAccount(),
|
|
5973
|
-
programData: getNextAccount(),
|
|
5974
|
-
systemProgram: getNextAccount()
|
|
5975
|
-
},
|
|
5976
|
-
data: getInitializeConfigInstructionDataDecoder3().decode(instruction.data)
|
|
5977
|
-
};
|
|
5978
|
-
}
|
|
5979
|
-
var REMOVE_COSIGNER_DISCRIMINATOR2 = new Uint8Array([
|
|
5980
|
-
174,
|
|
5981
|
-
11,
|
|
5982
|
-
171,
|
|
5983
|
-
252,
|
|
5984
|
-
179,
|
|
5985
|
-
99,
|
|
5986
|
-
220,
|
|
5987
|
-
27
|
|
5988
|
-
]);
|
|
5989
|
-
function getRemoveCosignerDiscriminatorBytes2() {
|
|
5990
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
5991
|
-
REMOVE_COSIGNER_DISCRIMINATOR2
|
|
5992
|
-
);
|
|
5993
|
-
}
|
|
5994
|
-
function getRemoveCosignerInstructionDataEncoder2() {
|
|
5995
|
-
return kit.transformEncoder(
|
|
5996
|
-
kit.getStructEncoder([
|
|
5997
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5998
|
-
["cosigner", kit.getAddressEncoder()]
|
|
5999
|
-
]),
|
|
6000
|
-
(value) => ({ ...value, discriminator: REMOVE_COSIGNER_DISCRIMINATOR2 })
|
|
6001
|
-
);
|
|
6002
|
-
}
|
|
6003
|
-
function getRemoveCosignerInstructionDataDecoder2() {
|
|
6004
|
-
return kit.getStructDecoder([
|
|
6005
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
6006
|
-
["cosigner", kit.getAddressDecoder()]
|
|
6007
|
-
]);
|
|
6008
|
-
}
|
|
6009
|
-
function getRemoveCosignerInstructionDataCodec2() {
|
|
6010
|
-
return kit.combineCodec(
|
|
6011
|
-
getRemoveCosignerInstructionDataEncoder2(),
|
|
6012
|
-
getRemoveCosignerInstructionDataDecoder2()
|
|
6013
|
-
);
|
|
6014
|
-
}
|
|
6015
|
-
async function getRemoveCosignerInstructionAsync2(input, config) {
|
|
6016
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
6017
|
-
const originalAccounts = {
|
|
6018
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
6019
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
6020
|
-
};
|
|
6021
|
-
const accounts = originalAccounts;
|
|
6022
|
-
const args = { ...input };
|
|
6023
|
-
if (!accounts.config.value) {
|
|
6024
|
-
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
6025
|
-
programAddress,
|
|
6026
|
-
seeds: [
|
|
6027
|
-
kit.getBytesEncoder().encode(
|
|
6028
|
-
new Uint8Array([
|
|
6029
|
-
99,
|
|
6030
|
-
111,
|
|
6031
|
-
115,
|
|
6032
|
-
105,
|
|
6033
|
-
103,
|
|
6034
|
-
110,
|
|
6035
|
-
101,
|
|
6036
|
-
114,
|
|
6037
|
-
95,
|
|
6038
|
-
104,
|
|
6039
|
-
111,
|
|
6040
|
-
111,
|
|
6041
|
-
107,
|
|
6042
|
-
95,
|
|
6043
|
-
99,
|
|
6044
|
-
111,
|
|
6045
|
-
110,
|
|
6046
|
-
102,
|
|
6047
|
-
105,
|
|
6048
|
-
103
|
|
6049
|
-
])
|
|
6050
|
-
)
|
|
6051
|
-
]
|
|
6052
|
-
});
|
|
6053
|
-
}
|
|
6054
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6055
|
-
return Object.freeze({
|
|
6056
|
-
accounts: [
|
|
6057
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
6058
|
-
getAccountMeta("config", accounts.config)
|
|
6059
|
-
],
|
|
6060
|
-
data: getRemoveCosignerInstructionDataEncoder2().encode(
|
|
6061
|
-
args
|
|
6062
|
-
),
|
|
6063
|
-
programAddress
|
|
6064
|
-
});
|
|
6065
|
-
}
|
|
6066
|
-
function getRemoveCosignerInstruction2(input, config) {
|
|
6067
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
6068
|
-
const originalAccounts = {
|
|
6069
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
6070
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
6071
|
-
};
|
|
6072
|
-
const accounts = originalAccounts;
|
|
6073
|
-
const args = { ...input };
|
|
6074
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6075
|
-
return Object.freeze({
|
|
6076
|
-
accounts: [
|
|
6077
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
6078
|
-
getAccountMeta("config", accounts.config)
|
|
6079
|
-
],
|
|
6080
|
-
data: getRemoveCosignerInstructionDataEncoder2().encode(
|
|
6081
|
-
args
|
|
6082
|
-
),
|
|
6083
|
-
programAddress
|
|
6084
|
-
});
|
|
6085
|
-
}
|
|
6086
|
-
function parseRemoveCosignerInstruction2(instruction) {
|
|
6087
|
-
if (instruction.accounts.length < 2) {
|
|
6088
|
-
throw new kit.SolanaError(
|
|
6089
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
6090
|
-
{
|
|
6091
|
-
actualAccountMetas: instruction.accounts.length,
|
|
6092
|
-
expectedAccountMetas: 2
|
|
6093
|
-
}
|
|
6094
|
-
);
|
|
6095
|
-
}
|
|
6096
|
-
let accountIndex = 0;
|
|
6097
|
-
const getNextAccount = () => {
|
|
6098
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
6099
|
-
accountIndex += 1;
|
|
6100
|
-
return accountMeta;
|
|
6101
|
-
};
|
|
6102
|
-
return {
|
|
6103
|
-
programAddress: instruction.programAddress,
|
|
6104
|
-
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
6105
|
-
data: getRemoveCosignerInstructionDataDecoder2().decode(instruction.data)
|
|
6106
|
-
};
|
|
6107
|
-
}
|
|
6108
|
-
var SET_AUTHORITY_DISCRIMINATOR2 = new Uint8Array([
|
|
6109
|
-
133,
|
|
6110
|
-
250,
|
|
6111
|
-
37,
|
|
6112
|
-
21,
|
|
6113
|
-
110,
|
|
6114
|
-
163,
|
|
6115
|
-
26,
|
|
6116
|
-
121
|
|
6117
|
-
]);
|
|
6118
|
-
function getSetAuthorityDiscriminatorBytes2() {
|
|
6119
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6120
|
-
SET_AUTHORITY_DISCRIMINATOR2
|
|
6121
|
-
);
|
|
6122
|
-
}
|
|
6123
|
-
function getSetAuthorityInstructionDataEncoder2() {
|
|
6124
|
-
return kit.transformEncoder(
|
|
6125
|
-
kit.getStructEncoder([
|
|
6126
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
6127
|
-
["adminAuthority", kit.getAddressEncoder()]
|
|
6128
|
-
]),
|
|
6129
|
-
(value) => ({ ...value, discriminator: SET_AUTHORITY_DISCRIMINATOR2 })
|
|
6130
|
-
);
|
|
6131
|
-
}
|
|
6132
|
-
function getSetAuthorityInstructionDataDecoder2() {
|
|
6133
|
-
return kit.getStructDecoder([
|
|
6134
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
6135
|
-
["adminAuthority", kit.getAddressDecoder()]
|
|
6136
|
-
]);
|
|
6137
|
-
}
|
|
6138
|
-
function getSetAuthorityInstructionDataCodec2() {
|
|
6139
|
-
return kit.combineCodec(
|
|
6140
|
-
getSetAuthorityInstructionDataEncoder2(),
|
|
6141
|
-
getSetAuthorityInstructionDataDecoder2()
|
|
6142
|
-
);
|
|
6143
|
-
}
|
|
6144
|
-
async function getSetAuthorityInstructionAsync2(input, config) {
|
|
6145
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
6146
|
-
const originalAccounts = {
|
|
6147
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
6148
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
6149
|
-
};
|
|
6150
|
-
const accounts = originalAccounts;
|
|
6151
|
-
const args = { ...input, adminAuthority: input.adminAuthorityArg };
|
|
6152
|
-
if (!accounts.config.value) {
|
|
6153
|
-
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
6154
|
-
programAddress,
|
|
6155
|
-
seeds: [
|
|
6156
|
-
kit.getBytesEncoder().encode(
|
|
6157
|
-
new Uint8Array([
|
|
6158
|
-
99,
|
|
6159
|
-
111,
|
|
6160
|
-
115,
|
|
6161
|
-
105,
|
|
6162
|
-
103,
|
|
6163
|
-
110,
|
|
6164
|
-
101,
|
|
6165
|
-
114,
|
|
6166
|
-
95,
|
|
6167
|
-
104,
|
|
6168
|
-
111,
|
|
6169
|
-
111,
|
|
6170
|
-
107,
|
|
6171
|
-
95,
|
|
6172
|
-
99,
|
|
6173
|
-
111,
|
|
6174
|
-
110,
|
|
6175
|
-
102,
|
|
6176
|
-
105,
|
|
6177
|
-
103
|
|
6178
|
-
])
|
|
6179
|
-
)
|
|
6180
|
-
]
|
|
6181
|
-
});
|
|
6182
|
-
}
|
|
6183
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6184
|
-
return Object.freeze({
|
|
6185
|
-
accounts: [
|
|
6186
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
6187
|
-
getAccountMeta("config", accounts.config)
|
|
6188
|
-
],
|
|
6189
|
-
data: getSetAuthorityInstructionDataEncoder2().encode(
|
|
6190
|
-
args
|
|
6191
|
-
),
|
|
6192
|
-
programAddress
|
|
6193
|
-
});
|
|
6194
|
-
}
|
|
6195
|
-
function getSetAuthorityInstruction2(input, config) {
|
|
6196
|
-
const programAddress = config?.programAddress ?? DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS;
|
|
6197
|
-
const originalAccounts = {
|
|
6198
|
-
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
6199
|
-
config: { value: input.config ?? null, isWritable: true }
|
|
6200
|
-
};
|
|
6201
|
-
const accounts = originalAccounts;
|
|
6202
|
-
const args = { ...input, adminAuthority: input.adminAuthorityArg };
|
|
6203
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6204
|
-
return Object.freeze({
|
|
6205
|
-
accounts: [
|
|
6206
|
-
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
6207
|
-
getAccountMeta("config", accounts.config)
|
|
6208
|
-
],
|
|
6209
|
-
data: getSetAuthorityInstructionDataEncoder2().encode(
|
|
6210
|
-
args
|
|
6211
|
-
),
|
|
6212
|
-
programAddress
|
|
6213
|
-
});
|
|
6214
|
-
}
|
|
6215
|
-
function parseSetAuthorityInstruction2(instruction) {
|
|
6216
|
-
if (instruction.accounts.length < 2) {
|
|
6217
|
-
throw new kit.SolanaError(
|
|
6218
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
6219
|
-
{
|
|
6220
|
-
actualAccountMetas: instruction.accounts.length,
|
|
6221
|
-
expectedAccountMetas: 2
|
|
6222
|
-
}
|
|
6223
|
-
);
|
|
6224
|
-
}
|
|
6225
|
-
let accountIndex = 0;
|
|
6226
|
-
const getNextAccount = () => {
|
|
6227
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
6228
|
-
accountIndex += 1;
|
|
6229
|
-
return accountMeta;
|
|
6230
|
-
};
|
|
6231
|
-
return {
|
|
6232
|
-
programAddress: instruction.programAddress,
|
|
6233
|
-
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
6234
|
-
data: getSetAuthorityInstructionDataDecoder2().decode(instruction.data)
|
|
6235
|
-
};
|
|
6236
|
-
}
|
|
6237
|
-
|
|
6238
|
-
// src/solana/generated/dynamicFeeHook/programs/dynamicFeeHook.ts
|
|
6239
|
-
var DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS = "HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i";
|
|
6240
|
-
var DynamicFeeHookAccount = /* @__PURE__ */ ((DynamicFeeHookAccount2) => {
|
|
6241
|
-
DynamicFeeHookAccount2[DynamicFeeHookAccount2["CosignerConfig"] = 0] = "CosignerConfig";
|
|
6242
|
-
return DynamicFeeHookAccount2;
|
|
6243
|
-
})(DynamicFeeHookAccount || {});
|
|
6244
|
-
function identifyDynamicFeeHookAccount(account) {
|
|
6245
|
-
const data = "data" in account ? account.data : account;
|
|
6246
|
-
if (kit.containsBytes(
|
|
6247
|
-
data,
|
|
6248
|
-
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6249
|
-
new Uint8Array([133, 227, 177, 74, 145, 74, 247, 183])
|
|
6250
|
-
),
|
|
6251
|
-
0
|
|
6252
|
-
)) {
|
|
6253
|
-
return 0 /* CosignerConfig */;
|
|
6254
|
-
}
|
|
6255
|
-
throw new kit.SolanaError(
|
|
6256
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,
|
|
6257
|
-
{ accountData: data, programName: "dynamicFeeHook" }
|
|
6258
|
-
);
|
|
6259
|
-
}
|
|
6260
|
-
var DynamicFeeHookInstruction = /* @__PURE__ */ ((DynamicFeeHookInstruction2) => {
|
|
6261
|
-
DynamicFeeHookInstruction2[DynamicFeeHookInstruction2["AddCosigner"] = 0] = "AddCosigner";
|
|
6262
|
-
DynamicFeeHookInstruction2[DynamicFeeHookInstruction2["InitializeConfig"] = 1] = "InitializeConfig";
|
|
6263
|
-
DynamicFeeHookInstruction2[DynamicFeeHookInstruction2["RemoveCosigner"] = 2] = "RemoveCosigner";
|
|
6264
|
-
DynamicFeeHookInstruction2[DynamicFeeHookInstruction2["SetAuthority"] = 3] = "SetAuthority";
|
|
6265
|
-
return DynamicFeeHookInstruction2;
|
|
6266
|
-
})(DynamicFeeHookInstruction || {});
|
|
6267
|
-
function identifyDynamicFeeHookInstruction(instruction) {
|
|
6268
|
-
const data = "data" in instruction ? instruction.data : instruction;
|
|
6269
|
-
if (kit.containsBytes(
|
|
6270
|
-
data,
|
|
6271
|
-
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6272
|
-
new Uint8Array([17, 34, 183, 119, 202, 255, 218, 233])
|
|
6273
|
-
),
|
|
6274
|
-
0
|
|
6275
|
-
)) {
|
|
6276
|
-
return 0 /* AddCosigner */;
|
|
6277
|
-
}
|
|
6278
|
-
if (kit.containsBytes(
|
|
6279
|
-
data,
|
|
6280
|
-
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6281
|
-
new Uint8Array([208, 127, 21, 1, 194, 190, 196, 70])
|
|
6282
|
-
),
|
|
6283
|
-
0
|
|
6284
|
-
)) {
|
|
6285
|
-
return 1 /* InitializeConfig */;
|
|
6286
|
-
}
|
|
6287
|
-
if (kit.containsBytes(
|
|
6288
|
-
data,
|
|
6289
|
-
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6290
|
-
new Uint8Array([174, 11, 171, 252, 179, 99, 220, 27])
|
|
6291
|
-
),
|
|
6292
|
-
0
|
|
6293
|
-
)) {
|
|
6294
|
-
return 2 /* RemoveCosigner */;
|
|
6295
|
-
}
|
|
6296
|
-
if (kit.containsBytes(
|
|
6297
|
-
data,
|
|
6298
|
-
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6299
|
-
new Uint8Array([133, 250, 37, 21, 110, 163, 26, 121])
|
|
6300
|
-
),
|
|
6301
|
-
0
|
|
6302
|
-
)) {
|
|
6303
|
-
return 3 /* SetAuthority */;
|
|
6304
|
-
}
|
|
6305
|
-
throw new kit.SolanaError(
|
|
6306
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
|
|
6307
|
-
{ instructionData: data, programName: "dynamicFeeHook" }
|
|
6308
|
-
);
|
|
6309
|
-
}
|
|
6310
|
-
function parseDynamicFeeHookInstruction(instruction) {
|
|
6311
|
-
const instructionType = identifyDynamicFeeHookInstruction(instruction);
|
|
6312
|
-
switch (instructionType) {
|
|
6313
|
-
case 0 /* AddCosigner */: {
|
|
6314
|
-
kit.assertIsInstructionWithAccounts(instruction);
|
|
6315
|
-
return {
|
|
6316
|
-
instructionType: 0 /* AddCosigner */,
|
|
6317
|
-
...parseAddCosignerInstruction2(instruction)
|
|
6318
|
-
};
|
|
6319
|
-
}
|
|
6320
|
-
case 1 /* InitializeConfig */: {
|
|
6321
|
-
kit.assertIsInstructionWithAccounts(instruction);
|
|
6322
|
-
return {
|
|
6323
|
-
instructionType: 1 /* InitializeConfig */,
|
|
6324
|
-
...parseInitializeConfigInstruction4(instruction)
|
|
6325
|
-
};
|
|
6326
|
-
}
|
|
6327
|
-
case 2 /* RemoveCosigner */: {
|
|
6328
|
-
kit.assertIsInstructionWithAccounts(instruction);
|
|
6329
|
-
return {
|
|
6330
|
-
instructionType: 2 /* RemoveCosigner */,
|
|
6331
|
-
...parseRemoveCosignerInstruction2(instruction)
|
|
6332
|
-
};
|
|
6333
|
-
}
|
|
6334
|
-
case 3 /* SetAuthority */: {
|
|
6335
|
-
kit.assertIsInstructionWithAccounts(instruction);
|
|
6336
|
-
return {
|
|
6337
|
-
instructionType: 3 /* SetAuthority */,
|
|
6338
|
-
...parseSetAuthorityInstruction2(instruction)
|
|
6339
|
-
};
|
|
6340
|
-
}
|
|
6341
|
-
default:
|
|
6342
|
-
throw new kit.SolanaError(
|
|
6343
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
|
|
6344
|
-
{
|
|
6345
|
-
instructionType,
|
|
6346
|
-
programName: "dynamicFeeHook"
|
|
6347
|
-
}
|
|
6348
|
-
);
|
|
6349
|
-
}
|
|
6350
|
-
}
|
|
6351
|
-
function dynamicFeeHookProgram() {
|
|
6352
|
-
return (client) => {
|
|
6353
|
-
return {
|
|
6354
|
-
...client,
|
|
6355
|
-
dynamicFeeHook: {
|
|
6356
|
-
accounts: {
|
|
6357
|
-
cosignerConfig: programClientCore.addSelfFetchFunctions(
|
|
6358
|
-
client,
|
|
6359
|
-
getCosignerConfigCodec2()
|
|
6360
|
-
)
|
|
6361
|
-
},
|
|
6362
|
-
instructions: {
|
|
6363
|
-
addCosigner: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
6364
|
-
client,
|
|
6365
|
-
getAddCosignerInstructionAsync2(input)
|
|
6366
|
-
),
|
|
6367
|
-
initializeConfig: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
6368
|
-
client,
|
|
6369
|
-
getInitializeConfigInstructionAsync4({
|
|
6370
|
-
...input,
|
|
6371
|
-
payer: input.payer ?? client.payer
|
|
6372
|
-
})
|
|
6373
|
-
),
|
|
6374
|
-
removeCosigner: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
6375
|
-
client,
|
|
6376
|
-
getRemoveCosignerInstructionAsync2(input)
|
|
6377
|
-
),
|
|
6378
|
-
setAuthority: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
6379
|
-
client,
|
|
6380
|
-
getSetAuthorityInstructionAsync2(input)
|
|
6381
|
-
)
|
|
6382
|
-
}
|
|
6383
|
-
}
|
|
6384
|
-
};
|
|
6385
|
-
};
|
|
6386
|
-
}
|
|
6387
|
-
|
|
6388
|
-
// src/solana/generated/dynamicFeeHook/errors/dynamicFeeHook.ts
|
|
6389
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_INSTRUCTION_DATA = 6e3;
|
|
6390
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_SCHEDULE_DATA = 6001;
|
|
6391
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_FEE = 6002;
|
|
6392
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_DURATION = 6003;
|
|
6393
|
-
var DYNAMIC_FEE_HOOK_ERROR__ARITHMETIC_OVERFLOW = 6004;
|
|
6394
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_AUTHORITY = 6005;
|
|
6395
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_CONFIG = 6006;
|
|
6396
|
-
var DYNAMIC_FEE_HOOK_ERROR__INVALID_COSIGNER = 6007;
|
|
6397
|
-
var DYNAMIC_FEE_HOOK_ERROR__COSIGNER_ALREADY_EXISTS = 6008;
|
|
6398
|
-
var DYNAMIC_FEE_HOOK_ERROR__COSIGNER_NOT_FOUND = 6009;
|
|
6399
|
-
var DYNAMIC_FEE_HOOK_ERROR__COSIGNER_LIST_FULL = 6010;
|
|
6400
|
-
var dynamicFeeHookErrorMessages;
|
|
6401
|
-
if (process.env.NODE_ENV !== "production") {
|
|
6402
|
-
dynamicFeeHookErrorMessages = {
|
|
6403
|
-
[DYNAMIC_FEE_HOOK_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
|
|
6404
|
-
[DYNAMIC_FEE_HOOK_ERROR__COSIGNER_ALREADY_EXISTS]: `Cosigner already exists`,
|
|
6405
|
-
[DYNAMIC_FEE_HOOK_ERROR__COSIGNER_LIST_FULL]: `Cosigner list is full`,
|
|
6406
|
-
[DYNAMIC_FEE_HOOK_ERROR__COSIGNER_NOT_FOUND]: `Cosigner not found`,
|
|
6407
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_AUTHORITY]: `Invalid hook authority`,
|
|
6408
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_CONFIG]: `Invalid cosigner hook config`,
|
|
6409
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_COSIGNER]: `Invalid cosigner key`,
|
|
6410
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_DURATION]: `Invalid fee duration`,
|
|
6411
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_FEE]: `Invalid fee`,
|
|
6412
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_INSTRUCTION_DATA]: `Invalid instruction data`,
|
|
6413
|
-
[DYNAMIC_FEE_HOOK_ERROR__INVALID_SCHEDULE_DATA]: `Invalid schedule payload`
|
|
6414
|
-
};
|
|
6415
|
-
}
|
|
6416
|
-
function getDynamicFeeHookErrorMessage(code) {
|
|
6417
|
-
if (process.env.NODE_ENV !== "production") {
|
|
6418
|
-
return dynamicFeeHookErrorMessages[code];
|
|
6419
|
-
}
|
|
6420
|
-
return "Error message not available in production bundles.";
|
|
6421
|
-
}
|
|
6422
|
-
function isDynamicFeeHookError(error, transactionMessage, code) {
|
|
6423
|
-
return kit.isProgramError(
|
|
6424
|
-
error,
|
|
6425
|
-
transactionMessage,
|
|
6426
|
-
DYNAMIC_FEE_HOOK_PROGRAM_ADDRESS,
|
|
6427
|
-
code
|
|
6428
|
-
);
|
|
6429
|
-
}
|
|
6430
|
-
function getCosignerArgEncoder2() {
|
|
6431
|
-
return kit.getStructEncoder([["cosigner", kit.getAddressEncoder()]]);
|
|
6432
|
-
}
|
|
6433
|
-
function getCosignerArgDecoder2() {
|
|
6434
|
-
return kit.getStructDecoder([["cosigner", kit.getAddressDecoder()]]);
|
|
6435
|
-
}
|
|
6436
|
-
function getCosignerArgCodec2() {
|
|
6437
|
-
return kit.combineCodec(getCosignerArgEncoder2(), getCosignerArgDecoder2());
|
|
6438
|
-
}
|
|
6439
|
-
function getInitializeConfigArgsEncoder3() {
|
|
6440
|
-
return kit.getStructEncoder([
|
|
6441
|
-
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
6442
|
-
]);
|
|
6443
|
-
}
|
|
6444
|
-
function getInitializeConfigArgsDecoder3() {
|
|
6445
|
-
return kit.getStructDecoder([
|
|
6446
|
-
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
6447
|
-
]);
|
|
6448
|
-
}
|
|
6449
|
-
function getInitializeConfigArgsCodec3() {
|
|
6450
|
-
return kit.combineCodec(
|
|
6451
|
-
getInitializeConfigArgsEncoder3(),
|
|
6452
|
-
getInitializeConfigArgsDecoder3()
|
|
6453
|
-
);
|
|
6454
|
-
}
|
|
6455
|
-
function getSetAuthorityArgsEncoder2() {
|
|
6456
|
-
return kit.getStructEncoder([["adminAuthority", kit.getAddressEncoder()]]);
|
|
6457
|
-
}
|
|
6458
|
-
function getSetAuthorityArgsDecoder2() {
|
|
6459
|
-
return kit.getStructDecoder([["adminAuthority", kit.getAddressDecoder()]]);
|
|
6460
|
-
}
|
|
6461
|
-
function getSetAuthorityArgsCodec2() {
|
|
6462
|
-
return kit.combineCodec(
|
|
6463
|
-
getSetAuthorityArgsEncoder2(),
|
|
6464
|
-
getSetAuthorityArgsDecoder2()
|
|
6465
|
-
);
|
|
6466
|
-
}
|
|
6467
|
-
var DEVNET_DYNAMIC_FEE_HOOK_PROGRAM_ID = kit.address(
|
|
6468
|
-
"HVsPNZh98TgChUXHwKrUG47SUqvGQHxUy5wZwcQLFD4i"
|
|
6469
|
-
);
|
|
6470
|
-
var DYNAMIC_FEE_HOOK_PROGRAM_ID = DEVNET_DYNAMIC_FEE_HOOK_PROGRAM_ID;
|
|
6471
|
-
var SEED_DYNAMIC_FEE_HOOK_CONFIG = "cosigner_hook_config";
|
|
6472
|
-
var MAX_COSIGNERS2 = 32;
|
|
6473
|
-
var DYNAMIC_FEE_SCHEDULE_MAGIC = new Uint8Array([
|
|
6474
|
-
68,
|
|
6475
|
-
70,
|
|
6476
|
-
69,
|
|
6477
|
-
69,
|
|
6478
|
-
86,
|
|
6479
|
-
49,
|
|
6480
|
-
95,
|
|
6481
|
-
95
|
|
6482
|
-
]);
|
|
6483
|
-
var DYNAMIC_FEE_SCHEDULE_VERSION = 1;
|
|
6484
|
-
var DYNAMIC_FEE_SCHEDULE_LEN = 32;
|
|
6485
|
-
var DYNAMIC_FEE_SCHEDULE_HEADER_LEN = 16;
|
|
6486
|
-
var DYNAMIC_FEE_SCHEDULE_MAX_BPS = 1e4;
|
|
6487
|
-
|
|
6488
|
-
// src/solana/dynamicFeeHook/payload.ts
|
|
6489
|
-
var MAX_I64 = (1n << 63n) - 1n;
|
|
6490
|
-
var MAX_U32 = (1n << 32n) - 1n;
|
|
6491
|
-
function toBigInt2(value) {
|
|
6492
|
-
return typeof value === "bigint" ? value : BigInt(value);
|
|
6493
|
-
}
|
|
6494
|
-
function assertU16Bps(label, value) {
|
|
6495
|
-
if (!Number.isInteger(value) || value < 0 || value > DYNAMIC_FEE_SCHEDULE_MAX_BPS) {
|
|
6496
|
-
throw new Error(`${label} must be an integer between 0 and 10000`);
|
|
6497
|
-
}
|
|
6498
|
-
}
|
|
6499
|
-
function writeI64Le(bytes, offset, value) {
|
|
6500
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
6501
|
-
view.setBigInt64(offset, value, true);
|
|
6502
|
-
}
|
|
6503
|
-
function writeU16Le(bytes, offset, value) {
|
|
6504
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
6505
|
-
view.setUint16(offset, value, true);
|
|
6506
|
-
}
|
|
6507
|
-
function writeU32Le(bytes, offset, value) {
|
|
6508
|
-
const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
|
6509
|
-
view.setUint32(offset, Number(value), true);
|
|
6510
|
-
}
|
|
6511
|
-
function validateDynamicFeeScheduleArgs(schedule) {
|
|
6512
|
-
const startingTime = toBigInt2(schedule.startingTime);
|
|
6513
|
-
if (startingTime < 0n || startingTime > MAX_I64) {
|
|
6514
|
-
throw new Error("startingTime must be between 0 and i64::MAX");
|
|
6515
|
-
}
|
|
6516
|
-
assertU16Bps("startFeeBps", schedule.startFeeBps);
|
|
6517
|
-
assertU16Bps("endFeeBps", schedule.endFeeBps);
|
|
6518
|
-
if (schedule.endFeeBps > schedule.startFeeBps) {
|
|
6519
|
-
throw new Error("endFeeBps must be less than or equal to startFeeBps");
|
|
6520
|
-
}
|
|
6521
|
-
const durationSeconds = toBigInt2(schedule.durationSeconds);
|
|
6522
|
-
if (durationSeconds < 0n || durationSeconds > MAX_U32) {
|
|
6523
|
-
throw new Error("durationSeconds must be between 0 and u32::MAX");
|
|
6524
|
-
}
|
|
6525
|
-
if (schedule.startFeeBps > schedule.endFeeBps && durationSeconds === 0n) {
|
|
6526
|
-
throw new Error("durationSeconds must be nonzero for decaying schedules");
|
|
6527
|
-
}
|
|
6528
|
-
return { startingTime, durationSeconds };
|
|
6529
|
-
}
|
|
6530
|
-
function encodeDynamicFeeSchedule(schedule) {
|
|
6531
|
-
const { startingTime, durationSeconds } = validateDynamicFeeScheduleArgs(schedule);
|
|
6532
|
-
const payload = new Uint8Array(DYNAMIC_FEE_SCHEDULE_LEN);
|
|
6533
|
-
payload.set(DYNAMIC_FEE_SCHEDULE_MAGIC, 0);
|
|
6534
|
-
payload[8] = DYNAMIC_FEE_SCHEDULE_VERSION;
|
|
6535
|
-
writeI64Le(payload, DYNAMIC_FEE_SCHEDULE_HEADER_LEN, startingTime);
|
|
6536
|
-
writeU16Le(payload, 24, schedule.startFeeBps);
|
|
6537
|
-
writeU16Le(payload, 26, schedule.endFeeBps);
|
|
6538
|
-
writeU32Le(payload, 28, durationSeconds);
|
|
6539
|
-
return payload;
|
|
6540
|
-
}
|
|
6541
|
-
function encodeDynamicFeeHookPayload(args = {}) {
|
|
6542
|
-
const schedulePayload = args.schedule ? encodeDynamicFeeSchedule(args.schedule) : new Uint8Array();
|
|
6543
|
-
const gatePayload = args.gateExpiry ? encodeCosignerGateExpiryPayload(args.gateExpiry) : new Uint8Array();
|
|
6544
|
-
const payload = new Uint8Array(schedulePayload.length + gatePayload.length);
|
|
6545
|
-
payload.set(schedulePayload, 0);
|
|
6546
|
-
payload.set(gatePayload, schedulePayload.length);
|
|
6547
|
-
return payload;
|
|
6548
|
-
}
|
|
6549
|
-
function encodeDynamicFeeCosignerGatePayload(args) {
|
|
6550
|
-
return encodeCosignerGateExpiryPayload(args);
|
|
6551
|
-
}
|
|
6552
|
-
function getDynamicFeeHookRemainingAccounts({
|
|
6553
|
-
namespace,
|
|
6554
|
-
config,
|
|
6555
|
-
cosigner
|
|
6556
|
-
}) {
|
|
6557
|
-
const signedHookRemainingAccounts = [namespace];
|
|
6558
|
-
if (config && config !== namespace) {
|
|
6559
|
-
signedHookRemainingAccounts.push(config);
|
|
6560
|
-
}
|
|
6561
|
-
if (cosigner) {
|
|
6562
|
-
signedHookRemainingAccounts.push(cosigner);
|
|
6563
|
-
}
|
|
6564
|
-
const unsignedHookRemainingAccounts = signedHookRemainingAccounts.map(
|
|
6565
|
-
chunk4WY5GNZD_cjs.getAddressFromRemainingAccount
|
|
6566
|
-
);
|
|
6567
|
-
return {
|
|
6568
|
-
signedHookRemainingAccounts,
|
|
6569
|
-
unsignedHookRemainingAccounts,
|
|
6570
|
-
hookRemainingAccountsHash: computeRemainingAccountsHash(
|
|
6571
|
-
unsignedHookRemainingAccounts
|
|
6572
|
-
)
|
|
6573
|
-
};
|
|
6574
|
-
}
|
|
6575
|
-
function getDynamicFeeHookRemainingAccountAddresses({
|
|
6576
|
-
namespace,
|
|
6577
|
-
config,
|
|
6578
|
-
cosigner
|
|
6579
|
-
}) {
|
|
6580
|
-
return getDynamicFeeHookRemainingAccounts({
|
|
6581
|
-
namespace,
|
|
6582
|
-
config,
|
|
6583
|
-
cosigner
|
|
6584
|
-
}).unsignedHookRemainingAccounts;
|
|
6585
|
-
}
|
|
6586
|
-
function isDynamicFeeSchedulePayload(payload) {
|
|
6587
|
-
return payload.length >= DYNAMIC_FEE_SCHEDULE_LEN && DYNAMIC_FEE_SCHEDULE_MAGIC.every((byte, index) => payload[index] === byte);
|
|
6588
|
-
}
|
|
6589
|
-
var textEncoder6 = new TextEncoder();
|
|
6590
|
-
async function getDynamicFeeHookConfigAddress(programId = DYNAMIC_FEE_HOOK_PROGRAM_ID) {
|
|
6591
|
-
return kit.getProgramDerivedAddress({
|
|
6592
|
-
programAddress: programId,
|
|
6593
|
-
seeds: [textEncoder6.encode(SEED_DYNAMIC_FEE_HOOK_CONFIG)]
|
|
6594
|
-
});
|
|
6595
|
-
}
|
|
6596
|
-
|
|
6597
|
-
// src/solana/migrators/cpmmMigrator/index.ts
|
|
6598
|
-
var cpmmMigrator_exports = {};
|
|
6599
|
-
chunkQ7SFCCGT_cjs.__export(cpmmMigrator_exports, {
|
|
6600
|
-
CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: () => CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS,
|
|
6601
|
-
CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: () => CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS,
|
|
6602
|
-
CPMM_MIGRATOR_PROGRAM_ID: () => CPMM_MIGRATOR_PROGRAM_ID,
|
|
6603
|
-
MAX_RECIPIENTS: () => MAX_RECIPIENTS,
|
|
6604
|
-
SEED_MIGRATION_AUTHORITY: () => SEED_MIGRATION_AUTHORITY,
|
|
6605
|
-
SEED_STATE: () => SEED_STATE,
|
|
6606
|
-
buildCpmmMigrationRemainingAccounts: () => buildCpmmMigrationRemainingAccounts,
|
|
6607
|
-
buildCpmmMigrationRemainingAccountsHash: () => buildCpmmMigrationRemainingAccountsHash,
|
|
6608
|
-
encodeMigratePayload: () => encodeMigratePayload,
|
|
6609
|
-
encodeRegisterLaunchPayload: () => encodeRegisterLaunchPayload,
|
|
6610
|
-
fetchCpmmMigratorState: () => fetchCpmmMigratorState,
|
|
6611
|
-
getCpmmMigrationAuthorityAddress: () => getCpmmMigrationAuthorityAddress,
|
|
6612
|
-
getCpmmMigratorStateAddress: () => getCpmmMigratorStateAddress,
|
|
6613
|
-
getCpmmMigratorStateCodec: () => getCpmmMigratorStateCodec,
|
|
6614
|
-
getCpmmMigratorStateDecoder: () => getCpmmMigratorStateDecoder,
|
|
6615
|
-
getCpmmMigratorStateEncoder: () => getCpmmMigratorStateEncoder,
|
|
6616
|
-
getMigrateArgsCodec: () => getMigrateArgsCodec,
|
|
6617
|
-
getMigrateArgsDecoder: () => getMigrateArgsDecoder,
|
|
6618
|
-
getMigrateArgsEncoder: () => getMigrateArgsEncoder,
|
|
6619
|
-
getRecipientCodec: () => getRecipientCodec,
|
|
6620
|
-
getRecipientDecoder: () => getRecipientDecoder,
|
|
6621
|
-
getRecipientEncoder: () => getRecipientEncoder,
|
|
6622
|
-
getRegisterLaunchArgsCodec: () => getRegisterLaunchArgsCodec,
|
|
6623
|
-
getRegisterLaunchArgsDecoder: () => getRegisterLaunchArgsDecoder,
|
|
6624
|
-
getRegisterLaunchArgsEncoder: () => getRegisterLaunchArgsEncoder
|
|
6625
|
-
});
|
|
6626
|
-
function getMigrateArgsEncoder() {
|
|
6627
|
-
return kit.getStructEncoder([
|
|
6628
|
-
["baseForDistribution", kit.getU64Encoder()],
|
|
6629
|
-
["baseForLiquidity", kit.getU64Encoder()]
|
|
6630
|
-
]);
|
|
6631
|
-
}
|
|
6632
|
-
function getMigrateArgsDecoder() {
|
|
6633
|
-
return kit.getStructDecoder([
|
|
6634
|
-
["baseForDistribution", kit.getU64Decoder()],
|
|
6635
|
-
["baseForLiquidity", kit.getU64Decoder()]
|
|
6636
|
-
]);
|
|
6637
|
-
}
|
|
6638
|
-
function getMigrateArgsCodec() {
|
|
6639
|
-
return kit.combineCodec(getMigrateArgsEncoder(), getMigrateArgsDecoder());
|
|
6640
|
-
}
|
|
6641
|
-
function getMigratedPoolHookConfigEncoder() {
|
|
6642
|
-
return kit.getStructEncoder([
|
|
6643
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
6644
|
-
["hookFlags", kit.getU32Encoder()]
|
|
6645
|
-
]);
|
|
6646
|
-
}
|
|
6647
|
-
function getMigratedPoolHookConfigDecoder() {
|
|
6648
|
-
return kit.getStructDecoder([
|
|
6649
|
-
["hookProgram", kit.getAddressDecoder()],
|
|
6650
|
-
["hookFlags", kit.getU32Decoder()]
|
|
6651
|
-
]);
|
|
6652
|
-
}
|
|
6653
|
-
function getRecipientEncoder() {
|
|
6654
|
-
return kit.getStructEncoder([
|
|
6655
|
-
["wallet", kit.getAddressEncoder()],
|
|
6656
|
-
["amount", kit.getU64Encoder()]
|
|
6657
|
-
]);
|
|
5780
|
+
function getRecipientEncoder() {
|
|
5781
|
+
return kit.getStructEncoder([
|
|
5782
|
+
["wallet", kit.getAddressEncoder()],
|
|
5783
|
+
["amount", kit.getU64Encoder()]
|
|
5784
|
+
]);
|
|
6658
5785
|
}
|
|
6659
5786
|
function getRecipientDecoder() {
|
|
6660
5787
|
return kit.getStructDecoder([
|
|
@@ -6758,14 +5885,409 @@ function getCpmmMigratorStateCodec() {
|
|
|
6758
5885
|
getCpmmMigratorStateDecoder()
|
|
6759
5886
|
);
|
|
6760
5887
|
}
|
|
5888
|
+
var CREATE_SPOT_POOL_DISCRIMINATOR = new Uint8Array([
|
|
5889
|
+
13,
|
|
5890
|
+
137,
|
|
5891
|
+
16,
|
|
5892
|
+
26,
|
|
5893
|
+
40,
|
|
5894
|
+
36,
|
|
5895
|
+
110,
|
|
5896
|
+
26
|
|
5897
|
+
]);
|
|
5898
|
+
function getCreateSpotPoolInstructionDataEncoder() {
|
|
5899
|
+
return kit.transformEncoder(
|
|
5900
|
+
kit.getStructEncoder([
|
|
5901
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5902
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
5903
|
+
["positionId", kit.getU64Encoder()],
|
|
5904
|
+
["amount0Max", kit.getU64Encoder()],
|
|
5905
|
+
["amount1Max", kit.getU64Encoder()],
|
|
5906
|
+
["minSharesOut", kit.getU128Encoder()]
|
|
5907
|
+
]),
|
|
5908
|
+
(value) => ({ ...value, discriminator: CREATE_SPOT_POOL_DISCRIMINATOR })
|
|
5909
|
+
);
|
|
5910
|
+
}
|
|
5911
|
+
function getCreateSpotPoolInstructionDataDecoder() {
|
|
5912
|
+
return kit.getStructDecoder([
|
|
5913
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
5914
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
5915
|
+
["positionId", kit.getU64Decoder()],
|
|
5916
|
+
["amount0Max", kit.getU64Decoder()],
|
|
5917
|
+
["amount1Max", kit.getU64Decoder()],
|
|
5918
|
+
["minSharesOut", kit.getU128Decoder()]
|
|
5919
|
+
]);
|
|
5920
|
+
}
|
|
5921
|
+
function getCreateSpotPoolInstructionDataCodec() {
|
|
5922
|
+
return kit.combineCodec(
|
|
5923
|
+
getCreateSpotPoolInstructionDataEncoder(),
|
|
5924
|
+
getCreateSpotPoolInstructionDataDecoder()
|
|
5925
|
+
);
|
|
5926
|
+
}
|
|
5927
|
+
async function getCreateSpotPoolInstructionAsync(input, config) {
|
|
5928
|
+
const programAddress = config?.programAddress ?? CPMM_MIGRATOR_PROGRAM_ADDRESS;
|
|
5929
|
+
const originalAccounts = {
|
|
5930
|
+
cpmmConfig: { value: input.cpmmConfig ?? null, isWritable: false },
|
|
5931
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
5932
|
+
liquidityOwner: { value: input.liquidityOwner ?? null, isWritable: false },
|
|
5933
|
+
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
5934
|
+
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
5935
|
+
pool: { value: input.pool ?? null, isWritable: true },
|
|
5936
|
+
poolAuthority: { value: input.poolAuthority ?? null, isWritable: false },
|
|
5937
|
+
poolVault0: { value: input.poolVault0 ?? null, isWritable: true },
|
|
5938
|
+
poolVault1: { value: input.poolVault1 ?? null, isWritable: true },
|
|
5939
|
+
protocolFeeOwner: {
|
|
5940
|
+
value: input.protocolFeeOwner ?? null,
|
|
5941
|
+
isWritable: false
|
|
5942
|
+
},
|
|
5943
|
+
protocolFeePosition: {
|
|
5944
|
+
value: input.protocolFeePosition ?? null,
|
|
5945
|
+
isWritable: true
|
|
5946
|
+
},
|
|
5947
|
+
position: { value: input.position ?? null, isWritable: true },
|
|
5948
|
+
user0: { value: input.user0 ?? null, isWritable: true },
|
|
5949
|
+
user1: { value: input.user1 ?? null, isWritable: true },
|
|
5950
|
+
cpmmProgram: { value: input.cpmmProgram ?? null, isWritable: false },
|
|
5951
|
+
migrationAuthority: {
|
|
5952
|
+
value: input.migrationAuthority ?? null,
|
|
5953
|
+
isWritable: false
|
|
5954
|
+
},
|
|
5955
|
+
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
5956
|
+
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
5957
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
5958
|
+
rent: { value: input.rent ?? null, isWritable: false }
|
|
5959
|
+
};
|
|
5960
|
+
const accounts = originalAccounts;
|
|
5961
|
+
const args = { ...input };
|
|
5962
|
+
if (!accounts.cpmmProgram.value) {
|
|
5963
|
+
accounts.cpmmProgram.value = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
|
|
5964
|
+
}
|
|
5965
|
+
if (!accounts.migrationAuthority.value) {
|
|
5966
|
+
accounts.migrationAuthority.value = await kit.getProgramDerivedAddress({
|
|
5967
|
+
programAddress,
|
|
5968
|
+
seeds: [
|
|
5969
|
+
kit.getBytesEncoder().encode(
|
|
5970
|
+
new Uint8Array([
|
|
5971
|
+
109,
|
|
5972
|
+
105,
|
|
5973
|
+
103,
|
|
5974
|
+
114,
|
|
5975
|
+
97,
|
|
5976
|
+
116,
|
|
5977
|
+
105,
|
|
5978
|
+
111,
|
|
5979
|
+
110,
|
|
5980
|
+
95,
|
|
5981
|
+
97,
|
|
5982
|
+
117,
|
|
5983
|
+
116,
|
|
5984
|
+
104,
|
|
5985
|
+
111,
|
|
5986
|
+
114,
|
|
5987
|
+
105,
|
|
5988
|
+
116,
|
|
5989
|
+
121
|
|
5990
|
+
])
|
|
5991
|
+
)
|
|
5992
|
+
]
|
|
5993
|
+
});
|
|
5994
|
+
}
|
|
5995
|
+
if (!accounts.systemProgram.value) {
|
|
5996
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
5997
|
+
}
|
|
5998
|
+
if (!accounts.rent.value) {
|
|
5999
|
+
accounts.rent.value = "SysvarRent111111111111111111111111111111111";
|
|
6000
|
+
}
|
|
6001
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6002
|
+
return Object.freeze({
|
|
6003
|
+
accounts: [
|
|
6004
|
+
getAccountMeta("cpmmConfig", accounts.cpmmConfig),
|
|
6005
|
+
getAccountMeta("payer", accounts.payer),
|
|
6006
|
+
getAccountMeta("liquidityOwner", accounts.liquidityOwner),
|
|
6007
|
+
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
6008
|
+
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
6009
|
+
getAccountMeta("pool", accounts.pool),
|
|
6010
|
+
getAccountMeta("poolAuthority", accounts.poolAuthority),
|
|
6011
|
+
getAccountMeta("poolVault0", accounts.poolVault0),
|
|
6012
|
+
getAccountMeta("poolVault1", accounts.poolVault1),
|
|
6013
|
+
getAccountMeta("protocolFeeOwner", accounts.protocolFeeOwner),
|
|
6014
|
+
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
6015
|
+
getAccountMeta("position", accounts.position),
|
|
6016
|
+
getAccountMeta("user0", accounts.user0),
|
|
6017
|
+
getAccountMeta("user1", accounts.user1),
|
|
6018
|
+
getAccountMeta("cpmmProgram", accounts.cpmmProgram),
|
|
6019
|
+
getAccountMeta("migrationAuthority", accounts.migrationAuthority),
|
|
6020
|
+
getAccountMeta("token0Program", accounts.token0Program),
|
|
6021
|
+
getAccountMeta("token1Program", accounts.token1Program),
|
|
6022
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
6023
|
+
getAccountMeta("rent", accounts.rent)
|
|
6024
|
+
],
|
|
6025
|
+
data: getCreateSpotPoolInstructionDataEncoder().encode(
|
|
6026
|
+
args
|
|
6027
|
+
),
|
|
6028
|
+
programAddress
|
|
6029
|
+
});
|
|
6030
|
+
}
|
|
6031
|
+
function getCreateSpotPoolInstruction(input, config) {
|
|
6032
|
+
const programAddress = config?.programAddress ?? CPMM_MIGRATOR_PROGRAM_ADDRESS;
|
|
6033
|
+
const originalAccounts = {
|
|
6034
|
+
cpmmConfig: { value: input.cpmmConfig ?? null, isWritable: false },
|
|
6035
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
6036
|
+
liquidityOwner: { value: input.liquidityOwner ?? null, isWritable: false },
|
|
6037
|
+
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
6038
|
+
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
6039
|
+
pool: { value: input.pool ?? null, isWritable: true },
|
|
6040
|
+
poolAuthority: { value: input.poolAuthority ?? null, isWritable: false },
|
|
6041
|
+
poolVault0: { value: input.poolVault0 ?? null, isWritable: true },
|
|
6042
|
+
poolVault1: { value: input.poolVault1 ?? null, isWritable: true },
|
|
6043
|
+
protocolFeeOwner: {
|
|
6044
|
+
value: input.protocolFeeOwner ?? null,
|
|
6045
|
+
isWritable: false
|
|
6046
|
+
},
|
|
6047
|
+
protocolFeePosition: {
|
|
6048
|
+
value: input.protocolFeePosition ?? null,
|
|
6049
|
+
isWritable: true
|
|
6050
|
+
},
|
|
6051
|
+
position: { value: input.position ?? null, isWritable: true },
|
|
6052
|
+
user0: { value: input.user0 ?? null, isWritable: true },
|
|
6053
|
+
user1: { value: input.user1 ?? null, isWritable: true },
|
|
6054
|
+
cpmmProgram: { value: input.cpmmProgram ?? null, isWritable: false },
|
|
6055
|
+
migrationAuthority: {
|
|
6056
|
+
value: input.migrationAuthority ?? null,
|
|
6057
|
+
isWritable: false
|
|
6058
|
+
},
|
|
6059
|
+
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
6060
|
+
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
6061
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
6062
|
+
rent: { value: input.rent ?? null, isWritable: false }
|
|
6063
|
+
};
|
|
6064
|
+
const accounts = originalAccounts;
|
|
6065
|
+
const args = { ...input };
|
|
6066
|
+
if (!accounts.cpmmProgram.value) {
|
|
6067
|
+
accounts.cpmmProgram.value = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
|
|
6068
|
+
}
|
|
6069
|
+
if (!accounts.systemProgram.value) {
|
|
6070
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
6071
|
+
}
|
|
6072
|
+
if (!accounts.rent.value) {
|
|
6073
|
+
accounts.rent.value = "SysvarRent111111111111111111111111111111111";
|
|
6074
|
+
}
|
|
6075
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
6076
|
+
return Object.freeze({
|
|
6077
|
+
accounts: [
|
|
6078
|
+
getAccountMeta("cpmmConfig", accounts.cpmmConfig),
|
|
6079
|
+
getAccountMeta("payer", accounts.payer),
|
|
6080
|
+
getAccountMeta("liquidityOwner", accounts.liquidityOwner),
|
|
6081
|
+
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
6082
|
+
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
6083
|
+
getAccountMeta("pool", accounts.pool),
|
|
6084
|
+
getAccountMeta("poolAuthority", accounts.poolAuthority),
|
|
6085
|
+
getAccountMeta("poolVault0", accounts.poolVault0),
|
|
6086
|
+
getAccountMeta("poolVault1", accounts.poolVault1),
|
|
6087
|
+
getAccountMeta("protocolFeeOwner", accounts.protocolFeeOwner),
|
|
6088
|
+
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
6089
|
+
getAccountMeta("position", accounts.position),
|
|
6090
|
+
getAccountMeta("user0", accounts.user0),
|
|
6091
|
+
getAccountMeta("user1", accounts.user1),
|
|
6092
|
+
getAccountMeta("cpmmProgram", accounts.cpmmProgram),
|
|
6093
|
+
getAccountMeta("migrationAuthority", accounts.migrationAuthority),
|
|
6094
|
+
getAccountMeta("token0Program", accounts.token0Program),
|
|
6095
|
+
getAccountMeta("token1Program", accounts.token1Program),
|
|
6096
|
+
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
6097
|
+
getAccountMeta("rent", accounts.rent)
|
|
6098
|
+
],
|
|
6099
|
+
data: getCreateSpotPoolInstructionDataEncoder().encode(
|
|
6100
|
+
args
|
|
6101
|
+
),
|
|
6102
|
+
programAddress
|
|
6103
|
+
});
|
|
6104
|
+
}
|
|
6105
|
+
|
|
6106
|
+
// src/solana/generated/cpmmMigrator/programs/cpmmMigrator.ts
|
|
6107
|
+
var CPMM_MIGRATOR_PROGRAM_ADDRESS = "7WMUTNC41eMCo6eGH5Sy2xbgE3AycvLbFPo95AU9CSUd";
|
|
6761
6108
|
if (process.env.NODE_ENV !== "production") ;
|
|
6109
|
+
var addressCodec5 = kit.getAddressCodec();
|
|
6110
|
+
var textEncoder6 = new TextEncoder();
|
|
6111
|
+
var U64_MAX = (1n << 64n) - 1n;
|
|
6112
|
+
var PROTOCOL_FEE_POSITION_ID = 0n;
|
|
6113
|
+
async function pda(programAddress, seeds) {
|
|
6114
|
+
const [derived] = await kit.getProgramDerivedAddress({
|
|
6115
|
+
programAddress,
|
|
6116
|
+
seeds
|
|
6117
|
+
});
|
|
6118
|
+
return derived;
|
|
6119
|
+
}
|
|
6120
|
+
function seed(value) {
|
|
6121
|
+
return textEncoder6.encode(value);
|
|
6122
|
+
}
|
|
6123
|
+
function addressSeed(value) {
|
|
6124
|
+
return addressCodec5.encode(value);
|
|
6125
|
+
}
|
|
6126
|
+
function assertSafeInteger(name, value) {
|
|
6127
|
+
if (typeof value === "number" && !Number.isSafeInteger(value)) {
|
|
6128
|
+
throw new RangeError(
|
|
6129
|
+
`${name} must be a safe integer when provided as a number; use bigint for values above Number.MAX_SAFE_INTEGER`
|
|
6130
|
+
);
|
|
6131
|
+
}
|
|
6132
|
+
}
|
|
6133
|
+
function u64Seed(value) {
|
|
6134
|
+
assertSafeInteger("positionId", value);
|
|
6135
|
+
const bigintValue = BigInt(value);
|
|
6136
|
+
if (bigintValue < 0n || bigintValue > U64_MAX) {
|
|
6137
|
+
throw new RangeError("u64 position ID must be between 0 and 2^64 - 1");
|
|
6138
|
+
}
|
|
6139
|
+
const bytes = new Uint8Array(8);
|
|
6140
|
+
new DataView(bytes.buffer).setBigUint64(0, bigintValue, true);
|
|
6141
|
+
return bytes;
|
|
6142
|
+
}
|
|
6143
|
+
function addressOf(value) {
|
|
6144
|
+
return typeof value === "string" ? value : value.address;
|
|
6145
|
+
}
|
|
6146
|
+
function accountMeta(value, role) {
|
|
6147
|
+
if (typeof value === "string") {
|
|
6148
|
+
return { address: value, role };
|
|
6149
|
+
}
|
|
6150
|
+
return { address: value.address, role, signer: value };
|
|
6151
|
+
}
|
|
6152
|
+
async function deriveSpotPoolAccounts({
|
|
6153
|
+
tokenAMint,
|
|
6154
|
+
tokenBMint,
|
|
6155
|
+
swapFeeBps,
|
|
6156
|
+
liquidityOwner,
|
|
6157
|
+
tokenAProgram = token.TOKEN_PROGRAM_ADDRESS,
|
|
6158
|
+
tokenBProgram = token.TOKEN_PROGRAM_ADDRESS,
|
|
6159
|
+
tokenAAccount,
|
|
6160
|
+
tokenBAccount,
|
|
6161
|
+
token0Account,
|
|
6162
|
+
token1Account,
|
|
6163
|
+
positionId = 0n,
|
|
6164
|
+
cpmmProgram = chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID,
|
|
6165
|
+
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
6166
|
+
}) {
|
|
6167
|
+
const [token0Mint, token1Mint] = chunk4CI2M2F6_cjs.sortMints(tokenAMint, tokenBMint);
|
|
6168
|
+
const token0IsA = token0Mint === tokenAMint;
|
|
6169
|
+
const token0Program = token0IsA ? tokenAProgram : tokenBProgram;
|
|
6170
|
+
const token1Program = token0IsA ? tokenBProgram : tokenAProgram;
|
|
6171
|
+
const [userA] = await token.findAssociatedTokenPda({
|
|
6172
|
+
owner: liquidityOwner,
|
|
6173
|
+
mint: tokenAMint,
|
|
6174
|
+
tokenProgram: tokenAProgram
|
|
6175
|
+
});
|
|
6176
|
+
const [userB] = await token.findAssociatedTokenPda({
|
|
6177
|
+
owner: liquidityOwner,
|
|
6178
|
+
mint: tokenBMint,
|
|
6179
|
+
tokenProgram: tokenBProgram
|
|
6180
|
+
});
|
|
6181
|
+
const user0 = token0Account ?? (token0IsA ? tokenAAccount ?? userA : tokenBAccount ?? userB);
|
|
6182
|
+
const user1 = token1Account ?? (token0IsA ? tokenBAccount ?? userB : tokenAAccount ?? userA);
|
|
6183
|
+
const [pool] = await chunk4CI2M2F6_cjs.getSpotPoolAddress(
|
|
6184
|
+
token0Mint,
|
|
6185
|
+
token1Mint,
|
|
6186
|
+
swapFeeBps,
|
|
6187
|
+
cpmmProgram
|
|
6188
|
+
);
|
|
6189
|
+
const protocolFeeOwner = await pda(cpmmProgram, [
|
|
6190
|
+
seed(chunk4CI2M2F6_cjs.SEED_PROTOCOL_FEE_OWNER),
|
|
6191
|
+
addressSeed(pool)
|
|
6192
|
+
]);
|
|
6193
|
+
return {
|
|
6194
|
+
cpmmConfig: await pda(cpmmProgram, [seed(chunk4CI2M2F6_cjs.SEED_CONFIG)]),
|
|
6195
|
+
token0Mint,
|
|
6196
|
+
token1Mint,
|
|
6197
|
+
token0Program,
|
|
6198
|
+
token1Program,
|
|
6199
|
+
pool,
|
|
6200
|
+
poolAuthority: await pda(cpmmProgram, [
|
|
6201
|
+
seed(chunk4CI2M2F6_cjs.SEED_AUTHORITY),
|
|
6202
|
+
addressSeed(pool)
|
|
6203
|
+
]),
|
|
6204
|
+
poolVault0: await pda(cpmmProgram, [seed(chunk4CI2M2F6_cjs.SEED_VAULT0), addressSeed(pool)]),
|
|
6205
|
+
poolVault1: await pda(cpmmProgram, [seed(chunk4CI2M2F6_cjs.SEED_VAULT1), addressSeed(pool)]),
|
|
6206
|
+
protocolFeeOwner,
|
|
6207
|
+
protocolFeePosition: await pda(cpmmProgram, [
|
|
6208
|
+
seed(chunk4CI2M2F6_cjs.SEED_POSITION),
|
|
6209
|
+
addressSeed(pool),
|
|
6210
|
+
addressSeed(protocolFeeOwner),
|
|
6211
|
+
u64Seed(PROTOCOL_FEE_POSITION_ID)
|
|
6212
|
+
]),
|
|
6213
|
+
position: await pda(cpmmProgram, [
|
|
6214
|
+
seed(chunk4CI2M2F6_cjs.SEED_POSITION),
|
|
6215
|
+
addressSeed(pool),
|
|
6216
|
+
addressSeed(liquidityOwner),
|
|
6217
|
+
u64Seed(positionId)
|
|
6218
|
+
]),
|
|
6219
|
+
user0,
|
|
6220
|
+
user1,
|
|
6221
|
+
migrationAuthority: await pda(cpmmMigratorProgram, [
|
|
6222
|
+
seed(SEED_MIGRATION_AUTHORITY)
|
|
6223
|
+
])
|
|
6224
|
+
};
|
|
6225
|
+
}
|
|
6226
|
+
async function createSpotPoolInstruction(input) {
|
|
6227
|
+
const payer = input.payer;
|
|
6228
|
+
const liquidityOwner = input.liquidityOwner ?? payer;
|
|
6229
|
+
const positionId = input.positionId ?? 0n;
|
|
6230
|
+
const minSharesOut = input.minSharesOut ?? 1n;
|
|
6231
|
+
assertSafeInteger("positionId", positionId);
|
|
6232
|
+
assertSafeInteger("tokenAAmount", input.tokenAAmount);
|
|
6233
|
+
assertSafeInteger("tokenBAmount", input.tokenBAmount);
|
|
6234
|
+
assertSafeInteger("minSharesOut", minSharesOut);
|
|
6235
|
+
const cpmmProgram = input.cpmmProgram ?? chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID;
|
|
6236
|
+
const cpmmMigratorProgram = input.cpmmMigratorProgram ?? CPMM_MIGRATOR_PROGRAM_ID;
|
|
6237
|
+
const accounts = await deriveSpotPoolAccounts({
|
|
6238
|
+
...input,
|
|
6239
|
+
liquidityOwner: addressOf(liquidityOwner),
|
|
6240
|
+
cpmmProgram,
|
|
6241
|
+
cpmmMigratorProgram,
|
|
6242
|
+
positionId
|
|
6243
|
+
});
|
|
6244
|
+
const token0IsA = accounts.token0Mint === input.tokenAMint;
|
|
6245
|
+
return {
|
|
6246
|
+
programAddress: cpmmMigratorProgram,
|
|
6247
|
+
accounts: [
|
|
6248
|
+
{ address: accounts.cpmmConfig, role: kit.AccountRole.READONLY },
|
|
6249
|
+
accountMeta(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
6250
|
+
accountMeta(liquidityOwner, kit.AccountRole.READONLY_SIGNER),
|
|
6251
|
+
{ address: accounts.token0Mint, role: kit.AccountRole.READONLY },
|
|
6252
|
+
{ address: accounts.token1Mint, role: kit.AccountRole.READONLY },
|
|
6253
|
+
{ address: accounts.pool, role: kit.AccountRole.WRITABLE },
|
|
6254
|
+
{ address: accounts.poolAuthority, role: kit.AccountRole.READONLY },
|
|
6255
|
+
{ address: accounts.poolVault0, role: kit.AccountRole.WRITABLE },
|
|
6256
|
+
{ address: accounts.poolVault1, role: kit.AccountRole.WRITABLE },
|
|
6257
|
+
{ address: accounts.protocolFeeOwner, role: kit.AccountRole.READONLY },
|
|
6258
|
+
{ address: accounts.protocolFeePosition, role: kit.AccountRole.WRITABLE },
|
|
6259
|
+
{ address: accounts.position, role: kit.AccountRole.WRITABLE },
|
|
6260
|
+
{ address: accounts.user0, role: kit.AccountRole.WRITABLE },
|
|
6261
|
+
{ address: accounts.user1, role: kit.AccountRole.WRITABLE },
|
|
6262
|
+
{ address: cpmmProgram, role: kit.AccountRole.READONLY },
|
|
6263
|
+
{ address: accounts.migrationAuthority, role: kit.AccountRole.READONLY },
|
|
6264
|
+
{ address: accounts.token0Program, role: kit.AccountRole.READONLY },
|
|
6265
|
+
{ address: accounts.token1Program, role: kit.AccountRole.READONLY },
|
|
6266
|
+
{
|
|
6267
|
+
address: input.systemProgram ?? system.SYSTEM_PROGRAM_ADDRESS,
|
|
6268
|
+
role: kit.AccountRole.READONLY
|
|
6269
|
+
},
|
|
6270
|
+
{
|
|
6271
|
+
address: input.rent ?? sysvars.SYSVAR_RENT_ADDRESS,
|
|
6272
|
+
role: kit.AccountRole.READONLY
|
|
6273
|
+
}
|
|
6274
|
+
],
|
|
6275
|
+
data: getCreateSpotPoolInstructionDataEncoder().encode({
|
|
6276
|
+
swapFeeBps: input.swapFeeBps,
|
|
6277
|
+
positionId,
|
|
6278
|
+
amount0Max: token0IsA ? input.tokenAAmount : input.tokenBAmount,
|
|
6279
|
+
amount1Max: token0IsA ? input.tokenBAmount : input.tokenAAmount,
|
|
6280
|
+
minSharesOut
|
|
6281
|
+
})
|
|
6282
|
+
};
|
|
6283
|
+
}
|
|
6762
6284
|
|
|
6763
6285
|
// src/solana/migrators/cpmmMigrator/client.ts
|
|
6764
|
-
async function fetchCpmmMigratorState(rpc,
|
|
6765
|
-
const response = await rpc.getAccountInfo(
|
|
6286
|
+
async function fetchCpmmMigratorState(rpc, address6) {
|
|
6287
|
+
const response = await rpc.getAccountInfo(address6, { encoding: "base64" }).send();
|
|
6766
6288
|
if (!response.value) return null;
|
|
6767
6289
|
return getCpmmMigratorStateDecoder().decode(
|
|
6768
|
-
|
|
6290
|
+
chunk7PXLEMBJ_cjs.base64ToBytes(response.value.data[0])
|
|
6769
6291
|
);
|
|
6770
6292
|
}
|
|
6771
6293
|
async function buildCpmmMigrationRemainingAccounts({
|
|
@@ -6776,7 +6298,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
6776
6298
|
adminBaseAta,
|
|
6777
6299
|
adminQuoteAta,
|
|
6778
6300
|
recipientAtas,
|
|
6779
|
-
cpmmProgram =
|
|
6301
|
+
cpmmProgram = chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID,
|
|
6780
6302
|
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
6781
6303
|
}) {
|
|
6782
6304
|
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
@@ -6784,9 +6306,9 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
6784
6306
|
cpmmMigratorProgram
|
|
6785
6307
|
);
|
|
6786
6308
|
const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
|
|
6787
|
-
const poolInit = await
|
|
6309
|
+
const poolInit = await chunk4CI2M2F6_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
|
|
6788
6310
|
const pool = poolInit.pool[0];
|
|
6789
|
-
const [launchLpPosition] = await
|
|
6311
|
+
const [launchLpPosition] = await chunk4CI2M2F6_cjs.getPositionAddress(
|
|
6790
6312
|
pool,
|
|
6791
6313
|
launchAuthority,
|
|
6792
6314
|
0n,
|
|
@@ -6825,8 +6347,8 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
6825
6347
|
{ address: migrationAuthority, role: kit.AccountRole.READONLY },
|
|
6826
6348
|
{ address: adminBaseAta, role: kit.AccountRole.WRITABLE },
|
|
6827
6349
|
{ address: adminQuoteAta, role: kit.AccountRole.WRITABLE },
|
|
6828
|
-
...recipientAtas.map((
|
|
6829
|
-
address:
|
|
6350
|
+
...recipientAtas.map((address6) => ({
|
|
6351
|
+
address: address6,
|
|
6830
6352
|
role: kit.AccountRole.WRITABLE
|
|
6831
6353
|
}))
|
|
6832
6354
|
],
|
|
@@ -6850,8 +6372,24 @@ async function buildCpmmMigrationRemainingAccountsHash(input) {
|
|
|
6850
6372
|
}
|
|
6851
6373
|
|
|
6852
6374
|
// src/solana/migrators/cpmmMigrator/index.ts
|
|
6375
|
+
function encodeCreateSpotPoolPayload(args) {
|
|
6376
|
+
assertSafeInteger("positionId", args.positionId);
|
|
6377
|
+
assertSafeInteger("amount0Max", args.amount0Max);
|
|
6378
|
+
assertSafeInteger("amount1Max", args.amount1Max);
|
|
6379
|
+
assertSafeInteger("minSharesOut", args.minSharesOut);
|
|
6380
|
+
const encoded = new Uint8Array(getCreateSpotPoolArgsEncoder().encode(args));
|
|
6381
|
+
return kit.mergeBytes([
|
|
6382
|
+
CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.createSpotPool,
|
|
6383
|
+
encoded
|
|
6384
|
+
]);
|
|
6385
|
+
}
|
|
6853
6386
|
function encodeRegisterLaunchPayload(args) {
|
|
6854
|
-
const encoded = new Uint8Array(
|
|
6387
|
+
const encoded = new Uint8Array(
|
|
6388
|
+
getRegisterLaunchArgsEncoder().encode({
|
|
6389
|
+
...args,
|
|
6390
|
+
migratedPoolHookConfig: args.migratedPoolHookConfig ?? null
|
|
6391
|
+
})
|
|
6392
|
+
);
|
|
6855
6393
|
return kit.mergeBytes([
|
|
6856
6394
|
CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.registerLaunch,
|
|
6857
6395
|
encoded
|
|
@@ -6871,14 +6409,14 @@ var launchIdCounter = 0n;
|
|
|
6871
6409
|
var launchTokenPrograms = {
|
|
6872
6410
|
splToken() {
|
|
6873
6411
|
return {
|
|
6874
|
-
baseTokenProgram:
|
|
6875
|
-
quoteTokenProgram:
|
|
6412
|
+
baseTokenProgram: chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
6413
|
+
quoteTokenProgram: chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS
|
|
6876
6414
|
};
|
|
6877
6415
|
},
|
|
6878
6416
|
token2022Base() {
|
|
6879
6417
|
return {
|
|
6880
|
-
baseTokenProgram:
|
|
6881
|
-
quoteTokenProgram:
|
|
6418
|
+
baseTokenProgram: chunk4CI2M2F6_cjs.TOKEN_2022_PROGRAM_ADDRESS,
|
|
6419
|
+
quoteTokenProgram: chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS
|
|
6882
6420
|
};
|
|
6883
6421
|
}
|
|
6884
6422
|
};
|
|
@@ -6892,7 +6430,7 @@ function createLaunchId() {
|
|
|
6892
6430
|
return bytes;
|
|
6893
6431
|
}
|
|
6894
6432
|
function getSignerAddress(value) {
|
|
6895
|
-
return
|
|
6433
|
+
return chunk7PXLEMBJ_cjs.getAddressFromAddressOrSigner(value);
|
|
6896
6434
|
}
|
|
6897
6435
|
function hasMetadata(metadata) {
|
|
6898
6436
|
return Boolean(metadata?.metadataName);
|
|
@@ -6908,73 +6446,24 @@ function hashRemainingAccounts(accounts) {
|
|
|
6908
6446
|
return void 0;
|
|
6909
6447
|
}
|
|
6910
6448
|
return computeRemainingAccountsHash(
|
|
6911
|
-
accounts.map(
|
|
6449
|
+
accounts.map(chunk7PXLEMBJ_cjs.getAddressFromRemainingAccount)
|
|
6912
6450
|
);
|
|
6913
6451
|
}
|
|
6914
6452
|
function isCustomMigrationConfig(migration) {
|
|
6915
6453
|
return migration.kind === "custom";
|
|
6916
6454
|
}
|
|
6917
|
-
function getCreateLaunchHookMode(input) {
|
|
6918
|
-
if (input.hook !== void 0 && input.hook !== null) {
|
|
6919
|
-
return input.hook;
|
|
6920
|
-
}
|
|
6921
|
-
if (input.dynamicFee) {
|
|
6922
|
-
return "dynamicFee";
|
|
6923
|
-
}
|
|
6924
|
-
return input.cosigner ? "cosigner" : "cpmm";
|
|
6925
|
-
}
|
|
6926
6455
|
async function getCreateLaunchHookContext(input) {
|
|
6927
|
-
const
|
|
6928
|
-
if (input.
|
|
6929
|
-
throw new Error(
|
|
6930
|
-
'dynamicFee requires hook to be unset or set to "dynamicFee"'
|
|
6931
|
-
);
|
|
6932
|
-
}
|
|
6933
|
-
if (mode !== "cosigner" && mode !== "dynamicFee") {
|
|
6934
|
-
return { mode };
|
|
6935
|
-
}
|
|
6936
|
-
if (mode === "dynamicFee") {
|
|
6937
|
-
if (!input.dynamicFee && !input.cosigner) {
|
|
6938
|
-
throw new Error(
|
|
6939
|
-
"dynamicFee hook mode requires dynamicFee or cosigner input"
|
|
6940
|
-
);
|
|
6941
|
-
}
|
|
6942
|
-
if (!input.cosigner) {
|
|
6943
|
-
return { mode };
|
|
6944
|
-
}
|
|
6945
|
-
const [dynamicFeeConfig] = await getDynamicFeeHookConfigAddress(
|
|
6946
|
-
input.deployment?.dynamicFeeHookProgram ?? DYNAMIC_FEE_HOOK_PROGRAM_ID
|
|
6947
|
-
);
|
|
6948
|
-
return { mode, dynamicFeeConfig };
|
|
6949
|
-
}
|
|
6950
|
-
const [cosignerConfig] = await getCosignerHookConfigAddress(
|
|
6951
|
-
input.deployment?.cosignerHookProgram ?? DOPPLER_NATIVE_COSIGNER_HOOK_PROGRAM_ID
|
|
6952
|
-
);
|
|
6953
|
-
return { mode, cosignerConfig };
|
|
6954
|
-
}
|
|
6955
|
-
function getCosignerHookRemainingAccounts2({
|
|
6956
|
-
namespace,
|
|
6957
|
-
cosigner,
|
|
6958
|
-
cosignerConfig
|
|
6959
|
-
}) {
|
|
6960
|
-
const accounts = namespace === cosignerConfig ? [cosignerConfig] : [namespace, cosignerConfig];
|
|
6961
|
-
accounts.push(cosigner);
|
|
6962
|
-
return accounts;
|
|
6963
|
-
}
|
|
6964
|
-
function resolveCosignerHookPayload(input) {
|
|
6965
|
-
if (input.cosignGateExpiresAt === void 0 || input.cosignGateExpiresAt === null) {
|
|
6966
|
-
return new Uint8Array();
|
|
6456
|
+
const program = input.deployment?.cpmmHookProgram ?? CPMM_HOOK_PROGRAM_ID;
|
|
6457
|
+
if (input.cosignGateExpiresAt != null && !input.cosigner) {
|
|
6458
|
+
throw new Error("cosigner is required when cosignGateExpiresAt is set");
|
|
6967
6459
|
}
|
|
6968
6460
|
if (!input.cosigner) {
|
|
6969
|
-
|
|
6461
|
+
return { program };
|
|
6970
6462
|
}
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
value: input.cosignGateExpiresAt,
|
|
6974
|
-
cosigner: getSignerAddress(input.cosigner)
|
|
6975
|
-
});
|
|
6463
|
+
const [config] = await getCpmmHookConfigAddress(program);
|
|
6464
|
+
return { program, config };
|
|
6976
6465
|
}
|
|
6977
|
-
function
|
|
6466
|
+
function resolveCpmmHookPayload(input) {
|
|
6978
6467
|
let gateExpiry = null;
|
|
6979
6468
|
if (input.cosignGateExpiresAt !== void 0 && input.cosignGateExpiresAt !== null) {
|
|
6980
6469
|
if (!input.cosigner) {
|
|
@@ -6986,7 +6475,7 @@ function resolveDynamicFeeHookPayload(input) {
|
|
|
6986
6475
|
cosigner: getSignerAddress(input.cosigner)
|
|
6987
6476
|
};
|
|
6988
6477
|
}
|
|
6989
|
-
return
|
|
6478
|
+
return encodeCpmmHookPayload({
|
|
6990
6479
|
schedule: input.dynamicFee ?? null,
|
|
6991
6480
|
gateExpiry
|
|
6992
6481
|
});
|
|
@@ -6996,59 +6485,18 @@ function resolveCreateLaunchHook({
|
|
|
6996
6485
|
namespace,
|
|
6997
6486
|
hookContext
|
|
6998
6487
|
}) {
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
if (!input.cosigner) {
|
|
7007
|
-
throw new Error('cosigner is required when hook is "cosigner"');
|
|
7008
|
-
}
|
|
7009
|
-
if (!hookContext.cosignerConfig) {
|
|
7010
|
-
throw new Error("cosigner hook config could not be derived");
|
|
7011
|
-
}
|
|
7012
|
-
const remainingAccounts = getCosignerHookRemainingAccounts2({
|
|
7013
|
-
namespace,
|
|
7014
|
-
cosigner: input.cosigner,
|
|
7015
|
-
cosignerConfig: hookContext.cosignerConfig
|
|
7016
|
-
});
|
|
7017
|
-
return {
|
|
7018
|
-
program: input.deployment?.cosignerHookProgram ?? DOPPLER_NATIVE_COSIGNER_HOOK_PROGRAM_ID,
|
|
7019
|
-
flags: HF_BEFORE_SWAP2 | HF_FORWARD_READONLY_SIGNERS2,
|
|
7020
|
-
payload: resolveCosignerHookPayload(input),
|
|
7021
|
-
remainingAccounts,
|
|
7022
|
-
remainingAccountsHash: hashRemainingAccounts(remainingAccounts) ?? EMPTY_REMAINING_ACCOUNTS_HASH
|
|
7023
|
-
};
|
|
7024
|
-
}
|
|
7025
|
-
if (hookContext.mode === "dynamicFee") {
|
|
7026
|
-
const hasCosigner = Boolean(input.cosigner);
|
|
7027
|
-
const hasSchedule = Boolean(input.dynamicFee);
|
|
7028
|
-
if (input.cosignGateExpiresAt !== void 0 && input.cosignGateExpiresAt !== null && !input.cosigner) {
|
|
7029
|
-
throw new Error("cosigner is required when cosignGateExpiresAt is set");
|
|
7030
|
-
}
|
|
7031
|
-
if (hasCosigner && !hookContext.dynamicFeeConfig) {
|
|
7032
|
-
throw new Error("dynamic fee hook config could not be derived");
|
|
7033
|
-
}
|
|
7034
|
-
const remainingAccounts = getDynamicFeeHookRemainingAccounts({
|
|
7035
|
-
namespace,
|
|
7036
|
-
config: hookContext.dynamicFeeConfig,
|
|
7037
|
-
cosigner: input.cosigner
|
|
7038
|
-
});
|
|
7039
|
-
return {
|
|
7040
|
-
program: input.deployment?.dynamicFeeHookProgram ?? DYNAMIC_FEE_HOOK_PROGRAM_ID,
|
|
7041
|
-
flags: HF_BEFORE_SWAP2 | (hasSchedule ? HF_BEFORE_CREATE : 0) | (hasCosigner ? HF_FORWARD_READONLY_SIGNERS2 : 0),
|
|
7042
|
-
payload: resolveDynamicFeeHookPayload(input),
|
|
7043
|
-
remainingAccounts: remainingAccounts.signedHookRemainingAccounts,
|
|
7044
|
-
remainingAccountsHash: remainingAccounts.hookRemainingAccountsHash
|
|
7045
|
-
};
|
|
7046
|
-
}
|
|
6488
|
+
const hasCosigner = Boolean(input.cosigner);
|
|
6489
|
+
const hasSchedule = Boolean(input.dynamicFee);
|
|
6490
|
+
const remainingAccounts = getCpmmHookRemainingAccounts({
|
|
6491
|
+
namespace,
|
|
6492
|
+
config: hookContext.config,
|
|
6493
|
+
cosigner: input.cosigner
|
|
6494
|
+
});
|
|
7047
6495
|
return {
|
|
7048
|
-
program:
|
|
7049
|
-
flags: HF_BEFORE_SWAP2,
|
|
7050
|
-
payload:
|
|
7051
|
-
remainingAccountsHash:
|
|
6496
|
+
program: hookContext.program,
|
|
6497
|
+
flags: HF_BEFORE_SWAP2 | (hasSchedule ? HF_BEFORE_CREATE : 0) | (hasCosigner ? HF_FORWARD_READONLY_SIGNERS2 : 0),
|
|
6498
|
+
payload: resolveCpmmHookPayload(input),
|
|
6499
|
+
remainingAccountsHash: remainingAccounts.hookRemainingAccountsHash
|
|
7052
6500
|
};
|
|
7053
6501
|
}
|
|
7054
6502
|
async function getAssociatedTokenAddress({
|
|
@@ -7186,7 +6634,7 @@ async function createLaunch(input) {
|
|
|
7186
6634
|
const programId = getInitializerProgramId(input);
|
|
7187
6635
|
const launchId = input.launchId ?? createLaunchId();
|
|
7188
6636
|
const hookContext = await getCreateLaunchHookContext(input);
|
|
7189
|
-
const namespace = input.namespace ??
|
|
6637
|
+
const namespace = input.namespace ?? chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS;
|
|
7190
6638
|
const tokenPrograms = {
|
|
7191
6639
|
...launchTokenPrograms.splToken(),
|
|
7192
6640
|
...input.tokenPrograms
|
|
@@ -7232,10 +6680,10 @@ async function createLaunch(input) {
|
|
|
7232
6680
|
cpmmConfig: migration?.cpmmConfig,
|
|
7233
6681
|
baseTokenProgram: tokenPrograms.baseTokenProgram,
|
|
7234
6682
|
quoteTokenProgram: tokenPrograms.quoteTokenProgram,
|
|
7235
|
-
systemProgram: input.systemProgram ??
|
|
7236
|
-
rent: input.rent ??
|
|
6683
|
+
systemProgram: input.systemProgram ?? chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
6684
|
+
rent: input.rent ?? chunk4CI2M2F6_cjs.SYSVAR_RENT_ADDRESS,
|
|
7237
6685
|
metadataAccount: addresses.metadataAccount,
|
|
7238
|
-
metadataProgram: input.metadataProgram ??
|
|
6686
|
+
metadataProgram: input.metadataProgram ?? chunk4CI2M2F6_cjs.TOKEN_METADATA_PROGRAM_ID
|
|
7239
6687
|
},
|
|
7240
6688
|
{
|
|
7241
6689
|
namespace,
|
|
@@ -7252,7 +6700,7 @@ async function createLaunch(input) {
|
|
|
7252
6700
|
allowBuy: input.allowBuy ?? true,
|
|
7253
6701
|
allowSell: input.allowSell ?? true,
|
|
7254
6702
|
hookFlags: hook.flags,
|
|
7255
|
-
hookPayload: hook.payload
|
|
6703
|
+
hookPayload: hook.payload,
|
|
7256
6704
|
migratorInitPayload: migration?.initPayload ?? new Uint8Array(),
|
|
7257
6705
|
migratorMigratePayload: migration?.migratePayload ?? new Uint8Array(),
|
|
7258
6706
|
hookRemainingAccountsHash: hook.remainingAccountsHash,
|
|
@@ -7270,7 +6718,7 @@ async function createLaunch(input) {
|
|
|
7270
6718
|
accounts: [
|
|
7271
6719
|
...instruction.accounts ?? [],
|
|
7272
6720
|
...(migration?.initRemainingAccounts ?? []).map(
|
|
7273
|
-
|
|
6721
|
+
chunk7PXLEMBJ_cjs.createReadonlyRemainingAccountMeta
|
|
7274
6722
|
)
|
|
7275
6723
|
]
|
|
7276
6724
|
} : instruction;
|
|
@@ -7386,23 +6834,23 @@ function assertTransactionMessageFitsWithLookupTable(transactionMessage, lookupT
|
|
|
7386
6834
|
);
|
|
7387
6835
|
return assertTransactionMessageFits(compressedMessage, options);
|
|
7388
6836
|
}
|
|
7389
|
-
var
|
|
7390
|
-
async function fetchLaunch2(rpc,
|
|
7391
|
-
const response = await rpc.getAccountInfo(
|
|
6837
|
+
var addressCodec6 = kit.getAddressCodec();
|
|
6838
|
+
async function fetchLaunch2(rpc, address6, config) {
|
|
6839
|
+
const response = await rpc.getAccountInfo(address6, {
|
|
7392
6840
|
encoding: "base64",
|
|
7393
6841
|
commitment: config?.commitment
|
|
7394
6842
|
}).send();
|
|
7395
6843
|
if (!response.value) {
|
|
7396
6844
|
return null;
|
|
7397
6845
|
}
|
|
7398
|
-
return getLaunchDecoder().decode(
|
|
6846
|
+
return getLaunchDecoder().decode(chunk7PXLEMBJ_cjs.base64ToBytes(response.value.data[0]));
|
|
7399
6847
|
}
|
|
7400
6848
|
async function fetchAllLaunches(rpc, config) {
|
|
7401
6849
|
const programId = config?.programId ?? INITIALIZER_PROGRAM_ID;
|
|
7402
6850
|
const discriminatorFilter = {
|
|
7403
6851
|
memcmp: {
|
|
7404
6852
|
offset: 0n,
|
|
7405
|
-
bytes:
|
|
6853
|
+
bytes: chunk7PXLEMBJ_cjs.bytesToBase64EncodedBytes(
|
|
7406
6854
|
INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch
|
|
7407
6855
|
),
|
|
7408
6856
|
encoding: "base64"
|
|
@@ -7413,15 +6861,15 @@ async function fetchAllLaunches(rpc, config) {
|
|
|
7413
6861
|
commitment: config?.commitment,
|
|
7414
6862
|
filters: [discriminatorFilter]
|
|
7415
6863
|
}).send();
|
|
7416
|
-
const accounts =
|
|
6864
|
+
const accounts = chunk7PXLEMBJ_cjs.normalizeProgramAccountsResponse(response);
|
|
7417
6865
|
const launches = [];
|
|
7418
6866
|
const decoder = getLaunchDecoder();
|
|
7419
6867
|
for (const account of accounts) {
|
|
7420
6868
|
try {
|
|
7421
|
-
const launch = decoder.decode(
|
|
6869
|
+
const launch = decoder.decode(chunk7PXLEMBJ_cjs.base64ToBytes(account.account.data[0]));
|
|
7422
6870
|
launches.push({ address: account.pubkey, account: launch });
|
|
7423
6871
|
} catch {
|
|
7424
|
-
|
|
6872
|
+
chunk7PXLEMBJ_cjs.warnAccountDecodeFailure("launch", account.pubkey);
|
|
7425
6873
|
}
|
|
7426
6874
|
}
|
|
7427
6875
|
return launches;
|
|
@@ -7431,7 +6879,7 @@ async function fetchLaunchesByAuthority(rpc, authority, config) {
|
|
|
7431
6879
|
const discriminatorFilter = {
|
|
7432
6880
|
memcmp: {
|
|
7433
6881
|
offset: 0n,
|
|
7434
|
-
bytes:
|
|
6882
|
+
bytes: chunk7PXLEMBJ_cjs.bytesToBase64EncodedBytes(
|
|
7435
6883
|
INITIALIZER_ACCOUNT_DISCRIMINATORS.Launch
|
|
7436
6884
|
),
|
|
7437
6885
|
encoding: "base64"
|
|
@@ -7440,7 +6888,7 @@ async function fetchLaunchesByAuthority(rpc, authority, config) {
|
|
|
7440
6888
|
const authorityFilter = {
|
|
7441
6889
|
memcmp: {
|
|
7442
6890
|
offset: 8n,
|
|
7443
|
-
bytes:
|
|
6891
|
+
bytes: chunk7PXLEMBJ_cjs.bytesToBase64EncodedBytes(addressCodec6.encode(authority)),
|
|
7444
6892
|
encoding: "base64"
|
|
7445
6893
|
}
|
|
7446
6894
|
};
|
|
@@ -7449,15 +6897,15 @@ async function fetchLaunchesByAuthority(rpc, authority, config) {
|
|
|
7449
6897
|
commitment: config?.commitment,
|
|
7450
6898
|
filters: [discriminatorFilter, authorityFilter]
|
|
7451
6899
|
}).send();
|
|
7452
|
-
const accounts =
|
|
6900
|
+
const accounts = chunk7PXLEMBJ_cjs.normalizeProgramAccountsResponse(response);
|
|
7453
6901
|
const launches = [];
|
|
7454
6902
|
const decoder = getLaunchDecoder();
|
|
7455
6903
|
for (const account of accounts) {
|
|
7456
6904
|
try {
|
|
7457
|
-
const launch = decoder.decode(
|
|
6905
|
+
const launch = decoder.decode(chunk7PXLEMBJ_cjs.base64ToBytes(account.account.data[0]));
|
|
7458
6906
|
launches.push({ address: account.pubkey, account: launch });
|
|
7459
6907
|
} catch {
|
|
7460
|
-
|
|
6908
|
+
chunk7PXLEMBJ_cjs.warnAccountDecodeFailure("launch", account.pubkey);
|
|
7461
6909
|
}
|
|
7462
6910
|
}
|
|
7463
6911
|
return launches;
|
|
@@ -7575,7 +7023,7 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
|
|
|
7575
7023
|
getInitConfigDecoder: () => getInitConfigDecoder2,
|
|
7576
7024
|
getInitConfigDiscriminatorBytes: () => getInitConfigDiscriminatorBytes,
|
|
7577
7025
|
getInitConfigEncoder: () => getInitConfigEncoder2,
|
|
7578
|
-
getInitConfigSize: () =>
|
|
7026
|
+
getInitConfigSize: () => getInitConfigSize2,
|
|
7579
7027
|
getLaunchCodec: () => getLaunchCodec2,
|
|
7580
7028
|
getLaunchDecoder: () => getLaunchDecoder2,
|
|
7581
7029
|
getLaunchDiscriminatorBytes: () => getLaunchDiscriminatorBytes,
|
|
@@ -7793,13 +7241,13 @@ function decodeOracleState3(encodedAccount) {
|
|
|
7793
7241
|
getOracleStateDecoder2()
|
|
7794
7242
|
);
|
|
7795
7243
|
}
|
|
7796
|
-
async function fetchOracleState2(rpc,
|
|
7797
|
-
const maybeAccount = await fetchMaybeOracleState2(rpc,
|
|
7244
|
+
async function fetchOracleState2(rpc, address6, config) {
|
|
7245
|
+
const maybeAccount = await fetchMaybeOracleState2(rpc, address6, config);
|
|
7798
7246
|
kit.assertAccountExists(maybeAccount);
|
|
7799
7247
|
return maybeAccount;
|
|
7800
7248
|
}
|
|
7801
|
-
async function fetchMaybeOracleState2(rpc,
|
|
7802
|
-
const maybeAccount = await kit.fetchEncodedAccount(rpc,
|
|
7249
|
+
async function fetchMaybeOracleState2(rpc, address6, config) {
|
|
7250
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address6, config);
|
|
7803
7251
|
return decodeOracleState3(maybeAccount);
|
|
7804
7252
|
}
|
|
7805
7253
|
async function fetchAllOracleState2(rpc, addresses, config) {
|
|
@@ -7883,9 +7331,9 @@ function parseFinalizeInstruction(instruction) {
|
|
|
7883
7331
|
}
|
|
7884
7332
|
let accountIndex = 0;
|
|
7885
7333
|
const getNextAccount = () => {
|
|
7886
|
-
const
|
|
7334
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
7887
7335
|
accountIndex += 1;
|
|
7888
|
-
return
|
|
7336
|
+
return accountMeta2;
|
|
7889
7337
|
};
|
|
7890
7338
|
return {
|
|
7891
7339
|
programAddress: instruction.programAddress,
|
|
@@ -7971,9 +7419,9 @@ function parseInitializeOracleInstruction2(instruction) {
|
|
|
7971
7419
|
}
|
|
7972
7420
|
let accountIndex = 0;
|
|
7973
7421
|
const getNextAccount = () => {
|
|
7974
|
-
const
|
|
7422
|
+
const accountMeta2 = instruction.accounts[accountIndex];
|
|
7975
7423
|
accountIndex += 1;
|
|
7976
|
-
return
|
|
7424
|
+
return accountMeta2;
|
|
7977
7425
|
};
|
|
7978
7426
|
return {
|
|
7979
7427
|
programAddress: instruction.programAddress,
|
|
@@ -8183,8 +7631,8 @@ async function curveSwapExactIn(input) {
|
|
|
8183
7631
|
const programId = input.programId ?? input.deployment?.initializerProgram ?? INITIALIZER_PROGRAM_ID;
|
|
8184
7632
|
const user = input.user ?? input.payer;
|
|
8185
7633
|
const userAddress = getAddress(user);
|
|
8186
|
-
const baseTokenProgram = input.baseTokenProgram ??
|
|
8187
|
-
const quoteTokenProgram = input.quoteTokenProgram ??
|
|
7634
|
+
const baseTokenProgram = input.baseTokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
7635
|
+
const quoteTokenProgram = input.quoteTokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
8188
7636
|
const userBaseAccount = await getAssociatedTokenAddress2({
|
|
8189
7637
|
owner: userAddress,
|
|
8190
7638
|
mint: input.baseMint,
|
|
@@ -8233,7 +7681,7 @@ async function curveSwapExactIn(input) {
|
|
|
8233
7681
|
baseMint: input.baseMint,
|
|
8234
7682
|
quoteMint: input.quoteMint,
|
|
8235
7683
|
user,
|
|
8236
|
-
hookProgram: input.
|
|
7684
|
+
hookProgram: input.deployment?.cpmmHookProgram ?? CPMM_HOOK_PROGRAM_ID,
|
|
8237
7685
|
baseTokenProgram,
|
|
8238
7686
|
quoteTokenProgram,
|
|
8239
7687
|
remainingAccounts: input.remainingAccounts ? [...input.remainingAccounts] : void 0
|
|
@@ -8261,7 +7709,7 @@ async function curveSwapExactIn(input) {
|
|
|
8261
7709
|
}
|
|
8262
7710
|
async function swapExactIn(input) {
|
|
8263
7711
|
const programId = input.programId ?? input.deployment?.cpmmProgram ?? void 0;
|
|
8264
|
-
const pool = "pool" in input ? input.pool : await
|
|
7712
|
+
const pool = "pool" in input ? input.pool : await chunk7PXLEMBJ_cjs.getPoolByMints(input.rpc, input.mintA, input.mintB, {
|
|
8265
7713
|
programId
|
|
8266
7714
|
});
|
|
8267
7715
|
if (!pool) {
|
|
@@ -8269,9 +7717,9 @@ async function swapExactIn(input) {
|
|
|
8269
7717
|
}
|
|
8270
7718
|
const user = input.user ?? input.payer;
|
|
8271
7719
|
const userAddress = getAddress(user);
|
|
8272
|
-
const token0Program = input.token0Program ?? input.tokenProgram ??
|
|
8273
|
-
const token1Program = input.token1Program ?? input.tokenProgram ??
|
|
8274
|
-
const quote =
|
|
7720
|
+
const token0Program = input.token0Program ?? input.tokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
7721
|
+
const token1Program = input.token1Program ?? input.tokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
7722
|
+
const quote = chunk7PXLEMBJ_cjs.getSwapQuote(
|
|
8275
7723
|
pool.account,
|
|
8276
7724
|
input.amountIn,
|
|
8277
7725
|
input.tradeDirection
|
|
@@ -8360,8 +7808,8 @@ function getDefaultComputeUnitLimit(cpmmMigration) {
|
|
|
8360
7808
|
return cpmmMigration.recipientAtas.length > 0 ? 8e5 : 4e5;
|
|
8361
7809
|
}
|
|
8362
7810
|
function migrateLaunch(input) {
|
|
8363
|
-
const baseTokenProgram = input.baseTokenProgram ??
|
|
8364
|
-
const quoteTokenProgram = input.quoteTokenProgram ??
|
|
7811
|
+
const baseTokenProgram = input.baseTokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
7812
|
+
const quoteTokenProgram = input.quoteTokenProgram ?? chunk4CI2M2F6_cjs.TOKEN_PROGRAM_ADDRESS;
|
|
8365
7813
|
const recipients = input.recipients ? [...input.recipients] : [];
|
|
8366
7814
|
if (recipients.length > 0 && recipients.length !== input.cpmmMigration.recipientAtas.length) {
|
|
8367
7815
|
throw new Error(
|
|
@@ -8395,8 +7843,8 @@ function migrateLaunch(input) {
|
|
|
8395
7843
|
payer: input.payer,
|
|
8396
7844
|
baseTokenProgram,
|
|
8397
7845
|
quoteTokenProgram,
|
|
8398
|
-
systemProgram: input.systemProgram ??
|
|
8399
|
-
rent: input.rent ??
|
|
7846
|
+
systemProgram: input.systemProgram ?? chunk4CI2M2F6_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7847
|
+
rent: input.rent ?? chunk4CI2M2F6_cjs.SYSVAR_RENT_ADDRESS
|
|
8400
7848
|
},
|
|
8401
7849
|
input.programId ?? input.deployment?.initializerProgram ?? INITIALIZER_PROGRAM_ID
|
|
8402
7850
|
);
|
|
@@ -8463,15 +7911,13 @@ async function assertMigrationQuoteThreshold({
|
|
|
8463
7911
|
|
|
8464
7912
|
// src/solana/deployment.ts
|
|
8465
7913
|
var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
|
|
8466
|
-
cpmmProgram:
|
|
7914
|
+
cpmmProgram: chunk4CI2M2F6_cjs.CPMM_PROGRAM_ID,
|
|
8467
7915
|
initializerProgram: INITIALIZER_PROGRAM_ID,
|
|
8468
7916
|
cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
|
|
8469
|
-
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
|
|
8470
|
-
cosignerHookProgram: DOPPLER_NATIVE_COSIGNER_HOOK_PROGRAM_ID,
|
|
8471
|
-
dynamicFeeHookProgram: DYNAMIC_FEE_HOOK_PROGRAM_ID
|
|
7917
|
+
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
|
|
8472
7918
|
};
|
|
8473
7919
|
async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
|
|
8474
|
-
const [cpmmConfig] = await
|
|
7920
|
+
const [cpmmConfig] = await chunk4CI2M2F6_cjs.getConfigAddress(programs.cpmmProgram);
|
|
8475
7921
|
const [initializerConfig] = await getConfigAddress2(
|
|
8476
7922
|
programs.initializerProgram
|
|
8477
7923
|
);
|
|
@@ -8484,13 +7930,12 @@ async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGR
|
|
|
8484
7930
|
|
|
8485
7931
|
exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES;
|
|
8486
7932
|
exports.assertMigrationQuoteThreshold = assertMigrationQuoteThreshold;
|
|
8487
|
-
exports.cosignerHook = cosignerHook_exports;
|
|
8488
7933
|
exports.cpmm = cpmm_exports;
|
|
7934
|
+
exports.cpmmHook = cpmmHook_exports;
|
|
8489
7935
|
exports.cpmmMigrator = cpmmMigrator_exports;
|
|
8490
7936
|
exports.createLaunch = createLaunch;
|
|
8491
7937
|
exports.curveSwapExactIn = curveSwapExactIn;
|
|
8492
7938
|
exports.deriveSolanaCpmmDeployment = deriveSolanaCpmmDeployment;
|
|
8493
|
-
exports.dynamicFeeHook = dynamicFeeHook_exports;
|
|
8494
7939
|
exports.getMigrationQuoteProgress = getMigrationQuoteProgress;
|
|
8495
7940
|
exports.initializer = initializer_exports;
|
|
8496
7941
|
exports.migrateLaunch = migrateLaunch;
|