@whetstone-research/doppler-sdk 1.0.19 → 1.0.21
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-BESE77DM.js +3840 -0
- package/dist/chunk-BESE77DM.js.map +1 -0
- package/dist/chunk-KJ6W44WF.cjs +4089 -0
- package/dist/chunk-KJ6W44WF.cjs.map +1 -0
- package/dist/{chunk-AKLS6T3R.cjs → chunk-Y6TJIH33.cjs} +36 -24
- package/dist/chunk-Y6TJIH33.cjs.map +1 -0
- package/dist/{chunk-6TOPYGOG.js → chunk-ZUJKBFXW.js} +35 -24
- package/dist/chunk-ZUJKBFXW.js.map +1 -0
- package/dist/{oracle-7PmpwwPx.d.ts → oracle-D1wPWydZ.d.cts} +1 -33
- package/dist/{oracle-7PmpwwPx.d.cts → oracle-D1wPWydZ.d.ts} +1 -33
- package/dist/{pda-PZRHQJMK.cjs → pda-A4PIAS5Y.cjs} +20 -16
- package/dist/pda-A4PIAS5Y.cjs.map +1 -0
- package/dist/{pda-N6ULJYLG.js → pda-JVAD45XJ.js} +3 -3
- package/dist/pda-JVAD45XJ.js.map +1 -0
- package/dist/solana/index.cjs +427 -3253
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +211 -213
- package/dist/solana/index.d.ts +211 -213
- package/dist/solana/index.js +105 -2931
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +53 -85
- package/dist/solana/react/index.cjs.map +1 -1
- package/dist/solana/react/index.d.cts +7 -1
- package/dist/solana/react/index.d.ts +7 -1
- package/dist/solana/react/index.js +15 -47
- package/dist/solana/react/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-6TOPYGOG.js.map +0 -1
- package/dist/chunk-AKLS6T3R.cjs.map +0 -1
- package/dist/chunk-C2D7CIXP.js +0 -977
- package/dist/chunk-C2D7CIXP.js.map +0 -1
- package/dist/chunk-GUGN3EYX.cjs +0 -1069
- package/dist/chunk-GUGN3EYX.cjs.map +0 -1
- package/dist/pda-N6ULJYLG.js.map +0 -1
- package/dist/pda-PZRHQJMK.cjs.map +0 -1
package/dist/solana/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkKJ6W44WF_cjs = require('../chunk-KJ6W44WF.cjs');
|
|
4
|
+
var chunkY6TJIH33_cjs = require('../chunk-Y6TJIH33.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');
|
|
@@ -11,345 +11,334 @@ var addressLookupTable = require('@solana-program/address-lookup-table');
|
|
|
11
11
|
// src/solana/cpmm/index.ts
|
|
12
12
|
var cpmm_exports = {};
|
|
13
13
|
chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
14
|
-
ACCOUNT_DISCRIMINATORS: () =>
|
|
15
|
-
ACCOUNT_VERSION: () =>
|
|
16
|
-
ADD_LIQUIDITY_DISCRIMINATOR: () => ADD_LIQUIDITY_DISCRIMINATOR,
|
|
17
|
-
BPS_DENOM: () =>
|
|
18
|
-
CLOSE_POSITION_DISCRIMINATOR: () => CLOSE_POSITION_DISCRIMINATOR,
|
|
19
|
-
COLLECT_FEES_DISCRIMINATOR: () => COLLECT_FEES_DISCRIMINATOR,
|
|
20
|
-
COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () => COLLECT_PROTOCOL_FEES_DISCRIMINATOR,
|
|
14
|
+
ACCOUNT_DISCRIMINATORS: () => chunkY6TJIH33_cjs.ACCOUNT_DISCRIMINATORS,
|
|
15
|
+
ACCOUNT_VERSION: () => chunkY6TJIH33_cjs.ACCOUNT_VERSION,
|
|
16
|
+
ADD_LIQUIDITY_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.ADD_LIQUIDITY_DISCRIMINATOR,
|
|
17
|
+
BPS_DENOM: () => chunkY6TJIH33_cjs.BPS_DENOM,
|
|
18
|
+
CLOSE_POSITION_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.CLOSE_POSITION_DISCRIMINATOR,
|
|
19
|
+
COLLECT_FEES_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.COLLECT_FEES_DISCRIMINATOR,
|
|
20
|
+
COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.COLLECT_PROTOCOL_FEES_DISCRIMINATOR,
|
|
21
21
|
CPMM_ERROR_MESSAGES: () => CPMM_ERROR_MESSAGES,
|
|
22
|
-
CPMM_PROGRAM_ID: () =>
|
|
23
|
-
CREATE_POSITION_DISCRIMINATOR: () => CREATE_POSITION_DISCRIMINATOR,
|
|
22
|
+
CPMM_PROGRAM_ID: () => chunkY6TJIH33_cjs.CPMM_PROGRAM_ID,
|
|
23
|
+
CREATE_POSITION_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.CREATE_POSITION_DISCRIMINATOR,
|
|
24
24
|
CpmmError: () => CpmmError,
|
|
25
25
|
CpmmErrorCode: () => CpmmErrorCode,
|
|
26
|
-
HF_AFTER_ADD_LIQ: () =>
|
|
27
|
-
HF_AFTER_REMOVE_LIQ: () =>
|
|
28
|
-
HF_AFTER_SWAP: () =>
|
|
29
|
-
HF_BEFORE_ADD_LIQ: () =>
|
|
30
|
-
HF_BEFORE_REMOVE_LIQ: () =>
|
|
31
|
-
HF_BEFORE_SWAP: () =>
|
|
32
|
-
HF_FORWARD_READONLY_SIGNERS: () =>
|
|
33
|
-
HF_REQUIRE_ORACLE: () =>
|
|
34
|
-
HOOK_NO_CHANGE: () =>
|
|
35
|
-
INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR,
|
|
36
|
-
INITIALIZE_ORACLE_DISCRIMINATOR: () => INITIALIZE_ORACLE_DISCRIMINATOR,
|
|
37
|
-
INITIALIZE_POOL_DISCRIMINATOR: () => INITIALIZE_POOL_DISCRIMINATOR,
|
|
38
|
-
INSTRUCTION_DISCRIMINATORS: () =>
|
|
26
|
+
HF_AFTER_ADD_LIQ: () => chunkY6TJIH33_cjs.HF_AFTER_ADD_LIQ,
|
|
27
|
+
HF_AFTER_REMOVE_LIQ: () => chunkY6TJIH33_cjs.HF_AFTER_REMOVE_LIQ,
|
|
28
|
+
HF_AFTER_SWAP: () => chunkY6TJIH33_cjs.HF_AFTER_SWAP,
|
|
29
|
+
HF_BEFORE_ADD_LIQ: () => chunkY6TJIH33_cjs.HF_BEFORE_ADD_LIQ,
|
|
30
|
+
HF_BEFORE_REMOVE_LIQ: () => chunkY6TJIH33_cjs.HF_BEFORE_REMOVE_LIQ,
|
|
31
|
+
HF_BEFORE_SWAP: () => chunkY6TJIH33_cjs.HF_BEFORE_SWAP,
|
|
32
|
+
HF_FORWARD_READONLY_SIGNERS: () => chunkY6TJIH33_cjs.HF_FORWARD_READONLY_SIGNERS,
|
|
33
|
+
HF_REQUIRE_ORACLE: () => chunkY6TJIH33_cjs.HF_REQUIRE_ORACLE,
|
|
34
|
+
HOOK_NO_CHANGE: () => chunkY6TJIH33_cjs.HOOK_NO_CHANGE,
|
|
35
|
+
INITIALIZE_CONFIG_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.INITIALIZE_CONFIG_DISCRIMINATOR,
|
|
36
|
+
INITIALIZE_ORACLE_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.INITIALIZE_ORACLE_DISCRIMINATOR,
|
|
37
|
+
INITIALIZE_POOL_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.INITIALIZE_POOL_DISCRIMINATOR,
|
|
38
|
+
INSTRUCTION_DISCRIMINATORS: () => chunkY6TJIH33_cjs.INSTRUCTION_DISCRIMINATORS,
|
|
39
39
|
MAX_FEE_AMOUNT: () => MAX_FEE_AMOUNT,
|
|
40
|
-
MAX_HOOK_ALLOWLIST: () =>
|
|
41
|
-
MAX_ORACLE_OBSERVATIONS: () =>
|
|
42
|
-
ORACLE_CONSULT_DISCRIMINATOR: () => ORACLE_CONSULT_DISCRIMINATOR,
|
|
43
|
-
ORACLE_UPDATE_DISCRIMINATOR: () => ORACLE_UPDATE_DISCRIMINATOR,
|
|
44
|
-
PAUSE_DISCRIMINATOR: () => PAUSE_DISCRIMINATOR,
|
|
45
|
-
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () => PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,
|
|
46
|
-
Q64_ONE: () =>
|
|
47
|
-
|
|
48
|
-
REMOVE_LIQUIDITY_DISCRIMINATOR: () => REMOVE_LIQUIDITY_DISCRIMINATOR,
|
|
49
|
-
SEED_AUTHORITY: () =>
|
|
50
|
-
SEED_CONFIG: () =>
|
|
51
|
-
SEED_ORACLE: () =>
|
|
52
|
-
SEED_POOL: () =>
|
|
53
|
-
SEED_POSITION: () =>
|
|
54
|
-
|
|
55
|
-
SET_FEES_DISCRIMINATOR: () => SET_FEES_DISCRIMINATOR,
|
|
56
|
-
SET_HOOK_DISCRIMINATOR: () => SET_HOOK_DISCRIMINATOR,
|
|
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
|
-
createSetHookInstruction: () => getSetHookInstruction,
|
|
93
|
-
createSetRouteInstruction: () => getSetRouteInstruction,
|
|
94
|
-
createSwapExactInInstruction: () => getSwapExactInInstruction,
|
|
40
|
+
MAX_HOOK_ALLOWLIST: () => chunkY6TJIH33_cjs.MAX_HOOK_ALLOWLIST,
|
|
41
|
+
MAX_ORACLE_OBSERVATIONS: () => chunkY6TJIH33_cjs.MAX_ORACLE_OBSERVATIONS,
|
|
42
|
+
ORACLE_CONSULT_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.ORACLE_CONSULT_DISCRIMINATOR,
|
|
43
|
+
ORACLE_UPDATE_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.ORACLE_UPDATE_DISCRIMINATOR,
|
|
44
|
+
PAUSE_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.PAUSE_DISCRIMINATOR,
|
|
45
|
+
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,
|
|
46
|
+
Q64_ONE: () => chunkY6TJIH33_cjs.Q64_ONE,
|
|
47
|
+
REDEEM_PROTOCOL_SHARES_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.REDEEM_PROTOCOL_SHARES_DISCRIMINATOR,
|
|
48
|
+
REMOVE_LIQUIDITY_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.REMOVE_LIQUIDITY_DISCRIMINATOR,
|
|
49
|
+
SEED_AUTHORITY: () => chunkY6TJIH33_cjs.SEED_AUTHORITY,
|
|
50
|
+
SEED_CONFIG: () => chunkY6TJIH33_cjs.SEED_CONFIG,
|
|
51
|
+
SEED_ORACLE: () => chunkY6TJIH33_cjs.SEED_ORACLE,
|
|
52
|
+
SEED_POOL: () => chunkY6TJIH33_cjs.SEED_POOL,
|
|
53
|
+
SEED_POSITION: () => chunkY6TJIH33_cjs.SEED_POSITION,
|
|
54
|
+
SEED_PROTOCOL_FEE_OWNER: () => chunkY6TJIH33_cjs.SEED_PROTOCOL_FEE_OWNER,
|
|
55
|
+
SET_FEES_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.SET_FEES_DISCRIMINATOR,
|
|
56
|
+
SET_HOOK_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.SET_HOOK_DISCRIMINATOR,
|
|
57
|
+
SWAP_EXACT_IN_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.SWAP_EXACT_IN_DISCRIMINATOR,
|
|
58
|
+
TOKEN_METADATA_PROGRAM_ID: () => chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
59
|
+
TRANSFER_ADMIN_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.TRANSFER_ADMIN_DISCRIMINATOR,
|
|
60
|
+
UNPAUSE_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.UNPAUSE_DISCRIMINATOR,
|
|
61
|
+
UPDATE_CONFIG_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.UPDATE_CONFIG_DISCRIMINATOR,
|
|
62
|
+
WITHDRAW_VAULT_EXCESS_DISCRIMINATOR: () => chunkKJ6W44WF_cjs.WITHDRAW_VAULT_EXCESS_DISCRIMINATOR,
|
|
63
|
+
addLiquidityArgsCodec: () => chunkKJ6W44WF_cjs.addLiquidityArgsCodec,
|
|
64
|
+
ammConfigDataCodec: () => chunkKJ6W44WF_cjs.ammConfigDataCodec,
|
|
65
|
+
areMintsOrdered: () => chunkY6TJIH33_cjs.areMintsOrdered,
|
|
66
|
+
calculateAccruedFees: () => chunkKJ6W44WF_cjs.calculateAccruedFees,
|
|
67
|
+
calculateTwap: () => chunkKJ6W44WF_cjs.calculateTwap,
|
|
68
|
+
calculateTwapNumber: () => chunkKJ6W44WF_cjs.calculateTwapNumber,
|
|
69
|
+
ceilDiv: () => chunkKJ6W44WF_cjs.ceilDiv,
|
|
70
|
+
collectFeesArgsCodec: () => chunkKJ6W44WF_cjs.collectFeesArgsCodec,
|
|
71
|
+
collectProtocolFeesArgsCodec: () => chunkKJ6W44WF_cjs.collectProtocolFeesArgsCodec,
|
|
72
|
+
comparePoolAndOraclePrices: () => chunkKJ6W44WF_cjs.comparePoolAndOraclePrices,
|
|
73
|
+
computePrice0Q64: () => chunkKJ6W44WF_cjs.computePrice0Q64,
|
|
74
|
+
computePrice1Q64: () => chunkKJ6W44WF_cjs.computePrice1Q64,
|
|
75
|
+
consultTwap: () => chunkKJ6W44WF_cjs.consultTwap,
|
|
76
|
+
createAddLiquidityInstruction: () => chunkKJ6W44WF_cjs.getAddLiquidityInstruction,
|
|
77
|
+
createClosePositionInstruction: () => chunkKJ6W44WF_cjs.getClosePositionInstruction,
|
|
78
|
+
createCollectFeesInstruction: () => chunkKJ6W44WF_cjs.getCollectFeesInstruction,
|
|
79
|
+
createCollectProtocolFeesInstruction: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstruction,
|
|
80
|
+
createCreatePositionInstruction: () => chunkKJ6W44WF_cjs.getCreatePositionInstruction,
|
|
81
|
+
createInitializeConfigInstruction: () => chunkKJ6W44WF_cjs.getInitializeConfigInstruction,
|
|
82
|
+
createInitializeOracleInstruction: () => chunkKJ6W44WF_cjs.getInitializeOracleInstruction,
|
|
83
|
+
createInitializePoolInstruction: () => chunkKJ6W44WF_cjs.getInitializePoolInstruction,
|
|
84
|
+
createOracleConsultInstruction: () => chunkKJ6W44WF_cjs.getOracleConsultInstruction,
|
|
85
|
+
createOracleUpdateInstruction: () => chunkKJ6W44WF_cjs.getOracleUpdateInstruction,
|
|
86
|
+
createPauseInstruction: () => chunkKJ6W44WF_cjs.getPauseInstruction,
|
|
87
|
+
createPositionArgsCodec: () => chunkKJ6W44WF_cjs.createPositionArgsCodec,
|
|
88
|
+
createRemoveLiquidityInstruction: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstruction,
|
|
89
|
+
createSetFeesInstruction: () => chunkKJ6W44WF_cjs.getSetFeesInstruction,
|
|
90
|
+
createSetHookInstruction: () => chunkKJ6W44WF_cjs.getSetHookInstruction,
|
|
91
|
+
createSwapExactInInstruction: () => chunkKJ6W44WF_cjs.getSwapExactInInstruction,
|
|
95
92
|
createSwapInstruction: () => createSwapInstruction,
|
|
96
|
-
createTransferAdminInstruction: () => getTransferAdminInstruction,
|
|
97
|
-
createUnpauseInstruction: () => getUnpauseInstruction,
|
|
98
|
-
createWithdrawVaultExcessInstruction: () => getWithdrawVaultExcessInstruction,
|
|
93
|
+
createTransferAdminInstruction: () => chunkKJ6W44WF_cjs.getTransferAdminInstruction,
|
|
94
|
+
createUnpauseInstruction: () => chunkKJ6W44WF_cjs.getUnpauseInstruction,
|
|
95
|
+
createWithdrawVaultExcessInstruction: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstruction,
|
|
99
96
|
curveParamsToMarketCap: () => curveParamsToMarketCap,
|
|
100
|
-
decodeAmmConfig: () =>
|
|
101
|
-
decodeOracleState: () =>
|
|
102
|
-
decodePool: () =>
|
|
103
|
-
decodePosition: () =>
|
|
104
|
-
encodeAddLiquidityArgs: () =>
|
|
105
|
-
encodeCollectFeesArgs: () =>
|
|
106
|
-
encodeCollectProtocolFeesArgs: () =>
|
|
107
|
-
encodeCreatePositionArgs: () =>
|
|
108
|
-
encodeInitializeConfigArgs: () =>
|
|
109
|
-
encodeInitializeOracleArgs: () =>
|
|
110
|
-
encodeInitializePoolArgs: () =>
|
|
111
|
-
encodeInstructionData: () =>
|
|
112
|
-
encodeOracleConsultArgs: () =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
encodeTransferAdminArgs: () => chunkGUGN3EYX_cjs.encodeTransferAdminArgs,
|
|
120
|
-
fetchAllPools: () => chunkGUGN3EYX_cjs.fetchAllPools,
|
|
97
|
+
decodeAmmConfig: () => chunkKJ6W44WF_cjs.decodeAmmConfig,
|
|
98
|
+
decodeOracleState: () => chunkKJ6W44WF_cjs.decodeOracleState,
|
|
99
|
+
decodePool: () => chunkKJ6W44WF_cjs.decodePool,
|
|
100
|
+
decodePosition: () => chunkKJ6W44WF_cjs.decodePosition,
|
|
101
|
+
encodeAddLiquidityArgs: () => chunkKJ6W44WF_cjs.encodeAddLiquidityArgs,
|
|
102
|
+
encodeCollectFeesArgs: () => chunkKJ6W44WF_cjs.encodeCollectFeesArgs,
|
|
103
|
+
encodeCollectProtocolFeesArgs: () => chunkKJ6W44WF_cjs.encodeCollectProtocolFeesArgs,
|
|
104
|
+
encodeCreatePositionArgs: () => chunkKJ6W44WF_cjs.encodeCreatePositionArgs,
|
|
105
|
+
encodeInitializeConfigArgs: () => chunkKJ6W44WF_cjs.encodeInitializeConfigArgs,
|
|
106
|
+
encodeInitializeOracleArgs: () => chunkKJ6W44WF_cjs.encodeInitializeOracleArgs,
|
|
107
|
+
encodeInitializePoolArgs: () => chunkKJ6W44WF_cjs.encodeInitializePoolArgs,
|
|
108
|
+
encodeInstructionData: () => chunkKJ6W44WF_cjs.encodeInstructionData,
|
|
109
|
+
encodeOracleConsultArgs: () => chunkKJ6W44WF_cjs.encodeOracleConsultArgs,
|
|
110
|
+
encodeRemoveLiquidityArgs: () => chunkKJ6W44WF_cjs.encodeRemoveLiquidityArgs,
|
|
111
|
+
encodeSetFeesArgs: () => chunkKJ6W44WF_cjs.encodeSetFeesArgs,
|
|
112
|
+
encodeSetHookArgs: () => chunkKJ6W44WF_cjs.encodeSetHookArgs,
|
|
113
|
+
encodeSwapExactInArgs: () => chunkKJ6W44WF_cjs.encodeSwapExactInArgs,
|
|
114
|
+
encodeTransferAdminArgs: () => chunkKJ6W44WF_cjs.encodeTransferAdminArgs,
|
|
115
|
+
fetchAllPools: () => chunkKJ6W44WF_cjs.fetchAllPools,
|
|
121
116
|
fetchConfig: () => fetchConfig,
|
|
122
117
|
fetchConfigWithAddress: () => fetchConfigWithAddress,
|
|
123
|
-
fetchOracle: () =>
|
|
124
|
-
fetchOraclesBatch: () =>
|
|
125
|
-
fetchPool: () =>
|
|
126
|
-
fetchPoolPositions: () =>
|
|
127
|
-
fetchPoolsBatch: () =>
|
|
128
|
-
fetchPosition: () =>
|
|
129
|
-
fetchPositionByParams: () =>
|
|
130
|
-
fetchPositionsBatch: () =>
|
|
131
|
-
fetchUserPositions: () =>
|
|
132
|
-
filterActivePositions: () =>
|
|
133
|
-
filterPoolsByMint: () =>
|
|
134
|
-
getAddLiquidityDiscriminatorBytes: () => getAddLiquidityDiscriminatorBytes,
|
|
135
|
-
getAddLiquidityInstruction: () => getAddLiquidityInstruction,
|
|
136
|
-
getAddLiquidityInstructionAsync: () => getAddLiquidityInstructionAsync,
|
|
137
|
-
getAddLiquidityInstructionDataCodec: () => getAddLiquidityInstructionDataCodec,
|
|
138
|
-
getAddLiquidityInstructionDataDecoder: () => getAddLiquidityInstructionDataDecoder,
|
|
139
|
-
getAddLiquidityInstructionDataEncoder: () => getAddLiquidityInstructionDataEncoder,
|
|
140
|
-
getAddLiquidityQuote: () =>
|
|
141
|
-
getClosePositionDiscriminatorBytes: () => getClosePositionDiscriminatorBytes,
|
|
142
|
-
getClosePositionInstruction: () => getClosePositionInstruction,
|
|
143
|
-
getClosePositionInstructionDataCodec: () => getClosePositionInstructionDataCodec,
|
|
144
|
-
getClosePositionInstructionDataDecoder: () => getClosePositionInstructionDataDecoder,
|
|
145
|
-
getClosePositionInstructionDataEncoder: () => getClosePositionInstructionDataEncoder,
|
|
146
|
-
getCollectFeesDiscriminatorBytes: () => getCollectFeesDiscriminatorBytes,
|
|
147
|
-
getCollectFeesInstruction: () => getCollectFeesInstruction,
|
|
148
|
-
getCollectFeesInstructionAsync: () => getCollectFeesInstructionAsync,
|
|
149
|
-
getCollectFeesInstructionDataCodec: () => getCollectFeesInstructionDataCodec,
|
|
150
|
-
getCollectFeesInstructionDataDecoder: () => getCollectFeesInstructionDataDecoder,
|
|
151
|
-
getCollectFeesInstructionDataEncoder: () => getCollectFeesInstructionDataEncoder,
|
|
152
|
-
getCollectProtocolFeesDiscriminatorBytes: () => getCollectProtocolFeesDiscriminatorBytes,
|
|
153
|
-
getCollectProtocolFeesInstruction: () => getCollectProtocolFeesInstruction,
|
|
154
|
-
getCollectProtocolFeesInstructionAsync: () => getCollectProtocolFeesInstructionAsync,
|
|
155
|
-
getCollectProtocolFeesInstructionDataCodec: () => getCollectProtocolFeesInstructionDataCodec,
|
|
156
|
-
getCollectProtocolFeesInstructionDataDecoder: () => getCollectProtocolFeesInstructionDataDecoder,
|
|
157
|
-
getCollectProtocolFeesInstructionDataEncoder: () => getCollectProtocolFeesInstructionDataEncoder,
|
|
158
|
-
getConfigAddress: () =>
|
|
159
|
-
getCreatePositionDiscriminatorBytes: () => getCreatePositionDiscriminatorBytes,
|
|
160
|
-
getCreatePositionInstruction: () => getCreatePositionInstruction,
|
|
161
|
-
getCreatePositionInstructionAsync: () => getCreatePositionInstructionAsync,
|
|
162
|
-
getCreatePositionInstructionDataCodec: () => getCreatePositionInstructionDataCodec,
|
|
163
|
-
getCreatePositionInstructionDataDecoder: () => getCreatePositionInstructionDataDecoder,
|
|
164
|
-
getCreatePositionInstructionDataEncoder: () => getCreatePositionInstructionDataEncoder,
|
|
118
|
+
fetchOracle: () => chunkKJ6W44WF_cjs.fetchOracle,
|
|
119
|
+
fetchOraclesBatch: () => chunkKJ6W44WF_cjs.fetchOraclesBatch,
|
|
120
|
+
fetchPool: () => chunkKJ6W44WF_cjs.fetchPool,
|
|
121
|
+
fetchPoolPositions: () => chunkKJ6W44WF_cjs.fetchPoolPositions,
|
|
122
|
+
fetchPoolsBatch: () => chunkKJ6W44WF_cjs.fetchPoolsBatch,
|
|
123
|
+
fetchPosition: () => chunkKJ6W44WF_cjs.fetchPosition,
|
|
124
|
+
fetchPositionByParams: () => chunkKJ6W44WF_cjs.fetchPositionByParams,
|
|
125
|
+
fetchPositionsBatch: () => chunkKJ6W44WF_cjs.fetchPositionsBatch,
|
|
126
|
+
fetchUserPositions: () => chunkKJ6W44WF_cjs.fetchUserPositions,
|
|
127
|
+
filterActivePositions: () => chunkKJ6W44WF_cjs.filterActivePositions,
|
|
128
|
+
filterPoolsByMint: () => chunkKJ6W44WF_cjs.filterPoolsByMint,
|
|
129
|
+
getAddLiquidityDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getAddLiquidityDiscriminatorBytes,
|
|
130
|
+
getAddLiquidityInstruction: () => chunkKJ6W44WF_cjs.getAddLiquidityInstruction,
|
|
131
|
+
getAddLiquidityInstructionAsync: () => chunkKJ6W44WF_cjs.getAddLiquidityInstructionAsync,
|
|
132
|
+
getAddLiquidityInstructionDataCodec: () => chunkKJ6W44WF_cjs.getAddLiquidityInstructionDataCodec,
|
|
133
|
+
getAddLiquidityInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getAddLiquidityInstructionDataDecoder,
|
|
134
|
+
getAddLiquidityInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getAddLiquidityInstructionDataEncoder,
|
|
135
|
+
getAddLiquidityQuote: () => chunkKJ6W44WF_cjs.getAddLiquidityQuote,
|
|
136
|
+
getClosePositionDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getClosePositionDiscriminatorBytes,
|
|
137
|
+
getClosePositionInstruction: () => chunkKJ6W44WF_cjs.getClosePositionInstruction,
|
|
138
|
+
getClosePositionInstructionDataCodec: () => chunkKJ6W44WF_cjs.getClosePositionInstructionDataCodec,
|
|
139
|
+
getClosePositionInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getClosePositionInstructionDataDecoder,
|
|
140
|
+
getClosePositionInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getClosePositionInstructionDataEncoder,
|
|
141
|
+
getCollectFeesDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getCollectFeesDiscriminatorBytes,
|
|
142
|
+
getCollectFeesInstruction: () => chunkKJ6W44WF_cjs.getCollectFeesInstruction,
|
|
143
|
+
getCollectFeesInstructionAsync: () => chunkKJ6W44WF_cjs.getCollectFeesInstructionAsync,
|
|
144
|
+
getCollectFeesInstructionDataCodec: () => chunkKJ6W44WF_cjs.getCollectFeesInstructionDataCodec,
|
|
145
|
+
getCollectFeesInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getCollectFeesInstructionDataDecoder,
|
|
146
|
+
getCollectFeesInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getCollectFeesInstructionDataEncoder,
|
|
147
|
+
getCollectProtocolFeesDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesDiscriminatorBytes,
|
|
148
|
+
getCollectProtocolFeesInstruction: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstruction,
|
|
149
|
+
getCollectProtocolFeesInstructionAsync: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstructionAsync,
|
|
150
|
+
getCollectProtocolFeesInstructionDataCodec: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstructionDataCodec,
|
|
151
|
+
getCollectProtocolFeesInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstructionDataDecoder,
|
|
152
|
+
getCollectProtocolFeesInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getCollectProtocolFeesInstructionDataEncoder,
|
|
153
|
+
getConfigAddress: () => chunkY6TJIH33_cjs.getConfigAddress,
|
|
154
|
+
getCreatePositionDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getCreatePositionDiscriminatorBytes,
|
|
155
|
+
getCreatePositionInstruction: () => chunkKJ6W44WF_cjs.getCreatePositionInstruction,
|
|
156
|
+
getCreatePositionInstructionAsync: () => chunkKJ6W44WF_cjs.getCreatePositionInstructionAsync,
|
|
157
|
+
getCreatePositionInstructionDataCodec: () => chunkKJ6W44WF_cjs.getCreatePositionInstructionDataCodec,
|
|
158
|
+
getCreatePositionInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getCreatePositionInstructionDataDecoder,
|
|
159
|
+
getCreatePositionInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getCreatePositionInstructionDataEncoder,
|
|
165
160
|
getErrorMessage: () => getErrorMessage,
|
|
166
|
-
getInitializeConfigDiscriminatorBytes: () => getInitializeConfigDiscriminatorBytes,
|
|
167
|
-
getInitializeConfigInstruction: () => getInitializeConfigInstruction,
|
|
168
|
-
getInitializeConfigInstructionAsync: () => getInitializeConfigInstructionAsync,
|
|
169
|
-
getInitializeConfigInstructionDataCodec: () => getInitializeConfigInstructionDataCodec,
|
|
170
|
-
getInitializeConfigInstructionDataDecoder: () => getInitializeConfigInstructionDataDecoder,
|
|
171
|
-
getInitializeConfigInstructionDataEncoder: () => getInitializeConfigInstructionDataEncoder,
|
|
172
|
-
getInitializeOracleDiscriminatorBytes: () => getInitializeOracleDiscriminatorBytes,
|
|
173
|
-
getInitializeOracleInstruction: () => getInitializeOracleInstruction,
|
|
174
|
-
getInitializeOracleInstructionAsync: () => getInitializeOracleInstructionAsync,
|
|
175
|
-
getInitializeOracleInstructionDataCodec: () => getInitializeOracleInstructionDataCodec,
|
|
176
|
-
getInitializeOracleInstructionDataDecoder: () => getInitializeOracleInstructionDataDecoder,
|
|
177
|
-
getInitializeOracleInstructionDataEncoder: () => getInitializeOracleInstructionDataEncoder,
|
|
178
|
-
getInitializePoolDiscriminatorBytes: () => getInitializePoolDiscriminatorBytes,
|
|
179
|
-
getInitializePoolInstruction: () => getInitializePoolInstruction,
|
|
180
|
-
getInitializePoolInstructionAsync: () => getInitializePoolInstructionAsync,
|
|
181
|
-
getInitializePoolInstructionDataCodec: () => getInitializePoolInstructionDataCodec,
|
|
182
|
-
getInitializePoolInstructionDataDecoder: () => getInitializePoolInstructionDataDecoder,
|
|
183
|
-
getInitializePoolInstructionDataEncoder: () => getInitializePoolInstructionDataEncoder,
|
|
184
|
-
getK: () =>
|
|
185
|
-
getLiquidityAddresses: () =>
|
|
161
|
+
getInitializeConfigDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getInitializeConfigDiscriminatorBytes,
|
|
162
|
+
getInitializeConfigInstruction: () => chunkKJ6W44WF_cjs.getInitializeConfigInstruction,
|
|
163
|
+
getInitializeConfigInstructionAsync: () => chunkKJ6W44WF_cjs.getInitializeConfigInstructionAsync,
|
|
164
|
+
getInitializeConfigInstructionDataCodec: () => chunkKJ6W44WF_cjs.getInitializeConfigInstructionDataCodec,
|
|
165
|
+
getInitializeConfigInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getInitializeConfigInstructionDataDecoder,
|
|
166
|
+
getInitializeConfigInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getInitializeConfigInstructionDataEncoder,
|
|
167
|
+
getInitializeOracleDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getInitializeOracleDiscriminatorBytes,
|
|
168
|
+
getInitializeOracleInstruction: () => chunkKJ6W44WF_cjs.getInitializeOracleInstruction,
|
|
169
|
+
getInitializeOracleInstructionAsync: () => chunkKJ6W44WF_cjs.getInitializeOracleInstructionAsync,
|
|
170
|
+
getInitializeOracleInstructionDataCodec: () => chunkKJ6W44WF_cjs.getInitializeOracleInstructionDataCodec,
|
|
171
|
+
getInitializeOracleInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getInitializeOracleInstructionDataDecoder,
|
|
172
|
+
getInitializeOracleInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getInitializeOracleInstructionDataEncoder,
|
|
173
|
+
getInitializePoolDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getInitializePoolDiscriminatorBytes,
|
|
174
|
+
getInitializePoolInstruction: () => chunkKJ6W44WF_cjs.getInitializePoolInstruction,
|
|
175
|
+
getInitializePoolInstructionAsync: () => chunkKJ6W44WF_cjs.getInitializePoolInstructionAsync,
|
|
176
|
+
getInitializePoolInstructionDataCodec: () => chunkKJ6W44WF_cjs.getInitializePoolInstructionDataCodec,
|
|
177
|
+
getInitializePoolInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getInitializePoolInstructionDataDecoder,
|
|
178
|
+
getInitializePoolInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getInitializePoolInstructionDataEncoder,
|
|
179
|
+
getK: () => chunkKJ6W44WF_cjs.getK,
|
|
180
|
+
getLiquidityAddresses: () => chunkY6TJIH33_cjs.getLiquidityAddresses,
|
|
186
181
|
getMetadataAddress: () => getMetadataAddress,
|
|
187
|
-
getOracleAddress: () =>
|
|
188
|
-
getOracleAddressFromPool: () =>
|
|
189
|
-
getOracleAge: () =>
|
|
190
|
-
getOracleBufferStats: () =>
|
|
191
|
-
getOracleConsultDiscriminatorBytes: () => getOracleConsultDiscriminatorBytes,
|
|
192
|
-
getOracleConsultInstruction: () => getOracleConsultInstruction,
|
|
193
|
-
getOracleConsultInstructionAsync: () => getOracleConsultInstructionAsync,
|
|
194
|
-
getOracleConsultInstructionDataCodec: () => getOracleConsultInstructionDataCodec,
|
|
195
|
-
getOracleConsultInstructionDataDecoder: () => getOracleConsultInstructionDataDecoder,
|
|
196
|
-
getOracleConsultInstructionDataEncoder: () => getOracleConsultInstructionDataEncoder,
|
|
197
|
-
getOracleDeviation: () =>
|
|
198
|
-
getOracleForPool: () =>
|
|
199
|
-
getOracleSpotPrices: () =>
|
|
200
|
-
getOracleUpdateDiscriminatorBytes: () => getOracleUpdateDiscriminatorBytes,
|
|
201
|
-
getOracleUpdateInstruction: () => getOracleUpdateInstruction,
|
|
202
|
-
getOracleUpdateInstructionAsync: () => getOracleUpdateInstructionAsync,
|
|
203
|
-
getOracleUpdateInstructionDataCodec: () => getOracleUpdateInstructionDataCodec,
|
|
204
|
-
getOracleUpdateInstructionDataDecoder: () => getOracleUpdateInstructionDataDecoder,
|
|
205
|
-
getOracleUpdateInstructionDataEncoder: () => getOracleUpdateInstructionDataEncoder,
|
|
206
|
-
getPauseDiscriminatorBytes: () => getPauseDiscriminatorBytes,
|
|
207
|
-
getPauseInstruction: () => getPauseInstruction,
|
|
208
|
-
getPauseInstructionDataCodec: () => getPauseInstructionDataCodec,
|
|
209
|
-
getPauseInstructionDataDecoder: () => getPauseInstructionDataDecoder,
|
|
210
|
-
getPauseInstructionDataEncoder: () => getPauseInstructionDataEncoder,
|
|
211
|
-
getPendingFees: () =>
|
|
212
|
-
getPoolAddress: () =>
|
|
213
|
-
getPoolAddressFromMints: () =>
|
|
214
|
-
getPoolAuthorityAddress: () =>
|
|
215
|
-
getPoolByMints: () =>
|
|
216
|
-
getPoolInitAddresses: () =>
|
|
217
|
-
getPoolVault0Address: () =>
|
|
218
|
-
getPoolVault1Address: () =>
|
|
219
|
-
getPositionAddress: () =>
|
|
220
|
-
getPositionAddressFromParams: () =>
|
|
221
|
-
getPositionValue: () =>
|
|
222
|
-
getPreviewSwapExactInDiscriminatorBytes: () => getPreviewSwapExactInDiscriminatorBytes,
|
|
223
|
-
getPreviewSwapExactInInstruction: () => getPreviewSwapExactInInstruction,
|
|
224
|
-
getPreviewSwapExactInInstructionDataCodec: () => getPreviewSwapExactInInstructionDataCodec,
|
|
225
|
-
getPreviewSwapExactInInstructionDataDecoder: () => getPreviewSwapExactInInstructionDataDecoder,
|
|
226
|
-
getPreviewSwapExactInInstructionDataEncoder: () => getPreviewSwapExactInInstructionDataEncoder,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
initializeConfigArgsCodec: () => chunkGUGN3EYX_cjs.initializeConfigArgsCodec,
|
|
289
|
-
initializeOracleArgsCodec: () => chunkGUGN3EYX_cjs.initializeOracleArgsCodec,
|
|
290
|
-
initializePoolArgsCodec: () => chunkGUGN3EYX_cjs.initializePoolArgsCodec,
|
|
182
|
+
getOracleAddress: () => chunkY6TJIH33_cjs.getOracleAddress,
|
|
183
|
+
getOracleAddressFromPool: () => chunkKJ6W44WF_cjs.getOracleAddressFromPool,
|
|
184
|
+
getOracleAge: () => chunkKJ6W44WF_cjs.getOracleAge,
|
|
185
|
+
getOracleBufferStats: () => chunkKJ6W44WF_cjs.getOracleBufferStats,
|
|
186
|
+
getOracleConsultDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getOracleConsultDiscriminatorBytes,
|
|
187
|
+
getOracleConsultInstruction: () => chunkKJ6W44WF_cjs.getOracleConsultInstruction,
|
|
188
|
+
getOracleConsultInstructionAsync: () => chunkKJ6W44WF_cjs.getOracleConsultInstructionAsync,
|
|
189
|
+
getOracleConsultInstructionDataCodec: () => chunkKJ6W44WF_cjs.getOracleConsultInstructionDataCodec,
|
|
190
|
+
getOracleConsultInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getOracleConsultInstructionDataDecoder,
|
|
191
|
+
getOracleConsultInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getOracleConsultInstructionDataEncoder,
|
|
192
|
+
getOracleDeviation: () => chunkKJ6W44WF_cjs.getOracleDeviation,
|
|
193
|
+
getOracleForPool: () => chunkKJ6W44WF_cjs.getOracleForPool,
|
|
194
|
+
getOracleSpotPrices: () => chunkKJ6W44WF_cjs.getOracleSpotPrices,
|
|
195
|
+
getOracleUpdateDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getOracleUpdateDiscriminatorBytes,
|
|
196
|
+
getOracleUpdateInstruction: () => chunkKJ6W44WF_cjs.getOracleUpdateInstruction,
|
|
197
|
+
getOracleUpdateInstructionAsync: () => chunkKJ6W44WF_cjs.getOracleUpdateInstructionAsync,
|
|
198
|
+
getOracleUpdateInstructionDataCodec: () => chunkKJ6W44WF_cjs.getOracleUpdateInstructionDataCodec,
|
|
199
|
+
getOracleUpdateInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getOracleUpdateInstructionDataDecoder,
|
|
200
|
+
getOracleUpdateInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getOracleUpdateInstructionDataEncoder,
|
|
201
|
+
getPauseDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getPauseDiscriminatorBytes,
|
|
202
|
+
getPauseInstruction: () => chunkKJ6W44WF_cjs.getPauseInstruction,
|
|
203
|
+
getPauseInstructionDataCodec: () => chunkKJ6W44WF_cjs.getPauseInstructionDataCodec,
|
|
204
|
+
getPauseInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getPauseInstructionDataDecoder,
|
|
205
|
+
getPauseInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getPauseInstructionDataEncoder,
|
|
206
|
+
getPendingFees: () => chunkKJ6W44WF_cjs.getPendingFees,
|
|
207
|
+
getPoolAddress: () => chunkY6TJIH33_cjs.getPoolAddress,
|
|
208
|
+
getPoolAddressFromMints: () => chunkKJ6W44WF_cjs.getPoolAddressFromMints,
|
|
209
|
+
getPoolAuthorityAddress: () => chunkY6TJIH33_cjs.getPoolAuthorityAddress,
|
|
210
|
+
getPoolByMints: () => chunkKJ6W44WF_cjs.getPoolByMints,
|
|
211
|
+
getPoolInitAddresses: () => chunkY6TJIH33_cjs.getPoolInitAddresses,
|
|
212
|
+
getPoolVault0Address: () => chunkY6TJIH33_cjs.getPoolVault0Address,
|
|
213
|
+
getPoolVault1Address: () => chunkY6TJIH33_cjs.getPoolVault1Address,
|
|
214
|
+
getPositionAddress: () => chunkY6TJIH33_cjs.getPositionAddress,
|
|
215
|
+
getPositionAddressFromParams: () => chunkKJ6W44WF_cjs.getPositionAddressFromParams,
|
|
216
|
+
getPositionValue: () => chunkKJ6W44WF_cjs.getPositionValue,
|
|
217
|
+
getPreviewSwapExactInDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getPreviewSwapExactInDiscriminatorBytes,
|
|
218
|
+
getPreviewSwapExactInInstruction: () => chunkKJ6W44WF_cjs.getPreviewSwapExactInInstruction,
|
|
219
|
+
getPreviewSwapExactInInstructionDataCodec: () => chunkKJ6W44WF_cjs.getPreviewSwapExactInInstructionDataCodec,
|
|
220
|
+
getPreviewSwapExactInInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getPreviewSwapExactInInstructionDataDecoder,
|
|
221
|
+
getPreviewSwapExactInInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getPreviewSwapExactInInstructionDataEncoder,
|
|
222
|
+
getProtocolFeeOwnerAddress: () => chunkY6TJIH33_cjs.getProtocolFeeOwnerAddress,
|
|
223
|
+
getProtocolFeePositionAddress: () => chunkY6TJIH33_cjs.getProtocolFeePositionAddress,
|
|
224
|
+
getRedeemProtocolSharesDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesDiscriminatorBytes,
|
|
225
|
+
getRedeemProtocolSharesInstruction: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesInstruction,
|
|
226
|
+
getRedeemProtocolSharesInstructionAsync: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesInstructionAsync,
|
|
227
|
+
getRedeemProtocolSharesInstructionDataCodec: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesInstructionDataCodec,
|
|
228
|
+
getRedeemProtocolSharesInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesInstructionDataDecoder,
|
|
229
|
+
getRedeemProtocolSharesInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getRedeemProtocolSharesInstructionDataEncoder,
|
|
230
|
+
getRemoveLiquidityDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getRemoveLiquidityDiscriminatorBytes,
|
|
231
|
+
getRemoveLiquidityInstruction: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstruction,
|
|
232
|
+
getRemoveLiquidityInstructionAsync: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstructionAsync,
|
|
233
|
+
getRemoveLiquidityInstructionDataCodec: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstructionDataCodec,
|
|
234
|
+
getRemoveLiquidityInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstructionDataDecoder,
|
|
235
|
+
getRemoveLiquidityInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getRemoveLiquidityInstructionDataEncoder,
|
|
236
|
+
getRemoveLiquidityQuote: () => chunkKJ6W44WF_cjs.getRemoveLiquidityQuote,
|
|
237
|
+
getSetFeesDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getSetFeesDiscriminatorBytes,
|
|
238
|
+
getSetFeesInstruction: () => chunkKJ6W44WF_cjs.getSetFeesInstruction,
|
|
239
|
+
getSetFeesInstructionDataCodec: () => chunkKJ6W44WF_cjs.getSetFeesInstructionDataCodec,
|
|
240
|
+
getSetFeesInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getSetFeesInstructionDataDecoder,
|
|
241
|
+
getSetFeesInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getSetFeesInstructionDataEncoder,
|
|
242
|
+
getSetHookDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getSetHookDiscriminatorBytes,
|
|
243
|
+
getSetHookInstruction: () => chunkKJ6W44WF_cjs.getSetHookInstruction,
|
|
244
|
+
getSetHookInstructionDataCodec: () => chunkKJ6W44WF_cjs.getSetHookInstructionDataCodec,
|
|
245
|
+
getSetHookInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getSetHookInstructionDataDecoder,
|
|
246
|
+
getSetHookInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getSetHookInstructionDataEncoder,
|
|
247
|
+
getSpotPrice0: () => chunkKJ6W44WF_cjs.getSpotPrice0,
|
|
248
|
+
getSpotPrice1: () => chunkKJ6W44WF_cjs.getSpotPrice1,
|
|
249
|
+
getSwapAddresses: () => chunkY6TJIH33_cjs.getSwapAddresses,
|
|
250
|
+
getSwapExactInDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getSwapExactInDiscriminatorBytes,
|
|
251
|
+
getSwapExactInInstruction: () => chunkKJ6W44WF_cjs.getSwapExactInInstruction,
|
|
252
|
+
getSwapExactInInstructionAsync: () => chunkKJ6W44WF_cjs.getSwapExactInInstructionAsync,
|
|
253
|
+
getSwapExactInInstructionDataCodec: () => chunkKJ6W44WF_cjs.getSwapExactInInstructionDataCodec,
|
|
254
|
+
getSwapExactInInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getSwapExactInInstructionDataDecoder,
|
|
255
|
+
getSwapExactInInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getSwapExactInInstructionDataEncoder,
|
|
256
|
+
getSwapQuote: () => chunkKJ6W44WF_cjs.getSwapQuote,
|
|
257
|
+
getSwapQuoteExactOut: () => chunkKJ6W44WF_cjs.getSwapQuoteExactOut,
|
|
258
|
+
getTransferAdminDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getTransferAdminDiscriminatorBytes,
|
|
259
|
+
getTransferAdminInstruction: () => chunkKJ6W44WF_cjs.getTransferAdminInstruction,
|
|
260
|
+
getTransferAdminInstructionDataCodec: () => chunkKJ6W44WF_cjs.getTransferAdminInstructionDataCodec,
|
|
261
|
+
getTransferAdminInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getTransferAdminInstructionDataDecoder,
|
|
262
|
+
getTransferAdminInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getTransferAdminInstructionDataEncoder,
|
|
263
|
+
getTvl: () => chunkKJ6W44WF_cjs.getTvl,
|
|
264
|
+
getUnpauseDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getUnpauseDiscriminatorBytes,
|
|
265
|
+
getUnpauseInstruction: () => chunkKJ6W44WF_cjs.getUnpauseInstruction,
|
|
266
|
+
getUnpauseInstructionDataCodec: () => chunkKJ6W44WF_cjs.getUnpauseInstructionDataCodec,
|
|
267
|
+
getUnpauseInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getUnpauseInstructionDataDecoder,
|
|
268
|
+
getUnpauseInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getUnpauseInstructionDataEncoder,
|
|
269
|
+
getUpdateConfigDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getUpdateConfigDiscriminatorBytes,
|
|
270
|
+
getUpdateConfigInstruction: () => chunkKJ6W44WF_cjs.getUpdateConfigInstruction,
|
|
271
|
+
getUpdateConfigInstructionDataCodec: () => chunkKJ6W44WF_cjs.getUpdateConfigInstructionDataCodec,
|
|
272
|
+
getUpdateConfigInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getUpdateConfigInstructionDataDecoder,
|
|
273
|
+
getUpdateConfigInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getUpdateConfigInstructionDataEncoder,
|
|
274
|
+
getWithdrawVaultExcessDiscriminatorBytes: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessDiscriminatorBytes,
|
|
275
|
+
getWithdrawVaultExcessInstruction: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstruction,
|
|
276
|
+
getWithdrawVaultExcessInstructionAsync: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstructionAsync,
|
|
277
|
+
getWithdrawVaultExcessInstructionDataCodec: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstructionDataCodec,
|
|
278
|
+
getWithdrawVaultExcessInstructionDataDecoder: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstructionDataDecoder,
|
|
279
|
+
getWithdrawVaultExcessInstructionDataEncoder: () => chunkKJ6W44WF_cjs.getWithdrawVaultExcessInstructionDataEncoder,
|
|
280
|
+
initializeConfigArgsCodec: () => chunkKJ6W44WF_cjs.initializeConfigArgsCodec,
|
|
281
|
+
initializeOracleArgsCodec: () => chunkKJ6W44WF_cjs.initializeOracleArgsCodec,
|
|
282
|
+
initializePoolArgsCodec: () => chunkKJ6W44WF_cjs.initializePoolArgsCodec,
|
|
291
283
|
isCpmmError: () => isCpmmError,
|
|
292
|
-
isOracleStale: () =>
|
|
293
|
-
isqrt: () =>
|
|
284
|
+
isOracleStale: () => chunkKJ6W44WF_cjs.isOracleStale,
|
|
285
|
+
isqrt: () => chunkKJ6W44WF_cjs.isqrt,
|
|
294
286
|
marketCapToCurveParams: () => marketCapToCurveParams,
|
|
295
287
|
marketCapToSingleCurveParams: () => marketCapToSingleCurveParams,
|
|
296
288
|
marketCapToTokenPrice: () => marketCapToTokenPrice,
|
|
297
|
-
maxBigInt: () =>
|
|
298
|
-
minBigInt: () =>
|
|
299
|
-
numberToQ64: () =>
|
|
300
|
-
observationCodec: () =>
|
|
301
|
-
oracleConsultArgsCodec: () =>
|
|
302
|
-
oracleStateDataCodec: () =>
|
|
303
|
-
parseAddLiquidityInstruction: () => parseAddLiquidityInstruction,
|
|
304
|
-
parseClosePositionInstruction: () => parseClosePositionInstruction,
|
|
305
|
-
parseCollectFeesInstruction: () => parseCollectFeesInstruction,
|
|
306
|
-
parseCollectProtocolFeesInstruction: () => parseCollectProtocolFeesInstruction,
|
|
307
|
-
parseCreatePositionInstruction: () => parseCreatePositionInstruction,
|
|
289
|
+
maxBigInt: () => chunkKJ6W44WF_cjs.maxBigInt,
|
|
290
|
+
minBigInt: () => chunkKJ6W44WF_cjs.minBigInt,
|
|
291
|
+
numberToQ64: () => chunkKJ6W44WF_cjs.numberToQ64,
|
|
292
|
+
observationCodec: () => chunkKJ6W44WF_cjs.observationCodec,
|
|
293
|
+
oracleConsultArgsCodec: () => chunkKJ6W44WF_cjs.oracleConsultArgsCodec,
|
|
294
|
+
oracleStateDataCodec: () => chunkKJ6W44WF_cjs.oracleStateDataCodec,
|
|
295
|
+
parseAddLiquidityInstruction: () => chunkKJ6W44WF_cjs.parseAddLiquidityInstruction,
|
|
296
|
+
parseClosePositionInstruction: () => chunkKJ6W44WF_cjs.parseClosePositionInstruction,
|
|
297
|
+
parseCollectFeesInstruction: () => chunkKJ6W44WF_cjs.parseCollectFeesInstruction,
|
|
298
|
+
parseCollectProtocolFeesInstruction: () => chunkKJ6W44WF_cjs.parseCollectProtocolFeesInstruction,
|
|
299
|
+
parseCreatePositionInstruction: () => chunkKJ6W44WF_cjs.parseCreatePositionInstruction,
|
|
308
300
|
parseErrorFromLogs: () => parseErrorFromLogs,
|
|
309
|
-
parseInitializeConfigInstruction: () => parseInitializeConfigInstruction,
|
|
310
|
-
parseInitializeOracleInstruction: () => parseInitializeOracleInstruction,
|
|
311
|
-
parseInitializePoolInstruction: () => parseInitializePoolInstruction,
|
|
312
|
-
parseOracleConsultInstruction: () => parseOracleConsultInstruction,
|
|
313
|
-
parseOracleUpdateInstruction: () => parseOracleUpdateInstruction,
|
|
314
|
-
parsePauseInstruction: () => parsePauseInstruction,
|
|
315
|
-
parsePreviewSwapExactInInstruction: () => parsePreviewSwapExactInInstruction,
|
|
316
|
-
|
|
317
|
-
parseRemoveLiquidityInstruction: () => parseRemoveLiquidityInstruction,
|
|
318
|
-
parseSetFeesInstruction: () => parseSetFeesInstruction,
|
|
319
|
-
parseSetHookInstruction: () => parseSetHookInstruction,
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
sortPositionsByShares: () => chunkGUGN3EYX_cjs.sortPositionsByShares,
|
|
341
|
-
swapExactInArgsCodec: () => chunkGUGN3EYX_cjs.swapExactInArgsCodec,
|
|
342
|
-
transferAdminArgsCodec: () => chunkGUGN3EYX_cjs.transferAdminArgsCodec,
|
|
301
|
+
parseInitializeConfigInstruction: () => chunkKJ6W44WF_cjs.parseInitializeConfigInstruction,
|
|
302
|
+
parseInitializeOracleInstruction: () => chunkKJ6W44WF_cjs.parseInitializeOracleInstruction,
|
|
303
|
+
parseInitializePoolInstruction: () => chunkKJ6W44WF_cjs.parseInitializePoolInstruction,
|
|
304
|
+
parseOracleConsultInstruction: () => chunkKJ6W44WF_cjs.parseOracleConsultInstruction,
|
|
305
|
+
parseOracleUpdateInstruction: () => chunkKJ6W44WF_cjs.parseOracleUpdateInstruction,
|
|
306
|
+
parsePauseInstruction: () => chunkKJ6W44WF_cjs.parsePauseInstruction,
|
|
307
|
+
parsePreviewSwapExactInInstruction: () => chunkKJ6W44WF_cjs.parsePreviewSwapExactInInstruction,
|
|
308
|
+
parseRedeemProtocolSharesInstruction: () => chunkKJ6W44WF_cjs.parseRedeemProtocolSharesInstruction,
|
|
309
|
+
parseRemoveLiquidityInstruction: () => chunkKJ6W44WF_cjs.parseRemoveLiquidityInstruction,
|
|
310
|
+
parseSetFeesInstruction: () => chunkKJ6W44WF_cjs.parseSetFeesInstruction,
|
|
311
|
+
parseSetHookInstruction: () => chunkKJ6W44WF_cjs.parseSetHookInstruction,
|
|
312
|
+
parseSwapExactInInstruction: () => chunkKJ6W44WF_cjs.parseSwapExactInInstruction,
|
|
313
|
+
parseTransferAdminInstruction: () => chunkKJ6W44WF_cjs.parseTransferAdminInstruction,
|
|
314
|
+
parseUnpauseInstruction: () => chunkKJ6W44WF_cjs.parseUnpauseInstruction,
|
|
315
|
+
parseUpdateConfigInstruction: () => chunkKJ6W44WF_cjs.parseUpdateConfigInstruction,
|
|
316
|
+
parseWithdrawVaultExcessInstruction: () => chunkKJ6W44WF_cjs.parseWithdrawVaultExcessInstruction,
|
|
317
|
+
poolDataCodec: () => chunkKJ6W44WF_cjs.poolDataCodec,
|
|
318
|
+
poolExists: () => chunkKJ6W44WF_cjs.poolExists,
|
|
319
|
+
positionDataCodec: () => chunkKJ6W44WF_cjs.positionDataCodec,
|
|
320
|
+
q64Div: () => chunkKJ6W44WF_cjs.q64Div,
|
|
321
|
+
q64Mul: () => chunkKJ6W44WF_cjs.q64Mul,
|
|
322
|
+
q64ToNumber: () => chunkKJ6W44WF_cjs.q64ToNumber,
|
|
323
|
+
ratioToNumber: () => chunkKJ6W44WF_cjs.ratioToNumber,
|
|
324
|
+
removeLiquidityArgsCodec: () => chunkKJ6W44WF_cjs.removeLiquidityArgsCodec,
|
|
325
|
+
setFeesArgsCodec: () => chunkKJ6W44WF_cjs.setFeesArgsCodec,
|
|
326
|
+
setHookArgsCodec: () => chunkKJ6W44WF_cjs.setHookArgsCodec,
|
|
327
|
+
sortMints: () => chunkY6TJIH33_cjs.sortMints,
|
|
328
|
+
sortPoolsByReserves: () => chunkKJ6W44WF_cjs.sortPoolsByReserves,
|
|
329
|
+
sortPositionsByShares: () => chunkKJ6W44WF_cjs.sortPositionsByShares,
|
|
330
|
+
swapExactInArgsCodec: () => chunkKJ6W44WF_cjs.swapExactInArgsCodec,
|
|
331
|
+
transferAdminArgsCodec: () => chunkKJ6W44WF_cjs.transferAdminArgsCodec,
|
|
343
332
|
validateMarketCapParameters: () => validateMarketCapParameters
|
|
344
333
|
});
|
|
345
334
|
var addressCodec = kit.getAddressCodec();
|
|
346
335
|
var textEncoder = new TextEncoder();
|
|
347
336
|
async function getMetadataAddress(mint) {
|
|
348
337
|
return kit.getProgramDerivedAddress({
|
|
349
|
-
programAddress:
|
|
338
|
+
programAddress: chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
350
339
|
seeds: [
|
|
351
340
|
textEncoder.encode("metadata"),
|
|
352
|
-
addressCodec.encode(
|
|
341
|
+
addressCodec.encode(chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
353
342
|
addressCodec.encode(mint)
|
|
354
343
|
]
|
|
355
344
|
});
|
|
@@ -641,2869 +630,6 @@ function getErrorMessage(code) {
|
|
|
641
630
|
}
|
|
642
631
|
return `Unknown error code: ${code}`;
|
|
643
632
|
}
|
|
644
|
-
|
|
645
|
-
// src/solana/generated/cpmm/programs/cpmm.ts
|
|
646
|
-
var CPMM_PROGRAM_ADDRESS = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
|
|
647
|
-
|
|
648
|
-
// src/solana/generated/cpmm/instructions/addLiquidity.ts
|
|
649
|
-
var ADD_LIQUIDITY_DISCRIMINATOR = new Uint8Array([
|
|
650
|
-
181,
|
|
651
|
-
157,
|
|
652
|
-
89,
|
|
653
|
-
67,
|
|
654
|
-
143,
|
|
655
|
-
182,
|
|
656
|
-
52,
|
|
657
|
-
72
|
|
658
|
-
]);
|
|
659
|
-
function getAddLiquidityDiscriminatorBytes() {
|
|
660
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
661
|
-
ADD_LIQUIDITY_DISCRIMINATOR
|
|
662
|
-
);
|
|
663
|
-
}
|
|
664
|
-
function getAddLiquidityInstructionDataEncoder() {
|
|
665
|
-
return kit.transformEncoder(
|
|
666
|
-
kit.getStructEncoder([
|
|
667
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
668
|
-
["amount0Max", kit.getU64Encoder()],
|
|
669
|
-
["amount1Max", kit.getU64Encoder()],
|
|
670
|
-
["minSharesOut", kit.getU128Encoder()],
|
|
671
|
-
["updateOracle", kit.getBooleanEncoder()]
|
|
672
|
-
]),
|
|
673
|
-
(value) => ({ ...value, discriminator: ADD_LIQUIDITY_DISCRIMINATOR })
|
|
674
|
-
);
|
|
675
|
-
}
|
|
676
|
-
function getAddLiquidityInstructionDataDecoder() {
|
|
677
|
-
return kit.getStructDecoder([
|
|
678
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
679
|
-
["amount0Max", kit.getU64Decoder()],
|
|
680
|
-
["amount1Max", kit.getU64Decoder()],
|
|
681
|
-
["minSharesOut", kit.getU128Decoder()],
|
|
682
|
-
["updateOracle", kit.getBooleanDecoder()]
|
|
683
|
-
]);
|
|
684
|
-
}
|
|
685
|
-
function getAddLiquidityInstructionDataCodec() {
|
|
686
|
-
return kit.combineCodec(
|
|
687
|
-
getAddLiquidityInstructionDataEncoder(),
|
|
688
|
-
getAddLiquidityInstructionDataDecoder()
|
|
689
|
-
);
|
|
690
|
-
}
|
|
691
|
-
async function getAddLiquidityInstructionAsync(input, config) {
|
|
692
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
693
|
-
const originalAccounts = {
|
|
694
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
695
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
696
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
697
|
-
protocolFeePosition: {
|
|
698
|
-
value: input.protocolFeePosition ?? null,
|
|
699
|
-
isWritable: true
|
|
700
|
-
},
|
|
701
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
702
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
703
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
704
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
705
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
706
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
707
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
708
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
709
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
710
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
711
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
712
|
-
};
|
|
713
|
-
const accounts = originalAccounts;
|
|
714
|
-
const args = { ...input };
|
|
715
|
-
if (!accounts.authority.value) {
|
|
716
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
717
|
-
programAddress,
|
|
718
|
-
seeds: [
|
|
719
|
-
kit.getBytesEncoder().encode(
|
|
720
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
721
|
-
),
|
|
722
|
-
kit.getAddressEncoder().encode(
|
|
723
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
724
|
-
)
|
|
725
|
-
]
|
|
726
|
-
});
|
|
727
|
-
}
|
|
728
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
729
|
-
return Object.freeze({
|
|
730
|
-
accounts: [
|
|
731
|
-
getAccountMeta("config", accounts.config),
|
|
732
|
-
getAccountMeta("pool", accounts.pool),
|
|
733
|
-
getAccountMeta("position", accounts.position),
|
|
734
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
735
|
-
getAccountMeta("owner", accounts.owner),
|
|
736
|
-
getAccountMeta("authority", accounts.authority),
|
|
737
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
738
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
739
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
740
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
741
|
-
getAccountMeta("user0", accounts.user0),
|
|
742
|
-
getAccountMeta("user1", accounts.user1),
|
|
743
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
744
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
745
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
746
|
-
],
|
|
747
|
-
data: getAddLiquidityInstructionDataEncoder().encode(
|
|
748
|
-
args
|
|
749
|
-
),
|
|
750
|
-
programAddress
|
|
751
|
-
});
|
|
752
|
-
}
|
|
753
|
-
function getAddLiquidityInstruction(input, config) {
|
|
754
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
755
|
-
const originalAccounts = {
|
|
756
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
757
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
758
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
759
|
-
protocolFeePosition: {
|
|
760
|
-
value: input.protocolFeePosition ?? null,
|
|
761
|
-
isWritable: true
|
|
762
|
-
},
|
|
763
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
764
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
765
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
766
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
767
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
768
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
769
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
770
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
771
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
772
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
773
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
774
|
-
};
|
|
775
|
-
const accounts = originalAccounts;
|
|
776
|
-
const args = { ...input };
|
|
777
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
778
|
-
return Object.freeze({
|
|
779
|
-
accounts: [
|
|
780
|
-
getAccountMeta("config", accounts.config),
|
|
781
|
-
getAccountMeta("pool", accounts.pool),
|
|
782
|
-
getAccountMeta("position", accounts.position),
|
|
783
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
784
|
-
getAccountMeta("owner", accounts.owner),
|
|
785
|
-
getAccountMeta("authority", accounts.authority),
|
|
786
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
787
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
788
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
789
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
790
|
-
getAccountMeta("user0", accounts.user0),
|
|
791
|
-
getAccountMeta("user1", accounts.user1),
|
|
792
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
793
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
794
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
795
|
-
],
|
|
796
|
-
data: getAddLiquidityInstructionDataEncoder().encode(
|
|
797
|
-
args
|
|
798
|
-
),
|
|
799
|
-
programAddress
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
function parseAddLiquidityInstruction(instruction) {
|
|
803
|
-
if (instruction.accounts.length < 15) {
|
|
804
|
-
throw new kit.SolanaError(
|
|
805
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
806
|
-
{
|
|
807
|
-
actualAccountMetas: instruction.accounts.length,
|
|
808
|
-
expectedAccountMetas: 15
|
|
809
|
-
}
|
|
810
|
-
);
|
|
811
|
-
}
|
|
812
|
-
let accountIndex = 0;
|
|
813
|
-
const getNextAccount = () => {
|
|
814
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
815
|
-
accountIndex += 1;
|
|
816
|
-
return accountMeta;
|
|
817
|
-
};
|
|
818
|
-
const getNextOptionalAccount = () => {
|
|
819
|
-
const accountMeta = getNextAccount();
|
|
820
|
-
return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
821
|
-
};
|
|
822
|
-
return {
|
|
823
|
-
programAddress: instruction.programAddress,
|
|
824
|
-
accounts: {
|
|
825
|
-
config: getNextAccount(),
|
|
826
|
-
pool: getNextAccount(),
|
|
827
|
-
position: getNextAccount(),
|
|
828
|
-
protocolFeePosition: getNextAccount(),
|
|
829
|
-
owner: getNextAccount(),
|
|
830
|
-
authority: getNextAccount(),
|
|
831
|
-
vault0: getNextAccount(),
|
|
832
|
-
vault1: getNextAccount(),
|
|
833
|
-
token0Mint: getNextAccount(),
|
|
834
|
-
token1Mint: getNextAccount(),
|
|
835
|
-
user0: getNextAccount(),
|
|
836
|
-
user1: getNextAccount(),
|
|
837
|
-
token0Program: getNextAccount(),
|
|
838
|
-
token1Program: getNextAccount(),
|
|
839
|
-
oracle: getNextOptionalAccount()
|
|
840
|
-
},
|
|
841
|
-
data: getAddLiquidityInstructionDataDecoder().decode(instruction.data)
|
|
842
|
-
};
|
|
843
|
-
}
|
|
844
|
-
var CLOSE_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
845
|
-
123,
|
|
846
|
-
134,
|
|
847
|
-
81,
|
|
848
|
-
0,
|
|
849
|
-
49,
|
|
850
|
-
68,
|
|
851
|
-
98,
|
|
852
|
-
98
|
|
853
|
-
]);
|
|
854
|
-
function getClosePositionDiscriminatorBytes() {
|
|
855
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
856
|
-
CLOSE_POSITION_DISCRIMINATOR
|
|
857
|
-
);
|
|
858
|
-
}
|
|
859
|
-
function getClosePositionInstructionDataEncoder() {
|
|
860
|
-
return kit.transformEncoder(
|
|
861
|
-
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
862
|
-
(value) => ({ ...value, discriminator: CLOSE_POSITION_DISCRIMINATOR })
|
|
863
|
-
);
|
|
864
|
-
}
|
|
865
|
-
function getClosePositionInstructionDataDecoder() {
|
|
866
|
-
return kit.getStructDecoder([
|
|
867
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
|
|
868
|
-
]);
|
|
869
|
-
}
|
|
870
|
-
function getClosePositionInstructionDataCodec() {
|
|
871
|
-
return kit.combineCodec(
|
|
872
|
-
getClosePositionInstructionDataEncoder(),
|
|
873
|
-
getClosePositionInstructionDataDecoder()
|
|
874
|
-
);
|
|
875
|
-
}
|
|
876
|
-
function getClosePositionInstruction(input, config) {
|
|
877
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
878
|
-
const originalAccounts = {
|
|
879
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
880
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
881
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
882
|
-
rentRecipient: { value: input.rentRecipient ?? null, isWritable: true }
|
|
883
|
-
};
|
|
884
|
-
const accounts = originalAccounts;
|
|
885
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
886
|
-
return Object.freeze({
|
|
887
|
-
accounts: [
|
|
888
|
-
getAccountMeta("pool", accounts.pool),
|
|
889
|
-
getAccountMeta("position", accounts.position),
|
|
890
|
-
getAccountMeta("owner", accounts.owner),
|
|
891
|
-
getAccountMeta("rentRecipient", accounts.rentRecipient)
|
|
892
|
-
],
|
|
893
|
-
data: getClosePositionInstructionDataEncoder().encode({}),
|
|
894
|
-
programAddress
|
|
895
|
-
});
|
|
896
|
-
}
|
|
897
|
-
function parseClosePositionInstruction(instruction) {
|
|
898
|
-
if (instruction.accounts.length < 4) {
|
|
899
|
-
throw new kit.SolanaError(
|
|
900
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
901
|
-
{
|
|
902
|
-
actualAccountMetas: instruction.accounts.length,
|
|
903
|
-
expectedAccountMetas: 4
|
|
904
|
-
}
|
|
905
|
-
);
|
|
906
|
-
}
|
|
907
|
-
let accountIndex = 0;
|
|
908
|
-
const getNextAccount = () => {
|
|
909
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
910
|
-
accountIndex += 1;
|
|
911
|
-
return accountMeta;
|
|
912
|
-
};
|
|
913
|
-
return {
|
|
914
|
-
programAddress: instruction.programAddress,
|
|
915
|
-
accounts: {
|
|
916
|
-
pool: getNextAccount(),
|
|
917
|
-
position: getNextAccount(),
|
|
918
|
-
owner: getNextAccount(),
|
|
919
|
-
rentRecipient: getNextAccount()
|
|
920
|
-
},
|
|
921
|
-
data: getClosePositionInstructionDataDecoder().decode(instruction.data)
|
|
922
|
-
};
|
|
923
|
-
}
|
|
924
|
-
var COLLECT_FEES_DISCRIMINATOR = new Uint8Array([
|
|
925
|
-
164,
|
|
926
|
-
152,
|
|
927
|
-
207,
|
|
928
|
-
99,
|
|
929
|
-
30,
|
|
930
|
-
186,
|
|
931
|
-
19,
|
|
932
|
-
182
|
|
933
|
-
]);
|
|
934
|
-
function getCollectFeesDiscriminatorBytes() {
|
|
935
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
936
|
-
COLLECT_FEES_DISCRIMINATOR
|
|
937
|
-
);
|
|
938
|
-
}
|
|
939
|
-
function getCollectFeesInstructionDataEncoder() {
|
|
940
|
-
return kit.transformEncoder(
|
|
941
|
-
kit.getStructEncoder([
|
|
942
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
943
|
-
["max0", kit.getU64Encoder()],
|
|
944
|
-
["max1", kit.getU64Encoder()]
|
|
945
|
-
]),
|
|
946
|
-
(value) => ({ ...value, discriminator: COLLECT_FEES_DISCRIMINATOR })
|
|
947
|
-
);
|
|
948
|
-
}
|
|
949
|
-
function getCollectFeesInstructionDataDecoder() {
|
|
950
|
-
return kit.getStructDecoder([
|
|
951
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
952
|
-
["max0", kit.getU64Decoder()],
|
|
953
|
-
["max1", kit.getU64Decoder()]
|
|
954
|
-
]);
|
|
955
|
-
}
|
|
956
|
-
function getCollectFeesInstructionDataCodec() {
|
|
957
|
-
return kit.combineCodec(
|
|
958
|
-
getCollectFeesInstructionDataEncoder(),
|
|
959
|
-
getCollectFeesInstructionDataDecoder()
|
|
960
|
-
);
|
|
961
|
-
}
|
|
962
|
-
async function getCollectFeesInstructionAsync(input, config) {
|
|
963
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
964
|
-
const originalAccounts = {
|
|
965
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
966
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
967
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
968
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
969
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
970
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
971
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
972
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
973
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
974
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
975
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
976
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
977
|
-
};
|
|
978
|
-
const accounts = originalAccounts;
|
|
979
|
-
const args = { ...input };
|
|
980
|
-
if (!accounts.authority.value) {
|
|
981
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
982
|
-
programAddress,
|
|
983
|
-
seeds: [
|
|
984
|
-
kit.getBytesEncoder().encode(
|
|
985
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
986
|
-
),
|
|
987
|
-
kit.getAddressEncoder().encode(
|
|
988
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
989
|
-
)
|
|
990
|
-
]
|
|
991
|
-
});
|
|
992
|
-
}
|
|
993
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
994
|
-
return Object.freeze({
|
|
995
|
-
accounts: [
|
|
996
|
-
getAccountMeta("pool", accounts.pool),
|
|
997
|
-
getAccountMeta("position", accounts.position),
|
|
998
|
-
getAccountMeta("owner", accounts.owner),
|
|
999
|
-
getAccountMeta("authority", accounts.authority),
|
|
1000
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1001
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1002
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1003
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1004
|
-
getAccountMeta("user0", accounts.user0),
|
|
1005
|
-
getAccountMeta("user1", accounts.user1),
|
|
1006
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1007
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
1008
|
-
],
|
|
1009
|
-
data: getCollectFeesInstructionDataEncoder().encode(
|
|
1010
|
-
args
|
|
1011
|
-
),
|
|
1012
|
-
programAddress
|
|
1013
|
-
});
|
|
1014
|
-
}
|
|
1015
|
-
function getCollectFeesInstruction(input, config) {
|
|
1016
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1017
|
-
const originalAccounts = {
|
|
1018
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
1019
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
1020
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
1021
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1022
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
1023
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
1024
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
1025
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
1026
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
1027
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
1028
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
1029
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
1030
|
-
};
|
|
1031
|
-
const accounts = originalAccounts;
|
|
1032
|
-
const args = { ...input };
|
|
1033
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1034
|
-
return Object.freeze({
|
|
1035
|
-
accounts: [
|
|
1036
|
-
getAccountMeta("pool", accounts.pool),
|
|
1037
|
-
getAccountMeta("position", accounts.position),
|
|
1038
|
-
getAccountMeta("owner", accounts.owner),
|
|
1039
|
-
getAccountMeta("authority", accounts.authority),
|
|
1040
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1041
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1042
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1043
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1044
|
-
getAccountMeta("user0", accounts.user0),
|
|
1045
|
-
getAccountMeta("user1", accounts.user1),
|
|
1046
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1047
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
1048
|
-
],
|
|
1049
|
-
data: getCollectFeesInstructionDataEncoder().encode(
|
|
1050
|
-
args
|
|
1051
|
-
),
|
|
1052
|
-
programAddress
|
|
1053
|
-
});
|
|
1054
|
-
}
|
|
1055
|
-
function parseCollectFeesInstruction(instruction) {
|
|
1056
|
-
if (instruction.accounts.length < 12) {
|
|
1057
|
-
throw new kit.SolanaError(
|
|
1058
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1059
|
-
{
|
|
1060
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1061
|
-
expectedAccountMetas: 12
|
|
1062
|
-
}
|
|
1063
|
-
);
|
|
1064
|
-
}
|
|
1065
|
-
let accountIndex = 0;
|
|
1066
|
-
const getNextAccount = () => {
|
|
1067
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1068
|
-
accountIndex += 1;
|
|
1069
|
-
return accountMeta;
|
|
1070
|
-
};
|
|
1071
|
-
return {
|
|
1072
|
-
programAddress: instruction.programAddress,
|
|
1073
|
-
accounts: {
|
|
1074
|
-
pool: getNextAccount(),
|
|
1075
|
-
position: getNextAccount(),
|
|
1076
|
-
owner: getNextAccount(),
|
|
1077
|
-
authority: getNextAccount(),
|
|
1078
|
-
vault0: getNextAccount(),
|
|
1079
|
-
vault1: getNextAccount(),
|
|
1080
|
-
token0Mint: getNextAccount(),
|
|
1081
|
-
token1Mint: getNextAccount(),
|
|
1082
|
-
user0: getNextAccount(),
|
|
1083
|
-
user1: getNextAccount(),
|
|
1084
|
-
token0Program: getNextAccount(),
|
|
1085
|
-
token1Program: getNextAccount()
|
|
1086
|
-
},
|
|
1087
|
-
data: getCollectFeesInstructionDataDecoder().decode(instruction.data)
|
|
1088
|
-
};
|
|
1089
|
-
}
|
|
1090
|
-
var COLLECT_PROTOCOL_FEES_DISCRIMINATOR = new Uint8Array([
|
|
1091
|
-
22,
|
|
1092
|
-
67,
|
|
1093
|
-
23,
|
|
1094
|
-
98,
|
|
1095
|
-
150,
|
|
1096
|
-
178,
|
|
1097
|
-
70,
|
|
1098
|
-
220
|
|
1099
|
-
]);
|
|
1100
|
-
function getCollectProtocolFeesDiscriminatorBytes() {
|
|
1101
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1102
|
-
COLLECT_PROTOCOL_FEES_DISCRIMINATOR
|
|
1103
|
-
);
|
|
1104
|
-
}
|
|
1105
|
-
function getCollectProtocolFeesInstructionDataEncoder() {
|
|
1106
|
-
return kit.transformEncoder(
|
|
1107
|
-
kit.getStructEncoder([
|
|
1108
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1109
|
-
["max0", kit.getU64Encoder()],
|
|
1110
|
-
["max1", kit.getU64Encoder()]
|
|
1111
|
-
]),
|
|
1112
|
-
(value) => ({
|
|
1113
|
-
...value,
|
|
1114
|
-
discriminator: COLLECT_PROTOCOL_FEES_DISCRIMINATOR
|
|
1115
|
-
})
|
|
1116
|
-
);
|
|
1117
|
-
}
|
|
1118
|
-
function getCollectProtocolFeesInstructionDataDecoder() {
|
|
1119
|
-
return kit.getStructDecoder([
|
|
1120
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1121
|
-
["max0", kit.getU64Decoder()],
|
|
1122
|
-
["max1", kit.getU64Decoder()]
|
|
1123
|
-
]);
|
|
1124
|
-
}
|
|
1125
|
-
function getCollectProtocolFeesInstructionDataCodec() {
|
|
1126
|
-
return kit.combineCodec(
|
|
1127
|
-
getCollectProtocolFeesInstructionDataEncoder(),
|
|
1128
|
-
getCollectProtocolFeesInstructionDataDecoder()
|
|
1129
|
-
);
|
|
1130
|
-
}
|
|
1131
|
-
async function getCollectProtocolFeesInstructionAsync(input, config) {
|
|
1132
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1133
|
-
const originalAccounts = {
|
|
1134
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1135
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
1136
|
-
protocolFeePosition: {
|
|
1137
|
-
value: input.protocolFeePosition ?? null,
|
|
1138
|
-
isWritable: true
|
|
1139
|
-
},
|
|
1140
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
1141
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1142
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
1143
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
1144
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
1145
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
1146
|
-
recipient0: { value: input.recipient0 ?? null, isWritable: true },
|
|
1147
|
-
recipient1: { value: input.recipient1 ?? null, isWritable: true },
|
|
1148
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
1149
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
1150
|
-
};
|
|
1151
|
-
const accounts = originalAccounts;
|
|
1152
|
-
const args = { ...input };
|
|
1153
|
-
if (!accounts.authority.value) {
|
|
1154
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
1155
|
-
programAddress,
|
|
1156
|
-
seeds: [
|
|
1157
|
-
kit.getBytesEncoder().encode(
|
|
1158
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1159
|
-
),
|
|
1160
|
-
kit.getAddressEncoder().encode(
|
|
1161
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1162
|
-
)
|
|
1163
|
-
]
|
|
1164
|
-
});
|
|
1165
|
-
}
|
|
1166
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1167
|
-
return Object.freeze({
|
|
1168
|
-
accounts: [
|
|
1169
|
-
getAccountMeta("config", accounts.config),
|
|
1170
|
-
getAccountMeta("pool", accounts.pool),
|
|
1171
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
1172
|
-
getAccountMeta("admin", accounts.admin),
|
|
1173
|
-
getAccountMeta("authority", accounts.authority),
|
|
1174
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1175
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1176
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1177
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1178
|
-
getAccountMeta("recipient0", accounts.recipient0),
|
|
1179
|
-
getAccountMeta("recipient1", accounts.recipient1),
|
|
1180
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1181
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
1182
|
-
],
|
|
1183
|
-
data: getCollectProtocolFeesInstructionDataEncoder().encode(
|
|
1184
|
-
args
|
|
1185
|
-
),
|
|
1186
|
-
programAddress
|
|
1187
|
-
});
|
|
1188
|
-
}
|
|
1189
|
-
function getCollectProtocolFeesInstruction(input, config) {
|
|
1190
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1191
|
-
const originalAccounts = {
|
|
1192
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1193
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
1194
|
-
protocolFeePosition: {
|
|
1195
|
-
value: input.protocolFeePosition ?? null,
|
|
1196
|
-
isWritable: true
|
|
1197
|
-
},
|
|
1198
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
1199
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1200
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
1201
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
1202
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
1203
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
1204
|
-
recipient0: { value: input.recipient0 ?? null, isWritable: true },
|
|
1205
|
-
recipient1: { value: input.recipient1 ?? null, isWritable: true },
|
|
1206
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
1207
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
1208
|
-
};
|
|
1209
|
-
const accounts = originalAccounts;
|
|
1210
|
-
const args = { ...input };
|
|
1211
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1212
|
-
return Object.freeze({
|
|
1213
|
-
accounts: [
|
|
1214
|
-
getAccountMeta("config", accounts.config),
|
|
1215
|
-
getAccountMeta("pool", accounts.pool),
|
|
1216
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
1217
|
-
getAccountMeta("admin", accounts.admin),
|
|
1218
|
-
getAccountMeta("authority", accounts.authority),
|
|
1219
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1220
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1221
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1222
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1223
|
-
getAccountMeta("recipient0", accounts.recipient0),
|
|
1224
|
-
getAccountMeta("recipient1", accounts.recipient1),
|
|
1225
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1226
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
1227
|
-
],
|
|
1228
|
-
data: getCollectProtocolFeesInstructionDataEncoder().encode(
|
|
1229
|
-
args
|
|
1230
|
-
),
|
|
1231
|
-
programAddress
|
|
1232
|
-
});
|
|
1233
|
-
}
|
|
1234
|
-
function parseCollectProtocolFeesInstruction(instruction) {
|
|
1235
|
-
if (instruction.accounts.length < 13) {
|
|
1236
|
-
throw new kit.SolanaError(
|
|
1237
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1238
|
-
{
|
|
1239
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1240
|
-
expectedAccountMetas: 13
|
|
1241
|
-
}
|
|
1242
|
-
);
|
|
1243
|
-
}
|
|
1244
|
-
let accountIndex = 0;
|
|
1245
|
-
const getNextAccount = () => {
|
|
1246
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1247
|
-
accountIndex += 1;
|
|
1248
|
-
return accountMeta;
|
|
1249
|
-
};
|
|
1250
|
-
return {
|
|
1251
|
-
programAddress: instruction.programAddress,
|
|
1252
|
-
accounts: {
|
|
1253
|
-
config: getNextAccount(),
|
|
1254
|
-
pool: getNextAccount(),
|
|
1255
|
-
protocolFeePosition: getNextAccount(),
|
|
1256
|
-
admin: getNextAccount(),
|
|
1257
|
-
authority: getNextAccount(),
|
|
1258
|
-
vault0: getNextAccount(),
|
|
1259
|
-
vault1: getNextAccount(),
|
|
1260
|
-
token0Mint: getNextAccount(),
|
|
1261
|
-
token1Mint: getNextAccount(),
|
|
1262
|
-
recipient0: getNextAccount(),
|
|
1263
|
-
recipient1: getNextAccount(),
|
|
1264
|
-
token0Program: getNextAccount(),
|
|
1265
|
-
token1Program: getNextAccount()
|
|
1266
|
-
},
|
|
1267
|
-
data: getCollectProtocolFeesInstructionDataDecoder().decode(
|
|
1268
|
-
instruction.data
|
|
1269
|
-
)
|
|
1270
|
-
};
|
|
1271
|
-
}
|
|
1272
|
-
var CREATE_POSITION_DISCRIMINATOR = new Uint8Array([
|
|
1273
|
-
48,
|
|
1274
|
-
215,
|
|
1275
|
-
197,
|
|
1276
|
-
153,
|
|
1277
|
-
96,
|
|
1278
|
-
203,
|
|
1279
|
-
180,
|
|
1280
|
-
133
|
|
1281
|
-
]);
|
|
1282
|
-
function getCreatePositionDiscriminatorBytes() {
|
|
1283
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1284
|
-
CREATE_POSITION_DISCRIMINATOR
|
|
1285
|
-
);
|
|
1286
|
-
}
|
|
1287
|
-
function getCreatePositionInstructionDataEncoder() {
|
|
1288
|
-
return kit.transformEncoder(
|
|
1289
|
-
kit.getStructEncoder([
|
|
1290
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1291
|
-
["positionId", kit.getU64Encoder()]
|
|
1292
|
-
]),
|
|
1293
|
-
(value) => ({ ...value, discriminator: CREATE_POSITION_DISCRIMINATOR })
|
|
1294
|
-
);
|
|
1295
|
-
}
|
|
1296
|
-
function getCreatePositionInstructionDataDecoder() {
|
|
1297
|
-
return kit.getStructDecoder([
|
|
1298
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1299
|
-
["positionId", kit.getU64Decoder()]
|
|
1300
|
-
]);
|
|
1301
|
-
}
|
|
1302
|
-
function getCreatePositionInstructionDataCodec() {
|
|
1303
|
-
return kit.combineCodec(
|
|
1304
|
-
getCreatePositionInstructionDataEncoder(),
|
|
1305
|
-
getCreatePositionInstructionDataDecoder()
|
|
1306
|
-
);
|
|
1307
|
-
}
|
|
1308
|
-
async function getCreatePositionInstructionAsync(input, config) {
|
|
1309
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1310
|
-
const originalAccounts = {
|
|
1311
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
1312
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
1313
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
1314
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1315
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1316
|
-
};
|
|
1317
|
-
const accounts = originalAccounts;
|
|
1318
|
-
const args = { ...input };
|
|
1319
|
-
if (!accounts.position.value) {
|
|
1320
|
-
accounts.position.value = await kit.getProgramDerivedAddress({
|
|
1321
|
-
programAddress,
|
|
1322
|
-
seeds: [
|
|
1323
|
-
kit.getBytesEncoder().encode(
|
|
1324
|
-
new Uint8Array([112, 111, 115, 105, 116, 105, 111, 110])
|
|
1325
|
-
),
|
|
1326
|
-
kit.getAddressEncoder().encode(
|
|
1327
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1328
|
-
),
|
|
1329
|
-
kit.getAddressEncoder().encode(
|
|
1330
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
1331
|
-
"owner",
|
|
1332
|
-
accounts.owner.value
|
|
1333
|
-
)
|
|
1334
|
-
),
|
|
1335
|
-
kit.getU64Encoder().encode(
|
|
1336
|
-
programClientCore.getNonNullResolvedInstructionInput("positionId", args.positionId)
|
|
1337
|
-
)
|
|
1338
|
-
]
|
|
1339
|
-
});
|
|
1340
|
-
}
|
|
1341
|
-
if (!accounts.systemProgram.value) {
|
|
1342
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1343
|
-
}
|
|
1344
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1345
|
-
return Object.freeze({
|
|
1346
|
-
accounts: [
|
|
1347
|
-
getAccountMeta("pool", accounts.pool),
|
|
1348
|
-
getAccountMeta("position", accounts.position),
|
|
1349
|
-
getAccountMeta("owner", accounts.owner),
|
|
1350
|
-
getAccountMeta("payer", accounts.payer),
|
|
1351
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1352
|
-
],
|
|
1353
|
-
data: getCreatePositionInstructionDataEncoder().encode(
|
|
1354
|
-
args
|
|
1355
|
-
),
|
|
1356
|
-
programAddress
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
function getCreatePositionInstruction(input, config) {
|
|
1360
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1361
|
-
const originalAccounts = {
|
|
1362
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
1363
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
1364
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
1365
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1366
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1367
|
-
};
|
|
1368
|
-
const accounts = originalAccounts;
|
|
1369
|
-
const args = { ...input };
|
|
1370
|
-
if (!accounts.systemProgram.value) {
|
|
1371
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1372
|
-
}
|
|
1373
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1374
|
-
return Object.freeze({
|
|
1375
|
-
accounts: [
|
|
1376
|
-
getAccountMeta("pool", accounts.pool),
|
|
1377
|
-
getAccountMeta("position", accounts.position),
|
|
1378
|
-
getAccountMeta("owner", accounts.owner),
|
|
1379
|
-
getAccountMeta("payer", accounts.payer),
|
|
1380
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1381
|
-
],
|
|
1382
|
-
data: getCreatePositionInstructionDataEncoder().encode(
|
|
1383
|
-
args
|
|
1384
|
-
),
|
|
1385
|
-
programAddress
|
|
1386
|
-
});
|
|
1387
|
-
}
|
|
1388
|
-
function parseCreatePositionInstruction(instruction) {
|
|
1389
|
-
if (instruction.accounts.length < 5) {
|
|
1390
|
-
throw new kit.SolanaError(
|
|
1391
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1392
|
-
{
|
|
1393
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1394
|
-
expectedAccountMetas: 5
|
|
1395
|
-
}
|
|
1396
|
-
);
|
|
1397
|
-
}
|
|
1398
|
-
let accountIndex = 0;
|
|
1399
|
-
const getNextAccount = () => {
|
|
1400
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1401
|
-
accountIndex += 1;
|
|
1402
|
-
return accountMeta;
|
|
1403
|
-
};
|
|
1404
|
-
return {
|
|
1405
|
-
programAddress: instruction.programAddress,
|
|
1406
|
-
accounts: {
|
|
1407
|
-
pool: getNextAccount(),
|
|
1408
|
-
position: getNextAccount(),
|
|
1409
|
-
owner: getNextAccount(),
|
|
1410
|
-
payer: getNextAccount(),
|
|
1411
|
-
systemProgram: getNextAccount()
|
|
1412
|
-
},
|
|
1413
|
-
data: getCreatePositionInstructionDataDecoder().decode(instruction.data)
|
|
1414
|
-
};
|
|
1415
|
-
}
|
|
1416
|
-
var INITIALIZE_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
1417
|
-
208,
|
|
1418
|
-
127,
|
|
1419
|
-
21,
|
|
1420
|
-
1,
|
|
1421
|
-
194,
|
|
1422
|
-
190,
|
|
1423
|
-
196,
|
|
1424
|
-
70
|
|
1425
|
-
]);
|
|
1426
|
-
function getInitializeConfigDiscriminatorBytes() {
|
|
1427
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1428
|
-
INITIALIZE_CONFIG_DISCRIMINATOR
|
|
1429
|
-
);
|
|
1430
|
-
}
|
|
1431
|
-
function getInitializeConfigInstructionDataEncoder() {
|
|
1432
|
-
return kit.transformEncoder(
|
|
1433
|
-
kit.getStructEncoder([
|
|
1434
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1435
|
-
["admin", kit.getAddressEncoder()],
|
|
1436
|
-
["numeraireMint", kit.getAddressEncoder()],
|
|
1437
|
-
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
1438
|
-
["maxFeeSplitBps", kit.getU16Encoder()],
|
|
1439
|
-
["maxRouteHops", kit.getU8Encoder()],
|
|
1440
|
-
["protocolFeeEnabled", kit.getBooleanEncoder()],
|
|
1441
|
-
["protocolFeeBps", kit.getU16Encoder()],
|
|
1442
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
1443
|
-
]),
|
|
1444
|
-
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR })
|
|
1445
|
-
);
|
|
1446
|
-
}
|
|
1447
|
-
function getInitializeConfigInstructionDataDecoder() {
|
|
1448
|
-
return kit.getStructDecoder([
|
|
1449
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1450
|
-
["admin", kit.getAddressDecoder()],
|
|
1451
|
-
["numeraireMint", kit.getAddressDecoder()],
|
|
1452
|
-
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
1453
|
-
["maxFeeSplitBps", kit.getU16Decoder()],
|
|
1454
|
-
["maxRouteHops", kit.getU8Decoder()],
|
|
1455
|
-
["protocolFeeEnabled", kit.getBooleanDecoder()],
|
|
1456
|
-
["protocolFeeBps", kit.getU16Decoder()],
|
|
1457
|
-
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
1458
|
-
]);
|
|
1459
|
-
}
|
|
1460
|
-
function getInitializeConfigInstructionDataCodec() {
|
|
1461
|
-
return kit.combineCodec(
|
|
1462
|
-
getInitializeConfigInstructionDataEncoder(),
|
|
1463
|
-
getInitializeConfigInstructionDataDecoder()
|
|
1464
|
-
);
|
|
1465
|
-
}
|
|
1466
|
-
async function getInitializeConfigInstructionAsync(input, config) {
|
|
1467
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1468
|
-
const originalAccounts = {
|
|
1469
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
1470
|
-
programData: { value: input.programData ?? null, isWritable: false },
|
|
1471
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1472
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1473
|
-
};
|
|
1474
|
-
const accounts = originalAccounts;
|
|
1475
|
-
const args = { ...input };
|
|
1476
|
-
if (!accounts.config.value) {
|
|
1477
|
-
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
1478
|
-
programAddress,
|
|
1479
|
-
seeds: [
|
|
1480
|
-
kit.getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
|
|
1481
|
-
]
|
|
1482
|
-
});
|
|
1483
|
-
}
|
|
1484
|
-
if (!accounts.systemProgram.value) {
|
|
1485
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1486
|
-
}
|
|
1487
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1488
|
-
return Object.freeze({
|
|
1489
|
-
accounts: [
|
|
1490
|
-
getAccountMeta("config", accounts.config),
|
|
1491
|
-
getAccountMeta("programData", accounts.programData),
|
|
1492
|
-
getAccountMeta("payer", accounts.payer),
|
|
1493
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1494
|
-
],
|
|
1495
|
-
data: getInitializeConfigInstructionDataEncoder().encode(
|
|
1496
|
-
args
|
|
1497
|
-
),
|
|
1498
|
-
programAddress
|
|
1499
|
-
});
|
|
1500
|
-
}
|
|
1501
|
-
function getInitializeConfigInstruction(input, config) {
|
|
1502
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1503
|
-
const originalAccounts = {
|
|
1504
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
1505
|
-
programData: { value: input.programData ?? null, isWritable: false },
|
|
1506
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1507
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1508
|
-
};
|
|
1509
|
-
const accounts = originalAccounts;
|
|
1510
|
-
const args = { ...input };
|
|
1511
|
-
if (!accounts.systemProgram.value) {
|
|
1512
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1513
|
-
}
|
|
1514
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1515
|
-
return Object.freeze({
|
|
1516
|
-
accounts: [
|
|
1517
|
-
getAccountMeta("config", accounts.config),
|
|
1518
|
-
getAccountMeta("programData", accounts.programData),
|
|
1519
|
-
getAccountMeta("payer", accounts.payer),
|
|
1520
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1521
|
-
],
|
|
1522
|
-
data: getInitializeConfigInstructionDataEncoder().encode(
|
|
1523
|
-
args
|
|
1524
|
-
),
|
|
1525
|
-
programAddress
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
|
-
function parseInitializeConfigInstruction(instruction) {
|
|
1529
|
-
if (instruction.accounts.length < 4) {
|
|
1530
|
-
throw new kit.SolanaError(
|
|
1531
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1532
|
-
{
|
|
1533
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1534
|
-
expectedAccountMetas: 4
|
|
1535
|
-
}
|
|
1536
|
-
);
|
|
1537
|
-
}
|
|
1538
|
-
let accountIndex = 0;
|
|
1539
|
-
const getNextAccount = () => {
|
|
1540
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1541
|
-
accountIndex += 1;
|
|
1542
|
-
return accountMeta;
|
|
1543
|
-
};
|
|
1544
|
-
return {
|
|
1545
|
-
programAddress: instruction.programAddress,
|
|
1546
|
-
accounts: {
|
|
1547
|
-
config: getNextAccount(),
|
|
1548
|
-
programData: getNextAccount(),
|
|
1549
|
-
payer: getNextAccount(),
|
|
1550
|
-
systemProgram: getNextAccount()
|
|
1551
|
-
},
|
|
1552
|
-
data: getInitializeConfigInstructionDataDecoder().decode(instruction.data)
|
|
1553
|
-
};
|
|
1554
|
-
}
|
|
1555
|
-
var INITIALIZE_ORACLE_DISCRIMINATOR = new Uint8Array([
|
|
1556
|
-
144,
|
|
1557
|
-
223,
|
|
1558
|
-
131,
|
|
1559
|
-
120,
|
|
1560
|
-
196,
|
|
1561
|
-
253,
|
|
1562
|
-
181,
|
|
1563
|
-
99
|
|
1564
|
-
]);
|
|
1565
|
-
function getInitializeOracleDiscriminatorBytes() {
|
|
1566
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1567
|
-
INITIALIZE_ORACLE_DISCRIMINATOR
|
|
1568
|
-
);
|
|
1569
|
-
}
|
|
1570
|
-
function getInitializeOracleInstructionDataEncoder() {
|
|
1571
|
-
return kit.transformEncoder(
|
|
1572
|
-
kit.getStructEncoder([
|
|
1573
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1574
|
-
["maxPriceChangeRatioQ64", kit.getU128Encoder()],
|
|
1575
|
-
["observationIntervalSec", kit.getU32Encoder()]
|
|
1576
|
-
]),
|
|
1577
|
-
(value) => ({ ...value, discriminator: INITIALIZE_ORACLE_DISCRIMINATOR })
|
|
1578
|
-
);
|
|
1579
|
-
}
|
|
1580
|
-
function getInitializeOracleInstructionDataDecoder() {
|
|
1581
|
-
return kit.getStructDecoder([
|
|
1582
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1583
|
-
["maxPriceChangeRatioQ64", kit.getU128Decoder()],
|
|
1584
|
-
["observationIntervalSec", kit.getU32Decoder()]
|
|
1585
|
-
]);
|
|
1586
|
-
}
|
|
1587
|
-
function getInitializeOracleInstructionDataCodec() {
|
|
1588
|
-
return kit.combineCodec(
|
|
1589
|
-
getInitializeOracleInstructionDataEncoder(),
|
|
1590
|
-
getInitializeOracleInstructionDataDecoder()
|
|
1591
|
-
);
|
|
1592
|
-
}
|
|
1593
|
-
async function getInitializeOracleInstructionAsync(input, config) {
|
|
1594
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1595
|
-
const originalAccounts = {
|
|
1596
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1597
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
1598
|
-
oracle: { value: input.oracle ?? null, isWritable: true },
|
|
1599
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
1600
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1601
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1602
|
-
};
|
|
1603
|
-
const accounts = originalAccounts;
|
|
1604
|
-
const args = { ...input };
|
|
1605
|
-
if (!accounts.oracle.value) {
|
|
1606
|
-
accounts.oracle.value = await kit.getProgramDerivedAddress({
|
|
1607
|
-
programAddress,
|
|
1608
|
-
seeds: [
|
|
1609
|
-
kit.getBytesEncoder().encode(new Uint8Array([111, 114, 97, 99, 108, 101])),
|
|
1610
|
-
kit.getAddressEncoder().encode(
|
|
1611
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1612
|
-
)
|
|
1613
|
-
]
|
|
1614
|
-
});
|
|
1615
|
-
}
|
|
1616
|
-
if (!accounts.systemProgram.value) {
|
|
1617
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1618
|
-
}
|
|
1619
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1620
|
-
return Object.freeze({
|
|
1621
|
-
accounts: [
|
|
1622
|
-
getAccountMeta("config", accounts.config),
|
|
1623
|
-
getAccountMeta("pool", accounts.pool),
|
|
1624
|
-
getAccountMeta("oracle", accounts.oracle),
|
|
1625
|
-
getAccountMeta("admin", accounts.admin),
|
|
1626
|
-
getAccountMeta("payer", accounts.payer),
|
|
1627
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1628
|
-
],
|
|
1629
|
-
data: getInitializeOracleInstructionDataEncoder().encode(
|
|
1630
|
-
args
|
|
1631
|
-
),
|
|
1632
|
-
programAddress
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
function getInitializeOracleInstruction(input, config) {
|
|
1636
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1637
|
-
const originalAccounts = {
|
|
1638
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1639
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
1640
|
-
oracle: { value: input.oracle ?? null, isWritable: true },
|
|
1641
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
1642
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1643
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1644
|
-
};
|
|
1645
|
-
const accounts = originalAccounts;
|
|
1646
|
-
const args = { ...input };
|
|
1647
|
-
if (!accounts.systemProgram.value) {
|
|
1648
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1649
|
-
}
|
|
1650
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1651
|
-
return Object.freeze({
|
|
1652
|
-
accounts: [
|
|
1653
|
-
getAccountMeta("config", accounts.config),
|
|
1654
|
-
getAccountMeta("pool", accounts.pool),
|
|
1655
|
-
getAccountMeta("oracle", accounts.oracle),
|
|
1656
|
-
getAccountMeta("admin", accounts.admin),
|
|
1657
|
-
getAccountMeta("payer", accounts.payer),
|
|
1658
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1659
|
-
],
|
|
1660
|
-
data: getInitializeOracleInstructionDataEncoder().encode(
|
|
1661
|
-
args
|
|
1662
|
-
),
|
|
1663
|
-
programAddress
|
|
1664
|
-
});
|
|
1665
|
-
}
|
|
1666
|
-
function parseInitializeOracleInstruction(instruction) {
|
|
1667
|
-
if (instruction.accounts.length < 6) {
|
|
1668
|
-
throw new kit.SolanaError(
|
|
1669
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1670
|
-
{
|
|
1671
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1672
|
-
expectedAccountMetas: 6
|
|
1673
|
-
}
|
|
1674
|
-
);
|
|
1675
|
-
}
|
|
1676
|
-
let accountIndex = 0;
|
|
1677
|
-
const getNextAccount = () => {
|
|
1678
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1679
|
-
accountIndex += 1;
|
|
1680
|
-
return accountMeta;
|
|
1681
|
-
};
|
|
1682
|
-
return {
|
|
1683
|
-
programAddress: instruction.programAddress,
|
|
1684
|
-
accounts: {
|
|
1685
|
-
config: getNextAccount(),
|
|
1686
|
-
pool: getNextAccount(),
|
|
1687
|
-
oracle: getNextAccount(),
|
|
1688
|
-
admin: getNextAccount(),
|
|
1689
|
-
payer: getNextAccount(),
|
|
1690
|
-
systemProgram: getNextAccount()
|
|
1691
|
-
},
|
|
1692
|
-
data: getInitializeOracleInstructionDataDecoder().decode(instruction.data)
|
|
1693
|
-
};
|
|
1694
|
-
}
|
|
1695
|
-
var INITIALIZE_POOL_DISCRIMINATOR = new Uint8Array([
|
|
1696
|
-
95,
|
|
1697
|
-
180,
|
|
1698
|
-
10,
|
|
1699
|
-
172,
|
|
1700
|
-
84,
|
|
1701
|
-
174,
|
|
1702
|
-
232,
|
|
1703
|
-
40
|
|
1704
|
-
]);
|
|
1705
|
-
function getInitializePoolDiscriminatorBytes() {
|
|
1706
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1707
|
-
INITIALIZE_POOL_DISCRIMINATOR
|
|
1708
|
-
);
|
|
1709
|
-
}
|
|
1710
|
-
function getInitializePoolInstructionDataEncoder() {
|
|
1711
|
-
return kit.transformEncoder(
|
|
1712
|
-
kit.getStructEncoder([
|
|
1713
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1714
|
-
["mintA", kit.getAddressEncoder()],
|
|
1715
|
-
["mintB", kit.getAddressEncoder()],
|
|
1716
|
-
["initialSwapFeeBps", kit.getU16Encoder()],
|
|
1717
|
-
["initialFeeSplitBps", kit.getU16Encoder()],
|
|
1718
|
-
["liquidityMeasureTokenIndex", kit.getU8Encoder()],
|
|
1719
|
-
["numeraireMintOverride", kit.getOptionEncoder(kit.getAddressEncoder())],
|
|
1720
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
1721
|
-
["hookFlags", kit.getU32Encoder()]
|
|
1722
|
-
]),
|
|
1723
|
-
(value) => ({ ...value, discriminator: INITIALIZE_POOL_DISCRIMINATOR })
|
|
1724
|
-
);
|
|
1725
|
-
}
|
|
1726
|
-
function getInitializePoolInstructionDataDecoder() {
|
|
1727
|
-
return kit.getStructDecoder([
|
|
1728
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1729
|
-
["mintA", kit.getAddressDecoder()],
|
|
1730
|
-
["mintB", kit.getAddressDecoder()],
|
|
1731
|
-
["initialSwapFeeBps", kit.getU16Decoder()],
|
|
1732
|
-
["initialFeeSplitBps", kit.getU16Decoder()],
|
|
1733
|
-
["liquidityMeasureTokenIndex", kit.getU8Decoder()],
|
|
1734
|
-
["numeraireMintOverride", kit.getOptionDecoder(kit.getAddressDecoder())],
|
|
1735
|
-
["hookProgram", kit.getAddressDecoder()],
|
|
1736
|
-
["hookFlags", kit.getU32Decoder()]
|
|
1737
|
-
]);
|
|
1738
|
-
}
|
|
1739
|
-
function getInitializePoolInstructionDataCodec() {
|
|
1740
|
-
return kit.combineCodec(
|
|
1741
|
-
getInitializePoolInstructionDataEncoder(),
|
|
1742
|
-
getInitializePoolInstructionDataDecoder()
|
|
1743
|
-
);
|
|
1744
|
-
}
|
|
1745
|
-
async function getInitializePoolInstructionAsync(input, config) {
|
|
1746
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1747
|
-
const originalAccounts = {
|
|
1748
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1749
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
1750
|
-
protocolFeePosition: {
|
|
1751
|
-
value: input.protocolFeePosition ?? null,
|
|
1752
|
-
isWritable: true
|
|
1753
|
-
},
|
|
1754
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1755
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
1756
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
1757
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
1758
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
1759
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1760
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
1761
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
1762
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1763
|
-
rent: { value: input.rent ?? null, isWritable: false },
|
|
1764
|
-
migrationAuthority: {
|
|
1765
|
-
value: input.migrationAuthority ?? null,
|
|
1766
|
-
isWritable: false
|
|
1767
|
-
}
|
|
1768
|
-
};
|
|
1769
|
-
const accounts = originalAccounts;
|
|
1770
|
-
const args = { ...input };
|
|
1771
|
-
if (!accounts.pool.value) {
|
|
1772
|
-
accounts.pool.value = await kit.getProgramDerivedAddress({
|
|
1773
|
-
programAddress,
|
|
1774
|
-
seeds: [
|
|
1775
|
-
kit.getBytesEncoder().encode(new Uint8Array([112, 111, 111, 108])),
|
|
1776
|
-
kit.getAddressEncoder().encode(
|
|
1777
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
1778
|
-
"token0Mint",
|
|
1779
|
-
accounts.token0Mint.value
|
|
1780
|
-
)
|
|
1781
|
-
),
|
|
1782
|
-
kit.getAddressEncoder().encode(
|
|
1783
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
1784
|
-
"token1Mint",
|
|
1785
|
-
accounts.token1Mint.value
|
|
1786
|
-
)
|
|
1787
|
-
)
|
|
1788
|
-
]
|
|
1789
|
-
});
|
|
1790
|
-
}
|
|
1791
|
-
if (!accounts.protocolFeePosition.value) {
|
|
1792
|
-
accounts.protocolFeePosition.value = await kit.getProgramDerivedAddress({
|
|
1793
|
-
programAddress,
|
|
1794
|
-
seeds: [
|
|
1795
|
-
kit.getBytesEncoder().encode(
|
|
1796
|
-
new Uint8Array([
|
|
1797
|
-
112,
|
|
1798
|
-
114,
|
|
1799
|
-
111,
|
|
1800
|
-
116,
|
|
1801
|
-
111,
|
|
1802
|
-
99,
|
|
1803
|
-
111,
|
|
1804
|
-
108,
|
|
1805
|
-
95,
|
|
1806
|
-
112,
|
|
1807
|
-
111,
|
|
1808
|
-
115,
|
|
1809
|
-
105,
|
|
1810
|
-
116,
|
|
1811
|
-
105,
|
|
1812
|
-
111,
|
|
1813
|
-
110
|
|
1814
|
-
])
|
|
1815
|
-
),
|
|
1816
|
-
kit.getAddressEncoder().encode(
|
|
1817
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1818
|
-
)
|
|
1819
|
-
]
|
|
1820
|
-
});
|
|
1821
|
-
}
|
|
1822
|
-
if (!accounts.authority.value) {
|
|
1823
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
1824
|
-
programAddress,
|
|
1825
|
-
seeds: [
|
|
1826
|
-
kit.getBytesEncoder().encode(
|
|
1827
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
1828
|
-
),
|
|
1829
|
-
kit.getAddressEncoder().encode(
|
|
1830
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1831
|
-
)
|
|
1832
|
-
]
|
|
1833
|
-
});
|
|
1834
|
-
}
|
|
1835
|
-
if (!accounts.vault0.value) {
|
|
1836
|
-
accounts.vault0.value = await kit.getProgramDerivedAddress({
|
|
1837
|
-
programAddress,
|
|
1838
|
-
seeds: [
|
|
1839
|
-
kit.getBytesEncoder().encode(new Uint8Array([118, 97, 117, 108, 116, 48])),
|
|
1840
|
-
kit.getAddressEncoder().encode(
|
|
1841
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1842
|
-
)
|
|
1843
|
-
]
|
|
1844
|
-
});
|
|
1845
|
-
}
|
|
1846
|
-
if (!accounts.vault1.value) {
|
|
1847
|
-
accounts.vault1.value = await kit.getProgramDerivedAddress({
|
|
1848
|
-
programAddress,
|
|
1849
|
-
seeds: [
|
|
1850
|
-
kit.getBytesEncoder().encode(new Uint8Array([118, 97, 117, 108, 116, 49])),
|
|
1851
|
-
kit.getAddressEncoder().encode(
|
|
1852
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
1853
|
-
)
|
|
1854
|
-
]
|
|
1855
|
-
});
|
|
1856
|
-
}
|
|
1857
|
-
if (!accounts.systemProgram.value) {
|
|
1858
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1859
|
-
}
|
|
1860
|
-
if (!accounts.rent.value) {
|
|
1861
|
-
accounts.rent.value = "SysvarRent111111111111111111111111111111111";
|
|
1862
|
-
}
|
|
1863
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1864
|
-
return Object.freeze({
|
|
1865
|
-
accounts: [
|
|
1866
|
-
getAccountMeta("config", accounts.config),
|
|
1867
|
-
getAccountMeta("pool", accounts.pool),
|
|
1868
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
1869
|
-
getAccountMeta("authority", accounts.authority),
|
|
1870
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1871
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1872
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1873
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1874
|
-
getAccountMeta("payer", accounts.payer),
|
|
1875
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1876
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
1877
|
-
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1878
|
-
getAccountMeta("rent", accounts.rent),
|
|
1879
|
-
getAccountMeta("migrationAuthority", accounts.migrationAuthority)
|
|
1880
|
-
],
|
|
1881
|
-
data: getInitializePoolInstructionDataEncoder().encode(
|
|
1882
|
-
args
|
|
1883
|
-
),
|
|
1884
|
-
programAddress
|
|
1885
|
-
});
|
|
1886
|
-
}
|
|
1887
|
-
function getInitializePoolInstruction(input, config) {
|
|
1888
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
1889
|
-
const originalAccounts = {
|
|
1890
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1891
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
1892
|
-
protocolFeePosition: {
|
|
1893
|
-
value: input.protocolFeePosition ?? null,
|
|
1894
|
-
isWritable: true
|
|
1895
|
-
},
|
|
1896
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1897
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
1898
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
1899
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
1900
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
1901
|
-
payer: { value: input.payer ?? null, isWritable: true },
|
|
1902
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
1903
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
1904
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
1905
|
-
rent: { value: input.rent ?? null, isWritable: false },
|
|
1906
|
-
migrationAuthority: {
|
|
1907
|
-
value: input.migrationAuthority ?? null,
|
|
1908
|
-
isWritable: false
|
|
1909
|
-
}
|
|
1910
|
-
};
|
|
1911
|
-
const accounts = originalAccounts;
|
|
1912
|
-
const args = { ...input };
|
|
1913
|
-
if (!accounts.systemProgram.value) {
|
|
1914
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1915
|
-
}
|
|
1916
|
-
if (!accounts.rent.value) {
|
|
1917
|
-
accounts.rent.value = "SysvarRent111111111111111111111111111111111";
|
|
1918
|
-
}
|
|
1919
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
1920
|
-
return Object.freeze({
|
|
1921
|
-
accounts: [
|
|
1922
|
-
getAccountMeta("config", accounts.config),
|
|
1923
|
-
getAccountMeta("pool", accounts.pool),
|
|
1924
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
1925
|
-
getAccountMeta("authority", accounts.authority),
|
|
1926
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
1927
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
1928
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
1929
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
1930
|
-
getAccountMeta("payer", accounts.payer),
|
|
1931
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
1932
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
1933
|
-
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
1934
|
-
getAccountMeta("rent", accounts.rent),
|
|
1935
|
-
getAccountMeta("migrationAuthority", accounts.migrationAuthority)
|
|
1936
|
-
],
|
|
1937
|
-
data: getInitializePoolInstructionDataEncoder().encode(
|
|
1938
|
-
args
|
|
1939
|
-
),
|
|
1940
|
-
programAddress
|
|
1941
|
-
});
|
|
1942
|
-
}
|
|
1943
|
-
function parseInitializePoolInstruction(instruction) {
|
|
1944
|
-
if (instruction.accounts.length < 14) {
|
|
1945
|
-
throw new kit.SolanaError(
|
|
1946
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
1947
|
-
{
|
|
1948
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1949
|
-
expectedAccountMetas: 14
|
|
1950
|
-
}
|
|
1951
|
-
);
|
|
1952
|
-
}
|
|
1953
|
-
let accountIndex = 0;
|
|
1954
|
-
const getNextAccount = () => {
|
|
1955
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1956
|
-
accountIndex += 1;
|
|
1957
|
-
return accountMeta;
|
|
1958
|
-
};
|
|
1959
|
-
return {
|
|
1960
|
-
programAddress: instruction.programAddress,
|
|
1961
|
-
accounts: {
|
|
1962
|
-
config: getNextAccount(),
|
|
1963
|
-
pool: getNextAccount(),
|
|
1964
|
-
protocolFeePosition: getNextAccount(),
|
|
1965
|
-
authority: getNextAccount(),
|
|
1966
|
-
vault0: getNextAccount(),
|
|
1967
|
-
vault1: getNextAccount(),
|
|
1968
|
-
token0Mint: getNextAccount(),
|
|
1969
|
-
token1Mint: getNextAccount(),
|
|
1970
|
-
payer: getNextAccount(),
|
|
1971
|
-
token0Program: getNextAccount(),
|
|
1972
|
-
token1Program: getNextAccount(),
|
|
1973
|
-
systemProgram: getNextAccount(),
|
|
1974
|
-
rent: getNextAccount(),
|
|
1975
|
-
migrationAuthority: getNextAccount()
|
|
1976
|
-
},
|
|
1977
|
-
data: getInitializePoolInstructionDataDecoder().decode(instruction.data)
|
|
1978
|
-
};
|
|
1979
|
-
}
|
|
1980
|
-
var ORACLE_CONSULT_DISCRIMINATOR = new Uint8Array([
|
|
1981
|
-
239,
|
|
1982
|
-
237,
|
|
1983
|
-
255,
|
|
1984
|
-
177,
|
|
1985
|
-
142,
|
|
1986
|
-
72,
|
|
1987
|
-
96,
|
|
1988
|
-
175
|
|
1989
|
-
]);
|
|
1990
|
-
function getOracleConsultDiscriminatorBytes() {
|
|
1991
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
1992
|
-
ORACLE_CONSULT_DISCRIMINATOR
|
|
1993
|
-
);
|
|
1994
|
-
}
|
|
1995
|
-
function getOracleConsultInstructionDataEncoder() {
|
|
1996
|
-
return kit.transformEncoder(
|
|
1997
|
-
kit.getStructEncoder([
|
|
1998
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1999
|
-
["windowSeconds", kit.getU32Encoder()]
|
|
2000
|
-
]),
|
|
2001
|
-
(value) => ({ ...value, discriminator: ORACLE_CONSULT_DISCRIMINATOR })
|
|
2002
|
-
);
|
|
2003
|
-
}
|
|
2004
|
-
function getOracleConsultInstructionDataDecoder() {
|
|
2005
|
-
return kit.getStructDecoder([
|
|
2006
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2007
|
-
["windowSeconds", kit.getU32Decoder()]
|
|
2008
|
-
]);
|
|
2009
|
-
}
|
|
2010
|
-
function getOracleConsultInstructionDataCodec() {
|
|
2011
|
-
return kit.combineCodec(
|
|
2012
|
-
getOracleConsultInstructionDataEncoder(),
|
|
2013
|
-
getOracleConsultInstructionDataDecoder()
|
|
2014
|
-
);
|
|
2015
|
-
}
|
|
2016
|
-
async function getOracleConsultInstructionAsync(input, config) {
|
|
2017
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2018
|
-
const originalAccounts = {
|
|
2019
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
2020
|
-
oracle: { value: input.oracle ?? null, isWritable: false }
|
|
2021
|
-
};
|
|
2022
|
-
const accounts = originalAccounts;
|
|
2023
|
-
const args = { ...input };
|
|
2024
|
-
if (!accounts.oracle.value) {
|
|
2025
|
-
accounts.oracle.value = await kit.getProgramDerivedAddress({
|
|
2026
|
-
programAddress,
|
|
2027
|
-
seeds: [
|
|
2028
|
-
kit.getBytesEncoder().encode(new Uint8Array([111, 114, 97, 99, 108, 101])),
|
|
2029
|
-
kit.getAddressEncoder().encode(
|
|
2030
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
2031
|
-
)
|
|
2032
|
-
]
|
|
2033
|
-
});
|
|
2034
|
-
}
|
|
2035
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2036
|
-
return Object.freeze({
|
|
2037
|
-
accounts: [
|
|
2038
|
-
getAccountMeta("pool", accounts.pool),
|
|
2039
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2040
|
-
],
|
|
2041
|
-
data: getOracleConsultInstructionDataEncoder().encode(
|
|
2042
|
-
args
|
|
2043
|
-
),
|
|
2044
|
-
programAddress
|
|
2045
|
-
});
|
|
2046
|
-
}
|
|
2047
|
-
function getOracleConsultInstruction(input, config) {
|
|
2048
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2049
|
-
const originalAccounts = {
|
|
2050
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
2051
|
-
oracle: { value: input.oracle ?? null, isWritable: false }
|
|
2052
|
-
};
|
|
2053
|
-
const accounts = originalAccounts;
|
|
2054
|
-
const args = { ...input };
|
|
2055
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2056
|
-
return Object.freeze({
|
|
2057
|
-
accounts: [
|
|
2058
|
-
getAccountMeta("pool", accounts.pool),
|
|
2059
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2060
|
-
],
|
|
2061
|
-
data: getOracleConsultInstructionDataEncoder().encode(
|
|
2062
|
-
args
|
|
2063
|
-
),
|
|
2064
|
-
programAddress
|
|
2065
|
-
});
|
|
2066
|
-
}
|
|
2067
|
-
function parseOracleConsultInstruction(instruction) {
|
|
2068
|
-
if (instruction.accounts.length < 2) {
|
|
2069
|
-
throw new kit.SolanaError(
|
|
2070
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2071
|
-
{
|
|
2072
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2073
|
-
expectedAccountMetas: 2
|
|
2074
|
-
}
|
|
2075
|
-
);
|
|
2076
|
-
}
|
|
2077
|
-
let accountIndex = 0;
|
|
2078
|
-
const getNextAccount = () => {
|
|
2079
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2080
|
-
accountIndex += 1;
|
|
2081
|
-
return accountMeta;
|
|
2082
|
-
};
|
|
2083
|
-
return {
|
|
2084
|
-
programAddress: instruction.programAddress,
|
|
2085
|
-
accounts: { pool: getNextAccount(), oracle: getNextAccount() },
|
|
2086
|
-
data: getOracleConsultInstructionDataDecoder().decode(instruction.data)
|
|
2087
|
-
};
|
|
2088
|
-
}
|
|
2089
|
-
var ORACLE_UPDATE_DISCRIMINATOR = new Uint8Array([
|
|
2090
|
-
85,
|
|
2091
|
-
209,
|
|
2092
|
-
248,
|
|
2093
|
-
142,
|
|
2094
|
-
186,
|
|
2095
|
-
249,
|
|
2096
|
-
120,
|
|
2097
|
-
239
|
|
2098
|
-
]);
|
|
2099
|
-
function getOracleUpdateDiscriminatorBytes() {
|
|
2100
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
2101
|
-
ORACLE_UPDATE_DISCRIMINATOR
|
|
2102
|
-
);
|
|
2103
|
-
}
|
|
2104
|
-
function getOracleUpdateInstructionDataEncoder() {
|
|
2105
|
-
return kit.transformEncoder(
|
|
2106
|
-
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
2107
|
-
(value) => ({ ...value, discriminator: ORACLE_UPDATE_DISCRIMINATOR })
|
|
2108
|
-
);
|
|
2109
|
-
}
|
|
2110
|
-
function getOracleUpdateInstructionDataDecoder() {
|
|
2111
|
-
return kit.getStructDecoder([
|
|
2112
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
|
|
2113
|
-
]);
|
|
2114
|
-
}
|
|
2115
|
-
function getOracleUpdateInstructionDataCodec() {
|
|
2116
|
-
return kit.combineCodec(
|
|
2117
|
-
getOracleUpdateInstructionDataEncoder(),
|
|
2118
|
-
getOracleUpdateInstructionDataDecoder()
|
|
2119
|
-
);
|
|
2120
|
-
}
|
|
2121
|
-
async function getOracleUpdateInstructionAsync(input, config) {
|
|
2122
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2123
|
-
const originalAccounts = {
|
|
2124
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
2125
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2126
|
-
};
|
|
2127
|
-
const accounts = originalAccounts;
|
|
2128
|
-
if (!accounts.oracle.value) {
|
|
2129
|
-
accounts.oracle.value = await kit.getProgramDerivedAddress({
|
|
2130
|
-
programAddress,
|
|
2131
|
-
seeds: [
|
|
2132
|
-
kit.getBytesEncoder().encode(new Uint8Array([111, 114, 97, 99, 108, 101])),
|
|
2133
|
-
kit.getAddressEncoder().encode(
|
|
2134
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
2135
|
-
)
|
|
2136
|
-
]
|
|
2137
|
-
});
|
|
2138
|
-
}
|
|
2139
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2140
|
-
return Object.freeze({
|
|
2141
|
-
accounts: [
|
|
2142
|
-
getAccountMeta("pool", accounts.pool),
|
|
2143
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2144
|
-
],
|
|
2145
|
-
data: getOracleUpdateInstructionDataEncoder().encode({}),
|
|
2146
|
-
programAddress
|
|
2147
|
-
});
|
|
2148
|
-
}
|
|
2149
|
-
function getOracleUpdateInstruction(input, config) {
|
|
2150
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2151
|
-
const originalAccounts = {
|
|
2152
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
2153
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2154
|
-
};
|
|
2155
|
-
const accounts = originalAccounts;
|
|
2156
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2157
|
-
return Object.freeze({
|
|
2158
|
-
accounts: [
|
|
2159
|
-
getAccountMeta("pool", accounts.pool),
|
|
2160
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2161
|
-
],
|
|
2162
|
-
data: getOracleUpdateInstructionDataEncoder().encode({}),
|
|
2163
|
-
programAddress
|
|
2164
|
-
});
|
|
2165
|
-
}
|
|
2166
|
-
function parseOracleUpdateInstruction(instruction) {
|
|
2167
|
-
if (instruction.accounts.length < 2) {
|
|
2168
|
-
throw new kit.SolanaError(
|
|
2169
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2170
|
-
{
|
|
2171
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2172
|
-
expectedAccountMetas: 2
|
|
2173
|
-
}
|
|
2174
|
-
);
|
|
2175
|
-
}
|
|
2176
|
-
let accountIndex = 0;
|
|
2177
|
-
const getNextAccount = () => {
|
|
2178
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2179
|
-
accountIndex += 1;
|
|
2180
|
-
return accountMeta;
|
|
2181
|
-
};
|
|
2182
|
-
return {
|
|
2183
|
-
programAddress: instruction.programAddress,
|
|
2184
|
-
accounts: { pool: getNextAccount(), oracle: getNextAccount() },
|
|
2185
|
-
data: getOracleUpdateInstructionDataDecoder().decode(instruction.data)
|
|
2186
|
-
};
|
|
2187
|
-
}
|
|
2188
|
-
var PAUSE_DISCRIMINATOR = new Uint8Array([
|
|
2189
|
-
211,
|
|
2190
|
-
22,
|
|
2191
|
-
221,
|
|
2192
|
-
251,
|
|
2193
|
-
74,
|
|
2194
|
-
121,
|
|
2195
|
-
193,
|
|
2196
|
-
47
|
|
2197
|
-
]);
|
|
2198
|
-
function getPauseDiscriminatorBytes() {
|
|
2199
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(PAUSE_DISCRIMINATOR);
|
|
2200
|
-
}
|
|
2201
|
-
function getPauseInstructionDataEncoder() {
|
|
2202
|
-
return kit.transformEncoder(
|
|
2203
|
-
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
2204
|
-
(value) => ({ ...value, discriminator: PAUSE_DISCRIMINATOR })
|
|
2205
|
-
);
|
|
2206
|
-
}
|
|
2207
|
-
function getPauseInstructionDataDecoder() {
|
|
2208
|
-
return kit.getStructDecoder([
|
|
2209
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
|
|
2210
|
-
]);
|
|
2211
|
-
}
|
|
2212
|
-
function getPauseInstructionDataCodec() {
|
|
2213
|
-
return kit.combineCodec(
|
|
2214
|
-
getPauseInstructionDataEncoder(),
|
|
2215
|
-
getPauseInstructionDataDecoder()
|
|
2216
|
-
);
|
|
2217
|
-
}
|
|
2218
|
-
function getPauseInstruction(input, config) {
|
|
2219
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2220
|
-
const originalAccounts = {
|
|
2221
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
2222
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
2223
|
-
};
|
|
2224
|
-
const accounts = originalAccounts;
|
|
2225
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2226
|
-
return Object.freeze({
|
|
2227
|
-
accounts: [
|
|
2228
|
-
getAccountMeta("config", accounts.config),
|
|
2229
|
-
getAccountMeta("admin", accounts.admin)
|
|
2230
|
-
],
|
|
2231
|
-
data: getPauseInstructionDataEncoder().encode({}),
|
|
2232
|
-
programAddress
|
|
2233
|
-
});
|
|
2234
|
-
}
|
|
2235
|
-
function parsePauseInstruction(instruction) {
|
|
2236
|
-
if (instruction.accounts.length < 2) {
|
|
2237
|
-
throw new kit.SolanaError(
|
|
2238
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2239
|
-
{
|
|
2240
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2241
|
-
expectedAccountMetas: 2
|
|
2242
|
-
}
|
|
2243
|
-
);
|
|
2244
|
-
}
|
|
2245
|
-
let accountIndex = 0;
|
|
2246
|
-
const getNextAccount = () => {
|
|
2247
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2248
|
-
accountIndex += 1;
|
|
2249
|
-
return accountMeta;
|
|
2250
|
-
};
|
|
2251
|
-
return {
|
|
2252
|
-
programAddress: instruction.programAddress,
|
|
2253
|
-
accounts: { config: getNextAccount(), admin: getNextAccount() },
|
|
2254
|
-
data: getPauseInstructionDataDecoder().decode(instruction.data)
|
|
2255
|
-
};
|
|
2256
|
-
}
|
|
2257
|
-
var PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
|
|
2258
|
-
50,
|
|
2259
|
-
130,
|
|
2260
|
-
31,
|
|
2261
|
-
69,
|
|
2262
|
-
147,
|
|
2263
|
-
58,
|
|
2264
|
-
222,
|
|
2265
|
-
178
|
|
2266
|
-
]);
|
|
2267
|
-
function getPreviewSwapExactInDiscriminatorBytes() {
|
|
2268
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
2269
|
-
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR
|
|
2270
|
-
);
|
|
2271
|
-
}
|
|
2272
|
-
function getPreviewSwapExactInInstructionDataEncoder() {
|
|
2273
|
-
return kit.transformEncoder(
|
|
2274
|
-
kit.getStructEncoder([
|
|
2275
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2276
|
-
["amountIn", kit.getU64Encoder()],
|
|
2277
|
-
["tradeDirection", kit.getU8Encoder()]
|
|
2278
|
-
]),
|
|
2279
|
-
(value) => ({
|
|
2280
|
-
...value,
|
|
2281
|
-
discriminator: PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR
|
|
2282
|
-
})
|
|
2283
|
-
);
|
|
2284
|
-
}
|
|
2285
|
-
function getPreviewSwapExactInInstructionDataDecoder() {
|
|
2286
|
-
return kit.getStructDecoder([
|
|
2287
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2288
|
-
["amountIn", kit.getU64Decoder()],
|
|
2289
|
-
["tradeDirection", kit.getU8Decoder()]
|
|
2290
|
-
]);
|
|
2291
|
-
}
|
|
2292
|
-
function getPreviewSwapExactInInstructionDataCodec() {
|
|
2293
|
-
return kit.combineCodec(
|
|
2294
|
-
getPreviewSwapExactInInstructionDataEncoder(),
|
|
2295
|
-
getPreviewSwapExactInInstructionDataDecoder()
|
|
2296
|
-
);
|
|
2297
|
-
}
|
|
2298
|
-
function getPreviewSwapExactInInstruction(input, config) {
|
|
2299
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2300
|
-
const originalAccounts = {
|
|
2301
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2302
|
-
pool: { value: input.pool ?? null, isWritable: false }
|
|
2303
|
-
};
|
|
2304
|
-
const accounts = originalAccounts;
|
|
2305
|
-
const args = { ...input };
|
|
2306
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2307
|
-
return Object.freeze({
|
|
2308
|
-
accounts: [
|
|
2309
|
-
getAccountMeta("config", accounts.config),
|
|
2310
|
-
getAccountMeta("pool", accounts.pool)
|
|
2311
|
-
],
|
|
2312
|
-
data: getPreviewSwapExactInInstructionDataEncoder().encode(
|
|
2313
|
-
args
|
|
2314
|
-
),
|
|
2315
|
-
programAddress
|
|
2316
|
-
});
|
|
2317
|
-
}
|
|
2318
|
-
function parsePreviewSwapExactInInstruction(instruction) {
|
|
2319
|
-
if (instruction.accounts.length < 2) {
|
|
2320
|
-
throw new kit.SolanaError(
|
|
2321
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2322
|
-
{
|
|
2323
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2324
|
-
expectedAccountMetas: 2
|
|
2325
|
-
}
|
|
2326
|
-
);
|
|
2327
|
-
}
|
|
2328
|
-
let accountIndex = 0;
|
|
2329
|
-
const getNextAccount = () => {
|
|
2330
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2331
|
-
accountIndex += 1;
|
|
2332
|
-
return accountMeta;
|
|
2333
|
-
};
|
|
2334
|
-
return {
|
|
2335
|
-
programAddress: instruction.programAddress,
|
|
2336
|
-
accounts: { config: getNextAccount(), pool: getNextAccount() },
|
|
2337
|
-
data: getPreviewSwapExactInInstructionDataDecoder().decode(
|
|
2338
|
-
instruction.data
|
|
2339
|
-
)
|
|
2340
|
-
};
|
|
2341
|
-
}
|
|
2342
|
-
var QUOTE_TO_NUMERAIRE_DISCRIMINATOR = new Uint8Array([
|
|
2343
|
-
4,
|
|
2344
|
-
142,
|
|
2345
|
-
249,
|
|
2346
|
-
240,
|
|
2347
|
-
129,
|
|
2348
|
-
15,
|
|
2349
|
-
143,
|
|
2350
|
-
57
|
|
2351
|
-
]);
|
|
2352
|
-
function getQuoteToNumeraireDiscriminatorBytes() {
|
|
2353
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
2354
|
-
QUOTE_TO_NUMERAIRE_DISCRIMINATOR
|
|
2355
|
-
);
|
|
2356
|
-
}
|
|
2357
|
-
function getQuoteToNumeraireInstructionDataEncoder() {
|
|
2358
|
-
return kit.transformEncoder(
|
|
2359
|
-
kit.getStructEncoder([
|
|
2360
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2361
|
-
["amount", kit.getU128Encoder()],
|
|
2362
|
-
["inputTokenIndex", kit.getU8Encoder()],
|
|
2363
|
-
["maxHops", kit.getU8Encoder()],
|
|
2364
|
-
["useTwap", kit.getBooleanEncoder()],
|
|
2365
|
-
["windowSeconds", kit.getU32Encoder()]
|
|
2366
|
-
]),
|
|
2367
|
-
(value) => ({ ...value, discriminator: QUOTE_TO_NUMERAIRE_DISCRIMINATOR })
|
|
2368
|
-
);
|
|
2369
|
-
}
|
|
2370
|
-
function getQuoteToNumeraireInstructionDataDecoder() {
|
|
2371
|
-
return kit.getStructDecoder([
|
|
2372
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2373
|
-
["amount", kit.getU128Decoder()],
|
|
2374
|
-
["inputTokenIndex", kit.getU8Decoder()],
|
|
2375
|
-
["maxHops", kit.getU8Decoder()],
|
|
2376
|
-
["useTwap", kit.getBooleanDecoder()],
|
|
2377
|
-
["windowSeconds", kit.getU32Decoder()]
|
|
2378
|
-
]);
|
|
2379
|
-
}
|
|
2380
|
-
function getQuoteToNumeraireInstructionDataCodec() {
|
|
2381
|
-
return kit.combineCodec(
|
|
2382
|
-
getQuoteToNumeraireInstructionDataEncoder(),
|
|
2383
|
-
getQuoteToNumeraireInstructionDataDecoder()
|
|
2384
|
-
);
|
|
2385
|
-
}
|
|
2386
|
-
function getQuoteToNumeraireInstruction(input, config) {
|
|
2387
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2388
|
-
const originalAccounts = {
|
|
2389
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2390
|
-
startPool: { value: input.startPool ?? null, isWritable: false }
|
|
2391
|
-
};
|
|
2392
|
-
const accounts = originalAccounts;
|
|
2393
|
-
const args = { ...input };
|
|
2394
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2395
|
-
return Object.freeze({
|
|
2396
|
-
accounts: [
|
|
2397
|
-
getAccountMeta("config", accounts.config),
|
|
2398
|
-
getAccountMeta("startPool", accounts.startPool)
|
|
2399
|
-
],
|
|
2400
|
-
data: getQuoteToNumeraireInstructionDataEncoder().encode(
|
|
2401
|
-
args
|
|
2402
|
-
),
|
|
2403
|
-
programAddress
|
|
2404
|
-
});
|
|
2405
|
-
}
|
|
2406
|
-
function parseQuoteToNumeraireInstruction(instruction) {
|
|
2407
|
-
if (instruction.accounts.length < 2) {
|
|
2408
|
-
throw new kit.SolanaError(
|
|
2409
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2410
|
-
{
|
|
2411
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2412
|
-
expectedAccountMetas: 2
|
|
2413
|
-
}
|
|
2414
|
-
);
|
|
2415
|
-
}
|
|
2416
|
-
let accountIndex = 0;
|
|
2417
|
-
const getNextAccount = () => {
|
|
2418
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2419
|
-
accountIndex += 1;
|
|
2420
|
-
return accountMeta;
|
|
2421
|
-
};
|
|
2422
|
-
return {
|
|
2423
|
-
programAddress: instruction.programAddress,
|
|
2424
|
-
accounts: { config: getNextAccount(), startPool: getNextAccount() },
|
|
2425
|
-
data: getQuoteToNumeraireInstructionDataDecoder().decode(instruction.data)
|
|
2426
|
-
};
|
|
2427
|
-
}
|
|
2428
|
-
var REMOVE_LIQUIDITY_DISCRIMINATOR = new Uint8Array([
|
|
2429
|
-
80,
|
|
2430
|
-
85,
|
|
2431
|
-
209,
|
|
2432
|
-
72,
|
|
2433
|
-
24,
|
|
2434
|
-
206,
|
|
2435
|
-
177,
|
|
2436
|
-
108
|
|
2437
|
-
]);
|
|
2438
|
-
function getRemoveLiquidityDiscriminatorBytes() {
|
|
2439
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
2440
|
-
REMOVE_LIQUIDITY_DISCRIMINATOR
|
|
2441
|
-
);
|
|
2442
|
-
}
|
|
2443
|
-
function getRemoveLiquidityInstructionDataEncoder() {
|
|
2444
|
-
return kit.transformEncoder(
|
|
2445
|
-
kit.getStructEncoder([
|
|
2446
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2447
|
-
["sharesIn", kit.getU128Encoder()],
|
|
2448
|
-
["minAmount0Out", kit.getU64Encoder()],
|
|
2449
|
-
["minAmount1Out", kit.getU64Encoder()],
|
|
2450
|
-
["updateOracle", kit.getBooleanEncoder()]
|
|
2451
|
-
]),
|
|
2452
|
-
(value) => ({ ...value, discriminator: REMOVE_LIQUIDITY_DISCRIMINATOR })
|
|
2453
|
-
);
|
|
2454
|
-
}
|
|
2455
|
-
function getRemoveLiquidityInstructionDataDecoder() {
|
|
2456
|
-
return kit.getStructDecoder([
|
|
2457
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2458
|
-
["sharesIn", kit.getU128Decoder()],
|
|
2459
|
-
["minAmount0Out", kit.getU64Decoder()],
|
|
2460
|
-
["minAmount1Out", kit.getU64Decoder()],
|
|
2461
|
-
["updateOracle", kit.getBooleanDecoder()]
|
|
2462
|
-
]);
|
|
2463
|
-
}
|
|
2464
|
-
function getRemoveLiquidityInstructionDataCodec() {
|
|
2465
|
-
return kit.combineCodec(
|
|
2466
|
-
getRemoveLiquidityInstructionDataEncoder(),
|
|
2467
|
-
getRemoveLiquidityInstructionDataDecoder()
|
|
2468
|
-
);
|
|
2469
|
-
}
|
|
2470
|
-
async function getRemoveLiquidityInstructionAsync(input, config) {
|
|
2471
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2472
|
-
const originalAccounts = {
|
|
2473
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2474
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2475
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
2476
|
-
protocolFeePosition: {
|
|
2477
|
-
value: input.protocolFeePosition ?? null,
|
|
2478
|
-
isWritable: true
|
|
2479
|
-
},
|
|
2480
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
2481
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
2482
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
2483
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
2484
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
2485
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
2486
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
2487
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
2488
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
2489
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
2490
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2491
|
-
};
|
|
2492
|
-
const accounts = originalAccounts;
|
|
2493
|
-
const args = { ...input };
|
|
2494
|
-
if (!accounts.authority.value) {
|
|
2495
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
2496
|
-
programAddress,
|
|
2497
|
-
seeds: [
|
|
2498
|
-
kit.getBytesEncoder().encode(
|
|
2499
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2500
|
-
),
|
|
2501
|
-
kit.getAddressEncoder().encode(
|
|
2502
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
2503
|
-
)
|
|
2504
|
-
]
|
|
2505
|
-
});
|
|
2506
|
-
}
|
|
2507
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2508
|
-
return Object.freeze({
|
|
2509
|
-
accounts: [
|
|
2510
|
-
getAccountMeta("config", accounts.config),
|
|
2511
|
-
getAccountMeta("pool", accounts.pool),
|
|
2512
|
-
getAccountMeta("position", accounts.position),
|
|
2513
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
2514
|
-
getAccountMeta("owner", accounts.owner),
|
|
2515
|
-
getAccountMeta("authority", accounts.authority),
|
|
2516
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
2517
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
2518
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
2519
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
2520
|
-
getAccountMeta("user0", accounts.user0),
|
|
2521
|
-
getAccountMeta("user1", accounts.user1),
|
|
2522
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
2523
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
2524
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2525
|
-
],
|
|
2526
|
-
data: getRemoveLiquidityInstructionDataEncoder().encode(
|
|
2527
|
-
args
|
|
2528
|
-
),
|
|
2529
|
-
programAddress
|
|
2530
|
-
});
|
|
2531
|
-
}
|
|
2532
|
-
function getRemoveLiquidityInstruction(input, config) {
|
|
2533
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2534
|
-
const originalAccounts = {
|
|
2535
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2536
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2537
|
-
position: { value: input.position ?? null, isWritable: true },
|
|
2538
|
-
protocolFeePosition: {
|
|
2539
|
-
value: input.protocolFeePosition ?? null,
|
|
2540
|
-
isWritable: true
|
|
2541
|
-
},
|
|
2542
|
-
owner: { value: input.owner ?? null, isWritable: false },
|
|
2543
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
2544
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
2545
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
2546
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
2547
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
2548
|
-
user0: { value: input.user0 ?? null, isWritable: true },
|
|
2549
|
-
user1: { value: input.user1 ?? null, isWritable: true },
|
|
2550
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
2551
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
2552
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2553
|
-
};
|
|
2554
|
-
const accounts = originalAccounts;
|
|
2555
|
-
const args = { ...input };
|
|
2556
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2557
|
-
return Object.freeze({
|
|
2558
|
-
accounts: [
|
|
2559
|
-
getAccountMeta("config", accounts.config),
|
|
2560
|
-
getAccountMeta("pool", accounts.pool),
|
|
2561
|
-
getAccountMeta("position", accounts.position),
|
|
2562
|
-
getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
|
|
2563
|
-
getAccountMeta("owner", accounts.owner),
|
|
2564
|
-
getAccountMeta("authority", accounts.authority),
|
|
2565
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
2566
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
2567
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
2568
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
2569
|
-
getAccountMeta("user0", accounts.user0),
|
|
2570
|
-
getAccountMeta("user1", accounts.user1),
|
|
2571
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
2572
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
2573
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2574
|
-
],
|
|
2575
|
-
data: getRemoveLiquidityInstructionDataEncoder().encode(
|
|
2576
|
-
args
|
|
2577
|
-
),
|
|
2578
|
-
programAddress
|
|
2579
|
-
});
|
|
2580
|
-
}
|
|
2581
|
-
function parseRemoveLiquidityInstruction(instruction) {
|
|
2582
|
-
if (instruction.accounts.length < 15) {
|
|
2583
|
-
throw new kit.SolanaError(
|
|
2584
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2585
|
-
{
|
|
2586
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2587
|
-
expectedAccountMetas: 15
|
|
2588
|
-
}
|
|
2589
|
-
);
|
|
2590
|
-
}
|
|
2591
|
-
let accountIndex = 0;
|
|
2592
|
-
const getNextAccount = () => {
|
|
2593
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2594
|
-
accountIndex += 1;
|
|
2595
|
-
return accountMeta;
|
|
2596
|
-
};
|
|
2597
|
-
const getNextOptionalAccount = () => {
|
|
2598
|
-
const accountMeta = getNextAccount();
|
|
2599
|
-
return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
2600
|
-
};
|
|
2601
|
-
return {
|
|
2602
|
-
programAddress: instruction.programAddress,
|
|
2603
|
-
accounts: {
|
|
2604
|
-
config: getNextAccount(),
|
|
2605
|
-
pool: getNextAccount(),
|
|
2606
|
-
position: getNextAccount(),
|
|
2607
|
-
protocolFeePosition: getNextAccount(),
|
|
2608
|
-
owner: getNextAccount(),
|
|
2609
|
-
authority: getNextAccount(),
|
|
2610
|
-
vault0: getNextAccount(),
|
|
2611
|
-
vault1: getNextAccount(),
|
|
2612
|
-
token0Mint: getNextAccount(),
|
|
2613
|
-
token1Mint: getNextAccount(),
|
|
2614
|
-
user0: getNextAccount(),
|
|
2615
|
-
user1: getNextAccount(),
|
|
2616
|
-
token0Program: getNextAccount(),
|
|
2617
|
-
token1Program: getNextAccount(),
|
|
2618
|
-
oracle: getNextOptionalAccount()
|
|
2619
|
-
},
|
|
2620
|
-
data: getRemoveLiquidityInstructionDataDecoder().decode(instruction.data)
|
|
2621
|
-
};
|
|
2622
|
-
}
|
|
2623
|
-
var SET_FEES_DISCRIMINATOR = new Uint8Array([
|
|
2624
|
-
137,
|
|
2625
|
-
178,
|
|
2626
|
-
49,
|
|
2627
|
-
58,
|
|
2628
|
-
0,
|
|
2629
|
-
245,
|
|
2630
|
-
242,
|
|
2631
|
-
190
|
|
2632
|
-
]);
|
|
2633
|
-
function getSetFeesDiscriminatorBytes() {
|
|
2634
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_FEES_DISCRIMINATOR);
|
|
2635
|
-
}
|
|
2636
|
-
function getSetFeesInstructionDataEncoder() {
|
|
2637
|
-
return kit.transformEncoder(
|
|
2638
|
-
kit.getStructEncoder([
|
|
2639
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2640
|
-
["swapFeeBps", kit.getU16Encoder()],
|
|
2641
|
-
["feeSplitBps", kit.getU16Encoder()]
|
|
2642
|
-
]),
|
|
2643
|
-
(value) => ({ ...value, discriminator: SET_FEES_DISCRIMINATOR })
|
|
2644
|
-
);
|
|
2645
|
-
}
|
|
2646
|
-
function getSetFeesInstructionDataDecoder() {
|
|
2647
|
-
return kit.getStructDecoder([
|
|
2648
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2649
|
-
["swapFeeBps", kit.getU16Decoder()],
|
|
2650
|
-
["feeSplitBps", kit.getU16Decoder()]
|
|
2651
|
-
]);
|
|
2652
|
-
}
|
|
2653
|
-
function getSetFeesInstructionDataCodec() {
|
|
2654
|
-
return kit.combineCodec(
|
|
2655
|
-
getSetFeesInstructionDataEncoder(),
|
|
2656
|
-
getSetFeesInstructionDataDecoder()
|
|
2657
|
-
);
|
|
2658
|
-
}
|
|
2659
|
-
function getSetFeesInstruction(input, config) {
|
|
2660
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2661
|
-
const originalAccounts = {
|
|
2662
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2663
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2664
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
2665
|
-
};
|
|
2666
|
-
const accounts = originalAccounts;
|
|
2667
|
-
const args = { ...input };
|
|
2668
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2669
|
-
return Object.freeze({
|
|
2670
|
-
accounts: [
|
|
2671
|
-
getAccountMeta("config", accounts.config),
|
|
2672
|
-
getAccountMeta("pool", accounts.pool),
|
|
2673
|
-
getAccountMeta("admin", accounts.admin)
|
|
2674
|
-
],
|
|
2675
|
-
data: getSetFeesInstructionDataEncoder().encode(
|
|
2676
|
-
args
|
|
2677
|
-
),
|
|
2678
|
-
programAddress
|
|
2679
|
-
});
|
|
2680
|
-
}
|
|
2681
|
-
function parseSetFeesInstruction(instruction) {
|
|
2682
|
-
if (instruction.accounts.length < 3) {
|
|
2683
|
-
throw new kit.SolanaError(
|
|
2684
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2685
|
-
{
|
|
2686
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2687
|
-
expectedAccountMetas: 3
|
|
2688
|
-
}
|
|
2689
|
-
);
|
|
2690
|
-
}
|
|
2691
|
-
let accountIndex = 0;
|
|
2692
|
-
const getNextAccount = () => {
|
|
2693
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2694
|
-
accountIndex += 1;
|
|
2695
|
-
return accountMeta;
|
|
2696
|
-
};
|
|
2697
|
-
return {
|
|
2698
|
-
programAddress: instruction.programAddress,
|
|
2699
|
-
accounts: {
|
|
2700
|
-
config: getNextAccount(),
|
|
2701
|
-
pool: getNextAccount(),
|
|
2702
|
-
admin: getNextAccount()
|
|
2703
|
-
},
|
|
2704
|
-
data: getSetFeesInstructionDataDecoder().decode(instruction.data)
|
|
2705
|
-
};
|
|
2706
|
-
}
|
|
2707
|
-
var SET_HOOK_DISCRIMINATOR = new Uint8Array([
|
|
2708
|
-
175,
|
|
2709
|
-
16,
|
|
2710
|
-
187,
|
|
2711
|
-
252,
|
|
2712
|
-
19,
|
|
2713
|
-
54,
|
|
2714
|
-
111,
|
|
2715
|
-
221
|
|
2716
|
-
]);
|
|
2717
|
-
function getSetHookDiscriminatorBytes() {
|
|
2718
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_HOOK_DISCRIMINATOR);
|
|
2719
|
-
}
|
|
2720
|
-
function getSetHookInstructionDataEncoder() {
|
|
2721
|
-
return kit.transformEncoder(
|
|
2722
|
-
kit.getStructEncoder([
|
|
2723
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2724
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
2725
|
-
["hookFlags", kit.getU32Encoder()]
|
|
2726
|
-
]),
|
|
2727
|
-
(value) => ({ ...value, discriminator: SET_HOOK_DISCRIMINATOR })
|
|
2728
|
-
);
|
|
2729
|
-
}
|
|
2730
|
-
function getSetHookInstructionDataDecoder() {
|
|
2731
|
-
return kit.getStructDecoder([
|
|
2732
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2733
|
-
["hookProgram", kit.getAddressDecoder()],
|
|
2734
|
-
["hookFlags", kit.getU32Decoder()]
|
|
2735
|
-
]);
|
|
2736
|
-
}
|
|
2737
|
-
function getSetHookInstructionDataCodec() {
|
|
2738
|
-
return kit.combineCodec(
|
|
2739
|
-
getSetHookInstructionDataEncoder(),
|
|
2740
|
-
getSetHookInstructionDataDecoder()
|
|
2741
|
-
);
|
|
2742
|
-
}
|
|
2743
|
-
function getSetHookInstruction(input, config) {
|
|
2744
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2745
|
-
const originalAccounts = {
|
|
2746
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2747
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2748
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
2749
|
-
};
|
|
2750
|
-
const accounts = originalAccounts;
|
|
2751
|
-
const args = { ...input };
|
|
2752
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2753
|
-
return Object.freeze({
|
|
2754
|
-
accounts: [
|
|
2755
|
-
getAccountMeta("config", accounts.config),
|
|
2756
|
-
getAccountMeta("pool", accounts.pool),
|
|
2757
|
-
getAccountMeta("admin", accounts.admin)
|
|
2758
|
-
],
|
|
2759
|
-
data: getSetHookInstructionDataEncoder().encode(
|
|
2760
|
-
args
|
|
2761
|
-
),
|
|
2762
|
-
programAddress
|
|
2763
|
-
});
|
|
2764
|
-
}
|
|
2765
|
-
function parseSetHookInstruction(instruction) {
|
|
2766
|
-
if (instruction.accounts.length < 3) {
|
|
2767
|
-
throw new kit.SolanaError(
|
|
2768
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2769
|
-
{
|
|
2770
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2771
|
-
expectedAccountMetas: 3
|
|
2772
|
-
}
|
|
2773
|
-
);
|
|
2774
|
-
}
|
|
2775
|
-
let accountIndex = 0;
|
|
2776
|
-
const getNextAccount = () => {
|
|
2777
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2778
|
-
accountIndex += 1;
|
|
2779
|
-
return accountMeta;
|
|
2780
|
-
};
|
|
2781
|
-
return {
|
|
2782
|
-
programAddress: instruction.programAddress,
|
|
2783
|
-
accounts: {
|
|
2784
|
-
config: getNextAccount(),
|
|
2785
|
-
pool: getNextAccount(),
|
|
2786
|
-
admin: getNextAccount()
|
|
2787
|
-
},
|
|
2788
|
-
data: getSetHookInstructionDataDecoder().decode(instruction.data)
|
|
2789
|
-
};
|
|
2790
|
-
}
|
|
2791
|
-
var SET_ROUTE_DISCRIMINATOR = new Uint8Array([
|
|
2792
|
-
244,
|
|
2793
|
-
231,
|
|
2794
|
-
3,
|
|
2795
|
-
84,
|
|
2796
|
-
233,
|
|
2797
|
-
61,
|
|
2798
|
-
146,
|
|
2799
|
-
149
|
|
2800
|
-
]);
|
|
2801
|
-
function getSetRouteDiscriminatorBytes() {
|
|
2802
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_ROUTE_DISCRIMINATOR);
|
|
2803
|
-
}
|
|
2804
|
-
function getSetRouteInstructionDataEncoder() {
|
|
2805
|
-
return kit.transformEncoder(
|
|
2806
|
-
kit.getStructEncoder([
|
|
2807
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2808
|
-
["routeNextPool", kit.getAddressEncoder()],
|
|
2809
|
-
["routeBridgeMint", kit.getAddressEncoder()]
|
|
2810
|
-
]),
|
|
2811
|
-
(value) => ({ ...value, discriminator: SET_ROUTE_DISCRIMINATOR })
|
|
2812
|
-
);
|
|
2813
|
-
}
|
|
2814
|
-
function getSetRouteInstructionDataDecoder() {
|
|
2815
|
-
return kit.getStructDecoder([
|
|
2816
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2817
|
-
["routeNextPool", kit.getAddressDecoder()],
|
|
2818
|
-
["routeBridgeMint", kit.getAddressDecoder()]
|
|
2819
|
-
]);
|
|
2820
|
-
}
|
|
2821
|
-
function getSetRouteInstructionDataCodec() {
|
|
2822
|
-
return kit.combineCodec(
|
|
2823
|
-
getSetRouteInstructionDataEncoder(),
|
|
2824
|
-
getSetRouteInstructionDataDecoder()
|
|
2825
|
-
);
|
|
2826
|
-
}
|
|
2827
|
-
function getSetRouteInstruction(input, config) {
|
|
2828
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2829
|
-
const originalAccounts = {
|
|
2830
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2831
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2832
|
-
nextPool: { value: input.nextPool ?? null, isWritable: false },
|
|
2833
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
2834
|
-
};
|
|
2835
|
-
const accounts = originalAccounts;
|
|
2836
|
-
const args = { ...input };
|
|
2837
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2838
|
-
return Object.freeze({
|
|
2839
|
-
accounts: [
|
|
2840
|
-
getAccountMeta("config", accounts.config),
|
|
2841
|
-
getAccountMeta("pool", accounts.pool),
|
|
2842
|
-
getAccountMeta("nextPool", accounts.nextPool),
|
|
2843
|
-
getAccountMeta("admin", accounts.admin)
|
|
2844
|
-
],
|
|
2845
|
-
data: getSetRouteInstructionDataEncoder().encode(
|
|
2846
|
-
args
|
|
2847
|
-
),
|
|
2848
|
-
programAddress
|
|
2849
|
-
});
|
|
2850
|
-
}
|
|
2851
|
-
function parseSetRouteInstruction(instruction) {
|
|
2852
|
-
if (instruction.accounts.length < 4) {
|
|
2853
|
-
throw new kit.SolanaError(
|
|
2854
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
2855
|
-
{
|
|
2856
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2857
|
-
expectedAccountMetas: 4
|
|
2858
|
-
}
|
|
2859
|
-
);
|
|
2860
|
-
}
|
|
2861
|
-
let accountIndex = 0;
|
|
2862
|
-
const getNextAccount = () => {
|
|
2863
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2864
|
-
accountIndex += 1;
|
|
2865
|
-
return accountMeta;
|
|
2866
|
-
};
|
|
2867
|
-
const getNextOptionalAccount = () => {
|
|
2868
|
-
const accountMeta = getNextAccount();
|
|
2869
|
-
return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
2870
|
-
};
|
|
2871
|
-
return {
|
|
2872
|
-
programAddress: instruction.programAddress,
|
|
2873
|
-
accounts: {
|
|
2874
|
-
config: getNextAccount(),
|
|
2875
|
-
pool: getNextAccount(),
|
|
2876
|
-
nextPool: getNextOptionalAccount(),
|
|
2877
|
-
admin: getNextAccount()
|
|
2878
|
-
},
|
|
2879
|
-
data: getSetRouteInstructionDataDecoder().decode(instruction.data)
|
|
2880
|
-
};
|
|
2881
|
-
}
|
|
2882
|
-
var SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
|
|
2883
|
-
104,
|
|
2884
|
-
104,
|
|
2885
|
-
131,
|
|
2886
|
-
86,
|
|
2887
|
-
161,
|
|
2888
|
-
189,
|
|
2889
|
-
180,
|
|
2890
|
-
216
|
|
2891
|
-
]);
|
|
2892
|
-
function getSwapExactInDiscriminatorBytes() {
|
|
2893
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
2894
|
-
SWAP_EXACT_IN_DISCRIMINATOR
|
|
2895
|
-
);
|
|
2896
|
-
}
|
|
2897
|
-
function getSwapExactInInstructionDataEncoder() {
|
|
2898
|
-
return kit.transformEncoder(
|
|
2899
|
-
kit.getStructEncoder([
|
|
2900
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2901
|
-
["amountIn", kit.getU64Encoder()],
|
|
2902
|
-
["minAmountOut", kit.getU64Encoder()],
|
|
2903
|
-
["tradeDirection", kit.getU8Encoder()],
|
|
2904
|
-
["updateOracle", kit.getBooleanEncoder()]
|
|
2905
|
-
]),
|
|
2906
|
-
(value) => ({ ...value, discriminator: SWAP_EXACT_IN_DISCRIMINATOR })
|
|
2907
|
-
);
|
|
2908
|
-
}
|
|
2909
|
-
function getSwapExactInInstructionDataDecoder() {
|
|
2910
|
-
return kit.getStructDecoder([
|
|
2911
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2912
|
-
["amountIn", kit.getU64Decoder()],
|
|
2913
|
-
["minAmountOut", kit.getU64Decoder()],
|
|
2914
|
-
["tradeDirection", kit.getU8Decoder()],
|
|
2915
|
-
["updateOracle", kit.getBooleanDecoder()]
|
|
2916
|
-
]);
|
|
2917
|
-
}
|
|
2918
|
-
function getSwapExactInInstructionDataCodec() {
|
|
2919
|
-
return kit.combineCodec(
|
|
2920
|
-
getSwapExactInInstructionDataEncoder(),
|
|
2921
|
-
getSwapExactInInstructionDataDecoder()
|
|
2922
|
-
);
|
|
2923
|
-
}
|
|
2924
|
-
async function getSwapExactInInstructionAsync(input, config) {
|
|
2925
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2926
|
-
const originalAccounts = {
|
|
2927
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2928
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2929
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
2930
|
-
vaultIn: { value: input.vaultIn ?? null, isWritable: true },
|
|
2931
|
-
vaultOut: { value: input.vaultOut ?? null, isWritable: true },
|
|
2932
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
2933
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
2934
|
-
userIn: { value: input.userIn ?? null, isWritable: true },
|
|
2935
|
-
userOut: { value: input.userOut ?? null, isWritable: true },
|
|
2936
|
-
trader: { value: input.trader ?? null, isWritable: false },
|
|
2937
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
2938
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
2939
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2940
|
-
};
|
|
2941
|
-
const accounts = originalAccounts;
|
|
2942
|
-
const args = { ...input };
|
|
2943
|
-
if (!accounts.authority.value) {
|
|
2944
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
2945
|
-
programAddress,
|
|
2946
|
-
seeds: [
|
|
2947
|
-
kit.getBytesEncoder().encode(
|
|
2948
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
2949
|
-
),
|
|
2950
|
-
kit.getAddressEncoder().encode(
|
|
2951
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
2952
|
-
)
|
|
2953
|
-
]
|
|
2954
|
-
});
|
|
2955
|
-
}
|
|
2956
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2957
|
-
return Object.freeze({
|
|
2958
|
-
accounts: [
|
|
2959
|
-
getAccountMeta("config", accounts.config),
|
|
2960
|
-
getAccountMeta("pool", accounts.pool),
|
|
2961
|
-
getAccountMeta("authority", accounts.authority),
|
|
2962
|
-
getAccountMeta("vaultIn", accounts.vaultIn),
|
|
2963
|
-
getAccountMeta("vaultOut", accounts.vaultOut),
|
|
2964
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
2965
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
2966
|
-
getAccountMeta("userIn", accounts.userIn),
|
|
2967
|
-
getAccountMeta("userOut", accounts.userOut),
|
|
2968
|
-
getAccountMeta("trader", accounts.trader),
|
|
2969
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
2970
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
2971
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
2972
|
-
],
|
|
2973
|
-
data: getSwapExactInInstructionDataEncoder().encode(
|
|
2974
|
-
args
|
|
2975
|
-
),
|
|
2976
|
-
programAddress
|
|
2977
|
-
});
|
|
2978
|
-
}
|
|
2979
|
-
function getSwapExactInInstruction(input, config) {
|
|
2980
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
2981
|
-
const originalAccounts = {
|
|
2982
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2983
|
-
pool: { value: input.pool ?? null, isWritable: true },
|
|
2984
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
2985
|
-
vaultIn: { value: input.vaultIn ?? null, isWritable: true },
|
|
2986
|
-
vaultOut: { value: input.vaultOut ?? null, isWritable: true },
|
|
2987
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
2988
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
2989
|
-
userIn: { value: input.userIn ?? null, isWritable: true },
|
|
2990
|
-
userOut: { value: input.userOut ?? null, isWritable: true },
|
|
2991
|
-
trader: { value: input.trader ?? null, isWritable: false },
|
|
2992
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
2993
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false },
|
|
2994
|
-
oracle: { value: input.oracle ?? null, isWritable: true }
|
|
2995
|
-
};
|
|
2996
|
-
const accounts = originalAccounts;
|
|
2997
|
-
const args = { ...input };
|
|
2998
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
2999
|
-
return Object.freeze({
|
|
3000
|
-
accounts: [
|
|
3001
|
-
getAccountMeta("config", accounts.config),
|
|
3002
|
-
getAccountMeta("pool", accounts.pool),
|
|
3003
|
-
getAccountMeta("authority", accounts.authority),
|
|
3004
|
-
getAccountMeta("vaultIn", accounts.vaultIn),
|
|
3005
|
-
getAccountMeta("vaultOut", accounts.vaultOut),
|
|
3006
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
3007
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
3008
|
-
getAccountMeta("userIn", accounts.userIn),
|
|
3009
|
-
getAccountMeta("userOut", accounts.userOut),
|
|
3010
|
-
getAccountMeta("trader", accounts.trader),
|
|
3011
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
3012
|
-
getAccountMeta("token1Program", accounts.token1Program),
|
|
3013
|
-
getAccountMeta("oracle", accounts.oracle)
|
|
3014
|
-
],
|
|
3015
|
-
data: getSwapExactInInstructionDataEncoder().encode(
|
|
3016
|
-
args
|
|
3017
|
-
),
|
|
3018
|
-
programAddress
|
|
3019
|
-
});
|
|
3020
|
-
}
|
|
3021
|
-
function parseSwapExactInInstruction(instruction) {
|
|
3022
|
-
if (instruction.accounts.length < 13) {
|
|
3023
|
-
throw new kit.SolanaError(
|
|
3024
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3025
|
-
{
|
|
3026
|
-
actualAccountMetas: instruction.accounts.length,
|
|
3027
|
-
expectedAccountMetas: 13
|
|
3028
|
-
}
|
|
3029
|
-
);
|
|
3030
|
-
}
|
|
3031
|
-
let accountIndex = 0;
|
|
3032
|
-
const getNextAccount = () => {
|
|
3033
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3034
|
-
accountIndex += 1;
|
|
3035
|
-
return accountMeta;
|
|
3036
|
-
};
|
|
3037
|
-
const getNextOptionalAccount = () => {
|
|
3038
|
-
const accountMeta = getNextAccount();
|
|
3039
|
-
return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
3040
|
-
};
|
|
3041
|
-
return {
|
|
3042
|
-
programAddress: instruction.programAddress,
|
|
3043
|
-
accounts: {
|
|
3044
|
-
config: getNextAccount(),
|
|
3045
|
-
pool: getNextAccount(),
|
|
3046
|
-
authority: getNextAccount(),
|
|
3047
|
-
vaultIn: getNextAccount(),
|
|
3048
|
-
vaultOut: getNextAccount(),
|
|
3049
|
-
token0Mint: getNextAccount(),
|
|
3050
|
-
token1Mint: getNextAccount(),
|
|
3051
|
-
userIn: getNextAccount(),
|
|
3052
|
-
userOut: getNextAccount(),
|
|
3053
|
-
trader: getNextAccount(),
|
|
3054
|
-
token0Program: getNextAccount(),
|
|
3055
|
-
token1Program: getNextAccount(),
|
|
3056
|
-
oracle: getNextOptionalAccount()
|
|
3057
|
-
},
|
|
3058
|
-
data: getSwapExactInInstructionDataDecoder().decode(instruction.data)
|
|
3059
|
-
};
|
|
3060
|
-
}
|
|
3061
|
-
var TRANSFER_ADMIN_DISCRIMINATOR = new Uint8Array([
|
|
3062
|
-
42,
|
|
3063
|
-
242,
|
|
3064
|
-
66,
|
|
3065
|
-
106,
|
|
3066
|
-
228,
|
|
3067
|
-
10,
|
|
3068
|
-
111,
|
|
3069
|
-
156
|
|
3070
|
-
]);
|
|
3071
|
-
function getTransferAdminDiscriminatorBytes() {
|
|
3072
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3073
|
-
TRANSFER_ADMIN_DISCRIMINATOR
|
|
3074
|
-
);
|
|
3075
|
-
}
|
|
3076
|
-
function getTransferAdminInstructionDataEncoder() {
|
|
3077
|
-
return kit.transformEncoder(
|
|
3078
|
-
kit.getStructEncoder([
|
|
3079
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3080
|
-
["newAdmin", kit.getAddressEncoder()]
|
|
3081
|
-
]),
|
|
3082
|
-
(value) => ({ ...value, discriminator: TRANSFER_ADMIN_DISCRIMINATOR })
|
|
3083
|
-
);
|
|
3084
|
-
}
|
|
3085
|
-
function getTransferAdminInstructionDataDecoder() {
|
|
3086
|
-
return kit.getStructDecoder([
|
|
3087
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3088
|
-
["newAdmin", kit.getAddressDecoder()]
|
|
3089
|
-
]);
|
|
3090
|
-
}
|
|
3091
|
-
function getTransferAdminInstructionDataCodec() {
|
|
3092
|
-
return kit.combineCodec(
|
|
3093
|
-
getTransferAdminInstructionDataEncoder(),
|
|
3094
|
-
getTransferAdminInstructionDataDecoder()
|
|
3095
|
-
);
|
|
3096
|
-
}
|
|
3097
|
-
function getTransferAdminInstruction(input, config) {
|
|
3098
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
3099
|
-
const originalAccounts = {
|
|
3100
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
3101
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
3102
|
-
};
|
|
3103
|
-
const accounts = originalAccounts;
|
|
3104
|
-
const args = { ...input };
|
|
3105
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3106
|
-
return Object.freeze({
|
|
3107
|
-
accounts: [
|
|
3108
|
-
getAccountMeta("config", accounts.config),
|
|
3109
|
-
getAccountMeta("admin", accounts.admin)
|
|
3110
|
-
],
|
|
3111
|
-
data: getTransferAdminInstructionDataEncoder().encode(
|
|
3112
|
-
args
|
|
3113
|
-
),
|
|
3114
|
-
programAddress
|
|
3115
|
-
});
|
|
3116
|
-
}
|
|
3117
|
-
function parseTransferAdminInstruction(instruction) {
|
|
3118
|
-
if (instruction.accounts.length < 2) {
|
|
3119
|
-
throw new kit.SolanaError(
|
|
3120
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3121
|
-
{
|
|
3122
|
-
actualAccountMetas: instruction.accounts.length,
|
|
3123
|
-
expectedAccountMetas: 2
|
|
3124
|
-
}
|
|
3125
|
-
);
|
|
3126
|
-
}
|
|
3127
|
-
let accountIndex = 0;
|
|
3128
|
-
const getNextAccount = () => {
|
|
3129
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3130
|
-
accountIndex += 1;
|
|
3131
|
-
return accountMeta;
|
|
3132
|
-
};
|
|
3133
|
-
return {
|
|
3134
|
-
programAddress: instruction.programAddress,
|
|
3135
|
-
accounts: { config: getNextAccount(), admin: getNextAccount() },
|
|
3136
|
-
data: getTransferAdminInstructionDataDecoder().decode(instruction.data)
|
|
3137
|
-
};
|
|
3138
|
-
}
|
|
3139
|
-
var UNPAUSE_DISCRIMINATOR = new Uint8Array([
|
|
3140
|
-
169,
|
|
3141
|
-
144,
|
|
3142
|
-
4,
|
|
3143
|
-
38,
|
|
3144
|
-
10,
|
|
3145
|
-
141,
|
|
3146
|
-
188,
|
|
3147
|
-
255
|
|
3148
|
-
]);
|
|
3149
|
-
function getUnpauseDiscriminatorBytes() {
|
|
3150
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(UNPAUSE_DISCRIMINATOR);
|
|
3151
|
-
}
|
|
3152
|
-
function getUnpauseInstructionDataEncoder() {
|
|
3153
|
-
return kit.transformEncoder(
|
|
3154
|
-
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
3155
|
-
(value) => ({ ...value, discriminator: UNPAUSE_DISCRIMINATOR })
|
|
3156
|
-
);
|
|
3157
|
-
}
|
|
3158
|
-
function getUnpauseInstructionDataDecoder() {
|
|
3159
|
-
return kit.getStructDecoder([
|
|
3160
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
|
|
3161
|
-
]);
|
|
3162
|
-
}
|
|
3163
|
-
function getUnpauseInstructionDataCodec() {
|
|
3164
|
-
return kit.combineCodec(
|
|
3165
|
-
getUnpauseInstructionDataEncoder(),
|
|
3166
|
-
getUnpauseInstructionDataDecoder()
|
|
3167
|
-
);
|
|
3168
|
-
}
|
|
3169
|
-
function getUnpauseInstruction(input, config) {
|
|
3170
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
3171
|
-
const originalAccounts = {
|
|
3172
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
3173
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
3174
|
-
};
|
|
3175
|
-
const accounts = originalAccounts;
|
|
3176
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3177
|
-
return Object.freeze({
|
|
3178
|
-
accounts: [
|
|
3179
|
-
getAccountMeta("config", accounts.config),
|
|
3180
|
-
getAccountMeta("admin", accounts.admin)
|
|
3181
|
-
],
|
|
3182
|
-
data: getUnpauseInstructionDataEncoder().encode({}),
|
|
3183
|
-
programAddress
|
|
3184
|
-
});
|
|
3185
|
-
}
|
|
3186
|
-
function parseUnpauseInstruction(instruction) {
|
|
3187
|
-
if (instruction.accounts.length < 2) {
|
|
3188
|
-
throw new kit.SolanaError(
|
|
3189
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3190
|
-
{
|
|
3191
|
-
actualAccountMetas: instruction.accounts.length,
|
|
3192
|
-
expectedAccountMetas: 2
|
|
3193
|
-
}
|
|
3194
|
-
);
|
|
3195
|
-
}
|
|
3196
|
-
let accountIndex = 0;
|
|
3197
|
-
const getNextAccount = () => {
|
|
3198
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3199
|
-
accountIndex += 1;
|
|
3200
|
-
return accountMeta;
|
|
3201
|
-
};
|
|
3202
|
-
return {
|
|
3203
|
-
programAddress: instruction.programAddress,
|
|
3204
|
-
accounts: { config: getNextAccount(), admin: getNextAccount() },
|
|
3205
|
-
data: getUnpauseInstructionDataDecoder().decode(instruction.data)
|
|
3206
|
-
};
|
|
3207
|
-
}
|
|
3208
|
-
var UPDATE_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
3209
|
-
29,
|
|
3210
|
-
158,
|
|
3211
|
-
252,
|
|
3212
|
-
191,
|
|
3213
|
-
10,
|
|
3214
|
-
83,
|
|
3215
|
-
219,
|
|
3216
|
-
99
|
|
3217
|
-
]);
|
|
3218
|
-
function getUpdateConfigDiscriminatorBytes() {
|
|
3219
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3220
|
-
UPDATE_CONFIG_DISCRIMINATOR
|
|
3221
|
-
);
|
|
3222
|
-
}
|
|
3223
|
-
function getUpdateConfigInstructionDataEncoder() {
|
|
3224
|
-
return kit.transformEncoder(
|
|
3225
|
-
kit.getStructEncoder([
|
|
3226
|
-
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3227
|
-
["numeraireMint", kit.getAddressEncoder()],
|
|
3228
|
-
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
3229
|
-
["maxFeeSplitBps", kit.getU16Encoder()],
|
|
3230
|
-
["maxRouteHops", kit.getU8Encoder()],
|
|
3231
|
-
["protocolFeeEnabled", kit.getBooleanEncoder()],
|
|
3232
|
-
["protocolFeeBps", kit.getU16Encoder()],
|
|
3233
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
3234
|
-
]),
|
|
3235
|
-
(value) => ({ ...value, discriminator: UPDATE_CONFIG_DISCRIMINATOR })
|
|
3236
|
-
);
|
|
3237
|
-
}
|
|
3238
|
-
function getUpdateConfigInstructionDataDecoder() {
|
|
3239
|
-
return kit.getStructDecoder([
|
|
3240
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3241
|
-
["numeraireMint", kit.getAddressDecoder()],
|
|
3242
|
-
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
3243
|
-
["maxFeeSplitBps", kit.getU16Decoder()],
|
|
3244
|
-
["maxRouteHops", kit.getU8Decoder()],
|
|
3245
|
-
["protocolFeeEnabled", kit.getBooleanDecoder()],
|
|
3246
|
-
["protocolFeeBps", kit.getU16Decoder()],
|
|
3247
|
-
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
3248
|
-
]);
|
|
3249
|
-
}
|
|
3250
|
-
function getUpdateConfigInstructionDataCodec() {
|
|
3251
|
-
return kit.combineCodec(
|
|
3252
|
-
getUpdateConfigInstructionDataEncoder(),
|
|
3253
|
-
getUpdateConfigInstructionDataDecoder()
|
|
3254
|
-
);
|
|
3255
|
-
}
|
|
3256
|
-
function getUpdateConfigInstruction(input, config) {
|
|
3257
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
3258
|
-
const originalAccounts = {
|
|
3259
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
3260
|
-
admin: { value: input.admin ?? null, isWritable: false }
|
|
3261
|
-
};
|
|
3262
|
-
const accounts = originalAccounts;
|
|
3263
|
-
const args = { ...input };
|
|
3264
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3265
|
-
return Object.freeze({
|
|
3266
|
-
accounts: [
|
|
3267
|
-
getAccountMeta("config", accounts.config),
|
|
3268
|
-
getAccountMeta("admin", accounts.admin)
|
|
3269
|
-
],
|
|
3270
|
-
data: getUpdateConfigInstructionDataEncoder().encode(
|
|
3271
|
-
args
|
|
3272
|
-
),
|
|
3273
|
-
programAddress
|
|
3274
|
-
});
|
|
3275
|
-
}
|
|
3276
|
-
function parseUpdateConfigInstruction(instruction) {
|
|
3277
|
-
if (instruction.accounts.length < 2) {
|
|
3278
|
-
throw new kit.SolanaError(
|
|
3279
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3280
|
-
{
|
|
3281
|
-
actualAccountMetas: instruction.accounts.length,
|
|
3282
|
-
expectedAccountMetas: 2
|
|
3283
|
-
}
|
|
3284
|
-
);
|
|
3285
|
-
}
|
|
3286
|
-
let accountIndex = 0;
|
|
3287
|
-
const getNextAccount = () => {
|
|
3288
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3289
|
-
accountIndex += 1;
|
|
3290
|
-
return accountMeta;
|
|
3291
|
-
};
|
|
3292
|
-
return {
|
|
3293
|
-
programAddress: instruction.programAddress,
|
|
3294
|
-
accounts: { config: getNextAccount(), admin: getNextAccount() },
|
|
3295
|
-
data: getUpdateConfigInstructionDataDecoder().decode(instruction.data)
|
|
3296
|
-
};
|
|
3297
|
-
}
|
|
3298
|
-
var WITHDRAW_VAULT_EXCESS_DISCRIMINATOR = new Uint8Array([
|
|
3299
|
-
235,
|
|
3300
|
-
197,
|
|
3301
|
-
247,
|
|
3302
|
-
177,
|
|
3303
|
-
137,
|
|
3304
|
-
72,
|
|
3305
|
-
135,
|
|
3306
|
-
113
|
|
3307
|
-
]);
|
|
3308
|
-
function getWithdrawVaultExcessDiscriminatorBytes() {
|
|
3309
|
-
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3310
|
-
WITHDRAW_VAULT_EXCESS_DISCRIMINATOR
|
|
3311
|
-
);
|
|
3312
|
-
}
|
|
3313
|
-
function getWithdrawVaultExcessInstructionDataEncoder() {
|
|
3314
|
-
return kit.transformEncoder(
|
|
3315
|
-
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
3316
|
-
(value) => ({
|
|
3317
|
-
...value,
|
|
3318
|
-
discriminator: WITHDRAW_VAULT_EXCESS_DISCRIMINATOR
|
|
3319
|
-
})
|
|
3320
|
-
);
|
|
3321
|
-
}
|
|
3322
|
-
function getWithdrawVaultExcessInstructionDataDecoder() {
|
|
3323
|
-
return kit.getStructDecoder([
|
|
3324
|
-
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
|
|
3325
|
-
]);
|
|
3326
|
-
}
|
|
3327
|
-
function getWithdrawVaultExcessInstructionDataCodec() {
|
|
3328
|
-
return kit.combineCodec(
|
|
3329
|
-
getWithdrawVaultExcessInstructionDataEncoder(),
|
|
3330
|
-
getWithdrawVaultExcessInstructionDataDecoder()
|
|
3331
|
-
);
|
|
3332
|
-
}
|
|
3333
|
-
async function getWithdrawVaultExcessInstructionAsync(input, config) {
|
|
3334
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
3335
|
-
const originalAccounts = {
|
|
3336
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
3337
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
3338
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
3339
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
3340
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
3341
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
3342
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
3343
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
3344
|
-
adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
|
|
3345
|
-
adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
|
|
3346
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
3347
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
3348
|
-
};
|
|
3349
|
-
const accounts = originalAccounts;
|
|
3350
|
-
if (!accounts.authority.value) {
|
|
3351
|
-
accounts.authority.value = await kit.getProgramDerivedAddress({
|
|
3352
|
-
programAddress,
|
|
3353
|
-
seeds: [
|
|
3354
|
-
kit.getBytesEncoder().encode(
|
|
3355
|
-
new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
|
|
3356
|
-
),
|
|
3357
|
-
kit.getAddressEncoder().encode(
|
|
3358
|
-
programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
|
|
3359
|
-
)
|
|
3360
|
-
]
|
|
3361
|
-
});
|
|
3362
|
-
}
|
|
3363
|
-
if (!accounts.adminAta0.value) {
|
|
3364
|
-
accounts.adminAta0.value = await kit.getProgramDerivedAddress({
|
|
3365
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
3366
|
-
seeds: [
|
|
3367
|
-
kit.getAddressEncoder().encode(
|
|
3368
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3369
|
-
"admin",
|
|
3370
|
-
accounts.admin.value
|
|
3371
|
-
)
|
|
3372
|
-
),
|
|
3373
|
-
kit.getAddressEncoder().encode(
|
|
3374
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3375
|
-
"token0Program",
|
|
3376
|
-
accounts.token0Program.value
|
|
3377
|
-
)
|
|
3378
|
-
),
|
|
3379
|
-
kit.getAddressEncoder().encode(
|
|
3380
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3381
|
-
"token0Mint",
|
|
3382
|
-
accounts.token0Mint.value
|
|
3383
|
-
)
|
|
3384
|
-
)
|
|
3385
|
-
]
|
|
3386
|
-
});
|
|
3387
|
-
}
|
|
3388
|
-
if (!accounts.adminAta1.value) {
|
|
3389
|
-
accounts.adminAta1.value = await kit.getProgramDerivedAddress({
|
|
3390
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
3391
|
-
seeds: [
|
|
3392
|
-
kit.getAddressEncoder().encode(
|
|
3393
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3394
|
-
"admin",
|
|
3395
|
-
accounts.admin.value
|
|
3396
|
-
)
|
|
3397
|
-
),
|
|
3398
|
-
kit.getAddressEncoder().encode(
|
|
3399
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3400
|
-
"token1Program",
|
|
3401
|
-
accounts.token1Program.value
|
|
3402
|
-
)
|
|
3403
|
-
),
|
|
3404
|
-
kit.getAddressEncoder().encode(
|
|
3405
|
-
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3406
|
-
"token1Mint",
|
|
3407
|
-
accounts.token1Mint.value
|
|
3408
|
-
)
|
|
3409
|
-
)
|
|
3410
|
-
]
|
|
3411
|
-
});
|
|
3412
|
-
}
|
|
3413
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3414
|
-
return Object.freeze({
|
|
3415
|
-
accounts: [
|
|
3416
|
-
getAccountMeta("config", accounts.config),
|
|
3417
|
-
getAccountMeta("pool", accounts.pool),
|
|
3418
|
-
getAccountMeta("admin", accounts.admin),
|
|
3419
|
-
getAccountMeta("authority", accounts.authority),
|
|
3420
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
3421
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
3422
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
3423
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
3424
|
-
getAccountMeta("adminAta0", accounts.adminAta0),
|
|
3425
|
-
getAccountMeta("adminAta1", accounts.adminAta1),
|
|
3426
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
3427
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
3428
|
-
],
|
|
3429
|
-
data: getWithdrawVaultExcessInstructionDataEncoder().encode({}),
|
|
3430
|
-
programAddress
|
|
3431
|
-
});
|
|
3432
|
-
}
|
|
3433
|
-
function getWithdrawVaultExcessInstruction(input, config) {
|
|
3434
|
-
const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
|
|
3435
|
-
const originalAccounts = {
|
|
3436
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
3437
|
-
pool: { value: input.pool ?? null, isWritable: false },
|
|
3438
|
-
admin: { value: input.admin ?? null, isWritable: false },
|
|
3439
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
3440
|
-
vault0: { value: input.vault0 ?? null, isWritable: true },
|
|
3441
|
-
vault1: { value: input.vault1 ?? null, isWritable: true },
|
|
3442
|
-
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
3443
|
-
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
3444
|
-
adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
|
|
3445
|
-
adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
|
|
3446
|
-
token0Program: { value: input.token0Program ?? null, isWritable: false },
|
|
3447
|
-
token1Program: { value: input.token1Program ?? null, isWritable: false }
|
|
3448
|
-
};
|
|
3449
|
-
const accounts = originalAccounts;
|
|
3450
|
-
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3451
|
-
return Object.freeze({
|
|
3452
|
-
accounts: [
|
|
3453
|
-
getAccountMeta("config", accounts.config),
|
|
3454
|
-
getAccountMeta("pool", accounts.pool),
|
|
3455
|
-
getAccountMeta("admin", accounts.admin),
|
|
3456
|
-
getAccountMeta("authority", accounts.authority),
|
|
3457
|
-
getAccountMeta("vault0", accounts.vault0),
|
|
3458
|
-
getAccountMeta("vault1", accounts.vault1),
|
|
3459
|
-
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
3460
|
-
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
3461
|
-
getAccountMeta("adminAta0", accounts.adminAta0),
|
|
3462
|
-
getAccountMeta("adminAta1", accounts.adminAta1),
|
|
3463
|
-
getAccountMeta("token0Program", accounts.token0Program),
|
|
3464
|
-
getAccountMeta("token1Program", accounts.token1Program)
|
|
3465
|
-
],
|
|
3466
|
-
data: getWithdrawVaultExcessInstructionDataEncoder().encode({}),
|
|
3467
|
-
programAddress
|
|
3468
|
-
});
|
|
3469
|
-
}
|
|
3470
|
-
function parseWithdrawVaultExcessInstruction(instruction) {
|
|
3471
|
-
if (instruction.accounts.length < 12) {
|
|
3472
|
-
throw new kit.SolanaError(
|
|
3473
|
-
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3474
|
-
{
|
|
3475
|
-
actualAccountMetas: instruction.accounts.length,
|
|
3476
|
-
expectedAccountMetas: 12
|
|
3477
|
-
}
|
|
3478
|
-
);
|
|
3479
|
-
}
|
|
3480
|
-
let accountIndex = 0;
|
|
3481
|
-
const getNextAccount = () => {
|
|
3482
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3483
|
-
accountIndex += 1;
|
|
3484
|
-
return accountMeta;
|
|
3485
|
-
};
|
|
3486
|
-
return {
|
|
3487
|
-
programAddress: instruction.programAddress,
|
|
3488
|
-
accounts: {
|
|
3489
|
-
config: getNextAccount(),
|
|
3490
|
-
pool: getNextAccount(),
|
|
3491
|
-
admin: getNextAccount(),
|
|
3492
|
-
authority: getNextAccount(),
|
|
3493
|
-
vault0: getNextAccount(),
|
|
3494
|
-
vault1: getNextAccount(),
|
|
3495
|
-
token0Mint: getNextAccount(),
|
|
3496
|
-
token1Mint: getNextAccount(),
|
|
3497
|
-
adminAta0: getNextAccount(),
|
|
3498
|
-
adminAta1: getNextAccount(),
|
|
3499
|
-
token0Program: getNextAccount(),
|
|
3500
|
-
token1Program: getNextAccount()
|
|
3501
|
-
},
|
|
3502
|
-
data: getWithdrawVaultExcessInstructionDataDecoder().decode(
|
|
3503
|
-
instruction.data
|
|
3504
|
-
)
|
|
3505
|
-
};
|
|
3506
|
-
}
|
|
3507
633
|
function isTransactionSigner(value) {
|
|
3508
634
|
return typeof value === "object" && value !== null && "address" in value && "signTransactions" in value;
|
|
3509
635
|
}
|
|
@@ -3541,12 +667,12 @@ function createSwapInstruction(params) {
|
|
|
3541
667
|
token0Program,
|
|
3542
668
|
token1Program,
|
|
3543
669
|
tokenProgram,
|
|
3544
|
-
programId = CPMM_PROGRAM_ADDRESS
|
|
670
|
+
programId = chunkKJ6W44WF_cjs.CPMM_PROGRAM_ADDRESS
|
|
3545
671
|
} = params;
|
|
3546
672
|
const trader = typeof user === "string" ? kit.createNoopSigner(user) : user;
|
|
3547
673
|
const [vaultIn, vaultOut] = tradeDirection === 0 ? [vault0, vault1] : [vault1, vault0];
|
|
3548
674
|
const [userIn, userOut] = tradeDirection === 0 ? [userToken0, userToken1] : [userToken1, userToken0];
|
|
3549
|
-
const instruction = getSwapExactInInstruction(
|
|
675
|
+
const instruction = chunkKJ6W44WF_cjs.getSwapExactInInstruction(
|
|
3550
676
|
{
|
|
3551
677
|
config,
|
|
3552
678
|
pool,
|
|
@@ -3558,8 +684,8 @@ function createSwapInstruction(params) {
|
|
|
3558
684
|
userIn,
|
|
3559
685
|
userOut,
|
|
3560
686
|
trader,
|
|
3561
|
-
token0Program: token0Program ?? tokenProgram ??
|
|
3562
|
-
token1Program: token1Program ?? tokenProgram ??
|
|
687
|
+
token0Program: token0Program ?? tokenProgram ?? chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
688
|
+
token1Program: token1Program ?? tokenProgram ?? chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3563
689
|
oracle,
|
|
3564
690
|
amountIn,
|
|
3565
691
|
minAmountOut,
|
|
@@ -3587,8 +713,8 @@ function base64ToBytes(base64) {
|
|
|
3587
713
|
}
|
|
3588
714
|
return bytes;
|
|
3589
715
|
}
|
|
3590
|
-
async function fetchConfig(rpc, programId =
|
|
3591
|
-
const [configAddress] = await
|
|
716
|
+
async function fetchConfig(rpc, programId = chunkY6TJIH33_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
717
|
+
const [configAddress] = await chunkY6TJIH33_cjs.getConfigAddress(programId);
|
|
3592
718
|
const response = await rpc.getAccountInfo(configAddress, {
|
|
3593
719
|
encoding: "base64",
|
|
3594
720
|
commitment
|
|
@@ -3596,10 +722,10 @@ async function fetchConfig(rpc, programId = chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID, c
|
|
|
3596
722
|
if (!response.value) {
|
|
3597
723
|
return null;
|
|
3598
724
|
}
|
|
3599
|
-
return
|
|
725
|
+
return chunkKJ6W44WF_cjs.decodeAmmConfig(base64ToBytes(response.value.data[0]));
|
|
3600
726
|
}
|
|
3601
|
-
async function fetchConfigWithAddress(rpc, programId =
|
|
3602
|
-
const [configAddress] = await
|
|
727
|
+
async function fetchConfigWithAddress(rpc, programId = chunkY6TJIH33_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
728
|
+
const [configAddress] = await chunkY6TJIH33_cjs.getConfigAddress(programId);
|
|
3603
729
|
const account = await fetchConfig(rpc, programId, commitment);
|
|
3604
730
|
if (!account) {
|
|
3605
731
|
return null;
|
|
@@ -4562,8 +1688,11 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
4562
1688
|
SEED_LAUNCH: () => SEED_LAUNCH,
|
|
4563
1689
|
SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
|
|
4564
1690
|
SEED_LAUNCH_FEE_STATE: () => SEED_LAUNCH_FEE_STATE,
|
|
1691
|
+
SOLANA_TRANSACTION_SIZE_LIMIT: () => SOLANA_TRANSACTION_SIZE_LIMIT,
|
|
4565
1692
|
TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
|
|
4566
1693
|
TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
|
|
1694
|
+
assertTransactionMessageFits: () => assertTransactionMessageFits,
|
|
1695
|
+
assertTransactionMessageFitsWithLookupTable: () => assertTransactionMessageFitsWithLookupTable,
|
|
4567
1696
|
buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
|
|
4568
1697
|
compressTransactionMessageWithLookupTable: () => compressTransactionMessageWithLookupTable,
|
|
4569
1698
|
computeRemainingAccountsHash: () => computeRemainingAccountsHash,
|
|
@@ -4609,6 +1738,8 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
4609
1738
|
getTokenMetadataAddress: () => getTokenMetadataAddress,
|
|
4610
1739
|
launchExists: () => launchExists,
|
|
4611
1740
|
launchIdFromU64: () => launchIdFromU64,
|
|
1741
|
+
measureTransactionMessageSize: () => measureTransactionMessageSize,
|
|
1742
|
+
measureTransactionMessageSizeWithLookupTable: () => measureTransactionMessageSizeWithLookupTable,
|
|
4612
1743
|
phaseLabel: () => phaseLabel
|
|
4613
1744
|
});
|
|
4614
1745
|
var INITIALIZER_PROGRAM_ID = kit.address(
|
|
@@ -4860,6 +1991,14 @@ function getFeeBeneficiaryInputDecoder() {
|
|
|
4860
1991
|
["shareBps", kit.getU16Decoder()]
|
|
4861
1992
|
]);
|
|
4862
1993
|
}
|
|
1994
|
+
var FeeClaimRole = /* @__PURE__ */ ((FeeClaimRole2) => {
|
|
1995
|
+
FeeClaimRole2[FeeClaimRole2["Protocol"] = 0] = "Protocol";
|
|
1996
|
+
FeeClaimRole2[FeeClaimRole2["Beneficiary"] = 1] = "Beneficiary";
|
|
1997
|
+
return FeeClaimRole2;
|
|
1998
|
+
})(FeeClaimRole || {});
|
|
1999
|
+
function getFeeClaimRoleEncoder() {
|
|
2000
|
+
return kit.getEnumEncoder(FeeClaimRole);
|
|
2001
|
+
}
|
|
4863
2002
|
function getInitializeConfigArgsEncoder2() {
|
|
4864
2003
|
return kit.getStructEncoder([
|
|
4865
2004
|
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
@@ -4899,11 +2038,9 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
4899
2038
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
4900
2039
|
["allowBuy", kit.getU8Encoder()],
|
|
4901
2040
|
["allowSell", kit.getU8Encoder()],
|
|
4902
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
4903
2041
|
["hookFlags", kit.getU32Encoder()],
|
|
4904
2042
|
["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
4905
2043
|
["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
|
|
4906
|
-
["migratorProgram", kit.getAddressEncoder()],
|
|
4907
2044
|
[
|
|
4908
2045
|
"migratorInitPayload",
|
|
4909
2046
|
kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
|
|
@@ -4940,11 +2077,9 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
4940
2077
|
["curveParams", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
4941
2078
|
["allowBuy", kit.getU8Decoder()],
|
|
4942
2079
|
["allowSell", kit.getU8Decoder()],
|
|
4943
|
-
["hookProgram", kit.getAddressDecoder()],
|
|
4944
2080
|
["hookFlags", kit.getU32Decoder()],
|
|
4945
2081
|
["hookPayload", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
4946
2082
|
["hookCreateRemainingAccountsLen", kit.getU32Decoder()],
|
|
4947
|
-
["migratorProgram", kit.getAddressDecoder()],
|
|
4948
2083
|
[
|
|
4949
2084
|
"migratorInitPayload",
|
|
4950
2085
|
kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())
|
|
@@ -5097,7 +2232,6 @@ function getLaunchFeeStateEncoder() {
|
|
|
5097
2232
|
kit.getStructEncoder([
|
|
5098
2233
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5099
2234
|
["launch", kit.getAddressEncoder()],
|
|
5100
|
-
["protocolBeneficiary", kit.getAddressEncoder()],
|
|
5101
2235
|
["beneficiaryLen", kit.getU8Encoder()],
|
|
5102
2236
|
["bump", kit.getU8Encoder()],
|
|
5103
2237
|
["protocolFeeBps", kit.getU16Encoder()],
|
|
@@ -5129,7 +2263,6 @@ function getLaunchFeeStateDecoder() {
|
|
|
5129
2263
|
return kit.getStructDecoder([
|
|
5130
2264
|
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
5131
2265
|
["launch", kit.getAddressDecoder()],
|
|
5132
|
-
["protocolBeneficiary", kit.getAddressDecoder()],
|
|
5133
2266
|
["beneficiaryLen", kit.getU8Decoder()],
|
|
5134
2267
|
["bump", kit.getU8Decoder()],
|
|
5135
2268
|
["protocolFeeBps", kit.getU16Decoder()],
|
|
@@ -5167,20 +2300,23 @@ var CLAIM_FEES_DISCRIMINATOR = new Uint8Array([
|
|
|
5167
2300
|
]);
|
|
5168
2301
|
function getClaimFeesInstructionDataEncoder() {
|
|
5169
2302
|
return kit.transformEncoder(
|
|
5170
|
-
kit.getStructEncoder([
|
|
2303
|
+
kit.getStructEncoder([
|
|
2304
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2305
|
+
["role", getFeeClaimRoleEncoder()]
|
|
2306
|
+
]),
|
|
5171
2307
|
(value) => ({ ...value, discriminator: CLAIM_FEES_DISCRIMINATOR })
|
|
5172
2308
|
);
|
|
5173
2309
|
}
|
|
5174
2310
|
async function getClaimFeesInstructionAsync(input, config) {
|
|
5175
2311
|
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5176
2312
|
const originalAccounts = {
|
|
2313
|
+
config: { value: input.config ?? null, isWritable: false },
|
|
5177
2314
|
launch: { value: input.launch ?? null, isWritable: false },
|
|
5178
2315
|
launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
|
|
5179
2316
|
launchAuthority: {
|
|
5180
2317
|
value: input.launchAuthority ?? null,
|
|
5181
2318
|
isWritable: false
|
|
5182
2319
|
},
|
|
5183
|
-
recipient: { value: input.recipient ?? null, isWritable: false },
|
|
5184
2320
|
baseMint: { value: input.baseMint ?? null, isWritable: false },
|
|
5185
2321
|
quoteMint: { value: input.quoteMint ?? null, isWritable: false },
|
|
5186
2322
|
baseVault: { value: input.baseVault ?? null, isWritable: true },
|
|
@@ -5203,6 +2339,15 @@ async function getClaimFeesInstructionAsync(input, config) {
|
|
|
5203
2339
|
}
|
|
5204
2340
|
};
|
|
5205
2341
|
const accounts = originalAccounts;
|
|
2342
|
+
const args = { ...input };
|
|
2343
|
+
if (!accounts.config.value) {
|
|
2344
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2345
|
+
programAddress,
|
|
2346
|
+
seeds: [
|
|
2347
|
+
kit.getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
|
|
2348
|
+
]
|
|
2349
|
+
});
|
|
2350
|
+
}
|
|
5206
2351
|
if (!accounts.launchFeeState.value) {
|
|
5207
2352
|
accounts.launchFeeState.value = await kit.getProgramDerivedAddress({
|
|
5208
2353
|
programAddress,
|
|
@@ -5272,10 +2417,10 @@ async function getClaimFeesInstructionAsync(input, config) {
|
|
|
5272
2417
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5273
2418
|
return Object.freeze({
|
|
5274
2419
|
accounts: [
|
|
2420
|
+
getAccountMeta("config", accounts.config),
|
|
5275
2421
|
getAccountMeta("launch", accounts.launch),
|
|
5276
2422
|
getAccountMeta("launchFeeState", accounts.launchFeeState),
|
|
5277
2423
|
getAccountMeta("launchAuthority", accounts.launchAuthority),
|
|
5278
|
-
getAccountMeta("recipient", accounts.recipient),
|
|
5279
2424
|
getAccountMeta("baseMint", accounts.baseMint),
|
|
5280
2425
|
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
5281
2426
|
getAccountMeta("baseVault", accounts.baseVault),
|
|
@@ -5285,7 +2430,9 @@ async function getClaimFeesInstructionAsync(input, config) {
|
|
|
5285
2430
|
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
5286
2431
|
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
5287
2432
|
],
|
|
5288
|
-
data: getClaimFeesInstructionDataEncoder().encode(
|
|
2433
|
+
data: getClaimFeesInstructionDataEncoder().encode(
|
|
2434
|
+
args
|
|
2435
|
+
),
|
|
5289
2436
|
programAddress
|
|
5290
2437
|
});
|
|
5291
2438
|
}
|
|
@@ -5507,11 +2654,9 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
5507
2654
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
5508
2655
|
["allowBuy", kit.getU8Encoder()],
|
|
5509
2656
|
["allowSell", kit.getU8Encoder()],
|
|
5510
|
-
["hookProgram", kit.getAddressEncoder()],
|
|
5511
2657
|
["hookFlags", kit.getU32Encoder()],
|
|
5512
2658
|
["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
5513
2659
|
["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
|
|
5514
|
-
["migratorProgram", kit.getAddressEncoder()],
|
|
5515
2660
|
[
|
|
5516
2661
|
"migratorInitPayload",
|
|
5517
2662
|
kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
|
|
@@ -5589,6 +2734,7 @@ function getReplaceFeeBeneficiaryInstructionDataEncoder() {
|
|
|
5589
2734
|
async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
|
|
5590
2735
|
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5591
2736
|
const originalAccounts = {
|
|
2737
|
+
config: { value: input.config ?? null, isWritable: false },
|
|
5592
2738
|
launch: { value: input.launch ?? null, isWritable: false },
|
|
5593
2739
|
launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
|
|
5594
2740
|
currentBeneficiary: {
|
|
@@ -5598,6 +2744,14 @@ async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
|
|
|
5598
2744
|
};
|
|
5599
2745
|
const accounts = originalAccounts;
|
|
5600
2746
|
const args = { ...input };
|
|
2747
|
+
if (!accounts.config.value) {
|
|
2748
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
2749
|
+
programAddress,
|
|
2750
|
+
seeds: [
|
|
2751
|
+
kit.getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
|
|
2752
|
+
]
|
|
2753
|
+
});
|
|
2754
|
+
}
|
|
5601
2755
|
if (!accounts.launchFeeState.value) {
|
|
5602
2756
|
accounts.launchFeeState.value = await kit.getProgramDerivedAddress({
|
|
5603
2757
|
programAddress,
|
|
@@ -5634,6 +2788,7 @@ async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
|
|
|
5634
2788
|
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5635
2789
|
return Object.freeze({
|
|
5636
2790
|
accounts: [
|
|
2791
|
+
getAccountMeta("config", accounts.config),
|
|
5637
2792
|
getAccountMeta("launch", accounts.launch),
|
|
5638
2793
|
getAccountMeta("launchFeeState", accounts.launchFeeState),
|
|
5639
2794
|
getAccountMeta("currentBeneficiary", accounts.currentBeneficiary)
|
|
@@ -5808,7 +2963,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
5808
2963
|
admin,
|
|
5809
2964
|
config,
|
|
5810
2965
|
programData,
|
|
5811
|
-
systemProgram =
|
|
2966
|
+
systemProgram = chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
5812
2967
|
} = accounts;
|
|
5813
2968
|
const keys = [
|
|
5814
2969
|
createSignerAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
@@ -6602,7 +3757,7 @@ async function fetchAllMaybeMarket(rpc, addresses, config) {
|
|
|
6602
3757
|
function getMarketSize() {
|
|
6603
3758
|
return 208;
|
|
6604
3759
|
}
|
|
6605
|
-
var
|
|
3760
|
+
var ORACLE_STATE_DISCRIMINATOR = new Uint8Array([
|
|
6606
3761
|
97,
|
|
6607
3762
|
156,
|
|
6608
3763
|
157,
|
|
@@ -6614,7 +3769,7 @@ var ORACLE_STATE_DISCRIMINATOR2 = new Uint8Array([
|
|
|
6614
3769
|
]);
|
|
6615
3770
|
function getOracleStateDiscriminatorBytes() {
|
|
6616
3771
|
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
6617
|
-
|
|
3772
|
+
ORACLE_STATE_DISCRIMINATOR
|
|
6618
3773
|
);
|
|
6619
3774
|
}
|
|
6620
3775
|
function getOracleStateEncoder() {
|
|
@@ -6629,7 +3784,7 @@ function getOracleStateEncoder() {
|
|
|
6629
3784
|
["bump", kit.getU8Encoder()],
|
|
6630
3785
|
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 31)]
|
|
6631
3786
|
]),
|
|
6632
|
-
(value) => ({ ...value, discriminator:
|
|
3787
|
+
(value) => ({ ...value, discriminator: ORACLE_STATE_DISCRIMINATOR })
|
|
6633
3788
|
);
|
|
6634
3789
|
}
|
|
6635
3790
|
function getOracleStateDecoder() {
|
|
@@ -6644,7 +3799,7 @@ function getOracleStateDecoder() {
|
|
|
6644
3799
|
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 31)]
|
|
6645
3800
|
]);
|
|
6646
3801
|
}
|
|
6647
|
-
function
|
|
3802
|
+
function getOracleStateCodec() {
|
|
6648
3803
|
return kit.combineCodec(getOracleStateEncoder(), getOracleStateDecoder());
|
|
6649
3804
|
}
|
|
6650
3805
|
function decodeOracleState2(encodedAccount) {
|
|
@@ -7865,7 +5020,7 @@ function predictionMigratorProgram() {
|
|
|
7865
5020
|
initConfig: programClientCore.addSelfFetchFunctions(client, getInitConfigCodec2()),
|
|
7866
5021
|
launch: programClientCore.addSelfFetchFunctions(client, getLaunchCodec2()),
|
|
7867
5022
|
market: programClientCore.addSelfFetchFunctions(client, getMarketCodec()),
|
|
7868
|
-
oracleState: programClientCore.addSelfFetchFunctions(client,
|
|
5023
|
+
oracleState: programClientCore.addSelfFetchFunctions(client, getOracleStateCodec())
|
|
7869
5024
|
},
|
|
7870
5025
|
instructions: {
|
|
7871
5026
|
claim: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
@@ -7955,10 +5110,10 @@ function createAccountMeta(value, role) {
|
|
|
7955
5110
|
async function getTokenMetadataAddress(mint) {
|
|
7956
5111
|
const encoder = kit.getAddressEncoder();
|
|
7957
5112
|
const [metadataAddress] = await kit.getProgramDerivedAddress({
|
|
7958
|
-
programAddress:
|
|
5113
|
+
programAddress: chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
7959
5114
|
seeds: [
|
|
7960
5115
|
new TextEncoder().encode("metadata"),
|
|
7961
|
-
encoder.encode(
|
|
5116
|
+
encoder.encode(chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
7962
5117
|
encoder.encode(mint)
|
|
7963
5118
|
]
|
|
7964
5119
|
});
|
|
@@ -7989,12 +5144,12 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
7989
5144
|
authority,
|
|
7990
5145
|
hookProgram,
|
|
7991
5146
|
migratorProgram,
|
|
7992
|
-
baseTokenProgram =
|
|
7993
|
-
quoteTokenProgram =
|
|
7994
|
-
systemProgram =
|
|
5147
|
+
baseTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5148
|
+
quoteTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5149
|
+
systemProgram = chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7995
5150
|
rent,
|
|
7996
5151
|
metadataAccount,
|
|
7997
|
-
metadataProgram =
|
|
5152
|
+
metadataProgram = chunkY6TJIH33_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
7998
5153
|
hookCreateRemainingAccounts = []
|
|
7999
5154
|
} = accounts;
|
|
8000
5155
|
const withMetadata = Boolean(
|
|
@@ -8053,9 +5208,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
8053
5208
|
feeBeneficiaries: args.feeBeneficiaries ?? [],
|
|
8054
5209
|
allowBuy: args.allowBuy ? 1 : 0,
|
|
8055
5210
|
allowSell: args.allowSell ? 1 : 0,
|
|
8056
|
-
hookProgram: args.hookProgram ?? hookProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8057
5211
|
hookCreateRemainingAccountsLen: args.hookCreateRemainingAccountsLen ?? hookCreateRemainingAccounts.length,
|
|
8058
|
-
migratorProgram: migratorProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8059
5212
|
hookCreateRemainingAccountsHash: args.hookCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(hookCreateRemainingAccountAddresses) : new Uint8Array(32))
|
|
8060
5213
|
};
|
|
8061
5214
|
const data = new Uint8Array(
|
|
@@ -8141,10 +5294,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
8141
5294
|
baseMint,
|
|
8142
5295
|
quoteMint,
|
|
8143
5296
|
user,
|
|
8144
|
-
hookProgram =
|
|
5297
|
+
hookProgram = chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8145
5298
|
launchFeeState,
|
|
8146
|
-
baseTokenProgram =
|
|
8147
|
-
quoteTokenProgram =
|
|
5299
|
+
baseTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5300
|
+
quoteTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8148
5301
|
remainingAccounts = []
|
|
8149
5302
|
} = accounts;
|
|
8150
5303
|
const keys = [
|
|
@@ -8193,9 +5346,9 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
8193
5346
|
launchFeeState,
|
|
8194
5347
|
migratorProgram,
|
|
8195
5348
|
payer,
|
|
8196
|
-
baseTokenProgram =
|
|
8197
|
-
quoteTokenProgram =
|
|
8198
|
-
systemProgram =
|
|
5349
|
+
baseTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5350
|
+
quoteTokenProgram = chunkY6TJIH33_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
5351
|
+
systemProgram = chunkY6TJIH33_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8199
5352
|
rent
|
|
8200
5353
|
} = accounts;
|
|
8201
5354
|
const keys = [
|
|
@@ -8214,7 +5367,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
8214
5367
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
8215
5368
|
{ address: rent, role: kit.AccountRole.READONLY }
|
|
8216
5369
|
];
|
|
8217
|
-
const data =
|
|
5370
|
+
const data = chunkKJ6W44WF_cjs.encodeInstructionData(
|
|
8218
5371
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
|
|
8219
5372
|
);
|
|
8220
5373
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -8280,7 +5433,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
|
|
|
8280
5433
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
8281
5434
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
8282
5435
|
];
|
|
8283
|
-
const data =
|
|
5436
|
+
const data = chunkKJ6W44WF_cjs.encodeInstructionData(
|
|
8284
5437
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
|
|
8285
5438
|
);
|
|
8286
5439
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -8359,6 +5512,39 @@ function compressTransactionMessageWithLookupTable(transactionMessage, {
|
|
|
8359
5512
|
}
|
|
8360
5513
|
);
|
|
8361
5514
|
}
|
|
5515
|
+
var SOLANA_TRANSACTION_SIZE_LIMIT = 1232;
|
|
5516
|
+
function measureTransactionMessageSize(transactionMessage) {
|
|
5517
|
+
const size = kit.getTransactionMessageSize(transactionMessage);
|
|
5518
|
+
const overBy = Math.max(0, size - SOLANA_TRANSACTION_SIZE_LIMIT);
|
|
5519
|
+
return {
|
|
5520
|
+
size,
|
|
5521
|
+
limit: SOLANA_TRANSACTION_SIZE_LIMIT,
|
|
5522
|
+
overBy,
|
|
5523
|
+
fits: overBy === 0
|
|
5524
|
+
};
|
|
5525
|
+
}
|
|
5526
|
+
function measureTransactionMessageSizeWithLookupTable(transactionMessage, lookupTable) {
|
|
5527
|
+
return measureTransactionMessageSize(
|
|
5528
|
+
compressTransactionMessageWithLookupTable(transactionMessage, lookupTable)
|
|
5529
|
+
);
|
|
5530
|
+
}
|
|
5531
|
+
function assertTransactionMessageFits(transactionMessage, { label = "Transaction", metadataBytes } = {}) {
|
|
5532
|
+
const report = measureTransactionMessageSize(transactionMessage);
|
|
5533
|
+
if (report.fits) {
|
|
5534
|
+
return report;
|
|
5535
|
+
}
|
|
5536
|
+
const metadataHint = metadataBytes && metadataBytes > 0 ? ` Metadata contributes ${metadataBytes} instruction-data bytes; address lookup tables do not compress metadata strings.` : "";
|
|
5537
|
+
throw new Error(
|
|
5538
|
+
`${label} is ${report.size} bytes, exceeding Solana's ${report.limit}-byte transaction limit by ${report.overBy} bytes.${metadataHint}`
|
|
5539
|
+
);
|
|
5540
|
+
}
|
|
5541
|
+
function assertTransactionMessageFitsWithLookupTable(transactionMessage, lookupTable, options = {}) {
|
|
5542
|
+
const compressedMessage = compressTransactionMessageWithLookupTable(
|
|
5543
|
+
transactionMessage,
|
|
5544
|
+
lookupTable
|
|
5545
|
+
);
|
|
5546
|
+
return assertTransactionMessageFits(compressedMessage, options);
|
|
5547
|
+
}
|
|
8362
5548
|
var addressCodec5 = kit.getAddressCodec();
|
|
8363
5549
|
function bytesToBase64(bytes) {
|
|
8364
5550
|
let binary = "";
|
|
@@ -8653,7 +5839,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
8653
5839
|
adminBaseAta,
|
|
8654
5840
|
adminQuoteAta,
|
|
8655
5841
|
recipientAtas,
|
|
8656
|
-
cpmmProgram =
|
|
5842
|
+
cpmmProgram = chunkY6TJIH33_cjs.CPMM_PROGRAM_ID,
|
|
8657
5843
|
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
8658
5844
|
}) {
|
|
8659
5845
|
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
@@ -8661,9 +5847,9 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
8661
5847
|
cpmmMigratorProgram
|
|
8662
5848
|
);
|
|
8663
5849
|
const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
|
|
8664
|
-
const poolInit = await
|
|
5850
|
+
const poolInit = await chunkY6TJIH33_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
|
|
8665
5851
|
const pool = poolInit.pool[0];
|
|
8666
|
-
const [launchLpPosition] = await
|
|
5852
|
+
const [launchLpPosition] = await chunkY6TJIH33_cjs.getPositionAddress(
|
|
8667
5853
|
pool,
|
|
8668
5854
|
launchAuthority,
|
|
8669
5855
|
0n,
|
|
@@ -8676,6 +5862,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
8676
5862
|
poolInit.authority[0],
|
|
8677
5863
|
poolInit.vault0[0],
|
|
8678
5864
|
poolInit.vault1[0],
|
|
5865
|
+
poolInit.protocolFeeOwner[0],
|
|
8679
5866
|
poolInit.protocolFeePosition[0],
|
|
8680
5867
|
launchLpPosition,
|
|
8681
5868
|
cpmmProgram,
|
|
@@ -8694,6 +5881,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
8694
5881
|
{ address: poolInit.authority[0], role: kit.AccountRole.READONLY },
|
|
8695
5882
|
{ address: poolInit.vault0[0], role: kit.AccountRole.WRITABLE },
|
|
8696
5883
|
{ address: poolInit.vault1[0], role: kit.AccountRole.WRITABLE },
|
|
5884
|
+
{ address: poolInit.protocolFeeOwner[0], role: kit.AccountRole.READONLY },
|
|
8697
5885
|
{ address: poolInit.protocolFeePosition[0], role: kit.AccountRole.WRITABLE },
|
|
8698
5886
|
{ address: launchLpPosition, role: kit.AccountRole.WRITABLE },
|
|
8699
5887
|
{ address: cpmmProgram, role: kit.AccountRole.READONLY },
|
|
@@ -8711,6 +5899,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
8711
5899
|
poolAuthority: poolInit.authority[0],
|
|
8712
5900
|
poolVault0: poolInit.vault0[0],
|
|
8713
5901
|
poolVault1: poolInit.vault1[0],
|
|
5902
|
+
protocolFeeOwner: poolInit.protocolFeeOwner[0],
|
|
8714
5903
|
protocolFeePosition: poolInit.protocolFeePosition[0],
|
|
8715
5904
|
launchLpPosition,
|
|
8716
5905
|
migrationAuthority
|
|
@@ -8747,11 +5936,8 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
|
|
|
8747
5936
|
LAUNCH_DISCRIMINATOR: () => LAUNCH_DISCRIMINATOR2,
|
|
8748
5937
|
MARKET_DISCRIMINATOR: () => MARKET_DISCRIMINATOR,
|
|
8749
5938
|
MIGRATE_ENTRY_DISCRIMINATOR: () => MIGRATE_ENTRY_DISCRIMINATOR,
|
|
8750
|
-
ORACLE_STATE_DISCRIMINATOR: () =>
|
|
5939
|
+
ORACLE_STATE_DISCRIMINATOR: () => ORACLE_STATE_DISCRIMINATOR,
|
|
8751
5940
|
PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED: () => PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED,
|
|
8752
|
-
PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED: () => PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED,
|
|
8753
|
-
PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED: () => PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED,
|
|
8754
|
-
PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED: () => PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED,
|
|
8755
5941
|
PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE: () => PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE,
|
|
8756
5942
|
PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID: () => PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID,
|
|
8757
5943
|
PREDICTION_MIGRATOR_ERROR__INVALID_INPUT: () => PREDICTION_MIGRATOR_ERROR__INVALID_INPUT,
|
|
@@ -8762,7 +5948,6 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
|
|
|
8762
5948
|
PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT: () => PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT,
|
|
8763
5949
|
PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED: () => PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED,
|
|
8764
5950
|
PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW: () => PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW,
|
|
8765
|
-
PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS: () => PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS,
|
|
8766
5951
|
PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED: () => PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED,
|
|
8767
5952
|
PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH: () => PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH,
|
|
8768
5953
|
PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED: () => PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED,
|
|
@@ -8868,7 +6053,7 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
|
|
|
8868
6053
|
getMigrateEntryInstructionDataCodec: () => getMigrateEntryInstructionDataCodec,
|
|
8869
6054
|
getMigrateEntryInstructionDataDecoder: () => getMigrateEntryInstructionDataDecoder,
|
|
8870
6055
|
getMigrateEntryInstructionDataEncoder: () => getMigrateEntryInstructionDataEncoder,
|
|
8871
|
-
getOracleStateCodec: () =>
|
|
6056
|
+
getOracleStateCodec: () => getOracleStateCodec,
|
|
8872
6057
|
getOracleStateDecoder: () => getOracleStateDecoder,
|
|
8873
6058
|
getOracleStateDiscriminatorBytes: () => getOracleStateDiscriminatorBytes,
|
|
8874
6059
|
getOracleStateEncoder: () => getOracleStateEncoder,
|
|
@@ -8914,10 +6099,7 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
|
|
|
8914
6099
|
});
|
|
8915
6100
|
var PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED = 6e3;
|
|
8916
6101
|
var PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH = 6001;
|
|
8917
|
-
var PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED = 6002;
|
|
8918
|
-
var PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED = 6003;
|
|
8919
6102
|
var PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED = 6004;
|
|
8920
|
-
var PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED = 6005;
|
|
8921
6103
|
var PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED = 6006;
|
|
8922
6104
|
var PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED = 6007;
|
|
8923
6105
|
var PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT = 6008;
|
|
@@ -8928,7 +6110,6 @@ var PREDICTION_MIGRATOR_ERROR__INVALID_MARKET = 6012;
|
|
|
8928
6110
|
var PREDICTION_MIGRATOR_ERROR__INVALID_VAULT = 6013;
|
|
8929
6111
|
var PREDICTION_MIGRATOR_ERROR__INVALID_MINT = 6014;
|
|
8930
6112
|
var PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED = 6015;
|
|
8931
|
-
var PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS = 6016;
|
|
8932
6113
|
var PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE = 6017;
|
|
8933
6114
|
var PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY = 6018;
|
|
8934
6115
|
var PREDICTION_MIGRATOR_ERROR__INVALID_INPUT = 6019;
|
|
@@ -8936,9 +6117,6 @@ var predictionMigratorErrorMessages;
|
|
|
8936
6117
|
if (process.env.NODE_ENV !== "production") {
|
|
8937
6118
|
predictionMigratorErrorMessages = {
|
|
8938
6119
|
[PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED]: `Entry already migrated`,
|
|
8939
|
-
[PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED]: `Entry already registered`,
|
|
8940
|
-
[PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED]: `Entry not migrated`,
|
|
8941
|
-
[PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED]: `Entry not registered`,
|
|
8942
6120
|
[PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE]: `Insufficient balance`,
|
|
8943
6121
|
[PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID]: `Invalid entry ID`,
|
|
8944
6122
|
[PREDICTION_MIGRATOR_ERROR__INVALID_INPUT]: `Invalid input`,
|
|
@@ -8949,7 +6127,6 @@ if (process.env.NODE_ENV !== "production") {
|
|
|
8949
6127
|
[PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT]: `Invalid winner mint`,
|
|
8950
6128
|
[PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED]: `Market not resolved`,
|
|
8951
6129
|
[PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW]: `Math overflow`,
|
|
8952
|
-
[PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS]: `No pending rewards`,
|
|
8953
6130
|
[PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED]: `Oracle not finalized`,
|
|
8954
6131
|
[PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH]: `Quote mint mismatch`,
|
|
8955
6132
|
[PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED]: `Unauthorized`,
|
|
@@ -8977,10 +6154,9 @@ var trustedOracle_exports = {};
|
|
|
8977
6154
|
chunkQ7SFCCGT_cjs.__export(trustedOracle_exports, {
|
|
8978
6155
|
FINALIZE_DISCRIMINATOR: () => FINALIZE_DISCRIMINATOR,
|
|
8979
6156
|
INITIALIZE_ORACLE_DISCRIMINATOR: () => INITIALIZE_ORACLE_DISCRIMINATOR2,
|
|
8980
|
-
ORACLE_STATE_DISCRIMINATOR: () =>
|
|
6157
|
+
ORACLE_STATE_DISCRIMINATOR: () => ORACLE_STATE_DISCRIMINATOR2,
|
|
8981
6158
|
TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED: () => TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED,
|
|
8982
6159
|
TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT: () => TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT,
|
|
8983
|
-
TRUSTED_ORACLE_ERROR__NOT_FINALIZED: () => TRUSTED_ORACLE_ERROR__NOT_FINALIZED,
|
|
8984
6160
|
TRUSTED_ORACLE_ERROR__UNAUTHORIZED: () => TRUSTED_ORACLE_ERROR__UNAUTHORIZED,
|
|
8985
6161
|
TRUSTED_ORACLE_PROGRAM_ADDRESS: () => TRUSTED_ORACLE_PROGRAM_ADDRESS,
|
|
8986
6162
|
TrustedOracleAccount: () => TrustedOracleAccount,
|
|
@@ -9004,7 +6180,7 @@ chunkQ7SFCCGT_cjs.__export(trustedOracle_exports, {
|
|
|
9004
6180
|
getInitializeOracleInstructionDataDecoder: () => getInitializeOracleInstructionDataDecoder2,
|
|
9005
6181
|
getInitializeOracleInstructionDataEncoder: () => getInitializeOracleInstructionDataEncoder2,
|
|
9006
6182
|
getOracleStateAddress: () => getOracleStateAddress,
|
|
9007
|
-
getOracleStateCodec: () =>
|
|
6183
|
+
getOracleStateCodec: () => getOracleStateCodec2,
|
|
9008
6184
|
getOracleStateDecoder: () => getOracleStateDecoder2,
|
|
9009
6185
|
getOracleStateDiscriminatorBytes: () => getOracleStateDiscriminatorBytes2,
|
|
9010
6186
|
getOracleStateEncoder: () => getOracleStateEncoder2,
|
|
@@ -9018,7 +6194,7 @@ chunkQ7SFCCGT_cjs.__export(trustedOracle_exports, {
|
|
|
9018
6194
|
parseTrustedOracleInstruction: () => parseTrustedOracleInstruction,
|
|
9019
6195
|
trustedOracleProgram: () => trustedOracleProgram
|
|
9020
6196
|
});
|
|
9021
|
-
var
|
|
6197
|
+
var ORACLE_STATE_DISCRIMINATOR2 = new Uint8Array([
|
|
9022
6198
|
97,
|
|
9023
6199
|
156,
|
|
9024
6200
|
157,
|
|
@@ -9030,7 +6206,7 @@ var ORACLE_STATE_DISCRIMINATOR3 = new Uint8Array([
|
|
|
9030
6206
|
]);
|
|
9031
6207
|
function getOracleStateDiscriminatorBytes2() {
|
|
9032
6208
|
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
9033
|
-
|
|
6209
|
+
ORACLE_STATE_DISCRIMINATOR2
|
|
9034
6210
|
);
|
|
9035
6211
|
}
|
|
9036
6212
|
function getOracleStateEncoder2() {
|
|
@@ -9045,7 +6221,7 @@ function getOracleStateEncoder2() {
|
|
|
9045
6221
|
["bump", kit.getU8Encoder()],
|
|
9046
6222
|
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 31)]
|
|
9047
6223
|
]),
|
|
9048
|
-
(value) => ({ ...value, discriminator:
|
|
6224
|
+
(value) => ({ ...value, discriminator: ORACLE_STATE_DISCRIMINATOR2 })
|
|
9049
6225
|
);
|
|
9050
6226
|
}
|
|
9051
6227
|
function getOracleStateDecoder2() {
|
|
@@ -9060,7 +6236,7 @@ function getOracleStateDecoder2() {
|
|
|
9060
6236
|
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 31)]
|
|
9061
6237
|
]);
|
|
9062
6238
|
}
|
|
9063
|
-
function
|
|
6239
|
+
function getOracleStateCodec2() {
|
|
9064
6240
|
return kit.combineCodec(getOracleStateEncoder2(), getOracleStateDecoder2());
|
|
9065
6241
|
}
|
|
9066
6242
|
function decodeOracleState3(encodedAccount) {
|
|
@@ -9347,7 +6523,7 @@ function trustedOracleProgram() {
|
|
|
9347
6523
|
...client,
|
|
9348
6524
|
trustedOracle: {
|
|
9349
6525
|
accounts: {
|
|
9350
|
-
oracleState: programClientCore.addSelfFetchFunctions(client,
|
|
6526
|
+
oracleState: programClientCore.addSelfFetchFunctions(client, getOracleStateCodec2())
|
|
9351
6527
|
},
|
|
9352
6528
|
instructions: {
|
|
9353
6529
|
finalize: (input) => programClientCore.addSelfPlanAndSendFunctions(client, getFinalizeInstruction(input)),
|
|
@@ -9364,14 +6540,12 @@ function trustedOracleProgram() {
|
|
|
9364
6540
|
// src/solana/generated/trustedOracle/errors/trustedOracle.ts
|
|
9365
6541
|
var TRUSTED_ORACLE_ERROR__UNAUTHORIZED = 6e3;
|
|
9366
6542
|
var TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED = 6001;
|
|
9367
|
-
var TRUSTED_ORACLE_ERROR__NOT_FINALIZED = 6002;
|
|
9368
6543
|
var TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT = 6003;
|
|
9369
6544
|
var trustedOracleErrorMessages;
|
|
9370
6545
|
if (process.env.NODE_ENV !== "production") {
|
|
9371
6546
|
trustedOracleErrorMessages = {
|
|
9372
6547
|
[TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED]: `Oracle already finalized`,
|
|
9373
6548
|
[TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT]: `Invalid winning mint`,
|
|
9374
|
-
[TRUSTED_ORACLE_ERROR__NOT_FINALIZED]: `Oracle not finalized`,
|
|
9375
6549
|
[TRUSTED_ORACLE_ERROR__UNAUTHORIZED]: `Unauthorized: only oracle authority can perform this action`
|
|
9376
6550
|
};
|
|
9377
6551
|
}
|
|
@@ -9422,14 +6596,14 @@ async function getOracleStateAddress(oracleAuthority, nonce) {
|
|
|
9422
6596
|
|
|
9423
6597
|
// src/solana/deployment.ts
|
|
9424
6598
|
var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
|
|
9425
|
-
cpmmProgram:
|
|
6599
|
+
cpmmProgram: chunkY6TJIH33_cjs.CPMM_PROGRAM_ID,
|
|
9426
6600
|
initializerProgram: INITIALIZER_PROGRAM_ID,
|
|
9427
6601
|
cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
|
|
9428
6602
|
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID,
|
|
9429
6603
|
cosignerHookProgram: COSIGNER_HOOK_PROGRAM_ID
|
|
9430
6604
|
};
|
|
9431
6605
|
async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
|
|
9432
|
-
const [cpmmConfig] = await
|
|
6606
|
+
const [cpmmConfig] = await chunkY6TJIH33_cjs.getConfigAddress(programs.cpmmProgram);
|
|
9433
6607
|
const [initializerConfig] = await getConfigAddress2(
|
|
9434
6608
|
programs.initializerProgram
|
|
9435
6609
|
);
|