@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.
@@ -1,6 +1,2293 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.js";
2
- import { $ as getFulfillDrawInstructionDataCodec, $n as getPrizeEncoder, $t as findPoolPda, A as getRetryDrawInstructionDataCodec, An as fetchMaybePool, At as getClaimPrizeInstructionAsync, B as getInitializePoolInstructionDataEncoder, Bn as fetchAllMaybeDraw, Bt as getBuyPackInstructionDataDecoder, C as getSellPrizeInstructionDataDecoder, Cn as getReferralDiscriminatorBytes, Ct as getClaimReferralInstructionDataCodec, D as getRetryDrawDiscriminatorBytes, Dn as decodePool, Dt as CLAIM_PRIZE_DISCRIMINATOR, E as RETRY_DRAW_DISCRIMINATOR, En as POOL_DISCRIMINATOR, Et as parseClaimReferralInstruction, F as getInitializePoolDiscriminatorBytes, Fn as getPoolEncoder, Ft as BUY_PACK_DISCRIMINATOR, G as getFundPrizesInstructionDataCodec, Gn as getDrawDiscriminatorBytes, Gt as getBindReferrerInstruction, H as FUND_PRIZES_DISCRIMINATOR, Hn as fetchMaybeDraw, Ht as parseBuyPackInstruction, I as getInitializePoolInstruction, In as getPoolSize, It as getBuyPackDiscriminatorBytes, J as parseFundPrizesInstruction, Jn as getTierCodec, Jt as getBindReferrerInstructionDataDecoder, K as getFundPrizesInstructionDataDecoder, Kn as getDrawEncoder, Kt as getBindReferrerInstructionAsync, L as getInitializePoolInstructionAsync, Ln as DRAW_DISCRIMINATOR, Lt as getBuyPackInstruction, M as getRetryDrawInstructionDataEncoder, Mn as getPoolCodec, Mt as getClaimPrizeInstructionDataDecoder, N as parseRetryDrawInstruction, Nn as getPoolDecoder, Nt as getClaimPrizeInstructionDataEncoder, O as getRetryDrawInstruction, On as fetchAllMaybePool, Ot as getClaimPrizeDiscriminatorBytes, P as INITIALIZE_POOL_DISCRIMINATOR, Pn as getPoolDiscriminatorBytes, Pt as parseClaimPrizeInstruction, Q as getFulfillDrawInstructionAsync, Qn as getPrizeDecoder, Qt as findReferralPda, R as getInitializePoolInstructionDataCodec, Rn as decodeDraw, Rt as getBuyPackInstructionAsync, S as getSellPrizeInstructionDataCodec, Sn as getReferralDecoder, St as getClaimReferralInstructionAsync, T as parseSellPrizeInstruction, Tn as getReferralSize, Tt as getClaimReferralInstructionDataEncoder, U as getFundPrizesDiscriminatorBytes, Un as getDrawCodec, Ut as BIND_REFERRER_DISCRIMINATOR, V as parseInitializePoolInstruction, Vn as fetchDraw, Vt as getBuyPackInstructionDataEncoder, W as getFundPrizesInstruction, Wn as getDrawDecoder, Wt as getBindReferrerDiscriminatorBytes, X as getFulfillDrawDiscriminatorBytes, Xn as getTierEncoder, Xt as parseBindReferrerInstruction, Y as FULFILL_DRAW_DISCRIMINATOR, Yn as getTierDecoder, Yt as getBindReferrerInstructionDataEncoder, Z as getFulfillDrawInstruction, Zn as getPrizeCodec, Zt as findReferralLinkPda, _ as parseSellTokensInstruction, _n as fetchAllMaybeReferral, _t as getDeliverDrawInstructionDataEncoder, a as gaboxV2Program, an as decodeReferralLink, at as getExpireDrawInstruction, b as getSellPrizeInstruction, bn as fetchReferral, bt as getClaimReferralDiscriminatorBytes, c as identifyGaboxV2Instruction, cn as fetchMaybeReferralLink, ct as getExpireDrawInstructionDataDecoder, d as getSellTokensDiscriminatorBytes, dn as getReferralLinkDecoder, dt as DELIVER_DRAW_DISCRIMINATOR, en as findLinkPda, er as DrawStatus, et as getFulfillDrawInstructionDataDecoder, f as getSellTokensInstruction, fn as getReferralLinkDiscriminatorBytes, ft as getDeliverDrawDiscriminatorBytes, g as getSellTokensInstructionDataEncoder, gn as decodeReferral, gt as getDeliverDrawInstructionDataDecoder, h as getSellTokensInstructionDataDecoder, hn as REFERRAL_DISCRIMINATOR, ht as getDeliverDrawInstructionDataCodec, i as GaboxV2Instruction, in as REFERRAL_LINK_DISCRIMINATOR, it as getExpireDrawDiscriminatorBytes, j as getRetryDrawInstructionDataDecoder, jn as fetchPool, jt as getClaimPrizeInstructionDataCodec, k as getRetryDrawInstructionAsync, kn as fetchAllPool, kt as getClaimPrizeInstruction, l as parseGaboxV2Instruction, ln as fetchReferralLink, lt as getExpireDrawInstructionDataEncoder, m as getSellTokensInstructionDataCodec, mn as getReferralLinkSize, mt as getDeliverDrawInstructionAsync, n as GaboxV2Account, nn as findDrawPda, nr as getDrawStatusDecoder, nt as parseFulfillDrawInstruction, o as identifyGaboxV2Account, on as fetchAllMaybeReferralLink, ot as getExpireDrawInstructionAsync, p as getSellTokensInstructionAsync, pn as getReferralLinkEncoder, pt as getDeliverDrawInstruction, q as getFundPrizesInstructionDataEncoder, qn as getDrawSize, qt as getBindReferrerInstructionDataCodec, r as GaboxV2Event, rn as findClaimReferralReferralPda, rr as getDrawStatusEncoder, rt as EXPIRE_DRAW_DISCRIMINATOR, s as identifyGaboxV2Event, sn as fetchAllReferralLink, st as getExpireDrawInstructionDataCodec, t as GABOX_V2_PROGRAM_ADDRESS, tn as findIdentityPda, tr as getDrawStatusCodec, tt as getFulfillDrawInstructionDataEncoder, u as SELL_TOKENS_DISCRIMINATOR, un as getReferralLinkCodec, ut as parseExpireDrawInstruction, v as SELL_PRIZE_DISCRIMINATOR, vn as fetchAllReferral, vt as parseDeliverDrawInstruction, w as getSellPrizeInstructionDataEncoder, wn as getReferralEncoder, wt as getClaimReferralInstructionDataDecoder, x as getSellPrizeInstructionAsync, xn as getReferralCodec, xt as getClaimReferralInstruction, y as getSellPrizeDiscriminatorBytes, yn as fetchMaybeReferral, yt as CLAIM_REFERRAL_DISCRIMINATOR, z as getInitializePoolInstructionDataDecoder, zn as fetchAllDraw, zt as getBuyPackInstructionDataCodec } from "../gaboxV2-CV2XltqC.js";
3
- import { combineCodec, containsBytes, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, isProgramError } from "@solana/kit";
2
+ import { SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, SolanaError, assertAccountExists, assertAccountsExist, assertIsInstructionWithAccounts, combineCodec, containsBytes, decodeAccount, extendClient, fetchEncodedAccount, fetchEncodedAccounts, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, isProgramError, transformEncoder } from "@solana/kit";
3
+ import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, getAccountMetaFactory, getAddressFromResolvedInstructionAccount, getNonNullResolvedInstructionInput } from "@solana/program-client-core";
4
+ //#region src/generated/types/prize.ts
5
+ /**
6
+ * This code was AUTOGENERATED using the Codama library.
7
+ * Please DO NOT EDIT THIS FILE, instead use visitors
8
+ * to add features, then rerun Codama to update it.
9
+ *
10
+ * @see https://github.com/codama-idl/codama
11
+ */
12
+ function getPrizeEncoder() {
13
+ return getStructEncoder([["amount", getU64Encoder()], ["tickets", getU32Encoder()]]);
14
+ }
15
+ function getPrizeDecoder() {
16
+ return getStructDecoder([["amount", getU64Decoder()], ["tickets", getU32Decoder()]]);
17
+ }
18
+ function getPrizeCodec() {
19
+ return combineCodec(getPrizeEncoder(), getPrizeDecoder());
20
+ }
21
+ //#endregion
22
+ //#region src/generated/types/tier.ts
23
+ /**
24
+ * This code was AUTOGENERATED using the Codama library.
25
+ * Please DO NOT EDIT THIS FILE, instead use visitors
26
+ * to add features, then rerun Codama to update it.
27
+ *
28
+ * @see https://github.com/codama-idl/codama
29
+ */
30
+ function getTierEncoder() {
31
+ return getStructEncoder([["multiplierBps", getU32Encoder()], ["tickets", getU32Encoder()]]);
32
+ }
33
+ function getTierDecoder() {
34
+ return getStructDecoder([["multiplierBps", getU32Decoder()], ["tickets", getU32Decoder()]]);
35
+ }
36
+ function getTierCodec() {
37
+ return combineCodec(getTierEncoder(), getTierDecoder());
38
+ }
39
+ //#endregion
40
+ //#region src/generated/accounts/draw.ts
41
+ /**
42
+ * This code was AUTOGENERATED using the Codama library.
43
+ * Please DO NOT EDIT THIS FILE, instead use visitors
44
+ * to add features, then rerun Codama to update it.
45
+ *
46
+ * @see https://github.com/codama-idl/codama
47
+ */
48
+ const DRAW_DISCRIMINATOR = new Uint8Array([
49
+ 101,
50
+ 31,
51
+ 52,
52
+ 179,
53
+ 121,
54
+ 78,
55
+ 252,
56
+ 89
57
+ ]);
58
+ function getDrawDiscriminatorBytes() {
59
+ return fixEncoderSize(getBytesEncoder(), 8).encode(DRAW_DISCRIMINATOR);
60
+ }
61
+ /** Gets the encoder for {@link DrawArgs} account data. */
62
+ function getDrawEncoder() {
63
+ return transformEncoder(getStructEncoder([
64
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
65
+ ["pool", getAddressEncoder()],
66
+ ["purchaser", getAddressEncoder()],
67
+ ["seq", getU64Encoder()],
68
+ ["bump", getU8Encoder()],
69
+ ["requestSlot", getU64Encoder()],
70
+ ["lastAttemptSlot", getU64Encoder()],
71
+ ["attempts", getU8Encoder()],
72
+ ["maximum", getU64Encoder()],
73
+ ["minimum", getU64Encoder()],
74
+ ["prizes", getArrayEncoder(getPrizeEncoder(), { size: 8 })]
75
+ ]), (value) => ({
76
+ ...value,
77
+ discriminator: DRAW_DISCRIMINATOR
78
+ }));
79
+ }
80
+ /** Gets the decoder for {@link Draw} account data. */
81
+ function getDrawDecoder() {
82
+ return getStructDecoder([
83
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
84
+ ["pool", getAddressDecoder()],
85
+ ["purchaser", getAddressDecoder()],
86
+ ["seq", getU64Decoder()],
87
+ ["bump", getU8Decoder()],
88
+ ["requestSlot", getU64Decoder()],
89
+ ["lastAttemptSlot", getU64Decoder()],
90
+ ["attempts", getU8Decoder()],
91
+ ["maximum", getU64Decoder()],
92
+ ["minimum", getU64Decoder()],
93
+ ["prizes", getArrayDecoder(getPrizeDecoder(), { size: 8 })]
94
+ ]);
95
+ }
96
+ /** Gets the codec for {@link Draw} account data. */
97
+ function getDrawCodec() {
98
+ return combineCodec(getDrawEncoder(), getDrawDecoder());
99
+ }
100
+ function decodeDraw(encodedAccount) {
101
+ return decodeAccount(encodedAccount, getDrawDecoder());
102
+ }
103
+ async function fetchDraw(rpc, address, config) {
104
+ const maybeAccount = await fetchMaybeDraw(rpc, address, config);
105
+ assertAccountExists(maybeAccount);
106
+ return maybeAccount;
107
+ }
108
+ async function fetchMaybeDraw(rpc, address, config) {
109
+ return decodeDraw(await fetchEncodedAccount(rpc, address, config));
110
+ }
111
+ async function fetchAllDraw(rpc, addresses, config) {
112
+ const maybeAccounts = await fetchAllMaybeDraw(rpc, addresses, config);
113
+ assertAccountsExist(maybeAccounts);
114
+ return maybeAccounts;
115
+ }
116
+ async function fetchAllMaybeDraw(rpc, addresses, config) {
117
+ return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodeDraw(maybeAccount));
118
+ }
119
+ function getDrawSize() {
120
+ return 210;
121
+ }
122
+ //#endregion
123
+ //#region src/generated/accounts/pool.ts
124
+ /**
125
+ * This code was AUTOGENERATED using the Codama library.
126
+ * Please DO NOT EDIT THIS FILE, instead use visitors
127
+ * to add features, then rerun Codama to update it.
128
+ *
129
+ * @see https://github.com/codama-idl/codama
130
+ */
131
+ const POOL_DISCRIMINATOR = new Uint8Array([
132
+ 140,
133
+ 230,
134
+ 142,
135
+ 167,
136
+ 14,
137
+ 202,
138
+ 43,
139
+ 254
140
+ ]);
141
+ function getPoolDiscriminatorBytes() {
142
+ return fixEncoderSize(getBytesEncoder(), 8).encode(POOL_DISCRIMINATOR);
143
+ }
144
+ /** Gets the encoder for {@link PoolArgs} account data. */
145
+ function getPoolEncoder() {
146
+ return transformEncoder(getStructEncoder([
147
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
148
+ ["creator", getAddressEncoder()],
149
+ ["mint", getAddressEncoder()],
150
+ ["vault", getAddressEncoder()],
151
+ ["quoteMint", getAddressEncoder()],
152
+ ["bump", getU8Encoder()],
153
+ ["packTokens", getU64Encoder()],
154
+ ["seedQuoteAmount", getU64Encoder()],
155
+ ["tiers", getArrayEncoder(getTierEncoder(), { size: 8 })],
156
+ ["nextSeq", getU64Encoder()],
157
+ ["reserved", getU64Encoder()]
158
+ ]), (value) => ({
159
+ ...value,
160
+ discriminator: POOL_DISCRIMINATOR
161
+ }));
162
+ }
163
+ /** Gets the decoder for {@link Pool} account data. */
164
+ function getPoolDecoder() {
165
+ return getStructDecoder([
166
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
167
+ ["creator", getAddressDecoder()],
168
+ ["mint", getAddressDecoder()],
169
+ ["vault", getAddressDecoder()],
170
+ ["quoteMint", getAddressDecoder()],
171
+ ["bump", getU8Decoder()],
172
+ ["packTokens", getU64Decoder()],
173
+ ["seedQuoteAmount", getU64Decoder()],
174
+ ["tiers", getArrayDecoder(getTierDecoder(), { size: 8 })],
175
+ ["nextSeq", getU64Decoder()],
176
+ ["reserved", getU64Decoder()]
177
+ ]);
178
+ }
179
+ /** Gets the codec for {@link Pool} account data. */
180
+ function getPoolCodec() {
181
+ return combineCodec(getPoolEncoder(), getPoolDecoder());
182
+ }
183
+ function decodePool(encodedAccount) {
184
+ return decodeAccount(encodedAccount, getPoolDecoder());
185
+ }
186
+ async function fetchPool(rpc, address, config) {
187
+ const maybeAccount = await fetchMaybePool(rpc, address, config);
188
+ assertAccountExists(maybeAccount);
189
+ return maybeAccount;
190
+ }
191
+ async function fetchMaybePool(rpc, address, config) {
192
+ return decodePool(await fetchEncodedAccount(rpc, address, config));
193
+ }
194
+ async function fetchAllPool(rpc, addresses, config) {
195
+ const maybeAccounts = await fetchAllMaybePool(rpc, addresses, config);
196
+ assertAccountsExist(maybeAccounts);
197
+ return maybeAccounts;
198
+ }
199
+ async function fetchAllMaybePool(rpc, addresses, config) {
200
+ return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodePool(maybeAccount));
201
+ }
202
+ function getPoolSize() {
203
+ return 233;
204
+ }
205
+ //#endregion
206
+ //#region src/generated/accounts/walletActivity.ts
207
+ /**
208
+ * This code was AUTOGENERATED using the Codama library.
209
+ * Please DO NOT EDIT THIS FILE, instead use visitors
210
+ * to add features, then rerun Codama to update it.
211
+ *
212
+ * @see https://github.com/codama-idl/codama
213
+ */
214
+ const WALLET_ACTIVITY_DISCRIMINATOR = new Uint8Array([
215
+ 212,
216
+ 80,
217
+ 180,
218
+ 131,
219
+ 173,
220
+ 1,
221
+ 252,
222
+ 141
223
+ ]);
224
+ function getWalletActivityDiscriminatorBytes() {
225
+ return fixEncoderSize(getBytesEncoder(), 8).encode(WALLET_ACTIVITY_DISCRIMINATOR);
226
+ }
227
+ /** Gets the encoder for {@link WalletActivityArgs} account data. */
228
+ function getWalletActivityEncoder() {
229
+ return transformEncoder(getStructEncoder([
230
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
231
+ ["wallet", getAddressEncoder()],
232
+ ["bump", getU8Encoder()],
233
+ ["packsBought", getU64Encoder()],
234
+ ["nativeSpent", getU64Encoder()],
235
+ ["reserved", fixEncoderSize(getBytesEncoder(), 64)]
236
+ ]), (value) => ({
237
+ ...value,
238
+ discriminator: WALLET_ACTIVITY_DISCRIMINATOR
239
+ }));
240
+ }
241
+ /** Gets the decoder for {@link WalletActivity} account data. */
242
+ function getWalletActivityDecoder() {
243
+ return getStructDecoder([
244
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
245
+ ["wallet", getAddressDecoder()],
246
+ ["bump", getU8Decoder()],
247
+ ["packsBought", getU64Decoder()],
248
+ ["nativeSpent", getU64Decoder()],
249
+ ["reserved", fixDecoderSize(getBytesDecoder(), 64)]
250
+ ]);
251
+ }
252
+ /** Gets the codec for {@link WalletActivity} account data. */
253
+ function getWalletActivityCodec() {
254
+ return combineCodec(getWalletActivityEncoder(), getWalletActivityDecoder());
255
+ }
256
+ function decodeWalletActivity(encodedAccount) {
257
+ return decodeAccount(encodedAccount, getWalletActivityDecoder());
258
+ }
259
+ async function fetchWalletActivity(rpc, address, config) {
260
+ const maybeAccount = await fetchMaybeWalletActivity(rpc, address, config);
261
+ assertAccountExists(maybeAccount);
262
+ return maybeAccount;
263
+ }
264
+ async function fetchMaybeWalletActivity(rpc, address, config) {
265
+ return decodeWalletActivity(await fetchEncodedAccount(rpc, address, config));
266
+ }
267
+ async function fetchAllWalletActivity(rpc, addresses, config) {
268
+ const maybeAccounts = await fetchAllMaybeWalletActivity(rpc, addresses, config);
269
+ assertAccountsExist(maybeAccounts);
270
+ return maybeAccounts;
271
+ }
272
+ async function fetchAllMaybeWalletActivity(rpc, addresses, config) {
273
+ return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodeWalletActivity(maybeAccount));
274
+ }
275
+ function getWalletActivitySize() {
276
+ return 121;
277
+ }
278
+ //#endregion
279
+ //#region src/generated/pdas/activity.ts
280
+ /**
281
+ * This code was AUTOGENERATED using the Codama library.
282
+ * Please DO NOT EDIT THIS FILE, instead use visitors
283
+ * to add features, then rerun Codama to update it.
284
+ *
285
+ * @see https://github.com/codama-idl/codama
286
+ */
287
+ async function findActivityPda(seeds, config = {}) {
288
+ const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
289
+ return await getProgramDerivedAddress({
290
+ programAddress,
291
+ seeds: [getBytesEncoder().encode(new Uint8Array([
292
+ 97,
293
+ 99,
294
+ 116,
295
+ 105,
296
+ 118,
297
+ 105,
298
+ 116,
299
+ 121
300
+ ])), getAddressEncoder().encode(seeds.purchaser)]
301
+ });
302
+ }
303
+ //#endregion
304
+ //#region src/generated/pdas/draw.ts
305
+ /**
306
+ * This code was AUTOGENERATED using the Codama library.
307
+ * Please DO NOT EDIT THIS FILE, instead use visitors
308
+ * to add features, then rerun Codama to update it.
309
+ *
310
+ * @see https://github.com/codama-idl/codama
311
+ */
312
+ async function findDrawPda(seeds, config = {}) {
313
+ const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
314
+ return await getProgramDerivedAddress({
315
+ programAddress,
316
+ seeds: [
317
+ getBytesEncoder().encode(new Uint8Array([
318
+ 100,
319
+ 114,
320
+ 97,
321
+ 119
322
+ ])),
323
+ getAddressEncoder().encode(seeds.pool),
324
+ getU64Encoder().encode(seeds.seq)
325
+ ]
326
+ });
327
+ }
328
+ //#endregion
329
+ //#region src/generated/pdas/identity.ts
330
+ /**
331
+ * This code was AUTOGENERATED using the Codama library.
332
+ * Please DO NOT EDIT THIS FILE, instead use visitors
333
+ * to add features, then rerun Codama to update it.
334
+ *
335
+ * @see https://github.com/codama-idl/codama
336
+ */
337
+ async function findIdentityPda(config = {}) {
338
+ const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
339
+ return await getProgramDerivedAddress({
340
+ programAddress,
341
+ seeds: [getBytesEncoder().encode(new Uint8Array([
342
+ 105,
343
+ 100,
344
+ 101,
345
+ 110,
346
+ 116,
347
+ 105,
348
+ 116,
349
+ 121
350
+ ]))]
351
+ });
352
+ }
353
+ //#endregion
354
+ //#region src/generated/pdas/pool.ts
355
+ /**
356
+ * This code was AUTOGENERATED using the Codama library.
357
+ * Please DO NOT EDIT THIS FILE, instead use visitors
358
+ * to add features, then rerun Codama to update it.
359
+ *
360
+ * @see https://github.com/codama-idl/codama
361
+ */
362
+ async function findPoolPda(seeds, config = {}) {
363
+ const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
364
+ return await getProgramDerivedAddress({
365
+ programAddress,
366
+ seeds: [getBytesEncoder().encode(new Uint8Array([
367
+ 112,
368
+ 111,
369
+ 111,
370
+ 108
371
+ ])), getAddressEncoder().encode(seeds.mint)]
372
+ });
373
+ }
374
+ //#endregion
375
+ //#region src/generated/instructions/buyPack.ts
376
+ /**
377
+ * This code was AUTOGENERATED using the Codama library.
378
+ * Please DO NOT EDIT THIS FILE, instead use visitors
379
+ * to add features, then rerun Codama to update it.
380
+ *
381
+ * @see https://github.com/codama-idl/codama
382
+ */
383
+ const BUY_PACK_DISCRIMINATOR = new Uint8Array([
384
+ 151,
385
+ 46,
386
+ 141,
387
+ 93,
388
+ 174,
389
+ 5,
390
+ 49,
391
+ 173
392
+ ]);
393
+ function getBuyPackDiscriminatorBytes() {
394
+ return fixEncoderSize(getBytesEncoder(), 8).encode(BUY_PACK_DISCRIMINATOR);
395
+ }
396
+ function getBuyPackInstructionDataEncoder() {
397
+ return transformEncoder(getStructEncoder([
398
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
399
+ ["maxQuoteIn", getU64Encoder()],
400
+ ["minMaximum", getU64Encoder()],
401
+ ["maxNativeDebit", getU64Encoder()]
402
+ ]), (value) => ({
403
+ ...value,
404
+ discriminator: BUY_PACK_DISCRIMINATOR
405
+ }));
406
+ }
407
+ function getBuyPackInstructionDataDecoder() {
408
+ return getStructDecoder([
409
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
410
+ ["maxQuoteIn", getU64Decoder()],
411
+ ["minMaximum", getU64Decoder()],
412
+ ["maxNativeDebit", getU64Decoder()]
413
+ ]);
414
+ }
415
+ function getBuyPackInstructionDataCodec() {
416
+ return combineCodec(getBuyPackInstructionDataEncoder(), getBuyPackInstructionDataDecoder());
417
+ }
418
+ async function getBuyPackInstructionAsync(input, config) {
419
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
420
+ const accounts = {
421
+ purchaser: {
422
+ value: input.purchaser ?? null,
423
+ isWritable: true
424
+ },
425
+ pool: {
426
+ value: input.pool ?? null,
427
+ isWritable: true
428
+ },
429
+ draw: {
430
+ value: input.draw ?? null,
431
+ isWritable: true
432
+ },
433
+ activity: {
434
+ value: input.activity ?? null,
435
+ isWritable: true
436
+ },
437
+ mint: {
438
+ value: input.mint ?? null,
439
+ isWritable: false
440
+ },
441
+ quoteMint: {
442
+ value: input.quoteMint ?? null,
443
+ isWritable: false
444
+ },
445
+ vault: {
446
+ value: input.vault ?? null,
447
+ isWritable: true
448
+ },
449
+ userTokens: {
450
+ value: input.userTokens ?? null,
451
+ isWritable: true
452
+ },
453
+ venue: {
454
+ value: input.venue ?? null,
455
+ isWritable: false
456
+ },
457
+ identity: {
458
+ value: input.identity ?? null,
459
+ isWritable: false
460
+ },
461
+ queue: {
462
+ value: input.queue ?? null,
463
+ isWritable: true
464
+ },
465
+ program: {
466
+ value: input.program ?? null,
467
+ isWritable: false
468
+ },
469
+ slotHashes: {
470
+ value: input.slotHashes ?? null,
471
+ isWritable: false
472
+ },
473
+ tokenProgram: {
474
+ value: input.tokenProgram ?? null,
475
+ isWritable: false
476
+ },
477
+ associatedTokenProgram: {
478
+ value: input.associatedTokenProgram ?? null,
479
+ isWritable: false
480
+ },
481
+ systemProgram: {
482
+ value: input.systemProgram ?? null,
483
+ isWritable: false
484
+ }
485
+ };
486
+ const args = { ...input };
487
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
488
+ if (!accounts.activity.value) accounts.activity.value = await findActivityPda({ purchaser: getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value) }, { programAddress });
489
+ if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
490
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
491
+ seeds: [
492
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
493
+ getBytesEncoder().encode(new Uint8Array([
494
+ 6,
495
+ 221,
496
+ 246,
497
+ 225,
498
+ 215,
499
+ 101,
500
+ 161,
501
+ 147,
502
+ 217,
503
+ 203,
504
+ 225,
505
+ 70,
506
+ 206,
507
+ 235,
508
+ 121,
509
+ 172,
510
+ 28,
511
+ 180,
512
+ 133,
513
+ 237,
514
+ 95,
515
+ 91,
516
+ 55,
517
+ 145,
518
+ 58,
519
+ 140,
520
+ 245,
521
+ 133,
522
+ 126,
523
+ 255,
524
+ 0,
525
+ 169
526
+ ])),
527
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
528
+ ]
529
+ });
530
+ if (!accounts.identity.value) accounts.identity.value = await findIdentityPda({ programAddress });
531
+ if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
532
+ if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
533
+ if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
534
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
535
+ if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
536
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
537
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
538
+ return Object.freeze({
539
+ accounts: [
540
+ getAccountMeta("purchaser", accounts.purchaser),
541
+ getAccountMeta("pool", accounts.pool),
542
+ getAccountMeta("draw", accounts.draw),
543
+ getAccountMeta("activity", accounts.activity),
544
+ getAccountMeta("mint", accounts.mint),
545
+ getAccountMeta("quoteMint", accounts.quoteMint),
546
+ getAccountMeta("vault", accounts.vault),
547
+ getAccountMeta("userTokens", accounts.userTokens),
548
+ getAccountMeta("venue", accounts.venue),
549
+ getAccountMeta("identity", accounts.identity),
550
+ getAccountMeta("queue", accounts.queue),
551
+ getAccountMeta("program", accounts.program),
552
+ getAccountMeta("slotHashes", accounts.slotHashes),
553
+ getAccountMeta("tokenProgram", accounts.tokenProgram),
554
+ getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
555
+ getAccountMeta("systemProgram", accounts.systemProgram)
556
+ ],
557
+ data: getBuyPackInstructionDataEncoder().encode(args),
558
+ programAddress
559
+ });
560
+ }
561
+ function getBuyPackInstruction(input, config) {
562
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
563
+ const accounts = {
564
+ purchaser: {
565
+ value: input.purchaser ?? null,
566
+ isWritable: true
567
+ },
568
+ pool: {
569
+ value: input.pool ?? null,
570
+ isWritable: true
571
+ },
572
+ draw: {
573
+ value: input.draw ?? null,
574
+ isWritable: true
575
+ },
576
+ activity: {
577
+ value: input.activity ?? null,
578
+ isWritable: true
579
+ },
580
+ mint: {
581
+ value: input.mint ?? null,
582
+ isWritable: false
583
+ },
584
+ quoteMint: {
585
+ value: input.quoteMint ?? null,
586
+ isWritable: false
587
+ },
588
+ vault: {
589
+ value: input.vault ?? null,
590
+ isWritable: true
591
+ },
592
+ userTokens: {
593
+ value: input.userTokens ?? null,
594
+ isWritable: true
595
+ },
596
+ venue: {
597
+ value: input.venue ?? null,
598
+ isWritable: false
599
+ },
600
+ identity: {
601
+ value: input.identity ?? null,
602
+ isWritable: false
603
+ },
604
+ queue: {
605
+ value: input.queue ?? null,
606
+ isWritable: true
607
+ },
608
+ program: {
609
+ value: input.program ?? null,
610
+ isWritable: false
611
+ },
612
+ slotHashes: {
613
+ value: input.slotHashes ?? null,
614
+ isWritable: false
615
+ },
616
+ tokenProgram: {
617
+ value: input.tokenProgram ?? null,
618
+ isWritable: false
619
+ },
620
+ associatedTokenProgram: {
621
+ value: input.associatedTokenProgram ?? null,
622
+ isWritable: false
623
+ },
624
+ systemProgram: {
625
+ value: input.systemProgram ?? null,
626
+ isWritable: false
627
+ }
628
+ };
629
+ const args = { ...input };
630
+ if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
631
+ if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
632
+ if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
633
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
634
+ if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
635
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
636
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
637
+ return Object.freeze({
638
+ accounts: [
639
+ getAccountMeta("purchaser", accounts.purchaser),
640
+ getAccountMeta("pool", accounts.pool),
641
+ getAccountMeta("draw", accounts.draw),
642
+ getAccountMeta("activity", accounts.activity),
643
+ getAccountMeta("mint", accounts.mint),
644
+ getAccountMeta("quoteMint", accounts.quoteMint),
645
+ getAccountMeta("vault", accounts.vault),
646
+ getAccountMeta("userTokens", accounts.userTokens),
647
+ getAccountMeta("venue", accounts.venue),
648
+ getAccountMeta("identity", accounts.identity),
649
+ getAccountMeta("queue", accounts.queue),
650
+ getAccountMeta("program", accounts.program),
651
+ getAccountMeta("slotHashes", accounts.slotHashes),
652
+ getAccountMeta("tokenProgram", accounts.tokenProgram),
653
+ getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
654
+ getAccountMeta("systemProgram", accounts.systemProgram)
655
+ ],
656
+ data: getBuyPackInstructionDataEncoder().encode(args),
657
+ programAddress
658
+ });
659
+ }
660
+ function parseBuyPackInstruction(instruction) {
661
+ if (instruction.accounts.length < 16) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
662
+ actualAccountMetas: instruction.accounts.length,
663
+ expectedAccountMetas: 16
664
+ });
665
+ let accountIndex = 0;
666
+ const getNextAccount = () => {
667
+ const accountMeta = instruction.accounts[accountIndex];
668
+ accountIndex += 1;
669
+ return accountMeta;
670
+ };
671
+ return {
672
+ programAddress: instruction.programAddress,
673
+ accounts: {
674
+ purchaser: getNextAccount(),
675
+ pool: getNextAccount(),
676
+ draw: getNextAccount(),
677
+ activity: getNextAccount(),
678
+ mint: getNextAccount(),
679
+ quoteMint: getNextAccount(),
680
+ vault: getNextAccount(),
681
+ userTokens: getNextAccount(),
682
+ venue: getNextAccount(),
683
+ identity: getNextAccount(),
684
+ queue: getNextAccount(),
685
+ program: getNextAccount(),
686
+ slotHashes: getNextAccount(),
687
+ tokenProgram: getNextAccount(),
688
+ associatedTokenProgram: getNextAccount(),
689
+ systemProgram: getNextAccount()
690
+ },
691
+ data: getBuyPackInstructionDataDecoder().decode(instruction.data)
692
+ };
693
+ }
694
+ //#endregion
695
+ //#region src/generated/instructions/deliverDraw.ts
696
+ /**
697
+ * This code was AUTOGENERATED using the Codama library.
698
+ * Please DO NOT EDIT THIS FILE, instead use visitors
699
+ * to add features, then rerun Codama to update it.
700
+ *
701
+ * @see https://github.com/codama-idl/codama
702
+ */
703
+ const DELIVER_DRAW_DISCRIMINATOR = new Uint8Array([
704
+ 113,
705
+ 181,
706
+ 226,
707
+ 173,
708
+ 237,
709
+ 138,
710
+ 199,
711
+ 51
712
+ ]);
713
+ function getDeliverDrawDiscriminatorBytes() {
714
+ return fixEncoderSize(getBytesEncoder(), 8).encode(DELIVER_DRAW_DISCRIMINATOR);
715
+ }
716
+ function getDeliverDrawInstructionDataEncoder() {
717
+ return transformEncoder(getStructEncoder([
718
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
719
+ ["randomness", fixEncoderSize(getBytesEncoder(), 32)],
720
+ ["seq", getU64Encoder()]
721
+ ]), (value) => ({
722
+ ...value,
723
+ discriminator: DELIVER_DRAW_DISCRIMINATOR
724
+ }));
725
+ }
726
+ function getDeliverDrawInstructionDataDecoder() {
727
+ return getStructDecoder([
728
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
729
+ ["randomness", fixDecoderSize(getBytesDecoder(), 32)],
730
+ ["seq", getU64Decoder()]
731
+ ]);
732
+ }
733
+ function getDeliverDrawInstructionDataCodec() {
734
+ return combineCodec(getDeliverDrawInstructionDataEncoder(), getDeliverDrawInstructionDataDecoder());
735
+ }
736
+ async function getDeliverDrawInstructionAsync(input, config) {
737
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
738
+ const accounts = {
739
+ oracleIdentity: {
740
+ value: input.oracleIdentity ?? null,
741
+ isWritable: false
742
+ },
743
+ pool: {
744
+ value: input.pool ?? null,
745
+ isWritable: true
746
+ },
747
+ draw: {
748
+ value: input.draw ?? null,
749
+ isWritable: true
750
+ },
751
+ purchaser: {
752
+ value: input.purchaser ?? null,
753
+ isWritable: true
754
+ },
755
+ mint: {
756
+ value: input.mint ?? null,
757
+ isWritable: false
758
+ },
759
+ vault: {
760
+ value: input.vault ?? null,
761
+ isWritable: true
762
+ },
763
+ userTokens: {
764
+ value: input.userTokens ?? null,
765
+ isWritable: true
766
+ },
767
+ tokenProgram: {
768
+ value: input.tokenProgram ?? null,
769
+ isWritable: false
770
+ }
771
+ };
772
+ const args = { ...input };
773
+ if (!accounts.oracleIdentity.value) accounts.oracleIdentity.value = await getProgramDerivedAddress({
774
+ programAddress: "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz",
775
+ seeds: [getBytesEncoder().encode(new Uint8Array([
776
+ 105,
777
+ 100,
778
+ 101,
779
+ 110,
780
+ 116,
781
+ 105,
782
+ 116,
783
+ 121
784
+ ])), getBytesEncoder().encode(new Uint8Array([
785
+ 231,
786
+ 95,
787
+ 177,
788
+ 105,
789
+ 231,
790
+ 174,
791
+ 80,
792
+ 36,
793
+ 228,
794
+ 6,
795
+ 241,
796
+ 195,
797
+ 89,
798
+ 243,
799
+ 52,
800
+ 57,
801
+ 128,
802
+ 219,
803
+ 206,
804
+ 84,
805
+ 115,
806
+ 45,
807
+ 3,
808
+ 217,
809
+ 77,
810
+ 35,
811
+ 38,
812
+ 40,
813
+ 214,
814
+ 248,
815
+ 69,
816
+ 83
817
+ ]))]
818
+ });
819
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
820
+ if (!accounts.draw.value) accounts.draw.value = await findDrawPda({
821
+ pool: getAddressFromResolvedInstructionAccount("pool", accounts.pool.value),
822
+ seq: getNonNullResolvedInstructionInput("seq", args.seq)
823
+ }, { programAddress });
824
+ if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
825
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
826
+ seeds: [
827
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
828
+ getBytesEncoder().encode(new Uint8Array([
829
+ 6,
830
+ 221,
831
+ 246,
832
+ 225,
833
+ 215,
834
+ 101,
835
+ 161,
836
+ 147,
837
+ 217,
838
+ 203,
839
+ 225,
840
+ 70,
841
+ 206,
842
+ 235,
843
+ 121,
844
+ 172,
845
+ 28,
846
+ 180,
847
+ 133,
848
+ 237,
849
+ 95,
850
+ 91,
851
+ 55,
852
+ 145,
853
+ 58,
854
+ 140,
855
+ 245,
856
+ 133,
857
+ 126,
858
+ 255,
859
+ 0,
860
+ 169
861
+ ])),
862
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
863
+ ]
864
+ });
865
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
866
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
867
+ return Object.freeze({
868
+ accounts: [
869
+ getAccountMeta("oracleIdentity", accounts.oracleIdentity),
870
+ getAccountMeta("pool", accounts.pool),
871
+ getAccountMeta("draw", accounts.draw),
872
+ getAccountMeta("purchaser", accounts.purchaser),
873
+ getAccountMeta("mint", accounts.mint),
874
+ getAccountMeta("vault", accounts.vault),
875
+ getAccountMeta("userTokens", accounts.userTokens),
876
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
877
+ ],
878
+ data: getDeliverDrawInstructionDataEncoder().encode(args),
879
+ programAddress
880
+ });
881
+ }
882
+ function getDeliverDrawInstruction(input, config) {
883
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
884
+ const accounts = {
885
+ oracleIdentity: {
886
+ value: input.oracleIdentity ?? null,
887
+ isWritable: false
888
+ },
889
+ pool: {
890
+ value: input.pool ?? null,
891
+ isWritable: true
892
+ },
893
+ draw: {
894
+ value: input.draw ?? null,
895
+ isWritable: true
896
+ },
897
+ purchaser: {
898
+ value: input.purchaser ?? null,
899
+ isWritable: true
900
+ },
901
+ mint: {
902
+ value: input.mint ?? null,
903
+ isWritable: false
904
+ },
905
+ vault: {
906
+ value: input.vault ?? null,
907
+ isWritable: true
908
+ },
909
+ userTokens: {
910
+ value: input.userTokens ?? null,
911
+ isWritable: true
912
+ },
913
+ tokenProgram: {
914
+ value: input.tokenProgram ?? null,
915
+ isWritable: false
916
+ }
917
+ };
918
+ const args = { ...input };
919
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
920
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
921
+ return Object.freeze({
922
+ accounts: [
923
+ getAccountMeta("oracleIdentity", accounts.oracleIdentity),
924
+ getAccountMeta("pool", accounts.pool),
925
+ getAccountMeta("draw", accounts.draw),
926
+ getAccountMeta("purchaser", accounts.purchaser),
927
+ getAccountMeta("mint", accounts.mint),
928
+ getAccountMeta("vault", accounts.vault),
929
+ getAccountMeta("userTokens", accounts.userTokens),
930
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
931
+ ],
932
+ data: getDeliverDrawInstructionDataEncoder().encode(args),
933
+ programAddress
934
+ });
935
+ }
936
+ function parseDeliverDrawInstruction(instruction) {
937
+ if (instruction.accounts.length < 8) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
938
+ actualAccountMetas: instruction.accounts.length,
939
+ expectedAccountMetas: 8
940
+ });
941
+ let accountIndex = 0;
942
+ const getNextAccount = () => {
943
+ const accountMeta = instruction.accounts[accountIndex];
944
+ accountIndex += 1;
945
+ return accountMeta;
946
+ };
947
+ return {
948
+ programAddress: instruction.programAddress,
949
+ accounts: {
950
+ oracleIdentity: getNextAccount(),
951
+ pool: getNextAccount(),
952
+ draw: getNextAccount(),
953
+ purchaser: getNextAccount(),
954
+ mint: getNextAccount(),
955
+ vault: getNextAccount(),
956
+ userTokens: getNextAccount(),
957
+ tokenProgram: getNextAccount()
958
+ },
959
+ data: getDeliverDrawInstructionDataDecoder().decode(instruction.data)
960
+ };
961
+ }
962
+ //#endregion
963
+ //#region src/generated/instructions/expireDraw.ts
964
+ /**
965
+ * This code was AUTOGENERATED using the Codama library.
966
+ * Please DO NOT EDIT THIS FILE, instead use visitors
967
+ * to add features, then rerun Codama to update it.
968
+ *
969
+ * @see https://github.com/codama-idl/codama
970
+ */
971
+ const EXPIRE_DRAW_DISCRIMINATOR = new Uint8Array([
972
+ 100,
973
+ 119,
974
+ 235,
975
+ 75,
976
+ 8,
977
+ 25,
978
+ 252,
979
+ 255
980
+ ]);
981
+ function getExpireDrawDiscriminatorBytes() {
982
+ return fixEncoderSize(getBytesEncoder(), 8).encode(EXPIRE_DRAW_DISCRIMINATOR);
983
+ }
984
+ function getExpireDrawInstructionDataEncoder() {
985
+ return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
986
+ ...value,
987
+ discriminator: EXPIRE_DRAW_DISCRIMINATOR
988
+ }));
989
+ }
990
+ function getExpireDrawInstructionDataDecoder() {
991
+ return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)]]);
992
+ }
993
+ function getExpireDrawInstructionDataCodec() {
994
+ return combineCodec(getExpireDrawInstructionDataEncoder(), getExpireDrawInstructionDataDecoder());
995
+ }
996
+ async function getExpireDrawInstructionAsync(input, config) {
997
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
998
+ const accounts = {
999
+ pool: {
1000
+ value: input.pool ?? null,
1001
+ isWritable: true
1002
+ },
1003
+ draw: {
1004
+ value: input.draw ?? null,
1005
+ isWritable: true
1006
+ },
1007
+ purchaser: {
1008
+ value: input.purchaser ?? null,
1009
+ isWritable: true
1010
+ },
1011
+ mint: {
1012
+ value: input.mint ?? null,
1013
+ isWritable: false
1014
+ },
1015
+ vault: {
1016
+ value: input.vault ?? null,
1017
+ isWritable: true
1018
+ },
1019
+ userTokens: {
1020
+ value: input.userTokens ?? null,
1021
+ isWritable: true
1022
+ },
1023
+ tokenProgram: {
1024
+ value: input.tokenProgram ?? null,
1025
+ isWritable: false
1026
+ }
1027
+ };
1028
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
1029
+ if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
1030
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
1031
+ seeds: [
1032
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
1033
+ getBytesEncoder().encode(new Uint8Array([
1034
+ 6,
1035
+ 221,
1036
+ 246,
1037
+ 225,
1038
+ 215,
1039
+ 101,
1040
+ 161,
1041
+ 147,
1042
+ 217,
1043
+ 203,
1044
+ 225,
1045
+ 70,
1046
+ 206,
1047
+ 235,
1048
+ 121,
1049
+ 172,
1050
+ 28,
1051
+ 180,
1052
+ 133,
1053
+ 237,
1054
+ 95,
1055
+ 91,
1056
+ 55,
1057
+ 145,
1058
+ 58,
1059
+ 140,
1060
+ 245,
1061
+ 133,
1062
+ 126,
1063
+ 255,
1064
+ 0,
1065
+ 169
1066
+ ])),
1067
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
1068
+ ]
1069
+ });
1070
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1071
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1072
+ return Object.freeze({
1073
+ accounts: [
1074
+ getAccountMeta("pool", accounts.pool),
1075
+ getAccountMeta("draw", accounts.draw),
1076
+ getAccountMeta("purchaser", accounts.purchaser),
1077
+ getAccountMeta("mint", accounts.mint),
1078
+ getAccountMeta("vault", accounts.vault),
1079
+ getAccountMeta("userTokens", accounts.userTokens),
1080
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1081
+ ],
1082
+ data: getExpireDrawInstructionDataEncoder().encode({}),
1083
+ programAddress
1084
+ });
1085
+ }
1086
+ function getExpireDrawInstruction(input, config) {
1087
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1088
+ const accounts = {
1089
+ pool: {
1090
+ value: input.pool ?? null,
1091
+ isWritable: true
1092
+ },
1093
+ draw: {
1094
+ value: input.draw ?? null,
1095
+ isWritable: true
1096
+ },
1097
+ purchaser: {
1098
+ value: input.purchaser ?? null,
1099
+ isWritable: true
1100
+ },
1101
+ mint: {
1102
+ value: input.mint ?? null,
1103
+ isWritable: false
1104
+ },
1105
+ vault: {
1106
+ value: input.vault ?? null,
1107
+ isWritable: true
1108
+ },
1109
+ userTokens: {
1110
+ value: input.userTokens ?? null,
1111
+ isWritable: true
1112
+ },
1113
+ tokenProgram: {
1114
+ value: input.tokenProgram ?? null,
1115
+ isWritable: false
1116
+ }
1117
+ };
1118
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1119
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1120
+ return Object.freeze({
1121
+ accounts: [
1122
+ getAccountMeta("pool", accounts.pool),
1123
+ getAccountMeta("draw", accounts.draw),
1124
+ getAccountMeta("purchaser", accounts.purchaser),
1125
+ getAccountMeta("mint", accounts.mint),
1126
+ getAccountMeta("vault", accounts.vault),
1127
+ getAccountMeta("userTokens", accounts.userTokens),
1128
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1129
+ ],
1130
+ data: getExpireDrawInstructionDataEncoder().encode({}),
1131
+ programAddress
1132
+ });
1133
+ }
1134
+ function parseExpireDrawInstruction(instruction) {
1135
+ if (instruction.accounts.length < 7) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
1136
+ actualAccountMetas: instruction.accounts.length,
1137
+ expectedAccountMetas: 7
1138
+ });
1139
+ let accountIndex = 0;
1140
+ const getNextAccount = () => {
1141
+ const accountMeta = instruction.accounts[accountIndex];
1142
+ accountIndex += 1;
1143
+ return accountMeta;
1144
+ };
1145
+ return {
1146
+ programAddress: instruction.programAddress,
1147
+ accounts: {
1148
+ pool: getNextAccount(),
1149
+ draw: getNextAccount(),
1150
+ purchaser: getNextAccount(),
1151
+ mint: getNextAccount(),
1152
+ vault: getNextAccount(),
1153
+ userTokens: getNextAccount(),
1154
+ tokenProgram: getNextAccount()
1155
+ },
1156
+ data: getExpireDrawInstructionDataDecoder().decode(instruction.data)
1157
+ };
1158
+ }
1159
+ //#endregion
1160
+ //#region src/generated/instructions/fundPrizes.ts
1161
+ /**
1162
+ * This code was AUTOGENERATED using the Codama library.
1163
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1164
+ * to add features, then rerun Codama to update it.
1165
+ *
1166
+ * @see https://github.com/codama-idl/codama
1167
+ */
1168
+ const FUND_PRIZES_DISCRIMINATOR = new Uint8Array([
1169
+ 163,
1170
+ 225,
1171
+ 193,
1172
+ 125,
1173
+ 144,
1174
+ 171,
1175
+ 29,
1176
+ 241
1177
+ ]);
1178
+ function getFundPrizesDiscriminatorBytes() {
1179
+ return fixEncoderSize(getBytesEncoder(), 8).encode(FUND_PRIZES_DISCRIMINATOR);
1180
+ }
1181
+ function getFundPrizesInstructionDataEncoder() {
1182
+ return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)], ["amount", getU64Encoder()]]), (value) => ({
1183
+ ...value,
1184
+ discriminator: FUND_PRIZES_DISCRIMINATOR
1185
+ }));
1186
+ }
1187
+ function getFundPrizesInstructionDataDecoder() {
1188
+ return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)], ["amount", getU64Decoder()]]);
1189
+ }
1190
+ function getFundPrizesInstructionDataCodec() {
1191
+ return combineCodec(getFundPrizesInstructionDataEncoder(), getFundPrizesInstructionDataDecoder());
1192
+ }
1193
+ async function getFundPrizesInstructionAsync(input, config) {
1194
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1195
+ const accounts = {
1196
+ funder: {
1197
+ value: input.funder ?? null,
1198
+ isWritable: false
1199
+ },
1200
+ pool: {
1201
+ value: input.pool ?? null,
1202
+ isWritable: false
1203
+ },
1204
+ mint: {
1205
+ value: input.mint ?? null,
1206
+ isWritable: false
1207
+ },
1208
+ source: {
1209
+ value: input.source ?? null,
1210
+ isWritable: true
1211
+ },
1212
+ vault: {
1213
+ value: input.vault ?? null,
1214
+ isWritable: true
1215
+ },
1216
+ tokenProgram: {
1217
+ value: input.tokenProgram ?? null,
1218
+ isWritable: false
1219
+ }
1220
+ };
1221
+ const args = { ...input };
1222
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
1223
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1224
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1225
+ return Object.freeze({
1226
+ accounts: [
1227
+ getAccountMeta("funder", accounts.funder),
1228
+ getAccountMeta("pool", accounts.pool),
1229
+ getAccountMeta("mint", accounts.mint),
1230
+ getAccountMeta("source", accounts.source),
1231
+ getAccountMeta("vault", accounts.vault),
1232
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1233
+ ],
1234
+ data: getFundPrizesInstructionDataEncoder().encode(args),
1235
+ programAddress
1236
+ });
1237
+ }
1238
+ function getFundPrizesInstruction(input, config) {
1239
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1240
+ const accounts = {
1241
+ funder: {
1242
+ value: input.funder ?? null,
1243
+ isWritable: false
1244
+ },
1245
+ pool: {
1246
+ value: input.pool ?? null,
1247
+ isWritable: false
1248
+ },
1249
+ mint: {
1250
+ value: input.mint ?? null,
1251
+ isWritable: false
1252
+ },
1253
+ source: {
1254
+ value: input.source ?? null,
1255
+ isWritable: true
1256
+ },
1257
+ vault: {
1258
+ value: input.vault ?? null,
1259
+ isWritable: true
1260
+ },
1261
+ tokenProgram: {
1262
+ value: input.tokenProgram ?? null,
1263
+ isWritable: false
1264
+ }
1265
+ };
1266
+ const args = { ...input };
1267
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1268
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1269
+ return Object.freeze({
1270
+ accounts: [
1271
+ getAccountMeta("funder", accounts.funder),
1272
+ getAccountMeta("pool", accounts.pool),
1273
+ getAccountMeta("mint", accounts.mint),
1274
+ getAccountMeta("source", accounts.source),
1275
+ getAccountMeta("vault", accounts.vault),
1276
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1277
+ ],
1278
+ data: getFundPrizesInstructionDataEncoder().encode(args),
1279
+ programAddress
1280
+ });
1281
+ }
1282
+ function parseFundPrizesInstruction(instruction) {
1283
+ if (instruction.accounts.length < 6) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
1284
+ actualAccountMetas: instruction.accounts.length,
1285
+ expectedAccountMetas: 6
1286
+ });
1287
+ let accountIndex = 0;
1288
+ const getNextAccount = () => {
1289
+ const accountMeta = instruction.accounts[accountIndex];
1290
+ accountIndex += 1;
1291
+ return accountMeta;
1292
+ };
1293
+ return {
1294
+ programAddress: instruction.programAddress,
1295
+ accounts: {
1296
+ funder: getNextAccount(),
1297
+ pool: getNextAccount(),
1298
+ mint: getNextAccount(),
1299
+ source: getNextAccount(),
1300
+ vault: getNextAccount(),
1301
+ tokenProgram: getNextAccount()
1302
+ },
1303
+ data: getFundPrizesInstructionDataDecoder().decode(instruction.data)
1304
+ };
1305
+ }
1306
+ //#endregion
1307
+ //#region src/generated/instructions/initializePool.ts
1308
+ /**
1309
+ * This code was AUTOGENERATED using the Codama library.
1310
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1311
+ * to add features, then rerun Codama to update it.
1312
+ *
1313
+ * @see https://github.com/codama-idl/codama
1314
+ */
1315
+ const INITIALIZE_POOL_DISCRIMINATOR = new Uint8Array([
1316
+ 95,
1317
+ 180,
1318
+ 10,
1319
+ 172,
1320
+ 84,
1321
+ 174,
1322
+ 232,
1323
+ 40
1324
+ ]);
1325
+ function getInitializePoolDiscriminatorBytes() {
1326
+ return fixEncoderSize(getBytesEncoder(), 8).encode(INITIALIZE_POOL_DISCRIMINATOR);
1327
+ }
1328
+ function getInitializePoolInstructionDataEncoder() {
1329
+ return transformEncoder(getStructEncoder([
1330
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
1331
+ ["tiers", getArrayEncoder(getTierEncoder(), { size: 8 })],
1332
+ ["maxSeedQuoteIn", getU64Encoder()],
1333
+ ["maxSeedNativeDebit", getU64Encoder()],
1334
+ ["extraSeedTokens", getU64Encoder()]
1335
+ ]), (value) => ({
1336
+ ...value,
1337
+ discriminator: INITIALIZE_POOL_DISCRIMINATOR
1338
+ }));
1339
+ }
1340
+ function getInitializePoolInstructionDataDecoder() {
1341
+ return getStructDecoder([
1342
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
1343
+ ["tiers", getArrayDecoder(getTierDecoder(), { size: 8 })],
1344
+ ["maxSeedQuoteIn", getU64Decoder()],
1345
+ ["maxSeedNativeDebit", getU64Decoder()],
1346
+ ["extraSeedTokens", getU64Decoder()]
1347
+ ]);
1348
+ }
1349
+ function getInitializePoolInstructionDataCodec() {
1350
+ return combineCodec(getInitializePoolInstructionDataEncoder(), getInitializePoolInstructionDataDecoder());
1351
+ }
1352
+ async function getInitializePoolInstructionAsync(input, config) {
1353
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1354
+ const accounts = {
1355
+ creator: {
1356
+ value: input.creator ?? null,
1357
+ isWritable: true
1358
+ },
1359
+ pool: {
1360
+ value: input.pool ?? null,
1361
+ isWritable: true
1362
+ },
1363
+ mint: {
1364
+ value: input.mint ?? null,
1365
+ isWritable: false
1366
+ },
1367
+ quoteMint: {
1368
+ value: input.quoteMint ?? null,
1369
+ isWritable: false
1370
+ },
1371
+ creatorTokens: {
1372
+ value: input.creatorTokens ?? null,
1373
+ isWritable: true
1374
+ },
1375
+ vault: {
1376
+ value: input.vault ?? null,
1377
+ isWritable: true
1378
+ },
1379
+ venue: {
1380
+ value: input.venue ?? null,
1381
+ isWritable: false
1382
+ },
1383
+ instructions: {
1384
+ value: input.instructions ?? null,
1385
+ isWritable: false
1386
+ },
1387
+ tokenProgram: {
1388
+ value: input.tokenProgram ?? null,
1389
+ isWritable: false
1390
+ },
1391
+ associatedTokenProgram: {
1392
+ value: input.associatedTokenProgram ?? null,
1393
+ isWritable: false
1394
+ },
1395
+ systemProgram: {
1396
+ value: input.systemProgram ?? null,
1397
+ isWritable: false
1398
+ }
1399
+ };
1400
+ const args = { ...input };
1401
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
1402
+ if (!accounts.creatorTokens.value) accounts.creatorTokens.value = await getProgramDerivedAddress({
1403
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
1404
+ seeds: [
1405
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("creator", accounts.creator.value)),
1406
+ getBytesEncoder().encode(new Uint8Array([
1407
+ 6,
1408
+ 221,
1409
+ 246,
1410
+ 225,
1411
+ 215,
1412
+ 101,
1413
+ 161,
1414
+ 147,
1415
+ 217,
1416
+ 203,
1417
+ 225,
1418
+ 70,
1419
+ 206,
1420
+ 235,
1421
+ 121,
1422
+ 172,
1423
+ 28,
1424
+ 180,
1425
+ 133,
1426
+ 237,
1427
+ 95,
1428
+ 91,
1429
+ 55,
1430
+ 145,
1431
+ 58,
1432
+ 140,
1433
+ 245,
1434
+ 133,
1435
+ 126,
1436
+ 255,
1437
+ 0,
1438
+ 169
1439
+ ])),
1440
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
1441
+ ]
1442
+ });
1443
+ if (!accounts.vault.value) accounts.vault.value = await getProgramDerivedAddress({
1444
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
1445
+ seeds: [
1446
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)),
1447
+ getBytesEncoder().encode(new Uint8Array([
1448
+ 6,
1449
+ 221,
1450
+ 246,
1451
+ 225,
1452
+ 215,
1453
+ 101,
1454
+ 161,
1455
+ 147,
1456
+ 217,
1457
+ 203,
1458
+ 225,
1459
+ 70,
1460
+ 206,
1461
+ 235,
1462
+ 121,
1463
+ 172,
1464
+ 28,
1465
+ 180,
1466
+ 133,
1467
+ 237,
1468
+ 95,
1469
+ 91,
1470
+ 55,
1471
+ 145,
1472
+ 58,
1473
+ 140,
1474
+ 245,
1475
+ 133,
1476
+ 126,
1477
+ 255,
1478
+ 0,
1479
+ 169
1480
+ ])),
1481
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
1482
+ ]
1483
+ });
1484
+ if (!accounts.venue.value) accounts.venue.value = "DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6";
1485
+ if (!accounts.instructions.value) accounts.instructions.value = "Sysvar1nstructions1111111111111111111111111";
1486
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1487
+ if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1488
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
1489
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1490
+ return Object.freeze({
1491
+ accounts: [
1492
+ getAccountMeta("creator", accounts.creator),
1493
+ getAccountMeta("pool", accounts.pool),
1494
+ getAccountMeta("mint", accounts.mint),
1495
+ getAccountMeta("quoteMint", accounts.quoteMint),
1496
+ getAccountMeta("creatorTokens", accounts.creatorTokens),
1497
+ getAccountMeta("vault", accounts.vault),
1498
+ getAccountMeta("venue", accounts.venue),
1499
+ getAccountMeta("instructions", accounts.instructions),
1500
+ getAccountMeta("tokenProgram", accounts.tokenProgram),
1501
+ getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
1502
+ getAccountMeta("systemProgram", accounts.systemProgram)
1503
+ ],
1504
+ data: getInitializePoolInstructionDataEncoder().encode(args),
1505
+ programAddress
1506
+ });
1507
+ }
1508
+ function getInitializePoolInstruction(input, config) {
1509
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1510
+ const accounts = {
1511
+ creator: {
1512
+ value: input.creator ?? null,
1513
+ isWritable: true
1514
+ },
1515
+ pool: {
1516
+ value: input.pool ?? null,
1517
+ isWritable: true
1518
+ },
1519
+ mint: {
1520
+ value: input.mint ?? null,
1521
+ isWritable: false
1522
+ },
1523
+ quoteMint: {
1524
+ value: input.quoteMint ?? null,
1525
+ isWritable: false
1526
+ },
1527
+ creatorTokens: {
1528
+ value: input.creatorTokens ?? null,
1529
+ isWritable: true
1530
+ },
1531
+ vault: {
1532
+ value: input.vault ?? null,
1533
+ isWritable: true
1534
+ },
1535
+ venue: {
1536
+ value: input.venue ?? null,
1537
+ isWritable: false
1538
+ },
1539
+ instructions: {
1540
+ value: input.instructions ?? null,
1541
+ isWritable: false
1542
+ },
1543
+ tokenProgram: {
1544
+ value: input.tokenProgram ?? null,
1545
+ isWritable: false
1546
+ },
1547
+ associatedTokenProgram: {
1548
+ value: input.associatedTokenProgram ?? null,
1549
+ isWritable: false
1550
+ },
1551
+ systemProgram: {
1552
+ value: input.systemProgram ?? null,
1553
+ isWritable: false
1554
+ }
1555
+ };
1556
+ const args = { ...input };
1557
+ if (!accounts.venue.value) accounts.venue.value = "DRay6fNdQ5J82H7xV6uq2aV3mNrUZ1J4PgSKsWgptcm6";
1558
+ if (!accounts.instructions.value) accounts.instructions.value = "Sysvar1nstructions1111111111111111111111111";
1559
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1560
+ if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
1561
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
1562
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1563
+ return Object.freeze({
1564
+ accounts: [
1565
+ getAccountMeta("creator", accounts.creator),
1566
+ getAccountMeta("pool", accounts.pool),
1567
+ getAccountMeta("mint", accounts.mint),
1568
+ getAccountMeta("quoteMint", accounts.quoteMint),
1569
+ getAccountMeta("creatorTokens", accounts.creatorTokens),
1570
+ getAccountMeta("vault", accounts.vault),
1571
+ getAccountMeta("venue", accounts.venue),
1572
+ getAccountMeta("instructions", accounts.instructions),
1573
+ getAccountMeta("tokenProgram", accounts.tokenProgram),
1574
+ getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
1575
+ getAccountMeta("systemProgram", accounts.systemProgram)
1576
+ ],
1577
+ data: getInitializePoolInstructionDataEncoder().encode(args),
1578
+ programAddress
1579
+ });
1580
+ }
1581
+ function parseInitializePoolInstruction(instruction) {
1582
+ if (instruction.accounts.length < 11) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
1583
+ actualAccountMetas: instruction.accounts.length,
1584
+ expectedAccountMetas: 11
1585
+ });
1586
+ let accountIndex = 0;
1587
+ const getNextAccount = () => {
1588
+ const accountMeta = instruction.accounts[accountIndex];
1589
+ accountIndex += 1;
1590
+ return accountMeta;
1591
+ };
1592
+ return {
1593
+ programAddress: instruction.programAddress,
1594
+ accounts: {
1595
+ creator: getNextAccount(),
1596
+ pool: getNextAccount(),
1597
+ mint: getNextAccount(),
1598
+ quoteMint: getNextAccount(),
1599
+ creatorTokens: getNextAccount(),
1600
+ vault: getNextAccount(),
1601
+ venue: getNextAccount(),
1602
+ instructions: getNextAccount(),
1603
+ tokenProgram: getNextAccount(),
1604
+ associatedTokenProgram: getNextAccount(),
1605
+ systemProgram: getNextAccount()
1606
+ },
1607
+ data: getInitializePoolInstructionDataDecoder().decode(instruction.data)
1608
+ };
1609
+ }
1610
+ //#endregion
1611
+ //#region src/generated/instructions/retryDraw.ts
1612
+ /**
1613
+ * This code was AUTOGENERATED using the Codama library.
1614
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1615
+ * to add features, then rerun Codama to update it.
1616
+ *
1617
+ * @see https://github.com/codama-idl/codama
1618
+ */
1619
+ const RETRY_DRAW_DISCRIMINATOR = new Uint8Array([
1620
+ 112,
1621
+ 118,
1622
+ 137,
1623
+ 120,
1624
+ 211,
1625
+ 39,
1626
+ 196,
1627
+ 96
1628
+ ]);
1629
+ function getRetryDrawDiscriminatorBytes() {
1630
+ return fixEncoderSize(getBytesEncoder(), 8).encode(RETRY_DRAW_DISCRIMINATOR);
1631
+ }
1632
+ function getRetryDrawInstructionDataEncoder() {
1633
+ return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)], ["maxVrfDebit", getU64Encoder()]]), (value) => ({
1634
+ ...value,
1635
+ discriminator: RETRY_DRAW_DISCRIMINATOR
1636
+ }));
1637
+ }
1638
+ function getRetryDrawInstructionDataDecoder() {
1639
+ return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)], ["maxVrfDebit", getU64Decoder()]]);
1640
+ }
1641
+ function getRetryDrawInstructionDataCodec() {
1642
+ return combineCodec(getRetryDrawInstructionDataEncoder(), getRetryDrawInstructionDataDecoder());
1643
+ }
1644
+ async function getRetryDrawInstructionAsync(input, config) {
1645
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1646
+ const accounts = {
1647
+ payer: {
1648
+ value: input.payer ?? null,
1649
+ isWritable: true
1650
+ },
1651
+ pool: {
1652
+ value: input.pool ?? null,
1653
+ isWritable: false
1654
+ },
1655
+ draw: {
1656
+ value: input.draw ?? null,
1657
+ isWritable: true
1658
+ },
1659
+ identity: {
1660
+ value: input.identity ?? null,
1661
+ isWritable: false
1662
+ },
1663
+ queue: {
1664
+ value: input.queue ?? null,
1665
+ isWritable: true
1666
+ },
1667
+ program: {
1668
+ value: input.program ?? null,
1669
+ isWritable: false
1670
+ },
1671
+ slotHashes: {
1672
+ value: input.slotHashes ?? null,
1673
+ isWritable: false
1674
+ },
1675
+ systemProgram: {
1676
+ value: input.systemProgram ?? null,
1677
+ isWritable: false
1678
+ }
1679
+ };
1680
+ const args = { ...input };
1681
+ if (!accounts.identity.value) accounts.identity.value = await findIdentityPda({ programAddress });
1682
+ if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
1683
+ if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
1684
+ if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
1685
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
1686
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1687
+ return Object.freeze({
1688
+ accounts: [
1689
+ getAccountMeta("payer", accounts.payer),
1690
+ getAccountMeta("pool", accounts.pool),
1691
+ getAccountMeta("draw", accounts.draw),
1692
+ getAccountMeta("identity", accounts.identity),
1693
+ getAccountMeta("queue", accounts.queue),
1694
+ getAccountMeta("program", accounts.program),
1695
+ getAccountMeta("slotHashes", accounts.slotHashes),
1696
+ getAccountMeta("systemProgram", accounts.systemProgram)
1697
+ ],
1698
+ data: getRetryDrawInstructionDataEncoder().encode(args),
1699
+ programAddress
1700
+ });
1701
+ }
1702
+ function getRetryDrawInstruction(input, config) {
1703
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1704
+ const accounts = {
1705
+ payer: {
1706
+ value: input.payer ?? null,
1707
+ isWritable: true
1708
+ },
1709
+ pool: {
1710
+ value: input.pool ?? null,
1711
+ isWritable: false
1712
+ },
1713
+ draw: {
1714
+ value: input.draw ?? null,
1715
+ isWritable: true
1716
+ },
1717
+ identity: {
1718
+ value: input.identity ?? null,
1719
+ isWritable: false
1720
+ },
1721
+ queue: {
1722
+ value: input.queue ?? null,
1723
+ isWritable: true
1724
+ },
1725
+ program: {
1726
+ value: input.program ?? null,
1727
+ isWritable: false
1728
+ },
1729
+ slotHashes: {
1730
+ value: input.slotHashes ?? null,
1731
+ isWritable: false
1732
+ },
1733
+ systemProgram: {
1734
+ value: input.systemProgram ?? null,
1735
+ isWritable: false
1736
+ }
1737
+ };
1738
+ const args = { ...input };
1739
+ if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
1740
+ if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
1741
+ if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
1742
+ if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
1743
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1744
+ return Object.freeze({
1745
+ accounts: [
1746
+ getAccountMeta("payer", accounts.payer),
1747
+ getAccountMeta("pool", accounts.pool),
1748
+ getAccountMeta("draw", accounts.draw),
1749
+ getAccountMeta("identity", accounts.identity),
1750
+ getAccountMeta("queue", accounts.queue),
1751
+ getAccountMeta("program", accounts.program),
1752
+ getAccountMeta("slotHashes", accounts.slotHashes),
1753
+ getAccountMeta("systemProgram", accounts.systemProgram)
1754
+ ],
1755
+ data: getRetryDrawInstructionDataEncoder().encode(args),
1756
+ programAddress
1757
+ });
1758
+ }
1759
+ function parseRetryDrawInstruction(instruction) {
1760
+ if (instruction.accounts.length < 8) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
1761
+ actualAccountMetas: instruction.accounts.length,
1762
+ expectedAccountMetas: 8
1763
+ });
1764
+ let accountIndex = 0;
1765
+ const getNextAccount = () => {
1766
+ const accountMeta = instruction.accounts[accountIndex];
1767
+ accountIndex += 1;
1768
+ return accountMeta;
1769
+ };
1770
+ return {
1771
+ programAddress: instruction.programAddress,
1772
+ accounts: {
1773
+ payer: getNextAccount(),
1774
+ pool: getNextAccount(),
1775
+ draw: getNextAccount(),
1776
+ identity: getNextAccount(),
1777
+ queue: getNextAccount(),
1778
+ program: getNextAccount(),
1779
+ slotHashes: getNextAccount(),
1780
+ systemProgram: getNextAccount()
1781
+ },
1782
+ data: getRetryDrawInstructionDataDecoder().decode(instruction.data)
1783
+ };
1784
+ }
1785
+ //#endregion
1786
+ //#region src/generated/instructions/sellTokens.ts
1787
+ /**
1788
+ * This code was AUTOGENERATED using the Codama library.
1789
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1790
+ * to add features, then rerun Codama to update it.
1791
+ *
1792
+ * @see https://github.com/codama-idl/codama
1793
+ */
1794
+ const SELL_TOKENS_DISCRIMINATOR = new Uint8Array([
1795
+ 114,
1796
+ 242,
1797
+ 25,
1798
+ 12,
1799
+ 62,
1800
+ 126,
1801
+ 92,
1802
+ 2
1803
+ ]);
1804
+ function getSellTokensDiscriminatorBytes() {
1805
+ return fixEncoderSize(getBytesEncoder(), 8).encode(SELL_TOKENS_DISCRIMINATOR);
1806
+ }
1807
+ function getSellTokensInstructionDataEncoder() {
1808
+ return transformEncoder(getStructEncoder([
1809
+ ["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
1810
+ ["amount", getU64Encoder()],
1811
+ ["minQuoteOutput", getU64Encoder()],
1812
+ ["maxNativeDebit", getU64Encoder()]
1813
+ ]), (value) => ({
1814
+ ...value,
1815
+ discriminator: SELL_TOKENS_DISCRIMINATOR
1816
+ }));
1817
+ }
1818
+ function getSellTokensInstructionDataDecoder() {
1819
+ return getStructDecoder([
1820
+ ["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
1821
+ ["amount", getU64Decoder()],
1822
+ ["minQuoteOutput", getU64Decoder()],
1823
+ ["maxNativeDebit", getU64Decoder()]
1824
+ ]);
1825
+ }
1826
+ function getSellTokensInstructionDataCodec() {
1827
+ return combineCodec(getSellTokensInstructionDataEncoder(), getSellTokensInstructionDataDecoder());
1828
+ }
1829
+ async function getSellTokensInstructionAsync(input, config) {
1830
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1831
+ const accounts = {
1832
+ seller: {
1833
+ value: input.seller ?? null,
1834
+ isWritable: true
1835
+ },
1836
+ pool: {
1837
+ value: input.pool ?? null,
1838
+ isWritable: false
1839
+ },
1840
+ mint: {
1841
+ value: input.mint ?? null,
1842
+ isWritable: false
1843
+ },
1844
+ quoteMint: {
1845
+ value: input.quoteMint ?? null,
1846
+ isWritable: false
1847
+ },
1848
+ userTokens: {
1849
+ value: input.userTokens ?? null,
1850
+ isWritable: true
1851
+ },
1852
+ venue: {
1853
+ value: input.venue ?? null,
1854
+ isWritable: false
1855
+ },
1856
+ tokenProgram: {
1857
+ value: input.tokenProgram ?? null,
1858
+ isWritable: false
1859
+ }
1860
+ };
1861
+ const args = { ...input };
1862
+ if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
1863
+ if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
1864
+ programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
1865
+ seeds: [
1866
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("seller", accounts.seller.value)),
1867
+ getBytesEncoder().encode(new Uint8Array([
1868
+ 6,
1869
+ 221,
1870
+ 246,
1871
+ 225,
1872
+ 215,
1873
+ 101,
1874
+ 161,
1875
+ 147,
1876
+ 217,
1877
+ 203,
1878
+ 225,
1879
+ 70,
1880
+ 206,
1881
+ 235,
1882
+ 121,
1883
+ 172,
1884
+ 28,
1885
+ 180,
1886
+ 133,
1887
+ 237,
1888
+ 95,
1889
+ 91,
1890
+ 55,
1891
+ 145,
1892
+ 58,
1893
+ 140,
1894
+ 245,
1895
+ 133,
1896
+ 126,
1897
+ 255,
1898
+ 0,
1899
+ 169
1900
+ ])),
1901
+ getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
1902
+ ]
1903
+ });
1904
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1905
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1906
+ return Object.freeze({
1907
+ accounts: [
1908
+ getAccountMeta("seller", accounts.seller),
1909
+ getAccountMeta("pool", accounts.pool),
1910
+ getAccountMeta("mint", accounts.mint),
1911
+ getAccountMeta("quoteMint", accounts.quoteMint),
1912
+ getAccountMeta("userTokens", accounts.userTokens),
1913
+ getAccountMeta("venue", accounts.venue),
1914
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1915
+ ],
1916
+ data: getSellTokensInstructionDataEncoder().encode(args),
1917
+ programAddress
1918
+ });
1919
+ }
1920
+ function getSellTokensInstruction(input, config) {
1921
+ const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
1922
+ const accounts = {
1923
+ seller: {
1924
+ value: input.seller ?? null,
1925
+ isWritable: true
1926
+ },
1927
+ pool: {
1928
+ value: input.pool ?? null,
1929
+ isWritable: false
1930
+ },
1931
+ mint: {
1932
+ value: input.mint ?? null,
1933
+ isWritable: false
1934
+ },
1935
+ quoteMint: {
1936
+ value: input.quoteMint ?? null,
1937
+ isWritable: false
1938
+ },
1939
+ userTokens: {
1940
+ value: input.userTokens ?? null,
1941
+ isWritable: true
1942
+ },
1943
+ venue: {
1944
+ value: input.venue ?? null,
1945
+ isWritable: false
1946
+ },
1947
+ tokenProgram: {
1948
+ value: input.tokenProgram ?? null,
1949
+ isWritable: false
1950
+ }
1951
+ };
1952
+ const args = { ...input };
1953
+ if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
1954
+ const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
1955
+ return Object.freeze({
1956
+ accounts: [
1957
+ getAccountMeta("seller", accounts.seller),
1958
+ getAccountMeta("pool", accounts.pool),
1959
+ getAccountMeta("mint", accounts.mint),
1960
+ getAccountMeta("quoteMint", accounts.quoteMint),
1961
+ getAccountMeta("userTokens", accounts.userTokens),
1962
+ getAccountMeta("venue", accounts.venue),
1963
+ getAccountMeta("tokenProgram", accounts.tokenProgram)
1964
+ ],
1965
+ data: getSellTokensInstructionDataEncoder().encode(args),
1966
+ programAddress
1967
+ });
1968
+ }
1969
+ function parseSellTokensInstruction(instruction) {
1970
+ if (instruction.accounts.length < 7) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
1971
+ actualAccountMetas: instruction.accounts.length,
1972
+ expectedAccountMetas: 7
1973
+ });
1974
+ let accountIndex = 0;
1975
+ const getNextAccount = () => {
1976
+ const accountMeta = instruction.accounts[accountIndex];
1977
+ accountIndex += 1;
1978
+ return accountMeta;
1979
+ };
1980
+ return {
1981
+ programAddress: instruction.programAddress,
1982
+ accounts: {
1983
+ seller: getNextAccount(),
1984
+ pool: getNextAccount(),
1985
+ mint: getNextAccount(),
1986
+ quoteMint: getNextAccount(),
1987
+ userTokens: getNextAccount(),
1988
+ venue: getNextAccount(),
1989
+ tokenProgram: getNextAccount()
1990
+ },
1991
+ data: getSellTokensInstructionDataDecoder().decode(instruction.data)
1992
+ };
1993
+ }
1994
+ //#endregion
1995
+ //#region src/generated/programs/gabox.ts
1996
+ /**
1997
+ * This code was AUTOGENERATED using the Codama library.
1998
+ * Please DO NOT EDIT THIS FILE, instead use visitors
1999
+ * to add features, then rerun Codama to update it.
2000
+ *
2001
+ * @see https://github.com/codama-idl/codama
2002
+ */
2003
+ const GABOX_PROGRAM_ADDRESS = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
2004
+ let GaboxAccount = /* @__PURE__ */ function(GaboxAccount) {
2005
+ GaboxAccount[GaboxAccount["Draw"] = 0] = "Draw";
2006
+ GaboxAccount[GaboxAccount["Pool"] = 1] = "Pool";
2007
+ GaboxAccount[GaboxAccount["WalletActivity"] = 2] = "WalletActivity";
2008
+ return GaboxAccount;
2009
+ }({});
2010
+ function identifyGaboxAccount(account) {
2011
+ const data = "data" in account ? account.data : account;
2012
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2013
+ 101,
2014
+ 31,
2015
+ 52,
2016
+ 179,
2017
+ 121,
2018
+ 78,
2019
+ 252,
2020
+ 89
2021
+ ])), 0)) return 0;
2022
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2023
+ 140,
2024
+ 230,
2025
+ 142,
2026
+ 167,
2027
+ 14,
2028
+ 202,
2029
+ 43,
2030
+ 254
2031
+ ])), 0)) return 1;
2032
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2033
+ 212,
2034
+ 80,
2035
+ 180,
2036
+ 131,
2037
+ 173,
2038
+ 1,
2039
+ 252,
2040
+ 141
2041
+ ])), 0)) return 2;
2042
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, {
2043
+ accountData: data,
2044
+ programName: "gabox"
2045
+ });
2046
+ }
2047
+ let GaboxEvent = /* @__PURE__ */ function(GaboxEvent) {
2048
+ GaboxEvent[GaboxEvent["DrawResolved"] = 0] = "DrawResolved";
2049
+ GaboxEvent[GaboxEvent["PackBought"] = 1] = "PackBought";
2050
+ GaboxEvent[GaboxEvent["PoolCreated"] = 2] = "PoolCreated";
2051
+ GaboxEvent[GaboxEvent["PrizesFunded"] = 3] = "PrizesFunded";
2052
+ GaboxEvent[GaboxEvent["RandomnessRetried"] = 4] = "RandomnessRetried";
2053
+ GaboxEvent[GaboxEvent["TokensSold"] = 5] = "TokensSold";
2054
+ return GaboxEvent;
2055
+ }({});
2056
+ function identifyGaboxEvent(event) {
2057
+ const data = "data" in event ? event.data : event;
2058
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2059
+ 127,
2060
+ 177,
2061
+ 62,
2062
+ 146,
2063
+ 164,
2064
+ 90,
2065
+ 185,
2066
+ 218
2067
+ ])), 0)) return 0;
2068
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2069
+ 220,
2070
+ 208,
2071
+ 74,
2072
+ 75,
2073
+ 42,
2074
+ 144,
2075
+ 231,
2076
+ 69
2077
+ ])), 0)) return 1;
2078
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2079
+ 202,
2080
+ 44,
2081
+ 41,
2082
+ 88,
2083
+ 104,
2084
+ 220,
2085
+ 157,
2086
+ 82
2087
+ ])), 0)) return 2;
2088
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2089
+ 188,
2090
+ 129,
2091
+ 185,
2092
+ 44,
2093
+ 234,
2094
+ 71,
2095
+ 53,
2096
+ 60
2097
+ ])), 0)) return 3;
2098
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2099
+ 243,
2100
+ 30,
2101
+ 148,
2102
+ 22,
2103
+ 14,
2104
+ 127,
2105
+ 52,
2106
+ 140
2107
+ ])), 0)) return 4;
2108
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2109
+ 217,
2110
+ 83,
2111
+ 68,
2112
+ 137,
2113
+ 134,
2114
+ 225,
2115
+ 94,
2116
+ 45
2117
+ ])), 0)) return 5;
2118
+ throw new Error("The provided event could not be identified as a gabox event.");
2119
+ }
2120
+ let GaboxInstruction = /* @__PURE__ */ function(GaboxInstruction) {
2121
+ GaboxInstruction[GaboxInstruction["BuyPack"] = 0] = "BuyPack";
2122
+ GaboxInstruction[GaboxInstruction["DeliverDraw"] = 1] = "DeliverDraw";
2123
+ GaboxInstruction[GaboxInstruction["ExpireDraw"] = 2] = "ExpireDraw";
2124
+ GaboxInstruction[GaboxInstruction["FundPrizes"] = 3] = "FundPrizes";
2125
+ GaboxInstruction[GaboxInstruction["InitializePool"] = 4] = "InitializePool";
2126
+ GaboxInstruction[GaboxInstruction["RetryDraw"] = 5] = "RetryDraw";
2127
+ GaboxInstruction[GaboxInstruction["SellTokens"] = 6] = "SellTokens";
2128
+ return GaboxInstruction;
2129
+ }({});
2130
+ function identifyGaboxInstruction(instruction) {
2131
+ const data = "data" in instruction ? instruction.data : instruction;
2132
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2133
+ 151,
2134
+ 46,
2135
+ 141,
2136
+ 93,
2137
+ 174,
2138
+ 5,
2139
+ 49,
2140
+ 173
2141
+ ])), 0)) return 0;
2142
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2143
+ 113,
2144
+ 181,
2145
+ 226,
2146
+ 173,
2147
+ 237,
2148
+ 138,
2149
+ 199,
2150
+ 51
2151
+ ])), 0)) return 1;
2152
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2153
+ 100,
2154
+ 119,
2155
+ 235,
2156
+ 75,
2157
+ 8,
2158
+ 25,
2159
+ 252,
2160
+ 255
2161
+ ])), 0)) return 2;
2162
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2163
+ 163,
2164
+ 225,
2165
+ 193,
2166
+ 125,
2167
+ 144,
2168
+ 171,
2169
+ 29,
2170
+ 241
2171
+ ])), 0)) return 3;
2172
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2173
+ 95,
2174
+ 180,
2175
+ 10,
2176
+ 172,
2177
+ 84,
2178
+ 174,
2179
+ 232,
2180
+ 40
2181
+ ])), 0)) return 4;
2182
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2183
+ 112,
2184
+ 118,
2185
+ 137,
2186
+ 120,
2187
+ 211,
2188
+ 39,
2189
+ 196,
2190
+ 96
2191
+ ])), 0)) return 5;
2192
+ if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
2193
+ 114,
2194
+ 242,
2195
+ 25,
2196
+ 12,
2197
+ 62,
2198
+ 126,
2199
+ 92,
2200
+ 2
2201
+ ])), 0)) return 6;
2202
+ throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
2203
+ instructionData: data,
2204
+ programName: "gabox"
2205
+ });
2206
+ }
2207
+ function parseGaboxInstruction(instruction) {
2208
+ const instructionType = identifyGaboxInstruction(instruction);
2209
+ switch (instructionType) {
2210
+ case 0:
2211
+ assertIsInstructionWithAccounts(instruction);
2212
+ return {
2213
+ instructionType: 0,
2214
+ ...parseBuyPackInstruction(instruction)
2215
+ };
2216
+ case 1:
2217
+ assertIsInstructionWithAccounts(instruction);
2218
+ return {
2219
+ instructionType: 1,
2220
+ ...parseDeliverDrawInstruction(instruction)
2221
+ };
2222
+ case 2:
2223
+ assertIsInstructionWithAccounts(instruction);
2224
+ return {
2225
+ instructionType: 2,
2226
+ ...parseExpireDrawInstruction(instruction)
2227
+ };
2228
+ case 3:
2229
+ assertIsInstructionWithAccounts(instruction);
2230
+ return {
2231
+ instructionType: 3,
2232
+ ...parseFundPrizesInstruction(instruction)
2233
+ };
2234
+ case 4:
2235
+ assertIsInstructionWithAccounts(instruction);
2236
+ return {
2237
+ instructionType: 4,
2238
+ ...parseInitializePoolInstruction(instruction)
2239
+ };
2240
+ case 5:
2241
+ assertIsInstructionWithAccounts(instruction);
2242
+ return {
2243
+ instructionType: 5,
2244
+ ...parseRetryDrawInstruction(instruction)
2245
+ };
2246
+ case 6:
2247
+ assertIsInstructionWithAccounts(instruction);
2248
+ return {
2249
+ instructionType: 6,
2250
+ ...parseSellTokensInstruction(instruction)
2251
+ };
2252
+ default: throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
2253
+ instructionType,
2254
+ programName: "gabox"
2255
+ });
2256
+ }
2257
+ }
2258
+ function gaboxProgram() {
2259
+ return (client) => {
2260
+ return extendClient(client, { gabox: {
2261
+ accounts: {
2262
+ draw: addSelfFetchFunctions(client, getDrawCodec()),
2263
+ pool: addSelfFetchFunctions(client, getPoolCodec()),
2264
+ walletActivity: addSelfFetchFunctions(client, getWalletActivityCodec())
2265
+ },
2266
+ instructions: {
2267
+ buyPack: (input) => addSelfPlanAndSendFunctions(client, getBuyPackInstructionAsync(input)),
2268
+ deliverDraw: (input) => addSelfPlanAndSendFunctions(client, getDeliverDrawInstructionAsync(input)),
2269
+ expireDraw: (input) => addSelfPlanAndSendFunctions(client, getExpireDrawInstructionAsync(input)),
2270
+ fundPrizes: (input) => addSelfPlanAndSendFunctions(client, getFundPrizesInstructionAsync(input)),
2271
+ initializePool: (input) => addSelfPlanAndSendFunctions(client, getInitializePoolInstructionAsync(input)),
2272
+ retryDraw: (input) => addSelfPlanAndSendFunctions(client, getRetryDrawInstructionAsync({
2273
+ ...input,
2274
+ payer: input.payer ?? client.payer
2275
+ })),
2276
+ sellTokens: (input) => addSelfPlanAndSendFunctions(client, getSellTokensInstructionAsync(input))
2277
+ },
2278
+ pdas: {
2279
+ pool: findPoolPda,
2280
+ activity: findActivityPda,
2281
+ identity: findIdentityPda,
2282
+ draw: findDrawPda
2283
+ },
2284
+ identifyAccount: identifyGaboxAccount,
2285
+ identifyInstruction: identifyGaboxInstruction,
2286
+ parseInstruction: parseGaboxInstruction
2287
+ } });
2288
+ };
2289
+ }
2290
+ //#endregion
4
2291
  //#region src/generated/events/drawResolved.ts
