@whetstone-research/doppler-sdk 1.0.16 → 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/{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 +764 -179
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +306 -10
- package/dist/solana/index.d.ts +306 -10
- package/dist/solana/index.js +605 -20
- 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;
|
|
@@ -4557,6 +4561,7 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
4557
4561
|
SEED_CONFIG: () => SEED_CONFIG2,
|
|
4558
4562
|
SEED_LAUNCH: () => SEED_LAUNCH,
|
|
4559
4563
|
SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
|
|
4564
|
+
SEED_LAUNCH_FEE_STATE: () => SEED_LAUNCH_FEE_STATE,
|
|
4560
4565
|
TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
|
|
4561
4566
|
TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
|
|
4562
4567
|
buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
|
|
@@ -4576,7 +4581,9 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
4576
4581
|
fetchAllLaunches: () => fetchAllLaunches,
|
|
4577
4582
|
fetchLaunch: () => fetchLaunch2,
|
|
4578
4583
|
fetchLaunchesByAuthority: () => fetchLaunchesByAuthority,
|
|
4584
|
+
getClaimFeesInstructionAsync: () => getClaimFeesInstructionAsync,
|
|
4579
4585
|
getConfigAddress: () => getConfigAddress2,
|
|
4586
|
+
getHarvestMigratedFeesInstructionAsync: () => getHarvestMigratedFeesInstructionAsync,
|
|
4580
4587
|
getInitConfigCodec: () => getInitConfigCodec,
|
|
4581
4588
|
getInitConfigDecoder: () => getInitConfigDecoder,
|
|
4582
4589
|
getInitConfigEncoder: () => getInitConfigEncoder,
|
|
@@ -4592,7 +4599,13 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
4592
4599
|
getLaunchCodec: () => getLaunchCodec,
|
|
4593
4600
|
getLaunchDecoder: () => getLaunchDecoder,
|
|
4594
4601
|
getLaunchEncoder: () => getLaunchEncoder,
|
|
4602
|
+
getLaunchFeeStateAddress: () => getLaunchFeeStateAddress,
|
|
4603
|
+
getLaunchFeeStateCodec: () => getLaunchFeeStateCodec,
|
|
4604
|
+
getLaunchFeeStateDecoder: () => getLaunchFeeStateDecoder,
|
|
4605
|
+
getLaunchFeeStateEncoder: () => getLaunchFeeStateEncoder,
|
|
4595
4606
|
getProgramDataAddress: () => getProgramDataAddress,
|
|
4607
|
+
getReplaceFeeBeneficiaryInstructionAsync: () => getReplaceFeeBeneficiaryInstructionAsync,
|
|
4608
|
+
getSetFeePolicyInstructionAsync: () => getSetFeePolicyInstructionAsync,
|
|
4596
4609
|
getTokenMetadataAddress: () => getTokenMetadataAddress,
|
|
4597
4610
|
launchExists: () => launchExists,
|
|
4598
4611
|
launchIdFromU64: () => launchIdFromU64,
|
|
@@ -4613,6 +4626,7 @@ var PREDICTION_HOOK_PROGRAM_ID = kit.address(
|
|
|
4613
4626
|
var SEED_CONFIG2 = "config";
|
|
4614
4627
|
var SEED_LAUNCH = "launch";
|
|
4615
4628
|
var SEED_LAUNCH_AUTHORITY = "launch_authority";
|
|
4629
|
+
var SEED_LAUNCH_FEE_STATE = "launch_fee_state";
|
|
4616
4630
|
var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
|
|
4617
4631
|
232,
|
|
4618
4632
|
231,
|
|
@@ -4759,7 +4773,18 @@ var INITIALIZER_ACCOUNT_DISCRIMINATORS = {
|
|
|
4759
4773
|
// SHA256("account:InitConfig")[0:8]
|
|
4760
4774
|
InitConfig: new Uint8Array([97, 166, 35, 7, 20, 2, 164, 126]),
|
|
4761
4775
|
// SHA256("account:Launch")[0:8]
|
|
4762
|
-
Launch: new Uint8Array([144, 51, 51, 163, 206, 85, 213, 38])
|
|
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
|
+
])
|
|
4763
4788
|
};
|
|
4764
4789
|
var INIT_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
4765
4790
|
97,
|
|
@@ -4782,7 +4807,10 @@ function getInitConfigEncoder() {
|
|
|
4782
4807
|
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
|
|
4783
4808
|
["bump", kit.getU8Encoder()],
|
|
4784
4809
|
["version", kit.getU8Encoder()],
|
|
4785
|
-
["
|
|
4810
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
4811
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
4812
|
+
["maxSwapFeeBps", kit.getU16Encoder()],
|
|
4813
|
+
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 24)]
|
|
4786
4814
|
]),
|
|
4787
4815
|
(value) => ({ ...value, discriminator: INIT_CONFIG_DISCRIMINATOR })
|
|
4788
4816
|
);
|
|
@@ -4797,22 +4825,57 @@ function getInitConfigDecoder() {
|
|
|
4797
4825
|
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
|
|
4798
4826
|
["bump", kit.getU8Decoder()],
|
|
4799
4827
|
["version", kit.getU8Decoder()],
|
|
4800
|
-
["
|
|
4828
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
4829
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
4830
|
+
["maxSwapFeeBps", kit.getU16Decoder()],
|
|
4831
|
+
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 24)]
|
|
4801
4832
|
]);
|
|
4802
4833
|
}
|
|
4803
4834
|
function getInitConfigCodec() {
|
|
4804
4835
|
return kit.combineCodec(getInitConfigEncoder(), getInitConfigDecoder());
|
|
4805
4836
|
}
|
|
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
|
+
}
|
|
4806
4863
|
function getInitializeConfigArgsEncoder2() {
|
|
4807
4864
|
return kit.getStructEncoder([
|
|
4808
4865
|
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
4809
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
4866
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
4867
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
4868
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
4869
|
+
["maxSwapFeeBps", kit.getU16Encoder()]
|
|
4810
4870
|
]);
|
|
4811
4871
|
}
|
|
4812
4872
|
function getInitializeConfigArgsDecoder2() {
|
|
4813
4873
|
return kit.getStructDecoder([
|
|
4814
4874
|
["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
4815
|
-
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
|
|
4875
|
+
["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())],
|
|
4876
|
+
["protocolFeeBps", kit.getU16Decoder()],
|
|
4877
|
+
["minSwapFeeBps", kit.getU16Decoder()],
|
|
4878
|
+
["maxSwapFeeBps", kit.getU16Decoder()]
|
|
4816
4879
|
]);
|
|
4817
4880
|
}
|
|
4818
4881
|
function getInitializeConfigArgsCodec2() {
|
|
@@ -4831,7 +4894,7 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
4831
4894
|
["baseForLiquidity", kit.getU64Encoder()],
|
|
4832
4895
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
4833
4896
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
4834
|
-
["
|
|
4897
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
4835
4898
|
["curveKind", kit.getU8Encoder()],
|
|
4836
4899
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
4837
4900
|
["allowBuy", kit.getU8Encoder()],
|
|
@@ -4858,7 +4921,8 @@ function getInitializeLaunchArgsEncoder() {
|
|
|
4858
4921
|
["migratorRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
4859
4922
|
["metadataName", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
4860
4923
|
["metadataSymbol", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
4861
|
-
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
4924
|
+
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
4925
|
+
["feeBeneficiaries", kit.getArrayEncoder(getFeeBeneficiaryInputEncoder())]
|
|
4862
4926
|
]);
|
|
4863
4927
|
}
|
|
4864
4928
|
function getInitializeLaunchArgsDecoder() {
|
|
@@ -4871,7 +4935,7 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
4871
4935
|
["baseForLiquidity", kit.getU64Decoder()],
|
|
4872
4936
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
4873
4937
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
4874
|
-
["
|
|
4938
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
4875
4939
|
["curveKind", kit.getU8Decoder()],
|
|
4876
4940
|
["curveParams", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
|
|
4877
4941
|
["allowBuy", kit.getU8Decoder()],
|
|
@@ -4898,7 +4962,8 @@ function getInitializeLaunchArgsDecoder() {
|
|
|
4898
4962
|
["migratorRemainingAccountsHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
4899
4963
|
["metadataName", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
4900
4964
|
["metadataSymbol", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
4901
|
-
["metadataUri", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())]
|
|
4965
|
+
["metadataUri", kit.addDecoderSizePrefix(kit.getUtf8Decoder(), kit.getU32Decoder())],
|
|
4966
|
+
["feeBeneficiaries", kit.getArrayDecoder(getFeeBeneficiaryInputDecoder())]
|
|
4902
4967
|
]);
|
|
4903
4968
|
}
|
|
4904
4969
|
function getInitializeLaunchArgsCodec() {
|
|
@@ -4952,7 +5017,7 @@ function getLaunchEncoder() {
|
|
|
4952
5017
|
["baseForCurve", kit.getU64Encoder()],
|
|
4953
5018
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
4954
5019
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
4955
|
-
["
|
|
5020
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
4956
5021
|
["pad1", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
|
|
4957
5022
|
["allowBuy", kit.getU8Encoder()],
|
|
4958
5023
|
["allowSell", kit.getU8Encoder()],
|
|
@@ -4994,7 +5059,7 @@ function getLaunchDecoder() {
|
|
|
4994
5059
|
["baseForCurve", kit.getU64Decoder()],
|
|
4995
5060
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
4996
5061
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
4997
|
-
["
|
|
5062
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
4998
5063
|
["pad1", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
|
|
4999
5064
|
["allowBuy", kit.getU8Decoder()],
|
|
5000
5065
|
["allowSell", kit.getU8Decoder()],
|
|
@@ -5017,6 +5082,217 @@ function getLaunchDecoder() {
|
|
|
5017
5082
|
function getLaunchCodec() {
|
|
5018
5083
|
return kit.combineCodec(getLaunchEncoder(), getLaunchDecoder());
|
|
5019
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
|
+
}
|
|
5020
5296
|
var CURVE_SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
|
|
5021
5297
|
196,
|
|
5022
5298
|
247,
|
|
@@ -5038,6 +5314,153 @@ function getCurveSwapExactInInstructionDataEncoder() {
|
|
|
5038
5314
|
(value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR })
|
|
5039
5315
|
);
|
|
5040
5316
|
}
|
|
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
|
+
}
|
|
5041
5464
|
var INITIALIZE_CONFIG_DISCRIMINATOR3 = new Uint8Array([
|
|
5042
5465
|
208,
|
|
5043
5466
|
127,
|
|
@@ -5053,7 +5476,10 @@ function getInitializeConfigInstructionDataEncoder3() {
|
|
|
5053
5476
|
kit.getStructEncoder([
|
|
5054
5477
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
5055
5478
|
["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
5056
|
-
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
|
|
5479
|
+
["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
|
|
5480
|
+
["protocolFeeBps", kit.getU16Encoder()],
|
|
5481
|
+
["minSwapFeeBps", kit.getU16Encoder()],
|
|
5482
|
+
["maxSwapFeeBps", kit.getU16Encoder()]
|
|
5057
5483
|
]),
|
|
5058
5484
|
(value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR3 })
|
|
5059
5485
|
);
|
|
@@ -5080,7 +5506,7 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
5080
5506
|
["baseForLiquidity", kit.getU64Encoder()],
|
|
5081
5507
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
5082
5508
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
5083
|
-
["
|
|
5509
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
5084
5510
|
["curveKind", kit.getU8Encoder()],
|
|
5085
5511
|
["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
|
|
5086
5512
|
["allowBuy", kit.getU8Encoder()],
|
|
@@ -5113,7 +5539,8 @@ function getInitializeLaunchInstructionDataEncoder() {
|
|
|
5113
5539
|
"metadataSymbol",
|
|
5114
5540
|
kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())
|
|
5115
5541
|
],
|
|
5116
|
-
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())]
|
|
5542
|
+
["metadataUri", kit.addEncoderSizePrefix(kit.getUtf8Encoder(), kit.getU32Encoder())],
|
|
5543
|
+
["feeBeneficiaries", kit.getArrayEncoder(getFeeBeneficiaryInputEncoder())]
|
|
5117
5544
|
]),
|
|
5118
5545
|
(value) => ({ ...value, discriminator: INITIALIZE_LAUNCH_DISCRIMINATOR })
|
|
5119
5546
|
);
|
|
@@ -5141,6 +5568,135 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
|
|
|
5141
5568
|
})
|
|
5142
5569
|
);
|
|
5143
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
|
+
}
|
|
5144
5700
|
var SET_HOOK_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
|
|
5145
5701
|
232,
|
|
5146
5702
|
28,
|
|
@@ -5182,6 +5738,9 @@ function getSetMigratorAllowlistInstructionDataEncoder() {
|
|
|
5182
5738
|
})
|
|
5183
5739
|
);
|
|
5184
5740
|
}
|
|
5741
|
+
|
|
5742
|
+
// src/solana/generated/initializer/programs/initializer.ts
|
|
5743
|
+
var INITIALIZER_PROGRAM_ADDRESS = "4h3Dqyo5qmteJoMxXt3tdtfXELDB6pdRTPU9mWruiKp1";
|
|
5185
5744
|
if (process.env.NODE_ENV !== "production") ;
|
|
5186
5745
|
var addressCodec2 = kit.getAddressCodec();
|
|
5187
5746
|
var textEncoder3 = new TextEncoder();
|
|
@@ -5225,6 +5784,15 @@ async function getLaunchAuthorityAddress(launch, programId = INITIALIZER_PROGRAM
|
|
|
5225
5784
|
]
|
|
5226
5785
|
});
|
|
5227
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),
|
|
5792
|
+
addressCodec2.encode(launch)
|
|
5793
|
+
]
|
|
5794
|
+
});
|
|
5795
|
+
}
|
|
5228
5796
|
function launchIdFromU64(launchId) {
|
|
5229
5797
|
const out = new Uint8Array(32);
|
|
5230
5798
|
out.set(encodeU64LE(launchId), 0);
|
|
@@ -5244,7 +5812,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
|
|
|
5244
5812
|
admin,
|
|
5245
5813
|
config,
|
|
5246
5814
|
programData,
|
|
5247
|
-
systemProgram =
|
|
5815
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
5248
5816
|
} = accounts;
|
|
5249
5817
|
const keys = [
|
|
5250
5818
|
createSignerAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
@@ -5788,7 +6356,7 @@ function getLaunchEncoder2() {
|
|
|
5788
6356
|
["baseForCurve", kit.getU64Encoder()],
|
|
5789
6357
|
["curveVirtualBase", kit.getU64Encoder()],
|
|
5790
6358
|
["curveVirtualQuote", kit.getU64Encoder()],
|
|
5791
|
-
["
|
|
6359
|
+
["swapFeeBps", kit.getU16Encoder()],
|
|
5792
6360
|
["pad1", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
|
|
5793
6361
|
["allowBuy", kit.getU8Encoder()],
|
|
5794
6362
|
["allowSell", kit.getU8Encoder()],
|
|
@@ -5830,7 +6398,7 @@ function getLaunchDecoder2() {
|
|
|
5830
6398
|
["baseForCurve", kit.getU64Decoder()],
|
|
5831
6399
|
["curveVirtualBase", kit.getU64Decoder()],
|
|
5832
6400
|
["curveVirtualQuote", kit.getU64Decoder()],
|
|
5833
|
-
["
|
|
6401
|
+
["swapFeeBps", kit.getU16Decoder()],
|
|
5834
6402
|
["pad1", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
|
|
5835
6403
|
["allowBuy", kit.getU8Decoder()],
|
|
5836
6404
|
["allowSell", kit.getU8Decoder()],
|
|
@@ -7302,10 +7870,10 @@ function createAccountMeta(value, role) {
|
|
|
7302
7870
|
async function getTokenMetadataAddress(mint) {
|
|
7303
7871
|
const encoder = kit.getAddressEncoder();
|
|
7304
7872
|
const [metadataAddress] = await kit.getProgramDerivedAddress({
|
|
7305
|
-
programAddress:
|
|
7873
|
+
programAddress: chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
7306
7874
|
seeds: [
|
|
7307
7875
|
new TextEncoder().encode("metadata"),
|
|
7308
|
-
encoder.encode(
|
|
7876
|
+
encoder.encode(chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
7309
7877
|
encoder.encode(mint)
|
|
7310
7878
|
]
|
|
7311
7879
|
});
|
|
@@ -7331,16 +7899,17 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
7331
7899
|
quoteMint,
|
|
7332
7900
|
baseVault,
|
|
7333
7901
|
quoteVault,
|
|
7902
|
+
launchFeeState,
|
|
7334
7903
|
payer,
|
|
7335
7904
|
authority,
|
|
7336
7905
|
hookProgram,
|
|
7337
7906
|
migratorProgram,
|
|
7338
|
-
baseTokenProgram =
|
|
7339
|
-
quoteTokenProgram =
|
|
7340
|
-
systemProgram =
|
|
7907
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
7908
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
7909
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7341
7910
|
rent,
|
|
7342
7911
|
metadataAccount,
|
|
7343
|
-
metadataProgram =
|
|
7912
|
+
metadataProgram = chunkAKLS6T3R_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
7344
7913
|
hookCreateRemainingAccounts = []
|
|
7345
7914
|
} = accounts;
|
|
7346
7915
|
const withMetadata = Boolean(
|
|
@@ -7355,6 +7924,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
7355
7924
|
const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
|
|
7356
7925
|
(account) => isTransactionSigner5(account) ? account.address : account
|
|
7357
7926
|
);
|
|
7927
|
+
const swapFeeBps = args.swapFeeBps ?? args.curveFeeBps;
|
|
7928
|
+
if (swapFeeBps === void 0) {
|
|
7929
|
+
throw new Error("swapFeeBps is required");
|
|
7930
|
+
}
|
|
7358
7931
|
const keys = [
|
|
7359
7932
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
7360
7933
|
{ address: launch, role: kit.AccountRole.WRITABLE },
|
|
@@ -7363,6 +7936,10 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
7363
7936
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
7364
7937
|
createAccountMeta(baseVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
7365
7938
|
createAccountMeta(quoteVault, kit.AccountRole.WRITABLE_SIGNER),
|
|
7939
|
+
{
|
|
7940
|
+
address: launchFeeState ?? (await getLaunchFeeStateAddress(launch, programId))[0],
|
|
7941
|
+
role: kit.AccountRole.WRITABLE
|
|
7942
|
+
},
|
|
7366
7943
|
createAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER)
|
|
7367
7944
|
];
|
|
7368
7945
|
keys.push(
|
|
@@ -7387,11 +7964,13 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
7387
7964
|
}
|
|
7388
7965
|
const encoderArgs = {
|
|
7389
7966
|
...args,
|
|
7967
|
+
swapFeeBps,
|
|
7968
|
+
feeBeneficiaries: args.feeBeneficiaries ?? [],
|
|
7390
7969
|
allowBuy: args.allowBuy ? 1 : 0,
|
|
7391
7970
|
allowSell: args.allowSell ? 1 : 0,
|
|
7392
|
-
hookProgram: args.hookProgram ?? hookProgram ??
|
|
7971
|
+
hookProgram: args.hookProgram ?? hookProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7393
7972
|
hookCreateRemainingAccountsLen: args.hookCreateRemainingAccountsLen ?? hookCreateRemainingAccounts.length,
|
|
7394
|
-
migratorProgram: migratorProgram ??
|
|
7973
|
+
migratorProgram: migratorProgram ?? chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7395
7974
|
hookCreateRemainingAccountsHash: args.hookCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(hookCreateRemainingAccountAddresses) : new Uint8Array(32))
|
|
7396
7975
|
};
|
|
7397
7976
|
const data = new Uint8Array(
|
|
@@ -7477,9 +8056,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
7477
8056
|
baseMint,
|
|
7478
8057
|
quoteMint,
|
|
7479
8058
|
user,
|
|
7480
|
-
hookProgram =
|
|
7481
|
-
|
|
7482
|
-
|
|
8059
|
+
hookProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
8060
|
+
launchFeeState,
|
|
8061
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8062
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
7483
8063
|
remainingAccounts = []
|
|
7484
8064
|
} = accounts;
|
|
7485
8065
|
const keys = [
|
|
@@ -7497,6 +8077,7 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
7497
8077
|
// slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
|
|
7498
8078
|
// no-op placeholder when no real hook is configured.
|
|
7499
8079
|
{ address: hookProgram, role: kit.AccountRole.READONLY },
|
|
8080
|
+
{ address: launchFeeState, role: kit.AccountRole.WRITABLE },
|
|
7500
8081
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
7501
8082
|
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
7502
8083
|
...remainingAccounts.map(createRemainingAccountMeta)
|
|
@@ -7524,11 +8105,12 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
7524
8105
|
quoteMint,
|
|
7525
8106
|
baseVault,
|
|
7526
8107
|
quoteVault,
|
|
8108
|
+
launchFeeState,
|
|
7527
8109
|
migratorProgram,
|
|
7528
8110
|
payer,
|
|
7529
|
-
baseTokenProgram =
|
|
7530
|
-
quoteTokenProgram =
|
|
7531
|
-
systemProgram =
|
|
8111
|
+
baseTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8112
|
+
quoteTokenProgram = chunkAKLS6T3R_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
8113
|
+
systemProgram = chunkAKLS6T3R_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
7532
8114
|
rent
|
|
7533
8115
|
} = accounts;
|
|
7534
8116
|
const keys = [
|
|
@@ -7539,6 +8121,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
7539
8121
|
{ address: quoteMint, role: kit.AccountRole.READONLY },
|
|
7540
8122
|
{ address: baseVault, role: kit.AccountRole.WRITABLE },
|
|
7541
8123
|
{ address: quoteVault, role: kit.AccountRole.WRITABLE },
|
|
8124
|
+
{ address: launchFeeState, role: kit.AccountRole.READONLY },
|
|
7542
8125
|
{ address: migratorProgram, role: kit.AccountRole.READONLY },
|
|
7543
8126
|
createSignerAccountMeta4(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
7544
8127
|
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
@@ -7546,7 +8129,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
7546
8129
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
7547
8130
|
{ address: rent, role: kit.AccountRole.READONLY }
|
|
7548
8131
|
];
|
|
7549
|
-
const data =
|
|
8132
|
+
const data = chunkGUGN3EYX_cjs.encodeInstructionData(
|
|
7550
8133
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
|
|
7551
8134
|
);
|
|
7552
8135
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -7574,6 +8157,7 @@ var previewSwapExactInResultCodec = kit.getStructCodec([
|
|
|
7574
8157
|
function createPreviewSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
|
|
7575
8158
|
const {
|
|
7576
8159
|
launch,
|
|
8160
|
+
launchFeeState,
|
|
7577
8161
|
baseVault,
|
|
7578
8162
|
quoteVault,
|
|
7579
8163
|
hookProgram,
|
|
@@ -7581,6 +8165,7 @@ function createPreviewSwapExactInInstruction(accounts, args, programId = INITIAL
|
|
|
7581
8165
|
} = accounts;
|
|
7582
8166
|
const keys = [
|
|
7583
8167
|
{ address: launch, role: kit.AccountRole.READONLY },
|
|
8168
|
+
{ address: launchFeeState, role: kit.AccountRole.READONLY },
|
|
7584
8169
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
7585
8170
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
7586
8171
|
];
|
|
@@ -7610,7 +8195,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
|
|
|
7610
8195
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
7611
8196
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
7612
8197
|
];
|
|
7613
|
-
const data =
|
|
8198
|
+
const data = chunkGUGN3EYX_cjs.encodeInstructionData(
|
|
7614
8199
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
|
|
7615
8200
|
);
|
|
7616
8201
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -7983,7 +8568,7 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
7983
8568
|
adminBaseAta,
|
|
7984
8569
|
adminQuoteAta,
|
|
7985
8570
|
recipientAtas,
|
|
7986
|
-
cpmmProgram =
|
|
8571
|
+
cpmmProgram = chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID,
|
|
7987
8572
|
cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
|
|
7988
8573
|
}) {
|
|
7989
8574
|
const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
|
|
@@ -7991,9 +8576,9 @@ async function buildCpmmMigrationRemainingAccounts({
|
|
|
7991
8576
|
cpmmMigratorProgram
|
|
7992
8577
|
);
|
|
7993
8578
|
const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
|
|
7994
|
-
const poolInit = await
|
|
8579
|
+
const poolInit = await chunkAKLS6T3R_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
|
|
7995
8580
|
const pool = poolInit.pool[0];
|
|
7996
|
-
const [launchLpPosition] = await
|
|
8581
|
+
const [launchLpPosition] = await chunkAKLS6T3R_cjs.getPositionAddress(
|
|
7997
8582
|
pool,
|
|
7998
8583
|
launchAuthority,
|
|
7999
8584
|
0n,
|
|
@@ -8741,14 +9326,14 @@ async function getOracleStateAddress(oracleAuthority, nonce) {
|
|
|
8741
9326
|
|
|
8742
9327
|
// src/solana/deployment.ts
|
|
8743
9328
|
var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
|
|
8744
|
-
cpmmProgram:
|
|
9329
|
+
cpmmProgram: chunkAKLS6T3R_cjs.CPMM_PROGRAM_ID,
|
|
8745
9330
|
initializerProgram: INITIALIZER_PROGRAM_ID,
|
|
8746
9331
|
cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
|
|
8747
9332
|
cpmmHookProgram: CPMM_HOOK_PROGRAM_ID,
|
|
8748
9333
|
cosignerHookProgram: COSIGNER_HOOK_PROGRAM_ID
|
|
8749
9334
|
};
|
|
8750
9335
|
async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
|
|
8751
|
-
const [cpmmConfig] = await
|
|
9336
|
+
const [cpmmConfig] = await chunkAKLS6T3R_cjs.getConfigAddress(programs.cpmmProgram);
|
|
8752
9337
|
const [initializerConfig] = await getConfigAddress2(
|
|
8753
9338
|
programs.initializerProgram
|
|
8754
9339
|
);
|