@whetstone-research/doppler-sdk 1.0.15 → 1.0.17
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-TVBSIQIX.js → chunk-6TOPYGOG.js} +4 -3
- package/dist/chunk-6TOPYGOG.js.map +1 -0
- package/dist/{chunk-3BW6IVP3.cjs → chunk-AKLS6T3R.cjs} +4 -3
- package/dist/chunk-AKLS6T3R.cjs.map +1 -0
- package/dist/{chunk-NMTYI3TB.js → chunk-C2D7CIXP.js} +6 -4
- package/dist/{chunk-NMTYI3TB.js.map → chunk-C2D7CIXP.js.map} +1 -1
- package/dist/{chunk-W5TMS4RD.cjs → chunk-GUGN3EYX.cjs} +39 -37
- package/dist/{chunk-W5TMS4RD.cjs.map → chunk-GUGN3EYX.cjs.map} +1 -1
- package/dist/evm/index.cjs +4 -3
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.js +4 -3
- package/dist/evm/index.js.map +1 -1
- package/dist/{oracle-DN8BrGPh.d.ts → oracle-7PmpwwPx.d.cts} +2 -0
- package/dist/{oracle-DN8BrGPh.d.cts → oracle-7PmpwwPx.d.ts} +2 -0
- package/dist/{pda-5D3GD5S6.js → pda-N6ULJYLG.js} +3 -3
- package/dist/pda-N6ULJYLG.js.map +1 -0
- package/dist/{pda-GNZYNRUH.cjs → pda-PZRHQJMK.cjs} +16 -16
- package/dist/pda-PZRHQJMK.cjs.map +1 -0
- package/dist/solana/index.cjs +2004 -450
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +1306 -511
- package/dist/solana/index.d.ts +1306 -511
- package/dist/solana/index.js +1847 -294
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +47 -47
- package/dist/solana/react/index.d.cts +1 -1
- package/dist/solana/react/index.d.ts +1 -1
- package/dist/solana/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-3BW6IVP3.cjs.map +0 -1
- package/dist/chunk-TVBSIQIX.js.map +0 -1
- package/dist/pda-5D3GD5S6.js.map +0 -1
- package/dist/pda-GNZYNRUH.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 chunkGUGN3EYX_cjs = require('../chunk-GUGN3EYX.cjs');
|
|
4
|
+
var chunkAKLS6T3R_cjs = require('../chunk-AKLS6T3R.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,69 +11,69 @@ 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: () =>
|
|
14
|
+
ACCOUNT_DISCRIMINATORS: () => chunkAKLS6T3R_cjs.ACCOUNT_DISCRIMINATORS,
|
|
15
|
+
ACCOUNT_VERSION: () => chunkAKLS6T3R_cjs.ACCOUNT_VERSION,
|
|
16
16
|
ADD_LIQUIDITY_DISCRIMINATOR: () => ADD_LIQUIDITY_DISCRIMINATOR,
|
|
17
|
-
BPS_DENOM: () =>
|
|
17
|
+
BPS_DENOM: () => chunkAKLS6T3R_cjs.BPS_DENOM,
|
|
18
18
|
CLOSE_POSITION_DISCRIMINATOR: () => CLOSE_POSITION_DISCRIMINATOR,
|
|
19
19
|
COLLECT_FEES_DISCRIMINATOR: () => COLLECT_FEES_DISCRIMINATOR,
|
|
20
20
|
COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () => COLLECT_PROTOCOL_FEES_DISCRIMINATOR,
|
|
21
21
|
CPMM_ERROR_MESSAGES: () => CPMM_ERROR_MESSAGES,
|
|
22
|
-
CPMM_PROGRAM_ID: () =>
|
|
22
|
+
CPMM_PROGRAM_ID: () => chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID,
|
|
23
23
|
CREATE_POSITION_DISCRIMINATOR: () => 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: () =>
|
|
26
|
+
HF_AFTER_ADD_LIQ: () => chunkAKLS6T3R_cjs.HF_AFTER_ADD_LIQ,
|
|
27
|
+
HF_AFTER_REMOVE_LIQ: () => chunkAKLS6T3R_cjs.HF_AFTER_REMOVE_LIQ,
|
|
28
|
+
HF_AFTER_SWAP: () => chunkAKLS6T3R_cjs.HF_AFTER_SWAP,
|
|
29
|
+
HF_BEFORE_ADD_LIQ: () => chunkAKLS6T3R_cjs.HF_BEFORE_ADD_LIQ,
|
|
30
|
+
HF_BEFORE_REMOVE_LIQ: () => chunkAKLS6T3R_cjs.HF_BEFORE_REMOVE_LIQ,
|
|
31
|
+
HF_BEFORE_SWAP: () => chunkAKLS6T3R_cjs.HF_BEFORE_SWAP,
|
|
32
|
+
HF_FORWARD_READONLY_SIGNERS: () => chunkAKLS6T3R_cjs.HF_FORWARD_READONLY_SIGNERS,
|
|
33
|
+
HF_REQUIRE_ORACLE: () => chunkAKLS6T3R_cjs.HF_REQUIRE_ORACLE,
|
|
34
|
+
HOOK_NO_CHANGE: () => chunkAKLS6T3R_cjs.HOOK_NO_CHANGE,
|
|
35
35
|
INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR,
|
|
36
36
|
INITIALIZE_ORACLE_DISCRIMINATOR: () => INITIALIZE_ORACLE_DISCRIMINATOR,
|
|
37
37
|
INITIALIZE_POOL_DISCRIMINATOR: () => INITIALIZE_POOL_DISCRIMINATOR,
|
|
38
|
-
INSTRUCTION_DISCRIMINATORS: () =>
|
|
38
|
+
INSTRUCTION_DISCRIMINATORS: () => chunkAKLS6T3R_cjs.INSTRUCTION_DISCRIMINATORS,
|
|
39
39
|
MAX_FEE_AMOUNT: () => MAX_FEE_AMOUNT,
|
|
40
|
-
MAX_HOOK_ALLOWLIST: () =>
|
|
41
|
-
MAX_ORACLE_OBSERVATIONS: () =>
|
|
40
|
+
MAX_HOOK_ALLOWLIST: () => chunkAKLS6T3R_cjs.MAX_HOOK_ALLOWLIST,
|
|
41
|
+
MAX_ORACLE_OBSERVATIONS: () => chunkAKLS6T3R_cjs.MAX_ORACLE_OBSERVATIONS,
|
|
42
42
|
ORACLE_CONSULT_DISCRIMINATOR: () => ORACLE_CONSULT_DISCRIMINATOR,
|
|
43
43
|
ORACLE_UPDATE_DISCRIMINATOR: () => ORACLE_UPDATE_DISCRIMINATOR,
|
|
44
44
|
PAUSE_DISCRIMINATOR: () => PAUSE_DISCRIMINATOR,
|
|
45
45
|
PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () => PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,
|
|
46
|
-
Q64_ONE: () =>
|
|
46
|
+
Q64_ONE: () => chunkAKLS6T3R_cjs.Q64_ONE,
|
|
47
47
|
QUOTE_TO_NUMERAIRE_DISCRIMINATOR: () => QUOTE_TO_NUMERAIRE_DISCRIMINATOR,
|
|
48
48
|
REMOVE_LIQUIDITY_DISCRIMINATOR: () => REMOVE_LIQUIDITY_DISCRIMINATOR,
|
|
49
|
-
SEED_AUTHORITY: () =>
|
|
50
|
-
SEED_CONFIG: () =>
|
|
51
|
-
SEED_ORACLE: () =>
|
|
52
|
-
SEED_POOL: () =>
|
|
53
|
-
SEED_POSITION: () =>
|
|
54
|
-
SEED_PROTOCOL_FEE_POSITION: () =>
|
|
49
|
+
SEED_AUTHORITY: () => chunkAKLS6T3R_cjs.SEED_AUTHORITY,
|
|
50
|
+
SEED_CONFIG: () => chunkAKLS6T3R_cjs.SEED_CONFIG,
|
|
51
|
+
SEED_ORACLE: () => chunkAKLS6T3R_cjs.SEED_ORACLE,
|
|
52
|
+
SEED_POOL: () => chunkAKLS6T3R_cjs.SEED_POOL,
|
|
53
|
+
SEED_POSITION: () => chunkAKLS6T3R_cjs.SEED_POSITION,
|
|
54
|
+
SEED_PROTOCOL_FEE_POSITION: () => chunkAKLS6T3R_cjs.SEED_PROTOCOL_FEE_POSITION,
|
|
55
55
|
SET_FEES_DISCRIMINATOR: () => SET_FEES_DISCRIMINATOR,
|
|
56
56
|
SET_HOOK_DISCRIMINATOR: () => SET_HOOK_DISCRIMINATOR,
|
|
57
57
|
SET_ROUTE_DISCRIMINATOR: () => SET_ROUTE_DISCRIMINATOR,
|
|
58
58
|
SWAP_EXACT_IN_DISCRIMINATOR: () => SWAP_EXACT_IN_DISCRIMINATOR,
|
|
59
|
-
TOKEN_METADATA_PROGRAM_ID: () =>
|
|
59
|
+
TOKEN_METADATA_PROGRAM_ID: () => chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
60
60
|
TRANSFER_ADMIN_DISCRIMINATOR: () => TRANSFER_ADMIN_DISCRIMINATOR,
|
|
61
61
|
UNPAUSE_DISCRIMINATOR: () => UNPAUSE_DISCRIMINATOR,
|
|
62
62
|
UPDATE_CONFIG_DISCRIMINATOR: () => UPDATE_CONFIG_DISCRIMINATOR,
|
|
63
63
|
WITHDRAW_VAULT_EXCESS_DISCRIMINATOR: () => WITHDRAW_VAULT_EXCESS_DISCRIMINATOR,
|
|
64
|
-
addLiquidityArgsCodec: () =>
|
|
65
|
-
ammConfigDataCodec: () =>
|
|
66
|
-
areMintsOrdered: () =>
|
|
67
|
-
calculateAccruedFees: () =>
|
|
68
|
-
calculateTwap: () =>
|
|
69
|
-
calculateTwapNumber: () =>
|
|
70
|
-
ceilDiv: () =>
|
|
71
|
-
collectFeesArgsCodec: () =>
|
|
72
|
-
collectProtocolFeesArgsCodec: () =>
|
|
73
|
-
comparePoolAndOraclePrices: () =>
|
|
74
|
-
computePrice0Q64: () =>
|
|
75
|
-
computePrice1Q64: () =>
|
|
76
|
-
consultTwap: () =>
|
|
64
|
+
addLiquidityArgsCodec: () => chunkGUGN3EYX_cjs.addLiquidityArgsCodec,
|
|
65
|
+
ammConfigDataCodec: () => chunkGUGN3EYX_cjs.ammConfigDataCodec,
|
|
66
|
+
areMintsOrdered: () => chunkAKLS6T3R_cjs.areMintsOrdered,
|
|
67
|
+
calculateAccruedFees: () => chunkGUGN3EYX_cjs.calculateAccruedFees,
|
|
68
|
+
calculateTwap: () => chunkGUGN3EYX_cjs.calculateTwap,
|
|
69
|
+
calculateTwapNumber: () => chunkGUGN3EYX_cjs.calculateTwapNumber,
|
|
70
|
+
ceilDiv: () => chunkGUGN3EYX_cjs.ceilDiv,
|
|
71
|
+
collectFeesArgsCodec: () => chunkGUGN3EYX_cjs.collectFeesArgsCodec,
|
|
72
|
+
collectProtocolFeesArgsCodec: () => chunkGUGN3EYX_cjs.collectProtocolFeesArgsCodec,
|
|
73
|
+
comparePoolAndOraclePrices: () => chunkGUGN3EYX_cjs.comparePoolAndOraclePrices,
|
|
74
|
+
computePrice0Q64: () => chunkGUGN3EYX_cjs.computePrice0Q64,
|
|
75
|
+
computePrice1Q64: () => chunkGUGN3EYX_cjs.computePrice1Q64,
|
|
76
|
+
consultTwap: () => chunkGUGN3EYX_cjs.consultTwap,
|
|
77
77
|
createAddLiquidityInstruction: () => getAddLiquidityInstruction,
|
|
78
78
|
createClosePositionInstruction: () => getClosePositionInstruction,
|
|
79
79
|
createCollectFeesInstruction: () => getCollectFeesInstruction,
|
|
@@ -85,7 +85,7 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
85
85
|
createOracleConsultInstruction: () => getOracleConsultInstruction,
|
|
86
86
|
createOracleUpdateInstruction: () => getOracleUpdateInstruction,
|
|
87
87
|
createPauseInstruction: () => getPauseInstruction,
|
|
88
|
-
createPositionArgsCodec: () =>
|
|
88
|
+
createPositionArgsCodec: () => chunkGUGN3EYX_cjs.createPositionArgsCodec,
|
|
89
89
|
createQuoteToNumeraireInstruction: () => getQuoteToNumeraireInstruction,
|
|
90
90
|
createRemoveLiquidityInstruction: () => getRemoveLiquidityInstruction,
|
|
91
91
|
createSetFeesInstruction: () => getSetFeesInstruction,
|
|
@@ -97,47 +97,47 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
97
97
|
createUnpauseInstruction: () => getUnpauseInstruction,
|
|
98
98
|
createWithdrawVaultExcessInstruction: () => getWithdrawVaultExcessInstruction,
|
|
99
99
|
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
|
-
encodeQuoteToNumeraireArgs: () =>
|
|
114
|
-
encodeRemoveLiquidityArgs: () =>
|
|
115
|
-
encodeSetFeesArgs: () =>
|
|
116
|
-
encodeSetHookArgs: () =>
|
|
117
|
-
encodeSetRouteArgs: () =>
|
|
118
|
-
encodeSwapExactInArgs: () =>
|
|
119
|
-
encodeTransferAdminArgs: () =>
|
|
120
|
-
fetchAllPools: () =>
|
|
100
|
+
decodeAmmConfig: () => chunkGUGN3EYX_cjs.decodeAmmConfig,
|
|
101
|
+
decodeOracleState: () => chunkGUGN3EYX_cjs.decodeOracleState,
|
|
102
|
+
decodePool: () => chunkGUGN3EYX_cjs.decodePool,
|
|
103
|
+
decodePosition: () => chunkGUGN3EYX_cjs.decodePosition,
|
|
104
|
+
encodeAddLiquidityArgs: () => chunkGUGN3EYX_cjs.encodeAddLiquidityArgs,
|
|
105
|
+
encodeCollectFeesArgs: () => chunkGUGN3EYX_cjs.encodeCollectFeesArgs,
|
|
106
|
+
encodeCollectProtocolFeesArgs: () => chunkGUGN3EYX_cjs.encodeCollectProtocolFeesArgs,
|
|
107
|
+
encodeCreatePositionArgs: () => chunkGUGN3EYX_cjs.encodeCreatePositionArgs,
|
|
108
|
+
encodeInitializeConfigArgs: () => chunkGUGN3EYX_cjs.encodeInitializeConfigArgs,
|
|
109
|
+
encodeInitializeOracleArgs: () => chunkGUGN3EYX_cjs.encodeInitializeOracleArgs,
|
|
110
|
+
encodeInitializePoolArgs: () => chunkGUGN3EYX_cjs.encodeInitializePoolArgs,
|
|
111
|
+
encodeInstructionData: () => chunkGUGN3EYX_cjs.encodeInstructionData,
|
|
112
|
+
encodeOracleConsultArgs: () => chunkGUGN3EYX_cjs.encodeOracleConsultArgs,
|
|
113
|
+
encodeQuoteToNumeraireArgs: () => chunkGUGN3EYX_cjs.encodeQuoteToNumeraireArgs,
|
|
114
|
+
encodeRemoveLiquidityArgs: () => chunkGUGN3EYX_cjs.encodeRemoveLiquidityArgs,
|
|
115
|
+
encodeSetFeesArgs: () => chunkGUGN3EYX_cjs.encodeSetFeesArgs,
|
|
116
|
+
encodeSetHookArgs: () => chunkGUGN3EYX_cjs.encodeSetHookArgs,
|
|
117
|
+
encodeSetRouteArgs: () => chunkGUGN3EYX_cjs.encodeSetRouteArgs,
|
|
118
|
+
encodeSwapExactInArgs: () => chunkGUGN3EYX_cjs.encodeSwapExactInArgs,
|
|
119
|
+
encodeTransferAdminArgs: () => chunkGUGN3EYX_cjs.encodeTransferAdminArgs,
|
|
120
|
+
fetchAllPools: () => chunkGUGN3EYX_cjs.fetchAllPools,
|
|
121
121
|
fetchConfig: () => fetchConfig,
|
|
122
122
|
fetchConfigWithAddress: () => fetchConfigWithAddress,
|
|
123
|
-
fetchOracle: () =>
|
|
124
|
-
fetchOraclesBatch: () =>
|
|
125
|
-
fetchPool: () =>
|
|
126
|
-
fetchPoolPositions: () =>
|
|
127
|
-
fetchPoolsBatch: () =>
|
|
128
|
-
fetchPosition: () =>
|
|
129
|
-
fetchPositionByParams: () =>
|
|
130
|
-
fetchPositionsBatch: () =>
|
|
131
|
-
fetchUserPositions: () =>
|
|
132
|
-
filterActivePositions: () =>
|
|
133
|
-
filterPoolsByMint: () =>
|
|
123
|
+
fetchOracle: () => chunkGUGN3EYX_cjs.fetchOracle,
|
|
124
|
+
fetchOraclesBatch: () => chunkGUGN3EYX_cjs.fetchOraclesBatch,
|
|
125
|
+
fetchPool: () => chunkGUGN3EYX_cjs.fetchPool,
|
|
126
|
+
fetchPoolPositions: () => chunkGUGN3EYX_cjs.fetchPoolPositions,
|
|
127
|
+
fetchPoolsBatch: () => chunkGUGN3EYX_cjs.fetchPoolsBatch,
|
|
128
|
+
fetchPosition: () => chunkGUGN3EYX_cjs.fetchPosition,
|
|
129
|
+
fetchPositionByParams: () => chunkGUGN3EYX_cjs.fetchPositionByParams,
|
|
130
|
+
fetchPositionsBatch: () => chunkGUGN3EYX_cjs.fetchPositionsBatch,
|
|
131
|
+
fetchUserPositions: () => chunkGUGN3EYX_cjs.fetchUserPositions,
|
|
132
|
+
filterActivePositions: () => chunkGUGN3EYX_cjs.filterActivePositions,
|
|
133
|
+
filterPoolsByMint: () => chunkGUGN3EYX_cjs.filterPoolsByMint,
|
|
134
134
|
getAddLiquidityDiscriminatorBytes: () => getAddLiquidityDiscriminatorBytes,
|
|
135
135
|
getAddLiquidityInstruction: () => getAddLiquidityInstruction,
|
|
136
136
|
getAddLiquidityInstructionAsync: () => getAddLiquidityInstructionAsync,
|
|
137
137
|
getAddLiquidityInstructionDataCodec: () => getAddLiquidityInstructionDataCodec,
|
|
138
138
|
getAddLiquidityInstructionDataDecoder: () => getAddLiquidityInstructionDataDecoder,
|
|
139
139
|
getAddLiquidityInstructionDataEncoder: () => getAddLiquidityInstructionDataEncoder,
|
|
140
|
-
getAddLiquidityQuote: () =>
|
|
140
|
+
getAddLiquidityQuote: () => chunkGUGN3EYX_cjs.getAddLiquidityQuote,
|
|
141
141
|
getClosePositionDiscriminatorBytes: () => getClosePositionDiscriminatorBytes,
|
|
142
142
|
getClosePositionInstruction: () => getClosePositionInstruction,
|
|
143
143
|
getClosePositionInstructionDataCodec: () => getClosePositionInstructionDataCodec,
|
|
@@ -155,7 +155,7 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
155
155
|
getCollectProtocolFeesInstructionDataCodec: () => getCollectProtocolFeesInstructionDataCodec,
|
|
156
156
|
getCollectProtocolFeesInstructionDataDecoder: () => getCollectProtocolFeesInstructionDataDecoder,
|
|
157
157
|
getCollectProtocolFeesInstructionDataEncoder: () => getCollectProtocolFeesInstructionDataEncoder,
|
|
158
|
-
getConfigAddress: () =>
|
|
158
|
+
getConfigAddress: () => chunkAKLS6T3R_cjs.getConfigAddress,
|
|
159
159
|
getCreatePositionDiscriminatorBytes: () => getCreatePositionDiscriminatorBytes,
|
|
160
160
|
getCreatePositionInstruction: () => getCreatePositionInstruction,
|
|
161
161
|
getCreatePositionInstructionAsync: () => getCreatePositionInstructionAsync,
|
|
@@ -181,22 +181,22 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
181
181
|
getInitializePoolInstructionDataCodec: () => getInitializePoolInstructionDataCodec,
|
|
182
182
|
getInitializePoolInstructionDataDecoder: () => getInitializePoolInstructionDataDecoder,
|
|
183
183
|
getInitializePoolInstructionDataEncoder: () => getInitializePoolInstructionDataEncoder,
|
|
184
|
-
getK: () =>
|
|
185
|
-
getLiquidityAddresses: () =>
|
|
184
|
+
getK: () => chunkGUGN3EYX_cjs.getK,
|
|
185
|
+
getLiquidityAddresses: () => chunkAKLS6T3R_cjs.getLiquidityAddresses,
|
|
186
186
|
getMetadataAddress: () => getMetadataAddress,
|
|
187
|
-
getOracleAddress: () =>
|
|
188
|
-
getOracleAddressFromPool: () =>
|
|
189
|
-
getOracleAge: () =>
|
|
190
|
-
getOracleBufferStats: () =>
|
|
187
|
+
getOracleAddress: () => chunkAKLS6T3R_cjs.getOracleAddress,
|
|
188
|
+
getOracleAddressFromPool: () => chunkGUGN3EYX_cjs.getOracleAddressFromPool,
|
|
189
|
+
getOracleAge: () => chunkGUGN3EYX_cjs.getOracleAge,
|
|
190
|
+
getOracleBufferStats: () => chunkGUGN3EYX_cjs.getOracleBufferStats,
|
|
191
191
|
getOracleConsultDiscriminatorBytes: () => getOracleConsultDiscriminatorBytes,
|
|
192
192
|
getOracleConsultInstruction: () => getOracleConsultInstruction,
|
|
193
193
|
getOracleConsultInstructionAsync: () => getOracleConsultInstructionAsync,
|
|
194
194
|
getOracleConsultInstructionDataCodec: () => getOracleConsultInstructionDataCodec,
|
|
195
195
|
getOracleConsultInstructionDataDecoder: () => getOracleConsultInstructionDataDecoder,
|
|
196
196
|
getOracleConsultInstructionDataEncoder: () => getOracleConsultInstructionDataEncoder,
|
|
197
|
-
getOracleDeviation: () =>
|
|
198
|
-
getOracleForPool: () =>
|
|
199
|
-
getOracleSpotPrices: () =>
|
|
197
|
+
getOracleDeviation: () => chunkGUGN3EYX_cjs.getOracleDeviation,
|
|
198
|
+
getOracleForPool: () => chunkGUGN3EYX_cjs.getOracleForPool,
|
|
199
|
+
getOracleSpotPrices: () => chunkGUGN3EYX_cjs.getOracleSpotPrices,
|
|
200
200
|
getOracleUpdateDiscriminatorBytes: () => getOracleUpdateDiscriminatorBytes,
|
|
201
201
|
getOracleUpdateInstruction: () => getOracleUpdateInstruction,
|
|
202
202
|
getOracleUpdateInstructionAsync: () => getOracleUpdateInstructionAsync,
|
|
@@ -208,23 +208,23 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
208
208
|
getPauseInstructionDataCodec: () => getPauseInstructionDataCodec,
|
|
209
209
|
getPauseInstructionDataDecoder: () => getPauseInstructionDataDecoder,
|
|
210
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: () =>
|
|
211
|
+
getPendingFees: () => chunkGUGN3EYX_cjs.getPendingFees,
|
|
212
|
+
getPoolAddress: () => chunkAKLS6T3R_cjs.getPoolAddress,
|
|
213
|
+
getPoolAddressFromMints: () => chunkGUGN3EYX_cjs.getPoolAddressFromMints,
|
|
214
|
+
getPoolAuthorityAddress: () => chunkAKLS6T3R_cjs.getPoolAuthorityAddress,
|
|
215
|
+
getPoolByMints: () => chunkGUGN3EYX_cjs.getPoolByMints,
|
|
216
|
+
getPoolInitAddresses: () => chunkAKLS6T3R_cjs.getPoolInitAddresses,
|
|
217
|
+
getPoolVault0Address: () => chunkAKLS6T3R_cjs.getPoolVault0Address,
|
|
218
|
+
getPoolVault1Address: () => chunkAKLS6T3R_cjs.getPoolVault1Address,
|
|
219
|
+
getPositionAddress: () => chunkAKLS6T3R_cjs.getPositionAddress,
|
|
220
|
+
getPositionAddressFromParams: () => chunkGUGN3EYX_cjs.getPositionAddressFromParams,
|
|
221
|
+
getPositionValue: () => chunkGUGN3EYX_cjs.getPositionValue,
|
|
222
222
|
getPreviewSwapExactInDiscriminatorBytes: () => getPreviewSwapExactInDiscriminatorBytes,
|
|
223
223
|
getPreviewSwapExactInInstruction: () => getPreviewSwapExactInInstruction,
|
|
224
224
|
getPreviewSwapExactInInstructionDataCodec: () => getPreviewSwapExactInInstructionDataCodec,
|
|
225
225
|
getPreviewSwapExactInInstructionDataDecoder: () => getPreviewSwapExactInInstructionDataDecoder,
|
|
226
226
|
getPreviewSwapExactInInstructionDataEncoder: () => getPreviewSwapExactInInstructionDataEncoder,
|
|
227
|
-
getProtocolFeePositionAddress: () =>
|
|
227
|
+
getProtocolFeePositionAddress: () => chunkAKLS6T3R_cjs.getProtocolFeePositionAddress,
|
|
228
228
|
getQuoteToNumeraireDiscriminatorBytes: () => getQuoteToNumeraireDiscriminatorBytes,
|
|
229
229
|
getQuoteToNumeraireInstruction: () => getQuoteToNumeraireInstruction,
|
|
230
230
|
getQuoteToNumeraireInstructionDataCodec: () => getQuoteToNumeraireInstructionDataCodec,
|
|
@@ -236,7 +236,7 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
236
236
|
getRemoveLiquidityInstructionDataCodec: () => getRemoveLiquidityInstructionDataCodec,
|
|
237
237
|
getRemoveLiquidityInstructionDataDecoder: () => getRemoveLiquidityInstructionDataDecoder,
|
|
238
238
|
getRemoveLiquidityInstructionDataEncoder: () => getRemoveLiquidityInstructionDataEncoder,
|
|
239
|
-
getRemoveLiquidityQuote: () =>
|
|
239
|
+
getRemoveLiquidityQuote: () => chunkGUGN3EYX_cjs.getRemoveLiquidityQuote,
|
|
240
240
|
getSetFeesDiscriminatorBytes: () => getSetFeesDiscriminatorBytes,
|
|
241
241
|
getSetFeesInstruction: () => getSetFeesInstruction,
|
|
242
242
|
getSetFeesInstructionDataCodec: () => getSetFeesInstructionDataCodec,
|
|
@@ -252,23 +252,23 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
252
252
|
getSetRouteInstructionDataCodec: () => getSetRouteInstructionDataCodec,
|
|
253
253
|
getSetRouteInstructionDataDecoder: () => getSetRouteInstructionDataDecoder,
|
|
254
254
|
getSetRouteInstructionDataEncoder: () => getSetRouteInstructionDataEncoder,
|
|
255
|
-
getSpotPrice0: () =>
|
|
256
|
-
getSpotPrice1: () =>
|
|
257
|
-
getSwapAddresses: () =>
|
|
255
|
+
getSpotPrice0: () => chunkGUGN3EYX_cjs.getSpotPrice0,
|
|
256
|
+
getSpotPrice1: () => chunkGUGN3EYX_cjs.getSpotPrice1,
|
|
257
|
+
getSwapAddresses: () => chunkAKLS6T3R_cjs.getSwapAddresses,
|
|
258
258
|
getSwapExactInDiscriminatorBytes: () => getSwapExactInDiscriminatorBytes,
|
|
259
259
|
getSwapExactInInstruction: () => getSwapExactInInstruction,
|
|
260
260
|
getSwapExactInInstructionAsync: () => getSwapExactInInstructionAsync,
|
|
261
261
|
getSwapExactInInstructionDataCodec: () => getSwapExactInInstructionDataCodec,
|
|
262
262
|
getSwapExactInInstructionDataDecoder: () => getSwapExactInInstructionDataDecoder,
|
|
263
263
|
getSwapExactInInstructionDataEncoder: () => getSwapExactInInstructionDataEncoder,
|
|
264
|
-
getSwapQuote: () =>
|
|
265
|
-
getSwapQuoteExactOut: () =>
|
|
264
|
+
getSwapQuote: () => chunkGUGN3EYX_cjs.getSwapQuote,
|
|
265
|
+
getSwapQuoteExactOut: () => chunkGUGN3EYX_cjs.getSwapQuoteExactOut,
|
|
266
266
|
getTransferAdminDiscriminatorBytes: () => getTransferAdminDiscriminatorBytes,
|
|
267
267
|
getTransferAdminInstruction: () => getTransferAdminInstruction,
|
|
268
268
|
getTransferAdminInstructionDataCodec: () => getTransferAdminInstructionDataCodec,
|
|
269
269
|
getTransferAdminInstructionDataDecoder: () => getTransferAdminInstructionDataDecoder,
|
|
270
270
|
getTransferAdminInstructionDataEncoder: () => getTransferAdminInstructionDataEncoder,
|
|
271
|
-
getTvl: () =>
|
|
271
|
+
getTvl: () => chunkGUGN3EYX_cjs.getTvl,
|
|
272
272
|
getUnpauseDiscriminatorBytes: () => getUnpauseDiscriminatorBytes,
|
|
273
273
|
getUnpauseInstruction: () => getUnpauseInstruction,
|
|
274
274
|
getUnpauseInstructionDataCodec: () => getUnpauseInstructionDataCodec,
|
|
@@ -285,21 +285,21 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
285
285
|
getWithdrawVaultExcessInstructionDataCodec: () => getWithdrawVaultExcessInstructionDataCodec,
|
|
286
286
|
getWithdrawVaultExcessInstructionDataDecoder: () => getWithdrawVaultExcessInstructionDataDecoder,
|
|
287
287
|
getWithdrawVaultExcessInstructionDataEncoder: () => getWithdrawVaultExcessInstructionDataEncoder,
|
|
288
|
-
initializeConfigArgsCodec: () =>
|
|
289
|
-
initializeOracleArgsCodec: () =>
|
|
290
|
-
initializePoolArgsCodec: () =>
|
|
288
|
+
initializeConfigArgsCodec: () => chunkGUGN3EYX_cjs.initializeConfigArgsCodec,
|
|
289
|
+
initializeOracleArgsCodec: () => chunkGUGN3EYX_cjs.initializeOracleArgsCodec,
|
|
290
|
+
initializePoolArgsCodec: () => chunkGUGN3EYX_cjs.initializePoolArgsCodec,
|
|
291
291
|
isCpmmError: () => isCpmmError,
|
|
292
|
-
isOracleStale: () =>
|
|
293
|
-
isqrt: () =>
|
|
292
|
+
isOracleStale: () => chunkGUGN3EYX_cjs.isOracleStale,
|
|
293
|
+
isqrt: () => chunkGUGN3EYX_cjs.isqrt,
|
|
294
294
|
marketCapToCurveParams: () => marketCapToCurveParams,
|
|
295
295
|
marketCapToSingleCurveParams: () => marketCapToSingleCurveParams,
|
|
296
296
|
marketCapToTokenPrice: () => marketCapToTokenPrice,
|
|
297
|
-
maxBigInt: () =>
|
|
298
|
-
minBigInt: () =>
|
|
299
|
-
numberToQ64: () =>
|
|
300
|
-
observationCodec: () =>
|
|
301
|
-
oracleConsultArgsCodec: () =>
|
|
302
|
-
oracleStateDataCodec: () =>
|
|
297
|
+
maxBigInt: () => chunkGUGN3EYX_cjs.maxBigInt,
|
|
298
|
+
minBigInt: () => chunkGUGN3EYX_cjs.minBigInt,
|
|
299
|
+
numberToQ64: () => chunkGUGN3EYX_cjs.numberToQ64,
|
|
300
|
+
observationCodec: () => chunkGUGN3EYX_cjs.observationCodec,
|
|
301
|
+
oracleConsultArgsCodec: () => chunkGUGN3EYX_cjs.oracleConsultArgsCodec,
|
|
302
|
+
oracleStateDataCodec: () => chunkGUGN3EYX_cjs.oracleStateDataCodec,
|
|
303
303
|
parseAddLiquidityInstruction: () => parseAddLiquidityInstruction,
|
|
304
304
|
parseClosePositionInstruction: () => parseClosePositionInstruction,
|
|
305
305
|
parseCollectFeesInstruction: () => parseCollectFeesInstruction,
|
|
@@ -323,33 +323,33 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
323
323
|
parseUnpauseInstruction: () => parseUnpauseInstruction,
|
|
324
324
|
parseUpdateConfigInstruction: () => parseUpdateConfigInstruction,
|
|
325
325
|
parseWithdrawVaultExcessInstruction: () => parseWithdrawVaultExcessInstruction,
|
|
326
|
-
poolDataCodec: () =>
|
|
327
|
-
poolExists: () =>
|
|
328
|
-
positionDataCodec: () =>
|
|
329
|
-
q64Div: () =>
|
|
330
|
-
q64Mul: () =>
|
|
331
|
-
q64ToNumber: () =>
|
|
332
|
-
quoteToNumeraireArgsCodec: () =>
|
|
333
|
-
ratioToNumber: () =>
|
|
334
|
-
removeLiquidityArgsCodec: () =>
|
|
335
|
-
setFeesArgsCodec: () =>
|
|
336
|
-
setHookArgsCodec: () =>
|
|
337
|
-
setRouteArgsCodec: () =>
|
|
338
|
-
sortMints: () =>
|
|
339
|
-
sortPoolsByReserves: () =>
|
|
340
|
-
sortPositionsByShares: () =>
|
|
341
|
-
swapExactInArgsCodec: () =>
|
|
342
|
-
transferAdminArgsCodec: () =>
|
|
326
|
+
poolDataCodec: () => chunkGUGN3EYX_cjs.poolDataCodec,
|
|
327
|
+
poolExists: () => chunkGUGN3EYX_cjs.poolExists,
|
|
328
|
+
positionDataCodec: () => chunkGUGN3EYX_cjs.positionDataCodec,
|
|
329
|
+
q64Div: () => chunkGUGN3EYX_cjs.q64Div,
|
|
330
|
+
q64Mul: () => chunkGUGN3EYX_cjs.q64Mul,
|
|
331
|
+
q64ToNumber: () => chunkGUGN3EYX_cjs.q64ToNumber,
|
|
332
|
+
quoteToNumeraireArgsCodec: () => chunkGUGN3EYX_cjs.quoteToNumeraireArgsCodec,
|
|
333
|
+
ratioToNumber: () => chunkGUGN3EYX_cjs.ratioToNumber,
|
|
334
|
+
removeLiquidityArgsCodec: () => chunkGUGN3EYX_cjs.removeLiquidityArgsCodec,
|
|
335
|
+
setFeesArgsCodec: () => chunkGUGN3EYX_cjs.setFeesArgsCodec,
|
|
336
|
+
setHookArgsCodec: () => chunkGUGN3EYX_cjs.setHookArgsCodec,
|
|
337
|
+
setRouteArgsCodec: () => chunkGUGN3EYX_cjs.setRouteArgsCodec,
|
|
338
|
+
sortMints: () => chunkAKLS6T3R_cjs.sortMints,
|
|
339
|
+
sortPoolsByReserves: () => chunkGUGN3EYX_cjs.sortPoolsByReserves,
|
|
340
|
+
sortPositionsByShares: () => chunkGUGN3EYX_cjs.sortPositionsByShares,
|
|
341
|
+
swapExactInArgsCodec: () => chunkGUGN3EYX_cjs.swapExactInArgsCodec,
|
|
342
|
+
transferAdminArgsCodec: () => chunkGUGN3EYX_cjs.transferAdminArgsCodec,
|
|
343
343
|
validateMarketCapParameters: () => validateMarketCapParameters
|
|
344
344
|
});
|
|
345
345
|
var addressCodec = kit.getAddressCodec();
|
|
346
346
|
var textEncoder = new TextEncoder();
|
|
347
347
|
async function getMetadataAddress(mint) {
|
|
348
348
|
return kit.getProgramDerivedAddress({
|
|
349
|
-
programAddress:
|
|
349
|
+
programAddress: chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
350
350
|
seeds: [
|
|
351
351
|
textEncoder.encode("metadata"),
|
|
352
|
-
addressCodec.encode(
|
|
352
|
+
addressCodec.encode(chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
353
353
|
addressCodec.encode(mint)
|
|
354
354
|
]
|
|
355
355
|
});
|
|
@@ -1716,7 +1716,9 @@ function getInitializePoolInstructionDataEncoder() {
|
|
|
1716
1716
|
["initialSwapFeeBps", kit.getU16Encoder()],
|
|
1717
1717
|
["initialFeeSplitBps", kit.getU16Encoder()],
|
|
1718
1718
|
["liquidityMeasureTokenIndex", kit.getU8Encoder()],
|
|
1719
|
-
["numeraireMintOverride", kit.getOptionEncoder(kit.getAddressEncoder())]
|
|
1719
|
+
["numeraireMintOverride", kit.getOptionEncoder(kit.getAddressEncoder())],
|
|
1720
|
+
["hookProgram", kit.getAddressEncoder()],
|
|
1721
|
+
["hookFlags", kit.getU32Encoder()]
|
|
1720
1722
|
]),
|
|
1721
1723
|
(value) => ({ ...value, discriminator: INITIALIZE_POOL_DISCRIMINATOR })
|
|
1722
1724
|
);
|
|
@@ -1729,7 +1731,9 @@ function getInitializePoolInstructionDataDecoder() {
|
|
|
1729
1731
|
["initialSwapFeeBps", kit.getU16Decoder()],
|
|
1730
1732
|
["initialFeeSplitBps", kit.getU16Decoder()],
|
|
1731
1733
|
["liquidityMeasureTokenIndex", kit.getU8Decoder()],
|
|
1732
|
-
["numeraireMintOverride", kit.getOptionDecoder(kit.getAddressDecoder())]
|
|
1734
|
+
["numeraireMintOverride", kit.getOptionDecoder(kit.getAddressDecoder())],
|
|
1735
|
+
["hookProgram", kit.getAddressDecoder()],
|
|
1736
|
+
["hookFlags", kit.getU32Decoder()]
|
|
1733
1737
|
]);
|
|
1734
1738
|
}
|
|
1735
1739
|
function getInitializePoolInstructionDataCodec() {
|
|
@@ -3554,8 +3558,8 @@ function createSwapInstruction(params) {
|
|
|
3554
3558
|
userIn,
|
|
3555
3559
|
userOut,
|
|
3556
3560
|
trader,
|
|
3557
|
-
token0Program: token0Program ?? tokenProgram ??
|
|
3558
|
-
token1Program: token1Program ?? tokenProgram ??
|
|
3561
|
+
token0Program: token0Program ?? tokenProgram ?? chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3562
|
+
token1Program: token1Program ?? tokenProgram ?? chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3559
3563
|
oracle,
|
|
3560
3564
|
amountIn,
|
|
3561
3565
|
minAmountOut,
|
|
@@ -3583,8 +3587,8 @@ function base64ToBytes(base64) {
|
|
|
3583
3587
|
}
|
|
3584
3588
|
return bytes;
|
|
3585
3589
|
}
|
|
3586
|
-
async function fetchConfig(rpc, programId =
|
|
3587
|
-
const [configAddress] = await
|
|
3590
|
+
async function fetchConfig(rpc, programId = chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
3591
|
+
const [configAddress] = await chunkAKLS6T3R_cjs.getConfigAddress(programId);
|
|
3588
3592
|
const response = await rpc.getAccountInfo(configAddress, {
|
|
3589
3593
|
encoding: "base64",
|
|
3590
3594
|
commitment
|
|
@@ -3592,10 +3596,10 @@ async function fetchConfig(rpc, programId = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID, c
|
|
|
3592
3596
|
if (!response.value) {
|
|
3593
3597
|
return null;
|
|
3594
3598
|
}
|
|
3595
|
-
return
|
|
3599
|
+
return chunkGUGN3EYX_cjs.decodeAmmConfig(base64ToBytes(response.value.data[0]));
|
|
3596
3600
|
}
|
|
3597
|
-
async function fetchConfigWithAddress(rpc, programId =
|
|
3598
|
-
const [configAddress] = await
|
|
3601
|
+
async function fetchConfigWithAddress(rpc, programId = chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
3602
|
+
const [configAddress] = await chunkAKLS6T3R_cjs.getConfigAddress(programId);
|
|
3599
3603
|
const account = await fetchConfig(rpc, programId, commitment);
|
|
3600
3604
|
if (!account) {
|
|
3601
3605
|
return null;
|
|
@@ -3603,296 +3607,1281 @@ async function fetchConfigWithAddress(rpc, programId = chunk3BW6IVP3_cjs.CPMM_PR
|
|
|
3603
3607
|
return { address: configAddress, account };
|
|
3604
3608
|
}
|
|
3605
3609
|
|
|
3606
|
-
// src/solana/
|
|
3607
|
-
var
|
|
3608
|
-
chunkQ7SFCCGT_cjs.__export(
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
decodePreviewMigrationResult: () => decodePreviewMigrationResult,
|
|
3649
|
-
decodePreviewSwapExactInResult: () => decodePreviewSwapExactInResult,
|
|
3650
|
-
encodeU64LE: () => encodeU64LE,
|
|
3651
|
-
fetchAllLaunches: () => fetchAllLaunches,
|
|
3652
|
-
fetchLaunch: () => fetchLaunch2,
|
|
3653
|
-
fetchLaunchesByAuthority: () => fetchLaunchesByAuthority,
|
|
3654
|
-
getConfigAddress: () => getConfigAddress2,
|
|
3655
|
-
getInitConfigCodec: () => getInitConfigCodec,
|
|
3656
|
-
getInitConfigDecoder: () => getInitConfigDecoder,
|
|
3657
|
-
getInitConfigEncoder: () => getInitConfigEncoder,
|
|
3610
|
+
// src/solana/cosignerHook/index.ts
|
|
3611
|
+
var cosignerHook_exports = {};
|
|
3612
|
+
chunkQ7SFCCGT_cjs.__export(cosignerHook_exports, {
|
|
3613
|
+
ADD_COSIGNER_DISCRIMINATOR: () => ADD_COSIGNER_DISCRIMINATOR,
|
|
3614
|
+
COSIGNER_CONFIG_DISCRIMINATOR: () => COSIGNER_CONFIG_DISCRIMINATOR,
|
|
3615
|
+
COSIGNER_HOOK_ERROR__COSIGNER_ALREADY_EXISTS: () => COSIGNER_HOOK_ERROR__COSIGNER_ALREADY_EXISTS,
|
|
3616
|
+
COSIGNER_HOOK_ERROR__COSIGNER_LIST_FULL: () => COSIGNER_HOOK_ERROR__COSIGNER_LIST_FULL,
|
|
3617
|
+
COSIGNER_HOOK_ERROR__COSIGNER_NOT_FOUND: () => COSIGNER_HOOK_ERROR__COSIGNER_NOT_FOUND,
|
|
3618
|
+
COSIGNER_HOOK_ERROR__INVALID_AUTHORITY: () => COSIGNER_HOOK_ERROR__INVALID_AUTHORITY,
|
|
3619
|
+
COSIGNER_HOOK_ERROR__INVALID_CONFIG: () => COSIGNER_HOOK_ERROR__INVALID_CONFIG,
|
|
3620
|
+
COSIGNER_HOOK_ERROR__INVALID_COSIGNER: () => COSIGNER_HOOK_ERROR__INVALID_COSIGNER,
|
|
3621
|
+
COSIGNER_HOOK_PROGRAM_ADDRESS: () => COSIGNER_HOOK_PROGRAM_ADDRESS,
|
|
3622
|
+
COSIGNER_HOOK_PROGRAM_ID: () => COSIGNER_HOOK_PROGRAM_ID,
|
|
3623
|
+
CosignerHookAccount: () => CosignerHookAccount,
|
|
3624
|
+
CosignerHookInstruction: () => CosignerHookInstruction,
|
|
3625
|
+
INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR2,
|
|
3626
|
+
MAX_COSIGNERS: () => MAX_COSIGNERS,
|
|
3627
|
+
REMOVE_COSIGNER_DISCRIMINATOR: () => REMOVE_COSIGNER_DISCRIMINATOR,
|
|
3628
|
+
SEED_COSIGNER_HOOK_CONFIG: () => SEED_COSIGNER_HOOK_CONFIG,
|
|
3629
|
+
SET_AUTHORITY_DISCRIMINATOR: () => SET_AUTHORITY_DISCRIMINATOR,
|
|
3630
|
+
cosignerHookProgram: () => cosignerHookProgram,
|
|
3631
|
+
decodeCosignerConfig: () => decodeCosignerConfig,
|
|
3632
|
+
fetchAllCosignerConfig: () => fetchAllCosignerConfig,
|
|
3633
|
+
fetchAllMaybeCosignerConfig: () => fetchAllMaybeCosignerConfig,
|
|
3634
|
+
fetchCosignerConfig: () => fetchCosignerConfig,
|
|
3635
|
+
fetchMaybeCosignerConfig: () => fetchMaybeCosignerConfig,
|
|
3636
|
+
getAddCosignerDiscriminatorBytes: () => getAddCosignerDiscriminatorBytes,
|
|
3637
|
+
getAddCosignerInstruction: () => getAddCosignerInstruction,
|
|
3638
|
+
getAddCosignerInstructionAsync: () => getAddCosignerInstructionAsync,
|
|
3639
|
+
getAddCosignerInstructionDataCodec: () => getAddCosignerInstructionDataCodec,
|
|
3640
|
+
getAddCosignerInstructionDataDecoder: () => getAddCosignerInstructionDataDecoder,
|
|
3641
|
+
getAddCosignerInstructionDataEncoder: () => getAddCosignerInstructionDataEncoder,
|
|
3642
|
+
getCosignerArgCodec: () => getCosignerArgCodec,
|
|
3643
|
+
getCosignerArgDecoder: () => getCosignerArgDecoder,
|
|
3644
|
+
getCosignerArgEncoder: () => getCosignerArgEncoder,
|
|
3645
|
+
getCosignerConfigCodec: () => getCosignerConfigCodec,
|
|
3646
|
+
getCosignerConfigDecoder: () => getCosignerConfigDecoder,
|
|
3647
|
+
getCosignerConfigDiscriminatorBytes: () => getCosignerConfigDiscriminatorBytes,
|
|
3648
|
+
getCosignerConfigEncoder: () => getCosignerConfigEncoder,
|
|
3649
|
+
getCosignerConfigSize: () => getCosignerConfigSize,
|
|
3650
|
+
getCosignerHookConfigAddress: () => getCosignerHookConfigAddress,
|
|
3651
|
+
getCosignerHookErrorMessage: () => getCosignerHookErrorMessage,
|
|
3658
3652
|
getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec,
|
|
3659
3653
|
getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder,
|
|
3660
3654
|
getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder,
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
|
|
3655
|
+
getInitializeConfigDiscriminatorBytes: () => getInitializeConfigDiscriminatorBytes2,
|
|
3656
|
+
getInitializeConfigInstruction: () => getInitializeConfigInstruction2,
|
|
3657
|
+
getInitializeConfigInstructionAsync: () => getInitializeConfigInstructionAsync2,
|
|
3658
|
+
getInitializeConfigInstructionDataCodec: () => getInitializeConfigInstructionDataCodec2,
|
|
3659
|
+
getInitializeConfigInstructionDataDecoder: () => getInitializeConfigInstructionDataDecoder2,
|
|
3660
|
+
getInitializeConfigInstructionDataEncoder: () => getInitializeConfigInstructionDataEncoder2,
|
|
3661
|
+
getRemoveCosignerDiscriminatorBytes: () => getRemoveCosignerDiscriminatorBytes,
|
|
3662
|
+
getRemoveCosignerInstruction: () => getRemoveCosignerInstruction,
|
|
3663
|
+
getRemoveCosignerInstructionAsync: () => getRemoveCosignerInstructionAsync,
|
|
3664
|
+
getRemoveCosignerInstructionDataCodec: () => getRemoveCosignerInstructionDataCodec,
|
|
3665
|
+
getRemoveCosignerInstructionDataDecoder: () => getRemoveCosignerInstructionDataDecoder,
|
|
3666
|
+
getRemoveCosignerInstructionDataEncoder: () => getRemoveCosignerInstructionDataEncoder,
|
|
3667
|
+
getSetAuthorityArgsCodec: () => getSetAuthorityArgsCodec,
|
|
3668
|
+
getSetAuthorityArgsDecoder: () => getSetAuthorityArgsDecoder,
|
|
3669
|
+
getSetAuthorityArgsEncoder: () => getSetAuthorityArgsEncoder,
|
|
3670
|
+
getSetAuthorityDiscriminatorBytes: () => getSetAuthorityDiscriminatorBytes,
|
|
3671
|
+
getSetAuthorityInstruction: () => getSetAuthorityInstruction,
|
|
3672
|
+
getSetAuthorityInstructionAsync: () => getSetAuthorityInstructionAsync,
|
|
3673
|
+
getSetAuthorityInstructionDataCodec: () => getSetAuthorityInstructionDataCodec,
|
|
3674
|
+
getSetAuthorityInstructionDataDecoder: () => getSetAuthorityInstructionDataDecoder,
|
|
3675
|
+
getSetAuthorityInstructionDataEncoder: () => getSetAuthorityInstructionDataEncoder,
|
|
3676
|
+
identifyCosignerHookAccount: () => identifyCosignerHookAccount,
|
|
3677
|
+
identifyCosignerHookInstruction: () => identifyCosignerHookInstruction,
|
|
3678
|
+
isCosignerHookError: () => isCosignerHookError,
|
|
3679
|
+
parseAddCosignerInstruction: () => parseAddCosignerInstruction,
|
|
3680
|
+
parseCosignerHookInstruction: () => parseCosignerHookInstruction,
|
|
3681
|
+
parseInitializeConfigInstruction: () => parseInitializeConfigInstruction2,
|
|
3682
|
+
parseRemoveCosignerInstruction: () => parseRemoveCosignerInstruction,
|
|
3683
|
+
parseSetAuthorityInstruction: () => parseSetAuthorityInstruction
|
|
3675
3684
|
});
|
|
3676
|
-
var
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = kit.address(
|
|
3680
|
-
"BPFLoaderUpgradeab1e11111111111111111111111"
|
|
3681
|
-
);
|
|
3682
|
-
var CPMM_HOOK_PROGRAM_ID = kit.address(
|
|
3683
|
-
"2vJ1c62knEwZbxp3XdHB4RSmCfz55pA6tRkCho63gW7u"
|
|
3684
|
-
);
|
|
3685
|
-
var PREDICTION_HOOK_PROGRAM_ID = kit.address(
|
|
3686
|
-
"7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB"
|
|
3687
|
-
);
|
|
3688
|
-
var SEED_CONFIG2 = "config";
|
|
3689
|
-
var SEED_LAUNCH = "launch";
|
|
3690
|
-
var SEED_LAUNCH_AUTHORITY = "launch_authority";
|
|
3691
|
-
var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
|
|
3692
|
-
232,
|
|
3693
|
-
231,
|
|
3694
|
-
118,
|
|
3695
|
-
38,
|
|
3696
|
-
88,
|
|
3697
|
-
111,
|
|
3698
|
-
115,
|
|
3699
|
-
185,
|
|
3700
|
-
85,
|
|
3701
|
-
54,
|
|
3702
|
-
76,
|
|
3703
|
-
123,
|
|
3704
|
-
75,
|
|
3705
|
-
191,
|
|
3706
|
-
11,
|
|
3707
|
-
183,
|
|
3708
|
-
247,
|
|
3709
|
-
104,
|
|
3710
|
-
94,
|
|
3711
|
-
189,
|
|
3712
|
-
64,
|
|
3713
|
-
232,
|
|
3714
|
-
82,
|
|
3685
|
+
var COSIGNER_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
3686
|
+
133,
|
|
3687
|
+
227,
|
|
3715
3688
|
177,
|
|
3716
|
-
100,
|
|
3717
|
-
99,
|
|
3718
|
-
58,
|
|
3719
3689
|
74,
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
]);
|
|
3725
|
-
var MAX_MIGRATOR_ALLOWLIST = 32;
|
|
3726
|
-
var MAX_HOOK_ALLOWLIST2 = 32;
|
|
3727
|
-
var MAX_PAYLOAD = 256;
|
|
3728
|
-
var PHASE_TRADING = 0;
|
|
3729
|
-
var PHASE_MIGRATED = 1;
|
|
3730
|
-
var PHASE_ABORTED = 2;
|
|
3731
|
-
var TRADE_DIRECTION_BUY = 0;
|
|
3732
|
-
var TRADE_DIRECTION_SELL = 1;
|
|
3733
|
-
var CURVE_KIND_XYK = 0;
|
|
3734
|
-
var CURVE_PARAMS_FORMAT_XYK_V0 = 0;
|
|
3735
|
-
var HF_BEFORE_SWAP2 = 1 << 0;
|
|
3736
|
-
var HF_AFTER_SWAP2 = 1 << 1;
|
|
3737
|
-
var HF_BEFORE_CREATE = 1 << 2;
|
|
3738
|
-
var HF_AFTER_CREATE = 1 << 3;
|
|
3739
|
-
var HF_BEFORE_MIGRATE = 1 << 4;
|
|
3740
|
-
var HF_AFTER_MIGRATE = 1 << 5;
|
|
3741
|
-
var HOOK_NO_CHANGE2 = 65535;
|
|
3742
|
-
var INITIALIZER_INSTRUCTION_DISCRIMINATORS = {
|
|
3743
|
-
// SHA256("global:initialize_config")[0:8]
|
|
3744
|
-
initializeConfig: new Uint8Array([
|
|
3745
|
-
208,
|
|
3746
|
-
127,
|
|
3747
|
-
21,
|
|
3748
|
-
1,
|
|
3749
|
-
194,
|
|
3750
|
-
190,
|
|
3751
|
-
196,
|
|
3752
|
-
70
|
|
3753
|
-
]),
|
|
3754
|
-
// SHA256("global:set_migrator_allowlist")[0:8]
|
|
3755
|
-
setMigratorAllowlist: new Uint8Array([
|
|
3756
|
-
209,
|
|
3757
|
-
90,
|
|
3758
|
-
181,
|
|
3759
|
-
104,
|
|
3760
|
-
99,
|
|
3761
|
-
108,
|
|
3762
|
-
233,
|
|
3763
|
-
168
|
|
3764
|
-
]),
|
|
3765
|
-
// SHA256("global:set_hook_allowlist")[0:8]
|
|
3766
|
-
setHookAllowlist: new Uint8Array([
|
|
3767
|
-
232,
|
|
3768
|
-
28,
|
|
3769
|
-
40,
|
|
3770
|
-
143,
|
|
3771
|
-
121,
|
|
3772
|
-
182,
|
|
3773
|
-
77,
|
|
3774
|
-
103
|
|
3775
|
-
]),
|
|
3776
|
-
// SHA256("global:initialize_launch")[0:8]
|
|
3777
|
-
initializeLaunch: new Uint8Array([
|
|
3778
|
-
90,
|
|
3779
|
-
201,
|
|
3780
|
-
220,
|
|
3781
|
-
142,
|
|
3782
|
-
112,
|
|
3783
|
-
253,
|
|
3784
|
-
100,
|
|
3785
|
-
13
|
|
3786
|
-
]),
|
|
3787
|
-
// SHA256("global:curve_swap_exact_in")[0:8]
|
|
3788
|
-
curveSwapExactIn: new Uint8Array([
|
|
3789
|
-
196,
|
|
3790
|
-
247,
|
|
3791
|
-
195,
|
|
3792
|
-
126,
|
|
3793
|
-
227,
|
|
3794
|
-
27,
|
|
3795
|
-
166,
|
|
3796
|
-
93
|
|
3797
|
-
]),
|
|
3798
|
-
// SHA256("global:migrate_launch")[0:8]
|
|
3799
|
-
migrateLaunch: new Uint8Array([
|
|
3800
|
-
19,
|
|
3801
|
-
199,
|
|
3802
|
-
119,
|
|
3803
|
-
103,
|
|
3804
|
-
13,
|
|
3805
|
-
30,
|
|
3806
|
-
12,
|
|
3807
|
-
205
|
|
3808
|
-
]),
|
|
3809
|
-
// SHA256("global:preview_swap_exact_in")[0:8]
|
|
3810
|
-
previewSwapExactIn: new Uint8Array([
|
|
3811
|
-
50,
|
|
3812
|
-
130,
|
|
3813
|
-
31,
|
|
3814
|
-
69,
|
|
3815
|
-
147,
|
|
3816
|
-
58,
|
|
3817
|
-
222,
|
|
3818
|
-
178
|
|
3819
|
-
]),
|
|
3820
|
-
// SHA256("global:preview_migration")[0:8]
|
|
3821
|
-
previewMigration: new Uint8Array([
|
|
3822
|
-
216,
|
|
3823
|
-
180,
|
|
3824
|
-
209,
|
|
3825
|
-
112,
|
|
3826
|
-
62,
|
|
3827
|
-
16,
|
|
3828
|
-
15,
|
|
3829
|
-
63
|
|
3830
|
-
])
|
|
3831
|
-
};
|
|
3832
|
-
var INITIALIZER_ACCOUNT_DISCRIMINATORS = {
|
|
3833
|
-
// SHA256("account:InitConfig")[0:8]
|
|
3834
|
-
InitConfig: new Uint8Array([97, 166, 35, 7, 20, 2, 164, 126]),
|
|
3835
|
-
// SHA256("account:Launch")[0:8]
|
|
3836
|
-
Launch: new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38])
|
|
3837
|
-
};
|
|
3838
|
-
var INIT_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
3839
|
-
97,
|
|
3840
|
-
166,
|
|
3841
|
-
35,
|
|
3842
|
-
7,
|
|
3843
|
-
20,
|
|
3844
|
-
2,
|
|
3845
|
-
164,
|
|
3846
|
-
126
|
|
3690
|
+
145,
|
|
3691
|
+
74,
|
|
3692
|
+
247,
|
|
3693
|
+
183
|
|
3847
3694
|
]);
|
|
3848
|
-
function
|
|
3695
|
+
function getCosignerConfigDiscriminatorBytes() {
|
|
3696
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3697
|
+
COSIGNER_CONFIG_DISCRIMINATOR
|
|
3698
|
+
);
|
|
3699
|
+
}
|
|
3700
|
+
function getCosignerConfigEncoder() {
|
|
3849
3701
|
return kit.transformEncoder(
|
|
3850
3702
|
kit.getStructEncoder([
|
|
3851
3703
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3852
|
-
["
|
|
3853
|
-
["
|
|
3854
|
-
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
3855
|
-
["hookAllowlistLen", kit.getU8Encoder()],
|
|
3856
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
3704
|
+
["adminAuthority", kit.getAddressEncoder()],
|
|
3705
|
+
["cosignerCount", kit.getU8Encoder()],
|
|
3857
3706
|
["bump", kit.getU8Encoder()],
|
|
3858
3707
|
["version", kit.getU8Encoder()],
|
|
3859
|
-
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(),
|
|
3708
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 37)],
|
|
3709
|
+
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })]
|
|
3860
3710
|
]),
|
|
3861
|
-
(value) => ({ ...value, discriminator:
|
|
3711
|
+
(value) => ({ ...value, discriminator: COSIGNER_CONFIG_DISCRIMINATOR })
|
|
3862
3712
|
);
|
|
3863
3713
|
}
|
|
3864
|
-
function
|
|
3714
|
+
function getCosignerConfigDecoder() {
|
|
3865
3715
|
return kit.getStructDecoder([
|
|
3866
3716
|
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3867
|
-
["
|
|
3868
|
-
["
|
|
3869
|
-
["
|
|
3717
|
+
["adminAuthority", kit.getAddressDecoder()],
|
|
3718
|
+
["cosignerCount", kit.getU8Decoder()],
|
|
3719
|
+
["bump", kit.getU8Decoder()],
|
|
3720
|
+
["version", kit.getU8Decoder()],
|
|
3721
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 37)],
|
|
3722
|
+
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })]
|
|
3723
|
+
]);
|
|
3724
|
+
}
|
|
3725
|
+
function getCosignerConfigCodec() {
|
|
3726
|
+
return kit.combineCodec(getCosignerConfigEncoder(), getCosignerConfigDecoder());
|
|
3727
|
+
}
|
|
3728
|
+
function decodeCosignerConfig(encodedAccount) {
|
|
3729
|
+
return kit.decodeAccount(
|
|
3730
|
+
encodedAccount,
|
|
3731
|
+
getCosignerConfigDecoder()
|
|
3732
|
+
);
|
|
3733
|
+
}
|
|
3734
|
+
async function fetchCosignerConfig(rpc, address3, config) {
|
|
3735
|
+
const maybeAccount = await fetchMaybeCosignerConfig(rpc, address3, config);
|
|
3736
|
+
kit.assertAccountExists(maybeAccount);
|
|
3737
|
+
return maybeAccount;
|
|
3738
|
+
}
|
|
3739
|
+
async function fetchMaybeCosignerConfig(rpc, address3, config) {
|
|
3740
|
+
const maybeAccount = await kit.fetchEncodedAccount(rpc, address3, config);
|
|
3741
|
+
return decodeCosignerConfig(maybeAccount);
|
|
3742
|
+
}
|
|
3743
|
+
async function fetchAllCosignerConfig(rpc, addresses, config) {
|
|
3744
|
+
const maybeAccounts = await fetchAllMaybeCosignerConfig(
|
|
3745
|
+
rpc,
|
|
3746
|
+
addresses,
|
|
3747
|
+
config
|
|
3748
|
+
);
|
|
3749
|
+
kit.assertAccountsExist(maybeAccounts);
|
|
3750
|
+
return maybeAccounts;
|
|
3751
|
+
}
|
|
3752
|
+
async function fetchAllMaybeCosignerConfig(rpc, addresses, config) {
|
|
3753
|
+
const maybeAccounts = await kit.fetchEncodedAccounts(rpc, addresses, config);
|
|
3754
|
+
return maybeAccounts.map(
|
|
3755
|
+
(maybeAccount) => decodeCosignerConfig(maybeAccount)
|
|
3756
|
+
);
|
|
3757
|
+
}
|
|
3758
|
+
function getCosignerConfigSize() {
|
|
3759
|
+
return 1104;
|
|
3760
|
+
}
|
|
3761
|
+
var ADD_COSIGNER_DISCRIMINATOR = new Uint8Array([
|
|
3762
|
+
17,
|
|
3763
|
+
34,
|
|
3764
|
+
183,
|
|
3765
|
+
119,
|
|
3766
|
+
202,
|
|
3767
|
+
255,
|
|
3768
|
+
218,
|
|
3769
|
+
233
|
|
3770
|
+
]);
|
|
3771
|
+
function getAddCosignerDiscriminatorBytes() {
|
|
3772
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3773
|
+
ADD_COSIGNER_DISCRIMINATOR
|
|
3774
|
+
);
|
|
3775
|
+
}
|
|
3776
|
+
function getAddCosignerInstructionDataEncoder() {
|
|
3777
|
+
return kit.transformEncoder(
|
|
3778
|
+
kit.getStructEncoder([
|
|
3779
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3780
|
+
["cosigner", kit.getAddressEncoder()]
|
|
3781
|
+
]),
|
|
3782
|
+
(value) => ({ ...value, discriminator: ADD_COSIGNER_DISCRIMINATOR })
|
|
3783
|
+
);
|
|
3784
|
+
}
|
|
3785
|
+
function getAddCosignerInstructionDataDecoder() {
|
|
3786
|
+
return kit.getStructDecoder([
|
|
3787
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3788
|
+
["cosigner", kit.getAddressDecoder()]
|
|
3789
|
+
]);
|
|
3790
|
+
}
|
|
3791
|
+
function getAddCosignerInstructionDataCodec() {
|
|
3792
|
+
return kit.combineCodec(
|
|
3793
|
+
getAddCosignerInstructionDataEncoder(),
|
|
3794
|
+
getAddCosignerInstructionDataDecoder()
|
|
3795
|
+
);
|
|
3796
|
+
}
|
|
3797
|
+
async function getAddCosignerInstructionAsync(input, config) {
|
|
3798
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
3799
|
+
const originalAccounts = {
|
|
3800
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
3801
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
3802
|
+
};
|
|
3803
|
+
const accounts = originalAccounts;
|
|
3804
|
+
const args = { ...input };
|
|
3805
|
+
if (!accounts.config.value) {
|
|
3806
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
3807
|
+
programAddress,
|
|
3808
|
+
seeds: [
|
|
3809
|
+
kit.getBytesEncoder().encode(
|
|
3810
|
+
new Uint8Array([
|
|
3811
|
+
99,
|
|
3812
|
+
111,
|
|
3813
|
+
115,
|
|
3814
|
+
105,
|
|
3815
|
+
103,
|
|
3816
|
+
110,
|
|
3817
|
+
101,
|
|
3818
|
+
114,
|
|
3819
|
+
95,
|
|
3820
|
+
104,
|
|
3821
|
+
111,
|
|
3822
|
+
111,
|
|
3823
|
+
107,
|
|
3824
|
+
95,
|
|
3825
|
+
99,
|
|
3826
|
+
111,
|
|
3827
|
+
110,
|
|
3828
|
+
102,
|
|
3829
|
+
105,
|
|
3830
|
+
103
|
|
3831
|
+
])
|
|
3832
|
+
)
|
|
3833
|
+
]
|
|
3834
|
+
});
|
|
3835
|
+
}
|
|
3836
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3837
|
+
return Object.freeze({
|
|
3838
|
+
accounts: [
|
|
3839
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
3840
|
+
getAccountMeta("config", accounts.config)
|
|
3841
|
+
],
|
|
3842
|
+
data: getAddCosignerInstructionDataEncoder().encode(
|
|
3843
|
+
args
|
|
3844
|
+
),
|
|
3845
|
+
programAddress
|
|
3846
|
+
});
|
|
3847
|
+
}
|
|
3848
|
+
function getAddCosignerInstruction(input, config) {
|
|
3849
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
3850
|
+
const originalAccounts = {
|
|
3851
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
3852
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
3853
|
+
};
|
|
3854
|
+
const accounts = originalAccounts;
|
|
3855
|
+
const args = { ...input };
|
|
3856
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3857
|
+
return Object.freeze({
|
|
3858
|
+
accounts: [
|
|
3859
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
3860
|
+
getAccountMeta("config", accounts.config)
|
|
3861
|
+
],
|
|
3862
|
+
data: getAddCosignerInstructionDataEncoder().encode(
|
|
3863
|
+
args
|
|
3864
|
+
),
|
|
3865
|
+
programAddress
|
|
3866
|
+
});
|
|
3867
|
+
}
|
|
3868
|
+
function parseAddCosignerInstruction(instruction) {
|
|
3869
|
+
if (instruction.accounts.length < 2) {
|
|
3870
|
+
throw new kit.SolanaError(
|
|
3871
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3872
|
+
{
|
|
3873
|
+
actualAccountMetas: instruction.accounts.length,
|
|
3874
|
+
expectedAccountMetas: 2
|
|
3875
|
+
}
|
|
3876
|
+
);
|
|
3877
|
+
}
|
|
3878
|
+
let accountIndex = 0;
|
|
3879
|
+
const getNextAccount = () => {
|
|
3880
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
3881
|
+
accountIndex += 1;
|
|
3882
|
+
return accountMeta;
|
|
3883
|
+
};
|
|
3884
|
+
return {
|
|
3885
|
+
programAddress: instruction.programAddress,
|
|
3886
|
+
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
3887
|
+
data: getAddCosignerInstructionDataDecoder().decode(instruction.data)
|
|
3888
|
+
};
|
|
3889
|
+
}
|
|
3890
|
+
var INITIALIZE_CONFIG_DISCRIMINATOR2 = new Uint8Array([
|
|
3891
|
+
208,
|
|
3892
|
+
127,
|
|
3893
|
+
21,
|
|
3894
|
+
1,
|
|
3895
|
+
194,
|
|
3896
|
+
190,
|
|
3897
|
+
196,
|
|
3898
|
+
70
|
|
3899
|
+
]);
|
|
3900
|
+
function getInitializeConfigDiscriminatorBytes2() {
|
|
3901
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
3902
|
+
INITIALIZE_CONFIG_DISCRIMINATOR2
|
|
3903
|
+
);
|
|
3904
|
+
}
|
|
3905
|
+
function getInitializeConfigInstructionDataEncoder2() {
|
|
3906
|
+
return kit.transformEncoder(
|
|
3907
|
+
kit.getStructEncoder([
|
|
3908
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
3909
|
+
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
3910
|
+
]),
|
|
3911
|
+
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR2 })
|
|
3912
|
+
);
|
|
3913
|
+
}
|
|
3914
|
+
function getInitializeConfigInstructionDataDecoder2() {
|
|
3915
|
+
return kit.getStructDecoder([
|
|
3916
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
3917
|
+
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
3918
|
+
]);
|
|
3919
|
+
}
|
|
3920
|
+
function getInitializeConfigInstructionDataCodec2() {
|
|
3921
|
+
return kit.combineCodec(
|
|
3922
|
+
getInitializeConfigInstructionDataEncoder2(),
|
|
3923
|
+
getInitializeConfigInstructionDataDecoder2()
|
|
3924
|
+
);
|
|
3925
|
+
}
|
|
3926
|
+
async function getInitializeConfigInstructionAsync2(input, config) {
|
|
3927
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
3928
|
+
const originalAccounts = {
|
|
3929
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
3930
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
3931
|
+
config: { value: input.config ?? null, isWritable: true },
|
|
3932
|
+
programData: { value: input.programData ?? null, isWritable: false },
|
|
3933
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3934
|
+
};
|
|
3935
|
+
const accounts = originalAccounts;
|
|
3936
|
+
const args = { ...input };
|
|
3937
|
+
if (!accounts.config.value) {
|
|
3938
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
3939
|
+
programAddress,
|
|
3940
|
+
seeds: [
|
|
3941
|
+
kit.getBytesEncoder().encode(
|
|
3942
|
+
new Uint8Array([
|
|
3943
|
+
99,
|
|
3944
|
+
111,
|
|
3945
|
+
115,
|
|
3946
|
+
105,
|
|
3947
|
+
103,
|
|
3948
|
+
110,
|
|
3949
|
+
101,
|
|
3950
|
+
114,
|
|
3951
|
+
95,
|
|
3952
|
+
104,
|
|
3953
|
+
111,
|
|
3954
|
+
111,
|
|
3955
|
+
107,
|
|
3956
|
+
95,
|
|
3957
|
+
99,
|
|
3958
|
+
111,
|
|
3959
|
+
110,
|
|
3960
|
+
102,
|
|
3961
|
+
105,
|
|
3962
|
+
103
|
|
3963
|
+
])
|
|
3964
|
+
)
|
|
3965
|
+
]
|
|
3966
|
+
});
|
|
3967
|
+
}
|
|
3968
|
+
if (!accounts.systemProgram.value) {
|
|
3969
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3970
|
+
}
|
|
3971
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
3972
|
+
return Object.freeze({
|
|
3973
|
+
accounts: [
|
|
3974
|
+
getAccountMeta("payer", accounts.payer),
|
|
3975
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
3976
|
+
getAccountMeta("config", accounts.config),
|
|
3977
|
+
getAccountMeta("programData", accounts.programData),
|
|
3978
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
3979
|
+
],
|
|
3980
|
+
data: getInitializeConfigInstructionDataEncoder2().encode(
|
|
3981
|
+
args
|
|
3982
|
+
),
|
|
3983
|
+
programAddress
|
|
3984
|
+
});
|
|
3985
|
+
}
|
|
3986
|
+
function getInitializeConfigInstruction2(input, config) {
|
|
3987
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
3988
|
+
const originalAccounts = {
|
|
3989
|
+
payer: { value: input.payer ?? null, isWritable: true },
|
|
3990
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
3991
|
+
config: { value: input.config ?? null, isWritable: true },
|
|
3992
|
+
programData: { value: input.programData ?? null, isWritable: false },
|
|
3993
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3994
|
+
};
|
|
3995
|
+
const accounts = originalAccounts;
|
|
3996
|
+
const args = { ...input };
|
|
3997
|
+
if (!accounts.systemProgram.value) {
|
|
3998
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3999
|
+
}
|
|
4000
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
4001
|
+
return Object.freeze({
|
|
4002
|
+
accounts: [
|
|
4003
|
+
getAccountMeta("payer", accounts.payer),
|
|
4004
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
4005
|
+
getAccountMeta("config", accounts.config),
|
|
4006
|
+
getAccountMeta("programData", accounts.programData),
|
|
4007
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
4008
|
+
],
|
|
4009
|
+
data: getInitializeConfigInstructionDataEncoder2().encode(
|
|
4010
|
+
args
|
|
4011
|
+
),
|
|
4012
|
+
programAddress
|
|
4013
|
+
});
|
|
4014
|
+
}
|
|
4015
|
+
function parseInitializeConfigInstruction2(instruction) {
|
|
4016
|
+
if (instruction.accounts.length < 5) {
|
|
4017
|
+
throw new kit.SolanaError(
|
|
4018
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
4019
|
+
{
|
|
4020
|
+
actualAccountMetas: instruction.accounts.length,
|
|
4021
|
+
expectedAccountMetas: 5
|
|
4022
|
+
}
|
|
4023
|
+
);
|
|
4024
|
+
}
|
|
4025
|
+
let accountIndex = 0;
|
|
4026
|
+
const getNextAccount = () => {
|
|
4027
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
4028
|
+
accountIndex += 1;
|
|
4029
|
+
return accountMeta;
|
|
4030
|
+
};
|
|
4031
|
+
return {
|
|
4032
|
+
programAddress: instruction.programAddress,
|
|
4033
|
+
accounts: {
|
|
4034
|
+
payer: getNextAccount(),
|
|
4035
|
+
adminAuthority: getNextAccount(),
|
|
4036
|
+
config: getNextAccount(),
|
|
4037
|
+
programData: getNextAccount(),
|
|
4038
|
+
systemProgram: getNextAccount()
|
|
4039
|
+
},
|
|
4040
|
+
data: getInitializeConfigInstructionDataDecoder2().decode(instruction.data)
|
|
4041
|
+
};
|
|
4042
|
+
}
|
|
4043
|
+
var REMOVE_COSIGNER_DISCRIMINATOR = new Uint8Array([
|
|
4044
|
+
174,
|
|
4045
|
+
11,
|
|
4046
|
+
171,
|
|
4047
|
+
252,
|
|
4048
|
+
179,
|
|
4049
|
+
99,
|
|
4050
|
+
220,
|
|
4051
|
+
27
|
|
4052
|
+
]);
|
|
4053
|
+
function getRemoveCosignerDiscriminatorBytes() {
|
|
4054
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4055
|
+
REMOVE_COSIGNER_DISCRIMINATOR
|
|
4056
|
+
);
|
|
4057
|
+
}
|
|
4058
|
+
function getRemoveCosignerInstructionDataEncoder() {
|
|
4059
|
+
return kit.transformEncoder(
|
|
4060
|
+
kit.getStructEncoder([
|
|
4061
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
4062
|
+
["cosigner", kit.getAddressEncoder()]
|
|
4063
|
+
]),
|
|
4064
|
+
(value) => ({ ...value, discriminator: REMOVE_COSIGNER_DISCRIMINATOR })
|
|
4065
|
+
);
|
|
4066
|
+
}
|
|
4067
|
+
function getRemoveCosignerInstructionDataDecoder() {
|
|
4068
|
+
return kit.getStructDecoder([
|
|
4069
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
4070
|
+
["cosigner", kit.getAddressDecoder()]
|
|
4071
|
+
]);
|
|
4072
|
+
}
|
|
4073
|
+
function getRemoveCosignerInstructionDataCodec() {
|
|
4074
|
+
return kit.combineCodec(
|
|
4075
|
+
getRemoveCosignerInstructionDataEncoder(),
|
|
4076
|
+
getRemoveCosignerInstructionDataDecoder()
|
|
4077
|
+
);
|
|
4078
|
+
}
|
|
4079
|
+
async function getRemoveCosignerInstructionAsync(input, config) {
|
|
4080
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
4081
|
+
const originalAccounts = {
|
|
4082
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
4083
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
4084
|
+
};
|
|
4085
|
+
const accounts = originalAccounts;
|
|
4086
|
+
const args = { ...input };
|
|
4087
|
+
if (!accounts.config.value) {
|
|
4088
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
4089
|
+
programAddress,
|
|
4090
|
+
seeds: [
|
|
4091
|
+
kit.getBytesEncoder().encode(
|
|
4092
|
+
new Uint8Array([
|
|
4093
|
+
99,
|
|
4094
|
+
111,
|
|
4095
|
+
115,
|
|
4096
|
+
105,
|
|
4097
|
+
103,
|
|
4098
|
+
110,
|
|
4099
|
+
101,
|
|
4100
|
+
114,
|
|
4101
|
+
95,
|
|
4102
|
+
104,
|
|
4103
|
+
111,
|
|
4104
|
+
111,
|
|
4105
|
+
107,
|
|
4106
|
+
95,
|
|
4107
|
+
99,
|
|
4108
|
+
111,
|
|
4109
|
+
110,
|
|
4110
|
+
102,
|
|
4111
|
+
105,
|
|
4112
|
+
103
|
|
4113
|
+
])
|
|
4114
|
+
)
|
|
4115
|
+
]
|
|
4116
|
+
});
|
|
4117
|
+
}
|
|
4118
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
4119
|
+
return Object.freeze({
|
|
4120
|
+
accounts: [
|
|
4121
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
4122
|
+
getAccountMeta("config", accounts.config)
|
|
4123
|
+
],
|
|
4124
|
+
data: getRemoveCosignerInstructionDataEncoder().encode(
|
|
4125
|
+
args
|
|
4126
|
+
),
|
|
4127
|
+
programAddress
|
|
4128
|
+
});
|
|
4129
|
+
}
|
|
4130
|
+
function getRemoveCosignerInstruction(input, config) {
|
|
4131
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
4132
|
+
const originalAccounts = {
|
|
4133
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
4134
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
4135
|
+
};
|
|
4136
|
+
const accounts = originalAccounts;
|
|
4137
|
+
const args = { ...input };
|
|
4138
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
4139
|
+
return Object.freeze({
|
|
4140
|
+
accounts: [
|
|
4141
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
4142
|
+
getAccountMeta("config", accounts.config)
|
|
4143
|
+
],
|
|
4144
|
+
data: getRemoveCosignerInstructionDataEncoder().encode(
|
|
4145
|
+
args
|
|
4146
|
+
),
|
|
4147
|
+
programAddress
|
|
4148
|
+
});
|
|
4149
|
+
}
|
|
4150
|
+
function parseRemoveCosignerInstruction(instruction) {
|
|
4151
|
+
if (instruction.accounts.length < 2) {
|
|
4152
|
+
throw new kit.SolanaError(
|
|
4153
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
4154
|
+
{
|
|
4155
|
+
actualAccountMetas: instruction.accounts.length,
|
|
4156
|
+
expectedAccountMetas: 2
|
|
4157
|
+
}
|
|
4158
|
+
);
|
|
4159
|
+
}
|
|
4160
|
+
let accountIndex = 0;
|
|
4161
|
+
const getNextAccount = () => {
|
|
4162
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
4163
|
+
accountIndex += 1;
|
|
4164
|
+
return accountMeta;
|
|
4165
|
+
};
|
|
4166
|
+
return {
|
|
4167
|
+
programAddress: instruction.programAddress,
|
|
4168
|
+
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
4169
|
+
data: getRemoveCosignerInstructionDataDecoder().decode(instruction.data)
|
|
4170
|
+
};
|
|
4171
|
+
}
|
|
4172
|
+
var SET_AUTHORITY_DISCRIMINATOR = new Uint8Array([
|
|
4173
|
+
133,
|
|
4174
|
+
250,
|
|
4175
|
+
37,
|
|
4176
|
+
21,
|
|
4177
|
+
110,
|
|
4178
|
+
163,
|
|
4179
|
+
26,
|
|
4180
|
+
121
|
|
4181
|
+
]);
|
|
4182
|
+
function getSetAuthorityDiscriminatorBytes() {
|
|
4183
|
+
return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4184
|
+
SET_AUTHORITY_DISCRIMINATOR
|
|
4185
|
+
);
|
|
4186
|
+
}
|
|
4187
|
+
function getSetAuthorityInstructionDataEncoder() {
|
|
4188
|
+
return kit.transformEncoder(
|
|
4189
|
+
kit.getStructEncoder([
|
|
4190
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
4191
|
+
["adminAuthority", kit.getAddressEncoder()]
|
|
4192
|
+
]),
|
|
4193
|
+
(value) => ({ ...value, discriminator: SET_AUTHORITY_DISCRIMINATOR })
|
|
4194
|
+
);
|
|
4195
|
+
}
|
|
4196
|
+
function getSetAuthorityInstructionDataDecoder() {
|
|
4197
|
+
return kit.getStructDecoder([
|
|
4198
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
4199
|
+
["adminAuthority", kit.getAddressDecoder()]
|
|
4200
|
+
]);
|
|
4201
|
+
}
|
|
4202
|
+
function getSetAuthorityInstructionDataCodec() {
|
|
4203
|
+
return kit.combineCodec(
|
|
4204
|
+
getSetAuthorityInstructionDataEncoder(),
|
|
4205
|
+
getSetAuthorityInstructionDataDecoder()
|
|
4206
|
+
);
|
|
4207
|
+
}
|
|
4208
|
+
async function getSetAuthorityInstructionAsync(input, config) {
|
|
4209
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
4210
|
+
const originalAccounts = {
|
|
4211
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
4212
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
4213
|
+
};
|
|
4214
|
+
const accounts = originalAccounts;
|
|
4215
|
+
const args = { ...input, adminAuthority: input.adminAuthorityArg };
|
|
4216
|
+
if (!accounts.config.value) {
|
|
4217
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
4218
|
+
programAddress,
|
|
4219
|
+
seeds: [
|
|
4220
|
+
kit.getBytesEncoder().encode(
|
|
4221
|
+
new Uint8Array([
|
|
4222
|
+
99,
|
|
4223
|
+
111,
|
|
4224
|
+
115,
|
|
4225
|
+
105,
|
|
4226
|
+
103,
|
|
4227
|
+
110,
|
|
4228
|
+
101,
|
|
4229
|
+
114,
|
|
4230
|
+
95,
|
|
4231
|
+
104,
|
|
4232
|
+
111,
|
|
4233
|
+
111,
|
|
4234
|
+
107,
|
|
4235
|
+
95,
|
|
4236
|
+
99,
|
|
4237
|
+
111,
|
|
4238
|
+
110,
|
|
4239
|
+
102,
|
|
4240
|
+
105,
|
|
4241
|
+
103
|
|
4242
|
+
])
|
|
4243
|
+
)
|
|
4244
|
+
]
|
|
4245
|
+
});
|
|
4246
|
+
}
|
|
4247
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
4248
|
+
return Object.freeze({
|
|
4249
|
+
accounts: [
|
|
4250
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
4251
|
+
getAccountMeta("config", accounts.config)
|
|
4252
|
+
],
|
|
4253
|
+
data: getSetAuthorityInstructionDataEncoder().encode(
|
|
4254
|
+
args
|
|
4255
|
+
),
|
|
4256
|
+
programAddress
|
|
4257
|
+
});
|
|
4258
|
+
}
|
|
4259
|
+
function getSetAuthorityInstruction(input, config) {
|
|
4260
|
+
const programAddress = config?.programAddress ?? COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
4261
|
+
const originalAccounts = {
|
|
4262
|
+
adminAuthority: { value: input.adminAuthority ?? null, isWritable: false },
|
|
4263
|
+
config: { value: input.config ?? null, isWritable: true }
|
|
4264
|
+
};
|
|
4265
|
+
const accounts = originalAccounts;
|
|
4266
|
+
const args = { ...input, adminAuthority: input.adminAuthorityArg };
|
|
4267
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
4268
|
+
return Object.freeze({
|
|
4269
|
+
accounts: [
|
|
4270
|
+
getAccountMeta("adminAuthority", accounts.adminAuthority),
|
|
4271
|
+
getAccountMeta("config", accounts.config)
|
|
4272
|
+
],
|
|
4273
|
+
data: getSetAuthorityInstructionDataEncoder().encode(
|
|
4274
|
+
args
|
|
4275
|
+
),
|
|
4276
|
+
programAddress
|
|
4277
|
+
});
|
|
4278
|
+
}
|
|
4279
|
+
function parseSetAuthorityInstruction(instruction) {
|
|
4280
|
+
if (instruction.accounts.length < 2) {
|
|
4281
|
+
throw new kit.SolanaError(
|
|
4282
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
4283
|
+
{
|
|
4284
|
+
actualAccountMetas: instruction.accounts.length,
|
|
4285
|
+
expectedAccountMetas: 2
|
|
4286
|
+
}
|
|
4287
|
+
);
|
|
4288
|
+
}
|
|
4289
|
+
let accountIndex = 0;
|
|
4290
|
+
const getNextAccount = () => {
|
|
4291
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
4292
|
+
accountIndex += 1;
|
|
4293
|
+
return accountMeta;
|
|
4294
|
+
};
|
|
4295
|
+
return {
|
|
4296
|
+
programAddress: instruction.programAddress,
|
|
4297
|
+
accounts: { adminAuthority: getNextAccount(), config: getNextAccount() },
|
|
4298
|
+
data: getSetAuthorityInstructionDataDecoder().decode(instruction.data)
|
|
4299
|
+
};
|
|
4300
|
+
}
|
|
4301
|
+
|
|
4302
|
+
// src/solana/generated/cosignerHook/programs/cosignerHook.ts
|
|
4303
|
+
var COSIGNER_HOOK_PROGRAM_ADDRESS = "JDwnBoYE2NsmkQjQLHi1btQxeHirtJ9XjU1dM641QZt";
|
|
4304
|
+
var CosignerHookAccount = /* @__PURE__ */ ((CosignerHookAccount2) => {
|
|
4305
|
+
CosignerHookAccount2[CosignerHookAccount2["CosignerConfig"] = 0] = "CosignerConfig";
|
|
4306
|
+
return CosignerHookAccount2;
|
|
4307
|
+
})(CosignerHookAccount || {});
|
|
4308
|
+
function identifyCosignerHookAccount(account) {
|
|
4309
|
+
const data = "data" in account ? account.data : account;
|
|
4310
|
+
if (kit.containsBytes(
|
|
4311
|
+
data,
|
|
4312
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4313
|
+
new Uint8Array([133, 227, 177, 74, 145, 74, 247, 183])
|
|
4314
|
+
),
|
|
4315
|
+
0
|
|
4316
|
+
)) {
|
|
4317
|
+
return 0 /* CosignerConfig */;
|
|
4318
|
+
}
|
|
4319
|
+
throw new kit.SolanaError(
|
|
4320
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT,
|
|
4321
|
+
{ accountData: data, programName: "cosignerHook" }
|
|
4322
|
+
);
|
|
4323
|
+
}
|
|
4324
|
+
var CosignerHookInstruction = /* @__PURE__ */ ((CosignerHookInstruction2) => {
|
|
4325
|
+
CosignerHookInstruction2[CosignerHookInstruction2["AddCosigner"] = 0] = "AddCosigner";
|
|
4326
|
+
CosignerHookInstruction2[CosignerHookInstruction2["InitializeConfig"] = 1] = "InitializeConfig";
|
|
4327
|
+
CosignerHookInstruction2[CosignerHookInstruction2["RemoveCosigner"] = 2] = "RemoveCosigner";
|
|
4328
|
+
CosignerHookInstruction2[CosignerHookInstruction2["SetAuthority"] = 3] = "SetAuthority";
|
|
4329
|
+
return CosignerHookInstruction2;
|
|
4330
|
+
})(CosignerHookInstruction || {});
|
|
4331
|
+
function identifyCosignerHookInstruction(instruction) {
|
|
4332
|
+
const data = "data" in instruction ? instruction.data : instruction;
|
|
4333
|
+
if (kit.containsBytes(
|
|
4334
|
+
data,
|
|
4335
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4336
|
+
new Uint8Array([17, 34, 183, 119, 202, 255, 218, 233])
|
|
4337
|
+
),
|
|
4338
|
+
0
|
|
4339
|
+
)) {
|
|
4340
|
+
return 0 /* AddCosigner */;
|
|
4341
|
+
}
|
|
4342
|
+
if (kit.containsBytes(
|
|
4343
|
+
data,
|
|
4344
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4345
|
+
new Uint8Array([208, 127, 21, 1, 194, 190, 196, 70])
|
|
4346
|
+
),
|
|
4347
|
+
0
|
|
4348
|
+
)) {
|
|
4349
|
+
return 1 /* InitializeConfig */;
|
|
4350
|
+
}
|
|
4351
|
+
if (kit.containsBytes(
|
|
4352
|
+
data,
|
|
4353
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4354
|
+
new Uint8Array([174, 11, 171, 252, 179, 99, 220, 27])
|
|
4355
|
+
),
|
|
4356
|
+
0
|
|
4357
|
+
)) {
|
|
4358
|
+
return 2 /* RemoveCosigner */;
|
|
4359
|
+
}
|
|
4360
|
+
if (kit.containsBytes(
|
|
4361
|
+
data,
|
|
4362
|
+
kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
|
|
4363
|
+
new Uint8Array([133, 250, 37, 21, 110, 163, 26, 121])
|
|
4364
|
+
),
|
|
4365
|
+
0
|
|
4366
|
+
)) {
|
|
4367
|
+
return 3 /* SetAuthority */;
|
|
4368
|
+
}
|
|
4369
|
+
throw new kit.SolanaError(
|
|
4370
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
|
|
4371
|
+
{ instructionData: data, programName: "cosignerHook" }
|
|
4372
|
+
);
|
|
4373
|
+
}
|
|
4374
|
+
function parseCosignerHookInstruction(instruction) {
|
|
4375
|
+
const instructionType = identifyCosignerHookInstruction(instruction);
|
|
4376
|
+
switch (instructionType) {
|
|
4377
|
+
case 0 /* AddCosigner */: {
|
|
4378
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
4379
|
+
return {
|
|
4380
|
+
instructionType: 0 /* AddCosigner */,
|
|
4381
|
+
...parseAddCosignerInstruction(instruction)
|
|
4382
|
+
};
|
|
4383
|
+
}
|
|
4384
|
+
case 1 /* InitializeConfig */: {
|
|
4385
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
4386
|
+
return {
|
|
4387
|
+
instructionType: 1 /* InitializeConfig */,
|
|
4388
|
+
...parseInitializeConfigInstruction2(instruction)
|
|
4389
|
+
};
|
|
4390
|
+
}
|
|
4391
|
+
case 2 /* RemoveCosigner */: {
|
|
4392
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
4393
|
+
return {
|
|
4394
|
+
instructionType: 2 /* RemoveCosigner */,
|
|
4395
|
+
...parseRemoveCosignerInstruction(instruction)
|
|
4396
|
+
};
|
|
4397
|
+
}
|
|
4398
|
+
case 3 /* SetAuthority */: {
|
|
4399
|
+
kit.assertIsInstructionWithAccounts(instruction);
|
|
4400
|
+
return {
|
|
4401
|
+
instructionType: 3 /* SetAuthority */,
|
|
4402
|
+
...parseSetAuthorityInstruction(instruction)
|
|
4403
|
+
};
|
|
4404
|
+
}
|
|
4405
|
+
default:
|
|
4406
|
+
throw new kit.SolanaError(
|
|
4407
|
+
kit.SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
|
|
4408
|
+
{
|
|
4409
|
+
instructionType,
|
|
4410
|
+
programName: "cosignerHook"
|
|
4411
|
+
}
|
|
4412
|
+
);
|
|
4413
|
+
}
|
|
4414
|
+
}
|
|
4415
|
+
function cosignerHookProgram() {
|
|
4416
|
+
return (client) => {
|
|
4417
|
+
return {
|
|
4418
|
+
...client,
|
|
4419
|
+
cosignerHook: {
|
|
4420
|
+
accounts: {
|
|
4421
|
+
cosignerConfig: programClientCore.addSelfFetchFunctions(
|
|
4422
|
+
client,
|
|
4423
|
+
getCosignerConfigCodec()
|
|
4424
|
+
)
|
|
4425
|
+
},
|
|
4426
|
+
instructions: {
|
|
4427
|
+
addCosigner: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
4428
|
+
client,
|
|
4429
|
+
getAddCosignerInstructionAsync(input)
|
|
4430
|
+
),
|
|
4431
|
+
initializeConfig: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
4432
|
+
client,
|
|
4433
|
+
getInitializeConfigInstructionAsync2({
|
|
4434
|
+
...input,
|
|
4435
|
+
payer: input.payer ?? client.payer
|
|
4436
|
+
})
|
|
4437
|
+
),
|
|
4438
|
+
removeCosigner: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
4439
|
+
client,
|
|
4440
|
+
getRemoveCosignerInstructionAsync(input)
|
|
4441
|
+
),
|
|
4442
|
+
setAuthority: (input) => programClientCore.addSelfPlanAndSendFunctions(
|
|
4443
|
+
client,
|
|
4444
|
+
getSetAuthorityInstructionAsync(input)
|
|
4445
|
+
)
|
|
4446
|
+
}
|
|
4447
|
+
}
|
|
4448
|
+
};
|
|
4449
|
+
};
|
|
4450
|
+
}
|
|
4451
|
+
|
|
4452
|
+
// src/solana/generated/cosignerHook/errors/cosignerHook.ts
|
|
4453
|
+
var COSIGNER_HOOK_ERROR__INVALID_CONFIG = 6e3;
|
|
4454
|
+
var COSIGNER_HOOK_ERROR__INVALID_AUTHORITY = 6001;
|
|
4455
|
+
var COSIGNER_HOOK_ERROR__INVALID_COSIGNER = 6002;
|
|
4456
|
+
var COSIGNER_HOOK_ERROR__COSIGNER_ALREADY_EXISTS = 6003;
|
|
4457
|
+
var COSIGNER_HOOK_ERROR__COSIGNER_NOT_FOUND = 6004;
|
|
4458
|
+
var COSIGNER_HOOK_ERROR__COSIGNER_LIST_FULL = 6005;
|
|
4459
|
+
var cosignerHookErrorMessages;
|
|
4460
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4461
|
+
cosignerHookErrorMessages = {
|
|
4462
|
+
[COSIGNER_HOOK_ERROR__COSIGNER_ALREADY_EXISTS]: `Cosigner already exists`,
|
|
4463
|
+
[COSIGNER_HOOK_ERROR__COSIGNER_LIST_FULL]: `Cosigner list is full`,
|
|
4464
|
+
[COSIGNER_HOOK_ERROR__COSIGNER_NOT_FOUND]: `Cosigner not found`,
|
|
4465
|
+
[COSIGNER_HOOK_ERROR__INVALID_AUTHORITY]: `Invalid cosigner hook authority`,
|
|
4466
|
+
[COSIGNER_HOOK_ERROR__INVALID_CONFIG]: `Invalid cosigner hook config`,
|
|
4467
|
+
[COSIGNER_HOOK_ERROR__INVALID_COSIGNER]: `Invalid cosigner key`
|
|
4468
|
+
};
|
|
4469
|
+
}
|
|
4470
|
+
function getCosignerHookErrorMessage(code) {
|
|
4471
|
+
if (process.env.NODE_ENV !== "production") {
|
|
4472
|
+
return cosignerHookErrorMessages[code];
|
|
4473
|
+
}
|
|
4474
|
+
return "Error message not available in production bundles.";
|
|
4475
|
+
}
|
|
4476
|
+
function isCosignerHookError(error, transactionMessage, code) {
|
|
4477
|
+
return kit.isProgramError(
|
|
4478
|
+
error,
|
|
4479
|
+
transactionMessage,
|
|
4480
|
+
COSIGNER_HOOK_PROGRAM_ADDRESS,
|
|
4481
|
+
code
|
|
4482
|
+
);
|
|
4483
|
+
}
|
|
4484
|
+
function getCosignerArgEncoder() {
|
|
4485
|
+
return kit.getStructEncoder([["cosigner", kit.getAddressEncoder()]]);
|
|
4486
|
+
}
|
|
4487
|
+
function getCosignerArgDecoder() {
|
|
4488
|
+
return kit.getStructDecoder([["cosigner", kit.getAddressDecoder()]]);
|
|
4489
|
+
}
|
|
4490
|
+
function getCosignerArgCodec() {
|
|
4491
|
+
return kit.combineCodec(getCosignerArgEncoder(), getCosignerArgDecoder());
|
|
4492
|
+
}
|
|
4493
|
+
function getInitializeConfigArgsEncoder() {
|
|
4494
|
+
return kit.getStructEncoder([
|
|
4495
|
+
["cosigners", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
4496
|
+
]);
|
|
4497
|
+
}
|
|
4498
|
+
function getInitializeConfigArgsDecoder() {
|
|
4499
|
+
return kit.getStructDecoder([
|
|
4500
|
+
["cosigners", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
4501
|
+
]);
|
|
4502
|
+
}
|
|
4503
|
+
function getInitializeConfigArgsCodec() {
|
|
4504
|
+
return kit.combineCodec(
|
|
4505
|
+
getInitializeConfigArgsEncoder(),
|
|
4506
|
+
getInitializeConfigArgsDecoder()
|
|
4507
|
+
);
|
|
4508
|
+
}
|
|
4509
|
+
function getSetAuthorityArgsEncoder() {
|
|
4510
|
+
return kit.getStructEncoder([["adminAuthority", kit.getAddressEncoder()]]);
|
|
4511
|
+
}
|
|
4512
|
+
function getSetAuthorityArgsDecoder() {
|
|
4513
|
+
return kit.getStructDecoder([["adminAuthority", kit.getAddressDecoder()]]);
|
|
4514
|
+
}
|
|
4515
|
+
function getSetAuthorityArgsCodec() {
|
|
4516
|
+
return kit.combineCodec(
|
|
4517
|
+
getSetAuthorityArgsEncoder(),
|
|
4518
|
+
getSetAuthorityArgsDecoder()
|
|
4519
|
+
);
|
|
4520
|
+
}
|
|
4521
|
+
|
|
4522
|
+
// src/solana/cosignerHook/constants.ts
|
|
4523
|
+
var COSIGNER_HOOK_PROGRAM_ID = COSIGNER_HOOK_PROGRAM_ADDRESS;
|
|
4524
|
+
var SEED_COSIGNER_HOOK_CONFIG = "cosigner_hook_config";
|
|
4525
|
+
var MAX_COSIGNERS = 32;
|
|
4526
|
+
var textEncoder2 = new TextEncoder();
|
|
4527
|
+
async function getCosignerHookConfigAddress(programId = COSIGNER_HOOK_PROGRAM_ID) {
|
|
4528
|
+
return kit.getProgramDerivedAddress({
|
|
4529
|
+
programAddress: programId,
|
|
4530
|
+
seeds: [textEncoder2.encode(SEED_COSIGNER_HOOK_CONFIG)]
|
|
4531
|
+
});
|
|
4532
|
+
}
|
|
4533
|
+
|
|
4534
|
+
// src/solana/initializer/index.ts
|
|
4535
|
+
var initializer_exports = {};
|
|
4536
|
+
chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
4537
|
+
BPF_LOADER_UPGRADEABLE_PROGRAM_ID: () => BPF_LOADER_UPGRADEABLE_PROGRAM_ID,
|
|
4538
|
+
CPMM_HOOK_PROGRAM_ID: () => CPMM_HOOK_PROGRAM_ID,
|
|
4539
|
+
CURVE_KIND_XYK: () => CURVE_KIND_XYK,
|
|
4540
|
+
CURVE_PARAMS_FORMAT_XYK_V0: () => CURVE_PARAMS_FORMAT_XYK_V0,
|
|
4541
|
+
DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND: () => DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND,
|
|
4542
|
+
EMPTY_REMAINING_ACCOUNTS_HASH: () => EMPTY_REMAINING_ACCOUNTS_HASH,
|
|
4543
|
+
HF_AFTER_CREATE: () => HF_AFTER_CREATE,
|
|
4544
|
+
HF_AFTER_MIGRATE: () => HF_AFTER_MIGRATE,
|
|
4545
|
+
HF_AFTER_SWAP: () => HF_AFTER_SWAP2,
|
|
4546
|
+
HF_BEFORE_CREATE: () => HF_BEFORE_CREATE,
|
|
4547
|
+
HF_BEFORE_MIGRATE: () => HF_BEFORE_MIGRATE,
|
|
4548
|
+
HF_BEFORE_SWAP: () => HF_BEFORE_SWAP2,
|
|
4549
|
+
HF_FORWARD_READONLY_SIGNERS: () => HF_FORWARD_READONLY_SIGNERS2,
|
|
4550
|
+
HOOK_NO_CHANGE: () => HOOK_NO_CHANGE2,
|
|
4551
|
+
INITIALIZER_ACCOUNT_DISCRIMINATORS: () => INITIALIZER_ACCOUNT_DISCRIMINATORS,
|
|
4552
|
+
INITIALIZER_INSTRUCTION_DISCRIMINATORS: () => INITIALIZER_INSTRUCTION_DISCRIMINATORS,
|
|
4553
|
+
INITIALIZER_PROGRAM_ID: () => INITIALIZER_PROGRAM_ID,
|
|
4554
|
+
MAX_HOOK_ALLOWLIST: () => MAX_HOOK_ALLOWLIST2,
|
|
4555
|
+
MAX_MIGRATOR_ALLOWLIST: () => MAX_MIGRATOR_ALLOWLIST,
|
|
4556
|
+
MAX_PAYLOAD: () => MAX_PAYLOAD,
|
|
4557
|
+
PHASE_ABORTED: () => PHASE_ABORTED,
|
|
4558
|
+
PHASE_MIGRATED: () => PHASE_MIGRATED,
|
|
4559
|
+
PHASE_TRADING: () => PHASE_TRADING,
|
|
4560
|
+
PREDICTION_HOOK_PROGRAM_ID: () => PREDICTION_HOOK_PROGRAM_ID,
|
|
4561
|
+
SEED_CONFIG: () => SEED_CONFIG2,
|
|
4562
|
+
SEED_LAUNCH: () => SEED_LAUNCH,
|
|
4563
|
+
SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
|
|
4564
|
+
SEED_LAUNCH_FEE_STATE: () => SEED_LAUNCH_FEE_STATE,
|
|
4565
|
+
TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
|
|
4566
|
+
TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
|
|
4567
|
+
buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
|
|
4568
|
+
compressTransactionMessageWithLookupTable: () => compressTransactionMessageWithLookupTable,
|
|
4569
|
+
computeRemainingAccountsHash: () => computeRemainingAccountsHash,
|
|
4570
|
+
createCurveSwapExactInInstruction: () => createCurveSwapExactInInstruction,
|
|
4571
|
+
createInitializeConfigInstruction: () => createInitializeConfigInstruction,
|
|
4572
|
+
createInitializeLaunchInstruction: () => createInitializeLaunchInstruction,
|
|
4573
|
+
createMigrateLaunchInstruction: () => createMigrateLaunchInstruction,
|
|
4574
|
+
createPreviewMigrationInstruction: () => createPreviewMigrationInstruction,
|
|
4575
|
+
createPreviewSwapExactInInstruction: () => createPreviewSwapExactInInstruction,
|
|
4576
|
+
createSetHookAllowlistInstruction: () => createSetHookAllowlistInstruction,
|
|
4577
|
+
createSetMigratorAllowlistInstruction: () => createSetMigratorAllowlistInstruction,
|
|
4578
|
+
decodePreviewMigrationResult: () => decodePreviewMigrationResult,
|
|
4579
|
+
decodePreviewSwapExactInResult: () => decodePreviewSwapExactInResult,
|
|
4580
|
+
encodeU64LE: () => encodeU64LE,
|
|
4581
|
+
fetchAllLaunches: () => fetchAllLaunches,
|
|
4582
|
+
fetchLaunch: () => fetchLaunch2,
|
|
4583
|
+
fetchLaunchesByAuthority: () => fetchLaunchesByAuthority,
|
|
4584
|
+
getClaimFeesInstructionAsync: () => getClaimFeesInstructionAsync,
|
|
4585
|
+
getConfigAddress: () => getConfigAddress2,
|
|
4586
|
+
getHarvestMigratedFeesInstructionAsync: () => getHarvestMigratedFeesInstructionAsync,
|
|
4587
|
+
getInitConfigCodec: () => getInitConfigCodec,
|
|
4588
|
+
getInitConfigDecoder: () => getInitConfigDecoder,
|
|
4589
|
+
getInitConfigEncoder: () => getInitConfigEncoder,
|
|
4590
|
+
getInitializeConfigArgsCodec: () => getInitializeConfigArgsCodec2,
|
|
4591
|
+
getInitializeConfigArgsDecoder: () => getInitializeConfigArgsDecoder2,
|
|
4592
|
+
getInitializeConfigArgsEncoder: () => getInitializeConfigArgsEncoder2,
|
|
4593
|
+
getInitializeLaunchArgsCodec: () => getInitializeLaunchArgsCodec,
|
|
4594
|
+
getInitializeLaunchArgsDecoder: () => getInitializeLaunchArgsDecoder,
|
|
4595
|
+
getInitializeLaunchArgsEncoder: () => getInitializeLaunchArgsEncoder,
|
|
4596
|
+
getInstructionLookupTableAddresses: () => getInstructionLookupTableAddresses,
|
|
4597
|
+
getLaunchAddress: () => getLaunchAddress,
|
|
4598
|
+
getLaunchAuthorityAddress: () => getLaunchAuthorityAddress,
|
|
4599
|
+
getLaunchCodec: () => getLaunchCodec,
|
|
4600
|
+
getLaunchDecoder: () => getLaunchDecoder,
|
|
4601
|
+
getLaunchEncoder: () => getLaunchEncoder,
|
|
4602
|
+
getLaunchFeeStateAddress: () => getLaunchFeeStateAddress,
|
|
4603
|
+
getLaunchFeeStateCodec: () => getLaunchFeeStateCodec,
|
|
4604
|
+
getLaunchFeeStateDecoder: () => getLaunchFeeStateDecoder,
|
|
4605
|
+
getLaunchFeeStateEncoder: () => getLaunchFeeStateEncoder,
|
|
4606
|
+
getProgramDataAddress: () => getProgramDataAddress,
|
|
4607
|
+
getReplaceFeeBeneficiaryInstructionAsync: () => getReplaceFeeBeneficiaryInstructionAsync,
|
|
4608
|
+
getSetFeePolicyInstructionAsync: () => getSetFeePolicyInstructionAsync,
|
|
4609
|
+
getTokenMetadataAddress: () => getTokenMetadataAddress,
|
|
4610
|
+
launchExists: () => launchExists,
|
|
4611
|
+
launchIdFromU64: () => launchIdFromU64,
|
|
4612
|
+
phaseLabel: () => phaseLabel
|
|
4613
|
+
});
|
|
4614
|
+
var INITIALIZER_PROGRAM_ID = kit.address(
|
|
4615
|
+
"4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1"
|
|
4616
|
+
);
|
|
4617
|
+
var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = kit.address(
|
|
4618
|
+
"BPFLoaderUpgradeab1e11111111111111111111111"
|
|
4619
|
+
);
|
|
4620
|
+
var CPMM_HOOK_PROGRAM_ID = kit.address(
|
|
4621
|
+
"2vJ1c62knEwZbxp3XdHB4RSmCfz55pA6tRkCho63gW7u"
|
|
4622
|
+
);
|
|
4623
|
+
var PREDICTION_HOOK_PROGRAM_ID = kit.address(
|
|
4624
|
+
"7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB"
|
|
4625
|
+
);
|
|
4626
|
+
var SEED_CONFIG2 = "config";
|
|
4627
|
+
var SEED_LAUNCH = "launch";
|
|
4628
|
+
var SEED_LAUNCH_AUTHORITY = "launch_authority";
|
|
4629
|
+
var SEED_LAUNCH_FEE_STATE = "launch_fee_state";
|
|
4630
|
+
var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
|
|
4631
|
+
232,
|
|
4632
|
+
231,
|
|
4633
|
+
118,
|
|
4634
|
+
38,
|
|
4635
|
+
88,
|
|
4636
|
+
111,
|
|
4637
|
+
115,
|
|
4638
|
+
185,
|
|
4639
|
+
85,
|
|
4640
|
+
54,
|
|
4641
|
+
76,
|
|
4642
|
+
123,
|
|
4643
|
+
75,
|
|
4644
|
+
191,
|
|
4645
|
+
11,
|
|
4646
|
+
183,
|
|
4647
|
+
247,
|
|
4648
|
+
104,
|
|
4649
|
+
94,
|
|
4650
|
+
189,
|
|
4651
|
+
64,
|
|
4652
|
+
232,
|
|
4653
|
+
82,
|
|
4654
|
+
177,
|
|
4655
|
+
100,
|
|
4656
|
+
99,
|
|
4657
|
+
58,
|
|
4658
|
+
74,
|
|
4659
|
+
203,
|
|
4660
|
+
211,
|
|
4661
|
+
36,
|
|
4662
|
+
76
|
|
4663
|
+
]);
|
|
4664
|
+
var MAX_MIGRATOR_ALLOWLIST = 32;
|
|
4665
|
+
var MAX_HOOK_ALLOWLIST2 = 32;
|
|
4666
|
+
var MAX_PAYLOAD = 256;
|
|
4667
|
+
var PHASE_TRADING = 0;
|
|
4668
|
+
var PHASE_MIGRATED = 1;
|
|
4669
|
+
var PHASE_ABORTED = 2;
|
|
4670
|
+
var TRADE_DIRECTION_BUY = 0;
|
|
4671
|
+
var TRADE_DIRECTION_SELL = 1;
|
|
4672
|
+
var CURVE_KIND_XYK = 0;
|
|
4673
|
+
var CURVE_PARAMS_FORMAT_XYK_V0 = 0;
|
|
4674
|
+
var HF_BEFORE_SWAP2 = 1 << 0;
|
|
4675
|
+
var HF_AFTER_SWAP2 = 1 << 1;
|
|
4676
|
+
var HF_BEFORE_CREATE = 1 << 2;
|
|
4677
|
+
var HF_AFTER_CREATE = 1 << 3;
|
|
4678
|
+
var HF_BEFORE_MIGRATE = 1 << 4;
|
|
4679
|
+
var HF_AFTER_MIGRATE = 1 << 5;
|
|
4680
|
+
var HF_FORWARD_READONLY_SIGNERS2 = 1 << 6;
|
|
4681
|
+
var HOOK_NO_CHANGE2 = 65535;
|
|
4682
|
+
var INITIALIZER_INSTRUCTION_DISCRIMINATORS = {
|
|
4683
|
+
// SHA256("global:initialize_config")[0:8]
|
|
4684
|
+
initializeConfig: new Uint8Array([
|
|
4685
|
+
208,
|
|
4686
|
+
127,
|
|
4687
|
+
21,
|
|
4688
|
+
1,
|
|
4689
|
+
194,
|
|
4690
|
+
190,
|
|
4691
|
+
196,
|
|
4692
|
+
70
|
|
4693
|
+
]),
|
|
4694
|
+
// SHA256("global:set_migrator_allowlist")[0:8]
|
|
4695
|
+
setMigratorAllowlist: new Uint8Array([
|
|
4696
|
+
209,
|
|
4697
|
+
90,
|
|
4698
|
+
181,
|
|
4699
|
+
104,
|
|
4700
|
+
99,
|
|
4701
|
+
108,
|
|
4702
|
+
233,
|
|
4703
|
+
168
|
|
4704
|
+
]),
|
|
4705
|
+
// SHA256("global:set_hook_allowlist")[0:8]
|
|
4706
|
+
setHookAllowlist: new Uint8Array([
|
|
4707
|
+
232,
|
|
4708
|
+
28,
|
|
4709
|
+
40,
|
|
4710
|
+
143,
|
|
4711
|
+
121,
|
|
4712
|
+
182,
|
|
4713
|
+
77,
|
|
4714
|
+
103
|
|
4715
|
+
]),
|
|
4716
|
+
// SHA256("global:initialize_launch")[0:8]
|
|
4717
|
+
initializeLaunch: new Uint8Array([
|
|
4718
|
+
90,
|
|
4719
|
+
201,
|
|
4720
|
+
220,
|
|
4721
|
+
142,
|
|
4722
|
+
112,
|
|
4723
|
+
253,
|
|
4724
|
+
100,
|
|
4725
|
+
13
|
|
4726
|
+
]),
|
|
4727
|
+
// SHA256("global:curve_swap_exact_in")[0:8]
|
|
4728
|
+
curveSwapExactIn: new Uint8Array([
|
|
4729
|
+
196,
|
|
4730
|
+
247,
|
|
4731
|
+
195,
|
|
4732
|
+
126,
|
|
4733
|
+
227,
|
|
4734
|
+
27,
|
|
4735
|
+
166,
|
|
4736
|
+
93
|
|
4737
|
+
]),
|
|
4738
|
+
// SHA256("global:migrate_launch")[0:8]
|
|
4739
|
+
migrateLaunch: new Uint8Array([
|
|
4740
|
+
19,
|
|
4741
|
+
199,
|
|
4742
|
+
119,
|
|
4743
|
+
103,
|
|
4744
|
+
13,
|
|
4745
|
+
30,
|
|
4746
|
+
12,
|
|
4747
|
+
205
|
|
4748
|
+
]),
|
|
4749
|
+
// SHA256("global:preview_swap_exact_in")[0:8]
|
|
4750
|
+
previewSwapExactIn: new Uint8Array([
|
|
4751
|
+
50,
|
|
4752
|
+
130,
|
|
4753
|
+
31,
|
|
4754
|
+
69,
|
|
4755
|
+
147,
|
|
4756
|
+
58,
|
|
4757
|
+
222,
|
|
4758
|
+
178
|
|
4759
|
+
]),
|
|
4760
|
+
// SHA256("global:preview_migration")[0:8]
|
|
4761
|
+
previewMigration: new Uint8Array([
|
|
4762
|
+
216,
|
|
4763
|
+
180,
|
|
4764
|
+
209,
|
|
4765
|
+
112,
|
|
4766
|
+
62,
|
|
4767
|
+
16,
|
|
4768
|
+
15,
|
|
4769
|
+
63
|
|
4770
|
+
])
|
|
4771
|
+
};
|
|
4772
|
+
var INITIALIZER_ACCOUNT_DISCRIMINATORS = {
|
|
4773
|
+
// SHA256("account:InitConfig")[0:8]
|
|
4774
|
+
InitConfig: new Uint8Array([97, 166, 35, 7, 20, 2, 164, 126]),
|
|
4775
|
+
// SHA256("account:Launch")[0:8]
|
|
4776
|
+
Launch: new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38]),
|
|
4777
|
+
// SHA256("account:LaunchFeeState")[0:8]
|
|
4778
|
+
LaunchFeeState: new Uint8Array([
|
|
4779
|
+
1,
|
|
4780
|
+
106,
|
|
4781
|
+
55,
|
|
4782
|
+
241,
|
|
4783
|
+
179,
|
|
4784
|
+
18,
|
|
4785
|
+
230,
|
|
4786
|
+
232
|
|
4787
|
+
])
|
|
4788
|
+
};
|
|
4789
|
+
var INIT_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
4790
|
+
97,
|
|
4791
|
+
166,
|
|
4792
|
+
35,
|
|
4793
|
+
7,
|
|
4794
|
+
20,
|
|
4795
|
+
2,
|
|
4796
|
+
164,
|
|
4797
|
+
126
|
|
4798
|
+
]);
|
|
4799
|
+
function getInitConfigEncoder() {
|
|
4800
|
+
return kit.transformEncoder(
|
|
4801
|
+
kit.getStructEncoder([
|
|
4802
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
4803
|
+
["admin", kit.getAddressEncoder()],
|
|
4804
|
+
["migratorAllowlistLen", kit.getU8Encoder()],
|
|
4805
|
+
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
4806
|
+
["hookAllowlistLen", kit.getU8Encoder()],
|
|
4807
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
4808
|
+
["bump", kit.getU8Encoder()],
|
|
4809
|
+
["version", kit.getU8Encoder()],
|
|
4810
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
4811
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
4812
|
+
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
4813
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 24)]
|
|
4814
|
+
]),
|
|
4815
|
+
(value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR })
|
|
4816
|
+
);
|
|
4817
|
+
}
|
|
4818
|
+
function getInitConfigDecoder() {
|
|
4819
|
+
return kit.getStructDecoder([
|
|
4820
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
4821
|
+
["admin", kit.getAddressDecoder()],
|
|
4822
|
+
["migratorAllowlistLen", kit.getU8Decoder()],
|
|
4823
|
+
["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
3870
4824
|
["hookAllowlistLen", kit.getU8Decoder()],
|
|
3871
4825
|
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
3872
4826
|
["bump", kit.getU8Decoder()],
|
|
3873
4827
|
["version", kit.getU8Decoder()],
|
|
3874
|
-
["
|
|
4828
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
4829
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
4830
|
+
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
4831
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 24)]
|
|
3875
4832
|
]);
|
|
3876
4833
|
}
|
|
3877
4834
|
function getInitConfigCodec() {
|
|
3878
4835
|
return kit.combineCodec(getInitConfigEncoder(), getInitConfigDecoder());
|
|
3879
4836
|
}
|
|
3880
|
-
function
|
|
4837
|
+
function getFeeBeneficiaryEncoder() {
|
|
4838
|
+
return kit.getStructEncoder([
|
|
4839
|
+
["wallet", kit.getAddressEncoder()],
|
|
4840
|
+
["shareBps", kit.getU16Encoder()],
|
|
4841
|
+
["pad", kit.fixEncoderSize(kit.getBytesEncoder(), 6)]
|
|
4842
|
+
]);
|
|
4843
|
+
}
|
|
4844
|
+
function getFeeBeneficiaryDecoder() {
|
|
4845
|
+
return kit.getStructDecoder([
|
|
4846
|
+
["wallet", kit.getAddressDecoder()],
|
|
4847
|
+
["shareBps", kit.getU16Decoder()],
|
|
4848
|
+
["pad", kit.fixDecoderSize(kit.getBytesDecoder(), 6)]
|
|
4849
|
+
]);
|
|
4850
|
+
}
|
|
4851
|
+
function getFeeBeneficiaryInputEncoder() {
|
|
4852
|
+
return kit.getStructEncoder([
|
|
4853
|
+
["wallet", kit.getAddressEncoder()],
|
|
4854
|
+
["shareBps", kit.getU16Encoder()]
|
|
4855
|
+
]);
|
|
4856
|
+
}
|
|
4857
|
+
function getFeeBeneficiaryInputDecoder() {
|
|
4858
|
+
return kit.getStructDecoder([
|
|
4859
|
+
["wallet", kit.getAddressDecoder()],
|
|
4860
|
+
["shareBps", kit.getU16Decoder()]
|
|
4861
|
+
]);
|
|
4862
|
+
}
|
|
4863
|
+
function getInitializeConfigArgsEncoder2() {
|
|
3881
4864
|
return kit.getStructEncoder([
|
|
3882
4865
|
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
3883
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
4866
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
4867
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
4868
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
4869
|
+
["maxSwapFeeBps", kit.getU16Encoder()]
|
|
3884
4870
|
]);
|
|
3885
4871
|
}
|
|
3886
|
-
function
|
|
4872
|
+
function getInitializeConfigArgsDecoder2() {
|
|
3887
4873
|
return kit.getStructDecoder([
|
|
3888
4874
|
["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
3889
|
-
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
4875
|
+
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
4876
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
4877
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
4878
|
+
["maxSwapFeeBps", kit.getU16Decoder()]
|
|
3890
4879
|
]);
|
|
3891
4880
|
}
|
|
3892
|
-
function
|
|
4881
|
+
function getInitializeConfigArgsCodec2() {
|
|
3893
4882
|
return kit.combineCodec(
|
|
3894
|
-
|
|
3895
|
-
|
|
4883
|
+
getInitializeConfigArgsEncoder2(),
|
|
4884
|
+
getInitializeConfigArgsDecoder2()
|
|
3896
4885
|
);
|
|
3897
4886
|
}
|
|
3898
4887
|
function getInitializeLaunchArgsEncoder() {
|
|
@@ -3905,7 +4894,7 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
3905
4894
|
["baseForLiquidity", kit.getU64Encoder()],
|
|
3906
4895
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
3907
4896
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
3908
|
-
["
|
|
4897
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
3909
4898
|
["curveKind", kit.getU8Encoder()],
|
|
3910
4899
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
3911
4900
|
["allowBuy", kit.getU8Encoder()],
|
|
@@ -3932,7 +4921,8 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
3932
4921
|
["migratorRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
3933
4922
|
["metadataName", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
3934
4923
|
["metadataSymbol", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
3935
|
-
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
4924
|
+
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
4925
|
+
["feeBeneficiaries", kit.getArrayEncoder(getFeeBeneficiaryInputEncoder())]
|
|
3936
4926
|
]);
|
|
3937
4927
|
}
|
|
3938
4928
|
function getInitializeLaunchArgsDecoder() {
|
|
@@ -3945,7 +4935,7 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
3945
4935
|
["baseForLiquidity", kit.getU64Decoder()],
|
|
3946
4936
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
3947
4937
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
3948
|
-
["
|
|
4938
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
3949
4939
|
["curveKind", kit.getU8Decoder()],
|
|
3950
4940
|
["curveParams", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
3951
4941
|
["allowBuy", kit.getU8Decoder()],
|
|
@@ -3972,7 +4962,8 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
3972
4962
|
["migratorRemainingAccountsHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
3973
4963
|
["metadataName", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
3974
4964
|
["metadataSymbol", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
3975
|
-
["metadataUri", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())]
|
|
4965
|
+
["metadataUri", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
4966
|
+
["feeBeneficiaries", kit.getArrayDecoder(getFeeBeneficiaryInputDecoder())]
|
|
3976
4967
|
]);
|
|
3977
4968
|
}
|
|
3978
4969
|
function getInitializeLaunchArgsCodec() {
|
|
@@ -4026,7 +5017,7 @@ function getLaunchEncoder() {
|
|
|
4026
5017
|
["baseForCurve", kit.getU64Encoder()],
|
|
4027
5018
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
4028
5019
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
4029
|
-
["
|
|
5020
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
4030
5021
|
["pad1", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
|
|
4031
5022
|
["allowBuy", kit.getU8Encoder()],
|
|
4032
5023
|
["allowSell", kit.getU8Encoder()],
|
|
@@ -4068,7 +5059,7 @@ function getLaunchDecoder() {
|
|
|
4068
5059
|
["baseForCurve", kit.getU64Decoder()],
|
|
4069
5060
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
4070
5061
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
4071
|
-
["
|
|
5062
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
4072
5063
|
["pad1", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
|
|
4073
5064
|
["allowBuy", kit.getU8Decoder()],
|
|
4074
5065
|
["allowSell", kit.getU8Decoder()],
|
|
@@ -4091,6 +5082,217 @@ function getLaunchDecoder() {
|
|
|
4091
5082
|
function getLaunchCodec() {
|
|
4092
5083
|
return kit.combineCodec(getLaunchEncoder(), getLaunchDecoder());
|
|
4093
5084
|
}
|
|
5085
|
+
var LAUNCH_FEE_STATE_DISCRIMINATOR = new Uint8Array([
|
|
5086
|
+
1,
|
|
5087
|
+
106,
|
|
5088
|
+
55,
|
|
5089
|
+
241,
|
|
5090
|
+
179,
|
|
5091
|
+
18,
|
|
5092
|
+
230,
|
|
5093
|
+
232
|
|
5094
|
+
]);
|
|
5095
|
+
function getLaunchFeeStateEncoder() {
|
|
5096
|
+
return kit.transformEncoder(
|
|
5097
|
+
kit.getStructEncoder([
|
|
5098
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5099
|
+
["launch", kit.getAddressEncoder()],
|
|
5100
|
+
["protocolBeneficiary", kit.getAddressEncoder()],
|
|
5101
|
+
["beneficiaryLen", kit.getU8Encoder()],
|
|
5102
|
+
["bump", kit.getU8Encoder()],
|
|
5103
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
5104
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
5105
|
+
["version", kit.getU8Encoder()],
|
|
5106
|
+
["pad0", kit.fixEncoderSize(kit.getBytesEncoder(), 1)],
|
|
5107
|
+
[
|
|
5108
|
+
"beneficiaries",
|
|
5109
|
+
kit.getArrayEncoder(getFeeBeneficiaryEncoder(), { size: 8 })
|
|
5110
|
+
],
|
|
5111
|
+
["cumulatedBaseFees", kit.getU64Encoder()],
|
|
5112
|
+
["cumulatedQuoteFees", kit.getU64Encoder()],
|
|
5113
|
+
["distributedProtocolBaseFees", kit.getU64Encoder()],
|
|
5114
|
+
["distributedProtocolQuoteFees", kit.getU64Encoder()],
|
|
5115
|
+
[
|
|
5116
|
+
"distributedBaseByBeneficiary",
|
|
5117
|
+
kit.getArrayEncoder(kit.getU64Encoder(), { size: 8 })
|
|
5118
|
+
],
|
|
5119
|
+
[
|
|
5120
|
+
"distributedQuoteByBeneficiary",
|
|
5121
|
+
kit.getArrayEncoder(kit.getU64Encoder(), { size: 8 })
|
|
5122
|
+
],
|
|
5123
|
+
["migratedPool", kit.getAddressEncoder()],
|
|
5124
|
+
["migratedPosition", kit.getAddressEncoder()],
|
|
5125
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 64)]
|
|
5126
|
+
]),
|
|
5127
|
+
(value) => ({ ...value, discriminator: LAUNCH_FEE_STATE_DISCRIMINATOR })
|
|
5128
|
+
);
|
|
5129
|
+
}
|
|
5130
|
+
function getLaunchFeeStateDecoder() {
|
|
5131
|
+
return kit.getStructDecoder([
|
|
5132
|
+
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
5133
|
+
["launch", kit.getAddressDecoder()],
|
|
5134
|
+
["protocolBeneficiary", kit.getAddressDecoder()],
|
|
5135
|
+
["beneficiaryLen", kit.getU8Decoder()],
|
|
5136
|
+
["bump", kit.getU8Decoder()],
|
|
5137
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
5138
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
5139
|
+
["version", kit.getU8Decoder()],
|
|
5140
|
+
["pad0", kit.fixDecoderSize(kit.getBytesDecoder(), 1)],
|
|
5141
|
+
["beneficiaries", kit.getArrayDecoder(getFeeBeneficiaryDecoder(), { size: 8 })],
|
|
5142
|
+
["cumulatedBaseFees", kit.getU64Decoder()],
|
|
5143
|
+
["cumulatedQuoteFees", kit.getU64Decoder()],
|
|
5144
|
+
["distributedProtocolBaseFees", kit.getU64Decoder()],
|
|
5145
|
+
["distributedProtocolQuoteFees", kit.getU64Decoder()],
|
|
5146
|
+
[
|
|
5147
|
+
"distributedBaseByBeneficiary",
|
|
5148
|
+
kit.getArrayDecoder(kit.getU64Decoder(), { size: 8 })
|
|
5149
|
+
],
|
|
5150
|
+
[
|
|
5151
|
+
"distributedQuoteByBeneficiary",
|
|
5152
|
+
kit.getArrayDecoder(kit.getU64Decoder(), { size: 8 })
|
|
5153
|
+
],
|
|
5154
|
+
["migratedPool", kit.getAddressDecoder()],
|
|
5155
|
+
["migratedPosition", kit.getAddressDecoder()],
|
|
5156
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 64)]
|
|
5157
|
+
]);
|
|
5158
|
+
}
|
|
5159
|
+
function getLaunchFeeStateCodec() {
|
|
5160
|
+
return kit.combineCodec(getLaunchFeeStateEncoder(), getLaunchFeeStateDecoder());
|
|
5161
|
+
}
|
|
5162
|
+
var CLAIM_FEES_DISCRIMINATOR = new Uint8Array([
|
|
5163
|
+
82,
|
|
5164
|
+
251,
|
|
5165
|
+
233,
|
|
5166
|
+
156,
|
|
5167
|
+
12,
|
|
5168
|
+
52,
|
|
5169
|
+
184,
|
|
5170
|
+
202
|
|
5171
|
+
]);
|
|
5172
|
+
function getClaimFeesInstructionDataEncoder() {
|
|
5173
|
+
return kit.transformEncoder(
|
|
5174
|
+
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
5175
|
+
(value) => ({ ...value, discriminator: CLAIM_FEES_DISCRIMINATOR })
|
|
5176
|
+
);
|
|
5177
|
+
}
|
|
5178
|
+
async function getClaimFeesInstructionAsync(input, config) {
|
|
5179
|
+
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5180
|
+
const originalAccounts = {
|
|
5181
|
+
launch: { value: input.launch ?? null, isWritable: false },
|
|
5182
|
+
launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
|
|
5183
|
+
launchAuthority: {
|
|
5184
|
+
value: input.launchAuthority ?? null,
|
|
5185
|
+
isWritable: false
|
|
5186
|
+
},
|
|
5187
|
+
recipient: { value: input.recipient ?? null, isWritable: false },
|
|
5188
|
+
baseMint: { value: input.baseMint ?? null, isWritable: false },
|
|
5189
|
+
quoteMint: { value: input.quoteMint ?? null, isWritable: false },
|
|
5190
|
+
baseVault: { value: input.baseVault ?? null, isWritable: true },
|
|
5191
|
+
quoteVault: { value: input.quoteVault ?? null, isWritable: true },
|
|
5192
|
+
recipientBaseAta: {
|
|
5193
|
+
value: input.recipientBaseAta ?? null,
|
|
5194
|
+
isWritable: true
|
|
5195
|
+
},
|
|
5196
|
+
recipientQuoteAta: {
|
|
5197
|
+
value: input.recipientQuoteAta ?? null,
|
|
5198
|
+
isWritable: true
|
|
5199
|
+
},
|
|
5200
|
+
baseTokenProgram: {
|
|
5201
|
+
value: input.baseTokenProgram ?? null,
|
|
5202
|
+
isWritable: false
|
|
5203
|
+
},
|
|
5204
|
+
quoteTokenProgram: {
|
|
5205
|
+
value: input.quoteTokenProgram ?? null,
|
|
5206
|
+
isWritable: false
|
|
5207
|
+
}
|
|
5208
|
+
};
|
|
5209
|
+
const accounts = originalAccounts;
|
|
5210
|
+
if (!accounts.launchFeeState.value) {
|
|
5211
|
+
accounts.launchFeeState.value = await kit.getProgramDerivedAddress({
|
|
5212
|
+
programAddress,
|
|
5213
|
+
seeds: [
|
|
5214
|
+
kit.getBytesEncoder().encode(
|
|
5215
|
+
new Uint8Array([
|
|
5216
|
+
108,
|
|
5217
|
+
97,
|
|
5218
|
+
117,
|
|
5219
|
+
110,
|
|
5220
|
+
99,
|
|
5221
|
+
104,
|
|
5222
|
+
95,
|
|
5223
|
+
102,
|
|
5224
|
+
101,
|
|
5225
|
+
101,
|
|
5226
|
+
95,
|
|
5227
|
+
115,
|
|
5228
|
+
116,
|
|
5229
|
+
97,
|
|
5230
|
+
116,
|
|
5231
|
+
101
|
|
5232
|
+
])
|
|
5233
|
+
),
|
|
5234
|
+
kit.getAddressEncoder().encode(
|
|
5235
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
5236
|
+
"launch",
|
|
5237
|
+
accounts.launch.value
|
|
5238
|
+
)
|
|
5239
|
+
)
|
|
5240
|
+
]
|
|
5241
|
+
});
|
|
5242
|
+
}
|
|
5243
|
+
if (!accounts.launchAuthority.value) {
|
|
5244
|
+
accounts.launchAuthority.value = await kit.getProgramDerivedAddress({
|
|
5245
|
+
programAddress,
|
|
5246
|
+
seeds: [
|
|
5247
|
+
kit.getBytesEncoder().encode(
|
|
5248
|
+
new Uint8Array([
|
|
5249
|
+
108,
|
|
5250
|
+
97,
|
|
5251
|
+
117,
|
|
5252
|
+
110,
|
|
5253
|
+
99,
|
|
5254
|
+
104,
|
|
5255
|
+
95,
|
|
5256
|
+
97,
|
|
5257
|
+
117,
|
|
5258
|
+
116,
|
|
5259
|
+
104,
|
|
5260
|
+
111,
|
|
5261
|
+
114,
|
|
5262
|
+
105,
|
|
5263
|
+
116,
|
|
5264
|
+
121
|
|
5265
|
+
])
|
|
5266
|
+
),
|
|
5267
|
+
kit.getAddressEncoder().encode(
|
|
5268
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
5269
|
+
"launch",
|
|
5270
|
+
accounts.launch.value
|
|
5271
|
+
)
|
|
5272
|
+
)
|
|
5273
|
+
]
|
|
5274
|
+
});
|
|
5275
|
+
}
|
|
5276
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5277
|
+
return Object.freeze({
|
|
5278
|
+
accounts: [
|
|
5279
|
+
getAccountMeta("launch", accounts.launch),
|
|
5280
|
+
getAccountMeta("launchFeeState", accounts.launchFeeState),
|
|
5281
|
+
getAccountMeta("launchAuthority", accounts.launchAuthority),
|
|
5282
|
+
getAccountMeta("recipient", accounts.recipient),
|
|
5283
|
+
getAccountMeta("baseMint", accounts.baseMint),
|
|
5284
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
5285
|
+
getAccountMeta("baseVault", accounts.baseVault),
|
|
5286
|
+
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
5287
|
+
getAccountMeta("recipientBaseAta", accounts.recipientBaseAta),
|
|
5288
|
+
getAccountMeta("recipientQuoteAta", accounts.recipientQuoteAta),
|
|
5289
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
5290
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
5291
|
+
],
|
|
5292
|
+
data: getClaimFeesInstructionDataEncoder().encode({}),
|
|
5293
|
+
programAddress
|
|
5294
|
+
});
|
|
5295
|
+
}
|
|
4094
5296
|
var CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
|
|
4095
5297
|
196,
|
|
4096
5298
|
247,
|
|
@@ -4112,7 +5314,154 @@ function getCurveSwapExactInInstructionDataEncoder() {
|
|
|
4112
5314
|
(value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR })
|
|
4113
5315
|
);
|
|
4114
5316
|
}
|
|
4115
|
-
var
|
|
5317
|
+
var HARVEST_MIGRATED_FEES_DISCRIMINATOR = new Uint8Array([
|
|
5318
|
+
63,
|
|
5319
|
+
77,
|
|
5320
|
+
73,
|
|
5321
|
+
117,
|
|
5322
|
+
2,
|
|
5323
|
+
43,
|
|
5324
|
+
255,
|
|
5325
|
+
176
|
|
5326
|
+
]);
|
|
5327
|
+
function getHarvestMigratedFeesInstructionDataEncoder() {
|
|
5328
|
+
return kit.transformEncoder(
|
|
5329
|
+
kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
|
|
5330
|
+
(value) => ({
|
|
5331
|
+
...value,
|
|
5332
|
+
discriminator: HARVEST_MIGRATED_FEES_DISCRIMINATOR
|
|
5333
|
+
})
|
|
5334
|
+
);
|
|
5335
|
+
}
|
|
5336
|
+
async function getHarvestMigratedFeesInstructionAsync(input, config) {
|
|
5337
|
+
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5338
|
+
const originalAccounts = {
|
|
5339
|
+
launch: { value: input.launch ?? null, isWritable: false },
|
|
5340
|
+
launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
|
|
5341
|
+
launchAuthority: {
|
|
5342
|
+
value: input.launchAuthority ?? null,
|
|
5343
|
+
isWritable: false
|
|
5344
|
+
},
|
|
5345
|
+
baseMint: { value: input.baseMint ?? null, isWritable: false },
|
|
5346
|
+
quoteMint: { value: input.quoteMint ?? null, isWritable: false },
|
|
5347
|
+
baseVault: { value: input.baseVault ?? null, isWritable: true },
|
|
5348
|
+
quoteVault: { value: input.quoteVault ?? null, isWritable: true },
|
|
5349
|
+
pool: { value: input.pool ?? null, isWritable: true },
|
|
5350
|
+
launchLpPosition: {
|
|
5351
|
+
value: input.launchLpPosition ?? null,
|
|
5352
|
+
isWritable: true
|
|
5353
|
+
},
|
|
5354
|
+
poolAuthority: { value: input.poolAuthority ?? null, isWritable: false },
|
|
5355
|
+
poolVault0: { value: input.poolVault0 ?? null, isWritable: true },
|
|
5356
|
+
poolVault1: { value: input.poolVault1 ?? null, isWritable: true },
|
|
5357
|
+
token0Mint: { value: input.token0Mint ?? null, isWritable: false },
|
|
5358
|
+
token1Mint: { value: input.token1Mint ?? null, isWritable: false },
|
|
5359
|
+
cpmmProgram: { value: input.cpmmProgram ?? null, isWritable: false },
|
|
5360
|
+
baseTokenProgram: {
|
|
5361
|
+
value: input.baseTokenProgram ?? null,
|
|
5362
|
+
isWritable: false
|
|
5363
|
+
},
|
|
5364
|
+
quoteTokenProgram: {
|
|
5365
|
+
value: input.quoteTokenProgram ?? null,
|
|
5366
|
+
isWritable: false
|
|
5367
|
+
}
|
|
5368
|
+
};
|
|
5369
|
+
const accounts = originalAccounts;
|
|
5370
|
+
if (!accounts.launchFeeState.value) {
|
|
5371
|
+
accounts.launchFeeState.value = await kit.getProgramDerivedAddress({
|
|
5372
|
+
programAddress,
|
|
5373
|
+
seeds: [
|
|
5374
|
+
kit.getBytesEncoder().encode(
|
|
5375
|
+
new Uint8Array([
|
|
5376
|
+
108,
|
|
5377
|
+
97,
|
|
5378
|
+
117,
|
|
5379
|
+
110,
|
|
5380
|
+
99,
|
|
5381
|
+
104,
|
|
5382
|
+
95,
|
|
5383
|
+
102,
|
|
5384
|
+
101,
|
|
5385
|
+
101,
|
|
5386
|
+
95,
|
|
5387
|
+
115,
|
|
5388
|
+
116,
|
|
5389
|
+
97,
|
|
5390
|
+
116,
|
|
5391
|
+
101
|
|
5392
|
+
])
|
|
5393
|
+
),
|
|
5394
|
+
kit.getAddressEncoder().encode(
|
|
5395
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
5396
|
+
"launch",
|
|
5397
|
+
accounts.launch.value
|
|
5398
|
+
)
|
|
5399
|
+
)
|
|
5400
|
+
]
|
|
5401
|
+
});
|
|
5402
|
+
}
|
|
5403
|
+
if (!accounts.launchAuthority.value) {
|
|
5404
|
+
accounts.launchAuthority.value = await kit.getProgramDerivedAddress({
|
|
5405
|
+
programAddress,
|
|
5406
|
+
seeds: [
|
|
5407
|
+
kit.getBytesEncoder().encode(
|
|
5408
|
+
new Uint8Array([
|
|
5409
|
+
108,
|
|
5410
|
+
97,
|
|
5411
|
+
117,
|
|
5412
|
+
110,
|
|
5413
|
+
99,
|
|
5414
|
+
104,
|
|
5415
|
+
95,
|
|
5416
|
+
97,
|
|
5417
|
+
117,
|
|
5418
|
+
116,
|
|
5419
|
+
104,
|
|
5420
|
+
111,
|
|
5421
|
+
114,
|
|
5422
|
+
105,
|
|
5423
|
+
116,
|
|
5424
|
+
121
|
|
5425
|
+
])
|
|
5426
|
+
),
|
|
5427
|
+
kit.getAddressEncoder().encode(
|
|
5428
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
5429
|
+
"launch",
|
|
5430
|
+
accounts.launch.value
|
|
5431
|
+
)
|
|
5432
|
+
)
|
|
5433
|
+
]
|
|
5434
|
+
});
|
|
5435
|
+
}
|
|
5436
|
+
if (!accounts.cpmmProgram.value) {
|
|
5437
|
+
accounts.cpmmProgram.value = "9PSxVPoPfnbZ8Q1uQhgS6ZxvBjFboZtebNsu34umxkgQ";
|
|
5438
|
+
}
|
|
5439
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5440
|
+
return Object.freeze({
|
|
5441
|
+
accounts: [
|
|
5442
|
+
getAccountMeta("launch", accounts.launch),
|
|
5443
|
+
getAccountMeta("launchFeeState", accounts.launchFeeState),
|
|
5444
|
+
getAccountMeta("launchAuthority", accounts.launchAuthority),
|
|
5445
|
+
getAccountMeta("baseMint", accounts.baseMint),
|
|
5446
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
5447
|
+
getAccountMeta("baseVault", accounts.baseVault),
|
|
5448
|
+
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
5449
|
+
getAccountMeta("pool", accounts.pool),
|
|
5450
|
+
getAccountMeta("launchLpPosition", accounts.launchLpPosition),
|
|
5451
|
+
getAccountMeta("poolAuthority", accounts.poolAuthority),
|
|
5452
|
+
getAccountMeta("poolVault0", accounts.poolVault0),
|
|
5453
|
+
getAccountMeta("poolVault1", accounts.poolVault1),
|
|
5454
|
+
getAccountMeta("token0Mint", accounts.token0Mint),
|
|
5455
|
+
getAccountMeta("token1Mint", accounts.token1Mint),
|
|
5456
|
+
getAccountMeta("cpmmProgram", accounts.cpmmProgram),
|
|
5457
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
5458
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
5459
|
+
],
|
|
5460
|
+
data: getHarvestMigratedFeesInstructionDataEncoder().encode({}),
|
|
5461
|
+
programAddress
|
|
5462
|
+
});
|
|
5463
|
+
}
|
|
5464
|
+
var INITIALIZE_CONFIG_DISCRIMINATOR3 = new Uint8Array([
|
|
4116
5465
|
208,
|
|
4117
5466
|
127,
|
|
4118
5467
|
21,
|
|
@@ -4122,14 +5471,17 @@ var INITIALIZE_CONFIG_DISCRIMINATOR2 = new Uint8Array([
|
|
|
4122
5471
|
196,
|
|
4123
5472
|
70
|
|
4124
5473
|
]);
|
|
4125
|
-
function
|
|
5474
|
+
function getInitializeConfigInstructionDataEncoder3() {
|
|
4126
5475
|
return kit.transformEncoder(
|
|
4127
5476
|
kit.getStructEncoder([
|
|
4128
5477
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
4129
5478
|
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
4130
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
5479
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
5480
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
5481
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
5482
|
+
["maxSwapFeeBps", kit.getU16Encoder()]
|
|
4131
5483
|
]),
|
|
4132
|
-
(value) => ({ ...value, discriminator:
|
|
5484
|
+
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR3 })
|
|
4133
5485
|
);
|
|
4134
5486
|
}
|
|
4135
5487
|
var INITIALIZE_LAUNCH_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4154,7 +5506,7 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
4154
5506
|
["baseForLiquidity", kit.getU64Encoder()],
|
|
4155
5507
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
4156
5508
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
4157
|
-
["
|
|
5509
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
4158
5510
|
["curveKind", kit.getU8Encoder()],
|
|
4159
5511
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
4160
5512
|
["allowBuy", kit.getU8Encoder()],
|
|
@@ -4187,7 +5539,8 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
4187
5539
|
"metadataSymbol",
|
|
4188
5540
|
kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())
|
|
4189
5541
|
],
|
|
4190
|
-
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
5542
|
+
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
5543
|
+
["feeBeneficiaries", kit.getArrayEncoder(getFeeBeneficiaryInputEncoder())]
|
|
4191
5544
|
]),
|
|
4192
5545
|
(value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR })
|
|
4193
5546
|
);
|
|
@@ -4215,6 +5568,135 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
|
|
|
4215
5568
|
})
|
|
4216
5569
|
);
|
|
4217
5570
|
}
|
|
5571
|
+
var REPLACE_FEE_BENEFICIARY_DISCRIMINATOR = new Uint8Array([
|
|
5572
|
+
125,
|
|
5573
|
+
194,
|
|
5574
|
+
227,
|
|
5575
|
+
81,
|
|
5576
|
+
175,
|
|
5577
|
+
100,
|
|
5578
|
+
78,
|
|
5579
|
+
200
|
|
5580
|
+
]);
|
|
5581
|
+
function getReplaceFeeBeneficiaryInstructionDataEncoder() {
|
|
5582
|
+
return kit.transformEncoder(
|
|
5583
|
+
kit.getStructEncoder([
|
|
5584
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5585
|
+
["newBeneficiary", kit.getAddressEncoder()]
|
|
5586
|
+
]),
|
|
5587
|
+
(value) => ({
|
|
5588
|
+
...value,
|
|
5589
|
+
discriminator: REPLACE_FEE_BENEFICIARY_DISCRIMINATOR
|
|
5590
|
+
})
|
|
5591
|
+
);
|
|
5592
|
+
}
|
|
5593
|
+
async function getReplaceFeeBeneficiaryInstructionAsync(input, config) {
|
|
5594
|
+
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5595
|
+
const originalAccounts = {
|
|
5596
|
+
launch: { value: input.launch ?? null, isWritable: false },
|
|
5597
|
+
launchFeeState: { value: input.launchFeeState ?? null, isWritable: true },
|
|
5598
|
+
currentBeneficiary: {
|
|
5599
|
+
value: input.currentBeneficiary ?? null,
|
|
5600
|
+
isWritable: false
|
|
5601
|
+
}
|
|
5602
|
+
};
|
|
5603
|
+
const accounts = originalAccounts;
|
|
5604
|
+
const args = { ...input };
|
|
5605
|
+
if (!accounts.launchFeeState.value) {
|
|
5606
|
+
accounts.launchFeeState.value = await kit.getProgramDerivedAddress({
|
|
5607
|
+
programAddress,
|
|
5608
|
+
seeds: [
|
|
5609
|
+
kit.getBytesEncoder().encode(
|
|
5610
|
+
new Uint8Array([
|
|
5611
|
+
108,
|
|
5612
|
+
97,
|
|
5613
|
+
117,
|
|
5614
|
+
110,
|
|
5615
|
+
99,
|
|
5616
|
+
104,
|
|
5617
|
+
95,
|
|
5618
|
+
102,
|
|
5619
|
+
101,
|
|
5620
|
+
101,
|
|
5621
|
+
95,
|
|
5622
|
+
115,
|
|
5623
|
+
116,
|
|
5624
|
+
97,
|
|
5625
|
+
116,
|
|
5626
|
+
101
|
|
5627
|
+
])
|
|
5628
|
+
),
|
|
5629
|
+
kit.getAddressEncoder().encode(
|
|
5630
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
5631
|
+
"launch",
|
|
5632
|
+
accounts.launch.value
|
|
5633
|
+
)
|
|
5634
|
+
)
|
|
5635
|
+
]
|
|
5636
|
+
});
|
|
5637
|
+
}
|
|
5638
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5639
|
+
return Object.freeze({
|
|
5640
|
+
accounts: [
|
|
5641
|
+
getAccountMeta("launch", accounts.launch),
|
|
5642
|
+
getAccountMeta("launchFeeState", accounts.launchFeeState),
|
|
5643
|
+
getAccountMeta("currentBeneficiary", accounts.currentBeneficiary)
|
|
5644
|
+
],
|
|
5645
|
+
data: getReplaceFeeBeneficiaryInstructionDataEncoder().encode(
|
|
5646
|
+
args
|
|
5647
|
+
),
|
|
5648
|
+
programAddress
|
|
5649
|
+
});
|
|
5650
|
+
}
|
|
5651
|
+
var SET_FEE_POLICY_DISCRIMINATOR = new Uint8Array([
|
|
5652
|
+
91,
|
|
5653
|
+
32,
|
|
5654
|
+
224,
|
|
5655
|
+
109,
|
|
5656
|
+
147,
|
|
5657
|
+
98,
|
|
5658
|
+
71,
|
|
5659
|
+
132
|
|
5660
|
+
]);
|
|
5661
|
+
function getSetFeePolicyInstructionDataEncoder() {
|
|
5662
|
+
return kit.transformEncoder(
|
|
5663
|
+
kit.getStructEncoder([
|
|
5664
|
+
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5665
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
5666
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
5667
|
+
["maxSwapFeeBps", kit.getU16Encoder()]
|
|
5668
|
+
]),
|
|
5669
|
+
(value) => ({ ...value, discriminator: SET_FEE_POLICY_DISCRIMINATOR })
|
|
5670
|
+
);
|
|
5671
|
+
}
|
|
5672
|
+
async function getSetFeePolicyInstructionAsync(input, config) {
|
|
5673
|
+
const programAddress = config?.programAddress ?? INITIALIZER_PROGRAM_ADDRESS;
|
|
5674
|
+
const originalAccounts = {
|
|
5675
|
+
config: { value: input.config ?? null, isWritable: true },
|
|
5676
|
+
admin: { value: input.admin ?? null, isWritable: false }
|
|
5677
|
+
};
|
|
5678
|
+
const accounts = originalAccounts;
|
|
5679
|
+
const args = { ...input };
|
|
5680
|
+
if (!accounts.config.value) {
|
|
5681
|
+
accounts.config.value = await kit.getProgramDerivedAddress({
|
|
5682
|
+
programAddress,
|
|
5683
|
+
seeds: [
|
|
5684
|
+
kit.getBytesEncoder().encode(new Uint8Array([99, 111, 110, 102, 105, 103]))
|
|
5685
|
+
]
|
|
5686
|
+
});
|
|
5687
|
+
}
|
|
5688
|
+
const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
|
|
5689
|
+
return Object.freeze({
|
|
5690
|
+
accounts: [
|
|
5691
|
+
getAccountMeta("config", accounts.config),
|
|
5692
|
+
getAccountMeta("admin", accounts.admin)
|
|
5693
|
+
],
|
|
5694
|
+
data: getSetFeePolicyInstructionDataEncoder().encode(
|
|
5695
|
+
args
|
|
5696
|
+
),
|
|
5697
|
+
programAddress
|
|
5698
|
+
});
|
|
5699
|
+
}
|
|
4218
5700
|
var SET_HOOK_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
|
|
4219
5701
|
232,
|
|
4220
5702
|
28,
|
|
@@ -4256,9 +5738,12 @@ function getSetMigratorAllowlistInstructionDataEncoder() {
|
|
|
4256
5738
|
})
|
|
4257
5739
|
);
|
|
4258
5740
|
}
|
|
5741
|
+
|
|
5742
|
+
// src/solana/generated/initializer/programs/initializer.ts
|
|
5743
|
+
var INITIALIZER_PROGRAM_ADDRESS = "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1";
|
|
4259
5744
|
if (process.env.NODE_ENV !== "production") ;
|
|
4260
5745
|
var addressCodec2 = kit.getAddressCodec();
|
|
4261
|
-
var
|
|
5746
|
+
var textEncoder3 = new TextEncoder();
|
|
4262
5747
|
function encodeU64LE(value) {
|
|
4263
5748
|
const bytes = new Uint8Array(8);
|
|
4264
5749
|
const view = new DataView(bytes.buffer);
|
|
@@ -4268,7 +5753,7 @@ function encodeU64LE(value) {
|
|
|
4268
5753
|
async function getConfigAddress2(programId = INITIALIZER_PROGRAM_ID) {
|
|
4269
5754
|
return kit.getProgramDerivedAddress({
|
|
4270
5755
|
programAddress: programId,
|
|
4271
|
-
seeds: [
|
|
5756
|
+
seeds: [textEncoder3.encode(SEED_CONFIG2)]
|
|
4272
5757
|
});
|
|
4273
5758
|
}
|
|
4274
5759
|
async function getProgramDataAddress(programId = INITIALIZER_PROGRAM_ID) {
|
|
@@ -4284,7 +5769,7 @@ async function getLaunchAddress(namespace, launchId, programId = INITIALIZER_PRO
|
|
|
4284
5769
|
return kit.getProgramDerivedAddress({
|
|
4285
5770
|
programAddress: programId,
|
|
4286
5771
|
seeds: [
|
|
4287
|
-
|
|
5772
|
+
textEncoder3.encode(SEED_LAUNCH),
|
|
4288
5773
|
addressCodec2.encode(namespace),
|
|
4289
5774
|
launchId
|
|
4290
5775
|
]
|
|
@@ -4294,7 +5779,16 @@ async function getLaunchAuthorityAddress(launch, programId = INITIALIZER_PROGRAM
|
|
|
4294
5779
|
return kit.getProgramDerivedAddress({
|
|
4295
5780
|
programAddress: programId,
|
|
4296
5781
|
seeds: [
|
|
4297
|
-
|
|
5782
|
+
textEncoder3.encode(SEED_LAUNCH_AUTHORITY),
|
|
5783
|
+
addressCodec2.encode(launch)
|
|
5784
|
+
]
|
|
5785
|
+
});
|
|
5786
|
+
}
|
|
5787
|
+
async function getLaunchFeeStateAddress(launch, programId = INITIALIZER_PROGRAM_ID) {
|
|
5788
|
+
return kit.getProgramDerivedAddress({
|
|
5789
|
+
programAddress: programId,
|
|
5790
|
+
seeds: [
|
|
5791
|
+
textEncoder3.encode(SEED_LAUNCH_FEE_STATE),
|
|
4298
5792
|
addressCodec2.encode(launch)
|
|
4299
5793
|
]
|
|
4300
5794
|
});
|
|
@@ -4318,7 +5812,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
4318
5812
|
admin,
|
|
4319
5813
|
config,
|
|
4320
5814
|
programData,
|
|
4321
|
-
systemProgram =
|
|
5815
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
4322
5816
|
} = accounts;
|
|
4323
5817
|
const keys = [
|
|
4324
5818
|
createSignerAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
@@ -4327,7 +5821,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
4327
5821
|
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
4328
5822
|
];
|
|
4329
5823
|
const data = new Uint8Array(
|
|
4330
|
-
|
|
5824
|
+
getInitializeConfigInstructionDataEncoder3().encode(args)
|
|
4331
5825
|
);
|
|
4332
5826
|
return { programAddress: programId, accounts: keys, data };
|
|
4333
5827
|
}
|
|
@@ -4427,17 +5921,17 @@ var CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS = {
|
|
|
4427
5921
|
])
|
|
4428
5922
|
};
|
|
4429
5923
|
var addressCodec3 = kit.getAddressCodec();
|
|
4430
|
-
var
|
|
5924
|
+
var textEncoder4 = new TextEncoder();
|
|
4431
5925
|
async function getCpmmMigratorStateAddress(launch, programId = CPMM_MIGRATOR_PROGRAM_ID) {
|
|
4432
5926
|
return kit.getProgramDerivedAddress({
|
|
4433
5927
|
programAddress: programId,
|
|
4434
|
-
seeds: [
|
|
5928
|
+
seeds: [textEncoder4.encode(SEED_STATE), addressCodec3.encode(launch)]
|
|
4435
5929
|
});
|
|
4436
5930
|
}
|
|
4437
5931
|
async function getCpmmMigrationAuthorityAddress(programId = CPMM_MIGRATOR_PROGRAM_ID) {
|
|
4438
5932
|
return kit.getProgramDerivedAddress({
|
|
4439
5933
|
programAddress: programId,
|
|
4440
|
-
seeds: [
|
|
5934
|
+
seeds: [textEncoder4.encode(SEED_MIGRATION_AUTHORITY)]
|
|
4441
5935
|
});
|
|
4442
5936
|
}
|
|
4443
5937
|
var CLAIM_RECEIPT_DISCRIMINATOR = new Uint8Array([
|
|
@@ -4862,7 +6356,7 @@ function getLaunchEncoder2() {
|
|
|
4862
6356
|
["baseForCurve", kit.getU64Encoder()],
|
|
4863
6357
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
4864
6358
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
4865
|
-
["
|
|
6359
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
4866
6360
|
["pad1", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
|
|
4867
6361
|
["allowBuy", kit.getU8Encoder()],
|
|
4868
6362
|
["allowSell", kit.getU8Encoder()],
|
|
@@ -4904,7 +6398,7 @@ function getLaunchDecoder2() {
|
|
|
4904
6398
|
["baseForCurve", kit.getU64Decoder()],
|
|
4905
6399
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
4906
6400
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
4907
|
-
["
|
|
6401
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
4908
6402
|
["pad1", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
|
|
4909
6403
|
["allowBuy", kit.getU8Decoder()],
|
|
4910
6404
|
["allowSell", kit.getU8Decoder()],
|
|
@@ -6320,12 +7814,12 @@ function predictionMigratorProgram() {
|
|
|
6320
7814
|
};
|
|
6321
7815
|
}
|
|
6322
7816
|
var addressCodec4 = kit.getAddressCodec();
|
|
6323
|
-
var
|
|
7817
|
+
var textEncoder5 = new TextEncoder();
|
|
6324
7818
|
async function getPredictionMarketAddress(oracleState, quoteMint, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
6325
7819
|
return kit.getProgramDerivedAddress({
|
|
6326
7820
|
programAddress: programId,
|
|
6327
7821
|
seeds: [
|
|
6328
|
-
|
|
7822
|
+
textEncoder5.encode("market"),
|
|
6329
7823
|
addressCodec4.encode(oracleState),
|
|
6330
7824
|
addressCodec4.encode(quoteMint)
|
|
6331
7825
|
]
|
|
@@ -6335,7 +7829,7 @@ async function getPredictionMarketAuthorityAddress(market, programId = PREDICTIO
|
|
|
6335
7829
|
return kit.getProgramDerivedAddress({
|
|
6336
7830
|
programAddress: programId,
|
|
6337
7831
|
seeds: [
|
|
6338
|
-
|
|
7832
|
+
textEncoder5.encode("market_authority"),
|
|
6339
7833
|
addressCodec4.encode(market)
|
|
6340
7834
|
]
|
|
6341
7835
|
});
|
|
@@ -6343,20 +7837,20 @@ async function getPredictionMarketAuthorityAddress(market, programId = PREDICTIO
|
|
|
6343
7837
|
async function getPredictionPotVaultAddress(market, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
6344
7838
|
return kit.getProgramDerivedAddress({
|
|
6345
7839
|
programAddress: programId,
|
|
6346
|
-
seeds: [
|
|
7840
|
+
seeds: [textEncoder5.encode("pot_vault"), addressCodec4.encode(market)]
|
|
6347
7841
|
});
|
|
6348
7842
|
}
|
|
6349
7843
|
async function getPredictionEntryAddress(market, entryId, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
6350
7844
|
return kit.getProgramDerivedAddress({
|
|
6351
7845
|
programAddress: programId,
|
|
6352
|
-
seeds: [
|
|
7846
|
+
seeds: [textEncoder5.encode("entry"), addressCodec4.encode(market), entryId]
|
|
6353
7847
|
});
|
|
6354
7848
|
}
|
|
6355
7849
|
async function getPredictionEntryByMintAddress(market, mint, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
6356
7850
|
return kit.getProgramDerivedAddress({
|
|
6357
7851
|
programAddress: programId,
|
|
6358
7852
|
seeds: [
|
|
6359
|
-
|
|
7853
|
+
textEncoder5.encode("entry_by_mint"),
|
|
6360
7854
|
addressCodec4.encode(market),
|
|
6361
7855
|
addressCodec4.encode(mint)
|
|
6362
7856
|
]
|
|
@@ -6376,10 +7870,10 @@ function createAccountMeta(value, role) {
|
|
|
6376
7870
|
async function getTokenMetadataAddress(mint) {
|
|
6377
7871
|
const encoder = kit.getAddressEncoder();
|
|
6378
7872
|
const [metadataAddress] = await kit.getProgramDerivedAddress({
|
|
6379
|
-
programAddress:
|
|
7873
|
+
programAddress: chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
6380
7874
|
seeds: [
|
|
6381
7875
|
new TextEncoder().encode("metadata"),
|
|
6382
|
-
encoder.encode(
|
|
7876
|
+
encoder.encode(chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
6383
7877
|
encoder.encode(mint)
|
|
6384
7878
|
]
|
|
6385
7879
|
});
|
|
@@ -6405,16 +7899,17 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
6405
7899
|
quoteMint,
|
|
6406
7900
|
baseVault,
|
|
6407
7901
|
quoteVault,
|
|
7902
|
+
launchFeeState,
|
|
6408
7903
|
payer,
|
|
6409
7904
|
authority,
|
|
6410
7905
|
hookProgram,
|
|
6411
7906
|
migratorProgram,
|
|
6412
|
-
baseTokenProgram =
|
|
6413
|
-
quoteTokenProgram =
|
|
6414
|
-
systemProgram =
|
|
7907
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
7908
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
7909
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
6415
7910
|
rent,
|
|
6416
7911
|
metadataAccount,
|
|
6417
|
-
metadataProgram =
|
|
7912
|
+
metadataProgram = chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
6418
7913
|
hookCreateRemainingAccounts = []
|
|
6419
7914
|
} = accounts;
|
|
6420
7915
|
const withMetadata = Boolean(
|
|
@@ -6429,6 +7924,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
6429
7924
|
const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
|
|
6430
7925
|
(account) => isTransactionSigner5(account) ? account.address : account
|
|
6431
7926
|
);
|
|
7927
|
+
const swapFeeBps = args.swapFeeBps ?? args.curveFeeBps;
|
|
7928
|
+
if (swapFeeBps === void 0) {
|
|
7929
|
+
throw new Error("swapFeeBps is required");
|
|
7930
|
+
}
|
|
6432
7931
|
const keys = [
|
|
6433
7932
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
6434
7933
|
{ address: launch, role: kit.AccountRole.WRITABLE },
|
|
@@ -6437,6 +7936,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
6437
7936
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
6438
7937
|
createAccountMeta(baseVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
6439
7938
|
createAccountMeta(quoteVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
7939
|
+
{
|
|
7940
|
+
address: launchFeeState ?? (await getLaunchFeeStateAddress(launch, programId))[0],
|
|
7941
|
+
role: kit.AccountRole.WRITABLE
|
|
7942
|
+
},
|
|
6440
7943
|
createAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER)
|
|
6441
7944
|
];
|
|
6442
7945
|
keys.push(
|
|
@@ -6461,11 +7964,13 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
6461
7964
|
}
|
|
6462
7965
|
const encoderArgs = {
|
|
6463
7966
|
...args,
|
|
7967
|
+
swapFeeBps,
|
|
7968
|
+
feeBeneficiaries: args.feeBeneficiaries ?? [],
|
|
6464
7969
|
allowBuy: args.allowBuy ? 1 : 0,
|
|
6465
7970
|
allowSell: args.allowSell ? 1 : 0,
|
|
6466
|
-
hookProgram: args.hookProgram ?? hookProgram ??
|
|
7971
|
+
hookProgram: args.hookProgram ?? hookProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
6467
7972
|
hookCreateRemainingAccountsLen: args.hookCreateRemainingAccountsLen ?? hookCreateRemainingAccounts.length,
|
|
6468
|
-
migratorProgram: migratorProgram ??
|
|
7973
|
+
migratorProgram: migratorProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
6469
7974
|
hookCreateRemainingAccountsHash: args.hookCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(hookCreateRemainingAccountAddresses) : new Uint8Array(32))
|
|
6470
7975
|
};
|
|
6471
7976
|
const data = new Uint8Array(
|
|
@@ -6526,6 +8031,19 @@ function createAccountMeta2(value, role) {
|
|
|
6526
8031
|
}
|
|
6527
8032
|
return { address: value, role };
|
|
6528
8033
|
}
|
|
8034
|
+
function createRemainingAccountMeta(value) {
|
|
8035
|
+
if (typeof value === "string") {
|
|
8036
|
+
return { address: value, role: kit.AccountRole.READONLY };
|
|
8037
|
+
}
|
|
8038
|
+
if (isTransactionSigner6(value)) {
|
|
8039
|
+
return {
|
|
8040
|
+
address: value.address,
|
|
8041
|
+
role: kit.AccountRole.READONLY_SIGNER,
|
|
8042
|
+
signer: value
|
|
8043
|
+
};
|
|
8044
|
+
}
|
|
8045
|
+
return value;
|
|
8046
|
+
}
|
|
6529
8047
|
function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
|
|
6530
8048
|
const {
|
|
6531
8049
|
config,
|
|
@@ -6538,9 +8056,11 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
6538
8056
|
baseMint,
|
|
6539
8057
|
quoteMint,
|
|
6540
8058
|
user,
|
|
6541
|
-
hookProgram =
|
|
6542
|
-
|
|
6543
|
-
|
|
8059
|
+
hookProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8060
|
+
launchFeeState,
|
|
8061
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8062
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8063
|
+
remainingAccounts = []
|
|
6544
8064
|
} = accounts;
|
|
6545
8065
|
const keys = [
|
|
6546
8066
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -6557,8 +8077,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
6557
8077
|
// slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
|
|
6558
8078
|
// no-op placeholder when no real hook is configured.
|
|
6559
8079
|
{ address: hookProgram, role: kit.AccountRole.READONLY },
|
|
8080
|
+
{ address: launchFeeState, role: kit.AccountRole.WRITABLE },
|
|
6560
8081
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
6561
|
-
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY }
|
|
8082
|
+
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
8083
|
+
...remainingAccounts.map(createRemainingAccountMeta)
|
|
6562
8084
|
];
|
|
6563
8085
|
const data = new Uint8Array(
|
|
6564
8086
|
getCurveSwapExactInInstructionDataEncoder().encode(args)
|
|
@@ -6583,11 +8105,12 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
6583
8105
|
quoteMint,
|
|
6584
8106
|
baseVault,
|
|
6585
8107
|
quoteVault,
|
|
8108
|
+
launchFeeState,
|
|
6586
8109
|
migratorProgram,
|
|
6587
8110
|
payer,
|
|
6588
|
-
baseTokenProgram =
|
|
6589
|
-
quoteTokenProgram =
|
|
6590
|
-
systemProgram =
|
|
8111
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8112
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8113
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
6591
8114
|
rent
|
|
6592
8115
|
} = accounts;
|
|
6593
8116
|
const keys = [
|
|
@@ -6598,6 +8121,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
6598
8121
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
6599
8122
|
{ address: baseVault, role: kit.AccountRole.WRITABLE },
|
|
6600
8123
|
{ address: quoteVault, role: kit.AccountRole.WRITABLE },
|
|
8124
|
+
{ address: launchFeeState, role: kit.AccountRole.READONLY },
|
|
6601
8125
|
{ address: migratorProgram, role: kit.AccountRole.READONLY },
|
|
6602
8126
|
createSignerAccountMeta4(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
6603
8127
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
@@ -6605,27 +8129,55 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
6605
8129
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
6606
8130
|
{ address: rent, role: kit.AccountRole.READONLY }
|
|
6607
8131
|
];
|
|
6608
|
-
const data =
|
|
8132
|
+
const data = chunkGUGN3EYX_cjs.encodeInstructionData(
|
|
6609
8133
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
|
|
6610
8134
|
);
|
|
6611
8135
|
return { programAddress: programId, accounts: keys, data };
|
|
6612
8136
|
}
|
|
8137
|
+
function isTransactionSigner8(value) {
|
|
8138
|
+
return typeof value === "object" && value !== null && "address" in value && "signTransactions" in value;
|
|
8139
|
+
}
|
|
8140
|
+
function createRemainingAccountMeta2(value) {
|
|
8141
|
+
if (typeof value === "string") {
|
|
8142
|
+
return { address: value, role: kit.AccountRole.READONLY };
|
|
8143
|
+
}
|
|
8144
|
+
if (isTransactionSigner8(value)) {
|
|
8145
|
+
return {
|
|
8146
|
+
address: value.address,
|
|
8147
|
+
role: kit.AccountRole.READONLY_SIGNER,
|
|
8148
|
+
signer: value
|
|
8149
|
+
};
|
|
8150
|
+
}
|
|
8151
|
+
return value;
|
|
8152
|
+
}
|
|
6613
8153
|
var previewSwapExactInResultCodec = kit.getStructCodec([
|
|
6614
8154
|
["amountOut", kit.getU64Codec()],
|
|
6615
8155
|
["feePaid", kit.getU64Codec()]
|
|
6616
8156
|
]);
|
|
6617
8157
|
function createPreviewSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
|
|
6618
|
-
const {
|
|
8158
|
+
const {
|
|
8159
|
+
launch,
|
|
8160
|
+
launchFeeState,
|
|
8161
|
+
baseVault,
|
|
8162
|
+
quoteVault,
|
|
8163
|
+
hookProgram,
|
|
8164
|
+
remainingAccounts = []
|
|
8165
|
+
} = accounts;
|
|
6619
8166
|
const keys = [
|
|
6620
8167
|
{ address: launch, role: kit.AccountRole.READONLY },
|
|
8168
|
+
{ address: launchFeeState, role: kit.AccountRole.READONLY },
|
|
6621
8169
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
6622
8170
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
6623
8171
|
];
|
|
6624
8172
|
const accountsList = hookProgram ? [...keys, { address: hookProgram, role: kit.AccountRole.READONLY }] : keys;
|
|
8173
|
+
const accountsWithRemaining = [
|
|
8174
|
+
...accountsList,
|
|
8175
|
+
...remainingAccounts.map(createRemainingAccountMeta2)
|
|
8176
|
+
];
|
|
6625
8177
|
const data = new Uint8Array(
|
|
6626
8178
|
getPreviewSwapExactInInstructionDataEncoder2().encode(args)
|
|
6627
8179
|
);
|
|
6628
|
-
return { programAddress: programId, accounts:
|
|
8180
|
+
return { programAddress: programId, accounts: accountsWithRemaining, data };
|
|
6629
8181
|
}
|
|
6630
8182
|
function decodePreviewSwapExactInResult(data) {
|
|
6631
8183
|
return previewSwapExactInResultCodec.decode(data);
|
|
@@ -6643,7 +8195,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
|
|
|
6643
8195
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
6644
8196
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
6645
8197
|
];
|
|
6646
|
-
const data =
|
|
8198
|
+
const data = chunkGUGN3EYX_cjs.encodeInstructionData(
|
|
6647
8199
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
|
|
6648
8200
|
);
|
|
6649
8201
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -7016,7 +8568,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
7016
8568
|
adminBaseAta,
|
|
7017
8569
|
adminQuoteAta,
|
|
7018
8570
|
recipientAtas,
|
|
7019
|
-
cpmmProgram =
|
|
8571
|
+
cpmmProgram = chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID,
|
|
7020
8572
|
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
7021
8573
|
}) {
|
|
7022
8574
|
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
@@ -7024,9 +8576,9 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
7024
8576
|
cpmmMigratorProgram
|
|
7025
8577
|
);
|
|
7026
8578
|
const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
|
|
7027
|
-
const poolInit = await
|
|
8579
|
+
const poolInit = await chunkAKLS6T3R_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
|
|
7028
8580
|
const pool = poolInit.pool[0];
|
|
7029
|
-
const [launchLpPosition] = await
|
|
8581
|
+
const [launchLpPosition] = await chunkAKLS6T3R_cjs.getPositionAddress(
|
|
7030
8582
|
pool,
|
|
7031
8583
|
launchAuthority,
|
|
7032
8584
|
0n,
|
|
@@ -7774,13 +9326,14 @@ async function getOracleStateAddress(oracleAuthority, nonce) {
|
|
|
7774
9326
|
|
|
7775
9327
|
// src/solana/deployment.ts
|
|
7776
9328
|
var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
|
|
7777
|
-
cpmmProgram:
|
|
9329
|
+
cpmmProgram: chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID,
|
|
7778
9330
|
initializerProgram: INITIALIZER_PROGRAM_ID,
|
|
7779
9331
|
cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
|
|
7780
|
-
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
|
|
9332
|
+
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID,
|
|
9333
|
+
cosignerHookProgram: COSIGNER_HOOK_PROGRAM_ID
|
|
7781
9334
|
};
|
|
7782
9335
|
async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
|
|
7783
|
-
const [cpmmConfig] = await
|
|
9336
|
+
const [cpmmConfig] = await chunkAKLS6T3R_cjs.getConfigAddress(programs.cpmmProgram);
|
|
7784
9337
|
const [initializerConfig] = await getConfigAddress2(
|
|
7785
9338
|
programs.initializerProgram
|
|
7786
9339
|
);
|
|
@@ -7792,6 +9345,7 @@ async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGR
|
|
|
7792
9345
|
}
|
|
7793
9346
|
|
|
7794
9347
|
exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES;
|
|
9348
|
+
exports.cosignerHook = cosignerHook_exports;
|
|
7795
9349
|
exports.cpmm = cpmm_exports;
|
|
7796
9350
|
exports.cpmmMigrator = cpmmMigrator_exports;
|
|
7797
9351
|
exports.deriveSolanaCpmmDeployment = deriveSolanaCpmmDeployment;
|