5
2292
  /**
6
2293
  * This code was AUTOGENERATED using the Codama library.
@@ -82,12 +2369,12 @@ function getPackBoughtEventEncoder() {
82
2369
  ["seq", getU64Encoder()],
83
2370
  ["purchaser", getAddressEncoder()],
84
2371
  ["venue", getAddressEncoder()],
2372
+ ["quoteMint", getAddressEncoder()],
85
2373
  ["tokensBought", getU64Encoder()],
86
- ["venueDebit", getU64Encoder()],
87
- ["feeLamports", getU64Encoder()],
88
- ["referralLamports", getU64Encoder()],
89
- ["protocolLamports", getU64Encoder()],
90
- ["vrfDebit", getU64Encoder()],
2374
+ ["quoteDebit", getU64Encoder()],
2375
+ ["nativeDebit", getU64Encoder()],
2376
+ ["vrfNativeDebit", getU64Encoder()],
2377
+ ["totalNativeDebit", getU64Encoder()],
91
2378
  ["prizes", getArrayEncoder(getPrizeEncoder(), { size: 8 })]
92
2379
  ]), [getConstantEncoder(PACK_BOUGHT_EVENT_DISCRIMINATOR)]);
93
2380
  }
@@ -98,12 +2385,12 @@ function getPackBoughtEventDecoder() {
98
2385
  ["seq", getU64Decoder()],
99
2386
  ["purchaser", getAddressDecoder()],
100
2387
  ["venue", getAddressDecoder()],
2388
+ ["quoteMint", getAddressDecoder()],
101
2389
  ["tokensBought", getU64Decoder()],
102
- ["venueDebit", getU64Decoder()],
103
- ["feeLamports", getU64Decoder()],
104
- ["referralLamports", getU64Decoder()],
105
- ["protocolLamports", getU64Decoder()],
106
- ["vrfDebit", getU64Decoder()],
2390
+ ["quoteDebit", getU64Decoder()],
2391
+ ["nativeDebit", getU64Decoder()],
2392
+ ["vrfNativeDebit", getU64Decoder()],
2393
+ ["totalNativeDebit", getU64Decoder()],
107
2394
  ["prizes", getArrayDecoder(getPrizeDecoder(), { size: 8 })]
108
2395
  ]), [getConstantDecoder(PACK_BOUGHT_EVENT_DISCRIMINATOR)]);
109
2396
  }
@@ -145,10 +2432,12 @@ function getPoolCreatedEventEncoder() {
145
2432
  ["mint", getAddressEncoder()],
146
2433
  ["creator", getAddressEncoder()],
147
2434
  ["packTokens", getU64Encoder()],
148
- ["feeBps", getU16Encoder()],
149
2435
  ["tiers", getArrayEncoder(getTierEncoder(), { size: 8 })],
150
2436
  ["seedTokens", getU64Encoder()],
151
- ["seedLamports", getU64Encoder()]
2437
+ ["extraSeedTokens", getU64Encoder()],
2438
+ ["quoteMint", getAddressEncoder()],
2439
+ ["seedQuoteAmount", getU64Encoder()],
2440
+ ["seedNativeDebit", getU64Encoder()]
152
2441
  ]), [getConstantEncoder(POOL_CREATED_EVENT_DISCRIMINATOR)]);
153
2442
  }
154
2443
  /** Gets the decoder for {@link PoolCreatedEvent} event data. */
