@whetstone-research/doppler-sdk 1.0.7 → 1.0.9
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-BXATWUGJ.cjs → chunk-I5JME35L.cjs} +39 -39
- package/dist/{chunk-BXATWUGJ.cjs.map → chunk-I5JME35L.cjs.map} +1 -1
- package/dist/{chunk-DPKVNI6Q.cjs → chunk-O6FR7TXY.cjs} +27 -3
- package/dist/chunk-O6FR7TXY.cjs.map +1 -0
- package/dist/{chunk-BSHIMMA4.js → chunk-RF4NM4ES.js} +3 -3
- package/dist/{chunk-BSHIMMA4.js.map → chunk-RF4NM4ES.js.map} +1 -1
- package/dist/{chunk-J57ROY36.js → chunk-YWZCHTXQ.js} +25 -4
- package/dist/chunk-YWZCHTXQ.js.map +1 -0
- package/dist/evm/index.cjs +15 -14
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.js +15 -14
- package/dist/evm/index.js.map +1 -1
- package/dist/pda-NKKMVQ4N.js +4 -0
- package/dist/pda-NKKMVQ4N.js.map +1 -0
- package/dist/pda-UKFLYQGA.cjs +61 -0
- package/dist/pda-UKFLYQGA.cjs.map +1 -0
- package/dist/solana/index.cjs +428 -332
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +160 -118
- package/dist/solana/index.d.ts +160 -118
- package/dist/solana/index.js +208 -112
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/react/index.cjs +45 -45
- package/dist/solana/react/index.js +3 -3
- package/package.json +1 -1
- package/dist/chunk-DPKVNI6Q.cjs.map +0 -1
- package/dist/chunk-J57ROY36.js.map +0 -1
- package/dist/pda-TXZDXZZ4.js +0 -4
- package/dist/pda-TXZDXZZ4.js.map +0 -1
- package/dist/pda-ZZMBZSFU.cjs +0 -53
- package/dist/pda-ZZMBZSFU.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 chunkI5JME35L_cjs = require('../chunk-I5JME35L.cjs');
|
|
4
|
+
var chunkO6FR7TXY_cjs = require('../chunk-O6FR7TXY.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');
|
|
@@ -10,48 +10,48 @@ var sha3_js = require('@noble/hashes/sha3.js');
|
|
|
10
10
|
// src/solana/cpmm/index.ts
|
|
11
11
|
var cpmm_exports = {};
|
|
12
12
|
chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
13
|
-
ACCOUNT_DISCRIMINATORS: () =>
|
|
14
|
-
ACCOUNT_VERSION: () =>
|
|
15
|
-
BPS_DENOM: () =>
|
|
13
|
+
ACCOUNT_DISCRIMINATORS: () => chunkO6FR7TXY_cjs.ACCOUNT_DISCRIMINATORS,
|
|
14
|
+
ACCOUNT_VERSION: () => chunkO6FR7TXY_cjs.ACCOUNT_VERSION,
|
|
15
|
+
BPS_DENOM: () => chunkO6FR7TXY_cjs.BPS_DENOM,
|
|
16
16
|
CPMM_ERROR_MESSAGES: () => CPMM_ERROR_MESSAGES,
|
|
17
|
-
CPMM_PROGRAM_ID: () =>
|
|
17
|
+
CPMM_PROGRAM_ID: () => chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID,
|
|
18
18
|
CpmmError: () => CpmmError,
|
|
19
19
|
CpmmErrorCode: () => CpmmErrorCode,
|
|
20
|
-
INSTRUCTION_DISCRIMINATORS: () =>
|
|
21
|
-
MAX_FEE_AMOUNT: () =>
|
|
22
|
-
MAX_ORACLE_OBSERVATIONS: () =>
|
|
23
|
-
MAX_SENTINEL_ALLOWLIST: () =>
|
|
24
|
-
Q64_ONE: () =>
|
|
25
|
-
SEED_AUTHORITY: () =>
|
|
26
|
-
SEED_CONFIG: () =>
|
|
27
|
-
SEED_ORACLE: () =>
|
|
28
|
-
SEED_POOL: () =>
|
|
29
|
-
SEED_POSITION: () =>
|
|
30
|
-
SEED_PROTOCOL_POSITION: () =>
|
|
31
|
-
SENTINEL_NO_CHANGE: () =>
|
|
32
|
-
SF_AFTER_ADD_LIQ: () =>
|
|
33
|
-
SF_AFTER_REMOVE_LIQ: () =>
|
|
34
|
-
SF_AFTER_SWAP: () =>
|
|
35
|
-
SF_BEFORE_ADD_LIQ: () =>
|
|
36
|
-
SF_BEFORE_REMOVE_LIQ: () =>
|
|
37
|
-
SF_BEFORE_SWAP: () =>
|
|
38
|
-
TOKEN_METADATA_PROGRAM_ID: () =>
|
|
39
|
-
addLiquidityArgsCodec: () =>
|
|
40
|
-
ammConfigDataCodec: () =>
|
|
41
|
-
areMintsOrdered: () =>
|
|
42
|
-
calculateAccruedFees: () =>
|
|
43
|
-
calculateTwap: () =>
|
|
44
|
-
calculateTwapNumber: () =>
|
|
45
|
-
ceilDiv: () =>
|
|
46
|
-
collectFeesArgsCodec: () =>
|
|
47
|
-
collectProtocolFeesArgsCodec: () =>
|
|
48
|
-
comparePoolAndOraclePrices: () =>
|
|
49
|
-
computePrice0Q64: () =>
|
|
50
|
-
computePrice1Q64: () =>
|
|
51
|
-
consultTwap: () =>
|
|
20
|
+
INSTRUCTION_DISCRIMINATORS: () => chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS,
|
|
21
|
+
MAX_FEE_AMOUNT: () => chunkI5JME35L_cjs.MAX_FEE_AMOUNT,
|
|
22
|
+
MAX_ORACLE_OBSERVATIONS: () => chunkO6FR7TXY_cjs.MAX_ORACLE_OBSERVATIONS,
|
|
23
|
+
MAX_SENTINEL_ALLOWLIST: () => chunkO6FR7TXY_cjs.MAX_SENTINEL_ALLOWLIST,
|
|
24
|
+
Q64_ONE: () => chunkO6FR7TXY_cjs.Q64_ONE,
|
|
25
|
+
SEED_AUTHORITY: () => chunkO6FR7TXY_cjs.SEED_AUTHORITY,
|
|
26
|
+
SEED_CONFIG: () => chunkO6FR7TXY_cjs.SEED_CONFIG,
|
|
27
|
+
SEED_ORACLE: () => chunkO6FR7TXY_cjs.SEED_ORACLE,
|
|
28
|
+
SEED_POOL: () => chunkO6FR7TXY_cjs.SEED_POOL,
|
|
29
|
+
SEED_POSITION: () => chunkO6FR7TXY_cjs.SEED_POSITION,
|
|
30
|
+
SEED_PROTOCOL_POSITION: () => chunkO6FR7TXY_cjs.SEED_PROTOCOL_POSITION,
|
|
31
|
+
SENTINEL_NO_CHANGE: () => chunkO6FR7TXY_cjs.SENTINEL_NO_CHANGE,
|
|
32
|
+
SF_AFTER_ADD_LIQ: () => chunkO6FR7TXY_cjs.SF_AFTER_ADD_LIQ,
|
|
33
|
+
SF_AFTER_REMOVE_LIQ: () => chunkO6FR7TXY_cjs.SF_AFTER_REMOVE_LIQ,
|
|
34
|
+
SF_AFTER_SWAP: () => chunkO6FR7TXY_cjs.SF_AFTER_SWAP,
|
|
35
|
+
SF_BEFORE_ADD_LIQ: () => chunkO6FR7TXY_cjs.SF_BEFORE_ADD_LIQ,
|
|
36
|
+
SF_BEFORE_REMOVE_LIQ: () => chunkO6FR7TXY_cjs.SF_BEFORE_REMOVE_LIQ,
|
|
37
|
+
SF_BEFORE_SWAP: () => chunkO6FR7TXY_cjs.SF_BEFORE_SWAP,
|
|
38
|
+
TOKEN_METADATA_PROGRAM_ID: () => chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
39
|
+
addLiquidityArgsCodec: () => chunkI5JME35L_cjs.addLiquidityArgsCodec,
|
|
40
|
+
ammConfigDataCodec: () => chunkI5JME35L_cjs.ammConfigDataCodec,
|
|
41
|
+
areMintsOrdered: () => chunkO6FR7TXY_cjs.areMintsOrdered,
|
|
42
|
+
calculateAccruedFees: () => chunkI5JME35L_cjs.calculateAccruedFees,
|
|
43
|
+
calculateTwap: () => chunkI5JME35L_cjs.calculateTwap,
|
|
44
|
+
calculateTwapNumber: () => chunkI5JME35L_cjs.calculateTwapNumber,
|
|
45
|
+
ceilDiv: () => chunkI5JME35L_cjs.ceilDiv,
|
|
46
|
+
collectFeesArgsCodec: () => chunkI5JME35L_cjs.collectFeesArgsCodec,
|
|
47
|
+
collectProtocolFeesArgsCodec: () => chunkI5JME35L_cjs.collectProtocolFeesArgsCodec,
|
|
48
|
+
comparePoolAndOraclePrices: () => chunkI5JME35L_cjs.comparePoolAndOraclePrices,
|
|
49
|
+
computePrice0Q64: () => chunkI5JME35L_cjs.computePrice0Q64,
|
|
50
|
+
computePrice1Q64: () => chunkI5JME35L_cjs.computePrice1Q64,
|
|
51
|
+
consultTwap: () => chunkI5JME35L_cjs.consultTwap,
|
|
52
52
|
createAddLiquidityInstruction: () => createAddLiquidityInstruction,
|
|
53
53
|
createClosePositionInstruction: () => createClosePositionInstruction,
|
|
54
|
-
createCollectFeesInstruction: () =>
|
|
54
|
+
createCollectFeesInstruction: () => chunkI5JME35L_cjs.createCollectFeesInstruction,
|
|
55
55
|
createCollectProtocolFeesInstruction: () => createCollectProtocolFeesInstruction,
|
|
56
56
|
createCreatePositionInstruction: () => createCreatePositionInstruction,
|
|
57
57
|
createInitializeConfigInstruction: () => createInitializeConfigInstruction,
|
|
@@ -60,7 +60,7 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
60
60
|
createOracleConsultInstruction: () => createOracleConsultInstruction,
|
|
61
61
|
createOracleUpdateInstruction: () => createOracleUpdateInstruction,
|
|
62
62
|
createPauseInstruction: () => createPauseInstruction,
|
|
63
|
-
createPositionArgsCodec: () =>
|
|
63
|
+
createPositionArgsCodec: () => chunkI5JME35L_cjs.createPositionArgsCodec,
|
|
64
64
|
createQuoteToNumeraireInstruction: () => createQuoteToNumeraireInstruction,
|
|
65
65
|
createRemoveLiquidityInstruction: () => createRemoveLiquidityInstruction,
|
|
66
66
|
createSetFeesInstruction: () => createSetFeesInstruction,
|
|
@@ -72,115 +72,117 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
|
|
|
72
72
|
createTransferAdminInstruction: () => createTransferAdminInstruction,
|
|
73
73
|
createUnpauseInstruction: () => createUnpauseInstruction,
|
|
74
74
|
curveParamsToMarketCap: () => curveParamsToMarketCap,
|
|
75
|
-
decodeAmmConfig: () =>
|
|
75
|
+
decodeAmmConfig: () => chunkI5JME35L_cjs.decodeAmmConfig,
|
|
76
76
|
decodeOracleConsultResult: () => decodeOracleConsultResult,
|
|
77
|
-
decodeOracleState: () =>
|
|
78
|
-
decodePool: () =>
|
|
79
|
-
decodePosition: () =>
|
|
77
|
+
decodeOracleState: () => chunkI5JME35L_cjs.decodeOracleState,
|
|
78
|
+
decodePool: () => chunkI5JME35L_cjs.decodePool,
|
|
79
|
+
decodePosition: () => chunkI5JME35L_cjs.decodePosition,
|
|
80
80
|
decodeQuoteToNumeraireResult: () => decodeQuoteToNumeraireResult,
|
|
81
|
-
encodeAddLiquidityArgs: () =>
|
|
82
|
-
encodeCollectFeesArgs: () =>
|
|
83
|
-
encodeCollectProtocolFeesArgs: () =>
|
|
84
|
-
encodeCreatePositionArgs: () =>
|
|
85
|
-
encodeInitializeConfigArgs: () =>
|
|
86
|
-
encodeInitializeOracleArgs: () =>
|
|
87
|
-
encodeInitializePoolArgs: () =>
|
|
88
|
-
encodeInstructionData: () =>
|
|
89
|
-
encodeOracleConsultArgs: () =>
|
|
90
|
-
encodeQuoteToNumeraireArgs: () =>
|
|
91
|
-
encodeRemoveLiquidityArgs: () =>
|
|
92
|
-
encodeSetFeesArgs: () =>
|
|
93
|
-
encodeSetRouteArgs: () =>
|
|
94
|
-
encodeSetSentinelArgs: () =>
|
|
95
|
-
encodeSwapExactInArgs: () =>
|
|
96
|
-
encodeTransferAdminArgs: () =>
|
|
97
|
-
fetchAllPools: () =>
|
|
81
|
+
encodeAddLiquidityArgs: () => chunkI5JME35L_cjs.encodeAddLiquidityArgs,
|
|
82
|
+
encodeCollectFeesArgs: () => chunkI5JME35L_cjs.encodeCollectFeesArgs,
|
|
83
|
+
encodeCollectProtocolFeesArgs: () => chunkI5JME35L_cjs.encodeCollectProtocolFeesArgs,
|
|
84
|
+
encodeCreatePositionArgs: () => chunkI5JME35L_cjs.encodeCreatePositionArgs,
|
|
85
|
+
encodeInitializeConfigArgs: () => chunkI5JME35L_cjs.encodeInitializeConfigArgs,
|
|
86
|
+
encodeInitializeOracleArgs: () => chunkI5JME35L_cjs.encodeInitializeOracleArgs,
|
|
87
|
+
encodeInitializePoolArgs: () => chunkI5JME35L_cjs.encodeInitializePoolArgs,
|
|
88
|
+
encodeInstructionData: () => chunkI5JME35L_cjs.encodeInstructionData,
|
|
89
|
+
encodeOracleConsultArgs: () => chunkI5JME35L_cjs.encodeOracleConsultArgs,
|
|
90
|
+
encodeQuoteToNumeraireArgs: () => chunkI5JME35L_cjs.encodeQuoteToNumeraireArgs,
|
|
91
|
+
encodeRemoveLiquidityArgs: () => chunkI5JME35L_cjs.encodeRemoveLiquidityArgs,
|
|
92
|
+
encodeSetFeesArgs: () => chunkI5JME35L_cjs.encodeSetFeesArgs,
|
|
93
|
+
encodeSetRouteArgs: () => chunkI5JME35L_cjs.encodeSetRouteArgs,
|
|
94
|
+
encodeSetSentinelArgs: () => chunkI5JME35L_cjs.encodeSetSentinelArgs,
|
|
95
|
+
encodeSwapExactInArgs: () => chunkI5JME35L_cjs.encodeSwapExactInArgs,
|
|
96
|
+
encodeTransferAdminArgs: () => chunkI5JME35L_cjs.encodeTransferAdminArgs,
|
|
97
|
+
fetchAllPools: () => chunkI5JME35L_cjs.fetchAllPools,
|
|
98
98
|
fetchConfig: () => fetchConfig,
|
|
99
99
|
fetchConfigWithAddress: () => fetchConfigWithAddress,
|
|
100
|
-
fetchOracle: () =>
|
|
101
|
-
fetchOraclesBatch: () =>
|
|
102
|
-
fetchPool: () =>
|
|
103
|
-
fetchPoolPositions: () =>
|
|
104
|
-
fetchPoolsBatch: () =>
|
|
105
|
-
fetchPosition: () =>
|
|
106
|
-
fetchPositionByParams: () =>
|
|
107
|
-
fetchPositionsBatch: () =>
|
|
108
|
-
fetchUserPositions: () =>
|
|
109
|
-
filterActivePositions: () =>
|
|
110
|
-
filterPoolsByMint: () =>
|
|
111
|
-
getAddLiquidityQuote: () =>
|
|
112
|
-
getConfigAddress: () =>
|
|
100
|
+
fetchOracle: () => chunkI5JME35L_cjs.fetchOracle,
|
|
101
|
+
fetchOraclesBatch: () => chunkI5JME35L_cjs.fetchOraclesBatch,
|
|
102
|
+
fetchPool: () => chunkI5JME35L_cjs.fetchPool,
|
|
103
|
+
fetchPoolPositions: () => chunkI5JME35L_cjs.fetchPoolPositions,
|
|
104
|
+
fetchPoolsBatch: () => chunkI5JME35L_cjs.fetchPoolsBatch,
|
|
105
|
+
fetchPosition: () => chunkI5JME35L_cjs.fetchPosition,
|
|
106
|
+
fetchPositionByParams: () => chunkI5JME35L_cjs.fetchPositionByParams,
|
|
107
|
+
fetchPositionsBatch: () => chunkI5JME35L_cjs.fetchPositionsBatch,
|
|
108
|
+
fetchUserPositions: () => chunkI5JME35L_cjs.fetchUserPositions,
|
|
109
|
+
filterActivePositions: () => chunkI5JME35L_cjs.filterActivePositions,
|
|
110
|
+
filterPoolsByMint: () => chunkI5JME35L_cjs.filterPoolsByMint,
|
|
111
|
+
getAddLiquidityQuote: () => chunkI5JME35L_cjs.getAddLiquidityQuote,
|
|
112
|
+
getConfigAddress: () => chunkO6FR7TXY_cjs.getConfigAddress,
|
|
113
113
|
getErrorMessage: () => getErrorMessage,
|
|
114
|
-
getK: () =>
|
|
115
|
-
getLiquidityAddresses: () =>
|
|
114
|
+
getK: () => chunkI5JME35L_cjs.getK,
|
|
115
|
+
getLiquidityAddresses: () => chunkO6FR7TXY_cjs.getLiquidityAddresses,
|
|
116
116
|
getMetadataAddress: () => getMetadataAddress,
|
|
117
|
-
getOracleAddress: () =>
|
|
118
|
-
getOracleAddressFromPool: () =>
|
|
119
|
-
getOracleAge: () =>
|
|
120
|
-
getOracleBufferStats: () =>
|
|
121
|
-
getOracleDeviation: () =>
|
|
122
|
-
getOracleForPool: () =>
|
|
123
|
-
getOracleSpotPrices: () =>
|
|
124
|
-
getPendingFees: () =>
|
|
125
|
-
getPoolAddress: () =>
|
|
126
|
-
getPoolAddressFromMints: () =>
|
|
127
|
-
getPoolAuthorityAddress: () =>
|
|
128
|
-
getPoolByMints: () =>
|
|
129
|
-
getPoolInitAddresses: () =>
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
117
|
+
getOracleAddress: () => chunkO6FR7TXY_cjs.getOracleAddress,
|
|
118
|
+
getOracleAddressFromPool: () => chunkI5JME35L_cjs.getOracleAddressFromPool,
|
|
119
|
+
getOracleAge: () => chunkI5JME35L_cjs.getOracleAge,
|
|
120
|
+
getOracleBufferStats: () => chunkI5JME35L_cjs.getOracleBufferStats,
|
|
121
|
+
getOracleDeviation: () => chunkI5JME35L_cjs.getOracleDeviation,
|
|
122
|
+
getOracleForPool: () => chunkI5JME35L_cjs.getOracleForPool,
|
|
123
|
+
getOracleSpotPrices: () => chunkI5JME35L_cjs.getOracleSpotPrices,
|
|
124
|
+
getPendingFees: () => chunkI5JME35L_cjs.getPendingFees,
|
|
125
|
+
getPoolAddress: () => chunkO6FR7TXY_cjs.getPoolAddress,
|
|
126
|
+
getPoolAddressFromMints: () => chunkI5JME35L_cjs.getPoolAddressFromMints,
|
|
127
|
+
getPoolAuthorityAddress: () => chunkO6FR7TXY_cjs.getPoolAuthorityAddress,
|
|
128
|
+
getPoolByMints: () => chunkI5JME35L_cjs.getPoolByMints,
|
|
129
|
+
getPoolInitAddresses: () => chunkO6FR7TXY_cjs.getPoolInitAddresses,
|
|
130
|
+
getPoolVault0Address: () => chunkO6FR7TXY_cjs.getPoolVault0Address,
|
|
131
|
+
getPoolVault1Address: () => chunkO6FR7TXY_cjs.getPoolVault1Address,
|
|
132
|
+
getPositionAddress: () => chunkO6FR7TXY_cjs.getPositionAddress,
|
|
133
|
+
getPositionAddressFromParams: () => chunkI5JME35L_cjs.getPositionAddressFromParams,
|
|
134
|
+
getPositionValue: () => chunkI5JME35L_cjs.getPositionValue,
|
|
135
|
+
getProtocolPositionAddress: () => chunkO6FR7TXY_cjs.getProtocolPositionAddress,
|
|
136
|
+
getRemoveLiquidityQuote: () => chunkI5JME35L_cjs.getRemoveLiquidityQuote,
|
|
137
|
+
getSpotPrice0: () => chunkI5JME35L_cjs.getSpotPrice0,
|
|
138
|
+
getSpotPrice1: () => chunkI5JME35L_cjs.getSpotPrice1,
|
|
139
|
+
getSwapAddresses: () => chunkO6FR7TXY_cjs.getSwapAddresses,
|
|
140
|
+
getSwapQuote: () => chunkI5JME35L_cjs.getSwapQuote,
|
|
141
|
+
getSwapQuoteExactOut: () => chunkI5JME35L_cjs.getSwapQuoteExactOut,
|
|
142
|
+
getTvl: () => chunkI5JME35L_cjs.getTvl,
|
|
143
|
+
initializeConfigArgsCodec: () => chunkI5JME35L_cjs.initializeConfigArgsCodec,
|
|
144
|
+
initializeOracleArgsCodec: () => chunkI5JME35L_cjs.initializeOracleArgsCodec,
|
|
145
|
+
initializePoolArgsCodec: () => chunkI5JME35L_cjs.initializePoolArgsCodec,
|
|
144
146
|
isCpmmError: () => isCpmmError,
|
|
145
|
-
isOracleStale: () =>
|
|
146
|
-
isqrt: () =>
|
|
147
|
+
isOracleStale: () => chunkI5JME35L_cjs.isOracleStale,
|
|
148
|
+
isqrt: () => chunkI5JME35L_cjs.isqrt,
|
|
147
149
|
marketCapToCurveParams: () => marketCapToCurveParams,
|
|
148
150
|
marketCapToSingleCurveParams: () => marketCapToSingleCurveParams,
|
|
149
151
|
marketCapToTokenPrice: () => marketCapToTokenPrice,
|
|
150
|
-
maxBigInt: () =>
|
|
151
|
-
minBigInt: () =>
|
|
152
|
-
numberToQ64: () =>
|
|
153
|
-
observationCodec: () =>
|
|
154
|
-
oracleConsultArgsCodec: () =>
|
|
155
|
-
oracleStateDataCodec: () =>
|
|
152
|
+
maxBigInt: () => chunkI5JME35L_cjs.maxBigInt,
|
|
153
|
+
minBigInt: () => chunkI5JME35L_cjs.minBigInt,
|
|
154
|
+
numberToQ64: () => chunkI5JME35L_cjs.numberToQ64,
|
|
155
|
+
observationCodec: () => chunkI5JME35L_cjs.observationCodec,
|
|
156
|
+
oracleConsultArgsCodec: () => chunkI5JME35L_cjs.oracleConsultArgsCodec,
|
|
157
|
+
oracleStateDataCodec: () => chunkI5JME35L_cjs.oracleStateDataCodec,
|
|
156
158
|
parseErrorFromLogs: () => parseErrorFromLogs,
|
|
157
|
-
poolDataCodec: () =>
|
|
158
|
-
poolExists: () =>
|
|
159
|
-
positionDataCodec: () =>
|
|
160
|
-
q64Div: () =>
|
|
161
|
-
q64Mul: () =>
|
|
162
|
-
q64ToNumber: () =>
|
|
163
|
-
quoteToNumeraireArgsCodec: () =>
|
|
164
|
-
ratioToNumber: () =>
|
|
165
|
-
removeLiquidityArgsCodec: () =>
|
|
166
|
-
setFeesArgsCodec: () =>
|
|
167
|
-
setRouteArgsCodec: () =>
|
|
168
|
-
setSentinelArgsCodec: () =>
|
|
169
|
-
sortMints: () =>
|
|
170
|
-
sortPoolsByReserves: () =>
|
|
171
|
-
sortPositionsByShares: () =>
|
|
172
|
-
swapExactInArgsCodec: () =>
|
|
173
|
-
transferAdminArgsCodec: () =>
|
|
159
|
+
poolDataCodec: () => chunkI5JME35L_cjs.poolDataCodec,
|
|
160
|
+
poolExists: () => chunkI5JME35L_cjs.poolExists,
|
|
161
|
+
positionDataCodec: () => chunkI5JME35L_cjs.positionDataCodec,
|
|
162
|
+
q64Div: () => chunkI5JME35L_cjs.q64Div,
|
|
163
|
+
q64Mul: () => chunkI5JME35L_cjs.q64Mul,
|
|
164
|
+
q64ToNumber: () => chunkI5JME35L_cjs.q64ToNumber,
|
|
165
|
+
quoteToNumeraireArgsCodec: () => chunkI5JME35L_cjs.quoteToNumeraireArgsCodec,
|
|
166
|
+
ratioToNumber: () => chunkI5JME35L_cjs.ratioToNumber,
|
|
167
|
+
removeLiquidityArgsCodec: () => chunkI5JME35L_cjs.removeLiquidityArgsCodec,
|
|
168
|
+
setFeesArgsCodec: () => chunkI5JME35L_cjs.setFeesArgsCodec,
|
|
169
|
+
setRouteArgsCodec: () => chunkI5JME35L_cjs.setRouteArgsCodec,
|
|
170
|
+
setSentinelArgsCodec: () => chunkI5JME35L_cjs.setSentinelArgsCodec,
|
|
171
|
+
sortMints: () => chunkO6FR7TXY_cjs.sortMints,
|
|
172
|
+
sortPoolsByReserves: () => chunkI5JME35L_cjs.sortPoolsByReserves,
|
|
173
|
+
sortPositionsByShares: () => chunkI5JME35L_cjs.sortPositionsByShares,
|
|
174
|
+
swapExactInArgsCodec: () => chunkI5JME35L_cjs.swapExactInArgsCodec,
|
|
175
|
+
transferAdminArgsCodec: () => chunkI5JME35L_cjs.transferAdminArgsCodec,
|
|
174
176
|
validateMarketCapParameters: () => validateMarketCapParameters
|
|
175
177
|
});
|
|
176
178
|
var addressCodec = kit.getAddressCodec();
|
|
177
179
|
var textEncoder = new TextEncoder();
|
|
178
180
|
async function getMetadataAddress(mint) {
|
|
179
181
|
return kit.getProgramDerivedAddress({
|
|
180
|
-
programAddress:
|
|
182
|
+
programAddress: chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
181
183
|
seeds: [
|
|
182
184
|
textEncoder.encode("metadata"),
|
|
183
|
-
addressCodec.encode(
|
|
185
|
+
addressCodec.encode(chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
184
186
|
addressCodec.encode(mint)
|
|
185
187
|
]
|
|
186
188
|
});
|
|
@@ -468,16 +470,16 @@ function getErrorMessage(code) {
|
|
|
468
470
|
}
|
|
469
471
|
return `Unknown error code: ${code}`;
|
|
470
472
|
}
|
|
471
|
-
function createInitializeConfigInstruction(accounts, args, programId =
|
|
472
|
-
const { config, payer, systemProgram =
|
|
473
|
+
function createInitializeConfigInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
474
|
+
const { config, payer, systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS } = accounts;
|
|
473
475
|
const keys = [
|
|
474
476
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
475
477
|
{ address: payer, role: kit.AccountRole.WRITABLE_SIGNER },
|
|
476
478
|
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
477
479
|
];
|
|
478
|
-
const data =
|
|
479
|
-
|
|
480
|
-
|
|
480
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
481
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.initializeConfig,
|
|
482
|
+
chunkI5JME35L_cjs.initializeConfigArgsCodec,
|
|
481
483
|
args
|
|
482
484
|
);
|
|
483
485
|
return {
|
|
@@ -499,7 +501,7 @@ function createSignerAccountMeta(value, role) {
|
|
|
499
501
|
}
|
|
500
502
|
return { address: value, role };
|
|
501
503
|
}
|
|
502
|
-
function createInitializePoolInstruction(accounts, args, programId =
|
|
504
|
+
function createInitializePoolInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
503
505
|
const {
|
|
504
506
|
config,
|
|
505
507
|
pool,
|
|
@@ -510,27 +512,34 @@ function createInitializePoolInstruction(accounts, args, programId = chunkDPKVNI
|
|
|
510
512
|
token0Mint,
|
|
511
513
|
token1Mint,
|
|
512
514
|
payer,
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
515
|
+
token0Program,
|
|
516
|
+
token1Program,
|
|
517
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
518
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
519
|
+
rent,
|
|
520
|
+
migrationAuthority
|
|
516
521
|
} = accounts;
|
|
522
|
+
const resolvedToken0Program = token0Program ?? tokenProgram;
|
|
523
|
+
const resolvedToken1Program = token1Program ?? tokenProgram;
|
|
517
524
|
const keys = [
|
|
518
525
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
519
526
|
{ address: pool, role: kit.AccountRole.WRITABLE },
|
|
520
527
|
{ address: protocolPosition, role: kit.AccountRole.WRITABLE },
|
|
521
528
|
{ address: authority, role: kit.AccountRole.READONLY },
|
|
522
|
-
|
|
523
|
-
|
|
529
|
+
{ address: vault0, role: kit.AccountRole.WRITABLE },
|
|
530
|
+
{ address: vault1, role: kit.AccountRole.WRITABLE },
|
|
524
531
|
{ address: token0Mint, role: kit.AccountRole.READONLY },
|
|
525
532
|
{ address: token1Mint, role: kit.AccountRole.READONLY },
|
|
526
533
|
createSignerAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
527
|
-
{ address:
|
|
534
|
+
{ address: resolvedToken0Program, role: kit.AccountRole.READONLY },
|
|
535
|
+
{ address: resolvedToken1Program, role: kit.AccountRole.READONLY },
|
|
528
536
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
529
|
-
{ address: rent, role: kit.AccountRole.READONLY }
|
|
537
|
+
{ address: rent, role: kit.AccountRole.READONLY },
|
|
538
|
+
createSignerAccountMeta(migrationAuthority, kit.AccountRole.READONLY_SIGNER)
|
|
530
539
|
];
|
|
531
|
-
const data =
|
|
532
|
-
|
|
533
|
-
|
|
540
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
541
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.initializePool,
|
|
542
|
+
chunkI5JME35L_cjs.initializePoolArgsCodec,
|
|
534
543
|
args
|
|
535
544
|
);
|
|
536
545
|
return {
|
|
@@ -539,14 +548,14 @@ function createInitializePoolInstruction(accounts, args, programId = chunkDPKVNI
|
|
|
539
548
|
data
|
|
540
549
|
};
|
|
541
550
|
}
|
|
542
|
-
function createInitializeOracleInstruction(accounts, args, programId =
|
|
551
|
+
function createInitializeOracleInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
543
552
|
const {
|
|
544
553
|
config,
|
|
545
554
|
pool,
|
|
546
555
|
oracle,
|
|
547
556
|
admin,
|
|
548
557
|
payer,
|
|
549
|
-
systemProgram =
|
|
558
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
550
559
|
} = accounts;
|
|
551
560
|
const keys = [
|
|
552
561
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -556,9 +565,9 @@ function createInitializeOracleInstruction(accounts, args, programId = chunkDPKV
|
|
|
556
565
|
{ address: payer, role: kit.AccountRole.WRITABLE_SIGNER },
|
|
557
566
|
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
558
567
|
];
|
|
559
|
-
const data =
|
|
560
|
-
|
|
561
|
-
|
|
568
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
569
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.initializeOracle,
|
|
570
|
+
chunkI5JME35L_cjs.initializeOracleArgsCodec,
|
|
562
571
|
args
|
|
563
572
|
);
|
|
564
573
|
return {
|
|
@@ -567,16 +576,16 @@ function createInitializeOracleInstruction(accounts, args, programId = chunkDPKV
|
|
|
567
576
|
data
|
|
568
577
|
};
|
|
569
578
|
}
|
|
570
|
-
function createSetFeesInstruction(accounts, args, programId =
|
|
579
|
+
function createSetFeesInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
571
580
|
const { config, pool, admin } = accounts;
|
|
572
581
|
const keys = [
|
|
573
582
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
574
583
|
{ address: pool, role: kit.AccountRole.WRITABLE },
|
|
575
584
|
{ address: admin, role: kit.AccountRole.READONLY_SIGNER }
|
|
576
585
|
];
|
|
577
|
-
const data =
|
|
578
|
-
|
|
579
|
-
|
|
586
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
587
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.setFees,
|
|
588
|
+
chunkI5JME35L_cjs.setFeesArgsCodec,
|
|
580
589
|
args
|
|
581
590
|
);
|
|
582
591
|
return {
|
|
@@ -585,16 +594,16 @@ function createSetFeesInstruction(accounts, args, programId = chunkDPKVNI6Q_cjs.
|
|
|
585
594
|
data
|
|
586
595
|
};
|
|
587
596
|
}
|
|
588
|
-
function createSetSentinelInstruction(accounts, args, programId =
|
|
597
|
+
function createSetSentinelInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
589
598
|
const { config, pool, admin } = accounts;
|
|
590
599
|
const keys = [
|
|
591
600
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
592
601
|
{ address: pool, role: kit.AccountRole.WRITABLE },
|
|
593
602
|
{ address: admin, role: kit.AccountRole.READONLY_SIGNER }
|
|
594
603
|
];
|
|
595
|
-
const data =
|
|
596
|
-
|
|
597
|
-
|
|
604
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
605
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.setSentinel,
|
|
606
|
+
chunkI5JME35L_cjs.setSentinelArgsCodec,
|
|
598
607
|
args
|
|
599
608
|
);
|
|
600
609
|
return {
|
|
@@ -603,7 +612,7 @@ function createSetSentinelInstruction(accounts, args, programId = chunkDPKVNI6Q_
|
|
|
603
612
|
data
|
|
604
613
|
};
|
|
605
614
|
}
|
|
606
|
-
function createSetRouteInstruction(accounts, args, programId =
|
|
615
|
+
function createSetRouteInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
607
616
|
const { config, pool, nextPool, admin } = accounts;
|
|
608
617
|
const keys = [
|
|
609
618
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -613,9 +622,9 @@ function createSetRouteInstruction(accounts, args, programId = chunkDPKVNI6Q_cjs
|
|
|
613
622
|
keys.push({ address: nextPool, role: kit.AccountRole.READONLY });
|
|
614
623
|
}
|
|
615
624
|
keys.push({ address: admin, role: kit.AccountRole.READONLY_SIGNER });
|
|
616
|
-
const data =
|
|
617
|
-
|
|
618
|
-
|
|
625
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
626
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.setRoute,
|
|
627
|
+
chunkI5JME35L_cjs.setRouteArgsCodec,
|
|
619
628
|
args
|
|
620
629
|
);
|
|
621
630
|
return {
|
|
@@ -624,41 +633,41 @@ function createSetRouteInstruction(accounts, args, programId = chunkDPKVNI6Q_cjs
|
|
|
624
633
|
data
|
|
625
634
|
};
|
|
626
635
|
}
|
|
627
|
-
function createPauseInstruction(accounts, programId =
|
|
636
|
+
function createPauseInstruction(accounts, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
628
637
|
const { config, admin } = accounts;
|
|
629
638
|
const keys = [
|
|
630
639
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
631
640
|
{ address: admin, role: kit.AccountRole.READONLY_SIGNER }
|
|
632
641
|
];
|
|
633
|
-
const data =
|
|
642
|
+
const data = chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.pause;
|
|
634
643
|
return {
|
|
635
644
|
programAddress: programId,
|
|
636
645
|
accounts: keys,
|
|
637
646
|
data
|
|
638
647
|
};
|
|
639
648
|
}
|
|
640
|
-
function createUnpauseInstruction(accounts, programId =
|
|
649
|
+
function createUnpauseInstruction(accounts, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
641
650
|
const { config, admin } = accounts;
|
|
642
651
|
const keys = [
|
|
643
652
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
644
653
|
{ address: admin, role: kit.AccountRole.READONLY_SIGNER }
|
|
645
654
|
];
|
|
646
|
-
const data =
|
|
655
|
+
const data = chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.unpause;
|
|
647
656
|
return {
|
|
648
657
|
programAddress: programId,
|
|
649
658
|
accounts: keys,
|
|
650
659
|
data
|
|
651
660
|
};
|
|
652
661
|
}
|
|
653
|
-
function createTransferAdminInstruction(accounts, args, programId =
|
|
662
|
+
function createTransferAdminInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
654
663
|
const { config, admin } = accounts;
|
|
655
664
|
const keys = [
|
|
656
665
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
657
666
|
{ address: admin, role: kit.AccountRole.READONLY_SIGNER }
|
|
658
667
|
];
|
|
659
|
-
const data =
|
|
660
|
-
|
|
661
|
-
|
|
668
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
669
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.transferAdmin,
|
|
670
|
+
chunkI5JME35L_cjs.transferAdminArgsCodec,
|
|
662
671
|
args
|
|
663
672
|
);
|
|
664
673
|
return {
|
|
@@ -667,7 +676,7 @@ function createTransferAdminInstruction(accounts, args, programId = chunkDPKVNI6
|
|
|
667
676
|
data
|
|
668
677
|
};
|
|
669
678
|
}
|
|
670
|
-
function createSkimInstruction(accounts, programId =
|
|
679
|
+
function createSkimInstruction(accounts, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
671
680
|
const {
|
|
672
681
|
config,
|
|
673
682
|
pool,
|
|
@@ -679,7 +688,7 @@ function createSkimInstruction(accounts, programId = chunkDPKVNI6Q_cjs.CPMM_PROG
|
|
|
679
688
|
token1Mint,
|
|
680
689
|
adminAta0,
|
|
681
690
|
adminAta1,
|
|
682
|
-
tokenProgram =
|
|
691
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS
|
|
683
692
|
} = accounts;
|
|
684
693
|
const keys = [
|
|
685
694
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -694,14 +703,14 @@ function createSkimInstruction(accounts, programId = chunkDPKVNI6Q_cjs.CPMM_PROG
|
|
|
694
703
|
{ address: adminAta1, role: kit.AccountRole.WRITABLE },
|
|
695
704
|
{ address: tokenProgram, role: kit.AccountRole.READONLY }
|
|
696
705
|
];
|
|
697
|
-
const data =
|
|
706
|
+
const data = chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.skim;
|
|
698
707
|
return {
|
|
699
708
|
programAddress: programId,
|
|
700
709
|
accounts: keys,
|
|
701
710
|
data
|
|
702
711
|
};
|
|
703
712
|
}
|
|
704
|
-
function createSwapExactInInstruction(accounts, args, programId =
|
|
713
|
+
function createSwapExactInInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
705
714
|
const {
|
|
706
715
|
config,
|
|
707
716
|
pool,
|
|
@@ -713,10 +722,15 @@ function createSwapExactInInstruction(accounts, args, programId = chunkDPKVNI6Q_
|
|
|
713
722
|
userIn,
|
|
714
723
|
userOut,
|
|
715
724
|
user,
|
|
716
|
-
|
|
725
|
+
token0Program,
|
|
726
|
+
token1Program,
|
|
727
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
728
|
+
instructionsSysvar = chunkO6FR7TXY_cjs.SYSVAR_INSTRUCTIONS_ADDRESS,
|
|
717
729
|
oracle,
|
|
718
730
|
remainingAccounts = []
|
|
719
731
|
} = accounts;
|
|
732
|
+
const resolvedToken0Program = token0Program ?? tokenProgram;
|
|
733
|
+
const resolvedToken1Program = token1Program ?? tokenProgram;
|
|
720
734
|
const keys = [
|
|
721
735
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
722
736
|
{ address: pool, role: kit.AccountRole.WRITABLE },
|
|
@@ -728,7 +742,9 @@ function createSwapExactInInstruction(accounts, args, programId = chunkDPKVNI6Q_
|
|
|
728
742
|
{ address: userIn, role: kit.AccountRole.WRITABLE },
|
|
729
743
|
{ address: userOut, role: kit.AccountRole.WRITABLE },
|
|
730
744
|
{ address: user, role: kit.AccountRole.READONLY_SIGNER },
|
|
731
|
-
{ address:
|
|
745
|
+
{ address: resolvedToken0Program, role: kit.AccountRole.READONLY },
|
|
746
|
+
{ address: resolvedToken1Program, role: kit.AccountRole.READONLY },
|
|
747
|
+
{ address: instructionsSysvar, role: kit.AccountRole.READONLY }
|
|
732
748
|
];
|
|
733
749
|
if (oracle) {
|
|
734
750
|
keys.push({ address: oracle, role: kit.AccountRole.WRITABLE });
|
|
@@ -736,9 +752,9 @@ function createSwapExactInInstruction(accounts, args, programId = chunkDPKVNI6Q_
|
|
|
736
752
|
for (const account of remainingAccounts) {
|
|
737
753
|
keys.push({ address: account, role: kit.AccountRole.READONLY });
|
|
738
754
|
}
|
|
739
|
-
const data =
|
|
740
|
-
|
|
741
|
-
|
|
755
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
756
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.swapExactIn,
|
|
757
|
+
chunkI5JME35L_cjs.swapExactInArgsCodec,
|
|
742
758
|
args
|
|
743
759
|
);
|
|
744
760
|
return {
|
|
@@ -765,7 +781,11 @@ function createSwapInstruction(params) {
|
|
|
765
781
|
oracle,
|
|
766
782
|
remainingAccounts,
|
|
767
783
|
updateOracle = false,
|
|
768
|
-
|
|
784
|
+
token0Program,
|
|
785
|
+
token1Program,
|
|
786
|
+
tokenProgram,
|
|
787
|
+
instructionsSysvar,
|
|
788
|
+
programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID
|
|
769
789
|
} = params;
|
|
770
790
|
const [vaultIn, vaultOut] = direction === 0 ? [vault0, vault1] : [vault1, vault0];
|
|
771
791
|
const [userIn, userOut] = direction === 0 ? [userToken0, userToken1] : [userToken1, userToken0];
|
|
@@ -781,6 +801,10 @@ function createSwapInstruction(params) {
|
|
|
781
801
|
userIn,
|
|
782
802
|
userOut,
|
|
783
803
|
user,
|
|
804
|
+
token0Program,
|
|
805
|
+
token1Program,
|
|
806
|
+
tokenProgram,
|
|
807
|
+
instructionsSysvar,
|
|
784
808
|
oracle,
|
|
785
809
|
remainingAccounts
|
|
786
810
|
},
|
|
@@ -793,13 +817,13 @@ function createSwapInstruction(params) {
|
|
|
793
817
|
programId
|
|
794
818
|
);
|
|
795
819
|
}
|
|
796
|
-
function createCreatePositionInstruction(accounts, args, programId =
|
|
820
|
+
function createCreatePositionInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
797
821
|
const {
|
|
798
822
|
pool,
|
|
799
823
|
position,
|
|
800
824
|
owner,
|
|
801
825
|
payer,
|
|
802
|
-
systemProgram =
|
|
826
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
803
827
|
} = accounts;
|
|
804
828
|
const keys = [
|
|
805
829
|
{ address: pool, role: kit.AccountRole.READONLY },
|
|
@@ -808,9 +832,9 @@ function createCreatePositionInstruction(accounts, args, programId = chunkDPKVNI
|
|
|
808
832
|
{ address: payer, role: kit.AccountRole.WRITABLE_SIGNER },
|
|
809
833
|
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
810
834
|
];
|
|
811
|
-
const data =
|
|
812
|
-
|
|
813
|
-
|
|
835
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
836
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.createPosition,
|
|
837
|
+
chunkI5JME35L_cjs.createPositionArgsCodec,
|
|
814
838
|
args
|
|
815
839
|
);
|
|
816
840
|
return {
|
|
@@ -819,7 +843,7 @@ function createCreatePositionInstruction(accounts, args, programId = chunkDPKVNI
|
|
|
819
843
|
data
|
|
820
844
|
};
|
|
821
845
|
}
|
|
822
|
-
function createClosePositionInstruction(accounts, programId =
|
|
846
|
+
function createClosePositionInstruction(accounts, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
823
847
|
const { pool, position, owner, rentRecipient } = accounts;
|
|
824
848
|
const keys = [
|
|
825
849
|
{ address: pool, role: kit.AccountRole.READONLY },
|
|
@@ -827,7 +851,7 @@ function createClosePositionInstruction(accounts, programId = chunkDPKVNI6Q_cjs.
|
|
|
827
851
|
{ address: owner, role: kit.AccountRole.READONLY_SIGNER },
|
|
828
852
|
{ address: rentRecipient, role: kit.AccountRole.WRITABLE }
|
|
829
853
|
];
|
|
830
|
-
const data =
|
|
854
|
+
const data = chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.closePosition;
|
|
831
855
|
return {
|
|
832
856
|
programAddress: programId,
|
|
833
857
|
accounts: keys,
|
|
@@ -840,7 +864,7 @@ var addLiquidityArgsWithOracleCodec = kit.getStructCodec([
|
|
|
840
864
|
["minSharesOut", kit.getU128Codec()],
|
|
841
865
|
["updateOracle", kit.getBooleanCodec()]
|
|
842
866
|
]);
|
|
843
|
-
function createAddLiquidityInstruction(accounts, args, programId =
|
|
867
|
+
function createAddLiquidityInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
844
868
|
const {
|
|
845
869
|
config,
|
|
846
870
|
pool,
|
|
@@ -854,7 +878,7 @@ function createAddLiquidityInstruction(accounts, args, programId = chunkDPKVNI6Q
|
|
|
854
878
|
token1Mint,
|
|
855
879
|
user0,
|
|
856
880
|
user1,
|
|
857
|
-
tokenProgram =
|
|
881
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
858
882
|
oracle,
|
|
859
883
|
remainingAccounts = []
|
|
860
884
|
} = accounts;
|
|
@@ -879,8 +903,8 @@ function createAddLiquidityInstruction(accounts, args, programId = chunkDPKVNI6Q
|
|
|
879
903
|
for (const account of remainingAccounts) {
|
|
880
904
|
keys.push({ address: account, role: kit.AccountRole.READONLY });
|
|
881
905
|
}
|
|
882
|
-
const data =
|
|
883
|
-
|
|
906
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
907
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.addLiquidity,
|
|
884
908
|
addLiquidityArgsWithOracleCodec,
|
|
885
909
|
args
|
|
886
910
|
);
|
|
@@ -890,7 +914,7 @@ function createAddLiquidityInstruction(accounts, args, programId = chunkDPKVNI6Q
|
|
|
890
914
|
data
|
|
891
915
|
};
|
|
892
916
|
}
|
|
893
|
-
function createRemoveLiquidityInstruction(accounts, args, programId =
|
|
917
|
+
function createRemoveLiquidityInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
894
918
|
const {
|
|
895
919
|
config,
|
|
896
920
|
pool,
|
|
@@ -904,7 +928,7 @@ function createRemoveLiquidityInstruction(accounts, args, programId = chunkDPKVN
|
|
|
904
928
|
token1Mint,
|
|
905
929
|
user0,
|
|
906
930
|
user1,
|
|
907
|
-
tokenProgram =
|
|
931
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
908
932
|
oracle,
|
|
909
933
|
remainingAccounts = []
|
|
910
934
|
} = accounts;
|
|
@@ -929,9 +953,9 @@ function createRemoveLiquidityInstruction(accounts, args, programId = chunkDPKVN
|
|
|
929
953
|
for (const account of remainingAccounts) {
|
|
930
954
|
keys.push({ address: account, role: kit.AccountRole.READONLY });
|
|
931
955
|
}
|
|
932
|
-
const data =
|
|
933
|
-
|
|
934
|
-
|
|
956
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
957
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.removeLiquidity,
|
|
958
|
+
chunkI5JME35L_cjs.removeLiquidityArgsCodec,
|
|
935
959
|
args
|
|
936
960
|
);
|
|
937
961
|
return {
|
|
@@ -940,7 +964,7 @@ function createRemoveLiquidityInstruction(accounts, args, programId = chunkDPKVN
|
|
|
940
964
|
data
|
|
941
965
|
};
|
|
942
966
|
}
|
|
943
|
-
function createCollectProtocolFeesInstruction(accounts, args, programId =
|
|
967
|
+
function createCollectProtocolFeesInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
944
968
|
const {
|
|
945
969
|
config,
|
|
946
970
|
pool,
|
|
@@ -953,7 +977,7 @@ function createCollectProtocolFeesInstruction(accounts, args, programId = chunkD
|
|
|
953
977
|
token1Mint,
|
|
954
978
|
recipient0,
|
|
955
979
|
recipient1,
|
|
956
|
-
tokenProgram =
|
|
980
|
+
tokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS
|
|
957
981
|
} = accounts;
|
|
958
982
|
const keys = [
|
|
959
983
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -969,9 +993,9 @@ function createCollectProtocolFeesInstruction(accounts, args, programId = chunkD
|
|
|
969
993
|
{ address: recipient1, role: kit.AccountRole.WRITABLE },
|
|
970
994
|
{ address: tokenProgram, role: kit.AccountRole.READONLY }
|
|
971
995
|
];
|
|
972
|
-
const data =
|
|
973
|
-
|
|
974
|
-
|
|
996
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
997
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.collectProtocolFees,
|
|
998
|
+
chunkI5JME35L_cjs.collectProtocolFeesArgsCodec,
|
|
975
999
|
args
|
|
976
1000
|
);
|
|
977
1001
|
return {
|
|
@@ -980,13 +1004,13 @@ function createCollectProtocolFeesInstruction(accounts, args, programId = chunkD
|
|
|
980
1004
|
data
|
|
981
1005
|
};
|
|
982
1006
|
}
|
|
983
|
-
function createOracleUpdateInstruction(accounts, programId =
|
|
1007
|
+
function createOracleUpdateInstruction(accounts, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
984
1008
|
const { pool, oracle } = accounts;
|
|
985
1009
|
const keys = [
|
|
986
1010
|
{ address: pool, role: kit.AccountRole.READONLY },
|
|
987
1011
|
{ address: oracle, role: kit.AccountRole.WRITABLE }
|
|
988
1012
|
];
|
|
989
|
-
const data =
|
|
1013
|
+
const data = chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.oracleUpdate;
|
|
990
1014
|
return {
|
|
991
1015
|
programAddress: programId,
|
|
992
1016
|
accounts: keys,
|
|
@@ -1000,15 +1024,15 @@ var oracleConsultResultCodec = kit.getStructCodec([
|
|
|
1000
1024
|
function decodeOracleConsultResult(data) {
|
|
1001
1025
|
return oracleConsultResultCodec.decode(data);
|
|
1002
1026
|
}
|
|
1003
|
-
function createOracleConsultInstruction(accounts, args, programId =
|
|
1027
|
+
function createOracleConsultInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
1004
1028
|
const { pool, oracle } = accounts;
|
|
1005
1029
|
const keys = [
|
|
1006
1030
|
{ address: pool, role: kit.AccountRole.READONLY },
|
|
1007
1031
|
{ address: oracle, role: kit.AccountRole.READONLY }
|
|
1008
1032
|
];
|
|
1009
|
-
const data =
|
|
1010
|
-
|
|
1011
|
-
|
|
1033
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
1034
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.oracleConsult,
|
|
1035
|
+
chunkI5JME35L_cjs.oracleConsultArgsCodec,
|
|
1012
1036
|
args
|
|
1013
1037
|
);
|
|
1014
1038
|
return {
|
|
@@ -1025,7 +1049,7 @@ var quoteToNumeraireResultCodec = kit.getStructCodec([
|
|
|
1025
1049
|
function decodeQuoteToNumeraireResult(data) {
|
|
1026
1050
|
return quoteToNumeraireResultCodec.decode(data);
|
|
1027
1051
|
}
|
|
1028
|
-
function createQuoteToNumeraireInstruction(accounts, args, programId =
|
|
1052
|
+
function createQuoteToNumeraireInstruction(accounts, args, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID) {
|
|
1029
1053
|
const { config, startPool, remainingAccounts = [] } = accounts;
|
|
1030
1054
|
const keys = [
|
|
1031
1055
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -1034,9 +1058,9 @@ function createQuoteToNumeraireInstruction(accounts, args, programId = chunkDPKV
|
|
|
1034
1058
|
for (const account of remainingAccounts) {
|
|
1035
1059
|
keys.push({ address: account, role: kit.AccountRole.READONLY });
|
|
1036
1060
|
}
|
|
1037
|
-
const data =
|
|
1038
|
-
|
|
1039
|
-
|
|
1061
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
1062
|
+
chunkO6FR7TXY_cjs.INSTRUCTION_DISCRIMINATORS.quoteToNumeraire,
|
|
1063
|
+
chunkI5JME35L_cjs.quoteToNumeraireArgsCodec,
|
|
1040
1064
|
args
|
|
1041
1065
|
);
|
|
1042
1066
|
return {
|
|
@@ -1055,8 +1079,8 @@ function base64ToBytes(base64) {
|
|
|
1055
1079
|
}
|
|
1056
1080
|
return bytes;
|
|
1057
1081
|
}
|
|
1058
|
-
async function fetchConfig(rpc, programId =
|
|
1059
|
-
const [configAddress] = await
|
|
1082
|
+
async function fetchConfig(rpc, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
1083
|
+
const [configAddress] = await chunkO6FR7TXY_cjs.getConfigAddress(programId);
|
|
1060
1084
|
const response = await rpc.getAccountInfo(configAddress, {
|
|
1061
1085
|
encoding: "base64",
|
|
1062
1086
|
commitment
|
|
@@ -1064,10 +1088,10 @@ async function fetchConfig(rpc, programId = chunkDPKVNI6Q_cjs.CPMM_PROGRAM_ID, c
|
|
|
1064
1088
|
if (!response.value) {
|
|
1065
1089
|
return null;
|
|
1066
1090
|
}
|
|
1067
|
-
return
|
|
1091
|
+
return chunkI5JME35L_cjs.decodeAmmConfig(base64ToBytes(response.value.data[0]));
|
|
1068
1092
|
}
|
|
1069
|
-
async function fetchConfigWithAddress(rpc, programId =
|
|
1070
|
-
const [configAddress] = await
|
|
1093
|
+
async function fetchConfigWithAddress(rpc, programId = chunkO6FR7TXY_cjs.CPMM_PROGRAM_ID, commitment) {
|
|
1094
|
+
const [configAddress] = await chunkO6FR7TXY_cjs.getConfigAddress(programId);
|
|
1071
1095
|
const account = await fetchConfig(rpc, programId, commitment);
|
|
1072
1096
|
if (!account) {
|
|
1073
1097
|
return null;
|
|
@@ -1103,7 +1127,6 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
|
|
|
1103
1127
|
SF_AFTER_SWAP: () => SF_AFTER_SWAP2,
|
|
1104
1128
|
SF_BEFORE_SWAP: () => SF_BEFORE_SWAP2,
|
|
1105
1129
|
computeRemainingAccountsHash: () => computeRemainingAccountsHash,
|
|
1106
|
-
createAbortLaunchInstruction: () => createAbortLaunchInstruction,
|
|
1107
1130
|
createCurveSwapExactInInstruction: () => createCurveSwapExactInInstruction,
|
|
1108
1131
|
createInitializeConfigInstruction: () => createInitializeConfigInstruction2,
|
|
1109
1132
|
createInitializeLaunchInstruction: () => createInitializeLaunchInstruction,
|
|
@@ -1151,9 +1174,9 @@ var CPMM_SENTINEL_PROGRAM_ID = kit.address(
|
|
|
1151
1174
|
var PREDICTION_SENTINEL_PROGRAM_ID = kit.address(
|
|
1152
1175
|
"7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB"
|
|
1153
1176
|
);
|
|
1154
|
-
var SEED_CONFIG2 = "
|
|
1155
|
-
var SEED_LAUNCH = "
|
|
1156
|
-
var SEED_LAUNCH_AUTHORITY = "
|
|
1177
|
+
var SEED_CONFIG2 = "config";
|
|
1178
|
+
var SEED_LAUNCH = "launch";
|
|
1179
|
+
var SEED_LAUNCH_AUTHORITY = "launch_authority";
|
|
1157
1180
|
var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
|
|
1158
1181
|
232,
|
|
1159
1182
|
231,
|
|
@@ -1271,8 +1294,6 @@ var INITIALIZER_INSTRUCTION_DISCRIMINATORS = {
|
|
|
1271
1294
|
12,
|
|
1272
1295
|
205
|
|
1273
1296
|
]),
|
|
1274
|
-
// SHA256("global:abort_launch")[0:8]
|
|
1275
|
-
abortLaunch: new Uint8Array([44, 112, 192, 235, 227, 61, 179, 7]),
|
|
1276
1297
|
// SHA256("global:preview_swap_exact_in")[0:8]
|
|
1277
1298
|
previewSwapExactIn: new Uint8Array([
|
|
1278
1299
|
50,
|
|
@@ -1776,13 +1797,15 @@ function createInitializeConfigInstruction2(accounts, args, programId = INITIALI
|
|
|
1776
1797
|
admin,
|
|
1777
1798
|
config,
|
|
1778
1799
|
programData,
|
|
1779
|
-
systemProgram =
|
|
1800
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
1801
|
+
instructionsSysvar = chunkO6FR7TXY_cjs.SYSVAR_INSTRUCTIONS_ADDRESS
|
|
1780
1802
|
} = accounts;
|
|
1781
1803
|
const keys = [
|
|
1782
1804
|
createSignerAccountMeta2(admin, kit.AccountRole.WRITABLE_SIGNER),
|
|
1783
1805
|
{ address: config, role: kit.AccountRole.WRITABLE },
|
|
1784
1806
|
{ address: programData, role: kit.AccountRole.READONLY },
|
|
1785
|
-
{ address: systemProgram, role: kit.AccountRole.READONLY }
|
|
1807
|
+
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
1808
|
+
{ address: instructionsSysvar, role: kit.AccountRole.READONLY }
|
|
1786
1809
|
];
|
|
1787
1810
|
const data = new Uint8Array(
|
|
1788
1811
|
getInitializeConfigInstructionDataEncoder().encode(args)
|
|
@@ -1833,6 +1856,7 @@ var CPMM_MIGRATOR_PROGRAM_ID = kit.address(
|
|
|
1833
1856
|
"7WMUTNC41eMCo6eGH5Sy2xbgE3AycvLbFPo95AU9CSUd"
|
|
1834
1857
|
);
|
|
1835
1858
|
var SEED_STATE = "state";
|
|
1859
|
+
var SEED_MIGRATION_AUTHORITY = "migration_authority";
|
|
1836
1860
|
var MAX_RECIPIENTS = 2;
|
|
1837
1861
|
var CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS = {
|
|
1838
1862
|
// SHA256("global:register_launch")[0:8]
|
|
@@ -1870,6 +1894,12 @@ async function getCpmmMigratorStateAddress(launch, programId = CPMM_MIGRATOR_PRO
|
|
|
1870
1894
|
seeds: [textEncoder3.encode(SEED_STATE), addressCodec3.encode(launch)]
|
|
1871
1895
|
});
|
|
1872
1896
|
}
|
|
1897
|
+
async function getCpmmMigrationAuthorityAddress(programId = CPMM_MIGRATOR_PROGRAM_ID) {
|
|
1898
|
+
return kit.getProgramDerivedAddress({
|
|
1899
|
+
programAddress: programId,
|
|
1900
|
+
seeds: [textEncoder3.encode(SEED_MIGRATION_AUTHORITY)]
|
|
1901
|
+
});
|
|
1902
|
+
}
|
|
1873
1903
|
var CLAIM_RECEIPT_DISCRIMINATOR = new Uint8Array([
|
|
1874
1904
|
223,
|
|
1875
1905
|
233,
|
|
@@ -1957,7 +1987,7 @@ function getEntryEncoder() {
|
|
|
1957
1987
|
return kit.transformEncoder(
|
|
1958
1988
|
kit.getStructEncoder([
|
|
1959
1989
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
1960
|
-
["
|
|
1990
|
+
["market", kit.getAddressEncoder()],
|
|
1961
1991
|
["entryId", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
1962
1992
|
["baseMint", kit.getAddressEncoder()],
|
|
1963
1993
|
["contribution", kit.getU64Encoder()],
|
|
@@ -1971,7 +2001,7 @@ function getEntryEncoder() {
|
|
|
1971
2001
|
function getEntryDecoder() {
|
|
1972
2002
|
return kit.getStructDecoder([
|
|
1973
2003
|
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
1974
|
-
["
|
|
2004
|
+
["market", kit.getAddressDecoder()],
|
|
1975
2005
|
["entryId", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
1976
2006
|
["baseMint", kit.getAddressDecoder()],
|
|
1977
2007
|
["contribution", kit.getU64Decoder()],
|
|
@@ -2029,7 +2059,7 @@ function getEntryByMintEncoder() {
|
|
|
2029
2059
|
return kit.transformEncoder(
|
|
2030
2060
|
kit.getStructEncoder([
|
|
2031
2061
|
["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
|
|
2032
|
-
["
|
|
2062
|
+
["market", kit.getAddressEncoder()],
|
|
2033
2063
|
["baseMint", kit.getAddressEncoder()],
|
|
2034
2064
|
["entryId", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
|
|
2035
2065
|
["bump", kit.getU8Encoder()],
|
|
@@ -2041,7 +2071,7 @@ function getEntryByMintEncoder() {
|
|
|
2041
2071
|
function getEntryByMintDecoder() {
|
|
2042
2072
|
return kit.getStructDecoder([
|
|
2043
2073
|
["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
|
|
2044
|
-
["
|
|
2074
|
+
["market", kit.getAddressDecoder()],
|
|
2045
2075
|
["baseMint", kit.getAddressDecoder()],
|
|
2046
2076
|
["entryId", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
|
|
2047
2077
|
["bump", kit.getU8Decoder()],
|
|
@@ -2304,6 +2334,11 @@ function getLaunchEncoder2() {
|
|
|
2304
2334
|
["migratorProgram", kit.getAddressEncoder()],
|
|
2305
2335
|
["migratorInitCalldata", getCalldataBufEncoder2()],
|
|
2306
2336
|
["migratorMigrateCalldata", getCalldataBufEncoder2()],
|
|
2337
|
+
["curveKind", kit.getU8Encoder()],
|
|
2338
|
+
["swapLock", kit.getU8Encoder()],
|
|
2339
|
+
["pad4", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
|
|
2340
|
+
["curveParams", getCalldataBufEncoder2()],
|
|
2341
|
+
["quoteDeposited", kit.getU64Encoder()],
|
|
2307
2342
|
["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 64)]
|
|
2308
2343
|
]),
|
|
2309
2344
|
(value) => ({ ...value, discriminator: LAUNCH_DISCRIMINATOR2 })
|
|
@@ -2341,6 +2376,11 @@ function getLaunchDecoder2() {
|
|
|
2341
2376
|
["migratorProgram", kit.getAddressDecoder()],
|
|
2342
2377
|
["migratorInitCalldata", getCalldataBufDecoder2()],
|
|
2343
2378
|
["migratorMigrateCalldata", getCalldataBufDecoder2()],
|
|
2379
|
+
["curveKind", kit.getU8Decoder()],
|
|
2380
|
+
["swapLock", kit.getU8Decoder()],
|
|
2381
|
+
["pad4", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
|
|
2382
|
+
["curveParams", getCalldataBufDecoder2()],
|
|
2383
|
+
["quoteDeposited", kit.getU64Decoder()],
|
|
2344
2384
|
["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 64)]
|
|
2345
2385
|
]);
|
|
2346
2386
|
}
|
|
@@ -2372,7 +2412,7 @@ async function fetchAllMaybeLaunch(rpc, addresses, config) {
|
|
|
2372
2412
|
return maybeAccounts.map((maybeAccount) => decodeLaunch(maybeAccount));
|
|
2373
2413
|
}
|
|
2374
2414
|
function getLaunchSize() {
|
|
2375
|
-
return
|
|
2415
|
+
return 1488;
|
|
2376
2416
|
}
|
|
2377
2417
|
var MARKET_DISCRIMINATOR = new Uint8Array([
|
|
2378
2418
|
219,
|
|
@@ -2617,6 +2657,42 @@ async function getClaimInstructionAsync(input, config) {
|
|
|
2617
2657
|
]
|
|
2618
2658
|
});
|
|
2619
2659
|
}
|
|
2660
|
+
if (!accounts.entryByMint.value) {
|
|
2661
|
+
accounts.entryByMint.value = await kit.getProgramDerivedAddress({
|
|
2662
|
+
programAddress,
|
|
2663
|
+
seeds: [
|
|
2664
|
+
kit.getBytesEncoder().encode(
|
|
2665
|
+
new Uint8Array([
|
|
2666
|
+
101,
|
|
2667
|
+
110,
|
|
2668
|
+
116,
|
|
2669
|
+
114,
|
|
2670
|
+
121,
|
|
2671
|
+
95,
|
|
2672
|
+
98,
|
|
2673
|
+
121,
|
|
2674
|
+
95,
|
|
2675
|
+
109,
|
|
2676
|
+
105,
|
|
2677
|
+
110,
|
|
2678
|
+
116
|
|
2679
|
+
])
|
|
2680
|
+
),
|
|
2681
|
+
kit.getAddressEncoder().encode(
|
|
2682
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
2683
|
+
"market",
|
|
2684
|
+
accounts.market.value
|
|
2685
|
+
)
|
|
2686
|
+
),
|
|
2687
|
+
kit.getAddressEncoder().encode(
|
|
2688
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
2689
|
+
"winnerMint",
|
|
2690
|
+
accounts.winnerMint.value
|
|
2691
|
+
)
|
|
2692
|
+
)
|
|
2693
|
+
]
|
|
2694
|
+
});
|
|
2695
|
+
}
|
|
2620
2696
|
if (!accounts.receipt.value) {
|
|
2621
2697
|
accounts.receipt.value = await kit.getProgramDerivedAddress({
|
|
2622
2698
|
programAddress,
|
|
@@ -2807,7 +2883,14 @@ async function getMigrateEntryInstructionAsync(input, config) {
|
|
|
2807
2883
|
baseVault: { value: input.baseVault ?? null, isWritable: true },
|
|
2808
2884
|
quoteVault: { value: input.quoteVault ?? null, isWritable: true },
|
|
2809
2885
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
2810
|
-
|
|
2886
|
+
baseTokenProgram: {
|
|
2887
|
+
value: input.baseTokenProgram ?? null,
|
|
2888
|
+
isWritable: false
|
|
2889
|
+
},
|
|
2890
|
+
quoteTokenProgram: {
|
|
2891
|
+
value: input.quoteTokenProgram ?? null,
|
|
2892
|
+
isWritable: false
|
|
2893
|
+
},
|
|
2811
2894
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
2812
2895
|
rent: { value: input.rent ?? null, isWritable: false },
|
|
2813
2896
|
oracle: { value: input.oracle ?? null, isWritable: false },
|
|
@@ -2822,9 +2905,6 @@ async function getMigrateEntryInstructionAsync(input, config) {
|
|
|
2822
2905
|
};
|
|
2823
2906
|
const accounts = originalAccounts;
|
|
2824
2907
|
const args = { ...input };
|
|
2825
|
-
if (!accounts.tokenProgram.value) {
|
|
2826
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2827
|
-
}
|
|
2828
2908
|
if (!accounts.systemProgram.value) {
|
|
2829
2909
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2830
2910
|
}
|
|
@@ -2841,6 +2921,12 @@ async function getMigrateEntryInstructionAsync(input, config) {
|
|
|
2841
2921
|
"oracle",
|
|
2842
2922
|
accounts.oracle.value
|
|
2843
2923
|
)
|
|
2924
|
+
),
|
|
2925
|
+
kit.getAddressEncoder().encode(
|
|
2926
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
2927
|
+
"quoteMint",
|
|
2928
|
+
accounts.quoteMint.value
|
|
2929
|
+
)
|
|
2844
2930
|
)
|
|
2845
2931
|
]
|
|
2846
2932
|
});
|
|
@@ -2901,8 +2987,8 @@ async function getMigrateEntryInstructionAsync(input, config) {
|
|
|
2901
2987
|
),
|
|
2902
2988
|
kit.getAddressEncoder().encode(
|
|
2903
2989
|
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
2904
|
-
"
|
|
2905
|
-
accounts.
|
|
2990
|
+
"market",
|
|
2991
|
+
accounts.market.value
|
|
2906
2992
|
)
|
|
2907
2993
|
),
|
|
2908
2994
|
kit.getAddressEncoder().encode(
|
|
@@ -2925,7 +3011,8 @@ async function getMigrateEntryInstructionAsync(input, config) {
|
|
|
2925
3011
|
getAccountMeta("baseVault", accounts.baseVault),
|
|
2926
3012
|
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
2927
3013
|
getAccountMeta("payer", accounts.payer),
|
|
2928
|
-
getAccountMeta("
|
|
3014
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
3015
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2929
3016
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2930
3017
|
getAccountMeta("rent", accounts.rent),
|
|
2931
3018
|
getAccountMeta("oracle", accounts.oracle),
|
|
@@ -2958,7 +3045,14 @@ function getMigrateEntryInstruction(input, config) {
|
|
|
2958
3045
|
baseVault: { value: input.baseVault ?? null, isWritable: true },
|
|
2959
3046
|
quoteVault: { value: input.quoteVault ?? null, isWritable: true },
|
|
2960
3047
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
2961
|
-
|
|
3048
|
+
baseTokenProgram: {
|
|
3049
|
+
value: input.baseTokenProgram ?? null,
|
|
3050
|
+
isWritable: false
|
|
3051
|
+
},
|
|
3052
|
+
quoteTokenProgram: {
|
|
3053
|
+
value: input.quoteTokenProgram ?? null,
|
|
3054
|
+
isWritable: false
|
|
3055
|
+
},
|
|
2962
3056
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
2963
3057
|
rent: { value: input.rent ?? null, isWritable: false },
|
|
2964
3058
|
oracle: { value: input.oracle ?? null, isWritable: false },
|
|
@@ -2973,9 +3067,6 @@ function getMigrateEntryInstruction(input, config) {
|
|
|
2973
3067
|
};
|
|
2974
3068
|
const accounts = originalAccounts;
|
|
2975
3069
|
const args = { ...input };
|
|
2976
|
-
if (!accounts.tokenProgram.value) {
|
|
2977
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2978
|
-
}
|
|
2979
3070
|
if (!accounts.systemProgram.value) {
|
|
2980
3071
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2981
3072
|
}
|
|
@@ -2993,7 +3084,8 @@ function getMigrateEntryInstruction(input, config) {
|
|
|
2993
3084
|
getAccountMeta("baseVault", accounts.baseVault),
|
|
2994
3085
|
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
2995
3086
|
getAccountMeta("payer", accounts.payer),
|
|
2996
|
-
getAccountMeta("
|
|
3087
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
3088
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2997
3089
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2998
3090
|
getAccountMeta("rent", accounts.rent),
|
|
2999
3091
|
getAccountMeta("oracle", accounts.oracle),
|
|
@@ -3010,12 +3102,12 @@ function getMigrateEntryInstruction(input, config) {
|
|
|
3010
3102
|
});
|
|
3011
3103
|
}
|
|
3012
3104
|
function parseMigrateEntryInstruction(instruction) {
|
|
3013
|
-
if (instruction.accounts.length <
|
|
3105
|
+
if (instruction.accounts.length < 18) {
|
|
3014
3106
|
throw new kit.SolanaError(
|
|
3015
3107
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3016
3108
|
{
|
|
3017
3109
|
actualAccountMetas: instruction.accounts.length,
|
|
3018
|
-
expectedAccountMetas:
|
|
3110
|
+
expectedAccountMetas: 18
|
|
3019
3111
|
}
|
|
3020
3112
|
);
|
|
3021
3113
|
}
|
|
@@ -3036,7 +3128,8 @@ function parseMigrateEntryInstruction(instruction) {
|
|
|
3036
3128
|
baseVault: getNextAccount(),
|
|
3037
3129
|
quoteVault: getNextAccount(),
|
|
3038
3130
|
payer: getNextAccount(),
|
|
3039
|
-
|
|
3131
|
+
baseTokenProgram: getNextAccount(),
|
|
3132
|
+
quoteTokenProgram: getNextAccount(),
|
|
3040
3133
|
systemProgram: getNextAccount(),
|
|
3041
3134
|
rent: getNextAccount(),
|
|
3042
3135
|
oracle: getNextAccount(),
|
|
@@ -3187,7 +3280,14 @@ async function getRegisterEntryInstructionAsync(input, config) {
|
|
|
3187
3280
|
baseVault: { value: input.baseVault ?? null, isWritable: false },
|
|
3188
3281
|
quoteVault: { value: input.quoteVault ?? null, isWritable: false },
|
|
3189
3282
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
3190
|
-
|
|
3283
|
+
baseTokenProgram: {
|
|
3284
|
+
value: input.baseTokenProgram ?? null,
|
|
3285
|
+
isWritable: false
|
|
3286
|
+
},
|
|
3287
|
+
quoteTokenProgram: {
|
|
3288
|
+
value: input.quoteTokenProgram ?? null,
|
|
3289
|
+
isWritable: false
|
|
3290
|
+
},
|
|
3191
3291
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
3192
3292
|
rent: { value: input.rent ?? null, isWritable: false },
|
|
3193
3293
|
oracle: { value: input.oracle ?? null, isWritable: false },
|
|
@@ -3202,9 +3302,6 @@ async function getRegisterEntryInstructionAsync(input, config) {
|
|
|
3202
3302
|
};
|
|
3203
3303
|
const accounts = originalAccounts;
|
|
3204
3304
|
const args = { ...input };
|
|
3205
|
-
if (!accounts.tokenProgram.value) {
|
|
3206
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
3207
|
-
}
|
|
3208
3305
|
if (!accounts.systemProgram.value) {
|
|
3209
3306
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3210
3307
|
}
|
|
@@ -3221,6 +3318,12 @@ async function getRegisterEntryInstructionAsync(input, config) {
|
|
|
3221
3318
|
"oracle",
|
|
3222
3319
|
accounts.oracle.value
|
|
3223
3320
|
)
|
|
3321
|
+
),
|
|
3322
|
+
kit.getAddressEncoder().encode(
|
|
3323
|
+
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3324
|
+
"quoteMint",
|
|
3325
|
+
accounts.quoteMint.value
|
|
3326
|
+
)
|
|
3224
3327
|
)
|
|
3225
3328
|
]
|
|
3226
3329
|
});
|
|
@@ -3297,8 +3400,8 @@ async function getRegisterEntryInstructionAsync(input, config) {
|
|
|
3297
3400
|
),
|
|
3298
3401
|
kit.getAddressEncoder().encode(
|
|
3299
3402
|
programClientCore.getAddressFromResolvedInstructionAccount(
|
|
3300
|
-
"
|
|
3301
|
-
accounts.
|
|
3403
|
+
"market",
|
|
3404
|
+
accounts.market.value
|
|
3302
3405
|
)
|
|
3303
3406
|
),
|
|
3304
3407
|
kit.getAddressEncoder().encode(
|
|
@@ -3321,7 +3424,8 @@ async function getRegisterEntryInstructionAsync(input, config) {
|
|
|
3321
3424
|
getAccountMeta("baseVault", accounts.baseVault),
|
|
3322
3425
|
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
3323
3426
|
getAccountMeta("payer", accounts.payer),
|
|
3324
|
-
getAccountMeta("
|
|
3427
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
3428
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
3325
3429
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
3326
3430
|
getAccountMeta("rent", accounts.rent),
|
|
3327
3431
|
getAccountMeta("oracle", accounts.oracle),
|
|
@@ -3354,7 +3458,14 @@ function getRegisterEntryInstruction(input, config) {
|
|
|
3354
3458
|
baseVault: { value: input.baseVault ?? null, isWritable: false },
|
|
3355
3459
|
quoteVault: { value: input.quoteVault ?? null, isWritable: false },
|
|
3356
3460
|
payer: { value: input.payer ?? null, isWritable: true },
|
|
3357
|
-
|
|
3461
|
+
baseTokenProgram: {
|
|
3462
|
+
value: input.baseTokenProgram ?? null,
|
|
3463
|
+
isWritable: false
|
|
3464
|
+
},
|
|
3465
|
+
quoteTokenProgram: {
|
|
3466
|
+
value: input.quoteTokenProgram ?? null,
|
|
3467
|
+
isWritable: false
|
|
3468
|
+
},
|
|
3358
3469
|
systemProgram: { value: input.systemProgram ?? null, isWritable: false },
|
|
3359
3470
|
rent: { value: input.rent ?? null, isWritable: false },
|
|
3360
3471
|
oracle: { value: input.oracle ?? null, isWritable: false },
|
|
@@ -3369,9 +3480,6 @@ function getRegisterEntryInstruction(input, config) {
|
|
|
3369
3480
|
};
|
|
3370
3481
|
const accounts = originalAccounts;
|
|
3371
3482
|
const args = { ...input };
|
|
3372
|
-
if (!accounts.tokenProgram.value) {
|
|
3373
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
3374
|
-
}
|
|
3375
3483
|
if (!accounts.systemProgram.value) {
|
|
3376
3484
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3377
3485
|
}
|
|
@@ -3389,7 +3497,8 @@ function getRegisterEntryInstruction(input, config) {
|
|
|
3389
3497
|
getAccountMeta("baseVault", accounts.baseVault),
|
|
3390
3498
|
getAccountMeta("quoteVault", accounts.quoteVault),
|
|
3391
3499
|
getAccountMeta("payer", accounts.payer),
|
|
3392
|
-
getAccountMeta("
|
|
3500
|
+
getAccountMeta("baseTokenProgram", accounts.baseTokenProgram),
|
|
3501
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
3393
3502
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
3394
3503
|
getAccountMeta("rent", accounts.rent),
|
|
3395
3504
|
getAccountMeta("oracle", accounts.oracle),
|
|
@@ -3406,12 +3515,12 @@ function getRegisterEntryInstruction(input, config) {
|
|
|
3406
3515
|
});
|
|
3407
3516
|
}
|
|
3408
3517
|
function parseRegisterEntryInstruction(instruction) {
|
|
3409
|
-
if (instruction.accounts.length <
|
|
3518
|
+
if (instruction.accounts.length < 18) {
|
|
3410
3519
|
throw new kit.SolanaError(
|
|
3411
3520
|
kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
|
|
3412
3521
|
{
|
|
3413
3522
|
actualAccountMetas: instruction.accounts.length,
|
|
3414
|
-
expectedAccountMetas:
|
|
3523
|
+
expectedAccountMetas: 18
|
|
3415
3524
|
}
|
|
3416
3525
|
);
|
|
3417
3526
|
}
|
|
@@ -3432,7 +3541,8 @@ function parseRegisterEntryInstruction(instruction) {
|
|
|
3432
3541
|
baseVault: getNextAccount(),
|
|
3433
3542
|
quoteVault: getNextAccount(),
|
|
3434
3543
|
payer: getNextAccount(),
|
|
3435
|
-
|
|
3544
|
+
baseTokenProgram: getNextAccount(),
|
|
3545
|
+
quoteTokenProgram: getNextAccount(),
|
|
3436
3546
|
systemProgram: getNextAccount(),
|
|
3437
3547
|
rent: getNextAccount(),
|
|
3438
3548
|
oracle: getNextAccount(),
|
|
@@ -3655,10 +3765,14 @@ function predictionMigratorProgram() {
|
|
|
3655
3765
|
}
|
|
3656
3766
|
var addressCodec4 = kit.getAddressCodec();
|
|
3657
3767
|
var textEncoder4 = new TextEncoder();
|
|
3658
|
-
async function getPredictionMarketAddress(oracleState, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
3768
|
+
async function getPredictionMarketAddress(oracleState, quoteMint, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
3659
3769
|
return kit.getProgramDerivedAddress({
|
|
3660
3770
|
programAddress: programId,
|
|
3661
|
-
seeds: [
|
|
3771
|
+
seeds: [
|
|
3772
|
+
textEncoder4.encode("market"),
|
|
3773
|
+
addressCodec4.encode(oracleState),
|
|
3774
|
+
addressCodec4.encode(quoteMint)
|
|
3775
|
+
]
|
|
3662
3776
|
});
|
|
3663
3777
|
}
|
|
3664
3778
|
async function getPredictionMarketAuthorityAddress(market, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
@@ -3676,22 +3790,18 @@ async function getPredictionPotVaultAddress(market, programId = PREDICTION_MIGRA
|
|
|
3676
3790
|
seeds: [textEncoder4.encode("pot_vault"), addressCodec4.encode(market)]
|
|
3677
3791
|
});
|
|
3678
3792
|
}
|
|
3679
|
-
async function getPredictionEntryAddress(
|
|
3793
|
+
async function getPredictionEntryAddress(market, entryId, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
3680
3794
|
return kit.getProgramDerivedAddress({
|
|
3681
3795
|
programAddress: programId,
|
|
3682
|
-
seeds: [
|
|
3683
|
-
textEncoder4.encode("entry"),
|
|
3684
|
-
addressCodec4.encode(oracleState),
|
|
3685
|
-
entryId
|
|
3686
|
-
]
|
|
3796
|
+
seeds: [textEncoder4.encode("entry"), addressCodec4.encode(market), entryId]
|
|
3687
3797
|
});
|
|
3688
3798
|
}
|
|
3689
|
-
async function getPredictionEntryByMintAddress(
|
|
3799
|
+
async function getPredictionEntryByMintAddress(market, mint, programId = PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
3690
3800
|
return kit.getProgramDerivedAddress({
|
|
3691
3801
|
programAddress: programId,
|
|
3692
3802
|
seeds: [
|
|
3693
3803
|
textEncoder4.encode("entry_by_mint"),
|
|
3694
|
-
addressCodec4.encode(
|
|
3804
|
+
addressCodec4.encode(market),
|
|
3695
3805
|
addressCodec4.encode(mint)
|
|
3696
3806
|
]
|
|
3697
3807
|
});
|
|
@@ -3710,24 +3820,23 @@ function createAccountMeta(value, role) {
|
|
|
3710
3820
|
async function getTokenMetadataAddress(mint) {
|
|
3711
3821
|
const encoder = kit.getAddressEncoder();
|
|
3712
3822
|
const [metadataAddress] = await kit.getProgramDerivedAddress({
|
|
3713
|
-
programAddress:
|
|
3823
|
+
programAddress: chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
3714
3824
|
seeds: [
|
|
3715
3825
|
new TextEncoder().encode("metadata"),
|
|
3716
|
-
encoder.encode(
|
|
3826
|
+
encoder.encode(chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID),
|
|
3717
3827
|
encoder.encode(mint)
|
|
3718
3828
|
]
|
|
3719
3829
|
});
|
|
3720
3830
|
return metadataAddress;
|
|
3721
3831
|
}
|
|
3722
3832
|
var ALT_INDEX = {
|
|
3723
|
-
[
|
|
3724
|
-
[
|
|
3833
|
+
[chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS]: 0,
|
|
3834
|
+
[chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS]: 1,
|
|
3725
3835
|
SysvarRent111111111111111111111111111111111: 2,
|
|
3726
3836
|
[INITIALIZER_PROGRAM_ID]: 3,
|
|
3727
|
-
[
|
|
3837
|
+
[chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID]: 4,
|
|
3728
3838
|
[CPMM_MIGRATOR_PROGRAM_ID]: 5,
|
|
3729
3839
|
So11111111111111111111111111111111111111112: 6,
|
|
3730
|
-
// index 7 = config PDA — resolved at call time from accounts.config
|
|
3731
3840
|
[PREDICTION_MIGRATOR_PROGRAM_ADDRESS]: 8
|
|
3732
3841
|
};
|
|
3733
3842
|
function validateInitializeLaunchCurveParams(args) {
|
|
@@ -3753,10 +3862,13 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
3753
3862
|
payer,
|
|
3754
3863
|
authority,
|
|
3755
3864
|
migratorProgram,
|
|
3756
|
-
|
|
3757
|
-
|
|
3865
|
+
baseTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3866
|
+
quoteTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3867
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
3758
3868
|
rent,
|
|
3759
3869
|
metadataAccount,
|
|
3870
|
+
metadataProgram = chunkO6FR7TXY_cjs.TOKEN_METADATA_PROGRAM_ID,
|
|
3871
|
+
instructionsSysvar = chunkO6FR7TXY_cjs.SYSVAR_INSTRUCTIONS_ADDRESS,
|
|
3760
3872
|
addressLookupTable: alt
|
|
3761
3873
|
} = accounts;
|
|
3762
3874
|
const withMetadata = Boolean(
|
|
@@ -3767,7 +3879,7 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
3767
3879
|
"metadataName is set but metadataAccount was not provided. Derive it with await initializer.getTokenMetadataAddress(baseMintAddress)."
|
|
3768
3880
|
);
|
|
3769
3881
|
}
|
|
3770
|
-
const altIndexMap = alt ?
|
|
3882
|
+
const altIndexMap = alt ? ALT_INDEX : {};
|
|
3771
3883
|
function staticOrLookup(addr, role) {
|
|
3772
3884
|
if (alt && altIndexMap[addr] !== void 0) {
|
|
3773
3885
|
return {
|
|
@@ -3795,36 +3907,47 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
|
|
|
3795
3907
|
if (migratorProgram) {
|
|
3796
3908
|
keys.push(staticOrLookup(migratorProgram, kit.AccountRole.READONLY));
|
|
3797
3909
|
}
|
|
3798
|
-
keys.push(staticOrLookup(
|
|
3910
|
+
keys.push(staticOrLookup(baseTokenProgram, kit.AccountRole.READONLY));
|
|
3911
|
+
keys.push(staticOrLookup(quoteTokenProgram, kit.AccountRole.READONLY));
|
|
3799
3912
|
keys.push(staticOrLookup(systemProgram, kit.AccountRole.READONLY));
|
|
3800
3913
|
keys.push(staticOrLookup(rent, kit.AccountRole.READONLY));
|
|
3801
3914
|
if (withMetadata) {
|
|
3802
3915
|
keys.push({ address: metadataAccount, role: kit.AccountRole.WRITABLE });
|
|
3803
|
-
keys.push(staticOrLookup(
|
|
3916
|
+
keys.push(staticOrLookup(metadataProgram, kit.AccountRole.READONLY));
|
|
3917
|
+
} else {
|
|
3918
|
+
keys.push({ address: programId, role: kit.AccountRole.READONLY });
|
|
3919
|
+
keys.push({ address: programId, role: kit.AccountRole.READONLY });
|
|
3804
3920
|
}
|
|
3921
|
+
keys.push({ address: instructionsSysvar, role: kit.AccountRole.READONLY });
|
|
3805
3922
|
const encoderArgs = {
|
|
3806
3923
|
...args,
|
|
3807
3924
|
allowBuy: args.allowBuy ? 1 : 0,
|
|
3808
3925
|
allowSell: args.allowSell ? 1 : 0,
|
|
3809
|
-
migratorProgram: migratorProgram ??
|
|
3926
|
+
migratorProgram: migratorProgram ?? chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS
|
|
3810
3927
|
};
|
|
3811
3928
|
const data = new Uint8Array(
|
|
3812
3929
|
getInitializeLaunchInstructionDataEncoder().encode(encoderArgs)
|
|
3813
3930
|
);
|
|
3814
3931
|
if (migratorProgram === CPMM_MIGRATOR_PROGRAM_ID) {
|
|
3932
|
+
if (!accounts.cpmmConfig) {
|
|
3933
|
+
throw new Error(
|
|
3934
|
+
"cpmmConfig is required when migratorProgram is CPMM_MIGRATOR_PROGRAM_ID"
|
|
3935
|
+
);
|
|
3936
|
+
}
|
|
3815
3937
|
const [cpmmMigratorState] = await getCpmmMigratorStateAddress(launch);
|
|
3816
3938
|
keys.push({ address: cpmmMigratorState, role: kit.AccountRole.WRITABLE });
|
|
3939
|
+
keys.push({ address: accounts.cpmmConfig, role: kit.AccountRole.READONLY });
|
|
3817
3940
|
}
|
|
3818
3941
|
if (migratorProgram === PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
|
|
3819
3942
|
const oracleState = args.namespace;
|
|
3820
3943
|
const entryId = args.launchId;
|
|
3821
3944
|
const baseMintAddress = isTransactionSigner5(baseMint) ? baseMint.address : baseMint;
|
|
3822
|
-
const [market] = await getPredictionMarketAddress(oracleState);
|
|
3945
|
+
const [market] = await getPredictionMarketAddress(oracleState, quoteMint);
|
|
3823
3946
|
const [potVault] = await getPredictionPotVaultAddress(market);
|
|
3824
3947
|
const [marketAuthority] = await getPredictionMarketAuthorityAddress(market);
|
|
3825
|
-
const [entry] = await getPredictionEntryAddress(
|
|
3948
|
+
const [entry] = await getPredictionEntryAddress(market, entryId);
|
|
3826
3949
|
const [entryByMint] = await getPredictionEntryByMintAddress(
|
|
3827
|
-
|
|
3950
|
+
market,
|
|
3828
3951
|
baseMintAddress
|
|
3829
3952
|
);
|
|
3830
3953
|
keys.push({ address: oracleState, role: kit.AccountRole.READONLY });
|
|
@@ -3857,8 +3980,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
3857
3980
|
baseMint,
|
|
3858
3981
|
quoteMint,
|
|
3859
3982
|
user,
|
|
3860
|
-
sentinelProgram =
|
|
3861
|
-
|
|
3983
|
+
sentinelProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
3984
|
+
baseTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3985
|
+
quoteTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
3986
|
+
instructionsSysvar = chunkO6FR7TXY_cjs.SYSVAR_INSTRUCTIONS_ADDRESS
|
|
3862
3987
|
} = accounts;
|
|
3863
3988
|
const keys = [
|
|
3864
3989
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -3875,7 +4000,9 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
|
|
|
3875
4000
|
// slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
|
|
3876
4001
|
// no-op placeholder when no real sentinel is configured.
|
|
3877
4002
|
{ address: sentinelProgram, role: kit.AccountRole.READONLY },
|
|
3878
|
-
{ address:
|
|
4003
|
+
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
4004
|
+
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
4005
|
+
{ address: instructionsSysvar, role: kit.AccountRole.READONLY }
|
|
3879
4006
|
];
|
|
3880
4007
|
const data = new Uint8Array(
|
|
3881
4008
|
getCurveSwapExactInInstructionDataEncoder().encode(args)
|
|
@@ -3902,9 +4029,11 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
3902
4029
|
quoteVault,
|
|
3903
4030
|
migratorProgram,
|
|
3904
4031
|
payer,
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
4032
|
+
baseTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
4033
|
+
quoteTokenProgram = chunkO6FR7TXY_cjs.TOKEN_PROGRAM_ADDRESS,
|
|
4034
|
+
systemProgram = chunkO6FR7TXY_cjs.SYSTEM_PROGRAM_ADDRESS,
|
|
4035
|
+
rent,
|
|
4036
|
+
instructionsSysvar = chunkO6FR7TXY_cjs.SYSVAR_INSTRUCTIONS_ADDRESS
|
|
3908
4037
|
} = accounts;
|
|
3909
4038
|
const keys = [
|
|
3910
4039
|
{ address: config, role: kit.AccountRole.READONLY },
|
|
@@ -3916,52 +4045,17 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
|
|
|
3916
4045
|
{ address: quoteVault, role: kit.AccountRole.WRITABLE },
|
|
3917
4046
|
{ address: migratorProgram, role: kit.AccountRole.READONLY },
|
|
3918
4047
|
createSignerAccountMeta5(payer, kit.AccountRole.WRITABLE_SIGNER),
|
|
3919
|
-
{ address:
|
|
4048
|
+
{ address: baseTokenProgram, role: kit.AccountRole.READONLY },
|
|
4049
|
+
{ address: quoteTokenProgram, role: kit.AccountRole.READONLY },
|
|
3920
4050
|
{ address: systemProgram, role: kit.AccountRole.READONLY },
|
|
3921
|
-
{ address: rent, role: kit.AccountRole.READONLY }
|
|
4051
|
+
{ address: rent, role: kit.AccountRole.READONLY },
|
|
4052
|
+
{ address: instructionsSysvar, role: kit.AccountRole.READONLY }
|
|
3922
4053
|
];
|
|
3923
|
-
const data =
|
|
4054
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
3924
4055
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
|
|
3925
4056
|
);
|
|
3926
4057
|
return { programAddress: programId, accounts: keys, data };
|
|
3927
4058
|
}
|
|
3928
|
-
function isTransactionSigner8(value) {
|
|
3929
|
-
return typeof value === "object" && value !== null && "address" in value && "signTransactions" in value;
|
|
3930
|
-
}
|
|
3931
|
-
function createAccountMeta3(value, role) {
|
|
3932
|
-
if (isTransactionSigner8(value)) {
|
|
3933
|
-
return { address: value.address, role, signer: value };
|
|
3934
|
-
}
|
|
3935
|
-
return { address: value, role };
|
|
3936
|
-
}
|
|
3937
|
-
function createAbortLaunchInstruction(accounts, programId = INITIALIZER_PROGRAM_ID) {
|
|
3938
|
-
const {
|
|
3939
|
-
config,
|
|
3940
|
-
launch,
|
|
3941
|
-
launchAuthority,
|
|
3942
|
-
baseVault,
|
|
3943
|
-
quoteVault,
|
|
3944
|
-
authority,
|
|
3945
|
-
authorityBaseAccount,
|
|
3946
|
-
baseMint,
|
|
3947
|
-
tokenProgram = chunkDPKVNI6Q_cjs.TOKEN_PROGRAM_ADDRESS
|
|
3948
|
-
} = accounts;
|
|
3949
|
-
const keys = [
|
|
3950
|
-
{ address: config, role: kit.AccountRole.READONLY },
|
|
3951
|
-
{ address: launch, role: kit.AccountRole.WRITABLE },
|
|
3952
|
-
{ address: launchAuthority, role: kit.AccountRole.READONLY },
|
|
3953
|
-
{ address: baseVault, role: kit.AccountRole.WRITABLE },
|
|
3954
|
-
{ address: quoteVault, role: kit.AccountRole.READONLY },
|
|
3955
|
-
createAccountMeta3(authority, kit.AccountRole.READONLY_SIGNER),
|
|
3956
|
-
{ address: authorityBaseAccount, role: kit.AccountRole.WRITABLE },
|
|
3957
|
-
{ address: baseMint, role: kit.AccountRole.READONLY },
|
|
3958
|
-
{ address: tokenProgram, role: kit.AccountRole.READONLY }
|
|
3959
|
-
];
|
|
3960
|
-
const data = chunkBXATWUGJ_cjs.encodeInstructionData(
|
|
3961
|
-
INITIALIZER_INSTRUCTION_DISCRIMINATORS.abortLaunch
|
|
3962
|
-
);
|
|
3963
|
-
return { programAddress: programId, accounts: keys, data };
|
|
3964
|
-
}
|
|
3965
4059
|
var previewSwapExactInResultCodec = kit.getStructCodec([
|
|
3966
4060
|
["amountOut", kit.getU64Codec()],
|
|
3967
4061
|
["feePaid", kit.getU64Codec()]
|
|
@@ -3995,7 +4089,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
|
|
|
3995
4089
|
{ address: baseVault, role: kit.AccountRole.READONLY },
|
|
3996
4090
|
{ address: quoteVault, role: kit.AccountRole.READONLY }
|
|
3997
4091
|
];
|
|
3998
|
-
const data =
|
|
4092
|
+
const data = chunkI5JME35L_cjs.encodeInstructionData(
|
|
3999
4093
|
INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
|
|
4000
4094
|
);
|
|
4001
4095
|
return { programAddress: programId, accounts: keys, data };
|
|
@@ -4135,10 +4229,12 @@ chunkQ7SFCCGT_cjs.__export(cpmmMigrator_exports, {
|
|
|
4135
4229
|
CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: () => CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS,
|
|
4136
4230
|
CPMM_MIGRATOR_PROGRAM_ID: () => CPMM_MIGRATOR_PROGRAM_ID,
|
|
4137
4231
|
MAX_RECIPIENTS: () => MAX_RECIPIENTS,
|
|
4232
|
+
SEED_MIGRATION_AUTHORITY: () => SEED_MIGRATION_AUTHORITY,
|
|
4138
4233
|
SEED_STATE: () => SEED_STATE,
|
|
4139
4234
|
encodeMigrateCalldata: () => encodeMigrateCalldata,
|
|
4140
4235
|
encodeRegisterLaunchCalldata: () => encodeRegisterLaunchCalldata,
|
|
4141
4236
|
fetchCpmmMigratorState: () => fetchCpmmMigratorState,
|
|
4237
|
+
getCpmmMigrationAuthorityAddress: () => getCpmmMigrationAuthorityAddress,
|
|
4142
4238
|
getCpmmMigratorStateAddress: () => getCpmmMigratorStateAddress,
|
|
4143
4239
|
getCpmmMigratorStateCodec: () => getCpmmMigratorStateCodec,
|
|
4144
4240
|
getCpmmMigratorStateDecoder: () => getCpmmMigratorStateDecoder,
|