@gabox-labs/sdk 0.2.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +310 -0
- package/README.md +173 -438
- package/dist/{gaboxV2-CV2XltqC.js → gabox-DGTCh34U.js} +575 -1584
- package/dist/gabox-DGTCh34U.js.map +1 -0
- package/dist/generated/index.d.ts +384 -752
- package/dist/generated/index.js +116 -338
- package/dist/generated/index.js.map +1 -1
- package/dist/index-C4at2cZ_.d.ts +1184 -0
- package/dist/index.d.ts +474 -432
- package/dist/index.js +1186 -1374
- package/dist/index.js.map +1 -1
- package/dist/raydium/index.d.ts +2 -0
- package/dist/raydium/index.js +2 -0
- package/dist/raydium-CU-tZzIk.js +3282 -0
- package/dist/raydium-CU-tZzIk.js.map +1 -0
- package/llms.txt +7 -3
- package/package.json +11 -16
- package/skills/gabox-sdk/SKILL.md +57 -146
- package/skills/gabox-sdk/references/api.md +155 -145
- package/dist/gaboxV2-CV2XltqC.js.map +0 -1
- package/dist/index-BxvSkzCO.d.ts +0 -471
- package/dist/pump/index.d.ts +0 -2
- package/dist/pump/index.js +0 -2
- package/dist/pump-D0K_0uiC.js +0 -1531
- package/dist/pump-D0K_0uiC.js.map +0 -1
|
@@ -1,28 +1,5 @@
|
|
|
1
|
-
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,
|
|
1
|
+
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, getBytesDecoder, getBytesEncoder, getProgramDerivedAddress, getStructDecoder, getStructEncoder, getU32Decoder, getU32Encoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, transformEncoder } from "@solana/kit";
|
|
2
2
|
import { addSelfFetchFunctions, addSelfPlanAndSendFunctions, getAccountMetaFactory, getAddressFromResolvedInstructionAccount, getNonNullResolvedInstructionInput } from "@solana/program-client-core";
|
|
3
|
-
//#region src/generated/types/drawStatus.ts
|
|
4
|
-
/**
|
|
5
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
6
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
7
|
-
* to add features, then rerun Codama to update it.
|
|
8
|
-
*
|
|
9
|
-
* @see https://github.com/codama-idl/codama
|
|
10
|
-
*/
|
|
11
|
-
let DrawStatus = /* @__PURE__ */ function(DrawStatus) {
|
|
12
|
-
DrawStatus[DrawStatus["Pending"] = 0] = "Pending";
|
|
13
|
-
DrawStatus[DrawStatus["Ready"] = 1] = "Ready";
|
|
14
|
-
return DrawStatus;
|
|
15
|
-
}({});
|
|
16
|
-
function getDrawStatusEncoder() {
|
|
17
|
-
return getEnumEncoder(DrawStatus);
|
|
18
|
-
}
|
|
19
|
-
function getDrawStatusDecoder() {
|
|
20
|
-
return getEnumDecoder(DrawStatus);
|
|
21
|
-
}
|
|
22
|
-
function getDrawStatusCodec() {
|
|
23
|
-
return combineCodec(getDrawStatusEncoder(), getDrawStatusDecoder());
|
|
24
|
-
}
|
|
25
|
-
//#endregion
|
|
26
3
|
//#region src/generated/types/prize.ts
|
|
27
4
|
/**
|
|
28
5
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -68,14 +45,14 @@ function getTierCodec() {
|
|
|
68
45
|
* @see https://github.com/codama-idl/codama
|
|
69
46
|
*/
|
|
70
47
|
const DRAW_DISCRIMINATOR = new Uint8Array([
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
48
|
+
101,
|
|
49
|
+
31,
|
|
50
|
+
52,
|
|
51
|
+
179,
|
|
52
|
+
121,
|
|
53
|
+
78,
|
|
54
|
+
252,
|
|
55
|
+
89
|
|
79
56
|
]);
|
|
80
57
|
function getDrawDiscriminatorBytes() {
|
|
81
58
|
return fixEncoderSize(getBytesEncoder(), 8).encode(DRAW_DISCRIMINATOR);
|
|
@@ -88,16 +65,12 @@ function getDrawEncoder() {
|
|
|
88
65
|
["purchaser", getAddressEncoder()],
|
|
89
66
|
["seq", getU64Encoder()],
|
|
90
67
|
["bump", getU8Encoder()],
|
|
91
|
-
["status", getDrawStatusEncoder()],
|
|
92
68
|
["requestSlot", getU64Encoder()],
|
|
93
69
|
["lastAttemptSlot", getU64Encoder()],
|
|
94
70
|
["attempts", getU8Encoder()],
|
|
95
71
|
["maximum", getU64Encoder()],
|
|
96
72
|
["minimum", getU64Encoder()],
|
|
97
|
-
["prizes", getArrayEncoder(getPrizeEncoder(), { size: 8 })]
|
|
98
|
-
["amount", getU64Encoder()],
|
|
99
|
-
["randomness", fixEncoderSize(getBytesEncoder(), 32)],
|
|
100
|
-
["timedOut", getBooleanEncoder()]
|
|
73
|
+
["prizes", getArrayEncoder(getPrizeEncoder(), { size: 8 })]
|
|
101
74
|
]), (value) => ({
|
|
102
75
|
...value,
|
|
103
76
|
discriminator: DRAW_DISCRIMINATOR
|
|
@@ -111,16 +84,12 @@ function getDrawDecoder() {
|
|
|
111
84
|
["purchaser", getAddressDecoder()],
|
|
112
85
|
["seq", getU64Decoder()],
|
|
113
86
|
["bump", getU8Decoder()],
|
|
114
|
-
["status", getDrawStatusDecoder()],
|
|
115
87
|
["requestSlot", getU64Decoder()],
|
|
116
88
|
["lastAttemptSlot", getU64Decoder()],
|
|
117
89
|
["attempts", getU8Decoder()],
|
|
118
90
|
["maximum", getU64Decoder()],
|
|
119
91
|
["minimum", getU64Decoder()],
|
|
120
|
-
["prizes", getArrayDecoder(getPrizeDecoder(), { size: 8 })]
|
|
121
|
-
["amount", getU64Decoder()],
|
|
122
|
-
["randomness", fixDecoderSize(getBytesDecoder(), 32)],
|
|
123
|
-
["timedOut", getBooleanDecoder()]
|
|
92
|
+
["prizes", getArrayDecoder(getPrizeDecoder(), { size: 8 })]
|
|
124
93
|
]);
|
|
125
94
|
}
|
|
126
95
|
/** Gets the codec for {@link Draw} account data. */
|
|
@@ -147,7 +116,7 @@ async function fetchAllMaybeDraw(rpc, addresses, config) {
|
|
|
147
116
|
return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodeDraw(maybeAccount));
|
|
148
117
|
}
|
|
149
118
|
function getDrawSize() {
|
|
150
|
-
return
|
|
119
|
+
return 210;
|
|
151
120
|
}
|
|
152
121
|
//#endregion
|
|
153
122
|
//#region src/generated/accounts/pool.ts
|
|
@@ -159,14 +128,14 @@ function getDrawSize() {
|
|
|
159
128
|
* @see https://github.com/codama-idl/codama
|
|
160
129
|
*/
|
|
161
130
|
const POOL_DISCRIMINATOR = new Uint8Array([
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
131
|
+
153,
|
|
132
|
+
115,
|
|
133
|
+
78,
|
|
134
|
+
55,
|
|
135
|
+
156,
|
|
136
|
+
26,
|
|
137
|
+
133,
|
|
138
|
+
45
|
|
170
139
|
]);
|
|
171
140
|
function getPoolDiscriminatorBytes() {
|
|
172
141
|
return fixEncoderSize(getBytesEncoder(), 8).encode(POOL_DISCRIMINATOR);
|
|
@@ -177,16 +146,16 @@ function getPoolEncoder() {
|
|
|
177
146
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
178
147
|
["creator", getAddressEncoder()],
|
|
179
148
|
["mint", getAddressEncoder()],
|
|
180
|
-
["tokenProgram", getAddressEncoder()],
|
|
181
149
|
["vault", getAddressEncoder()],
|
|
150
|
+
["quoteMint", getAddressEncoder()],
|
|
182
151
|
["bump", getU8Encoder()],
|
|
183
152
|
["packTokens", getU64Encoder()],
|
|
184
|
-
["
|
|
185
|
-
["seedLamports", getU64Encoder()],
|
|
186
|
-
["seedTokens", getU64Encoder()],
|
|
153
|
+
["seedQuoteAmount", getU64Encoder()],
|
|
187
154
|
["tiers", getArrayEncoder(getTierEncoder(), { size: 8 })],
|
|
188
155
|
["nextSeq", getU64Encoder()],
|
|
189
|
-
["reserved", getU64Encoder()]
|
|
156
|
+
["reserved", getU64Encoder()],
|
|
157
|
+
["quoteConfig", getAddressEncoder()],
|
|
158
|
+
["quoteTokenProgram", getAddressEncoder()]
|
|
190
159
|
]), (value) => ({
|
|
191
160
|
...value,
|
|
192
161
|
discriminator: POOL_DISCRIMINATOR
|
|
@@ -198,16 +167,16 @@ function getPoolDecoder() {
|
|
|
198
167
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
199
168
|
["creator", getAddressDecoder()],
|
|
200
169
|
["mint", getAddressDecoder()],
|
|
201
|
-
["tokenProgram", getAddressDecoder()],
|
|
202
170
|
["vault", getAddressDecoder()],
|
|
171
|
+
["quoteMint", getAddressDecoder()],
|
|
203
172
|
["bump", getU8Decoder()],
|
|
204
173
|
["packTokens", getU64Decoder()],
|
|
205
|
-
["
|
|
206
|
-
["seedLamports", getU64Decoder()],
|
|
207
|
-
["seedTokens", getU64Decoder()],
|
|
174
|
+
["seedQuoteAmount", getU64Decoder()],
|
|
208
175
|
["tiers", getArrayDecoder(getTierDecoder(), { size: 8 })],
|
|
209
176
|
["nextSeq", getU64Decoder()],
|
|
210
|
-
["reserved", getU64Decoder()]
|
|
177
|
+
["reserved", getU64Decoder()],
|
|
178
|
+
["quoteConfig", getAddressDecoder()],
|
|
179
|
+
["quoteTokenProgram", getAddressDecoder()]
|
|
211
180
|
]);
|
|
212
181
|
}
|
|
213
182
|
/** Gets the codec for {@link Pool} account data. */
|
|
@@ -234,81 +203,10 @@ async function fetchAllMaybePool(rpc, addresses, config) {
|
|
|
234
203
|
return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodePool(maybeAccount));
|
|
235
204
|
}
|
|
236
205
|
function getPoolSize() {
|
|
237
|
-
return
|
|
238
|
-
}
|
|
239
|
-
//#endregion
|
|
240
|
-
//#region src/generated/accounts/referral.ts
|
|
241
|
-
/**
|
|
242
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
243
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
244
|
-
* to add features, then rerun Codama to update it.
|
|
245
|
-
*
|
|
246
|
-
* @see https://github.com/codama-idl/codama
|
|
247
|
-
*/
|
|
248
|
-
const REFERRAL_DISCRIMINATOR = new Uint8Array([
|
|
249
|
-
30,
|
|
250
|
-
235,
|
|
251
|
-
136,
|
|
252
|
-
224,
|
|
253
|
-
106,
|
|
254
|
-
107,
|
|
255
|
-
49,
|
|
256
|
-
64
|
|
257
|
-
]);
|
|
258
|
-
function getReferralDiscriminatorBytes() {
|
|
259
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(REFERRAL_DISCRIMINATOR);
|
|
260
|
-
}
|
|
261
|
-
/** Gets the encoder for {@link ReferralArgs} account data. */
|
|
262
|
-
function getReferralEncoder() {
|
|
263
|
-
return transformEncoder(getStructEncoder([
|
|
264
|
-
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
265
|
-
["pool", getAddressEncoder()],
|
|
266
|
-
["referrer", getAddressEncoder()],
|
|
267
|
-
["owed", getU64Encoder()],
|
|
268
|
-
["bump", getU8Encoder()]
|
|
269
|
-
]), (value) => ({
|
|
270
|
-
...value,
|
|
271
|
-
discriminator: REFERRAL_DISCRIMINATOR
|
|
272
|
-
}));
|
|
273
|
-
}
|
|
274
|
-
/** Gets the decoder for {@link Referral} account data. */
|
|
275
|
-
function getReferralDecoder() {
|
|
276
|
-
return getStructDecoder([
|
|
277
|
-
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
278
|
-
["pool", getAddressDecoder()],
|
|
279
|
-
["referrer", getAddressDecoder()],
|
|
280
|
-
["owed", getU64Decoder()],
|
|
281
|
-
["bump", getU8Decoder()]
|
|
282
|
-
]);
|
|
283
|
-
}
|
|
284
|
-
/** Gets the codec for {@link Referral} account data. */
|
|
285
|
-
function getReferralCodec() {
|
|
286
|
-
return combineCodec(getReferralEncoder(), getReferralDecoder());
|
|
287
|
-
}
|
|
288
|
-
function decodeReferral(encodedAccount) {
|
|
289
|
-
return decodeAccount(encodedAccount, getReferralDecoder());
|
|
290
|
-
}
|
|
291
|
-
async function fetchReferral(rpc, address, config) {
|
|
292
|
-
const maybeAccount = await fetchMaybeReferral(rpc, address, config);
|
|
293
|
-
assertAccountExists(maybeAccount);
|
|
294
|
-
return maybeAccount;
|
|
295
|
-
}
|
|
296
|
-
async function fetchMaybeReferral(rpc, address, config) {
|
|
297
|
-
return decodeReferral(await fetchEncodedAccount(rpc, address, config));
|
|
298
|
-
}
|
|
299
|
-
async function fetchAllReferral(rpc, addresses, config) {
|
|
300
|
-
const maybeAccounts = await fetchAllMaybeReferral(rpc, addresses, config);
|
|
301
|
-
assertAccountsExist(maybeAccounts);
|
|
302
|
-
return maybeAccounts;
|
|
303
|
-
}
|
|
304
|
-
async function fetchAllMaybeReferral(rpc, addresses, config) {
|
|
305
|
-
return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodeReferral(maybeAccount));
|
|
306
|
-
}
|
|
307
|
-
function getReferralSize() {
|
|
308
|
-
return 81;
|
|
206
|
+
return 297;
|
|
309
207
|
}
|
|
310
208
|
//#endregion
|
|
311
|
-
//#region src/generated/accounts/
|
|
209
|
+
//#region src/generated/accounts/walletActivity.ts
|
|
312
210
|
/**
|
|
313
211
|
* This code was AUTOGENERATED using the Codama library.
|
|
314
212
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -316,68 +214,72 @@ function getReferralSize() {
|
|
|
316
214
|
*
|
|
317
215
|
* @see https://github.com/codama-idl/codama
|
|
318
216
|
*/
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
217
|
+
const WALLET_ACTIVITY_DISCRIMINATOR = new Uint8Array([
|
|
218
|
+
212,
|
|
219
|
+
80,
|
|
220
|
+
180,
|
|
221
|
+
131,
|
|
222
|
+
173,
|
|
223
|
+
1,
|
|
224
|
+
252,
|
|
225
|
+
141
|
|
328
226
|
]);
|
|
329
|
-
function
|
|
330
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(
|
|
227
|
+
function getWalletActivityDiscriminatorBytes() {
|
|
228
|
+
return fixEncoderSize(getBytesEncoder(), 8).encode(WALLET_ACTIVITY_DISCRIMINATOR);
|
|
331
229
|
}
|
|
332
|
-
/** Gets the encoder for {@link
|
|
333
|
-
function
|
|
230
|
+
/** Gets the encoder for {@link WalletActivityArgs} account data. */
|
|
231
|
+
function getWalletActivityEncoder() {
|
|
334
232
|
return transformEncoder(getStructEncoder([
|
|
335
233
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
336
|
-
["
|
|
337
|
-
["
|
|
338
|
-
["
|
|
234
|
+
["wallet", getAddressEncoder()],
|
|
235
|
+
["bump", getU8Encoder()],
|
|
236
|
+
["packsBought", getU64Encoder()],
|
|
237
|
+
["nativeSpent", getU64Encoder()],
|
|
238
|
+
["reserved", fixEncoderSize(getBytesEncoder(), 64)]
|
|
339
239
|
]), (value) => ({
|
|
340
240
|
...value,
|
|
341
|
-
discriminator:
|
|
241
|
+
discriminator: WALLET_ACTIVITY_DISCRIMINATOR
|
|
342
242
|
}));
|
|
343
243
|
}
|
|
344
|
-
/** Gets the decoder for {@link
|
|
345
|
-
function
|
|
244
|
+
/** Gets the decoder for {@link WalletActivity} account data. */
|
|
245
|
+
function getWalletActivityDecoder() {
|
|
346
246
|
return getStructDecoder([
|
|
347
247
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
348
|
-
["
|
|
349
|
-
["
|
|
350
|
-
["
|
|
248
|
+
["wallet", getAddressDecoder()],
|
|
249
|
+
["bump", getU8Decoder()],
|
|
250
|
+
["packsBought", getU64Decoder()],
|
|
251
|
+
["nativeSpent", getU64Decoder()],
|
|
252
|
+
["reserved", fixDecoderSize(getBytesDecoder(), 64)]
|
|
351
253
|
]);
|
|
352
254
|
}
|
|
353
|
-
/** Gets the codec for {@link
|
|
354
|
-
function
|
|
355
|
-
return combineCodec(
|
|
255
|
+
/** Gets the codec for {@link WalletActivity} account data. */
|
|
256
|
+
function getWalletActivityCodec() {
|
|
257
|
+
return combineCodec(getWalletActivityEncoder(), getWalletActivityDecoder());
|
|
356
258
|
}
|
|
357
|
-
function
|
|
358
|
-
return decodeAccount(encodedAccount,
|
|
259
|
+
function decodeWalletActivity(encodedAccount) {
|
|
260
|
+
return decodeAccount(encodedAccount, getWalletActivityDecoder());
|
|
359
261
|
}
|
|
360
|
-
async function
|
|
361
|
-
const maybeAccount = await
|
|
262
|
+
async function fetchWalletActivity(rpc, address, config) {
|
|
263
|
+
const maybeAccount = await fetchMaybeWalletActivity(rpc, address, config);
|
|
362
264
|
assertAccountExists(maybeAccount);
|
|
363
265
|
return maybeAccount;
|
|
364
266
|
}
|
|
365
|
-
async function
|
|
366
|
-
return
|
|
267
|
+
async function fetchMaybeWalletActivity(rpc, address, config) {
|
|
268
|
+
return decodeWalletActivity(await fetchEncodedAccount(rpc, address, config));
|
|
367
269
|
}
|
|
368
|
-
async function
|
|
369
|
-
const maybeAccounts = await
|
|
270
|
+
async function fetchAllWalletActivity(rpc, addresses, config) {
|
|
271
|
+
const maybeAccounts = await fetchAllMaybeWalletActivity(rpc, addresses, config);
|
|
370
272
|
assertAccountsExist(maybeAccounts);
|
|
371
273
|
return maybeAccounts;
|
|
372
274
|
}
|
|
373
|
-
async function
|
|
374
|
-
return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) =>
|
|
275
|
+
async function fetchAllMaybeWalletActivity(rpc, addresses, config) {
|
|
276
|
+
return (await fetchEncodedAccounts(rpc, addresses, config)).map((maybeAccount) => decodeWalletActivity(maybeAccount));
|
|
375
277
|
}
|
|
376
|
-
function
|
|
377
|
-
return
|
|
278
|
+
function getWalletActivitySize() {
|
|
279
|
+
return 121;
|
|
378
280
|
}
|
|
379
281
|
//#endregion
|
|
380
|
-
//#region src/generated/pdas/
|
|
282
|
+
//#region src/generated/pdas/activity.ts
|
|
381
283
|
/**
|
|
382
284
|
* This code was AUTOGENERATED using the Codama library.
|
|
383
285
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -385,24 +287,20 @@ function getReferralLinkSize() {
|
|
|
385
287
|
*
|
|
386
288
|
* @see https://github.com/codama-idl/codama
|
|
387
289
|
*/
|
|
388
|
-
async function
|
|
290
|
+
async function findActivityPda(seeds, config = {}) {
|
|
389
291
|
const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
|
|
390
292
|
return await getProgramDerivedAddress({
|
|
391
293
|
programAddress,
|
|
392
|
-
seeds: [
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
])),
|
|
403
|
-
getAddressEncoder().encode(seeds.pool),
|
|
404
|
-
getAddressEncoder().encode(seeds.referrer)
|
|
405
|
-
]
|
|
294
|
+
seeds: [getBytesEncoder().encode(new Uint8Array([
|
|
295
|
+
97,
|
|
296
|
+
99,
|
|
297
|
+
116,
|
|
298
|
+
105,
|
|
299
|
+
118,
|
|
300
|
+
105,
|
|
301
|
+
116,
|
|
302
|
+
121
|
|
303
|
+
])), getAddressEncoder().encode(seeds.purchaser)]
|
|
406
304
|
});
|
|
407
305
|
}
|
|
408
306
|
//#endregion
|
|
@@ -456,31 +354,6 @@ async function findIdentityPda(config = {}) {
|
|
|
456
354
|
});
|
|
457
355
|
}
|
|
458
356
|
//#endregion
|
|
459
|
-
//#region src/generated/pdas/link.ts
|
|
460
|
-
/**
|
|
461
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
462
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
463
|
-
* to add features, then rerun Codama to update it.
|
|
464
|
-
*
|
|
465
|
-
* @see https://github.com/codama-idl/codama
|
|
466
|
-
*/
|
|
467
|
-
async function findLinkPda(seeds, config = {}) {
|
|
468
|
-
const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
|
|
469
|
-
return await getProgramDerivedAddress({
|
|
470
|
-
programAddress,
|
|
471
|
-
seeds: [getBytesEncoder().encode(new Uint8Array([
|
|
472
|
-
114,
|
|
473
|
-
101,
|
|
474
|
-
102,
|
|
475
|
-
101,
|
|
476
|
-
114,
|
|
477
|
-
114,
|
|
478
|
-
97,
|
|
479
|
-
108
|
|
480
|
-
])), getAddressEncoder().encode(seeds.referee)]
|
|
481
|
-
});
|
|
482
|
-
}
|
|
483
|
-
//#endregion
|
|
484
357
|
//#region src/generated/pdas/pool.ts
|
|
485
358
|
/**
|
|
486
359
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -502,174 +375,6 @@ async function findPoolPda(seeds, config = {}) {
|
|
|
502
375
|
});
|
|
503
376
|
}
|
|
504
377
|
//#endregion
|
|
505
|
-
//#region src/generated/pdas/referral.ts
|
|
506
|
-
/**
|
|
507
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
508
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
509
|
-
* to add features, then rerun Codama to update it.
|
|
510
|
-
*
|
|
511
|
-
* @see https://github.com/codama-idl/codama
|
|
512
|
-
*/
|
|
513
|
-
async function findReferralPda(seeds, config = {}) {
|
|
514
|
-
const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
|
|
515
|
-
return await getProgramDerivedAddress({
|
|
516
|
-
programAddress,
|
|
517
|
-
seeds: [
|
|
518
|
-
getBytesEncoder().encode(new Uint8Array([
|
|
519
|
-
114,
|
|
520
|
-
101,
|
|
521
|
-
102,
|
|
522
|
-
101,
|
|
523
|
-
114,
|
|
524
|
-
114,
|
|
525
|
-
97,
|
|
526
|
-
108
|
|
527
|
-
])),
|
|
528
|
-
getAddressEncoder().encode(seeds.pool),
|
|
529
|
-
getAddressEncoder().encode(seeds.referralLink)
|
|
530
|
-
]
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
//#endregion
|
|
534
|
-
//#region src/generated/pdas/referralLink.ts
|
|
535
|
-
/**
|
|
536
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
537
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
538
|
-
* to add features, then rerun Codama to update it.
|
|
539
|
-
*
|
|
540
|
-
* @see https://github.com/codama-idl/codama
|
|
541
|
-
*/
|
|
542
|
-
async function findReferralLinkPda(seeds, config = {}) {
|
|
543
|
-
const { programAddress = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" } = config;
|
|
544
|
-
return await getProgramDerivedAddress({
|
|
545
|
-
programAddress,
|
|
546
|
-
seeds: [getBytesEncoder().encode(new Uint8Array([
|
|
547
|
-
114,
|
|
548
|
-
101,
|
|
549
|
-
102,
|
|
550
|
-
101,
|
|
551
|
-
114,
|
|
552
|
-
114,
|
|
553
|
-
97,
|
|
554
|
-
108
|
|
555
|
-
])), getAddressEncoder().encode(seeds.purchaser)]
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
//#endregion
|
|
559
|
-
//#region src/generated/instructions/bindReferrer.ts
|
|
560
|
-
/**
|
|
561
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
562
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
563
|
-
* to add features, then rerun Codama to update it.
|
|
564
|
-
*
|
|
565
|
-
* @see https://github.com/codama-idl/codama
|
|
566
|
-
*/
|
|
567
|
-
const BIND_REFERRER_DISCRIMINATOR = new Uint8Array([
|
|
568
|
-
45,
|
|
569
|
-
172,
|
|
570
|
-
18,
|
|
571
|
-
187,
|
|
572
|
-
3,
|
|
573
|
-
160,
|
|
574
|
-
196,
|
|
575
|
-
176
|
|
576
|
-
]);
|
|
577
|
-
function getBindReferrerDiscriminatorBytes() {
|
|
578
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(BIND_REFERRER_DISCRIMINATOR);
|
|
579
|
-
}
|
|
580
|
-
function getBindReferrerInstructionDataEncoder() {
|
|
581
|
-
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)], ["referrer", getAddressEncoder()]]), (value) => ({
|
|
582
|
-
...value,
|
|
583
|
-
discriminator: BIND_REFERRER_DISCRIMINATOR
|
|
584
|
-
}));
|
|
585
|
-
}
|
|
586
|
-
function getBindReferrerInstructionDataDecoder() {
|
|
587
|
-
return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)], ["referrer", getAddressDecoder()]]);
|
|
588
|
-
}
|
|
589
|
-
function getBindReferrerInstructionDataCodec() {
|
|
590
|
-
return combineCodec(getBindReferrerInstructionDataEncoder(), getBindReferrerInstructionDataDecoder());
|
|
591
|
-
}
|
|
592
|
-
async function getBindReferrerInstructionAsync(input, config) {
|
|
593
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
594
|
-
const accounts = {
|
|
595
|
-
referee: {
|
|
596
|
-
value: input.referee ?? null,
|
|
597
|
-
isWritable: true
|
|
598
|
-
},
|
|
599
|
-
link: {
|
|
600
|
-
value: input.link ?? null,
|
|
601
|
-
isWritable: true
|
|
602
|
-
},
|
|
603
|
-
systemProgram: {
|
|
604
|
-
value: input.systemProgram ?? null,
|
|
605
|
-
isWritable: false
|
|
606
|
-
}
|
|
607
|
-
};
|
|
608
|
-
const args = { ...input };
|
|
609
|
-
if (!accounts.link.value) accounts.link.value = await findLinkPda({ referee: getAddressFromResolvedInstructionAccount("referee", accounts.referee.value) }, { programAddress });
|
|
610
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
611
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
612
|
-
return Object.freeze({
|
|
613
|
-
accounts: [
|
|
614
|
-
getAccountMeta("referee", accounts.referee),
|
|
615
|
-
getAccountMeta("link", accounts.link),
|
|
616
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
617
|
-
],
|
|
618
|
-
data: getBindReferrerInstructionDataEncoder().encode(args),
|
|
619
|
-
programAddress
|
|
620
|
-
});
|
|
621
|
-
}
|
|
622
|
-
function getBindReferrerInstruction(input, config) {
|
|
623
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
624
|
-
const accounts = {
|
|
625
|
-
referee: {
|
|
626
|
-
value: input.referee ?? null,
|
|
627
|
-
isWritable: true
|
|
628
|
-
},
|
|
629
|
-
link: {
|
|
630
|
-
value: input.link ?? null,
|
|
631
|
-
isWritable: true
|
|
632
|
-
},
|
|
633
|
-
systemProgram: {
|
|
634
|
-
value: input.systemProgram ?? null,
|
|
635
|
-
isWritable: false
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
const args = { ...input };
|
|
639
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
640
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
641
|
-
return Object.freeze({
|
|
642
|
-
accounts: [
|
|
643
|
-
getAccountMeta("referee", accounts.referee),
|
|
644
|
-
getAccountMeta("link", accounts.link),
|
|
645
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
646
|
-
],
|
|
647
|
-
data: getBindReferrerInstructionDataEncoder().encode(args),
|
|
648
|
-
programAddress
|
|
649
|
-
});
|
|
650
|
-
}
|
|
651
|
-
function parseBindReferrerInstruction(instruction) {
|
|
652
|
-
if (instruction.accounts.length < 3) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
653
|
-
actualAccountMetas: instruction.accounts.length,
|
|
654
|
-
expectedAccountMetas: 3
|
|
655
|
-
});
|
|
656
|
-
let accountIndex = 0;
|
|
657
|
-
const getNextAccount = () => {
|
|
658
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
659
|
-
accountIndex += 1;
|
|
660
|
-
return accountMeta;
|
|
661
|
-
};
|
|
662
|
-
return {
|
|
663
|
-
programAddress: instruction.programAddress,
|
|
664
|
-
accounts: {
|
|
665
|
-
referee: getNextAccount(),
|
|
666
|
-
link: getNextAccount(),
|
|
667
|
-
systemProgram: getNextAccount()
|
|
668
|
-
},
|
|
669
|
-
data: getBindReferrerInstructionDataDecoder().decode(instruction.data)
|
|
670
|
-
};
|
|
671
|
-
}
|
|
672
|
-
//#endregion
|
|
673
378
|
//#region src/generated/instructions/buyPack.ts
|
|
674
379
|
/**
|
|
675
380
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -696,7 +401,7 @@ function getBuyPackInstructionDataEncoder() {
|
|
|
696
401
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
697
402
|
["maxQuoteIn", getU64Encoder()],
|
|
698
403
|
["minMaximum", getU64Encoder()],
|
|
699
|
-
["
|
|
404
|
+
["maxNativeDebit", getU64Encoder()]
|
|
700
405
|
]), (value) => ({
|
|
701
406
|
...value,
|
|
702
407
|
discriminator: BUY_PACK_DISCRIMINATOR
|
|
@@ -707,7 +412,7 @@ function getBuyPackInstructionDataDecoder() {
|
|
|
707
412
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
708
413
|
["maxQuoteIn", getU64Decoder()],
|
|
709
414
|
["minMaximum", getU64Decoder()],
|
|
710
|
-
["
|
|
415
|
+
["maxNativeDebit", getU64Decoder()]
|
|
711
416
|
]);
|
|
712
417
|
}
|
|
713
418
|
function getBuyPackInstructionDataCodec() {
|
|
@@ -724,22 +429,22 @@ async function getBuyPackInstructionAsync(input, config) {
|
|
|
724
429
|
value: input.pool ?? null,
|
|
725
430
|
isWritable: true
|
|
726
431
|
},
|
|
727
|
-
creator: {
|
|
728
|
-
value: input.creator ?? null,
|
|
729
|
-
isWritable: true
|
|
730
|
-
},
|
|
731
|
-
feeCollector: {
|
|
732
|
-
value: input.feeCollector ?? null,
|
|
733
|
-
isWritable: true
|
|
734
|
-
},
|
|
735
432
|
draw: {
|
|
736
433
|
value: input.draw ?? null,
|
|
737
434
|
isWritable: true
|
|
738
435
|
},
|
|
436
|
+
activity: {
|
|
437
|
+
value: input.activity ?? null,
|
|
438
|
+
isWritable: true
|
|
439
|
+
},
|
|
739
440
|
mint: {
|
|
740
441
|
value: input.mint ?? null,
|
|
741
442
|
isWritable: false
|
|
742
443
|
},
|
|
444
|
+
quoteMint: {
|
|
445
|
+
value: input.quoteMint ?? null,
|
|
446
|
+
isWritable: false
|
|
447
|
+
},
|
|
743
448
|
vault: {
|
|
744
449
|
value: input.vault ?? null,
|
|
745
450
|
isWritable: true
|
|
@@ -772,6 +477,10 @@ async function getBuyPackInstructionAsync(input, config) {
|
|
|
772
477
|
value: input.tokenProgram ?? null,
|
|
773
478
|
isWritable: false
|
|
774
479
|
},
|
|
480
|
+
quoteTokenProgram: {
|
|
481
|
+
value: input.quoteTokenProgram ?? null,
|
|
482
|
+
isWritable: false
|
|
483
|
+
},
|
|
775
484
|
associatedTokenProgram: {
|
|
776
485
|
value: input.associatedTokenProgram ?? null,
|
|
777
486
|
isWritable: false
|
|
@@ -779,24 +488,49 @@ async function getBuyPackInstructionAsync(input, config) {
|
|
|
779
488
|
systemProgram: {
|
|
780
489
|
value: input.systemProgram ?? null,
|
|
781
490
|
isWritable: false
|
|
782
|
-
},
|
|
783
|
-
referralLink: {
|
|
784
|
-
value: input.referralLink ?? null,
|
|
785
|
-
isWritable: false
|
|
786
|
-
},
|
|
787
|
-
referral: {
|
|
788
|
-
value: input.referral ?? null,
|
|
789
|
-
isWritable: true
|
|
790
491
|
}
|
|
791
492
|
};
|
|
792
493
|
const args = { ...input };
|
|
793
|
-
if (!accounts.
|
|
794
|
-
if (!accounts.
|
|
494
|
+
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
495
|
+
if (!accounts.activity.value) accounts.activity.value = await findActivityPda({ purchaser: getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value) }, { programAddress });
|
|
795
496
|
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
796
497
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
797
498
|
seeds: [
|
|
798
499
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
|
|
799
|
-
|
|
500
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
501
|
+
6,
|
|
502
|
+
221,
|
|
503
|
+
246,
|
|
504
|
+
225,
|
|
505
|
+
215,
|
|
506
|
+
101,
|
|
507
|
+
161,
|
|
508
|
+
147,
|
|
509
|
+
217,
|
|
510
|
+
203,
|
|
511
|
+
225,
|
|
512
|
+
70,
|
|
513
|
+
206,
|
|
514
|
+
235,
|
|
515
|
+
121,
|
|
516
|
+
172,
|
|
517
|
+
28,
|
|
518
|
+
180,
|
|
519
|
+
133,
|
|
520
|
+
237,
|
|
521
|
+
95,
|
|
522
|
+
91,
|
|
523
|
+
55,
|
|
524
|
+
145,
|
|
525
|
+
58,
|
|
526
|
+
140,
|
|
527
|
+
245,
|
|
528
|
+
133,
|
|
529
|
+
126,
|
|
530
|
+
255,
|
|
531
|
+
0,
|
|
532
|
+
169
|
|
533
|
+
])),
|
|
800
534
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
801
535
|
]
|
|
802
536
|
});
|
|
@@ -804,22 +538,18 @@ async function getBuyPackInstructionAsync(input, config) {
|
|
|
804
538
|
if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
|
|
805
539
|
if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
806
540
|
if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
|
|
541
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
807
542
|
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
808
543
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
809
|
-
if (!accounts.referralLink.value) accounts.referralLink.value = await findReferralLinkPda({ purchaser: getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value) }, { programAddress });
|
|
810
|
-
if (!accounts.referral.value) accounts.referral.value = await findReferralPda({
|
|
811
|
-
pool: getAddressFromResolvedInstructionAccount("pool", accounts.pool.value),
|
|
812
|
-
referralLink: getAddressFromResolvedInstructionAccount("referralLink", accounts.referralLink.value)
|
|
813
|
-
}, { programAddress });
|
|
814
544
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
815
545
|
return Object.freeze({
|
|
816
546
|
accounts: [
|
|
817
547
|
getAccountMeta("purchaser", accounts.purchaser),
|
|
818
548
|
getAccountMeta("pool", accounts.pool),
|
|
819
|
-
getAccountMeta("creator", accounts.creator),
|
|
820
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
821
549
|
getAccountMeta("draw", accounts.draw),
|
|
550
|
+
getAccountMeta("activity", accounts.activity),
|
|
822
551
|
getAccountMeta("mint", accounts.mint),
|
|
552
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
823
553
|
getAccountMeta("vault", accounts.vault),
|
|
824
554
|
getAccountMeta("userTokens", accounts.userTokens),
|
|
825
555
|
getAccountMeta("venue", accounts.venue),
|
|
@@ -828,10 +558,9 @@ async function getBuyPackInstructionAsync(input, config) {
|
|
|
828
558
|
getAccountMeta("program", accounts.program),
|
|
829
559
|
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
830
560
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
561
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
831
562
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
832
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
833
|
-
getAccountMeta("referralLink", accounts.referralLink),
|
|
834
|
-
getAccountMeta("referral", accounts.referral)
|
|
563
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
835
564
|
],
|
|
836
565
|
data: getBuyPackInstructionDataEncoder().encode(args),
|
|
837
566
|
programAddress
|
|
@@ -848,22 +577,22 @@ function getBuyPackInstruction(input, config) {
|
|
|
848
577
|
value: input.pool ?? null,
|
|
849
578
|
isWritable: true
|
|
850
579
|
},
|
|
851
|
-
creator: {
|
|
852
|
-
value: input.creator ?? null,
|
|
853
|
-
isWritable: true
|
|
854
|
-
},
|
|
855
|
-
feeCollector: {
|
|
856
|
-
value: input.feeCollector ?? null,
|
|
857
|
-
isWritable: true
|
|
858
|
-
},
|
|
859
580
|
draw: {
|
|
860
581
|
value: input.draw ?? null,
|
|
861
582
|
isWritable: true
|
|
862
583
|
},
|
|
863
|
-
|
|
584
|
+
activity: {
|
|
585
|
+
value: input.activity ?? null,
|
|
586
|
+
isWritable: true
|
|
587
|
+
},
|
|
588
|
+
mint: {
|
|
864
589
|
value: input.mint ?? null,
|
|
865
590
|
isWritable: false
|
|
866
591
|
},
|
|
592
|
+
quoteMint: {
|
|
593
|
+
value: input.quoteMint ?? null,
|
|
594
|
+
isWritable: false
|
|
595
|
+
},
|
|
867
596
|
vault: {
|
|
868
597
|
value: input.vault ?? null,
|
|
869
598
|
isWritable: true
|
|
@@ -896,6 +625,10 @@ function getBuyPackInstruction(input, config) {
|
|
|
896
625
|
value: input.tokenProgram ?? null,
|
|
897
626
|
isWritable: false
|
|
898
627
|
},
|
|
628
|
+
quoteTokenProgram: {
|
|
629
|
+
value: input.quoteTokenProgram ?? null,
|
|
630
|
+
isWritable: false
|
|
631
|
+
},
|
|
899
632
|
associatedTokenProgram: {
|
|
900
633
|
value: input.associatedTokenProgram ?? null,
|
|
901
634
|
isWritable: false
|
|
@@ -903,22 +636,13 @@ function getBuyPackInstruction(input, config) {
|
|
|
903
636
|
systemProgram: {
|
|
904
637
|
value: input.systemProgram ?? null,
|
|
905
638
|
isWritable: false
|
|
906
|
-
},
|
|
907
|
-
referralLink: {
|
|
908
|
-
value: input.referralLink ?? null,
|
|
909
|
-
isWritable: false
|
|
910
|
-
},
|
|
911
|
-
referral: {
|
|
912
|
-
value: input.referral ?? null,
|
|
913
|
-
isWritable: true
|
|
914
639
|
}
|
|
915
640
|
};
|
|
916
641
|
const args = { ...input };
|
|
917
|
-
if (!accounts.feeCollector.value) accounts.feeCollector.value = "5WcPTEQ59UqpQzjZUPbU8QRGCbj7NeQNLDa7DbsLkLKT";
|
|
918
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
919
642
|
if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
|
|
920
643
|
if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
921
644
|
if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
|
|
645
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
922
646
|
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
923
647
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
924
648
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
@@ -926,10 +650,10 @@ function getBuyPackInstruction(input, config) {
|
|
|
926
650
|
accounts: [
|
|
927
651
|
getAccountMeta("purchaser", accounts.purchaser),
|
|
928
652
|
getAccountMeta("pool", accounts.pool),
|
|
929
|
-
getAccountMeta("creator", accounts.creator),
|
|
930
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
931
653
|
getAccountMeta("draw", accounts.draw),
|
|
654
|
+
getAccountMeta("activity", accounts.activity),
|
|
932
655
|
getAccountMeta("mint", accounts.mint),
|
|
656
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
933
657
|
getAccountMeta("vault", accounts.vault),
|
|
934
658
|
getAccountMeta("userTokens", accounts.userTokens),
|
|
935
659
|
getAccountMeta("venue", accounts.venue),
|
|
@@ -938,19 +662,18 @@ function getBuyPackInstruction(input, config) {
|
|
|
938
662
|
getAccountMeta("program", accounts.program),
|
|
939
663
|
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
940
664
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
665
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
941
666
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
942
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
943
|
-
getAccountMeta("referralLink", accounts.referralLink),
|
|
944
|
-
getAccountMeta("referral", accounts.referral)
|
|
667
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
945
668
|
],
|
|
946
669
|
data: getBuyPackInstructionDataEncoder().encode(args),
|
|
947
670
|
programAddress
|
|
948
671
|
});
|
|
949
672
|
}
|
|
950
673
|
function parseBuyPackInstruction(instruction) {
|
|
951
|
-
if (instruction.accounts.length <
|
|
674
|
+
if (instruction.accounts.length < 17) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
952
675
|
actualAccountMetas: instruction.accounts.length,
|
|
953
|
-
expectedAccountMetas:
|
|
676
|
+
expectedAccountMetas: 17
|
|
954
677
|
});
|
|
955
678
|
let accountIndex = 0;
|
|
956
679
|
const getNextAccount = () => {
|
|
@@ -958,19 +681,15 @@ function parseBuyPackInstruction(instruction) {
|
|
|
958
681
|
accountIndex += 1;
|
|
959
682
|
return accountMeta;
|
|
960
683
|
};
|
|
961
|
-
const getNextOptionalAccount = () => {
|
|
962
|
-
const accountMeta = getNextAccount();
|
|
963
|
-
return accountMeta.address === "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA" ? void 0 : accountMeta;
|
|
964
|
-
};
|
|
965
684
|
return {
|
|
966
685
|
programAddress: instruction.programAddress,
|
|
967
686
|
accounts: {
|
|
968
687
|
purchaser: getNextAccount(),
|
|
969
688
|
pool: getNextAccount(),
|
|
970
|
-
creator: getNextAccount(),
|
|
971
|
-
feeCollector: getNextAccount(),
|
|
972
689
|
draw: getNextAccount(),
|
|
690
|
+
activity: getNextAccount(),
|
|
973
691
|
mint: getNextAccount(),
|
|
692
|
+
quoteMint: getNextAccount(),
|
|
974
693
|
vault: getNextAccount(),
|
|
975
694
|
userTokens: getNextAccount(),
|
|
976
695
|
venue: getNextAccount(),
|
|
@@ -979,328 +698,11 @@ function parseBuyPackInstruction(instruction) {
|
|
|
979
698
|
program: getNextAccount(),
|
|
980
699
|
slotHashes: getNextAccount(),
|
|
981
700
|
tokenProgram: getNextAccount(),
|
|
982
|
-
|
|
983
|
-
systemProgram: getNextAccount(),
|
|
984
|
-
referralLink: getNextOptionalAccount(),
|
|
985
|
-
referral: getNextOptionalAccount()
|
|
986
|
-
},
|
|
987
|
-
data: getBuyPackInstructionDataDecoder().decode(instruction.data)
|
|
988
|
-
};
|
|
989
|
-
}
|
|
990
|
-
//#endregion
|
|
991
|
-
//#region src/generated/instructions/claimPrize.ts
|
|
992
|
-
/**
|
|
993
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
994
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
995
|
-
* to add features, then rerun Codama to update it.
|
|
996
|
-
*
|
|
997
|
-
* @see https://github.com/codama-idl/codama
|
|
998
|
-
*/
|
|
999
|
-
const CLAIM_PRIZE_DISCRIMINATOR = new Uint8Array([
|
|
1000
|
-
157,
|
|
1001
|
-
233,
|
|
1002
|
-
139,
|
|
1003
|
-
121,
|
|
1004
|
-
246,
|
|
1005
|
-
62,
|
|
1006
|
-
234,
|
|
1007
|
-
235
|
|
1008
|
-
]);
|
|
1009
|
-
function getClaimPrizeDiscriminatorBytes() {
|
|
1010
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_PRIZE_DISCRIMINATOR);
|
|
1011
|
-
}
|
|
1012
|
-
function getClaimPrizeInstructionDataEncoder() {
|
|
1013
|
-
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
1014
|
-
...value,
|
|
1015
|
-
discriminator: CLAIM_PRIZE_DISCRIMINATOR
|
|
1016
|
-
}));
|
|
1017
|
-
}
|
|
1018
|
-
function getClaimPrizeInstructionDataDecoder() {
|
|
1019
|
-
return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)]]);
|
|
1020
|
-
}
|
|
1021
|
-
function getClaimPrizeInstructionDataCodec() {
|
|
1022
|
-
return combineCodec(getClaimPrizeInstructionDataEncoder(), getClaimPrizeInstructionDataDecoder());
|
|
1023
|
-
}
|
|
1024
|
-
async function getClaimPrizeInstructionAsync(input, config) {
|
|
1025
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1026
|
-
const accounts = {
|
|
1027
|
-
purchaser: {
|
|
1028
|
-
value: input.purchaser ?? null,
|
|
1029
|
-
isWritable: true
|
|
1030
|
-
},
|
|
1031
|
-
pool: {
|
|
1032
|
-
value: input.pool ?? null,
|
|
1033
|
-
isWritable: true
|
|
1034
|
-
},
|
|
1035
|
-
draw: {
|
|
1036
|
-
value: input.draw ?? null,
|
|
1037
|
-
isWritable: true
|
|
1038
|
-
},
|
|
1039
|
-
mint: {
|
|
1040
|
-
value: input.mint ?? null,
|
|
1041
|
-
isWritable: false
|
|
1042
|
-
},
|
|
1043
|
-
vault: {
|
|
1044
|
-
value: input.vault ?? null,
|
|
1045
|
-
isWritable: true
|
|
1046
|
-
},
|
|
1047
|
-
userTokens: {
|
|
1048
|
-
value: input.userTokens ?? null,
|
|
1049
|
-
isWritable: true
|
|
1050
|
-
},
|
|
1051
|
-
tokenProgram: {
|
|
1052
|
-
value: input.tokenProgram ?? null,
|
|
1053
|
-
isWritable: false
|
|
1054
|
-
},
|
|
1055
|
-
associatedTokenProgram: {
|
|
1056
|
-
value: input.associatedTokenProgram ?? null,
|
|
1057
|
-
isWritable: false
|
|
1058
|
-
},
|
|
1059
|
-
systemProgram: {
|
|
1060
|
-
value: input.systemProgram ?? null,
|
|
1061
|
-
isWritable: false
|
|
1062
|
-
}
|
|
1063
|
-
};
|
|
1064
|
-
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
1065
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1066
|
-
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
1067
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
1068
|
-
seeds: [
|
|
1069
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
|
|
1070
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("tokenProgram", accounts.tokenProgram.value)),
|
|
1071
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
1072
|
-
]
|
|
1073
|
-
});
|
|
1074
|
-
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
1075
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1076
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1077
|
-
return Object.freeze({
|
|
1078
|
-
accounts: [
|
|
1079
|
-
getAccountMeta("purchaser", accounts.purchaser),
|
|
1080
|
-
getAccountMeta("pool", accounts.pool),
|
|
1081
|
-
getAccountMeta("draw", accounts.draw),
|
|
1082
|
-
getAccountMeta("mint", accounts.mint),
|
|
1083
|
-
getAccountMeta("vault", accounts.vault),
|
|
1084
|
-
getAccountMeta("userTokens", accounts.userTokens),
|
|
1085
|
-
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1086
|
-
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
1087
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1088
|
-
],
|
|
1089
|
-
data: getClaimPrizeInstructionDataEncoder().encode({}),
|
|
1090
|
-
programAddress
|
|
1091
|
-
});
|
|
1092
|
-
}
|
|
1093
|
-
function getClaimPrizeInstruction(input, config) {
|
|
1094
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1095
|
-
const accounts = {
|
|
1096
|
-
purchaser: {
|
|
1097
|
-
value: input.purchaser ?? null,
|
|
1098
|
-
isWritable: true
|
|
1099
|
-
},
|
|
1100
|
-
pool: {
|
|
1101
|
-
value: input.pool ?? null,
|
|
1102
|
-
isWritable: true
|
|
1103
|
-
},
|
|
1104
|
-
draw: {
|
|
1105
|
-
value: input.draw ?? null,
|
|
1106
|
-
isWritable: true
|
|
1107
|
-
},
|
|
1108
|
-
mint: {
|
|
1109
|
-
value: input.mint ?? null,
|
|
1110
|
-
isWritable: false
|
|
1111
|
-
},
|
|
1112
|
-
vault: {
|
|
1113
|
-
value: input.vault ?? null,
|
|
1114
|
-
isWritable: true
|
|
1115
|
-
},
|
|
1116
|
-
userTokens: {
|
|
1117
|
-
value: input.userTokens ?? null,
|
|
1118
|
-
isWritable: true
|
|
1119
|
-
},
|
|
1120
|
-
tokenProgram: {
|
|
1121
|
-
value: input.tokenProgram ?? null,
|
|
1122
|
-
isWritable: false
|
|
1123
|
-
},
|
|
1124
|
-
associatedTokenProgram: {
|
|
1125
|
-
value: input.associatedTokenProgram ?? null,
|
|
1126
|
-
isWritable: false
|
|
1127
|
-
},
|
|
1128
|
-
systemProgram: {
|
|
1129
|
-
value: input.systemProgram ?? null,
|
|
1130
|
-
isWritable: false
|
|
1131
|
-
}
|
|
1132
|
-
};
|
|
1133
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1134
|
-
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
1135
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1136
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1137
|
-
return Object.freeze({
|
|
1138
|
-
accounts: [
|
|
1139
|
-
getAccountMeta("purchaser", accounts.purchaser),
|
|
1140
|
-
getAccountMeta("pool", accounts.pool),
|
|
1141
|
-
getAccountMeta("draw", accounts.draw),
|
|
1142
|
-
getAccountMeta("mint", accounts.mint),
|
|
1143
|
-
getAccountMeta("vault", accounts.vault),
|
|
1144
|
-
getAccountMeta("userTokens", accounts.userTokens),
|
|
1145
|
-
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1146
|
-
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
1147
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1148
|
-
],
|
|
1149
|
-
data: getClaimPrizeInstructionDataEncoder().encode({}),
|
|
1150
|
-
programAddress
|
|
1151
|
-
});
|
|
1152
|
-
}
|
|
1153
|
-
function parseClaimPrizeInstruction(instruction) {
|
|
1154
|
-
if (instruction.accounts.length < 9) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1155
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1156
|
-
expectedAccountMetas: 9
|
|
1157
|
-
});
|
|
1158
|
-
let accountIndex = 0;
|
|
1159
|
-
const getNextAccount = () => {
|
|
1160
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1161
|
-
accountIndex += 1;
|
|
1162
|
-
return accountMeta;
|
|
1163
|
-
};
|
|
1164
|
-
return {
|
|
1165
|
-
programAddress: instruction.programAddress,
|
|
1166
|
-
accounts: {
|
|
1167
|
-
purchaser: getNextAccount(),
|
|
1168
|
-
pool: getNextAccount(),
|
|
1169
|
-
draw: getNextAccount(),
|
|
1170
|
-
mint: getNextAccount(),
|
|
1171
|
-
vault: getNextAccount(),
|
|
1172
|
-
userTokens: getNextAccount(),
|
|
1173
|
-
tokenProgram: getNextAccount(),
|
|
701
|
+
quoteTokenProgram: getNextAccount(),
|
|
1174
702
|
associatedTokenProgram: getNextAccount(),
|
|
1175
703
|
systemProgram: getNextAccount()
|
|
1176
704
|
},
|
|
1177
|
-
data:
|
|
1178
|
-
};
|
|
1179
|
-
}
|
|
1180
|
-
//#endregion
|
|
1181
|
-
//#region src/generated/instructions/claimReferral.ts
|
|
1182
|
-
/**
|
|
1183
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
1184
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1185
|
-
* to add features, then rerun Codama to update it.
|
|
1186
|
-
*
|
|
1187
|
-
* @see https://github.com/codama-idl/codama
|
|
1188
|
-
*/
|
|
1189
|
-
const CLAIM_REFERRAL_DISCRIMINATOR = new Uint8Array([
|
|
1190
|
-
219,
|
|
1191
|
-
247,
|
|
1192
|
-
18,
|
|
1193
|
-
148,
|
|
1194
|
-
63,
|
|
1195
|
-
247,
|
|
1196
|
-
112,
|
|
1197
|
-
198
|
|
1198
|
-
]);
|
|
1199
|
-
function getClaimReferralDiscriminatorBytes() {
|
|
1200
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(CLAIM_REFERRAL_DISCRIMINATOR);
|
|
1201
|
-
}
|
|
1202
|
-
function getClaimReferralInstructionDataEncoder() {
|
|
1203
|
-
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)]]), (value) => ({
|
|
1204
|
-
...value,
|
|
1205
|
-
discriminator: CLAIM_REFERRAL_DISCRIMINATOR
|
|
1206
|
-
}));
|
|
1207
|
-
}
|
|
1208
|
-
function getClaimReferralInstructionDataDecoder() {
|
|
1209
|
-
return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)]]);
|
|
1210
|
-
}
|
|
1211
|
-
function getClaimReferralInstructionDataCodec() {
|
|
1212
|
-
return combineCodec(getClaimReferralInstructionDataEncoder(), getClaimReferralInstructionDataDecoder());
|
|
1213
|
-
}
|
|
1214
|
-
async function getClaimReferralInstructionAsync(input, config) {
|
|
1215
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1216
|
-
const accounts = {
|
|
1217
|
-
referrer: {
|
|
1218
|
-
value: input.referrer ?? null,
|
|
1219
|
-
isWritable: true
|
|
1220
|
-
},
|
|
1221
|
-
pool: {
|
|
1222
|
-
value: input.pool ?? null,
|
|
1223
|
-
isWritable: false
|
|
1224
|
-
},
|
|
1225
|
-
referral: {
|
|
1226
|
-
value: input.referral ?? null,
|
|
1227
|
-
isWritable: true
|
|
1228
|
-
},
|
|
1229
|
-
systemProgram: {
|
|
1230
|
-
value: input.systemProgram ?? null,
|
|
1231
|
-
isWritable: false
|
|
1232
|
-
}
|
|
1233
|
-
};
|
|
1234
|
-
if (!accounts.referral.value) accounts.referral.value = await findClaimReferralReferralPda({
|
|
1235
|
-
pool: getAddressFromResolvedInstructionAccount("pool", accounts.pool.value),
|
|
1236
|
-
referrer: getAddressFromResolvedInstructionAccount("referrer", accounts.referrer.value)
|
|
1237
|
-
}, { programAddress });
|
|
1238
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1239
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1240
|
-
return Object.freeze({
|
|
1241
|
-
accounts: [
|
|
1242
|
-
getAccountMeta("referrer", accounts.referrer),
|
|
1243
|
-
getAccountMeta("pool", accounts.pool),
|
|
1244
|
-
getAccountMeta("referral", accounts.referral),
|
|
1245
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1246
|
-
],
|
|
1247
|
-
data: getClaimReferralInstructionDataEncoder().encode({}),
|
|
1248
|
-
programAddress
|
|
1249
|
-
});
|
|
1250
|
-
}
|
|
1251
|
-
function getClaimReferralInstruction(input, config) {
|
|
1252
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1253
|
-
const accounts = {
|
|
1254
|
-
referrer: {
|
|
1255
|
-
value: input.referrer ?? null,
|
|
1256
|
-
isWritable: true
|
|
1257
|
-
},
|
|
1258
|
-
pool: {
|
|
1259
|
-
value: input.pool ?? null,
|
|
1260
|
-
isWritable: false
|
|
1261
|
-
},
|
|
1262
|
-
referral: {
|
|
1263
|
-
value: input.referral ?? null,
|
|
1264
|
-
isWritable: true
|
|
1265
|
-
},
|
|
1266
|
-
systemProgram: {
|
|
1267
|
-
value: input.systemProgram ?? null,
|
|
1268
|
-
isWritable: false
|
|
1269
|
-
}
|
|
1270
|
-
};
|
|
1271
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1272
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1273
|
-
return Object.freeze({
|
|
1274
|
-
accounts: [
|
|
1275
|
-
getAccountMeta("referrer", accounts.referrer),
|
|
1276
|
-
getAccountMeta("pool", accounts.pool),
|
|
1277
|
-
getAccountMeta("referral", accounts.referral),
|
|
1278
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
1279
|
-
],
|
|
1280
|
-
data: getClaimReferralInstructionDataEncoder().encode({}),
|
|
1281
|
-
programAddress
|
|
1282
|
-
});
|
|
1283
|
-
}
|
|
1284
|
-
function parseClaimReferralInstruction(instruction) {
|
|
1285
|
-
if (instruction.accounts.length < 4) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1286
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1287
|
-
expectedAccountMetas: 4
|
|
1288
|
-
});
|
|
1289
|
-
let accountIndex = 0;
|
|
1290
|
-
const getNextAccount = () => {
|
|
1291
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1292
|
-
accountIndex += 1;
|
|
1293
|
-
return accountMeta;
|
|
1294
|
-
};
|
|
1295
|
-
return {
|
|
1296
|
-
programAddress: instruction.programAddress,
|
|
1297
|
-
accounts: {
|
|
1298
|
-
referrer: getNextAccount(),
|
|
1299
|
-
pool: getNextAccount(),
|
|
1300
|
-
referral: getNextAccount(),
|
|
1301
|
-
systemProgram: getNextAccount()
|
|
1302
|
-
},
|
|
1303
|
-
data: getClaimReferralInstructionDataDecoder().decode(instruction.data)
|
|
705
|
+
data: getBuyPackInstructionDataDecoder().decode(instruction.data)
|
|
1304
706
|
};
|
|
1305
707
|
}
|
|
1306
708
|
//#endregion
|
|
@@ -1433,15 +835,48 @@ async function getDeliverDrawInstructionAsync(input, config) {
|
|
|
1433
835
|
pool: getAddressFromResolvedInstructionAccount("pool", accounts.pool.value),
|
|
1434
836
|
seq: getNonNullResolvedInstructionInput("seq", args.seq)
|
|
1435
837
|
}, { programAddress });
|
|
1436
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1437
838
|
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
1438
839
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
1439
840
|
seeds: [
|
|
1440
841
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
|
|
1441
|
-
|
|
842
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
843
|
+
6,
|
|
844
|
+
221,
|
|
845
|
+
246,
|
|
846
|
+
225,
|
|
847
|
+
215,
|
|
848
|
+
101,
|
|
849
|
+
161,
|
|
850
|
+
147,
|
|
851
|
+
217,
|
|
852
|
+
203,
|
|
853
|
+
225,
|
|
854
|
+
70,
|
|
855
|
+
206,
|
|
856
|
+
235,
|
|
857
|
+
121,
|
|
858
|
+
172,
|
|
859
|
+
28,
|
|
860
|
+
180,
|
|
861
|
+
133,
|
|
862
|
+
237,
|
|
863
|
+
95,
|
|
864
|
+
91,
|
|
865
|
+
55,
|
|
866
|
+
145,
|
|
867
|
+
58,
|
|
868
|
+
140,
|
|
869
|
+
245,
|
|
870
|
+
133,
|
|
871
|
+
126,
|
|
872
|
+
255,
|
|
873
|
+
0,
|
|
874
|
+
169
|
|
875
|
+
])),
|
|
1442
876
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
1443
877
|
]
|
|
1444
878
|
});
|
|
879
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1445
880
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1446
881
|
return Object.freeze({
|
|
1447
882
|
accounts: [
|
|
@@ -1605,15 +1040,48 @@ async function getExpireDrawInstructionAsync(input, config) {
|
|
|
1605
1040
|
}
|
|
1606
1041
|
};
|
|
1607
1042
|
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
1608
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1609
1043
|
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
1610
1044
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
1611
1045
|
seeds: [
|
|
1612
1046
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
|
|
1613
|
-
|
|
1047
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
1048
|
+
6,
|
|
1049
|
+
221,
|
|
1050
|
+
246,
|
|
1051
|
+
225,
|
|
1052
|
+
215,
|
|
1053
|
+
101,
|
|
1054
|
+
161,
|
|
1055
|
+
147,
|
|
1056
|
+
217,
|
|
1057
|
+
203,
|
|
1058
|
+
225,
|
|
1059
|
+
70,
|
|
1060
|
+
206,
|
|
1061
|
+
235,
|
|
1062
|
+
121,
|
|
1063
|
+
172,
|
|
1064
|
+
28,
|
|
1065
|
+
180,
|
|
1066
|
+
133,
|
|
1067
|
+
237,
|
|
1068
|
+
95,
|
|
1069
|
+
91,
|
|
1070
|
+
55,
|
|
1071
|
+
145,
|
|
1072
|
+
58,
|
|
1073
|
+
140,
|
|
1074
|
+
245,
|
|
1075
|
+
133,
|
|
1076
|
+
126,
|
|
1077
|
+
255,
|
|
1078
|
+
0,
|
|
1079
|
+
169
|
|
1080
|
+
])),
|
|
1614
1081
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
1615
1082
|
]
|
|
1616
1083
|
});
|
|
1084
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1617
1085
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1618
1086
|
return Object.freeze({
|
|
1619
1087
|
accounts: [
|
|
@@ -1703,175 +1171,6 @@ function parseExpireDrawInstruction(instruction) {
|
|
|
1703
1171
|
};
|
|
1704
1172
|
}
|
|
1705
1173
|
//#endregion
|
|
1706
|
-
//#region src/generated/instructions/fulfillDraw.ts
|
|
1707
|
-
/**
|
|
1708
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
1709
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
1710
|
-
* to add features, then rerun Codama to update it.
|
|
1711
|
-
*
|
|
1712
|
-
* @see https://github.com/codama-idl/codama
|
|
1713
|
-
*/
|
|
1714
|
-
const FULFILL_DRAW_DISCRIMINATOR = new Uint8Array([
|
|
1715
|
-
136,
|
|
1716
|
-
46,
|
|
1717
|
-
22,
|
|
1718
|
-
51,
|
|
1719
|
-
33,
|
|
1720
|
-
153,
|
|
1721
|
-
232,
|
|
1722
|
-
234
|
|
1723
|
-
]);
|
|
1724
|
-
function getFulfillDrawDiscriminatorBytes() {
|
|
1725
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(FULFILL_DRAW_DISCRIMINATOR);
|
|
1726
|
-
}
|
|
1727
|
-
function getFulfillDrawInstructionDataEncoder() {
|
|
1728
|
-
return transformEncoder(getStructEncoder([
|
|
1729
|
-
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
1730
|
-
["randomness", fixEncoderSize(getBytesEncoder(), 32)],
|
|
1731
|
-
["seq", getU64Encoder()]
|
|
1732
|
-
]), (value) => ({
|
|
1733
|
-
...value,
|
|
1734
|
-
discriminator: FULFILL_DRAW_DISCRIMINATOR
|
|
1735
|
-
}));
|
|
1736
|
-
}
|
|
1737
|
-
function getFulfillDrawInstructionDataDecoder() {
|
|
1738
|
-
return getStructDecoder([
|
|
1739
|
-
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
1740
|
-
["randomness", fixDecoderSize(getBytesDecoder(), 32)],
|
|
1741
|
-
["seq", getU64Decoder()]
|
|
1742
|
-
]);
|
|
1743
|
-
}
|
|
1744
|
-
function getFulfillDrawInstructionDataCodec() {
|
|
1745
|
-
return combineCodec(getFulfillDrawInstructionDataEncoder(), getFulfillDrawInstructionDataDecoder());
|
|
1746
|
-
}
|
|
1747
|
-
async function getFulfillDrawInstructionAsync(input, config) {
|
|
1748
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1749
|
-
const accounts = {
|
|
1750
|
-
oracleIdentity: {
|
|
1751
|
-
value: input.oracleIdentity ?? null,
|
|
1752
|
-
isWritable: false
|
|
1753
|
-
},
|
|
1754
|
-
pool: {
|
|
1755
|
-
value: input.pool ?? null,
|
|
1756
|
-
isWritable: true
|
|
1757
|
-
},
|
|
1758
|
-
draw: {
|
|
1759
|
-
value: input.draw ?? null,
|
|
1760
|
-
isWritable: true
|
|
1761
|
-
}
|
|
1762
|
-
};
|
|
1763
|
-
const args = { ...input };
|
|
1764
|
-
if (!accounts.oracleIdentity.value) accounts.oracleIdentity.value = await getProgramDerivedAddress({
|
|
1765
|
-
programAddress: "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz",
|
|
1766
|
-
seeds: [getBytesEncoder().encode(new Uint8Array([
|
|
1767
|
-
105,
|
|
1768
|
-
100,
|
|
1769
|
-
101,
|
|
1770
|
-
110,
|
|
1771
|
-
116,
|
|
1772
|
-
105,
|
|
1773
|
-
116,
|
|
1774
|
-
121
|
|
1775
|
-
])), getBytesEncoder().encode(new Uint8Array([
|
|
1776
|
-
231,
|
|
1777
|
-
95,
|
|
1778
|
-
177,
|
|
1779
|
-
105,
|
|
1780
|
-
231,
|
|
1781
|
-
174,
|
|
1782
|
-
80,
|
|
1783
|
-
36,
|
|
1784
|
-
228,
|
|
1785
|
-
6,
|
|
1786
|
-
241,
|
|
1787
|
-
195,
|
|
1788
|
-
89,
|
|
1789
|
-
243,
|
|
1790
|
-
52,
|
|
1791
|
-
57,
|
|
1792
|
-
128,
|
|
1793
|
-
219,
|
|
1794
|
-
206,
|
|
1795
|
-
84,
|
|
1796
|
-
115,
|
|
1797
|
-
45,
|
|
1798
|
-
3,
|
|
1799
|
-
217,
|
|
1800
|
-
77,
|
|
1801
|
-
35,
|
|
1802
|
-
38,
|
|
1803
|
-
40,
|
|
1804
|
-
214,
|
|
1805
|
-
248,
|
|
1806
|
-
69,
|
|
1807
|
-
83
|
|
1808
|
-
]))]
|
|
1809
|
-
});
|
|
1810
|
-
if (!accounts.draw.value) accounts.draw.value = await findDrawPda({
|
|
1811
|
-
pool: getAddressFromResolvedInstructionAccount("pool", accounts.pool.value),
|
|
1812
|
-
seq: getNonNullResolvedInstructionInput("seq", args.seq)
|
|
1813
|
-
}, { programAddress });
|
|
1814
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1815
|
-
return Object.freeze({
|
|
1816
|
-
accounts: [
|
|
1817
|
-
getAccountMeta("oracleIdentity", accounts.oracleIdentity),
|
|
1818
|
-
getAccountMeta("pool", accounts.pool),
|
|
1819
|
-
getAccountMeta("draw", accounts.draw)
|
|
1820
|
-
],
|
|
1821
|
-
data: getFulfillDrawInstructionDataEncoder().encode(args),
|
|
1822
|
-
programAddress
|
|
1823
|
-
});
|
|
1824
|
-
}
|
|
1825
|
-
function getFulfillDrawInstruction(input, config) {
|
|
1826
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1827
|
-
const accounts = {
|
|
1828
|
-
oracleIdentity: {
|
|
1829
|
-
value: input.oracleIdentity ?? null,
|
|
1830
|
-
isWritable: false
|
|
1831
|
-
},
|
|
1832
|
-
pool: {
|
|
1833
|
-
value: input.pool ?? null,
|
|
1834
|
-
isWritable: true
|
|
1835
|
-
},
|
|
1836
|
-
draw: {
|
|
1837
|
-
value: input.draw ?? null,
|
|
1838
|
-
isWritable: true
|
|
1839
|
-
}
|
|
1840
|
-
};
|
|
1841
|
-
const args = { ...input };
|
|
1842
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1843
|
-
return Object.freeze({
|
|
1844
|
-
accounts: [
|
|
1845
|
-
getAccountMeta("oracleIdentity", accounts.oracleIdentity),
|
|
1846
|
-
getAccountMeta("pool", accounts.pool),
|
|
1847
|
-
getAccountMeta("draw", accounts.draw)
|
|
1848
|
-
],
|
|
1849
|
-
data: getFulfillDrawInstructionDataEncoder().encode(args),
|
|
1850
|
-
programAddress
|
|
1851
|
-
});
|
|
1852
|
-
}
|
|
1853
|
-
function parseFulfillDrawInstruction(instruction) {
|
|
1854
|
-
if (instruction.accounts.length < 3) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
1855
|
-
actualAccountMetas: instruction.accounts.length,
|
|
1856
|
-
expectedAccountMetas: 3
|
|
1857
|
-
});
|
|
1858
|
-
let accountIndex = 0;
|
|
1859
|
-
const getNextAccount = () => {
|
|
1860
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1861
|
-
accountIndex += 1;
|
|
1862
|
-
return accountMeta;
|
|
1863
|
-
};
|
|
1864
|
-
return {
|
|
1865
|
-
programAddress: instruction.programAddress,
|
|
1866
|
-
accounts: {
|
|
1867
|
-
oracleIdentity: getNextAccount(),
|
|
1868
|
-
pool: getNextAccount(),
|
|
1869
|
-
draw: getNextAccount()
|
|
1870
|
-
},
|
|
1871
|
-
data: getFulfillDrawInstructionDataDecoder().decode(instruction.data)
|
|
1872
|
-
};
|
|
1873
|
-
}
|
|
1874
|
-
//#endregion
|
|
1875
1174
|
//#region src/generated/instructions/fundPrizes.ts
|
|
1876
1175
|
/**
|
|
1877
1176
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -1905,6 +1204,51 @@ function getFundPrizesInstructionDataDecoder() {
|
|
|
1905
1204
|
function getFundPrizesInstructionDataCodec() {
|
|
1906
1205
|
return combineCodec(getFundPrizesInstructionDataEncoder(), getFundPrizesInstructionDataDecoder());
|
|
1907
1206
|
}
|
|
1207
|
+
async function getFundPrizesInstructionAsync(input, config) {
|
|
1208
|
+
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1209
|
+
const accounts = {
|
|
1210
|
+
funder: {
|
|
1211
|
+
value: input.funder ?? null,
|
|
1212
|
+
isWritable: false
|
|
1213
|
+
},
|
|
1214
|
+
pool: {
|
|
1215
|
+
value: input.pool ?? null,
|
|
1216
|
+
isWritable: false
|
|
1217
|
+
},
|
|
1218
|
+
mint: {
|
|
1219
|
+
value: input.mint ?? null,
|
|
1220
|
+
isWritable: false
|
|
1221
|
+
},
|
|
1222
|
+
source: {
|
|
1223
|
+
value: input.source ?? null,
|
|
1224
|
+
isWritable: true
|
|
1225
|
+
},
|
|
1226
|
+
vault: {
|
|
1227
|
+
value: input.vault ?? null,
|
|
1228
|
+
isWritable: true
|
|
1229
|
+
},
|
|
1230
|
+
tokenProgram: {
|
|
1231
|
+
value: input.tokenProgram ?? null,
|
|
1232
|
+
isWritable: false
|
|
1233
|
+
}
|
|
1234
|
+
};
|
|
1235
|
+
const args = { ...input };
|
|
1236
|
+
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
1237
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1238
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1239
|
+
return Object.freeze({
|
|
1240
|
+
accounts: [
|
|
1241
|
+
getAccountMeta("funder", accounts.funder),
|
|
1242
|
+
getAccountMeta("pool", accounts.pool),
|
|
1243
|
+
getAccountMeta("mint", accounts.mint),
|
|
1244
|
+
getAccountMeta("source", accounts.source),
|
|
1245
|
+
getAccountMeta("vault", accounts.vault),
|
|
1246
|
+
getAccountMeta("tokenProgram", accounts.tokenProgram)
|
|
1247
|
+
],
|
|
1248
|
+
data: getFundPrizesInstructionDataEncoder().encode(args),
|
|
1249
|
+
programAddress
|
|
1250
|
+
});
|
|
1251
|
+
}
|
|
1908
1252
|
function getFundPrizesInstruction(input, config) {
|
|
1909
1253
|
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
1910
1254
|
const accounts = {
|
|
@@ -1998,9 +1342,10 @@ function getInitializePoolDiscriminatorBytes() {
|
|
|
1998
1342
|
function getInitializePoolInstructionDataEncoder() {
|
|
1999
1343
|
return transformEncoder(getStructEncoder([
|
|
2000
1344
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
2001
|
-
["feeBps", getU16Encoder()],
|
|
2002
1345
|
["tiers", getArrayEncoder(getTierEncoder(), { size: 8 })],
|
|
2003
|
-
["
|
|
1346
|
+
["maxSeedQuoteIn", getU64Encoder()],
|
|
1347
|
+
["maxSeedNativeDebit", getU64Encoder()],
|
|
1348
|
+
["extraSeedTokens", getU64Encoder()]
|
|
2004
1349
|
]), (value) => ({
|
|
2005
1350
|
...value,
|
|
2006
1351
|
discriminator: INITIALIZE_POOL_DISCRIMINATOR
|
|
@@ -2009,9 +1354,10 @@ function getInitializePoolInstructionDataEncoder() {
|
|
|
2009
1354
|
function getInitializePoolInstructionDataDecoder() {
|
|
2010
1355
|
return getStructDecoder([
|
|
2011
1356
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
2012
|
-
["feeBps", getU16Decoder()],
|
|
2013
1357
|
["tiers", getArrayDecoder(getTierDecoder(), { size: 8 })],
|
|
2014
|
-
["
|
|
1358
|
+
["maxSeedQuoteIn", getU64Decoder()],
|
|
1359
|
+
["maxSeedNativeDebit", getU64Decoder()],
|
|
1360
|
+
["extraSeedTokens", getU64Decoder()]
|
|
2015
1361
|
]);
|
|
2016
1362
|
}
|
|
2017
1363
|
function getInitializePoolInstructionDataCodec() {
|
|
@@ -2032,6 +1378,14 @@ async function getInitializePoolInstructionAsync(input, config) {
|
|
|
2032
1378
|
value: input.mint ?? null,
|
|
2033
1379
|
isWritable: false
|
|
2034
1380
|
},
|
|
1381
|
+
quoteMint: {
|
|
1382
|
+
value: input.quoteMint ?? null,
|
|
1383
|
+
isWritable: false
|
|
1384
|
+
},
|
|
1385
|
+
quoteConfig: {
|
|
1386
|
+
value: input.quoteConfig ?? null,
|
|
1387
|
+
isWritable: false
|
|
1388
|
+
},
|
|
2035
1389
|
creatorTokens: {
|
|
2036
1390
|
value: input.creatorTokens ?? null,
|
|
2037
1391
|
isWritable: true
|
|
@@ -2052,6 +1406,10 @@ async function getInitializePoolInstructionAsync(input, config) {
|
|
|
2052
1406
|
value: input.tokenProgram ?? null,
|
|
2053
1407
|
isWritable: false
|
|
2054
1408
|
},
|
|
1409
|
+
quoteTokenProgram: {
|
|
1410
|
+
value: input.quoteTokenProgram ?? null,
|
|
1411
|
+
isWritable: false
|
|
1412
|
+
},
|
|
2055
1413
|
associatedTokenProgram: {
|
|
2056
1414
|
value: input.associatedTokenProgram ?? null,
|
|
2057
1415
|
isWritable: false
|
|
@@ -2063,12 +1421,44 @@ async function getInitializePoolInstructionAsync(input, config) {
|
|
|
2063
1421
|
};
|
|
2064
1422
|
const args = { ...input };
|
|
2065
1423
|
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
2066
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2067
1424
|
if (!accounts.creatorTokens.value) accounts.creatorTokens.value = await getProgramDerivedAddress({
|
|
2068
1425
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2069
1426
|
seeds: [
|
|
2070
1427
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("creator", accounts.creator.value)),
|
|
2071
|
-
|
|
1428
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
1429
|
+
6,
|
|
1430
|
+
221,
|
|
1431
|
+
246,
|
|
1432
|
+
225,
|
|
1433
|
+
215,
|
|
1434
|
+
101,
|
|
1435
|
+
161,
|
|
1436
|
+
147,
|
|
1437
|
+
217,
|
|
1438
|
+
203,
|
|
1439
|
+
225,
|
|
1440
|
+
70,
|
|
1441
|
+
206,
|
|
1442
|
+
235,
|
|
1443
|
+
121,
|
|
1444
|
+
172,
|
|
1445
|
+
28,
|
|
1446
|
+
180,
|
|
1447
|
+
133,
|
|
1448
|
+
237,
|
|
1449
|
+
95,
|
|
1450
|
+
91,
|
|
1451
|
+
55,
|
|
1452
|
+
145,
|
|
1453
|
+
58,
|
|
1454
|
+
140,
|
|
1455
|
+
245,
|
|
1456
|
+
133,
|
|
1457
|
+
126,
|
|
1458
|
+
255,
|
|
1459
|
+
0,
|
|
1460
|
+
169
|
|
1461
|
+
])),
|
|
2072
1462
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
2073
1463
|
]
|
|
2074
1464
|
});
|
|
@@ -2076,12 +1466,45 @@ async function getInitializePoolInstructionAsync(input, config) {
|
|
|
2076
1466
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2077
1467
|
seeds: [
|
|
2078
1468
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("pool", accounts.pool.value)),
|
|
2079
|
-
|
|
1469
|
+
getBytesEncoder().encode(new Uint8Array([
|
|
1470
|
+
6,
|
|
1471
|
+
221,
|
|
1472
|
+
246,
|
|
1473
|
+
225,
|
|
1474
|
+
215,
|
|
1475
|
+
101,
|
|
1476
|
+
161,
|
|
1477
|
+
147,
|
|
1478
|
+
217,
|
|
1479
|
+
203,
|
|
1480
|
+
225,
|
|
1481
|
+
70,
|
|
1482
|
+
206,
|
|
1483
|
+
235,
|
|
1484
|
+
121,
|
|
1485
|
+
172,
|
|
1486
|
+
28,
|
|
1487
|
+
180,
|
|
1488
|
+
133,
|
|
1489
|
+
237,
|
|
1490
|
+
95,
|
|
1491
|
+
91,
|
|
1492
|
+
55,
|
|
1493
|
+
145,
|
|
1494
|
+
58,
|
|
1495
|
+
140,
|
|
1496
|
+
245,
|
|
1497
|
+
133,
|
|
1498
|
+
126,
|
|
1499
|
+
255,
|
|
1500
|
+
0,
|
|
1501
|
+
169
|
|
1502
|
+
])),
|
|
2080
1503
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
2081
1504
|
]
|
|
2082
1505
|
});
|
|
2083
|
-
if (!accounts.venue.value) accounts.venue.value = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
|
|
2084
1506
|
if (!accounts.instructions.value) accounts.instructions.value = "Sysvar1nstructions1111111111111111111111111";
|
|
1507
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2085
1508
|
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2086
1509
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2087
1510
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
@@ -2090,11 +1513,14 @@ async function getInitializePoolInstructionAsync(input, config) {
|
|
|
2090
1513
|
getAccountMeta("creator", accounts.creator),
|
|
2091
1514
|
getAccountMeta("pool", accounts.pool),
|
|
2092
1515
|
getAccountMeta("mint", accounts.mint),
|
|
1516
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
1517
|
+
getAccountMeta("quoteConfig", accounts.quoteConfig),
|
|
2093
1518
|
getAccountMeta("creatorTokens", accounts.creatorTokens),
|
|
2094
1519
|
getAccountMeta("vault", accounts.vault),
|
|
2095
1520
|
getAccountMeta("venue", accounts.venue),
|
|
2096
1521
|
getAccountMeta("instructions", accounts.instructions),
|
|
2097
1522
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1523
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2098
1524
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
2099
1525
|
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2100
1526
|
],
|
|
@@ -2117,6 +1543,14 @@ function getInitializePoolInstruction(input, config) {
|
|
|
2117
1543
|
value: input.mint ?? null,
|
|
2118
1544
|
isWritable: false
|
|
2119
1545
|
},
|
|
1546
|
+
quoteMint: {
|
|
1547
|
+
value: input.quoteMint ?? null,
|
|
1548
|
+
isWritable: false
|
|
1549
|
+
},
|
|
1550
|
+
quoteConfig: {
|
|
1551
|
+
value: input.quoteConfig ?? null,
|
|
1552
|
+
isWritable: false
|
|
1553
|
+
},
|
|
2120
1554
|
creatorTokens: {
|
|
2121
1555
|
value: input.creatorTokens ?? null,
|
|
2122
1556
|
isWritable: true
|
|
@@ -2137,6 +1571,10 @@ function getInitializePoolInstruction(input, config) {
|
|
|
2137
1571
|
value: input.tokenProgram ?? null,
|
|
2138
1572
|
isWritable: false
|
|
2139
1573
|
},
|
|
1574
|
+
quoteTokenProgram: {
|
|
1575
|
+
value: input.quoteTokenProgram ?? null,
|
|
1576
|
+
isWritable: false
|
|
1577
|
+
},
|
|
2140
1578
|
associatedTokenProgram: {
|
|
2141
1579
|
value: input.associatedTokenProgram ?? null,
|
|
2142
1580
|
isWritable: false
|
|
@@ -2147,9 +1585,8 @@ function getInitializePoolInstruction(input, config) {
|
|
|
2147
1585
|
}
|
|
2148
1586
|
};
|
|
2149
1587
|
const args = { ...input };
|
|
2150
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2151
|
-
if (!accounts.venue.value) accounts.venue.value = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
|
|
2152
1588
|
if (!accounts.instructions.value) accounts.instructions.value = "Sysvar1nstructions1111111111111111111111111";
|
|
1589
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2153
1590
|
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2154
1591
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2155
1592
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
@@ -2158,11 +1595,14 @@ function getInitializePoolInstruction(input, config) {
|
|
|
2158
1595
|
getAccountMeta("creator", accounts.creator),
|
|
2159
1596
|
getAccountMeta("pool", accounts.pool),
|
|
2160
1597
|
getAccountMeta("mint", accounts.mint),
|
|
1598
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
1599
|
+
getAccountMeta("quoteConfig", accounts.quoteConfig),
|
|
2161
1600
|
getAccountMeta("creatorTokens", accounts.creatorTokens),
|
|
2162
1601
|
getAccountMeta("vault", accounts.vault),
|
|
2163
1602
|
getAccountMeta("venue", accounts.venue),
|
|
2164
1603
|
getAccountMeta("instructions", accounts.instructions),
|
|
2165
1604
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
1605
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2166
1606
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
2167
1607
|
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2168
1608
|
],
|
|
@@ -2171,9 +1611,9 @@ function getInitializePoolInstruction(input, config) {
|
|
|
2171
1611
|
});
|
|
2172
1612
|
}
|
|
2173
1613
|
function parseInitializePoolInstruction(instruction) {
|
|
2174
|
-
if (instruction.accounts.length <
|
|
1614
|
+
if (instruction.accounts.length < 13) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2175
1615
|
actualAccountMetas: instruction.accounts.length,
|
|
2176
|
-
expectedAccountMetas:
|
|
1616
|
+
expectedAccountMetas: 13
|
|
2177
1617
|
});
|
|
2178
1618
|
let accountIndex = 0;
|
|
2179
1619
|
const getNextAccount = () => {
|
|
@@ -2187,11 +1627,14 @@ function parseInitializePoolInstruction(instruction) {
|
|
|
2187
1627
|
creator: getNextAccount(),
|
|
2188
1628
|
pool: getNextAccount(),
|
|
2189
1629
|
mint: getNextAccount(),
|
|
1630
|
+
quoteMint: getNextAccount(),
|
|
1631
|
+
quoteConfig: getNextAccount(),
|
|
2190
1632
|
creatorTokens: getNextAccount(),
|
|
2191
1633
|
vault: getNextAccount(),
|
|
2192
1634
|
venue: getNextAccount(),
|
|
2193
1635
|
instructions: getNextAccount(),
|
|
2194
1636
|
tokenProgram: getNextAccount(),
|
|
1637
|
+
quoteTokenProgram: getNextAccount(),
|
|
2195
1638
|
associatedTokenProgram: getNextAccount(),
|
|
2196
1639
|
systemProgram: getNextAccount()
|
|
2197
1640
|
},
|
|
@@ -2274,359 +1717,83 @@ async function getRetryDrawInstructionAsync(input, config) {
|
|
|
2274
1717
|
if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
2275
1718
|
if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
|
|
2276
1719
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2277
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2278
|
-
return Object.freeze({
|
|
2279
|
-
accounts: [
|
|
2280
|
-
getAccountMeta("payer", accounts.payer),
|
|
2281
|
-
getAccountMeta("pool", accounts.pool),
|
|
2282
|
-
getAccountMeta("draw", accounts.draw),
|
|
2283
|
-
getAccountMeta("identity", accounts.identity),
|
|
2284
|
-
getAccountMeta("queue", accounts.queue),
|
|
2285
|
-
getAccountMeta("program", accounts.program),
|
|
2286
|
-
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
2287
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2288
|
-
],
|
|
2289
|
-
data: getRetryDrawInstructionDataEncoder().encode(args),
|
|
2290
|
-
programAddress
|
|
2291
|
-
});
|
|
2292
|
-
}
|
|
2293
|
-
function getRetryDrawInstruction(input, config) {
|
|
2294
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
2295
|
-
const accounts = {
|
|
2296
|
-
payer: {
|
|
2297
|
-
value: input.payer ?? null,
|
|
2298
|
-
isWritable: true
|
|
2299
|
-
},
|
|
2300
|
-
pool: {
|
|
2301
|
-
value: input.pool ?? null,
|
|
2302
|
-
isWritable: false
|
|
2303
|
-
},
|
|
2304
|
-
draw: {
|
|
2305
|
-
value: input.draw ?? null,
|
|
2306
|
-
isWritable: true
|
|
2307
|
-
},
|
|
2308
|
-
identity: {
|
|
2309
|
-
value: input.identity ?? null,
|
|
2310
|
-
isWritable: false
|
|
2311
|
-
},
|
|
2312
|
-
queue: {
|
|
2313
|
-
value: input.queue ?? null,
|
|
2314
|
-
isWritable: true
|
|
2315
|
-
},
|
|
2316
|
-
program: {
|
|
2317
|
-
value: input.program ?? null,
|
|
2318
|
-
isWritable: false
|
|
2319
|
-
},
|
|
2320
|
-
slotHashes: {
|
|
2321
|
-
value: input.slotHashes ?? null,
|
|
2322
|
-
isWritable: false
|
|
2323
|
-
},
|
|
2324
|
-
systemProgram: {
|
|
2325
|
-
value: input.systemProgram ?? null,
|
|
2326
|
-
isWritable: false
|
|
2327
|
-
}
|
|
2328
|
-
};
|
|
2329
|
-
const args = { ...input };
|
|
2330
|
-
if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
|
|
2331
|
-
if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
2332
|
-
if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
|
|
2333
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2334
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2335
|
-
return Object.freeze({
|
|
2336
|
-
accounts: [
|
|
2337
|
-
getAccountMeta("payer", accounts.payer),
|
|
2338
|
-
getAccountMeta("pool", accounts.pool),
|
|
2339
|
-
getAccountMeta("draw", accounts.draw),
|
|
2340
|
-
getAccountMeta("identity", accounts.identity),
|
|
2341
|
-
getAccountMeta("queue", accounts.queue),
|
|
2342
|
-
getAccountMeta("program", accounts.program),
|
|
2343
|
-
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
2344
|
-
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2345
|
-
],
|
|
2346
|
-
data: getRetryDrawInstructionDataEncoder().encode(args),
|
|
2347
|
-
programAddress
|
|
2348
|
-
});
|
|
2349
|
-
}
|
|
2350
|
-
function parseRetryDrawInstruction(instruction) {
|
|
2351
|
-
if (instruction.accounts.length < 8) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2352
|
-
actualAccountMetas: instruction.accounts.length,
|
|
2353
|
-
expectedAccountMetas: 8
|
|
2354
|
-
});
|
|
2355
|
-
let accountIndex = 0;
|
|
2356
|
-
const getNextAccount = () => {
|
|
2357
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2358
|
-
accountIndex += 1;
|
|
2359
|
-
return accountMeta;
|
|
2360
|
-
};
|
|
2361
|
-
return {
|
|
2362
|
-
programAddress: instruction.programAddress,
|
|
2363
|
-
accounts: {
|
|
2364
|
-
payer: getNextAccount(),
|
|
2365
|
-
pool: getNextAccount(),
|
|
2366
|
-
draw: getNextAccount(),
|
|
2367
|
-
identity: getNextAccount(),
|
|
2368
|
-
queue: getNextAccount(),
|
|
2369
|
-
program: getNextAccount(),
|
|
2370
|
-
slotHashes: getNextAccount(),
|
|
2371
|
-
systemProgram: getNextAccount()
|
|
2372
|
-
},
|
|
2373
|
-
data: getRetryDrawInstructionDataDecoder().decode(instruction.data)
|
|
2374
|
-
};
|
|
2375
|
-
}
|
|
2376
|
-
//#endregion
|
|
2377
|
-
//#region src/generated/instructions/sellPrize.ts
|
|
2378
|
-
/**
|
|
2379
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
2380
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
2381
|
-
* to add features, then rerun Codama to update it.
|
|
2382
|
-
*
|
|
2383
|
-
* @see https://github.com/codama-idl/codama
|
|
2384
|
-
*/
|
|
2385
|
-
const SELL_PRIZE_DISCRIMINATOR = new Uint8Array([
|
|
2386
|
-
235,
|
|
2387
|
-
236,
|
|
2388
|
-
8,
|
|
2389
|
-
137,
|
|
2390
|
-
79,
|
|
2391
|
-
25,
|
|
2392
|
-
208,
|
|
2393
|
-
235
|
|
2394
|
-
]);
|
|
2395
|
-
function getSellPrizeDiscriminatorBytes() {
|
|
2396
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(SELL_PRIZE_DISCRIMINATOR);
|
|
2397
|
-
}
|
|
2398
|
-
function getSellPrizeInstructionDataEncoder() {
|
|
2399
|
-
return transformEncoder(getStructEncoder([["discriminator", fixEncoderSize(getBytesEncoder(), 8)], ["minQuoteOutput", getU64Encoder()]]), (value) => ({
|
|
2400
|
-
...value,
|
|
2401
|
-
discriminator: SELL_PRIZE_DISCRIMINATOR
|
|
2402
|
-
}));
|
|
2403
|
-
}
|
|
2404
|
-
function getSellPrizeInstructionDataDecoder() {
|
|
2405
|
-
return getStructDecoder([["discriminator", fixDecoderSize(getBytesDecoder(), 8)], ["minQuoteOutput", getU64Decoder()]]);
|
|
2406
|
-
}
|
|
2407
|
-
function getSellPrizeInstructionDataCodec() {
|
|
2408
|
-
return combineCodec(getSellPrizeInstructionDataEncoder(), getSellPrizeInstructionDataDecoder());
|
|
2409
|
-
}
|
|
2410
|
-
async function getSellPrizeInstructionAsync(input, config) {
|
|
2411
|
-
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
2412
|
-
const accounts = {
|
|
2413
|
-
purchaser: {
|
|
2414
|
-
value: input.purchaser ?? null,
|
|
2415
|
-
isWritable: true
|
|
2416
|
-
},
|
|
2417
|
-
pool: {
|
|
2418
|
-
value: input.pool ?? null,
|
|
2419
|
-
isWritable: true
|
|
2420
|
-
},
|
|
2421
|
-
draw: {
|
|
2422
|
-
value: input.draw ?? null,
|
|
2423
|
-
isWritable: true
|
|
2424
|
-
},
|
|
2425
|
-
mint: {
|
|
2426
|
-
value: input.mint ?? null,
|
|
2427
|
-
isWritable: false
|
|
2428
|
-
},
|
|
2429
|
-
vault: {
|
|
2430
|
-
value: input.vault ?? null,
|
|
2431
|
-
isWritable: true
|
|
2432
|
-
},
|
|
2433
|
-
userTokens: {
|
|
2434
|
-
value: input.userTokens ?? null,
|
|
2435
|
-
isWritable: true
|
|
2436
|
-
},
|
|
2437
|
-
tokenProgram: {
|
|
2438
|
-
value: input.tokenProgram ?? null,
|
|
2439
|
-
isWritable: false
|
|
2440
|
-
},
|
|
2441
|
-
associatedTokenProgram: {
|
|
2442
|
-
value: input.associatedTokenProgram ?? null,
|
|
2443
|
-
isWritable: false
|
|
2444
|
-
},
|
|
2445
|
-
systemProgram: {
|
|
2446
|
-
value: input.systemProgram ?? null,
|
|
2447
|
-
isWritable: false
|
|
2448
|
-
},
|
|
2449
|
-
venue: {
|
|
2450
|
-
value: input.venue ?? null,
|
|
2451
|
-
isWritable: false
|
|
2452
|
-
},
|
|
2453
|
-
feeCollector: {
|
|
2454
|
-
value: input.feeCollector ?? null,
|
|
2455
|
-
isWritable: true
|
|
2456
|
-
},
|
|
2457
|
-
feeCollectorWsol: {
|
|
2458
|
-
value: input.feeCollectorWsol ?? null,
|
|
2459
|
-
isWritable: true
|
|
2460
|
-
},
|
|
2461
|
-
quoteTokenProgram: {
|
|
2462
|
-
value: input.quoteTokenProgram ?? null,
|
|
2463
|
-
isWritable: false
|
|
2464
|
-
}
|
|
2465
|
-
};
|
|
2466
|
-
const args = { ...input };
|
|
2467
|
-
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
2468
|
-
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2469
|
-
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
2470
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2471
|
-
seeds: [
|
|
2472
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("purchaser", accounts.purchaser.value)),
|
|
2473
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("tokenProgram", accounts.tokenProgram.value)),
|
|
2474
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
2475
|
-
]
|
|
2476
|
-
});
|
|
2477
|
-
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2478
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2479
|
-
if (!accounts.feeCollector.value) accounts.feeCollector.value = "5WcPTEQ59UqpQzjZUPbU8QRGCbj7NeQNLDa7DbsLkLKT";
|
|
2480
|
-
if (!accounts.quoteTokenProgram.value) accounts.quoteTokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2481
|
-
if (!accounts.feeCollectorWsol.value) accounts.feeCollectorWsol.value = await getProgramDerivedAddress({
|
|
2482
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2483
|
-
seeds: [
|
|
2484
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("feeCollector", accounts.feeCollector.value)),
|
|
2485
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("quoteTokenProgram", accounts.quoteTokenProgram.value)),
|
|
2486
|
-
getBytesEncoder().encode(new Uint8Array([
|
|
2487
|
-
6,
|
|
2488
|
-
155,
|
|
2489
|
-
136,
|
|
2490
|
-
87,
|
|
2491
|
-
254,
|
|
2492
|
-
171,
|
|
2493
|
-
129,
|
|
2494
|
-
132,
|
|
2495
|
-
251,
|
|
2496
|
-
104,
|
|
2497
|
-
127,
|
|
2498
|
-
99,
|
|
2499
|
-
70,
|
|
2500
|
-
24,
|
|
2501
|
-
192,
|
|
2502
|
-
53,
|
|
2503
|
-
218,
|
|
2504
|
-
196,
|
|
2505
|
-
57,
|
|
2506
|
-
220,
|
|
2507
|
-
26,
|
|
2508
|
-
235,
|
|
2509
|
-
59,
|
|
2510
|
-
85,
|
|
2511
|
-
152,
|
|
2512
|
-
160,
|
|
2513
|
-
240,
|
|
2514
|
-
0,
|
|
2515
|
-
0,
|
|
2516
|
-
0,
|
|
2517
|
-
0,
|
|
2518
|
-
1
|
|
2519
|
-
]))
|
|
2520
|
-
]
|
|
2521
|
-
});
|
|
2522
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2523
|
-
return Object.freeze({
|
|
2524
|
-
accounts: [
|
|
2525
|
-
getAccountMeta("purchaser", accounts.purchaser),
|
|
2526
|
-
getAccountMeta("pool", accounts.pool),
|
|
2527
|
-
getAccountMeta("draw", accounts.draw),
|
|
2528
|
-
getAccountMeta("mint", accounts.mint),
|
|
2529
|
-
getAccountMeta("vault", accounts.vault),
|
|
2530
|
-
getAccountMeta("userTokens", accounts.userTokens),
|
|
2531
|
-
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
2532
|
-
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
2533
|
-
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2534
|
-
getAccountMeta("venue", accounts.venue),
|
|
2535
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
2536
|
-
getAccountMeta("feeCollectorWsol", accounts.feeCollectorWsol),
|
|
2537
|
-
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
1720
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1721
|
+
return Object.freeze({
|
|
1722
|
+
accounts: [
|
|
1723
|
+
getAccountMeta("payer", accounts.payer),
|
|
1724
|
+
getAccountMeta("pool", accounts.pool),
|
|
1725
|
+
getAccountMeta("draw", accounts.draw),
|
|
1726
|
+
getAccountMeta("identity", accounts.identity),
|
|
1727
|
+
getAccountMeta("queue", accounts.queue),
|
|
1728
|
+
getAccountMeta("program", accounts.program),
|
|
1729
|
+
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
1730
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2538
1731
|
],
|
|
2539
|
-
data:
|
|
1732
|
+
data: getRetryDrawInstructionDataEncoder().encode(args),
|
|
2540
1733
|
programAddress
|
|
2541
1734
|
});
|
|
2542
1735
|
}
|
|
2543
|
-
function
|
|
1736
|
+
function getRetryDrawInstruction(input, config) {
|
|
2544
1737
|
const programAddress = config?.programAddress ?? "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
2545
1738
|
const accounts = {
|
|
2546
|
-
|
|
2547
|
-
value: input.
|
|
1739
|
+
payer: {
|
|
1740
|
+
value: input.payer ?? null,
|
|
2548
1741
|
isWritable: true
|
|
2549
1742
|
},
|
|
2550
1743
|
pool: {
|
|
2551
1744
|
value: input.pool ?? null,
|
|
2552
|
-
isWritable:
|
|
1745
|
+
isWritable: false
|
|
2553
1746
|
},
|
|
2554
1747
|
draw: {
|
|
2555
1748
|
value: input.draw ?? null,
|
|
2556
1749
|
isWritable: true
|
|
2557
1750
|
},
|
|
2558
|
-
|
|
2559
|
-
value: input.
|
|
1751
|
+
identity: {
|
|
1752
|
+
value: input.identity ?? null,
|
|
2560
1753
|
isWritable: false
|
|
2561
1754
|
},
|
|
2562
|
-
|
|
2563
|
-
value: input.
|
|
2564
|
-
isWritable: true
|
|
2565
|
-
},
|
|
2566
|
-
userTokens: {
|
|
2567
|
-
value: input.userTokens ?? null,
|
|
1755
|
+
queue: {
|
|
1756
|
+
value: input.queue ?? null,
|
|
2568
1757
|
isWritable: true
|
|
2569
1758
|
},
|
|
2570
|
-
|
|
2571
|
-
value: input.
|
|
1759
|
+
program: {
|
|
1760
|
+
value: input.program ?? null,
|
|
2572
1761
|
isWritable: false
|
|
2573
1762
|
},
|
|
2574
|
-
|
|
2575
|
-
value: input.
|
|
1763
|
+
slotHashes: {
|
|
1764
|
+
value: input.slotHashes ?? null,
|
|
2576
1765
|
isWritable: false
|
|
2577
1766
|
},
|
|
2578
1767
|
systemProgram: {
|
|
2579
1768
|
value: input.systemProgram ?? null,
|
|
2580
1769
|
isWritable: false
|
|
2581
|
-
},
|
|
2582
|
-
venue: {
|
|
2583
|
-
value: input.venue ?? null,
|
|
2584
|
-
isWritable: false
|
|
2585
|
-
},
|
|
2586
|
-
feeCollector: {
|
|
2587
|
-
value: input.feeCollector ?? null,
|
|
2588
|
-
isWritable: true
|
|
2589
|
-
},
|
|
2590
|
-
feeCollectorWsol: {
|
|
2591
|
-
value: input.feeCollectorWsol ?? null,
|
|
2592
|
-
isWritable: true
|
|
2593
|
-
},
|
|
2594
|
-
quoteTokenProgram: {
|
|
2595
|
-
value: input.quoteTokenProgram ?? null,
|
|
2596
|
-
isWritable: false
|
|
2597
1770
|
}
|
|
2598
1771
|
};
|
|
2599
1772
|
const args = { ...input };
|
|
2600
|
-
if (!accounts.
|
|
2601
|
-
if (!accounts.
|
|
1773
|
+
if (!accounts.queue.value) accounts.queue.value = "Cuj97ggrhhidhbu39TijNVqE74xvKJ69gDervRUXAxGh";
|
|
1774
|
+
if (!accounts.program.value) accounts.program.value = "Vrf1RNUjXmQGjmQrQLvJHs9SNkvDJEsRVFPkfSQUwGz";
|
|
1775
|
+
if (!accounts.slotHashes.value) accounts.slotHashes.value = "SysvarS1otHashes111111111111111111111111111";
|
|
2602
1776
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2603
|
-
if (!accounts.feeCollector.value) accounts.feeCollector.value = "5WcPTEQ59UqpQzjZUPbU8QRGCbj7NeQNLDa7DbsLkLKT";
|
|
2604
|
-
if (!accounts.quoteTokenProgram.value) accounts.quoteTokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2605
1777
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2606
1778
|
return Object.freeze({
|
|
2607
1779
|
accounts: [
|
|
2608
|
-
getAccountMeta("
|
|
1780
|
+
getAccountMeta("payer", accounts.payer),
|
|
2609
1781
|
getAccountMeta("pool", accounts.pool),
|
|
2610
1782
|
getAccountMeta("draw", accounts.draw),
|
|
2611
|
-
getAccountMeta("
|
|
2612
|
-
getAccountMeta("
|
|
2613
|
-
getAccountMeta("
|
|
2614
|
-
getAccountMeta("
|
|
2615
|
-
getAccountMeta("
|
|
2616
|
-
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
2617
|
-
getAccountMeta("venue", accounts.venue),
|
|
2618
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
2619
|
-
getAccountMeta("feeCollectorWsol", accounts.feeCollectorWsol),
|
|
2620
|
-
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
1783
|
+
getAccountMeta("identity", accounts.identity),
|
|
1784
|
+
getAccountMeta("queue", accounts.queue),
|
|
1785
|
+
getAccountMeta("program", accounts.program),
|
|
1786
|
+
getAccountMeta("slotHashes", accounts.slotHashes),
|
|
1787
|
+
getAccountMeta("systemProgram", accounts.systemProgram)
|
|
2621
1788
|
],
|
|
2622
|
-
data:
|
|
1789
|
+
data: getRetryDrawInstructionDataEncoder().encode(args),
|
|
2623
1790
|
programAddress
|
|
2624
1791
|
});
|
|
2625
1792
|
}
|
|
2626
|
-
function
|
|
2627
|
-
if (instruction.accounts.length <
|
|
1793
|
+
function parseRetryDrawInstruction(instruction) {
|
|
1794
|
+
if (instruction.accounts.length < 8) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2628
1795
|
actualAccountMetas: instruction.accounts.length,
|
|
2629
|
-
expectedAccountMetas:
|
|
1796
|
+
expectedAccountMetas: 8
|
|
2630
1797
|
});
|
|
2631
1798
|
let accountIndex = 0;
|
|
2632
1799
|
const getNextAccount = () => {
|
|
@@ -2637,21 +1804,16 @@ function parseSellPrizeInstruction(instruction) {
|
|
|
2637
1804
|
return {
|
|
2638
1805
|
programAddress: instruction.programAddress,
|
|
2639
1806
|
accounts: {
|
|
2640
|
-
|
|
1807
|
+
payer: getNextAccount(),
|
|
2641
1808
|
pool: getNextAccount(),
|
|
2642
1809
|
draw: getNextAccount(),
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
systemProgram: getNextAccount(),
|
|
2649
|
-
venue: getNextAccount(),
|
|
2650
|
-
feeCollector: getNextAccount(),
|
|
2651
|
-
feeCollectorWsol: getNextAccount(),
|
|
2652
|
-
quoteTokenProgram: getNextAccount()
|
|
1810
|
+
identity: getNextAccount(),
|
|
1811
|
+
queue: getNextAccount(),
|
|
1812
|
+
program: getNextAccount(),
|
|
1813
|
+
slotHashes: getNextAccount(),
|
|
1814
|
+
systemProgram: getNextAccount()
|
|
2653
1815
|
},
|
|
2654
|
-
data:
|
|
1816
|
+
data: getRetryDrawInstructionDataDecoder().decode(instruction.data)
|
|
2655
1817
|
};
|
|
2656
1818
|
}
|
|
2657
1819
|
//#endregion
|
|
@@ -2680,7 +1842,8 @@ function getSellTokensInstructionDataEncoder() {
|
|
|
2680
1842
|
return transformEncoder(getStructEncoder([
|
|
2681
1843
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
2682
1844
|
["amount", getU64Encoder()],
|
|
2683
|
-
["minQuoteOutput", getU64Encoder()]
|
|
1845
|
+
["minQuoteOutput", getU64Encoder()],
|
|
1846
|
+
["maxNativeDebit", getU64Encoder()]
|
|
2684
1847
|
]), (value) => ({
|
|
2685
1848
|
...value,
|
|
2686
1849
|
discriminator: SELL_TOKENS_DISCRIMINATOR
|
|
@@ -2690,7 +1853,8 @@ function getSellTokensInstructionDataDecoder() {
|
|
|
2690
1853
|
return getStructDecoder([
|
|
2691
1854
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
2692
1855
|
["amount", getU64Decoder()],
|
|
2693
|
-
["minQuoteOutput", getU64Decoder()]
|
|
1856
|
+
["minQuoteOutput", getU64Decoder()],
|
|
1857
|
+
["maxNativeDebit", getU64Decoder()]
|
|
2694
1858
|
]);
|
|
2695
1859
|
}
|
|
2696
1860
|
function getSellTokensInstructionDataCodec() {
|
|
@@ -2711,6 +1875,10 @@ async function getSellTokensInstructionAsync(input, config) {
|
|
|
2711
1875
|
value: input.mint ?? null,
|
|
2712
1876
|
isWritable: false
|
|
2713
1877
|
},
|
|
1878
|
+
quoteMint: {
|
|
1879
|
+
value: input.quoteMint ?? null,
|
|
1880
|
+
isWritable: false
|
|
1881
|
+
},
|
|
2714
1882
|
userTokens: {
|
|
2715
1883
|
value: input.userTokens ?? null,
|
|
2716
1884
|
isWritable: true
|
|
@@ -2719,94 +1887,70 @@ async function getSellTokensInstructionAsync(input, config) {
|
|
|
2719
1887
|
value: input.venue ?? null,
|
|
2720
1888
|
isWritable: false
|
|
2721
1889
|
},
|
|
2722
|
-
feeCollector: {
|
|
2723
|
-
value: input.feeCollector ?? null,
|
|
2724
|
-
isWritable: true
|
|
2725
|
-
},
|
|
2726
|
-
feeCollectorWsol: {
|
|
2727
|
-
value: input.feeCollectorWsol ?? null,
|
|
2728
|
-
isWritable: true
|
|
2729
|
-
},
|
|
2730
|
-
quoteTokenProgram: {
|
|
2731
|
-
value: input.quoteTokenProgram ?? null,
|
|
2732
|
-
isWritable: false
|
|
2733
|
-
},
|
|
2734
1890
|
tokenProgram: {
|
|
2735
1891
|
value: input.tokenProgram ?? null,
|
|
2736
1892
|
isWritable: false
|
|
2737
1893
|
},
|
|
2738
|
-
|
|
2739
|
-
value: input.
|
|
1894
|
+
quoteTokenProgram: {
|
|
1895
|
+
value: input.quoteTokenProgram ?? null,
|
|
2740
1896
|
isWritable: false
|
|
2741
1897
|
}
|
|
2742
1898
|
};
|
|
2743
1899
|
const args = { ...input };
|
|
2744
|
-
if (!accounts.
|
|
1900
|
+
if (!accounts.pool.value) accounts.pool.value = await findPoolPda({ mint: getAddressFromResolvedInstructionAccount("mint", accounts.mint.value) }, { programAddress });
|
|
2745
1901
|
if (!accounts.userTokens.value) accounts.userTokens.value = await getProgramDerivedAddress({
|
|
2746
1902
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2747
1903
|
seeds: [
|
|
2748
1904
|
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("seller", accounts.seller.value)),
|
|
2749
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("tokenProgram", accounts.tokenProgram.value)),
|
|
2750
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
2751
|
-
]
|
|
2752
|
-
});
|
|
2753
|
-
if (!accounts.feeCollector.value) accounts.feeCollector.value = "5WcPTEQ59UqpQzjZUPbU8QRGCbj7NeQNLDa7DbsLkLKT";
|
|
2754
|
-
if (!accounts.quoteTokenProgram.value) accounts.quoteTokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2755
|
-
if (!accounts.feeCollectorWsol.value) accounts.feeCollectorWsol.value = await getProgramDerivedAddress({
|
|
2756
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2757
|
-
seeds: [
|
|
2758
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("feeCollector", accounts.feeCollector.value)),
|
|
2759
|
-
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("quoteTokenProgram", accounts.quoteTokenProgram.value)),
|
|
2760
1905
|
getBytesEncoder().encode(new Uint8Array([
|
|
2761
1906
|
6,
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
|
|
2772
|
-
99,
|
|
1907
|
+
221,
|
|
1908
|
+
246,
|
|
1909
|
+
225,
|
|
1910
|
+
215,
|
|
1911
|
+
101,
|
|
1912
|
+
161,
|
|
1913
|
+
147,
|
|
1914
|
+
217,
|
|
1915
|
+
203,
|
|
1916
|
+
225,
|
|
2773
1917
|
70,
|
|
2774
|
-
|
|
2775
|
-
192,
|
|
2776
|
-
53,
|
|
2777
|
-
218,
|
|
2778
|
-
196,
|
|
2779
|
-
57,
|
|
2780
|
-
220,
|
|
2781
|
-
26,
|
|
1918
|
+
206,
|
|
2782
1919
|
235,
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
1920
|
+
121,
|
|
1921
|
+
172,
|
|
1922
|
+
28,
|
|
1923
|
+
180,
|
|
1924
|
+
133,
|
|
1925
|
+
237,
|
|
1926
|
+
95,
|
|
1927
|
+
91,
|
|
1928
|
+
55,
|
|
1929
|
+
145,
|
|
1930
|
+
58,
|
|
1931
|
+
140,
|
|
1932
|
+
245,
|
|
1933
|
+
133,
|
|
1934
|
+
126,
|
|
1935
|
+
255,
|
|
2791
1936
|
0,
|
|
2792
|
-
|
|
2793
|
-
]))
|
|
1937
|
+
169
|
|
1938
|
+
])),
|
|
1939
|
+
getAddressEncoder().encode(getAddressFromResolvedInstructionAccount("mint", accounts.mint.value))
|
|
2794
1940
|
]
|
|
2795
1941
|
});
|
|
2796
|
-
if (!accounts.
|
|
1942
|
+
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2797
1943
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2798
1944
|
return Object.freeze({
|
|
2799
1945
|
accounts: [
|
|
2800
1946
|
getAccountMeta("seller", accounts.seller),
|
|
2801
1947
|
getAccountMeta("pool", accounts.pool),
|
|
2802
1948
|
getAccountMeta("mint", accounts.mint),
|
|
1949
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
2803
1950
|
getAccountMeta("userTokens", accounts.userTokens),
|
|
2804
1951
|
getAccountMeta("venue", accounts.venue),
|
|
2805
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
2806
|
-
getAccountMeta("feeCollectorWsol", accounts.feeCollectorWsol),
|
|
2807
|
-
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2808
1952
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
2809
|
-
getAccountMeta("
|
|
1953
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
2810
1954
|
],
|
|
2811
1955
|
data: getSellTokensInstructionDataEncoder().encode(args),
|
|
2812
1956
|
programAddress
|
|
@@ -2827,6 +1971,10 @@ function getSellTokensInstruction(input, config) {
|
|
|
2827
1971
|
value: input.mint ?? null,
|
|
2828
1972
|
isWritable: false
|
|
2829
1973
|
},
|
|
1974
|
+
quoteMint: {
|
|
1975
|
+
value: input.quoteMint ?? null,
|
|
1976
|
+
isWritable: false
|
|
1977
|
+
},
|
|
2830
1978
|
userTokens: {
|
|
2831
1979
|
value: input.userTokens ?? null,
|
|
2832
1980
|
isWritable: true
|
|
@@ -2835,54 +1983,37 @@ function getSellTokensInstruction(input, config) {
|
|
|
2835
1983
|
value: input.venue ?? null,
|
|
2836
1984
|
isWritable: false
|
|
2837
1985
|
},
|
|
2838
|
-
feeCollector: {
|
|
2839
|
-
value: input.feeCollector ?? null,
|
|
2840
|
-
isWritable: true
|
|
2841
|
-
},
|
|
2842
|
-
feeCollectorWsol: {
|
|
2843
|
-
value: input.feeCollectorWsol ?? null,
|
|
2844
|
-
isWritable: true
|
|
2845
|
-
},
|
|
2846
|
-
quoteTokenProgram: {
|
|
2847
|
-
value: input.quoteTokenProgram ?? null,
|
|
2848
|
-
isWritable: false
|
|
2849
|
-
},
|
|
2850
1986
|
tokenProgram: {
|
|
2851
1987
|
value: input.tokenProgram ?? null,
|
|
2852
1988
|
isWritable: false
|
|
2853
1989
|
},
|
|
2854
|
-
|
|
2855
|
-
value: input.
|
|
1990
|
+
quoteTokenProgram: {
|
|
1991
|
+
value: input.quoteTokenProgram ?? null,
|
|
2856
1992
|
isWritable: false
|
|
2857
1993
|
}
|
|
2858
1994
|
};
|
|
2859
1995
|
const args = { ...input };
|
|
2860
1996
|
if (!accounts.tokenProgram.value) accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2861
|
-
if (!accounts.feeCollector.value) accounts.feeCollector.value = "5WcPTEQ59UqpQzjZUPbU8QRGCbj7NeQNLDa7DbsLkLKT";
|
|
2862
|
-
if (!accounts.quoteTokenProgram.value) accounts.quoteTokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2863
|
-
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2864
1997
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2865
1998
|
return Object.freeze({
|
|
2866
1999
|
accounts: [
|
|
2867
2000
|
getAccountMeta("seller", accounts.seller),
|
|
2868
2001
|
getAccountMeta("pool", accounts.pool),
|
|
2869
2002
|
getAccountMeta("mint", accounts.mint),
|
|
2003
|
+
getAccountMeta("quoteMint", accounts.quoteMint),
|
|
2870
2004
|
getAccountMeta("userTokens", accounts.userTokens),
|
|
2871
2005
|
getAccountMeta("venue", accounts.venue),
|
|
2872
|
-
getAccountMeta("feeCollector", accounts.feeCollector),
|
|
2873
|
-
getAccountMeta("feeCollectorWsol", accounts.feeCollectorWsol),
|
|
2874
|
-
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram),
|
|
2875
2006
|
getAccountMeta("tokenProgram", accounts.tokenProgram),
|
|
2876
|
-
getAccountMeta("
|
|
2007
|
+
getAccountMeta("quoteTokenProgram", accounts.quoteTokenProgram)
|
|
2877
2008
|
],
|
|
2878
2009
|
data: getSellTokensInstructionDataEncoder().encode(args),
|
|
2879
2010
|
programAddress
|
|
2880
2011
|
});
|
|
2881
2012
|
}
|
|
2882
2013
|
function parseSellTokensInstruction(instruction) {
|
|
2883
|
-
if (instruction.accounts.length <
|
|
2014
|
+
if (instruction.accounts.length < 8) throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
2884
2015
|
actualAccountMetas: instruction.accounts.length,
|
|
2885
|
-
expectedAccountMetas:
|
|
2016
|
+
expectedAccountMetas: 8
|
|
2886
2017
|
});
|
|
2887
2018
|
let accountIndex = 0;
|
|
2888
2019
|
const getNextAccount = () => {
|
|
@@ -2896,19 +2027,17 @@ function parseSellTokensInstruction(instruction) {
|
|
|
2896
2027
|
seller: getNextAccount(),
|
|
2897
2028
|
pool: getNextAccount(),
|
|
2898
2029
|
mint: getNextAccount(),
|
|
2030
|
+
quoteMint: getNextAccount(),
|
|
2899
2031
|
userTokens: getNextAccount(),
|
|
2900
2032
|
venue: getNextAccount(),
|
|
2901
|
-
feeCollector: getNextAccount(),
|
|
2902
|
-
feeCollectorWsol: getNextAccount(),
|
|
2903
|
-
quoteTokenProgram: getNextAccount(),
|
|
2904
2033
|
tokenProgram: getNextAccount(),
|
|
2905
|
-
|
|
2034
|
+
quoteTokenProgram: getNextAccount()
|
|
2906
2035
|
},
|
|
2907
2036
|
data: getSellTokensInstructionDataDecoder().decode(instruction.data)
|
|
2908
2037
|
};
|
|
2909
2038
|
}
|
|
2910
2039
|
//#endregion
|
|
2911
|
-
//#region src/generated/programs/
|
|
2040
|
+
//#region src/generated/programs/gabox.ts
|
|
2912
2041
|
/**
|
|
2913
2042
|
* This code was AUTOGENERATED using the Codama library.
|
|
2914
2043
|
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
@@ -2916,74 +2045,60 @@ function parseSellTokensInstruction(instruction) {
|
|
|
2916
2045
|
*
|
|
2917
2046
|
* @see https://github.com/codama-idl/codama
|
|
2918
2047
|
*/
|
|
2919
|
-
const
|
|
2920
|
-
let
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
return GaboxV2Account;
|
|
2048
|
+
const GABOX_PROGRAM_ADDRESS = "GaBoxR9nYcK1zeu8EvSJVHV3SrYpCFmvbh2MLgobMcUA";
|
|
2049
|
+
let GaboxAccount = /* @__PURE__ */ function(GaboxAccount) {
|
|
2050
|
+
GaboxAccount[GaboxAccount["Draw"] = 0] = "Draw";
|
|
2051
|
+
GaboxAccount[GaboxAccount["Pool"] = 1] = "Pool";
|
|
2052
|
+
GaboxAccount[GaboxAccount["WalletActivity"] = 2] = "WalletActivity";
|
|
2053
|
+
return GaboxAccount;
|
|
2926
2054
|
}({});
|
|
2927
|
-
function
|
|
2055
|
+
function identifyGaboxAccount(account) {
|
|
2928
2056
|
const data = "data" in account ? account.data : account;
|
|
2929
2057
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2058
|
+
101,
|
|
2059
|
+
31,
|
|
2060
|
+
52,
|
|
2061
|
+
179,
|
|
2062
|
+
121,
|
|
2063
|
+
78,
|
|
2064
|
+
252,
|
|
2065
|
+
89
|
|
2938
2066
|
])), 0)) return 0;
|
|
2939
2067
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2068
|
+
153,
|
|
2069
|
+
115,
|
|
2070
|
+
78,
|
|
2071
|
+
55,
|
|
2072
|
+
156,
|
|
2073
|
+
26,
|
|
2074
|
+
133,
|
|
2075
|
+
45
|
|
2948
2076
|
])), 0)) return 1;
|
|
2949
2077
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2078
|
+
212,
|
|
2079
|
+
80,
|
|
2080
|
+
180,
|
|
2081
|
+
131,
|
|
2082
|
+
173,
|
|
2083
|
+
1,
|
|
2084
|
+
252,
|
|
2085
|
+
141
|
|
2958
2086
|
])), 0)) return 2;
|
|
2959
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
2960
|
-
30,
|
|
2961
|
-
231,
|
|
2962
|
-
159,
|
|
2963
|
-
98,
|
|
2964
|
-
189,
|
|
2965
|
-
47,
|
|
2966
|
-
48,
|
|
2967
|
-
5
|
|
2968
|
-
])), 0)) return 3;
|
|
2969
2087
|
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_ACCOUNT, {
|
|
2970
2088
|
accountData: data,
|
|
2971
|
-
programName: "
|
|
2089
|
+
programName: "gabox"
|
|
2972
2090
|
});
|
|
2973
2091
|
}
|
|
2974
|
-
let
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
2981
|
-
|
|
2982
|
-
GaboxV2Event[GaboxV2Event["ReferralClaimed"] = 7] = "ReferralClaimed";
|
|
2983
|
-
GaboxV2Event[GaboxV2Event["TokensSold"] = 8] = "TokensSold";
|
|
2984
|
-
return GaboxV2Event;
|
|
2092
|
+
let GaboxEvent = /* @__PURE__ */ function(GaboxEvent) {
|
|
2093
|
+
GaboxEvent[GaboxEvent["DrawResolved"] = 0] = "DrawResolved";
|
|
2094
|
+
GaboxEvent[GaboxEvent["PackBought"] = 1] = "PackBought";
|
|
2095
|
+
GaboxEvent[GaboxEvent["PoolCreated"] = 2] = "PoolCreated";
|
|
2096
|
+
GaboxEvent[GaboxEvent["PrizesFunded"] = 3] = "PrizesFunded";
|
|
2097
|
+
GaboxEvent[GaboxEvent["RandomnessRetried"] = 4] = "RandomnessRetried";
|
|
2098
|
+
GaboxEvent[GaboxEvent["TokensSold"] = 5] = "TokensSold";
|
|
2099
|
+
return GaboxEvent;
|
|
2985
2100
|
}({});
|
|
2986
|
-
function
|
|
2101
|
+
function identifyGaboxEvent(event) {
|
|
2987
2102
|
const data = "data" in event ? event.data : event;
|
|
2988
2103
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
2989
2104
|
127,
|
|
@@ -3015,16 +2130,6 @@ function identifyGaboxV2Event(event) {
|
|
|
3015
2130
|
157,
|
|
3016
2131
|
82
|
|
3017
2132
|
])), 0)) return 2;
|
|
3018
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3019
|
-
243,
|
|
3020
|
-
193,
|
|
3021
|
-
245,
|
|
3022
|
-
166,
|
|
3023
|
-
160,
|
|
3024
|
-
101,
|
|
3025
|
-
182,
|
|
3026
|
-
207
|
|
3027
|
-
])), 0)) return 3;
|
|
3028
2133
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3029
2134
|
188,
|
|
3030
2135
|
129,
|
|
@@ -3034,7 +2139,7 @@ function identifyGaboxV2Event(event) {
|
|
|
3034
2139
|
71,
|
|
3035
2140
|
53,
|
|
3036
2141
|
60
|
|
3037
|
-
])), 0)) return
|
|
2142
|
+
])), 0)) return 3;
|
|
3038
2143
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3039
2144
|
243,
|
|
3040
2145
|
30,
|
|
@@ -3044,27 +2149,7 @@ function identifyGaboxV2Event(event) {
|
|
|
3044
2149
|
127,
|
|
3045
2150
|
52,
|
|
3046
2151
|
140
|
|
3047
|
-
])), 0)) return
|
|
3048
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3049
|
-
12,
|
|
3050
|
-
28,
|
|
3051
|
-
152,
|
|
3052
|
-
148,
|
|
3053
|
-
55,
|
|
3054
|
-
210,
|
|
3055
|
-
102,
|
|
3056
|
-
190
|
|
3057
|
-
])), 0)) return 6;
|
|
3058
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3059
|
-
195,
|
|
3060
|
-
109,
|
|
3061
|
-
77,
|
|
3062
|
-
196,
|
|
3063
|
-
134,
|
|
3064
|
-
226,
|
|
3065
|
-
78,
|
|
3066
|
-
108
|
|
3067
|
-
])), 0)) return 7;
|
|
2152
|
+
])), 0)) return 4;
|
|
3068
2153
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3069
2154
|
217,
|
|
3070
2155
|
83,
|
|
@@ -3074,36 +2159,21 @@ function identifyGaboxV2Event(event) {
|
|
|
3074
2159
|
225,
|
|
3075
2160
|
94,
|
|
3076
2161
|
45
|
|
3077
|
-
])), 0)) return
|
|
3078
|
-
throw new Error("The provided event could not be identified as a
|
|
3079
|
-
}
|
|
3080
|
-
let
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
GaboxV2Instruction[GaboxV2Instruction["InitializePool"] = 8] = "InitializePool";
|
|
3090
|
-
GaboxV2Instruction[GaboxV2Instruction["RetryDraw"] = 9] = "RetryDraw";
|
|
3091
|
-
GaboxV2Instruction[GaboxV2Instruction["SellPrize"] = 10] = "SellPrize";
|
|
3092
|
-
GaboxV2Instruction[GaboxV2Instruction["SellTokens"] = 11] = "SellTokens";
|
|
3093
|
-
return GaboxV2Instruction;
|
|
2162
|
+
])), 0)) return 5;
|
|
2163
|
+
throw new Error("The provided event could not be identified as a gabox event.");
|
|
2164
|
+
}
|
|
2165
|
+
let GaboxInstruction = /* @__PURE__ */ function(GaboxInstruction) {
|
|
2166
|
+
GaboxInstruction[GaboxInstruction["BuyPack"] = 0] = "BuyPack";
|
|
2167
|
+
GaboxInstruction[GaboxInstruction["DeliverDraw"] = 1] = "DeliverDraw";
|
|
2168
|
+
GaboxInstruction[GaboxInstruction["ExpireDraw"] = 2] = "ExpireDraw";
|
|
2169
|
+
GaboxInstruction[GaboxInstruction["FundPrizes"] = 3] = "FundPrizes";
|
|
2170
|
+
GaboxInstruction[GaboxInstruction["InitializePool"] = 4] = "InitializePool";
|
|
2171
|
+
GaboxInstruction[GaboxInstruction["RetryDraw"] = 5] = "RetryDraw";
|
|
2172
|
+
GaboxInstruction[GaboxInstruction["SellTokens"] = 6] = "SellTokens";
|
|
2173
|
+
return GaboxInstruction;
|
|
3094
2174
|
}({});
|
|
3095
|
-
function
|
|
2175
|
+
function identifyGaboxInstruction(instruction) {
|
|
3096
2176
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
3097
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3098
|
-
45,
|
|
3099
|
-
172,
|
|
3100
|
-
18,
|
|
3101
|
-
187,
|
|
3102
|
-
3,
|
|
3103
|
-
160,
|
|
3104
|
-
196,
|
|
3105
|
-
176
|
|
3106
|
-
])), 0)) return 0;
|
|
3107
2177
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3108
2178
|
151,
|
|
3109
2179
|
46,
|
|
@@ -3113,27 +2183,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3113
2183
|
5,
|
|
3114
2184
|
49,
|
|
3115
2185
|
173
|
|
3116
|
-
])), 0)) return
|
|
3117
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3118
|
-
157,
|
|
3119
|
-
233,
|
|
3120
|
-
139,
|
|
3121
|
-
121,
|
|
3122
|
-
246,
|
|
3123
|
-
62,
|
|
3124
|
-
234,
|
|
3125
|
-
235
|
|
3126
|
-
])), 0)) return 2;
|
|
3127
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3128
|
-
219,
|
|
3129
|
-
247,
|
|
3130
|
-
18,
|
|
3131
|
-
148,
|
|
3132
|
-
63,
|
|
3133
|
-
247,
|
|
3134
|
-
112,
|
|
3135
|
-
198
|
|
3136
|
-
])), 0)) return 3;
|
|
2186
|
+
])), 0)) return 0;
|
|
3137
2187
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3138
2188
|
113,
|
|
3139
2189
|
181,
|
|
@@ -3143,7 +2193,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3143
2193
|
138,
|
|
3144
2194
|
199,
|
|
3145
2195
|
51
|
|
3146
|
-
])), 0)) return
|
|
2196
|
+
])), 0)) return 1;
|
|
3147
2197
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3148
2198
|
100,
|
|
3149
2199
|
119,
|
|
@@ -3153,17 +2203,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3153
2203
|
25,
|
|
3154
2204
|
252,
|
|
3155
2205
|
255
|
|
3156
|
-
])), 0)) return
|
|
3157
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3158
|
-
136,
|
|
3159
|
-
46,
|
|
3160
|
-
22,
|
|
3161
|
-
51,
|
|
3162
|
-
33,
|
|
3163
|
-
153,
|
|
3164
|
-
232,
|
|
3165
|
-
234
|
|
3166
|
-
])), 0)) return 6;
|
|
2206
|
+
])), 0)) return 2;
|
|
3167
2207
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3168
2208
|
163,
|
|
3169
2209
|
225,
|
|
@@ -3173,7 +2213,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3173
2213
|
171,
|
|
3174
2214
|
29,
|
|
3175
2215
|
241
|
|
3176
|
-
])), 0)) return
|
|
2216
|
+
])), 0)) return 3;
|
|
3177
2217
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3178
2218
|
95,
|
|
3179
2219
|
180,
|
|
@@ -3183,7 +2223,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3183
2223
|
174,
|
|
3184
2224
|
232,
|
|
3185
2225
|
40
|
|
3186
|
-
])), 0)) return
|
|
2226
|
+
])), 0)) return 4;
|
|
3187
2227
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3188
2228
|
112,
|
|
3189
2229
|
118,
|
|
@@ -3193,17 +2233,7 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3193
2233
|
39,
|
|
3194
2234
|
196,
|
|
3195
2235
|
96
|
|
3196
|
-
])), 0)) return
|
|
3197
|
-
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3198
|
-
235,
|
|
3199
|
-
236,
|
|
3200
|
-
8,
|
|
3201
|
-
137,
|
|
3202
|
-
79,
|
|
3203
|
-
25,
|
|
3204
|
-
208,
|
|
3205
|
-
235
|
|
3206
|
-
])), 0)) return 10;
|
|
2236
|
+
])), 0)) return 5;
|
|
3207
2237
|
if (containsBytes(data, fixEncoderSize(getBytesEncoder(), 8).encode(new Uint8Array([
|
|
3208
2238
|
114,
|
|
3209
2239
|
242,
|
|
@@ -3213,135 +2243,96 @@ function identifyGaboxV2Instruction(instruction) {
|
|
|
3213
2243
|
126,
|
|
3214
2244
|
92,
|
|
3215
2245
|
2
|
|
3216
|
-
])), 0)) return
|
|
2246
|
+
])), 0)) return 6;
|
|
3217
2247
|
throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION, {
|
|
3218
2248
|
instructionData: data,
|
|
3219
|
-
programName: "
|
|
2249
|
+
programName: "gabox"
|
|
3220
2250
|
});
|
|
3221
2251
|
}
|
|
3222
|
-
function
|
|
3223
|
-
const instructionType =
|
|
2252
|
+
function parseGaboxInstruction(instruction) {
|
|
2253
|
+
const instructionType = identifyGaboxInstruction(instruction);
|
|
3224
2254
|
switch (instructionType) {
|
|
3225
2255
|
case 0:
|
|
3226
2256
|
assertIsInstructionWithAccounts(instruction);
|
|
3227
2257
|
return {
|
|
3228
2258
|
instructionType: 0,
|
|
3229
|
-
...
|
|
2259
|
+
...parseBuyPackInstruction(instruction)
|
|
3230
2260
|
};
|
|
3231
2261
|
case 1:
|
|
3232
2262
|
assertIsInstructionWithAccounts(instruction);
|
|
3233
2263
|
return {
|
|
3234
2264
|
instructionType: 1,
|
|
3235
|
-
...
|
|
2265
|
+
...parseDeliverDrawInstruction(instruction)
|
|
3236
2266
|
};
|
|
3237
2267
|
case 2:
|
|
3238
2268
|
assertIsInstructionWithAccounts(instruction);
|
|
3239
2269
|
return {
|
|
3240
2270
|
instructionType: 2,
|
|
3241
|
-
...
|
|
2271
|
+
...parseExpireDrawInstruction(instruction)
|
|
3242
2272
|
};
|
|
3243
2273
|
case 3:
|
|
3244
2274
|
assertIsInstructionWithAccounts(instruction);
|
|
3245
2275
|
return {
|
|
3246
2276
|
instructionType: 3,
|
|
3247
|
-
...
|
|
2277
|
+
...parseFundPrizesInstruction(instruction)
|
|
3248
2278
|
};
|
|
3249
2279
|
case 4:
|
|
3250
2280
|
assertIsInstructionWithAccounts(instruction);
|
|
3251
2281
|
return {
|
|
3252
2282
|
instructionType: 4,
|
|
3253
|
-
...
|
|
2283
|
+
...parseInitializePoolInstruction(instruction)
|
|
3254
2284
|
};
|
|
3255
2285
|
case 5:
|
|
3256
2286
|
assertIsInstructionWithAccounts(instruction);
|
|
3257
2287
|
return {
|
|
3258
2288
|
instructionType: 5,
|
|
3259
|
-
...
|
|
2289
|
+
...parseRetryDrawInstruction(instruction)
|
|
3260
2290
|
};
|
|
3261
2291
|
case 6:
|
|
3262
2292
|
assertIsInstructionWithAccounts(instruction);
|
|
3263
2293
|
return {
|
|
3264
2294
|
instructionType: 6,
|
|
3265
|
-
...parseFulfillDrawInstruction(instruction)
|
|
3266
|
-
};
|
|
3267
|
-
case 7:
|
|
3268
|
-
assertIsInstructionWithAccounts(instruction);
|
|
3269
|
-
return {
|
|
3270
|
-
instructionType: 7,
|
|
3271
|
-
...parseFundPrizesInstruction(instruction)
|
|
3272
|
-
};
|
|
3273
|
-
case 8:
|
|
3274
|
-
assertIsInstructionWithAccounts(instruction);
|
|
3275
|
-
return {
|
|
3276
|
-
instructionType: 8,
|
|
3277
|
-
...parseInitializePoolInstruction(instruction)
|
|
3278
|
-
};
|
|
3279
|
-
case 9:
|
|
3280
|
-
assertIsInstructionWithAccounts(instruction);
|
|
3281
|
-
return {
|
|
3282
|
-
instructionType: 9,
|
|
3283
|
-
...parseRetryDrawInstruction(instruction)
|
|
3284
|
-
};
|
|
3285
|
-
case 10:
|
|
3286
|
-
assertIsInstructionWithAccounts(instruction);
|
|
3287
|
-
return {
|
|
3288
|
-
instructionType: 10,
|
|
3289
|
-
...parseSellPrizeInstruction(instruction)
|
|
3290
|
-
};
|
|
3291
|
-
case 11:
|
|
3292
|
-
assertIsInstructionWithAccounts(instruction);
|
|
3293
|
-
return {
|
|
3294
|
-
instructionType: 11,
|
|
3295
2295
|
...parseSellTokensInstruction(instruction)
|
|
3296
2296
|
};
|
|
3297
2297
|
default: throw new SolanaError(SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE, {
|
|
3298
2298
|
instructionType,
|
|
3299
|
-
programName: "
|
|
2299
|
+
programName: "gabox"
|
|
3300
2300
|
});
|
|
3301
2301
|
}
|
|
3302
2302
|
}
|
|
3303
|
-
function
|
|
2303
|
+
function gaboxProgram() {
|
|
3304
2304
|
return (client) => {
|
|
3305
|
-
return extendClient(client, {
|
|
2305
|
+
return extendClient(client, { gabox: {
|
|
3306
2306
|
accounts: {
|
|
3307
2307
|
draw: addSelfFetchFunctions(client, getDrawCodec()),
|
|
3308
2308
|
pool: addSelfFetchFunctions(client, getPoolCodec()),
|
|
3309
|
-
|
|
3310
|
-
referralLink: addSelfFetchFunctions(client, getReferralLinkCodec())
|
|
2309
|
+
walletActivity: addSelfFetchFunctions(client, getWalletActivityCodec())
|
|
3311
2310
|
},
|
|
3312
2311
|
instructions: {
|
|
3313
|
-
bindReferrer: (input) => addSelfPlanAndSendFunctions(client, getBindReferrerInstructionAsync(input)),
|
|
3314
2312
|
buyPack: (input) => addSelfPlanAndSendFunctions(client, getBuyPackInstructionAsync(input)),
|
|
3315
|
-
claimPrize: (input) => addSelfPlanAndSendFunctions(client, getClaimPrizeInstructionAsync(input)),
|
|
3316
|
-
claimReferral: (input) => addSelfPlanAndSendFunctions(client, getClaimReferralInstructionAsync(input)),
|
|
3317
2313
|
deliverDraw: (input) => addSelfPlanAndSendFunctions(client, getDeliverDrawInstructionAsync(input)),
|
|
3318
2314
|
expireDraw: (input) => addSelfPlanAndSendFunctions(client, getExpireDrawInstructionAsync(input)),
|
|
3319
|
-
|
|
3320
|
-
fundPrizes: (input) => addSelfPlanAndSendFunctions(client, getFundPrizesInstruction(input)),
|
|
2315
|
+
fundPrizes: (input) => addSelfPlanAndSendFunctions(client, getFundPrizesInstructionAsync(input)),
|
|
3321
2316
|
initializePool: (input) => addSelfPlanAndSendFunctions(client, getInitializePoolInstructionAsync(input)),
|
|
3322
2317
|
retryDraw: (input) => addSelfPlanAndSendFunctions(client, getRetryDrawInstructionAsync({
|
|
3323
2318
|
...input,
|
|
3324
2319
|
payer: input.payer ?? client.payer
|
|
3325
2320
|
})),
|
|
3326
|
-
sellPrize: (input) => addSelfPlanAndSendFunctions(client, getSellPrizeInstructionAsync(input)),
|
|
3327
2321
|
sellTokens: (input) => addSelfPlanAndSendFunctions(client, getSellTokensInstructionAsync(input))
|
|
3328
2322
|
},
|
|
3329
2323
|
pdas: {
|
|
3330
|
-
link: findLinkPda,
|
|
3331
|
-
identity: findIdentityPda,
|
|
3332
|
-
referralLink: findReferralLinkPda,
|
|
3333
|
-
referral: findReferralPda,
|
|
3334
2324
|
pool: findPoolPda,
|
|
3335
|
-
|
|
2325
|
+
activity: findActivityPda,
|
|
2326
|
+
identity: findIdentityPda,
|
|
3336
2327
|
draw: findDrawPda
|
|
3337
2328
|
},
|
|
3338
|
-
identifyAccount:
|
|
3339
|
-
identifyInstruction:
|
|
3340
|
-
parseInstruction:
|
|
2329
|
+
identifyAccount: identifyGaboxAccount,
|
|
2330
|
+
identifyInstruction: identifyGaboxInstruction,
|
|
2331
|
+
parseInstruction: parseGaboxInstruction
|
|
3341
2332
|
} });
|
|
3342
2333
|
};
|
|
3343
2334
|
}
|
|
3344
2335
|
//#endregion
|
|
3345
|
-
export {
|
|
2336
|
+
export { getDeliverDrawInstructionAsync as $, getPrizeDecoder as $t, getInitializePoolInstructionDataCodec as A, fetchAllPool as At, getFundPrizesInstructionDataEncoder as B, fetchAllDraw as Bt, getRetryDrawInstructionDataDecoder as C, getWalletActivityDecoder as Ct, getInitializePoolDiscriminatorBytes as D, POOL_DISCRIMINATOR as Dt, INITIALIZE_POOL_DISCRIMINATOR as E, getWalletActivitySize as Et, getFundPrizesDiscriminatorBytes as F, getPoolDiscriminatorBytes as Ft, getExpireDrawInstructionAsync as G, getDrawDecoder as Gt, EXPIRE_DRAW_DISCRIMINATOR as H, fetchDraw as Ht, getFundPrizesInstruction as I, getPoolEncoder as It, getExpireDrawInstructionDataEncoder as J, getDrawSize as Jt, getExpireDrawInstructionDataCodec as K, getDrawDiscriminatorBytes as Kt, getFundPrizesInstructionAsync as L, getPoolSize as Lt, getInitializePoolInstructionDataEncoder as M, fetchPool as Mt, parseInitializePoolInstruction as N, getPoolCodec as Nt, getInitializePoolInstruction as O, decodePool as Ot, FUND_PRIZES_DISCRIMINATOR as P, getPoolDecoder as Pt, getDeliverDrawInstruction as Q, getPrizeCodec as Qt, getFundPrizesInstructionDataCodec as R, DRAW_DISCRIMINATOR as Rt, getRetryDrawInstructionDataCodec as S, getWalletActivityCodec as St, parseRetryDrawInstruction as T, getWalletActivityEncoder as Tt, getExpireDrawDiscriminatorBytes as U, fetchMaybeDraw as Ut, parseFundPrizesInstruction as V, fetchAllMaybeDraw as Vt, getExpireDrawInstruction as W, getDrawCodec as Wt, DELIVER_DRAW_DISCRIMINATOR as X, getTierDecoder as Xt, parseExpireDrawInstruction as Y, getTierCodec as Yt, getDeliverDrawDiscriminatorBytes as Z, getTierEncoder as Zt, parseSellTokensInstruction as _, decodeWalletActivity as _t, gaboxProgram as a, getBuyPackDiscriminatorBytes as at, getRetryDrawInstruction as b, fetchMaybeWalletActivity as bt, identifyGaboxInstruction as c, getBuyPackInstructionDataCodec as ct, getSellTokensDiscriminatorBytes as d, parseBuyPackInstruction as dt, getPrizeEncoder as en, getDeliverDrawInstructionDataCodec as et, getSellTokensInstruction as f, findPoolPda as ft, getSellTokensInstructionDataEncoder as g, WALLET_ACTIVITY_DISCRIMINATOR as gt, getSellTokensInstructionDataDecoder as h, findActivityPda as ht, GaboxInstruction as i, BUY_PACK_DISCRIMINATOR as it, getInitializePoolInstructionDataDecoder as j, fetchMaybePool as jt, getInitializePoolInstructionAsync as k, fetchAllMaybePool as kt, parseGaboxInstruction as l, getBuyPackInstructionDataDecoder as lt, getSellTokensInstructionDataCodec as m, findDrawPda as mt, GaboxAccount as n, getDeliverDrawInstructionDataEncoder as nt, identifyGaboxAccount as o, getBuyPackInstruction as ot, getSellTokensInstructionAsync as p, findIdentityPda as pt, getExpireDrawInstructionDataDecoder as q, getDrawEncoder as qt, GaboxEvent as r, parseDeliverDrawInstruction as rt, identifyGaboxEvent as s, getBuyPackInstructionAsync as st, GABOX_PROGRAM_ADDRESS as t, getDeliverDrawInstructionDataDecoder as tt, SELL_TOKENS_DISCRIMINATOR as u, getBuyPackInstructionDataEncoder as ut, RETRY_DRAW_DISCRIMINATOR as v, fetchAllMaybeWalletActivity as vt, getRetryDrawInstructionDataEncoder as w, getWalletActivityDiscriminatorBytes as wt, getRetryDrawInstructionAsync as x, fetchWalletActivity as xt, getRetryDrawDiscriminatorBytes as y, fetchAllWalletActivity as yt, getFundPrizesInstructionDataDecoder as z, decodeDraw as zt };
|
|
3346
2337
|
|
|
3347
|
-
//# sourceMappingURL=
|
|
2338
|
+
//# sourceMappingURL=gabox-DGTCh34U.js.map
|