@@ -158,10 +2447,12 @@ function getPoolCreatedEventDecoder() {
158
2447
  ["mint", getAddressDecoder()],
159
2448
  ["creator", getAddressDecoder()],
160
2449
  ["packTokens", getU64Decoder()],
161
- ["feeBps", getU16Decoder()],
162
2450
  ["tiers", getArrayDecoder(getTierDecoder(), { size: 8 })],
163
2451
  ["seedTokens", getU64Decoder()],
164
- ["seedLamports", getU64Decoder()]
2452
+ ["extraSeedTokens", getU64Decoder()],
2453
+ ["quoteMint", getAddressDecoder()],
2454
+ ["seedQuoteAmount", getU64Decoder()],
2455
+ ["seedNativeDebit", getU64Decoder()]
165
2456
  ]), [getConstantDecoder(POOL_CREATED_EVENT_DISCRIMINATOR)]);
166
2457
  }
167
2458
  /** Gets the codec for {@link PoolCreatedEvent} event data. */
@@ -174,57 +2465,6 @@ function parsePoolCreatedEvent(data) {
174
2465
  throw new Error("The provided data does not match the \"PoolCreatedEvent\" event discriminators.");
175
2466
  }
176
2467
  //#endregion
177
- //#region src/generated/events/prizeRedeemed.ts
178
- /**
179
- * This code was AUTOGENERATED using the Codama library.
180
- * Please DO NOT EDIT THIS FILE, instead use visitors
181
- * to add features, then rerun Codama to update it.
182
- *
183
- * @see https://github.com/codama-idl/codama
184
- */
185
- const PRIZE_REDEEMED_EVENT_DISCRIMINATOR = new Uint8Array([
186
- 243,
187
- 193,
188
- 245,
189
- 166,
190
- 160,
191
- 101,
192
- 182,
193
- 207
194
- ]);
195
- function getPrizeRedeemedEventDiscriminatorBytes() {
196
- return fixEncoderSize(getBytesEncoder(), 8).encode(PRIZE_REDEEMED_EVENT_DISCRIMINATOR);
197
- }
198
- /** Gets the encoder for {@link PrizeRedeemedEventArgs} event data. */
199
- function getPrizeRedeemedEventEncoder() {
200
- return getHiddenPrefixEncoder(getStructEncoder([
201
- ["pool", getAddressEncoder()],
202
- ["seq", getU64Encoder()],
203
- ["purchaser", getAddressEncoder()],
204
- ["amount", getU64Encoder()],
205
- ["sold", getBooleanEncoder()]
206
- ]), [getConstantEncoder(PRIZE_REDEEMED_EVENT_DISCRIMINATOR)]);
207
- }
208
- /** Gets the decoder for {@link PrizeRedeemedEvent} event data. */
209
- function getPrizeRedeemedEventDecoder() {
210
- return getHiddenPrefixDecoder(getStructDecoder([
211
- ["pool", getAddressDecoder()],
212
- ["seq", getU64Decoder()],
213
- ["purchaser", getAddressDecoder()],
214
- ["amount", getU64Decoder()],
215
- ["sold", getBooleanDecoder()]
216
- ]), [getConstantDecoder(PRIZE_REDEEMED_EVENT_DISCRIMINATOR)]);
217
- }
218
- /** Gets the codec for {@link PrizeRedeemedEvent} event data. */
219
- function getPrizeRedeemedEventCodec() {
220
- return combineCodec(getPrizeRedeemedEventEncoder(), getPrizeRedeemedEventDecoder());
221
- }
222
- /** Parses the provided bytes into {@link PrizeRedeemedEvent} event data. */
223
- function parsePrizeRedeemedEvent(data) {
224
- if (containsBytes(data, PRIZE_REDEEMED_EVENT_DISCRIMINATOR, 0)) return getPrizeRedeemedEventDecoder().decode(data);
225
- throw new Error("The provided data does not match the \"PrizeRedeemedEvent\" event discriminators.");
226
- }
227
- //#endregion
228
2468
  //#region src/generated/events/prizesFunded.ts
