@whetstone-research/doppler-sdk 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -19
- package/dist/chunk-BXATWUGJ.cjs +1111 -0
- package/dist/chunk-BXATWUGJ.cjs.map +1 -0
- package/dist/chunk-DPKVNI6Q.cjs +351 -0
- package/dist/chunk-DPKVNI6Q.cjs.map +1 -0
- package/dist/chunk-Q7SFCCGT.cjs +11 -0
- package/dist/chunk-Q7SFCCGT.cjs.map +1 -0
- package/dist/evm/index.cjs +15410 -0
- package/dist/evm/index.cjs.map +1 -0
- package/dist/evm/index.d.cts +8533 -0
- package/dist/oracle-CU-nZnja.d.cts +826 -0
- package/dist/pda-ZZMBZSFU.cjs +53 -0
- package/dist/pda-ZZMBZSFU.cjs.map +1 -0
- package/dist/solana/index.cjs +4981 -0
- package/dist/solana/index.cjs.map +1 -0
- package/dist/solana/index.d.cts +4584 -0
- package/dist/solana/react/index.cjs +1465 -0
- package/dist/solana/react/index.cjs.map +1 -0
- package/dist/solana/react/index.d.cts +1046 -0
- package/package.json +7 -4
|
@@ -0,0 +1,4584 @@
|
|
|
1
|
+
import { Address, ReadonlyUint8Array, Codec, ProgramDerivedAddress, Instruction, TransactionSigner, Rpc, GetAccountInfoApi, FixedSizeDecoder, FixedSizeEncoder, FixedSizeCodec, Encoder, Decoder, OptionOrNullable, Option, EncodedAccount, Account, MaybeEncodedAccount, MaybeAccount, fetchEncodedAccount, FetchAccountConfig, fetchEncodedAccounts, FetchAccountsConfig, SolanaError, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, InstructionWithData, ClientWithRpc, GetMultipleAccountsApi, ClientWithPayer, ClientWithTransactionPlanning, ClientWithTransactionSending, AccountMeta, InstructionWithAccounts, WritableAccount, ReadonlyAccount, ReadonlySignerAccount, AccountSignerMeta, WritableSignerAccount } from '@solana/kit';
|
|
2
|
+
import { A as AmmConfig, P as Pool, a as Position, O as OracleState$2, S as SwapExactInArgs, b as AddLiquidityArgs, R as RemoveLiquidityArgs, C as CollectFeesArgs, c as CollectProtocolFeesArgs, d as CreatePositionArgs, I as InitializeConfigArgs$1, e as InitializePoolArgs, f as InitializeOracleArgs$1, g as SetSentinelArgs, h as SetFeesArgs, i as SetRouteArgs, T as TransferAdminArgs, j as OracleConsultArgs, Q as QuoteToNumeraireArgs, k as Observation, l as SwapDirection, m as SwapQuote, n as SwapQuoteExactOut, o as AddLiquidityQuote, p as RemoveLiquidityQuote, M as MarketCapValidationResult, q as MarketCapToCurveParamsInput, r as CurveParams, s as CurveParamsToMarketCapInput, G as GetProgramAccountsRpc, t as AddLiquidityEvent, u as AdminTransferredEvent, v as CollectFeesEvent, w as CollectProtocolFeesEvent, F as FeesUpdatedEvent, x as FetchOracleConfig, y as FetchPositionsConfig, z as OracleInitializedEvent, B as OracleUpdatedEvent, D as OracleWithAddress, E as PausedEvent, H as PoolInitializedEvent, J as PositionClosedEvent, K as PositionCreatedEvent, L as PositionValue, N as PositionWithAddress, U as RemoveLiquidityEvent, V as RouteUpdatedEvent, W as SentinelErrorEvent, X as SentinelInvokedEvent, Y as SentinelUpdatedEvent, Z as SkimmedEvent, _ as SwapEvent, $ as TwapResult, a0 as UnpausedEvent, a1 as comparePoolAndOraclePrices, a2 as consultTwap, a3 as fetchOracle, a4 as fetchOraclesBatch, a5 as fetchPoolPositions, a6 as fetchPosition, a7 as fetchPositionByParams, a8 as fetchPositionsBatch, a9 as fetchUserPositions, aa as filterActivePositions, ab as getOracleAddressFromPool, ac as getOracleAge, ad as getOracleBufferStats, ae as getOracleDeviation, af as getOracleForPool, ag as getOracleSpotPrices, ah as getPositionAddressFromParams, ai as getPositionValue, aj as isOracleStale, ak as sortPositionsByShares } from '../oracle-CU-nZnja.cjs';
|
|
3
|
+
import { SelfFetchFunctions, SelfPlanAndSendFunctions } from '@solana/program-client-core';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CPMM AMM program ID (devnet)
|
|
7
|
+
*/
|
|
8
|
+
declare const CPMM_PROGRAM_ID: Address;
|
|
9
|
+
/**
|
|
10
|
+
* Metaplex Token Metadata Program ID
|
|
11
|
+
*/
|
|
12
|
+
declare const TOKEN_METADATA_PROGRAM_ID: Address;
|
|
13
|
+
/** Basis points denominator (10,000 = 100%) */
|
|
14
|
+
declare const BPS_DENOM = 10000n;
|
|
15
|
+
/** Q64.64 fixed-point representation of 1.0 (2^64) */
|
|
16
|
+
declare const Q64_ONE: bigint;
|
|
17
|
+
/** Current account version */
|
|
18
|
+
declare const ACCOUNT_VERSION = 1;
|
|
19
|
+
/** Maximum number of programs in sentinel allowlist */
|
|
20
|
+
declare const MAX_SENTINEL_ALLOWLIST$1 = 32;
|
|
21
|
+
/** Maximum number of oracle observations (TWAP buffer size) */
|
|
22
|
+
declare const MAX_ORACLE_OBSERVATIONS = 64;
|
|
23
|
+
/** Seed for AmmConfig PDA: ['config'] */
|
|
24
|
+
declare const SEED_CONFIG$1 = "config";
|
|
25
|
+
/** Seed prefix for Pool PDA: ['pool', token0_mint, token1_mint] */
|
|
26
|
+
declare const SEED_POOL = "pool";
|
|
27
|
+
/** Seed prefix for pool authority PDA: ['authority', pool] */
|
|
28
|
+
declare const SEED_AUTHORITY = "authority";
|
|
29
|
+
/** Seed prefix for Position PDA: ['position', pool, owner, position_id] */
|
|
30
|
+
declare const SEED_POSITION = "position";
|
|
31
|
+
/** Seed prefix for OracleState PDA: ['oracle', pool] */
|
|
32
|
+
declare const SEED_ORACLE = "oracle";
|
|
33
|
+
/** Seed prefix for protocol position PDA: ['protocol_position', pool] */
|
|
34
|
+
declare const SEED_PROTOCOL_POSITION = "protocol_position";
|
|
35
|
+
/** Sentinel hook: called before swap */
|
|
36
|
+
declare const SF_BEFORE_SWAP$1: number;
|
|
37
|
+
/** Sentinel hook: called after swap */
|
|
38
|
+
declare const SF_AFTER_SWAP$1: number;
|
|
39
|
+
/** Sentinel hook: called before add liquidity */
|
|
40
|
+
declare const SF_BEFORE_ADD_LIQ: number;
|
|
41
|
+
/** Sentinel hook: called after add liquidity */
|
|
42
|
+
declare const SF_AFTER_ADD_LIQ: number;
|
|
43
|
+
/** Sentinel hook: called before remove liquidity */
|
|
44
|
+
declare const SF_BEFORE_REMOVE_LIQ: number;
|
|
45
|
+
/** Sentinel hook: called after remove liquidity */
|
|
46
|
+
declare const SF_AFTER_REMOVE_LIQ: number;
|
|
47
|
+
/** Sentinel return value indicating "no change" to fee parameter */
|
|
48
|
+
declare const SENTINEL_NO_CHANGE$1 = 65535;
|
|
49
|
+
/**
|
|
50
|
+
* Anchor instruction discriminator (first 8 bytes of SHA256("global:<instruction_name>"))
|
|
51
|
+
* These are computed at build time from the instruction names.
|
|
52
|
+
*/
|
|
53
|
+
declare const INSTRUCTION_DISCRIMINATORS: {
|
|
54
|
+
readonly initializeConfig: Uint8Array<ArrayBuffer>;
|
|
55
|
+
readonly initializePool: Uint8Array<ArrayBuffer>;
|
|
56
|
+
readonly initializeOracle: Uint8Array<ArrayBuffer>;
|
|
57
|
+
readonly createPosition: Uint8Array<ArrayBuffer>;
|
|
58
|
+
readonly addLiquidity: Uint8Array<ArrayBuffer>;
|
|
59
|
+
readonly removeLiquidity: Uint8Array<ArrayBuffer>;
|
|
60
|
+
readonly swapExactIn: Uint8Array<ArrayBuffer>;
|
|
61
|
+
readonly collectFees: Uint8Array<ArrayBuffer>;
|
|
62
|
+
readonly collectProtocolFees: Uint8Array<ArrayBuffer>;
|
|
63
|
+
readonly closePosition: Uint8Array<ArrayBuffer>;
|
|
64
|
+
readonly oracleUpdate: Uint8Array<ArrayBuffer>;
|
|
65
|
+
readonly oracleConsult: Uint8Array<ArrayBuffer>;
|
|
66
|
+
readonly quoteToNumeraire: Uint8Array<ArrayBuffer>;
|
|
67
|
+
readonly setSentinel: Uint8Array<ArrayBuffer>;
|
|
68
|
+
readonly setFees: Uint8Array<ArrayBuffer>;
|
|
69
|
+
readonly setRoute: Uint8Array<ArrayBuffer>;
|
|
70
|
+
readonly transferAdmin: Uint8Array<ArrayBuffer>;
|
|
71
|
+
readonly pause: Uint8Array<ArrayBuffer>;
|
|
72
|
+
readonly unpause: Uint8Array<ArrayBuffer>;
|
|
73
|
+
readonly skim: Uint8Array<ArrayBuffer>;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Anchor account discriminator (first 8 bytes of SHA256("account:<AccountName>"))
|
|
77
|
+
*/
|
|
78
|
+
declare const ACCOUNT_DISCRIMINATORS: {
|
|
79
|
+
readonly AmmConfig: Uint8Array<ArrayBuffer>;
|
|
80
|
+
readonly Pool: Uint8Array<ArrayBuffer>;
|
|
81
|
+
readonly Position: Uint8Array<ArrayBuffer>;
|
|
82
|
+
readonly OracleState: Uint8Array<ArrayBuffer>;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Borsh serialization/deserialization for CPMM accounts and instructions
|
|
87
|
+
*
|
|
88
|
+
* This module provides encoding/decoding utilities for program accounts
|
|
89
|
+
* and instruction data using Borsh-compatible binary formats.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
declare const observationCodec: Codec<Observation>;
|
|
93
|
+
declare const ammConfigDataCodec: Codec<AmmConfig>;
|
|
94
|
+
declare const poolDataCodec: Codec<Pool>;
|
|
95
|
+
declare const positionDataCodec: Codec<Position>;
|
|
96
|
+
declare const oracleStateDataCodec: Codec<OracleState$2>;
|
|
97
|
+
/**
|
|
98
|
+
* Decode AmmConfig from raw account data (including discriminator)
|
|
99
|
+
*/
|
|
100
|
+
declare function decodeAmmConfig(data: ReadonlyUint8Array): AmmConfig;
|
|
101
|
+
/**
|
|
102
|
+
* Decode Pool from raw account data (including discriminator)
|
|
103
|
+
*/
|
|
104
|
+
declare function decodePool(data: ReadonlyUint8Array): Pool;
|
|
105
|
+
/**
|
|
106
|
+
* Decode Position from raw account data (including discriminator)
|
|
107
|
+
*/
|
|
108
|
+
declare function decodePosition(data: ReadonlyUint8Array): Position;
|
|
109
|
+
/**
|
|
110
|
+
* Decode OracleState from raw account data (including discriminator)
|
|
111
|
+
*/
|
|
112
|
+
declare function decodeOracleState$2(data: ReadonlyUint8Array): OracleState$2;
|
|
113
|
+
/**
|
|
114
|
+
* Encode instruction data with discriminator prefix
|
|
115
|
+
*/
|
|
116
|
+
declare function encodeInstructionData<T>(discriminator: Uint8Array, codec?: {
|
|
117
|
+
encode: (args: T) => ReadonlyUint8Array | Uint8Array;
|
|
118
|
+
}, args?: T): Uint8Array;
|
|
119
|
+
type AddLiquidityArgsWithOracle$1 = AddLiquidityArgs & {
|
|
120
|
+
updateOracle?: boolean;
|
|
121
|
+
};
|
|
122
|
+
declare const swapExactInArgsCodec: Codec<SwapExactInArgs>;
|
|
123
|
+
declare const addLiquidityArgsCodec: Codec<AddLiquidityArgsWithOracle$1>;
|
|
124
|
+
declare const removeLiquidityArgsCodec: Codec<RemoveLiquidityArgs>;
|
|
125
|
+
declare const collectFeesArgsCodec: Codec<CollectFeesArgs>;
|
|
126
|
+
declare const collectProtocolFeesArgsCodec: Codec<CollectProtocolFeesArgs>;
|
|
127
|
+
declare const createPositionArgsCodec: Codec<CreatePositionArgs>;
|
|
128
|
+
declare const initializeConfigArgsCodec: Codec<InitializeConfigArgs$1>;
|
|
129
|
+
declare const initializePoolArgsCodec: Codec<InitializePoolArgs>;
|
|
130
|
+
declare const initializeOracleArgsCodec: Codec<InitializeOracleArgs$1>;
|
|
131
|
+
declare const setSentinelArgsCodec: Codec<SetSentinelArgs>;
|
|
132
|
+
declare const setFeesArgsCodec: Codec<SetFeesArgs>;
|
|
133
|
+
declare const setRouteArgsCodec: Codec<SetRouteArgs>;
|
|
134
|
+
declare const transferAdminArgsCodec: Codec<TransferAdminArgs>;
|
|
135
|
+
declare const oracleConsultArgsCodec: Codec<OracleConsultArgs>;
|
|
136
|
+
declare const quoteToNumeraireArgsCodec: Codec<QuoteToNumeraireArgs>;
|
|
137
|
+
/** Encode SwapExactIn args */
|
|
138
|
+
declare function encodeSwapExactInArgs(args: SwapExactInArgs): Uint8Array;
|
|
139
|
+
/** Encode AddLiquidity args */
|
|
140
|
+
declare function encodeAddLiquidityArgs(args: AddLiquidityArgsWithOracle$1): Uint8Array;
|
|
141
|
+
/** Encode RemoveLiquidity args */
|
|
142
|
+
declare function encodeRemoveLiquidityArgs(args: RemoveLiquidityArgs): Uint8Array;
|
|
143
|
+
/** Encode CollectFees args */
|
|
144
|
+
declare function encodeCollectFeesArgs(args: CollectFeesArgs): Uint8Array;
|
|
145
|
+
/** Encode CollectProtocolFees args */
|
|
146
|
+
declare function encodeCollectProtocolFeesArgs(args: CollectProtocolFeesArgs): Uint8Array;
|
|
147
|
+
/** Encode CreatePosition args */
|
|
148
|
+
declare function encodeCreatePositionArgs(args: CreatePositionArgs): Uint8Array;
|
|
149
|
+
/** Encode InitializeConfig args */
|
|
150
|
+
declare function encodeInitializeConfigArgs(args: InitializeConfigArgs$1): Uint8Array;
|
|
151
|
+
/** Encode InitializePool args */
|
|
152
|
+
declare function encodeInitializePoolArgs(args: InitializePoolArgs): Uint8Array;
|
|
153
|
+
/** Encode InitializeOracle args */
|
|
154
|
+
declare function encodeInitializeOracleArgs(args: InitializeOracleArgs$1): Uint8Array;
|
|
155
|
+
/** Encode SetSentinel args */
|
|
156
|
+
declare function encodeSetSentinelArgs(args: SetSentinelArgs): Uint8Array;
|
|
157
|
+
/** Encode SetFees args */
|
|
158
|
+
declare function encodeSetFeesArgs(args: SetFeesArgs): Uint8Array;
|
|
159
|
+
/** Encode SetRoute args */
|
|
160
|
+
declare function encodeSetRouteArgs(args: SetRouteArgs): Uint8Array;
|
|
161
|
+
/** Encode TransferAdmin args */
|
|
162
|
+
declare function encodeTransferAdminArgs(args: TransferAdminArgs): Uint8Array;
|
|
163
|
+
/** Encode OracleConsult args */
|
|
164
|
+
declare function encodeOracleConsultArgs(args: OracleConsultArgs): Uint8Array;
|
|
165
|
+
/** Encode QuoteToNumeraire args */
|
|
166
|
+
declare function encodeQuoteToNumeraireArgs(args: QuoteToNumeraireArgs): Uint8Array;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Sort two mints into canonical order (token0 < token1 by bytes)
|
|
170
|
+
* This is required for Pool PDA derivation and instruction ordering.
|
|
171
|
+
*
|
|
172
|
+
* @param mint0 - First mint address
|
|
173
|
+
* @param mint1 - Second mint address
|
|
174
|
+
* @returns Tuple of [token0, token1] in canonical order
|
|
175
|
+
* @throws Error if mints are equal
|
|
176
|
+
*/
|
|
177
|
+
declare function sortMints(mint0: Address, mint1: Address): [Address, Address];
|
|
178
|
+
/**
|
|
179
|
+
* Check if mints are in canonical order
|
|
180
|
+
*/
|
|
181
|
+
declare function areMintsOrdered(mint0: Address, mint1: Address): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Derive the AmmConfig PDA address
|
|
184
|
+
* Seeds: ['config']
|
|
185
|
+
*/
|
|
186
|
+
declare function getConfigAddress$1(programId?: Address): Promise<ProgramDerivedAddress>;
|
|
187
|
+
/**
|
|
188
|
+
* Derive the Pool PDA address for a token pair
|
|
189
|
+
* Seeds: ['pool', token0_mint, token1_mint]
|
|
190
|
+
*
|
|
191
|
+
* Note: Mints will be automatically sorted if not in canonical order.
|
|
192
|
+
*/
|
|
193
|
+
declare function getPoolAddress(mint0: Address, mint1: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
194
|
+
/**
|
|
195
|
+
* Derive the Pool authority PDA (vault owner)
|
|
196
|
+
* Seeds: ['authority', pool]
|
|
197
|
+
*/
|
|
198
|
+
declare function getPoolAuthorityAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
199
|
+
/**
|
|
200
|
+
* Derive the Position PDA address
|
|
201
|
+
* Seeds: ['position', pool, owner, position_id_le_bytes]
|
|
202
|
+
*/
|
|
203
|
+
declare function getPositionAddress(pool: Address, owner: Address, positionId: bigint, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
204
|
+
/**
|
|
205
|
+
* Derive the OracleState PDA address
|
|
206
|
+
* Seeds: ['oracle', pool]
|
|
207
|
+
*/
|
|
208
|
+
declare function getOracleAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
209
|
+
/**
|
|
210
|
+
* Derive the Protocol Position PDA address
|
|
211
|
+
* Seeds: ['protocol_position', pool]
|
|
212
|
+
*/
|
|
213
|
+
declare function getProtocolPositionAddress(pool: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
214
|
+
/**
|
|
215
|
+
* Derive all PDAs needed for pool initialization
|
|
216
|
+
*/
|
|
217
|
+
declare function getPoolInitAddresses(mint0: Address, mint1: Address, programId?: Address): Promise<{
|
|
218
|
+
token0: Address;
|
|
219
|
+
token1: Address;
|
|
220
|
+
pool: ProgramDerivedAddress;
|
|
221
|
+
authority: ProgramDerivedAddress;
|
|
222
|
+
config: ProgramDerivedAddress;
|
|
223
|
+
protocolPosition: ProgramDerivedAddress;
|
|
224
|
+
}>;
|
|
225
|
+
/**
|
|
226
|
+
* Derive all PDAs needed for swap operation
|
|
227
|
+
*/
|
|
228
|
+
declare function getSwapAddresses(pool: Address, programId?: Address): Promise<{
|
|
229
|
+
config: ProgramDerivedAddress;
|
|
230
|
+
authority: ProgramDerivedAddress;
|
|
231
|
+
oracle: ProgramDerivedAddress;
|
|
232
|
+
}>;
|
|
233
|
+
/**
|
|
234
|
+
* Derive all PDAs needed for liquidity operations
|
|
235
|
+
*/
|
|
236
|
+
declare function getLiquidityAddresses(pool: Address, owner: Address, positionId: bigint, programId?: Address): Promise<{
|
|
237
|
+
config: ProgramDerivedAddress;
|
|
238
|
+
authority: ProgramDerivedAddress;
|
|
239
|
+
position: ProgramDerivedAddress;
|
|
240
|
+
protocolPosition: ProgramDerivedAddress;
|
|
241
|
+
oracle: ProgramDerivedAddress;
|
|
242
|
+
}>;
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* Derive Metaplex Token Metadata PDA for a given mint.
|
|
246
|
+
*
|
|
247
|
+
* Seeds: ['metadata', token_metadata_program_id, mint]
|
|
248
|
+
*/
|
|
249
|
+
declare function getMetadataAddress(mint: Address): Promise<ProgramDerivedAddress>;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Convert a Q64.64 fixed-point number to a decimal number
|
|
253
|
+
*/
|
|
254
|
+
declare function q64ToNumber(q64: bigint): number;
|
|
255
|
+
/**
|
|
256
|
+
* Convert a decimal number to Q64.64 fixed-point
|
|
257
|
+
*/
|
|
258
|
+
declare function numberToQ64(n: number): bigint;
|
|
259
|
+
/**
|
|
260
|
+
* Multiply two Q64.64 numbers, returning Q64.64 result
|
|
261
|
+
*/
|
|
262
|
+
declare function q64Mul(a: bigint, b: bigint): bigint;
|
|
263
|
+
/**
|
|
264
|
+
* Divide two Q64.64 numbers, returning Q64.64 result
|
|
265
|
+
*/
|
|
266
|
+
declare function q64Div(a: bigint, b: bigint): bigint;
|
|
267
|
+
/**
|
|
268
|
+
* Compute spot price (reserve1/reserve0) as Q64.64
|
|
269
|
+
* Price of token0 denominated in token1
|
|
270
|
+
*/
|
|
271
|
+
declare function computePrice0Q64(reserve0: bigint, reserve1: bigint): bigint;
|
|
272
|
+
/**
|
|
273
|
+
* Compute spot price (reserve0/reserve1) as Q64.64
|
|
274
|
+
* Price of token1 denominated in token0
|
|
275
|
+
*/
|
|
276
|
+
declare function computePrice1Q64(reserve0: bigint, reserve1: bigint): bigint;
|
|
277
|
+
/**
|
|
278
|
+
* Integer square root (floor)
|
|
279
|
+
*/
|
|
280
|
+
declare function isqrt(n: bigint): bigint;
|
|
281
|
+
/**
|
|
282
|
+
* Ceiling division: ceil(a / b)
|
|
283
|
+
*/
|
|
284
|
+
declare function ceilDiv(a: bigint, b: bigint): bigint;
|
|
285
|
+
/**
|
|
286
|
+
* Minimum of two bigints
|
|
287
|
+
*/
|
|
288
|
+
declare function minBigInt(a: bigint, b: bigint): bigint;
|
|
289
|
+
/**
|
|
290
|
+
* Maximum of two bigints
|
|
291
|
+
*/
|
|
292
|
+
declare function maxBigInt(a: bigint, b: bigint): bigint;
|
|
293
|
+
/**
|
|
294
|
+
* Convert a ratio of two bigints to a decimal number using Q64.64 precision
|
|
295
|
+
*/
|
|
296
|
+
declare function ratioToNumber(numerator: bigint, denominator: bigint): number;
|
|
297
|
+
/**
|
|
298
|
+
* Calculate swap output and fees for exact input amount
|
|
299
|
+
*
|
|
300
|
+
* Fee calculation (from spec):
|
|
301
|
+
* - fee_total = floor(amount_in * fee_bps / 10_000)
|
|
302
|
+
* - fee_dist = floor(fee_total * split_bps / 10_000)
|
|
303
|
+
* - fee_comp = fee_total - fee_dist
|
|
304
|
+
* - amount_in_eff = amount_in - fee_total
|
|
305
|
+
*
|
|
306
|
+
* CPMM output:
|
|
307
|
+
* - amount_out = floor(amount_in_eff * reserve_out / (reserve_in + amount_in_eff))
|
|
308
|
+
*/
|
|
309
|
+
declare function getSwapQuote(pool: Pool, amountIn: bigint, direction: SwapDirection): SwapQuote;
|
|
310
|
+
/**
|
|
311
|
+
* Calculate input amount needed for exact output (reverse quote)
|
|
312
|
+
*/
|
|
313
|
+
declare function getSwapQuoteExactOut(pool: Pool, amountOut: bigint, direction: SwapDirection): SwapQuoteExactOut;
|
|
314
|
+
/**
|
|
315
|
+
* Calculate shares and actual amounts for adding liquidity
|
|
316
|
+
*
|
|
317
|
+
* From spec:
|
|
318
|
+
* - If initial: shares = floor_sqrt(amount0 * amount1)
|
|
319
|
+
* - Else: shares = min(amount0 * totalShares / reserve0, amount1 * totalShares / reserve1)
|
|
320
|
+
*/
|
|
321
|
+
declare function getAddLiquidityQuote(pool: Pool, amount0Max: bigint, amount1Max: bigint): AddLiquidityQuote;
|
|
322
|
+
/**
|
|
323
|
+
* Calculate token amounts for removing liquidity
|
|
324
|
+
*
|
|
325
|
+
* From spec:
|
|
326
|
+
* - amount0 = shares * reserve0 / totalShares
|
|
327
|
+
* - amount1 = shares * reserve1 / totalShares
|
|
328
|
+
*/
|
|
329
|
+
declare function getRemoveLiquidityQuote(pool: Pool, sharesIn: bigint): RemoveLiquidityQuote;
|
|
330
|
+
/**
|
|
331
|
+
* Calculate accrued fees for a position
|
|
332
|
+
*
|
|
333
|
+
* From spec:
|
|
334
|
+
* - delta = pool.fee_growth_global - position.fee_growth_last
|
|
335
|
+
* - owed_inc = floor(position.shares * delta / 2^64)
|
|
336
|
+
*/
|
|
337
|
+
declare function calculateAccruedFees(shares: bigint, feeGrowthLastQ64: bigint, feeGrowthGlobalQ64: bigint): bigint;
|
|
338
|
+
/**
|
|
339
|
+
* Calculate pending fees for a position (both tokens)
|
|
340
|
+
*/
|
|
341
|
+
declare function getPendingFees(pool: Pool, position: {
|
|
342
|
+
shares: bigint;
|
|
343
|
+
feeGrowthLast0Q64: bigint;
|
|
344
|
+
feeGrowthLast1Q64: bigint;
|
|
345
|
+
feeOwed0: bigint;
|
|
346
|
+
feeOwed1: bigint;
|
|
347
|
+
}): {
|
|
348
|
+
pending0: bigint;
|
|
349
|
+
pending1: bigint;
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Calculate spot price of token0 in terms of token1
|
|
353
|
+
*/
|
|
354
|
+
declare function getSpotPrice0(pool: Pool): number;
|
|
355
|
+
/**
|
|
356
|
+
* Calculate spot price of token1 in terms of token0
|
|
357
|
+
*/
|
|
358
|
+
declare function getSpotPrice1(pool: Pool): number;
|
|
359
|
+
/**
|
|
360
|
+
* Calculate k (constant product invariant)
|
|
361
|
+
*/
|
|
362
|
+
declare function getK(pool: Pool): bigint;
|
|
363
|
+
/**
|
|
364
|
+
* Calculate pool TVL in terms of one token
|
|
365
|
+
* @param pool Pool data
|
|
366
|
+
* @param side 0 = denominate in token0, 1 = denominate in token1
|
|
367
|
+
*/
|
|
368
|
+
declare function getTvl(pool: Pool, side?: SwapDirection): bigint;
|
|
369
|
+
/**
|
|
370
|
+
* Calculate TWAP price from oracle observations
|
|
371
|
+
*
|
|
372
|
+
* TWAP = (cumulative_end - cumulative_start) / (timestamp_end - timestamp_start)
|
|
373
|
+
*/
|
|
374
|
+
declare function calculateTwap(cumulativeStart: bigint, cumulativeEnd: bigint, timestampStart: number, timestampEnd: number): bigint;
|
|
375
|
+
/**
|
|
376
|
+
* Calculate TWAP as a decimal number
|
|
377
|
+
*/
|
|
378
|
+
declare function calculateTwapNumber(cumulativeStart: bigint, cumulativeEnd: bigint, timestampStart: number, timestampEnd: number): number;
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Market cap conversion utilities for Solana token launches.
|
|
382
|
+
*
|
|
383
|
+
* Converts between human-readable market cap values (USD) and the raw
|
|
384
|
+
* curve parameters used by the initializer program.
|
|
385
|
+
*
|
|
386
|
+
* For an XYK bonding curve the marginal spot price at any point is:
|
|
387
|
+
*
|
|
388
|
+
* spotPrice (quote/base, raw units) = (quoteReserve + curveVirtualQuote)
|
|
389
|
+
* / (baseReserve + curveVirtualBase)
|
|
390
|
+
*
|
|
391
|
+
* At launch open (quoteReserve = 0, baseReserve = baseForCurve):
|
|
392
|
+
*
|
|
393
|
+
* spotPrice = curveVirtualQuote / (baseForCurve + curveVirtualBase)
|
|
394
|
+
*
|
|
395
|
+
* Adjusted for decimals and numeraire price:
|
|
396
|
+
*
|
|
397
|
+
* spotPriceUSD = spotPrice * 10^(baseDecimals - quoteDecimals) * numerairePriceUSD
|
|
398
|
+
*
|
|
399
|
+
* Market cap (FDV) is then:
|
|
400
|
+
*
|
|
401
|
+
* marketCap = spotPriceUSD * (baseTotalSupply / 10^baseDecimals)
|
|
402
|
+
*/
|
|
403
|
+
|
|
404
|
+
/**
|
|
405
|
+
* Convert a market cap (USD) and total supply to a per-token price (USD).
|
|
406
|
+
*
|
|
407
|
+
* @example
|
|
408
|
+
* // $1M market cap, 1B tokens with 6 decimals
|
|
409
|
+
* marketCapToTokenPrice(1_000_000, 1_000_000_000n * 10n**6n, 6)
|
|
410
|
+
* // => 0.001
|
|
411
|
+
*/
|
|
412
|
+
declare function marketCapToTokenPrice(marketCapUSD: number, baseTotalSupply: bigint, baseDecimals: number): number;
|
|
413
|
+
/**
|
|
414
|
+
* Validate market cap parameters and return warnings for unusual values.
|
|
415
|
+
* Does not throw — callers can decide whether to surface warnings to users.
|
|
416
|
+
*
|
|
417
|
+
* @example
|
|
418
|
+
* const { valid, warnings } = validateMarketCapParameters(500, supply, 6);
|
|
419
|
+
* if (!valid) console.warn(warnings);
|
|
420
|
+
*/
|
|
421
|
+
declare function validateMarketCapParameters(marketCapUSD: number, baseTotalSupply: bigint, baseDecimals: number): MarketCapValidationResult;
|
|
422
|
+
/**
|
|
423
|
+
* Convert a market cap range (USD) to XYK curve virtual reserve parameters.
|
|
424
|
+
*
|
|
425
|
+
* Returns `{ curveVirtualBase, curveVirtualQuote }` for both the start (open)
|
|
426
|
+
* and end (graduation) prices, ready to pass into `InitializeLaunchArgs`.
|
|
427
|
+
*
|
|
428
|
+
* `baseForCurve` is the number of base tokens allocated to the curve vault
|
|
429
|
+
* (baseTotalSupply - baseForDistribution - baseForLiquidity). It determines
|
|
430
|
+
* the correct initial spot price alongside the virtual reserves.
|
|
431
|
+
*
|
|
432
|
+
* `virtualBase` defaults to `baseForCurve`. A larger value gives finer price
|
|
433
|
+
* granularity at the cost of a proportionally larger `curveVirtualQuote`.
|
|
434
|
+
*
|
|
435
|
+
* @example
|
|
436
|
+
* const totalSupply = 1_000_000_000n * 10n ** 6n;
|
|
437
|
+
* const { start, end } = marketCapToCurveParams({
|
|
438
|
+
* startMarketCapUSD: 100_000,
|
|
439
|
+
* endMarketCapUSD: 5_000_000,
|
|
440
|
+
* baseTotalSupply: totalSupply,
|
|
441
|
+
* baseForCurve: totalSupply, // no distribution or liquidity allocation
|
|
442
|
+
* baseDecimals: 6,
|
|
443
|
+
* quoteDecimals: 9, // SOL
|
|
444
|
+
* numerairePriceUSD: 150,
|
|
445
|
+
* });
|
|
446
|
+
* // Use start.curveVirtualBase / start.curveVirtualQuote in InitializeLaunchArgs
|
|
447
|
+
*/
|
|
448
|
+
declare function marketCapToCurveParams(input: MarketCapToCurveParamsInput): {
|
|
449
|
+
start: CurveParams;
|
|
450
|
+
end: CurveParams;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Convert a single market cap (USD) to XYK curve virtual reserve parameters.
|
|
454
|
+
* Use `marketCapToCurveParams` for a full start/end range.
|
|
455
|
+
*/
|
|
456
|
+
declare function marketCapToSingleCurveParams(marketCapUSD: number, baseTotalSupply: bigint, baseForCurve: bigint, baseDecimals: number, quoteDecimals: number, numerairePriceUSD: number, virtualBase?: bigint): CurveParams;
|
|
457
|
+
/**
|
|
458
|
+
* Derive the current market cap (USD) from live XYK curve state.
|
|
459
|
+
*
|
|
460
|
+
* Pass the virtual reserves from the `Launch` account and the current token
|
|
461
|
+
* vault balances (`baseReserve`, `quoteReserve`) to get the live spot price.
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* const launch = await fetchLaunch(connection, launchAddress);
|
|
465
|
+
* const [baseVaultBalance, quoteVaultBalance] = await Promise.all([
|
|
466
|
+
* getTokenAccountBalance(connection, launch.baseVault),
|
|
467
|
+
* getTokenAccountBalance(connection, launch.quoteVault),
|
|
468
|
+
* ]);
|
|
469
|
+
* // baseReserve is the curve-available portion, excluding reserved allocations
|
|
470
|
+
* const baseReserve = baseVaultBalance - launch.baseForDistribution - launch.baseForLiquidity;
|
|
471
|
+
* const mcap = curveParamsToMarketCap({
|
|
472
|
+
* curveVirtualBase: launch.curveVirtualBase,
|
|
473
|
+
* curveVirtualQuote: launch.curveVirtualQuote,
|
|
474
|
+
* baseReserve,
|
|
475
|
+
* quoteReserve: quoteVaultBalance,
|
|
476
|
+
* baseTotalSupply: launch.baseTotalSupply,
|
|
477
|
+
* baseDecimals: 6,
|
|
478
|
+
* quoteDecimals: 9,
|
|
479
|
+
* numerairePriceUSD: 150,
|
|
480
|
+
* });
|
|
481
|
+
*/
|
|
482
|
+
declare function curveParamsToMarketCap(input: CurveParamsToMarketCapInput): number;
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* CPMM program error codes
|
|
486
|
+
*
|
|
487
|
+
* These correspond to the CpmmError enum in the on-chain program.
|
|
488
|
+
* Anchor errors start at 6000 (0x1770).
|
|
489
|
+
*/
|
|
490
|
+
declare enum CpmmErrorCode {
|
|
491
|
+
/** Unauthorized - caller lacks required authority */
|
|
492
|
+
Unauthorized = 6000,
|
|
493
|
+
/** Pool is currently locked (reentrancy protection) */
|
|
494
|
+
PoolLocked = 6001,
|
|
495
|
+
/** Invalid fee value (exceeds max or invalid range) */
|
|
496
|
+
InvalidFee = 6002,
|
|
497
|
+
/** Invalid fee split value (exceeds max or invalid range) */
|
|
498
|
+
InvalidFeeSplit = 6003,
|
|
499
|
+
/** Invalid swap direction (must be 0 or 1) */
|
|
500
|
+
InvalidDirection = 6004,
|
|
501
|
+
/** Insufficient liquidity for operation */
|
|
502
|
+
InsufficientLiquidity = 6005,
|
|
503
|
+
/** Output amount less than minimum (slippage exceeded) */
|
|
504
|
+
SlippageExceeded = 6006,
|
|
505
|
+
/** Math operation overflowed */
|
|
506
|
+
MathOverflow = 6007,
|
|
507
|
+
/** Mints not in canonical order */
|
|
508
|
+
InvalidMintOrder = 6008,
|
|
509
|
+
/** Cannot create pool with identical tokens */
|
|
510
|
+
SameMintPair = 6009,
|
|
511
|
+
/** Vault account invalid or mismatch */
|
|
512
|
+
InvalidVault = 6010,
|
|
513
|
+
/** Position account invalid or mismatch */
|
|
514
|
+
InvalidPosition = 6011,
|
|
515
|
+
/** Cannot close position with non-zero shares or fees */
|
|
516
|
+
PositionNotEmpty = 6012,
|
|
517
|
+
/** Invalid route configuration */
|
|
518
|
+
InvalidRoute = 6013,
|
|
519
|
+
/** Not supported in v0.1 */
|
|
520
|
+
NotSupportedInV0_1 = 6014,
|
|
521
|
+
/** Oracle not initialized for this pool */
|
|
522
|
+
OracleNotInitialized = 6015,
|
|
523
|
+
/** Zero shares out */
|
|
524
|
+
ZeroSharesOut = 6016,
|
|
525
|
+
/** Sentinel program rejected the operation */
|
|
526
|
+
SentinelRejected = 6017,
|
|
527
|
+
/** Sentinel CPI call failed */
|
|
528
|
+
SentinelCpiFailed = 6018,
|
|
529
|
+
/** Sentinel program account not provided */
|
|
530
|
+
SentinelProgramNotProvided = 6019,
|
|
531
|
+
/** Sentinel program account is not executable */
|
|
532
|
+
SentinelProgramNotExecutable = 6020,
|
|
533
|
+
/** Sentinel return data missing or wrong program id */
|
|
534
|
+
SentinelReturnDataMissing = 6021,
|
|
535
|
+
/** Sentinel return data invalid length or could not deserialize */
|
|
536
|
+
SentinelReturnDataInvalid = 6022,
|
|
537
|
+
/** Sentinel program not in allowlist */
|
|
538
|
+
SentinelNotAllowlisted = 6023,
|
|
539
|
+
/** Pool has zero shares (no liquidity) */
|
|
540
|
+
TotalSharesZero = 6024,
|
|
541
|
+
/** Amount cannot be zero */
|
|
542
|
+
AmountZero = 6025,
|
|
543
|
+
/** Pool is paused by admin */
|
|
544
|
+
Paused = 6026,
|
|
545
|
+
/** Internal invariant violation */
|
|
546
|
+
InvariantViolation = 6027,
|
|
547
|
+
/** Invalid mint address */
|
|
548
|
+
InvalidMint = 6028,
|
|
549
|
+
/** Invalid input parameter */
|
|
550
|
+
InvalidInput = 6029,
|
|
551
|
+
/** Reentrancy detected */
|
|
552
|
+
Reentrancy = 6030
|
|
553
|
+
}
|
|
554
|
+
/**
|
|
555
|
+
* Human-readable error messages
|
|
556
|
+
*/
|
|
557
|
+
declare const CPMM_ERROR_MESSAGES: Record<CpmmErrorCode, string>;
|
|
558
|
+
/**
|
|
559
|
+
* Custom error class for CPMM program errors
|
|
560
|
+
*/
|
|
561
|
+
declare class CpmmError extends Error {
|
|
562
|
+
readonly code: CpmmErrorCode;
|
|
563
|
+
readonly logs?: string[] | undefined;
|
|
564
|
+
constructor(code: CpmmErrorCode, logs?: string[] | undefined);
|
|
565
|
+
/**
|
|
566
|
+
* Get the error code name
|
|
567
|
+
*/
|
|
568
|
+
get codeName(): string;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Parse error code from transaction logs
|
|
572
|
+
*/
|
|
573
|
+
declare function parseErrorFromLogs(logs: string[]): CpmmError | null;
|
|
574
|
+
/**
|
|
575
|
+
* Check if an error code is a CPMM error
|
|
576
|
+
*/
|
|
577
|
+
declare function isCpmmError(code: number): code is CpmmErrorCode;
|
|
578
|
+
/**
|
|
579
|
+
* Get error message from code
|
|
580
|
+
*/
|
|
581
|
+
declare function getErrorMessage(code: number): string;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Accounts required for initialize_config instruction
|
|
585
|
+
*/
|
|
586
|
+
interface InitializeConfigAccounts$1 {
|
|
587
|
+
/** AmmConfig account to initialize (writable, PDA: ['config']) */
|
|
588
|
+
config: Address;
|
|
589
|
+
/** Payer for account creation (writable, signer) */
|
|
590
|
+
payer: Address;
|
|
591
|
+
/** System program */
|
|
592
|
+
systemProgram?: Address;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Create an initialize_config instruction
|
|
596
|
+
*
|
|
597
|
+
* Initializes the global AMM configuration singleton. This should only be called once
|
|
598
|
+
* per deployment to set up the admin, fees, and allowlist.
|
|
599
|
+
*
|
|
600
|
+
* @param accounts - Required accounts for initialization
|
|
601
|
+
* @param args - Instruction arguments (admin, numeraireMint, fees, allowlist)
|
|
602
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
603
|
+
* @returns Instruction to initialize the config
|
|
604
|
+
*
|
|
605
|
+
* @example
|
|
606
|
+
* ```ts
|
|
607
|
+
* const [configAddress] = await getConfigAddress();
|
|
608
|
+
* const ix = createInitializeConfigInstruction(
|
|
609
|
+
* {
|
|
610
|
+
* config: configAddress,
|
|
611
|
+
* payer: payerPublicKey,
|
|
612
|
+
* },
|
|
613
|
+
* {
|
|
614
|
+
* admin: adminPublicKey,
|
|
615
|
+
* numeraireMint: usdcMint,
|
|
616
|
+
* maxSwapFeeBps: 100,
|
|
617
|
+
* maxFeeSplitBps: 5000,
|
|
618
|
+
* maxRouteHops: 3,
|
|
619
|
+
* protocolFeeEnabled: true,
|
|
620
|
+
* protocolFeeBps: 500,
|
|
621
|
+
* sentinelAllowlist: [],
|
|
622
|
+
* }
|
|
623
|
+
* );
|
|
624
|
+
* ```
|
|
625
|
+
*/
|
|
626
|
+
declare function createInitializeConfigInstruction$1(accounts: InitializeConfigAccounts$1, args: InitializeConfigArgs$1, programId?: Address): Instruction;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Accounts required for initialize_pool instruction
|
|
630
|
+
*/
|
|
631
|
+
interface InitializePoolAccounts {
|
|
632
|
+
/** AmmConfig account (read-only) */
|
|
633
|
+
config: Address;
|
|
634
|
+
/** Pool account to initialize (writable, PDA: ['pool', token0_mint, token1_mint]) */
|
|
635
|
+
pool: Address;
|
|
636
|
+
/** Protocol position account (writable, PDA: ['protocol_position', pool]) */
|
|
637
|
+
protocolPosition: Address;
|
|
638
|
+
/** Pool authority PDA (read-only, PDA: ['authority', pool]) */
|
|
639
|
+
authority: Address;
|
|
640
|
+
/** Vault for token0 (writable signer - pass TransactionSigner to include signer in instruction) */
|
|
641
|
+
vault0: Address | TransactionSigner;
|
|
642
|
+
/** Vault for token1 (writable signer - pass TransactionSigner to include signer in instruction) */
|
|
643
|
+
vault1: Address | TransactionSigner;
|
|
644
|
+
/** Token0 mint (read-only, must be lexicographically smaller) */
|
|
645
|
+
token0Mint: Address;
|
|
646
|
+
/** Token1 mint (read-only, must be lexicographically larger) */
|
|
647
|
+
token1Mint: Address;
|
|
648
|
+
/** Payer for account creation (writable signer - pass TransactionSigner to include signer in instruction) */
|
|
649
|
+
payer: Address | TransactionSigner;
|
|
650
|
+
/** SPL Token program */
|
|
651
|
+
tokenProgram?: Address;
|
|
652
|
+
/** System program */
|
|
653
|
+
systemProgram?: Address;
|
|
654
|
+
/** Rent sysvar */
|
|
655
|
+
rent: Address;
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* Create an initialize_pool instruction
|
|
659
|
+
*
|
|
660
|
+
* Initializes a new trading pool for a token pair. The mints must be in canonical order
|
|
661
|
+
* (token0 < token1 by bytes). Use sortMints() to ensure proper ordering.
|
|
662
|
+
*
|
|
663
|
+
* @param accounts - Required accounts for pool initialization
|
|
664
|
+
* @param args - Instruction arguments (mintA, mintB, fees, liquidityMeasureSide, numeraire override)
|
|
665
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
666
|
+
* @returns Instruction to initialize the pool
|
|
667
|
+
*
|
|
668
|
+
* @example
|
|
669
|
+
* ```ts
|
|
670
|
+
* const addresses = await getPoolInitAddresses(mintA, mintB);
|
|
671
|
+
* const ix = createInitializePoolInstruction(
|
|
672
|
+
* {
|
|
673
|
+
* config: addresses.config[0],
|
|
674
|
+
* pool: addresses.pool[0],
|
|
675
|
+
* protocolPosition: addresses.protocolPosition[0],
|
|
676
|
+
* authority: addresses.authority[0],
|
|
677
|
+
* vault0: vault0Keypair.publicKey,
|
|
678
|
+
* vault1: vault1Keypair.publicKey,
|
|
679
|
+
* token0Mint: addresses.token0,
|
|
680
|
+
* token1Mint: addresses.token1,
|
|
681
|
+
* payer: payerPublicKey,
|
|
682
|
+
* rent: SYSVAR_RENT_PUBKEY,
|
|
683
|
+
* },
|
|
684
|
+
* {
|
|
685
|
+
* mintA: mintA,
|
|
686
|
+
* mintB: mintB,
|
|
687
|
+
* initialSwapFeeBps: 30,
|
|
688
|
+
* initialFeeSplitBps: 5000,
|
|
689
|
+
* liquidityMeasureSide: 0,
|
|
690
|
+
* numeraireMintOverride: null,
|
|
691
|
+
* }
|
|
692
|
+
* );
|
|
693
|
+
* ```
|
|
694
|
+
*/
|
|
695
|
+
declare function createInitializePoolInstruction(accounts: InitializePoolAccounts, args: InitializePoolArgs, programId?: Address): Instruction;
|
|
696
|
+
|
|
697
|
+
/**
|
|
698
|
+
* Accounts required for initialize_oracle instruction
|
|
699
|
+
*/
|
|
700
|
+
interface InitializeOracleAccounts {
|
|
701
|
+
/** AmmConfig account (read-only) */
|
|
702
|
+
config: Address;
|
|
703
|
+
/** Pool account (read-only) */
|
|
704
|
+
pool: Address;
|
|
705
|
+
/** Oracle PDA to initialize (writable, will be created) */
|
|
706
|
+
oracle: Address;
|
|
707
|
+
/** Admin authority (signer, must match config.admin) */
|
|
708
|
+
admin: Address;
|
|
709
|
+
/** Payer for account creation (signer, writable) */
|
|
710
|
+
payer: Address;
|
|
711
|
+
/** System program */
|
|
712
|
+
systemProgram?: Address;
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Create an initialize_oracle instruction
|
|
716
|
+
*
|
|
717
|
+
* Initializes a TWAP oracle for a pool. The oracle tracks price movements
|
|
718
|
+
* and stores observations for time-weighted average price calculations.
|
|
719
|
+
*
|
|
720
|
+
* @param accounts - Required accounts for the instruction
|
|
721
|
+
* @param args - Instruction arguments (maxPriceChangeRatioQ64, observationIntervalSec, numObservations)
|
|
722
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
723
|
+
* @returns Instruction to initialize the oracle
|
|
724
|
+
*
|
|
725
|
+
* @example
|
|
726
|
+
* ```ts
|
|
727
|
+
* const ix = createInitializeOracleInstruction(
|
|
728
|
+
* {
|
|
729
|
+
* config: configAddress,
|
|
730
|
+
* pool: poolAddress,
|
|
731
|
+
* oracle: oracleAddress,
|
|
732
|
+
* admin: adminPublicKey,
|
|
733
|
+
* payer: payerPublicKey,
|
|
734
|
+
* },
|
|
735
|
+
* {
|
|
736
|
+
* maxPriceChangeRatioQ64: 1n << 64n, // 100% max change per slot
|
|
737
|
+
* observationIntervalSec: 60, // 1 minute between observations
|
|
738
|
+
* numObservations: 64, // Must be MAX_ORACLE_OBSERVATIONS
|
|
739
|
+
* }
|
|
740
|
+
* );
|
|
741
|
+
* ```
|
|
742
|
+
*/
|
|
743
|
+
declare function createInitializeOracleInstruction(accounts: InitializeOracleAccounts, args: InitializeOracleArgs$1, programId?: Address): Instruction;
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* Accounts required for set_fees instruction
|
|
747
|
+
*/
|
|
748
|
+
interface SetFeesAccounts {
|
|
749
|
+
/** AmmConfig account (read-only) */
|
|
750
|
+
config: Address;
|
|
751
|
+
/** Pool account (writable) */
|
|
752
|
+
pool: Address;
|
|
753
|
+
/** Admin authority (signer, must match config.admin) */
|
|
754
|
+
admin: Address;
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Create a set_fees instruction
|
|
758
|
+
*
|
|
759
|
+
* Admin instruction to update the swap fee and fee split on a pool.
|
|
760
|
+
* Fees will be clamped to the config's max values.
|
|
761
|
+
*
|
|
762
|
+
* @param accounts - Required accounts for setting fees
|
|
763
|
+
* @param args - Instruction arguments (swapFeeBps, feeSplitBps)
|
|
764
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
765
|
+
* @returns Instruction to set fees
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
* ```ts
|
|
769
|
+
* const ix = createSetFeesInstruction(
|
|
770
|
+
* {
|
|
771
|
+
* config: configAddress,
|
|
772
|
+
* pool: poolAddress,
|
|
773
|
+
* admin: adminPublicKey,
|
|
774
|
+
* },
|
|
775
|
+
* {
|
|
776
|
+
* swapFeeBps: 30, // 0.30% swap fee
|
|
777
|
+
* feeSplitBps: 5000, // 50% of fees go to LPs (distributable)
|
|
778
|
+
* }
|
|
779
|
+
* );
|
|
780
|
+
* ```
|
|
781
|
+
*/
|
|
782
|
+
declare function createSetFeesInstruction(accounts: SetFeesAccounts, args: SetFeesArgs, programId?: Address): Instruction;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Accounts required for set_sentinel instruction
|
|
786
|
+
*/
|
|
787
|
+
interface SetSentinelAccounts {
|
|
788
|
+
/** AmmConfig account (read-only) */
|
|
789
|
+
config: Address;
|
|
790
|
+
/** Pool account (writable) */
|
|
791
|
+
pool: Address;
|
|
792
|
+
/** Admin authority (signer, must match config.admin) */
|
|
793
|
+
admin: Address;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Create a set_sentinel instruction
|
|
797
|
+
*
|
|
798
|
+
* Admin instruction to configure a sentinel (hook) program on a pool.
|
|
799
|
+
* The sentinel program must be in the config's allowlist (if the allowlist is non-empty).
|
|
800
|
+
* Use Pubkey::default() to disable the sentinel.
|
|
801
|
+
*
|
|
802
|
+
* @param accounts - Required accounts for setting sentinel
|
|
803
|
+
* @param args - Instruction arguments (sentinelProgram, sentinelFlags)
|
|
804
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
805
|
+
* @returns Instruction to set sentinel
|
|
806
|
+
*
|
|
807
|
+
* @example
|
|
808
|
+
* ```ts
|
|
809
|
+
* import { SF_BEFORE_SWAP, SF_AFTER_SWAP } from '@cpmm/sdk';
|
|
810
|
+
*
|
|
811
|
+
* const ix = createSetSentinelInstruction(
|
|
812
|
+
* {
|
|
813
|
+
* config: configAddress,
|
|
814
|
+
* pool: poolAddress,
|
|
815
|
+
* admin: adminPublicKey,
|
|
816
|
+
* },
|
|
817
|
+
* {
|
|
818
|
+
* sentinelProgram: sentinelProgramId,
|
|
819
|
+
* sentinelFlags: SF_BEFORE_SWAP | SF_AFTER_SWAP, // Enable both hooks
|
|
820
|
+
* }
|
|
821
|
+
* );
|
|
822
|
+
* ```
|
|
823
|
+
*/
|
|
824
|
+
declare function createSetSentinelInstruction(accounts: SetSentinelAccounts, args: SetSentinelArgs, programId?: Address): Instruction;
|
|
825
|
+
|
|
826
|
+
/**
|
|
827
|
+
* Accounts required for set_route instruction
|
|
828
|
+
*/
|
|
829
|
+
interface SetRouteAccounts {
|
|
830
|
+
/** AmmConfig account (read-only) */
|
|
831
|
+
config: Address;
|
|
832
|
+
/** Pool account (writable) */
|
|
833
|
+
pool: Address;
|
|
834
|
+
/** Next pool in routing chain (optional, required if setting a route) */
|
|
835
|
+
nextPool?: Address;
|
|
836
|
+
/** Admin authority (signer, must match config.admin) */
|
|
837
|
+
admin: Address;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Create a set_route instruction
|
|
841
|
+
*
|
|
842
|
+
* Admin instruction to configure routing for a pool. This allows multi-hop swaps
|
|
843
|
+
* through a chain of pools. The bridge mint must exist in both the current pool
|
|
844
|
+
* and the next pool.
|
|
845
|
+
*
|
|
846
|
+
* To clear routing, pass Pubkey::default() for both routeNextPool and routeBridgeMint.
|
|
847
|
+
*
|
|
848
|
+
* @param accounts - Required accounts for setting route
|
|
849
|
+
* @param args - Instruction arguments (routeNextPool, routeBridgeMint)
|
|
850
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
851
|
+
* @returns Instruction to set route
|
|
852
|
+
*
|
|
853
|
+
* @example
|
|
854
|
+
* ```ts
|
|
855
|
+
* // Set up routing: Pool A -> Pool B via USDC
|
|
856
|
+
* const ix = createSetRouteInstruction(
|
|
857
|
+
* {
|
|
858
|
+
* config: configAddress,
|
|
859
|
+
* pool: poolAAddress,
|
|
860
|
+
* nextPool: poolBAddress,
|
|
861
|
+
* admin: adminPublicKey,
|
|
862
|
+
* },
|
|
863
|
+
* {
|
|
864
|
+
* routeNextPool: poolBAddress,
|
|
865
|
+
* routeBridgeMint: usdcMint, // Must be in both pools
|
|
866
|
+
* }
|
|
867
|
+
* );
|
|
868
|
+
*
|
|
869
|
+
* // Clear routing
|
|
870
|
+
* const clearIx = createSetRouteInstruction(
|
|
871
|
+
* {
|
|
872
|
+
* config: configAddress,
|
|
873
|
+
* pool: poolAddress,
|
|
874
|
+
* admin: adminPublicKey,
|
|
875
|
+
* },
|
|
876
|
+
* {
|
|
877
|
+
* routeNextPool: address('11111111111111111111111111111111'),
|
|
878
|
+
* routeBridgeMint: address('11111111111111111111111111111111'),
|
|
879
|
+
* }
|
|
880
|
+
* );
|
|
881
|
+
* ```
|
|
882
|
+
*/
|
|
883
|
+
declare function createSetRouteInstruction(accounts: SetRouteAccounts, args: SetRouteArgs, programId?: Address): Instruction;
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* Accounts required for pause instruction
|
|
887
|
+
*/
|
|
888
|
+
interface PauseAccounts {
|
|
889
|
+
/** AmmConfig account (writable) */
|
|
890
|
+
config: Address;
|
|
891
|
+
/** Admin authority (signer, must match config.admin) */
|
|
892
|
+
admin: Address;
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Create a pause instruction
|
|
896
|
+
*
|
|
897
|
+
* Admin instruction to pause all pool operations globally. When paused,
|
|
898
|
+
* swaps, liquidity additions, and liquidity removals will fail.
|
|
899
|
+
*
|
|
900
|
+
* @param accounts - Required accounts for pausing
|
|
901
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
902
|
+
* @returns Instruction to pause the AMM
|
|
903
|
+
*
|
|
904
|
+
* @example
|
|
905
|
+
* ```ts
|
|
906
|
+
* const ix = createPauseInstruction({
|
|
907
|
+
* config: configAddress,
|
|
908
|
+
* admin: adminPublicKey,
|
|
909
|
+
* });
|
|
910
|
+
* ```
|
|
911
|
+
*/
|
|
912
|
+
declare function createPauseInstruction(accounts: PauseAccounts, programId?: Address): Instruction;
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Accounts required for unpause instruction
|
|
916
|
+
*/
|
|
917
|
+
interface UnpauseAccounts {
|
|
918
|
+
/** AmmConfig account (writable) */
|
|
919
|
+
config: Address;
|
|
920
|
+
/** Admin authority (signer, must match config.admin) */
|
|
921
|
+
admin: Address;
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Create an unpause instruction
|
|
925
|
+
*
|
|
926
|
+
* Admin instruction to unpause all pool operations. This re-enables
|
|
927
|
+
* swaps, liquidity additions, and liquidity removals after a pause.
|
|
928
|
+
*
|
|
929
|
+
* @param accounts - Required accounts for unpausing
|
|
930
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
931
|
+
* @returns Instruction to unpause the AMM
|
|
932
|
+
*
|
|
933
|
+
* @example
|
|
934
|
+
* ```ts
|
|
935
|
+
* const ix = createUnpauseInstruction({
|
|
936
|
+
* config: configAddress,
|
|
937
|
+
* admin: adminPublicKey,
|
|
938
|
+
* });
|
|
939
|
+
* ```
|
|
940
|
+
*/
|
|
941
|
+
declare function createUnpauseInstruction(accounts: UnpauseAccounts, programId?: Address): Instruction;
|
|
942
|
+
|
|
943
|
+
/**
|
|
944
|
+
* Accounts required for transfer_admin instruction
|
|
945
|
+
*/
|
|
946
|
+
interface TransferAdminAccounts {
|
|
947
|
+
/** AmmConfig account (writable) */
|
|
948
|
+
config: Address;
|
|
949
|
+
/** Current admin authority (signer, must match config.admin) */
|
|
950
|
+
admin: Address;
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* Create a transfer_admin instruction
|
|
954
|
+
*
|
|
955
|
+
* Admin instruction to transfer administrative authority to a new address.
|
|
956
|
+
* The new admin will have full control over the AMM configuration and all pools.
|
|
957
|
+
*
|
|
958
|
+
* CAUTION: This action is irreversible. Ensure the new admin address is correct
|
|
959
|
+
* and that you have access to it before executing.
|
|
960
|
+
*
|
|
961
|
+
* @param accounts - Required accounts for transferring admin
|
|
962
|
+
* @param args - Instruction arguments (newAdmin)
|
|
963
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
964
|
+
* @returns Instruction to transfer admin
|
|
965
|
+
*
|
|
966
|
+
* @example
|
|
967
|
+
* ```ts
|
|
968
|
+
* const ix = createTransferAdminInstruction(
|
|
969
|
+
* {
|
|
970
|
+
* config: configAddress,
|
|
971
|
+
* admin: currentAdminPublicKey,
|
|
972
|
+
* },
|
|
973
|
+
* {
|
|
974
|
+
* newAdmin: newAdminPublicKey,
|
|
975
|
+
* }
|
|
976
|
+
* );
|
|
977
|
+
* ```
|
|
978
|
+
*/
|
|
979
|
+
declare function createTransferAdminInstruction(accounts: TransferAdminAccounts, args: TransferAdminArgs, programId?: Address): Instruction;
|
|
980
|
+
|
|
981
|
+
/**
|
|
982
|
+
* Accounts required for skim instruction
|
|
983
|
+
*/
|
|
984
|
+
interface SkimAccounts {
|
|
985
|
+
/** AmmConfig account (read-only) */
|
|
986
|
+
config: Address;
|
|
987
|
+
/** Pool account (read-only) */
|
|
988
|
+
pool: Address;
|
|
989
|
+
/** Admin authority (signer, must match config.admin) */
|
|
990
|
+
admin: Address;
|
|
991
|
+
/** Pool authority PDA (read-only, PDA: ['authority', pool]) */
|
|
992
|
+
authority: Address;
|
|
993
|
+
/** Token0 vault (writable) */
|
|
994
|
+
vault0: Address;
|
|
995
|
+
/** Token1 vault (writable) */
|
|
996
|
+
vault1: Address;
|
|
997
|
+
/** Token0 mint (read-only) */
|
|
998
|
+
token0Mint: Address;
|
|
999
|
+
/** Token1 mint (read-only) */
|
|
1000
|
+
token1Mint: Address;
|
|
1001
|
+
/** Admin's token0 ATA to receive excess (writable) */
|
|
1002
|
+
adminAta0: Address;
|
|
1003
|
+
/** Admin's token1 ATA to receive excess (writable) */
|
|
1004
|
+
adminAta1: Address;
|
|
1005
|
+
/** SPL Token program */
|
|
1006
|
+
tokenProgram?: Address;
|
|
1007
|
+
}
|
|
1008
|
+
/**
|
|
1009
|
+
* Create a skim instruction
|
|
1010
|
+
*
|
|
1011
|
+
* Admin instruction to withdraw excess tokens from pool vaults. This recovers any
|
|
1012
|
+
* tokens that were accidentally sent directly to the vault accounts (outside of
|
|
1013
|
+
* normal pool operations).
|
|
1014
|
+
*
|
|
1015
|
+
* Only withdraws tokens in excess of (reserve + unclaimed_fees). Normal pool
|
|
1016
|
+
* reserves and LP fees are not affected.
|
|
1017
|
+
*
|
|
1018
|
+
* @param accounts - Required accounts for skimming
|
|
1019
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1020
|
+
* @returns Instruction to skim excess tokens
|
|
1021
|
+
*
|
|
1022
|
+
* @example
|
|
1023
|
+
* ```ts
|
|
1024
|
+
* const ix = createSkimInstruction({
|
|
1025
|
+
* config: configAddress,
|
|
1026
|
+
* pool: poolAddress,
|
|
1027
|
+
* admin: adminPublicKey,
|
|
1028
|
+
* authority: authorityAddress,
|
|
1029
|
+
* vault0: vault0Address,
|
|
1030
|
+
* vault1: vault1Address,
|
|
1031
|
+
* token0Mint: mint0,
|
|
1032
|
+
* token1Mint: mint1,
|
|
1033
|
+
* adminAta0: adminToken0Account,
|
|
1034
|
+
* adminAta1: adminToken1Account,
|
|
1035
|
+
* });
|
|
1036
|
+
* ```
|
|
1037
|
+
*/
|
|
1038
|
+
declare function createSkimInstruction(accounts: SkimAccounts, programId?: Address): Instruction;
|
|
1039
|
+
|
|
1040
|
+
/**
|
|
1041
|
+
* Accounts required for swap_exact_in instruction
|
|
1042
|
+
*/
|
|
1043
|
+
interface SwapExactInAccounts {
|
|
1044
|
+
/** AmmConfig account (read-only) */
|
|
1045
|
+
config: Address;
|
|
1046
|
+
/** Pool account (writable) */
|
|
1047
|
+
pool: Address;
|
|
1048
|
+
/** Pool authority PDA (read-only) */
|
|
1049
|
+
authority: Address;
|
|
1050
|
+
/** Input token vault (writable) */
|
|
1051
|
+
vaultIn: Address;
|
|
1052
|
+
/** Output token vault (writable) */
|
|
1053
|
+
vaultOut: Address;
|
|
1054
|
+
/** Token0 mint (read-only, for transfer_checked) */
|
|
1055
|
+
token0Mint: Address;
|
|
1056
|
+
/** Token1 mint (read-only, for transfer_checked) */
|
|
1057
|
+
token1Mint: Address;
|
|
1058
|
+
/** User's input token account (writable) */
|
|
1059
|
+
userIn: Address;
|
|
1060
|
+
/** User's output token account (writable) */
|
|
1061
|
+
userOut: Address;
|
|
1062
|
+
/** User authority (signer) */
|
|
1063
|
+
user: Address;
|
|
1064
|
+
/** SPL Token program */
|
|
1065
|
+
tokenProgram?: Address;
|
|
1066
|
+
/** Oracle account (optional, required if updateOracle is true) */
|
|
1067
|
+
oracle?: Address;
|
|
1068
|
+
/** Optional remaining accounts (sentinel program/state, route/oracle data) */
|
|
1069
|
+
remainingAccounts?: Address[];
|
|
1070
|
+
}
|
|
1071
|
+
/**
|
|
1072
|
+
* Create a swap_exact_in instruction
|
|
1073
|
+
*
|
|
1074
|
+
* Swaps an exact input amount for a minimum output amount using the CPMM formula.
|
|
1075
|
+
*
|
|
1076
|
+
* @param accounts - Required accounts for the swap
|
|
1077
|
+
* @param args - Instruction arguments (amountIn, minAmountOut, direction, updateOracle)
|
|
1078
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1079
|
+
* @returns Instruction to execute the swap
|
|
1080
|
+
*
|
|
1081
|
+
* @example
|
|
1082
|
+
* ```ts
|
|
1083
|
+
* const ix = createSwapExactInInstruction(
|
|
1084
|
+
* {
|
|
1085
|
+
* config: configAddress,
|
|
1086
|
+
* pool: poolAddress,
|
|
1087
|
+
* authority: authorityAddress,
|
|
1088
|
+
* vaultIn: vault0Address,
|
|
1089
|
+
* vaultOut: vault1Address,
|
|
1090
|
+
* token0Mint: mint0,
|
|
1091
|
+
* token1Mint: mint1,
|
|
1092
|
+
* userIn: userToken0Account,
|
|
1093
|
+
* userOut: userToken1Account,
|
|
1094
|
+
* user: userPublicKey,
|
|
1095
|
+
* },
|
|
1096
|
+
* {
|
|
1097
|
+
* amountIn: 1000000n,
|
|
1098
|
+
* minAmountOut: 990000n,
|
|
1099
|
+
* direction: 0, // token0 -> token1
|
|
1100
|
+
* updateOracle: false,
|
|
1101
|
+
* }
|
|
1102
|
+
* );
|
|
1103
|
+
* ```
|
|
1104
|
+
*/
|
|
1105
|
+
declare function createSwapExactInInstruction(accounts: SwapExactInAccounts, args: SwapExactInArgs, programId?: Address): Instruction;
|
|
1106
|
+
/**
|
|
1107
|
+
* Helper to create swap instruction with simplified parameters
|
|
1108
|
+
*/
|
|
1109
|
+
declare function createSwapInstruction(params: {
|
|
1110
|
+
config: Address;
|
|
1111
|
+
pool: Address;
|
|
1112
|
+
authority: Address;
|
|
1113
|
+
vault0: Address;
|
|
1114
|
+
vault1: Address;
|
|
1115
|
+
token0Mint: Address;
|
|
1116
|
+
token1Mint: Address;
|
|
1117
|
+
userToken0: Address;
|
|
1118
|
+
userToken1: Address;
|
|
1119
|
+
user: Address;
|
|
1120
|
+
amountIn: bigint;
|
|
1121
|
+
minAmountOut: bigint;
|
|
1122
|
+
direction: SwapDirection;
|
|
1123
|
+
oracle?: Address;
|
|
1124
|
+
remainingAccounts?: Address[];
|
|
1125
|
+
updateOracle?: boolean;
|
|
1126
|
+
programId?: Address;
|
|
1127
|
+
}): Instruction;
|
|
1128
|
+
|
|
1129
|
+
/**
|
|
1130
|
+
* Accounts required for create_position instruction
|
|
1131
|
+
*/
|
|
1132
|
+
interface CreatePositionAccounts {
|
|
1133
|
+
/** Pool account (read-only) */
|
|
1134
|
+
pool: Address;
|
|
1135
|
+
/** Position PDA to be created (writable, derived from ['position', pool, owner, position_id]) */
|
|
1136
|
+
position: Address;
|
|
1137
|
+
/** Owner of the position (signer) */
|
|
1138
|
+
owner: Address;
|
|
1139
|
+
/** Payer for rent (signer, writable) */
|
|
1140
|
+
payer: Address;
|
|
1141
|
+
/** System program */
|
|
1142
|
+
systemProgram?: Address;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Create a create_position instruction
|
|
1146
|
+
*
|
|
1147
|
+
* Creates a new liquidity position for a pool. The position is a PDA derived from
|
|
1148
|
+
* the pool, owner, and position ID. Users can have multiple positions per pool
|
|
1149
|
+
* by using different position IDs.
|
|
1150
|
+
*
|
|
1151
|
+
* @param accounts - Required accounts for creating the position
|
|
1152
|
+
* @param args - Instruction arguments (positionId)
|
|
1153
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1154
|
+
* @returns Instruction to create a new position
|
|
1155
|
+
*
|
|
1156
|
+
* @example
|
|
1157
|
+
* ```ts
|
|
1158
|
+
* const ix = createCreatePositionInstruction(
|
|
1159
|
+
* {
|
|
1160
|
+
* pool: poolAddress,
|
|
1161
|
+
* position: positionPda,
|
|
1162
|
+
* owner: userPublicKey,
|
|
1163
|
+
* payer: userPublicKey,
|
|
1164
|
+
* },
|
|
1165
|
+
* {
|
|
1166
|
+
* positionId: 0n,
|
|
1167
|
+
* }
|
|
1168
|
+
* );
|
|
1169
|
+
* ```
|
|
1170
|
+
*/
|
|
1171
|
+
declare function createCreatePositionInstruction(accounts: CreatePositionAccounts, args: CreatePositionArgs, programId?: Address): Instruction;
|
|
1172
|
+
|
|
1173
|
+
/**
|
|
1174
|
+
* Accounts required for close_position instruction
|
|
1175
|
+
*/
|
|
1176
|
+
interface ClosePositionAccounts {
|
|
1177
|
+
/** Pool account (read-only) */
|
|
1178
|
+
pool: Address;
|
|
1179
|
+
/** Position account to close (writable) */
|
|
1180
|
+
position: Address;
|
|
1181
|
+
/** Position owner (signer) */
|
|
1182
|
+
owner: Address;
|
|
1183
|
+
/** Recipient for rent lamports (writable) */
|
|
1184
|
+
rentRecipient: Address;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Create a close_position instruction
|
|
1188
|
+
*
|
|
1189
|
+
* Closes an empty position account, returning the rent lamports to the recipient.
|
|
1190
|
+
* The position must have zero shares and zero accrued fees to be closed.
|
|
1191
|
+
*
|
|
1192
|
+
* @param accounts - Required accounts for closing the position
|
|
1193
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1194
|
+
* @returns Instruction to close a position
|
|
1195
|
+
*
|
|
1196
|
+
* @example
|
|
1197
|
+
* ```ts
|
|
1198
|
+
* const ix = createClosePositionInstruction({
|
|
1199
|
+
* pool: poolAddress,
|
|
1200
|
+
* position: positionAddress,
|
|
1201
|
+
* owner: userPublicKey,
|
|
1202
|
+
* rentRecipient: userPublicKey,
|
|
1203
|
+
* });
|
|
1204
|
+
* ```
|
|
1205
|
+
*/
|
|
1206
|
+
declare function createClosePositionInstruction(accounts: ClosePositionAccounts, programId?: Address): Instruction;
|
|
1207
|
+
|
|
1208
|
+
/**
|
|
1209
|
+
* Extended AddLiquidity args that include updateOracle flag
|
|
1210
|
+
* (matches the on-chain program's actual args)
|
|
1211
|
+
*/
|
|
1212
|
+
interface AddLiquidityArgsWithOracle extends AddLiquidityArgs {
|
|
1213
|
+
/** Whether to update the oracle (requires oracle account) */
|
|
1214
|
+
updateOracle: boolean;
|
|
1215
|
+
}
|
|
1216
|
+
/**
|
|
1217
|
+
* Accounts required for add_liquidity instruction
|
|
1218
|
+
*/
|
|
1219
|
+
interface AddLiquidityAccounts {
|
|
1220
|
+
/** AmmConfig account (read-only) */
|
|
1221
|
+
config: Address;
|
|
1222
|
+
/** Pool account (writable) */
|
|
1223
|
+
pool: Address;
|
|
1224
|
+
/** User's position account (writable) */
|
|
1225
|
+
position: Address;
|
|
1226
|
+
/** Protocol position for protocol fees (writable) */
|
|
1227
|
+
protocolPosition: Address;
|
|
1228
|
+
/** Position owner (signer) */
|
|
1229
|
+
owner: Address;
|
|
1230
|
+
/** Pool authority PDA (read-only) */
|
|
1231
|
+
authority: Address;
|
|
1232
|
+
/** Pool vault for token0 (writable) */
|
|
1233
|
+
vault0: Address;
|
|
1234
|
+
/** Pool vault for token1 (writable) */
|
|
1235
|
+
vault1: Address;
|
|
1236
|
+
/** Token0 mint (read-only) */
|
|
1237
|
+
token0Mint: Address;
|
|
1238
|
+
/** Token1 mint (read-only) */
|
|
1239
|
+
token1Mint: Address;
|
|
1240
|
+
/** User's token0 account (writable) */
|
|
1241
|
+
user0: Address;
|
|
1242
|
+
/** User's token1 account (writable) */
|
|
1243
|
+
user1: Address;
|
|
1244
|
+
/** SPL Token program */
|
|
1245
|
+
tokenProgram?: Address;
|
|
1246
|
+
/** Oracle account (optional, required if updateOracle is true) */
|
|
1247
|
+
oracle?: Address;
|
|
1248
|
+
/** Optional remaining accounts (sentinel program/state, route/oracle data) */
|
|
1249
|
+
remainingAccounts?: Address[];
|
|
1250
|
+
}
|
|
1251
|
+
/**
|
|
1252
|
+
* Create an add_liquidity instruction
|
|
1253
|
+
*
|
|
1254
|
+
* Adds liquidity to a pool by depositing tokens and receiving LP shares.
|
|
1255
|
+
* For an empty pool (first deposit), the amount of shares is sqrt(amount0 * amount1).
|
|
1256
|
+
* For subsequent deposits, shares are proportional to the smaller ratio of deposit to reserves.
|
|
1257
|
+
*
|
|
1258
|
+
* @param accounts - Required accounts for adding liquidity
|
|
1259
|
+
* @param args - Instruction arguments (amount0Max, amount1Max, minSharesOut, updateOracle)
|
|
1260
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1261
|
+
* @returns Instruction to add liquidity
|
|
1262
|
+
*
|
|
1263
|
+
* @example
|
|
1264
|
+
* ```ts
|
|
1265
|
+
* const ix = createAddLiquidityInstruction(
|
|
1266
|
+
* {
|
|
1267
|
+
* config: configAddress,
|
|
1268
|
+
* pool: poolAddress,
|
|
1269
|
+
* position: positionAddress,
|
|
1270
|
+
* protocolPosition: protocolPositionAddress,
|
|
1271
|
+
* owner: userPublicKey,
|
|
1272
|
+
* authority: authorityPda,
|
|
1273
|
+
* vault0: vault0Address,
|
|
1274
|
+
* vault1: vault1Address,
|
|
1275
|
+
* token0Mint: mint0,
|
|
1276
|
+
* token1Mint: mint1,
|
|
1277
|
+
* user0: userToken0Account,
|
|
1278
|
+
* user1: userToken1Account,
|
|
1279
|
+
* },
|
|
1280
|
+
* {
|
|
1281
|
+
* amount0Max: 1000000n,
|
|
1282
|
+
* amount1Max: 1000000n,
|
|
1283
|
+
* minSharesOut: 0n,
|
|
1284
|
+
* updateOracle: false,
|
|
1285
|
+
* }
|
|
1286
|
+
* );
|
|
1287
|
+
* ```
|
|
1288
|
+
*/
|
|
1289
|
+
declare function createAddLiquidityInstruction(accounts: AddLiquidityAccounts, args: AddLiquidityArgsWithOracle, programId?: Address): Instruction;
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* Accounts required for remove_liquidity instruction
|
|
1293
|
+
*/
|
|
1294
|
+
interface RemoveLiquidityAccounts {
|
|
1295
|
+
/** AmmConfig account (read-only) */
|
|
1296
|
+
config: Address;
|
|
1297
|
+
/** Pool account (writable) */
|
|
1298
|
+
pool: Address;
|
|
1299
|
+
/** User's position account (writable) */
|
|
1300
|
+
position: Address;
|
|
1301
|
+
/** Protocol position for protocol fees (writable) */
|
|
1302
|
+
protocolPosition: Address;
|
|
1303
|
+
/** Position owner (signer) */
|
|
1304
|
+
owner: Address;
|
|
1305
|
+
/** Pool authority PDA (read-only) */
|
|
1306
|
+
authority: Address;
|
|
1307
|
+
/** Pool vault for token0 (writable) */
|
|
1308
|
+
vault0: Address;
|
|
1309
|
+
/** Pool vault for token1 (writable) */
|
|
1310
|
+
vault1: Address;
|
|
1311
|
+
/** Token0 mint (read-only) */
|
|
1312
|
+
token0Mint: Address;
|
|
1313
|
+
/** Token1 mint (read-only) */
|
|
1314
|
+
token1Mint: Address;
|
|
1315
|
+
/** User's token0 account (writable) */
|
|
1316
|
+
user0: Address;
|
|
1317
|
+
/** User's token1 account (writable) */
|
|
1318
|
+
user1: Address;
|
|
1319
|
+
/** SPL Token program */
|
|
1320
|
+
tokenProgram?: Address;
|
|
1321
|
+
/** Oracle account (optional, required if updateOracle is true) */
|
|
1322
|
+
oracle?: Address;
|
|
1323
|
+
/** Optional remaining accounts (sentinel program/state, route/oracle data) */
|
|
1324
|
+
remainingAccounts?: Address[];
|
|
1325
|
+
}
|
|
1326
|
+
/**
|
|
1327
|
+
* Create a remove_liquidity instruction
|
|
1328
|
+
*
|
|
1329
|
+
* Removes liquidity from a pool by burning LP shares and receiving tokens back.
|
|
1330
|
+
* The amount of tokens received is proportional to the share of the pool being withdrawn.
|
|
1331
|
+
* Also accrues any pending fees to the position before withdrawal.
|
|
1332
|
+
*
|
|
1333
|
+
* @param accounts - Required accounts for removing liquidity
|
|
1334
|
+
* @param args - Instruction arguments (sharesIn, minAmount0Out, minAmount1Out, updateOracle)
|
|
1335
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1336
|
+
* @returns Instruction to remove liquidity
|
|
1337
|
+
*
|
|
1338
|
+
* @example
|
|
1339
|
+
* ```ts
|
|
1340
|
+
* const ix = createRemoveLiquidityInstruction(
|
|
1341
|
+
* {
|
|
1342
|
+
* config: configAddress,
|
|
1343
|
+
* pool: poolAddress,
|
|
1344
|
+
* position: positionAddress,
|
|
1345
|
+
* protocolPosition: protocolPositionAddress,
|
|
1346
|
+
* owner: userPublicKey,
|
|
1347
|
+
* authority: authorityPda,
|
|
1348
|
+
* vault0: vault0Address,
|
|
1349
|
+
* vault1: vault1Address,
|
|
1350
|
+
* token0Mint: mint0,
|
|
1351
|
+
* token1Mint: mint1,
|
|
1352
|
+
* user0: userToken0Account,
|
|
1353
|
+
* user1: userToken1Account,
|
|
1354
|
+
* },
|
|
1355
|
+
* {
|
|
1356
|
+
* sharesIn: 500000n,
|
|
1357
|
+
* minAmount0Out: 450000n,
|
|
1358
|
+
* minAmount1Out: 450000n,
|
|
1359
|
+
* updateOracle: false,
|
|
1360
|
+
* }
|
|
1361
|
+
* );
|
|
1362
|
+
* ```
|
|
1363
|
+
*/
|
|
1364
|
+
declare function createRemoveLiquidityInstruction(accounts: RemoveLiquidityAccounts, args: RemoveLiquidityArgs, programId?: Address): Instruction;
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Accounts required for collect_fees instruction
|
|
1368
|
+
*/
|
|
1369
|
+
interface CollectFeesAccounts {
|
|
1370
|
+
/** Pool account (writable) */
|
|
1371
|
+
pool: Address;
|
|
1372
|
+
/** User's position account (writable) */
|
|
1373
|
+
position: Address;
|
|
1374
|
+
/** Position owner (signer) */
|
|
1375
|
+
owner: Address;
|
|
1376
|
+
/** Pool authority PDA (read-only) */
|
|
1377
|
+
authority: Address;
|
|
1378
|
+
/** Pool vault for token0 (writable) */
|
|
1379
|
+
vault0: Address;
|
|
1380
|
+
/** Pool vault for token1 (writable) */
|
|
1381
|
+
vault1: Address;
|
|
1382
|
+
/** Token0 mint (read-only) */
|
|
1383
|
+
token0Mint: Address;
|
|
1384
|
+
/** Token1 mint (read-only) */
|
|
1385
|
+
token1Mint: Address;
|
|
1386
|
+
/** User's token0 account (writable) */
|
|
1387
|
+
user0: Address;
|
|
1388
|
+
/** User's token1 account (writable) */
|
|
1389
|
+
user1: Address;
|
|
1390
|
+
/** SPL Token program */
|
|
1391
|
+
tokenProgram?: Address;
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* Create a collect_fees instruction
|
|
1395
|
+
*
|
|
1396
|
+
* Collects accrued LP fees from a position. Fees are first accrued from the global
|
|
1397
|
+
* fee growth, then transferred from the pool vaults to the user's token accounts.
|
|
1398
|
+
* You can specify max amounts to partially collect fees.
|
|
1399
|
+
*
|
|
1400
|
+
* @param accounts - Required accounts for collecting fees
|
|
1401
|
+
* @param args - Instruction arguments (max0, max1)
|
|
1402
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1403
|
+
* @returns Instruction to collect fees
|
|
1404
|
+
*
|
|
1405
|
+
* @example
|
|
1406
|
+
* ```ts
|
|
1407
|
+
* // Collect all accrued fees
|
|
1408
|
+
* const ix = createCollectFeesInstruction(
|
|
1409
|
+
* {
|
|
1410
|
+
* pool: poolAddress,
|
|
1411
|
+
* position: positionAddress,
|
|
1412
|
+
* owner: userPublicKey,
|
|
1413
|
+
* authority: authorityPda,
|
|
1414
|
+
* vault0: vault0Address,
|
|
1415
|
+
* vault1: vault1Address,
|
|
1416
|
+
* token0Mint: mint0,
|
|
1417
|
+
* token1Mint: mint1,
|
|
1418
|
+
* user0: userToken0Account,
|
|
1419
|
+
* user1: userToken1Account,
|
|
1420
|
+
* },
|
|
1421
|
+
* {
|
|
1422
|
+
* max0: BigInt('18446744073709551615'), // u64::MAX to collect all
|
|
1423
|
+
* max1: BigInt('18446744073709551615'),
|
|
1424
|
+
* }
|
|
1425
|
+
* );
|
|
1426
|
+
* ```
|
|
1427
|
+
*/
|
|
1428
|
+
declare function createCollectFeesInstruction(accounts: CollectFeesAccounts, args: CollectFeesArgs, programId?: Address): Instruction;
|
|
1429
|
+
/**
|
|
1430
|
+
* Convenience constant for collecting all fees (u64::MAX)
|
|
1431
|
+
*/
|
|
1432
|
+
declare const MAX_FEE_AMOUNT: bigint;
|
|
1433
|
+
|
|
1434
|
+
/**
|
|
1435
|
+
* Accounts required for collect_protocol_fees instruction
|
|
1436
|
+
*/
|
|
1437
|
+
interface CollectProtocolFeesAccounts {
|
|
1438
|
+
/** AmmConfig account (read-only) */
|
|
1439
|
+
config: Address;
|
|
1440
|
+
/** Pool account (writable) */
|
|
1441
|
+
pool: Address;
|
|
1442
|
+
/** Protocol position account (writable) */
|
|
1443
|
+
protocolPosition: Address;
|
|
1444
|
+
/** Admin authority (signer) */
|
|
1445
|
+
admin: Address;
|
|
1446
|
+
/** Pool authority PDA (read-only) */
|
|
1447
|
+
authority: Address;
|
|
1448
|
+
/** Pool vault for token0 (writable) */
|
|
1449
|
+
vault0: Address;
|
|
1450
|
+
/** Pool vault for token1 (writable) */
|
|
1451
|
+
vault1: Address;
|
|
1452
|
+
/** Token0 mint (read-only) */
|
|
1453
|
+
token0Mint: Address;
|
|
1454
|
+
/** Token1 mint (read-only) */
|
|
1455
|
+
token1Mint: Address;
|
|
1456
|
+
/** Recipient token0 account (writable) */
|
|
1457
|
+
recipient0: Address;
|
|
1458
|
+
/** Recipient token1 account (writable) */
|
|
1459
|
+
recipient1: Address;
|
|
1460
|
+
/** SPL Token program */
|
|
1461
|
+
tokenProgram?: Address;
|
|
1462
|
+
}
|
|
1463
|
+
/**
|
|
1464
|
+
* Create a collect_protocol_fees instruction
|
|
1465
|
+
*
|
|
1466
|
+
* Collects accrued protocol fees from the protocol position and transfers them
|
|
1467
|
+
* to the configured recipients.
|
|
1468
|
+
*
|
|
1469
|
+
* @param accounts - Required accounts for collecting protocol fees
|
|
1470
|
+
* @param args - Instruction arguments (max0, max1)
|
|
1471
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1472
|
+
* @returns Instruction to collect protocol fees
|
|
1473
|
+
*
|
|
1474
|
+
* @example
|
|
1475
|
+
* ```ts
|
|
1476
|
+
* const ix = createCollectProtocolFeesInstruction(
|
|
1477
|
+
* {
|
|
1478
|
+
* config: configAddress,
|
|
1479
|
+
* pool: poolAddress,
|
|
1480
|
+
* protocolPosition: protocolPositionAddress,
|
|
1481
|
+
* admin: adminPublicKey,
|
|
1482
|
+
* authority: authorityPda,
|
|
1483
|
+
* vault0: vault0Address,
|
|
1484
|
+
* vault1: vault1Address,
|
|
1485
|
+
* token0Mint: mint0,
|
|
1486
|
+
* token1Mint: mint1,
|
|
1487
|
+
* recipient0: adminToken0Account,
|
|
1488
|
+
* recipient1: adminToken1Account,
|
|
1489
|
+
* },
|
|
1490
|
+
* {
|
|
1491
|
+
* max0: BigInt('18446744073709551615'),
|
|
1492
|
+
* max1: BigInt('18446744073709551615'),
|
|
1493
|
+
* }
|
|
1494
|
+
* );
|
|
1495
|
+
* ```
|
|
1496
|
+
*/
|
|
1497
|
+
declare function createCollectProtocolFeesInstruction(accounts: CollectProtocolFeesAccounts, args: CollectProtocolFeesArgs, programId?: Address): Instruction;
|
|
1498
|
+
|
|
1499
|
+
/**
|
|
1500
|
+
* Accounts required for oracle_update instruction
|
|
1501
|
+
*/
|
|
1502
|
+
interface OracleUpdateAccounts {
|
|
1503
|
+
/** Pool account (read-only) */
|
|
1504
|
+
pool: Address;
|
|
1505
|
+
/** Oracle PDA to update (writable) */
|
|
1506
|
+
oracle: Address;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* Create an oracle_update instruction
|
|
1510
|
+
*
|
|
1511
|
+
* Updates the oracle with the current pool prices. This samples the current
|
|
1512
|
+
* spot price, clamps it according to maxPriceChangeRatioQ64, and records
|
|
1513
|
+
* a new observation if the observation interval has elapsed.
|
|
1514
|
+
*
|
|
1515
|
+
* This instruction is permissionless - anyone can call it to update the oracle.
|
|
1516
|
+
*
|
|
1517
|
+
* @param accounts - Required accounts for the instruction
|
|
1518
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1519
|
+
* @returns Instruction to update the oracle
|
|
1520
|
+
*
|
|
1521
|
+
* @example
|
|
1522
|
+
* ```ts
|
|
1523
|
+
* const ix = createOracleUpdateInstruction({
|
|
1524
|
+
* pool: poolAddress,
|
|
1525
|
+
* oracle: oracleAddress,
|
|
1526
|
+
* });
|
|
1527
|
+
* ```
|
|
1528
|
+
*/
|
|
1529
|
+
declare function createOracleUpdateInstruction(accounts: OracleUpdateAccounts, programId?: Address): Instruction;
|
|
1530
|
+
|
|
1531
|
+
/**
|
|
1532
|
+
* Accounts required for oracle_consult instruction
|
|
1533
|
+
*/
|
|
1534
|
+
interface OracleConsultAccounts {
|
|
1535
|
+
/** Pool account (read-only) */
|
|
1536
|
+
pool: Address;
|
|
1537
|
+
/** Oracle PDA to query (read-only) */
|
|
1538
|
+
oracle: Address;
|
|
1539
|
+
}
|
|
1540
|
+
/**
|
|
1541
|
+
* Result returned from oracle_consult via return data
|
|
1542
|
+
*/
|
|
1543
|
+
interface OracleConsultResult {
|
|
1544
|
+
/** TWAP price of token0 in token1 (Q64.64 fixed-point) */
|
|
1545
|
+
price0Q64: bigint;
|
|
1546
|
+
/** TWAP price of token1 in token0 (Q64.64 fixed-point) */
|
|
1547
|
+
price1Q64: bigint;
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Decode oracle_consult return data
|
|
1551
|
+
*/
|
|
1552
|
+
declare function decodeOracleConsultResult(data: ReadonlyUint8Array): OracleConsultResult;
|
|
1553
|
+
/**
|
|
1554
|
+
* Create an oracle_consult instruction
|
|
1555
|
+
*
|
|
1556
|
+
* Queries the TWAP price from the oracle over the specified time window.
|
|
1557
|
+
* The result is returned via Solana's return data mechanism.
|
|
1558
|
+
*
|
|
1559
|
+
* Note: To read the result, you must invoke this instruction via CPI or
|
|
1560
|
+
* simulate the transaction and parse the return data.
|
|
1561
|
+
*
|
|
1562
|
+
* @param accounts - Required accounts for the instruction
|
|
1563
|
+
* @param args - Instruction arguments (windowSeconds)
|
|
1564
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1565
|
+
* @returns Instruction to consult the oracle
|
|
1566
|
+
*
|
|
1567
|
+
* @example
|
|
1568
|
+
* ```ts
|
|
1569
|
+
* const ix = createOracleConsultInstruction(
|
|
1570
|
+
* {
|
|
1571
|
+
* pool: poolAddress,
|
|
1572
|
+
* oracle: oracleAddress,
|
|
1573
|
+
* },
|
|
1574
|
+
* {
|
|
1575
|
+
* windowSeconds: 300, // 5-minute TWAP
|
|
1576
|
+
* }
|
|
1577
|
+
* );
|
|
1578
|
+
* ```
|
|
1579
|
+
*/
|
|
1580
|
+
declare function createOracleConsultInstruction(accounts: OracleConsultAccounts, args: OracleConsultArgs, programId?: Address): Instruction;
|
|
1581
|
+
|
|
1582
|
+
/**
|
|
1583
|
+
* Accounts required for quote_to_numeraire instruction
|
|
1584
|
+
*/
|
|
1585
|
+
interface QuoteToNumeraireAccounts {
|
|
1586
|
+
/** AmmConfig account (read-only) */
|
|
1587
|
+
config: Address;
|
|
1588
|
+
/** Starting pool for the route (read-only) */
|
|
1589
|
+
startPool: Address;
|
|
1590
|
+
/**
|
|
1591
|
+
* Remaining accounts for routing:
|
|
1592
|
+
* - [pool1?, pool2?, ...]
|
|
1593
|
+
*
|
|
1594
|
+
* Each hop requires the next pool in the route chain.
|
|
1595
|
+
*/
|
|
1596
|
+
remainingAccounts?: Address[];
|
|
1597
|
+
}
|
|
1598
|
+
/**
|
|
1599
|
+
* Result returned from quote_to_numeraire via return data
|
|
1600
|
+
*/
|
|
1601
|
+
interface QuoteToNumeraireResult {
|
|
1602
|
+
/** Amount converted to numeraire (u128) */
|
|
1603
|
+
amountInNumeraire: bigint;
|
|
1604
|
+
/** Final mint reached (should be numeraire) */
|
|
1605
|
+
endMint: Address;
|
|
1606
|
+
/** Number of hops used in the route */
|
|
1607
|
+
hopsUsed: number;
|
|
1608
|
+
}
|
|
1609
|
+
/**
|
|
1610
|
+
* Decode quote_to_numeraire return data
|
|
1611
|
+
*/
|
|
1612
|
+
declare function decodeQuoteToNumeraireResult(data: ReadonlyUint8Array): QuoteToNumeraireResult;
|
|
1613
|
+
/**
|
|
1614
|
+
* Create a quote_to_numeraire instruction
|
|
1615
|
+
*
|
|
1616
|
+
* Converts an amount of one token to its value in the pool's numeraire
|
|
1617
|
+
* via the routing chain using spot pricing. (TWAP is not supported in v0.1.)
|
|
1618
|
+
*
|
|
1619
|
+
* The result is returned via Solana's return data mechanism.
|
|
1620
|
+
*
|
|
1621
|
+
* @param accounts - Required accounts for the instruction
|
|
1622
|
+
* @param args - Instruction arguments (amount, side, maxHops, useTwap, windowSeconds)
|
|
1623
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1624
|
+
* @returns Instruction to quote amount in numeraire
|
|
1625
|
+
*
|
|
1626
|
+
* @example
|
|
1627
|
+
* ```ts
|
|
1628
|
+
* // Quote using spot prices (no TWAP)
|
|
1629
|
+
* const ix = createQuoteToNumeraireInstruction(
|
|
1630
|
+
* {
|
|
1631
|
+
* config: configAddress,
|
|
1632
|
+
* startPool: poolAddress,
|
|
1633
|
+
* },
|
|
1634
|
+
* {
|
|
1635
|
+
* amount: 1000000n,
|
|
1636
|
+
* side: 0, // token0
|
|
1637
|
+
* maxHops: 3,
|
|
1638
|
+
* useTwap: false,
|
|
1639
|
+
* windowSeconds: 0,
|
|
1640
|
+
* }
|
|
1641
|
+
* );
|
|
1642
|
+
* ```
|
|
1643
|
+
*/
|
|
1644
|
+
declare function createQuoteToNumeraireInstruction(accounts: QuoteToNumeraireAccounts, args: QuoteToNumeraireArgs, programId?: Address): Instruction;
|
|
1645
|
+
|
|
1646
|
+
/**
|
|
1647
|
+
* Pool fetching and utility functions for the CPMM SDK
|
|
1648
|
+
*/
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* Configuration for fetching pools
|
|
1652
|
+
*/
|
|
1653
|
+
interface FetchPoolsConfig {
|
|
1654
|
+
/** Program ID (defaults to CPMM program) */
|
|
1655
|
+
programId?: Address;
|
|
1656
|
+
/** Commitment level */
|
|
1657
|
+
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
1658
|
+
}
|
|
1659
|
+
/**
|
|
1660
|
+
* Pool with its address
|
|
1661
|
+
*/
|
|
1662
|
+
interface PoolWithAddress {
|
|
1663
|
+
address: Address;
|
|
1664
|
+
account: Pool;
|
|
1665
|
+
}
|
|
1666
|
+
/**
|
|
1667
|
+
* Fetch and decode a single pool account
|
|
1668
|
+
*
|
|
1669
|
+
* @param rpc - Solana RPC client
|
|
1670
|
+
* @param address - Pool account address
|
|
1671
|
+
* @param config - Optional configuration
|
|
1672
|
+
* @returns Decoded pool data or null if not found
|
|
1673
|
+
*
|
|
1674
|
+
* @example
|
|
1675
|
+
* ```ts
|
|
1676
|
+
* const pool = await fetchPool(rpc, poolAddress);
|
|
1677
|
+
* if (pool) {
|
|
1678
|
+
* console.log(`Pool reserves: ${pool.reserve0} / ${pool.reserve1}`);
|
|
1679
|
+
* }
|
|
1680
|
+
* ```
|
|
1681
|
+
*/
|
|
1682
|
+
declare function fetchPool(rpc: Rpc<GetAccountInfoApi>, address: Address, config?: FetchPoolsConfig): Promise<Pool | null>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Fetch all pool accounts for the CPMM program
|
|
1685
|
+
*
|
|
1686
|
+
* Uses getProgramAccounts with a discriminator filter for efficiency.
|
|
1687
|
+
*
|
|
1688
|
+
* @param rpc - Solana RPC client
|
|
1689
|
+
* @param config - Optional configuration
|
|
1690
|
+
* @returns Array of pools with their addresses
|
|
1691
|
+
*
|
|
1692
|
+
* @example
|
|
1693
|
+
* ```ts
|
|
1694
|
+
* const pools = await fetchAllPools(rpc);
|
|
1695
|
+
* console.log(`Found ${pools.length} pools`);
|
|
1696
|
+
* for (const { address, account } of pools) {
|
|
1697
|
+
* console.log(`Pool ${address}: ${account.token0Mint} / ${account.token1Mint}`);
|
|
1698
|
+
* }
|
|
1699
|
+
* ```
|
|
1700
|
+
*/
|
|
1701
|
+
declare function fetchAllPools(rpc: GetProgramAccountsRpc, config?: FetchPoolsConfig): Promise<PoolWithAddress[]>;
|
|
1702
|
+
/**
|
|
1703
|
+
* Find a pool by its token pair mints
|
|
1704
|
+
*
|
|
1705
|
+
* Derives the pool PDA from the mints (automatically sorted) and fetches it.
|
|
1706
|
+
*
|
|
1707
|
+
* @param rpc - Solana RPC client
|
|
1708
|
+
* @param mint0 - First token mint
|
|
1709
|
+
* @param mint1 - Second token mint
|
|
1710
|
+
* @param config - Optional configuration
|
|
1711
|
+
* @returns Pool data with address, or null if not found
|
|
1712
|
+
*
|
|
1713
|
+
* @example
|
|
1714
|
+
* ```ts
|
|
1715
|
+
* const result = await getPoolByMints(rpc, usdcMint, wsolMint);
|
|
1716
|
+
* if (result) {
|
|
1717
|
+
* console.log(`Found pool at ${result.address}`);
|
|
1718
|
+
* console.log(`Swap fee: ${result.account.swapFeeBps} bps`);
|
|
1719
|
+
* }
|
|
1720
|
+
* ```
|
|
1721
|
+
*/
|
|
1722
|
+
declare function getPoolByMints(rpc: Rpc<GetAccountInfoApi>, mint0: Address, mint1: Address, config?: FetchPoolsConfig): Promise<PoolWithAddress | null>;
|
|
1723
|
+
/**
|
|
1724
|
+
* Get multiple pools by their addresses in a single batch request
|
|
1725
|
+
*
|
|
1726
|
+
* @param rpc - Solana RPC client
|
|
1727
|
+
* @param addresses - Array of pool addresses to fetch
|
|
1728
|
+
* @param config - Optional configuration
|
|
1729
|
+
* @returns Map of address to pool (missing pools are not included)
|
|
1730
|
+
*
|
|
1731
|
+
* @example
|
|
1732
|
+
* ```ts
|
|
1733
|
+
* const poolMap = await fetchPoolsBatch(rpc, [pool1, pool2, pool3]);
|
|
1734
|
+
* for (const [addr, pool] of poolMap) {
|
|
1735
|
+
* console.log(`Pool ${addr}: TVL = ${pool.reserve0 + pool.reserve1}`);
|
|
1736
|
+
* }
|
|
1737
|
+
* ```
|
|
1738
|
+
*/
|
|
1739
|
+
declare function fetchPoolsBatch(rpc: Rpc<GetAccountInfoApi>, addresses: Address[], config?: FetchPoolsConfig): Promise<Map<Address, Pool>>;
|
|
1740
|
+
/**
|
|
1741
|
+
* Check if a pool exists for a token pair
|
|
1742
|
+
*
|
|
1743
|
+
* @param rpc - Solana RPC client
|
|
1744
|
+
* @param mint0 - First token mint
|
|
1745
|
+
* @param mint1 - Second token mint
|
|
1746
|
+
* @param config - Optional configuration
|
|
1747
|
+
* @returns true if pool exists, false otherwise
|
|
1748
|
+
*/
|
|
1749
|
+
declare function poolExists(rpc: Rpc<GetAccountInfoApi>, mint0: Address, mint1: Address, config?: FetchPoolsConfig): Promise<boolean>;
|
|
1750
|
+
/**
|
|
1751
|
+
* Get the pool address for a token pair without fetching
|
|
1752
|
+
*
|
|
1753
|
+
* @param mint0 - First token mint
|
|
1754
|
+
* @param mint1 - Second token mint
|
|
1755
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1756
|
+
* @returns Pool address and sorted mints
|
|
1757
|
+
*/
|
|
1758
|
+
declare function getPoolAddressFromMints(mint0: Address, mint1: Address, programId?: Address): Promise<{
|
|
1759
|
+
poolAddress: Address;
|
|
1760
|
+
token0: Address;
|
|
1761
|
+
token1: Address;
|
|
1762
|
+
}>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Filter pools by a specific token mint
|
|
1765
|
+
*
|
|
1766
|
+
* @param pools - Array of pools to filter
|
|
1767
|
+
* @param mint - Token mint to filter by
|
|
1768
|
+
* @returns Pools that contain the specified mint
|
|
1769
|
+
*/
|
|
1770
|
+
declare function filterPoolsByMint(pools: PoolWithAddress[], mint: Address): PoolWithAddress[];
|
|
1771
|
+
/**
|
|
1772
|
+
* Sort pools by total reserves (proxy for TVL)
|
|
1773
|
+
*
|
|
1774
|
+
* @param pools - Array of pools to sort
|
|
1775
|
+
* @param descending - Sort descending (highest first) if true
|
|
1776
|
+
* @returns Sorted array (does not mutate input)
|
|
1777
|
+
*/
|
|
1778
|
+
declare function sortPoolsByReserves(pools: PoolWithAddress[], descending?: boolean): PoolWithAddress[];
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Config fetching and utilities for the CPMM SDK
|
|
1782
|
+
*/
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* Fetch and decode the AmmConfig account
|
|
1786
|
+
*
|
|
1787
|
+
* @param rpc - Solana RPC client
|
|
1788
|
+
* @param programId - Program ID (defaults to CPMM program)
|
|
1789
|
+
* @param commitment - Optional commitment level
|
|
1790
|
+
* @returns Decoded config data or null if not found
|
|
1791
|
+
*/
|
|
1792
|
+
declare function fetchConfig(rpc: Rpc<GetAccountInfoApi>, programId?: Address, commitment?: 'processed' | 'confirmed' | 'finalized'): Promise<AmmConfig | null>;
|
|
1793
|
+
/**
|
|
1794
|
+
* Fetch config with its PDA address
|
|
1795
|
+
*/
|
|
1796
|
+
declare function fetchConfigWithAddress(rpc: Rpc<GetAccountInfoApi>, programId?: Address, commitment?: 'processed' | 'confirmed' | 'finalized'): Promise<{
|
|
1797
|
+
address: Address;
|
|
1798
|
+
account: AmmConfig;
|
|
1799
|
+
} | null>;
|
|
1800
|
+
|
|
1801
|
+
declare const index$4_ACCOUNT_DISCRIMINATORS: typeof ACCOUNT_DISCRIMINATORS;
|
|
1802
|
+
declare const index$4_ACCOUNT_VERSION: typeof ACCOUNT_VERSION;
|
|
1803
|
+
type index$4_AddLiquidityAccounts = AddLiquidityAccounts;
|
|
1804
|
+
declare const index$4_AddLiquidityArgs: typeof AddLiquidityArgs;
|
|
1805
|
+
type index$4_AddLiquidityArgsWithOracle = AddLiquidityArgsWithOracle;
|
|
1806
|
+
declare const index$4_AddLiquidityEvent: typeof AddLiquidityEvent;
|
|
1807
|
+
declare const index$4_AddLiquidityQuote: typeof AddLiquidityQuote;
|
|
1808
|
+
declare const index$4_AdminTransferredEvent: typeof AdminTransferredEvent;
|
|
1809
|
+
declare const index$4_AmmConfig: typeof AmmConfig;
|
|
1810
|
+
declare const index$4_BPS_DENOM: typeof BPS_DENOM;
|
|
1811
|
+
declare const index$4_CPMM_ERROR_MESSAGES: typeof CPMM_ERROR_MESSAGES;
|
|
1812
|
+
declare const index$4_CPMM_PROGRAM_ID: typeof CPMM_PROGRAM_ID;
|
|
1813
|
+
type index$4_ClosePositionAccounts = ClosePositionAccounts;
|
|
1814
|
+
type index$4_CollectFeesAccounts = CollectFeesAccounts;
|
|
1815
|
+
declare const index$4_CollectFeesArgs: typeof CollectFeesArgs;
|
|
1816
|
+
declare const index$4_CollectFeesEvent: typeof CollectFeesEvent;
|
|
1817
|
+
type index$4_CollectProtocolFeesAccounts = CollectProtocolFeesAccounts;
|
|
1818
|
+
declare const index$4_CollectProtocolFeesArgs: typeof CollectProtocolFeesArgs;
|
|
1819
|
+
declare const index$4_CollectProtocolFeesEvent: typeof CollectProtocolFeesEvent;
|
|
1820
|
+
type index$4_CpmmError = CpmmError;
|
|
1821
|
+
declare const index$4_CpmmError: typeof CpmmError;
|
|
1822
|
+
type index$4_CpmmErrorCode = CpmmErrorCode;
|
|
1823
|
+
declare const index$4_CpmmErrorCode: typeof CpmmErrorCode;
|
|
1824
|
+
type index$4_CreatePositionAccounts = CreatePositionAccounts;
|
|
1825
|
+
declare const index$4_CreatePositionArgs: typeof CreatePositionArgs;
|
|
1826
|
+
declare const index$4_CurveParams: typeof CurveParams;
|
|
1827
|
+
declare const index$4_CurveParamsToMarketCapInput: typeof CurveParamsToMarketCapInput;
|
|
1828
|
+
declare const index$4_FeesUpdatedEvent: typeof FeesUpdatedEvent;
|
|
1829
|
+
declare const index$4_FetchOracleConfig: typeof FetchOracleConfig;
|
|
1830
|
+
type index$4_FetchPoolsConfig = FetchPoolsConfig;
|
|
1831
|
+
declare const index$4_FetchPositionsConfig: typeof FetchPositionsConfig;
|
|
1832
|
+
declare const index$4_INSTRUCTION_DISCRIMINATORS: typeof INSTRUCTION_DISCRIMINATORS;
|
|
1833
|
+
type index$4_InitializeOracleAccounts = InitializeOracleAccounts;
|
|
1834
|
+
type index$4_InitializePoolAccounts = InitializePoolAccounts;
|
|
1835
|
+
declare const index$4_InitializePoolArgs: typeof InitializePoolArgs;
|
|
1836
|
+
declare const index$4_MAX_FEE_AMOUNT: typeof MAX_FEE_AMOUNT;
|
|
1837
|
+
declare const index$4_MAX_ORACLE_OBSERVATIONS: typeof MAX_ORACLE_OBSERVATIONS;
|
|
1838
|
+
declare const index$4_MarketCapToCurveParamsInput: typeof MarketCapToCurveParamsInput;
|
|
1839
|
+
declare const index$4_MarketCapValidationResult: typeof MarketCapValidationResult;
|
|
1840
|
+
declare const index$4_Observation: typeof Observation;
|
|
1841
|
+
type index$4_OracleConsultAccounts = OracleConsultAccounts;
|
|
1842
|
+
declare const index$4_OracleConsultArgs: typeof OracleConsultArgs;
|
|
1843
|
+
type index$4_OracleConsultResult = OracleConsultResult;
|
|
1844
|
+
declare const index$4_OracleInitializedEvent: typeof OracleInitializedEvent;
|
|
1845
|
+
type index$4_OracleUpdateAccounts = OracleUpdateAccounts;
|
|
1846
|
+
declare const index$4_OracleUpdatedEvent: typeof OracleUpdatedEvent;
|
|
1847
|
+
declare const index$4_OracleWithAddress: typeof OracleWithAddress;
|
|
1848
|
+
type index$4_PauseAccounts = PauseAccounts;
|
|
1849
|
+
declare const index$4_PausedEvent: typeof PausedEvent;
|
|
1850
|
+
declare const index$4_Pool: typeof Pool;
|
|
1851
|
+
declare const index$4_PoolInitializedEvent: typeof PoolInitializedEvent;
|
|
1852
|
+
type index$4_PoolWithAddress = PoolWithAddress;
|
|
1853
|
+
declare const index$4_Position: typeof Position;
|
|
1854
|
+
declare const index$4_PositionClosedEvent: typeof PositionClosedEvent;
|
|
1855
|
+
declare const index$4_PositionCreatedEvent: typeof PositionCreatedEvent;
|
|
1856
|
+
declare const index$4_PositionValue: typeof PositionValue;
|
|
1857
|
+
declare const index$4_PositionWithAddress: typeof PositionWithAddress;
|
|
1858
|
+
declare const index$4_Q64_ONE: typeof Q64_ONE;
|
|
1859
|
+
type index$4_QuoteToNumeraireAccounts = QuoteToNumeraireAccounts;
|
|
1860
|
+
declare const index$4_QuoteToNumeraireArgs: typeof QuoteToNumeraireArgs;
|
|
1861
|
+
type index$4_QuoteToNumeraireResult = QuoteToNumeraireResult;
|
|
1862
|
+
type index$4_RemoveLiquidityAccounts = RemoveLiquidityAccounts;
|
|
1863
|
+
declare const index$4_RemoveLiquidityArgs: typeof RemoveLiquidityArgs;
|
|
1864
|
+
declare const index$4_RemoveLiquidityEvent: typeof RemoveLiquidityEvent;
|
|
1865
|
+
declare const index$4_RemoveLiquidityQuote: typeof RemoveLiquidityQuote;
|
|
1866
|
+
declare const index$4_RouteUpdatedEvent: typeof RouteUpdatedEvent;
|
|
1867
|
+
declare const index$4_SEED_AUTHORITY: typeof SEED_AUTHORITY;
|
|
1868
|
+
declare const index$4_SEED_ORACLE: typeof SEED_ORACLE;
|
|
1869
|
+
declare const index$4_SEED_POOL: typeof SEED_POOL;
|
|
1870
|
+
declare const index$4_SEED_POSITION: typeof SEED_POSITION;
|
|
1871
|
+
declare const index$4_SEED_PROTOCOL_POSITION: typeof SEED_PROTOCOL_POSITION;
|
|
1872
|
+
declare const index$4_SF_AFTER_ADD_LIQ: typeof SF_AFTER_ADD_LIQ;
|
|
1873
|
+
declare const index$4_SF_AFTER_REMOVE_LIQ: typeof SF_AFTER_REMOVE_LIQ;
|
|
1874
|
+
declare const index$4_SF_BEFORE_ADD_LIQ: typeof SF_BEFORE_ADD_LIQ;
|
|
1875
|
+
declare const index$4_SF_BEFORE_REMOVE_LIQ: typeof SF_BEFORE_REMOVE_LIQ;
|
|
1876
|
+
declare const index$4_SentinelErrorEvent: typeof SentinelErrorEvent;
|
|
1877
|
+
declare const index$4_SentinelInvokedEvent: typeof SentinelInvokedEvent;
|
|
1878
|
+
declare const index$4_SentinelUpdatedEvent: typeof SentinelUpdatedEvent;
|
|
1879
|
+
type index$4_SetFeesAccounts = SetFeesAccounts;
|
|
1880
|
+
declare const index$4_SetFeesArgs: typeof SetFeesArgs;
|
|
1881
|
+
type index$4_SetRouteAccounts = SetRouteAccounts;
|
|
1882
|
+
declare const index$4_SetRouteArgs: typeof SetRouteArgs;
|
|
1883
|
+
type index$4_SetSentinelAccounts = SetSentinelAccounts;
|
|
1884
|
+
declare const index$4_SetSentinelArgs: typeof SetSentinelArgs;
|
|
1885
|
+
type index$4_SkimAccounts = SkimAccounts;
|
|
1886
|
+
declare const index$4_SkimmedEvent: typeof SkimmedEvent;
|
|
1887
|
+
declare const index$4_SwapDirection: typeof SwapDirection;
|
|
1888
|
+
declare const index$4_SwapEvent: typeof SwapEvent;
|
|
1889
|
+
type index$4_SwapExactInAccounts = SwapExactInAccounts;
|
|
1890
|
+
declare const index$4_SwapExactInArgs: typeof SwapExactInArgs;
|
|
1891
|
+
declare const index$4_SwapQuote: typeof SwapQuote;
|
|
1892
|
+
declare const index$4_SwapQuoteExactOut: typeof SwapQuoteExactOut;
|
|
1893
|
+
declare const index$4_TOKEN_METADATA_PROGRAM_ID: typeof TOKEN_METADATA_PROGRAM_ID;
|
|
1894
|
+
type index$4_TransferAdminAccounts = TransferAdminAccounts;
|
|
1895
|
+
declare const index$4_TransferAdminArgs: typeof TransferAdminArgs;
|
|
1896
|
+
declare const index$4_TwapResult: typeof TwapResult;
|
|
1897
|
+
type index$4_UnpauseAccounts = UnpauseAccounts;
|
|
1898
|
+
declare const index$4_UnpausedEvent: typeof UnpausedEvent;
|
|
1899
|
+
declare const index$4_addLiquidityArgsCodec: typeof addLiquidityArgsCodec;
|
|
1900
|
+
declare const index$4_ammConfigDataCodec: typeof ammConfigDataCodec;
|
|
1901
|
+
declare const index$4_areMintsOrdered: typeof areMintsOrdered;
|
|
1902
|
+
declare const index$4_calculateAccruedFees: typeof calculateAccruedFees;
|
|
1903
|
+
declare const index$4_calculateTwap: typeof calculateTwap;
|
|
1904
|
+
declare const index$4_calculateTwapNumber: typeof calculateTwapNumber;
|
|
1905
|
+
declare const index$4_ceilDiv: typeof ceilDiv;
|
|
1906
|
+
declare const index$4_collectFeesArgsCodec: typeof collectFeesArgsCodec;
|
|
1907
|
+
declare const index$4_collectProtocolFeesArgsCodec: typeof collectProtocolFeesArgsCodec;
|
|
1908
|
+
declare const index$4_comparePoolAndOraclePrices: typeof comparePoolAndOraclePrices;
|
|
1909
|
+
declare const index$4_computePrice0Q64: typeof computePrice0Q64;
|
|
1910
|
+
declare const index$4_computePrice1Q64: typeof computePrice1Q64;
|
|
1911
|
+
declare const index$4_consultTwap: typeof consultTwap;
|
|
1912
|
+
declare const index$4_createAddLiquidityInstruction: typeof createAddLiquidityInstruction;
|
|
1913
|
+
declare const index$4_createClosePositionInstruction: typeof createClosePositionInstruction;
|
|
1914
|
+
declare const index$4_createCollectFeesInstruction: typeof createCollectFeesInstruction;
|
|
1915
|
+
declare const index$4_createCollectProtocolFeesInstruction: typeof createCollectProtocolFeesInstruction;
|
|
1916
|
+
declare const index$4_createCreatePositionInstruction: typeof createCreatePositionInstruction;
|
|
1917
|
+
declare const index$4_createInitializeOracleInstruction: typeof createInitializeOracleInstruction;
|
|
1918
|
+
declare const index$4_createInitializePoolInstruction: typeof createInitializePoolInstruction;
|
|
1919
|
+
declare const index$4_createOracleConsultInstruction: typeof createOracleConsultInstruction;
|
|
1920
|
+
declare const index$4_createOracleUpdateInstruction: typeof createOracleUpdateInstruction;
|
|
1921
|
+
declare const index$4_createPauseInstruction: typeof createPauseInstruction;
|
|
1922
|
+
declare const index$4_createPositionArgsCodec: typeof createPositionArgsCodec;
|
|
1923
|
+
declare const index$4_createQuoteToNumeraireInstruction: typeof createQuoteToNumeraireInstruction;
|
|
1924
|
+
declare const index$4_createRemoveLiquidityInstruction: typeof createRemoveLiquidityInstruction;
|
|
1925
|
+
declare const index$4_createSetFeesInstruction: typeof createSetFeesInstruction;
|
|
1926
|
+
declare const index$4_createSetRouteInstruction: typeof createSetRouteInstruction;
|
|
1927
|
+
declare const index$4_createSetSentinelInstruction: typeof createSetSentinelInstruction;
|
|
1928
|
+
declare const index$4_createSkimInstruction: typeof createSkimInstruction;
|
|
1929
|
+
declare const index$4_createSwapExactInInstruction: typeof createSwapExactInInstruction;
|
|
1930
|
+
declare const index$4_createSwapInstruction: typeof createSwapInstruction;
|
|
1931
|
+
declare const index$4_createTransferAdminInstruction: typeof createTransferAdminInstruction;
|
|
1932
|
+
declare const index$4_createUnpauseInstruction: typeof createUnpauseInstruction;
|
|
1933
|
+
declare const index$4_curveParamsToMarketCap: typeof curveParamsToMarketCap;
|
|
1934
|
+
declare const index$4_decodeAmmConfig: typeof decodeAmmConfig;
|
|
1935
|
+
declare const index$4_decodeOracleConsultResult: typeof decodeOracleConsultResult;
|
|
1936
|
+
declare const index$4_decodePool: typeof decodePool;
|
|
1937
|
+
declare const index$4_decodePosition: typeof decodePosition;
|
|
1938
|
+
declare const index$4_decodeQuoteToNumeraireResult: typeof decodeQuoteToNumeraireResult;
|
|
1939
|
+
declare const index$4_encodeAddLiquidityArgs: typeof encodeAddLiquidityArgs;
|
|
1940
|
+
declare const index$4_encodeCollectFeesArgs: typeof encodeCollectFeesArgs;
|
|
1941
|
+
declare const index$4_encodeCollectProtocolFeesArgs: typeof encodeCollectProtocolFeesArgs;
|
|
1942
|
+
declare const index$4_encodeCreatePositionArgs: typeof encodeCreatePositionArgs;
|
|
1943
|
+
declare const index$4_encodeInitializeConfigArgs: typeof encodeInitializeConfigArgs;
|
|
1944
|
+
declare const index$4_encodeInitializeOracleArgs: typeof encodeInitializeOracleArgs;
|
|
1945
|
+
declare const index$4_encodeInitializePoolArgs: typeof encodeInitializePoolArgs;
|
|
1946
|
+
declare const index$4_encodeInstructionData: typeof encodeInstructionData;
|
|
1947
|
+
declare const index$4_encodeOracleConsultArgs: typeof encodeOracleConsultArgs;
|
|
1948
|
+
declare const index$4_encodeQuoteToNumeraireArgs: typeof encodeQuoteToNumeraireArgs;
|
|
1949
|
+
declare const index$4_encodeRemoveLiquidityArgs: typeof encodeRemoveLiquidityArgs;
|
|
1950
|
+
declare const index$4_encodeSetFeesArgs: typeof encodeSetFeesArgs;
|
|
1951
|
+
declare const index$4_encodeSetRouteArgs: typeof encodeSetRouteArgs;
|
|
1952
|
+
declare const index$4_encodeSetSentinelArgs: typeof encodeSetSentinelArgs;
|
|
1953
|
+
declare const index$4_encodeSwapExactInArgs: typeof encodeSwapExactInArgs;
|
|
1954
|
+
declare const index$4_encodeTransferAdminArgs: typeof encodeTransferAdminArgs;
|
|
1955
|
+
declare const index$4_fetchAllPools: typeof fetchAllPools;
|
|
1956
|
+
declare const index$4_fetchConfig: typeof fetchConfig;
|
|
1957
|
+
declare const index$4_fetchConfigWithAddress: typeof fetchConfigWithAddress;
|
|
1958
|
+
declare const index$4_fetchOracle: typeof fetchOracle;
|
|
1959
|
+
declare const index$4_fetchOraclesBatch: typeof fetchOraclesBatch;
|
|
1960
|
+
declare const index$4_fetchPool: typeof fetchPool;
|
|
1961
|
+
declare const index$4_fetchPoolPositions: typeof fetchPoolPositions;
|
|
1962
|
+
declare const index$4_fetchPoolsBatch: typeof fetchPoolsBatch;
|
|
1963
|
+
declare const index$4_fetchPosition: typeof fetchPosition;
|
|
1964
|
+
declare const index$4_fetchPositionByParams: typeof fetchPositionByParams;
|
|
1965
|
+
declare const index$4_fetchPositionsBatch: typeof fetchPositionsBatch;
|
|
1966
|
+
declare const index$4_fetchUserPositions: typeof fetchUserPositions;
|
|
1967
|
+
declare const index$4_filterActivePositions: typeof filterActivePositions;
|
|
1968
|
+
declare const index$4_filterPoolsByMint: typeof filterPoolsByMint;
|
|
1969
|
+
declare const index$4_getAddLiquidityQuote: typeof getAddLiquidityQuote;
|
|
1970
|
+
declare const index$4_getErrorMessage: typeof getErrorMessage;
|
|
1971
|
+
declare const index$4_getK: typeof getK;
|
|
1972
|
+
declare const index$4_getLiquidityAddresses: typeof getLiquidityAddresses;
|
|
1973
|
+
declare const index$4_getMetadataAddress: typeof getMetadataAddress;
|
|
1974
|
+
declare const index$4_getOracleAddress: typeof getOracleAddress;
|
|
1975
|
+
declare const index$4_getOracleAddressFromPool: typeof getOracleAddressFromPool;
|
|
1976
|
+
declare const index$4_getOracleAge: typeof getOracleAge;
|
|
1977
|
+
declare const index$4_getOracleBufferStats: typeof getOracleBufferStats;
|
|
1978
|
+
declare const index$4_getOracleDeviation: typeof getOracleDeviation;
|
|
1979
|
+
declare const index$4_getOracleForPool: typeof getOracleForPool;
|
|
1980
|
+
declare const index$4_getOracleSpotPrices: typeof getOracleSpotPrices;
|
|
1981
|
+
declare const index$4_getPendingFees: typeof getPendingFees;
|
|
1982
|
+
declare const index$4_getPoolAddress: typeof getPoolAddress;
|
|
1983
|
+
declare const index$4_getPoolAddressFromMints: typeof getPoolAddressFromMints;
|
|
1984
|
+
declare const index$4_getPoolAuthorityAddress: typeof getPoolAuthorityAddress;
|
|
1985
|
+
declare const index$4_getPoolByMints: typeof getPoolByMints;
|
|
1986
|
+
declare const index$4_getPoolInitAddresses: typeof getPoolInitAddresses;
|
|
1987
|
+
declare const index$4_getPositionAddress: typeof getPositionAddress;
|
|
1988
|
+
declare const index$4_getPositionAddressFromParams: typeof getPositionAddressFromParams;
|
|
1989
|
+
declare const index$4_getPositionValue: typeof getPositionValue;
|
|
1990
|
+
declare const index$4_getProtocolPositionAddress: typeof getProtocolPositionAddress;
|
|
1991
|
+
declare const index$4_getRemoveLiquidityQuote: typeof getRemoveLiquidityQuote;
|
|
1992
|
+
declare const index$4_getSpotPrice0: typeof getSpotPrice0;
|
|
1993
|
+
declare const index$4_getSpotPrice1: typeof getSpotPrice1;
|
|
1994
|
+
declare const index$4_getSwapAddresses: typeof getSwapAddresses;
|
|
1995
|
+
declare const index$4_getSwapQuote: typeof getSwapQuote;
|
|
1996
|
+
declare const index$4_getSwapQuoteExactOut: typeof getSwapQuoteExactOut;
|
|
1997
|
+
declare const index$4_getTvl: typeof getTvl;
|
|
1998
|
+
declare const index$4_initializeConfigArgsCodec: typeof initializeConfigArgsCodec;
|
|
1999
|
+
declare const index$4_initializeOracleArgsCodec: typeof initializeOracleArgsCodec;
|
|
2000
|
+
declare const index$4_initializePoolArgsCodec: typeof initializePoolArgsCodec;
|
|
2001
|
+
declare const index$4_isCpmmError: typeof isCpmmError;
|
|
2002
|
+
declare const index$4_isOracleStale: typeof isOracleStale;
|
|
2003
|
+
declare const index$4_isqrt: typeof isqrt;
|
|
2004
|
+
declare const index$4_marketCapToCurveParams: typeof marketCapToCurveParams;
|
|
2005
|
+
declare const index$4_marketCapToSingleCurveParams: typeof marketCapToSingleCurveParams;
|
|
2006
|
+
declare const index$4_marketCapToTokenPrice: typeof marketCapToTokenPrice;
|
|
2007
|
+
declare const index$4_maxBigInt: typeof maxBigInt;
|
|
2008
|
+
declare const index$4_minBigInt: typeof minBigInt;
|
|
2009
|
+
declare const index$4_numberToQ64: typeof numberToQ64;
|
|
2010
|
+
declare const index$4_observationCodec: typeof observationCodec;
|
|
2011
|
+
declare const index$4_oracleConsultArgsCodec: typeof oracleConsultArgsCodec;
|
|
2012
|
+
declare const index$4_oracleStateDataCodec: typeof oracleStateDataCodec;
|
|
2013
|
+
declare const index$4_parseErrorFromLogs: typeof parseErrorFromLogs;
|
|
2014
|
+
declare const index$4_poolDataCodec: typeof poolDataCodec;
|
|
2015
|
+
declare const index$4_poolExists: typeof poolExists;
|
|
2016
|
+
declare const index$4_positionDataCodec: typeof positionDataCodec;
|
|
2017
|
+
declare const index$4_q64Div: typeof q64Div;
|
|
2018
|
+
declare const index$4_q64Mul: typeof q64Mul;
|
|
2019
|
+
declare const index$4_q64ToNumber: typeof q64ToNumber;
|
|
2020
|
+
declare const index$4_quoteToNumeraireArgsCodec: typeof quoteToNumeraireArgsCodec;
|
|
2021
|
+
declare const index$4_ratioToNumber: typeof ratioToNumber;
|
|
2022
|
+
declare const index$4_removeLiquidityArgsCodec: typeof removeLiquidityArgsCodec;
|
|
2023
|
+
declare const index$4_setFeesArgsCodec: typeof setFeesArgsCodec;
|
|
2024
|
+
declare const index$4_setRouteArgsCodec: typeof setRouteArgsCodec;
|
|
2025
|
+
declare const index$4_setSentinelArgsCodec: typeof setSentinelArgsCodec;
|
|
2026
|
+
declare const index$4_sortMints: typeof sortMints;
|
|
2027
|
+
declare const index$4_sortPoolsByReserves: typeof sortPoolsByReserves;
|
|
2028
|
+
declare const index$4_sortPositionsByShares: typeof sortPositionsByShares;
|
|
2029
|
+
declare const index$4_swapExactInArgsCodec: typeof swapExactInArgsCodec;
|
|
2030
|
+
declare const index$4_transferAdminArgsCodec: typeof transferAdminArgsCodec;
|
|
2031
|
+
declare const index$4_validateMarketCapParameters: typeof validateMarketCapParameters;
|
|
2032
|
+
declare namespace index$4 {
|
|
2033
|
+
export { index$4_ACCOUNT_DISCRIMINATORS as ACCOUNT_DISCRIMINATORS, index$4_ACCOUNT_VERSION as ACCOUNT_VERSION, type index$4_AddLiquidityAccounts as AddLiquidityAccounts, index$4_AddLiquidityArgs as AddLiquidityArgs, type index$4_AddLiquidityArgsWithOracle as AddLiquidityArgsWithOracle, index$4_AddLiquidityEvent as AddLiquidityEvent, index$4_AddLiquidityQuote as AddLiquidityQuote, index$4_AdminTransferredEvent as AdminTransferredEvent, index$4_AmmConfig as AmmConfig, index$4_BPS_DENOM as BPS_DENOM, index$4_CPMM_ERROR_MESSAGES as CPMM_ERROR_MESSAGES, index$4_CPMM_PROGRAM_ID as CPMM_PROGRAM_ID, type index$4_ClosePositionAccounts as ClosePositionAccounts, type index$4_CollectFeesAccounts as CollectFeesAccounts, index$4_CollectFeesArgs as CollectFeesArgs, index$4_CollectFeesEvent as CollectFeesEvent, type index$4_CollectProtocolFeesAccounts as CollectProtocolFeesAccounts, index$4_CollectProtocolFeesArgs as CollectProtocolFeesArgs, index$4_CollectProtocolFeesEvent as CollectProtocolFeesEvent, index$4_CpmmError as CpmmError, index$4_CpmmErrorCode as CpmmErrorCode, type index$4_CreatePositionAccounts as CreatePositionAccounts, index$4_CreatePositionArgs as CreatePositionArgs, index$4_CurveParams as CurveParams, index$4_CurveParamsToMarketCapInput as CurveParamsToMarketCapInput, index$4_FeesUpdatedEvent as FeesUpdatedEvent, index$4_FetchOracleConfig as FetchOracleConfig, type index$4_FetchPoolsConfig as FetchPoolsConfig, index$4_FetchPositionsConfig as FetchPositionsConfig, index$4_INSTRUCTION_DISCRIMINATORS as INSTRUCTION_DISCRIMINATORS, type InitializeConfigAccounts$1 as InitializeConfigAccounts, InitializeConfigArgs$1 as InitializeConfigArgs, type index$4_InitializeOracleAccounts as InitializeOracleAccounts, InitializeOracleArgs$1 as InitializeOracleArgs, type index$4_InitializePoolAccounts as InitializePoolAccounts, index$4_InitializePoolArgs as InitializePoolArgs, index$4_MAX_FEE_AMOUNT as MAX_FEE_AMOUNT, index$4_MAX_ORACLE_OBSERVATIONS as MAX_ORACLE_OBSERVATIONS, MAX_SENTINEL_ALLOWLIST$1 as MAX_SENTINEL_ALLOWLIST, index$4_MarketCapToCurveParamsInput as MarketCapToCurveParamsInput, index$4_MarketCapValidationResult as MarketCapValidationResult, index$4_Observation as Observation, type index$4_OracleConsultAccounts as OracleConsultAccounts, index$4_OracleConsultArgs as OracleConsultArgs, type index$4_OracleConsultResult as OracleConsultResult, index$4_OracleInitializedEvent as OracleInitializedEvent, OracleState$2 as OracleState, type index$4_OracleUpdateAccounts as OracleUpdateAccounts, index$4_OracleUpdatedEvent as OracleUpdatedEvent, index$4_OracleWithAddress as OracleWithAddress, type index$4_PauseAccounts as PauseAccounts, index$4_PausedEvent as PausedEvent, index$4_Pool as Pool, index$4_PoolInitializedEvent as PoolInitializedEvent, type index$4_PoolWithAddress as PoolWithAddress, index$4_Position as Position, index$4_PositionClosedEvent as PositionClosedEvent, index$4_PositionCreatedEvent as PositionCreatedEvent, index$4_PositionValue as PositionValue, index$4_PositionWithAddress as PositionWithAddress, index$4_Q64_ONE as Q64_ONE, type index$4_QuoteToNumeraireAccounts as QuoteToNumeraireAccounts, index$4_QuoteToNumeraireArgs as QuoteToNumeraireArgs, type index$4_QuoteToNumeraireResult as QuoteToNumeraireResult, type index$4_RemoveLiquidityAccounts as RemoveLiquidityAccounts, index$4_RemoveLiquidityArgs as RemoveLiquidityArgs, index$4_RemoveLiquidityEvent as RemoveLiquidityEvent, index$4_RemoveLiquidityQuote as RemoveLiquidityQuote, index$4_RouteUpdatedEvent as RouteUpdatedEvent, index$4_SEED_AUTHORITY as SEED_AUTHORITY, SEED_CONFIG$1 as SEED_CONFIG, index$4_SEED_ORACLE as SEED_ORACLE, index$4_SEED_POOL as SEED_POOL, index$4_SEED_POSITION as SEED_POSITION, index$4_SEED_PROTOCOL_POSITION as SEED_PROTOCOL_POSITION, SENTINEL_NO_CHANGE$1 as SENTINEL_NO_CHANGE, index$4_SF_AFTER_ADD_LIQ as SF_AFTER_ADD_LIQ, index$4_SF_AFTER_REMOVE_LIQ as SF_AFTER_REMOVE_LIQ, SF_AFTER_SWAP$1 as SF_AFTER_SWAP, index$4_SF_BEFORE_ADD_LIQ as SF_BEFORE_ADD_LIQ, index$4_SF_BEFORE_REMOVE_LIQ as SF_BEFORE_REMOVE_LIQ, SF_BEFORE_SWAP$1 as SF_BEFORE_SWAP, index$4_SentinelErrorEvent as SentinelErrorEvent, index$4_SentinelInvokedEvent as SentinelInvokedEvent, index$4_SentinelUpdatedEvent as SentinelUpdatedEvent, type index$4_SetFeesAccounts as SetFeesAccounts, index$4_SetFeesArgs as SetFeesArgs, type index$4_SetRouteAccounts as SetRouteAccounts, index$4_SetRouteArgs as SetRouteArgs, type index$4_SetSentinelAccounts as SetSentinelAccounts, index$4_SetSentinelArgs as SetSentinelArgs, type index$4_SkimAccounts as SkimAccounts, index$4_SkimmedEvent as SkimmedEvent, index$4_SwapDirection as SwapDirection, index$4_SwapEvent as SwapEvent, type index$4_SwapExactInAccounts as SwapExactInAccounts, index$4_SwapExactInArgs as SwapExactInArgs, index$4_SwapQuote as SwapQuote, index$4_SwapQuoteExactOut as SwapQuoteExactOut, index$4_TOKEN_METADATA_PROGRAM_ID as TOKEN_METADATA_PROGRAM_ID, type index$4_TransferAdminAccounts as TransferAdminAccounts, index$4_TransferAdminArgs as TransferAdminArgs, index$4_TwapResult as TwapResult, type index$4_UnpauseAccounts as UnpauseAccounts, index$4_UnpausedEvent as UnpausedEvent, index$4_addLiquidityArgsCodec as addLiquidityArgsCodec, index$4_ammConfigDataCodec as ammConfigDataCodec, index$4_areMintsOrdered as areMintsOrdered, index$4_calculateAccruedFees as calculateAccruedFees, index$4_calculateTwap as calculateTwap, index$4_calculateTwapNumber as calculateTwapNumber, index$4_ceilDiv as ceilDiv, index$4_collectFeesArgsCodec as collectFeesArgsCodec, index$4_collectProtocolFeesArgsCodec as collectProtocolFeesArgsCodec, index$4_comparePoolAndOraclePrices as comparePoolAndOraclePrices, index$4_computePrice0Q64 as computePrice0Q64, index$4_computePrice1Q64 as computePrice1Q64, index$4_consultTwap as consultTwap, index$4_createAddLiquidityInstruction as createAddLiquidityInstruction, index$4_createClosePositionInstruction as createClosePositionInstruction, index$4_createCollectFeesInstruction as createCollectFeesInstruction, index$4_createCollectProtocolFeesInstruction as createCollectProtocolFeesInstruction, index$4_createCreatePositionInstruction as createCreatePositionInstruction, createInitializeConfigInstruction$1 as createInitializeConfigInstruction, index$4_createInitializeOracleInstruction as createInitializeOracleInstruction, index$4_createInitializePoolInstruction as createInitializePoolInstruction, index$4_createOracleConsultInstruction as createOracleConsultInstruction, index$4_createOracleUpdateInstruction as createOracleUpdateInstruction, index$4_createPauseInstruction as createPauseInstruction, index$4_createPositionArgsCodec as createPositionArgsCodec, index$4_createQuoteToNumeraireInstruction as createQuoteToNumeraireInstruction, index$4_createRemoveLiquidityInstruction as createRemoveLiquidityInstruction, index$4_createSetFeesInstruction as createSetFeesInstruction, index$4_createSetRouteInstruction as createSetRouteInstruction, index$4_createSetSentinelInstruction as createSetSentinelInstruction, index$4_createSkimInstruction as createSkimInstruction, index$4_createSwapExactInInstruction as createSwapExactInInstruction, index$4_createSwapInstruction as createSwapInstruction, index$4_createTransferAdminInstruction as createTransferAdminInstruction, index$4_createUnpauseInstruction as createUnpauseInstruction, index$4_curveParamsToMarketCap as curveParamsToMarketCap, index$4_decodeAmmConfig as decodeAmmConfig, index$4_decodeOracleConsultResult as decodeOracleConsultResult, decodeOracleState$2 as decodeOracleState, index$4_decodePool as decodePool, index$4_decodePosition as decodePosition, index$4_decodeQuoteToNumeraireResult as decodeQuoteToNumeraireResult, index$4_encodeAddLiquidityArgs as encodeAddLiquidityArgs, index$4_encodeCollectFeesArgs as encodeCollectFeesArgs, index$4_encodeCollectProtocolFeesArgs as encodeCollectProtocolFeesArgs, index$4_encodeCreatePositionArgs as encodeCreatePositionArgs, index$4_encodeInitializeConfigArgs as encodeInitializeConfigArgs, index$4_encodeInitializeOracleArgs as encodeInitializeOracleArgs, index$4_encodeInitializePoolArgs as encodeInitializePoolArgs, index$4_encodeInstructionData as encodeInstructionData, index$4_encodeOracleConsultArgs as encodeOracleConsultArgs, index$4_encodeQuoteToNumeraireArgs as encodeQuoteToNumeraireArgs, index$4_encodeRemoveLiquidityArgs as encodeRemoveLiquidityArgs, index$4_encodeSetFeesArgs as encodeSetFeesArgs, index$4_encodeSetRouteArgs as encodeSetRouteArgs, index$4_encodeSetSentinelArgs as encodeSetSentinelArgs, index$4_encodeSwapExactInArgs as encodeSwapExactInArgs, index$4_encodeTransferAdminArgs as encodeTransferAdminArgs, index$4_fetchAllPools as fetchAllPools, index$4_fetchConfig as fetchConfig, index$4_fetchConfigWithAddress as fetchConfigWithAddress, index$4_fetchOracle as fetchOracle, index$4_fetchOraclesBatch as fetchOraclesBatch, index$4_fetchPool as fetchPool, index$4_fetchPoolPositions as fetchPoolPositions, index$4_fetchPoolsBatch as fetchPoolsBatch, index$4_fetchPosition as fetchPosition, index$4_fetchPositionByParams as fetchPositionByParams, index$4_fetchPositionsBatch as fetchPositionsBatch, index$4_fetchUserPositions as fetchUserPositions, index$4_filterActivePositions as filterActivePositions, index$4_filterPoolsByMint as filterPoolsByMint, index$4_getAddLiquidityQuote as getAddLiquidityQuote, getConfigAddress$1 as getConfigAddress, index$4_getErrorMessage as getErrorMessage, index$4_getK as getK, index$4_getLiquidityAddresses as getLiquidityAddresses, index$4_getMetadataAddress as getMetadataAddress, index$4_getOracleAddress as getOracleAddress, index$4_getOracleAddressFromPool as getOracleAddressFromPool, index$4_getOracleAge as getOracleAge, index$4_getOracleBufferStats as getOracleBufferStats, index$4_getOracleDeviation as getOracleDeviation, index$4_getOracleForPool as getOracleForPool, index$4_getOracleSpotPrices as getOracleSpotPrices, index$4_getPendingFees as getPendingFees, index$4_getPoolAddress as getPoolAddress, index$4_getPoolAddressFromMints as getPoolAddressFromMints, index$4_getPoolAuthorityAddress as getPoolAuthorityAddress, index$4_getPoolByMints as getPoolByMints, index$4_getPoolInitAddresses as getPoolInitAddresses, index$4_getPositionAddress as getPositionAddress, index$4_getPositionAddressFromParams as getPositionAddressFromParams, index$4_getPositionValue as getPositionValue, index$4_getProtocolPositionAddress as getProtocolPositionAddress, index$4_getRemoveLiquidityQuote as getRemoveLiquidityQuote, index$4_getSpotPrice0 as getSpotPrice0, index$4_getSpotPrice1 as getSpotPrice1, index$4_getSwapAddresses as getSwapAddresses, index$4_getSwapQuote as getSwapQuote, index$4_getSwapQuoteExactOut as getSwapQuoteExactOut, index$4_getTvl as getTvl, index$4_initializeConfigArgsCodec as initializeConfigArgsCodec, index$4_initializeOracleArgsCodec as initializeOracleArgsCodec, index$4_initializePoolArgsCodec as initializePoolArgsCodec, index$4_isCpmmError as isCpmmError, index$4_isOracleStale as isOracleStale, index$4_isqrt as isqrt, index$4_marketCapToCurveParams as marketCapToCurveParams, index$4_marketCapToSingleCurveParams as marketCapToSingleCurveParams, index$4_marketCapToTokenPrice as marketCapToTokenPrice, index$4_maxBigInt as maxBigInt, index$4_minBigInt as minBigInt, index$4_numberToQ64 as numberToQ64, index$4_observationCodec as observationCodec, index$4_oracleConsultArgsCodec as oracleConsultArgsCodec, index$4_oracleStateDataCodec as oracleStateDataCodec, index$4_parseErrorFromLogs as parseErrorFromLogs, index$4_poolDataCodec as poolDataCodec, index$4_poolExists as poolExists, index$4_positionDataCodec as positionDataCodec, index$4_q64Div as q64Div, index$4_q64Mul as q64Mul, index$4_q64ToNumber as q64ToNumber, index$4_quoteToNumeraireArgsCodec as quoteToNumeraireArgsCodec, index$4_ratioToNumber as ratioToNumber, index$4_removeLiquidityArgsCodec as removeLiquidityArgsCodec, index$4_setFeesArgsCodec as setFeesArgsCodec, index$4_setRouteArgsCodec as setRouteArgsCodec, index$4_setSentinelArgsCodec as setSentinelArgsCodec, index$4_sortMints as sortMints, index$4_sortPoolsByReserves as sortPoolsByReserves, index$4_sortPositionsByShares as sortPositionsByShares, index$4_swapExactInArgsCodec as swapExactInArgsCodec, index$4_transferAdminArgsCodec as transferAdminArgsCodec, index$4_validateMarketCapParameters as validateMarketCapParameters };
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
/**
|
|
2037
|
+
* Program ID for the Initializer program.
|
|
2038
|
+
*
|
|
2039
|
+
* Source of truth: programs/initializer/src/lib.rs
|
|
2040
|
+
*/
|
|
2041
|
+
declare const INITIALIZER_PROGRAM_ID: Address;
|
|
2042
|
+
declare const BPF_LOADER_UPGRADEABLE_PROGRAM_ID: Address;
|
|
2043
|
+
/**
|
|
2044
|
+
* Sentinel program for CPMM-migrated launches.
|
|
2045
|
+
* Invoked during bonding curve swaps and previews as a pre/post-swap hook.
|
|
2046
|
+
*
|
|
2047
|
+
* Source of truth: programs/cpmm_sentinel/src/lib.rs
|
|
2048
|
+
*/
|
|
2049
|
+
declare const CPMM_SENTINEL_PROGRAM_ID: Address;
|
|
2050
|
+
/**
|
|
2051
|
+
* Sentinel program for prediction market launches.
|
|
2052
|
+
* Invoked during bonding curve swaps and previews as a pre/post-swap hook.
|
|
2053
|
+
*
|
|
2054
|
+
* Source of truth: programs/prediction_sentinel/src/lib.rs
|
|
2055
|
+
*/
|
|
2056
|
+
declare const PREDICTION_SENTINEL_PROGRAM_ID: Address;
|
|
2057
|
+
declare const SEED_CONFIG = "config_v3";
|
|
2058
|
+
declare const SEED_LAUNCH = "launch_v3";
|
|
2059
|
+
declare const SEED_LAUNCH_AUTHORITY = "launch_authority_v3";
|
|
2060
|
+
/**
|
|
2061
|
+
* Commitment hash for an empty remaining-accounts list — keccak256 of [0,0,0,0].
|
|
2062
|
+
* Pass this for sentinelRemainingAccountsHash and migratorRemainingAccountsHash
|
|
2063
|
+
* when no extra accounts are needed at that hook's invocation time.
|
|
2064
|
+
*/
|
|
2065
|
+
declare const EMPTY_REMAINING_ACCOUNTS_HASH: Uint8Array<ArrayBuffer>;
|
|
2066
|
+
/**
|
|
2067
|
+
* Devnet ALT containing static accounts shared by every initializeLaunch tx.
|
|
2068
|
+
* Indices: 0=TOKEN_PROGRAM, 1=SYSTEM_PROGRAM, 2=SYSVAR_RENT,
|
|
2069
|
+
* 3=INITIALIZER_PROGRAM, 4=TOKEN_METADATA_PROGRAM,
|
|
2070
|
+
* 5=CPMM_MIGRATOR_PROGRAM, 6=WSOL_MINT, 7=config PDA
|
|
2071
|
+
*/
|
|
2072
|
+
declare const DOPPLER_DEVNET_ALT: Address;
|
|
2073
|
+
declare const MAX_MIGRATOR_ALLOWLIST = 32;
|
|
2074
|
+
declare const MAX_SENTINEL_ALLOWLIST = 32;
|
|
2075
|
+
declare const MAX_CALLDATA = 256;
|
|
2076
|
+
declare const PHASE_TRADING = 0;
|
|
2077
|
+
declare const PHASE_MIGRATED = 1;
|
|
2078
|
+
declare const PHASE_ABORTED = 2;
|
|
2079
|
+
declare const DIRECTION_BUY = 0;
|
|
2080
|
+
declare const DIRECTION_SELL = 1;
|
|
2081
|
+
declare const CURVE_KIND_XYK = 0;
|
|
2082
|
+
declare const CURVE_PARAMS_FORMAT_XYK_V0 = 0;
|
|
2083
|
+
declare const SF_BEFORE_SWAP: number;
|
|
2084
|
+
declare const SF_AFTER_SWAP: number;
|
|
2085
|
+
declare const SENTINEL_NO_CHANGE = 65535;
|
|
2086
|
+
declare const INITIALIZER_INSTRUCTION_DISCRIMINATORS: {
|
|
2087
|
+
readonly initializeConfig: Uint8Array<ArrayBuffer>;
|
|
2088
|
+
readonly setMigratorAllowlist: Uint8Array<ArrayBuffer>;
|
|
2089
|
+
readonly setSentinelAllowlist: Uint8Array<ArrayBuffer>;
|
|
2090
|
+
readonly initializeLaunch: Uint8Array<ArrayBuffer>;
|
|
2091
|
+
readonly curveSwapExactIn: Uint8Array<ArrayBuffer>;
|
|
2092
|
+
readonly migrateLaunch: Uint8Array<ArrayBuffer>;
|
|
2093
|
+
readonly abortLaunch: Uint8Array<ArrayBuffer>;
|
|
2094
|
+
readonly previewSwapExactIn: Uint8Array<ArrayBuffer>;
|
|
2095
|
+
readonly previewMigration: Uint8Array<ArrayBuffer>;
|
|
2096
|
+
};
|
|
2097
|
+
declare const INITIALIZER_ACCOUNT_DISCRIMINATORS: {
|
|
2098
|
+
readonly InitConfig: Uint8Array<ArrayBuffer>;
|
|
2099
|
+
readonly Launch: Uint8Array<ArrayBuffer>;
|
|
2100
|
+
};
|
|
2101
|
+
|
|
2102
|
+
/**
|
|
2103
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2104
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2105
|
+
* to add features, then rerun Codama to update it.
|
|
2106
|
+
*
|
|
2107
|
+
* @see https://github.com/codama-idl/codama
|
|
2108
|
+
*/
|
|
2109
|
+
|
|
2110
|
+
type InitConfig = {
|
|
2111
|
+
discriminator: ReadonlyUint8Array;
|
|
2112
|
+
admin: Address;
|
|
2113
|
+
migratorAllowlistLen: number;
|
|
2114
|
+
migratorAllowlist: Array<Address>;
|
|
2115
|
+
sentinelAllowlistLen: number;
|
|
2116
|
+
sentinelAllowlist: Array<Address>;
|
|
2117
|
+
bump: number;
|
|
2118
|
+
version: number;
|
|
2119
|
+
reserved: ReadonlyUint8Array;
|
|
2120
|
+
};
|
|
2121
|
+
type InitConfigArgs = {
|
|
2122
|
+
admin: Address;
|
|
2123
|
+
migratorAllowlistLen: number;
|
|
2124
|
+
migratorAllowlist: Array<Address>;
|
|
2125
|
+
sentinelAllowlistLen: number;
|
|
2126
|
+
sentinelAllowlist: Array<Address>;
|
|
2127
|
+
bump: number;
|
|
2128
|
+
version: number;
|
|
2129
|
+
reserved: ReadonlyUint8Array;
|
|
2130
|
+
};
|
|
2131
|
+
/** Gets the encoder for {@link InitConfigArgs} account data. */
|
|
2132
|
+
declare function getInitConfigEncoder(): FixedSizeEncoder<InitConfigArgs>;
|
|
2133
|
+
/** Gets the decoder for {@link InitConfig} account data. */
|
|
2134
|
+
declare function getInitConfigDecoder(): FixedSizeDecoder<InitConfig>;
|
|
2135
|
+
/** Gets the codec for {@link InitConfig} account data. */
|
|
2136
|
+
declare function getInitConfigCodec(): FixedSizeCodec<InitConfigArgs, InitConfig>;
|
|
2137
|
+
|
|
2138
|
+
/**
|
|
2139
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2140
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2141
|
+
* to add features, then rerun Codama to update it.
|
|
2142
|
+
*
|
|
2143
|
+
* @see https://github.com/codama-idl/codama
|
|
2144
|
+
*/
|
|
2145
|
+
|
|
2146
|
+
type CalldataBuf$1 = {
|
|
2147
|
+
len: number;
|
|
2148
|
+
bytes: ReadonlyUint8Array;
|
|
2149
|
+
};
|
|
2150
|
+
type CalldataBufArgs$1 = CalldataBuf$1;
|
|
2151
|
+
|
|
2152
|
+
/**
|
|
2153
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2154
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2155
|
+
* to add features, then rerun Codama to update it.
|
|
2156
|
+
*
|
|
2157
|
+
* @see https://github.com/codama-idl/codama
|
|
2158
|
+
*/
|
|
2159
|
+
|
|
2160
|
+
type InitializeConfigArgs = {
|
|
2161
|
+
migratorAllowlist: Array<Address>;
|
|
2162
|
+
sentinelAllowlist: Array<Address>;
|
|
2163
|
+
};
|
|
2164
|
+
type InitializeConfigArgsArgs = InitializeConfigArgs;
|
|
2165
|
+
declare function getInitializeConfigArgsEncoder(): Encoder<InitializeConfigArgsArgs>;
|
|
2166
|
+
declare function getInitializeConfigArgsDecoder(): Decoder<InitializeConfigArgs>;
|
|
2167
|
+
declare function getInitializeConfigArgsCodec(): Codec<InitializeConfigArgsArgs, InitializeConfigArgs>;
|
|
2168
|
+
|
|
2169
|
+
/**
|
|
2170
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2171
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2172
|
+
* to add features, then rerun Codama to update it.
|
|
2173
|
+
*
|
|
2174
|
+
* @see https://github.com/codama-idl/codama
|
|
2175
|
+
*/
|
|
2176
|
+
|
|
2177
|
+
type InitializeLaunchArgs = {
|
|
2178
|
+
namespace: Address;
|
|
2179
|
+
launchId: ReadonlyUint8Array;
|
|
2180
|
+
baseDecimals: number;
|
|
2181
|
+
baseTotalSupply: bigint;
|
|
2182
|
+
baseForDistribution: bigint;
|
|
2183
|
+
baseForLiquidity: bigint;
|
|
2184
|
+
curveVirtualBase: bigint;
|
|
2185
|
+
curveVirtualQuote: bigint;
|
|
2186
|
+
curveFeeBps: number;
|
|
2187
|
+
curveKind: number;
|
|
2188
|
+
curveParams: ReadonlyUint8Array;
|
|
2189
|
+
allowBuy: number;
|
|
2190
|
+
allowSell: number;
|
|
2191
|
+
sentinelProgram: Address;
|
|
2192
|
+
sentinelFlags: number;
|
|
2193
|
+
sentinelCalldata: ReadonlyUint8Array;
|
|
2194
|
+
migratorProgram: Address;
|
|
2195
|
+
migratorInitCalldata: ReadonlyUint8Array;
|
|
2196
|
+
migratorMigrateCalldata: ReadonlyUint8Array;
|
|
2197
|
+
/**
|
|
2198
|
+
* Commitment hash for swap/preview sentinel remaining accounts.
|
|
2199
|
+
* Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
|
|
2200
|
+
*/
|
|
2201
|
+
sentinelRemainingAccountsHash: ReadonlyUint8Array;
|
|
2202
|
+
/**
|
|
2203
|
+
* Commitment hash for migrate remaining accounts.
|
|
2204
|
+
* Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
|
|
2205
|
+
*/
|
|
2206
|
+
migratorRemainingAccountsHash: ReadonlyUint8Array;
|
|
2207
|
+
/** Token name for on-chain metadata. If empty, metadata creation is skipped. */
|
|
2208
|
+
metadataName: string;
|
|
2209
|
+
/** Token symbol for on-chain metadata. */
|
|
2210
|
+
metadataSymbol: string;
|
|
2211
|
+
/** Metadata JSON URI for on-chain metadata. */
|
|
2212
|
+
metadataUri: string;
|
|
2213
|
+
};
|
|
2214
|
+
type InitializeLaunchArgsArgs = {
|
|
2215
|
+
namespace: Address;
|
|
2216
|
+
launchId: ReadonlyUint8Array;
|
|
2217
|
+
baseDecimals: number;
|
|
2218
|
+
baseTotalSupply: number | bigint;
|
|
2219
|
+
baseForDistribution: number | bigint;
|
|
2220
|
+
baseForLiquidity: number | bigint;
|
|
2221
|
+
curveVirtualBase: number | bigint;
|
|
2222
|
+
curveVirtualQuote: number | bigint;
|
|
2223
|
+
curveFeeBps: number;
|
|
2224
|
+
curveKind: number;
|
|
2225
|
+
curveParams: ReadonlyUint8Array;
|
|
2226
|
+
allowBuy: number;
|
|
2227
|
+
allowSell: number;
|
|
2228
|
+
sentinelProgram: Address;
|
|
2229
|
+
sentinelFlags: number;
|
|
2230
|
+
sentinelCalldata: ReadonlyUint8Array;
|
|
2231
|
+
migratorProgram: Address;
|
|
2232
|
+
migratorInitCalldata: ReadonlyUint8Array;
|
|
2233
|
+
migratorMigrateCalldata: ReadonlyUint8Array;
|
|
2234
|
+
/**
|
|
2235
|
+
* Commitment hash for swap/preview sentinel remaining accounts.
|
|
2236
|
+
* Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
|
|
2237
|
+
*/
|
|
2238
|
+
sentinelRemainingAccountsHash: ReadonlyUint8Array;
|
|
2239
|
+
/**
|
|
2240
|
+
* Commitment hash for migrate remaining accounts.
|
|
2241
|
+
* Computed as hash(u32_len || pubkey_0 || ... || pubkey_n).
|
|
2242
|
+
*/
|
|
2243
|
+
migratorRemainingAccountsHash: ReadonlyUint8Array;
|
|
2244
|
+
/** Token name for on-chain metadata. If empty, metadata creation is skipped. */
|
|
2245
|
+
metadataName: string;
|
|
2246
|
+
/** Token symbol for on-chain metadata. */
|
|
2247
|
+
metadataSymbol: string;
|
|
2248
|
+
/** Metadata JSON URI for on-chain metadata. */
|
|
2249
|
+
metadataUri: string;
|
|
2250
|
+
};
|
|
2251
|
+
declare function getInitializeLaunchArgsEncoder(): Encoder<InitializeLaunchArgsArgs>;
|
|
2252
|
+
declare function getInitializeLaunchArgsDecoder(): Decoder<InitializeLaunchArgs>;
|
|
2253
|
+
declare function getInitializeLaunchArgsCodec(): Codec<InitializeLaunchArgsArgs, InitializeLaunchArgs>;
|
|
2254
|
+
|
|
2255
|
+
/**
|
|
2256
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2257
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2258
|
+
* to add features, then rerun Codama to update it.
|
|
2259
|
+
*
|
|
2260
|
+
* @see https://github.com/codama-idl/codama
|
|
2261
|
+
*/
|
|
2262
|
+
|
|
2263
|
+
type Launch$1 = {
|
|
2264
|
+
discriminator: ReadonlyUint8Array;
|
|
2265
|
+
authority: Address;
|
|
2266
|
+
namespace: Address;
|
|
2267
|
+
launchId: ReadonlyUint8Array;
|
|
2268
|
+
phase: number;
|
|
2269
|
+
bump: number;
|
|
2270
|
+
launchAuthorityBump: number;
|
|
2271
|
+
pad0: ReadonlyUint8Array;
|
|
2272
|
+
baseMint: Address;
|
|
2273
|
+
quoteMint: Address;
|
|
2274
|
+
baseVault: Address;
|
|
2275
|
+
quoteVault: Address;
|
|
2276
|
+
baseTotalSupply: bigint;
|
|
2277
|
+
baseForDistribution: bigint;
|
|
2278
|
+
baseForLiquidity: bigint;
|
|
2279
|
+
baseForCurve: bigint;
|
|
2280
|
+
curveVirtualBase: bigint;
|
|
2281
|
+
curveVirtualQuote: bigint;
|
|
2282
|
+
curveFeeBps: number;
|
|
2283
|
+
pad1: ReadonlyUint8Array;
|
|
2284
|
+
allowBuy: number;
|
|
2285
|
+
allowSell: number;
|
|
2286
|
+
pad2: ReadonlyUint8Array;
|
|
2287
|
+
sentinelProgram: Address;
|
|
2288
|
+
sentinelFlags: number;
|
|
2289
|
+
pad3: ReadonlyUint8Array;
|
|
2290
|
+
sentinelCalldata: CalldataBuf$1;
|
|
2291
|
+
migratorProgram: Address;
|
|
2292
|
+
migratorInitCalldata: CalldataBuf$1;
|
|
2293
|
+
migratorMigrateCalldata: CalldataBuf$1;
|
|
2294
|
+
curveKind: number;
|
|
2295
|
+
swapLock: number;
|
|
2296
|
+
pad4: ReadonlyUint8Array;
|
|
2297
|
+
curveParams: CalldataBuf$1;
|
|
2298
|
+
quoteDeposited: bigint;
|
|
2299
|
+
reserved: ReadonlyUint8Array;
|
|
2300
|
+
};
|
|
2301
|
+
type LaunchArgs$1 = {
|
|
2302
|
+
authority: Address;
|
|
2303
|
+
namespace: Address;
|
|
2304
|
+
launchId: ReadonlyUint8Array;
|
|
2305
|
+
phase: number;
|
|
2306
|
+
bump: number;
|
|
2307
|
+
launchAuthorityBump: number;
|
|
2308
|
+
pad0: ReadonlyUint8Array;
|
|
2309
|
+
baseMint: Address;
|
|
2310
|
+
quoteMint: Address;
|
|
2311
|
+
baseVault: Address;
|
|
2312
|
+
quoteVault: Address;
|
|
2313
|
+
baseTotalSupply: number | bigint;
|
|
2314
|
+
baseForDistribution: number | bigint;
|
|
2315
|
+
baseForLiquidity: number | bigint;
|
|
2316
|
+
baseForCurve: number | bigint;
|
|
2317
|
+
curveVirtualBase: number | bigint;
|
|
2318
|
+
curveVirtualQuote: number | bigint;
|
|
2319
|
+
curveFeeBps: number;
|
|
2320
|
+
pad1: ReadonlyUint8Array;
|
|
2321
|
+
allowBuy: number;
|
|
2322
|
+
allowSell: number;
|
|
2323
|
+
pad2: ReadonlyUint8Array;
|
|
2324
|
+
sentinelProgram: Address;
|
|
2325
|
+
sentinelFlags: number;
|
|
2326
|
+
pad3: ReadonlyUint8Array;
|
|
2327
|
+
sentinelCalldata: CalldataBufArgs$1;
|
|
2328
|
+
migratorProgram: Address;
|
|
2329
|
+
migratorInitCalldata: CalldataBufArgs$1;
|
|
2330
|
+
migratorMigrateCalldata: CalldataBufArgs$1;
|
|
2331
|
+
curveKind: number;
|
|
2332
|
+
swapLock: number;
|
|
2333
|
+
pad4: ReadonlyUint8Array;
|
|
2334
|
+
curveParams: CalldataBufArgs$1;
|
|
2335
|
+
quoteDeposited: number | bigint;
|
|
2336
|
+
reserved: ReadonlyUint8Array;
|
|
2337
|
+
};
|
|
2338
|
+
/** Gets the encoder for {@link LaunchArgs} account data. */
|
|
2339
|
+
declare function getLaunchEncoder$1(): FixedSizeEncoder<LaunchArgs$1>;
|
|
2340
|
+
/** Gets the decoder for {@link Launch} account data. */
|
|
2341
|
+
declare function getLaunchDecoder$1(): FixedSizeDecoder<Launch$1>;
|
|
2342
|
+
/** Gets the codec for {@link Launch} account data. */
|
|
2343
|
+
declare function getLaunchCodec$1(): FixedSizeCodec<LaunchArgs$1, Launch$1>;
|
|
2344
|
+
|
|
2345
|
+
declare function encodeU64LE(value: bigint): Uint8Array;
|
|
2346
|
+
/**
|
|
2347
|
+
* Derive the InitConfig PDA address.
|
|
2348
|
+
* Seeds: ['config_v3']
|
|
2349
|
+
*/
|
|
2350
|
+
declare function getConfigAddress(programId?: Address): Promise<ProgramDerivedAddress>;
|
|
2351
|
+
/**
|
|
2352
|
+
* Derive the ProgramData PDA for an upgradeable program.
|
|
2353
|
+
* Seeds: [initializer_program_id] with program = BPFLoaderUpgradeable.
|
|
2354
|
+
*/
|
|
2355
|
+
declare function getProgramDataAddress(programId?: Address): Promise<ProgramDerivedAddress>;
|
|
2356
|
+
/**
|
|
2357
|
+
* Derive the Launch PDA address.
|
|
2358
|
+
* Seeds: ['launch_v3', namespace, launch_id_bytes_32]
|
|
2359
|
+
*/
|
|
2360
|
+
declare function getLaunchAddress(namespace: Address, launchId: Uint8Array, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
2361
|
+
/**
|
|
2362
|
+
* Derive the Launch authority PDA address.
|
|
2363
|
+
* Seeds: ['launch_authority_v3', launch]
|
|
2364
|
+
*/
|
|
2365
|
+
declare function getLaunchAuthorityAddress(launch: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
2366
|
+
/**
|
|
2367
|
+
* Convenience helper for the common pattern: embed a u64 into a 32-byte launch_id.
|
|
2368
|
+
*/
|
|
2369
|
+
declare function launchIdFromU64(launchId: bigint): Uint8Array;
|
|
2370
|
+
|
|
2371
|
+
type AddressOrSigner$6 = Address | TransactionSigner;
|
|
2372
|
+
interface InitializeConfigAccounts {
|
|
2373
|
+
admin: AddressOrSigner$6;
|
|
2374
|
+
config: Address;
|
|
2375
|
+
programData: Address;
|
|
2376
|
+
systemProgram?: Address;
|
|
2377
|
+
}
|
|
2378
|
+
declare function createInitializeConfigInstruction(accounts: InitializeConfigAccounts, args: InitializeConfigArgsArgs, programId?: Address): Instruction;
|
|
2379
|
+
|
|
2380
|
+
type AddressOrSigner$5 = Address | TransactionSigner;
|
|
2381
|
+
interface SetMigratorAllowlistAccounts {
|
|
2382
|
+
admin: AddressOrSigner$5;
|
|
2383
|
+
config: Address;
|
|
2384
|
+
}
|
|
2385
|
+
declare function createSetMigratorAllowlistInstruction(accounts: SetMigratorAllowlistAccounts, allowlist: Address[], programId?: Address): Instruction;
|
|
2386
|
+
|
|
2387
|
+
type AddressOrSigner$4 = Address | TransactionSigner;
|
|
2388
|
+
interface SetSentinelAllowlistAccounts {
|
|
2389
|
+
admin: AddressOrSigner$4;
|
|
2390
|
+
config: Address;
|
|
2391
|
+
}
|
|
2392
|
+
declare function createSetSentinelAllowlistInstruction(accounts: SetSentinelAllowlistAccounts, allowlist: Address[], programId?: Address): Instruction;
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Public params for createInitializeLaunchInstruction.
|
|
2396
|
+
* - allowBuy / allowSell are boolean; converted to u8 wire format (1/0).
|
|
2397
|
+
* - migratorProgram is omitted — it is derived from accounts.migratorProgram
|
|
2398
|
+
* so callers do not need to repeat it in both the accounts object and args.
|
|
2399
|
+
*/
|
|
2400
|
+
type InitializeLaunchParams = Omit<InitializeLaunchArgsArgs, 'allowBuy' | 'allowSell' | 'migratorProgram'> & {
|
|
2401
|
+
allowBuy: boolean;
|
|
2402
|
+
allowSell: boolean;
|
|
2403
|
+
};
|
|
2404
|
+
type AddressOrSigner$3 = Address | TransactionSigner;
|
|
2405
|
+
/**
|
|
2406
|
+
* Derive the Metaplex token metadata PDA for a given mint.
|
|
2407
|
+
* Seeds: ["metadata", TOKEN_METADATA_PROGRAM_ID, mint]
|
|
2408
|
+
*
|
|
2409
|
+
* Pass the result as `metadataAccount` in InitializeLaunchAccounts
|
|
2410
|
+
* whenever `metadataName` is non-empty.
|
|
2411
|
+
*/
|
|
2412
|
+
declare function getTokenMetadataAddress(mint: Address): Promise<Address>;
|
|
2413
|
+
interface InitializeLaunchAccounts {
|
|
2414
|
+
config: Address;
|
|
2415
|
+
launch: Address;
|
|
2416
|
+
launchAuthority: Address;
|
|
2417
|
+
baseMint: AddressOrSigner$3;
|
|
2418
|
+
quoteMint: Address;
|
|
2419
|
+
baseVault: AddressOrSigner$3;
|
|
2420
|
+
quoteVault: AddressOrSigner$3;
|
|
2421
|
+
payer: AddressOrSigner$3;
|
|
2422
|
+
authority?: AddressOrSigner$3;
|
|
2423
|
+
migratorProgram?: Address;
|
|
2424
|
+
tokenProgram?: Address;
|
|
2425
|
+
systemProgram?: Address;
|
|
2426
|
+
rent: Address;
|
|
2427
|
+
/** Required when args.metadataName is non-empty. Derive with getTokenMetadataAddress(baseMint). */
|
|
2428
|
+
metadataAccount?: Address;
|
|
2429
|
+
/**
|
|
2430
|
+
* Optional Address Lookup Table to reference for static accounts.
|
|
2431
|
+
* When provided, constant non-signer accounts (tokenProgram, systemProgram,
|
|
2432
|
+
* rent, migratorProgram, quoteMint when WSOL, metadataProgram, config) are
|
|
2433
|
+
* encoded as ALT lookup metas instead of 32-byte static keys, reducing
|
|
2434
|
+
* transaction size by ~200+ bytes and enabling V4 metadata within the
|
|
2435
|
+
* 1232-byte Solana transaction limit.
|
|
2436
|
+
*
|
|
2437
|
+
* Use DOPPLER_DEVNET_ALT for devnet.
|
|
2438
|
+
*/
|
|
2439
|
+
addressLookupTable?: Address;
|
|
2440
|
+
}
|
|
2441
|
+
declare function createInitializeLaunchInstruction(accounts: InitializeLaunchAccounts, args: InitializeLaunchParams, programId?: Address): Promise<Instruction>;
|
|
2442
|
+
|
|
2443
|
+
type AddressOrSigner$2 = Address | TransactionSigner;
|
|
2444
|
+
interface CurveSwapExactInAccounts {
|
|
2445
|
+
config: Address;
|
|
2446
|
+
launch: Address;
|
|
2447
|
+
launchAuthority: Address;
|
|
2448
|
+
baseVault: Address;
|
|
2449
|
+
quoteVault: Address;
|
|
2450
|
+
userBaseAccount: Address;
|
|
2451
|
+
userQuoteAccount: Address;
|
|
2452
|
+
baseMint: Address;
|
|
2453
|
+
quoteMint: Address;
|
|
2454
|
+
user: AddressOrSigner$2;
|
|
2455
|
+
/** Pass the actual sentinel program address, or omit to use System Program as a no-op placeholder. */
|
|
2456
|
+
sentinelProgram?: Address;
|
|
2457
|
+
tokenProgram?: Address;
|
|
2458
|
+
}
|
|
2459
|
+
declare function createCurveSwapExactInInstruction(accounts: CurveSwapExactInAccounts, args: {
|
|
2460
|
+
amountIn: bigint;
|
|
2461
|
+
minAmountOut: bigint;
|
|
2462
|
+
direction: number;
|
|
2463
|
+
}, programId?: Address): Instruction;
|
|
2464
|
+
|
|
2465
|
+
type AddressOrSigner$1 = Address | TransactionSigner;
|
|
2466
|
+
interface MigrateLaunchAccounts {
|
|
2467
|
+
config: Address;
|
|
2468
|
+
launch: Address;
|
|
2469
|
+
launchAuthority: Address;
|
|
2470
|
+
baseMint: Address;
|
|
2471
|
+
quoteMint: Address;
|
|
2472
|
+
baseVault: Address;
|
|
2473
|
+
quoteVault: Address;
|
|
2474
|
+
migratorProgram: Address;
|
|
2475
|
+
payer: AddressOrSigner$1;
|
|
2476
|
+
tokenProgram?: Address;
|
|
2477
|
+
systemProgram?: Address;
|
|
2478
|
+
rent: Address;
|
|
2479
|
+
}
|
|
2480
|
+
declare function createMigrateLaunchInstruction(accounts: MigrateLaunchAccounts, programId?: Address): Instruction;
|
|
2481
|
+
|
|
2482
|
+
type AddressOrSigner = Address | TransactionSigner;
|
|
2483
|
+
interface AbortLaunchAccounts {
|
|
2484
|
+
config: Address;
|
|
2485
|
+
launch: Address;
|
|
2486
|
+
launchAuthority: Address;
|
|
2487
|
+
baseVault: Address;
|
|
2488
|
+
quoteVault: Address;
|
|
2489
|
+
authority: AddressOrSigner;
|
|
2490
|
+
authorityBaseAccount: Address;
|
|
2491
|
+
baseMint: Address;
|
|
2492
|
+
tokenProgram?: Address;
|
|
2493
|
+
}
|
|
2494
|
+
declare function createAbortLaunchInstruction(accounts: AbortLaunchAccounts, programId?: Address): Instruction;
|
|
2495
|
+
|
|
2496
|
+
interface PreviewSwapExactInResult {
|
|
2497
|
+
amountOut: bigint;
|
|
2498
|
+
feePaid: bigint;
|
|
2499
|
+
}
|
|
2500
|
+
interface PreviewSwapExactInAccounts {
|
|
2501
|
+
launch: Address;
|
|
2502
|
+
baseVault: Address;
|
|
2503
|
+
quoteVault: Address;
|
|
2504
|
+
sentinelProgram?: Address;
|
|
2505
|
+
}
|
|
2506
|
+
declare function createPreviewSwapExactInInstruction(accounts: PreviewSwapExactInAccounts, args: {
|
|
2507
|
+
amountIn: bigint;
|
|
2508
|
+
direction: number;
|
|
2509
|
+
}, programId?: Address): Instruction;
|
|
2510
|
+
declare function decodePreviewSwapExactInResult(data: Uint8Array): PreviewSwapExactInResult;
|
|
2511
|
+
|
|
2512
|
+
interface PreviewMigrationResult {
|
|
2513
|
+
baseVaultAmount: bigint;
|
|
2514
|
+
quoteVaultAmount: bigint;
|
|
2515
|
+
baseMintSupply: bigint;
|
|
2516
|
+
}
|
|
2517
|
+
interface PreviewMigrationAccounts {
|
|
2518
|
+
launch: Address;
|
|
2519
|
+
baseMint: Address;
|
|
2520
|
+
baseVault: Address;
|
|
2521
|
+
quoteVault: Address;
|
|
2522
|
+
}
|
|
2523
|
+
declare function createPreviewMigrationInstruction(accounts: PreviewMigrationAccounts, programId?: Address): Instruction;
|
|
2524
|
+
declare function decodePreviewMigrationResult(data: Uint8Array): PreviewMigrationResult;
|
|
2525
|
+
|
|
2526
|
+
/**
|
|
2527
|
+
* Compute the remaining-accounts commitment hash used by the Initializer program.
|
|
2528
|
+
*
|
|
2529
|
+
* Algorithm: keccak256(u32_len_le || pubkey_0 || ... || pubkey_n)
|
|
2530
|
+
*
|
|
2531
|
+
* This matches compute_remaining_accounts_hash in
|
|
2532
|
+
* programs/initializer/src/instructions/launch_common.rs.
|
|
2533
|
+
*
|
|
2534
|
+
* Commit the result as sentinelRemainingAccountsHash or migratorRemainingAccountsHash
|
|
2535
|
+
* when calling initializeLaunch. At migrate_launch (or sentinel invoke) time, pass the
|
|
2536
|
+
* same accounts in the same order as remaining accounts — the program verifies they match.
|
|
2537
|
+
*
|
|
2538
|
+
* For an empty account list use EMPTY_REMAINING_ACCOUNTS_HASH instead.
|
|
2539
|
+
*/
|
|
2540
|
+
declare function computeRemainingAccountsHash(addresses: Address[]): Uint8Array;
|
|
2541
|
+
/**
|
|
2542
|
+
* Returns a human-readable label for a launch phase value.
|
|
2543
|
+
* Falls back to the numeric string for any unrecognised phase.
|
|
2544
|
+
*/
|
|
2545
|
+
declare function phaseLabel(phase: number): string;
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* Launch fetching functions for the Initializer SDK
|
|
2549
|
+
*/
|
|
2550
|
+
|
|
2551
|
+
interface FetchLaunchesConfig {
|
|
2552
|
+
programId?: Address;
|
|
2553
|
+
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
2554
|
+
}
|
|
2555
|
+
interface LaunchWithAddress {
|
|
2556
|
+
address: Address;
|
|
2557
|
+
account: Launch$1;
|
|
2558
|
+
}
|
|
2559
|
+
declare function fetchLaunch$1(rpc: Rpc<GetAccountInfoApi>, address: Address, config?: FetchLaunchesConfig): Promise<Launch$1 | null>;
|
|
2560
|
+
declare function fetchAllLaunches(rpc: GetProgramAccountsRpc, config?: FetchLaunchesConfig): Promise<LaunchWithAddress[]>;
|
|
2561
|
+
/**
|
|
2562
|
+
* Fetch launches filtered by Launch.authority (offset 8).
|
|
2563
|
+
* Note: Permissionless launches have authority == Pubkey::default().
|
|
2564
|
+
*/
|
|
2565
|
+
declare function fetchLaunchesByAuthority(rpc: GetProgramAccountsRpc, authority: Address, config?: FetchLaunchesConfig): Promise<LaunchWithAddress[]>;
|
|
2566
|
+
declare function launchExists(rpc: Rpc<GetAccountInfoApi>, namespace: Address, launchId: Uint8Array, config?: FetchLaunchesConfig): Promise<boolean>;
|
|
2567
|
+
|
|
2568
|
+
type index$3_AbortLaunchAccounts = AbortLaunchAccounts;
|
|
2569
|
+
declare const index$3_BPF_LOADER_UPGRADEABLE_PROGRAM_ID: typeof BPF_LOADER_UPGRADEABLE_PROGRAM_ID;
|
|
2570
|
+
declare const index$3_CPMM_SENTINEL_PROGRAM_ID: typeof CPMM_SENTINEL_PROGRAM_ID;
|
|
2571
|
+
declare const index$3_CURVE_KIND_XYK: typeof CURVE_KIND_XYK;
|
|
2572
|
+
declare const index$3_CURVE_PARAMS_FORMAT_XYK_V0: typeof CURVE_PARAMS_FORMAT_XYK_V0;
|
|
2573
|
+
type index$3_CurveSwapExactInAccounts = CurveSwapExactInAccounts;
|
|
2574
|
+
declare const index$3_DIRECTION_BUY: typeof DIRECTION_BUY;
|
|
2575
|
+
declare const index$3_DIRECTION_SELL: typeof DIRECTION_SELL;
|
|
2576
|
+
declare const index$3_DOPPLER_DEVNET_ALT: typeof DOPPLER_DEVNET_ALT;
|
|
2577
|
+
declare const index$3_EMPTY_REMAINING_ACCOUNTS_HASH: typeof EMPTY_REMAINING_ACCOUNTS_HASH;
|
|
2578
|
+
type index$3_FetchLaunchesConfig = FetchLaunchesConfig;
|
|
2579
|
+
declare const index$3_INITIALIZER_ACCOUNT_DISCRIMINATORS: typeof INITIALIZER_ACCOUNT_DISCRIMINATORS;
|
|
2580
|
+
declare const index$3_INITIALIZER_INSTRUCTION_DISCRIMINATORS: typeof INITIALIZER_INSTRUCTION_DISCRIMINATORS;
|
|
2581
|
+
declare const index$3_INITIALIZER_PROGRAM_ID: typeof INITIALIZER_PROGRAM_ID;
|
|
2582
|
+
type index$3_InitConfig = InitConfig;
|
|
2583
|
+
type index$3_InitConfigArgs = InitConfigArgs;
|
|
2584
|
+
type index$3_InitializeConfigAccounts = InitializeConfigAccounts;
|
|
2585
|
+
type index$3_InitializeConfigArgs = InitializeConfigArgs;
|
|
2586
|
+
type index$3_InitializeConfigArgsArgs = InitializeConfigArgsArgs;
|
|
2587
|
+
type index$3_InitializeLaunchAccounts = InitializeLaunchAccounts;
|
|
2588
|
+
type index$3_InitializeLaunchArgs = InitializeLaunchArgs;
|
|
2589
|
+
type index$3_InitializeLaunchArgsArgs = InitializeLaunchArgsArgs;
|
|
2590
|
+
type index$3_LaunchWithAddress = LaunchWithAddress;
|
|
2591
|
+
declare const index$3_MAX_CALLDATA: typeof MAX_CALLDATA;
|
|
2592
|
+
declare const index$3_MAX_MIGRATOR_ALLOWLIST: typeof MAX_MIGRATOR_ALLOWLIST;
|
|
2593
|
+
declare const index$3_MAX_SENTINEL_ALLOWLIST: typeof MAX_SENTINEL_ALLOWLIST;
|
|
2594
|
+
type index$3_MigrateLaunchAccounts = MigrateLaunchAccounts;
|
|
2595
|
+
declare const index$3_PHASE_ABORTED: typeof PHASE_ABORTED;
|
|
2596
|
+
declare const index$3_PHASE_MIGRATED: typeof PHASE_MIGRATED;
|
|
2597
|
+
declare const index$3_PHASE_TRADING: typeof PHASE_TRADING;
|
|
2598
|
+
declare const index$3_PREDICTION_SENTINEL_PROGRAM_ID: typeof PREDICTION_SENTINEL_PROGRAM_ID;
|
|
2599
|
+
type index$3_PreviewMigrationAccounts = PreviewMigrationAccounts;
|
|
2600
|
+
type index$3_PreviewMigrationResult = PreviewMigrationResult;
|
|
2601
|
+
type index$3_PreviewSwapExactInAccounts = PreviewSwapExactInAccounts;
|
|
2602
|
+
type index$3_PreviewSwapExactInResult = PreviewSwapExactInResult;
|
|
2603
|
+
declare const index$3_SEED_CONFIG: typeof SEED_CONFIG;
|
|
2604
|
+
declare const index$3_SEED_LAUNCH: typeof SEED_LAUNCH;
|
|
2605
|
+
declare const index$3_SEED_LAUNCH_AUTHORITY: typeof SEED_LAUNCH_AUTHORITY;
|
|
2606
|
+
declare const index$3_SENTINEL_NO_CHANGE: typeof SENTINEL_NO_CHANGE;
|
|
2607
|
+
declare const index$3_SF_AFTER_SWAP: typeof SF_AFTER_SWAP;
|
|
2608
|
+
declare const index$3_SF_BEFORE_SWAP: typeof SF_BEFORE_SWAP;
|
|
2609
|
+
type index$3_SetMigratorAllowlistAccounts = SetMigratorAllowlistAccounts;
|
|
2610
|
+
type index$3_SetSentinelAllowlistAccounts = SetSentinelAllowlistAccounts;
|
|
2611
|
+
declare const index$3_computeRemainingAccountsHash: typeof computeRemainingAccountsHash;
|
|
2612
|
+
declare const index$3_createAbortLaunchInstruction: typeof createAbortLaunchInstruction;
|
|
2613
|
+
declare const index$3_createCurveSwapExactInInstruction: typeof createCurveSwapExactInInstruction;
|
|
2614
|
+
declare const index$3_createInitializeConfigInstruction: typeof createInitializeConfigInstruction;
|
|
2615
|
+
declare const index$3_createInitializeLaunchInstruction: typeof createInitializeLaunchInstruction;
|
|
2616
|
+
declare const index$3_createMigrateLaunchInstruction: typeof createMigrateLaunchInstruction;
|
|
2617
|
+
declare const index$3_createPreviewMigrationInstruction: typeof createPreviewMigrationInstruction;
|
|
2618
|
+
declare const index$3_createPreviewSwapExactInInstruction: typeof createPreviewSwapExactInInstruction;
|
|
2619
|
+
declare const index$3_createSetMigratorAllowlistInstruction: typeof createSetMigratorAllowlistInstruction;
|
|
2620
|
+
declare const index$3_createSetSentinelAllowlistInstruction: typeof createSetSentinelAllowlistInstruction;
|
|
2621
|
+
declare const index$3_decodePreviewMigrationResult: typeof decodePreviewMigrationResult;
|
|
2622
|
+
declare const index$3_decodePreviewSwapExactInResult: typeof decodePreviewSwapExactInResult;
|
|
2623
|
+
declare const index$3_encodeU64LE: typeof encodeU64LE;
|
|
2624
|
+
declare const index$3_fetchAllLaunches: typeof fetchAllLaunches;
|
|
2625
|
+
declare const index$3_fetchLaunchesByAuthority: typeof fetchLaunchesByAuthority;
|
|
2626
|
+
declare const index$3_getConfigAddress: typeof getConfigAddress;
|
|
2627
|
+
declare const index$3_getInitConfigCodec: typeof getInitConfigCodec;
|
|
2628
|
+
declare const index$3_getInitConfigDecoder: typeof getInitConfigDecoder;
|
|
2629
|
+
declare const index$3_getInitConfigEncoder: typeof getInitConfigEncoder;
|
|
2630
|
+
declare const index$3_getInitializeConfigArgsCodec: typeof getInitializeConfigArgsCodec;
|
|
2631
|
+
declare const index$3_getInitializeConfigArgsDecoder: typeof getInitializeConfigArgsDecoder;
|
|
2632
|
+
declare const index$3_getInitializeConfigArgsEncoder: typeof getInitializeConfigArgsEncoder;
|
|
2633
|
+
declare const index$3_getInitializeLaunchArgsCodec: typeof getInitializeLaunchArgsCodec;
|
|
2634
|
+
declare const index$3_getInitializeLaunchArgsDecoder: typeof getInitializeLaunchArgsDecoder;
|
|
2635
|
+
declare const index$3_getInitializeLaunchArgsEncoder: typeof getInitializeLaunchArgsEncoder;
|
|
2636
|
+
declare const index$3_getLaunchAddress: typeof getLaunchAddress;
|
|
2637
|
+
declare const index$3_getLaunchAuthorityAddress: typeof getLaunchAuthorityAddress;
|
|
2638
|
+
declare const index$3_getProgramDataAddress: typeof getProgramDataAddress;
|
|
2639
|
+
declare const index$3_getTokenMetadataAddress: typeof getTokenMetadataAddress;
|
|
2640
|
+
declare const index$3_launchExists: typeof launchExists;
|
|
2641
|
+
declare const index$3_launchIdFromU64: typeof launchIdFromU64;
|
|
2642
|
+
declare const index$3_phaseLabel: typeof phaseLabel;
|
|
2643
|
+
declare namespace index$3 {
|
|
2644
|
+
export { type index$3_AbortLaunchAccounts as AbortLaunchAccounts, index$3_BPF_LOADER_UPGRADEABLE_PROGRAM_ID as BPF_LOADER_UPGRADEABLE_PROGRAM_ID, index$3_CPMM_SENTINEL_PROGRAM_ID as CPMM_SENTINEL_PROGRAM_ID, index$3_CURVE_KIND_XYK as CURVE_KIND_XYK, index$3_CURVE_PARAMS_FORMAT_XYK_V0 as CURVE_PARAMS_FORMAT_XYK_V0, type CalldataBuf$1 as CalldataBuf, type index$3_CurveSwapExactInAccounts as CurveSwapExactInAccounts, index$3_DIRECTION_BUY as DIRECTION_BUY, index$3_DIRECTION_SELL as DIRECTION_SELL, index$3_DOPPLER_DEVNET_ALT as DOPPLER_DEVNET_ALT, index$3_EMPTY_REMAINING_ACCOUNTS_HASH as EMPTY_REMAINING_ACCOUNTS_HASH, type index$3_FetchLaunchesConfig as FetchLaunchesConfig, index$3_INITIALIZER_ACCOUNT_DISCRIMINATORS as INITIALIZER_ACCOUNT_DISCRIMINATORS, index$3_INITIALIZER_INSTRUCTION_DISCRIMINATORS as INITIALIZER_INSTRUCTION_DISCRIMINATORS, index$3_INITIALIZER_PROGRAM_ID as INITIALIZER_PROGRAM_ID, type index$3_InitConfig as InitConfig, type index$3_InitConfigArgs as InitConfigArgs, type index$3_InitializeConfigAccounts as InitializeConfigAccounts, type index$3_InitializeConfigArgs as InitializeConfigArgs, type index$3_InitializeConfigArgsArgs as InitializeConfigArgsArgs, type index$3_InitializeLaunchAccounts as InitializeLaunchAccounts, type index$3_InitializeLaunchArgs as InitializeLaunchArgs, type index$3_InitializeLaunchArgsArgs as InitializeLaunchArgsArgs, type Launch$1 as Launch, type LaunchArgs$1 as LaunchArgs, type index$3_LaunchWithAddress as LaunchWithAddress, index$3_MAX_CALLDATA as MAX_CALLDATA, index$3_MAX_MIGRATOR_ALLOWLIST as MAX_MIGRATOR_ALLOWLIST, index$3_MAX_SENTINEL_ALLOWLIST as MAX_SENTINEL_ALLOWLIST, type index$3_MigrateLaunchAccounts as MigrateLaunchAccounts, index$3_PHASE_ABORTED as PHASE_ABORTED, index$3_PHASE_MIGRATED as PHASE_MIGRATED, index$3_PHASE_TRADING as PHASE_TRADING, index$3_PREDICTION_SENTINEL_PROGRAM_ID as PREDICTION_SENTINEL_PROGRAM_ID, type index$3_PreviewMigrationAccounts as PreviewMigrationAccounts, type index$3_PreviewMigrationResult as PreviewMigrationResult, type index$3_PreviewSwapExactInAccounts as PreviewSwapExactInAccounts, type index$3_PreviewSwapExactInResult as PreviewSwapExactInResult, index$3_SEED_CONFIG as SEED_CONFIG, index$3_SEED_LAUNCH as SEED_LAUNCH, index$3_SEED_LAUNCH_AUTHORITY as SEED_LAUNCH_AUTHORITY, index$3_SENTINEL_NO_CHANGE as SENTINEL_NO_CHANGE, index$3_SF_AFTER_SWAP as SF_AFTER_SWAP, index$3_SF_BEFORE_SWAP as SF_BEFORE_SWAP, type index$3_SetMigratorAllowlistAccounts as SetMigratorAllowlistAccounts, type index$3_SetSentinelAllowlistAccounts as SetSentinelAllowlistAccounts, index$3_computeRemainingAccountsHash as computeRemainingAccountsHash, index$3_createAbortLaunchInstruction as createAbortLaunchInstruction, index$3_createCurveSwapExactInInstruction as createCurveSwapExactInInstruction, index$3_createInitializeConfigInstruction as createInitializeConfigInstruction, index$3_createInitializeLaunchInstruction as createInitializeLaunchInstruction, index$3_createMigrateLaunchInstruction as createMigrateLaunchInstruction, index$3_createPreviewMigrationInstruction as createPreviewMigrationInstruction, index$3_createPreviewSwapExactInInstruction as createPreviewSwapExactInInstruction, index$3_createSetMigratorAllowlistInstruction as createSetMigratorAllowlistInstruction, index$3_createSetSentinelAllowlistInstruction as createSetSentinelAllowlistInstruction, index$3_decodePreviewMigrationResult as decodePreviewMigrationResult, index$3_decodePreviewSwapExactInResult as decodePreviewSwapExactInResult, index$3_encodeU64LE as encodeU64LE, index$3_fetchAllLaunches as fetchAllLaunches, fetchLaunch$1 as fetchLaunch, index$3_fetchLaunchesByAuthority as fetchLaunchesByAuthority, index$3_getConfigAddress as getConfigAddress, index$3_getInitConfigCodec as getInitConfigCodec, index$3_getInitConfigDecoder as getInitConfigDecoder, index$3_getInitConfigEncoder as getInitConfigEncoder, index$3_getInitializeConfigArgsCodec as getInitializeConfigArgsCodec, index$3_getInitializeConfigArgsDecoder as getInitializeConfigArgsDecoder, index$3_getInitializeConfigArgsEncoder as getInitializeConfigArgsEncoder, index$3_getInitializeLaunchArgsCodec as getInitializeLaunchArgsCodec, index$3_getInitializeLaunchArgsDecoder as getInitializeLaunchArgsDecoder, index$3_getInitializeLaunchArgsEncoder as getInitializeLaunchArgsEncoder, index$3_getLaunchAddress as getLaunchAddress, index$3_getLaunchAuthorityAddress as getLaunchAuthorityAddress, getLaunchCodec$1 as getLaunchCodec, getLaunchDecoder$1 as getLaunchDecoder, getLaunchEncoder$1 as getLaunchEncoder, index$3_getProgramDataAddress as getProgramDataAddress, index$3_getTokenMetadataAddress as getTokenMetadataAddress, index$3_launchExists as launchExists, index$3_launchIdFromU64 as launchIdFromU64, index$3_phaseLabel as phaseLabel };
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
/**
|
|
2648
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2649
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2650
|
+
* to add features, then rerun Codama to update it.
|
|
2651
|
+
*
|
|
2652
|
+
* @see https://github.com/codama-idl/codama
|
|
2653
|
+
*/
|
|
2654
|
+
|
|
2655
|
+
/**
|
|
2656
|
+
* Arguments for migrate instruction.
|
|
2657
|
+
* These are deserialized from the migrator_migrate_calldata passed by initializer.
|
|
2658
|
+
*/
|
|
2659
|
+
type MigrateArgs = {
|
|
2660
|
+
/** Base tokens reserved for distribution to recipients */
|
|
2661
|
+
baseForDistribution: bigint;
|
|
2662
|
+
/** Base tokens reserved for CPMM liquidity */
|
|
2663
|
+
baseForLiquidity: bigint;
|
|
2664
|
+
};
|
|
2665
|
+
type MigrateArgsArgs = {
|
|
2666
|
+
/** Base tokens reserved for distribution to recipients */
|
|
2667
|
+
baseForDistribution: number | bigint;
|
|
2668
|
+
/** Base tokens reserved for CPMM liquidity */
|
|
2669
|
+
baseForLiquidity: number | bigint;
|
|
2670
|
+
};
|
|
2671
|
+
declare function getMigrateArgsEncoder(): FixedSizeEncoder<MigrateArgsArgs>;
|
|
2672
|
+
declare function getMigrateArgsDecoder(): FixedSizeDecoder<MigrateArgs>;
|
|
2673
|
+
declare function getMigrateArgsCodec(): FixedSizeCodec<MigrateArgsArgs, MigrateArgs>;
|
|
2674
|
+
|
|
2675
|
+
/**
|
|
2676
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2677
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2678
|
+
* to add features, then rerun Codama to update it.
|
|
2679
|
+
*
|
|
2680
|
+
* @see https://github.com/codama-idl/codama
|
|
2681
|
+
*/
|
|
2682
|
+
|
|
2683
|
+
type Recipient = {
|
|
2684
|
+
wallet: Address;
|
|
2685
|
+
amount: bigint;
|
|
2686
|
+
};
|
|
2687
|
+
type RecipientArgs = {
|
|
2688
|
+
wallet: Address;
|
|
2689
|
+
amount: number | bigint;
|
|
2690
|
+
};
|
|
2691
|
+
declare function getRecipientEncoder(): FixedSizeEncoder<RecipientArgs>;
|
|
2692
|
+
declare function getRecipientDecoder(): FixedSizeDecoder<Recipient>;
|
|
2693
|
+
declare function getRecipientCodec(): FixedSizeCodec<RecipientArgs, Recipient>;
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2697
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2698
|
+
* to add features, then rerun Codama to update it.
|
|
2699
|
+
*
|
|
2700
|
+
* @see https://github.com/codama-idl/codama
|
|
2701
|
+
*/
|
|
2702
|
+
|
|
2703
|
+
/**
|
|
2704
|
+
* Arguments for register_launch instruction.
|
|
2705
|
+
* These are deserialized from the migrator_init_calldata passed by initializer.
|
|
2706
|
+
*/
|
|
2707
|
+
type RegisterLaunchArgs = {
|
|
2708
|
+
cpmmConfig: Address;
|
|
2709
|
+
initialSwapFeeBps: number;
|
|
2710
|
+
initialFeeSplitBps: number;
|
|
2711
|
+
recipients: Array<Recipient>;
|
|
2712
|
+
minRaiseQuote: bigint;
|
|
2713
|
+
minMigrationPriceQ64Opt: Option<bigint>;
|
|
2714
|
+
};
|
|
2715
|
+
type RegisterLaunchArgsArgs = {
|
|
2716
|
+
cpmmConfig: Address;
|
|
2717
|
+
initialSwapFeeBps: number;
|
|
2718
|
+
initialFeeSplitBps: number;
|
|
2719
|
+
recipients: Array<RecipientArgs>;
|
|
2720
|
+
minRaiseQuote: number | bigint;
|
|
2721
|
+
minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;
|
|
2722
|
+
};
|
|
2723
|
+
declare function getRegisterLaunchArgsEncoder(): Encoder<RegisterLaunchArgsArgs>;
|
|
2724
|
+
declare function getRegisterLaunchArgsDecoder(): Decoder<RegisterLaunchArgs>;
|
|
2725
|
+
declare function getRegisterLaunchArgsCodec(): Codec<RegisterLaunchArgsArgs, RegisterLaunchArgs>;
|
|
2726
|
+
|
|
2727
|
+
/**
|
|
2728
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2729
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2730
|
+
* to add features, then rerun Codama to update it.
|
|
2731
|
+
*
|
|
2732
|
+
* @see https://github.com/codama-idl/codama
|
|
2733
|
+
*/
|
|
2734
|
+
|
|
2735
|
+
type CpmmMigratorState = {
|
|
2736
|
+
discriminator: ReadonlyUint8Array;
|
|
2737
|
+
/** The launch this state is associated with */
|
|
2738
|
+
launch: Address;
|
|
2739
|
+
/** Admin who registered this launch (receives unsold curve base tokens) */
|
|
2740
|
+
admin: Address;
|
|
2741
|
+
/** CPMM config to use for pool initialization */
|
|
2742
|
+
cpmmConfig: Address;
|
|
2743
|
+
/** Initial swap fee for the CPMM pool (basis points) */
|
|
2744
|
+
initialSwapFeeBps: number;
|
|
2745
|
+
/** Initial fee split for the CPMM pool (basis points) */
|
|
2746
|
+
initialFeeSplitBps: number;
|
|
2747
|
+
/** Padding for alignment */
|
|
2748
|
+
pad0: ReadonlyUint8Array;
|
|
2749
|
+
/** Recipients for base token distribution at migration */
|
|
2750
|
+
recipients: Array<Recipient>;
|
|
2751
|
+
/** Minimum quote tokens required to migrate */
|
|
2752
|
+
minRaiseQuote: bigint;
|
|
2753
|
+
/** Optional minimum price floor (Q64 fixed point) */
|
|
2754
|
+
minMigrationPriceQ64Opt: Option<bigint>;
|
|
2755
|
+
/** Whether this launch has been migrated */
|
|
2756
|
+
isMigrated: boolean;
|
|
2757
|
+
/** Bump seed for this PDA */
|
|
2758
|
+
bump: number;
|
|
2759
|
+
/** Reserved for future use */
|
|
2760
|
+
reserved: ReadonlyUint8Array;
|
|
2761
|
+
};
|
|
2762
|
+
type CpmmMigratorStateArgs = {
|
|
2763
|
+
/** The launch this state is associated with */
|
|
2764
|
+
launch: Address;
|
|
2765
|
+
/** Admin who registered this launch (receives unsold curve base tokens) */
|
|
2766
|
+
admin: Address;
|
|
2767
|
+
/** CPMM config to use for pool initialization */
|
|
2768
|
+
cpmmConfig: Address;
|
|
2769
|
+
/** Initial swap fee for the CPMM pool (basis points) */
|
|
2770
|
+
initialSwapFeeBps: number;
|
|
2771
|
+
/** Initial fee split for the CPMM pool (basis points) */
|
|
2772
|
+
initialFeeSplitBps: number;
|
|
2773
|
+
/** Padding for alignment */
|
|
2774
|
+
pad0: ReadonlyUint8Array;
|
|
2775
|
+
/** Recipients for base token distribution at migration */
|
|
2776
|
+
recipients: Array<RecipientArgs>;
|
|
2777
|
+
/** Minimum quote tokens required to migrate */
|
|
2778
|
+
minRaiseQuote: number | bigint;
|
|
2779
|
+
/** Optional minimum price floor (Q64 fixed point) */
|
|
2780
|
+
minMigrationPriceQ64Opt: OptionOrNullable<number | bigint>;
|
|
2781
|
+
/** Whether this launch has been migrated */
|
|
2782
|
+
isMigrated: boolean;
|
|
2783
|
+
/** Bump seed for this PDA */
|
|
2784
|
+
bump: number;
|
|
2785
|
+
/** Reserved for future use */
|
|
2786
|
+
reserved: ReadonlyUint8Array;
|
|
2787
|
+
};
|
|
2788
|
+
/** Gets the encoder for {@link CpmmMigratorStateArgs} account data. */
|
|
2789
|
+
declare function getCpmmMigratorStateEncoder(): Encoder<CpmmMigratorStateArgs>;
|
|
2790
|
+
/** Gets the decoder for {@link CpmmMigratorState} account data. */
|
|
2791
|
+
declare function getCpmmMigratorStateDecoder(): Decoder<CpmmMigratorState>;
|
|
2792
|
+
/** Gets the codec for {@link CpmmMigratorState} account data. */
|
|
2793
|
+
declare function getCpmmMigratorStateCodec(): Codec<CpmmMigratorStateArgs, CpmmMigratorState>;
|
|
2794
|
+
|
|
2795
|
+
declare const CPMM_MIGRATOR_PROGRAM_ID: Address;
|
|
2796
|
+
declare const SEED_STATE = "state";
|
|
2797
|
+
declare const MAX_RECIPIENTS = 2;
|
|
2798
|
+
declare const CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: {
|
|
2799
|
+
readonly registerLaunch: Uint8Array<ArrayBuffer>;
|
|
2800
|
+
readonly migrate: Uint8Array<ArrayBuffer>;
|
|
2801
|
+
};
|
|
2802
|
+
declare const CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: {
|
|
2803
|
+
readonly CpmmMigratorState: Uint8Array<ArrayBuffer>;
|
|
2804
|
+
};
|
|
2805
|
+
|
|
2806
|
+
declare function getCpmmMigratorStateAddress(launch: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
2807
|
+
|
|
2808
|
+
declare function fetchCpmmMigratorState(rpc: Rpc<GetAccountInfoApi>, address: Address): Promise<CpmmMigratorState | null>;
|
|
2809
|
+
|
|
2810
|
+
declare function encodeRegisterLaunchCalldata(args: RegisterLaunchArgsArgs): Uint8Array;
|
|
2811
|
+
declare function encodeMigrateCalldata(args: MigrateArgsArgs): Uint8Array;
|
|
2812
|
+
|
|
2813
|
+
declare const index$2_CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS: typeof CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS;
|
|
2814
|
+
declare const index$2_CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS: typeof CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS;
|
|
2815
|
+
declare const index$2_CPMM_MIGRATOR_PROGRAM_ID: typeof CPMM_MIGRATOR_PROGRAM_ID;
|
|
2816
|
+
type index$2_CpmmMigratorState = CpmmMigratorState;
|
|
2817
|
+
type index$2_CpmmMigratorStateArgs = CpmmMigratorStateArgs;
|
|
2818
|
+
declare const index$2_MAX_RECIPIENTS: typeof MAX_RECIPIENTS;
|
|
2819
|
+
type index$2_MigrateArgs = MigrateArgs;
|
|
2820
|
+
type index$2_MigrateArgsArgs = MigrateArgsArgs;
|
|
2821
|
+
type index$2_Recipient = Recipient;
|
|
2822
|
+
type index$2_RecipientArgs = RecipientArgs;
|
|
2823
|
+
type index$2_RegisterLaunchArgs = RegisterLaunchArgs;
|
|
2824
|
+
type index$2_RegisterLaunchArgsArgs = RegisterLaunchArgsArgs;
|
|
2825
|
+
declare const index$2_SEED_STATE: typeof SEED_STATE;
|
|
2826
|
+
declare const index$2_encodeMigrateCalldata: typeof encodeMigrateCalldata;
|
|
2827
|
+
declare const index$2_encodeRegisterLaunchCalldata: typeof encodeRegisterLaunchCalldata;
|
|
2828
|
+
declare const index$2_fetchCpmmMigratorState: typeof fetchCpmmMigratorState;
|
|
2829
|
+
declare const index$2_getCpmmMigratorStateAddress: typeof getCpmmMigratorStateAddress;
|
|
2830
|
+
declare const index$2_getCpmmMigratorStateCodec: typeof getCpmmMigratorStateCodec;
|
|
2831
|
+
declare const index$2_getCpmmMigratorStateDecoder: typeof getCpmmMigratorStateDecoder;
|
|
2832
|
+
declare const index$2_getCpmmMigratorStateEncoder: typeof getCpmmMigratorStateEncoder;
|
|
2833
|
+
declare const index$2_getMigrateArgsCodec: typeof getMigrateArgsCodec;
|
|
2834
|
+
declare const index$2_getMigrateArgsDecoder: typeof getMigrateArgsDecoder;
|
|
2835
|
+
declare const index$2_getMigrateArgsEncoder: typeof getMigrateArgsEncoder;
|
|
2836
|
+
declare const index$2_getRecipientCodec: typeof getRecipientCodec;
|
|
2837
|
+
declare const index$2_getRecipientDecoder: typeof getRecipientDecoder;
|
|
2838
|
+
declare const index$2_getRecipientEncoder: typeof getRecipientEncoder;
|
|
2839
|
+
declare const index$2_getRegisterLaunchArgsCodec: typeof getRegisterLaunchArgsCodec;
|
|
2840
|
+
declare const index$2_getRegisterLaunchArgsDecoder: typeof getRegisterLaunchArgsDecoder;
|
|
2841
|
+
declare const index$2_getRegisterLaunchArgsEncoder: typeof getRegisterLaunchArgsEncoder;
|
|
2842
|
+
declare namespace index$2 {
|
|
2843
|
+
export { index$2_CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS as CPMM_MIGRATOR_ACCOUNT_DISCRIMINATORS, index$2_CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS as CPMM_MIGRATOR_INSTRUCTION_DISCRIMINATORS, index$2_CPMM_MIGRATOR_PROGRAM_ID as CPMM_MIGRATOR_PROGRAM_ID, type index$2_CpmmMigratorState as CpmmMigratorState, type index$2_CpmmMigratorStateArgs as CpmmMigratorStateArgs, index$2_MAX_RECIPIENTS as MAX_RECIPIENTS, type index$2_MigrateArgs as MigrateArgs, type index$2_MigrateArgsArgs as MigrateArgsArgs, type index$2_Recipient as Recipient, type index$2_RecipientArgs as RecipientArgs, type index$2_RegisterLaunchArgs as RegisterLaunchArgs, type index$2_RegisterLaunchArgsArgs as RegisterLaunchArgsArgs, index$2_SEED_STATE as SEED_STATE, index$2_encodeMigrateCalldata as encodeMigrateCalldata, index$2_encodeRegisterLaunchCalldata as encodeRegisterLaunchCalldata, index$2_fetchCpmmMigratorState as fetchCpmmMigratorState, index$2_getCpmmMigratorStateAddress as getCpmmMigratorStateAddress, index$2_getCpmmMigratorStateCodec as getCpmmMigratorStateCodec, index$2_getCpmmMigratorStateDecoder as getCpmmMigratorStateDecoder, index$2_getCpmmMigratorStateEncoder as getCpmmMigratorStateEncoder, index$2_getMigrateArgsCodec as getMigrateArgsCodec, index$2_getMigrateArgsDecoder as getMigrateArgsDecoder, index$2_getMigrateArgsEncoder as getMigrateArgsEncoder, index$2_getRecipientCodec as getRecipientCodec, index$2_getRecipientDecoder as getRecipientDecoder, index$2_getRecipientEncoder as getRecipientEncoder, index$2_getRegisterLaunchArgsCodec as getRegisterLaunchArgsCodec, index$2_getRegisterLaunchArgsDecoder as getRegisterLaunchArgsDecoder, index$2_getRegisterLaunchArgsEncoder as getRegisterLaunchArgsEncoder };
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
/**
|
|
2847
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2848
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2849
|
+
* to add features, then rerun Codama to update it.
|
|
2850
|
+
*
|
|
2851
|
+
* @see https://github.com/codama-idl/codama
|
|
2852
|
+
*/
|
|
2853
|
+
|
|
2854
|
+
declare const CLAIM_RECEIPT_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
2855
|
+
declare function getClaimReceiptDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
2856
|
+
type ClaimReceipt = {
|
|
2857
|
+
discriminator: ReadonlyUint8Array;
|
|
2858
|
+
/** The market this receipt belongs to */
|
|
2859
|
+
market: Address;
|
|
2860
|
+
/** The claimer's wallet */
|
|
2861
|
+
claimer: Address;
|
|
2862
|
+
/** Total winner tokens burned by this user */
|
|
2863
|
+
burnedAmount: bigint;
|
|
2864
|
+
/** Reward debt for accumulator accounting (scaled by ACC_SCALE) */
|
|
2865
|
+
rewardDebt: bigint;
|
|
2866
|
+
/** Bump seed for this PDA */
|
|
2867
|
+
bump: number;
|
|
2868
|
+
/** Reserved for future use */
|
|
2869
|
+
reserved: ReadonlyUint8Array;
|
|
2870
|
+
};
|
|
2871
|
+
type ClaimReceiptArgs = {
|
|
2872
|
+
/** The market this receipt belongs to */
|
|
2873
|
+
market: Address;
|
|
2874
|
+
/** The claimer's wallet */
|
|
2875
|
+
claimer: Address;
|
|
2876
|
+
/** Total winner tokens burned by this user */
|
|
2877
|
+
burnedAmount: number | bigint;
|
|
2878
|
+
/** Reward debt for accumulator accounting (scaled by ACC_SCALE) */
|
|
2879
|
+
rewardDebt: number | bigint;
|
|
2880
|
+
/** Bump seed for this PDA */
|
|
2881
|
+
bump: number;
|
|
2882
|
+
/** Reserved for future use */
|
|
2883
|
+
reserved: ReadonlyUint8Array;
|
|
2884
|
+
};
|
|
2885
|
+
/** Gets the encoder for {@link ClaimReceiptArgs} account data. */
|
|
2886
|
+
declare function getClaimReceiptEncoder(): FixedSizeEncoder<ClaimReceiptArgs>;
|
|
2887
|
+
/** Gets the decoder for {@link ClaimReceipt} account data. */
|
|
2888
|
+
declare function getClaimReceiptDecoder(): FixedSizeDecoder<ClaimReceipt>;
|
|
2889
|
+
/** Gets the codec for {@link ClaimReceipt} account data. */
|
|
2890
|
+
declare function getClaimReceiptCodec(): FixedSizeCodec<ClaimReceiptArgs, ClaimReceipt>;
|
|
2891
|
+
declare function decodeClaimReceipt<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<ClaimReceipt, TAddress>;
|
|
2892
|
+
declare function decodeClaimReceipt<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<ClaimReceipt, TAddress>;
|
|
2893
|
+
declare function fetchClaimReceipt<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<ClaimReceipt, TAddress>>;
|
|
2894
|
+
declare function fetchMaybeClaimReceipt<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<ClaimReceipt, TAddress>>;
|
|
2895
|
+
declare function fetchAllClaimReceipt(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<ClaimReceipt>[]>;
|
|
2896
|
+
declare function fetchAllMaybeClaimReceipt(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<ClaimReceipt>[]>;
|
|
2897
|
+
declare function getClaimReceiptSize(): number;
|
|
2898
|
+
|
|
2899
|
+
/**
|
|
2900
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2901
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2902
|
+
* to add features, then rerun Codama to update it.
|
|
2903
|
+
*
|
|
2904
|
+
* @see https://github.com/codama-idl/codama
|
|
2905
|
+
*/
|
|
2906
|
+
|
|
2907
|
+
declare const ENTRY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
2908
|
+
declare function getEntryDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
2909
|
+
type Entry = {
|
|
2910
|
+
discriminator: ReadonlyUint8Array;
|
|
2911
|
+
/** The oracle this entry belongs to */
|
|
2912
|
+
oracle: Address;
|
|
2913
|
+
/** Unique identifier for this entry within the market */
|
|
2914
|
+
entryId: ReadonlyUint8Array;
|
|
2915
|
+
/** The token mint for this entry */
|
|
2916
|
+
baseMint: Address;
|
|
2917
|
+
/** Quote contributed when this entry was migrated */
|
|
2918
|
+
contribution: bigint;
|
|
2919
|
+
/** Whether this entry has been migrated */
|
|
2920
|
+
isMigrated: boolean;
|
|
2921
|
+
/** Bump seed for this PDA */
|
|
2922
|
+
bump: number;
|
|
2923
|
+
/** Reserved for future use */
|
|
2924
|
+
reserved: ReadonlyUint8Array;
|
|
2925
|
+
};
|
|
2926
|
+
type EntryArgs = {
|
|
2927
|
+
/** The oracle this entry belongs to */
|
|
2928
|
+
oracle: Address;
|
|
2929
|
+
/** Unique identifier for this entry within the market */
|
|
2930
|
+
entryId: ReadonlyUint8Array;
|
|
2931
|
+
/** The token mint for this entry */
|
|
2932
|
+
baseMint: Address;
|
|
2933
|
+
/** Quote contributed when this entry was migrated */
|
|
2934
|
+
contribution: number | bigint;
|
|
2935
|
+
/** Whether this entry has been migrated */
|
|
2936
|
+
isMigrated: boolean;
|
|
2937
|
+
/** Bump seed for this PDA */
|
|
2938
|
+
bump: number;
|
|
2939
|
+
/** Reserved for future use */
|
|
2940
|
+
reserved: ReadonlyUint8Array;
|
|
2941
|
+
};
|
|
2942
|
+
/** Gets the encoder for {@link EntryArgs} account data. */
|
|
2943
|
+
declare function getEntryEncoder(): FixedSizeEncoder<EntryArgs>;
|
|
2944
|
+
/** Gets the decoder for {@link Entry} account data. */
|
|
2945
|
+
declare function getEntryDecoder(): FixedSizeDecoder<Entry>;
|
|
2946
|
+
/** Gets the codec for {@link Entry} account data. */
|
|
2947
|
+
declare function getEntryCodec(): FixedSizeCodec<EntryArgs, Entry>;
|
|
2948
|
+
declare function decodeEntry<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Entry, TAddress>;
|
|
2949
|
+
declare function decodeEntry<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Entry, TAddress>;
|
|
2950
|
+
declare function fetchEntry<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Entry, TAddress>>;
|
|
2951
|
+
declare function fetchMaybeEntry<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Entry, TAddress>>;
|
|
2952
|
+
declare function fetchAllEntry(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Entry>[]>;
|
|
2953
|
+
declare function fetchAllMaybeEntry(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Entry>[]>;
|
|
2954
|
+
declare function getEntrySize(): number;
|
|
2955
|
+
|
|
2956
|
+
/**
|
|
2957
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
2958
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2959
|
+
* to add features, then rerun Codama to update it.
|
|
2960
|
+
*
|
|
2961
|
+
* @see https://github.com/codama-idl/codama
|
|
2962
|
+
*/
|
|
2963
|
+
|
|
2964
|
+
declare const ENTRY_BY_MINT_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
2965
|
+
declare function getEntryByMintDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
2966
|
+
type EntryByMint = {
|
|
2967
|
+
discriminator: ReadonlyUint8Array;
|
|
2968
|
+
/** The oracle this entry belongs to */
|
|
2969
|
+
oracle: Address;
|
|
2970
|
+
/** The base mint */
|
|
2971
|
+
baseMint: Address;
|
|
2972
|
+
/** The entry_id for reverse lookup */
|
|
2973
|
+
entryId: ReadonlyUint8Array;
|
|
2974
|
+
/** Bump seed for this PDA */
|
|
2975
|
+
bump: number;
|
|
2976
|
+
/** Reserved for future use */
|
|
2977
|
+
reserved: ReadonlyUint8Array;
|
|
2978
|
+
};
|
|
2979
|
+
type EntryByMintArgs = {
|
|
2980
|
+
/** The oracle this entry belongs to */
|
|
2981
|
+
oracle: Address;
|
|
2982
|
+
/** The base mint */
|
|
2983
|
+
baseMint: Address;
|
|
2984
|
+
/** The entry_id for reverse lookup */
|
|
2985
|
+
entryId: ReadonlyUint8Array;
|
|
2986
|
+
/** Bump seed for this PDA */
|
|
2987
|
+
bump: number;
|
|
2988
|
+
/** Reserved for future use */
|
|
2989
|
+
reserved: ReadonlyUint8Array;
|
|
2990
|
+
};
|
|
2991
|
+
/** Gets the encoder for {@link EntryByMintArgs} account data. */
|
|
2992
|
+
declare function getEntryByMintEncoder(): FixedSizeEncoder<EntryByMintArgs>;
|
|
2993
|
+
/** Gets the decoder for {@link EntryByMint} account data. */
|
|
2994
|
+
declare function getEntryByMintDecoder(): FixedSizeDecoder<EntryByMint>;
|
|
2995
|
+
/** Gets the codec for {@link EntryByMint} account data. */
|
|
2996
|
+
declare function getEntryByMintCodec(): FixedSizeCodec<EntryByMintArgs, EntryByMint>;
|
|
2997
|
+
declare function decodeEntryByMint<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<EntryByMint, TAddress>;
|
|
2998
|
+
declare function decodeEntryByMint<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<EntryByMint, TAddress>;
|
|
2999
|
+
declare function fetchEntryByMint<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<EntryByMint, TAddress>>;
|
|
3000
|
+
declare function fetchMaybeEntryByMint<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<EntryByMint, TAddress>>;
|
|
3001
|
+
declare function fetchAllEntryByMint(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<EntryByMint>[]>;
|
|
3002
|
+
declare function fetchAllMaybeEntryByMint(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<EntryByMint>[]>;
|
|
3003
|
+
declare function getEntryByMintSize(): number;
|
|
3004
|
+
|
|
3005
|
+
/**
|
|
3006
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3007
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3008
|
+
* to add features, then rerun Codama to update it.
|
|
3009
|
+
*
|
|
3010
|
+
* @see https://github.com/codama-idl/codama
|
|
3011
|
+
*/
|
|
3012
|
+
|
|
3013
|
+
type AccumulatorUpdated = {
|
|
3014
|
+
market: Address;
|
|
3015
|
+
newTotalPot: bigint;
|
|
3016
|
+
newAccQuotePerToken: bigint;
|
|
3017
|
+
};
|
|
3018
|
+
type AccumulatorUpdatedArgs = {
|
|
3019
|
+
market: Address;
|
|
3020
|
+
newTotalPot: number | bigint;
|
|
3021
|
+
newAccQuotePerToken: number | bigint;
|
|
3022
|
+
};
|
|
3023
|
+
declare function getAccumulatorUpdatedEncoder(): FixedSizeEncoder<AccumulatorUpdatedArgs>;
|
|
3024
|
+
declare function getAccumulatorUpdatedDecoder(): FixedSizeDecoder<AccumulatorUpdated>;
|
|
3025
|
+
declare function getAccumulatorUpdatedCodec(): FixedSizeCodec<AccumulatorUpdatedArgs, AccumulatorUpdated>;
|
|
3026
|
+
|
|
3027
|
+
/**
|
|
3028
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3029
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3030
|
+
* to add features, then rerun Codama to update it.
|
|
3031
|
+
*
|
|
3032
|
+
* @see https://github.com/codama-idl/codama
|
|
3033
|
+
*/
|
|
3034
|
+
|
|
3035
|
+
/** Variable-length calldata buffer. */
|
|
3036
|
+
type CalldataBuf = {
|
|
3037
|
+
len: number;
|
|
3038
|
+
bytes: ReadonlyUint8Array;
|
|
3039
|
+
};
|
|
3040
|
+
type CalldataBufArgs = CalldataBuf;
|
|
3041
|
+
declare function getCalldataBufEncoder(): FixedSizeEncoder<CalldataBufArgs>;
|
|
3042
|
+
declare function getCalldataBufDecoder(): FixedSizeDecoder<CalldataBuf>;
|
|
3043
|
+
declare function getCalldataBufCodec(): FixedSizeCodec<CalldataBufArgs, CalldataBuf>;
|
|
3044
|
+
|
|
3045
|
+
/**
|
|
3046
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3047
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3048
|
+
* to add features, then rerun Codama to update it.
|
|
3049
|
+
*
|
|
3050
|
+
* @see https://github.com/codama-idl/codama
|
|
3051
|
+
*/
|
|
3052
|
+
|
|
3053
|
+
type EntryMigrated = {
|
|
3054
|
+
market: Address;
|
|
3055
|
+
oracle: Address;
|
|
3056
|
+
entryId: ReadonlyUint8Array;
|
|
3057
|
+
baseMint: Address;
|
|
3058
|
+
contribution: bigint;
|
|
3059
|
+
isWinner: boolean;
|
|
3060
|
+
};
|
|
3061
|
+
type EntryMigratedArgs = {
|
|
3062
|
+
market: Address;
|
|
3063
|
+
oracle: Address;
|
|
3064
|
+
entryId: ReadonlyUint8Array;
|
|
3065
|
+
baseMint: Address;
|
|
3066
|
+
contribution: number | bigint;
|
|
3067
|
+
isWinner: boolean;
|
|
3068
|
+
};
|
|
3069
|
+
declare function getEntryMigratedEncoder(): FixedSizeEncoder<EntryMigratedArgs>;
|
|
3070
|
+
declare function getEntryMigratedDecoder(): FixedSizeDecoder<EntryMigrated>;
|
|
3071
|
+
declare function getEntryMigratedCodec(): FixedSizeCodec<EntryMigratedArgs, EntryMigrated>;
|
|
3072
|
+
|
|
3073
|
+
/**
|
|
3074
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3075
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3076
|
+
* to add features, then rerun Codama to update it.
|
|
3077
|
+
*
|
|
3078
|
+
* @see https://github.com/codama-idl/codama
|
|
3079
|
+
*/
|
|
3080
|
+
|
|
3081
|
+
type EntryRegistered = {
|
|
3082
|
+
market: Address;
|
|
3083
|
+
oracle: Address;
|
|
3084
|
+
entryId: ReadonlyUint8Array;
|
|
3085
|
+
baseMint: Address;
|
|
3086
|
+
};
|
|
3087
|
+
type EntryRegisteredArgs = EntryRegistered;
|
|
3088
|
+
declare function getEntryRegisteredEncoder(): FixedSizeEncoder<EntryRegisteredArgs>;
|
|
3089
|
+
declare function getEntryRegisteredDecoder(): FixedSizeDecoder<EntryRegistered>;
|
|
3090
|
+
declare function getEntryRegisteredCodec(): FixedSizeCodec<EntryRegisteredArgs, EntryRegistered>;
|
|
3091
|
+
|
|
3092
|
+
/**
|
|
3093
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3094
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3095
|
+
* to add features, then rerun Codama to update it.
|
|
3096
|
+
*
|
|
3097
|
+
* @see https://github.com/codama-idl/codama
|
|
3098
|
+
*/
|
|
3099
|
+
|
|
3100
|
+
type MarketCreated = {
|
|
3101
|
+
market: Address;
|
|
3102
|
+
oracle: Address;
|
|
3103
|
+
quoteMint: Address;
|
|
3104
|
+
};
|
|
3105
|
+
type MarketCreatedArgs = MarketCreated;
|
|
3106
|
+
declare function getMarketCreatedEncoder(): FixedSizeEncoder<MarketCreatedArgs>;
|
|
3107
|
+
declare function getMarketCreatedDecoder(): FixedSizeDecoder<MarketCreated>;
|
|
3108
|
+
declare function getMarketCreatedCodec(): FixedSizeCodec<MarketCreatedArgs, MarketCreated>;
|
|
3109
|
+
|
|
3110
|
+
/**
|
|
3111
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3112
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3113
|
+
* to add features, then rerun Codama to update it.
|
|
3114
|
+
*
|
|
3115
|
+
* @see https://github.com/codama-idl/codama
|
|
3116
|
+
*/
|
|
3117
|
+
|
|
3118
|
+
type MarketResolved = {
|
|
3119
|
+
market: Address;
|
|
3120
|
+
oracle: Address;
|
|
3121
|
+
winnerMint: Address;
|
|
3122
|
+
claimableSupply: bigint;
|
|
3123
|
+
totalPot: bigint;
|
|
3124
|
+
};
|
|
3125
|
+
type MarketResolvedArgs = {
|
|
3126
|
+
market: Address;
|
|
3127
|
+
oracle: Address;
|
|
3128
|
+
winnerMint: Address;
|
|
3129
|
+
claimableSupply: number | bigint;
|
|
3130
|
+
totalPot: number | bigint;
|
|
3131
|
+
};
|
|
3132
|
+
declare function getMarketResolvedEncoder(): FixedSizeEncoder<MarketResolvedArgs>;
|
|
3133
|
+
declare function getMarketResolvedDecoder(): FixedSizeDecoder<MarketResolved>;
|
|
3134
|
+
declare function getMarketResolvedCodec(): FixedSizeCodec<MarketResolvedArgs, MarketResolved>;
|
|
3135
|
+
|
|
3136
|
+
/**
|
|
3137
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3138
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3139
|
+
* to add features, then rerun Codama to update it.
|
|
3140
|
+
*
|
|
3141
|
+
* @see https://github.com/codama-idl/codama
|
|
3142
|
+
*/
|
|
3143
|
+
|
|
3144
|
+
/**
|
|
3145
|
+
* Arguments for migrate_entry instruction.
|
|
3146
|
+
* This is decoded from migrator_migrate_calldata passed by initializer.
|
|
3147
|
+
*/
|
|
3148
|
+
type MigrateEntryArgs = {
|
|
3149
|
+
entryId: ReadonlyUint8Array;
|
|
3150
|
+
};
|
|
3151
|
+
type MigrateEntryArgsArgs = MigrateEntryArgs;
|
|
3152
|
+
declare function getMigrateEntryArgsEncoder(): FixedSizeEncoder<MigrateEntryArgsArgs>;
|
|
3153
|
+
declare function getMigrateEntryArgsDecoder(): FixedSizeDecoder<MigrateEntryArgs>;
|
|
3154
|
+
declare function getMigrateEntryArgsCodec(): FixedSizeCodec<MigrateEntryArgsArgs, MigrateEntryArgs>;
|
|
3155
|
+
|
|
3156
|
+
/**
|
|
3157
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3158
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3159
|
+
* to add features, then rerun Codama to update it.
|
|
3160
|
+
*
|
|
3161
|
+
* @see https://github.com/codama-idl/codama
|
|
3162
|
+
*/
|
|
3163
|
+
|
|
3164
|
+
type PreviewPayoutIfWinnerArgs = {
|
|
3165
|
+
candidateWinnerMint: Address;
|
|
3166
|
+
tokenAmount: bigint;
|
|
3167
|
+
};
|
|
3168
|
+
type PreviewPayoutIfWinnerArgsArgs = {
|
|
3169
|
+
candidateWinnerMint: Address;
|
|
3170
|
+
tokenAmount: number | bigint;
|
|
3171
|
+
};
|
|
3172
|
+
declare function getPreviewPayoutIfWinnerArgsEncoder(): FixedSizeEncoder<PreviewPayoutIfWinnerArgsArgs>;
|
|
3173
|
+
declare function getPreviewPayoutIfWinnerArgsDecoder(): FixedSizeDecoder<PreviewPayoutIfWinnerArgs>;
|
|
3174
|
+
declare function getPreviewPayoutIfWinnerArgsCodec(): FixedSizeCodec<PreviewPayoutIfWinnerArgsArgs, PreviewPayoutIfWinnerArgs>;
|
|
3175
|
+
|
|
3176
|
+
/**
|
|
3177
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3178
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3179
|
+
* to add features, then rerun Codama to update it.
|
|
3180
|
+
*
|
|
3181
|
+
* @see https://github.com/codama-idl/codama
|
|
3182
|
+
*/
|
|
3183
|
+
|
|
3184
|
+
/**
|
|
3185
|
+
* Arguments for register_entry instruction.
|
|
3186
|
+
* This is decoded from migrator_init_calldata passed by initializer.
|
|
3187
|
+
*/
|
|
3188
|
+
type RegisterEntryArgs = {
|
|
3189
|
+
entryId: ReadonlyUint8Array;
|
|
3190
|
+
};
|
|
3191
|
+
type RegisterEntryArgsArgs = RegisterEntryArgs;
|
|
3192
|
+
declare function getRegisterEntryArgsEncoder(): FixedSizeEncoder<RegisterEntryArgsArgs>;
|
|
3193
|
+
declare function getRegisterEntryArgsDecoder(): FixedSizeDecoder<RegisterEntryArgs>;
|
|
3194
|
+
declare function getRegisterEntryArgsCodec(): FixedSizeCodec<RegisterEntryArgsArgs, RegisterEntryArgs>;
|
|
3195
|
+
|
|
3196
|
+
/**
|
|
3197
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3198
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3199
|
+
* to add features, then rerun Codama to update it.
|
|
3200
|
+
*
|
|
3201
|
+
* @see https://github.com/codama-idl/codama
|
|
3202
|
+
*/
|
|
3203
|
+
|
|
3204
|
+
type RewardsClaimed = {
|
|
3205
|
+
market: Address;
|
|
3206
|
+
claimer: Address;
|
|
3207
|
+
burnedAmount: bigint;
|
|
3208
|
+
rewardAmount: bigint;
|
|
3209
|
+
totalBurned: bigint;
|
|
3210
|
+
};
|
|
3211
|
+
type RewardsClaimedArgs = {
|
|
3212
|
+
market: Address;
|
|
3213
|
+
claimer: Address;
|
|
3214
|
+
burnedAmount: number | bigint;
|
|
3215
|
+
rewardAmount: number | bigint;
|
|
3216
|
+
totalBurned: number | bigint;
|
|
3217
|
+
};
|
|
3218
|
+
declare function getRewardsClaimedEncoder(): FixedSizeEncoder<RewardsClaimedArgs>;
|
|
3219
|
+
declare function getRewardsClaimedDecoder(): FixedSizeDecoder<RewardsClaimed>;
|
|
3220
|
+
declare function getRewardsClaimedCodec(): FixedSizeCodec<RewardsClaimedArgs, RewardsClaimed>;
|
|
3221
|
+
|
|
3222
|
+
/**
|
|
3223
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3224
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3225
|
+
* to add features, then rerun Codama to update it.
|
|
3226
|
+
*
|
|
3227
|
+
* @see https://github.com/codama-idl/codama
|
|
3228
|
+
*/
|
|
3229
|
+
|
|
3230
|
+
declare const LAUNCH_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3231
|
+
declare function getLaunchDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3232
|
+
type Launch = {
|
|
3233
|
+
discriminator: ReadonlyUint8Array;
|
|
3234
|
+
authority: Address;
|
|
3235
|
+
namespace: Address;
|
|
3236
|
+
launchId: ReadonlyUint8Array;
|
|
3237
|
+
phase: number;
|
|
3238
|
+
bump: number;
|
|
3239
|
+
launchAuthorityBump: number;
|
|
3240
|
+
pad0: ReadonlyUint8Array;
|
|
3241
|
+
baseMint: Address;
|
|
3242
|
+
quoteMint: Address;
|
|
3243
|
+
baseVault: Address;
|
|
3244
|
+
quoteVault: Address;
|
|
3245
|
+
baseTotalSupply: bigint;
|
|
3246
|
+
baseForDistribution: bigint;
|
|
3247
|
+
baseForLiquidity: bigint;
|
|
3248
|
+
baseForCurve: bigint;
|
|
3249
|
+
curveVirtualBase: bigint;
|
|
3250
|
+
curveVirtualQuote: bigint;
|
|
3251
|
+
curveFeeBps: number;
|
|
3252
|
+
pad1: ReadonlyUint8Array;
|
|
3253
|
+
allowBuy: number;
|
|
3254
|
+
allowSell: number;
|
|
3255
|
+
pad2: ReadonlyUint8Array;
|
|
3256
|
+
sentinelProgram: Address;
|
|
3257
|
+
sentinelFlags: number;
|
|
3258
|
+
pad3: ReadonlyUint8Array;
|
|
3259
|
+
sentinelCalldata: CalldataBuf;
|
|
3260
|
+
migratorProgram: Address;
|
|
3261
|
+
migratorInitCalldata: CalldataBuf;
|
|
3262
|
+
migratorMigrateCalldata: CalldataBuf;
|
|
3263
|
+
reserved: ReadonlyUint8Array;
|
|
3264
|
+
};
|
|
3265
|
+
type LaunchArgs = {
|
|
3266
|
+
authority: Address;
|
|
3267
|
+
namespace: Address;
|
|
3268
|
+
launchId: ReadonlyUint8Array;
|
|
3269
|
+
phase: number;
|
|
3270
|
+
bump: number;
|
|
3271
|
+
launchAuthorityBump: number;
|
|
3272
|
+
pad0: ReadonlyUint8Array;
|
|
3273
|
+
baseMint: Address;
|
|
3274
|
+
quoteMint: Address;
|
|
3275
|
+
baseVault: Address;
|
|
3276
|
+
quoteVault: Address;
|
|
3277
|
+
baseTotalSupply: number | bigint;
|
|
3278
|
+
baseForDistribution: number | bigint;
|
|
3279
|
+
baseForLiquidity: number | bigint;
|
|
3280
|
+
baseForCurve: number | bigint;
|
|
3281
|
+
curveVirtualBase: number | bigint;
|
|
3282
|
+
curveVirtualQuote: number | bigint;
|
|
3283
|
+
curveFeeBps: number;
|
|
3284
|
+
pad1: ReadonlyUint8Array;
|
|
3285
|
+
allowBuy: number;
|
|
3286
|
+
allowSell: number;
|
|
3287
|
+
pad2: ReadonlyUint8Array;
|
|
3288
|
+
sentinelProgram: Address;
|
|
3289
|
+
sentinelFlags: number;
|
|
3290
|
+
pad3: ReadonlyUint8Array;
|
|
3291
|
+
sentinelCalldata: CalldataBufArgs;
|
|
3292
|
+
migratorProgram: Address;
|
|
3293
|
+
migratorInitCalldata: CalldataBufArgs;
|
|
3294
|
+
migratorMigrateCalldata: CalldataBufArgs;
|
|
3295
|
+
reserved: ReadonlyUint8Array;
|
|
3296
|
+
};
|
|
3297
|
+
/** Gets the encoder for {@link LaunchArgs} account data. */
|
|
3298
|
+
declare function getLaunchEncoder(): FixedSizeEncoder<LaunchArgs>;
|
|
3299
|
+
/** Gets the decoder for {@link Launch} account data. */
|
|
3300
|
+
declare function getLaunchDecoder(): FixedSizeDecoder<Launch>;
|
|
3301
|
+
/** Gets the codec for {@link Launch} account data. */
|
|
3302
|
+
declare function getLaunchCodec(): FixedSizeCodec<LaunchArgs, Launch>;
|
|
3303
|
+
declare function decodeLaunch<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Launch, TAddress>;
|
|
3304
|
+
declare function decodeLaunch<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Launch, TAddress>;
|
|
3305
|
+
declare function fetchLaunch<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Launch, TAddress>>;
|
|
3306
|
+
declare function fetchMaybeLaunch<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Launch, TAddress>>;
|
|
3307
|
+
declare function fetchAllLaunch(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Launch>[]>;
|
|
3308
|
+
declare function fetchAllMaybeLaunch(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Launch>[]>;
|
|
3309
|
+
declare function getLaunchSize(): number;
|
|
3310
|
+
|
|
3311
|
+
/**
|
|
3312
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3313
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3314
|
+
* to add features, then rerun Codama to update it.
|
|
3315
|
+
*
|
|
3316
|
+
* @see https://github.com/codama-idl/codama
|
|
3317
|
+
*/
|
|
3318
|
+
|
|
3319
|
+
declare const MARKET_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3320
|
+
declare function getMarketDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3321
|
+
type Market = {
|
|
3322
|
+
discriminator: ReadonlyUint8Array;
|
|
3323
|
+
/** The oracle that determines the winner */
|
|
3324
|
+
oracle: Address;
|
|
3325
|
+
/** Quote mint for this market (e.g., USDC) */
|
|
3326
|
+
quoteMint: Address;
|
|
3327
|
+
/** The pot vault holding quote tokens */
|
|
3328
|
+
potVault: Address;
|
|
3329
|
+
/** Total quote migrated into pot (cumulative) */
|
|
3330
|
+
totalPot: bigint;
|
|
3331
|
+
/** Total quote claimed/paid out (cumulative) */
|
|
3332
|
+
totalClaimed: bigint;
|
|
3333
|
+
/** Winner mint (set when market resolves) */
|
|
3334
|
+
winnerMint: Address;
|
|
3335
|
+
/** Claimable supply of winner token (fixed after winning entry migrates) */
|
|
3336
|
+
claimableSupply: bigint;
|
|
3337
|
+
/**
|
|
3338
|
+
* Scaled accumulator: total_pot * ACC_SCALE / claimable_supply
|
|
3339
|
+
* This tracks quote per token and increases as losing entries migrate
|
|
3340
|
+
*/
|
|
3341
|
+
accQuotePerToken: bigint;
|
|
3342
|
+
/** Whether the market has been resolved (winner determined) */
|
|
3343
|
+
isResolved: boolean;
|
|
3344
|
+
/** Bump seed for this PDA */
|
|
3345
|
+
bump: number;
|
|
3346
|
+
/** Bump seed for market authority PDA */
|
|
3347
|
+
marketAuthorityBump: number;
|
|
3348
|
+
/** Reserved for future use */
|
|
3349
|
+
reserved: ReadonlyUint8Array;
|
|
3350
|
+
};
|
|
3351
|
+
type MarketArgs = {
|
|
3352
|
+
/** The oracle that determines the winner */
|
|
3353
|
+
oracle: Address;
|
|
3354
|
+
/** Quote mint for this market (e.g., USDC) */
|
|
3355
|
+
quoteMint: Address;
|
|
3356
|
+
/** The pot vault holding quote tokens */
|
|
3357
|
+
potVault: Address;
|
|
3358
|
+
/** Total quote migrated into pot (cumulative) */
|
|
3359
|
+
totalPot: number | bigint;
|
|
3360
|
+
/** Total quote claimed/paid out (cumulative) */
|
|
3361
|
+
totalClaimed: number | bigint;
|
|
3362
|
+
/** Winner mint (set when market resolves) */
|
|
3363
|
+
winnerMint: Address;
|
|
3364
|
+
/** Claimable supply of winner token (fixed after winning entry migrates) */
|
|
3365
|
+
claimableSupply: number | bigint;
|
|
3366
|
+
/**
|
|
3367
|
+
* Scaled accumulator: total_pot * ACC_SCALE / claimable_supply
|
|
3368
|
+
* This tracks quote per token and increases as losing entries migrate
|
|
3369
|
+
*/
|
|
3370
|
+
accQuotePerToken: number | bigint;
|
|
3371
|
+
/** Whether the market has been resolved (winner determined) */
|
|
3372
|
+
isResolved: boolean;
|
|
3373
|
+
/** Bump seed for this PDA */
|
|
3374
|
+
bump: number;
|
|
3375
|
+
/** Bump seed for market authority PDA */
|
|
3376
|
+
marketAuthorityBump: number;
|
|
3377
|
+
/** Reserved for future use */
|
|
3378
|
+
reserved: ReadonlyUint8Array;
|
|
3379
|
+
};
|
|
3380
|
+
/** Gets the encoder for {@link MarketArgs} account data. */
|
|
3381
|
+
declare function getMarketEncoder(): FixedSizeEncoder<MarketArgs>;
|
|
3382
|
+
/** Gets the decoder for {@link Market} account data. */
|
|
3383
|
+
declare function getMarketDecoder(): FixedSizeDecoder<Market>;
|
|
3384
|
+
/** Gets the codec for {@link Market} account data. */
|
|
3385
|
+
declare function getMarketCodec(): FixedSizeCodec<MarketArgs, Market>;
|
|
3386
|
+
declare function decodeMarket<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Market, TAddress>;
|
|
3387
|
+
declare function decodeMarket<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Market, TAddress>;
|
|
3388
|
+
declare function fetchMarket<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Market, TAddress>>;
|
|
3389
|
+
declare function fetchMaybeMarket<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Market, TAddress>>;
|
|
3390
|
+
declare function fetchAllMarket(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Market>[]>;
|
|
3391
|
+
declare function fetchAllMaybeMarket(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Market>[]>;
|
|
3392
|
+
declare function getMarketSize(): number;
|
|
3393
|
+
|
|
3394
|
+
/**
|
|
3395
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3396
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3397
|
+
* to add features, then rerun Codama to update it.
|
|
3398
|
+
*
|
|
3399
|
+
* @see https://github.com/codama-idl/codama
|
|
3400
|
+
*/
|
|
3401
|
+
|
|
3402
|
+
declare const ORACLE_STATE_DISCRIMINATOR$1: Uint8Array<ArrayBuffer>;
|
|
3403
|
+
declare function getOracleStateDiscriminatorBytes$1(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3404
|
+
type OracleState$1 = {
|
|
3405
|
+
discriminator: ReadonlyUint8Array;
|
|
3406
|
+
/** The authority that can finalize this oracle. */
|
|
3407
|
+
oracleAuthority: Address;
|
|
3408
|
+
/** Optional quote mint for validation (Pubkey::default() if not used). */
|
|
3409
|
+
quoteMint: Address;
|
|
3410
|
+
/** Whether the oracle has been finalized with a winner. */
|
|
3411
|
+
isFinalized: boolean;
|
|
3412
|
+
/** The winning mint (only valid if is_finalized == true). */
|
|
3413
|
+
winningMint: Address;
|
|
3414
|
+
/** Nonce used in PDA derivation. */
|
|
3415
|
+
nonce: bigint;
|
|
3416
|
+
/** PDA bump seed. */
|
|
3417
|
+
bump: number;
|
|
3418
|
+
/** Reserved for future use. */
|
|
3419
|
+
reserved: ReadonlyUint8Array;
|
|
3420
|
+
};
|
|
3421
|
+
type OracleStateArgs$1 = {
|
|
3422
|
+
/** The authority that can finalize this oracle. */
|
|
3423
|
+
oracleAuthority: Address;
|
|
3424
|
+
/** Optional quote mint for validation (Pubkey::default() if not used). */
|
|
3425
|
+
quoteMint: Address;
|
|
3426
|
+
/** Whether the oracle has been finalized with a winner. */
|
|
3427
|
+
isFinalized: boolean;
|
|
3428
|
+
/** The winning mint (only valid if is_finalized == true). */
|
|
3429
|
+
winningMint: Address;
|
|
3430
|
+
/** Nonce used in PDA derivation. */
|
|
3431
|
+
nonce: number | bigint;
|
|
3432
|
+
/** PDA bump seed. */
|
|
3433
|
+
bump: number;
|
|
3434
|
+
/** Reserved for future use. */
|
|
3435
|
+
reserved: ReadonlyUint8Array;
|
|
3436
|
+
};
|
|
3437
|
+
/** Gets the encoder for {@link OracleStateArgs} account data. */
|
|
3438
|
+
declare function getOracleStateEncoder$1(): FixedSizeEncoder<OracleStateArgs$1>;
|
|
3439
|
+
/** Gets the decoder for {@link OracleState} account data. */
|
|
3440
|
+
declare function getOracleStateDecoder$1(): FixedSizeDecoder<OracleState$1>;
|
|
3441
|
+
/** Gets the codec for {@link OracleState} account data. */
|
|
3442
|
+
declare function getOracleStateCodec$1(): FixedSizeCodec<OracleStateArgs$1, OracleState$1>;
|
|
3443
|
+
declare function decodeOracleState$1<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<OracleState$1, TAddress>;
|
|
3444
|
+
declare function decodeOracleState$1<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<OracleState$1, TAddress>;
|
|
3445
|
+
declare function fetchOracleState$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<OracleState$1, TAddress>>;
|
|
3446
|
+
declare function fetchMaybeOracleState$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<OracleState$1, TAddress>>;
|
|
3447
|
+
declare function fetchAllOracleState$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<OracleState$1>[]>;
|
|
3448
|
+
declare function fetchAllMaybeOracleState$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<OracleState$1>[]>;
|
|
3449
|
+
declare function getOracleStateSize$1(): number;
|
|
3450
|
+
|
|
3451
|
+
/**
|
|
3452
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3453
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3454
|
+
* to add features, then rerun Codama to update it.
|
|
3455
|
+
*
|
|
3456
|
+
* @see https://github.com/codama-idl/codama
|
|
3457
|
+
*/
|
|
3458
|
+
|
|
3459
|
+
/** Unauthorized: Unauthorized */
|
|
3460
|
+
declare const PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED = 6000;
|
|
3461
|
+
/** QuoteMintMismatch: Quote mint mismatch */
|
|
3462
|
+
declare const PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH = 6001;
|
|
3463
|
+
/** EntryAlreadyRegistered: Entry already registered */
|
|
3464
|
+
declare const PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED = 6002;
|
|
3465
|
+
/** EntryNotRegistered: Entry not registered */
|
|
3466
|
+
declare const PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED = 6003;
|
|
3467
|
+
/** EntryAlreadyMigrated: Entry already migrated */
|
|
3468
|
+
declare const PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED = 6004;
|
|
3469
|
+
/** EntryNotMigrated: Entry not migrated */
|
|
3470
|
+
declare const PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED = 6005;
|
|
3471
|
+
/** OracleNotFinalized: Oracle not finalized */
|
|
3472
|
+
declare const PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED = 6006;
|
|
3473
|
+
/** MarketNotResolved: Market not resolved */
|
|
3474
|
+
declare const PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED = 6007;
|
|
3475
|
+
/** InvalidWinnerMint: Invalid winner mint */
|
|
3476
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT = 6008;
|
|
3477
|
+
/** InsufficientBalance: Insufficient balance */
|
|
3478
|
+
declare const PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE = 6009;
|
|
3479
|
+
/** MathOverflow: Math overflow */
|
|
3480
|
+
declare const PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW = 6010;
|
|
3481
|
+
/** InvalidEntryId: Invalid entry ID */
|
|
3482
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID = 6011;
|
|
3483
|
+
/** InvalidMarket: Invalid market */
|
|
3484
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_MARKET = 6012;
|
|
3485
|
+
/** InvalidVault: Invalid vault */
|
|
3486
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_VAULT = 6013;
|
|
3487
|
+
/** InvalidMint: Invalid mint */
|
|
3488
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_MINT = 6014;
|
|
3489
|
+
/** WinningEntryNotMigrated: Winning entry not migrated */
|
|
3490
|
+
declare const PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED = 6015;
|
|
3491
|
+
/** NoPendingRewards: No pending rewards */
|
|
3492
|
+
declare const PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS = 6016;
|
|
3493
|
+
/** InvalidOracle: Invalid oracle */
|
|
3494
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE = 6017;
|
|
3495
|
+
/** ZeroClaimableSupply: Zero claimable supply */
|
|
3496
|
+
declare const PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY = 6018;
|
|
3497
|
+
/** InvalidInput: Invalid input */
|
|
3498
|
+
declare const PREDICTION_MIGRATOR_ERROR__INVALID_INPUT = 6019;
|
|
3499
|
+
type PredictionMigratorError = typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED | typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED | typeof PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE | typeof PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID | typeof PREDICTION_MIGRATOR_ERROR__INVALID_INPUT | typeof PREDICTION_MIGRATOR_ERROR__INVALID_MARKET | typeof PREDICTION_MIGRATOR_ERROR__INVALID_MINT | typeof PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE | typeof PREDICTION_MIGRATOR_ERROR__INVALID_VAULT | typeof PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT | typeof PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED | typeof PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW | typeof PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS | typeof PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED | typeof PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH | typeof PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED | typeof PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED | typeof PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY;
|
|
3500
|
+
declare function getPredictionMigratorErrorMessage(code: PredictionMigratorError): string;
|
|
3501
|
+
declare function isPredictionMigratorError<TProgramErrorCode extends PredictionMigratorError>(error: unknown, transactionMessage: {
|
|
3502
|
+
instructions: Record<number, {
|
|
3503
|
+
programAddress: Address;
|
|
3504
|
+
}>;
|
|
3505
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
3506
|
+
context: Readonly<{
|
|
3507
|
+
code: TProgramErrorCode;
|
|
3508
|
+
}>;
|
|
3509
|
+
}>;
|
|
3510
|
+
|
|
3511
|
+
/**
|
|
3512
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3513
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3514
|
+
* to add features, then rerun Codama to update it.
|
|
3515
|
+
*
|
|
3516
|
+
* @see https://github.com/codama-idl/codama
|
|
3517
|
+
*/
|
|
3518
|
+
|
|
3519
|
+
declare const PREDICTION_MIGRATOR_PROGRAM_ADDRESS: Address<"HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ">;
|
|
3520
|
+
declare enum PredictionMigratorAccount {
|
|
3521
|
+
ClaimReceipt = 0,
|
|
3522
|
+
Entry = 1,
|
|
3523
|
+
EntryByMint = 2,
|
|
3524
|
+
Launch = 3,
|
|
3525
|
+
Market = 4,
|
|
3526
|
+
OracleState = 5
|
|
3527
|
+
}
|
|
3528
|
+
declare function identifyPredictionMigratorAccount(account: {
|
|
3529
|
+
data: ReadonlyUint8Array;
|
|
3530
|
+
} | ReadonlyUint8Array): PredictionMigratorAccount;
|
|
3531
|
+
declare enum PredictionMigratorInstruction {
|
|
3532
|
+
Claim = 0,
|
|
3533
|
+
MigrateEntry = 1,
|
|
3534
|
+
PreviewPayoutIfWinner = 2,
|
|
3535
|
+
RegisterEntry = 3
|
|
3536
|
+
}
|
|
3537
|
+
declare function identifyPredictionMigratorInstruction(instruction: {
|
|
3538
|
+
data: ReadonlyUint8Array;
|
|
3539
|
+
} | ReadonlyUint8Array): PredictionMigratorInstruction;
|
|
3540
|
+
type ParsedPredictionMigratorInstruction<TProgram extends string = 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ'> = ({
|
|
3541
|
+
instructionType: PredictionMigratorInstruction.Claim;
|
|
3542
|
+
} & ParsedClaimInstruction<TProgram>) | ({
|
|
3543
|
+
instructionType: PredictionMigratorInstruction.MigrateEntry;
|
|
3544
|
+
} & ParsedMigrateEntryInstruction<TProgram>) | ({
|
|
3545
|
+
instructionType: PredictionMigratorInstruction.PreviewPayoutIfWinner;
|
|
3546
|
+
} & ParsedPreviewPayoutIfWinnerInstruction<TProgram>) | ({
|
|
3547
|
+
instructionType: PredictionMigratorInstruction.RegisterEntry;
|
|
3548
|
+
} & ParsedRegisterEntryInstruction<TProgram>);
|
|
3549
|
+
declare function parsePredictionMigratorInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedPredictionMigratorInstruction<TProgram>;
|
|
3550
|
+
type PredictionMigratorPlugin = {
|
|
3551
|
+
accounts: PredictionMigratorPluginAccounts;
|
|
3552
|
+
instructions: PredictionMigratorPluginInstructions;
|
|
3553
|
+
};
|
|
3554
|
+
type PredictionMigratorPluginAccounts = {
|
|
3555
|
+
claimReceipt: ReturnType<typeof getClaimReceiptCodec> & SelfFetchFunctions<ClaimReceiptArgs, ClaimReceipt>;
|
|
3556
|
+
entry: ReturnType<typeof getEntryCodec> & SelfFetchFunctions<EntryArgs, Entry>;
|
|
3557
|
+
entryByMint: ReturnType<typeof getEntryByMintCodec> & SelfFetchFunctions<EntryByMintArgs, EntryByMint>;
|
|
3558
|
+
launch: ReturnType<typeof getLaunchCodec> & SelfFetchFunctions<LaunchArgs, Launch>;
|
|
3559
|
+
market: ReturnType<typeof getMarketCodec> & SelfFetchFunctions<MarketArgs, Market>;
|
|
3560
|
+
oracleState: ReturnType<typeof getOracleStateCodec$1> & SelfFetchFunctions<OracleStateArgs$1, OracleState$1>;
|
|
3561
|
+
};
|
|
3562
|
+
type PredictionMigratorPluginInstructions = {
|
|
3563
|
+
claim: (input: MakeOptional<ClaimAsyncInput, 'payer'>) => ReturnType<typeof getClaimInstructionAsync> & SelfPlanAndSendFunctions;
|
|
3564
|
+
migrateEntry: (input: MakeOptional<MigrateEntryAsyncInput, 'payer'>) => ReturnType<typeof getMigrateEntryInstructionAsync> & SelfPlanAndSendFunctions;
|
|
3565
|
+
previewPayoutIfWinner: (input: PreviewPayoutIfWinnerInput) => ReturnType<typeof getPreviewPayoutIfWinnerInstruction> & SelfPlanAndSendFunctions;
|
|
3566
|
+
registerEntry: (input: MakeOptional<RegisterEntryAsyncInput, 'payer'>) => ReturnType<typeof getRegisterEntryInstructionAsync> & SelfPlanAndSendFunctions;
|
|
3567
|
+
};
|
|
3568
|
+
type PredictionMigratorPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithPayer & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
3569
|
+
declare function predictionMigratorProgram(): <T extends PredictionMigratorPluginRequirements>(client: T) => T & {
|
|
3570
|
+
predictionMigrator: PredictionMigratorPlugin;
|
|
3571
|
+
};
|
|
3572
|
+
type MakeOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3576
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3577
|
+
* to add features, then rerun Codama to update it.
|
|
3578
|
+
*
|
|
3579
|
+
* @see https://github.com/codama-idl/codama
|
|
3580
|
+
*/
|
|
3581
|
+
|
|
3582
|
+
declare const CLAIM_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3583
|
+
declare function getClaimDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3584
|
+
type ClaimInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMarket extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountWinnerMint extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TAccountClaimerWinnerAta extends string | AccountMeta<string> = string, TAccountClaimerQuoteAta extends string | AccountMeta<string> = string, TAccountClaimer extends string | AccountMeta<string> = string, TAccountReceipt extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
3585
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
3586
|
+
TAccountMarketAuthority extends string ? ReadonlyAccount<TAccountMarketAuthority> : TAccountMarketAuthority,
|
|
3587
|
+
TAccountPotVault extends string ? WritableAccount<TAccountPotVault> : TAccountPotVault,
|
|
3588
|
+
TAccountWinnerMint extends string ? WritableAccount<TAccountWinnerMint> : TAccountWinnerMint,
|
|
3589
|
+
TAccountEntryByMint extends string ? ReadonlyAccount<TAccountEntryByMint> : TAccountEntryByMint,
|
|
3590
|
+
TAccountClaimerWinnerAta extends string ? WritableAccount<TAccountClaimerWinnerAta> : TAccountClaimerWinnerAta,
|
|
3591
|
+
TAccountClaimerQuoteAta extends string ? WritableAccount<TAccountClaimerQuoteAta> : TAccountClaimerQuoteAta,
|
|
3592
|
+
TAccountClaimer extends string ? ReadonlySignerAccount<TAccountClaimer> & AccountSignerMeta<TAccountClaimer> : TAccountClaimer,
|
|
3593
|
+
TAccountReceipt extends string ? WritableAccount<TAccountReceipt> : TAccountReceipt,
|
|
3594
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
3595
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
3596
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
3597
|
+
...TRemainingAccounts
|
|
3598
|
+
]>;
|
|
3599
|
+
type ClaimInstructionData = {
|
|
3600
|
+
discriminator: ReadonlyUint8Array;
|
|
3601
|
+
burnAmount: bigint;
|
|
3602
|
+
};
|
|
3603
|
+
type ClaimInstructionDataArgs = {
|
|
3604
|
+
burnAmount: number | bigint;
|
|
3605
|
+
};
|
|
3606
|
+
declare function getClaimInstructionDataEncoder(): FixedSizeEncoder<ClaimInstructionDataArgs>;
|
|
3607
|
+
declare function getClaimInstructionDataDecoder(): FixedSizeDecoder<ClaimInstructionData>;
|
|
3608
|
+
declare function getClaimInstructionDataCodec(): FixedSizeCodec<ClaimInstructionDataArgs, ClaimInstructionData>;
|
|
3609
|
+
type ClaimAsyncInput<TAccountMarket extends string = string, TAccountMarketAuthority extends string = string, TAccountPotVault extends string = string, TAccountWinnerMint extends string = string, TAccountEntryByMint extends string = string, TAccountClaimerWinnerAta extends string = string, TAccountClaimerQuoteAta extends string = string, TAccountClaimer extends string = string, TAccountReceipt extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
3610
|
+
/** Market PDA */
|
|
3611
|
+
market: Address<TAccountMarket>;
|
|
3612
|
+
marketAuthority?: Address<TAccountMarketAuthority>;
|
|
3613
|
+
/** Pot vault holding quote tokens */
|
|
3614
|
+
potVault: Address<TAccountPotVault>;
|
|
3615
|
+
/** Winner mint (must match market.winner_mint) */
|
|
3616
|
+
winnerMint: Address<TAccountWinnerMint>;
|
|
3617
|
+
/** EntryByMint for validation that this mint belongs to this market */
|
|
3618
|
+
entryByMint: Address<TAccountEntryByMint>;
|
|
3619
|
+
/** Claimer's winner token account (source for burn) */
|
|
3620
|
+
claimerWinnerAta: Address<TAccountClaimerWinnerAta>;
|
|
3621
|
+
/** Claimer's quote token account (destination for rewards) */
|
|
3622
|
+
claimerQuoteAta: Address<TAccountClaimerQuoteAta>;
|
|
3623
|
+
/** Claimer wallet (signer) */
|
|
3624
|
+
claimer: TransactionSigner<TAccountClaimer>;
|
|
3625
|
+
/** Claim receipt PDA (created if first claim) */
|
|
3626
|
+
receipt?: Address<TAccountReceipt>;
|
|
3627
|
+
/** Payer for receipt creation (can be same as claimer) */
|
|
3628
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3629
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3630
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3631
|
+
burnAmount: ClaimInstructionDataArgs['burnAmount'];
|
|
3632
|
+
};
|
|
3633
|
+
declare function getClaimInstructionAsync<TAccountMarket extends string, TAccountMarketAuthority extends string, TAccountPotVault extends string, TAccountWinnerMint extends string, TAccountEntryByMint extends string, TAccountClaimerWinnerAta extends string, TAccountClaimerQuoteAta extends string, TAccountClaimer extends string, TAccountReceipt extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: ClaimAsyncInput<TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>, config?: {
|
|
3634
|
+
programAddress?: TProgramAddress;
|
|
3635
|
+
}): Promise<ClaimInstruction<TProgramAddress, TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>>;
|
|
3636
|
+
type ClaimInput<TAccountMarket extends string = string, TAccountMarketAuthority extends string = string, TAccountPotVault extends string = string, TAccountWinnerMint extends string = string, TAccountEntryByMint extends string = string, TAccountClaimerWinnerAta extends string = string, TAccountClaimerQuoteAta extends string = string, TAccountClaimer extends string = string, TAccountReceipt extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = {
|
|
3637
|
+
/** Market PDA */
|
|
3638
|
+
market: Address<TAccountMarket>;
|
|
3639
|
+
marketAuthority: Address<TAccountMarketAuthority>;
|
|
3640
|
+
/** Pot vault holding quote tokens */
|
|
3641
|
+
potVault: Address<TAccountPotVault>;
|
|
3642
|
+
/** Winner mint (must match market.winner_mint) */
|
|
3643
|
+
winnerMint: Address<TAccountWinnerMint>;
|
|
3644
|
+
/** EntryByMint for validation that this mint belongs to this market */
|
|
3645
|
+
entryByMint: Address<TAccountEntryByMint>;
|
|
3646
|
+
/** Claimer's winner token account (source for burn) */
|
|
3647
|
+
claimerWinnerAta: Address<TAccountClaimerWinnerAta>;
|
|
3648
|
+
/** Claimer's quote token account (destination for rewards) */
|
|
3649
|
+
claimerQuoteAta: Address<TAccountClaimerQuoteAta>;
|
|
3650
|
+
/** Claimer wallet (signer) */
|
|
3651
|
+
claimer: TransactionSigner<TAccountClaimer>;
|
|
3652
|
+
/** Claim receipt PDA (created if first claim) */
|
|
3653
|
+
receipt: Address<TAccountReceipt>;
|
|
3654
|
+
/** Payer for receipt creation (can be same as claimer) */
|
|
3655
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3656
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3657
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3658
|
+
burnAmount: ClaimInstructionDataArgs['burnAmount'];
|
|
3659
|
+
};
|
|
3660
|
+
declare function getClaimInstruction<TAccountMarket extends string, TAccountMarketAuthority extends string, TAccountPotVault extends string, TAccountWinnerMint extends string, TAccountEntryByMint extends string, TAccountClaimerWinnerAta extends string, TAccountClaimerQuoteAta extends string, TAccountClaimer extends string, TAccountReceipt extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: ClaimInput<TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>, config?: {
|
|
3661
|
+
programAddress?: TProgramAddress;
|
|
3662
|
+
}): ClaimInstruction<TProgramAddress, TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>;
|
|
3663
|
+
type ParsedClaimInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
3664
|
+
programAddress: Address<TProgram>;
|
|
3665
|
+
accounts: {
|
|
3666
|
+
/** Market PDA */
|
|
3667
|
+
market: TAccountMetas[0];
|
|
3668
|
+
marketAuthority: TAccountMetas[1];
|
|
3669
|
+
/** Pot vault holding quote tokens */
|
|
3670
|
+
potVault: TAccountMetas[2];
|
|
3671
|
+
/** Winner mint (must match market.winner_mint) */
|
|
3672
|
+
winnerMint: TAccountMetas[3];
|
|
3673
|
+
/** EntryByMint for validation that this mint belongs to this market */
|
|
3674
|
+
entryByMint: TAccountMetas[4];
|
|
3675
|
+
/** Claimer's winner token account (source for burn) */
|
|
3676
|
+
claimerWinnerAta: TAccountMetas[5];
|
|
3677
|
+
/** Claimer's quote token account (destination for rewards) */
|
|
3678
|
+
claimerQuoteAta: TAccountMetas[6];
|
|
3679
|
+
/** Claimer wallet (signer) */
|
|
3680
|
+
claimer: TAccountMetas[7];
|
|
3681
|
+
/** Claim receipt PDA (created if first claim) */
|
|
3682
|
+
receipt: TAccountMetas[8];
|
|
3683
|
+
/** Payer for receipt creation (can be same as claimer) */
|
|
3684
|
+
payer: TAccountMetas[9];
|
|
3685
|
+
tokenProgram: TAccountMetas[10];
|
|
3686
|
+
systemProgram: TAccountMetas[11];
|
|
3687
|
+
};
|
|
3688
|
+
data: ClaimInstructionData;
|
|
3689
|
+
};
|
|
3690
|
+
declare function parseClaimInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedClaimInstruction<TProgram, TAccountMetas>;
|
|
3691
|
+
|
|
3692
|
+
/**
|
|
3693
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3694
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3695
|
+
* to add features, then rerun Codama to update it.
|
|
3696
|
+
*
|
|
3697
|
+
* @see https://github.com/codama-idl/codama
|
|
3698
|
+
*/
|
|
3699
|
+
|
|
3700
|
+
declare const MIGRATE_ENTRY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3701
|
+
declare function getMigrateEntryDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3702
|
+
type MigrateEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountInitializerConfig extends string | AccountMeta<string> = string, TAccountLaunch extends string | AccountMeta<string> = string, TAccountLaunchAuthority extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountBaseVault extends string | AccountMeta<string> = string, TAccountQuoteVault extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TAccountOracle extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountEntry extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
3703
|
+
TAccountInitializerConfig extends string ? ReadonlyAccount<TAccountInitializerConfig> : TAccountInitializerConfig,
|
|
3704
|
+
TAccountLaunch extends string ? ReadonlyAccount<TAccountLaunch> : TAccountLaunch,
|
|
3705
|
+
TAccountLaunchAuthority extends string ? ReadonlySignerAccount<TAccountLaunchAuthority> & AccountSignerMeta<TAccountLaunchAuthority> : TAccountLaunchAuthority,
|
|
3706
|
+
TAccountBaseMint extends string ? WritableAccount<TAccountBaseMint> : TAccountBaseMint,
|
|
3707
|
+
TAccountQuoteMint extends string ? ReadonlyAccount<TAccountQuoteMint> : TAccountQuoteMint,
|
|
3708
|
+
TAccountBaseVault extends string ? WritableAccount<TAccountBaseVault> : TAccountBaseVault,
|
|
3709
|
+
TAccountQuoteVault extends string ? WritableAccount<TAccountQuoteVault> : TAccountQuoteVault,
|
|
3710
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
3711
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
3712
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
3713
|
+
TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent,
|
|
3714
|
+
TAccountOracle extends string ? ReadonlyAccount<TAccountOracle> : TAccountOracle,
|
|
3715
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
3716
|
+
TAccountPotVault extends string ? WritableAccount<TAccountPotVault> : TAccountPotVault,
|
|
3717
|
+
TAccountMarketAuthority extends string ? ReadonlyAccount<TAccountMarketAuthority> : TAccountMarketAuthority,
|
|
3718
|
+
TAccountEntry extends string ? WritableAccount<TAccountEntry> : TAccountEntry,
|
|
3719
|
+
TAccountEntryByMint extends string ? ReadonlyAccount<TAccountEntryByMint> : TAccountEntryByMint,
|
|
3720
|
+
...TRemainingAccounts
|
|
3721
|
+
]>;
|
|
3722
|
+
type MigrateEntryInstructionData = {
|
|
3723
|
+
discriminator: ReadonlyUint8Array;
|
|
3724
|
+
entryId: ReadonlyUint8Array;
|
|
3725
|
+
};
|
|
3726
|
+
type MigrateEntryInstructionDataArgs = {
|
|
3727
|
+
entryId: ReadonlyUint8Array;
|
|
3728
|
+
};
|
|
3729
|
+
declare function getMigrateEntryInstructionDataEncoder(): FixedSizeEncoder<MigrateEntryInstructionDataArgs>;
|
|
3730
|
+
declare function getMigrateEntryInstructionDataDecoder(): FixedSizeDecoder<MigrateEntryInstructionData>;
|
|
3731
|
+
declare function getMigrateEntryInstructionDataCodec(): FixedSizeCodec<MigrateEntryInstructionDataArgs, MigrateEntryInstructionData>;
|
|
3732
|
+
type MigrateEntryAsyncInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = {
|
|
3733
|
+
initializerConfig: Address<TAccountInitializerConfig>;
|
|
3734
|
+
/** Launch account from initializer */
|
|
3735
|
+
launch: Address<TAccountLaunch>;
|
|
3736
|
+
/** Launch authority PDA - signed by initializer */
|
|
3737
|
+
launchAuthority: TransactionSigner<TAccountLaunchAuthority>;
|
|
3738
|
+
/** Base mint for this entry (will burn unsold) */
|
|
3739
|
+
baseMint: Address<TAccountBaseMint>;
|
|
3740
|
+
/** Quote mint for this market */
|
|
3741
|
+
quoteMint: Address<TAccountQuoteMint>;
|
|
3742
|
+
/** Base vault from launch (source for burn) */
|
|
3743
|
+
baseVault: Address<TAccountBaseVault>;
|
|
3744
|
+
/** Quote vault from launch (source for transfer) */
|
|
3745
|
+
quoteVault: Address<TAccountQuoteVault>;
|
|
3746
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3747
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3748
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3749
|
+
rent?: Address<TAccountRent>;
|
|
3750
|
+
/**
|
|
3751
|
+
* The oracle that determines the winner.
|
|
3752
|
+
* Anchor enforces owner + discriminator (trusted_oracle_interface).
|
|
3753
|
+
*/
|
|
3754
|
+
oracle: Address<TAccountOracle>;
|
|
3755
|
+
/** Market PDA */
|
|
3756
|
+
market?: Address<TAccountMarket>;
|
|
3757
|
+
/** Pot vault for holding quote tokens */
|
|
3758
|
+
potVault: Address<TAccountPotVault>;
|
|
3759
|
+
marketAuthority?: Address<TAccountMarketAuthority>;
|
|
3760
|
+
/** Entry PDA */
|
|
3761
|
+
entry: Address<TAccountEntry>;
|
|
3762
|
+
/** EntryByMint PDA (for validation) */
|
|
3763
|
+
entryByMint?: Address<TAccountEntryByMint>;
|
|
3764
|
+
entryId: MigrateEntryInstructionDataArgs['entryId'];
|
|
3765
|
+
};
|
|
3766
|
+
declare function getMigrateEntryInstructionAsync<TAccountInitializerConfig extends string, TAccountLaunch extends string, TAccountLaunchAuthority extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountBaseVault extends string, TAccountQuoteVault extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountOracle extends string, TAccountMarket extends string, TAccountPotVault extends string, TAccountMarketAuthority extends string, TAccountEntry extends string, TAccountEntryByMint extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: MigrateEntryAsyncInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>, config?: {
|
|
3767
|
+
programAddress?: TProgramAddress;
|
|
3768
|
+
}): Promise<MigrateEntryInstruction<TProgramAddress, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>>;
|
|
3769
|
+
type MigrateEntryInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = {
|
|
3770
|
+
initializerConfig: Address<TAccountInitializerConfig>;
|
|
3771
|
+
/** Launch account from initializer */
|
|
3772
|
+
launch: Address<TAccountLaunch>;
|
|
3773
|
+
/** Launch authority PDA - signed by initializer */
|
|
3774
|
+
launchAuthority: TransactionSigner<TAccountLaunchAuthority>;
|
|
3775
|
+
/** Base mint for this entry (will burn unsold) */
|
|
3776
|
+
baseMint: Address<TAccountBaseMint>;
|
|
3777
|
+
/** Quote mint for this market */
|
|
3778
|
+
quoteMint: Address<TAccountQuoteMint>;
|
|
3779
|
+
/** Base vault from launch (source for burn) */
|
|
3780
|
+
baseVault: Address<TAccountBaseVault>;
|
|
3781
|
+
/** Quote vault from launch (source for transfer) */
|
|
3782
|
+
quoteVault: Address<TAccountQuoteVault>;
|
|
3783
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3784
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3785
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3786
|
+
rent?: Address<TAccountRent>;
|
|
3787
|
+
/**
|
|
3788
|
+
* The oracle that determines the winner.
|
|
3789
|
+
* Anchor enforces owner + discriminator (trusted_oracle_interface).
|
|
3790
|
+
*/
|
|
3791
|
+
oracle: Address<TAccountOracle>;
|
|
3792
|
+
/** Market PDA */
|
|
3793
|
+
market: Address<TAccountMarket>;
|
|
3794
|
+
/** Pot vault for holding quote tokens */
|
|
3795
|
+
potVault: Address<TAccountPotVault>;
|
|
3796
|
+
marketAuthority: Address<TAccountMarketAuthority>;
|
|
3797
|
+
/** Entry PDA */
|
|
3798
|
+
entry: Address<TAccountEntry>;
|
|
3799
|
+
/** EntryByMint PDA (for validation) */
|
|
3800
|
+
entryByMint: Address<TAccountEntryByMint>;
|
|
3801
|
+
entryId: MigrateEntryInstructionDataArgs['entryId'];
|
|
3802
|
+
};
|
|
3803
|
+
declare function getMigrateEntryInstruction<TAccountInitializerConfig extends string, TAccountLaunch extends string, TAccountLaunchAuthority extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountBaseVault extends string, TAccountQuoteVault extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountOracle extends string, TAccountMarket extends string, TAccountPotVault extends string, TAccountMarketAuthority extends string, TAccountEntry extends string, TAccountEntryByMint extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: MigrateEntryInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>, config?: {
|
|
3804
|
+
programAddress?: TProgramAddress;
|
|
3805
|
+
}): MigrateEntryInstruction<TProgramAddress, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
3806
|
+
type ParsedMigrateEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
3807
|
+
programAddress: Address<TProgram>;
|
|
3808
|
+
accounts: {
|
|
3809
|
+
initializerConfig: TAccountMetas[0];
|
|
3810
|
+
/** Launch account from initializer */
|
|
3811
|
+
launch: TAccountMetas[1];
|
|
3812
|
+
/** Launch authority PDA - signed by initializer */
|
|
3813
|
+
launchAuthority: TAccountMetas[2];
|
|
3814
|
+
/** Base mint for this entry (will burn unsold) */
|
|
3815
|
+
baseMint: TAccountMetas[3];
|
|
3816
|
+
/** Quote mint for this market */
|
|
3817
|
+
quoteMint: TAccountMetas[4];
|
|
3818
|
+
/** Base vault from launch (source for burn) */
|
|
3819
|
+
baseVault: TAccountMetas[5];
|
|
3820
|
+
/** Quote vault from launch (source for transfer) */
|
|
3821
|
+
quoteVault: TAccountMetas[6];
|
|
3822
|
+
payer: TAccountMetas[7];
|
|
3823
|
+
tokenProgram: TAccountMetas[8];
|
|
3824
|
+
systemProgram: TAccountMetas[9];
|
|
3825
|
+
rent: TAccountMetas[10];
|
|
3826
|
+
/**
|
|
3827
|
+
* The oracle that determines the winner.
|
|
3828
|
+
* Anchor enforces owner + discriminator (trusted_oracle_interface).
|
|
3829
|
+
*/
|
|
3830
|
+
oracle: TAccountMetas[11];
|
|
3831
|
+
/** Market PDA */
|
|
3832
|
+
market: TAccountMetas[12];
|
|
3833
|
+
/** Pot vault for holding quote tokens */
|
|
3834
|
+
potVault: TAccountMetas[13];
|
|
3835
|
+
marketAuthority: TAccountMetas[14];
|
|
3836
|
+
/** Entry PDA */
|
|
3837
|
+
entry: TAccountMetas[15];
|
|
3838
|
+
/** EntryByMint PDA (for validation) */
|
|
3839
|
+
entryByMint: TAccountMetas[16];
|
|
3840
|
+
};
|
|
3841
|
+
data: MigrateEntryInstructionData;
|
|
3842
|
+
};
|
|
3843
|
+
declare function parseMigrateEntryInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedMigrateEntryInstruction<TProgram, TAccountMetas>;
|
|
3844
|
+
|
|
3845
|
+
/**
|
|
3846
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3847
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3848
|
+
* to add features, then rerun Codama to update it.
|
|
3849
|
+
*
|
|
3850
|
+
* @see https://github.com/codama-idl/codama
|
|
3851
|
+
*/
|
|
3852
|
+
|
|
3853
|
+
declare const PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3854
|
+
declare function getPreviewPayoutIfWinnerDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3855
|
+
type PreviewPayoutIfWinnerInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMarket extends string | AccountMeta<string> = string, TAccountCandidateMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
3856
|
+
TAccountMarket extends string ? ReadonlyAccount<TAccountMarket> : TAccountMarket,
|
|
3857
|
+
TAccountCandidateMint extends string ? ReadonlyAccount<TAccountCandidateMint> : TAccountCandidateMint,
|
|
3858
|
+
...TRemainingAccounts
|
|
3859
|
+
]>;
|
|
3860
|
+
type PreviewPayoutIfWinnerInstructionData = {
|
|
3861
|
+
discriminator: ReadonlyUint8Array;
|
|
3862
|
+
candidateWinnerMint: Address;
|
|
3863
|
+
tokenAmount: bigint;
|
|
3864
|
+
};
|
|
3865
|
+
type PreviewPayoutIfWinnerInstructionDataArgs = {
|
|
3866
|
+
candidateWinnerMint: Address;
|
|
3867
|
+
tokenAmount: number | bigint;
|
|
3868
|
+
};
|
|
3869
|
+
declare function getPreviewPayoutIfWinnerInstructionDataEncoder(): FixedSizeEncoder<PreviewPayoutIfWinnerInstructionDataArgs>;
|
|
3870
|
+
declare function getPreviewPayoutIfWinnerInstructionDataDecoder(): FixedSizeDecoder<PreviewPayoutIfWinnerInstructionData>;
|
|
3871
|
+
declare function getPreviewPayoutIfWinnerInstructionDataCodec(): FixedSizeCodec<PreviewPayoutIfWinnerInstructionDataArgs, PreviewPayoutIfWinnerInstructionData>;
|
|
3872
|
+
type PreviewPayoutIfWinnerInput<TAccountMarket extends string = string, TAccountCandidateMint extends string = string> = {
|
|
3873
|
+
/** Market PDA */
|
|
3874
|
+
market: Address<TAccountMarket>;
|
|
3875
|
+
/** Candidate winner mint (may or may not match oracle winner) */
|
|
3876
|
+
candidateMint: Address<TAccountCandidateMint>;
|
|
3877
|
+
candidateWinnerMint: PreviewPayoutIfWinnerInstructionDataArgs['candidateWinnerMint'];
|
|
3878
|
+
tokenAmount: PreviewPayoutIfWinnerInstructionDataArgs['tokenAmount'];
|
|
3879
|
+
};
|
|
3880
|
+
declare function getPreviewPayoutIfWinnerInstruction<TAccountMarket extends string, TAccountCandidateMint extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: PreviewPayoutIfWinnerInput<TAccountMarket, TAccountCandidateMint>, config?: {
|
|
3881
|
+
programAddress?: TProgramAddress;
|
|
3882
|
+
}): PreviewPayoutIfWinnerInstruction<TProgramAddress, TAccountMarket, TAccountCandidateMint>;
|
|
3883
|
+
type ParsedPreviewPayoutIfWinnerInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
3884
|
+
programAddress: Address<TProgram>;
|
|
3885
|
+
accounts: {
|
|
3886
|
+
/** Market PDA */
|
|
3887
|
+
market: TAccountMetas[0];
|
|
3888
|
+
/** Candidate winner mint (may or may not match oracle winner) */
|
|
3889
|
+
candidateMint: TAccountMetas[1];
|
|
3890
|
+
};
|
|
3891
|
+
data: PreviewPayoutIfWinnerInstructionData;
|
|
3892
|
+
};
|
|
3893
|
+
declare function parsePreviewPayoutIfWinnerInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedPreviewPayoutIfWinnerInstruction<TProgram, TAccountMetas>;
|
|
3894
|
+
|
|
3895
|
+
/**
|
|
3896
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3897
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
3898
|
+
* to add features, then rerun Codama to update it.
|
|
3899
|
+
*
|
|
3900
|
+
* @see https://github.com/codama-idl/codama
|
|
3901
|
+
*/
|
|
3902
|
+
|
|
3903
|
+
declare const REGISTER_ENTRY_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
3904
|
+
declare function getRegisterEntryDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
3905
|
+
type RegisterEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountInitializerConfig extends string | AccountMeta<string> = string, TAccountLaunch extends string | AccountMeta<string> = string, TAccountLaunchAuthority extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountBaseVault extends string | AccountMeta<string> = string, TAccountQuoteVault extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TAccountOracle extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountEntry extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
3906
|
+
TAccountInitializerConfig extends string ? ReadonlyAccount<TAccountInitializerConfig> : TAccountInitializerConfig,
|
|
3907
|
+
TAccountLaunch extends string ? ReadonlyAccount<TAccountLaunch> : TAccountLaunch,
|
|
3908
|
+
TAccountLaunchAuthority extends string ? ReadonlySignerAccount<TAccountLaunchAuthority> & AccountSignerMeta<TAccountLaunchAuthority> : TAccountLaunchAuthority,
|
|
3909
|
+
TAccountBaseMint extends string ? ReadonlyAccount<TAccountBaseMint> : TAccountBaseMint,
|
|
3910
|
+
TAccountQuoteMint extends string ? ReadonlyAccount<TAccountQuoteMint> : TAccountQuoteMint,
|
|
3911
|
+
TAccountBaseVault extends string ? ReadonlyAccount<TAccountBaseVault> : TAccountBaseVault,
|
|
3912
|
+
TAccountQuoteVault extends string ? ReadonlyAccount<TAccountQuoteVault> : TAccountQuoteVault,
|
|
3913
|
+
TAccountPayer extends string ? WritableSignerAccount<TAccountPayer> & AccountSignerMeta<TAccountPayer> : TAccountPayer,
|
|
3914
|
+
TAccountTokenProgram extends string ? ReadonlyAccount<TAccountTokenProgram> : TAccountTokenProgram,
|
|
3915
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
3916
|
+
TAccountRent extends string ? ReadonlyAccount<TAccountRent> : TAccountRent,
|
|
3917
|
+
TAccountOracle extends string ? ReadonlyAccount<TAccountOracle> : TAccountOracle,
|
|
3918
|
+
TAccountMarket extends string ? WritableAccount<TAccountMarket> : TAccountMarket,
|
|
3919
|
+
TAccountPotVault extends string ? WritableAccount<TAccountPotVault> : TAccountPotVault,
|
|
3920
|
+
TAccountMarketAuthority extends string ? ReadonlyAccount<TAccountMarketAuthority> : TAccountMarketAuthority,
|
|
3921
|
+
TAccountEntry extends string ? WritableAccount<TAccountEntry> : TAccountEntry,
|
|
3922
|
+
TAccountEntryByMint extends string ? WritableAccount<TAccountEntryByMint> : TAccountEntryByMint,
|
|
3923
|
+
...TRemainingAccounts
|
|
3924
|
+
]>;
|
|
3925
|
+
type RegisterEntryInstructionData = {
|
|
3926
|
+
discriminator: ReadonlyUint8Array;
|
|
3927
|
+
entryId: ReadonlyUint8Array;
|
|
3928
|
+
};
|
|
3929
|
+
type RegisterEntryInstructionDataArgs = {
|
|
3930
|
+
entryId: ReadonlyUint8Array;
|
|
3931
|
+
};
|
|
3932
|
+
declare function getRegisterEntryInstructionDataEncoder(): FixedSizeEncoder<RegisterEntryInstructionDataArgs>;
|
|
3933
|
+
declare function getRegisterEntryInstructionDataDecoder(): FixedSizeDecoder<RegisterEntryInstructionData>;
|
|
3934
|
+
declare function getRegisterEntryInstructionDataCodec(): FixedSizeCodec<RegisterEntryInstructionDataArgs, RegisterEntryInstructionData>;
|
|
3935
|
+
type RegisterEntryAsyncInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = {
|
|
3936
|
+
initializerConfig: Address<TAccountInitializerConfig>;
|
|
3937
|
+
/** Launch account from initializer */
|
|
3938
|
+
launch: Address<TAccountLaunch>;
|
|
3939
|
+
/** Launch authority PDA - signed by initializer */
|
|
3940
|
+
launchAuthority: TransactionSigner<TAccountLaunchAuthority>;
|
|
3941
|
+
/** Base mint for this entry */
|
|
3942
|
+
baseMint: Address<TAccountBaseMint>;
|
|
3943
|
+
/** Quote mint for this market */
|
|
3944
|
+
quoteMint: Address<TAccountQuoteMint>;
|
|
3945
|
+
baseVault: Address<TAccountBaseVault>;
|
|
3946
|
+
quoteVault: Address<TAccountQuoteVault>;
|
|
3947
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3948
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3949
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3950
|
+
rent?: Address<TAccountRent>;
|
|
3951
|
+
/** The oracle that this market is tied to */
|
|
3952
|
+
oracle: Address<TAccountOracle>;
|
|
3953
|
+
/** Market PDA - created if first entry */
|
|
3954
|
+
market?: Address<TAccountMarket>;
|
|
3955
|
+
/** Pot vault for holding quote tokens */
|
|
3956
|
+
potVault?: Address<TAccountPotVault>;
|
|
3957
|
+
marketAuthority?: Address<TAccountMarketAuthority>;
|
|
3958
|
+
/** Entry PDA for this entry */
|
|
3959
|
+
entry: Address<TAccountEntry>;
|
|
3960
|
+
/** EntryByMint PDA for reverse lookup */
|
|
3961
|
+
entryByMint?: Address<TAccountEntryByMint>;
|
|
3962
|
+
entryId: RegisterEntryInstructionDataArgs['entryId'];
|
|
3963
|
+
};
|
|
3964
|
+
declare function getRegisterEntryInstructionAsync<TAccountInitializerConfig extends string, TAccountLaunch extends string, TAccountLaunchAuthority extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountBaseVault extends string, TAccountQuoteVault extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountOracle extends string, TAccountMarket extends string, TAccountPotVault extends string, TAccountMarketAuthority extends string, TAccountEntry extends string, TAccountEntryByMint extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: RegisterEntryAsyncInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>, config?: {
|
|
3965
|
+
programAddress?: TProgramAddress;
|
|
3966
|
+
}): Promise<RegisterEntryInstruction<TProgramAddress, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>>;
|
|
3967
|
+
type RegisterEntryInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = {
|
|
3968
|
+
initializerConfig: Address<TAccountInitializerConfig>;
|
|
3969
|
+
/** Launch account from initializer */
|
|
3970
|
+
launch: Address<TAccountLaunch>;
|
|
3971
|
+
/** Launch authority PDA - signed by initializer */
|
|
3972
|
+
launchAuthority: TransactionSigner<TAccountLaunchAuthority>;
|
|
3973
|
+
/** Base mint for this entry */
|
|
3974
|
+
baseMint: Address<TAccountBaseMint>;
|
|
3975
|
+
/** Quote mint for this market */
|
|
3976
|
+
quoteMint: Address<TAccountQuoteMint>;
|
|
3977
|
+
baseVault: Address<TAccountBaseVault>;
|
|
3978
|
+
quoteVault: Address<TAccountQuoteVault>;
|
|
3979
|
+
payer: TransactionSigner<TAccountPayer>;
|
|
3980
|
+
tokenProgram?: Address<TAccountTokenProgram>;
|
|
3981
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
3982
|
+
rent?: Address<TAccountRent>;
|
|
3983
|
+
/** The oracle that this market is tied to */
|
|
3984
|
+
oracle: Address<TAccountOracle>;
|
|
3985
|
+
/** Market PDA - created if first entry */
|
|
3986
|
+
market: Address<TAccountMarket>;
|
|
3987
|
+
/** Pot vault for holding quote tokens */
|
|
3988
|
+
potVault: Address<TAccountPotVault>;
|
|
3989
|
+
marketAuthority: Address<TAccountMarketAuthority>;
|
|
3990
|
+
/** Entry PDA for this entry */
|
|
3991
|
+
entry: Address<TAccountEntry>;
|
|
3992
|
+
/** EntryByMint PDA for reverse lookup */
|
|
3993
|
+
entryByMint: Address<TAccountEntryByMint>;
|
|
3994
|
+
entryId: RegisterEntryInstructionDataArgs['entryId'];
|
|
3995
|
+
};
|
|
3996
|
+
declare function getRegisterEntryInstruction<TAccountInitializerConfig extends string, TAccountLaunch extends string, TAccountLaunchAuthority extends string, TAccountBaseMint extends string, TAccountQuoteMint extends string, TAccountBaseVault extends string, TAccountQuoteVault extends string, TAccountPayer extends string, TAccountTokenProgram extends string, TAccountSystemProgram extends string, TAccountRent extends string, TAccountOracle extends string, TAccountMarket extends string, TAccountPotVault extends string, TAccountMarketAuthority extends string, TAccountEntry extends string, TAccountEntryByMint extends string, TProgramAddress extends Address = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS>(input: RegisterEntryInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>, config?: {
|
|
3997
|
+
programAddress?: TProgramAddress;
|
|
3998
|
+
}): RegisterEntryInstruction<TProgramAddress, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
3999
|
+
type ParsedRegisterEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
4000
|
+
programAddress: Address<TProgram>;
|
|
4001
|
+
accounts: {
|
|
4002
|
+
initializerConfig: TAccountMetas[0];
|
|
4003
|
+
/** Launch account from initializer */
|
|
4004
|
+
launch: TAccountMetas[1];
|
|
4005
|
+
/** Launch authority PDA - signed by initializer */
|
|
4006
|
+
launchAuthority: TAccountMetas[2];
|
|
4007
|
+
/** Base mint for this entry */
|
|
4008
|
+
baseMint: TAccountMetas[3];
|
|
4009
|
+
/** Quote mint for this market */
|
|
4010
|
+
quoteMint: TAccountMetas[4];
|
|
4011
|
+
baseVault: TAccountMetas[5];
|
|
4012
|
+
quoteVault: TAccountMetas[6];
|
|
4013
|
+
payer: TAccountMetas[7];
|
|
4014
|
+
tokenProgram: TAccountMetas[8];
|
|
4015
|
+
systemProgram: TAccountMetas[9];
|
|
4016
|
+
rent: TAccountMetas[10];
|
|
4017
|
+
/** The oracle that this market is tied to */
|
|
4018
|
+
oracle: TAccountMetas[11];
|
|
4019
|
+
/** Market PDA - created if first entry */
|
|
4020
|
+
market: TAccountMetas[12];
|
|
4021
|
+
/** Pot vault for holding quote tokens */
|
|
4022
|
+
potVault: TAccountMetas[13];
|
|
4023
|
+
marketAuthority: TAccountMetas[14];
|
|
4024
|
+
/** Entry PDA for this entry */
|
|
4025
|
+
entry: TAccountMetas[15];
|
|
4026
|
+
/** EntryByMint PDA for reverse lookup */
|
|
4027
|
+
entryByMint: TAccountMetas[16];
|
|
4028
|
+
};
|
|
4029
|
+
data: RegisterEntryInstructionData;
|
|
4030
|
+
};
|
|
4031
|
+
declare function parseRegisterEntryInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedRegisterEntryInstruction<TProgram, TAccountMetas>;
|
|
4032
|
+
|
|
4033
|
+
declare function getPredictionMarketAddress(oracleState: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
4034
|
+
declare function getPredictionMarketAuthorityAddress(market: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
4035
|
+
declare function getPredictionPotVaultAddress(market: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
4036
|
+
declare function getPredictionEntryAddress(oracleState: Address, entryId: ReadonlyUint8Array | Uint8Array, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
4037
|
+
declare function getPredictionEntryByMintAddress(oracleState: Address, mint: Address, programId?: Address): Promise<ProgramDerivedAddress>;
|
|
4038
|
+
|
|
4039
|
+
type index$1_AccumulatorUpdated = AccumulatorUpdated;
|
|
4040
|
+
type index$1_AccumulatorUpdatedArgs = AccumulatorUpdatedArgs;
|
|
4041
|
+
declare const index$1_CLAIM_DISCRIMINATOR: typeof CLAIM_DISCRIMINATOR;
|
|
4042
|
+
declare const index$1_CLAIM_RECEIPT_DISCRIMINATOR: typeof CLAIM_RECEIPT_DISCRIMINATOR;
|
|
4043
|
+
type index$1_CalldataBuf = CalldataBuf;
|
|
4044
|
+
type index$1_CalldataBufArgs = CalldataBufArgs;
|
|
4045
|
+
type index$1_ClaimAsyncInput<TAccountMarket extends string = string, TAccountMarketAuthority extends string = string, TAccountPotVault extends string = string, TAccountWinnerMint extends string = string, TAccountEntryByMint extends string = string, TAccountClaimerWinnerAta extends string = string, TAccountClaimerQuoteAta extends string = string, TAccountClaimer extends string = string, TAccountReceipt extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = ClaimAsyncInput<TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>;
|
|
4046
|
+
type index$1_ClaimInput<TAccountMarket extends string = string, TAccountMarketAuthority extends string = string, TAccountPotVault extends string = string, TAccountWinnerMint extends string = string, TAccountEntryByMint extends string = string, TAccountClaimerWinnerAta extends string = string, TAccountClaimerQuoteAta extends string = string, TAccountClaimer extends string = string, TAccountReceipt extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string> = ClaimInput<TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram>;
|
|
4047
|
+
type index$1_ClaimInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMarket extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountWinnerMint extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TAccountClaimerWinnerAta extends string | AccountMeta<string> = string, TAccountClaimerQuoteAta extends string | AccountMeta<string> = string, TAccountClaimer extends string | AccountMeta<string> = string, TAccountReceipt extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = ClaimInstruction<TProgram, TAccountMarket, TAccountMarketAuthority, TAccountPotVault, TAccountWinnerMint, TAccountEntryByMint, TAccountClaimerWinnerAta, TAccountClaimerQuoteAta, TAccountClaimer, TAccountReceipt, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TRemainingAccounts>;
|
|
4048
|
+
type index$1_ClaimInstructionData = ClaimInstructionData;
|
|
4049
|
+
type index$1_ClaimInstructionDataArgs = ClaimInstructionDataArgs;
|
|
4050
|
+
type index$1_ClaimReceipt = ClaimReceipt;
|
|
4051
|
+
type index$1_ClaimReceiptArgs = ClaimReceiptArgs;
|
|
4052
|
+
declare const index$1_ENTRY_BY_MINT_DISCRIMINATOR: typeof ENTRY_BY_MINT_DISCRIMINATOR;
|
|
4053
|
+
declare const index$1_ENTRY_DISCRIMINATOR: typeof ENTRY_DISCRIMINATOR;
|
|
4054
|
+
type index$1_Entry = Entry;
|
|
4055
|
+
type index$1_EntryArgs = EntryArgs;
|
|
4056
|
+
type index$1_EntryByMint = EntryByMint;
|
|
4057
|
+
type index$1_EntryByMintArgs = EntryByMintArgs;
|
|
4058
|
+
type index$1_EntryMigrated = EntryMigrated;
|
|
4059
|
+
type index$1_EntryMigratedArgs = EntryMigratedArgs;
|
|
4060
|
+
type index$1_EntryRegistered = EntryRegistered;
|
|
4061
|
+
type index$1_EntryRegisteredArgs = EntryRegisteredArgs;
|
|
4062
|
+
declare const index$1_LAUNCH_DISCRIMINATOR: typeof LAUNCH_DISCRIMINATOR;
|
|
4063
|
+
type index$1_Launch = Launch;
|
|
4064
|
+
type index$1_LaunchArgs = LaunchArgs;
|
|
4065
|
+
declare const index$1_MARKET_DISCRIMINATOR: typeof MARKET_DISCRIMINATOR;
|
|
4066
|
+
declare const index$1_MIGRATE_ENTRY_DISCRIMINATOR: typeof MIGRATE_ENTRY_DISCRIMINATOR;
|
|
4067
|
+
type index$1_Market = Market;
|
|
4068
|
+
type index$1_MarketArgs = MarketArgs;
|
|
4069
|
+
type index$1_MarketCreated = MarketCreated;
|
|
4070
|
+
type index$1_MarketCreatedArgs = MarketCreatedArgs;
|
|
4071
|
+
type index$1_MarketResolved = MarketResolved;
|
|
4072
|
+
type index$1_MarketResolvedArgs = MarketResolvedArgs;
|
|
4073
|
+
type index$1_MigrateEntryArgs = MigrateEntryArgs;
|
|
4074
|
+
type index$1_MigrateEntryArgsArgs = MigrateEntryArgsArgs;
|
|
4075
|
+
type index$1_MigrateEntryAsyncInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = MigrateEntryAsyncInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
4076
|
+
type index$1_MigrateEntryInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = MigrateEntryInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
4077
|
+
type index$1_MigrateEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountInitializerConfig extends string | AccountMeta<string> = string, TAccountLaunch extends string | AccountMeta<string> = string, TAccountLaunchAuthority extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountBaseVault extends string | AccountMeta<string> = string, TAccountQuoteVault extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TAccountOracle extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountEntry extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = MigrateEntryInstruction<TProgram, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint, TRemainingAccounts>;
|
|
4078
|
+
type index$1_MigrateEntryInstructionData = MigrateEntryInstructionData;
|
|
4079
|
+
type index$1_MigrateEntryInstructionDataArgs = MigrateEntryInstructionDataArgs;
|
|
4080
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED: typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED;
|
|
4081
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED: typeof PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED;
|
|
4082
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED: typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED;
|
|
4083
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED: typeof PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED;
|
|
4084
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE: typeof PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE;
|
|
4085
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID: typeof PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID;
|
|
4086
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_INPUT: typeof PREDICTION_MIGRATOR_ERROR__INVALID_INPUT;
|
|
4087
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_MARKET: typeof PREDICTION_MIGRATOR_ERROR__INVALID_MARKET;
|
|
4088
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_MINT: typeof PREDICTION_MIGRATOR_ERROR__INVALID_MINT;
|
|
4089
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE: typeof PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE;
|
|
4090
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_VAULT: typeof PREDICTION_MIGRATOR_ERROR__INVALID_VAULT;
|
|
4091
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT: typeof PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT;
|
|
4092
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED: typeof PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED;
|
|
4093
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW: typeof PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW;
|
|
4094
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS: typeof PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS;
|
|
4095
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED: typeof PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED;
|
|
4096
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH: typeof PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH;
|
|
4097
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED: typeof PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED;
|
|
4098
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED: typeof PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED;
|
|
4099
|
+
declare const index$1_PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY: typeof PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY;
|
|
4100
|
+
declare const index$1_PREDICTION_MIGRATOR_PROGRAM_ADDRESS: typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS;
|
|
4101
|
+
declare const index$1_PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR: typeof PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR;
|
|
4102
|
+
type index$1_ParsedClaimInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedClaimInstruction<TProgram, TAccountMetas>;
|
|
4103
|
+
type index$1_ParsedMigrateEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedMigrateEntryInstruction<TProgram, TAccountMetas>;
|
|
4104
|
+
type index$1_ParsedPredictionMigratorInstruction<TProgram extends string = 'HYHdyy7QZg8Ucky9Z97xNtSCvrZxVNkeoney8xEPXjiZ'> = ParsedPredictionMigratorInstruction<TProgram>;
|
|
4105
|
+
type index$1_ParsedPreviewPayoutIfWinnerInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedPreviewPayoutIfWinnerInstruction<TProgram, TAccountMetas>;
|
|
4106
|
+
type index$1_ParsedRegisterEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedRegisterEntryInstruction<TProgram, TAccountMetas>;
|
|
4107
|
+
type index$1_PredictionMigratorAccount = PredictionMigratorAccount;
|
|
4108
|
+
declare const index$1_PredictionMigratorAccount: typeof PredictionMigratorAccount;
|
|
4109
|
+
type index$1_PredictionMigratorError = PredictionMigratorError;
|
|
4110
|
+
type index$1_PredictionMigratorInstruction = PredictionMigratorInstruction;
|
|
4111
|
+
declare const index$1_PredictionMigratorInstruction: typeof PredictionMigratorInstruction;
|
|
4112
|
+
type index$1_PredictionMigratorPlugin = PredictionMigratorPlugin;
|
|
4113
|
+
type index$1_PredictionMigratorPluginAccounts = PredictionMigratorPluginAccounts;
|
|
4114
|
+
type index$1_PredictionMigratorPluginInstructions = PredictionMigratorPluginInstructions;
|
|
4115
|
+
type index$1_PredictionMigratorPluginRequirements = PredictionMigratorPluginRequirements;
|
|
4116
|
+
type index$1_PreviewPayoutIfWinnerArgs = PreviewPayoutIfWinnerArgs;
|
|
4117
|
+
type index$1_PreviewPayoutIfWinnerArgsArgs = PreviewPayoutIfWinnerArgsArgs;
|
|
4118
|
+
type index$1_PreviewPayoutIfWinnerInput<TAccountMarket extends string = string, TAccountCandidateMint extends string = string> = PreviewPayoutIfWinnerInput<TAccountMarket, TAccountCandidateMint>;
|
|
4119
|
+
type index$1_PreviewPayoutIfWinnerInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountMarket extends string | AccountMeta<string> = string, TAccountCandidateMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = PreviewPayoutIfWinnerInstruction<TProgram, TAccountMarket, TAccountCandidateMint, TRemainingAccounts>;
|
|
4120
|
+
type index$1_PreviewPayoutIfWinnerInstructionData = PreviewPayoutIfWinnerInstructionData;
|
|
4121
|
+
type index$1_PreviewPayoutIfWinnerInstructionDataArgs = PreviewPayoutIfWinnerInstructionDataArgs;
|
|
4122
|
+
declare const index$1_REGISTER_ENTRY_DISCRIMINATOR: typeof REGISTER_ENTRY_DISCRIMINATOR;
|
|
4123
|
+
type index$1_RegisterEntryArgs = RegisterEntryArgs;
|
|
4124
|
+
type index$1_RegisterEntryArgsArgs = RegisterEntryArgsArgs;
|
|
4125
|
+
type index$1_RegisterEntryAsyncInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = RegisterEntryAsyncInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
4126
|
+
type index$1_RegisterEntryInput<TAccountInitializerConfig extends string = string, TAccountLaunch extends string = string, TAccountLaunchAuthority extends string = string, TAccountBaseMint extends string = string, TAccountQuoteMint extends string = string, TAccountBaseVault extends string = string, TAccountQuoteVault extends string = string, TAccountPayer extends string = string, TAccountTokenProgram extends string = string, TAccountSystemProgram extends string = string, TAccountRent extends string = string, TAccountOracle extends string = string, TAccountMarket extends string = string, TAccountPotVault extends string = string, TAccountMarketAuthority extends string = string, TAccountEntry extends string = string, TAccountEntryByMint extends string = string> = RegisterEntryInput<TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint>;
|
|
4127
|
+
type index$1_RegisterEntryInstruction<TProgram extends string = typeof PREDICTION_MIGRATOR_PROGRAM_ADDRESS, TAccountInitializerConfig extends string | AccountMeta<string> = string, TAccountLaunch extends string | AccountMeta<string> = string, TAccountLaunchAuthority extends string | AccountMeta<string> = string, TAccountBaseMint extends string | AccountMeta<string> = string, TAccountQuoteMint extends string | AccountMeta<string> = string, TAccountBaseVault extends string | AccountMeta<string> = string, TAccountQuoteVault extends string | AccountMeta<string> = string, TAccountPayer extends string | AccountMeta<string> = string, TAccountTokenProgram extends string | AccountMeta<string> = 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TAccountRent extends string | AccountMeta<string> = 'SysvarRent111111111111111111111111111111111', TAccountOracle extends string | AccountMeta<string> = string, TAccountMarket extends string | AccountMeta<string> = string, TAccountPotVault extends string | AccountMeta<string> = string, TAccountMarketAuthority extends string | AccountMeta<string> = string, TAccountEntry extends string | AccountMeta<string> = string, TAccountEntryByMint extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = RegisterEntryInstruction<TProgram, TAccountInitializerConfig, TAccountLaunch, TAccountLaunchAuthority, TAccountBaseMint, TAccountQuoteMint, TAccountBaseVault, TAccountQuoteVault, TAccountPayer, TAccountTokenProgram, TAccountSystemProgram, TAccountRent, TAccountOracle, TAccountMarket, TAccountPotVault, TAccountMarketAuthority, TAccountEntry, TAccountEntryByMint, TRemainingAccounts>;
|
|
4128
|
+
type index$1_RegisterEntryInstructionData = RegisterEntryInstructionData;
|
|
4129
|
+
type index$1_RegisterEntryInstructionDataArgs = RegisterEntryInstructionDataArgs;
|
|
4130
|
+
type index$1_RewardsClaimed = RewardsClaimed;
|
|
4131
|
+
type index$1_RewardsClaimedArgs = RewardsClaimedArgs;
|
|
4132
|
+
declare const index$1_decodeClaimReceipt: typeof decodeClaimReceipt;
|
|
4133
|
+
declare const index$1_decodeEntry: typeof decodeEntry;
|
|
4134
|
+
declare const index$1_decodeEntryByMint: typeof decodeEntryByMint;
|
|
4135
|
+
declare const index$1_decodeLaunch: typeof decodeLaunch;
|
|
4136
|
+
declare const index$1_decodeMarket: typeof decodeMarket;
|
|
4137
|
+
declare const index$1_fetchAllClaimReceipt: typeof fetchAllClaimReceipt;
|
|
4138
|
+
declare const index$1_fetchAllEntry: typeof fetchAllEntry;
|
|
4139
|
+
declare const index$1_fetchAllEntryByMint: typeof fetchAllEntryByMint;
|
|
4140
|
+
declare const index$1_fetchAllLaunch: typeof fetchAllLaunch;
|
|
4141
|
+
declare const index$1_fetchAllMarket: typeof fetchAllMarket;
|
|
4142
|
+
declare const index$1_fetchAllMaybeClaimReceipt: typeof fetchAllMaybeClaimReceipt;
|
|
4143
|
+
declare const index$1_fetchAllMaybeEntry: typeof fetchAllMaybeEntry;
|
|
4144
|
+
declare const index$1_fetchAllMaybeEntryByMint: typeof fetchAllMaybeEntryByMint;
|
|
4145
|
+
declare const index$1_fetchAllMaybeLaunch: typeof fetchAllMaybeLaunch;
|
|
4146
|
+
declare const index$1_fetchAllMaybeMarket: typeof fetchAllMaybeMarket;
|
|
4147
|
+
declare const index$1_fetchClaimReceipt: typeof fetchClaimReceipt;
|
|
4148
|
+
declare const index$1_fetchEntry: typeof fetchEntry;
|
|
4149
|
+
declare const index$1_fetchEntryByMint: typeof fetchEntryByMint;
|
|
4150
|
+
declare const index$1_fetchLaunch: typeof fetchLaunch;
|
|
4151
|
+
declare const index$1_fetchMarket: typeof fetchMarket;
|
|
4152
|
+
declare const index$1_fetchMaybeClaimReceipt: typeof fetchMaybeClaimReceipt;
|
|
4153
|
+
declare const index$1_fetchMaybeEntry: typeof fetchMaybeEntry;
|
|
4154
|
+
declare const index$1_fetchMaybeEntryByMint: typeof fetchMaybeEntryByMint;
|
|
4155
|
+
declare const index$1_fetchMaybeLaunch: typeof fetchMaybeLaunch;
|
|
4156
|
+
declare const index$1_fetchMaybeMarket: typeof fetchMaybeMarket;
|
|
4157
|
+
declare const index$1_getAccumulatorUpdatedCodec: typeof getAccumulatorUpdatedCodec;
|
|
4158
|
+
declare const index$1_getAccumulatorUpdatedDecoder: typeof getAccumulatorUpdatedDecoder;
|
|
4159
|
+
declare const index$1_getAccumulatorUpdatedEncoder: typeof getAccumulatorUpdatedEncoder;
|
|
4160
|
+
declare const index$1_getCalldataBufCodec: typeof getCalldataBufCodec;
|
|
4161
|
+
declare const index$1_getCalldataBufDecoder: typeof getCalldataBufDecoder;
|
|
4162
|
+
declare const index$1_getCalldataBufEncoder: typeof getCalldataBufEncoder;
|
|
4163
|
+
declare const index$1_getClaimDiscriminatorBytes: typeof getClaimDiscriminatorBytes;
|
|
4164
|
+
declare const index$1_getClaimInstruction: typeof getClaimInstruction;
|
|
4165
|
+
declare const index$1_getClaimInstructionAsync: typeof getClaimInstructionAsync;
|
|
4166
|
+
declare const index$1_getClaimInstructionDataCodec: typeof getClaimInstructionDataCodec;
|
|
4167
|
+
declare const index$1_getClaimInstructionDataDecoder: typeof getClaimInstructionDataDecoder;
|
|
4168
|
+
declare const index$1_getClaimInstructionDataEncoder: typeof getClaimInstructionDataEncoder;
|
|
4169
|
+
declare const index$1_getClaimReceiptCodec: typeof getClaimReceiptCodec;
|
|
4170
|
+
declare const index$1_getClaimReceiptDecoder: typeof getClaimReceiptDecoder;
|
|
4171
|
+
declare const index$1_getClaimReceiptDiscriminatorBytes: typeof getClaimReceiptDiscriminatorBytes;
|
|
4172
|
+
declare const index$1_getClaimReceiptEncoder: typeof getClaimReceiptEncoder;
|
|
4173
|
+
declare const index$1_getClaimReceiptSize: typeof getClaimReceiptSize;
|
|
4174
|
+
declare const index$1_getEntryByMintCodec: typeof getEntryByMintCodec;
|
|
4175
|
+
declare const index$1_getEntryByMintDecoder: typeof getEntryByMintDecoder;
|
|
4176
|
+
declare const index$1_getEntryByMintDiscriminatorBytes: typeof getEntryByMintDiscriminatorBytes;
|
|
4177
|
+
declare const index$1_getEntryByMintEncoder: typeof getEntryByMintEncoder;
|
|
4178
|
+
declare const index$1_getEntryByMintSize: typeof getEntryByMintSize;
|
|
4179
|
+
declare const index$1_getEntryCodec: typeof getEntryCodec;
|
|
4180
|
+
declare const index$1_getEntryDecoder: typeof getEntryDecoder;
|
|
4181
|
+
declare const index$1_getEntryDiscriminatorBytes: typeof getEntryDiscriminatorBytes;
|
|
4182
|
+
declare const index$1_getEntryEncoder: typeof getEntryEncoder;
|
|
4183
|
+
declare const index$1_getEntryMigratedCodec: typeof getEntryMigratedCodec;
|
|
4184
|
+
declare const index$1_getEntryMigratedDecoder: typeof getEntryMigratedDecoder;
|
|
4185
|
+
declare const index$1_getEntryMigratedEncoder: typeof getEntryMigratedEncoder;
|
|
4186
|
+
declare const index$1_getEntryRegisteredCodec: typeof getEntryRegisteredCodec;
|
|
4187
|
+
declare const index$1_getEntryRegisteredDecoder: typeof getEntryRegisteredDecoder;
|
|
4188
|
+
declare const index$1_getEntryRegisteredEncoder: typeof getEntryRegisteredEncoder;
|
|
4189
|
+
declare const index$1_getEntrySize: typeof getEntrySize;
|
|
4190
|
+
declare const index$1_getLaunchCodec: typeof getLaunchCodec;
|
|
4191
|
+
declare const index$1_getLaunchDecoder: typeof getLaunchDecoder;
|
|
4192
|
+
declare const index$1_getLaunchDiscriminatorBytes: typeof getLaunchDiscriminatorBytes;
|
|
4193
|
+
declare const index$1_getLaunchEncoder: typeof getLaunchEncoder;
|
|
4194
|
+
declare const index$1_getLaunchSize: typeof getLaunchSize;
|
|
4195
|
+
declare const index$1_getMarketCodec: typeof getMarketCodec;
|
|
4196
|
+
declare const index$1_getMarketCreatedCodec: typeof getMarketCreatedCodec;
|
|
4197
|
+
declare const index$1_getMarketCreatedDecoder: typeof getMarketCreatedDecoder;
|
|
4198
|
+
declare const index$1_getMarketCreatedEncoder: typeof getMarketCreatedEncoder;
|
|
4199
|
+
declare const index$1_getMarketDecoder: typeof getMarketDecoder;
|
|
4200
|
+
declare const index$1_getMarketDiscriminatorBytes: typeof getMarketDiscriminatorBytes;
|
|
4201
|
+
declare const index$1_getMarketEncoder: typeof getMarketEncoder;
|
|
4202
|
+
declare const index$1_getMarketResolvedCodec: typeof getMarketResolvedCodec;
|
|
4203
|
+
declare const index$1_getMarketResolvedDecoder: typeof getMarketResolvedDecoder;
|
|
4204
|
+
declare const index$1_getMarketResolvedEncoder: typeof getMarketResolvedEncoder;
|
|
4205
|
+
declare const index$1_getMarketSize: typeof getMarketSize;
|
|
4206
|
+
declare const index$1_getMigrateEntryArgsCodec: typeof getMigrateEntryArgsCodec;
|
|
4207
|
+
declare const index$1_getMigrateEntryArgsDecoder: typeof getMigrateEntryArgsDecoder;
|
|
4208
|
+
declare const index$1_getMigrateEntryArgsEncoder: typeof getMigrateEntryArgsEncoder;
|
|
4209
|
+
declare const index$1_getMigrateEntryDiscriminatorBytes: typeof getMigrateEntryDiscriminatorBytes;
|
|
4210
|
+
declare const index$1_getMigrateEntryInstruction: typeof getMigrateEntryInstruction;
|
|
4211
|
+
declare const index$1_getMigrateEntryInstructionAsync: typeof getMigrateEntryInstructionAsync;
|
|
4212
|
+
declare const index$1_getMigrateEntryInstructionDataCodec: typeof getMigrateEntryInstructionDataCodec;
|
|
4213
|
+
declare const index$1_getMigrateEntryInstructionDataDecoder: typeof getMigrateEntryInstructionDataDecoder;
|
|
4214
|
+
declare const index$1_getMigrateEntryInstructionDataEncoder: typeof getMigrateEntryInstructionDataEncoder;
|
|
4215
|
+
declare const index$1_getPredictionEntryAddress: typeof getPredictionEntryAddress;
|
|
4216
|
+
declare const index$1_getPredictionEntryByMintAddress: typeof getPredictionEntryByMintAddress;
|
|
4217
|
+
declare const index$1_getPredictionMarketAddress: typeof getPredictionMarketAddress;
|
|
4218
|
+
declare const index$1_getPredictionMarketAuthorityAddress: typeof getPredictionMarketAuthorityAddress;
|
|
4219
|
+
declare const index$1_getPredictionMigratorErrorMessage: typeof getPredictionMigratorErrorMessage;
|
|
4220
|
+
declare const index$1_getPredictionPotVaultAddress: typeof getPredictionPotVaultAddress;
|
|
4221
|
+
declare const index$1_getPreviewPayoutIfWinnerArgsCodec: typeof getPreviewPayoutIfWinnerArgsCodec;
|
|
4222
|
+
declare const index$1_getPreviewPayoutIfWinnerArgsDecoder: typeof getPreviewPayoutIfWinnerArgsDecoder;
|
|
4223
|
+
declare const index$1_getPreviewPayoutIfWinnerArgsEncoder: typeof getPreviewPayoutIfWinnerArgsEncoder;
|
|
4224
|
+
declare const index$1_getPreviewPayoutIfWinnerDiscriminatorBytes: typeof getPreviewPayoutIfWinnerDiscriminatorBytes;
|
|
4225
|
+
declare const index$1_getPreviewPayoutIfWinnerInstruction: typeof getPreviewPayoutIfWinnerInstruction;
|
|
4226
|
+
declare const index$1_getPreviewPayoutIfWinnerInstructionDataCodec: typeof getPreviewPayoutIfWinnerInstructionDataCodec;
|
|
4227
|
+
declare const index$1_getPreviewPayoutIfWinnerInstructionDataDecoder: typeof getPreviewPayoutIfWinnerInstructionDataDecoder;
|
|
4228
|
+
declare const index$1_getPreviewPayoutIfWinnerInstructionDataEncoder: typeof getPreviewPayoutIfWinnerInstructionDataEncoder;
|
|
4229
|
+
declare const index$1_getRegisterEntryArgsCodec: typeof getRegisterEntryArgsCodec;
|
|
4230
|
+
declare const index$1_getRegisterEntryArgsDecoder: typeof getRegisterEntryArgsDecoder;
|
|
4231
|
+
declare const index$1_getRegisterEntryArgsEncoder: typeof getRegisterEntryArgsEncoder;
|
|
4232
|
+
declare const index$1_getRegisterEntryDiscriminatorBytes: typeof getRegisterEntryDiscriminatorBytes;
|
|
4233
|
+
declare const index$1_getRegisterEntryInstruction: typeof getRegisterEntryInstruction;
|
|
4234
|
+
declare const index$1_getRegisterEntryInstructionAsync: typeof getRegisterEntryInstructionAsync;
|
|
4235
|
+
declare const index$1_getRegisterEntryInstructionDataCodec: typeof getRegisterEntryInstructionDataCodec;
|
|
4236
|
+
declare const index$1_getRegisterEntryInstructionDataDecoder: typeof getRegisterEntryInstructionDataDecoder;
|
|
4237
|
+
declare const index$1_getRegisterEntryInstructionDataEncoder: typeof getRegisterEntryInstructionDataEncoder;
|
|
4238
|
+
declare const index$1_getRewardsClaimedCodec: typeof getRewardsClaimedCodec;
|
|
4239
|
+
declare const index$1_getRewardsClaimedDecoder: typeof getRewardsClaimedDecoder;
|
|
4240
|
+
declare const index$1_getRewardsClaimedEncoder: typeof getRewardsClaimedEncoder;
|
|
4241
|
+
declare const index$1_identifyPredictionMigratorAccount: typeof identifyPredictionMigratorAccount;
|
|
4242
|
+
declare const index$1_identifyPredictionMigratorInstruction: typeof identifyPredictionMigratorInstruction;
|
|
4243
|
+
declare const index$1_isPredictionMigratorError: typeof isPredictionMigratorError;
|
|
4244
|
+
declare const index$1_parseClaimInstruction: typeof parseClaimInstruction;
|
|
4245
|
+
declare const index$1_parseMigrateEntryInstruction: typeof parseMigrateEntryInstruction;
|
|
4246
|
+
declare const index$1_parsePredictionMigratorInstruction: typeof parsePredictionMigratorInstruction;
|
|
4247
|
+
declare const index$1_parsePreviewPayoutIfWinnerInstruction: typeof parsePreviewPayoutIfWinnerInstruction;
|
|
4248
|
+
declare const index$1_parseRegisterEntryInstruction: typeof parseRegisterEntryInstruction;
|
|
4249
|
+
declare const index$1_predictionMigratorProgram: typeof predictionMigratorProgram;
|
|
4250
|
+
declare namespace index$1 {
|
|
4251
|
+
export { type index$1_AccumulatorUpdated as AccumulatorUpdated, type index$1_AccumulatorUpdatedArgs as AccumulatorUpdatedArgs, index$1_CLAIM_DISCRIMINATOR as CLAIM_DISCRIMINATOR, index$1_CLAIM_RECEIPT_DISCRIMINATOR as CLAIM_RECEIPT_DISCRIMINATOR, type index$1_CalldataBuf as CalldataBuf, type index$1_CalldataBufArgs as CalldataBufArgs, type index$1_ClaimAsyncInput as ClaimAsyncInput, type index$1_ClaimInput as ClaimInput, type index$1_ClaimInstruction as ClaimInstruction, type index$1_ClaimInstructionData as ClaimInstructionData, type index$1_ClaimInstructionDataArgs as ClaimInstructionDataArgs, type index$1_ClaimReceipt as ClaimReceipt, type index$1_ClaimReceiptArgs as ClaimReceiptArgs, index$1_ENTRY_BY_MINT_DISCRIMINATOR as ENTRY_BY_MINT_DISCRIMINATOR, index$1_ENTRY_DISCRIMINATOR as ENTRY_DISCRIMINATOR, type index$1_Entry as Entry, type index$1_EntryArgs as EntryArgs, type index$1_EntryByMint as EntryByMint, type index$1_EntryByMintArgs as EntryByMintArgs, type index$1_EntryMigrated as EntryMigrated, type index$1_EntryMigratedArgs as EntryMigratedArgs, type index$1_EntryRegistered as EntryRegistered, type index$1_EntryRegisteredArgs as EntryRegisteredArgs, index$1_LAUNCH_DISCRIMINATOR as LAUNCH_DISCRIMINATOR, type index$1_Launch as Launch, type index$1_LaunchArgs as LaunchArgs, index$1_MARKET_DISCRIMINATOR as MARKET_DISCRIMINATOR, index$1_MIGRATE_ENTRY_DISCRIMINATOR as MIGRATE_ENTRY_DISCRIMINATOR, type index$1_Market as Market, type index$1_MarketArgs as MarketArgs, type index$1_MarketCreated as MarketCreated, type index$1_MarketCreatedArgs as MarketCreatedArgs, type index$1_MarketResolved as MarketResolved, type index$1_MarketResolvedArgs as MarketResolvedArgs, type index$1_MigrateEntryArgs as MigrateEntryArgs, type index$1_MigrateEntryArgsArgs as MigrateEntryArgsArgs, type index$1_MigrateEntryAsyncInput as MigrateEntryAsyncInput, type index$1_MigrateEntryInput as MigrateEntryInput, type index$1_MigrateEntryInstruction as MigrateEntryInstruction, type index$1_MigrateEntryInstructionData as MigrateEntryInstructionData, type index$1_MigrateEntryInstructionDataArgs as MigrateEntryInstructionDataArgs, ORACLE_STATE_DISCRIMINATOR$1 as ORACLE_STATE_DISCRIMINATOR, type OracleState$1 as OracleState, type OracleStateArgs$1 as OracleStateArgs, index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED as PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_MIGRATED, index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED as PREDICTION_MIGRATOR_ERROR__ENTRY_ALREADY_REGISTERED, index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED as PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_MIGRATED, index$1_PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED as PREDICTION_MIGRATOR_ERROR__ENTRY_NOT_REGISTERED, index$1_PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE as PREDICTION_MIGRATOR_ERROR__INSUFFICIENT_BALANCE, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID as PREDICTION_MIGRATOR_ERROR__INVALID_ENTRY_ID, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_INPUT as PREDICTION_MIGRATOR_ERROR__INVALID_INPUT, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_MARKET as PREDICTION_MIGRATOR_ERROR__INVALID_MARKET, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_MINT as PREDICTION_MIGRATOR_ERROR__INVALID_MINT, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE as PREDICTION_MIGRATOR_ERROR__INVALID_ORACLE, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_VAULT as PREDICTION_MIGRATOR_ERROR__INVALID_VAULT, index$1_PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT as PREDICTION_MIGRATOR_ERROR__INVALID_WINNER_MINT, index$1_PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED as PREDICTION_MIGRATOR_ERROR__MARKET_NOT_RESOLVED, index$1_PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW as PREDICTION_MIGRATOR_ERROR__MATH_OVERFLOW, index$1_PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS as PREDICTION_MIGRATOR_ERROR__NO_PENDING_REWARDS, index$1_PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED as PREDICTION_MIGRATOR_ERROR__ORACLE_NOT_FINALIZED, index$1_PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH as PREDICTION_MIGRATOR_ERROR__QUOTE_MINT_MISMATCH, index$1_PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED as PREDICTION_MIGRATOR_ERROR__UNAUTHORIZED, index$1_PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED as PREDICTION_MIGRATOR_ERROR__WINNING_ENTRY_NOT_MIGRATED, index$1_PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY as PREDICTION_MIGRATOR_ERROR__ZERO_CLAIMABLE_SUPPLY, index$1_PREDICTION_MIGRATOR_PROGRAM_ADDRESS as PREDICTION_MIGRATOR_PROGRAM_ADDRESS, index$1_PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR as PREVIEW_PAYOUT_IF_WINNER_DISCRIMINATOR, type index$1_ParsedClaimInstruction as ParsedClaimInstruction, type index$1_ParsedMigrateEntryInstruction as ParsedMigrateEntryInstruction, type index$1_ParsedPredictionMigratorInstruction as ParsedPredictionMigratorInstruction, type index$1_ParsedPreviewPayoutIfWinnerInstruction as ParsedPreviewPayoutIfWinnerInstruction, type index$1_ParsedRegisterEntryInstruction as ParsedRegisterEntryInstruction, index$1_PredictionMigratorAccount as PredictionMigratorAccount, type index$1_PredictionMigratorError as PredictionMigratorError, index$1_PredictionMigratorInstruction as PredictionMigratorInstruction, type index$1_PredictionMigratorPlugin as PredictionMigratorPlugin, type index$1_PredictionMigratorPluginAccounts as PredictionMigratorPluginAccounts, type index$1_PredictionMigratorPluginInstructions as PredictionMigratorPluginInstructions, type index$1_PredictionMigratorPluginRequirements as PredictionMigratorPluginRequirements, type index$1_PreviewPayoutIfWinnerArgs as PreviewPayoutIfWinnerArgs, type index$1_PreviewPayoutIfWinnerArgsArgs as PreviewPayoutIfWinnerArgsArgs, type index$1_PreviewPayoutIfWinnerInput as PreviewPayoutIfWinnerInput, type index$1_PreviewPayoutIfWinnerInstruction as PreviewPayoutIfWinnerInstruction, type index$1_PreviewPayoutIfWinnerInstructionData as PreviewPayoutIfWinnerInstructionData, type index$1_PreviewPayoutIfWinnerInstructionDataArgs as PreviewPayoutIfWinnerInstructionDataArgs, index$1_REGISTER_ENTRY_DISCRIMINATOR as REGISTER_ENTRY_DISCRIMINATOR, type index$1_RegisterEntryArgs as RegisterEntryArgs, type index$1_RegisterEntryArgsArgs as RegisterEntryArgsArgs, type index$1_RegisterEntryAsyncInput as RegisterEntryAsyncInput, type index$1_RegisterEntryInput as RegisterEntryInput, type index$1_RegisterEntryInstruction as RegisterEntryInstruction, type index$1_RegisterEntryInstructionData as RegisterEntryInstructionData, type index$1_RegisterEntryInstructionDataArgs as RegisterEntryInstructionDataArgs, type index$1_RewardsClaimed as RewardsClaimed, type index$1_RewardsClaimedArgs as RewardsClaimedArgs, index$1_decodeClaimReceipt as decodeClaimReceipt, index$1_decodeEntry as decodeEntry, index$1_decodeEntryByMint as decodeEntryByMint, index$1_decodeLaunch as decodeLaunch, index$1_decodeMarket as decodeMarket, decodeOracleState$1 as decodeOracleState, index$1_fetchAllClaimReceipt as fetchAllClaimReceipt, index$1_fetchAllEntry as fetchAllEntry, index$1_fetchAllEntryByMint as fetchAllEntryByMint, index$1_fetchAllLaunch as fetchAllLaunch, index$1_fetchAllMarket as fetchAllMarket, index$1_fetchAllMaybeClaimReceipt as fetchAllMaybeClaimReceipt, index$1_fetchAllMaybeEntry as fetchAllMaybeEntry, index$1_fetchAllMaybeEntryByMint as fetchAllMaybeEntryByMint, index$1_fetchAllMaybeLaunch as fetchAllMaybeLaunch, index$1_fetchAllMaybeMarket as fetchAllMaybeMarket, fetchAllMaybeOracleState$1 as fetchAllMaybeOracleState, fetchAllOracleState$1 as fetchAllOracleState, index$1_fetchClaimReceipt as fetchClaimReceipt, index$1_fetchEntry as fetchEntry, index$1_fetchEntryByMint as fetchEntryByMint, index$1_fetchLaunch as fetchLaunch, index$1_fetchMarket as fetchMarket, index$1_fetchMaybeClaimReceipt as fetchMaybeClaimReceipt, index$1_fetchMaybeEntry as fetchMaybeEntry, index$1_fetchMaybeEntryByMint as fetchMaybeEntryByMint, index$1_fetchMaybeLaunch as fetchMaybeLaunch, index$1_fetchMaybeMarket as fetchMaybeMarket, fetchMaybeOracleState$1 as fetchMaybeOracleState, fetchOracleState$1 as fetchOracleState, index$1_getAccumulatorUpdatedCodec as getAccumulatorUpdatedCodec, index$1_getAccumulatorUpdatedDecoder as getAccumulatorUpdatedDecoder, index$1_getAccumulatorUpdatedEncoder as getAccumulatorUpdatedEncoder, index$1_getCalldataBufCodec as getCalldataBufCodec, index$1_getCalldataBufDecoder as getCalldataBufDecoder, index$1_getCalldataBufEncoder as getCalldataBufEncoder, index$1_getClaimDiscriminatorBytes as getClaimDiscriminatorBytes, index$1_getClaimInstruction as getClaimInstruction, index$1_getClaimInstructionAsync as getClaimInstructionAsync, index$1_getClaimInstructionDataCodec as getClaimInstructionDataCodec, index$1_getClaimInstructionDataDecoder as getClaimInstructionDataDecoder, index$1_getClaimInstructionDataEncoder as getClaimInstructionDataEncoder, index$1_getClaimReceiptCodec as getClaimReceiptCodec, index$1_getClaimReceiptDecoder as getClaimReceiptDecoder, index$1_getClaimReceiptDiscriminatorBytes as getClaimReceiptDiscriminatorBytes, index$1_getClaimReceiptEncoder as getClaimReceiptEncoder, index$1_getClaimReceiptSize as getClaimReceiptSize, index$1_getEntryByMintCodec as getEntryByMintCodec, index$1_getEntryByMintDecoder as getEntryByMintDecoder, index$1_getEntryByMintDiscriminatorBytes as getEntryByMintDiscriminatorBytes, index$1_getEntryByMintEncoder as getEntryByMintEncoder, index$1_getEntryByMintSize as getEntryByMintSize, index$1_getEntryCodec as getEntryCodec, index$1_getEntryDecoder as getEntryDecoder, index$1_getEntryDiscriminatorBytes as getEntryDiscriminatorBytes, index$1_getEntryEncoder as getEntryEncoder, index$1_getEntryMigratedCodec as getEntryMigratedCodec, index$1_getEntryMigratedDecoder as getEntryMigratedDecoder, index$1_getEntryMigratedEncoder as getEntryMigratedEncoder, index$1_getEntryRegisteredCodec as getEntryRegisteredCodec, index$1_getEntryRegisteredDecoder as getEntryRegisteredDecoder, index$1_getEntryRegisteredEncoder as getEntryRegisteredEncoder, index$1_getEntrySize as getEntrySize, index$1_getLaunchCodec as getLaunchCodec, index$1_getLaunchDecoder as getLaunchDecoder, index$1_getLaunchDiscriminatorBytes as getLaunchDiscriminatorBytes, index$1_getLaunchEncoder as getLaunchEncoder, index$1_getLaunchSize as getLaunchSize, index$1_getMarketCodec as getMarketCodec, index$1_getMarketCreatedCodec as getMarketCreatedCodec, index$1_getMarketCreatedDecoder as getMarketCreatedDecoder, index$1_getMarketCreatedEncoder as getMarketCreatedEncoder, index$1_getMarketDecoder as getMarketDecoder, index$1_getMarketDiscriminatorBytes as getMarketDiscriminatorBytes, index$1_getMarketEncoder as getMarketEncoder, index$1_getMarketResolvedCodec as getMarketResolvedCodec, index$1_getMarketResolvedDecoder as getMarketResolvedDecoder, index$1_getMarketResolvedEncoder as getMarketResolvedEncoder, index$1_getMarketSize as getMarketSize, index$1_getMigrateEntryArgsCodec as getMigrateEntryArgsCodec, index$1_getMigrateEntryArgsDecoder as getMigrateEntryArgsDecoder, index$1_getMigrateEntryArgsEncoder as getMigrateEntryArgsEncoder, index$1_getMigrateEntryDiscriminatorBytes as getMigrateEntryDiscriminatorBytes, index$1_getMigrateEntryInstruction as getMigrateEntryInstruction, index$1_getMigrateEntryInstructionAsync as getMigrateEntryInstructionAsync, index$1_getMigrateEntryInstructionDataCodec as getMigrateEntryInstructionDataCodec, index$1_getMigrateEntryInstructionDataDecoder as getMigrateEntryInstructionDataDecoder, index$1_getMigrateEntryInstructionDataEncoder as getMigrateEntryInstructionDataEncoder, getOracleStateCodec$1 as getOracleStateCodec, getOracleStateDecoder$1 as getOracleStateDecoder, getOracleStateDiscriminatorBytes$1 as getOracleStateDiscriminatorBytes, getOracleStateEncoder$1 as getOracleStateEncoder, getOracleStateSize$1 as getOracleStateSize, index$1_getPredictionEntryAddress as getPredictionEntryAddress, index$1_getPredictionEntryByMintAddress as getPredictionEntryByMintAddress, index$1_getPredictionMarketAddress as getPredictionMarketAddress, index$1_getPredictionMarketAuthorityAddress as getPredictionMarketAuthorityAddress, index$1_getPredictionMigratorErrorMessage as getPredictionMigratorErrorMessage, index$1_getPredictionPotVaultAddress as getPredictionPotVaultAddress, index$1_getPreviewPayoutIfWinnerArgsCodec as getPreviewPayoutIfWinnerArgsCodec, index$1_getPreviewPayoutIfWinnerArgsDecoder as getPreviewPayoutIfWinnerArgsDecoder, index$1_getPreviewPayoutIfWinnerArgsEncoder as getPreviewPayoutIfWinnerArgsEncoder, index$1_getPreviewPayoutIfWinnerDiscriminatorBytes as getPreviewPayoutIfWinnerDiscriminatorBytes, index$1_getPreviewPayoutIfWinnerInstruction as getPreviewPayoutIfWinnerInstruction, index$1_getPreviewPayoutIfWinnerInstructionDataCodec as getPreviewPayoutIfWinnerInstructionDataCodec, index$1_getPreviewPayoutIfWinnerInstructionDataDecoder as getPreviewPayoutIfWinnerInstructionDataDecoder, index$1_getPreviewPayoutIfWinnerInstructionDataEncoder as getPreviewPayoutIfWinnerInstructionDataEncoder, index$1_getRegisterEntryArgsCodec as getRegisterEntryArgsCodec, index$1_getRegisterEntryArgsDecoder as getRegisterEntryArgsDecoder, index$1_getRegisterEntryArgsEncoder as getRegisterEntryArgsEncoder, index$1_getRegisterEntryDiscriminatorBytes as getRegisterEntryDiscriminatorBytes, index$1_getRegisterEntryInstruction as getRegisterEntryInstruction, index$1_getRegisterEntryInstructionAsync as getRegisterEntryInstructionAsync, index$1_getRegisterEntryInstructionDataCodec as getRegisterEntryInstructionDataCodec, index$1_getRegisterEntryInstructionDataDecoder as getRegisterEntryInstructionDataDecoder, index$1_getRegisterEntryInstructionDataEncoder as getRegisterEntryInstructionDataEncoder, index$1_getRewardsClaimedCodec as getRewardsClaimedCodec, index$1_getRewardsClaimedDecoder as getRewardsClaimedDecoder, index$1_getRewardsClaimedEncoder as getRewardsClaimedEncoder, index$1_identifyPredictionMigratorAccount as identifyPredictionMigratorAccount, index$1_identifyPredictionMigratorInstruction as identifyPredictionMigratorInstruction, index$1_isPredictionMigratorError as isPredictionMigratorError, index$1_parseClaimInstruction as parseClaimInstruction, index$1_parseMigrateEntryInstruction as parseMigrateEntryInstruction, index$1_parsePredictionMigratorInstruction as parsePredictionMigratorInstruction, index$1_parsePreviewPayoutIfWinnerInstruction as parsePreviewPayoutIfWinnerInstruction, index$1_parseRegisterEntryInstruction as parseRegisterEntryInstruction, index$1_predictionMigratorProgram as predictionMigratorProgram };
|
|
4252
|
+
}
|
|
4253
|
+
|
|
4254
|
+
/**
|
|
4255
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4256
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4257
|
+
* to add features, then rerun Codama to update it.
|
|
4258
|
+
*
|
|
4259
|
+
* @see https://github.com/codama-idl/codama
|
|
4260
|
+
*/
|
|
4261
|
+
|
|
4262
|
+
declare const ORACLE_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
4263
|
+
declare function getOracleStateDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
4264
|
+
type OracleState = {
|
|
4265
|
+
discriminator: ReadonlyUint8Array;
|
|
4266
|
+
/** The authority that can finalize this oracle */
|
|
4267
|
+
oracleAuthority: Address;
|
|
4268
|
+
/** Optional quote mint for validation (Pubkey::default() if not used) */
|
|
4269
|
+
quoteMint: Address;
|
|
4270
|
+
/** Whether the oracle has been finalized with a winner */
|
|
4271
|
+
isFinalized: boolean;
|
|
4272
|
+
/** The winning mint (only valid if is_finalized == true) */
|
|
4273
|
+
winningMint: Address;
|
|
4274
|
+
/** Nonce used in PDA derivation */
|
|
4275
|
+
nonce: bigint;
|
|
4276
|
+
/** PDA bump seed */
|
|
4277
|
+
bump: number;
|
|
4278
|
+
/** Reserved for future use */
|
|
4279
|
+
reserved: ReadonlyUint8Array;
|
|
4280
|
+
};
|
|
4281
|
+
type OracleStateArgs = {
|
|
4282
|
+
/** The authority that can finalize this oracle */
|
|
4283
|
+
oracleAuthority: Address;
|
|
4284
|
+
/** Optional quote mint for validation (Pubkey::default() if not used) */
|
|
4285
|
+
quoteMint: Address;
|
|
4286
|
+
/** Whether the oracle has been finalized with a winner */
|
|
4287
|
+
isFinalized: boolean;
|
|
4288
|
+
/** The winning mint (only valid if is_finalized == true) */
|
|
4289
|
+
winningMint: Address;
|
|
4290
|
+
/** Nonce used in PDA derivation */
|
|
4291
|
+
nonce: number | bigint;
|
|
4292
|
+
/** PDA bump seed */
|
|
4293
|
+
bump: number;
|
|
4294
|
+
/** Reserved for future use */
|
|
4295
|
+
reserved: ReadonlyUint8Array;
|
|
4296
|
+
};
|
|
4297
|
+
/** Gets the encoder for {@link OracleStateArgs} account data. */
|
|
4298
|
+
declare function getOracleStateEncoder(): FixedSizeEncoder<OracleStateArgs>;
|
|
4299
|
+
/** Gets the decoder for {@link OracleState} account data. */
|
|
4300
|
+
declare function getOracleStateDecoder(): FixedSizeDecoder<OracleState>;
|
|
4301
|
+
/** Gets the codec for {@link OracleState} account data. */
|
|
4302
|
+
declare function getOracleStateCodec(): FixedSizeCodec<OracleStateArgs, OracleState>;
|
|
4303
|
+
declare function decodeOracleState<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<OracleState, TAddress>;
|
|
4304
|
+
declare function decodeOracleState<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<OracleState, TAddress>;
|
|
4305
|
+
declare function fetchOracleState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<OracleState, TAddress>>;
|
|
4306
|
+
declare function fetchMaybeOracleState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<OracleState, TAddress>>;
|
|
4307
|
+
declare function fetchAllOracleState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<OracleState>[]>;
|
|
4308
|
+
declare function fetchAllMaybeOracleState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<OracleState>[]>;
|
|
4309
|
+
declare function getOracleStateSize(): number;
|
|
4310
|
+
|
|
4311
|
+
/**
|
|
4312
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4313
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4314
|
+
* to add features, then rerun Codama to update it.
|
|
4315
|
+
*
|
|
4316
|
+
* @see https://github.com/codama-idl/codama
|
|
4317
|
+
*/
|
|
4318
|
+
|
|
4319
|
+
/** Unauthorized: Unauthorized: only oracle authority can perform this action */
|
|
4320
|
+
declare const TRUSTED_ORACLE_ERROR__UNAUTHORIZED = 6000;
|
|
4321
|
+
/** AlreadyFinalized: Oracle already finalized */
|
|
4322
|
+
declare const TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED = 6001;
|
|
4323
|
+
/** NotFinalized: Oracle not finalized */
|
|
4324
|
+
declare const TRUSTED_ORACLE_ERROR__NOT_FINALIZED = 6002;
|
|
4325
|
+
/** InvalidWinningMint: Invalid winning mint */
|
|
4326
|
+
declare const TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT = 6003;
|
|
4327
|
+
type TrustedOracleError = typeof TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED | typeof TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT | typeof TRUSTED_ORACLE_ERROR__NOT_FINALIZED | typeof TRUSTED_ORACLE_ERROR__UNAUTHORIZED;
|
|
4328
|
+
declare function getTrustedOracleErrorMessage(code: TrustedOracleError): string;
|
|
4329
|
+
declare function isTrustedOracleError<TProgramErrorCode extends TrustedOracleError>(error: unknown, transactionMessage: {
|
|
4330
|
+
instructions: Record<number, {
|
|
4331
|
+
programAddress: Address;
|
|
4332
|
+
}>;
|
|
4333
|
+
}, code?: TProgramErrorCode): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{
|
|
4334
|
+
context: Readonly<{
|
|
4335
|
+
code: TProgramErrorCode;
|
|
4336
|
+
}>;
|
|
4337
|
+
}>;
|
|
4338
|
+
|
|
4339
|
+
/**
|
|
4340
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4341
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4342
|
+
* to add features, then rerun Codama to update it.
|
|
4343
|
+
*
|
|
4344
|
+
* @see https://github.com/codama-idl/codama
|
|
4345
|
+
*/
|
|
4346
|
+
|
|
4347
|
+
declare const TRUSTED_ORACLE_PROGRAM_ADDRESS: Address<"HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m">;
|
|
4348
|
+
declare enum TrustedOracleAccount {
|
|
4349
|
+
OracleState = 0
|
|
4350
|
+
}
|
|
4351
|
+
declare function identifyTrustedOracleAccount(account: {
|
|
4352
|
+
data: ReadonlyUint8Array;
|
|
4353
|
+
} | ReadonlyUint8Array): TrustedOracleAccount;
|
|
4354
|
+
declare enum TrustedOracleInstruction {
|
|
4355
|
+
Finalize = 0,
|
|
4356
|
+
InitializeOracle = 1
|
|
4357
|
+
}
|
|
4358
|
+
declare function identifyTrustedOracleInstruction(instruction: {
|
|
4359
|
+
data: ReadonlyUint8Array;
|
|
4360
|
+
} | ReadonlyUint8Array): TrustedOracleInstruction;
|
|
4361
|
+
type ParsedTrustedOracleInstruction<TProgram extends string = 'HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m'> = ({
|
|
4362
|
+
instructionType: TrustedOracleInstruction.Finalize;
|
|
4363
|
+
} & ParsedFinalizeInstruction<TProgram>) | ({
|
|
4364
|
+
instructionType: TrustedOracleInstruction.InitializeOracle;
|
|
4365
|
+
} & ParsedInitializeOracleInstruction<TProgram>);
|
|
4366
|
+
declare function parseTrustedOracleInstruction<TProgram extends string>(instruction: Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array>): ParsedTrustedOracleInstruction<TProgram>;
|
|
4367
|
+
type TrustedOraclePlugin = {
|
|
4368
|
+
accounts: TrustedOraclePluginAccounts;
|
|
4369
|
+
instructions: TrustedOraclePluginInstructions;
|
|
4370
|
+
};
|
|
4371
|
+
type TrustedOraclePluginAccounts = {
|
|
4372
|
+
oracleState: ReturnType<typeof getOracleStateCodec> & SelfFetchFunctions<OracleStateArgs, OracleState>;
|
|
4373
|
+
};
|
|
4374
|
+
type TrustedOraclePluginInstructions = {
|
|
4375
|
+
finalize: (input: FinalizeInput) => ReturnType<typeof getFinalizeInstruction> & SelfPlanAndSendFunctions;
|
|
4376
|
+
initializeOracle: (input: InitializeOracleInput) => ReturnType<typeof getInitializeOracleInstruction> & SelfPlanAndSendFunctions;
|
|
4377
|
+
};
|
|
4378
|
+
type TrustedOraclePluginRequirements = ClientWithRpc<GetAccountInfoApi & GetMultipleAccountsApi> & ClientWithTransactionPlanning & ClientWithTransactionSending;
|
|
4379
|
+
declare function trustedOracleProgram(): <T extends TrustedOraclePluginRequirements>(client: T) => T & {
|
|
4380
|
+
trustedOracle: TrustedOraclePlugin;
|
|
4381
|
+
};
|
|
4382
|
+
|
|
4383
|
+
/**
|
|
4384
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4385
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4386
|
+
* to add features, then rerun Codama to update it.
|
|
4387
|
+
*
|
|
4388
|
+
* @see https://github.com/codama-idl/codama
|
|
4389
|
+
*/
|
|
4390
|
+
|
|
4391
|
+
declare const FINALIZE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
4392
|
+
declare function getFinalizeDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
4393
|
+
type FinalizeInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountOracleAuthority extends string | AccountMeta<string> = string, TAccountOracleState extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
4394
|
+
TAccountOracleAuthority extends string ? ReadonlySignerAccount<TAccountOracleAuthority> & AccountSignerMeta<TAccountOracleAuthority> : TAccountOracleAuthority,
|
|
4395
|
+
TAccountOracleState extends string ? WritableAccount<TAccountOracleState> : TAccountOracleState,
|
|
4396
|
+
...TRemainingAccounts
|
|
4397
|
+
]>;
|
|
4398
|
+
type FinalizeInstructionData = {
|
|
4399
|
+
discriminator: ReadonlyUint8Array;
|
|
4400
|
+
winningMint: Address;
|
|
4401
|
+
};
|
|
4402
|
+
type FinalizeInstructionDataArgs = {
|
|
4403
|
+
winningMint: Address;
|
|
4404
|
+
};
|
|
4405
|
+
declare function getFinalizeInstructionDataEncoder(): FixedSizeEncoder<FinalizeInstructionDataArgs>;
|
|
4406
|
+
declare function getFinalizeInstructionDataDecoder(): FixedSizeDecoder<FinalizeInstructionData>;
|
|
4407
|
+
declare function getFinalizeInstructionDataCodec(): FixedSizeCodec<FinalizeInstructionDataArgs, FinalizeInstructionData>;
|
|
4408
|
+
type FinalizeInput<TAccountOracleAuthority extends string = string, TAccountOracleState extends string = string> = {
|
|
4409
|
+
/** The oracle authority - must sign to finalize */
|
|
4410
|
+
oracleAuthority: TransactionSigner<TAccountOracleAuthority>;
|
|
4411
|
+
oracleState: Address<TAccountOracleState>;
|
|
4412
|
+
winningMint: FinalizeInstructionDataArgs['winningMint'];
|
|
4413
|
+
};
|
|
4414
|
+
declare function getFinalizeInstruction<TAccountOracleAuthority extends string, TAccountOracleState extends string, TProgramAddress extends Address = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS>(input: FinalizeInput<TAccountOracleAuthority, TAccountOracleState>, config?: {
|
|
4415
|
+
programAddress?: TProgramAddress;
|
|
4416
|
+
}): FinalizeInstruction<TProgramAddress, TAccountOracleAuthority, TAccountOracleState>;
|
|
4417
|
+
type ParsedFinalizeInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
4418
|
+
programAddress: Address<TProgram>;
|
|
4419
|
+
accounts: {
|
|
4420
|
+
/** The oracle authority - must sign to finalize */
|
|
4421
|
+
oracleAuthority: TAccountMetas[0];
|
|
4422
|
+
oracleState: TAccountMetas[1];
|
|
4423
|
+
};
|
|
4424
|
+
data: FinalizeInstructionData;
|
|
4425
|
+
};
|
|
4426
|
+
declare function parseFinalizeInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedFinalizeInstruction<TProgram, TAccountMetas>;
|
|
4427
|
+
|
|
4428
|
+
/**
|
|
4429
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4430
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4431
|
+
* to add features, then rerun Codama to update it.
|
|
4432
|
+
*
|
|
4433
|
+
* @see https://github.com/codama-idl/codama
|
|
4434
|
+
*/
|
|
4435
|
+
|
|
4436
|
+
declare const INITIALIZE_ORACLE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
4437
|
+
declare function getInitializeOracleDiscriminatorBytes(): ReadonlyUint8Array<ArrayBuffer>;
|
|
4438
|
+
type InitializeOracleInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountOracleAuthority extends string | AccountMeta<string> = string, TAccountOracleState extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = Instruction<TProgram> & InstructionWithData<ReadonlyUint8Array> & InstructionWithAccounts<[
|
|
4439
|
+
TAccountOracleAuthority extends string ? WritableSignerAccount<TAccountOracleAuthority> & AccountSignerMeta<TAccountOracleAuthority> : TAccountOracleAuthority,
|
|
4440
|
+
TAccountOracleState extends string ? WritableAccount<TAccountOracleState> : TAccountOracleState,
|
|
4441
|
+
TAccountSystemProgram extends string ? ReadonlyAccount<TAccountSystemProgram> : TAccountSystemProgram,
|
|
4442
|
+
...TRemainingAccounts
|
|
4443
|
+
]>;
|
|
4444
|
+
type InitializeOracleInstructionData = {
|
|
4445
|
+
discriminator: ReadonlyUint8Array;
|
|
4446
|
+
/** Nonce for PDA derivation (allows multiple oracles per authority) */
|
|
4447
|
+
nonce: bigint;
|
|
4448
|
+
/** Optional quote mint for validation (use Pubkey::default() if not needed) */
|
|
4449
|
+
quoteMint: Address;
|
|
4450
|
+
};
|
|
4451
|
+
type InitializeOracleInstructionDataArgs = {
|
|
4452
|
+
/** Nonce for PDA derivation (allows multiple oracles per authority) */
|
|
4453
|
+
nonce: number | bigint;
|
|
4454
|
+
/** Optional quote mint for validation (use Pubkey::default() if not needed) */
|
|
4455
|
+
quoteMint: Address;
|
|
4456
|
+
};
|
|
4457
|
+
declare function getInitializeOracleInstructionDataEncoder(): FixedSizeEncoder<InitializeOracleInstructionDataArgs>;
|
|
4458
|
+
declare function getInitializeOracleInstructionDataDecoder(): FixedSizeDecoder<InitializeOracleInstructionData>;
|
|
4459
|
+
declare function getInitializeOracleInstructionDataCodec(): FixedSizeCodec<InitializeOracleInstructionDataArgs, InitializeOracleInstructionData>;
|
|
4460
|
+
type InitializeOracleInput<TAccountOracleAuthority extends string = string, TAccountOracleState extends string = string, TAccountSystemProgram extends string = string> = {
|
|
4461
|
+
/** The authority that will be able to finalize this oracle */
|
|
4462
|
+
oracleAuthority: TransactionSigner<TAccountOracleAuthority>;
|
|
4463
|
+
oracleState: Address<TAccountOracleState>;
|
|
4464
|
+
systemProgram?: Address<TAccountSystemProgram>;
|
|
4465
|
+
nonce: InitializeOracleInstructionDataArgs['nonce'];
|
|
4466
|
+
quoteMint: InitializeOracleInstructionDataArgs['quoteMint'];
|
|
4467
|
+
};
|
|
4468
|
+
declare function getInitializeOracleInstruction<TAccountOracleAuthority extends string, TAccountOracleState extends string, TAccountSystemProgram extends string, TProgramAddress extends Address = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS>(input: InitializeOracleInput<TAccountOracleAuthority, TAccountOracleState, TAccountSystemProgram>, config?: {
|
|
4469
|
+
programAddress?: TProgramAddress;
|
|
4470
|
+
}): InitializeOracleInstruction<TProgramAddress, TAccountOracleAuthority, TAccountOracleState, TAccountSystemProgram>;
|
|
4471
|
+
type ParsedInitializeOracleInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = {
|
|
4472
|
+
programAddress: Address<TProgram>;
|
|
4473
|
+
accounts: {
|
|
4474
|
+
/** The authority that will be able to finalize this oracle */
|
|
4475
|
+
oracleAuthority: TAccountMetas[0];
|
|
4476
|
+
oracleState: TAccountMetas[1];
|
|
4477
|
+
systemProgram: TAccountMetas[2];
|
|
4478
|
+
};
|
|
4479
|
+
data: InitializeOracleInstructionData;
|
|
4480
|
+
};
|
|
4481
|
+
declare function parseInitializeOracleInstruction<TProgram extends string, TAccountMetas extends readonly AccountMeta[]>(instruction: Instruction<TProgram> & InstructionWithAccounts<TAccountMetas> & InstructionWithData<ReadonlyUint8Array>): ParsedInitializeOracleInstruction<TProgram, TAccountMetas>;
|
|
4482
|
+
|
|
4483
|
+
/**
|
|
4484
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4485
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4486
|
+
* to add features, then rerun Codama to update it.
|
|
4487
|
+
*
|
|
4488
|
+
* @see https://github.com/codama-idl/codama
|
|
4489
|
+
*/
|
|
4490
|
+
|
|
4491
|
+
type InitializeOracleArgs = {
|
|
4492
|
+
/** Nonce for PDA derivation (allows multiple oracles per authority) */
|
|
4493
|
+
nonce: bigint;
|
|
4494
|
+
/** Optional quote mint for validation (use Pubkey::default() if not needed) */
|
|
4495
|
+
quoteMint: Address;
|
|
4496
|
+
};
|
|
4497
|
+
type InitializeOracleArgsArgs = {
|
|
4498
|
+
/** Nonce for PDA derivation (allows multiple oracles per authority) */
|
|
4499
|
+
nonce: number | bigint;
|
|
4500
|
+
/** Optional quote mint for validation (use Pubkey::default() if not needed) */
|
|
4501
|
+
quoteMint: Address;
|
|
4502
|
+
};
|
|
4503
|
+
declare function getInitializeOracleArgsEncoder(): FixedSizeEncoder<InitializeOracleArgsArgs>;
|
|
4504
|
+
declare function getInitializeOracleArgsDecoder(): FixedSizeDecoder<InitializeOracleArgs>;
|
|
4505
|
+
declare function getInitializeOracleArgsCodec(): FixedSizeCodec<InitializeOracleArgsArgs, InitializeOracleArgs>;
|
|
4506
|
+
|
|
4507
|
+
/**
|
|
4508
|
+
* Derive the OracleState PDA address.
|
|
4509
|
+
* Seeds: ["oracle", oracleAuthority, nonce_le_u64]
|
|
4510
|
+
*
|
|
4511
|
+
* The nonce allows a single authority to create multiple independent oracles.
|
|
4512
|
+
* Use Date.now() or any unique u64 value.
|
|
4513
|
+
*/
|
|
4514
|
+
declare function getOracleStateAddress(oracleAuthority: Address, nonce: bigint): Promise<ProgramDerivedAddress>;
|
|
4515
|
+
|
|
4516
|
+
declare const index_FINALIZE_DISCRIMINATOR: typeof FINALIZE_DISCRIMINATOR;
|
|
4517
|
+
type index_FinalizeInput<TAccountOracleAuthority extends string = string, TAccountOracleState extends string = string> = FinalizeInput<TAccountOracleAuthority, TAccountOracleState>;
|
|
4518
|
+
type index_FinalizeInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountOracleAuthority extends string | AccountMeta<string> = string, TAccountOracleState extends string | AccountMeta<string> = string, TRemainingAccounts extends readonly AccountMeta<string>[] = []> = FinalizeInstruction<TProgram, TAccountOracleAuthority, TAccountOracleState, TRemainingAccounts>;
|
|
4519
|
+
type index_FinalizeInstructionData = FinalizeInstructionData;
|
|
4520
|
+
type index_FinalizeInstructionDataArgs = FinalizeInstructionDataArgs;
|
|
4521
|
+
declare const index_INITIALIZE_ORACLE_DISCRIMINATOR: typeof INITIALIZE_ORACLE_DISCRIMINATOR;
|
|
4522
|
+
type index_InitializeOracleArgs = InitializeOracleArgs;
|
|
4523
|
+
type index_InitializeOracleArgsArgs = InitializeOracleArgsArgs;
|
|
4524
|
+
type index_InitializeOracleInput<TAccountOracleAuthority extends string = string, TAccountOracleState extends string = string, TAccountSystemProgram extends string = string> = InitializeOracleInput<TAccountOracleAuthority, TAccountOracleState, TAccountSystemProgram>;
|
|
4525
|
+
type index_InitializeOracleInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountOracleAuthority extends string | AccountMeta<string> = string, TAccountOracleState extends string | AccountMeta<string> = string, TAccountSystemProgram extends string | AccountMeta<string> = '11111111111111111111111111111111', TRemainingAccounts extends readonly AccountMeta<string>[] = []> = InitializeOracleInstruction<TProgram, TAccountOracleAuthority, TAccountOracleState, TAccountSystemProgram, TRemainingAccounts>;
|
|
4526
|
+
type index_InitializeOracleInstructionData = InitializeOracleInstructionData;
|
|
4527
|
+
type index_InitializeOracleInstructionDataArgs = InitializeOracleInstructionDataArgs;
|
|
4528
|
+
declare const index_ORACLE_STATE_DISCRIMINATOR: typeof ORACLE_STATE_DISCRIMINATOR;
|
|
4529
|
+
type index_OracleState = OracleState;
|
|
4530
|
+
type index_OracleStateArgs = OracleStateArgs;
|
|
4531
|
+
type index_ParsedFinalizeInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedFinalizeInstruction<TProgram, TAccountMetas>;
|
|
4532
|
+
type index_ParsedInitializeOracleInstruction<TProgram extends string = typeof TRUSTED_ORACLE_PROGRAM_ADDRESS, TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[]> = ParsedInitializeOracleInstruction<TProgram, TAccountMetas>;
|
|
4533
|
+
type index_ParsedTrustedOracleInstruction<TProgram extends string = 'HhUzN7VvonNUevATyugZUepzxpeEZMXQbV92X2xvsp5m'> = ParsedTrustedOracleInstruction<TProgram>;
|
|
4534
|
+
declare const index_TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED: typeof TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED;
|
|
4535
|
+
declare const index_TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT: typeof TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT;
|
|
4536
|
+
declare const index_TRUSTED_ORACLE_ERROR__NOT_FINALIZED: typeof TRUSTED_ORACLE_ERROR__NOT_FINALIZED;
|
|
4537
|
+
declare const index_TRUSTED_ORACLE_ERROR__UNAUTHORIZED: typeof TRUSTED_ORACLE_ERROR__UNAUTHORIZED;
|
|
4538
|
+
declare const index_TRUSTED_ORACLE_PROGRAM_ADDRESS: typeof TRUSTED_ORACLE_PROGRAM_ADDRESS;
|
|
4539
|
+
type index_TrustedOracleAccount = TrustedOracleAccount;
|
|
4540
|
+
declare const index_TrustedOracleAccount: typeof TrustedOracleAccount;
|
|
4541
|
+
type index_TrustedOracleError = TrustedOracleError;
|
|
4542
|
+
type index_TrustedOracleInstruction = TrustedOracleInstruction;
|
|
4543
|
+
declare const index_TrustedOracleInstruction: typeof TrustedOracleInstruction;
|
|
4544
|
+
type index_TrustedOraclePlugin = TrustedOraclePlugin;
|
|
4545
|
+
type index_TrustedOraclePluginAccounts = TrustedOraclePluginAccounts;
|
|
4546
|
+
type index_TrustedOraclePluginInstructions = TrustedOraclePluginInstructions;
|
|
4547
|
+
type index_TrustedOraclePluginRequirements = TrustedOraclePluginRequirements;
|
|
4548
|
+
declare const index_decodeOracleState: typeof decodeOracleState;
|
|
4549
|
+
declare const index_fetchAllMaybeOracleState: typeof fetchAllMaybeOracleState;
|
|
4550
|
+
declare const index_fetchAllOracleState: typeof fetchAllOracleState;
|
|
4551
|
+
declare const index_fetchMaybeOracleState: typeof fetchMaybeOracleState;
|
|
4552
|
+
declare const index_fetchOracleState: typeof fetchOracleState;
|
|
4553
|
+
declare const index_getFinalizeDiscriminatorBytes: typeof getFinalizeDiscriminatorBytes;
|
|
4554
|
+
declare const index_getFinalizeInstruction: typeof getFinalizeInstruction;
|
|
4555
|
+
declare const index_getFinalizeInstructionDataCodec: typeof getFinalizeInstructionDataCodec;
|
|
4556
|
+
declare const index_getFinalizeInstructionDataDecoder: typeof getFinalizeInstructionDataDecoder;
|
|
4557
|
+
declare const index_getFinalizeInstructionDataEncoder: typeof getFinalizeInstructionDataEncoder;
|
|
4558
|
+
declare const index_getInitializeOracleArgsCodec: typeof getInitializeOracleArgsCodec;
|
|
4559
|
+
declare const index_getInitializeOracleArgsDecoder: typeof getInitializeOracleArgsDecoder;
|
|
4560
|
+
declare const index_getInitializeOracleArgsEncoder: typeof getInitializeOracleArgsEncoder;
|
|
4561
|
+
declare const index_getInitializeOracleDiscriminatorBytes: typeof getInitializeOracleDiscriminatorBytes;
|
|
4562
|
+
declare const index_getInitializeOracleInstruction: typeof getInitializeOracleInstruction;
|
|
4563
|
+
declare const index_getInitializeOracleInstructionDataCodec: typeof getInitializeOracleInstructionDataCodec;
|
|
4564
|
+
declare const index_getInitializeOracleInstructionDataDecoder: typeof getInitializeOracleInstructionDataDecoder;
|
|
4565
|
+
declare const index_getInitializeOracleInstructionDataEncoder: typeof getInitializeOracleInstructionDataEncoder;
|
|
4566
|
+
declare const index_getOracleStateAddress: typeof getOracleStateAddress;
|
|
4567
|
+
declare const index_getOracleStateCodec: typeof getOracleStateCodec;
|
|
4568
|
+
declare const index_getOracleStateDecoder: typeof getOracleStateDecoder;
|
|
4569
|
+
declare const index_getOracleStateDiscriminatorBytes: typeof getOracleStateDiscriminatorBytes;
|
|
4570
|
+
declare const index_getOracleStateEncoder: typeof getOracleStateEncoder;
|
|
4571
|
+
declare const index_getOracleStateSize: typeof getOracleStateSize;
|
|
4572
|
+
declare const index_getTrustedOracleErrorMessage: typeof getTrustedOracleErrorMessage;
|
|
4573
|
+
declare const index_identifyTrustedOracleAccount: typeof identifyTrustedOracleAccount;
|
|
4574
|
+
declare const index_identifyTrustedOracleInstruction: typeof identifyTrustedOracleInstruction;
|
|
4575
|
+
declare const index_isTrustedOracleError: typeof isTrustedOracleError;
|
|
4576
|
+
declare const index_parseFinalizeInstruction: typeof parseFinalizeInstruction;
|
|
4577
|
+
declare const index_parseInitializeOracleInstruction: typeof parseInitializeOracleInstruction;
|
|
4578
|
+
declare const index_parseTrustedOracleInstruction: typeof parseTrustedOracleInstruction;
|
|
4579
|
+
declare const index_trustedOracleProgram: typeof trustedOracleProgram;
|
|
4580
|
+
declare namespace index {
|
|
4581
|
+
export { index_FINALIZE_DISCRIMINATOR as FINALIZE_DISCRIMINATOR, type index_FinalizeInput as FinalizeInput, type index_FinalizeInstruction as FinalizeInstruction, type index_FinalizeInstructionData as FinalizeInstructionData, type index_FinalizeInstructionDataArgs as FinalizeInstructionDataArgs, index_INITIALIZE_ORACLE_DISCRIMINATOR as INITIALIZE_ORACLE_DISCRIMINATOR, type index_InitializeOracleArgs as InitializeOracleArgs, type index_InitializeOracleArgsArgs as InitializeOracleArgsArgs, type index_InitializeOracleInput as InitializeOracleInput, type index_InitializeOracleInstruction as InitializeOracleInstruction, type index_InitializeOracleInstructionData as InitializeOracleInstructionData, type index_InitializeOracleInstructionDataArgs as InitializeOracleInstructionDataArgs, index_ORACLE_STATE_DISCRIMINATOR as ORACLE_STATE_DISCRIMINATOR, type index_OracleState as OracleState, type index_OracleStateArgs as OracleStateArgs, type index_ParsedFinalizeInstruction as ParsedFinalizeInstruction, type index_ParsedInitializeOracleInstruction as ParsedInitializeOracleInstruction, type index_ParsedTrustedOracleInstruction as ParsedTrustedOracleInstruction, index_TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED as TRUSTED_ORACLE_ERROR__ALREADY_FINALIZED, index_TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT as TRUSTED_ORACLE_ERROR__INVALID_WINNING_MINT, index_TRUSTED_ORACLE_ERROR__NOT_FINALIZED as TRUSTED_ORACLE_ERROR__NOT_FINALIZED, index_TRUSTED_ORACLE_ERROR__UNAUTHORIZED as TRUSTED_ORACLE_ERROR__UNAUTHORIZED, index_TRUSTED_ORACLE_PROGRAM_ADDRESS as TRUSTED_ORACLE_PROGRAM_ADDRESS, index_TrustedOracleAccount as TrustedOracleAccount, type index_TrustedOracleError as TrustedOracleError, index_TrustedOracleInstruction as TrustedOracleInstruction, type index_TrustedOraclePlugin as TrustedOraclePlugin, type index_TrustedOraclePluginAccounts as TrustedOraclePluginAccounts, type index_TrustedOraclePluginInstructions as TrustedOraclePluginInstructions, type index_TrustedOraclePluginRequirements as TrustedOraclePluginRequirements, index_decodeOracleState as decodeOracleState, index_fetchAllMaybeOracleState as fetchAllMaybeOracleState, index_fetchAllOracleState as fetchAllOracleState, index_fetchMaybeOracleState as fetchMaybeOracleState, index_fetchOracleState as fetchOracleState, index_getFinalizeDiscriminatorBytes as getFinalizeDiscriminatorBytes, index_getFinalizeInstruction as getFinalizeInstruction, index_getFinalizeInstructionDataCodec as getFinalizeInstructionDataCodec, index_getFinalizeInstructionDataDecoder as getFinalizeInstructionDataDecoder, index_getFinalizeInstructionDataEncoder as getFinalizeInstructionDataEncoder, index_getInitializeOracleArgsCodec as getInitializeOracleArgsCodec, index_getInitializeOracleArgsDecoder as getInitializeOracleArgsDecoder, index_getInitializeOracleArgsEncoder as getInitializeOracleArgsEncoder, index_getInitializeOracleDiscriminatorBytes as getInitializeOracleDiscriminatorBytes, index_getInitializeOracleInstruction as getInitializeOracleInstruction, index_getInitializeOracleInstructionDataCodec as getInitializeOracleInstructionDataCodec, index_getInitializeOracleInstructionDataDecoder as getInitializeOracleInstructionDataDecoder, index_getInitializeOracleInstructionDataEncoder as getInitializeOracleInstructionDataEncoder, index_getOracleStateAddress as getOracleStateAddress, index_getOracleStateCodec as getOracleStateCodec, index_getOracleStateDecoder as getOracleStateDecoder, index_getOracleStateDiscriminatorBytes as getOracleStateDiscriminatorBytes, index_getOracleStateEncoder as getOracleStateEncoder, index_getOracleStateSize as getOracleStateSize, index_getTrustedOracleErrorMessage as getTrustedOracleErrorMessage, index_identifyTrustedOracleAccount as identifyTrustedOracleAccount, index_identifyTrustedOracleInstruction as identifyTrustedOracleInstruction, index_isTrustedOracleError as isTrustedOracleError, index_parseFinalizeInstruction as parseFinalizeInstruction, index_parseInitializeOracleInstruction as parseInitializeOracleInstruction, index_parseTrustedOracleInstruction as parseTrustedOracleInstruction, index_trustedOracleProgram as trustedOracleProgram };
|
|
4582
|
+
}
|
|
4583
|
+
|
|
4584
|
+
export { index$4 as cpmm, index$2 as cpmmMigrator, index$3 as initializer, index$1 as predictionMigrator, index as trustedOracle };
|