@whetstone-research/doppler-sdk 1.0.13 → 1.0.15

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.
Files changed (33) hide show
  1. package/README.md +48 -12
  2. package/dist/{chunk-AT33RY6T.cjs → chunk-3BW6IVP3.cjs} +46 -37
  3. package/dist/chunk-3BW6IVP3.cjs.map +1 -0
  4. package/dist/{chunk-ZQEEGBXT.js → chunk-NMTYI3TB.js} +23 -26
  5. package/dist/chunk-NMTYI3TB.js.map +1 -0
  6. package/dist/{chunk-2NFQKIOB.js → chunk-TVBSIQIX.js} +35 -26
  7. package/dist/chunk-TVBSIQIX.js.map +1 -0
  8. package/dist/{chunk-LL7TW3GU.cjs → chunk-W5TMS4RD.cjs} +56 -59
  9. package/dist/chunk-W5TMS4RD.cjs.map +1 -0
  10. package/dist/{oracle-CU-nZnja.d.cts → oracle-DN8BrGPh.d.cts} +28 -28
  11. package/dist/{oracle-CU-nZnja.d.ts → oracle-DN8BrGPh.d.ts} +28 -28
  12. package/dist/{pda-FLNTBIC5.js → pda-5D3GD5S6.js} +3 -3
  13. package/dist/pda-5D3GD5S6.js.map +1 -0
  14. package/dist/{pda-G25AJSXG.cjs → pda-GNZYNRUH.cjs} +17 -17
  15. package/dist/{pda-G25AJSXG.cjs.map → pda-GNZYNRUH.cjs.map} +1 -1
  16. package/dist/solana/index.cjs +910 -743
  17. package/dist/solana/index.cjs.map +1 -1
  18. package/dist/solana/index.d.cts +560 -472
  19. package/dist/solana/index.d.ts +560 -472
  20. package/dist/solana/index.js +772 -607
  21. package/dist/solana/index.js.map +1 -1
  22. package/dist/solana/react/index.cjs +57 -57
  23. package/dist/solana/react/index.cjs.map +1 -1
  24. package/dist/solana/react/index.d.cts +5 -5
  25. package/dist/solana/react/index.d.ts +5 -5
  26. package/dist/solana/react/index.js +15 -15
  27. package/dist/solana/react/index.js.map +1 -1
  28. package/package.json +4 -2
  29. package/dist/chunk-2NFQKIOB.js.map +0 -1
  30. package/dist/chunk-AT33RY6T.cjs.map +0 -1
  31. package/dist/chunk-LL7TW3GU.cjs.map +0 -1
  32. package/dist/chunk-ZQEEGBXT.js.map +0 -1
  33. package/dist/pda-FLNTBIC5.js.map +0 -1
@@ -1,78 +1,79 @@
1
1
  'use strict';
2
2
 
3
- var chunkLL7TW3GU_cjs = require('../chunk-LL7TW3GU.cjs');
4
- var chunkAT33RY6T_cjs = require('../chunk-AT33RY6T.cjs');
3
+ var chunkW5TMS4RD_cjs = require('../chunk-W5TMS4RD.cjs');
4
+ var chunk3BW6IVP3_cjs = require('../chunk-3BW6IVP3.cjs');
5
5
  var chunkQ7SFCCGT_cjs = require('../chunk-Q7SFCCGT.cjs');
6
6
  var kit = require('@solana/kit');
7
7
  var programClientCore = require('@solana/program-client-core');
8
8
  var sha3_js = require('@noble/hashes/sha3.js');
9
+ var addressLookupTable = require('@solana-program/address-lookup-table');
9
10
 
10
11
  // src/solana/cpmm/index.ts
11
12
  var cpmm_exports = {};
12
13
  chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
13
- ACCOUNT_DISCRIMINATORS: () => chunkAT33RY6T_cjs.ACCOUNT_DISCRIMINATORS,
14
- ACCOUNT_VERSION: () => chunkAT33RY6T_cjs.ACCOUNT_VERSION,
14
+ ACCOUNT_DISCRIMINATORS: () => chunk3BW6IVP3_cjs.ACCOUNT_DISCRIMINATORS,
15
+ ACCOUNT_VERSION: () => chunk3BW6IVP3_cjs.ACCOUNT_VERSION,
15
16
  ADD_LIQUIDITY_DISCRIMINATOR: () => ADD_LIQUIDITY_DISCRIMINATOR,
16
- BPS_DENOM: () => chunkAT33RY6T_cjs.BPS_DENOM,
17
+ BPS_DENOM: () => chunk3BW6IVP3_cjs.BPS_DENOM,
17
18
  CLOSE_POSITION_DISCRIMINATOR: () => CLOSE_POSITION_DISCRIMINATOR,
18
19
  COLLECT_FEES_DISCRIMINATOR: () => COLLECT_FEES_DISCRIMINATOR,
19
20
  COLLECT_PROTOCOL_FEES_DISCRIMINATOR: () => COLLECT_PROTOCOL_FEES_DISCRIMINATOR,
20
21
  CPMM_ERROR_MESSAGES: () => CPMM_ERROR_MESSAGES,
21
- CPMM_PROGRAM_ID: () => chunkAT33RY6T_cjs.CPMM_PROGRAM_ID,
22
+ CPMM_PROGRAM_ID: () => chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
22
23
  CREATE_POSITION_DISCRIMINATOR: () => CREATE_POSITION_DISCRIMINATOR,
23
24
  CpmmError: () => CpmmError,
24
25
  CpmmErrorCode: () => CpmmErrorCode,
26
+ HF_AFTER_ADD_LIQ: () => chunk3BW6IVP3_cjs.HF_AFTER_ADD_LIQ,
27
+ HF_AFTER_REMOVE_LIQ: () => chunk3BW6IVP3_cjs.HF_AFTER_REMOVE_LIQ,
28
+ HF_AFTER_SWAP: () => chunk3BW6IVP3_cjs.HF_AFTER_SWAP,
29
+ HF_BEFORE_ADD_LIQ: () => chunk3BW6IVP3_cjs.HF_BEFORE_ADD_LIQ,
30
+ HF_BEFORE_REMOVE_LIQ: () => chunk3BW6IVP3_cjs.HF_BEFORE_REMOVE_LIQ,
31
+ HF_BEFORE_SWAP: () => chunk3BW6IVP3_cjs.HF_BEFORE_SWAP,
32
+ HF_FORWARD_READONLY_SIGNERS: () => chunk3BW6IVP3_cjs.HF_FORWARD_READONLY_SIGNERS,
33
+ HF_REQUIRE_ORACLE: () => chunk3BW6IVP3_cjs.HF_REQUIRE_ORACLE,
34
+ HOOK_NO_CHANGE: () => chunk3BW6IVP3_cjs.HOOK_NO_CHANGE,
25
35
  INITIALIZE_CONFIG_DISCRIMINATOR: () => INITIALIZE_CONFIG_DISCRIMINATOR,
26
36
  INITIALIZE_ORACLE_DISCRIMINATOR: () => INITIALIZE_ORACLE_DISCRIMINATOR,
27
37
  INITIALIZE_POOL_DISCRIMINATOR: () => INITIALIZE_POOL_DISCRIMINATOR,
28
- INSTRUCTION_DISCRIMINATORS: () => chunkAT33RY6T_cjs.INSTRUCTION_DISCRIMINATORS,
38
+ INSTRUCTION_DISCRIMINATORS: () => chunk3BW6IVP3_cjs.INSTRUCTION_DISCRIMINATORS,
29
39
  MAX_FEE_AMOUNT: () => MAX_FEE_AMOUNT,
30
- MAX_ORACLE_OBSERVATIONS: () => chunkAT33RY6T_cjs.MAX_ORACLE_OBSERVATIONS,
31
- MAX_SENTINEL_ALLOWLIST: () => chunkAT33RY6T_cjs.MAX_SENTINEL_ALLOWLIST,
40
+ MAX_HOOK_ALLOWLIST: () => chunk3BW6IVP3_cjs.MAX_HOOK_ALLOWLIST,
41
+ MAX_ORACLE_OBSERVATIONS: () => chunk3BW6IVP3_cjs.MAX_ORACLE_OBSERVATIONS,
32
42
  ORACLE_CONSULT_DISCRIMINATOR: () => ORACLE_CONSULT_DISCRIMINATOR,
33
43
  ORACLE_UPDATE_DISCRIMINATOR: () => ORACLE_UPDATE_DISCRIMINATOR,
34
44
  PAUSE_DISCRIMINATOR: () => PAUSE_DISCRIMINATOR,
35
45
  PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR: () => PREVIEW_SWAP_EXACT_IN_DISCRIMINATOR,
36
- Q64_ONE: () => chunkAT33RY6T_cjs.Q64_ONE,
46
+ Q64_ONE: () => chunk3BW6IVP3_cjs.Q64_ONE,
37
47
  QUOTE_TO_NUMERAIRE_DISCRIMINATOR: () => QUOTE_TO_NUMERAIRE_DISCRIMINATOR,
38
48
  REMOVE_LIQUIDITY_DISCRIMINATOR: () => REMOVE_LIQUIDITY_DISCRIMINATOR,
39
- SEED_AUTHORITY: () => chunkAT33RY6T_cjs.SEED_AUTHORITY,
40
- SEED_CONFIG: () => chunkAT33RY6T_cjs.SEED_CONFIG,
41
- SEED_ORACLE: () => chunkAT33RY6T_cjs.SEED_ORACLE,
42
- SEED_POOL: () => chunkAT33RY6T_cjs.SEED_POOL,
43
- SEED_POSITION: () => chunkAT33RY6T_cjs.SEED_POSITION,
44
- SEED_PROTOCOL_POSITION: () => chunkAT33RY6T_cjs.SEED_PROTOCOL_POSITION,
45
- SENTINEL_NO_CHANGE: () => chunkAT33RY6T_cjs.SENTINEL_NO_CHANGE,
49
+ SEED_AUTHORITY: () => chunk3BW6IVP3_cjs.SEED_AUTHORITY,
50
+ SEED_CONFIG: () => chunk3BW6IVP3_cjs.SEED_CONFIG,
51
+ SEED_ORACLE: () => chunk3BW6IVP3_cjs.SEED_ORACLE,
52
+ SEED_POOL: () => chunk3BW6IVP3_cjs.SEED_POOL,
53
+ SEED_POSITION: () => chunk3BW6IVP3_cjs.SEED_POSITION,
54
+ SEED_PROTOCOL_FEE_POSITION: () => chunk3BW6IVP3_cjs.SEED_PROTOCOL_FEE_POSITION,
46
55
  SET_FEES_DISCRIMINATOR: () => SET_FEES_DISCRIMINATOR,
56
+ SET_HOOK_DISCRIMINATOR: () => SET_HOOK_DISCRIMINATOR,
47
57
  SET_ROUTE_DISCRIMINATOR: () => SET_ROUTE_DISCRIMINATOR,
48
- SET_SENTINEL_DISCRIMINATOR: () => SET_SENTINEL_DISCRIMINATOR,
49
- SF_AFTER_ADD_LIQ: () => chunkAT33RY6T_cjs.SF_AFTER_ADD_LIQ,
50
- SF_AFTER_REMOVE_LIQ: () => chunkAT33RY6T_cjs.SF_AFTER_REMOVE_LIQ,
51
- SF_AFTER_SWAP: () => chunkAT33RY6T_cjs.SF_AFTER_SWAP,
52
- SF_BEFORE_ADD_LIQ: () => chunkAT33RY6T_cjs.SF_BEFORE_ADD_LIQ,
53
- SF_BEFORE_REMOVE_LIQ: () => chunkAT33RY6T_cjs.SF_BEFORE_REMOVE_LIQ,
54
- SF_BEFORE_SWAP: () => chunkAT33RY6T_cjs.SF_BEFORE_SWAP,
55
- SF_FORWARD_READONLY_SIGNERS: () => chunkAT33RY6T_cjs.SF_FORWARD_READONLY_SIGNERS,
56
- SF_REQUIRE_ORACLE: () => chunkAT33RY6T_cjs.SF_REQUIRE_ORACLE,
57
- SKIM_DISCRIMINATOR: () => SKIM_DISCRIMINATOR,
58
58
  SWAP_EXACT_IN_DISCRIMINATOR: () => SWAP_EXACT_IN_DISCRIMINATOR,
59
- TOKEN_METADATA_PROGRAM_ID: () => chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID,
59
+ TOKEN_METADATA_PROGRAM_ID: () => chunk3BW6IVP3_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
- addLiquidityArgsCodec: () => chunkLL7TW3GU_cjs.addLiquidityArgsCodec,
64
- ammConfigDataCodec: () => chunkLL7TW3GU_cjs.ammConfigDataCodec,
65
- areMintsOrdered: () => chunkAT33RY6T_cjs.areMintsOrdered,
66
- calculateAccruedFees: () => chunkLL7TW3GU_cjs.calculateAccruedFees,
67
- calculateTwap: () => chunkLL7TW3GU_cjs.calculateTwap,
68
- calculateTwapNumber: () => chunkLL7TW3GU_cjs.calculateTwapNumber,
69
- ceilDiv: () => chunkLL7TW3GU_cjs.ceilDiv,
70
- collectFeesArgsCodec: () => chunkLL7TW3GU_cjs.collectFeesArgsCodec,
71
- collectProtocolFeesArgsCodec: () => chunkLL7TW3GU_cjs.collectProtocolFeesArgsCodec,
72
- comparePoolAndOraclePrices: () => chunkLL7TW3GU_cjs.comparePoolAndOraclePrices,
73
- computePrice0Q64: () => chunkLL7TW3GU_cjs.computePrice0Q64,
74
- computePrice1Q64: () => chunkLL7TW3GU_cjs.computePrice1Q64,
75
- consultTwap: () => chunkLL7TW3GU_cjs.consultTwap,
63
+ WITHDRAW_VAULT_EXCESS_DISCRIMINATOR: () => WITHDRAW_VAULT_EXCESS_DISCRIMINATOR,
64
+ addLiquidityArgsCodec: () => chunkW5TMS4RD_cjs.addLiquidityArgsCodec,
65
+ ammConfigDataCodec: () => chunkW5TMS4RD_cjs.ammConfigDataCodec,
66
+ areMintsOrdered: () => chunk3BW6IVP3_cjs.areMintsOrdered,
67
+ calculateAccruedFees: () => chunkW5TMS4RD_cjs.calculateAccruedFees,
68
+ calculateTwap: () => chunkW5TMS4RD_cjs.calculateTwap,
69
+ calculateTwapNumber: () => chunkW5TMS4RD_cjs.calculateTwapNumber,
70
+ ceilDiv: () => chunkW5TMS4RD_cjs.ceilDiv,
71
+ collectFeesArgsCodec: () => chunkW5TMS4RD_cjs.collectFeesArgsCodec,
72
+ collectProtocolFeesArgsCodec: () => chunkW5TMS4RD_cjs.collectProtocolFeesArgsCodec,
73
+ comparePoolAndOraclePrices: () => chunkW5TMS4RD_cjs.comparePoolAndOraclePrices,
74
+ computePrice0Q64: () => chunkW5TMS4RD_cjs.computePrice0Q64,
75
+ computePrice1Q64: () => chunkW5TMS4RD_cjs.computePrice1Q64,
76
+ consultTwap: () => chunkW5TMS4RD_cjs.consultTwap,
76
77
  createAddLiquidityInstruction: () => getAddLiquidityInstruction,
77
78
  createClosePositionInstruction: () => getClosePositionInstruction,
78
79
  createCollectFeesInstruction: () => getCollectFeesInstruction,
@@ -84,59 +85,59 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
84
85
  createOracleConsultInstruction: () => getOracleConsultInstruction,
85
86
  createOracleUpdateInstruction: () => getOracleUpdateInstruction,
86
87
  createPauseInstruction: () => getPauseInstruction,
87
- createPositionArgsCodec: () => chunkLL7TW3GU_cjs.createPositionArgsCodec,
88
+ createPositionArgsCodec: () => chunkW5TMS4RD_cjs.createPositionArgsCodec,
88
89
  createQuoteToNumeraireInstruction: () => getQuoteToNumeraireInstruction,
89
90
  createRemoveLiquidityInstruction: () => getRemoveLiquidityInstruction,
90
91
  createSetFeesInstruction: () => getSetFeesInstruction,
92
+ createSetHookInstruction: () => getSetHookInstruction,
91
93
  createSetRouteInstruction: () => getSetRouteInstruction,
92
- createSetSentinelInstruction: () => getSetSentinelInstruction,
93
- createSkimInstruction: () => getSkimInstruction,
94
94
  createSwapExactInInstruction: () => getSwapExactInInstruction,
95
95
  createSwapInstruction: () => createSwapInstruction,
96
96
  createTransferAdminInstruction: () => getTransferAdminInstruction,
97
97
  createUnpauseInstruction: () => getUnpauseInstruction,
98
+ createWithdrawVaultExcessInstruction: () => getWithdrawVaultExcessInstruction,
98
99
  curveParamsToMarketCap: () => curveParamsToMarketCap,
99
- decodeAmmConfig: () => chunkLL7TW3GU_cjs.decodeAmmConfig,
100
- decodeOracleState: () => chunkLL7TW3GU_cjs.decodeOracleState,
101
- decodePool: () => chunkLL7TW3GU_cjs.decodePool,
102
- decodePosition: () => chunkLL7TW3GU_cjs.decodePosition,
103
- encodeAddLiquidityArgs: () => chunkLL7TW3GU_cjs.encodeAddLiquidityArgs,
104
- encodeCollectFeesArgs: () => chunkLL7TW3GU_cjs.encodeCollectFeesArgs,
105
- encodeCollectProtocolFeesArgs: () => chunkLL7TW3GU_cjs.encodeCollectProtocolFeesArgs,
106
- encodeCreatePositionArgs: () => chunkLL7TW3GU_cjs.encodeCreatePositionArgs,
107
- encodeInitializeConfigArgs: () => chunkLL7TW3GU_cjs.encodeInitializeConfigArgs,
108
- encodeInitializeOracleArgs: () => chunkLL7TW3GU_cjs.encodeInitializeOracleArgs,
109
- encodeInitializePoolArgs: () => chunkLL7TW3GU_cjs.encodeInitializePoolArgs,
110
- encodeInstructionData: () => chunkLL7TW3GU_cjs.encodeInstructionData,
111
- encodeOracleConsultArgs: () => chunkLL7TW3GU_cjs.encodeOracleConsultArgs,
112
- encodeQuoteToNumeraireArgs: () => chunkLL7TW3GU_cjs.encodeQuoteToNumeraireArgs,
113
- encodeRemoveLiquidityArgs: () => chunkLL7TW3GU_cjs.encodeRemoveLiquidityArgs,
114
- encodeSetFeesArgs: () => chunkLL7TW3GU_cjs.encodeSetFeesArgs,
115
- encodeSetRouteArgs: () => chunkLL7TW3GU_cjs.encodeSetRouteArgs,
116
- encodeSetSentinelArgs: () => chunkLL7TW3GU_cjs.encodeSetSentinelArgs,
117
- encodeSwapExactInArgs: () => chunkLL7TW3GU_cjs.encodeSwapExactInArgs,
118
- encodeTransferAdminArgs: () => chunkLL7TW3GU_cjs.encodeTransferAdminArgs,
119
- fetchAllPools: () => chunkLL7TW3GU_cjs.fetchAllPools,
100
+ decodeAmmConfig: () => chunkW5TMS4RD_cjs.decodeAmmConfig,
101
+ decodeOracleState: () => chunkW5TMS4RD_cjs.decodeOracleState,
102
+ decodePool: () => chunkW5TMS4RD_cjs.decodePool,
103
+ decodePosition: () => chunkW5TMS4RD_cjs.decodePosition,
104
+ encodeAddLiquidityArgs: () => chunkW5TMS4RD_cjs.encodeAddLiquidityArgs,
105
+ encodeCollectFeesArgs: () => chunkW5TMS4RD_cjs.encodeCollectFeesArgs,
106
+ encodeCollectProtocolFeesArgs: () => chunkW5TMS4RD_cjs.encodeCollectProtocolFeesArgs,
107
+ encodeCreatePositionArgs: () => chunkW5TMS4RD_cjs.encodeCreatePositionArgs,
108
+ encodeInitializeConfigArgs: () => chunkW5TMS4RD_cjs.encodeInitializeConfigArgs,
109
+ encodeInitializeOracleArgs: () => chunkW5TMS4RD_cjs.encodeInitializeOracleArgs,
110
+ encodeInitializePoolArgs: () => chunkW5TMS4RD_cjs.encodeInitializePoolArgs,
111
+ encodeInstructionData: () => chunkW5TMS4RD_cjs.encodeInstructionData,
112
+ encodeOracleConsultArgs: () => chunkW5TMS4RD_cjs.encodeOracleConsultArgs,
113
+ encodeQuoteToNumeraireArgs: () => chunkW5TMS4RD_cjs.encodeQuoteToNumeraireArgs,
114
+ encodeRemoveLiquidityArgs: () => chunkW5TMS4RD_cjs.encodeRemoveLiquidityArgs,
115
+ encodeSetFeesArgs: () => chunkW5TMS4RD_cjs.encodeSetFeesArgs,
116
+ encodeSetHookArgs: () => chunkW5TMS4RD_cjs.encodeSetHookArgs,
117
+ encodeSetRouteArgs: () => chunkW5TMS4RD_cjs.encodeSetRouteArgs,
118
+ encodeSwapExactInArgs: () => chunkW5TMS4RD_cjs.encodeSwapExactInArgs,
119
+ encodeTransferAdminArgs: () => chunkW5TMS4RD_cjs.encodeTransferAdminArgs,
120
+ fetchAllPools: () => chunkW5TMS4RD_cjs.fetchAllPools,
120
121
  fetchConfig: () => fetchConfig,
121
122
  fetchConfigWithAddress: () => fetchConfigWithAddress,