229
2469
  /**
230
2470
  * This code was AUTOGENERATED using the Codama library.
@@ -346,9 +2586,10 @@ function getTokensSoldEventEncoder() {
346
2586
  ["pool", getAddressEncoder()],
347
2587
  ["seller", getAddressEncoder()],
348
2588
  ["venue", getAddressEncoder()],
2589
+ ["quoteMint", getAddressEncoder()],
349
2590
  ["amount", getU64Encoder()],
350
- ["proceeds", getU64Encoder()],
351
- ["protocolFee", getU64Encoder()]
2591
+ ["quoteProceeds", getU64Encoder()],
2592
+ ["nativeDebit", getU64Encoder()]
352
2593
  ]), [getConstantEncoder(TOKENS_SOLD_EVENT_DISCRIMINATOR)]);
353
2594
  }
354
2595
  /** Gets the decoder for {@link TokensSoldEvent} event data. */
@@ -357,9 +2598,10 @@ function getTokensSoldEventDecoder() {
357
2598
  ["pool", getAddressDecoder()],
358
2599
  ["seller", getAddressDecoder()],
359
2600
  ["venue", getAddressDecoder()],
2601
+ ["quoteMint", getAddressDecoder()],
360
2602
  ["amount", getU64Decoder()],
361
- ["proceeds", getU64Decoder()],
362
- ["protocolFee", getU64Decoder()]
2603
+ ["quoteProceeds", getU64Decoder()],
2604
+ ["nativeDebit", getU64Decoder()]
363
2605
  ]), [getConstantDecoder(TOKENS_SOLD_EVENT_DISCRIMINATOR)]);
