@gabox-labs/sdk 0.2.0 → 0.6.0
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/CHANGELOG.md +226 -0
- package/README.md +116 -460
- package/dist/generated/index.d.ts +334 -755
- package/dist/generated/index.js +2403 -338
- package/dist/generated/index.js.map +1 -1
- package/dist/index-BDfGvmgF.d.ts +934 -0
- package/dist/index.d.ts +191 -448
- package/dist/index.js +468 -1034
- package/dist/index.js.map +1 -1
- package/dist/raydium/index.d.ts +2 -0
- package/dist/raydium/index.js +2 -0
- package/dist/raydium-B-l9V3O-.js +2604 -0
- package/dist/raydium-B-l9V3O-.js.map +1 -0
- package/llms.txt +4 -2
- package/package.json +11 -16
- package/skills/gabox-sdk/SKILL.md +40 -142
- package/skills/gabox-sdk/references/api.md +103 -145
- package/dist/gaboxV2-CV2XltqC.js +0 -3347
- package/dist/gaboxV2-CV2XltqC.js.map +0 -1
- package/dist/index-BxvSkzCO.d.ts +0 -471
- package/dist/pump/index.d.ts +0 -2
- package/dist/pump/index.js +0 -2
- package/dist/pump-D0K_0uiC.js +0 -1531
- package/dist/pump-D0K_0uiC.js.map +0 -1
|
@@ -0,0 +1,934 @@
|
|
|
1
|
+
import { AccountMeta, Address, AddressesByLookupTableAddress, Instruction, Rpc, RpcSubscriptions, SolanaRpcApi, SolanaRpcSubscriptionsApi, TransactionMessage, TransactionMessageWithBlockhashLifetime, TransactionMessageWithFeePayerSigner, TransactionSigner } from "@solana/kit";
|
|
2
|
+
//#region src/rpc.d.ts
|
|
3
|
+
type Cluster = 'devnet' | 'mainnet-beta' | 'localnet';
|
|
4
|
+
/** Solana's public endpoints, and the test validator's default ports. */
|
|
5
|
+
declare const CLUSTER_ENDPOINTS: Readonly<Record<Cluster, {
|
|
6
|
+
url: string;
|
|
7
|
+
wsUrl: string;
|
|
8
|
+
}>>;
|
|
9
|
+
declare const DEVNET_HTTP: string;
|
|
10
|
+
declare const DEVNET_WS: string;
|
|
11
|
+
type GaboxRpc = Rpc<SolanaRpcApi>;
|
|
12
|
+
type GaboxRpcSubscriptions = RpcSubscriptions<SolanaRpcSubscriptionsApi>;
|
|
13
|
+
type ClientConfig = {
|
|
14
|
+
/** The cluster this client talks to. Required: see the file comment. */
|
|
15
|
+
cluster: Cluster;
|
|
16
|
+
/** HTTP endpoint. Defaults to the cluster's entry in `CLUSTER_ENDPOINTS`. */
|
|
17
|
+
url?: string;
|
|
18
|
+
/**
|
|
19
|
+
* WebSocket endpoint. Left out, it follows `url`: `https` becomes `wss`, `http` becomes `ws`.
|
|
20
|
+
* When `url` is left out too, it is the cluster's default.
|
|
21
|
+
*/
|
|
22
|
+
wsUrl?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Address lookup tables every builder compresses with. Defaults to the cluster's shared table,
|
|
25
|
+
* which only devnet has today; other clusters default to none. Pass `{}` to disable compression.
|
|
26
|
+
*/
|
|
27
|
+
addressLookupTables?: AddressesByLookupTableAddress;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Everything the SDK needs to talk to one cluster. Pass it to every chain-touching function.
|
|
31
|
+
*
|
|
32
|
+
* A plain object, so a caller who needs a custom transport can spread it:
|
|
33
|
+
* `{ ...createClient({ cluster }), rpc: createSolanaRpcFromTransport(transport) }`.
|
|
34
|
+
*/
|
|
35
|
+
type GaboxClient = Readonly<{
|
|
36
|
+
cluster: Cluster;
|
|
37
|
+
url: string;
|
|
38
|
+
wsUrl: string;
|
|
39
|
+
rpc: GaboxRpc;
|
|
40
|
+
rpcSubscriptions: GaboxRpcSubscriptions;
|
|
41
|
+
addressLookupTables: AddressesByLookupTableAddress;
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* The cluster a URL names, from its text alone. A substring check, deliberately: providers spell
|
|
45
|
+
* it many ways. `null` when the URL names none, which is a local validator or a private endpoint.
|
|
46
|
+
*/
|
|
47
|
+
declare function clusterNamedBy(url: string): Cluster | 'testnet' | null;
|
|
48
|
+
/**
|
|
49
|
+
* Refuse a URL that contradicts the declared cluster. Exported so a script can check a URL before
|
|
50
|
+
* it does anything else with it. The rules are in the file comment.
|
|
51
|
+
*/
|
|
52
|
+
declare function assertClusterUrl(cluster: Cluster, url: string): void;
|
|
53
|
+
/** `https://x` becomes `wss://x`, `http://x` becomes `ws://x`. Anything else is returned as is. */
|
|
54
|
+
declare function websocketUrlFor(url: string): string;
|
|
55
|
+
/**
|
|
56
|
+
* The SDK's init step. Call it once and pass the result everywhere.
|
|
57
|
+
*
|
|
58
|
+
* Both RPC clients are created together because everything in this SDK that watches a draw needs
|
|
59
|
+
* the pair: the subscription reports the change, and the RPC reads the account that changed.
|
|
60
|
+
*/
|
|
61
|
+
declare function createClient(config: ClientConfig): GaboxClient;
|
|
62
|
+
//#endregion
|
|
63
|
+
//#region src/raydium/abi.d.ts
|
|
64
|
+
/** One account slot: its IDL name and the privileges the venue's own ABI gives it. */
|
|
65
|
+
type VenueAccountSpec = {
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly writable: boolean;
|
|
68
|
+
readonly signer: boolean;
|
|
69
|
+
};
|
|
70
|
+
type VenueInstructionAbi = {
|
|
71
|
+
readonly name: string;
|
|
72
|
+
readonly discriminator: Uint8Array;
|
|
73
|
+
readonly accounts: readonly VenueAccountSpec[];
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The Raydium deployment of one cluster. Mainnet and devnet run different programs, so every
|
|
77
|
+
* address here differs between the two, and so does the quote the curve must raise.
|
|
78
|
+
*/
|
|
79
|
+
type RaydiumClusterIds = {
|
|
80
|
+
/** Raydium LaunchLab, the bonding curve a Gabox coin launches and trades on first. */
|
|
81
|
+
readonly launchlab: Address;
|
|
82
|
+
/** PDA(["vault_auth_seed"], launchlab). Signs LaunchLab's own vault transfers. */
|
|
83
|
+
readonly launchlabAuthority: Address;
|
|
84
|
+
/** PDA(["__event_authority"], launchlab). */
|
|
85
|
+
readonly launchlabEventAuthority: Address;
|
|
86
|
+
/** PDA(["global_config", WSOL, u8 0, u16 big-endian 0], launchlab). Holds the curve settings. */
|
|
87
|
+
readonly solGlobalConfig: Address;
|
|
88
|
+
/** PDA(["platform_config", PLATFORM_ADMIN], launchlab). The Gabox platform on LaunchLab. */
|
|
89
|
+
readonly gaboxPlatform: Address;
|
|
90
|
+
/** Raydium CPMM, the pool a Gabox coin graduates into. */
|
|
91
|
+
readonly cpmm: Address;
|
|
92
|
+
/** PDA(["vault_and_lp_mint_auth_seed"], cpmm). */
|
|
93
|
+
readonly cpmmAuthority: Address;
|
|
94
|
+
/**
|
|
95
|
+
* The quote the curve must raise before the coin graduates, in lamports.
|
|
96
|
+
*
|
|
97
|
+
* There is no fee tier here on purpose. The Gabox platform config names the CPMM fee tier a coin
|
|
98
|
+
* graduates into, and a migrated pool records it again in its own data. Both are read from the
|
|
99
|
+
* chain, never compiled in.
|
|
100
|
+
*/
|
|
101
|
+
readonly launchQuoteRaise: bigint;
|
|
102
|
+
};
|
|
103
|
+
declare const RAYDIUM_MAINNET_IDS: RaydiumClusterIds;
|
|
104
|
+
declare const RAYDIUM_DEVNET_IDS: RaydiumClusterIds;
|
|
105
|
+
/** Wrapped SOL. The only quote Gabox accepts today, on both venues. */
|
|
106
|
+
declare const WSOL_MINT: Address;
|
|
107
|
+
/** Metaplex Token Metadata, which LaunchLab's create instruction writes to. */
|
|
108
|
+
declare const METAPLEX_PROGRAM_ADDRESS: Address;
|
|
109
|
+
/**
|
|
110
|
+
* `PLATFORM_ADMIN` in the program's constants.rs. The Gabox platform config PDA derives from this
|
|
111
|
+
* wallet, and LaunchLab pays the platform share of every curve trade to it.
|
|
112
|
+
*/
|
|
113
|
+
declare const PLATFORM_ADMIN: Address;
|
|
114
|
+
/** The coin supply every Gabox launch mints: 1,000,000,000 coins at 6 decimals. */
|
|
115
|
+
declare const LAUNCH_SUPPLY = 1000000000000000n;
|
|
116
|
+
/** The part of the supply the LaunchLab curve sells: 793,100,000 coins. */
|
|
117
|
+
declare const LAUNCH_TOTAL_BASE_SELL = 793100000000000n;
|
|
118
|
+
/** Classic SPL Token. LaunchLab pins it on both sides of every Gabox launch and trade. */
|
|
119
|
+
declare const TOKEN_PROGRAM_ADDRESS: Address;
|
|
120
|
+
declare const ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address;
|
|
121
|
+
declare const SYSTEM_PROGRAM_ADDRESS: Address;
|
|
122
|
+
/** The rent sysvar. LaunchLab's create instruction still takes it. */
|
|
123
|
+
declare const RENT_SYSVAR_ADDRESS: Address;
|
|
124
|
+
/**
|
|
125
|
+
* The first eight bytes of each Raydium account this SDK decodes. `adapter.ts` checks them before
|
|
126
|
+
* it reads a field, so an account of the wrong type fails loudly instead of decoding as rubbish.
|
|
127
|
+
*
|
|
128
|
+
* LaunchLab and CPMM give their pool account the same eight bytes, because Anchor derives a
|
|
129
|
+
* discriminator from the struct name alone and both are called `PoolState`. The two programs own
|
|
130
|
+
* different accounts, so the pair never collides in practice.
|
|
131
|
+
*/
|
|
132
|
+
declare const LAUNCHLAB_POOL_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
133
|
+
declare const LAUNCHLAB_GLOBAL_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
134
|
+
declare const LAUNCHLAB_PLATFORM_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
135
|
+
declare const CPMM_POOL_STATE_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
136
|
+
declare const CPMM_AMM_CONFIG_DISCRIMINATOR: Uint8Array<ArrayBuffer>;
|
|
137
|
+
/**
|
|
138
|
+
* `initialize_v2` on `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` — cross-checked against interfaces.json.
|
|
139
|
+
*/
|
|
140
|
+
declare const LAUNCHLAB_INITIALIZE: VenueInstructionAbi;
|
|
141
|
+
/**
|
|
142
|
+
* `buy_exact_in` on `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` — not in interfaces.json (the program never builds it).
|
|
143
|
+
* The last three accounts are not in the IDL. LaunchLab reads them from the remaining
|
|
144
|
+
* accounts, in this order.
|
|
145
|
+
*/
|
|
146
|
+
declare const LAUNCHLAB_BUY_EXACT_IN: VenueInstructionAbi;
|
|
147
|
+
/**
|
|
148
|
+
* `buy_exact_out` on `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` — cross-checked against interfaces.json.
|
|
149
|
+
* The last three accounts are not in the IDL. LaunchLab reads them from the remaining
|
|
150
|
+
* accounts, in this order.
|
|
151
|
+
*/
|
|
152
|
+
declare const LAUNCHLAB_BUY_EXACT_OUT: VenueInstructionAbi;
|
|
153
|
+
/**
|
|
154
|
+
* `sell_exact_in` on `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` — cross-checked against interfaces.json.
|
|
155
|
+
* The last three accounts are not in the IDL. LaunchLab reads them from the remaining
|
|
156
|
+
* accounts, in this order.
|
|
157
|
+
*/
|
|
158
|
+
declare const LAUNCHLAB_SELL_EXACT_IN: VenueInstructionAbi;
|
|
159
|
+
/**
|
|
160
|
+
* `claim_creator_fee` on `LanMV9sAd7wArD4vJFi2qDdfnVhFxYSUg6eADduJ3uj` — not in interfaces.json (the program never builds it).
|
|
161
|
+
*/
|
|
162
|
+
declare const LAUNCHLAB_CLAIM_CREATOR_FEE: VenueInstructionAbi;
|
|
163
|
+
/**
|
|
164
|
+
* `swap_base_output` on `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` — cross-checked against interfaces.json.
|
|
165
|
+
*/
|
|
166
|
+
declare const CPMM_SWAP_BASE_OUTPUT: VenueInstructionAbi;
|
|
167
|
+
/**
|
|
168
|
+
* `swap_base_input` on `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` — cross-checked against interfaces.json.
|
|
169
|
+
*/
|
|
170
|
+
declare const CPMM_SWAP_BASE_INPUT: VenueInstructionAbi;
|
|
171
|
+
/**
|
|
172
|
+
* `collect_creator_fee` on `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C` — not in interfaces.json (the program never builds it).
|
|
173
|
+
* The last account is not in the IDL snapshot; see `CPMM_CREATOR_FEE_SHARE_ACCOUNT` in
|
|
174
|
+
* scripts/codegen.mjs. Derive it as PDA(["creator_fee_share", creator, amm_config]).
|
|
175
|
+
*/
|
|
176
|
+
declare const CPMM_COLLECT_CREATOR_FEE: VenueInstructionAbi;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/raydium/ids.d.ts
|
|
179
|
+
/** The name the rest of the SDK uses for one cluster's Raydium deployment. */
|
|
180
|
+
type RaydiumIds = RaydiumClusterIds;
|
|
181
|
+
/**
|
|
182
|
+
* The decimals every Gabox coin is launched with. `venue/launch.rs` refuses any other value, and
|
|
183
|
+
* `tokens.rs` refuses a pool mint that does not have exactly this many.
|
|
184
|
+
*/
|
|
185
|
+
declare const LAUNCH_DECIMALS = 6;
|
|
186
|
+
/**
|
|
187
|
+
* The Raydium deployment of each cluster.
|
|
188
|
+
*
|
|
189
|
+
* `localnet` uses the mainnet set. A local validator normally clones the mainnet Raydium programs,
|
|
190
|
+
* and the program's own default `anchor build` pins the mainnet addresses too; the `devnet` cargo
|
|
191
|
+
* feature is what swaps them. Pass your own ids to a builder if your validator clones devnet.
|
|
192
|
+
*/
|
|
193
|
+
declare const RAYDIUM_IDS: Readonly<Record<Cluster, RaydiumIds>>;
|
|
194
|
+
/** The Raydium deployment one cluster trades on. Throws for a cluster this SDK does not know. */
|
|
195
|
+
declare function raydiumIds(cluster: Cluster): RaydiumIds;
|
|
196
|
+
/** LaunchLab's PDA seeds, and the two Gabox coins are always sorted against. */
|
|
197
|
+
declare const LAUNCHLAB_SEEDS: {
|
|
198
|
+
/** `["vault_auth_seed"]`. */
|
|
199
|
+
readonly authority: "vault_auth_seed";
|
|
200
|
+
/** `["__event_authority"]`. */
|
|
201
|
+
readonly eventAuthority: "__event_authority";
|
|
202
|
+
/** `["global_config", quote_mint, u8 curve_type, u16 big-endian index]`. */
|
|
203
|
+
readonly globalConfig: "global_config";
|
|
204
|
+
/** `["platform_config", platform_admin]`. */
|
|
205
|
+
readonly platformConfig: "platform_config";
|
|
206
|
+
/** `["pool", base_mint, quote_mint]`. */
|
|
207
|
+
readonly pool: "pool";
|
|
208
|
+
/** `["pool_vault", pool_state, mint]`. */
|
|
209
|
+
readonly vault: "pool_vault";
|
|
210
|
+
/** `["creator_fee_vault_auth_seed"]`, the authority over every creator fee vault. */
|
|
211
|
+
readonly creatorFeeVaultAuthority: "creator_fee_vault_auth_seed";
|
|
212
|
+
};
|
|
213
|
+
/** CPMM's PDA seeds. */
|
|
214
|
+
declare const CPMM_SEEDS: {
|
|
215
|
+
/** `["vault_and_lp_mint_auth_seed"]`. */
|
|
216
|
+
readonly authority: "vault_and_lp_mint_auth_seed";
|
|
217
|
+
/** `["pool", amm_config, token_0_mint, token_1_mint]`, the mints sorted by byte order. */
|
|
218
|
+
readonly pool: "pool";
|
|
219
|
+
/** `["pool_vault", pool_state, mint]`. */
|
|
220
|
+
readonly vault: "pool_vault";
|
|
221
|
+
/** `["observation", pool_state]`. */
|
|
222
|
+
readonly observation: "observation";
|
|
223
|
+
/** `["creator_fee_share", creator, amm_config]`. */
|
|
224
|
+
readonly creatorFeeShare: "creator_fee_share";
|
|
225
|
+
};
|
|
226
|
+
/** Metaplex's metadata PDA seed: `["metadata", metaplex, mint]`. */
|
|
227
|
+
declare const METADATA_SEED = "metadata";
|
|
228
|
+
/**
|
|
229
|
+
* Every rate LaunchLab and CPMM state is out of 1,000,000, not out of 10,000. A `trade_fee_rate`
|
|
230
|
+
* of 5,000 is 0.5%.
|
|
231
|
+
*/
|
|
232
|
+
declare const RATE_DENOMINATOR = 1000000n;
|
|
233
|
+
/** The share-fee receiver Gabox never passes, so its rate is always zero on every trade. */
|
|
234
|
+
declare const SHARE_FEE_RATE = 0n;
|
|
235
|
+
/** `CurveParams::Constant`, the only curve shape Gabox launches. */
|
|
236
|
+
declare const CONSTANT_CURVE_TAG = 0;
|
|
237
|
+
/** `migrate_type` 1: the coin graduates into a CPMM pool, not into an AMM pool. */
|
|
238
|
+
declare const MIGRATE_TO_CPMM = 1;
|
|
239
|
+
/** `AmmCreatorFeeOn::QuoteToken`, so the CPMM creator fee is paid in WSOL. */
|
|
240
|
+
declare const CREATOR_FEE_ON_QUOTE = 0;
|
|
241
|
+
/** LaunchLab pool `status`: still selling on the curve. */
|
|
242
|
+
declare const LAUNCHLAB_STATUS_FUND = 0;
|
|
243
|
+
/** LaunchLab pool `status`: the raise is complete and Raydium's bot is migrating the coin. */
|
|
244
|
+
declare const LAUNCHLAB_STATUS_MIGRATE = 1;
|
|
245
|
+
/** LaunchLab pool `status`: the coin has graduated and trades on its CPMM pool. */
|
|
246
|
+
declare const LAUNCHLAB_STATUS_TRADE = 2;
|
|
247
|
+
/** Metaplex's own limits on the three strings a creator picks, in UTF-8 bytes. */
|
|
248
|
+
declare const METADATA_LIMITS: {
|
|
249
|
+
readonly name: 32;
|
|
250
|
+
readonly symbol: 10;
|
|
251
|
+
readonly uri: 200;
|
|
252
|
+
};
|
|
253
|
+
/** Raydium sorts a CPMM pair by raw address byte order. */
|
|
254
|
+
declare function sortedMints(a: Address, b: Address): [Address, Address];
|
|
255
|
+
/** Compare two addresses the way the runtime does: by their 32 raw bytes, not by base58 text. */
|
|
256
|
+
declare function compareAddresses(a: Address, b: Address): number;
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region src/raydium/adapter.d.ts
|
|
259
|
+
/**
|
|
260
|
+
* The `amount` field of an SPL token account: bytes 64 to 72, little-endian.
|
|
261
|
+
*
|
|
262
|
+
* Both venues and every Gabox account use classic SPL Token, whose account is 165 bytes. The
|
|
263
|
+
* Token-2022 layout shares those first 165 bytes, so this reader covers a Token-2022 account too.
|
|
264
|
+
*/
|
|
265
|
+
declare function tokenAccountAmount(data: Uint8Array): bigint;
|
|
266
|
+
/** The `mint` and `owner` of an SPL token account: bytes 0 to 32 and 32 to 64. */
|
|
267
|
+
declare function tokenAccountOwnerAndMint(data: Uint8Array): {
|
|
268
|
+
mint: Address;
|
|
269
|
+
owner: Address;
|
|
270
|
+
};
|
|
271
|
+
/** The curve pool of one coin, as far as pricing and routing need it. */
|
|
272
|
+
type LaunchlabPoolState = {
|
|
273
|
+
/** 0 while the curve still sells, 1 while Raydium migrates the coin, 2 once it has graduated. */
|
|
274
|
+
status: number;
|
|
275
|
+
baseDecimals: number;
|
|
276
|
+
quoteDecimals: number;
|
|
277
|
+
/** 1 means the coin graduates into a CPMM pool. Every Gabox launch pins this. */
|
|
278
|
+
migrateType: number;
|
|
279
|
+
supply: bigint;
|
|
280
|
+
/** The part of the supply the curve sells. The curve cannot sell more than this. */
|
|
281
|
+
totalBaseSell: bigint;
|
|
282
|
+
/** The curve's virtual reserves. `virtualQuote / virtualBase` is the starting price. */
|
|
283
|
+
virtualBase: bigint;
|
|
284
|
+
virtualQuote: bigint;
|
|
285
|
+
/** Coins the curve has already sold, and quote it has already raised. */
|
|
286
|
+
realBase: bigint;
|
|
287
|
+
realQuote: bigint;
|
|
288
|
+
totalQuoteFundRaising: bigint;
|
|
289
|
+
migrateFee: bigint;
|
|
290
|
+
globalConfig: Address;
|
|
291
|
+
platformConfig: Address;
|
|
292
|
+
baseMint: Address;
|
|
293
|
+
quoteMint: Address;
|
|
294
|
+
baseVault: Address;
|
|
295
|
+
quoteVault: Address;
|
|
296
|
+
/** The coin creator. LaunchLab pays the creator share of every trade to this wallet's vault. */
|
|
297
|
+
creator: Address;
|
|
298
|
+
/** 0 means the CPMM creator fee is paid in the quote token only. Every Gabox launch pins it. */
|
|
299
|
+
ammCreatorFeeOn: number;
|
|
300
|
+
};
|
|
301
|
+
/** The bytes the decoder above reads, discriminator included. The account itself is longer. */
|
|
302
|
+
declare const LAUNCHLAB_POOL_STATE_HEAD_SIZE = 367;
|
|
303
|
+
declare function decodeLaunchlabPool(data: Uint8Array): LaunchlabPoolState;
|
|
304
|
+
/** LaunchLab's settings for one quote asset. Gabox reads the trade fee and the migrate fee. */
|
|
305
|
+
type LaunchlabGlobalConfig = {
|
|
306
|
+
/** 0 is the constant product curve, the only shape Gabox launches. */
|
|
307
|
+
curveType: number;
|
|
308
|
+
index: number;
|
|
309
|
+
/** The quote LaunchLab keeps at graduation. It lowers the curve's own starting reserves. */
|
|
310
|
+
migrateFee: bigint;
|
|
311
|
+
/** Raydium's own share of every curve trade, out of 1,000,000. */
|
|
312
|
+
tradeFeeRate: bigint;
|
|
313
|
+
quoteMint: Address;
|
|
314
|
+
};
|
|
315
|
+
declare const LAUNCHLAB_GLOBAL_CONFIG_HEAD_SIZE = 115;
|
|
316
|
+
declare function decodeLaunchlabGlobalConfig(data: Uint8Array): LaunchlabGlobalConfig;
|
|
317
|
+
/** The Gabox platform on LaunchLab. Its two rates are the platform and creator shares. */
|
|
318
|
+
type LaunchlabPlatformConfig = {
|
|
319
|
+
/** Receives the platform share of every curve trade. */
|
|
320
|
+
platformFeeWallet: Address;
|
|
321
|
+
/** The platform share of every curve trade, out of 1,000,000. 5,000 is 0.5%. */
|
|
322
|
+
feeRate: bigint;
|
|
323
|
+
/** The coin creator's share of every curve trade, out of 1,000,000. 5,000 is 0.5%. */
|
|
324
|
+
creatorFeeRate: bigint;
|
|
325
|
+
/** The CPMM fee tier a coin of this platform graduates into. */
|
|
326
|
+
cpswapConfig: Address;
|
|
327
|
+
/**
|
|
328
|
+
* When this is a real wallet, it becomes the CPMM pool creator at graduation instead of the coin
|
|
329
|
+
* creator. Gabox leaves it empty, so its coin creators keep the CPMM creator fee.
|
|
330
|
+
*/
|
|
331
|
+
platformCpCreator: Address;
|
|
332
|
+
};
|
|
333
|
+
/** Everything before `curve_params`, discriminator included. */
|
|
334
|
+
declare const LAUNCHLAB_PLATFORM_CONFIG_HEAD_SIZE: number;
|
|
335
|
+
declare function decodeLaunchlabPlatformConfig(data: Uint8Array): LaunchlabPlatformConfig;
|
|
336
|
+
/** The pool a graduated Gabox coin trades in. */
|
|
337
|
+
type CpmmPoolState = {
|
|
338
|
+
ammConfig: Address;
|
|
339
|
+
/** LaunchLab sets this to the coin creator at migration. It earns the CPMM creator fee. */
|
|
340
|
+
poolCreator: Address;
|
|
341
|
+
token0Vault: Address;
|
|
342
|
+
token1Vault: Address;
|
|
343
|
+
token0Mint: Address;
|
|
344
|
+
token1Mint: Address;
|
|
345
|
+
token0Program: Address;
|
|
346
|
+
token1Program: Address;
|
|
347
|
+
observationKey: Address;
|
|
348
|
+
/** Bit flags. Bit 2 set (value 4) means swaps are switched off. */
|
|
349
|
+
status: number;
|
|
350
|
+
mint0Decimals: number;
|
|
351
|
+
mint1Decimals: number;
|
|
352
|
+
/** Fees the pool owes and a swap must not spend. Subtract them from the vault balances. */
|
|
353
|
+
protocolFeesToken0: bigint;
|
|
354
|
+
protocolFeesToken1: bigint;
|
|
355
|
+
fundFeesToken0: bigint;
|
|
356
|
+
fundFeesToken1: bigint;
|
|
357
|
+
creatorFeesToken0: bigint;
|
|
358
|
+
creatorFeesToken1: bigint;
|
|
359
|
+
/** Unix seconds. Swaps fail before it. */
|
|
360
|
+
openTime: bigint;
|
|
361
|
+
/** 0 charges the creator fee on whichever token comes in, 1 only token 0, 2 only token 1. */
|
|
362
|
+
creatorFeeOn: number;
|
|
363
|
+
/** `false` switches the creator fee off entirely. */
|
|
364
|
+
enableCreatorFee: boolean;
|
|
365
|
+
};
|
|
366
|
+
declare const CPMM_POOL_STATE_HEAD_SIZE = 413;
|
|
367
|
+
/**
|
|
368
|
+
* The full byte length of a CPMM `PoolState`, trailing padding included. A `getProgramAccounts`
|
|
369
|
+
* scan filters on it, so it has to be the whole account and not only the part decoded above.
|
|
370
|
+
*/
|
|
371
|
+
declare const CPMM_POOL_STATE_SIZE = 637;
|
|
372
|
+
/**
|
|
373
|
+
* Byte offsets a `getProgramAccounts` scan matches on. They are the same offsets `venue/trade.rs`
|
|
374
|
+
* reads the fields at, so a pool that passes the scan passes the program's own check.
|
|
375
|
+
*/
|
|
376
|
+
declare const CPMM_POOL_OFFSETS: {
|
|
377
|
+
readonly ammConfig: 8;
|
|
378
|
+
readonly poolCreator: 40;
|
|
379
|
+
readonly token0Mint: 168;
|
|
380
|
+
readonly token1Mint: 200;
|
|
381
|
+
readonly enableCreatorFee: 390;
|
|
382
|
+
};
|
|
383
|
+
declare function decodeCpmmPool(data: Uint8Array): CpmmPoolState;
|
|
384
|
+
/** One CPMM fee tier. Every rate is out of 1,000,000. */
|
|
385
|
+
type CpmmAmmConfig = {
|
|
386
|
+
index: number;
|
|
387
|
+
disableCreatePool: boolean;
|
|
388
|
+
/** The pool's own fee on every swap. Devnet tier 5 is 5,000, which is 0.50%. */
|
|
389
|
+
tradeFeeRate: bigint;
|
|
390
|
+
/** Raydium's share of the trade fee, not an extra charge on the swap. */
|
|
391
|
+
protocolFeeRate: bigint;
|
|
392
|
+
fundFeeRate: bigint;
|
|
393
|
+
/** The pool creator's fee on every swap. Devnet tier 5 is 4,000, which is 0.40%. */
|
|
394
|
+
creatorFeeRate: bigint;
|
|
395
|
+
};
|
|
396
|
+
declare const CPMM_AMM_CONFIG_HEAD_SIZE = 116;
|
|
397
|
+
declare function decodeCpmmAmmConfig(data: Uint8Array): CpmmAmmConfig;
|
|
398
|
+
//#endregion
|
|
399
|
+
//#region src/raydium/curve.d.ts
|
|
400
|
+
/**
|
|
401
|
+
* Raydium's own price math, ported to bigint.
|
|
402
|
+
*
|
|
403
|
+
* Every function here is a line-by-line port of Raydium's TypeScript, which is itself the same math
|
|
404
|
+
* their on-chain programs run. The point is that a buyer sees the exact number the venue will
|
|
405
|
+
* charge, not an estimate: `buy_pack` passes the pack size as an exact-tokens-out amount, and the
|
|
406
|
+
* program then requires the token delta to equal one pack.
|
|
407
|
+
*
|
|
408
|
+
* Sources, read on 2026-09-18:
|
|
409
|
+
*
|
|
410
|
+
* - `raydium/launchpad/curve/constantProductCurve.ts` and `curve.ts` (LaunchLab)
|
|
411
|
+
* - `raydium/cpmm/curve/calculator.ts`, `constantProduct.ts` and `fee.ts` (CPMM)
|
|
412
|
+
*
|
|
413
|
+
* Raydium uses `BN`, which truncates toward zero on division. Every value here is a non-negative
|
|
414
|
+
* bigint, where `/` truncates the same way, so a plain `/` is the faithful port of their `.div()`.
|
|
415
|
+
* Where they round up they call a ceiling helper, and so does this file. Nothing is approximated
|
|
416
|
+
* and no step is reordered: a division that happens before a subtraction there happens before it
|
|
417
|
+
* here, because the two orders give different answers.
|
|
418
|
+
*
|
|
419
|
+
* Every rate is out of 1,000,000, not out of 10,000.
|
|
420
|
+
*/
|
|
421
|
+
/** `ceilDiv(a, b, denominator)` in Raydium's code: `ceil(a * b / denominator)`. */
|
|
422
|
+
declare function ceilDivRate(amount: bigint, rate: bigint, denominator?: bigint): bigint;
|
|
423
|
+
/** `ceil(numerator / denominator)` for non-negative values. */
|
|
424
|
+
declare function ceilDiv(numerator: bigint, denominator: bigint): bigint;
|
|
425
|
+
/**
|
|
426
|
+
* The amount before a fee was taken, given the amount after it: `ceil(post * 1e6 / (1e6 - rate))`.
|
|
427
|
+
*
|
|
428
|
+
* Raydium calls this `calculatePreFee` on the curve and `calculatePreFeeAmount` on CPMM. Both are
|
|
429
|
+
* the same expression.
|
|
430
|
+
*/
|
|
431
|
+
declare function preFeeAmount(postFeeAmount: bigint, rate: bigint): bigint;
|
|
432
|
+
/** The four reserve numbers a curve price depends on. Read them off the pool account. */
|
|
433
|
+
type CurveReserves = {
|
|
434
|
+
virtualBase: bigint;
|
|
435
|
+
virtualQuote: bigint;
|
|
436
|
+
realBase: bigint;
|
|
437
|
+
realQuote: bigint;
|
|
438
|
+
/** The most the curve will ever sell. A buy larger than what is left is capped at it. */
|
|
439
|
+
totalBaseSell: bigint;
|
|
440
|
+
};
|
|
441
|
+
/** The three fee rates a curve trade pays, each out of 1,000,000. */
|
|
442
|
+
type CurveFeeRates = {
|
|
443
|
+
/** `trade_fee_rate` on LaunchLab's global config: Raydium's own share. */
|
|
444
|
+
tradeFeeRate: bigint;
|
|
445
|
+
/** `fee_rate` on the platform config: the Gabox platform's share. */
|
|
446
|
+
platformFeeRate: bigint;
|
|
447
|
+
/** `creator_fee_rate` on the platform config: the coin creator's share. */
|
|
448
|
+
creatorFeeRate: bigint;
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* The whole fee a curve trade pays. Gabox never passes a share-fee receiver, so the fourth rate
|
|
452
|
+
* Raydium supports is always zero and is left out here.
|
|
453
|
+
*/
|
|
454
|
+
declare function totalCurveFeeRate(rates: CurveFeeRates): bigint;
|
|
455
|
+
/** Coins the curve still has to sell. A buy cannot take more than this. */
|
|
456
|
+
declare function remainingBase(pool: CurveReserves): bigint;
|
|
457
|
+
/**
|
|
458
|
+
* Quote needed to buy exactly `tokens` coins on the curve, fees included.
|
|
459
|
+
*
|
|
460
|
+
* This is `Curve.buyExactOut` with no token transfer fee, which is always the case for Gabox: both
|
|
461
|
+
* mints are classic SPL Token and carry no transfer-fee extension.
|
|
462
|
+
*
|
|
463
|
+
* Raydium caps the amount at what the curve has left to sell and still returns a price, so this
|
|
464
|
+
* does the same. A caller that needs the whole `tokens` must check `remainingBase` first;
|
|
465
|
+
* `resolveVenue` does.
|
|
466
|
+
*/
|
|
467
|
+
declare function curveBuyExactOut(pool: CurveReserves, rates: CurveFeeRates, tokens: bigint): bigint;
|
|
468
|
+
/**
|
|
469
|
+
* Coins `quote` buys on the curve right now, fees already taken off the spend.
|
|
470
|
+
*
|
|
471
|
+
* This is `Curve.buyExactIn`. It is what a raw `buy_exact_in` pays out, which the devnet end-to-end
|
|
472
|
+
* test uses to push a curve to graduation.
|
|
473
|
+
*/
|
|
474
|
+
declare function curveBuyExactIn(pool: CurveReserves, rates: CurveFeeRates, quote: bigint): bigint;
|
|
475
|
+
/**
|
|
476
|
+
* Quote a sale of exactly `tokens` coins returns, net of fees. This is `Curve.sellExactIn`.
|
|
477
|
+
*/
|
|
478
|
+
declare function curveSellExactIn(pool: CurveReserves, rates: CurveFeeRates, tokens: bigint): bigint;
|
|
479
|
+
/** What a launch pins, and what the starting reserves follow from. */
|
|
480
|
+
type LaunchParams = {
|
|
481
|
+
/** The whole supply the coin is minted with. */
|
|
482
|
+
supply: bigint;
|
|
483
|
+
/** The part of it the curve sells. */
|
|
484
|
+
totalBaseSell: bigint;
|
|
485
|
+
/** The quote the curve must raise before the coin graduates. */
|
|
486
|
+
quoteRaise: bigint;
|
|
487
|
+
/** Coins locked in a vesting schedule. Always zero for a Gabox launch. */
|
|
488
|
+
totalLockedAmount?: bigint;
|
|
489
|
+
/** The quote LaunchLab keeps at graduation, from its global config. */
|
|
490
|
+
migrateFee?: bigint;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* The virtual reserves LaunchLab gives a coin that does not exist yet.
|
|
494
|
+
*
|
|
495
|
+
* This is `LaunchConstantProductCurve.getInitParam`. `createMachine` needs it because the seed buy
|
|
496
|
+
* runs in the same transaction that creates the coin: there is no pool account to read yet, and the
|
|
497
|
+
* reserves follow from the pinned launch shape alone.
|
|
498
|
+
*
|
|
499
|
+
* Checked against Raydium's own published numbers for the mainnet Gabox launch shape (supply
|
|
500
|
+
* 1,000,000,000 coins, 793,100,000 sold on the curve, 85 SOL raised, no migrate fee):
|
|
501
|
+
* `virtualBase` 1,073,025,605,596,382 and `virtualQuote` 30,000,852,951.
|
|
502
|
+
*/
|
|
503
|
+
declare function initialCurve(params: LaunchParams): CurveReserves;
|
|
504
|
+
/** One side of a CPMM swap, after the pool's own unspendable fee balances are taken off. */
|
|
505
|
+
type CpmmSwapSides = {
|
|
506
|
+
/** Token going in: the quote on a buy, the coin on a sell. */
|
|
507
|
+
inputReserve: bigint;
|
|
508
|
+
/** Token coming out: the coin on a buy, the quote on a sell. */
|
|
509
|
+
outputReserve: bigint;
|
|
510
|
+
};
|
|
511
|
+
/** The two CPMM rates, each out of 1,000,000, plus where the creator fee is charged. */
|
|
512
|
+
type CpmmFeeRates = {
|
|
513
|
+
/** `trade_fee_rate` on the `amm_config`. */
|
|
514
|
+
tradeFeeRate: bigint;
|
|
515
|
+
/** `creator_fee_rate` on the `amm_config`, or zero when the pool switched the fee off. */
|
|
516
|
+
creatorFeeRate: bigint;
|
|
517
|
+
/**
|
|
518
|
+
* `true` when this side's creator fee comes off the input token, `false` when it comes off the
|
|
519
|
+
* output. It follows from the pool's `creator_fee_on` and which token is going in.
|
|
520
|
+
*/
|
|
521
|
+
creatorFeeOnInput: boolean;
|
|
522
|
+
};
|
|
523
|
+
/**
|
|
524
|
+
* Quote a CPMM buy of exactly `tokens` coins costs, both fees included.
|
|
525
|
+
*
|
|
526
|
+
* This is `CurveCalculator.swapBaseOutput`, which is what `swap_base_output` charges.
|
|
527
|
+
*/
|
|
528
|
+
declare function cpmmSwapBaseOutput(sides: CpmmSwapSides, rates: CpmmFeeRates, amountOut: bigint): bigint;
|
|
529
|
+
/**
|
|
530
|
+
* What a CPMM swap of exactly `amountIn` returns, net of both fees.
|
|
531
|
+
*
|
|
532
|
+
* This is `CurveCalculator.swapBaseInput`, which is what `swap_base_input` pays out.
|
|
533
|
+
*/
|
|
534
|
+
declare function cpmmSwapBaseInput(sides: CpmmSwapSides, rates: CpmmFeeRates, amountIn: bigint): bigint;
|
|
535
|
+
//#endregion
|
|
536
|
+
//#region src/raydium/venue.d.ts
|
|
537
|
+
type VenueKind = 'launchlab' | 'cpmm';
|
|
538
|
+
/** Everything `resolveVenue` learned, plus the pure functions that follow from it. */
|
|
539
|
+
type ResolvedVenue = {
|
|
540
|
+
kind: VenueKind;
|
|
541
|
+
/** The program to pass as the `venue` account. */
|
|
542
|
+
program: Address;
|
|
543
|
+
mint: Address;
|
|
544
|
+
quoteMint: Address;
|
|
545
|
+
/** The venue's own pool: the LaunchLab curve pool, or the migrated CPMM pool. */
|
|
546
|
+
poolState: Address;
|
|
547
|
+
/** The LaunchLab pool's `status`: 0 funding, 1 migrating, 2 graduated. */
|
|
548
|
+
status: number;
|
|
549
|
+
/** The coin creator. LaunchLab and CPMM both pay their creator fee to this wallet. */
|
|
550
|
+
creator: Address;
|
|
551
|
+
/** The CPMM fee tier the pool names. Equal to the LaunchLab program on the curve venue. */
|
|
552
|
+
ammConfig: Address | null;
|
|
553
|
+
/** Coins the curve still has to sell. `0n` once the coin has graduated. */
|
|
554
|
+
remainingCurveBase: bigint;
|
|
555
|
+
/** The ordered account list for an exact-coins-out buy, in `remainingAccounts` order. */
|
|
556
|
+
buyAccounts: AccountMeta[];
|
|
557
|
+
/** The ordered account list for a sale. */
|
|
558
|
+
sellAccounts: AccountMeta[];
|
|
559
|
+
/** WSOL an exact-coins-out buy of `tokens` costs right now, the venue's fees included. */
|
|
560
|
+
quoteBuy(tokens: bigint): bigint;
|
|
561
|
+
/** WSOL a sale of `tokens` returns right now, net of the venue's fees. */
|
|
562
|
+
quoteSell(tokens: bigint): bigint;
|
|
563
|
+
};
|
|
564
|
+
type ResolveVenueOptions = {
|
|
565
|
+
mint: Address;
|
|
566
|
+
/** The wallet that will sign the trade. Its token accounts appear in the account list. */
|
|
567
|
+
user: Address;
|
|
568
|
+
/** Force a venue instead of reading the pool's `status`. A wrong choice fails on chain. */
|
|
569
|
+
venue?: VenueKind;
|
|
570
|
+
};
|
|
571
|
+
/**
|
|
572
|
+
* The user's WSOL associated token account.
|
|
573
|
+
*
|
|
574
|
+
* Both venues settle in WSOL, never in native SOL. This account must exist and hold enough before a
|
|
575
|
+
* pack is bought, and sale proceeds land in it. Every builder in `tx/` wraps the SOL it needs into
|
|
576
|
+
* this account and closes it again in the same transaction.
|
|
577
|
+
*/
|
|
578
|
+
declare function wsolAccountFor(user: Address): Promise<Address>;
|
|
579
|
+
/** What LaunchLab's global config and the Gabox platform config say about a curve trade. */
|
|
580
|
+
type CurveSettings = {
|
|
581
|
+
rates: CurveFeeRates;
|
|
582
|
+
/** `migrate_fee` on the global config. The starting reserves depend on it. */
|
|
583
|
+
migrateFee: bigint;
|
|
584
|
+
/** `cpswap_config` on the platform config: the CPMM fee tier a Gabox coin graduates into. */
|
|
585
|
+
cpswapConfig: Address;
|
|
586
|
+
};
|
|
587
|
+
/** Read the two pinned config accounts and take the four numbers a quote needs out of them. */
|
|
588
|
+
declare function fetchCurveSettings(client: GaboxClient, ids?: RaydiumIds): Promise<CurveSettings>;
|
|
589
|
+
declare function resolveVenue(client: GaboxClient, options: ResolveVenueOptions): Promise<ResolvedVenue>;
|
|
590
|
+
/** A CPMM pool that has proved, from its own data, that it is a coin's migrated pool. */
|
|
591
|
+
type MigratedCpmmPool = {
|
|
592
|
+
address: Address;
|
|
593
|
+
pool: CpmmPoolState;
|
|
594
|
+
};
|
|
595
|
+
type FindCpmmPoolOptions = {
|
|
596
|
+
mint: Address;
|
|
597
|
+
/** The coin creator, from the Gabox pool or the LaunchLab pool. */
|
|
598
|
+
creator: Address;
|
|
599
|
+
/** The fee tier the Gabox platform config names. Read it with `fetchCurveSettings`. */
|
|
600
|
+
cpswapConfig: Address;
|
|
601
|
+
quoteMint?: Address;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* Every check the program makes on a CPMM pool account, in one place.
|
|
605
|
+
*
|
|
606
|
+
* `enable_creator_fee` is the one that identifies the migrated pool. Anyone can call CPMM's own
|
|
607
|
+
* `initialize` and open a pool for the same pair with the same creator, but that pool always has
|
|
608
|
+
* the flag false. Only a creator Raydium has permissioned can set it, and LaunchLab's migration is
|
|
609
|
+
* one of those.
|
|
610
|
+
*/
|
|
611
|
+
declare function cpmmPoolMatches(pool: CpmmPoolState, expect: {
|
|
612
|
+
creator: Address;
|
|
613
|
+
token0: Address;
|
|
614
|
+
token1: Address;
|
|
615
|
+
}): boolean;
|
|
616
|
+
/**
|
|
617
|
+
* The CPMM pool LaunchLab migrated a coin into.
|
|
618
|
+
*
|
|
619
|
+
* Two steps, because the pool is not always at a derived address. Raydium migrates into
|
|
620
|
+
* `["pool", cpswap_config, token_0, token_1]` when that account is free, and into a random account
|
|
621
|
+
* when it is not. So: try the derived address, and scan for the pool when it does not hold one.
|
|
622
|
+
*
|
|
623
|
+
* The scan filters on the account length and on the three fields at their fixed offsets, so the
|
|
624
|
+
* RPC does the work and returns at most a handful of accounts. Every candidate still has to pass
|
|
625
|
+
* `cpmmPoolMatches`, and more than one match is an error rather than a guess.
|
|
626
|
+
*/
|
|
627
|
+
declare function findCpmmPool(client: GaboxClient, options: FindCpmmPoolOptions): Promise<MigratedCpmmPool>;
|
|
628
|
+
/**
|
|
629
|
+
* Does this side's creator fee come off the token going in?
|
|
630
|
+
*
|
|
631
|
+
* `creator_fee_on` is 0 when the fee follows the input token, 1 when it is always token 0, and 2
|
|
632
|
+
* when it is always token 1. LaunchLab migrates a Gabox coin with `AmmCreatorFeeOn::QuoteToken`, so
|
|
633
|
+
* the pool charges the creator fee in WSOL only: on the input of a buy, on the output of a sale.
|
|
634
|
+
*/
|
|
635
|
+
declare function creatorFeeOnInput(pool: CpmmPoolState, inputMint: Address): boolean;
|
|
636
|
+
/**
|
|
637
|
+
* WSOL an exact-coins-out buy of `tokens` costs right now, on whichever venue the coin trades.
|
|
638
|
+
* Pass `pool.packTokens` for the pack price.
|
|
639
|
+
*
|
|
640
|
+
* Use `resolveVenue` when you also need the account list, which every transaction builder does.
|
|
641
|
+
* This is for a price display.
|
|
642
|
+
*/
|
|
643
|
+
declare function curveQuote(client: GaboxClient, mint: Address, tokens: bigint, options?: {
|
|
644
|
+
user?: Address;
|
|
645
|
+
venue?: VenueKind;
|
|
646
|
+
}): Promise<bigint>;
|
|
647
|
+
/** WSOL a sale of `tokens` returns right now, net of the venue's fees. */
|
|
648
|
+
declare function sellQuote(client: GaboxClient, mint: Address, tokens: bigint, options?: {
|
|
649
|
+
user?: Address;
|
|
650
|
+
venue?: VenueKind;
|
|
651
|
+
}): Promise<bigint>;
|
|
652
|
+
/**
|
|
653
|
+
* WSOL an exact-coins-out buy of `tokens` would cost on a curve that does not exist yet, fees
|
|
654
|
+
* included.
|
|
655
|
+
*
|
|
656
|
+
* This is what the seed costs. `initialize_pool` buys it in the same transaction that creates the
|
|
657
|
+
* coin, so the curve is a brand-new LaunchLab curve with the pinned Gabox launch shape at that
|
|
658
|
+
* moment. Exact, unless Raydium changes a fee rate between this read and the send.
|
|
659
|
+
*/
|
|
660
|
+
declare function newCurveBuyCost(client: GaboxClient, tokens: bigint): Promise<bigint>;
|
|
661
|
+
/** The starting reserves of a brand-new Gabox curve on this cluster. */
|
|
662
|
+
declare function newCurveReserves(ids: RaydiumIds, migrateFee: bigint): CurveReserves;
|
|
663
|
+
//#endregion
|
|
664
|
+
//#region src/tx/message.d.ts
|
|
665
|
+
/**
|
|
666
|
+
* What every builder returns: a version 0 message with a fee-payer signer and a blockhash
|
|
667
|
+
* lifetime, ready for `signTransactionMessageWithSigners`.
|
|
668
|
+
*
|
|
669
|
+
* Named, and built only from types `@solana/kit` exports, so the published declaration file
|
|
670
|
+
* refers to kit's types instead of copying them. `pipe`'s inferred type is a long intersection
|
|
671
|
+
* of kit-internal brands, and a copy of a branded type is not assignable to the original.
|
|
672
|
+
*/
|
|
673
|
+
type GaboxTransactionMessage = Extract<TransactionMessage, {
|
|
674
|
+
version: 0;
|
|
675
|
+
}> & TransactionMessageWithFeePayerSigner & TransactionMessageWithBlockhashLifetime;
|
|
676
|
+
type BuildOptions = {
|
|
677
|
+
/** Compute units to request. Each builder passes its own default. */
|
|
678
|
+
computeUnitLimit: number;
|
|
679
|
+
/** Priority fee in micro-lamports per compute unit. Left out, no price instruction is added. */
|
|
680
|
+
computeUnitPrice?: number | bigint;
|
|
681
|
+
/** Defaults to the client's tables, which the cluster chose. Pass `{}` to disable compression. */
|
|
682
|
+
addressLookupTables?: AddressesByLookupTableAddress;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* Build the message. One RPC read, for the blockhash.
|
|
686
|
+
*
|
|
687
|
+
* The blockhash expires in about a minute, so build the message when the user is ready to sign
|
|
688
|
+
* rather than when the page loads.
|
|
689
|
+
*/
|
|
690
|
+
declare function buildMessage(client: GaboxClient, feePayer: TransactionSigner, instructions: Instruction[], options: BuildOptions): Promise<GaboxTransactionMessage>;
|
|
691
|
+
/** Append `remainingAccounts` to a generated instruction, which is how a venue's list is passed. */
|
|
692
|
+
declare function withRemainingAccounts<T extends Instruction>(instruction: T, remaining: readonly NonNullable<T['accounts']>[number][]): T;
|
|
693
|
+
//#endregion
|
|
694
|
+
//#region src/raydium/accounts.d.ts
|
|
695
|
+
/**
|
|
696
|
+
* Turn `{name -> address}` into the ABI's ordered `AccountMeta[]`.
|
|
697
|
+
*
|
|
698
|
+
* The map is keyed by the IDL's own account names, so a missing entry names the slot it belongs to
|
|
699
|
+
* rather than failing as an off-by-one further down. The role comes from the ABI table alone, never
|
|
700
|
+
* from the caller, which is what keeps this list in step with `venue/abi.rs`.
|
|
701
|
+
*/
|
|
702
|
+
declare function order(abi: VenueInstructionAbi, byName: Record<string, Address>): AccountMeta[];
|
|
703
|
+
/** Everything a LaunchLab trade list needs. Every address is derived, never read off the chain. */
|
|
704
|
+
type LaunchlabTradeAccountsInput = {
|
|
705
|
+
/** Raydium LaunchLab on this cluster. */
|
|
706
|
+
launchlab: Address;
|
|
707
|
+
/** `["vault_auth_seed"]` under LaunchLab. */
|
|
708
|
+
launchlabAuthority: Address;
|
|
709
|
+
/** `["__event_authority"]` under LaunchLab. */
|
|
710
|
+
launchlabEventAuthority: Address;
|
|
711
|
+
/** The global config of the quote asset. */
|
|
712
|
+
globalConfig: Address;
|
|
713
|
+
/** The Gabox platform config. */
|
|
714
|
+
platformConfig: Address;
|
|
715
|
+
/** `["pool", mint, quote_mint]` under LaunchLab. */
|
|
716
|
+
poolState: Address;
|
|
717
|
+
mint: Address;
|
|
718
|
+
quoteMint: Address;
|
|
719
|
+
/** `["pool_vault", pool_state, mint]` under LaunchLab. */
|
|
720
|
+
baseVault: Address;
|
|
721
|
+
/** `["pool_vault", pool_state, quote_mint]` under LaunchLab. */
|
|
722
|
+
quoteVault: Address;
|
|
723
|
+
/** The trader. The one signing slot in the list. */
|
|
724
|
+
user: Address;
|
|
725
|
+
/** The trader's coin ATA. `buy_pack` passes the same address as its own `user_tokens`. */
|
|
726
|
+
userBaseToken: Address;
|
|
727
|
+
/** The trader's WSOL ATA. Both venues settle here. */
|
|
728
|
+
userQuoteToken: Address;
|
|
729
|
+
/** `[platform_config, quote_mint]` under LaunchLab. */
|
|
730
|
+
platformFeeVault: Address;
|
|
731
|
+
/** `[creator, quote_mint]` under LaunchLab, where `creator` is the coin creator. */
|
|
732
|
+
creatorFeeVault: Address;
|
|
733
|
+
};
|
|
734
|
+
/** `buy_exact_out`: 18 accounts. The first argument is the coins wanted, the second the cost cap. */
|
|
735
|
+
declare const launchlabBuyAccounts: (input: LaunchlabTradeAccountsInput) => AccountMeta[];
|
|
736
|
+
/** `sell_exact_in`: the same 18 accounts. `venue/trade.rs` uses one table for both sides. */
|
|
737
|
+
declare const launchlabSellAccounts: (input: LaunchlabTradeAccountsInput) => AccountMeta[];
|
|
738
|
+
/**
|
|
739
|
+
* `buy_exact_in`: the same 18 accounts again. Gabox never forwards this instruction; a wallet sends
|
|
740
|
+
* it on its own, to buy the curve out with a fixed spend.
|
|
741
|
+
*/
|
|
742
|
+
declare const launchlabBuyExactInAccounts: (input: LaunchlabTradeAccountsInput) => AccountMeta[];
|
|
743
|
+
/** Everything a CPMM trade list needs. */
|
|
744
|
+
type CpmmTradeAccountsInput = {
|
|
745
|
+
/** `["vault_and_lp_mint_auth_seed"]` under CPMM. */
|
|
746
|
+
cpmmAuthority: Address;
|
|
747
|
+
/** The fee tier the pool belongs to. Gabox pins the one LaunchLab migrates into. */
|
|
748
|
+
ammConfig: Address;
|
|
749
|
+
/** The migrated pool. */
|
|
750
|
+
poolState: Address;
|
|
751
|
+
mint: Address;
|
|
752
|
+
quoteMint: Address;
|
|
753
|
+
/** `["pool_vault", pool_state, mint]` under CPMM. */
|
|
754
|
+
baseVault: Address;
|
|
755
|
+
/** `["pool_vault", pool_state, quote_mint]` under CPMM. */
|
|
756
|
+
quoteVault: Address;
|
|
757
|
+
/** `["observation", pool_state]` under CPMM. */
|
|
758
|
+
observationState: Address;
|
|
759
|
+
/** The trader. The one signing slot, and read-only here: CPMM does not take its lamports. */
|
|
760
|
+
user: Address;
|
|
761
|
+
userBaseToken: Address;
|
|
762
|
+
userQuoteToken: Address;
|
|
763
|
+
};
|
|
764
|
+
/** `swap_base_output`: 13 accounts. Note the argument order is `(max_amount_in, amount_out)`. */
|
|
765
|
+
declare const cpmmBuyAccounts: (input: CpmmTradeAccountsInput) => AccountMeta[];
|
|
766
|
+
/** `swap_base_input`: 13 accounts, with the four pairs swapped. */
|
|
767
|
+
declare const cpmmSellAccounts: (input: CpmmTradeAccountsInput) => AccountMeta[];
|
|
768
|
+
//#endregion
|
|
769
|
+
//#region src/raydium/claim.d.ts
|
|
770
|
+
/**
|
|
771
|
+
* The instructions of a curve fee claim: create the WSOL account, claim, close it.
|
|
772
|
+
*
|
|
773
|
+
* This sweeps **every** coin this wallet launched, because LaunchLab keeps one vault per wallet per
|
|
774
|
+
* quote asset. There is no per-coin version.
|
|
775
|
+
*/
|
|
776
|
+
declare function getClaimCreatorFeeInstructions(creator: TransactionSigner, ids: RaydiumIds): Promise<Instruction[]>;
|
|
777
|
+
type ClaimCreatorFeeInput = {
|
|
778
|
+
creator: TransactionSigner;
|
|
779
|
+
} & Partial<BuildOptions>;
|
|
780
|
+
/**
|
|
781
|
+
* Claim the curve creator fee and receive it as SOL.
|
|
782
|
+
*
|
|
783
|
+
* One transaction, three instructions. It sweeps every coin this wallet launched on LaunchLab.
|
|
784
|
+
*/
|
|
785
|
+
declare function claimCreatorFee(client: GaboxClient, input: ClaimCreatorFeeInput): Promise<GaboxTransactionMessage>;
|
|
786
|
+
/**
|
|
787
|
+
* The instructions of a graduated coin's fee collection: create the WSOL account, collect, close.
|
|
788
|
+
*
|
|
789
|
+
* This is per coin. `collect_creator_fee` pays out both sides of the pair, so anything owed in the
|
|
790
|
+
* coin itself lands in the creator's coin account and stays there.
|
|
791
|
+
*/
|
|
792
|
+
declare function getCollectCreatorFeeInstructions(client: GaboxClient, input: {
|
|
793
|
+
mint: Address;
|
|
794
|
+
creator: TransactionSigner;
|
|
795
|
+
}, ids?: RaydiumIds): Promise<Instruction[]>;
|
|
796
|
+
type CollectCreatorFeeInput = {
|
|
797
|
+
mint: Address;
|
|
798
|
+
creator: TransactionSigner;
|
|
799
|
+
} & Partial<BuildOptions>;
|
|
800
|
+
/** Collect one graduated coin's CPMM creator fee and receive the WSOL side as SOL. */
|
|
801
|
+
declare function collectCreatorFee(client: GaboxClient, input: CollectCreatorFeeInput): Promise<GaboxTransactionMessage>;
|
|
802
|
+
/** What a creator can collect right now. Every amount is in base units. */
|
|
803
|
+
type CreatorFees = {
|
|
804
|
+
/** WSOL waiting in the LaunchLab creator fee vault, across every coin this wallet launched. */
|
|
805
|
+
curveLamports: bigint;
|
|
806
|
+
/**
|
|
807
|
+
* WSOL the migrated CPMM pool of `mint` owes this creator. `0n` when the coin has not graduated,
|
|
808
|
+
* and `0n` when no `mint` was passed.
|
|
809
|
+
*/
|
|
810
|
+
cpmmLamports: bigint;
|
|
811
|
+
/** Coins the same pool owes this creator. CPMM can charge the fee on either side. */
|
|
812
|
+
cpmmTokens: bigint;
|
|
813
|
+
};
|
|
814
|
+
/**
|
|
815
|
+
* Read both places a creator's fees can sit.
|
|
816
|
+
*
|
|
817
|
+
* `mint` is optional. Without it only the curve vault is read, which is the one number that covers
|
|
818
|
+
* every coin at once. With it the coin's CPMM pool is read too, and a coin that has not graduated
|
|
819
|
+
* reports zeros rather than failing.
|
|
820
|
+
*/
|
|
821
|
+
declare function fetchCreatorFees(client: GaboxClient, input: {
|
|
822
|
+
creator: Address;
|
|
823
|
+
mint?: Address;
|
|
824
|
+
}): Promise<CreatorFees>;
|
|
825
|
+
//#endregion
|
|
826
|
+
//#region src/raydium/launch.d.ts
|
|
827
|
+
type LaunchInput = {
|
|
828
|
+
/** The coin's mint. A fresh keypair, and it signs. */
|
|
829
|
+
mint: TransactionSigner;
|
|
830
|
+
/**
|
|
831
|
+
* The wallet paying. LaunchLab takes it as both `payer` and `creator`, so this wallet receives
|
|
832
|
+
* LaunchLab's creator fee and owns the CPMM creator fee after graduation. It must be the same
|
|
833
|
+
* wallet that signs `initialize_pool`.
|
|
834
|
+
*/
|
|
835
|
+
creator: TransactionSigner;
|
|
836
|
+
name: string;
|
|
837
|
+
symbol: string;
|
|
838
|
+
/** The metadata URI. Metaplex stores it on the mint's metadata account. */
|
|
839
|
+
uri: string;
|
|
840
|
+
};
|
|
841
|
+
/**
|
|
842
|
+
* Build `initialize_v2` for one cluster's LaunchLab. `ids` is `raydiumIds(client.cluster)`.
|
|
843
|
+
*
|
|
844
|
+
* Two slots sign: the mint keypair, which LaunchLab takes as a signer rather than deriving, and the
|
|
845
|
+
* creator, who pays for everything.
|
|
846
|
+
*/
|
|
847
|
+
declare function getLaunchInstruction(input: LaunchInput, ids: RaydiumIds): Promise<Instruction>;
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region src/raydium/pdas.d.ts
|
|
850
|
+
/** `["vault_auth_seed"]`. LaunchLab signs its own vault transfers with this PDA. */
|
|
851
|
+
declare const launchlabAuthority: (launchlab: Address) => Promise<Address>;
|
|
852
|
+
/** `["__event_authority"]`. */
|
|
853
|
+
declare const launchlabEventAuthority: (launchlab: Address) => Promise<Address>;
|
|
854
|
+
/**
|
|
855
|
+
* `["global_config", quote_mint, u8 curve_type, u16 big-endian index]`. The curve settings for one
|
|
856
|
+
* quote asset. Gabox uses curve type 0 (constant product) and index 0.
|
|
857
|
+
*/
|
|
858
|
+
declare const launchlabGlobalConfig: (launchlab: Address, quoteMint: Address, curveType?: number, index?: number) => Promise<Address>;
|
|
859
|
+
/** `["platform_config", platform_admin]`. The Gabox platform on LaunchLab. */
|
|
860
|
+
declare const launchlabPlatformConfig: (launchlab: Address, platformAdmin: Address) => Promise<Address>;
|
|
861
|
+
/** `["pool", base_mint, quote_mint]`. The curve pool of one coin. */
|
|
862
|
+
declare const launchlabPoolAddress: (launchlab: Address, baseMint: Address, quoteMint: Address) => Promise<Address>;
|
|
863
|
+
/** `["pool_vault", pool_state, mint]`. One side of a curve pool's reserves. */
|
|
864
|
+
declare const launchlabVaultAddress: (launchlab: Address, poolState: Address, mint: Address) => Promise<Address>;
|
|
865
|
+
/**
|
|
866
|
+
* `[platform_config, quote_mint]`. LaunchLab pays the platform share of every curve trade here.
|
|
867
|
+
*
|
|
868
|
+
* The seeds carry no text prefix. That is Raydium's own derivation, not a mistake.
|
|
869
|
+
*/
|
|
870
|
+
declare const platformFeeVaultAddress: (launchlab: Address, platformConfig: Address, quoteMint: Address) => Promise<Address>;
|
|
871
|
+
/**
|
|
872
|
+
* `[creator, quote_mint]`. LaunchLab pays the creator share of every curve trade here.
|
|
873
|
+
*
|
|
874
|
+
* One vault per wallet per quote asset, not one per coin. A creator with several coins collects
|
|
875
|
+
* all of them with a single `claim_creator_fee`.
|
|
876
|
+
*/
|
|
877
|
+
declare const creatorFeeVaultAddress: (launchlab: Address, creator: Address, quoteMint: Address) => Promise<Address>;
|
|
878
|
+
/** `["creator_fee_vault_auth_seed"]`. The authority `claim_creator_fee` signs the payout with. */
|
|
879
|
+
declare const creatorFeeVaultAuthority: (launchlab: Address) => Promise<Address>;
|
|
880
|
+
/** `["metadata", metaplex, mint]` under Metaplex. LaunchLab's create instruction writes it. */
|
|
881
|
+
declare const metadataAddress: (mint: Address) => Promise<Address>;
|
|
882
|
+
/** `["vault_and_lp_mint_auth_seed"]`. */
|
|
883
|
+
declare const cpmmAuthority: (cpmm: Address) => Promise<Address>;
|
|
884
|
+
/**
|
|
885
|
+
* `["pool", amm_config, token_0, token_1]`, with the two mints sorted by raw byte order.
|
|
886
|
+
*
|
|
887
|
+
* This is where Raydium migrates a coin when the address is free. It is only a first guess: when the
|
|
888
|
+
* account is taken, the migration lands somewhere else entirely. And the address alone proves
|
|
889
|
+
* nothing, because anyone can open a CPMM pool for any pair under any config. `findCpmmPool` tries
|
|
890
|
+
* this address, checks the account data, and scans for the real pool when it does not match.
|
|
891
|
+
*
|
|
892
|
+
* There are no vault or observation derivations here on purpose. `venue/trade.rs` reads those three
|
|
893
|
+
* addresses out of the pool account, and so does this SDK: a migrated pool names its own vaults and
|
|
894
|
+
* its own oracle, wherever it sits.
|
|
895
|
+
*/
|
|
896
|
+
declare const cpmmPoolAddress: (cpmm: Address, ammConfig: Address, mintA: Address, mintB: Address) => Promise<Address>;
|
|
897
|
+
/**
|
|
898
|
+
* `["creator_fee_share", creator, amm_config]`. Where CPMM tracks what one creator is owed under
|
|
899
|
+
* one fee tier.
|
|
900
|
+
*
|
|
901
|
+
* `collect_creator_fee` takes this account after the fourteen the mainnet IDL lists. That snapshot
|
|
902
|
+
* predates the account; Raydium's devnet build declares it and stops with `AccountNotEnoughKeys`
|
|
903
|
+
* (3005) when it is missing. One account per creator per fee tier, not one per pool.
|
|
904
|
+
*/
|
|
905
|
+
declare const cpmmCreatorFeeShare: (cpmm: Address, creator: Address, ammConfig: Address) => Promise<Address>;
|
|
906
|
+
/** An associated token account. Off-curve owners are allowed: pool PDAs are all off-curve. */
|
|
907
|
+
declare const ata: (owner: Address, mint: Address, tokenProgram?: Address) => Promise<Address>;
|
|
908
|
+
//#endregion
|
|
909
|
+
//#region src/raydium/trade.d.ts
|
|
910
|
+
type CurveBuyExactInInput = {
|
|
911
|
+
mint: Address;
|
|
912
|
+
/** The coin creator, so the creator fee vault can be derived. Read it off the pool. */
|
|
913
|
+
creator: Address;
|
|
914
|
+
/** The wallet spending. It signs, and its WSOL ATA must already hold `quoteIn`. */
|
|
915
|
+
user: TransactionSigner;
|
|
916
|
+
/** WSOL to spend, fees included. */
|
|
917
|
+
quoteIn: bigint;
|
|
918
|
+
/** The floor on the coins received. Use `curveBuyExactIn` from `curve.ts` to compute it. */
|
|
919
|
+
minTokensOut: bigint;
|
|
920
|
+
};
|
|
921
|
+
/**
|
|
922
|
+
* `buy_exact_in` on the curve: spend exactly `quoteIn` WSOL and take whatever coins it buys.
|
|
923
|
+
*
|
|
924
|
+
* LaunchLab caps the trade at what the curve has left to sell, so a spend larger than the rest of
|
|
925
|
+
* the raise still succeeds and graduates the coin. Wrap the SOL into the user's WSOL ATA first and
|
|
926
|
+
* close it afterwards, the same way the Gabox builders do.
|
|
927
|
+
*/
|
|
928
|
+
declare function getCurveBuyExactInInstruction(client: GaboxClient, input: CurveBuyExactInInput, ids?: RaydiumIds): Promise<Instruction>;
|
|
929
|
+
declare namespace index_d_exports {
|
|
930
|
+
export { ASSOCIATED_TOKEN_PROGRAM_ADDRESS, CONSTANT_CURVE_TAG, CPMM_AMM_CONFIG_DISCRIMINATOR, CPMM_AMM_CONFIG_HEAD_SIZE, CPMM_COLLECT_CREATOR_FEE, CPMM_POOL_OFFSETS, CPMM_POOL_STATE_DISCRIMINATOR, CPMM_POOL_STATE_HEAD_SIZE, CPMM_POOL_STATE_SIZE, CPMM_SEEDS, CPMM_SWAP_BASE_INPUT, CPMM_SWAP_BASE_OUTPUT, CREATOR_FEE_ON_QUOTE, ClaimCreatorFeeInput, CollectCreatorFeeInput, CpmmAmmConfig, CpmmFeeRates, CpmmPoolState, CpmmSwapSides, CpmmTradeAccountsInput, CreatorFees, CurveBuyExactInInput, CurveFeeRates, CurveReserves, CurveSettings, FindCpmmPoolOptions, LAUNCHLAB_BUY_EXACT_IN, LAUNCHLAB_BUY_EXACT_OUT, LAUNCHLAB_CLAIM_CREATOR_FEE, LAUNCHLAB_GLOBAL_CONFIG_DISCRIMINATOR, LAUNCHLAB_GLOBAL_CONFIG_HEAD_SIZE, LAUNCHLAB_INITIALIZE, LAUNCHLAB_PLATFORM_CONFIG_DISCRIMINATOR, LAUNCHLAB_PLATFORM_CONFIG_HEAD_SIZE, LAUNCHLAB_POOL_STATE_DISCRIMINATOR, LAUNCHLAB_POOL_STATE_HEAD_SIZE, LAUNCHLAB_SEEDS, LAUNCHLAB_SELL_EXACT_IN, LAUNCHLAB_STATUS_FUND, LAUNCHLAB_STATUS_MIGRATE, LAUNCHLAB_STATUS_TRADE, LAUNCH_DECIMALS, LAUNCH_SUPPLY, LAUNCH_TOTAL_BASE_SELL, LaunchInput, LaunchParams, LaunchlabGlobalConfig, LaunchlabPlatformConfig, LaunchlabPoolState, LaunchlabTradeAccountsInput, METADATA_LIMITS, METADATA_SEED, METAPLEX_PROGRAM_ADDRESS, MIGRATE_TO_CPMM, MigratedCpmmPool, PLATFORM_ADMIN, RATE_DENOMINATOR, RAYDIUM_DEVNET_IDS, RAYDIUM_IDS, RAYDIUM_MAINNET_IDS, RENT_SYSVAR_ADDRESS, RaydiumClusterIds, RaydiumIds, ResolveVenueOptions, ResolvedVenue, SHARE_FEE_RATE, SYSTEM_PROGRAM_ADDRESS, TOKEN_PROGRAM_ADDRESS, VenueAccountSpec, VenueInstructionAbi, VenueKind, WSOL_MINT, ata, ceilDiv, ceilDivRate, claimCreatorFee, collectCreatorFee, compareAddresses, cpmmAuthority, cpmmBuyAccounts, cpmmCreatorFeeShare, cpmmPoolAddress, cpmmPoolMatches, cpmmSellAccounts, cpmmSwapBaseInput, cpmmSwapBaseOutput, creatorFeeOnInput, creatorFeeVaultAddress, creatorFeeVaultAuthority, curveBuyExactIn, curveBuyExactOut, curveQuote, curveSellExactIn, decodeCpmmAmmConfig, decodeCpmmPool, decodeLaunchlabGlobalConfig, decodeLaunchlabPlatformConfig, decodeLaunchlabPool, fetchCreatorFees, fetchCurveSettings, findCpmmPool, getClaimCreatorFeeInstructions, getCollectCreatorFeeInstructions, getCurveBuyExactInInstruction, getLaunchInstruction, initialCurve, launchlabAuthority, launchlabBuyAccounts, launchlabBuyExactInAccounts, launchlabEventAuthority, launchlabGlobalConfig, launchlabPlatformConfig, launchlabPoolAddress, launchlabSellAccounts, launchlabVaultAddress, metadataAddress, newCurveBuyCost, newCurveReserves, order, platformFeeVaultAddress, preFeeAmount, raydiumIds, remainingBase, resolveVenue, sellQuote, sortedMints, tokenAccountAmount, tokenAccountOwnerAndMint, totalCurveFeeRate, wsolAccountFor };
|
|
931
|
+
}
|
|
932
|
+
//#endregion
|
|
933
|
+
export { resolveVenue as $, raydiumIds as $t, cpmmBuyAccounts as A, Cluster as An, decodeCpmmAmmConfig as At, CurveSettings as B, LAUNCHLAB_SEEDS as Bt, claimCreatorFee as C, SYSTEM_PROGRAM_ADDRESS as Cn, CpmmPoolState as Ct, getCollectCreatorFeeInstructions as D, WSOL_MINT as Dn, LaunchlabGlobalConfig as Dt, getClaimCreatorFeeInstructions as E, VenueInstructionAbi as En, LAUNCHLAB_POOL_STATE_HEAD_SIZE as Et, order as F, GaboxRpcSubscriptions as Fn, tokenAccountAmount as Ft, VenueKind as G, METADATA_LIMITS as Gt, MigratedCpmmPool as H, LAUNCHLAB_STATUS_MIGRATE as Ht, BuildOptions as I, assertClusterUrl as In, tokenAccountOwnerAndMint as It, curveQuote as J, RATE_DENOMINATOR as Jt, cpmmPoolMatches as K, METADATA_SEED as Kt, GaboxTransactionMessage as L, clusterNamedBy as Ln, CONSTANT_CURVE_TAG as Lt, launchlabBuyAccounts as M, DEVNET_WS as Mn, decodeLaunchlabGlobalConfig as Mt, launchlabBuyExactInAccounts as N, GaboxClient as Nn, decodeLaunchlabPlatformConfig as Nt, CpmmTradeAccountsInput as O, CLUSTER_ENDPOINTS as On, LaunchlabPlatformConfig as Ot, launchlabSellAccounts as P, GaboxRpc as Pn, decodeLaunchlabPool as Pt, newCurveReserves as Q, compareAddresses as Qt, buildMessage as R, createClient as Rn, CPMM_SEEDS as Rt, CreatorFees as S, RaydiumClusterIds as Sn, CpmmAmmConfig as St, fetchCreatorFees as T, VenueAccountSpec as Tn, LAUNCHLAB_PLATFORM_CONFIG_HEAD_SIZE as Tt, ResolveVenueOptions as U, LAUNCHLAB_STATUS_TRADE as Ut, FindCpmmPoolOptions as V, LAUNCHLAB_STATUS_FUND as Vt, ResolvedVenue as W, LAUNCH_DECIMALS as Wt, findCpmmPool as X, RaydiumIds as Xt, fetchCurveSettings as Y, RAYDIUM_IDS as Yt, newCurveBuyCost as Z, SHARE_FEE_RATE as Zt, platformFeeVaultAddress as _, METAPLEX_PROGRAM_ADDRESS as _n, totalCurveFeeRate as _t, cpmmAuthority as a, CPMM_SWAP_BASE_INPUT as an, CurveReserves as at, ClaimCreatorFeeInput as b, RAYDIUM_MAINNET_IDS as bn, CPMM_POOL_STATE_HEAD_SIZE as bt, creatorFeeVaultAddress as c, LAUNCHLAB_BUY_EXACT_OUT as cn, ceilDivRate as ct, launchlabEventAuthority as d, LAUNCHLAB_INITIALIZE as dn, curveBuyExactIn as dt, sortedMints as en, sellQuote as et, launchlabGlobalConfig as f, LAUNCHLAB_PLATFORM_CONFIG_DISCRIMINATOR as fn, curveBuyExactOut as ft, metadataAddress as g, LAUNCH_TOTAL_BASE_SELL as gn, remainingBase as gt, launchlabVaultAddress as h, LAUNCH_SUPPLY as hn, preFeeAmount as ht, ata as i, CPMM_POOL_STATE_DISCRIMINATOR as in, CurveFeeRates as it, cpmmSellAccounts as j, DEVNET_HTTP as jn, decodeCpmmPool as jt, LaunchlabTradeAccountsInput as k, ClientConfig as kn, LaunchlabPoolState as kt, creatorFeeVaultAuthority as l, LAUNCHLAB_CLAIM_CREATOR_FEE as ln, cpmmSwapBaseInput as lt, launchlabPoolAddress as m, LAUNCHLAB_SELL_EXACT_IN as mn, initialCurve as mt, CurveBuyExactInInput as n, CPMM_AMM_CONFIG_DISCRIMINATOR as nn, CpmmFeeRates as nt, cpmmCreatorFeeShare as o, CPMM_SWAP_BASE_OUTPUT as on, LaunchParams as ot, launchlabPlatformConfig as p, LAUNCHLAB_POOL_STATE_DISCRIMINATOR as pn, curveSellExactIn as pt, creatorFeeOnInput as q, MIGRATE_TO_CPMM as qt, getCurveBuyExactInInstruction as r, CPMM_COLLECT_CREATOR_FEE as rn, CpmmSwapSides as rt, cpmmPoolAddress as s, LAUNCHLAB_BUY_EXACT_IN as sn, ceilDiv as st, index_d_exports as t, ASSOCIATED_TOKEN_PROGRAM_ADDRESS as tn, wsolAccountFor as tt, launchlabAuthority as u, LAUNCHLAB_GLOBAL_CONFIG_DISCRIMINATOR as un, cpmmSwapBaseOutput as ut, LaunchInput as v, PLATFORM_ADMIN as vn, CPMM_AMM_CONFIG_HEAD_SIZE as vt, collectCreatorFee as w, TOKEN_PROGRAM_ADDRESS as wn, LAUNCHLAB_GLOBAL_CONFIG_HEAD_SIZE as wt, CollectCreatorFeeInput as x, RENT_SYSVAR_ADDRESS as xn, CPMM_POOL_STATE_SIZE as xt, getLaunchInstruction as y, RAYDIUM_DEVNET_IDS as yn, CPMM_POOL_OFFSETS as yt, withRemainingAccounts as z, websocketUrlFor as zn, CREATOR_FEE_ON_QUOTE as zt };
|
|
934
|
+
//# sourceMappingURL=index-BDfGvmgF.d.ts.map
|