122
- fetchOracle: () => chunkLL7TW3GU_cjs.fetchOracle,
123
- fetchOraclesBatch: () => chunkLL7TW3GU_cjs.fetchOraclesBatch,
124
- fetchPool: () => chunkLL7TW3GU_cjs.fetchPool,
125
- fetchPoolPositions: () => chunkLL7TW3GU_cjs.fetchPoolPositions,
126
- fetchPoolsBatch: () => chunkLL7TW3GU_cjs.fetchPoolsBatch,
127
- fetchPosition: () => chunkLL7TW3GU_cjs.fetchPosition,
128
- fetchPositionByParams: () => chunkLL7TW3GU_cjs.fetchPositionByParams,
129
- fetchPositionsBatch: () => chunkLL7TW3GU_cjs.fetchPositionsBatch,
130
- fetchUserPositions: () => chunkLL7TW3GU_cjs.fetchUserPositions,
131
- filterActivePositions: () => chunkLL7TW3GU_cjs.filterActivePositions,
132
- filterPoolsByMint: () => chunkLL7TW3GU_cjs.filterPoolsByMint,
123
+ fetchOracle: () => chunkW5TMS4RD_cjs.fetchOracle,
124
+ fetchOraclesBatch: () => chunkW5TMS4RD_cjs.fetchOraclesBatch,
125
+ fetchPool: () => chunkW5TMS4RD_cjs.fetchPool,
126
+ fetchPoolPositions: () => chunkW5TMS4RD_cjs.fetchPoolPositions,
127
+ fetchPoolsBatch: () => chunkW5TMS4RD_cjs.fetchPoolsBatch,
128
+ fetchPosition: () => chunkW5TMS4RD_cjs.fetchPosition,
129
+ fetchPositionByParams: () => chunkW5TMS4RD_cjs.fetchPositionByParams,
130
+ fetchPositionsBatch: () => chunkW5TMS4RD_cjs.fetchPositionsBatch,
131
+ fetchUserPositions: () => chunkW5TMS4RD_cjs.fetchUserPositions,
132
+ filterActivePositions: () => chunkW5TMS4RD_cjs.filterActivePositions,
133
+ filterPoolsByMint: () => chunkW5TMS4RD_cjs.filterPoolsByMint,
133
134
  getAddLiquidityDiscriminatorBytes: () => getAddLiquidityDiscriminatorBytes,
134
135
  getAddLiquidityInstruction: () => getAddLiquidityInstruction,
135
136
  getAddLiquidityInstructionAsync: () => getAddLiquidityInstructionAsync,
136
137
  getAddLiquidityInstructionDataCodec: () => getAddLiquidityInstructionDataCodec,
137
138
  getAddLiquidityInstructionDataDecoder: () => getAddLiquidityInstructionDataDecoder,
138
139
  getAddLiquidityInstructionDataEncoder: () => getAddLiquidityInstructionDataEncoder,
139
- getAddLiquidityQuote: () => chunkLL7TW3GU_cjs.getAddLiquidityQuote,
140
+ getAddLiquidityQuote: () => chunkW5TMS4RD_cjs.getAddLiquidityQuote,
140
141
  getClosePositionDiscriminatorBytes: () => getClosePositionDiscriminatorBytes,
141
142
  getClosePositionInstruction: () => getClosePositionInstruction,
142
143
  getClosePositionInstructionDataCodec: () => getClosePositionInstructionDataCodec,
@@ -154,7 +155,7 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
154
155
  getCollectProtocolFeesInstructionDataCodec: () => getCollectProtocolFeesInstructionDataCodec,
155
156
  getCollectProtocolFeesInstructionDataDecoder: () => getCollectProtocolFeesInstructionDataDecoder,
156
157
  getCollectProtocolFeesInstructionDataEncoder: () => getCollectProtocolFeesInstructionDataEncoder,
157
- getConfigAddress: () => chunkAT33RY6T_cjs.getConfigAddress,
158
+ getConfigAddress: () => chunk3BW6IVP3_cjs.getConfigAddress,
158
159
  getCreatePositionDiscriminatorBytes: () => getCreatePositionDiscriminatorBytes,
159
160
  getCreatePositionInstruction: () => getCreatePositionInstruction,
160
161
  getCreatePositionInstructionAsync: () => getCreatePositionInstructionAsync,
@@ -180,22 +181,22 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
180
181
  getInitializePoolInstructionDataCodec: () => getInitializePoolInstructionDataCodec,
181
182
  getInitializePoolInstructionDataDecoder: () => getInitializePoolInstructionDataDecoder,
182
183
  getInitializePoolInstructionDataEncoder: () => getInitializePoolInstructionDataEncoder,
183
- getK: () => chunkLL7TW3GU_cjs.getK,
184
- getLiquidityAddresses: () => chunkAT33RY6T_cjs.getLiquidityAddresses,
184
+ getK: () => chunkW5TMS4RD_cjs.getK,
185
+ getLiquidityAddresses: () => chunk3BW6IVP3_cjs.getLiquidityAddresses,
185
186
  getMetadataAddress: () => getMetadataAddress,
186
- getOracleAddress: () => chunkAT33RY6T_cjs.getOracleAddress,
187
- getOracleAddressFromPool: () => chunkLL7TW3GU_cjs.getOracleAddressFromPool,
188
- getOracleAge: () => chunkLL7TW3GU_cjs.getOracleAge,
189
- getOracleBufferStats: () => chunkLL7TW3GU_cjs.getOracleBufferStats,
187
+ getOracleAddress: () => chunk3BW6IVP3_cjs.getOracleAddress,
188
+ getOracleAddressFromPool: () => chunkW5TMS4RD_cjs.getOracleAddressFromPool,
189
+ getOracleAge: () => chunkW5TMS4RD_cjs.getOracleAge,
190
+ getOracleBufferStats: () => chunkW5TMS4RD_cjs.getOracleBufferStats,
190
191
  getOracleConsultDiscriminatorBytes: () => getOracleConsultDiscriminatorBytes,
191
192
  getOracleConsultInstruction: () => getOracleConsultInstruction,
192
193
  getOracleConsultInstructionAsync: () => getOracleConsultInstructionAsync,
193
194
  getOracleConsultInstructionDataCodec: () => getOracleConsultInstructionDataCodec,
194
195
  getOracleConsultInstructionDataDecoder: () => getOracleConsultInstructionDataDecoder,
195
196
  getOracleConsultInstructionDataEncoder: () => getOracleConsultInstructionDataEncoder,
196
- getOracleDeviation: () => chunkLL7TW3GU_cjs.getOracleDeviation,
197
- getOracleForPool: () => chunkLL7TW3GU_cjs.getOracleForPool,
198
- getOracleSpotPrices: () => chunkLL7TW3GU_cjs.getOracleSpotPrices,
197
+ getOracleDeviation: () => chunkW5TMS4RD_cjs.getOracleDeviation,
198
+ getOracleForPool: () => chunkW5TMS4RD_cjs.getOracleForPool,
199
+ getOracleSpotPrices: () => chunkW5TMS4RD_cjs.getOracleSpotPrices,
199
200
  getOracleUpdateDiscriminatorBytes: () => getOracleUpdateDiscriminatorBytes,
200
201
  getOracleUpdateInstruction: () => getOracleUpdateInstruction,
201
202
  getOracleUpdateInstructionAsync: () => getOracleUpdateInstructionAsync,
@@ -207,23 +208,23 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
207
208
  getPauseInstructionDataCodec: () => getPauseInstructionDataCodec,
208
209
  getPauseInstructionDataDecoder: () => getPauseInstructionDataDecoder,
209
210
  getPauseInstructionDataEncoder: () => getPauseInstructionDataEncoder,
210
- getPendingFees: () => chunkLL7TW3GU_cjs.getPendingFees,
211
- getPoolAddress: () => chunkAT33RY6T_cjs.getPoolAddress,
212
- getPoolAddressFromMints: () => chunkLL7TW3GU_cjs.getPoolAddressFromMints,
213
- getPoolAuthorityAddress: () => chunkAT33RY6T_cjs.getPoolAuthorityAddress,
214
- getPoolByMints: () => chunkLL7TW3GU_cjs.getPoolByMints,
215
- getPoolInitAddresses: () => chunkAT33RY6T_cjs.getPoolInitAddresses,
216
- getPoolVault0Address: () => chunkAT33RY6T_cjs.getPoolVault0Address,
217
- getPoolVault1Address: () => chunkAT33RY6T_cjs.getPoolVault1Address,
218
- getPositionAddress: () => chunkAT33RY6T_cjs.getPositionAddress,
219
- getPositionAddressFromParams: () => chunkLL7TW3GU_cjs.getPositionAddressFromParams,
220
- getPositionValue: () => chunkLL7TW3GU_cjs.getPositionValue,
211
+ getPendingFees: () => chunkW5TMS4RD_cjs.getPendingFees,
212
+ getPoolAddress: () => chunk3BW6IVP3_cjs.getPoolAddress,
213
+ getPoolAddressFromMints: () => chunkW5TMS4RD_cjs.getPoolAddressFromMints,
214
+ getPoolAuthorityAddress: () => chunk3BW6IVP3_cjs.getPoolAuthorityAddress,
215
+ getPoolByMints: () => chunkW5TMS4RD_cjs.getPoolByMints,
216
+ getPoolInitAddresses: () => chunk3BW6IVP3_cjs.getPoolInitAddresses,
217
+ getPoolVault0Address: () => chunk3BW6IVP3_cjs.getPoolVault0Address,
218
+ getPoolVault1Address: () => chunk3BW6IVP3_cjs.getPoolVault1Address,
219
+ getPositionAddress: () => chunk3BW6IVP3_cjs.getPositionAddress,
220
+ getPositionAddressFromParams: () => chunkW5TMS4RD_cjs.getPositionAddressFromParams,
221
+ getPositionValue: () => chunkW5TMS4RD_cjs.getPositionValue,
221
222
  getPreviewSwapExactInDiscriminatorBytes: () => getPreviewSwapExactInDiscriminatorBytes,
222
223
  getPreviewSwapExactInInstruction: () => getPreviewSwapExactInInstruction,
223
224
  getPreviewSwapExactInInstructionDataCodec: () => getPreviewSwapExactInInstructionDataCodec,
224
225
  getPreviewSwapExactInInstructionDataDecoder: () => getPreviewSwapExactInInstructionDataDecoder,
225
226
  getPreviewSwapExactInInstructionDataEncoder: () => getPreviewSwapExactInInstructionDataEncoder,
226
- getProtocolPositionAddress: () => chunkAT33RY6T_cjs.getProtocolPositionAddress,
227
+ getProtocolFeePositionAddress: () => chunk3BW6IVP3_cjs.getProtocolFeePositionAddress,
227
228
  getQuoteToNumeraireDiscriminatorBytes: () => getQuoteToNumeraireDiscriminatorBytes,
228
229
  getQuoteToNumeraireInstruction: () => getQuoteToNumeraireInstruction,
229
230
  getQuoteToNumeraireInstructionDataCodec: () => getQuoteToNumeraireInstructionDataCodec,
@@ -235,45 +236,39 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
235
236
  getRemoveLiquidityInstructionDataCodec: () => getRemoveLiquidityInstructionDataCodec,
236
237
  getRemoveLiquidityInstructionDataDecoder: () => getRemoveLiquidityInstructionDataDecoder,
237
238
  getRemoveLiquidityInstructionDataEncoder: () => getRemoveLiquidityInstructionDataEncoder,
238
- getRemoveLiquidityQuote: () => chunkLL7TW3GU_cjs.getRemoveLiquidityQuote,
239
+ getRemoveLiquidityQuote: () => chunkW5TMS4RD_cjs.getRemoveLiquidityQuote,
239
240
  getSetFeesDiscriminatorBytes: () => getSetFeesDiscriminatorBytes,
240
241
  getSetFeesInstruction: () => getSetFeesInstruction,
241
242
  getSetFeesInstructionDataCodec: () => getSetFeesInstructionDataCodec,
242
243
  getSetFeesInstructionDataDecoder: () => getSetFeesInstructionDataDecoder,
243
244
  getSetFeesInstructionDataEncoder: () => getSetFeesInstructionDataEncoder,
245
+ getSetHookDiscriminatorBytes: () => getSetHookDiscriminatorBytes,
246
+ getSetHookInstruction: () => getSetHookInstruction,
247
+ getSetHookInstructionDataCodec: () => getSetHookInstructionDataCodec,
248
+ getSetHookInstructionDataDecoder: () => getSetHookInstructionDataDecoder,
249
+ getSetHookInstructionDataEncoder: () => getSetHookInstructionDataEncoder,
244
250
  getSetRouteDiscriminatorBytes: () => getSetRouteDiscriminatorBytes,
245
251
  getSetRouteInstruction: () => getSetRouteInstruction,
246
252
  getSetRouteInstructionDataCodec: () => getSetRouteInstructionDataCodec,
247
253
  getSetRouteInstructionDataDecoder: () => getSetRouteInstructionDataDecoder,
248
254
  getSetRouteInstructionDataEncoder: () => getSetRouteInstructionDataEncoder,
249
- getSetSentinelDiscriminatorBytes: () => getSetSentinelDiscriminatorBytes,
250
- getSetSentinelInstruction: () => getSetSentinelInstruction,
251
- getSetSentinelInstructionDataCodec: () => getSetSentinelInstructionDataCodec,
252
- getSetSentinelInstructionDataDecoder: () => getSetSentinelInstructionDataDecoder,
253
- getSetSentinelInstructionDataEncoder: () => getSetSentinelInstructionDataEncoder,
254
- getSkimDiscriminatorBytes: () => getSkimDiscriminatorBytes,
255
- getSkimInstruction: () => getSkimInstruction,
256
- getSkimInstructionAsync: () => getSkimInstructionAsync,
257
- getSkimInstructionDataCodec: () => getSkimInstructionDataCodec,
258
- getSkimInstructionDataDecoder: () => getSkimInstructionDataDecoder,
259
- getSkimInstructionDataEncoder: () => getSkimInstructionDataEncoder,
260
- getSpotPrice0: () => chunkLL7TW3GU_cjs.getSpotPrice0,
261
- getSpotPrice1: () => chunkLL7TW3GU_cjs.getSpotPrice1,
262
- getSwapAddresses: () => chunkAT33RY6T_cjs.getSwapAddresses,
255
+ getSpotPrice0: () => chunkW5TMS4RD_cjs.getSpotPrice0,
256
+ getSpotPrice1: () => chunkW5TMS4RD_cjs.getSpotPrice1,
257
+ getSwapAddresses: () => chunk3BW6IVP3_cjs.getSwapAddresses,
263
258
  getSwapExactInDiscriminatorBytes: () => getSwapExactInDiscriminatorBytes,
264
259
  getSwapExactInInstruction: () => getSwapExactInInstruction,
265
260
  getSwapExactInInstructionAsync: () => getSwapExactInInstructionAsync,
266
261
  getSwapExactInInstructionDataCodec: () => getSwapExactInInstructionDataCodec,
267
262
  getSwapExactInInstructionDataDecoder: () => getSwapExactInInstructionDataDecoder,
268
263
  getSwapExactInInstructionDataEncoder: () => getSwapExactInInstructionDataEncoder,
269
- getSwapQuote: () => chunkLL7TW3GU_cjs.getSwapQuote,
270
- getSwapQuoteExactOut: () => chunkLL7TW3GU_cjs.getSwapQuoteExactOut,
264
+ getSwapQuote: () => chunkW5TMS4RD_cjs.getSwapQuote,
265
+ getSwapQuoteExactOut: () => chunkW5TMS4RD_cjs.getSwapQuoteExactOut,
271
266
  getTransferAdminDiscriminatorBytes: () => getTransferAdminDiscriminatorBytes,
272
267
  getTransferAdminInstruction: () => getTransferAdminInstruction,
273
268
  getTransferAdminInstructionDataCodec: () => getTransferAdminInstructionDataCodec,
274
269
  getTransferAdminInstructionDataDecoder: () => getTransferAdminInstructionDataDecoder,
275
270
  getTransferAdminInstructionDataEncoder: () => getTransferAdminInstructionDataEncoder,
276
- getTvl: () => chunkLL7TW3GU_cjs.getTvl,
271
+ getTvl: () => chunkW5TMS4RD_cjs.getTvl,
277
272
  getUnpauseDiscriminatorBytes: () => getUnpauseDiscriminatorBytes,
278
273
  getUnpauseInstruction: () => getUnpauseInstruction,
279
274
  getUnpauseInstructionDataCodec: () => getUnpauseInstructionDataCodec,
@@ -284,21 +279,27 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
284
279
  getUpdateConfigInstructionDataCodec: () => getUpdateConfigInstructionDataCodec,
285
280
  getUpdateConfigInstructionDataDecoder: () => getUpdateConfigInstructionDataDecoder,
286
281
  getUpdateConfigInstructionDataEncoder: () => getUpdateConfigInstructionDataEncoder,
287
- initializeConfigArgsCodec: () => chunkLL7TW3GU_cjs.initializeConfigArgsCodec,
288
- initializeOracleArgsCodec: () => chunkLL7TW3GU_cjs.initializeOracleArgsCodec,
289
- initializePoolArgsCodec: () => chunkLL7TW3GU_cjs.initializePoolArgsCodec,
282
+ getWithdrawVaultExcessDiscriminatorBytes: () => getWithdrawVaultExcessDiscriminatorBytes,
283
+ getWithdrawVaultExcessInstruction: () => getWithdrawVaultExcessInstruction,
284
+ getWithdrawVaultExcessInstructionAsync: () => getWithdrawVaultExcessInstructionAsync,
285
+ getWithdrawVaultExcessInstructionDataCodec: () => getWithdrawVaultExcessInstructionDataCodec,
286
+ getWithdrawVaultExcessInstructionDataDecoder: () => getWithdrawVaultExcessInstructionDataDecoder,
287
+ getWithdrawVaultExcessInstructionDataEncoder: () => getWithdrawVaultExcessInstructionDataEncoder,
288
+ initializeConfigArgsCodec: () => chunkW5TMS4RD_cjs.initializeConfigArgsCodec,
289
+ initializeOracleArgsCodec: () => chunkW5TMS4RD_cjs.initializeOracleArgsCodec,
290
+ initializePoolArgsCodec: () => chunkW5TMS4RD_cjs.initializePoolArgsCodec,
290
291
  isCpmmError: () => isCpmmError,
291
- isOracleStale: () => chunkLL7TW3GU_cjs.isOracleStale,
292
- isqrt: () => chunkLL7TW3GU_cjs.isqrt,
292
+ isOracleStale: () => chunkW5TMS4RD_cjs.isOracleStale,
293
+ isqrt: () => chunkW5TMS4RD_cjs.isqrt,
293
294
  marketCapToCurveParams: () => marketCapToCurveParams,
294
295
  marketCapToSingleCurveParams: () => marketCapToSingleCurveParams,
295
296
  marketCapToTokenPrice: () => marketCapToTokenPrice,
296
- maxBigInt: () => chunkLL7TW3GU_cjs.maxBigInt,
297
- minBigInt: () => chunkLL7TW3GU_cjs.minBigInt,
298
- numberToQ64: () => chunkLL7TW3GU_cjs.numberToQ64,
299
- observationCodec: () => chunkLL7TW3GU_cjs.observationCodec,
300
- oracleConsultArgsCodec: () => chunkLL7TW3GU_cjs.oracleConsultArgsCodec,
301
- oracleStateDataCodec: () => chunkLL7TW3GU_cjs.oracleStateDataCodec,
297
+ maxBigInt: () => chunkW5TMS4RD_cjs.maxBigInt,
298
+ minBigInt: () => chunkW5TMS4RD_cjs.minBigInt,
299
+ numberToQ64: () => chunkW5TMS4RD_cjs.numberToQ64,
300
+ observationCodec: () => chunkW5TMS4RD_cjs.observationCodec,
301
+ oracleConsultArgsCodec: () => chunkW5TMS4RD_cjs.oracleConsultArgsCodec,
302
+ oracleStateDataCodec: () => chunkW5TMS4RD_cjs.oracleStateDataCodec,
302
303
  parseAddLiquidityInstruction: () => parseAddLiquidityInstruction,
303
304
  parseClosePositionInstruction: () => parseClosePositionInstruction,
304
305
  parseCollectFeesInstruction: () => parseCollectFeesInstruction,