364
2606
  }
365
2607
  /** Gets the codec for {@link TokensSoldEvent} event data. */
@@ -372,7 +2614,7 @@ function parseTokensSoldEvent(data) {
372
2614
  throw new Error("The provided data does not match the \"TokensSoldEvent\" event discriminators.");
373
2615
  }
374
2616
  //#endregion
375
- //#region src/generated/errors/gaboxV2.ts
2617
+ //#region src/generated/errors/gabox.ts
376
2618
  /**
377
2619
  * This code was AUTOGENERATED using the Codama library.
378
2620
  * Please DO NOT EDIT THIS FILE, instead use visitors
@@ -381,274 +2623,136 @@ function parseTokensSoldEvent(data) {
381
2623
  * @see https://github.com/codama-idl/codama
382
2624
  */
383
2625
  /** Arithmetic: Arithmetic overflow or inconsistent accounting */
384
- const GABOX_V2_ERROR__ARITHMETIC = 6e3;
2626
+ const GABOX_ERROR__ARITHMETIC = 6e3;
385
2627
  /** InvalidDistribution: Invalid prize distribution */
386
- const GABOX_V2_ERROR__INVALID_DISTRIBUTION = 6001;
2628
+ const GABOX_ERROR__INVALID_DISTRIBUTION = 6001;
387
2629
  /** UnfundedExpectation: Expected token award exceeds tokens purchased */