@@ -315,40 +316,40 @@ chunkQ7SFCCGT_cjs.__export(cpmm_exports, {
315
316
  parseQuoteToNumeraireInstruction: () => parseQuoteToNumeraireInstruction,
316
317
  parseRemoveLiquidityInstruction: () => parseRemoveLiquidityInstruction,
317
318
  parseSetFeesInstruction: () => parseSetFeesInstruction,
319
+ parseSetHookInstruction: () => parseSetHookInstruction,
318
320
  parseSetRouteInstruction: () => parseSetRouteInstruction,
319
- parseSetSentinelInstruction: () => parseSetSentinelInstruction,
320
- parseSkimInstruction: () => parseSkimInstruction,
321
321
  parseSwapExactInInstruction: () => parseSwapExactInInstruction,
322
322
  parseTransferAdminInstruction: () => parseTransferAdminInstruction,
323
323
  parseUnpauseInstruction: () => parseUnpauseInstruction,
324
324
  parseUpdateConfigInstruction: () => parseUpdateConfigInstruction,
325
- poolDataCodec: () => chunkLL7TW3GU_cjs.poolDataCodec,
326
- poolExists: () => chunkLL7TW3GU_cjs.poolExists,
327
- positionDataCodec: () => chunkLL7TW3GU_cjs.positionDataCodec,
328
- q64Div: () => chunkLL7TW3GU_cjs.q64Div,
329
- q64Mul: () => chunkLL7TW3GU_cjs.q64Mul,
330
- q64ToNumber: () => chunkLL7TW3GU_cjs.q64ToNumber,
331
- quoteToNumeraireArgsCodec: () => chunkLL7TW3GU_cjs.quoteToNumeraireArgsCodec,
332
- ratioToNumber: () => chunkLL7TW3GU_cjs.ratioToNumber,
333
- removeLiquidityArgsCodec: () => chunkLL7TW3GU_cjs.removeLiquidityArgsCodec,
334
- setFeesArgsCodec: () => chunkLL7TW3GU_cjs.setFeesArgsCodec,
335
- setRouteArgsCodec: () => chunkLL7TW3GU_cjs.setRouteArgsCodec,
336
- setSentinelArgsCodec: () => chunkLL7TW3GU_cjs.setSentinelArgsCodec,
337
- sortMints: () => chunkAT33RY6T_cjs.sortMints,
338
- sortPoolsByReserves: () => chunkLL7TW3GU_cjs.sortPoolsByReserves,
339
- sortPositionsByShares: () => chunkLL7TW3GU_cjs.sortPositionsByShares,
340
- swapExactInArgsCodec: () => chunkLL7TW3GU_cjs.swapExactInArgsCodec,
341
- transferAdminArgsCodec: () => chunkLL7TW3GU_cjs.transferAdminArgsCodec,
325
+ parseWithdrawVaultExcessInstruction: () => parseWithdrawVaultExcessInstruction,
326
+ poolDataCodec: () => chunkW5TMS4RD_cjs.poolDataCodec,
327
+ poolExists: () => chunkW5TMS4RD_cjs.poolExists,
328
+ positionDataCodec: () => chunkW5TMS4RD_cjs.positionDataCodec,
329
+ q64Div: () => chunkW5TMS4RD_cjs.q64Div,
330
+ q64Mul: () => chunkW5TMS4RD_cjs.q64Mul,
331
+ q64ToNumber: () => chunkW5TMS4RD_cjs.q64ToNumber,
332
+ quoteToNumeraireArgsCodec: () => chunkW5TMS4RD_cjs.quoteToNumeraireArgsCodec,
333
+ ratioToNumber: () => chunkW5TMS4RD_cjs.ratioToNumber,
334
+ removeLiquidityArgsCodec: () => chunkW5TMS4RD_cjs.removeLiquidityArgsCodec,
335
+ setFeesArgsCodec: () => chunkW5TMS4RD_cjs.setFeesArgsCodec,
336
+ setHookArgsCodec: () => chunkW5TMS4RD_cjs.setHookArgsCodec,
337
+ setRouteArgsCodec: () => chunkW5TMS4RD_cjs.setRouteArgsCodec,
338
+ sortMints: () => chunk3BW6IVP3_cjs.sortMints,
339
+ sortPoolsByReserves: () => chunkW5TMS4RD_cjs.sortPoolsByReserves,
340
+ sortPositionsByShares: () => chunkW5TMS4RD_cjs.sortPositionsByShares,
341
+ swapExactInArgsCodec: () => chunkW5TMS4RD_cjs.swapExactInArgsCodec,
342
+ transferAdminArgsCodec: () => chunkW5TMS4RD_cjs.transferAdminArgsCodec,
342
343
  validateMarketCapParameters: () => validateMarketCapParameters
343
344
  });
344
345
  var addressCodec = kit.getAddressCodec();
345
346
  var textEncoder = new TextEncoder();