388
- const GABOX_V2_ERROR__UNFUNDED_EXPECTATION = 6002;
389
- /** UnsupportedMint: Mint must have no mint/freeze authority and only supported extensions */
390
- const GABOX_V2_ERROR__UNSUPPORTED_MINT = 6003;
2630
+ const GABOX_ERROR__UNFUNDED_EXPECTATION = 6002;
2631
+ /** UnsupportedMint: Mint must have 6 decimals and no mint or freeze authority */
2632
+ const GABOX_ERROR__UNSUPPORTED_MINT = 6003;
391
2633
  /** InsolventInventory: Prize inventory does not cover reservations */
392
- const GABOX_V2_ERROR__INSOLVENT_INVENTORY = 6004;
2634
+ const GABOX_ERROR__INSOLVENT_INVENTORY = 6004;
393
2635
  /** PrizeCapChanged: Top prize is below the signed minimum; refresh the offer */
394
- const GABOX_V2_ERROR__PRIZE_CAP_CHANGED = 6005;
2636
+ const GABOX_ERROR__PRIZE_CAP_CHANGED = 6005;
395
2637
  /** PackTooSmall: A pack pays zero tokens on some tier */
396
- const GABOX_V2_ERROR__PACK_TOO_SMALL = 6006;
2638
+ const GABOX_ERROR__PACK_TOO_SMALL = 6006;
397
2639
  /** JackpotBelowOnePack: The largest tier must pay at least one pack */
398
- const GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK = 6007;
2640
+ const GABOX_ERROR__JACKPOT_BELOW_ONE_PACK = 6007;
399
2641
  /** InvalidVenue: Incorrect trade program, account order, or token binding */
400
- const GABOX_V2_ERROR__INVALID_VENUE = 6008;
2642
+ const GABOX_ERROR__INVALID_VENUE = 6008;
401
2643
  /** IncorrectTokenDelta: Trade did not move the exact token amount */
402
- const GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA = 6009;
2644
+ const GABOX_ERROR__INCORRECT_TOKEN_DELTA = 6009;
403
2645
  /** SlippageExceeded: Spend exceeds the signed limit */
404
- const GABOX_V2_ERROR__SLIPPAGE_EXCEEDED = 6010;
405
- /** NotPending: Draw is not awaiting randomness */
406
- const GABOX_V2_ERROR__NOT_PENDING = 6011;
407
- /** NotReady: Draw has not resolved */
408
- const GABOX_V2_ERROR__NOT_READY = 6012;
2646
+ const GABOX_ERROR__SLIPPAGE_EXCEEDED = 6010;
409
2647
  /** RetryTooSoon: Retry interval has not elapsed */
410
- const GABOX_V2_ERROR__RETRY_TOO_SOON = 6013;
2648
+ const GABOX_ERROR__RETRY_TOO_SOON = 6011;
411
2649
  /** RetryUnavailable: Retry limit reached or draw expired */
412
- const GABOX_V2_ERROR__RETRY_UNAVAILABLE = 6014;
2650
+ const GABOX_ERROR__RETRY_UNAVAILABLE = 6012;
413
2651
  /** NotExpired: Oracle timeout has not elapsed */
414
- const GABOX_V2_ERROR__NOT_EXPIRED = 6015;
2652
+ const GABOX_ERROR__NOT_EXPIRED = 6013;
415
2653
  /** ZeroAmount: Amount must be positive */