346
347
  async function getMetadataAddress(mint) {
347
348
  return kit.getProgramDerivedAddress({
348
- programAddress: chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID,
349
+ programAddress: chunk3BW6IVP3_cjs.TOKEN_METADATA_PROGRAM_ID,
349
350
  seeds: [
350
351
  textEncoder.encode("metadata"),
351
- addressCodec.encode(chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID),
352
+ addressCodec.encode(chunk3BW6IVP3_cjs.TOKEN_METADATA_PROGRAM_ID),
352
353
  addressCodec.encode(mint)
353
354
  ]
354
355
  });
@@ -521,7 +522,7 @@ var CpmmErrorCode = /* @__PURE__ */ ((CpmmErrorCode2) => {
521
522
  CpmmErrorCode2[CpmmErrorCode2["PoolLocked"] = 6001] = "PoolLocked";
522
523
  CpmmErrorCode2[CpmmErrorCode2["InvalidFee"] = 6002] = "InvalidFee";
523
524
  CpmmErrorCode2[CpmmErrorCode2["InvalidFeeSplit"] = 6003] = "InvalidFeeSplit";
524
- CpmmErrorCode2[CpmmErrorCode2["InvalidDirection"] = 6004] = "InvalidDirection";
525
+ CpmmErrorCode2[CpmmErrorCode2["InvalidTradeDirection"] = 6004] = "InvalidTradeDirection";
525
526
  CpmmErrorCode2[CpmmErrorCode2["InsufficientLiquidity"] = 6005] = "InsufficientLiquidity";
526
527
  CpmmErrorCode2[CpmmErrorCode2["SlippageExceeded"] = 6006] = "SlippageExceeded";
527
528
  CpmmErrorCode2[CpmmErrorCode2["MathOverflow"] = 6007] = "MathOverflow";
@@ -534,13 +535,13 @@ var CpmmErrorCode = /* @__PURE__ */ ((CpmmErrorCode2) => {
534
535
  CpmmErrorCode2[CpmmErrorCode2["NotSupportedInV0_1"] = 6014] = "NotSupportedInV0_1";
535
536
  CpmmErrorCode2[CpmmErrorCode2["OracleNotInitialized"] = 6015] = "OracleNotInitialized";
536
537
  CpmmErrorCode2[CpmmErrorCode2["ZeroSharesOut"] = 6016] = "ZeroSharesOut";
537
- CpmmErrorCode2[CpmmErrorCode2["SentinelRejected"] = 6017] = "SentinelRejected";
538
- CpmmErrorCode2[CpmmErrorCode2["SentinelCpiFailed"] = 6018] = "SentinelCpiFailed";
539
- CpmmErrorCode2[CpmmErrorCode2["SentinelProgramNotProvided"] = 6019] = "SentinelProgramNotProvided";
540
- CpmmErrorCode2[CpmmErrorCode2["SentinelProgramNotExecutable"] = 6020] = "SentinelProgramNotExecutable";
541
- CpmmErrorCode2[CpmmErrorCode2["SentinelReturnDataMissing"] = 6021] = "SentinelReturnDataMissing";
542
- CpmmErrorCode2[CpmmErrorCode2["SentinelReturnDataInvalid"] = 6022] = "SentinelReturnDataInvalid";
543
- CpmmErrorCode2[CpmmErrorCode2["SentinelNotAllowlisted"] = 6023] = "SentinelNotAllowlisted";
538
+ CpmmErrorCode2[CpmmErrorCode2["HookRejected"] = 6017] = "HookRejected";
539
+ CpmmErrorCode2[CpmmErrorCode2["HookCpiFailed"] = 6018] = "HookCpiFailed";
540
+ CpmmErrorCode2[CpmmErrorCode2["HookProgramNotProvided"] = 6019] = "HookProgramNotProvided";
541
+ CpmmErrorCode2[CpmmErrorCode2["HookProgramNotExecutable"] = 6020] = "HookProgramNotExecutable";
542
+ CpmmErrorCode2[CpmmErrorCode2["HookReturnDataMissing"] = 6021] = "HookReturnDataMissing";
543
+ CpmmErrorCode2[CpmmErrorCode2["HookReturnDataInvalid"] = 6022] = "HookReturnDataInvalid";
544
+ CpmmErrorCode2[CpmmErrorCode2["HookNotAllowlisted"] = 6023] = "HookNotAllowlisted";
544
545
  CpmmErrorCode2[CpmmErrorCode2["TotalSharesZero"] = 6024] = "TotalSharesZero";
545
546
  CpmmErrorCode2[CpmmErrorCode2["AmountZero"] = 6025] = "AmountZero";
546
547
  CpmmErrorCode2[CpmmErrorCode2["Paused"] = 6026] = "Paused";
@@ -548,6 +549,8 @@ var CpmmErrorCode = /* @__PURE__ */ ((CpmmErrorCode2) => {
548
549
  CpmmErrorCode2[CpmmErrorCode2["InvalidMint"] = 6028] = "InvalidMint";
549
550
  CpmmErrorCode2[CpmmErrorCode2["InvalidInput"] = 6029] = "InvalidInput";
550
551
  CpmmErrorCode2[CpmmErrorCode2["Reentrancy"] = 6030] = "Reentrancy";
552
+ CpmmErrorCode2[CpmmErrorCode2["CpiForbidden"] = 6031] = "CpiForbidden";
553
+ CpmmErrorCode2[CpmmErrorCode2["UseCollectProtocolFees"] = 6032] = "UseCollectProtocolFees";
551
554
  return CpmmErrorCode2;
552
555
  })(CpmmErrorCode || {});
553
556
  var CPMM_ERROR_MESSAGES = {
@@ -555,7 +558,7 @@ var CPMM_ERROR_MESSAGES = {
555
558
  [6001 /* PoolLocked */]: "Pool is currently locked (reentrancy protection)",
556
559
  [6002 /* InvalidFee */]: "Invalid fee value (exceeds max or invalid range)",
557
560
  [6003 /* InvalidFeeSplit */]: "Invalid fee split value (exceeds max or invalid range)",
558
- [6004 /* InvalidDirection */]: "Invalid swap direction (must be 0 or 1)",
561
+ [6004 /* InvalidTradeDirection */]: "Invalid trade direction (must be 0 or 1)",
559
562
  [6005 /* InsufficientLiquidity */]: "Insufficient liquidity for this operation",
560
563
  [6006 /* SlippageExceeded */]: "Slippage exceeded: Output amount less than minimum",
561
564
  [6007 /* MathOverflow */]: "Math operation overflowed",
@@ -568,20 +571,22 @@ var CPMM_ERROR_MESSAGES = {
568
571
  [6014 /* NotSupportedInV0_1 */]: "Not supported in v0.1",
569
572
  [6015 /* OracleNotInitialized */]: "Oracle not initialized for this pool",
570
573
  [6016 /* ZeroSharesOut */]: "Zero shares out",
571
- [6017 /* SentinelRejected */]: "Sentinel program rejected the operation",
572
- [6018 /* SentinelCpiFailed */]: "Sentinel CPI call failed",
573
- [6019 /* SentinelProgramNotProvided */]: "Sentinel program account not provided",
574
- [6020 /* SentinelProgramNotExecutable */]: "Sentinel program account is not executable",
575
- [6021 /* SentinelReturnDataMissing */]: "Sentinel return data missing or wrong program id",
576
- [6022 /* SentinelReturnDataInvalid */]: "Sentinel return data invalid length or could not deserialize",
577
- [6023 /* SentinelNotAllowlisted */]: "Sentinel program not in allowlist",
574
+ [6017 /* HookRejected */]: "Hook rejected",
575
+ [6018 /* HookCpiFailed */]: "Hook CPI failed",
576
+ [6019 /* HookProgramNotProvided */]: "Hook program account not provided",
577
+ [6020 /* HookProgramNotExecutable */]: "Hook program account is not executable",
578
+ [6021 /* HookReturnDataMissing */]: "Hook return data missing or wrong program id",
579
+ [6022 /* HookReturnDataInvalid */]: "Hook return data invalid length or could not deserialize",
580
+ [6023 /* HookNotAllowlisted */]: "Hook not allowlisted",
578
581
  [6024 /* TotalSharesZero */]: "Pool has zero shares (no liquidity)",
579
582
  [6025 /* AmountZero */]: "Amount cannot be zero",
580
583
  [6026 /* Paused */]: "Pool is paused by admin",
581
584
  [6027 /* InvariantViolation */]: "Internal invariant violation",
582
585
  [6028 /* InvalidMint */]: "Invalid mint address",
583
586
  [6029 /* InvalidInput */]: "Invalid input parameter",
584
- [6030 /* Reentrancy */]: "Reentrancy detected"
587
+ [6030 /* Reentrancy */]: "Reentrancy detected",
588
+ [6031 /* CpiForbidden */]: "CPI calls into this program are forbidden",
589
+ [6032 /* UseCollectProtocolFees */]: "Protocol fee position must be claimed via collect_protocol_fees"
585
590
  };
586
591
  var CpmmError = class extends Error {
587
592
  constructor(code, logs) {
@@ -604,14 +609,14 @@ function parseErrorFromLogs(logs) {
604
609
  );
605
610
  if (anchorMatch) {
606
611
  const errorNumber = parseInt(anchorMatch[2], 10);
607
- if (errorNumber >= 6e3 && errorNumber <= 6030) {
612
+ if (errorNumber >= 6e3 && errorNumber <= 6032) {
608
613
  return new CpmmError(errorNumber, logs);
609
614
  }
610
615
  }
611
616
  const hexMatch = log.match(/Error Number:\s*0x([0-9a-fA-F]+)/);
612
617
  if (hexMatch) {
613
618
  const errorNumber = parseInt(hexMatch[1], 16);
614
- if (errorNumber >= 6e3 && errorNumber <= 6030) {
619
+ if (errorNumber >= 6e3 && errorNumber <= 6032) {
615
620
  return new CpmmError(errorNumber, logs);
616
621
  }
617
622
  }
@@ -628,7 +633,7 @@ function parseErrorFromLogs(logs) {
628
633
  return null;
629
634
  }
630
635
  function isCpmmError(code) {
631
- return code >= 6e3 && code <= 6030;
636
+ return code >= 6e3 && code <= 6032;
632
637
  }
633
638
  function getErrorMessage(code) {
634
639
  if (isCpmmError(code)) {
@@ -689,8 +694,8 @@ async function getAddLiquidityInstructionAsync(input, config) {
689
694
  config: { value: input.config ?? null, isWritable: false },
690
695
  pool: { value: input.pool ?? null, isWritable: true },
691
696
  position: { value: input.position ?? null, isWritable: true },
692
- protocolPosition: {
693
- value: input.protocolPosition ?? null,
697
+ protocolFeePosition: {
698
+ value: input.protocolFeePosition ?? null,
694
699
  isWritable: true
695
700
  },
696
701
  owner: { value: input.owner ?? null, isWritable: false },
@@ -726,7 +731,7 @@ async function getAddLiquidityInstructionAsync(input, config) {
726
731
  getAccountMeta("config", accounts.config),
727
732
  getAccountMeta("pool", accounts.pool),
728
733
  getAccountMeta("position", accounts.position),
729
- getAccountMeta("protocolPosition", accounts.protocolPosition),
734
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
730
735
  getAccountMeta("owner", accounts.owner),
731
736
  getAccountMeta("authority", accounts.authority),
732
737
  getAccountMeta("vault0", accounts.vault0),
@@ -751,8 +756,8 @@ function getAddLiquidityInstruction(input, config) {
751
756
  config: { value: input.config ?? null, isWritable: false },
752
757
  pool: { value: input.pool ?? null, isWritable: true },
753
758
  position: { value: input.position ?? null, isWritable: true },
754
- protocolPosition: {
755
- value: input.protocolPosition ?? null,
759
+ protocolFeePosition: {
760
+ value: input.protocolFeePosition ?? null,
756
761
  isWritable: true
757
762
  },
758
763
  owner: { value: input.owner ?? null, isWritable: false },
@@ -775,7 +780,7 @@ function getAddLiquidityInstruction(input, config) {
775
780
  getAccountMeta("config", accounts.config),
776
781
  getAccountMeta("pool", accounts.pool),
777
782
  getAccountMeta("position", accounts.position),
778
- getAccountMeta("protocolPosition", accounts.protocolPosition),
783
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
779
784
  getAccountMeta("owner", accounts.owner),
780
785
  getAccountMeta("authority", accounts.authority),
781
786
  getAccountMeta("vault0", accounts.vault0),
@@ -820,7 +825,7 @@ function parseAddLiquidityInstruction(instruction) {
820
825
  config: getNextAccount(),
821
826
  pool: getNextAccount(),
822
827
  position: getNextAccount(),
823
- protocolPosition: getNextAccount(),
828
+ protocolFeePosition: getNextAccount(),
824
829
  owner: getNextAccount(),
825
830
  authority: getNextAccount(),
826
831
  vault0: getNextAccount(),
@@ -1128,8 +1133,8 @@ async function getCollectProtocolFeesInstructionAsync(input, config) {
1128
1133
  const originalAccounts = {
1129
1134
  config: { value: input.config ?? null, isWritable: false },
1130
1135
  pool: { value: input.pool ?? null, isWritable: true },
1131
- protocolPosition: {
1132
- value: input.protocolPosition ?? null,
1136
+ protocolFeePosition: {
1137
+ value: input.protocolFeePosition ?? null,
1133
1138
  isWritable: true
1134
1139
  },
1135
1140
  admin: { value: input.admin ?? null, isWritable: false },
@@ -1163,7 +1168,7 @@ async function getCollectProtocolFeesInstructionAsync(input, config) {
1163
1168
  accounts: [
1164
1169
  getAccountMeta("config", accounts.config),
1165
1170
  getAccountMeta("pool", accounts.pool),
1166
- getAccountMeta("protocolPosition", accounts.protocolPosition),
1171
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
1167
1172
  getAccountMeta("admin", accounts.admin),
1168
1173
  getAccountMeta("authority", accounts.authority),
1169
1174
  getAccountMeta("vault0", accounts.vault0),
@@ -1186,8 +1191,8 @@ function getCollectProtocolFeesInstruction(input, config) {
1186
1191
  const originalAccounts = {
1187
1192
  config: { value: input.config ?? null, isWritable: false },
1188
1193
  pool: { value: input.pool ?? null, isWritable: true },
1189
- protocolPosition: {
1190
- value: input.protocolPosition ?? null,
1194
+ protocolFeePosition: {
1195
+ value: input.protocolFeePosition ?? null,
1191
1196
  isWritable: true
1192
1197
  },
1193
1198
  admin: { value: input.admin ?? null, isWritable: false },
@@ -1208,7 +1213,7 @@ function getCollectProtocolFeesInstruction(input, config) {
1208
1213
  accounts: [
1209
1214
  getAccountMeta("config", accounts.config),
1210
1215
  getAccountMeta("pool", accounts.pool),
1211
- getAccountMeta("protocolPosition", accounts.protocolPosition),
1216
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
1212
1217
  getAccountMeta("admin", accounts.admin),
1213
1218
  getAccountMeta("authority", accounts.authority),
1214
1219
  getAccountMeta("vault0", accounts.vault0),
@@ -1247,7 +1252,7 @@ function parseCollectProtocolFeesInstruction(instruction) {
1247
1252
  accounts: {
1248
1253
  config: getNextAccount(),
1249
1254
  pool: getNextAccount(),
1250
- protocolPosition: getNextAccount(),
1255
+ protocolFeePosition: getNextAccount(),
1251
1256
  admin: getNextAccount(),
1252
1257
  authority: getNextAccount(),
1253
1258
  vault0: getNextAccount(),
@@ -1434,7 +1439,7 @@ function getInitializeConfigInstructionDataEncoder() {
1434
1439
  ["maxRouteHops", kit.getU8Encoder()],
1435
1440
  ["protocolFeeEnabled", kit.getBooleanEncoder()],
1436
1441
  ["protocolFeeBps", kit.getU16Encoder()],
1437
- ["sentinelAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
1442
+ ["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
1438
1443
  ]),
1439
1444
  (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR })
1440
1445
  );
@@ -1449,7 +1454,7 @@ function getInitializeConfigInstructionDataDecoder() {
1449
1454
  ["maxRouteHops", kit.getU8Decoder()],
1450
1455
  ["protocolFeeEnabled", kit.getBooleanDecoder()],
1451
1456
  ["protocolFeeBps", kit.getU16Decoder()],
1452
- ["sentinelAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
1457
+ ["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
1453
1458
  ]);
1454
1459
  }
1455
1460
  function getInitializeConfigInstructionDataCodec() {
@@ -1710,7 +1715,7 @@ function getInitializePoolInstructionDataEncoder() {
1710
1715
  ["mintB", kit.getAddressEncoder()],
1711
1716
  ["initialSwapFeeBps", kit.getU16Encoder()],
1712
1717
  ["initialFeeSplitBps", kit.getU16Encoder()],
1713
- ["liquidityMeasureSide", kit.getU8Encoder()],
1718
+ ["liquidityMeasureTokenIndex", kit.getU8Encoder()],
1714
1719
  ["numeraireMintOverride", kit.getOptionEncoder(kit.getAddressEncoder())]
1715
1720
  ]),
1716
1721
  (value) => ({ ...value, discriminator: INITIALIZE_POOL_DISCRIMINATOR })
@@ -1723,7 +1728,7 @@ function getInitializePoolInstructionDataDecoder() {
1723
1728
  ["mintB", kit.getAddressDecoder()],
1724
1729
  ["initialSwapFeeBps", kit.getU16Decoder()],
1725
1730
  ["initialFeeSplitBps", kit.getU16Decoder()],
1726
- ["liquidityMeasureSide", kit.getU8Decoder()],
1731
+ ["liquidityMeasureTokenIndex", kit.getU8Decoder()],
1727
1732
  ["numeraireMintOverride", kit.getOptionDecoder(kit.getAddressDecoder())]
1728
1733
  ]);
1729
1734
  }
@@ -1738,8 +1743,8 @@ async function getInitializePoolInstructionAsync(input, config) {
1738
1743
  const originalAccounts = {
1739
1744
  config: { value: input.config ?? null, isWritable: false },
1740
1745
  pool: { value: input.pool ?? null, isWritable: true },
1741
- protocolPosition: {
1742
- value: input.protocolPosition ?? null,
1746
+ protocolFeePosition: {
1747
+ value: input.protocolFeePosition ?? null,
1743
1748
  isWritable: true
1744
1749
  },
1745
1750
  authority: { value: input.authority ?? null, isWritable: false },
@@ -1779,8 +1784,8 @@ async function getInitializePoolInstructionAsync(input, config) {
1779
1784
  ]
1780
1785
  });
1781
1786
  }
1782
- if (!accounts.protocolPosition.value) {
1783
- accounts.protocolPosition.value = await kit.getProgramDerivedAddress({
1787
+ if (!accounts.protocolFeePosition.value) {
1788
+ accounts.protocolFeePosition.value = await kit.getProgramDerivedAddress({
1784
1789
  programAddress,
1785
1790
  seeds: [
1786
1791
  kit.getBytesEncoder().encode(
@@ -1856,7 +1861,7 @@ async function getInitializePoolInstructionAsync(input, config) {
1856
1861
  accounts: [
1857
1862
  getAccountMeta("config", accounts.config),
1858
1863
  getAccountMeta("pool", accounts.pool),
1859
- getAccountMeta("protocolPosition", accounts.protocolPosition),
1864
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
1860
1865
  getAccountMeta("authority", accounts.authority),
1861
1866
  getAccountMeta("vault0", accounts.vault0),
1862
1867
  getAccountMeta("vault1", accounts.vault1),
@@ -1880,8 +1885,8 @@ function getInitializePoolInstruction(input, config) {
1880
1885
  const originalAccounts = {
1881
1886
  config: { value: input.config ?? null, isWritable: false },
1882
1887
  pool: { value: input.pool ?? null, isWritable: true },
1883
- protocolPosition: {
1884
- value: input.protocolPosition ?? null,
1888
+ protocolFeePosition: {
1889
+ value: input.protocolFeePosition ?? null,
1885
1890
  isWritable: true
1886
1891
  },
1887
1892
  authority: { value: input.authority ?? null, isWritable: false },
@@ -1912,7 +1917,7 @@ function getInitializePoolInstruction(input, config) {
1912
1917
  accounts: [
1913
1918
  getAccountMeta("config", accounts.config),
1914
1919
  getAccountMeta("pool", accounts.pool),
1915
- getAccountMeta("protocolPosition", accounts.protocolPosition),
1920
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
1916
1921
  getAccountMeta("authority", accounts.authority),
1917
1922
  getAccountMeta("vault0", accounts.vault0),
1918
1923
  getAccountMeta("vault1", accounts.vault1),
@@ -1952,7 +1957,7 @@ function parseInitializePoolInstruction(instruction) {
1952
1957
  accounts: {
1953
1958
  config: getNextAccount(),
1954
1959
  pool: getNextAccount(),
1955
- protocolPosition: getNextAccount(),
1960
+ protocolFeePosition: getNextAccount(),
1956
1961
  authority: getNextAccount(),
1957
1962
  vault0: getNextAccount(),
1958
1963
  vault1: getNextAccount(),
@@ -2265,7 +2270,7 @@ function getPreviewSwapExactInInstructionDataEncoder() {
2265
2270
  kit.getStructEncoder([
2266
2271
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
2267
2272
  ["amountIn", kit.getU64Encoder()],
2268
- ["direction", kit.getU8Encoder()]
2273
+ ["tradeDirection", kit.getU8Encoder()]
2269
2274
  ]),
2270
2275
  (value) => ({
2271
2276
  ...value,
@@ -2277,7 +2282,7 @@ function getPreviewSwapExactInInstructionDataDecoder() {
2277
2282
  return kit.getStructDecoder([
2278
2283
  ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
2279
2284
  ["amountIn", kit.getU64Decoder()],
2280
- ["direction", kit.getU8Decoder()]
2285
+ ["tradeDirection", kit.getU8Decoder()]
2281
2286
  ]);
2282
2287
  }
2283
2288
  function getPreviewSwapExactInInstructionDataCodec() {
@@ -2350,7 +2355,7 @@ function getQuoteToNumeraireInstructionDataEncoder() {
2350
2355
  kit.getStructEncoder([
2351
2356
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
2352
2357
  ["amount", kit.getU128Encoder()],
2353
- ["side", kit.getU8Encoder()],
2358
+ ["inputTokenIndex", kit.getU8Encoder()],
2354
2359
  ["maxHops", kit.getU8Encoder()],
2355
2360
  ["useTwap", kit.getBooleanEncoder()],
2356
2361
  ["windowSeconds", kit.getU32Encoder()]
@@ -2362,7 +2367,7 @@ function getQuoteToNumeraireInstructionDataDecoder() {
2362
2367
  return kit.getStructDecoder([
2363
2368
  ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
2364
2369
  ["amount", kit.getU128Decoder()],
2365
- ["side", kit.getU8Decoder()],
2370
+ ["inputTokenIndex", kit.getU8Decoder()],
2366
2371
  ["maxHops", kit.getU8Decoder()],
2367
2372
  ["useTwap", kit.getBooleanDecoder()],
2368
2373
  ["windowSeconds", kit.getU32Decoder()]
@@ -2464,8 +2469,8 @@ async function getRemoveLiquidityInstructionAsync(input, config) {
2464
2469
  config: { value: input.config ?? null, isWritable: false },
2465
2470
  pool: { value: input.pool ?? null, isWritable: true },
2466
2471
  position: { value: input.position ?? null, isWritable: true },
2467
- protocolPosition: {
2468
- value: input.protocolPosition ?? null,
2472
+ protocolFeePosition: {
2473
+ value: input.protocolFeePosition ?? null,
2469
2474
  isWritable: true
2470
2475
  },
2471
2476
  owner: { value: input.owner ?? null, isWritable: false },
@@ -2501,7 +2506,7 @@ async function getRemoveLiquidityInstructionAsync(input, config) {
2501
2506
  getAccountMeta("config", accounts.config),
2502
2507
  getAccountMeta("pool", accounts.pool),
2503
2508
  getAccountMeta("position", accounts.position),
2504
- getAccountMeta("protocolPosition", accounts.protocolPosition),
2509
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
2505
2510
  getAccountMeta("owner", accounts.owner),
2506
2511
  getAccountMeta("authority", accounts.authority),
2507
2512
  getAccountMeta("vault0", accounts.vault0),
@@ -2526,8 +2531,8 @@ function getRemoveLiquidityInstruction(input, config) {
2526
2531
  config: { value: input.config ?? null, isWritable: false },
2527
2532
  pool: { value: input.pool ?? null, isWritable: true },
2528
2533
  position: { value: input.position ?? null, isWritable: true },
2529
- protocolPosition: {
2530
- value: input.protocolPosition ?? null,
2534
+ protocolFeePosition: {
2535
+ value: input.protocolFeePosition ?? null,
2531
2536
  isWritable: true
2532
2537
  },
2533
2538
  owner: { value: input.owner ?? null, isWritable: false },
@@ -2550,7 +2555,7 @@ function getRemoveLiquidityInstruction(input, config) {
2550
2555
  getAccountMeta("config", accounts.config),
2551
2556
  getAccountMeta("pool", accounts.pool),
2552
2557
  getAccountMeta("position", accounts.position),
2553
- getAccountMeta("protocolPosition", accounts.protocolPosition),
2558
+ getAccountMeta("protocolFeePosition", accounts.protocolFeePosition),
2554
2559
  getAccountMeta("owner", accounts.owner),
2555
2560
  getAccountMeta("authority", accounts.authority),
2556
2561
  getAccountMeta("vault0", accounts.vault0),
@@ -2595,7 +2600,7 @@ function parseRemoveLiquidityInstruction(instruction) {
2595
2600
  config: getNextAccount(),
2596
2601
  pool: getNextAccount(),
2597
2602
  position: getNextAccount(),
2598
- protocolPosition: getNextAccount(),
2603
+ protocolFeePosition: getNextAccount(),
2599
2604
  owner: getNextAccount(),
2600
2605
  authority: getNextAccount(),
2601
2606
  vault0: getNextAccount(),
@@ -2695,48 +2700,47 @@ function parseSetFeesInstruction(instruction) {
2695
2700
  data: getSetFeesInstructionDataDecoder().decode(instruction.data)
2696
2701
  };
2697
2702
  }
2698
- var SET_ROUTE_DISCRIMINATOR = new Uint8Array([
2699
- 244,
2700
- 231,
2701
- 3,
2702
- 84,
2703
- 233,
2704
- 61,
2705
- 146,
2706
- 149
2703
+ var SET_HOOK_DISCRIMINATOR = new Uint8Array([
2704
+ 175,
2705
+ 16,
2706
+ 187,
2707
+ 252,
2708
+ 19,
2709
+ 54,
2710
+ 111,
2711
+ 221
2707
2712
  ]);
2708
- function getSetRouteDiscriminatorBytes() {
2709
- return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_ROUTE_DISCRIMINATOR);
2713
+ function getSetHookDiscriminatorBytes() {
2714
+ return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_HOOK_DISCRIMINATOR);
2710
2715
  }
2711
- function getSetRouteInstructionDataEncoder() {
2716
+ function getSetHookInstructionDataEncoder() {
2712
2717
  return kit.transformEncoder(
2713
2718
  kit.getStructEncoder([
2714
2719
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
2715
- ["routeNextPool", kit.getAddressEncoder()],
2716
- ["routeBridgeMint", kit.getAddressEncoder()]
2720
+ ["hookProgram", kit.getAddressEncoder()],
2721
+ ["hookFlags", kit.getU32Encoder()]
2717
2722
  ]),
2718
- (value) => ({ ...value, discriminator: SET_ROUTE_DISCRIMINATOR })
2723
+ (value) => ({ ...value, discriminator: SET_HOOK_DISCRIMINATOR })
2719
2724
  );
2720
2725
  }
2721
- function getSetRouteInstructionDataDecoder() {
2726
+ function getSetHookInstructionDataDecoder() {
2722
2727
  return kit.getStructDecoder([
2723
2728
  ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
2724
- ["routeNextPool", kit.getAddressDecoder()],
2725
- ["routeBridgeMint", kit.getAddressDecoder()]
2729
+ ["hookProgram", kit.getAddressDecoder()],
2730
+ ["hookFlags", kit.getU32Decoder()]
2726
2731
  ]);
2727
2732
  }
2728
- function getSetRouteInstructionDataCodec() {
2733
+ function getSetHookInstructionDataCodec() {
2729
2734
  return kit.combineCodec(
2730
- getSetRouteInstructionDataEncoder(),
2731
- getSetRouteInstructionDataDecoder()
2735
+ getSetHookInstructionDataEncoder(),
2736
+ getSetHookInstructionDataDecoder()
2732
2737
  );
2733
2738
  }
2734
- function getSetRouteInstruction(input, config) {
2739
+ function getSetHookInstruction(input, config) {
2735
2740
  const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
2736
2741
  const originalAccounts = {
2737
2742
  config: { value: input.config ?? null, isWritable: false },
2738
2743
  pool: { value: input.pool ?? null, isWritable: true },
2739
- nextPool: { value: input.nextPool ?? null, isWritable: false },
2740
2744
  admin: { value: input.admin ?? null, isWritable: false }
2741
2745
  };
2742
2746
  const accounts = originalAccounts;
@@ -2746,22 +2750,21 @@ function getSetRouteInstruction(input, config) {
2746
2750
  accounts: [
2747
2751
  getAccountMeta("config", accounts.config),
2748
2752
  getAccountMeta("pool", accounts.pool),
2749
- getAccountMeta("nextPool", accounts.nextPool),
2750
2753
  getAccountMeta("admin", accounts.admin)
2751
2754
  ],
2752
- data: getSetRouteInstructionDataEncoder().encode(
2755
+ data: getSetHookInstructionDataEncoder().encode(
2753
2756
  args
2754
2757
  ),
2755
2758
  programAddress
2756
2759
  });
2757
2760
  }
2758
- function parseSetRouteInstruction(instruction) {
2759
- if (instruction.accounts.length < 4) {
2761
+ function parseSetHookInstruction(instruction) {
2762
+ if (instruction.accounts.length < 3) {
2760
2763
  throw new kit.SolanaError(
2761
2764
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
2762
2765
  {
2763
2766
  actualAccountMetas: instruction.accounts.length,
2764
- expectedAccountMetas: 4
2767
+ expectedAccountMetas: 3
2765
2768
  }
2766
2769
  );
2767
2770
  }
@@ -2771,64 +2774,58 @@ function parseSetRouteInstruction(instruction) {
2771
2774
  accountIndex += 1;
2772
2775
  return accountMeta;
2773
2776
  };
2774
- const getNextOptionalAccount = () => {
2775
- const accountMeta = getNextAccount();
2776
- return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
2777
- };
2778
2777
  return {
2779
2778
  programAddress: instruction.programAddress,
2780
2779
  accounts: {
2781
2780
  config: getNextAccount(),
2782
2781
  pool: getNextAccount(),
2783
- nextPool: getNextOptionalAccount(),
2784
2782
  admin: getNextAccount()
2785
2783
  },
2786
- data: getSetRouteInstructionDataDecoder().decode(instruction.data)
2784
+ data: getSetHookInstructionDataDecoder().decode(instruction.data)
2787
2785
  };
2788
2786
  }
2789
- var SET_SENTINEL_DISCRIMINATOR = new Uint8Array([
2790
- 94,
2791
- 200,
2792
- 82,
2793
- 129,
2794
- 53,
2795
- 149,
2796
- 232,
2797
- 113
2787
+ var SET_ROUTE_DISCRIMINATOR = new Uint8Array([
2788
+ 244,
2789
+ 231,
2790
+ 3,
2791
+ 84,
2792
+ 233,
2793
+ 61,
2794
+ 146,
2795
+ 149
2798
2796
  ]);
2799
- function getSetSentinelDiscriminatorBytes() {
2800
- return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
2801
- SET_SENTINEL_DISCRIMINATOR
2802
- );
2797
+ function getSetRouteDiscriminatorBytes() {
2798
+ return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SET_ROUTE_DISCRIMINATOR);
2803
2799
  }
2804
- function getSetSentinelInstructionDataEncoder() {
2800
+ function getSetRouteInstructionDataEncoder() {
2805
2801
  return kit.transformEncoder(
2806
2802
  kit.getStructEncoder([
2807
2803
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
2808
- ["sentinelProgram", kit.getAddressEncoder()],
2809
- ["sentinelFlags", kit.getU32Encoder()]
2804
+ ["routeNextPool", kit.getAddressEncoder()],
2805
+ ["routeBridgeMint", kit.getAddressEncoder()]
2810
2806
  ]),
2811
- (value) => ({ ...value, discriminator: SET_SENTINEL_DISCRIMINATOR })
2807
+ (value) => ({ ...value, discriminator: SET_ROUTE_DISCRIMINATOR })
2812
2808
  );
2813
2809
  }
2814
- function getSetSentinelInstructionDataDecoder() {
2810
+ function getSetRouteInstructionDataDecoder() {
2815
2811
  return kit.getStructDecoder([
2816
2812
  ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
2817
- ["sentinelProgram", kit.getAddressDecoder()],
2818
- ["sentinelFlags", kit.getU32Decoder()]
2813
+ ["routeNextPool", kit.getAddressDecoder()],
2814
+ ["routeBridgeMint", kit.getAddressDecoder()]
2819
2815
  ]);
2820
2816
  }
2821
- function getSetSentinelInstructionDataCodec() {
2817
+ function getSetRouteInstructionDataCodec() {
2822
2818
  return kit.combineCodec(
2823
- getSetSentinelInstructionDataEncoder(),
2824
- getSetSentinelInstructionDataDecoder()
2819
+ getSetRouteInstructionDataEncoder(),
2820
+ getSetRouteInstructionDataDecoder()
2825
2821
  );
2826
2822
  }
2827
- function getSetSentinelInstruction(input, config) {
2823
+ function getSetRouteInstruction(input, config) {
2828
2824
  const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
2829
2825
  const originalAccounts = {
2830
2826
  config: { value: input.config ?? null, isWritable: false },
2831
2827
  pool: { value: input.pool ?? null, isWritable: true },
2828
+ nextPool: { value: input.nextPool ?? null, isWritable: false },
2832
2829
  admin: { value: input.admin ?? null, isWritable: false }
2833
2830
  };
2834
2831
  const accounts = originalAccounts;
@@ -2838,21 +2835,22 @@ function getSetSentinelInstruction(input, config) {
2838
2835
  accounts: [
2839
2836
  getAccountMeta("config", accounts.config),
2840
2837
  getAccountMeta("pool", accounts.pool),
2838
+ getAccountMeta("nextPool", accounts.nextPool),
2841
2839
  getAccountMeta("admin", accounts.admin)
2842
2840
  ],
2843
- data: getSetSentinelInstructionDataEncoder().encode(
2841
+ data: getSetRouteInstructionDataEncoder().encode(
2844
2842
  args
2845
2843
  ),
2846
2844
  programAddress
2847
2845
  });
2848
2846
  }
2849
- function parseSetSentinelInstruction(instruction) {
2850
- if (instruction.accounts.length < 3) {
2847
+ function parseSetRouteInstruction(instruction) {
2848
+ if (instruction.accounts.length < 4) {
2851
2849
  throw new kit.SolanaError(
2852
2850
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
2853
2851
  {
2854
2852
  actualAccountMetas: instruction.accounts.length,
2855
- expectedAccountMetas: 3
2853
+ expectedAccountMetas: 4
2856
2854
  }
2857
2855
  );
2858
2856
  }
@@ -2862,216 +2860,19 @@ function parseSetSentinelInstruction(instruction) {
2862
2860
  accountIndex += 1;
2863
2861
  return accountMeta;
2864
2862
  };
2865
- return {
2866
- programAddress: instruction.programAddress,
2867
- accounts: {
2868
- config: getNextAccount(),
2869
- pool: getNextAccount(),
2870
- admin: getNextAccount()
2871
- },
2872
- data: getSetSentinelInstructionDataDecoder().decode(instruction.data)
2873
- };
2874
- }
2875
- var SKIM_DISCRIMINATOR = new Uint8Array([
2876
- 238,
2877
- 120,
2878
- 221,
2879
- 138,
2880
- 82,
2881
- 60,
2882
- 100,
2883
- 218
2884
- ]);
2885
- function getSkimDiscriminatorBytes() {
2886
- return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(SKIM_DISCRIMINATOR);
2887
- }
2888
- function getSkimInstructionDataEncoder() {
2889
- return kit.transformEncoder(
2890
- kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
2891
- (value) => ({ ...value, discriminator: SKIM_DISCRIMINATOR })
2892
- );
2893
- }
2894
- function getSkimInstructionDataDecoder() {
2895
- return kit.getStructDecoder([
2896
- ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
2897
- ]);
2898
- }
2899
- function getSkimInstructionDataCodec() {
2900
- return kit.combineCodec(
2901
- getSkimInstructionDataEncoder(),
2902
- getSkimInstructionDataDecoder()
2903
- );
2904
- }
2905
- async function getSkimInstructionAsync(input, config) {
2906
- const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
2907
- const originalAccounts = {
2908
- config: { value: input.config ?? null, isWritable: false },
2909
- pool: { value: input.pool ?? null, isWritable: false },
2910
- admin: { value: input.admin ?? null, isWritable: false },
2911
- authority: { value: input.authority ?? null, isWritable: false },
2912
- vault0: { value: input.vault0 ?? null, isWritable: true },
2913
- vault1: { value: input.vault1 ?? null, isWritable: true },
2914
- token0Mint: { value: input.token0Mint ?? null, isWritable: false },
2915
- token1Mint: { value: input.token1Mint ?? null, isWritable: false },
2916
- adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
2917
- adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
2918
- token0Program: { value: input.token0Program ?? null, isWritable: false },
2919
- token1Program: { value: input.token1Program ?? null, isWritable: false }
2920
- };
2921
- const accounts = originalAccounts;
2922
- if (!accounts.authority.value) {
2923
- accounts.authority.value = await kit.getProgramDerivedAddress({
2924
- programAddress,
2925
- seeds: [
2926
- kit.getBytesEncoder().encode(
2927
- new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
2928
- ),
2929
- kit.getAddressEncoder().encode(
2930
- programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
2931
- )
2932
- ]
2933
- });
2934
- }
2935
- if (!accounts.adminAta0.value) {
2936
- accounts.adminAta0.value = await kit.getProgramDerivedAddress({
2937
- programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
2938
- seeds: [
2939
- kit.getAddressEncoder().encode(
2940
- programClientCore.getAddressFromResolvedInstructionAccount(
2941
- "admin",
2942
- accounts.admin.value
2943
- )
2944
- ),
2945
- kit.getAddressEncoder().encode(
2946
- programClientCore.getAddressFromResolvedInstructionAccount(
2947
- "token0Program",
2948
- accounts.token0Program.value
2949
- )
2950
- ),
2951
- kit.getAddressEncoder().encode(
2952
- programClientCore.getAddressFromResolvedInstructionAccount(
2953
- "token0Mint",
2954
- accounts.token0Mint.value
2955
- )
2956
- )
2957
- ]
2958
- });
2959
- }
2960
- if (!accounts.adminAta1.value) {
2961
- accounts.adminAta1.value = await kit.getProgramDerivedAddress({
2962
- programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
2963
- seeds: [
2964
- kit.getAddressEncoder().encode(
2965
- programClientCore.getAddressFromResolvedInstructionAccount(
2966
- "admin",
2967
- accounts.admin.value
2968
- )
2969
- ),
2970
- kit.getAddressEncoder().encode(
2971
- programClientCore.getAddressFromResolvedInstructionAccount(
2972
- "token1Program",
2973
- accounts.token1Program.value
2974
- )
2975
- ),
2976
- kit.getAddressEncoder().encode(
2977
- programClientCore.getAddressFromResolvedInstructionAccount(
2978
- "token1Mint",
2979
- accounts.token1Mint.value
2980
- )
2981
- )
2982
- ]
2983
- });
2984
- }
2985
- const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
2986
- return Object.freeze({
2987
- accounts: [
2988
- getAccountMeta("config", accounts.config),
2989
- getAccountMeta("pool", accounts.pool),
2990
- getAccountMeta("admin", accounts.admin),
2991
- getAccountMeta("authority", accounts.authority),
2992
- getAccountMeta("vault0", accounts.vault0),
2993
- getAccountMeta("vault1", accounts.vault1),
2994
- getAccountMeta("token0Mint", accounts.token0Mint),
2995
- getAccountMeta("token1Mint", accounts.token1Mint),
2996
- getAccountMeta("adminAta0", accounts.adminAta0),
2997
- getAccountMeta("adminAta1", accounts.adminAta1),
2998
- getAccountMeta("token0Program", accounts.token0Program),
2999
- getAccountMeta("token1Program", accounts.token1Program)
3000
- ],
3001
- data: getSkimInstructionDataEncoder().encode({}),
3002
- programAddress
3003
- });
3004
- }
3005
- function getSkimInstruction(input, config) {
3006
- const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
3007
- const originalAccounts = {
3008
- config: { value: input.config ?? null, isWritable: false },
3009
- pool: { value: input.pool ?? null, isWritable: false },
3010
- admin: { value: input.admin ?? null, isWritable: false },
3011
- authority: { value: input.authority ?? null, isWritable: false },
3012
- vault0: { value: input.vault0 ?? null, isWritable: true },
3013
- vault1: { value: input.vault1 ?? null, isWritable: true },
3014
- token0Mint: { value: input.token0Mint ?? null, isWritable: false },
3015
- token1Mint: { value: input.token1Mint ?? null, isWritable: false },
3016
- adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
3017
- adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
3018
- token0Program: { value: input.token0Program ?? null, isWritable: false },
3019
- token1Program: { value: input.token1Program ?? null, isWritable: false }
3020
- };
3021
- const accounts = originalAccounts;
3022
- const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
3023
- return Object.freeze({
3024
- accounts: [
3025
- getAccountMeta("config", accounts.config),
3026
- getAccountMeta("pool", accounts.pool),
3027
- getAccountMeta("admin", accounts.admin),
3028
- getAccountMeta("authority", accounts.authority),
3029
- getAccountMeta("vault0", accounts.vault0),
3030
- getAccountMeta("vault1", accounts.vault1),
3031
- getAccountMeta("token0Mint", accounts.token0Mint),
3032
- getAccountMeta("token1Mint", accounts.token1Mint),
3033
- getAccountMeta("adminAta0", accounts.adminAta0),
3034
- getAccountMeta("adminAta1", accounts.adminAta1),
3035
- getAccountMeta("token0Program", accounts.token0Program),
3036
- getAccountMeta("token1Program", accounts.token1Program)
3037
- ],
3038
- data: getSkimInstructionDataEncoder().encode({}),
3039
- programAddress
3040
- });
3041
- }
3042
- function parseSkimInstruction(instruction) {
3043
- if (instruction.accounts.length < 12) {
3044
- throw new kit.SolanaError(
3045
- kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
3046
- {
3047
- actualAccountMetas: instruction.accounts.length,
3048
- expectedAccountMetas: 12
3049
- }
3050
- );
3051
- }
3052
- let accountIndex = 0;
3053
- const getNextAccount = () => {
3054
- const accountMeta = instruction.accounts[accountIndex];
3055
- accountIndex += 1;
3056
- return accountMeta;
2863
+ const getNextOptionalAccount = () => {
2864
+ const accountMeta = getNextAccount();
2865
+ return accountMeta.address === CPMM_PROGRAM_ADDRESS ? void 0 : accountMeta;
3057
2866
  };
3058
2867
  return {
3059
2868
  programAddress: instruction.programAddress,
3060
2869
  accounts: {
3061
2870
  config: getNextAccount(),
3062
2871
  pool: getNextAccount(),
3063
- admin: getNextAccount(),
3064
- authority: getNextAccount(),
3065
- vault0: getNextAccount(),
3066
- vault1: getNextAccount(),
3067
- token0Mint: getNextAccount(),
3068
- token1Mint: getNextAccount(),
3069
- adminAta0: getNextAccount(),
3070
- adminAta1: getNextAccount(),
3071
- token0Program: getNextAccount(),
3072
- token1Program: getNextAccount()
2872
+ nextPool: getNextOptionalAccount(),
2873
+ admin: getNextAccount()
3073
2874
  },
3074
- data: getSkimInstructionDataDecoder().decode(instruction.data)
2875
+ data: getSetRouteInstructionDataDecoder().decode(instruction.data)
3075
2876
  };
3076
2877
  }
3077
2878
  var SWAP_EXACT_IN_DISCRIMINATOR = new Uint8Array([
@@ -3095,7 +2896,7 @@ function getSwapExactInInstructionDataEncoder() {
3095
2896
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
3096
2897
  ["amountIn", kit.getU64Encoder()],
3097
2898
  ["minAmountOut", kit.getU64Encoder()],
3098
- ["direction", kit.getU8Encoder()],
2899
+ ["tradeDirection", kit.getU8Encoder()],
3099
2900
  ["updateOracle", kit.getBooleanEncoder()]
3100
2901
  ]),
3101
2902
  (value) => ({ ...value, discriminator: SWAP_EXACT_IN_DISCRIMINATOR })
@@ -3106,7 +2907,7 @@ function getSwapExactInInstructionDataDecoder() {
3106
2907
  ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)],
3107
2908
  ["amountIn", kit.getU64Decoder()],
3108
2909
  ["minAmountOut", kit.getU64Decoder()],
3109
- ["direction", kit.getU8Decoder()],
2910
+ ["tradeDirection", kit.getU8Decoder()],
3110
2911
  ["updateOracle", kit.getBooleanDecoder()]
3111
2912
  ]);
3112
2913
  }
@@ -3425,7 +3226,7 @@ function getUpdateConfigInstructionDataEncoder() {
3425
3226
  ["maxRouteHops", kit.getU8Encoder()],
3426
3227
  ["protocolFeeEnabled", kit.getBooleanEncoder()],
3427
3228
  ["protocolFeeBps", kit.getU16Encoder()],
3428
- ["sentinelAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
3229
+ ["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
3429
3230
  ]),
3430
3231
  (value) => ({ ...value, discriminator: UPDATE_CONFIG_DISCRIMINATOR })
3431
3232
  );
@@ -3439,7 +3240,7 @@ function getUpdateConfigInstructionDataDecoder() {
3439
3240
  ["maxRouteHops", kit.getU8Decoder()],
3440
3241
  ["protocolFeeEnabled", kit.getBooleanDecoder()],
3441
3242
  ["protocolFeeBps", kit.getU16Decoder()],
3442
- ["sentinelAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
3243
+ ["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
3443
3244
  ]);
3444
3245
  }
3445
3246
  function getUpdateConfigInstructionDataCodec() {
@@ -3448,33 +3249,227 @@ function getUpdateConfigInstructionDataCodec() {
3448
3249
  getUpdateConfigInstructionDataDecoder()
3449
3250
  );
3450
3251
  }
3451
- function getUpdateConfigInstruction(input, config) {
3252
+ function getUpdateConfigInstruction(input, config) {
3253
+ const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
3254
+ const originalAccounts = {
3255
+ config: { value: input.config ?? null, isWritable: true },
3256
+ admin: { value: input.admin ?? null, isWritable: false }
3257
+ };
3258
+ const accounts = originalAccounts;
3259
+ const args = { ...input };
3260
+ const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
3261
+ return Object.freeze({
3262
+ accounts: [
3263
+ getAccountMeta("config", accounts.config),
3264
+ getAccountMeta("admin", accounts.admin)
3265
+ ],
3266
+ data: getUpdateConfigInstructionDataEncoder().encode(
3267
+ args
3268
+ ),
3269
+ programAddress
3270
+ });
3271
+ }
3272
+ function parseUpdateConfigInstruction(instruction) {
3273
+ if (instruction.accounts.length < 2) {
3274
+ throw new kit.SolanaError(
3275
+ kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
3276
+ {
3277
+ actualAccountMetas: instruction.accounts.length,
3278
+ expectedAccountMetas: 2
3279
+ }
3280
+ );
3281
+ }
3282
+ let accountIndex = 0;
3283
+ const getNextAccount = () => {
3284
+ const accountMeta = instruction.accounts[accountIndex];
3285
+ accountIndex += 1;
3286
+ return accountMeta;
3287
+ };
3288
+ return {
3289
+ programAddress: instruction.programAddress,
3290
+ accounts: { config: getNextAccount(), admin: getNextAccount() },
3291
+ data: getUpdateConfigInstructionDataDecoder().decode(instruction.data)
3292
+ };
3293
+ }
3294
+ var WITHDRAW_VAULT_EXCESS_DISCRIMINATOR = new Uint8Array([
3295
+ 235,
3296
+ 197,
3297
+ 247,
3298
+ 177,
3299
+ 137,
3300
+ 72,
3301
+ 135,
3302
+ 113
3303
+ ]);
3304
+ function getWithdrawVaultExcessDiscriminatorBytes() {
3305
+ return kit.fixEncoderSize(kit.getBytesEncoder(), 8).encode(
3306
+ WITHDRAW_VAULT_EXCESS_DISCRIMINATOR
3307
+ );
3308
+ }
3309
+ function getWithdrawVaultExcessInstructionDataEncoder() {
3310
+ return kit.transformEncoder(
3311
+ kit.getStructEncoder([["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)]]),
3312
+ (value) => ({
3313
+ ...value,
3314
+ discriminator: WITHDRAW_VAULT_EXCESS_DISCRIMINATOR
3315
+ })
3316
+ );
3317
+ }
3318
+ function getWithdrawVaultExcessInstructionDataDecoder() {
3319
+ return kit.getStructDecoder([
3320
+ ["discriminator", kit.fixDecoderSize(kit.getBytesDecoder(), 8)]
3321
+ ]);
3322
+ }
3323
+ function getWithdrawVaultExcessInstructionDataCodec() {
3324
+ return kit.combineCodec(
3325
+ getWithdrawVaultExcessInstructionDataEncoder(),
3326
+ getWithdrawVaultExcessInstructionDataDecoder()
3327
+ );
3328
+ }
3329
+ async function getWithdrawVaultExcessInstructionAsync(input, config) {
3330
+ const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
3331
+ const originalAccounts = {
3332
+ config: { value: input.config ?? null, isWritable: false },
3333
+ pool: { value: input.pool ?? null, isWritable: false },
3334
+ admin: { value: input.admin ?? null, isWritable: false },
3335
+ authority: { value: input.authority ?? null, isWritable: false },
3336
+ vault0: { value: input.vault0 ?? null, isWritable: true },
3337
+ vault1: { value: input.vault1 ?? null, isWritable: true },
3338
+ token0Mint: { value: input.token0Mint ?? null, isWritable: false },
3339
+ token1Mint: { value: input.token1Mint ?? null, isWritable: false },
3340
+ adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
3341
+ adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
3342
+ token0Program: { value: input.token0Program ?? null, isWritable: false },
3343
+ token1Program: { value: input.token1Program ?? null, isWritable: false }
3344
+ };
3345
+ const accounts = originalAccounts;
3346
+ if (!accounts.authority.value) {
3347
+ accounts.authority.value = await kit.getProgramDerivedAddress({
3348
+ programAddress,
3349
+ seeds: [
3350
+ kit.getBytesEncoder().encode(
3351
+ new Uint8Array([97, 117, 116, 104, 111, 114, 105, 116, 121])
3352
+ ),
3353
+ kit.getAddressEncoder().encode(
3354
+ programClientCore.getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)
3355
+ )
3356
+ ]
3357
+ });
3358
+ }
3359
+ if (!accounts.adminAta0.value) {
3360
+ accounts.adminAta0.value = await kit.getProgramDerivedAddress({
3361
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
3362
+ seeds: [
3363
+ kit.getAddressEncoder().encode(
3364
+ programClientCore.getAddressFromResolvedInstructionAccount(
3365
+ "admin",
3366
+ accounts.admin.value
3367
+ )
3368
+ ),
3369
+ kit.getAddressEncoder().encode(
3370
+ programClientCore.getAddressFromResolvedInstructionAccount(
3371
+ "token0Program",
3372
+ accounts.token0Program.value
3373
+ )
3374
+ ),
3375
+ kit.getAddressEncoder().encode(
3376
+ programClientCore.getAddressFromResolvedInstructionAccount(
3377
+ "token0Mint",
3378
+ accounts.token0Mint.value
3379
+ )
3380
+ )
3381
+ ]
3382
+ });
3383
+ }
3384
+ if (!accounts.adminAta1.value) {
3385
+ accounts.adminAta1.value = await kit.getProgramDerivedAddress({
3386
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
3387
+ seeds: [
3388
+ kit.getAddressEncoder().encode(
3389
+ programClientCore.getAddressFromResolvedInstructionAccount(
3390
+ "admin",
3391
+ accounts.admin.value
3392
+ )
3393
+ ),
3394
+ kit.getAddressEncoder().encode(
3395
+ programClientCore.getAddressFromResolvedInstructionAccount(
3396
+ "token1Program",
3397
+ accounts.token1Program.value
3398
+ )
3399
+ ),
3400
+ kit.getAddressEncoder().encode(
3401
+ programClientCore.getAddressFromResolvedInstructionAccount(
3402
+ "token1Mint",
3403
+ accounts.token1Mint.value
3404
+ )
3405
+ )
3406
+ ]
3407
+ });
3408
+ }
3409
+ const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
3410
+ return Object.freeze({
3411
+ accounts: [
3412
+ getAccountMeta("config", accounts.config),
3413
+ getAccountMeta("pool", accounts.pool),
3414
+ getAccountMeta("admin", accounts.admin),
3415
+ getAccountMeta("authority", accounts.authority),
3416
+ getAccountMeta("vault0", accounts.vault0),
3417
+ getAccountMeta("vault1", accounts.vault1),
3418
+ getAccountMeta("token0Mint", accounts.token0Mint),
3419
+ getAccountMeta("token1Mint", accounts.token1Mint),
3420
+ getAccountMeta("adminAta0", accounts.adminAta0),
3421
+ getAccountMeta("adminAta1", accounts.adminAta1),
3422
+ getAccountMeta("token0Program", accounts.token0Program),
3423
+ getAccountMeta("token1Program", accounts.token1Program)
3424
+ ],
3425
+ data: getWithdrawVaultExcessInstructionDataEncoder().encode({}),
3426
+ programAddress
3427
+ });
3428
+ }
3429
+ function getWithdrawVaultExcessInstruction(input, config) {
3452
3430
  const programAddress = config?.programAddress ?? CPMM_PROGRAM_ADDRESS;
3453
3431
  const originalAccounts = {
3454
- config: { value: input.config ?? null, isWritable: true },
3455
- admin: { value: input.admin ?? null, isWritable: false }
3432
+ config: { value: input.config ?? null, isWritable: false },
3433
+ pool: { value: input.pool ?? null, isWritable: false },
3434
+ admin: { value: input.admin ?? null, isWritable: false },
3435
+ authority: { value: input.authority ?? null, isWritable: false },
3436
+ vault0: { value: input.vault0 ?? null, isWritable: true },
3437
+ vault1: { value: input.vault1 ?? null, isWritable: true },
3438
+ token0Mint: { value: input.token0Mint ?? null, isWritable: false },
3439
+ token1Mint: { value: input.token1Mint ?? null, isWritable: false },
3440
+ adminAta0: { value: input.adminAta0 ?? null, isWritable: true },
3441
+ adminAta1: { value: input.adminAta1 ?? null, isWritable: true },
3442
+ token0Program: { value: input.token0Program ?? null, isWritable: false },
3443
+ token1Program: { value: input.token1Program ?? null, isWritable: false }
3456
3444
  };
3457
3445
  const accounts = originalAccounts;
3458
- const args = { ...input };
3459
3446
  const getAccountMeta = programClientCore.getAccountMetaFactory(programAddress, "programId");
3460
3447
  return Object.freeze({
3461
3448
  accounts: [
3462
3449
  getAccountMeta("config", accounts.config),
3463
- getAccountMeta("admin", accounts.admin)
3450
+ getAccountMeta("pool", accounts.pool),
3451
+ getAccountMeta("admin", accounts.admin),
3452
+ getAccountMeta("authority", accounts.authority),
3453
+ getAccountMeta("vault0", accounts.vault0),
3454
+ getAccountMeta("vault1", accounts.vault1),
3455
+ getAccountMeta("token0Mint", accounts.token0Mint),
3456
+ getAccountMeta("token1Mint", accounts.token1Mint),
3457
+ getAccountMeta("adminAta0", accounts.adminAta0),
3458
+ getAccountMeta("adminAta1", accounts.adminAta1),
3459
+ getAccountMeta("token0Program", accounts.token0Program),
3460
+ getAccountMeta("token1Program", accounts.token1Program)
3464
3461
  ],
3465
- data: getUpdateConfigInstructionDataEncoder().encode(
3466
- args
3467
- ),
3462
+ data: getWithdrawVaultExcessInstructionDataEncoder().encode({}),
3468
3463
  programAddress
3469
3464
  });
3470
3465
  }
3471
- function parseUpdateConfigInstruction(instruction) {
3472
- if (instruction.accounts.length < 2) {
3466
+ function parseWithdrawVaultExcessInstruction(instruction) {
3467
+ if (instruction.accounts.length < 12) {
3473
3468
  throw new kit.SolanaError(
3474
3469
  kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS,
3475
3470
  {
3476
3471
  actualAccountMetas: instruction.accounts.length,
3477
- expectedAccountMetas: 2
3472
+ expectedAccountMetas: 12
3478
3473
  }
3479
3474
  );
3480
3475
  }
@@ -3486,8 +3481,23 @@ function parseUpdateConfigInstruction(instruction) {
3486
3481
  };
3487
3482
  return {
3488
3483
  programAddress: instruction.programAddress,
3489
- accounts: { config: getNextAccount(), admin: getNextAccount() },
3490
- data: getUpdateConfigInstructionDataDecoder().decode(instruction.data)
3484
+ accounts: {
3485
+ config: getNextAccount(),
3486
+ pool: getNextAccount(),
3487
+ admin: getNextAccount(),
3488
+ authority: getNextAccount(),
3489
+ vault0: getNextAccount(),
3490
+ vault1: getNextAccount(),
3491
+ token0Mint: getNextAccount(),
3492
+ token1Mint: getNextAccount(),
3493
+ adminAta0: getNextAccount(),
3494
+ adminAta1: getNextAccount(),
3495
+ token0Program: getNextAccount(),
3496
+ token1Program: getNextAccount()
3497
+ },
3498
+ data: getWithdrawVaultExcessInstructionDataDecoder().decode(
3499
+ instruction.data
3500
+ )
3491
3501
  };
3492
3502
  }
3493
3503
  function isTransactionSigner(value) {
@@ -3520,7 +3530,7 @@ function createSwapInstruction(params) {
3520
3530
  user,
3521
3531
  amountIn,
3522
3532
  minAmountOut,
3523
- direction,
3533
+ tradeDirection,
3524
3534
  oracle,
3525
3535
  remainingAccounts = [],
3526
3536
  updateOracle = false,
@@ -3530,8 +3540,8 @@ function createSwapInstruction(params) {
3530
3540
  programId = CPMM_PROGRAM_ADDRESS
3531
3541
  } = params;
3532
3542
  const trader = typeof user === "string" ? kit.createNoopSigner(user) : user;
3533
- const [vaultIn, vaultOut] = direction === 0 ? [vault0, vault1] : [vault1, vault0];
3534
- const [userIn, userOut] = direction === 0 ? [userToken0, userToken1] : [userToken1, userToken0];
3543
+ const [vaultIn, vaultOut] = tradeDirection === 0 ? [vault0, vault1] : [vault1, vault0];
3544
+ const [userIn, userOut] = tradeDirection === 0 ? [userToken0, userToken1] : [userToken1, userToken0];
3535
3545
  const instruction = getSwapExactInInstruction(
3536
3546
  {
3537
3547
  config,
@@ -3544,12 +3554,12 @@ function createSwapInstruction(params) {
3544
3554
  userIn,
3545
3555
  userOut,
3546
3556
  trader,
3547
- token0Program: token0Program ?? tokenProgram ?? chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
3548
- token1Program: token1Program ?? tokenProgram ?? chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
3557
+ token0Program: token0Program ?? tokenProgram ?? chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
3558
+ token1Program: token1Program ?? tokenProgram ?? chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
3549
3559
  oracle,
3550
3560
  amountIn,
3551
3561
  minAmountOut,
3552
- direction,
3562
+ tradeDirection,
3553
3563
  updateOracle
3554
3564
  },
3555
3565
  { programAddress: programId }
@@ -3573,8 +3583,8 @@ function base64ToBytes(base64) {
3573
3583
  }
3574
3584
  return bytes;
3575
3585
  }
3576
- async function fetchConfig(rpc, programId = chunkAT33RY6T_cjs.CPMM_PROGRAM_ID, commitment) {
3577
- const [configAddress] = await chunkAT33RY6T_cjs.getConfigAddress(programId);
3586
+ async function fetchConfig(rpc, programId = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID, commitment) {
3587
+ const [configAddress] = await chunk3BW6IVP3_cjs.getConfigAddress(programId);
3578
3588
  const response = await rpc.getAccountInfo(configAddress, {
3579
3589
  encoding: "base64",
3580
3590
  commitment
@@ -3582,10 +3592,10 @@ async function fetchConfig(rpc, programId = chunkAT33RY6T_cjs.CPMM_PROGRAM_ID, c
3582
3592
  if (!response.value) {
3583
3593
  return null;
3584
3594
  }
3585
- return chunkLL7TW3GU_cjs.decodeAmmConfig(base64ToBytes(response.value.data[0]));
3595
+ return chunkW5TMS4RD_cjs.decodeAmmConfig(base64ToBytes(response.value.data[0]));
3586
3596
  }
3587
- async function fetchConfigWithAddress(rpc, programId = chunkAT33RY6T_cjs.CPMM_PROGRAM_ID, commitment) {
3588
- const [configAddress] = await chunkAT33RY6T_cjs.getConfigAddress(programId);
3597
+ async function fetchConfigWithAddress(rpc, programId = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID, commitment) {
3598
+ const [configAddress] = await chunk3BW6IVP3_cjs.getConfigAddress(programId);
3589
3599
  const account = await fetchConfig(rpc, programId, commitment);
3590
3600
  if (!account) {
3591
3601
  return null;
@@ -3597,33 +3607,35 @@ async function fetchConfigWithAddress(rpc, programId = chunkAT33RY6T_cjs.CPMM_PR
3597
3607
  var initializer_exports = {};
3598
3608
  chunkQ7SFCCGT_cjs.__export(initializer_exports, {
3599
3609
  BPF_LOADER_UPGRADEABLE_PROGRAM_ID: () => BPF_LOADER_UPGRADEABLE_PROGRAM_ID,
3600
- CPMM_SENTINEL_PROGRAM_ID: () => CPMM_SENTINEL_PROGRAM_ID,
3610
+ CPMM_HOOK_PROGRAM_ID: () => CPMM_HOOK_PROGRAM_ID,
3601
3611
  CURVE_KIND_XYK: () => CURVE_KIND_XYK,
3602
3612
  CURVE_PARAMS_FORMAT_XYK_V0: () => CURVE_PARAMS_FORMAT_XYK_V0,
3603
- DIRECTION_BUY: () => DIRECTION_BUY,
3604
- DIRECTION_SELL: () => DIRECTION_SELL,
3605
- DOPPLER_DEVNET_ALT: () => DOPPLER_DEVNET_ALT,
3613
+ DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND: () => DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND,
3606
3614
  EMPTY_REMAINING_ACCOUNTS_HASH: () => EMPTY_REMAINING_ACCOUNTS_HASH,
3615
+ HF_AFTER_CREATE: () => HF_AFTER_CREATE,
3616
+ HF_AFTER_MIGRATE: () => HF_AFTER_MIGRATE,
3617
+ HF_AFTER_SWAP: () => HF_AFTER_SWAP2,
3618
+ HF_BEFORE_CREATE: () => HF_BEFORE_CREATE,
3619
+ HF_BEFORE_MIGRATE: () => HF_BEFORE_MIGRATE,
3620
+ HF_BEFORE_SWAP: () => HF_BEFORE_SWAP2,
3621
+ HOOK_NO_CHANGE: () => HOOK_NO_CHANGE2,
3607
3622
  INITIALIZER_ACCOUNT_DISCRIMINATORS: () => INITIALIZER_ACCOUNT_DISCRIMINATORS,
3608
3623
  INITIALIZER_INSTRUCTION_DISCRIMINATORS: () => INITIALIZER_INSTRUCTION_DISCRIMINATORS,
3609
3624
  INITIALIZER_PROGRAM_ID: () => INITIALIZER_PROGRAM_ID,
3610
- MAX_CALLDATA: () => MAX_CALLDATA,
3625
+ MAX_HOOK_ALLOWLIST: () => MAX_HOOK_ALLOWLIST2,
3611
3626
  MAX_MIGRATOR_ALLOWLIST: () => MAX_MIGRATOR_ALLOWLIST,
3612
- MAX_SENTINEL_ALLOWLIST: () => MAX_SENTINEL_ALLOWLIST2,
3627
+ MAX_PAYLOAD: () => MAX_PAYLOAD,
3613
3628
  PHASE_ABORTED: () => PHASE_ABORTED,
3614
3629
  PHASE_MIGRATED: () => PHASE_MIGRATED,
3615
3630
  PHASE_TRADING: () => PHASE_TRADING,
3616
- PREDICTION_SENTINEL_PROGRAM_ID: () => PREDICTION_SENTINEL_PROGRAM_ID,
3631
+ PREDICTION_HOOK_PROGRAM_ID: () => PREDICTION_HOOK_PROGRAM_ID,
3617
3632
  SEED_CONFIG: () => SEED_CONFIG2,
3618
3633
  SEED_LAUNCH: () => SEED_LAUNCH,
3619
3634
  SEED_LAUNCH_AUTHORITY: () => SEED_LAUNCH_AUTHORITY,
3620
- SENTINEL_NO_CHANGE: () => SENTINEL_NO_CHANGE2,
3621
- SF_AFTER_CREATE: () => SF_AFTER_CREATE,
3622
- SF_AFTER_MIGRATE: () => SF_AFTER_MIGRATE,
3623
- SF_AFTER_SWAP: () => SF_AFTER_SWAP2,
3624
- SF_BEFORE_CREATE: () => SF_BEFORE_CREATE,
3625
- SF_BEFORE_MIGRATE: () => SF_BEFORE_MIGRATE,
3626
- SF_BEFORE_SWAP: () => SF_BEFORE_SWAP2,
3635
+ TRADE_DIRECTION_BUY: () => TRADE_DIRECTION_BUY,
3636
+ TRADE_DIRECTION_SELL: () => TRADE_DIRECTION_SELL,
3637
+ buildAddressLookupTableSetupInstructions: () => buildAddressLookupTableSetupInstructions,
3638
+ compressTransactionMessageWithLookupTable: () => compressTransactionMessageWithLookupTable,
3627
3639
  computeRemainingAccountsHash: () => computeRemainingAccountsHash,
3628
3640
  createCurveSwapExactInInstruction: () => createCurveSwapExactInInstruction,
3629
3641
  createInitializeConfigInstruction: () => createInitializeConfigInstruction,
@@ -3631,8 +3643,8 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
3631
3643
  createMigrateLaunchInstruction: () => createMigrateLaunchInstruction,
3632
3644
  createPreviewMigrationInstruction: () => createPreviewMigrationInstruction,
3633
3645
  createPreviewSwapExactInInstruction: () => createPreviewSwapExactInInstruction,
3646
+ createSetHookAllowlistInstruction: () => createSetHookAllowlistInstruction,
3634
3647
  createSetMigratorAllowlistInstruction: () => createSetMigratorAllowlistInstruction,
3635
- createSetSentinelAllowlistInstruction: () => createSetSentinelAllowlistInstruction,
3636
3648
  decodePreviewMigrationResult: () => decodePreviewMigrationResult,
3637
3649
  decodePreviewSwapExactInResult: () => decodePreviewSwapExactInResult,
3638
3650
  encodeU64LE: () => encodeU64LE,
@@ -3649,6 +3661,7 @@ chunkQ7SFCCGT_cjs.__export(initializer_exports, {
3649
3661
  getInitializeLaunchArgsCodec: () => getInitializeLaunchArgsCodec,
3650
3662
  getInitializeLaunchArgsDecoder: () => getInitializeLaunchArgsDecoder,
3651
3663
  getInitializeLaunchArgsEncoder: () => getInitializeLaunchArgsEncoder,
3664
+ getInstructionLookupTableAddresses: () => getInstructionLookupTableAddresses,
3652
3665
  getLaunchAddress: () => getLaunchAddress,
3653
3666
  getLaunchAuthorityAddress: () => getLaunchAuthorityAddress,
3654
3667
  getLaunchCodec: () => getLaunchCodec,
@@ -3666,10 +3679,10 @@ var INITIALIZER_PROGRAM_ID = kit.address(
3666
3679
  var BPF_LOADER_UPGRADEABLE_PROGRAM_ID = kit.address(
3667
3680
  "BPFLoaderUpgradeab1e11111111111111111111111"
3668
3681
  );
3669
- var CPMM_SENTINEL_PROGRAM_ID = kit.address(
3682
+ var CPMM_HOOK_PROGRAM_ID = kit.address(
3670
3683
  "2vJ1c62knEwZbxp3XdHB4RSmCfz55pA6tRkCho63gW7u"
3671
3684
  );
3672
- var PREDICTION_SENTINEL_PROGRAM_ID = kit.address(
3685
+ var PREDICTION_HOOK_PROGRAM_ID = kit.address(
3673
3686
  "7QcQDANJVC17Jgc6KjjeagSkm2zAphgHVPK5agJzyihB"
3674
3687
  );
3675
3688
  var SEED_CONFIG2 = "config";
@@ -3709,26 +3722,23 @@ var EMPTY_REMAINING_ACCOUNTS_HASH = new Uint8Array([
3709
3722
  36,
3710
3723
  76
3711
3724
  ]);
3712
- var DOPPLER_DEVNET_ALT = kit.address(
3713
- "7r5rdLkGMzTq5Q2kBhkePw4ZTeZEooHgTXktYoamNmVq"
3714
- );
3715
3725
  var MAX_MIGRATOR_ALLOWLIST = 32;
3716
- var MAX_SENTINEL_ALLOWLIST2 = 32;
3717
- var MAX_CALLDATA = 256;
3726
+ var MAX_HOOK_ALLOWLIST2 = 32;
3727
+ var MAX_PAYLOAD = 256;
3718
3728
  var PHASE_TRADING = 0;
3719
3729
  var PHASE_MIGRATED = 1;
3720
3730
  var PHASE_ABORTED = 2;
3721
- var DIRECTION_BUY = 0;
3722
- var DIRECTION_SELL = 1;
3731
+ var TRADE_DIRECTION_BUY = 0;
3732
+ var TRADE_DIRECTION_SELL = 1;
3723
3733
  var CURVE_KIND_XYK = 0;
3724
3734
  var CURVE_PARAMS_FORMAT_XYK_V0 = 0;
3725
- var SF_BEFORE_SWAP2 = 1 << 0;
3726
- var SF_AFTER_SWAP2 = 1 << 1;
3727
- var SF_BEFORE_CREATE = 1 << 2;
3728
- var SF_AFTER_CREATE = 1 << 3;
3729
- var SF_BEFORE_MIGRATE = 1 << 4;
3730
- var SF_AFTER_MIGRATE = 1 << 5;
3731
- var SENTINEL_NO_CHANGE2 = 65535;
3735
+ var HF_BEFORE_SWAP2 = 1 << 0;
3736
+ var HF_AFTER_SWAP2 = 1 << 1;
3737
+ var HF_BEFORE_CREATE = 1 << 2;
3738
+ var HF_AFTER_CREATE = 1 << 3;
3739
+ var HF_BEFORE_MIGRATE = 1 << 4;
3740
+ var HF_AFTER_MIGRATE = 1 << 5;
3741
+ var HOOK_NO_CHANGE2 = 65535;
3732
3742
  var INITIALIZER_INSTRUCTION_DISCRIMINATORS = {
3733
3743
  // SHA256("global:initialize_config")[0:8]
3734
3744
  initializeConfig: new Uint8Array([
@@ -3752,16 +3762,16 @@ var INITIALIZER_INSTRUCTION_DISCRIMINATORS = {
3752
3762
  233,
3753
3763
  168
3754
3764
  ]),
3755
- // SHA256("global:set_sentinel_allowlist")[0:8]
3756
- setSentinelAllowlist: new Uint8Array([
3757
- 233,
3758
- 72,
3759
- 180,
3760
- 246,
3761
- 171,
3762
- 117,
3763
- 21,
3764
- 50
3765
+ // SHA256("global:set_hook_allowlist")[0:8]
3766
+ setHookAllowlist: new Uint8Array([
3767
+ 232,
3768
+ 28,
3769
+ 40,
3770
+ 143,
3771
+ 121,
3772
+ 182,
3773
+ 77,
3774
+ 103
3765
3775
  ]),
3766
3776
  // SHA256("global:initialize_launch")[0:8]
3767
3777
  initializeLaunch: new Uint8Array([
@@ -3842,8 +3852,8 @@ function getInitConfigEncoder() {
3842
3852
  ["admin", kit.getAddressEncoder()],
3843
3853
  ["migratorAllowlistLen", kit.getU8Encoder()],
3844
3854
  ["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
3845
- ["sentinelAllowlistLen", kit.getU8Encoder()],
3846
- ["sentinelAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
3855
+ ["hookAllowlistLen", kit.getU8Encoder()],
3856
+ ["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder(), { size: 32 })],
3847
3857
  ["bump", kit.getU8Encoder()],
3848
3858
  ["version", kit.getU8Encoder()],
3849
3859
  ["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 31)]
@@ -3857,8 +3867,8 @@ function getInitConfigDecoder() {
3857
3867
  ["admin", kit.getAddressDecoder()],
3858
3868
  ["migratorAllowlistLen", kit.getU8Decoder()],
3859
3869
  ["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
3860
- ["sentinelAllowlistLen", kit.getU8Decoder()],
3861
- ["sentinelAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
3870
+ ["hookAllowlistLen", kit.getU8Decoder()],
3871
+ ["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder(), { size: 32 })],
3862
3872
  ["bump", kit.getU8Decoder()],
3863
3873
  ["version", kit.getU8Decoder()],
3864
3874
  ["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 31)]
@@ -3867,28 +3877,16 @@ function getInitConfigDecoder() {
3867
3877
  function getInitConfigCodec() {
3868
3878
  return kit.combineCodec(getInitConfigEncoder(), getInitConfigDecoder());
3869
3879
  }
3870
- function getCalldataBufEncoder() {
3871
- return kit.getStructEncoder([
3872
- ["len", kit.getU16Encoder()],
3873
- ["bytes", kit.fixEncoderSize(kit.getBytesEncoder(), 256)]
3874
- ]);
3875
- }
3876
- function getCalldataBufDecoder() {
3877
- return kit.getStructDecoder([
3878
- ["len", kit.getU16Decoder()],
3879
- ["bytes", kit.fixDecoderSize(kit.getBytesDecoder(), 256)]
3880
- ]);
3881
- }
3882
3880
  function getInitializeConfigArgsEncoder() {
3883
3881
  return kit.getStructEncoder([
3884
3882
  ["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
3885
- ["sentinelAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
3883
+ ["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
3886
3884
  ]);
3887
3885
  }
3888
3886
  function getInitializeConfigArgsDecoder() {
3889
3887
  return kit.getStructDecoder([
3890
3888
  ["migratorAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())],
3891
- ["sentinelAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
3889
+ ["hookAllowlist", kit.getArrayDecoder(kit.getAddressDecoder())]
3892
3890
  ]);
3893
3891
  }
3894
3892
  function getInitializeConfigArgsCodec() {
@@ -3912,27 +3910,21 @@ function getInitializeLaunchArgsEncoder() {
3912
3910
  ["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
3913
3911
  ["allowBuy", kit.getU8Encoder()],
3914
3912
  ["allowSell", kit.getU8Encoder()],
3915
- ["sentinelProgram", kit.getAddressEncoder()],
3916
- ["sentinelFlags", kit.getU32Encoder()],
3917
- [
3918
- "sentinelCalldata",
3919
- kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
3920
- ],
3921
- ["sentinelCreateRemainingAccountsLen", kit.getU32Encoder()],
3913
+ ["hookProgram", kit.getAddressEncoder()],
3914
+ ["hookFlags", kit.getU32Encoder()],
3915
+ ["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
3916
+ ["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
3922
3917
  ["migratorProgram", kit.getAddressEncoder()],
3923
3918
  [
3924
- "migratorInitCalldata",
3919
+ "migratorInitPayload",
3925
3920
  kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
3926
3921
  ],
3927
3922
  [
3928
- "migratorMigrateCalldata",
3923
+ "migratorMigratePayload",
3929
3924
  kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
3930
3925
  ],
3931
- [
3932
- "sentinelCreateRemainingAccountsHash",
3933
- kit.fixEncoderSize(kit.getBytesEncoder(), 32)
3934
- ],
3935
- ["sentinelRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
3926
+ ["hookCreateRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
3927
+ ["hookRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
3936
3928
  [
3937
3929
  "migratorInitRemainingAccountsHash",
3938
3930
  kit.fixEncoderSize(kit.getBytesEncoder(), 32)
@@ -3958,27 +3950,21 @@ function getInitializeLaunchArgsDecoder() {
3958
3950
  ["curveParams", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
3959
3951
  ["allowBuy", kit.getU8Decoder()],
3960
3952
  ["allowSell", kit.getU8Decoder()],
3961
- ["sentinelProgram", kit.getAddressDecoder()],
3962
- ["sentinelFlags", kit.getU32Decoder()],
3963
- [
3964
- "sentinelCalldata",
3965
- kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())
3966
- ],
3967
- ["sentinelCreateRemainingAccountsLen", kit.getU32Decoder()],
3953
+ ["hookProgram", kit.getAddressDecoder()],
3954
+ ["hookFlags", kit.getU32Decoder()],
3955
+ ["hookPayload", kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())],
3956
+ ["hookCreateRemainingAccountsLen", kit.getU32Decoder()],
3968
3957
  ["migratorProgram", kit.getAddressDecoder()],
3969
3958
  [
3970
- "migratorInitCalldata",
3959
+ "migratorInitPayload",
3971
3960
  kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())
3972
3961
  ],
3973
3962
  [
3974
- "migratorMigrateCalldata",
3963
+ "migratorMigratePayload",
3975
3964
  kit.addDecoderSizePrefix(kit.getBytesDecoder(), kit.getU32Decoder())
3976
3965
  ],
3977
- [
3978
- "sentinelCreateRemainingAccountsHash",
3979
- kit.fixDecoderSize(kit.getBytesDecoder(), 32)
3980
- ],
3981
- ["sentinelRemainingAccountsHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
3966
+ ["hookCreateRemainingAccountsHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
3967
+ ["hookRemainingAccountsHash", kit.fixDecoderSize(kit.getBytesDecoder(), 32)],
3982
3968
  [
3983
3969
  "migratorInitRemainingAccountsHash",
3984
3970
  kit.fixDecoderSize(kit.getBytesDecoder(), 32)
@@ -3995,6 +3981,18 @@ function getInitializeLaunchArgsCodec() {
3995
3981
  getInitializeLaunchArgsDecoder()
3996
3982
  );
3997
3983
  }
3984
+ function getPayloadBufEncoder() {
3985
+ return kit.getStructEncoder([
3986
+ ["len", kit.getU16Encoder()],
3987
+ ["bytes", kit.fixEncoderSize(kit.getBytesEncoder(), 256)]
3988
+ ]);
3989
+ }
3990
+ function getPayloadBufDecoder() {
3991
+ return kit.getStructDecoder([
3992
+ ["len", kit.getU16Decoder()],
3993
+ ["bytes", kit.fixDecoderSize(kit.getBytesDecoder(), 256)]
3994
+ ]);
3995
+ }
3998
3996
 
3999
3997
  // src/solana/generated/initializer/accounts/launch.ts
4000
3998
  var LAUNCH_DISCRIMINATOR = new Uint8Array([
@@ -4033,17 +4031,17 @@ function getLaunchEncoder() {
4033
4031
  ["allowBuy", kit.getU8Encoder()],
4034
4032
  ["allowSell", kit.getU8Encoder()],
4035
4033
  ["pad2", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
4036
- ["sentinelProgram", kit.getAddressEncoder()],
4037
- ["sentinelFlags", kit.getU32Encoder()],
4034
+ ["hookProgram", kit.getAddressEncoder()],
4035
+ ["hookFlags", kit.getU32Encoder()],
4038
4036
  ["pad3", kit.fixEncoderSize(kit.getBytesEncoder(), 4)],
4039
- ["sentinelCalldata", getCalldataBufEncoder()],
4037
+ ["hookPayload", getPayloadBufEncoder()],
4040
4038
  ["migratorProgram", kit.getAddressEncoder()],
4041
- ["migratorInitCalldata", getCalldataBufEncoder()],
4042
- ["migratorMigrateCalldata", getCalldataBufEncoder()],
4039
+ ["migratorInitPayload", getPayloadBufEncoder()],
4040
+ ["migratorMigratePayload", getPayloadBufEncoder()],
4043
4041
  ["curveKind", kit.getU8Encoder()],
4044
4042
  ["swapLock", kit.getU8Encoder()],
4045
4043
  ["pad4", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
4046
- ["curveParams", getCalldataBufEncoder()],
4044
+ ["curveParams", getPayloadBufEncoder()],
4047
4045
  ["quoteDeposited", kit.getU64Encoder()],
4048
4046
  ["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 64)]
4049
4047
  ]),
@@ -4075,17 +4073,17 @@ function getLaunchDecoder() {
4075
4073
  ["allowBuy", kit.getU8Decoder()],
4076
4074
  ["allowSell", kit.getU8Decoder()],
4077
4075
  ["pad2", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
4078
- ["sentinelProgram", kit.getAddressDecoder()],
4079
- ["sentinelFlags", kit.getU32Decoder()],
4076
+ ["hookProgram", kit.getAddressDecoder()],
4077
+ ["hookFlags", kit.getU32Decoder()],
4080
4078
  ["pad3", kit.fixDecoderSize(kit.getBytesDecoder(), 4)],
4081
- ["sentinelCalldata", getCalldataBufDecoder()],
4079
+ ["hookPayload", getPayloadBufDecoder()],
4082
4080
  ["migratorProgram", kit.getAddressDecoder()],
4083
- ["migratorInitCalldata", getCalldataBufDecoder()],
4084
- ["migratorMigrateCalldata", getCalldataBufDecoder()],
4081
+ ["migratorInitPayload", getPayloadBufDecoder()],
4082
+ ["migratorMigratePayload", getPayloadBufDecoder()],
4085
4083
  ["curveKind", kit.getU8Decoder()],
4086
4084
  ["swapLock", kit.getU8Decoder()],
4087
4085
  ["pad4", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
4088
- ["curveParams", getCalldataBufDecoder()],
4086
+ ["curveParams", getPayloadBufDecoder()],
4089
4087
  ["quoteDeposited", kit.getU64Decoder()],
4090
4088
  ["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 64)]
4091
4089
  ]);
@@ -4109,7 +4107,7 @@ function getCurveSwapExactInInstructionDataEncoder() {
4109
4107
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
4110
4108
  ["amountIn", kit.getU64Encoder()],
4111
4109
  ["minAmountOut", kit.getU64Encoder()],
4112
- ["direction", kit.getU8Encoder()]
4110
+ ["tradeDirection", kit.getU8Encoder()]
4113
4111
  ]),
4114
4112
  (value) => ({ ...value, discriminator: CURVE_SWAP_EXACT_IN_DISCRIMINATOR })
4115
4113
  );
@@ -4129,7 +4127,7 @@ function getInitializeConfigInstructionDataEncoder2() {
4129
4127
  kit.getStructEncoder([
4130
4128
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
4131
4129
  ["migratorAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())],
4132
- ["sentinelAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
4130
+ ["hookAllowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
4133
4131
  ]),
4134
4132
  (value) => ({ ...value, discriminator: INITIALIZE_CONFIG_DISCRIMINATOR2 })
4135
4133
  );
@@ -4161,27 +4159,24 @@ function getInitializeLaunchInstructionDataEncoder() {
4161
4159
  ["curveParams", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
4162
4160
  ["allowBuy", kit.getU8Encoder()],
4163
4161
  ["allowSell", kit.getU8Encoder()],
4164
- ["sentinelProgram", kit.getAddressEncoder()],
4165
- ["sentinelFlags", kit.getU32Encoder()],
4166
- [
4167
- "sentinelCalldata",
4168
- kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
4169
- ],
4170
- ["sentinelCreateRemainingAccountsLen", kit.getU32Encoder()],
4162
+ ["hookProgram", kit.getAddressEncoder()],
4163
+ ["hookFlags", kit.getU32Encoder()],
4164
+ ["hookPayload", kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())],
4165
+ ["hookCreateRemainingAccountsLen", kit.getU32Encoder()],
4171
4166
  ["migratorProgram", kit.getAddressEncoder()],
4172
4167
  [
4173
- "migratorInitCalldata",
4168
+ "migratorInitPayload",
4174
4169
  kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
4175
4170
  ],
4176
4171
  [
4177
- "migratorMigrateCalldata",
4172
+ "migratorMigratePayload",
4178
4173
  kit.addEncoderSizePrefix(kit.getBytesEncoder(), kit.getU32Encoder())
4179
4174
  ],
4180
4175
  [
4181
- "sentinelCreateRemainingAccountsHash",
4176
+ "hookCreateRemainingAccountsHash",
4182
4177
  kit.fixEncoderSize(kit.getBytesEncoder(), 32)
4183
4178
  ],
4184
- ["sentinelRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
4179
+ ["hookRemainingAccountsHash", kit.fixEncoderSize(kit.getBytesEncoder(), 32)],
4185
4180
  [
4186
4181
  "migratorInitRemainingAccountsHash",
4187
4182
  kit.fixEncoderSize(kit.getBytesEncoder(), 32)
@@ -4212,7 +4207,7 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
4212
4207
  kit.getStructEncoder([
4213
4208
  ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
4214
4209
  ["amountIn", kit.getU64Encoder()],
4215
- ["direction", kit.getU8Encoder()]
4210
+ ["tradeDirection", kit.getU8Encoder()]
4216
4211
  ]),
4217
4212
  (value) => ({
4218
4213
  ...value,
@@ -4220,6 +4215,25 @@ function getPreviewSwapExactInInstructionDataEncoder2() {
4220
4215
  })
4221
4216
  );
4222
4217
  }
4218
+ var SET_HOOK_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
4219
+ 232,
4220
+ 28,
4221
+ 40,
4222
+ 143,
4223
+ 121,
4224
+ 182,
4225
+ 77,
4226
+ 103
4227
+ ]);
4228
+ function getSetHookAllowlistInstructionDataEncoder() {
4229
+ return kit.transformEncoder(
4230
+ kit.getStructEncoder([
4231
+ ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
4232
+ ["allowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
4233
+ ]),
4234
+ (value) => ({ ...value, discriminator: SET_HOOK_ALLOWLIST_DISCRIMINATOR })
4235
+ );
4236
+ }
4223
4237
  var SET_MIGRATOR_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
4224
4238
  209,
4225
4239
  90,
@@ -4242,28 +4256,6 @@ function getSetMigratorAllowlistInstructionDataEncoder() {
4242
4256
  })
4243
4257
  );
4244
4258
  }
4245
- var SET_SENTINEL_ALLOWLIST_DISCRIMINATOR = new Uint8Array([
4246
- 233,
4247
- 72,
4248
- 180,
4249
- 246,
4250
- 171,
4251
- 117,
4252
- 21,
4253
- 50
4254
- ]);
4255
- function getSetSentinelAllowlistInstructionDataEncoder() {
4256
- return kit.transformEncoder(
4257
- kit.getStructEncoder([
4258
- ["discriminator", kit.fixEncoderSize(kit.getBytesEncoder(), 8)],
4259
- ["allowlist", kit.getArrayEncoder(kit.getAddressEncoder())]
4260
- ]),
4261
- (value) => ({
4262
- ...value,
4263
- discriminator: SET_SENTINEL_ALLOWLIST_DISCRIMINATOR
4264
- })
4265
- );
4266
- }
4267
4259
  if (process.env.NODE_ENV !== "production") ;
4268
4260
  var addressCodec2 = kit.getAddressCodec();
4269
4261
  var textEncoder2 = new TextEncoder();
@@ -4326,7 +4318,7 @@ function createInitializeConfigInstruction(accounts, args, programId = INITIALIZ
4326
4318
  admin,
4327
4319
  config,
4328
4320
  programData,
4329
- systemProgram = chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS
4321
+ systemProgram = chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS
4330
4322
  } = accounts;
4331
4323
  const keys = [
4332
4324
  createSignerAccountMeta(admin, kit.AccountRole.WRITABLE_SIGNER),
@@ -4368,14 +4360,14 @@ function createSignerAccountMeta3(value, role) {
4368
4360
  }
4369
4361
  return { address: value, role };
4370
4362
  }
4371
- function createSetSentinelAllowlistInstruction(accounts, allowlist, programId = INITIALIZER_PROGRAM_ID) {
4363
+ function createSetHookAllowlistInstruction(accounts, allowlist, programId = INITIALIZER_PROGRAM_ID) {
4372
4364
  const { admin, config } = accounts;
4373
4365
  const keys = [
4374
4366
  createSignerAccountMeta3(admin, kit.AccountRole.WRITABLE_SIGNER),
4375
4367
  { address: config, role: kit.AccountRole.WRITABLE }
4376
4368
  ];
4377
4369
  const data = new Uint8Array(
4378
- getSetSentinelAllowlistInstructionDataEncoder().encode({ allowlist })
4370
+ getSetHookAllowlistInstructionDataEncoder().encode({ allowlist })
4379
4371
  );
4380
4372
  return { programAddress: programId, accounts: keys, data };
4381
4373
  }
@@ -4676,21 +4668,6 @@ function getAccumulatorUpdatedCodec() {
4676
4668
  getAccumulatorUpdatedDecoder()
4677
4669
  );
4678
4670
  }
4679
- function getCalldataBufEncoder2() {
4680
- return kit.getStructEncoder([
4681
- ["len", kit.getU16Encoder()],
4682
- ["bytes", kit.fixEncoderSize(kit.getBytesEncoder(), 256)]
4683
- ]);
4684
- }
4685
- function getCalldataBufDecoder2() {
4686
- return kit.getStructDecoder([
4687
- ["len", kit.getU16Decoder()],
4688
- ["bytes", kit.fixDecoderSize(kit.getBytesDecoder(), 256)]
4689
- ]);
4690
- }
4691
- function getCalldataBufCodec() {
4692
- return kit.combineCodec(getCalldataBufEncoder2(), getCalldataBufDecoder2());
4693
- }
4694
4671
  function getEntryMigratedEncoder() {
4695
4672
  return kit.getStructEncoder([
4696
4673
  ["market", kit.getAddressEncoder()],
@@ -4783,6 +4760,21 @@ function getMigrateEntryArgsCodec() {
4783
4760
  getMigrateEntryArgsDecoder()
4784
4761
  );
4785
4762
  }
4763
+ function getPayloadBufEncoder2() {
4764
+ return kit.getStructEncoder([
4765
+ ["len", kit.getU16Encoder()],
4766
+ ["bytes", kit.fixEncoderSize(kit.getBytesEncoder(), 256)]
4767
+ ]);
4768
+ }
4769
+ function getPayloadBufDecoder2() {
4770
+ return kit.getStructDecoder([
4771
+ ["len", kit.getU16Decoder()],
4772
+ ["bytes", kit.fixDecoderSize(kit.getBytesDecoder(), 256)]
4773
+ ]);
4774
+ }
4775
+ function getPayloadBufCodec() {
4776
+ return kit.combineCodec(getPayloadBufEncoder2(), getPayloadBufDecoder2());
4777
+ }
4786
4778
  function getPreviewPayoutIfWinnerArgsEncoder() {
4787
4779
  return kit.getStructEncoder([
4788
4780
  ["candidateWinnerMint", kit.getAddressEncoder()],
@@ -4875,17 +4867,17 @@ function getLaunchEncoder2() {
4875
4867
  ["allowBuy", kit.getU8Encoder()],
4876
4868
  ["allowSell", kit.getU8Encoder()],
4877
4869
  ["pad2", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
4878
- ["sentinelProgram", kit.getAddressEncoder()],
4879
- ["sentinelFlags", kit.getU32Encoder()],
4870
+ ["hookProgram", kit.getAddressEncoder()],
4871
+ ["hookFlags", kit.getU32Encoder()],
4880
4872
  ["pad3", kit.fixEncoderSize(kit.getBytesEncoder(), 4)],
4881
- ["sentinelCalldata", getCalldataBufEncoder2()],
4873
+ ["hookPayload", getPayloadBufEncoder2()],
4882
4874
  ["migratorProgram", kit.getAddressEncoder()],
4883
- ["migratorInitCalldata", getCalldataBufEncoder2()],
4884
- ["migratorMigrateCalldata", getCalldataBufEncoder2()],
4875
+ ["migratorInitPayload", getPayloadBufEncoder2()],
4876
+ ["migratorMigratePayload", getPayloadBufEncoder2()],
4885
4877
  ["curveKind", kit.getU8Encoder()],
4886
4878
  ["swapLock", kit.getU8Encoder()],
4887
4879
  ["pad4", kit.fixEncoderSize(kit.getBytesEncoder(), 6)],
4888
- ["curveParams", getCalldataBufEncoder2()],
4880
+ ["curveParams", getPayloadBufEncoder2()],
4889
4881
  ["quoteDeposited", kit.getU64Encoder()],
4890
4882
  ["reserved", kit.fixEncoderSize(kit.getBytesEncoder(), 64)]
4891
4883
  ]),
@@ -4917,17 +4909,17 @@ function getLaunchDecoder2() {
4917
4909
  ["allowBuy", kit.getU8Decoder()],
4918
4910
  ["allowSell", kit.getU8Decoder()],
4919
4911
  ["pad2", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
4920
- ["sentinelProgram", kit.getAddressDecoder()],
4921
- ["sentinelFlags", kit.getU32Decoder()],
4912
+ ["hookProgram", kit.getAddressDecoder()],
4913
+ ["hookFlags", kit.getU32Decoder()],
4922
4914
  ["pad3", kit.fixDecoderSize(kit.getBytesDecoder(), 4)],
4923
- ["sentinelCalldata", getCalldataBufDecoder2()],
4915
+ ["hookPayload", getPayloadBufDecoder2()],
4924
4916
  ["migratorProgram", kit.getAddressDecoder()],
4925
- ["migratorInitCalldata", getCalldataBufDecoder2()],
4926
- ["migratorMigrateCalldata", getCalldataBufDecoder2()],
4917
+ ["migratorInitPayload", getPayloadBufDecoder2()],
4918
+ ["migratorMigratePayload", getPayloadBufDecoder2()],
4927
4919
  ["curveKind", kit.getU8Decoder()],
4928
4920
  ["swapLock", kit.getU8Decoder()],
4929
4921
  ["pad4", kit.fixDecoderSize(kit.getBytesDecoder(), 6)],
4930
- ["curveParams", getCalldataBufDecoder2()],
4922
+ ["curveParams", getPayloadBufDecoder2()],
4931
4923
  ["quoteDeposited", kit.getU64Decoder()],
4932
4924
  ["reserved", kit.fixDecoderSize(kit.getBytesDecoder(), 64)]
4933
4925
  ]);
@@ -6384,26 +6376,15 @@ function createAccountMeta(value, role) {
6384
6376
  async function getTokenMetadataAddress(mint) {
6385
6377
  const encoder = kit.getAddressEncoder();
6386
6378
  const [metadataAddress] = await kit.getProgramDerivedAddress({
6387
- programAddress: chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID,
6379
+ programAddress: chunk3BW6IVP3_cjs.TOKEN_METADATA_PROGRAM_ID,
6388
6380
  seeds: [
6389
6381
  new TextEncoder().encode("metadata"),
6390
- encoder.encode(chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID),
6382
+ encoder.encode(chunk3BW6IVP3_cjs.TOKEN_METADATA_PROGRAM_ID),
6391
6383
  encoder.encode(mint)
6392
6384
  ]
6393
6385
  });
6394
6386
  return metadataAddress;
6395
6387
  }
6396
- var ALT_INDEX = {
6397
- [chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS]: 0,
6398
- [chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS]: 1,
6399
- SysvarRent111111111111111111111111111111111: 2,
6400
- [INITIALIZER_PROGRAM_ID]: 3,
6401
- [chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID]: 4,
6402
- [CPMM_MIGRATOR_PROGRAM_ID]: 5,
6403
- So11111111111111111111111111111111111111112: 6,
6404
- [PREDICTION_MIGRATOR_PROGRAM_ADDRESS]: 8,
6405
- A9DojSvj32PMTTGctEcWZu9GSKuQVEhPkBXxDxmYu34o: 10
6406
- };
6407
6388
  function validateInitializeLaunchCurveParams(args) {
6408
6389
  if (args.curveKind !== CURVE_KIND_XYK) {
6409
6390
  throw new Error(
@@ -6426,16 +6407,15 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
6426
6407
  quoteVault,
6427
6408
  payer,
6428
6409
  authority,
6429
- sentinelProgram,
6410
+ hookProgram,
6430
6411
  migratorProgram,
6431
- baseTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
6432
- quoteTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
6433
- systemProgram = chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS,
6412
+ baseTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
6413
+ quoteTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
6414
+ systemProgram = chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS,
6434
6415
  rent,
6435
6416
  metadataAccount,
6436
- metadataProgram = chunkAT33RY6T_cjs.TOKEN_METADATA_PROGRAM_ID,
6437
- sentinelCreateRemainingAccounts = [],
6438
- addressLookupTable: alt
6417
+ metadataProgram = chunk3BW6IVP3_cjs.TOKEN_METADATA_PROGRAM_ID,
6418
+ hookCreateRemainingAccounts = []
6439
6419
  } = accounts;
6440
6420
  const withMetadata = Boolean(
6441
6421
  args.metadataName && args.metadataName.length > 0
@@ -6445,80 +6425,75 @@ async function createInitializeLaunchInstruction(accounts, args, programId = INI
6445
6425
  "metadataName is set but metadataAccount was not provided. Derive it with await initializer.getTokenMetadataAddress(baseMintAddress)."
6446
6426
  );
6447
6427
  }
6448
- const createHooksEnabled = (args.sentinelFlags & (SF_BEFORE_CREATE | SF_AFTER_CREATE)) !== 0;
6449
- const sentinelCreateRemainingAccountAddresses = sentinelCreateRemainingAccounts.map(
6428
+ const createHooksEnabled = (args.hookFlags & (HF_BEFORE_CREATE | HF_AFTER_CREATE)) !== 0;
6429
+ const hookCreateRemainingAccountAddresses = hookCreateRemainingAccounts.map(
6450
6430
  (account) => isTransactionSigner5(account) ? account.address : account
6451
6431
  );
6452
- const altIndexMap = alt ? ALT_INDEX : {};
6453
- function staticOrLookup(addr, role) {
6454
- if (alt && altIndexMap[addr] !== void 0) {
6455
- return {
6456
- address: addr,
6457
- role,
6458
- lookupTableAddress: alt,
6459
- addressIndex: altIndexMap[addr]
6460
- };
6461
- }
6462
- return { address: addr, role };
6463
- }
6464
6432
  const keys = [
6465
- staticOrLookup(config, kit.AccountRole.READONLY),
6433
+ { address: config, role: kit.AccountRole.READONLY },
6466
6434
  { address: launch, role: kit.AccountRole.WRITABLE },
6467
6435
  { address: launchAuthority, role: kit.AccountRole.READONLY },
6468
6436
  createAccountMeta(baseMint, kit.AccountRole.WRITABLE_SIGNER),
6469
- staticOrLookup(quoteMint, kit.AccountRole.READONLY),
6437
+ { address: quoteMint, role: kit.AccountRole.READONLY },
6470
6438
  createAccountMeta(baseVault, kit.AccountRole.WRITABLE_SIGNER),
6471
6439
  createAccountMeta(quoteVault, kit.AccountRole.WRITABLE_SIGNER),
6472
6440
  createAccountMeta(payer, kit.AccountRole.WRITABLE_SIGNER)
6473
6441
  ];
6474
6442
  keys.push(
6475
- authority ? createAccountMeta(authority, kit.AccountRole.READONLY_SIGNER) : staticOrLookup(programId, kit.AccountRole.READONLY)
6443
+ authority ? createAccountMeta(authority, kit.AccountRole.READONLY_SIGNER) : { address: programId, role: kit.AccountRole.READONLY }
6476
6444
  );
6477
6445
  keys.push(
6478
- sentinelProgram ? staticOrLookup(sentinelProgram, kit.AccountRole.READONLY) : staticOrLookup(programId, kit.AccountRole.READONLY)
6446
+ hookProgram ? { address: hookProgram, role: kit.AccountRole.READONLY } : { address: programId, role: kit.AccountRole.READONLY }
6479
6447
  );
6480
6448
  keys.push(
6481
- migratorProgram ? staticOrLookup(migratorProgram, kit.AccountRole.READONLY) : staticOrLookup(programId, kit.AccountRole.READONLY)
6449
+ migratorProgram ? { address: migratorProgram, role: kit.AccountRole.READONLY } : { address: programId, role: kit.AccountRole.READONLY }
6482
6450
  );
6483
- keys.push(staticOrLookup(baseTokenProgram, kit.AccountRole.READONLY));
6484
- keys.push(staticOrLookup(quoteTokenProgram, kit.AccountRole.READONLY));
6485
- keys.push(staticOrLookup(systemProgram, kit.AccountRole.READONLY));
6486
- keys.push(staticOrLookup(rent, kit.AccountRole.READONLY));
6451
+ keys.push({ address: baseTokenProgram, role: kit.AccountRole.READONLY });
6452
+ keys.push({ address: quoteTokenProgram, role: kit.AccountRole.READONLY });
6453
+ keys.push({ address: systemProgram, role: kit.AccountRole.READONLY });
6454
+ keys.push({ address: rent, role: kit.AccountRole.READONLY });
6487
6455
  if (withMetadata) {
6488
6456
  keys.push({ address: metadataAccount, role: kit.AccountRole.WRITABLE });
6489
- keys.push(staticOrLookup(metadataProgram, kit.AccountRole.READONLY));
6457
+ keys.push({ address: metadataProgram, role: kit.AccountRole.READONLY });
6490
6458
  } else {
6491
- keys.push(staticOrLookup(programId, kit.AccountRole.READONLY));
6492
- keys.push(staticOrLookup(programId, kit.AccountRole.READONLY));
6459
+ keys.push({ address: programId, role: kit.AccountRole.READONLY });
6460
+ keys.push({ address: programId, role: kit.AccountRole.READONLY });
6493
6461
  }
6494
6462
  const encoderArgs = {
6495
6463
  ...args,
6496
6464
  allowBuy: args.allowBuy ? 1 : 0,
6497
6465
  allowSell: args.allowSell ? 1 : 0,
6498
- sentinelProgram: args.sentinelProgram ?? sentinelProgram ?? chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS,
6499
- sentinelCreateRemainingAccountsLen: args.sentinelCreateRemainingAccountsLen ?? sentinelCreateRemainingAccounts.length,
6500
- migratorProgram: migratorProgram ?? chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS,
6501
- sentinelCreateRemainingAccountsHash: args.sentinelCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(sentinelCreateRemainingAccountAddresses) : new Uint8Array(32))
6466
+ hookProgram: args.hookProgram ?? hookProgram ?? chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS,
6467
+ hookCreateRemainingAccountsLen: args.hookCreateRemainingAccountsLen ?? hookCreateRemainingAccounts.length,
6468
+ migratorProgram: migratorProgram ?? chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS,
6469
+ hookCreateRemainingAccountsHash: args.hookCreateRemainingAccountsHash ?? (createHooksEnabled ? computeRemainingAccountsHash(hookCreateRemainingAccountAddresses) : new Uint8Array(32))
6502
6470
  };
6503
6471
  const data = new Uint8Array(
6504
6472
  getInitializeLaunchInstructionDataEncoder().encode(encoderArgs)
6505
6473
  );
6506
6474
  keys.push(
6507
- ...sentinelCreateRemainingAccounts.map(
6475
+ ...hookCreateRemainingAccounts.map(
6508
6476
  (account) => createAccountMeta(
6509
6477
  account,
6510
6478
  isTransactionSigner5(account) ? kit.AccountRole.READONLY_SIGNER : kit.AccountRole.READONLY
6511
6479
  )
6512
6480
  )
6513
6481
  );
6514
- if (migratorProgram === CPMM_MIGRATOR_PROGRAM_ID) {
6515
- if (!accounts.cpmmConfig) {
6482
+ const shouldAppendCpmmMigratorAccounts = accounts.cpmmConfig !== void 0 || migratorProgram === CPMM_MIGRATOR_PROGRAM_ID;
6483
+ if (shouldAppendCpmmMigratorAccounts) {
6484
+ if (!migratorProgram) {
6516
6485
  throw new Error(
6517
- "cpmmConfig is required when migratorProgram is CPMM_MIGRATOR_PROGRAM_ID"
6486
+ "migratorProgram is required when cpmmConfig is provided"
6518
6487
  );
6519
6488
  }
6520
- const [cpmmMigratorState] = await getCpmmMigratorStateAddress(launch);
6521
- keys.push({ address: cpmmMigratorState, role: kit.AccountRole.WRITABLE });
6489
+ if (!accounts.cpmmConfig) {
6490
+ throw new Error("cpmmConfig is required when using the CPMM migrator");
6491
+ }
6492
+ const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
6493
+ launch,
6494
+ migratorProgram
6495
+ );
6496
+ keys.push({ address: cpmmMigrationState, role: kit.AccountRole.WRITABLE });
6522
6497
  keys.push({ address: accounts.cpmmConfig, role: kit.AccountRole.READONLY });
6523
6498
  }
6524
6499
  if (migratorProgram === PREDICTION_MIGRATOR_PROGRAM_ADDRESS) {
@@ -6563,9 +6538,9 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
6563
6538
  baseMint,
6564
6539
  quoteMint,
6565
6540
  user,
6566
- sentinelProgram = chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS,
6567
- baseTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
6568
- quoteTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS
6541
+ hookProgram = chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS,
6542
+ baseTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
6543
+ quoteTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS
6569
6544
  } = accounts;
6570
6545
  const keys = [
6571
6546
  { address: config, role: kit.AccountRole.READONLY },
@@ -6578,10 +6553,10 @@ function createCurveSwapExactInInstruction(accounts, args, programId = INITIALIZ
6578
6553
  { address: baseMint, role: kit.AccountRole.READONLY },
6579
6554
  { address: quoteMint, role: kit.AccountRole.READONLY },
6580
6555
  createAccountMeta2(user, kit.AccountRole.READONLY_SIGNER),
6581
- // sentinel_program is Optional in the on-chain struct but still occupies a fixed
6556
+ // hook_program is Optional in the on-chain struct but still occupies a fixed
6582
6557
  // slot (token_program follows it). Always emit it — use SYSTEM_PROGRAM_ADDRESS as the
6583
- // no-op placeholder when no real sentinel is configured.
6584
- { address: sentinelProgram, role: kit.AccountRole.READONLY },
6558
+ // no-op placeholder when no real hook is configured.
6559
+ { address: hookProgram, role: kit.AccountRole.READONLY },
6585
6560
  { address: baseTokenProgram, role: kit.AccountRole.READONLY },
6586
6561
  { address: quoteTokenProgram, role: kit.AccountRole.READONLY }
6587
6562
  ];
@@ -6610,9 +6585,9 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
6610
6585
  quoteVault,
6611
6586
  migratorProgram,
6612
6587
  payer,
6613
- baseTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
6614
- quoteTokenProgram = chunkAT33RY6T_cjs.TOKEN_PROGRAM_ADDRESS,
6615
- systemProgram = chunkAT33RY6T_cjs.SYSTEM_PROGRAM_ADDRESS,
6588
+ baseTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
6589
+ quoteTokenProgram = chunk3BW6IVP3_cjs.TOKEN_PROGRAM_ADDRESS,
6590
+ systemProgram = chunk3BW6IVP3_cjs.SYSTEM_PROGRAM_ADDRESS,
6616
6591
  rent
6617
6592
  } = accounts;
6618
6593
  const keys = [
@@ -6630,7 +6605,7 @@ function createMigrateLaunchInstruction(accounts, programId = INITIALIZER_PROGRA
6630
6605
  { address: systemProgram, role: kit.AccountRole.READONLY },
6631
6606
  { address: rent, role: kit.AccountRole.READONLY }
6632
6607
  ];
6633
- const data = chunkLL7TW3GU_cjs.encodeInstructionData(
6608
+ const data = chunkW5TMS4RD_cjs.encodeInstructionData(
6634
6609
  INITIALIZER_INSTRUCTION_DISCRIMINATORS.migrateLaunch
6635
6610
  );
6636
6611
  return { programAddress: programId, accounts: keys, data };
@@ -6640,13 +6615,13 @@ var previewSwapExactInResultCodec = kit.getStructCodec([
6640
6615
  ["feePaid", kit.getU64Codec()]
6641
6616
  ]);
6642
6617
  function createPreviewSwapExactInInstruction(accounts, args, programId = INITIALIZER_PROGRAM_ID) {
6643
- const { launch, baseVault, quoteVault, sentinelProgram } = accounts;
6618
+ const { launch, baseVault, quoteVault, hookProgram } = accounts;
6644
6619
  const keys = [
6645
6620
  { address: launch, role: kit.AccountRole.READONLY },
6646
6621
  { address: baseVault, role: kit.AccountRole.READONLY },
6647
6622
  { address: quoteVault, role: kit.AccountRole.READONLY }
6648
6623
  ];
6649
- const accountsList = sentinelProgram ? [...keys, { address: sentinelProgram, role: kit.AccountRole.READONLY }] : keys;
6624
+ const accountsList = hookProgram ? [...keys, { address: hookProgram, role: kit.AccountRole.READONLY }] : keys;
6650
6625
  const data = new Uint8Array(
6651
6626
  getPreviewSwapExactInInstructionDataEncoder2().encode(args)
6652
6627
  );
@@ -6668,7 +6643,7 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
6668
6643
  { address: baseVault, role: kit.AccountRole.READONLY },
6669
6644
  { address: quoteVault, role: kit.AccountRole.READONLY }
6670
6645
  ];
6671
- const data = chunkLL7TW3GU_cjs.encodeInstructionData(
6646
+ const data = chunkW5TMS4RD_cjs.encodeInstructionData(
6672
6647
  INITIALIZER_INSTRUCTION_DISCRIMINATORS.previewMigration
6673
6648
  );
6674
6649
  return { programAddress: programId, accounts: keys, data };
@@ -6676,6 +6651,77 @@ function createPreviewMigrationInstruction(accounts, programId = INITIALIZER_PRO
6676
6651
  function decodePreviewMigrationResult(data) {
6677
6652
  return previewMigrationResultCodec.decode(data);
6678
6653
  }
6654
+ var DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND = 20;
6655
+ function getInstructionLookupTableAddresses(instructions) {
6656
+ const seen = /* @__PURE__ */ new Set();
6657
+ const addresses = [];
6658
+ for (const instruction of Array.isArray(instructions) ? instructions : [instructions]) {
6659
+ for (const account of instruction.accounts ?? []) {
6660
+ if ("signer" in account || account.role === kit.AccountRole.READONLY_SIGNER || account.role === kit.AccountRole.WRITABLE_SIGNER) {
6661
+ continue;
6662
+ }
6663
+ if (!seen.has(account.address)) {
6664
+ seen.add(account.address);
6665
+ addresses.push(account.address);
6666
+ }
6667
+ }
6668
+ }
6669
+ return addresses;
6670
+ }
6671
+ async function buildAddressLookupTableSetupInstructions({
6672
+ authority,
6673
+ payer,
6674
+ recentSlot,
6675
+ addresses,
6676
+ addressesPerExtendInstruction = DEFAULT_LOOKUP_TABLE_ADDRESSES_PER_EXTEND
6677
+ }) {
6678
+ if (addressesPerExtendInstruction <= 0) {
6679
+ throw new Error("addressesPerExtendInstruction must be greater than zero");
6680
+ }
6681
+ const dedupedAddresses = [...new Set(addresses)];
6682
+ const lookupTablePda = await addressLookupTable.findAddressLookupTablePda({
6683
+ authority: authority.address,
6684
+ recentSlot
6685
+ });
6686
+ const [lookupTableAddress] = lookupTablePda;
6687
+ const createInstruction = addressLookupTable.getCreateLookupTableInstruction({
6688
+ address: lookupTablePda,
6689
+ authority: authority.address,
6690
+ payer,
6691
+ recentSlot
6692
+ });
6693
+ const extendInstructions = [];
6694
+ for (let start = 0; start < dedupedAddresses.length; start += addressesPerExtendInstruction) {
6695
+ extendInstructions.push(
6696
+ addressLookupTable.getExtendLookupTableInstruction({
6697
+ address: lookupTableAddress,
6698
+ authority,
6699
+ payer,
6700
+ addresses: dedupedAddresses.slice(
6701
+ start,
6702
+ start + addressesPerExtendInstruction
6703
+ )
6704
+ })
6705
+ );
6706
+ }
6707
+ return {
6708
+ lookupTableAddress,
6709
+ createInstruction,
6710
+ extendInstructions,
6711
+ addresses: dedupedAddresses
6712
+ };
6713
+ }
6714
+ function compressTransactionMessageWithLookupTable(transactionMessage, {
6715
+ lookupTableAddress,
6716
+ addresses
6717
+ }) {
6718
+ return kit.compressTransactionMessageUsingAddressLookupTables(
6719
+ transactionMessage,
6720
+ {
6721
+ [lookupTableAddress]: [...addresses]
6722
+ }
6723
+ );
6724
+ }
6679
6725
  var addressCodec5 = kit.getAddressCodec();
6680
6726
  function bytesToBase64(bytes) {
6681
6727
  let binary = "";
@@ -6789,8 +6835,10 @@ chunkQ7SFCCGT_cjs.__export(cpmmMigrator_exports, {
6789
6835
  MAX_RECIPIENTS: () => MAX_RECIPIENTS,
6790
6836
  SEED_MIGRATION_AUTHORITY: () => SEED_MIGRATION_AUTHORITY,
6791
6837
  SEED_STATE: () => SEED_STATE,
6792
- encodeMigrateCalldata: () => encodeMigrateCalldata,
6793
- encodeRegisterLaunchCalldata: () => encodeRegisterLaunchCalldata,
6838
+ buildCpmmMigrationRemainingAccounts: () => buildCpmmMigrationRemainingAccounts,
6839
+ buildCpmmMigrationRemainingAccountsHash: () => buildCpmmMigrationRemainingAccountsHash,
6840
+ encodeMigratePayload: () => encodeMigratePayload,
6841
+ encodeRegisterLaunchPayload: () => encodeRegisterLaunchPayload,
6794
6842
  fetchCpmmMigratorState: () => fetchCpmmMigratorState,
6795
6843
  getCpmmMigrationAuthorityAddress: () => getCpmmMigrationAuthorityAddress,
6796
6844
  getCpmmMigratorStateAddress: () => getCpmmMigratorStateAddress,
@@ -6822,6 +6870,18 @@ function getMigrateArgsDecoder() {
6822
6870
  function getMigrateArgsCodec() {
6823
6871
  return kit.combineCodec(getMigrateArgsEncoder(), getMigrateArgsDecoder());
6824
6872
  }
6873
+ function getMigratedPoolHookConfigEncoder() {
6874
+ return kit.getStructEncoder([
6875
+ ["hookProgram", kit.getAddressEncoder()],
6876
+ ["hookFlags", kit.getU32Encoder()]
6877
+ ]);
6878
+ }
6879
+ function getMigratedPoolHookConfigDecoder() {
6880
+ return kit.getStructDecoder([
6881
+ ["hookProgram", kit.getAddressDecoder()],
6882
+ ["hookFlags", kit.getU32Decoder()]
6883
+ ]);
6884
+ }
6825
6885
  function getRecipientEncoder() {
6826
6886
  return kit.getStructEncoder([
6827
6887
  ["wallet", kit.getAddressEncoder()],
@@ -6844,7 +6904,11 @@ function getRegisterLaunchArgsEncoder() {
6844
6904
  ["initialFeeSplitBps", kit.getU16Encoder()],
6845
6905
  ["recipients", kit.getArrayEncoder(getRecipientEncoder())],
6846
6906
  ["minRaiseQuote", kit.getU64Encoder()],
6847
- ["minMigrationPriceQ64Opt", kit.getOptionEncoder(kit.getU128Encoder())]
6907
+ ["minMigrationPriceQ64Opt", kit.getOptionEncoder(kit.getU128Encoder())],
6908
+ [
6909
+ "migratedPoolHookConfig",
6910
+ kit.getOptionEncoder(getMigratedPoolHookConfigEncoder())
6911
+ ]
6848
6912
  ]);
6849
6913
  }
6850
6914
  function getRegisterLaunchArgsDecoder() {
@@ -6854,7 +6918,11 @@ function getRegisterLaunchArgsDecoder() {
6854
6918
  ["initialFeeSplitBps", kit.getU16Decoder()],
6855
6919
  ["recipients", kit.getArrayDecoder(getRecipientDecoder())],
6856
6920
  ["minRaiseQuote", kit.getU64Decoder()],
6857
- ["minMigrationPriceQ64Opt", kit.getOptionDecoder(kit.getU128Decoder())]
6921
+ ["minMigrationPriceQ64Opt", kit.getOptionDecoder(kit.getU128Decoder())],
6922
+ [
6923
+ "migratedPoolHookConfig",
6924
+ kit.getOptionDecoder(getMigratedPoolHookConfigDecoder())
6925
+ ]
6858
6926
  ]);
6859
6927
  }
6860
6928
  function getRegisterLaunchArgsCodec() {
@@ -6885,6 +6953,8 @@ function getCpmmMigratorStateEncoder() {
6885
6953
  ["initialSwapFeeBps", kit.getU16Encoder()],
6886
6954
  ["initialFeeSplitBps", kit.getU16Encoder()],
6887
6955
  ["pad0", kit.fixEncoderSize(kit.getBytesEncoder(), 4)],
6956
+ ["migratedPoolHookProgram", kit.getAddressEncoder()],
6957
+ ["migratedPoolHookFlags", kit.getU32Encoder()],
6888
6958
  ["recipients", kit.getArrayEncoder(getRecipientEncoder(), { size: 2 })],
6889
6959
  ["minRaiseQuote", kit.getU64Encoder()],
6890
6960
  ["minMigrationPriceQ64Opt", kit.getOptionEncoder(kit.getU128Encoder())],
@@ -6904,6 +6974,8 @@ function getCpmmMigratorStateDecoder() {
6904
6974
  ["initialSwapFeeBps", kit.getU16Decoder()],
6905
6975
  ["initialFeeSplitBps", kit.getU16Decoder()],
6906
6976
  ["pad0", kit.fixDecoderSize(kit.getBytesDecoder(), 4)],
6977
+ ["migratedPoolHookProgram", kit.getAddressDecoder()],
6978
+ ["migratedPoolHookFlags", kit.getU32Decoder()],
6907
6979
  ["recipients", kit.getArrayDecoder(getRecipientDecoder(), { size: 2 })],
6908
6980
  ["minRaiseQuote", kit.getU64Decoder()],
6909
6981
  ["minMigrationPriceQ64Opt", kit.getOptionDecoder(kit.getU128Decoder())],
@@ -6936,16 +7008,90 @@ async function fetchCpmmMigratorState(rpc, address3) {
6936
7008
  base64ToBytes3(response.value.data[0])
6937
7009
  );
6938
7010
  }
7011
+ async function buildCpmmMigrationRemainingAccounts({
7012
+ launch,
7013
+ baseMint,
7014
+ quoteMint,
7015
+ launchAuthority,
7016
+ adminBaseAta,
7017
+ adminQuoteAta,
7018
+ recipientAtas,
7019
+ cpmmProgram = chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
7020
+ cpmmMigratorProgram = CPMM_MIGRATOR_PROGRAM_ID
7021
+ }) {
7022
+ const [cpmmMigrationState] = await getCpmmMigratorStateAddress(
7023
+ launch,
7024
+ cpmmMigratorProgram
7025
+ );
7026
+ const [migrationAuthority] = await getCpmmMigrationAuthorityAddress(cpmmMigratorProgram);
7027
+ const poolInit = await chunk3BW6IVP3_cjs.getPoolInitAddresses(baseMint, quoteMint, cpmmProgram);
7028
+ const pool = poolInit.pool[0];
7029
+ const [launchLpPosition] = await chunk3BW6IVP3_cjs.getPositionAddress(
7030
+ pool,
7031
+ launchAuthority,
7032
+ 0n,
7033
+ cpmmProgram
7034
+ );
7035
+ const addresses = [
7036
+ cpmmMigrationState,
7037
+ poolInit.config[0],
7038
+ pool,
7039
+ poolInit.authority[0],
7040
+ poolInit.vault0[0],
7041
+ poolInit.vault1[0],
7042
+ poolInit.protocolFeePosition[0],
7043
+ launchLpPosition,
7044
+ cpmmProgram,
7045
+ migrationAuthority,
7046
+ adminBaseAta,
7047
+ adminQuoteAta,
7048
+ ...recipientAtas
7049
+ ];
7050
+ return {
7051
+ addresses,
7052
+ hash: computeRemainingAccountsHash(addresses),
7053
+ metas: [
7054
+ { address: cpmmMigrationState, role: kit.AccountRole.WRITABLE },
7055
+ { address: poolInit.config[0], role: kit.AccountRole.READONLY },
7056
+ { address: pool, role: kit.AccountRole.WRITABLE },
7057
+ { address: poolInit.authority[0], role: kit.AccountRole.READONLY },
7058
+ { address: poolInit.vault0[0], role: kit.AccountRole.WRITABLE },
7059
+ { address: poolInit.vault1[0], role: kit.AccountRole.WRITABLE },
7060
+ { address: poolInit.protocolFeePosition[0], role: kit.AccountRole.WRITABLE },
7061
+ { address: launchLpPosition, role: kit.AccountRole.WRITABLE },
7062
+ { address: cpmmProgram, role: kit.AccountRole.READONLY },
7063
+ { address: migrationAuthority, role: kit.AccountRole.READONLY },
7064
+ { address: adminBaseAta, role: kit.AccountRole.WRITABLE },
7065
+ { address: adminQuoteAta, role: kit.AccountRole.WRITABLE },
7066
+ ...recipientAtas.map((address3) => ({
7067
+ address: address3,
7068
+ role: kit.AccountRole.WRITABLE
7069
+ }))
7070
+ ],
7071
+ cpmmMigrationState,
7072
+ cpmmConfig: poolInit.config[0],
7073
+ pool,
7074
+ poolAuthority: poolInit.authority[0],
7075
+ poolVault0: poolInit.vault0[0],
7076
+ poolVault1: poolInit.vault1[0],
7077
+ protocolFeePosition: poolInit.protocolFeePosition[0],
7078
+ launchLpPosition,
7079
+ migrationAuthority
7080
+ };
7081
+ }
7082
+ async function buildCpmmMigrationRemainingAccountsHash(input) {
7083
+ return (await buildCpmmMigrationRemainingAccounts(input)).hash;
7084
+ }
6939
7085
 
6940
7086
  // src/solana/migrators/cpmmMigrator/index.ts
6941
- function encodeRegisterLaunchCalldata(args) {
7087
+ function encodeRegisterLaunchPayload(args) {
6942
7088
  const encoded = new Uint8Array(getRegisterLaunchArgsEncoder().encode(args));
6943
7089
  return kit.mergeBytes([
6944
7090
  CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.registerLaunch,
6945
7091
  encoded
6946
7092
  ]);
6947
7093
  }
6948
- function encodeMigrateCalldata(args) {
7094
+ function encodeMigratePayload(args) {
6949
7095
  const encoded = new Uint8Array(getMigrateArgsEncoder().encode(args));
6950
7096
  return kit.mergeBytes([
6951
7097
  CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS.migrate,
@@ -7022,9 +7168,6 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
7022
7168
  getAccumulatorUpdatedCodec: () => getAccumulatorUpdatedCodec,
7023
7169
  getAccumulatorUpdatedDecoder: () => getAccumulatorUpdatedDecoder,
7024
7170
  getAccumulatorUpdatedEncoder: () => getAccumulatorUpdatedEncoder,
7025
- getCalldataBufCodec: () => getCalldataBufCodec,
7026
- getCalldataBufDecoder: () => getCalldataBufDecoder2,
7027
- getCalldataBufEncoder: () => getCalldataBufEncoder2,
7028
7171
  getClaimDiscriminatorBytes: () => getClaimDiscriminatorBytes,
7029
7172
  getClaimInstruction: () => getClaimInstruction,
7030
7173
  getClaimInstructionAsync: () => getClaimInstructionAsync,
@@ -7082,6 +7225,9 @@ chunkQ7SFCCGT_cjs.__export(predictionMigrator_exports, {
7082
7225
  getOracleStateDiscriminatorBytes: () => getOracleStateDiscriminatorBytes,
7083
7226
  getOracleStateEncoder: () => getOracleStateEncoder,
7084
7227
  getOracleStateSize: () => getOracleStateSize,
7228
+ getPayloadBufCodec: () => getPayloadBufCodec,
7229
+ getPayloadBufDecoder: () => getPayloadBufDecoder2,
7230
+ getPayloadBufEncoder: () => getPayloadBufEncoder2,
7085
7231
  getPredictionEntryAddress: () => getPredictionEntryAddress,
7086
7232
  getPredictionEntryByMintAddress: () => getPredictionEntryByMintAddress,
7087
7233
  getPredictionMarketAddress: () => getPredictionMarketAddress,
@@ -7626,8 +7772,29 @@ async function getOracleStateAddress(oracleAuthority, nonce) {
7626
7772
  });
7627
7773
  }
7628
7774
 
7775
+ // src/solana/deployment.ts
7776
+ var DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = {
7777
+ cpmmProgram: chunk3BW6IVP3_cjs.CPMM_PROGRAM_ID,
7778
+ initializerProgram: INITIALIZER_PROGRAM_ID,
7779
+ cpmmMigratorProgram: CPMM_MIGRATOR_PROGRAM_ID,
7780
+ cpmmHookProgram: CPMM_HOOK_PROGRAM_ID
7781
+ };
7782
+ async function deriveSolanaCpmmDeployment(programs = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES) {
7783
+ const [cpmmConfig] = await chunk3BW6IVP3_cjs.getConfigAddress(programs.cpmmProgram);
7784
+ const [initializerConfig] = await getConfigAddress2(
7785
+ programs.initializerProgram
7786
+ );
7787
+ return {
7788
+ ...programs,
7789
+ cpmmConfig,
7790
+ initializerConfig
7791
+ };
7792
+ }
7793
+
7794
+ exports.DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES = DOPPLER_SOLANA_DEVNET_PROGRAM_ADDRESSES;
7629
7795
  exports.cpmm = cpmm_exports;
7630
7796
  exports.cpmmMigrator = cpmmMigrator_exports;
7797
+ exports.deriveSolanaCpmmDeployment = deriveSolanaCpmmDeployment;
7631
7798
  exports.initializer = initializer_exports;
7632
7799
  exports.predictionMigrator = predictionMigrator_exports;
7633
7800
  exports.trustedOracle = trustedOracle_exports;