416
- const GABOX_V2_ERROR__ZERO_AMOUNT = 6016;
417
- /** InvalidFee: Creator fee exceeds the limit */
418
- const GABOX_V2_ERROR__INVALID_FEE = 6017;
419
- /** CoinNotCreatedHere: A pool must be created in the same transaction that creates the coin */
420
- const GABOX_V2_ERROR__COIN_NOT_CREATED_HERE = 6018;
421
- /** InvalidReferral: Referral account is missing or inconsistent */
422
- const GABOX_V2_ERROR__INVALID_REFERRAL = 6019;
423
- /** NothingOwedToReferrer: No referral revenue is owed */
424
- const GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER = 6020;
425
- /** InvalidFeeCollector: Fee account is not the protocol fee collector's */
426
- const GABOX_V2_ERROR__INVALID_FEE_COLLECTOR = 6021;
427
- let gaboxV2ErrorMessages;
428
- if (process.env["NODE_ENV"] !== "production") gaboxV2ErrorMessages = {
429
- [GABOX_V2_ERROR__ARITHMETIC]: `Arithmetic overflow or inconsistent accounting`,
430
- [GABOX_V2_ERROR__COIN_NOT_CREATED_HERE]: `A pool must be created in the same transaction that creates the coin`,
431
- [GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA]: `Trade did not move the exact token amount`,
432
- [GABOX_V2_ERROR__INSOLVENT_INVENTORY]: `Prize inventory does not cover reservations`,
433
- [GABOX_V2_ERROR__INVALID_DISTRIBUTION]: `Invalid prize distribution`,
434
- [GABOX_V2_ERROR__INVALID_FEE]: `Creator fee exceeds the limit`,
435
- [GABOX_V2_ERROR__INVALID_FEE_COLLECTOR]: `Fee account is not the protocol fee collector's`,
436
- [GABOX_V2_ERROR__INVALID_REFERRAL]: `Referral account is missing or inconsistent`,
437
- [GABOX_V2_ERROR__INVALID_VENUE]: `Incorrect trade program, account order, or token binding`,
438
- [GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK]: `The largest tier must pay at least one pack`,
439
- [GABOX_V2_ERROR__NOT_EXPIRED]: `Oracle timeout has not elapsed`,
440
- [GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER]: `No referral revenue is owed`,
441
- [GABOX_V2_ERROR__NOT_PENDING]: `Draw is not awaiting randomness`,
442
- [GABOX_V2_ERROR__NOT_READY]: `Draw has not resolved`,
443
- [GABOX_V2_ERROR__PACK_TOO_SMALL]: `A pack pays zero tokens on some tier`,
444
- [GABOX_V2_ERROR__PRIZE_CAP_CHANGED]: `Top prize is below the signed minimum; refresh the offer`,
445
- [GABOX_V2_ERROR__RETRY_TOO_SOON]: `Retry interval has not elapsed`,
446
- [GABOX_V2_ERROR__RETRY_UNAVAILABLE]: `Retry limit reached or draw expired`,
447
- [GABOX_V2_ERROR__SLIPPAGE_EXCEEDED]: `Spend exceeds the signed limit`,
448
- [GABOX_V2_ERROR__UNFUNDED_EXPECTATION]: `Expected token award exceeds tokens purchased`,
449
- [GABOX_V2_ERROR__UNSUPPORTED_MINT]: `Mint must have no mint/freeze authority and only supported extensions`,
450
- [GABOX_V2_ERROR__ZERO_AMOUNT]: `Amount must be positive`
2654
+ const GABOX_ERROR__ZERO_AMOUNT = 6014;
2655
+ /** InvalidLaunch: LaunchLab create instruction is malformed or missing before this instruction */
2656
+ const GABOX_ERROR__INVALID_LAUNCH = 6015;
2657
+ /** InvalidQuote: Quote mint or quote token program is unsupported */
2658
+ const GABOX_ERROR__INVALID_QUOTE = 6016;
2659
+ /** WalletActivityMismatch: Wallet activity account belongs to a different wallet */
2660
+ const GABOX_ERROR__WALLET_ACTIVITY_MISMATCH = 6017;
2661
+ let gaboxErrorMessages;
2662
+ if (process.env["NODE_ENV"] !== "production") gaboxErrorMessages = {
2663
+ [GABOX_ERROR__ARITHMETIC]: `Arithmetic overflow or inconsistent accounting`,
2664
+ [GABOX_ERROR__INCORRECT_TOKEN_DELTA]: `Trade did not move the exact token amount`,
2665
+ [GABOX_ERROR__INSOLVENT_INVENTORY]: `Prize inventory does not cover reservations`,
2666
+ [GABOX_ERROR__INVALID_DISTRIBUTION]: `Invalid prize distribution`,
2667
+ [GABOX_ERROR__INVALID_LAUNCH]: `LaunchLab create instruction is malformed or missing before this instruction`,
2668
+ [GABOX_ERROR__INVALID_QUOTE]: `Quote mint or quote token program is unsupported`,
2669
+ [GABOX_ERROR__INVALID_VENUE]: `Incorrect trade program, account order, or token binding`,
2670
+ [GABOX_ERROR__JACKPOT_BELOW_ONE_PACK]: `The largest tier must pay at least one pack`,
2671
+ [GABOX_ERROR__NOT_EXPIRED]: `Oracle timeout has not elapsed`,
2672
+ [GABOX_ERROR__PACK_TOO_SMALL]: `A pack pays zero tokens on some tier`,
2673
+ [GABOX_ERROR__PRIZE_CAP_CHANGED]: `Top prize is below the signed minimum; refresh the offer`,
2674
+ [GABOX_ERROR__RETRY_TOO_SOON]: `Retry interval has not elapsed`,
2675
+ [GABOX_ERROR__RETRY_UNAVAILABLE]: `Retry limit reached or draw expired`,
2676
+ [GABOX_ERROR__SLIPPAGE_EXCEEDED]: `Spend exceeds the signed limit`,
2677
+ [GABOX_ERROR__UNFUNDED_EXPECTATION]: `Expected token award exceeds tokens purchased`,
2678
+ [GABOX_ERROR__UNSUPPORTED_MINT]: `Mint must have 6 decimals and no mint or freeze authority`,
2679
+ [GABOX_ERROR__WALLET_ACTIVITY_MISMATCH]: `Wallet activity account belongs to a different wallet`,
2680
+ [GABOX_ERROR__ZERO_AMOUNT]: `Amount must be positive`
451
2681
  };
452
- function getGaboxV2ErrorMessage(code) {
453
- if (process.env["NODE_ENV"] !== "production") return gaboxV2ErrorMessages[code];
2682
+ function getGaboxErrorMessage(code) {
2683
+ if (process.env["NODE_ENV"] !== "production") return gaboxErrorMessages[code];
454
2684
  return "Error message not available in production bundles.";
455
2685
  }
456
- function isGaboxV2Error(error, transactionMessage, code) {
457
- return isProgramError(error, transactionMessage, GABOX_V2_PROGRAM_ADDRESS, code);
458
- }
459
- //#endregion
460
- //#region src/generated/events/referralBound.ts
461
- /**
462
- * This code was AUTOGENERATED using the Codama library.
463
- * Please DO NOT EDIT THIS FILE, instead use visitors
464
- * to add features, then rerun Codama to update it.
465
- *
466
- * @see https://github.com/codama-idl/codama
467
- */
468
- const REFERRAL_BOUND_EVENT_DISCRIMINATOR = new Uint8Array([
469
- 12,
470
- 28,
471
- 152,
472
- 148,
473
- 55,
474
- 210,
475
- 102,
476
- 190
477
- ]);
478
- function getReferralBoundEventDiscriminatorBytes() {
479
- return fixEncoderSize(getBytesEncoder(), 8).encode(REFERRAL_BOUND_EVENT_DISCRIMINATOR);
480
- }
481
- /** Gets the encoder for {@link ReferralBoundEventArgs} event data. */
482
- function getReferralBoundEventEncoder() {
483
- return getHiddenPrefixEncoder(getStructEncoder([["referee", getAddressEncoder()], ["referrer", getAddressEncoder()]]), [getConstantEncoder(REFERRAL_BOUND_EVENT_DISCRIMINATOR)]);
484
- }
485
- /** Gets the decoder for {@link ReferralBoundEvent} event data. */
486
- function getReferralBoundEventDecoder() {
487
- return getHiddenPrefixDecoder(getStructDecoder([["referee", getAddressDecoder()], ["referrer", getAddressDecoder()]]), [getConstantDecoder(REFERRAL_BOUND_EVENT_DISCRIMINATOR)]);
488
- }
489
- /** Gets the codec for {@link ReferralBoundEvent} event data. */
490
- function getReferralBoundEventCodec() {
491
- return combineCodec(getReferralBoundEventEncoder(), getReferralBoundEventDecoder());
492
- }
493
- /** Parses the provided bytes into {@link ReferralBoundEvent} event data. */
494
- function parseReferralBoundEvent(data) {
495
- if (containsBytes(data, REFERRAL_BOUND_EVENT_DISCRIMINATOR, 0)) return getReferralBoundEventDecoder().decode(data);
496
- throw new Error("The provided data does not match the \"ReferralBoundEvent\" event discriminators.");
497
- }
498
- //#endregion
499
- //#region src/generated/events/referralClaimed.ts
500
- /**
501
- * This code was AUTOGENERATED using the Codama library.
502
- * Please DO NOT EDIT THIS FILE, instead use visitors
503
- * to add features, then rerun Codama to update it.
504
- *
505
- * @see https://github.com/codama-idl/codama
506
- */
507
- const REFERRAL_CLAIMED_EVENT_DISCRIMINATOR = new Uint8Array([
508
- 195,
509
- 109,
510
- 77,
511
- 196,
512
- 134,
513
- 226,
514
- 78,
515
- 108
516
- ]);
517
- function getReferralClaimedEventDiscriminatorBytes() {
518
- return fixEncoderSize(getBytesEncoder(), 8).encode(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR);
519
- }
520
- /** Gets the encoder for {@link ReferralClaimedEventArgs} event data. */
521
- function getReferralClaimedEventEncoder() {
522
- return getHiddenPrefixEncoder(getStructEncoder([
523
- ["pool", getAddressEncoder()],
524
- ["referrer", getAddressEncoder()],
525
- ["amount", getU64Encoder()]
526
- ]), [getConstantEncoder(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR)]);
527
- }
528
- /** Gets the decoder for {@link ReferralClaimedEvent} event data. */
529
- function getReferralClaimedEventDecoder() {
530
- return getHiddenPrefixDecoder(getStructDecoder([
531
- ["pool", getAddressDecoder()],
532
- ["referrer", getAddressDecoder()],
533
- ["amount", getU64Decoder()]
534
- ]), [getConstantDecoder(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR)]);
535
- }
536
- /** Gets the codec for {@link ReferralClaimedEvent} event data. */
537
- function getReferralClaimedEventCodec() {
538
- return combineCodec(getReferralClaimedEventEncoder(), getReferralClaimedEventDecoder());
539
- }
540
- /** Parses the provided bytes into {@link ReferralClaimedEvent} event data. */
541
- function parseReferralClaimedEvent(data) {
542
- if (containsBytes(data, REFERRAL_CLAIMED_EVENT_DISCRIMINATOR, 0)) return getReferralClaimedEventDecoder().decode(data);
543
- throw new Error("The provided data does not match the \"ReferralClaimedEvent\" event discriminators.");
2686
+ function isGaboxError(error, transactionMessage, code) {
2687
+ return isProgramError(error, transactionMessage, GABOX_PROGRAM_ADDRESS, code);
544
2688
  }
545
2689
  //#endregion
546
2690
  //#region src/generated/index.ts
547
2691
  var generated_exports = /* @__PURE__ */ __exportAll({
548
- BIND_REFERRER_DISCRIMINATOR: () => BIND_REFERRER_DISCRIMINATOR,
549
2692
  BUY_PACK_DISCRIMINATOR: () => BUY_PACK_DISCRIMINATOR,
550
- CLAIM_PRIZE_DISCRIMINATOR: () => CLAIM_PRIZE_DISCRIMINATOR,
551
- CLAIM_REFERRAL_DISCRIMINATOR: () => CLAIM_REFERRAL_DISCRIMINATOR,
552
2693
  DELIVER_DRAW_DISCRIMINATOR: () => DELIVER_DRAW_DISCRIMINATOR,
553
2694
  DRAW_DISCRIMINATOR: () => DRAW_DISCRIMINATOR,
554
2695
  DRAW_RESOLVED_EVENT_DISCRIMINATOR: () => DRAW_RESOLVED_EVENT_DISCRIMINATOR,
555
- DrawStatus: () => DrawStatus,
556
2696
  EXPIRE_DRAW_DISCRIMINATOR: () => EXPIRE_DRAW_DISCRIMINATOR,
557
- FULFILL_DRAW_DISCRIMINATOR: () => FULFILL_DRAW_DISCRIMINATOR,
558
2697
  FUND_PRIZES_DISCRIMINATOR: () => FUND_PRIZES_DISCRIMINATOR,
559
- GABOX_V2_ERROR__ARITHMETIC: () => GABOX_V2_ERROR__ARITHMETIC,
560
- GABOX_V2_ERROR__COIN_NOT_CREATED_HERE: () => GABOX_V2_ERROR__COIN_NOT_CREATED_HERE,
561
- GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA: () => GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA,
562
- GABOX_V2_ERROR__INSOLVENT_INVENTORY: () => GABOX_V2_ERROR__INSOLVENT_INVENTORY,
563
- GABOX_V2_ERROR__INVALID_DISTRIBUTION: () => GABOX_V2_ERROR__INVALID_DISTRIBUTION,
564
- GABOX_V2_ERROR__INVALID_FEE: () => GABOX_V2_ERROR__INVALID_FEE,
565
- GABOX_V2_ERROR__INVALID_FEE_COLLECTOR: () => GABOX_V2_ERROR__INVALID_FEE_COLLECTOR,
566
- GABOX_V2_ERROR__INVALID_REFERRAL: () => GABOX_V2_ERROR__INVALID_REFERRAL,
567
- GABOX_V2_ERROR__INVALID_VENUE: () => GABOX_V2_ERROR__INVALID_VENUE,
568
- GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK: () => GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK,
569
- GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER: () => GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER,
570
- GABOX_V2_ERROR__NOT_EXPIRED: () => GABOX_V2_ERROR__NOT_EXPIRED,
571
- GABOX_V2_ERROR__NOT_PENDING: () => GABOX_V2_ERROR__NOT_PENDING,
572
- GABOX_V2_ERROR__NOT_READY: () => GABOX_V2_ERROR__NOT_READY,
573
- GABOX_V2_ERROR__PACK_TOO_SMALL: () => GABOX_V2_ERROR__PACK_TOO_SMALL,
574
- GABOX_V2_ERROR__PRIZE_CAP_CHANGED: () => GABOX_V2_ERROR__PRIZE_CAP_CHANGED,
575
- GABOX_V2_ERROR__RETRY_TOO_SOON: () => GABOX_V2_ERROR__RETRY_TOO_SOON,
576
- GABOX_V2_ERROR__RETRY_UNAVAILABLE: () => GABOX_V2_ERROR__RETRY_UNAVAILABLE,
577
- GABOX_V2_ERROR__SLIPPAGE_EXCEEDED: () => GABOX_V2_ERROR__SLIPPAGE_EXCEEDED,
578
- GABOX_V2_ERROR__UNFUNDED_EXPECTATION: () => GABOX_V2_ERROR__UNFUNDED_EXPECTATION,
579
- GABOX_V2_ERROR__UNSUPPORTED_MINT: () => GABOX_V2_ERROR__UNSUPPORTED_MINT,
580
- GABOX_V2_ERROR__ZERO_AMOUNT: () => GABOX_V2_ERROR__ZERO_AMOUNT,
581
- GABOX_V2_PROGRAM_ADDRESS: () => GABOX_V2_PROGRAM_ADDRESS,
582
- GaboxV2Account: () => GaboxV2Account,
583
- GaboxV2Event: () => GaboxV2Event,
584
- GaboxV2Instruction: () => GaboxV2Instruction,
2698
+ GABOX_ERROR__ARITHMETIC: () => GABOX_ERROR__ARITHMETIC,
2699
+ GABOX_ERROR__INCORRECT_TOKEN_DELTA: () => GABOX_ERROR__INCORRECT_TOKEN_DELTA,
2700
+ GABOX_ERROR__INSOLVENT_INVENTORY: () => GABOX_ERROR__INSOLVENT_INVENTORY,
2701
+ GABOX_ERROR__INVALID_DISTRIBUTION: () => GABOX_ERROR__INVALID_DISTRIBUTION,
2702
+ GABOX_ERROR__INVALID_LAUNCH: () => GABOX_ERROR__INVALID_LAUNCH,
2703
+ GABOX_ERROR__INVALID_QUOTE: () => GABOX_ERROR__INVALID_QUOTE,
2704
+ GABOX_ERROR__INVALID_VENUE: () => GABOX_ERROR__INVALID_VENUE,
2705
+ GABOX_ERROR__JACKPOT_BELOW_ONE_PACK: () => GABOX_ERROR__JACKPOT_BELOW_ONE_PACK,
2706
+ GABOX_ERROR__NOT_EXPIRED: () => GABOX_ERROR__NOT_EXPIRED,
2707
+ GABOX_ERROR__PACK_TOO_SMALL: () => GABOX_ERROR__PACK_TOO_SMALL,
2708
+ GABOX_ERROR__PRIZE_CAP_CHANGED: () => GABOX_ERROR__PRIZE_CAP_CHANGED,
2709
+ GABOX_ERROR__RETRY_TOO_SOON: () => GABOX_ERROR__RETRY_TOO_SOON,
2710
+ GABOX_ERROR__RETRY_UNAVAILABLE: () => GABOX_ERROR__RETRY_UNAVAILABLE,
2711
+ GABOX_ERROR__SLIPPAGE_EXCEEDED: () => GABOX_ERROR__SLIPPAGE_EXCEEDED,
2712
+ GABOX_ERROR__UNFUNDED_EXPECTATION: () => GABOX_ERROR__UNFUNDED_EXPECTATION,
2713
+ GABOX_ERROR__UNSUPPORTED_MINT: () => GABOX_ERROR__UNSUPPORTED_MINT,
2714
+ GABOX_ERROR__WALLET_ACTIVITY_MISMATCH: () => GABOX_ERROR__WALLET_ACTIVITY_MISMATCH,
2715
+ GABOX_ERROR__ZERO_AMOUNT: () => GABOX_ERROR__ZERO_AMOUNT,
2716
+ GABOX_PROGRAM_ADDRESS: () => GABOX_PROGRAM_ADDRESS,
2717
+ GaboxAccount: () => GaboxAccount,
2718
+ GaboxEvent: () => GaboxEvent,
2719
+ GaboxInstruction: () => GaboxInstruction,
585
2720
  INITIALIZE_POOL_DISCRIMINATOR: () => INITIALIZE_POOL_DISCRIMINATOR,
586
2721
  PACK_BOUGHT_EVENT_DISCRIMINATOR: () => PACK_BOUGHT_EVENT_DISCRIMINATOR,
587
2722
  POOL_CREATED_EVENT_DISCRIMINATOR: () => POOL_CREATED_EVENT_DISCRIMINATOR,
588
2723
  POOL_DISCRIMINATOR: () => POOL_DISCRIMINATOR,
589
2724
  PRIZES_FUNDED_EVENT_DISCRIMINATOR: () => PRIZES_FUNDED_EVENT_DISCRIMINATOR,
590
- PRIZE_REDEEMED_EVENT_DISCRIMINATOR: () => PRIZE_REDEEMED_EVENT_DISCRIMINATOR,
591
2725
  RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR: () => RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR,
592
- REFERRAL_BOUND_EVENT_DISCRIMINATOR: () => REFERRAL_BOUND_EVENT_DISCRIMINATOR,
593
- REFERRAL_CLAIMED_EVENT_DISCRIMINATOR: () => REFERRAL_CLAIMED_EVENT_DISCRIMINATOR,
594
- REFERRAL_DISCRIMINATOR: () => REFERRAL_DISCRIMINATOR,
595
- REFERRAL_LINK_DISCRIMINATOR: () => REFERRAL_LINK_DISCRIMINATOR,
596
2726
  RETRY_DRAW_DISCRIMINATOR: () => RETRY_DRAW_DISCRIMINATOR,
597
- SELL_PRIZE_DISCRIMINATOR: () => SELL_PRIZE_DISCRIMINATOR,
598
2727
  SELL_TOKENS_DISCRIMINATOR: () => SELL_TOKENS_DISCRIMINATOR,
599
2728
  TOKENS_SOLD_EVENT_DISCRIMINATOR: () => TOKENS_SOLD_EVENT_DISCRIMINATOR,
2729
+ WALLET_ACTIVITY_DISCRIMINATOR: () => WALLET_ACTIVITY_DISCRIMINATOR,
600
2730
  decodeDraw: () => decodeDraw,
601
2731
  decodePool: () => decodePool,
602
- decodeReferral: () => decodeReferral,
603
- decodeReferralLink: () => decodeReferralLink,
2732
+ decodeWalletActivity: () => decodeWalletActivity,
604
2733
  fetchAllDraw: () => fetchAllDraw,
605
2734
  fetchAllMaybeDraw: () => fetchAllMaybeDraw,
606
2735
  fetchAllMaybePool: () => fetchAllMaybePool,
607
- fetchAllMaybeReferral: () => fetchAllMaybeReferral,
608
- fetchAllMaybeReferralLink: () => fetchAllMaybeReferralLink,
2736
+ fetchAllMaybeWalletActivity: () => fetchAllMaybeWalletActivity,
609
2737
  fetchAllPool: () => fetchAllPool,
610
- fetchAllReferral: () => fetchAllReferral,
611
- fetchAllReferralLink: () => fetchAllReferralLink,
2738
+ fetchAllWalletActivity: () => fetchAllWalletActivity,
612
2739
  fetchDraw: () => fetchDraw,
613
2740
  fetchMaybeDraw: () => fetchMaybeDraw,
614
2741
  fetchMaybePool: () => fetchMaybePool,
615
- fetchMaybeReferral: () => fetchMaybeReferral,
616
- fetchMaybeReferralLink: () => fetchMaybeReferralLink,
2742
+ fetchMaybeWalletActivity: () => fetchMaybeWalletActivity,
617
2743
  fetchPool: () => fetchPool,
618
- fetchReferral: () => fetchReferral,
619
- fetchReferralLink: () => fetchReferralLink,
620
- findClaimReferralReferralPda: () => findClaimReferralReferralPda,
2744
+ fetchWalletActivity: () => fetchWalletActivity,
2745
+ findActivityPda: () => findActivityPda,
621
2746
  findDrawPda: () => findDrawPda,
622
2747
  findIdentityPda: () => findIdentityPda,
623
- findLinkPda: () => findLinkPda,
624
2748
  findPoolPda: () => findPoolPda,
625
- findReferralLinkPda: () => findReferralLinkPda,
626
- findReferralPda: () => findReferralPda,
627
- gaboxV2Program: () => gaboxV2Program,
628
- getBindReferrerDiscriminatorBytes: () => getBindReferrerDiscriminatorBytes,
629
- getBindReferrerInstruction: () => getBindReferrerInstruction,
630
- getBindReferrerInstructionAsync: () => getBindReferrerInstructionAsync,
631
- getBindReferrerInstructionDataCodec: () => getBindReferrerInstructionDataCodec,
632
- getBindReferrerInstructionDataDecoder: () => getBindReferrerInstructionDataDecoder,
633
- getBindReferrerInstructionDataEncoder: () => getBindReferrerInstructionDataEncoder,
2749
+ gaboxProgram: () => gaboxProgram,
634
2750
  getBuyPackDiscriminatorBytes: () => getBuyPackDiscriminatorBytes,
635
2751
  getBuyPackInstruction: () => getBuyPackInstruction,
636
2752
  getBuyPackInstructionAsync: () => getBuyPackInstructionAsync,
637
2753
  getBuyPackInstructionDataCodec: () => getBuyPackInstructionDataCodec,
638
2754
  getBuyPackInstructionDataDecoder: () => getBuyPackInstructionDataDecoder,
639
2755
  getBuyPackInstructionDataEncoder: () => getBuyPackInstructionDataEncoder,
640
- getClaimPrizeDiscriminatorBytes: () => getClaimPrizeDiscriminatorBytes,
641
- getClaimPrizeInstruction: () => getClaimPrizeInstruction,
642
- getClaimPrizeInstructionAsync: () => getClaimPrizeInstructionAsync,
643
- getClaimPrizeInstructionDataCodec: () => getClaimPrizeInstructionDataCodec,
644
- getClaimPrizeInstructionDataDecoder: () => getClaimPrizeInstructionDataDecoder,
645
- getClaimPrizeInstructionDataEncoder: () => getClaimPrizeInstructionDataEncoder,
646
- getClaimReferralDiscriminatorBytes: () => getClaimReferralDiscriminatorBytes,
647
- getClaimReferralInstruction: () => getClaimReferralInstruction,
648
- getClaimReferralInstructionAsync: () => getClaimReferralInstructionAsync,
649
- getClaimReferralInstructionDataCodec: () => getClaimReferralInstructionDataCodec,
650
- getClaimReferralInstructionDataDecoder: () => getClaimReferralInstructionDataDecoder,
651
- getClaimReferralInstructionDataEncoder: () => getClaimReferralInstructionDataEncoder,
652
2756
  getDeliverDrawDiscriminatorBytes: () => getDeliverDrawDiscriminatorBytes,
653
2757
  getDeliverDrawInstruction: () => getDeliverDrawInstruction,
654
2758
  getDeliverDrawInstructionAsync: () => getDeliverDrawInstructionAsync,
@@ -664,27 +2768,19 @@ var generated_exports = /* @__PURE__ */ __exportAll({
664
2768
  getDrawResolvedEventDiscriminatorBytes: () => getDrawResolvedEventDiscriminatorBytes,
665
2769
  getDrawResolvedEventEncoder: () => getDrawResolvedEventEncoder,
666
2770
  getDrawSize: () => getDrawSize,
667
- getDrawStatusCodec: () => getDrawStatusCodec,
668
- getDrawStatusDecoder: () => getDrawStatusDecoder,
669
- getDrawStatusEncoder: () => getDrawStatusEncoder,
670
2771
  getExpireDrawDiscriminatorBytes: () => getExpireDrawDiscriminatorBytes,
671
2772
  getExpireDrawInstruction: () => getExpireDrawInstruction,
672
2773
  getExpireDrawInstructionAsync: () => getExpireDrawInstructionAsync,
673
2774
  getExpireDrawInstructionDataCodec: () => getExpireDrawInstructionDataCodec,
674
2775
  getExpireDrawInstructionDataDecoder: () => getExpireDrawInstructionDataDecoder,
675
2776
  getExpireDrawInstructionDataEncoder: () => getExpireDrawInstructionDataEncoder,
676
- getFulfillDrawDiscriminatorBytes: () => getFulfillDrawDiscriminatorBytes,
677
- getFulfillDrawInstruction: () => getFulfillDrawInstruction,
678
- getFulfillDrawInstructionAsync: () => getFulfillDrawInstructionAsync,
679
- getFulfillDrawInstructionDataCodec: () => getFulfillDrawInstructionDataCodec,
680
- getFulfillDrawInstructionDataDecoder: () => getFulfillDrawInstructionDataDecoder,
681
- getFulfillDrawInstructionDataEncoder: () => getFulfillDrawInstructionDataEncoder,
682
2777
  getFundPrizesDiscriminatorBytes: () => getFundPrizesDiscriminatorBytes,
683
2778
  getFundPrizesInstruction: () => getFundPrizesInstruction,
2779
+ getFundPrizesInstructionAsync: () => getFundPrizesInstructionAsync,
684
2780
  getFundPrizesInstructionDataCodec: () => getFundPrizesInstructionDataCodec,
685
2781
  getFundPrizesInstructionDataDecoder: () => getFundPrizesInstructionDataDecoder,
686
2782
  getFundPrizesInstructionDataEncoder: () => getFundPrizesInstructionDataEncoder,
687
- getGaboxV2ErrorMessage: () => getGaboxV2ErrorMessage,
2783
+ getGaboxErrorMessage: () => getGaboxErrorMessage,
688
2784
  getInitializePoolDiscriminatorBytes: () => getInitializePoolDiscriminatorBytes,
689
2785
  getInitializePoolInstruction: () => getInitializePoolInstruction,
690
2786
  getInitializePoolInstructionAsync: () => getInitializePoolInstructionAsync,
@@ -707,10 +2803,6 @@ var generated_exports = /* @__PURE__ */ __exportAll({
707
2803
  getPrizeCodec: () => getPrizeCodec,
708
2804
  getPrizeDecoder: () => getPrizeDecoder,
709
2805
  getPrizeEncoder: () => getPrizeEncoder,
710
- getPrizeRedeemedEventCodec: () => getPrizeRedeemedEventCodec,
711
- getPrizeRedeemedEventDecoder: () => getPrizeRedeemedEventDecoder,
712
- getPrizeRedeemedEventDiscriminatorBytes: () => getPrizeRedeemedEventDiscriminatorBytes,
713
- getPrizeRedeemedEventEncoder: () => getPrizeRedeemedEventEncoder,
714
2806
  getPrizesFundedEventCodec: () => getPrizesFundedEventCodec,
715
2807
  getPrizesFundedEventDecoder: () => getPrizesFundedEventDecoder,
716
2808
  getPrizesFundedEventDiscriminatorBytes: () => getPrizesFundedEventDiscriminatorBytes,
@@ -719,36 +2811,12 @@ var generated_exports = /* @__PURE__ */ __exportAll({
719
2811
  getRandomnessRetriedEventDecoder: () => getRandomnessRetriedEventDecoder,
720
2812
  getRandomnessRetriedEventDiscriminatorBytes: () => getRandomnessRetriedEventDiscriminatorBytes,
721
2813
  getRandomnessRetriedEventEncoder: () => getRandomnessRetriedEventEncoder,
722
- getReferralBoundEventCodec: () => getReferralBoundEventCodec,
723
- getReferralBoundEventDecoder: () => getReferralBoundEventDecoder,
724
- getReferralBoundEventDiscriminatorBytes: () => getReferralBoundEventDiscriminatorBytes,
725
- getReferralBoundEventEncoder: () => getReferralBoundEventEncoder,
726
- getReferralClaimedEventCodec: () => getReferralClaimedEventCodec,
727
- getReferralClaimedEventDecoder: () => getReferralClaimedEventDecoder,
728
- getReferralClaimedEventDiscriminatorBytes: () => getReferralClaimedEventDiscriminatorBytes,
729
- getReferralClaimedEventEncoder: () => getReferralClaimedEventEncoder,
730
- getReferralCodec: () => getReferralCodec,
731
- getReferralDecoder: () => getReferralDecoder,
732
- getReferralDiscriminatorBytes: () => getReferralDiscriminatorBytes,
733
- getReferralEncoder: () => getReferralEncoder,
734
- getReferralLinkCodec: () => getReferralLinkCodec,
735
- getReferralLinkDecoder: () => getReferralLinkDecoder,
736
- getReferralLinkDiscriminatorBytes: () => getReferralLinkDiscriminatorBytes,
737
- getReferralLinkEncoder: () => getReferralLinkEncoder,
738
- getReferralLinkSize: () => getReferralLinkSize,
739
- getReferralSize: () => getReferralSize,
740
2814
  getRetryDrawDiscriminatorBytes: () => getRetryDrawDiscriminatorBytes,
741
2815
  getRetryDrawInstruction: () => getRetryDrawInstruction,
742
2816
  getRetryDrawInstructionAsync: () => getRetryDrawInstructionAsync,
743
2817
  getRetryDrawInstructionDataCodec: () => getRetryDrawInstructionDataCodec,
744
2818
  getRetryDrawInstructionDataDecoder: () => getRetryDrawInstructionDataDecoder,
745
2819
  getRetryDrawInstructionDataEncoder: () => getRetryDrawInstructionDataEncoder,
746
- getSellPrizeDiscriminatorBytes: () => getSellPrizeDiscriminatorBytes,
747
- getSellPrizeInstruction: () => getSellPrizeInstruction,
748
- getSellPrizeInstructionAsync: () => getSellPrizeInstructionAsync,
749
- getSellPrizeInstructionDataCodec: () => getSellPrizeInstructionDataCodec,
750
- getSellPrizeInstructionDataDecoder: () => getSellPrizeInstructionDataDecoder,
751
- getSellPrizeInstructionDataEncoder: () => getSellPrizeInstructionDataEncoder,
752
2820
  getSellTokensDiscriminatorBytes: () => getSellTokensDiscriminatorBytes,
753
2821
  getSellTokensInstruction: () => getSellTokensInstruction,
754
2822
  getSellTokensInstructionAsync: () => getSellTokensInstructionAsync,
@@ -762,34 +2830,31 @@ var generated_exports = /* @__PURE__ */ __exportAll({
762
2830
  getTokensSoldEventDecoder: () => getTokensSoldEventDecoder,
763
2831
  getTokensSoldEventDiscriminatorBytes: () => getTokensSoldEventDiscriminatorBytes,
764
2832
  getTokensSoldEventEncoder: () => getTokensSoldEventEncoder,
765
- identifyGaboxV2Account: () => identifyGaboxV2Account,
766
- identifyGaboxV2Event: () => identifyGaboxV2Event,
767
- identifyGaboxV2Instruction: () => identifyGaboxV2Instruction,
768
- isGaboxV2Error: () => isGaboxV2Error,
769
- parseBindReferrerInstruction: () => parseBindReferrerInstruction,
2833
+ getWalletActivityCodec: () => getWalletActivityCodec,
2834
+ getWalletActivityDecoder: () => getWalletActivityDecoder,
2835
+ getWalletActivityDiscriminatorBytes: () => getWalletActivityDiscriminatorBytes,
2836
+ getWalletActivityEncoder: () => getWalletActivityEncoder,
2837
+ getWalletActivitySize: () => getWalletActivitySize,
2838
+ identifyGaboxAccount: () => identifyGaboxAccount,
2839
+ identifyGaboxEvent: () => identifyGaboxEvent,
2840
+ identifyGaboxInstruction: () => identifyGaboxInstruction,
2841
+ isGaboxError: () => isGaboxError,
770
2842
  parseBuyPackInstruction: () => parseBuyPackInstruction,
771
- parseClaimPrizeInstruction: () => parseClaimPrizeInstruction,
772
- parseClaimReferralInstruction: () => parseClaimReferralInstruction,
773
2843
  parseDeliverDrawInstruction: () => parseDeliverDrawInstruction,
774
2844
  parseDrawResolvedEvent: () => parseDrawResolvedEvent,
775
2845
  parseExpireDrawInstruction: () => parseExpireDrawInstruction,
776
- parseFulfillDrawInstruction: () => parseFulfillDrawInstruction,
777
2846
  parseFundPrizesInstruction: () => parseFundPrizesInstruction,
778
- parseGaboxV2Instruction: () => parseGaboxV2Instruction,
2847
+ parseGaboxInstruction: () => parseGaboxInstruction,
779
2848
  parseInitializePoolInstruction: () => parseInitializePoolInstruction,
780
2849
  parsePackBoughtEvent: () => parsePackBoughtEvent,
781
2850
  parsePoolCreatedEvent: () => parsePoolCreatedEvent,
782
- parsePrizeRedeemedEvent: () => parsePrizeRedeemedEvent,
783
2851
  parsePrizesFundedEvent: () => parsePrizesFundedEvent,
784
2852
  parseRandomnessRetriedEvent: () => parseRandomnessRetriedEvent,
785
- parseReferralBoundEvent: () => parseReferralBoundEvent,
786
- parseReferralClaimedEvent: () => parseReferralClaimedEvent,
787
2853
  parseRetryDrawInstruction: () => parseRetryDrawInstruction,
788
- parseSellPrizeInstruction: () => parseSellPrizeInstruction,
789
2854
  parseSellTokensInstruction: () => parseSellTokensInstruction,
790
2855
  parseTokensSoldEvent: () => parseTokensSoldEvent
791
2856
  });
792
2857
  //#endregion
793
- export { BIND_REFERRER_DISCRIMINATOR, BUY_PACK_DISCRIMINATOR, CLAIM_PRIZE_DISCRIMINATOR, CLAIM_REFERRAL_DISCRIMINATOR, DELIVER_DRAW_DISCRIMINATOR, DRAW_DISCRIMINATOR, DRAW_RESOLVED_EVENT_DISCRIMINATOR, DrawStatus, EXPIRE_DRAW_DISCRIMINATOR, FULFILL_DRAW_DISCRIMINATOR, FUND_PRIZES_DISCRIMINATOR, GABOX_V2_ERROR__ARITHMETIC, GABOX_V2_ERROR__COIN_NOT_CREATED_HERE, GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA, GABOX_V2_ERROR__INSOLVENT_INVENTORY, GABOX_V2_ERROR__INVALID_DISTRIBUTION, GABOX_V2_ERROR__INVALID_FEE, GABOX_V2_ERROR__INVALID_FEE_COLLECTOR, GABOX_V2_ERROR__INVALID_REFERRAL, GABOX_V2_ERROR__INVALID_VENUE, GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK, GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER, GABOX_V2_ERROR__NOT_EXPIRED, GABOX_V2_ERROR__NOT_PENDING, GABOX_V2_ERROR__NOT_READY, GABOX_V2_ERROR__PACK_TOO_SMALL, GABOX_V2_ERROR__PRIZE_CAP_CHANGED, GABOX_V2_ERROR__RETRY_TOO_SOON, GABOX_V2_ERROR__RETRY_UNAVAILABLE, GABOX_V2_ERROR__SLIPPAGE_EXCEEDED, GABOX_V2_ERROR__UNFUNDED_EXPECTATION, GABOX_V2_ERROR__UNSUPPORTED_MINT, GABOX_V2_ERROR__ZERO_AMOUNT, GABOX_V2_PROGRAM_ADDRESS, GaboxV2Account, GaboxV2Event, GaboxV2Instruction, INITIALIZE_POOL_DISCRIMINATOR, PACK_BOUGHT_EVENT_DISCRIMINATOR, POOL_CREATED_EVENT_DISCRIMINATOR, POOL_DISCRIMINATOR, PRIZES_FUNDED_EVENT_DISCRIMINATOR, PRIZE_REDEEMED_EVENT_DISCRIMINATOR, RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR, REFERRAL_BOUND_EVENT_DISCRIMINATOR, REFERRAL_CLAIMED_EVENT_DISCRIMINATOR, REFERRAL_DISCRIMINATOR, REFERRAL_LINK_DISCRIMINATOR, RETRY_DRAW_DISCRIMINATOR, SELL_PRIZE_DISCRIMINATOR, SELL_TOKENS_DISCRIMINATOR, TOKENS_SOLD_EVENT_DISCRIMINATOR, decodeDraw, decodePool, decodeReferral, decodeReferralLink, fetchAllDraw, fetchAllMaybeDraw, fetchAllMaybePool, fetchAllMaybeReferral, fetchAllMaybeReferralLink, fetchAllPool, fetchAllReferral, fetchAllReferralLink, fetchDraw, fetchMaybeDraw, fetchMaybePool, fetchMaybeReferral, fetchMaybeReferralLink, fetchPool, fetchReferral, fetchReferralLink, findClaimReferralReferralPda, findDrawPda, findIdentityPda, findLinkPda, findPoolPda, findReferralLinkPda, findReferralPda, gaboxV2Program, getBindReferrerDiscriminatorBytes, getBindReferrerInstruction, getBindReferrerInstructionAsync, getBindReferrerInstructionDataCodec, getBindReferrerInstructionDataDecoder, getBindReferrerInstructionDataEncoder, getBuyPackDiscriminatorBytes, getBuyPackInstruction, getBuyPackInstructionAsync, getBuyPackInstructionDataCodec, getBuyPackInstructionDataDecoder, getBuyPackInstructionDataEncoder, getClaimPrizeDiscriminatorBytes, getClaimPrizeInstruction, getClaimPrizeInstructionAsync, getClaimPrizeInstructionDataCodec, getClaimPrizeInstructionDataDecoder, getClaimPrizeInstructionDataEncoder, getClaimReferralDiscriminatorBytes, getClaimReferralInstruction, getClaimReferralInstructionAsync, getClaimReferralInstructionDataCodec, getClaimReferralInstructionDataDecoder, getClaimReferralInstructionDataEncoder, getDeliverDrawDiscriminatorBytes, getDeliverDrawInstruction, getDeliverDrawInstructionAsync, getDeliverDrawInstructionDataCodec, getDeliverDrawInstructionDataDecoder, getDeliverDrawInstructionDataEncoder, getDrawCodec, getDrawDecoder, getDrawDiscriminatorBytes, getDrawEncoder, getDrawResolvedEventCodec, getDrawResolvedEventDecoder, getDrawResolvedEventDiscriminatorBytes, getDrawResolvedEventEncoder, getDrawSize, getDrawStatusCodec, getDrawStatusDecoder, getDrawStatusEncoder, getExpireDrawDiscriminatorBytes, getExpireDrawInstruction, getExpireDrawInstructionAsync, getExpireDrawInstructionDataCodec, getExpireDrawInstructionDataDecoder, getExpireDrawInstructionDataEncoder, getFulfillDrawDiscriminatorBytes, getFulfillDrawInstruction, getFulfillDrawInstructionAsync, getFulfillDrawInstructionDataCodec, getFulfillDrawInstructionDataDecoder, getFulfillDrawInstructionDataEncoder, getFundPrizesDiscriminatorBytes, getFundPrizesInstruction, getFundPrizesInstructionDataCodec, getFundPrizesInstructionDataDecoder, getFundPrizesInstructionDataEncoder, getGaboxV2ErrorMessage, getInitializePoolDiscriminatorBytes, getInitializePoolInstruction, getInitializePoolInstructionAsync, getInitializePoolInstructionDataCodec, getInitializePoolInstructionDataDecoder, getInitializePoolInstructionDataEncoder, getPackBoughtEventCodec, getPackBoughtEventDecoder, getPackBoughtEventDiscriminatorBytes, getPackBoughtEventEncoder, getPoolCodec, getPoolCreatedEventCodec, getPoolCreatedEventDecoder, getPoolCreatedEventDiscriminatorBytes, getPoolCreatedEventEncoder, getPoolDecoder, getPoolDiscriminatorBytes, getPoolEncoder, getPoolSize, getPrizeCodec, getPrizeDecoder, getPrizeEncoder, getPrizeRedeemedEventCodec, getPrizeRedeemedEventDecoder, getPrizeRedeemedEventDiscriminatorBytes, getPrizeRedeemedEventEncoder, getPrizesFundedEventCodec, getPrizesFundedEventDecoder, getPrizesFundedEventDiscriminatorBytes, getPrizesFundedEventEncoder, getRandomnessRetriedEventCodec, getRandomnessRetriedEventDecoder, getRandomnessRetriedEventDiscriminatorBytes, getRandomnessRetriedEventEncoder, getReferralBoundEventCodec, getReferralBoundEventDecoder, getReferralBoundEventDiscriminatorBytes, getReferralBoundEventEncoder, getReferralClaimedEventCodec, getReferralClaimedEventDecoder, getReferralClaimedEventDiscriminatorBytes, getReferralClaimedEventEncoder, getReferralCodec, getReferralDecoder, getReferralDiscriminatorBytes, getReferralEncoder, getReferralLinkCodec, getReferralLinkDecoder, getReferralLinkDiscriminatorBytes, getReferralLinkEncoder, getReferralLinkSize, getReferralSize, getRetryDrawDiscriminatorBytes, getRetryDrawInstruction, getRetryDrawInstructionAsync, getRetryDrawInstructionDataCodec, getRetryDrawInstructionDataDecoder, getRetryDrawInstructionDataEncoder, getSellPrizeDiscriminatorBytes, getSellPrizeInstruction, getSellPrizeInstructionAsync, getSellPrizeInstructionDataCodec, getSellPrizeInstructionDataDecoder, getSellPrizeInstructionDataEncoder, getSellTokensDiscriminatorBytes, getSellTokensInstruction, getSellTokensInstructionAsync, getSellTokensInstructionDataCodec, getSellTokensInstructionDataDecoder, getSellTokensInstructionDataEncoder, getTierCodec, getTierDecoder, getTierEncoder, getTokensSoldEventCodec, getTokensSoldEventDecoder, getTokensSoldEventDiscriminatorBytes, getTokensSoldEventEncoder, identifyGaboxV2Account, identifyGaboxV2Event, identifyGaboxV2Instruction, isGaboxV2Error, parseBindReferrerInstruction, parseBuyPackInstruction, parseClaimPrizeInstruction, parseClaimReferralInstruction, parseDeliverDrawInstruction, parseDrawResolvedEvent, parseExpireDrawInstruction, parseFulfillDrawInstruction, parseFundPrizesInstruction, parseGaboxV2Instruction, parseInitializePoolInstruction, parsePackBoughtEvent, parsePoolCreatedEvent, parsePrizeRedeemedEvent, parsePrizesFundedEvent, parseRandomnessRetriedEvent, parseReferralBoundEvent, parseReferralClaimedEvent, parseRetryDrawInstruction, parseSellPrizeInstruction, parseSellTokensInstruction, parseTokensSoldEvent, generated_exports as t };
2858
+ export { BUY_PACK_DISCRIMINATOR, DELIVER_DRAW_DISCRIMINATOR, DRAW_DISCRIMINATOR, DRAW_RESOLVED_EVENT_DISCRIMINATOR, EXPIRE_DRAW_DISCRIMINATOR, FUND_PRIZES_DISCRIMINATOR, GABOX_ERROR__ARITHMETIC, GABOX_ERROR__INCORRECT_TOKEN_DELTA, GABOX_ERROR__INSOLVENT_INVENTORY, GABOX_ERROR__INVALID_DISTRIBUTION, GABOX_ERROR__INVALID_LAUNCH, GABOX_ERROR__INVALID_QUOTE, GABOX_ERROR__INVALID_VENUE, GABOX_ERROR__JACKPOT_BELOW_ONE_PACK, GABOX_ERROR__NOT_EXPIRED, GABOX_ERROR__PACK_TOO_SMALL, GABOX_ERROR__PRIZE_CAP_CHANGED, GABOX_ERROR__RETRY_TOO_SOON, GABOX_ERROR__RETRY_UNAVAILABLE, GABOX_ERROR__SLIPPAGE_EXCEEDED, GABOX_ERROR__UNFUNDED_EXPECTATION, GABOX_ERROR__UNSUPPORTED_MINT, GABOX_ERROR__WALLET_ACTIVITY_MISMATCH, GABOX_ERROR__ZERO_AMOUNT, GABOX_PROGRAM_ADDRESS, GaboxAccount, GaboxEvent, GaboxInstruction, INITIALIZE_POOL_DISCRIMINATOR, PACK_BOUGHT_EVENT_DISCRIMINATOR, POOL_CREATED_EVENT_DISCRIMINATOR, POOL_DISCRIMINATOR, PRIZES_FUNDED_EVENT_DISCRIMINATOR, RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR, RETRY_DRAW_DISCRIMINATOR, SELL_TOKENS_DISCRIMINATOR, TOKENS_SOLD_EVENT_DISCRIMINATOR, WALLET_ACTIVITY_DISCRIMINATOR, decodeDraw, decodePool, decodeWalletActivity, fetchAllDraw, fetchAllMaybeDraw, fetchAllMaybePool, fetchAllMaybeWalletActivity, fetchAllPool, fetchAllWalletActivity, fetchDraw, fetchMaybeDraw, fetchMaybePool, fetchMaybeWalletActivity, fetchPool, fetchWalletActivity, findActivityPda, findDrawPda, findIdentityPda, findPoolPda, gaboxProgram, getBuyPackDiscriminatorBytes, getBuyPackInstruction, getBuyPackInstructionAsync, getBuyPackInstructionDataCodec, getBuyPackInstructionDataDecoder, getBuyPackInstructionDataEncoder, getDeliverDrawDiscriminatorBytes, getDeliverDrawInstruction, getDeliverDrawInstructionAsync, getDeliverDrawInstructionDataCodec, getDeliverDrawInstructionDataDecoder, getDeliverDrawInstructionDataEncoder, getDrawCodec, getDrawDecoder, getDrawDiscriminatorBytes, getDrawEncoder, getDrawResolvedEventCodec, getDrawResolvedEventDecoder, getDrawResolvedEventDiscriminatorBytes, getDrawResolvedEventEncoder, getDrawSize, getExpireDrawDiscriminatorBytes, getExpireDrawInstruction, getExpireDrawInstructionAsync, getExpireDrawInstructionDataCodec, getExpireDrawInstructionDataDecoder, getExpireDrawInstructionDataEncoder, getFundPrizesDiscriminatorBytes, getFundPrizesInstruction, getFundPrizesInstructionAsync, getFundPrizesInstructionDataCodec, getFundPrizesInstructionDataDecoder, getFundPrizesInstructionDataEncoder, getGaboxErrorMessage, getInitializePoolDiscriminatorBytes, getInitializePoolInstruction, getInitializePoolInstructionAsync, getInitializePoolInstructionDataCodec, getInitializePoolInstructionDataDecoder, getInitializePoolInstructionDataEncoder, getPackBoughtEventCodec, getPackBoughtEventDecoder, getPackBoughtEventDiscriminatorBytes, getPackBoughtEventEncoder, getPoolCodec, getPoolCreatedEventCodec, getPoolCreatedEventDecoder, getPoolCreatedEventDiscriminatorBytes, getPoolCreatedEventEncoder, getPoolDecoder, getPoolDiscriminatorBytes, getPoolEncoder, getPoolSize, getPrizeCodec, getPrizeDecoder, getPrizeEncoder, getPrizesFundedEventCodec, getPrizesFundedEventDecoder, getPrizesFundedEventDiscriminatorBytes, getPrizesFundedEventEncoder, getRandomnessRetriedEventCodec, getRandomnessRetriedEventDecoder, getRandomnessRetriedEventDiscriminatorBytes, getRandomnessRetriedEventEncoder, getRetryDrawDiscriminatorBytes, getRetryDrawInstruction, getRetryDrawInstructionAsync, getRetryDrawInstructionDataCodec, getRetryDrawInstructionDataDecoder, getRetryDrawInstructionDataEncoder, getSellTokensDiscriminatorBytes, getSellTokensInstruction, getSellTokensInstructionAsync, getSellTokensInstructionDataCodec, getSellTokensInstructionDataDecoder, getSellTokensInstructionDataEncoder, getTierCodec, getTierDecoder, getTierEncoder, getTokensSoldEventCodec, getTokensSoldEventDecoder, getTokensSoldEventDiscriminatorBytes, getTokensSoldEventEncoder, getWalletActivityCodec, getWalletActivityDecoder, getWalletActivityDiscriminatorBytes, getWalletActivityEncoder, getWalletActivitySize, identifyGaboxAccount, identifyGaboxEvent, identifyGaboxInstruction, isGaboxError, parseBuyPackInstruction, parseDeliverDrawInstruction, parseDrawResolvedEvent, parseExpireDrawInstruction, parseFundPrizesInstruction, parseGaboxInstruction, parseInitializePoolInstruction, parsePackBoughtEvent, parsePoolCreatedEvent, parsePrizesFundedEvent, parseRandomnessRetriedEvent, parseRetryDrawInstruction, parseSellTokensInstruction, parseTokensSoldEvent, generated_exports as t };
794
2859
 
795
2860
  //# sourceMappingURL=index.js.map