@dropsy/airdrop 0.2.7 → 0.4.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/dist/index.cjs +2544 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1119 -0
- package/dist/index.d.ts +491 -1045
- package/dist/index.js +1524 -2620
- package/dist/index.js.map +1 -1
- package/package.json +69 -59
- package/readme.md +60 -153
- package/dist/index.d.mts +0 -1673
- package/dist/index.mjs +0 -3741
- package/dist/index.mjs.map +0 -1
- package/generate-md.js +0 -71
package/dist/index.mjs
DELETED
|
@@ -1,3741 +0,0 @@
|
|
|
1
|
-
// src/accounts/affiliate.ts
|
|
2
|
-
import {
|
|
3
|
-
assertAccountExists,
|
|
4
|
-
assertAccountsExist,
|
|
5
|
-
combineCodec,
|
|
6
|
-
decodeAccount,
|
|
7
|
-
fetchEncodedAccount,
|
|
8
|
-
fetchEncodedAccounts,
|
|
9
|
-
fixDecoderSize,
|
|
10
|
-
fixEncoderSize,
|
|
11
|
-
getAddressDecoder,
|
|
12
|
-
getAddressEncoder,
|
|
13
|
-
getBytesDecoder,
|
|
14
|
-
getBytesEncoder,
|
|
15
|
-
getStructDecoder,
|
|
16
|
-
getStructEncoder,
|
|
17
|
-
getU32Decoder,
|
|
18
|
-
getU32Encoder,
|
|
19
|
-
getU64Decoder,
|
|
20
|
-
getU64Encoder,
|
|
21
|
-
getU8Decoder,
|
|
22
|
-
getU8Encoder,
|
|
23
|
-
transformEncoder
|
|
24
|
-
} from "@solana/kit";
|
|
25
|
-
var AFFILIATE_DISCRIMINATOR = new Uint8Array([
|
|
26
|
-
136,
|
|
27
|
-
95,
|
|
28
|
-
107,
|
|
29
|
-
149,
|
|
30
|
-
36,
|
|
31
|
-
195,
|
|
32
|
-
146,
|
|
33
|
-
35
|
|
34
|
-
]);
|
|
35
|
-
function getAffiliateDiscriminatorBytes() {
|
|
36
|
-
return fixEncoderSize(getBytesEncoder(), 8).encode(AFFILIATE_DISCRIMINATOR);
|
|
37
|
-
}
|
|
38
|
-
function getAffiliateEncoder() {
|
|
39
|
-
return transformEncoder(
|
|
40
|
-
getStructEncoder([
|
|
41
|
-
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
42
|
-
["master", getAddressEncoder()],
|
|
43
|
-
["authority", getAddressEncoder()],
|
|
44
|
-
["totalEarned", getU64Encoder()],
|
|
45
|
-
["referrals", getU32Encoder()],
|
|
46
|
-
["level", getU8Encoder()],
|
|
47
|
-
["bump", getU8Encoder()]
|
|
48
|
-
]),
|
|
49
|
-
(value) => ({ ...value, discriminator: AFFILIATE_DISCRIMINATOR })
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
function getAffiliateDecoder() {
|
|
53
|
-
return getStructDecoder([
|
|
54
|
-
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
55
|
-
["master", getAddressDecoder()],
|
|
56
|
-
["authority", getAddressDecoder()],
|
|
57
|
-
["totalEarned", getU64Decoder()],
|
|
58
|
-
["referrals", getU32Decoder()],
|
|
59
|
-
["level", getU8Decoder()],
|
|
60
|
-
["bump", getU8Decoder()]
|
|
61
|
-
]);
|
|
62
|
-
}
|
|
63
|
-
function getAffiliateCodec() {
|
|
64
|
-
return combineCodec(getAffiliateEncoder(), getAffiliateDecoder());
|
|
65
|
-
}
|
|
66
|
-
function decodeAffiliate(encodedAccount) {
|
|
67
|
-
return decodeAccount(
|
|
68
|
-
encodedAccount,
|
|
69
|
-
getAffiliateDecoder()
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
async function fetchAffiliate(rpc, address2, config) {
|
|
73
|
-
const maybeAccount = await fetchMaybeAffiliate(rpc, address2, config);
|
|
74
|
-
assertAccountExists(maybeAccount);
|
|
75
|
-
return maybeAccount;
|
|
76
|
-
}
|
|
77
|
-
async function fetchMaybeAffiliate(rpc, address2, config) {
|
|
78
|
-
const maybeAccount = await fetchEncodedAccount(rpc, address2, config);
|
|
79
|
-
return decodeAffiliate(maybeAccount);
|
|
80
|
-
}
|
|
81
|
-
async function fetchAllAffiliate(rpc, addresses, config) {
|
|
82
|
-
const maybeAccounts = await fetchAllMaybeAffiliate(rpc, addresses, config);
|
|
83
|
-
assertAccountsExist(maybeAccounts);
|
|
84
|
-
return maybeAccounts;
|
|
85
|
-
}
|
|
86
|
-
async function fetchAllMaybeAffiliate(rpc, addresses, config) {
|
|
87
|
-
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
88
|
-
return maybeAccounts.map((maybeAccount) => decodeAffiliate(maybeAccount));
|
|
89
|
-
}
|
|
90
|
-
function getAffiliateSize() {
|
|
91
|
-
return 86;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// src/accounts/affiliateMaster.ts
|
|
95
|
-
import {
|
|
96
|
-
assertAccountExists as assertAccountExists2,
|
|
97
|
-
assertAccountsExist as assertAccountsExist2,
|
|
98
|
-
combineCodec as combineCodec2,
|
|
99
|
-
decodeAccount as decodeAccount2,
|
|
100
|
-
fetchEncodedAccount as fetchEncodedAccount2,
|
|
101
|
-
fetchEncodedAccounts as fetchEncodedAccounts2,
|
|
102
|
-
fixDecoderSize as fixDecoderSize2,
|
|
103
|
-
fixEncoderSize as fixEncoderSize2,
|
|
104
|
-
getAddressDecoder as getAddressDecoder2,
|
|
105
|
-
getAddressEncoder as getAddressEncoder2,
|
|
106
|
-
getBytesDecoder as getBytesDecoder2,
|
|
107
|
-
getBytesEncoder as getBytesEncoder2,
|
|
108
|
-
getStructDecoder as getStructDecoder2,
|
|
109
|
-
getStructEncoder as getStructEncoder2,
|
|
110
|
-
getU16Decoder,
|
|
111
|
-
getU16Encoder,
|
|
112
|
-
getU64Decoder as getU64Decoder2,
|
|
113
|
-
getU64Encoder as getU64Encoder2,
|
|
114
|
-
getU8Decoder as getU8Decoder2,
|
|
115
|
-
getU8Encoder as getU8Encoder2,
|
|
116
|
-
transformEncoder as transformEncoder2
|
|
117
|
-
} from "@solana/kit";
|
|
118
|
-
var AFFILIATE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
119
|
-
25,
|
|
120
|
-
57,
|
|
121
|
-
134,
|
|
122
|
-
31,
|
|
123
|
-
30,
|
|
124
|
-
203,
|
|
125
|
-
219,
|
|
126
|
-
215
|
|
127
|
-
]);
|
|
128
|
-
function getAffiliateMasterDiscriminatorBytes() {
|
|
129
|
-
return fixEncoderSize2(getBytesEncoder2(), 8).encode(
|
|
130
|
-
AFFILIATE_MASTER_DISCRIMINATOR
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
function getAffiliateMasterEncoder() {
|
|
134
|
-
return transformEncoder2(
|
|
135
|
-
getStructEncoder2([
|
|
136
|
-
["discriminator", fixEncoderSize2(getBytesEncoder2(), 8)],
|
|
137
|
-
["authority", getAddressEncoder2()],
|
|
138
|
-
["tokenMint", getAddressEncoder2()],
|
|
139
|
-
["affiliatesCreated", getU64Encoder2()],
|
|
140
|
-
["maxAffiliatesAllowed", getU64Encoder2()],
|
|
141
|
-
["totalFeesCollected", getU64Encoder2()],
|
|
142
|
-
["affiliateCreationFee", getU64Encoder2()],
|
|
143
|
-
["affiliateUpgradeAmount", getU64Encoder2()],
|
|
144
|
-
["affiliateWithdrawFeeBasis", getU16Encoder()],
|
|
145
|
-
["burnPercentageBasis", getU16Encoder()],
|
|
146
|
-
["treasuryPercentageBasis", getU16Encoder()],
|
|
147
|
-
["upgradeRewardPercentageBasis", getU16Encoder()],
|
|
148
|
-
["bump", getU8Encoder2()]
|
|
149
|
-
]),
|
|
150
|
-
(value) => ({ ...value, discriminator: AFFILIATE_MASTER_DISCRIMINATOR })
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
function getAffiliateMasterDecoder() {
|
|
154
|
-
return getStructDecoder2([
|
|
155
|
-
["discriminator", fixDecoderSize2(getBytesDecoder2(), 8)],
|
|
156
|
-
["authority", getAddressDecoder2()],
|
|
157
|
-
["tokenMint", getAddressDecoder2()],
|
|
158
|
-
["affiliatesCreated", getU64Decoder2()],
|
|
159
|
-
["maxAffiliatesAllowed", getU64Decoder2()],
|
|
160
|
-
["totalFeesCollected", getU64Decoder2()],
|
|
161
|
-
["affiliateCreationFee", getU64Decoder2()],
|
|
162
|
-
["affiliateUpgradeAmount", getU64Decoder2()],
|
|
163
|
-
["affiliateWithdrawFeeBasis", getU16Decoder()],
|
|
164
|
-
["burnPercentageBasis", getU16Decoder()],
|
|
165
|
-
["treasuryPercentageBasis", getU16Decoder()],
|
|
166
|
-
["upgradeRewardPercentageBasis", getU16Decoder()],
|
|
167
|
-
["bump", getU8Decoder2()]
|
|
168
|
-
]);
|
|
169
|
-
}
|
|
170
|
-
function getAffiliateMasterCodec() {
|
|
171
|
-
return combineCodec2(getAffiliateMasterEncoder(), getAffiliateMasterDecoder());
|
|
172
|
-
}
|
|
173
|
-
function decodeAffiliateMaster(encodedAccount) {
|
|
174
|
-
return decodeAccount2(
|
|
175
|
-
encodedAccount,
|
|
176
|
-
getAffiliateMasterDecoder()
|
|
177
|
-
);
|
|
178
|
-
}
|
|
179
|
-
async function fetchAffiliateMaster(rpc, address2, config) {
|
|
180
|
-
const maybeAccount = await fetchMaybeAffiliateMaster(rpc, address2, config);
|
|
181
|
-
assertAccountExists2(maybeAccount);
|
|
182
|
-
return maybeAccount;
|
|
183
|
-
}
|
|
184
|
-
async function fetchMaybeAffiliateMaster(rpc, address2, config) {
|
|
185
|
-
const maybeAccount = await fetchEncodedAccount2(rpc, address2, config);
|
|
186
|
-
return decodeAffiliateMaster(maybeAccount);
|
|
187
|
-
}
|
|
188
|
-
async function fetchAllAffiliateMaster(rpc, addresses, config) {
|
|
189
|
-
const maybeAccounts = await fetchAllMaybeAffiliateMaster(
|
|
190
|
-
rpc,
|
|
191
|
-
addresses,
|
|
192
|
-
config
|
|
193
|
-
);
|
|
194
|
-
assertAccountsExist2(maybeAccounts);
|
|
195
|
-
return maybeAccounts;
|
|
196
|
-
}
|
|
197
|
-
async function fetchAllMaybeAffiliateMaster(rpc, addresses, config) {
|
|
198
|
-
const maybeAccounts = await fetchEncodedAccounts2(rpc, addresses, config);
|
|
199
|
-
return maybeAccounts.map(
|
|
200
|
-
(maybeAccount) => decodeAffiliateMaster(maybeAccount)
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
function getAffiliateMasterSize() {
|
|
204
|
-
return 121;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
// src/accounts/airdrop.ts
|
|
208
|
-
import {
|
|
209
|
-
assertAccountExists as assertAccountExists3,
|
|
210
|
-
assertAccountsExist as assertAccountsExist3,
|
|
211
|
-
combineCodec as combineCodec3,
|
|
212
|
-
decodeAccount as decodeAccount3,
|
|
213
|
-
fetchEncodedAccount as fetchEncodedAccount3,
|
|
214
|
-
fetchEncodedAccounts as fetchEncodedAccounts3,
|
|
215
|
-
fixDecoderSize as fixDecoderSize3,
|
|
216
|
-
fixEncoderSize as fixEncoderSize3,
|
|
217
|
-
getAddressDecoder as getAddressDecoder3,
|
|
218
|
-
getAddressEncoder as getAddressEncoder3,
|
|
219
|
-
getBytesDecoder as getBytesDecoder3,
|
|
220
|
-
getBytesEncoder as getBytesEncoder3,
|
|
221
|
-
getI64Decoder,
|
|
222
|
-
getI64Encoder,
|
|
223
|
-
getStructDecoder as getStructDecoder3,
|
|
224
|
-
getStructEncoder as getStructEncoder3,
|
|
225
|
-
getU16Decoder as getU16Decoder2,
|
|
226
|
-
getU16Encoder as getU16Encoder2,
|
|
227
|
-
getU64Decoder as getU64Decoder3,
|
|
228
|
-
getU64Encoder as getU64Encoder3,
|
|
229
|
-
getU8Decoder as getU8Decoder3,
|
|
230
|
-
getU8Encoder as getU8Encoder3,
|
|
231
|
-
transformEncoder as transformEncoder3
|
|
232
|
-
} from "@solana/kit";
|
|
233
|
-
var AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
234
|
-
31,
|
|
235
|
-
112,
|
|
236
|
-
159,
|
|
237
|
-
158,
|
|
238
|
-
124,
|
|
239
|
-
237,
|
|
240
|
-
9,
|
|
241
|
-
241
|
|
242
|
-
]);
|
|
243
|
-
function getAirdropDiscriminatorBytes() {
|
|
244
|
-
return fixEncoderSize3(getBytesEncoder3(), 8).encode(AIRDROP_DISCRIMINATOR);
|
|
245
|
-
}
|
|
246
|
-
function getAirdropEncoder() {
|
|
247
|
-
return transformEncoder3(
|
|
248
|
-
getStructEncoder3([
|
|
249
|
-
["discriminator", fixEncoderSize3(getBytesEncoder3(), 8)],
|
|
250
|
-
["master", getAddressEncoder3()],
|
|
251
|
-
["authority", getAddressEncoder3()],
|
|
252
|
-
["mint", getAddressEncoder3()],
|
|
253
|
-
["delegateAuthority", getAddressEncoder3()],
|
|
254
|
-
["presale", getAddressEncoder3()],
|
|
255
|
-
["merkleRoot", fixEncoderSize3(getBytesEncoder3(), 32)],
|
|
256
|
-
["supply", getU64Encoder3()],
|
|
257
|
-
["boost", getU64Encoder3()],
|
|
258
|
-
["startsAt", getI64Encoder()],
|
|
259
|
-
["endsAt", getI64Encoder()],
|
|
260
|
-
["bitmapCount", getU16Encoder2()],
|
|
261
|
-
["delegatePermissions", getU8Encoder3()],
|
|
262
|
-
["mutable", getU8Encoder3()],
|
|
263
|
-
["state", getU8Encoder3()],
|
|
264
|
-
["version", getU8Encoder3()],
|
|
265
|
-
["bump", getU8Encoder3()],
|
|
266
|
-
["padding", fixEncoderSize3(getBytesEncoder3(), 1)]
|
|
267
|
-
]),
|
|
268
|
-
(value) => ({ ...value, discriminator: AIRDROP_DISCRIMINATOR })
|
|
269
|
-
);
|
|
270
|
-
}
|
|
271
|
-
function getAirdropDecoder() {
|
|
272
|
-
return getStructDecoder3([
|
|
273
|
-
["discriminator", fixDecoderSize3(getBytesDecoder3(), 8)],
|
|
274
|
-
["master", getAddressDecoder3()],
|
|
275
|
-
["authority", getAddressDecoder3()],
|
|
276
|
-
["mint", getAddressDecoder3()],
|
|
277
|
-
["delegateAuthority", getAddressDecoder3()],
|
|
278
|
-
["presale", getAddressDecoder3()],
|
|
279
|
-
["merkleRoot", fixDecoderSize3(getBytesDecoder3(), 32)],
|
|
280
|
-
["supply", getU64Decoder3()],
|
|
281
|
-
["boost", getU64Decoder3()],
|
|
282
|
-
["startsAt", getI64Decoder()],
|
|
283
|
-
["endsAt", getI64Decoder()],
|
|
284
|
-
["bitmapCount", getU16Decoder2()],
|
|
285
|
-
["delegatePermissions", getU8Decoder3()],
|
|
286
|
-
["mutable", getU8Decoder3()],
|
|
287
|
-
["state", getU8Decoder3()],
|
|
288
|
-
["version", getU8Decoder3()],
|
|
289
|
-
["bump", getU8Decoder3()],
|
|
290
|
-
["padding", fixDecoderSize3(getBytesDecoder3(), 1)]
|
|
291
|
-
]);
|
|
292
|
-
}
|
|
293
|
-
function getAirdropCodec() {
|
|
294
|
-
return combineCodec3(getAirdropEncoder(), getAirdropDecoder());
|
|
295
|
-
}
|
|
296
|
-
function decodeAirdrop(encodedAccount) {
|
|
297
|
-
return decodeAccount3(
|
|
298
|
-
encodedAccount,
|
|
299
|
-
getAirdropDecoder()
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
async function fetchAirdrop(rpc, address2, config) {
|
|
303
|
-
const maybeAccount = await fetchMaybeAirdrop(rpc, address2, config);
|
|
304
|
-
assertAccountExists3(maybeAccount);
|
|
305
|
-
return maybeAccount;
|
|
306
|
-
}
|
|
307
|
-
async function fetchMaybeAirdrop(rpc, address2, config) {
|
|
308
|
-
const maybeAccount = await fetchEncodedAccount3(rpc, address2, config);
|
|
309
|
-
return decodeAirdrop(maybeAccount);
|
|
310
|
-
}
|
|
311
|
-
async function fetchAllAirdrop(rpc, addresses, config) {
|
|
312
|
-
const maybeAccounts = await fetchAllMaybeAirdrop(rpc, addresses, config);
|
|
313
|
-
assertAccountsExist3(maybeAccounts);
|
|
314
|
-
return maybeAccounts;
|
|
315
|
-
}
|
|
316
|
-
async function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
317
|
-
const maybeAccounts = await fetchEncodedAccounts3(rpc, addresses, config);
|
|
318
|
-
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
319
|
-
}
|
|
320
|
-
function getAirdropSize() {
|
|
321
|
-
return 240;
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// src/accounts/airdropConfig.ts
|
|
325
|
-
import {
|
|
326
|
-
assertAccountExists as assertAccountExists4,
|
|
327
|
-
assertAccountsExist as assertAccountsExist4,
|
|
328
|
-
combineCodec as combineCodec4,
|
|
329
|
-
decodeAccount as decodeAccount4,
|
|
330
|
-
fetchEncodedAccount as fetchEncodedAccount4,
|
|
331
|
-
fetchEncodedAccounts as fetchEncodedAccounts4,
|
|
332
|
-
fixDecoderSize as fixDecoderSize4,
|
|
333
|
-
fixEncoderSize as fixEncoderSize4,
|
|
334
|
-
getBytesDecoder as getBytesDecoder4,
|
|
335
|
-
getBytesEncoder as getBytesEncoder4,
|
|
336
|
-
getI64Decoder as getI64Decoder2,
|
|
337
|
-
getI64Encoder as getI64Encoder2,
|
|
338
|
-
getStructDecoder as getStructDecoder4,
|
|
339
|
-
getStructEncoder as getStructEncoder4,
|
|
340
|
-
getU64Decoder as getU64Decoder4,
|
|
341
|
-
getU64Encoder as getU64Encoder4,
|
|
342
|
-
getU8Decoder as getU8Decoder4,
|
|
343
|
-
getU8Encoder as getU8Encoder4,
|
|
344
|
-
transformEncoder as transformEncoder4
|
|
345
|
-
} from "@solana/kit";
|
|
346
|
-
var AIRDROP_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
347
|
-
194,
|
|
348
|
-
149,
|
|
349
|
-
223,
|
|
350
|
-
142,
|
|
351
|
-
42,
|
|
352
|
-
98,
|
|
353
|
-
128,
|
|
354
|
-
16
|
|
355
|
-
]);
|
|
356
|
-
function getAirdropConfigDiscriminatorBytes() {
|
|
357
|
-
return fixEncoderSize4(getBytesEncoder4(), 8).encode(
|
|
358
|
-
AIRDROP_CONFIG_DISCRIMINATOR
|
|
359
|
-
);
|
|
360
|
-
}
|
|
361
|
-
function getAirdropConfigEncoder() {
|
|
362
|
-
return transformEncoder4(
|
|
363
|
-
getStructEncoder4([
|
|
364
|
-
["discriminator", fixEncoderSize4(getBytesEncoder4(), 8)],
|
|
365
|
-
["merkleRoot", fixEncoderSize4(getBytesEncoder4(), 32)],
|
|
366
|
-
["minAirdropDuration", getI64Encoder2()],
|
|
367
|
-
["maxAirdropDuration", getI64Encoder2()],
|
|
368
|
-
["updateGracePeriod", getI64Encoder2()],
|
|
369
|
-
["createAirdropMasterFee", getU64Encoder4()],
|
|
370
|
-
["upgradeAirdropMasterFee", getU64Encoder4()],
|
|
371
|
-
["withdrawFeeBasis", getU64Encoder4()],
|
|
372
|
-
["perBoostAmount", getU64Encoder4()],
|
|
373
|
-
["bump", getU8Encoder4()]
|
|
374
|
-
]),
|
|
375
|
-
(value) => ({ ...value, discriminator: AIRDROP_CONFIG_DISCRIMINATOR })
|
|
376
|
-
);
|
|
377
|
-
}
|
|
378
|
-
function getAirdropConfigDecoder() {
|
|
379
|
-
return getStructDecoder4([
|
|
380
|
-
["discriminator", fixDecoderSize4(getBytesDecoder4(), 8)],
|
|
381
|
-
["merkleRoot", fixDecoderSize4(getBytesDecoder4(), 32)],
|
|
382
|
-
["minAirdropDuration", getI64Decoder2()],
|
|
383
|
-
["maxAirdropDuration", getI64Decoder2()],
|
|
384
|
-
["updateGracePeriod", getI64Decoder2()],
|
|
385
|
-
["createAirdropMasterFee", getU64Decoder4()],
|
|
386
|
-
["upgradeAirdropMasterFee", getU64Decoder4()],
|
|
387
|
-
["withdrawFeeBasis", getU64Decoder4()],
|
|
388
|
-
["perBoostAmount", getU64Decoder4()],
|
|
389
|
-
["bump", getU8Decoder4()]
|
|
390
|
-
]);
|
|
391
|
-
}
|
|
392
|
-
function getAirdropConfigCodec() {
|
|
393
|
-
return combineCodec4(getAirdropConfigEncoder(), getAirdropConfigDecoder());
|
|
394
|
-
}
|
|
395
|
-
function decodeAirdropConfig(encodedAccount) {
|
|
396
|
-
return decodeAccount4(
|
|
397
|
-
encodedAccount,
|
|
398
|
-
getAirdropConfigDecoder()
|
|
399
|
-
);
|
|
400
|
-
}
|
|
401
|
-
async function fetchAirdropConfig(rpc, address2, config) {
|
|
402
|
-
const maybeAccount = await fetchMaybeAirdropConfig(rpc, address2, config);
|
|
403
|
-
assertAccountExists4(maybeAccount);
|
|
404
|
-
return maybeAccount;
|
|
405
|
-
}
|
|
406
|
-
async function fetchMaybeAirdropConfig(rpc, address2, config) {
|
|
407
|
-
const maybeAccount = await fetchEncodedAccount4(rpc, address2, config);
|
|
408
|
-
return decodeAirdropConfig(maybeAccount);
|
|
409
|
-
}
|
|
410
|
-
async function fetchAllAirdropConfig(rpc, addresses, config) {
|
|
411
|
-
const maybeAccounts = await fetchAllMaybeAirdropConfig(
|
|
412
|
-
rpc,
|
|
413
|
-
addresses,
|
|
414
|
-
config
|
|
415
|
-
);
|
|
416
|
-
assertAccountsExist4(maybeAccounts);
|
|
417
|
-
return maybeAccounts;
|
|
418
|
-
}
|
|
419
|
-
async function fetchAllMaybeAirdropConfig(rpc, addresses, config) {
|
|
420
|
-
const maybeAccounts = await fetchEncodedAccounts4(rpc, addresses, config);
|
|
421
|
-
return maybeAccounts.map((maybeAccount) => decodeAirdropConfig(maybeAccount));
|
|
422
|
-
}
|
|
423
|
-
function getAirdropConfigSize() {
|
|
424
|
-
return 97;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
// src/accounts/airdropMaster.ts
|
|
428
|
-
import {
|
|
429
|
-
assertAccountExists as assertAccountExists5,
|
|
430
|
-
assertAccountsExist as assertAccountsExist5,
|
|
431
|
-
combineCodec as combineCodec5,
|
|
432
|
-
decodeAccount as decodeAccount5,
|
|
433
|
-
fetchEncodedAccount as fetchEncodedAccount5,
|
|
434
|
-
fetchEncodedAccounts as fetchEncodedAccounts5,
|
|
435
|
-
fixDecoderSize as fixDecoderSize5,
|
|
436
|
-
fixEncoderSize as fixEncoderSize5,
|
|
437
|
-
getAddressDecoder as getAddressDecoder4,
|
|
438
|
-
getAddressEncoder as getAddressEncoder4,
|
|
439
|
-
getBytesDecoder as getBytesDecoder5,
|
|
440
|
-
getBytesEncoder as getBytesEncoder5,
|
|
441
|
-
getStructDecoder as getStructDecoder5,
|
|
442
|
-
getStructEncoder as getStructEncoder5,
|
|
443
|
-
getU64Decoder as getU64Decoder5,
|
|
444
|
-
getU64Encoder as getU64Encoder5,
|
|
445
|
-
getU8Decoder as getU8Decoder5,
|
|
446
|
-
getU8Encoder as getU8Encoder5,
|
|
447
|
-
transformEncoder as transformEncoder5
|
|
448
|
-
} from "@solana/kit";
|
|
449
|
-
var AIRDROP_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
450
|
-
31,
|
|
451
|
-
109,
|
|
452
|
-
100,
|
|
453
|
-
62,
|
|
454
|
-
106,
|
|
455
|
-
173,
|
|
456
|
-
5,
|
|
457
|
-
4
|
|
458
|
-
]);
|
|
459
|
-
function getAirdropMasterDiscriminatorBytes() {
|
|
460
|
-
return fixEncoderSize5(getBytesEncoder5(), 8).encode(
|
|
461
|
-
AIRDROP_MASTER_DISCRIMINATOR
|
|
462
|
-
);
|
|
463
|
-
}
|
|
464
|
-
function getAirdropMasterEncoder() {
|
|
465
|
-
return transformEncoder5(
|
|
466
|
-
getStructEncoder5([
|
|
467
|
-
["discriminator", fixEncoderSize5(getBytesEncoder5(), 8)],
|
|
468
|
-
["affiliateMaster", getAddressEncoder4()],
|
|
469
|
-
["authority", getAddressEncoder4()],
|
|
470
|
-
["merkleRoot", fixEncoderSize5(getBytesEncoder5(), 32)],
|
|
471
|
-
["airdropsCreated", getU64Encoder5()],
|
|
472
|
-
["maxAirdropsAllowed", getU64Encoder5()],
|
|
473
|
-
["bitmapCreated", getU64Encoder5()],
|
|
474
|
-
["maxBitmapAllowed", getU64Encoder5()],
|
|
475
|
-
["airdropCreationFee", getU64Encoder5()],
|
|
476
|
-
["bitmapCreationFee", getU64Encoder5()],
|
|
477
|
-
["airdropUpdateFee", getU64Encoder5()],
|
|
478
|
-
["airdropClaimFee", getU64Encoder5()],
|
|
479
|
-
["airdropDelegateFee", getU64Encoder5()],
|
|
480
|
-
["airdropDepositFee", getU64Encoder5()],
|
|
481
|
-
["bump", getU8Encoder5()],
|
|
482
|
-
["padding", fixEncoderSize5(getBytesEncoder5(), 7)]
|
|
483
|
-
]),
|
|
484
|
-
(value) => ({ ...value, discriminator: AIRDROP_MASTER_DISCRIMINATOR })
|
|
485
|
-
);
|
|
486
|
-
}
|
|
487
|
-
function getAirdropMasterDecoder() {
|
|
488
|
-
return getStructDecoder5([
|
|
489
|
-
["discriminator", fixDecoderSize5(getBytesDecoder5(), 8)],
|
|
490
|
-
["affiliateMaster", getAddressDecoder4()],
|
|
491
|
-
["authority", getAddressDecoder4()],
|
|
492
|
-
["merkleRoot", fixDecoderSize5(getBytesDecoder5(), 32)],
|
|
493
|
-
["airdropsCreated", getU64Decoder5()],
|
|
494
|
-
["maxAirdropsAllowed", getU64Decoder5()],
|
|
495
|
-
["bitmapCreated", getU64Decoder5()],
|
|
496
|
-
["maxBitmapAllowed", getU64Decoder5()],
|
|
497
|
-
["airdropCreationFee", getU64Decoder5()],
|
|
498
|
-
["bitmapCreationFee", getU64Decoder5()],
|
|
499
|
-
["airdropUpdateFee", getU64Decoder5()],
|
|
500
|
-
["airdropClaimFee", getU64Decoder5()],
|
|
501
|
-
["airdropDelegateFee", getU64Decoder5()],
|
|
502
|
-
["airdropDepositFee", getU64Decoder5()],
|
|
503
|
-
["bump", getU8Decoder5()],
|
|
504
|
-
["padding", fixDecoderSize5(getBytesDecoder5(), 7)]
|
|
505
|
-
]);
|
|
506
|
-
}
|
|
507
|
-
function getAirdropMasterCodec() {
|
|
508
|
-
return combineCodec5(getAirdropMasterEncoder(), getAirdropMasterDecoder());
|
|
509
|
-
}
|
|
510
|
-
function decodeAirdropMaster(encodedAccount) {
|
|
511
|
-
return decodeAccount5(
|
|
512
|
-
encodedAccount,
|
|
513
|
-
getAirdropMasterDecoder()
|
|
514
|
-
);
|
|
515
|
-
}
|
|
516
|
-
async function fetchAirdropMaster(rpc, address2, config) {
|
|
517
|
-
const maybeAccount = await fetchMaybeAirdropMaster(rpc, address2, config);
|
|
518
|
-
assertAccountExists5(maybeAccount);
|
|
519
|
-
return maybeAccount;
|
|
520
|
-
}
|
|
521
|
-
async function fetchMaybeAirdropMaster(rpc, address2, config) {
|
|
522
|
-
const maybeAccount = await fetchEncodedAccount5(rpc, address2, config);
|
|
523
|
-
return decodeAirdropMaster(maybeAccount);
|
|
524
|
-
}
|
|
525
|
-
async function fetchAllAirdropMaster(rpc, addresses, config) {
|
|
526
|
-
const maybeAccounts = await fetchAllMaybeAirdropMaster(
|
|
527
|
-
rpc,
|
|
528
|
-
addresses,
|
|
529
|
-
config
|
|
530
|
-
);
|
|
531
|
-
assertAccountsExist5(maybeAccounts);
|
|
532
|
-
return maybeAccounts;
|
|
533
|
-
}
|
|
534
|
-
async function fetchAllMaybeAirdropMaster(rpc, addresses, config) {
|
|
535
|
-
const maybeAccounts = await fetchEncodedAccounts5(rpc, addresses, config);
|
|
536
|
-
return maybeAccounts.map((maybeAccount) => decodeAirdropMaster(maybeAccount));
|
|
537
|
-
}
|
|
538
|
-
function getAirdropMasterSize() {
|
|
539
|
-
return 192;
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
// src/accounts/claimMap.ts
|
|
543
|
-
import {
|
|
544
|
-
assertAccountExists as assertAccountExists6,
|
|
545
|
-
assertAccountsExist as assertAccountsExist6,
|
|
546
|
-
combineCodec as combineCodec6,
|
|
547
|
-
decodeAccount as decodeAccount6,
|
|
548
|
-
fetchEncodedAccount as fetchEncodedAccount6,
|
|
549
|
-
fetchEncodedAccounts as fetchEncodedAccounts6,
|
|
550
|
-
fixDecoderSize as fixDecoderSize6,
|
|
551
|
-
fixEncoderSize as fixEncoderSize6,
|
|
552
|
-
getAddressDecoder as getAddressDecoder5,
|
|
553
|
-
getAddressEncoder as getAddressEncoder5,
|
|
554
|
-
getBytesDecoder as getBytesDecoder6,
|
|
555
|
-
getBytesEncoder as getBytesEncoder6,
|
|
556
|
-
getStructDecoder as getStructDecoder6,
|
|
557
|
-
getStructEncoder as getStructEncoder6,
|
|
558
|
-
getU16Decoder as getU16Decoder3,
|
|
559
|
-
getU16Encoder as getU16Encoder3,
|
|
560
|
-
getU32Decoder as getU32Decoder2,
|
|
561
|
-
getU32Encoder as getU32Encoder2,
|
|
562
|
-
getU8Decoder as getU8Decoder6,
|
|
563
|
-
getU8Encoder as getU8Encoder6,
|
|
564
|
-
transformEncoder as transformEncoder6
|
|
565
|
-
} from "@solana/kit";
|
|
566
|
-
var CLAIM_MAP_DISCRIMINATOR = new Uint8Array([
|
|
567
|
-
193,
|
|
568
|
-
62,
|
|
569
|
-
74,
|
|
570
|
-
131,
|
|
571
|
-
13,
|
|
572
|
-
161,
|
|
573
|
-
53,
|
|
574
|
-
215
|
|
575
|
-
]);
|
|
576
|
-
function getClaimMapDiscriminatorBytes() {
|
|
577
|
-
return fixEncoderSize6(getBytesEncoder6(), 8).encode(CLAIM_MAP_DISCRIMINATOR);
|
|
578
|
-
}
|
|
579
|
-
function getClaimMapEncoder() {
|
|
580
|
-
return transformEncoder6(
|
|
581
|
-
getStructEncoder6([
|
|
582
|
-
["discriminator", fixEncoderSize6(getBytesEncoder6(), 8)],
|
|
583
|
-
["authority", getAddressEncoder5()],
|
|
584
|
-
["airdrop", getAddressEncoder5()],
|
|
585
|
-
["claimedBitmap", fixEncoderSize6(getBytesEncoder6(), 8e3)],
|
|
586
|
-
["total", getU32Encoder2()],
|
|
587
|
-
["id", getU16Encoder3()],
|
|
588
|
-
["version", getU8Encoder6()],
|
|
589
|
-
["bump", getU8Encoder6()]
|
|
590
|
-
]),
|
|
591
|
-
(value) => ({ ...value, discriminator: CLAIM_MAP_DISCRIMINATOR })
|
|
592
|
-
);
|
|
593
|
-
}
|
|
594
|
-
function getClaimMapDecoder() {
|
|
595
|
-
return getStructDecoder6([
|
|
596
|
-
["discriminator", fixDecoderSize6(getBytesDecoder6(), 8)],
|
|
597
|
-
["authority", getAddressDecoder5()],
|
|
598
|
-
["airdrop", getAddressDecoder5()],
|
|
599
|
-
["claimedBitmap", fixDecoderSize6(getBytesDecoder6(), 8e3)],
|
|
600
|
-
["total", getU32Decoder2()],
|
|
601
|
-
["id", getU16Decoder3()],
|
|
602
|
-
["version", getU8Decoder6()],
|
|
603
|
-
["bump", getU8Decoder6()]
|
|
604
|
-
]);
|
|
605
|
-
}
|
|
606
|
-
function getClaimMapCodec() {
|
|
607
|
-
return combineCodec6(getClaimMapEncoder(), getClaimMapDecoder());
|
|
608
|
-
}
|
|
609
|
-
function decodeClaimMap(encodedAccount) {
|
|
610
|
-
return decodeAccount6(
|
|
611
|
-
encodedAccount,
|
|
612
|
-
getClaimMapDecoder()
|
|
613
|
-
);
|
|
614
|
-
}
|
|
615
|
-
async function fetchClaimMap(rpc, address2, config) {
|
|
616
|
-
const maybeAccount = await fetchMaybeClaimMap(rpc, address2, config);
|
|
617
|
-
assertAccountExists6(maybeAccount);
|
|
618
|
-
return maybeAccount;
|
|
619
|
-
}
|
|
620
|
-
async function fetchMaybeClaimMap(rpc, address2, config) {
|
|
621
|
-
const maybeAccount = await fetchEncodedAccount6(rpc, address2, config);
|
|
622
|
-
return decodeClaimMap(maybeAccount);
|
|
623
|
-
}
|
|
624
|
-
async function fetchAllClaimMap(rpc, addresses, config) {
|
|
625
|
-
const maybeAccounts = await fetchAllMaybeClaimMap(rpc, addresses, config);
|
|
626
|
-
assertAccountsExist6(maybeAccounts);
|
|
627
|
-
return maybeAccounts;
|
|
628
|
-
}
|
|
629
|
-
async function fetchAllMaybeClaimMap(rpc, addresses, config) {
|
|
630
|
-
const maybeAccounts = await fetchEncodedAccounts6(rpc, addresses, config);
|
|
631
|
-
return maybeAccounts.map((maybeAccount) => decodeClaimMap(maybeAccount));
|
|
632
|
-
}
|
|
633
|
-
function getClaimMapSize() {
|
|
634
|
-
return 8080;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
// src/accounts/master.ts
|
|
638
|
-
import {
|
|
639
|
-
assertAccountExists as assertAccountExists7,
|
|
640
|
-
assertAccountsExist as assertAccountsExist7,
|
|
641
|
-
combineCodec as combineCodec7,
|
|
642
|
-
decodeAccount as decodeAccount7,
|
|
643
|
-
fetchEncodedAccount as fetchEncodedAccount7,
|
|
644
|
-
fetchEncodedAccounts as fetchEncodedAccounts7,
|
|
645
|
-
fixDecoderSize as fixDecoderSize7,
|
|
646
|
-
fixEncoderSize as fixEncoderSize7,
|
|
647
|
-
getAddressDecoder as getAddressDecoder6,
|
|
648
|
-
getAddressEncoder as getAddressEncoder6,
|
|
649
|
-
getBytesDecoder as getBytesDecoder7,
|
|
650
|
-
getBytesEncoder as getBytesEncoder7,
|
|
651
|
-
getStructDecoder as getStructDecoder7,
|
|
652
|
-
getStructEncoder as getStructEncoder7,
|
|
653
|
-
getU64Decoder as getU64Decoder6,
|
|
654
|
-
getU64Encoder as getU64Encoder6,
|
|
655
|
-
getU8Decoder as getU8Decoder7,
|
|
656
|
-
getU8Encoder as getU8Encoder7,
|
|
657
|
-
transformEncoder as transformEncoder7
|
|
658
|
-
} from "@solana/kit";
|
|
659
|
-
var MASTER_DISCRIMINATOR = new Uint8Array([
|
|
660
|
-
168,
|
|
661
|
-
213,
|
|
662
|
-
193,
|
|
663
|
-
12,
|
|
664
|
-
77,
|
|
665
|
-
162,
|
|
666
|
-
58,
|
|
667
|
-
235
|
|
668
|
-
]);
|
|
669
|
-
function getMasterDiscriminatorBytes() {
|
|
670
|
-
return fixEncoderSize7(getBytesEncoder7(), 8).encode(MASTER_DISCRIMINATOR);
|
|
671
|
-
}
|
|
672
|
-
function getMasterEncoder() {
|
|
673
|
-
return transformEncoder7(
|
|
674
|
-
getStructEncoder7([
|
|
675
|
-
["discriminator", fixEncoderSize7(getBytesEncoder7(), 8)],
|
|
676
|
-
["authority", getAddressEncoder6()],
|
|
677
|
-
["treasury", getAddressEncoder6()],
|
|
678
|
-
["tokenMint", getAddressEncoder6()],
|
|
679
|
-
["protocolFee", getU64Encoder6()],
|
|
680
|
-
["bump", getU8Encoder7()]
|
|
681
|
-
]),
|
|
682
|
-
(value) => ({ ...value, discriminator: MASTER_DISCRIMINATOR })
|
|
683
|
-
);
|
|
684
|
-
}
|
|
685
|
-
function getMasterDecoder() {
|
|
686
|
-
return getStructDecoder7([
|
|
687
|
-
["discriminator", fixDecoderSize7(getBytesDecoder7(), 8)],
|
|
688
|
-
["authority", getAddressDecoder6()],
|
|
689
|
-
["treasury", getAddressDecoder6()],
|
|
690
|
-
["tokenMint", getAddressDecoder6()],
|
|
691
|
-
["protocolFee", getU64Decoder6()],
|
|
692
|
-
["bump", getU8Decoder7()]
|
|
693
|
-
]);
|
|
694
|
-
}
|
|
695
|
-
function getMasterCodec() {
|
|
696
|
-
return combineCodec7(getMasterEncoder(), getMasterDecoder());
|
|
697
|
-
}
|
|
698
|
-
function decodeMaster(encodedAccount) {
|
|
699
|
-
return decodeAccount7(
|
|
700
|
-
encodedAccount,
|
|
701
|
-
getMasterDecoder()
|
|
702
|
-
);
|
|
703
|
-
}
|
|
704
|
-
async function fetchMaster(rpc, address2, config) {
|
|
705
|
-
const maybeAccount = await fetchMaybeMaster(rpc, address2, config);
|
|
706
|
-
assertAccountExists7(maybeAccount);
|
|
707
|
-
return maybeAccount;
|
|
708
|
-
}
|
|
709
|
-
async function fetchMaybeMaster(rpc, address2, config) {
|
|
710
|
-
const maybeAccount = await fetchEncodedAccount7(rpc, address2, config);
|
|
711
|
-
return decodeMaster(maybeAccount);
|
|
712
|
-
}
|
|
713
|
-
async function fetchAllMaster(rpc, addresses, config) {
|
|
714
|
-
const maybeAccounts = await fetchAllMaybeMaster(rpc, addresses, config);
|
|
715
|
-
assertAccountsExist7(maybeAccounts);
|
|
716
|
-
return maybeAccounts;
|
|
717
|
-
}
|
|
718
|
-
async function fetchAllMaybeMaster(rpc, addresses, config) {
|
|
719
|
-
const maybeAccounts = await fetchEncodedAccounts7(rpc, addresses, config);
|
|
720
|
-
return maybeAccounts.map((maybeAccount) => decodeMaster(maybeAccount));
|
|
721
|
-
}
|
|
722
|
-
function getMasterSize() {
|
|
723
|
-
return 113;
|
|
724
|
-
}
|
|
725
|
-
|
|
726
|
-
// src/errors/dropsy.ts
|
|
727
|
-
import {
|
|
728
|
-
isProgramError
|
|
729
|
-
} from "@solana/kit";
|
|
730
|
-
|
|
731
|
-
// src/programs/dropsy.ts
|
|
732
|
-
import {
|
|
733
|
-
containsBytes,
|
|
734
|
-
fixEncoderSize as fixEncoderSize8,
|
|
735
|
-
getBytesEncoder as getBytesEncoder8
|
|
736
|
-
} from "@solana/kit";
|
|
737
|
-
var DROPSY_PROGRAM_ADDRESS = "6Bd4YUkwyvZTPMt1bu13zvw9t4TtoMTd6CFVMmaswB2M";
|
|
738
|
-
var DropsyAccount = /* @__PURE__ */ ((DropsyAccount2) => {
|
|
739
|
-
DropsyAccount2[DropsyAccount2["Affiliate"] = 0] = "Affiliate";
|
|
740
|
-
DropsyAccount2[DropsyAccount2["AffiliateMaster"] = 1] = "AffiliateMaster";
|
|
741
|
-
DropsyAccount2[DropsyAccount2["Airdrop"] = 2] = "Airdrop";
|
|
742
|
-
DropsyAccount2[DropsyAccount2["AirdropConfig"] = 3] = "AirdropConfig";
|
|
743
|
-
DropsyAccount2[DropsyAccount2["AirdropMaster"] = 4] = "AirdropMaster";
|
|
744
|
-
DropsyAccount2[DropsyAccount2["ClaimMap"] = 5] = "ClaimMap";
|
|
745
|
-
DropsyAccount2[DropsyAccount2["Master"] = 6] = "Master";
|
|
746
|
-
return DropsyAccount2;
|
|
747
|
-
})(DropsyAccount || {});
|
|
748
|
-
function identifyDropsyAccount(account) {
|
|
749
|
-
const data = "data" in account ? account.data : account;
|
|
750
|
-
if (containsBytes(
|
|
751
|
-
data,
|
|
752
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
753
|
-
new Uint8Array([136, 95, 107, 149, 36, 195, 146, 35])
|
|
754
|
-
),
|
|
755
|
-
0
|
|
756
|
-
)) {
|
|
757
|
-
return 0 /* Affiliate */;
|
|
758
|
-
}
|
|
759
|
-
if (containsBytes(
|
|
760
|
-
data,
|
|
761
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
762
|
-
new Uint8Array([25, 57, 134, 31, 30, 203, 219, 215])
|
|
763
|
-
),
|
|
764
|
-
0
|
|
765
|
-
)) {
|
|
766
|
-
return 1 /* AffiliateMaster */;
|
|
767
|
-
}
|
|
768
|
-
if (containsBytes(
|
|
769
|
-
data,
|
|
770
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
771
|
-
new Uint8Array([31, 112, 159, 158, 124, 237, 9, 241])
|
|
772
|
-
),
|
|
773
|
-
0
|
|
774
|
-
)) {
|
|
775
|
-
return 2 /* Airdrop */;
|
|
776
|
-
}
|
|
777
|
-
if (containsBytes(
|
|
778
|
-
data,
|
|
779
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
780
|
-
new Uint8Array([194, 149, 223, 142, 42, 98, 128, 16])
|
|
781
|
-
),
|
|
782
|
-
0
|
|
783
|
-
)) {
|
|
784
|
-
return 3 /* AirdropConfig */;
|
|
785
|
-
}
|
|
786
|
-
if (containsBytes(
|
|
787
|
-
data,
|
|
788
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
789
|
-
new Uint8Array([31, 109, 100, 62, 106, 173, 5, 4])
|
|
790
|
-
),
|
|
791
|
-
0
|
|
792
|
-
)) {
|
|
793
|
-
return 4 /* AirdropMaster */;
|
|
794
|
-
}
|
|
795
|
-
if (containsBytes(
|
|
796
|
-
data,
|
|
797
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
798
|
-
new Uint8Array([193, 62, 74, 131, 13, 161, 53, 215])
|
|
799
|
-
),
|
|
800
|
-
0
|
|
801
|
-
)) {
|
|
802
|
-
return 5 /* ClaimMap */;
|
|
803
|
-
}
|
|
804
|
-
if (containsBytes(
|
|
805
|
-
data,
|
|
806
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
807
|
-
new Uint8Array([168, 213, 193, 12, 77, 162, 58, 235])
|
|
808
|
-
),
|
|
809
|
-
0
|
|
810
|
-
)) {
|
|
811
|
-
return 6 /* Master */;
|
|
812
|
-
}
|
|
813
|
-
throw new Error(
|
|
814
|
-
"The provided account could not be identified as a dropsy account."
|
|
815
|
-
);
|
|
816
|
-
}
|
|
817
|
-
var DropsyInstruction = /* @__PURE__ */ ((DropsyInstruction2) => {
|
|
818
|
-
DropsyInstruction2[DropsyInstruction2["ClaimAirdrop"] = 0] = "ClaimAirdrop";
|
|
819
|
-
DropsyInstruction2[DropsyInstruction2["CreateAirdrop"] = 1] = "CreateAirdrop";
|
|
820
|
-
DropsyInstruction2[DropsyInstruction2["CreateClaimMap"] = 2] = "CreateClaimMap";
|
|
821
|
-
DropsyInstruction2[DropsyInstruction2["DepositTokens"] = 3] = "DepositTokens";
|
|
822
|
-
DropsyInstruction2[DropsyInstruction2["InitializeAirdropMaster"] = 4] = "InitializeAirdropMaster";
|
|
823
|
-
DropsyInstruction2[DropsyInstruction2["InitializeMaster"] = 5] = "InitializeMaster";
|
|
824
|
-
DropsyInstruction2[DropsyInstruction2["RedeemAirdropTokens"] = 6] = "RedeemAirdropTokens";
|
|
825
|
-
return DropsyInstruction2;
|
|
826
|
-
})(DropsyInstruction || {});
|
|
827
|
-
function identifyDropsyInstruction(instruction) {
|
|
828
|
-
const data = "data" in instruction ? instruction.data : instruction;
|
|
829
|
-
if (containsBytes(
|
|
830
|
-
data,
|
|
831
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
832
|
-
new Uint8Array([137, 50, 122, 111, 89, 254, 8, 20])
|
|
833
|
-
),
|
|
834
|
-
0
|
|
835
|
-
)) {
|
|
836
|
-
return 0 /* ClaimAirdrop */;
|
|
837
|
-
}
|
|
838
|
-
if (containsBytes(
|
|
839
|
-
data,
|
|
840
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
841
|
-
new Uint8Array([227, 135, 208, 66, 137, 177, 80, 94])
|
|
842
|
-
),
|
|
843
|
-
0
|
|
844
|
-
)) {
|
|
845
|
-
return 1 /* CreateAirdrop */;
|
|
846
|
-
}
|
|
847
|
-
if (containsBytes(
|
|
848
|
-
data,
|
|
849
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
850
|
-
new Uint8Array([22, 150, 81, 49, 214, 142, 189, 122])
|
|
851
|
-
),
|
|
852
|
-
0
|
|
853
|
-
)) {
|
|
854
|
-
return 2 /* CreateClaimMap */;
|
|
855
|
-
}
|
|
856
|
-
if (containsBytes(
|
|
857
|
-
data,
|
|
858
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
859
|
-
new Uint8Array([176, 83, 229, 18, 191, 143, 176, 150])
|
|
860
|
-
),
|
|
861
|
-
0
|
|
862
|
-
)) {
|
|
863
|
-
return 3 /* DepositTokens */;
|
|
864
|
-
}
|
|
865
|
-
if (containsBytes(
|
|
866
|
-
data,
|
|
867
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
868
|
-
new Uint8Array([163, 197, 170, 44, 57, 57, 90, 65])
|
|
869
|
-
),
|
|
870
|
-
0
|
|
871
|
-
)) {
|
|
872
|
-
return 4 /* InitializeAirdropMaster */;
|
|
873
|
-
}
|
|
874
|
-
if (containsBytes(
|
|
875
|
-
data,
|
|
876
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
877
|
-
new Uint8Array([206, 91, 246, 30, 216, 101, 134, 166])
|
|
878
|
-
),
|
|
879
|
-
0
|
|
880
|
-
)) {
|
|
881
|
-
return 5 /* InitializeMaster */;
|
|
882
|
-
}
|
|
883
|
-
if (containsBytes(
|
|
884
|
-
data,
|
|
885
|
-
fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
886
|
-
new Uint8Array([102, 70, 115, 13, 97, 198, 59, 103])
|
|
887
|
-
),
|
|
888
|
-
0
|
|
889
|
-
)) {
|
|
890
|
-
return 6 /* RedeemAirdropTokens */;
|
|
891
|
-
}
|
|
892
|
-
throw new Error(
|
|
893
|
-
"The provided instruction could not be identified as a dropsy instruction."
|
|
894
|
-
);
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
// src/errors/dropsy.ts
|
|
898
|
-
var DROPSY_ERROR__VALUE_OUT_OF_RANGE = 6001;
|
|
899
|
-
var DROPSY_ERROR__VALUE_BELOW_THE_MINIMUM = 6002;
|
|
900
|
-
var DROPSY_ERROR__VALUE_EXCEEDS_MAXIMUM = 6003;
|
|
901
|
-
var DROPSY_ERROR__INVALID_PERCENTAGE = 6004;
|
|
902
|
-
var DROPSY_ERROR__INVALID_TIMESTAMP = 6006;
|
|
903
|
-
var DROPSY_ERROR__NON_ZERO_VALUE_REQUIRED = 6007;
|
|
904
|
-
var DROPSY_ERROR__INVALID_PUB_KEY = 6008;
|
|
905
|
-
var DROPSY_ERROR__UN_AUTHORIZED = 6009;
|
|
906
|
-
var DROPSY_ERROR__INVALID_MUTABILITY = 6010;
|
|
907
|
-
var DROPSY_ERROR__INVALID_DELEGATE_PERMISSION = 6011;
|
|
908
|
-
var DROPSY_ERROR__AIRDROP_NOT_STARTED = 6100;
|
|
909
|
-
var DROPSY_ERROR__AIRDROP_ENDED = 6101;
|
|
910
|
-
var DROPSY_ERROR__AIRDROP_NOT_ENDED = 6102;
|
|
911
|
-
var DROPSY_ERROR__DURATION_TOO_SHORT = 6103;
|
|
912
|
-
var DROPSY_ERROR__INVALID_END_TIME = 6104;
|
|
913
|
-
var DROPSY_ERROR__INVALID_VESTING_SCHEDULE = 6105;
|
|
914
|
-
var DROPSY_ERROR__IMMUTABLE_AIRDROP = 6106;
|
|
915
|
-
var DROPSY_ERROR__IMMUTABLE_FIELD = 6107;
|
|
916
|
-
var DROPSY_ERROR__UPDATE_CUTOFF_TIME_PASSED = 6108;
|
|
917
|
-
var DROPSY_ERROR__MAX_AIRDROPS_REACHED = 6109;
|
|
918
|
-
var DROPSY_ERROR__MAX_CLAIM_MAPS_REACHED = 6110;
|
|
919
|
-
var DROPSY_ERROR__INVALID_ADMIN = 6200;
|
|
920
|
-
var DROPSY_ERROR__OWNER_MISMATCH = 6201;
|
|
921
|
-
var DROPSY_ERROR__INVALID_VAULT_AUTHORITY = 6202;
|
|
922
|
-
var DROPSY_ERROR__INVALID_DESTINATION_OWNER = 6203;
|
|
923
|
-
var DROPSY_ERROR__INVALID_AFFILIATE_PDA = 6204;
|
|
924
|
-
var DROPSY_ERROR__UNAUTHORIZED = 6205;
|
|
925
|
-
var DROPSY_ERROR__INVALID_OWNER = 6206;
|
|
926
|
-
var DROPSY_ERROR__INVALID_MINT = 6300;
|
|
927
|
-
var DROPSY_ERROR__MINT_MISMATCH = 6301;
|
|
928
|
-
var DROPSY_ERROR__VAULT_MINT_MISMATCH = 6302;
|
|
929
|
-
var DROPSY_ERROR__DESTINATION_MINT_MISMATCH = 6303;
|
|
930
|
-
var DROPSY_ERROR__MINT_IS_FROZEN = 6304;
|
|
931
|
-
var DROPSY_ERROR__INVALID_MINT_OWNER = 6305;
|
|
932
|
-
var DROPSY_ERROR__MINT_IS_NOT_INITIALIZED = 6306;
|
|
933
|
-
var DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY = 6307;
|
|
934
|
-
var DROPSY_ERROR__NFT_NOT_ALLOWED = 6308;
|
|
935
|
-
var DROPSY_ERROR__VAULT_HAS_DELEGATE = 6401;
|
|
936
|
-
var DROPSY_ERROR__VAULT_FROZEN = 6402;
|
|
937
|
-
var DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY = 6403;
|
|
938
|
-
var DROPSY_ERROR__INVALID_AIRDROP_PDA = 6404;
|
|
939
|
-
var DROPSY_ERROR__VAULT_NOT_INITIALIZED = 6405;
|
|
940
|
-
var DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS = 6406;
|
|
941
|
-
var DROPSY_ERROR__SOURCE_HAS_DELEGATE = 6450;
|
|
942
|
-
var DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN = 6451;
|
|
943
|
-
var DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY = 6452;
|
|
944
|
-
var DROPSY_ERROR__INVALID_PROOF = 6500;
|
|
945
|
-
var DROPSY_ERROR__ALREADY_CLAIMED = 6501;
|
|
946
|
-
var DROPSY_ERROR__MISSING_BITMAP_PDA = 6502;
|
|
947
|
-
var DROPSY_ERROR__INVALID_BITMAP_ACCOUNT = 6503;
|
|
948
|
-
var DROPSY_ERROR__INVALID_BITMAP_INDEX = 6504;
|
|
949
|
-
var DROPSY_ERROR__TOO_MANY_BITMAPS = 6505;
|
|
950
|
-
var DROPSY_ERROR__BITMAP_TOO_LARGE = 6506;
|
|
951
|
-
var DROPSY_ERROR__INVALID_TOTAL = 6507;
|
|
952
|
-
var DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH = 6508;
|
|
953
|
-
var DROPSY_ERROR__ACTIVE_BITMAPS_EXIST = 6509;
|
|
954
|
-
var DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW = 6510;
|
|
955
|
-
var DROPSY_ERROR__INSUFFICIENT_DEPOSIT = 6600;
|
|
956
|
-
var DROPSY_ERROR__CREATE_FEE_TOO_HIGH = 6601;
|
|
957
|
-
var DROPSY_ERROR__CLAIM_FEE_TOO_HIGH = 6602;
|
|
958
|
-
var DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE = 6603;
|
|
959
|
-
var DROPSY_ERROR__INVALID_FEE_VAULT = 6604;
|
|
960
|
-
var DROPSY_ERROR__INVALID_FEE_VAULT_OWNER = 6605;
|
|
961
|
-
var DROPSY_ERROR__INVALID_FEE_VAULT_CURVE = 6606;
|
|
962
|
-
var DROPSY_ERROR__INVALID_PDA = 6700;
|
|
963
|
-
var DROPSY_ERROR__INVALID_AMOUNT = 6701;
|
|
964
|
-
var DROPSY_ERROR__OVERFLOW = 6702;
|
|
965
|
-
var DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT = 6703;
|
|
966
|
-
var DROPSY_ERROR__INVALID_TREASURY_ACCOUNT = 6704;
|
|
967
|
-
var DROPSY_ERROR__INVALID_AIRDROP_VERSION = 6705;
|
|
968
|
-
var DROPSY_ERROR__INVALID_VESTING_TYPE = 6707;
|
|
969
|
-
var DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED = 6708;
|
|
970
|
-
var DROPSY_ERROR__INVALID_PARENT_ACCOUNT = 6709;
|
|
971
|
-
var DROPSY_ERROR__INVALID_AIRDROP_VESTING_VERSION = 6710;
|
|
972
|
-
var DROPSY_ERROR__INVALID_AIRDROP_MASTER_ACCOUNT = 6711;
|
|
973
|
-
var dropsyErrorMessages;
|
|
974
|
-
if (process.env.NODE_ENV !== "production") {
|
|
975
|
-
dropsyErrorMessages = {
|
|
976
|
-
[DROPSY_ERROR__ACTIVE_BITMAPS_EXIST]: `Active bitmaps exist`,
|
|
977
|
-
[DROPSY_ERROR__AIRDROP_ENDED]: `Airdrop has already ended`,
|
|
978
|
-
[DROPSY_ERROR__AIRDROP_NOT_ENDED]: `Airdrop not yet ended`,
|
|
979
|
-
[DROPSY_ERROR__AIRDROP_NOT_STARTED]: `Airdrop has not started yet`,
|
|
980
|
-
[DROPSY_ERROR__ALREADY_CLAIMED]: `Tokens already claimed`,
|
|
981
|
-
[DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH]: `Bitmap/airdrop mismatch`,
|
|
982
|
-
[DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW]: `Bitmaps already closed`,
|
|
983
|
-
[DROPSY_ERROR__BITMAP_TOO_LARGE]: `Bitmap size exceeds limit`,
|
|
984
|
-
[DROPSY_ERROR__CLAIM_FEE_TOO_HIGH]: `Claim fee too high (>0.005 SOL)`,
|
|
985
|
-
[DROPSY_ERROR__CREATE_FEE_TOO_HIGH]: `Create fee too high (>0.05 SOL)`,
|
|
986
|
-
[DROPSY_ERROR__DESTINATION_MINT_MISMATCH]: `Destination mint doesn't match`,
|
|
987
|
-
[DROPSY_ERROR__DURATION_TOO_SHORT]: `Airdrop duration must be at least 24 hours`,
|
|
988
|
-
[DROPSY_ERROR__IMMUTABLE_AIRDROP]: `Airdrop is immutable`,
|
|
989
|
-
[DROPSY_ERROR__IMMUTABLE_FIELD]: `The target field is immutable`,
|
|
990
|
-
[DROPSY_ERROR__INSUFFICIENT_DEPOSIT]: `Insufficient SOL deposit`,
|
|
991
|
-
[DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE]: `Insufficient funds for fee`,
|
|
992
|
-
[DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS]: `Insufficient vault funds`,
|
|
993
|
-
[DROPSY_ERROR__INVALID_ADMIN]: `This Request Requires Admin Privileges`,
|
|
994
|
-
[DROPSY_ERROR__INVALID_AFFILIATE_PDA]: `Mismatched affiliate PDA`,
|
|
995
|
-
[DROPSY_ERROR__INVALID_AIRDROP_MASTER_ACCOUNT]: `Invalid Airdrop Master`,
|
|
996
|
-
[DROPSY_ERROR__INVALID_AIRDROP_PDA]: `Invalid vault account`,
|
|
997
|
-
[DROPSY_ERROR__INVALID_AIRDROP_VERSION]: `invalid airdrop version`,
|
|
998
|
-
[DROPSY_ERROR__INVALID_AIRDROP_VESTING_VERSION]: `Airdrop version don't support vesting`,
|
|
999
|
-
[DROPSY_ERROR__INVALID_AMOUNT]: `Invalid amount`,
|
|
1000
|
-
[DROPSY_ERROR__INVALID_BITMAP_ACCOUNT]: `Invalid bitmap account`,
|
|
1001
|
-
[DROPSY_ERROR__INVALID_BITMAP_INDEX]: `Invalid bitmap index`,
|
|
1002
|
-
[DROPSY_ERROR__INVALID_DELEGATE_PERMISSION]: `Invalid delegate permission Value`,
|
|
1003
|
-
[DROPSY_ERROR__INVALID_DESTINATION_OWNER]: `Destination account owner is not the signer`,
|
|
1004
|
-
[DROPSY_ERROR__INVALID_END_TIME]: `Airdrop must end at least 24 hours in the future`,
|
|
1005
|
-
[DROPSY_ERROR__INVALID_FEE_VAULT]: `Invalid fee vault`,
|
|
1006
|
-
[DROPSY_ERROR__INVALID_FEE_VAULT_CURVE]: `Fee vault not in curve`,
|
|
1007
|
-
[DROPSY_ERROR__INVALID_FEE_VAULT_OWNER]: `Invalid fee vault owner`,
|
|
1008
|
-
[DROPSY_ERROR__INVALID_MINT]: `Mint does not match stored state`,
|
|
1009
|
-
[DROPSY_ERROR__INVALID_MINT_OWNER]: `Invalid token program owner`,
|
|
1010
|
-
[DROPSY_ERROR__INVALID_MUTABILITY]: `Invalid mutability Value`,
|
|
1011
|
-
[DROPSY_ERROR__INVALID_OWNER]: `Transaction sender is not the owner`,
|
|
1012
|
-
[DROPSY_ERROR__INVALID_PARENT_ACCOUNT]: `Invalid Parent account provided`,
|
|
1013
|
-
[DROPSY_ERROR__INVALID_PDA]: `Invalid PDA account`,
|
|
1014
|
-
[DROPSY_ERROR__INVALID_PERCENTAGE]: `Invalid percentage (must be 0-100)`,
|
|
1015
|
-
[DROPSY_ERROR__INVALID_PROOF]: `Invalid merkle proof`,
|
|
1016
|
-
[DROPSY_ERROR__INVALID_PUB_KEY]: `Invalid Pubkey provided`,
|
|
1017
|
-
[DROPSY_ERROR__INVALID_TIMESTAMP]: `Invalid timestamp or duration`,
|
|
1018
|
-
[DROPSY_ERROR__INVALID_TOTAL]: `Invalid total claimers`,
|
|
1019
|
-
[DROPSY_ERROR__INVALID_TREASURY_ACCOUNT]: `invalid treasury account`,
|
|
1020
|
-
[DROPSY_ERROR__INVALID_VAULT_AUTHORITY]: `Invalid vault authority`,
|
|
1021
|
-
[DROPSY_ERROR__INVALID_VESTING_SCHEDULE]: `Vesting schedule is invalid`,
|
|
1022
|
-
[DROPSY_ERROR__INVALID_VESTING_TYPE]: `Invalid vesting type`,
|
|
1023
|
-
[DROPSY_ERROR__MAX_AIRDROPS_REACHED]: `Airdrop quota reached. Upgrade required for Airdrop Master.`,
|
|
1024
|
-
[DROPSY_ERROR__MAX_CLAIM_MAPS_REACHED]: `ClaimMap quota reached. Upgrade required for Airdrop Master.`,
|
|
1025
|
-
[DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY]: `Mint has freeze authority`,
|
|
1026
|
-
[DROPSY_ERROR__MINT_IS_FROZEN]: `Mint is frozen`,
|
|
1027
|
-
[DROPSY_ERROR__MINT_IS_NOT_INITIALIZED]: `Mint must be initialized`,
|
|
1028
|
-
[DROPSY_ERROR__MINT_MISMATCH]: `Provided mint doesn't match expected mint`,
|
|
1029
|
-
[DROPSY_ERROR__MISSING_BITMAP_PDA]: `Missing bitmap PDA`,
|
|
1030
|
-
[DROPSY_ERROR__NFT_NOT_ALLOWED]: `Fungible tokens only (no NFTs)`,
|
|
1031
|
-
[DROPSY_ERROR__NON_ZERO_VALUE_REQUIRED]: `Number must be non-zero`,
|
|
1032
|
-
[DROPSY_ERROR__OVERFLOW]: `Arithmetic overflow`,
|
|
1033
|
-
[DROPSY_ERROR__OWNER_MISMATCH]: `Airdrop owner mismatch`,
|
|
1034
|
-
[DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN]: `Source account is frozen`,
|
|
1035
|
-
[DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY]: `Source has close authority`,
|
|
1036
|
-
[DROPSY_ERROR__SOURCE_HAS_DELEGATE]: `Source has delegate set`,
|
|
1037
|
-
[DROPSY_ERROR__TOO_MANY_BITMAPS]: `Too many bitmap accounts`,
|
|
1038
|
-
[DROPSY_ERROR__UNAUTHORIZED]: `Not Authorized`,
|
|
1039
|
-
[DROPSY_ERROR__UN_AUTHORIZED]: `Invalid Authority Pubkey`,
|
|
1040
|
-
[DROPSY_ERROR__UPDATE_CUTOFF_TIME_PASSED]: `Airdrop updates are only allowed until cutoff time before start`,
|
|
1041
|
-
[DROPSY_ERROR__VALUE_BELOW_THE_MINIMUM]: `Value below the minimum`,
|
|
1042
|
-
[DROPSY_ERROR__VALUE_EXCEEDS_MAXIMUM]: `Value exceeds the maximum`,
|
|
1043
|
-
[DROPSY_ERROR__VALUE_OUT_OF_RANGE]: `Value out of range`,
|
|
1044
|
-
[DROPSY_ERROR__VAULT_FROZEN]: `Vault is frozen`,
|
|
1045
|
-
[DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY]: `Vault has close authority`,
|
|
1046
|
-
[DROPSY_ERROR__VAULT_HAS_DELEGATE]: `Vault has delegate set`,
|
|
1047
|
-
[DROPSY_ERROR__VAULT_MINT_MISMATCH]: `Vault mint doesn't match airdrop mint`,
|
|
1048
|
-
[DROPSY_ERROR__VAULT_NOT_INITIALIZED]: `Vault not initialized`,
|
|
1049
|
-
[DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT]: `Vault not rent exempt`,
|
|
1050
|
-
[DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED]: `vesting account required for vested airdrop`
|
|
1051
|
-
};
|
|
1052
|
-
}
|
|
1053
|
-
function getDropsyErrorMessage(code) {
|
|
1054
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1055
|
-
return dropsyErrorMessages[code];
|
|
1056
|
-
}
|
|
1057
|
-
return "Error message not available in production bundles.";
|
|
1058
|
-
}
|
|
1059
|
-
function isDropsyError(error, transactionMessage, code) {
|
|
1060
|
-
return isProgramError(
|
|
1061
|
-
error,
|
|
1062
|
-
transactionMessage,
|
|
1063
|
-
DROPSY_PROGRAM_ADDRESS,
|
|
1064
|
-
code
|
|
1065
|
-
);
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
// src/instructions/claimAirdrop.ts
|
|
1069
|
-
import {
|
|
1070
|
-
combineCodec as combineCodec8,
|
|
1071
|
-
fixDecoderSize as fixDecoderSize8,
|
|
1072
|
-
fixEncoderSize as fixEncoderSize9,
|
|
1073
|
-
getAddressEncoder as getAddressEncoder7,
|
|
1074
|
-
getArrayDecoder,
|
|
1075
|
-
getArrayEncoder,
|
|
1076
|
-
getBytesDecoder as getBytesDecoder8,
|
|
1077
|
-
getBytesEncoder as getBytesEncoder9,
|
|
1078
|
-
getProgramDerivedAddress,
|
|
1079
|
-
getStructDecoder as getStructDecoder8,
|
|
1080
|
-
getStructEncoder as getStructEncoder8,
|
|
1081
|
-
getU16Decoder as getU16Decoder4,
|
|
1082
|
-
getU16Encoder as getU16Encoder4,
|
|
1083
|
-
getU64Decoder as getU64Decoder7,
|
|
1084
|
-
getU64Encoder as getU64Encoder7,
|
|
1085
|
-
transformEncoder as transformEncoder8
|
|
1086
|
-
} from "@solana/kit";
|
|
1087
|
-
|
|
1088
|
-
// src/shared/index.ts
|
|
1089
|
-
import {
|
|
1090
|
-
AccountRole,
|
|
1091
|
-
isProgramDerivedAddress,
|
|
1092
|
-
isTransactionSigner as kitIsTransactionSigner,
|
|
1093
|
-
upgradeRoleToSigner
|
|
1094
|
-
} from "@solana/kit";
|
|
1095
|
-
function expectSome(value) {
|
|
1096
|
-
if (value === null || value === void 0) {
|
|
1097
|
-
throw new Error("Expected a value but received null or undefined.");
|
|
1098
|
-
}
|
|
1099
|
-
return value;
|
|
1100
|
-
}
|
|
1101
|
-
function expectAddress(value) {
|
|
1102
|
-
if (!value) {
|
|
1103
|
-
throw new Error("Expected a Address.");
|
|
1104
|
-
}
|
|
1105
|
-
if (typeof value === "object" && "address" in value) {
|
|
1106
|
-
return value.address;
|
|
1107
|
-
}
|
|
1108
|
-
if (Array.isArray(value)) {
|
|
1109
|
-
return value[0];
|
|
1110
|
-
}
|
|
1111
|
-
return value;
|
|
1112
|
-
}
|
|
1113
|
-
function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
1114
|
-
return (account) => {
|
|
1115
|
-
if (!account.value) {
|
|
1116
|
-
if (optionalAccountStrategy === "omitted") return;
|
|
1117
|
-
return Object.freeze({
|
|
1118
|
-
address: programAddress,
|
|
1119
|
-
role: AccountRole.READONLY
|
|
1120
|
-
});
|
|
1121
|
-
}
|
|
1122
|
-
const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
|
|
1123
|
-
return Object.freeze({
|
|
1124
|
-
address: expectAddress(account.value),
|
|
1125
|
-
role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
|
|
1126
|
-
...isTransactionSigner(account.value) ? { signer: account.value } : {}
|
|
1127
|
-
});
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
function isTransactionSigner(value) {
|
|
1131
|
-
return !!value && typeof value === "object" && "address" in value && kitIsTransactionSigner(value);
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
// src/instructions/claimAirdrop.ts
|
|
1135
|
-
var CLAIM_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1136
|
-
137,
|
|
1137
|
-
50,
|
|
1138
|
-
122,
|
|
1139
|
-
111,
|
|
1140
|
-
89,
|
|
1141
|
-
254,
|
|
1142
|
-
8,
|
|
1143
|
-
20
|
|
1144
|
-
]);
|
|
1145
|
-
function getClaimAirdropDiscriminatorBytes() {
|
|
1146
|
-
return fixEncoderSize9(getBytesEncoder9(), 8).encode(
|
|
1147
|
-
CLAIM_AIRDROP_DISCRIMINATOR
|
|
1148
|
-
);
|
|
1149
|
-
}
|
|
1150
|
-
function getClaimAirdropInstructionDataEncoder() {
|
|
1151
|
-
return transformEncoder8(
|
|
1152
|
-
getStructEncoder8([
|
|
1153
|
-
["discriminator", fixEncoderSize9(getBytesEncoder9(), 8)],
|
|
1154
|
-
["index", getU64Encoder7()],
|
|
1155
|
-
["proof", getArrayEncoder(fixEncoderSize9(getBytesEncoder9(), 32))],
|
|
1156
|
-
["amount", getU64Encoder7()],
|
|
1157
|
-
["claimMapIndex", getU16Encoder4()]
|
|
1158
|
-
]),
|
|
1159
|
-
(value) => ({ ...value, discriminator: CLAIM_AIRDROP_DISCRIMINATOR })
|
|
1160
|
-
);
|
|
1161
|
-
}
|
|
1162
|
-
function getClaimAirdropInstructionDataDecoder() {
|
|
1163
|
-
return getStructDecoder8([
|
|
1164
|
-
["discriminator", fixDecoderSize8(getBytesDecoder8(), 8)],
|
|
1165
|
-
["index", getU64Decoder7()],
|
|
1166
|
-
["proof", getArrayDecoder(fixDecoderSize8(getBytesDecoder8(), 32))],
|
|
1167
|
-
["amount", getU64Decoder7()],
|
|
1168
|
-
["claimMapIndex", getU16Decoder4()]
|
|
1169
|
-
]);
|
|
1170
|
-
}
|
|
1171
|
-
function getClaimAirdropInstructionDataCodec() {
|
|
1172
|
-
return combineCodec8(
|
|
1173
|
-
getClaimAirdropInstructionDataEncoder(),
|
|
1174
|
-
getClaimAirdropInstructionDataDecoder()
|
|
1175
|
-
);
|
|
1176
|
-
}
|
|
1177
|
-
async function getClaimAirdropInstructionAsync(input, config) {
|
|
1178
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1179
|
-
const originalAccounts = {
|
|
1180
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1181
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1182
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1183
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1184
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1185
|
-
sourceTokenAccount: {
|
|
1186
|
-
value: input.sourceTokenAccount ?? null,
|
|
1187
|
-
isWritable: true
|
|
1188
|
-
},
|
|
1189
|
-
destinationTokenAccount: {
|
|
1190
|
-
value: input.destinationTokenAccount ?? null,
|
|
1191
|
-
isWritable: true
|
|
1192
|
-
},
|
|
1193
|
-
airdrop: { value: input.airdrop ?? null, isWritable: false },
|
|
1194
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1195
|
-
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1196
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1197
|
-
claimer: { value: input.claimer ?? null, isWritable: true },
|
|
1198
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1199
|
-
associatedTokenProgram: {
|
|
1200
|
-
value: input.associatedTokenProgram ?? null,
|
|
1201
|
-
isWritable: false
|
|
1202
|
-
},
|
|
1203
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1204
|
-
};
|
|
1205
|
-
const accounts = originalAccounts;
|
|
1206
|
-
const args = { ...input };
|
|
1207
|
-
if (!accounts.master.value) {
|
|
1208
|
-
accounts.master.value = await getProgramDerivedAddress({
|
|
1209
|
-
programAddress,
|
|
1210
|
-
seeds: [
|
|
1211
|
-
getBytesEncoder9().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
1212
|
-
]
|
|
1213
|
-
});
|
|
1214
|
-
}
|
|
1215
|
-
if (!accounts.config.value) {
|
|
1216
|
-
accounts.config.value = await getProgramDerivedAddress({
|
|
1217
|
-
programAddress,
|
|
1218
|
-
seeds: [
|
|
1219
|
-
getBytesEncoder9().encode(
|
|
1220
|
-
new Uint8Array([
|
|
1221
|
-
97,
|
|
1222
|
-
105,
|
|
1223
|
-
114,
|
|
1224
|
-
100,
|
|
1225
|
-
114,
|
|
1226
|
-
111,
|
|
1227
|
-
112,
|
|
1228
|
-
95,
|
|
1229
|
-
99,
|
|
1230
|
-
111,
|
|
1231
|
-
110,
|
|
1232
|
-
102,
|
|
1233
|
-
105,
|
|
1234
|
-
103
|
|
1235
|
-
])
|
|
1236
|
-
)
|
|
1237
|
-
]
|
|
1238
|
-
});
|
|
1239
|
-
}
|
|
1240
|
-
if (!accounts.tokenProgram.value) {
|
|
1241
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1242
|
-
}
|
|
1243
|
-
if (!accounts.destinationTokenAccount.value) {
|
|
1244
|
-
accounts.destinationTokenAccount.value = await getProgramDerivedAddress({
|
|
1245
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
1246
|
-
seeds: [
|
|
1247
|
-
getAddressEncoder7().encode(expectAddress(accounts.claimer.value)),
|
|
1248
|
-
getAddressEncoder7().encode(expectAddress(accounts.tokenProgram.value)),
|
|
1249
|
-
getAddressEncoder7().encode(expectAddress(accounts.mint.value))
|
|
1250
|
-
]
|
|
1251
|
-
});
|
|
1252
|
-
}
|
|
1253
|
-
if (!accounts.airdrop.value) {
|
|
1254
|
-
accounts.airdrop.value = await getProgramDerivedAddress({
|
|
1255
|
-
programAddress,
|
|
1256
|
-
seeds: [
|
|
1257
|
-
getBytesEncoder9().encode(
|
|
1258
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1259
|
-
),
|
|
1260
|
-
getAddressEncoder7().encode(expectAddress(accounts.mint.value)),
|
|
1261
|
-
getAddressEncoder7().encode(expectAddress(accounts.authority.value))
|
|
1262
|
-
]
|
|
1263
|
-
});
|
|
1264
|
-
}
|
|
1265
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
1266
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
1267
|
-
}
|
|
1268
|
-
if (!accounts.systemProgram.value) {
|
|
1269
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1270
|
-
}
|
|
1271
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1272
|
-
return Object.freeze({
|
|
1273
|
-
accounts: [
|
|
1274
|
-
getAccountMeta(accounts.master),
|
|
1275
|
-
getAccountMeta(accounts.config),
|
|
1276
|
-
getAccountMeta(accounts.treasury),
|
|
1277
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1278
|
-
getAccountMeta(accounts.affiliate),
|
|
1279
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
1280
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
1281
|
-
getAccountMeta(accounts.airdrop),
|
|
1282
|
-
getAccountMeta(accounts.authority),
|
|
1283
|
-
getAccountMeta(accounts.bitmap),
|
|
1284
|
-
getAccountMeta(accounts.mint),
|
|
1285
|
-
getAccountMeta(accounts.claimer),
|
|
1286
|
-
getAccountMeta(accounts.tokenProgram),
|
|
1287
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
1288
|
-
getAccountMeta(accounts.systemProgram)
|
|
1289
|
-
],
|
|
1290
|
-
data: getClaimAirdropInstructionDataEncoder().encode(
|
|
1291
|
-
args
|
|
1292
|
-
),
|
|
1293
|
-
programAddress
|
|
1294
|
-
});
|
|
1295
|
-
}
|
|
1296
|
-
function getClaimAirdropInstruction(input, config) {
|
|
1297
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1298
|
-
const originalAccounts = {
|
|
1299
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1300
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1301
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1302
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1303
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1304
|
-
sourceTokenAccount: {
|
|
1305
|
-
value: input.sourceTokenAccount ?? null,
|
|
1306
|
-
isWritable: true
|
|
1307
|
-
},
|
|
1308
|
-
destinationTokenAccount: {
|
|
1309
|
-
value: input.destinationTokenAccount ?? null,
|
|
1310
|
-
isWritable: true
|
|
1311
|
-
},
|
|
1312
|
-
airdrop: { value: input.airdrop ?? null, isWritable: false },
|
|
1313
|
-
authority: { value: input.authority ?? null, isWritable: false },
|
|
1314
|
-
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1315
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1316
|
-
claimer: { value: input.claimer ?? null, isWritable: true },
|
|
1317
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1318
|
-
associatedTokenProgram: {
|
|
1319
|
-
value: input.associatedTokenProgram ?? null,
|
|
1320
|
-
isWritable: false
|
|
1321
|
-
},
|
|
1322
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1323
|
-
};
|
|
1324
|
-
const accounts = originalAccounts;
|
|
1325
|
-
const args = { ...input };
|
|
1326
|
-
if (!accounts.tokenProgram.value) {
|
|
1327
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1328
|
-
}
|
|
1329
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
1330
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
1331
|
-
}
|
|
1332
|
-
if (!accounts.systemProgram.value) {
|
|
1333
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1334
|
-
}
|
|
1335
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1336
|
-
return Object.freeze({
|
|
1337
|
-
accounts: [
|
|
1338
|
-
getAccountMeta(accounts.master),
|
|
1339
|
-
getAccountMeta(accounts.config),
|
|
1340
|
-
getAccountMeta(accounts.treasury),
|
|
1341
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1342
|
-
getAccountMeta(accounts.affiliate),
|
|
1343
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
1344
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
1345
|
-
getAccountMeta(accounts.airdrop),
|
|
1346
|
-
getAccountMeta(accounts.authority),
|
|
1347
|
-
getAccountMeta(accounts.bitmap),
|
|
1348
|
-
getAccountMeta(accounts.mint),
|
|
1349
|
-
getAccountMeta(accounts.claimer),
|
|
1350
|
-
getAccountMeta(accounts.tokenProgram),
|
|
1351
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
1352
|
-
getAccountMeta(accounts.systemProgram)
|
|
1353
|
-
],
|
|
1354
|
-
data: getClaimAirdropInstructionDataEncoder().encode(
|
|
1355
|
-
args
|
|
1356
|
-
),
|
|
1357
|
-
programAddress
|
|
1358
|
-
});
|
|
1359
|
-
}
|
|
1360
|
-
function parseClaimAirdropInstruction(instruction) {
|
|
1361
|
-
if (instruction.accounts.length < 15) {
|
|
1362
|
-
throw new Error("Not enough accounts");
|
|
1363
|
-
}
|
|
1364
|
-
let accountIndex = 0;
|
|
1365
|
-
const getNextAccount = () => {
|
|
1366
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1367
|
-
accountIndex += 1;
|
|
1368
|
-
return accountMeta;
|
|
1369
|
-
};
|
|
1370
|
-
const getNextOptionalAccount = () => {
|
|
1371
|
-
const accountMeta = getNextAccount();
|
|
1372
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
1373
|
-
};
|
|
1374
|
-
return {
|
|
1375
|
-
programAddress: instruction.programAddress,
|
|
1376
|
-
accounts: {
|
|
1377
|
-
master: getNextAccount(),
|
|
1378
|
-
config: getNextAccount(),
|
|
1379
|
-
treasury: getNextAccount(),
|
|
1380
|
-
airdropMaster: getNextAccount(),
|
|
1381
|
-
affiliate: getNextOptionalAccount(),
|
|
1382
|
-
sourceTokenAccount: getNextAccount(),
|
|
1383
|
-
destinationTokenAccount: getNextAccount(),
|
|
1384
|
-
airdrop: getNextAccount(),
|
|
1385
|
-
authority: getNextAccount(),
|
|
1386
|
-
bitmap: getNextAccount(),
|
|
1387
|
-
mint: getNextAccount(),
|
|
1388
|
-
claimer: getNextAccount(),
|
|
1389
|
-
tokenProgram: getNextAccount(),
|
|
1390
|
-
associatedTokenProgram: getNextAccount(),
|
|
1391
|
-
systemProgram: getNextAccount()
|
|
1392
|
-
},
|
|
1393
|
-
data: getClaimAirdropInstructionDataDecoder().decode(instruction.data)
|
|
1394
|
-
};
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
// src/instructions/createAirdrop.ts
|
|
1398
|
-
import {
|
|
1399
|
-
combineCodec as combineCodec9,
|
|
1400
|
-
fixDecoderSize as fixDecoderSize9,
|
|
1401
|
-
fixEncoderSize as fixEncoderSize10,
|
|
1402
|
-
getAddressDecoder as getAddressDecoder7,
|
|
1403
|
-
getAddressEncoder as getAddressEncoder9,
|
|
1404
|
-
getBytesDecoder as getBytesDecoder9,
|
|
1405
|
-
getBytesEncoder as getBytesEncoder10,
|
|
1406
|
-
getI64Decoder as getI64Decoder3,
|
|
1407
|
-
getI64Encoder as getI64Encoder3,
|
|
1408
|
-
getOptionDecoder,
|
|
1409
|
-
getOptionEncoder,
|
|
1410
|
-
getProgramDerivedAddress as getProgramDerivedAddress3,
|
|
1411
|
-
getStructDecoder as getStructDecoder9,
|
|
1412
|
-
getStructEncoder as getStructEncoder9,
|
|
1413
|
-
getU8Decoder as getU8Decoder8,
|
|
1414
|
-
getU8Encoder as getU8Encoder8,
|
|
1415
|
-
transformEncoder as transformEncoder9
|
|
1416
|
-
} from "@solana/kit";
|
|
1417
|
-
|
|
1418
|
-
// src/constants/index.ts
|
|
1419
|
-
import { address } from "@solana/kit";
|
|
1420
|
-
var DROPSY_MASTER_SEED = "master";
|
|
1421
|
-
var AIRDROP_CONFIG_SEED = "airdrop_config";
|
|
1422
|
-
var AFFILIATE_MASTER_SEED = "affiliate_master";
|
|
1423
|
-
var AIRDROP_MASTER_SEED = "airdrop_master";
|
|
1424
|
-
var AIRDROP_SEED = "airdrop";
|
|
1425
|
-
var AFFILIATE_SEED = "affiliate";
|
|
1426
|
-
var BITMAP_SEED = "bitmap";
|
|
1427
|
-
var VESTING_SEED = "vesting";
|
|
1428
|
-
var PRESALE_SEED = "presale";
|
|
1429
|
-
var VAULT_SEED = "vault";
|
|
1430
|
-
var ADMIN = address("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1431
|
-
var DROPSY_TREASURY = address("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1432
|
-
var DEFAULT_MASTER_PDA = address("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1433
|
-
var DEFAULT_MASTER_PDA_AUTHORITY = address("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1434
|
-
var BITMAP_SIZE = 8e3;
|
|
1435
|
-
var MAX_BITMAP_CLAIM = BITMAP_SIZE * 8;
|
|
1436
|
-
var VERSION_BASIC = 0;
|
|
1437
|
-
var VERSION_VESTED = 1;
|
|
1438
|
-
var STATE_INITIALIZED = 0;
|
|
1439
|
-
var STATE_DELEGATED = 1;
|
|
1440
|
-
var STATE_REDEEMED = 2;
|
|
1441
|
-
var MUTABLE_NONE = 0;
|
|
1442
|
-
|
|
1443
|
-
// src/utils/client.ts
|
|
1444
|
-
import {
|
|
1445
|
-
airdropFactory,
|
|
1446
|
-
appendTransactionMessageInstructions,
|
|
1447
|
-
createSolanaRpc,
|
|
1448
|
-
createSolanaRpcSubscriptions,
|
|
1449
|
-
createTransactionMessage,
|
|
1450
|
-
generateKeyPairSigner,
|
|
1451
|
-
lamports,
|
|
1452
|
-
pipe,
|
|
1453
|
-
setTransactionMessageFeePayerSigner,
|
|
1454
|
-
setTransactionMessageLifetimeUsingBlockhash
|
|
1455
|
-
} from "@solana/kit";
|
|
1456
|
-
var generateKeyPairSignerWithSol = async (rpcClient, putativeLamports = 1000000000n) => {
|
|
1457
|
-
const signer = await generateKeyPairSigner();
|
|
1458
|
-
await airdropFactory(rpcClient)({
|
|
1459
|
-
recipientAddress: signer.address,
|
|
1460
|
-
lamports: lamports(putativeLamports),
|
|
1461
|
-
commitment: "confirmed"
|
|
1462
|
-
});
|
|
1463
|
-
return signer;
|
|
1464
|
-
};
|
|
1465
|
-
var createDefaultSolanaClient = () => {
|
|
1466
|
-
const rpc = createSolanaRpc("https://api.devnet.solana.com");
|
|
1467
|
-
const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
1468
|
-
"wss://api.devnet.solana.com"
|
|
1469
|
-
);
|
|
1470
|
-
return { rpc, rpcSubscriptions };
|
|
1471
|
-
};
|
|
1472
|
-
var createTransactionMessageFromInstructions = async (rpc, signer, instruction) => {
|
|
1473
|
-
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
1474
|
-
return pipe(
|
|
1475
|
-
createTransactionMessage({ version: 0 }),
|
|
1476
|
-
(tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
|
|
1477
|
-
(tx) => setTransactionMessageFeePayerSigner(signer, tx),
|
|
1478
|
-
(tx) => appendTransactionMessageInstructions(instruction, tx)
|
|
1479
|
-
);
|
|
1480
|
-
};
|
|
1481
|
-
|
|
1482
|
-
// src/utils/derive.ts
|
|
1483
|
-
import {
|
|
1484
|
-
getAddressEncoder as getAddressEncoder8,
|
|
1485
|
-
getProgramDerivedAddress as getProgramDerivedAddress2
|
|
1486
|
-
} from "@solana/kit";
|
|
1487
|
-
async function getDropsyDerivedAddress(seeds) {
|
|
1488
|
-
return await getProgramDerivedAddress2({
|
|
1489
|
-
seeds,
|
|
1490
|
-
programAddress: DROPSY_PROGRAM_ADDRESS
|
|
1491
|
-
});
|
|
1492
|
-
}
|
|
1493
|
-
async function getMasterDerivedAddress() {
|
|
1494
|
-
return await getDropsyDerivedAddress([DROPSY_MASTER_SEED]);
|
|
1495
|
-
}
|
|
1496
|
-
async function getAirdropConfigDerivedAddress() {
|
|
1497
|
-
return await getDropsyDerivedAddress([AIRDROP_CONFIG_SEED]);
|
|
1498
|
-
}
|
|
1499
|
-
async function getAirdropMasterDerivedAddress(authority) {
|
|
1500
|
-
const seeds = [
|
|
1501
|
-
AIRDROP_MASTER_SEED,
|
|
1502
|
-
getAddressEncoder8().encode(authority)
|
|
1503
|
-
];
|
|
1504
|
-
return await getDropsyDerivedAddress(seeds);
|
|
1505
|
-
}
|
|
1506
|
-
async function getAffiliateDerivedAddress(authority) {
|
|
1507
|
-
const seeds = [
|
|
1508
|
-
AFFILIATE_SEED,
|
|
1509
|
-
getAddressEncoder8().encode(authority)
|
|
1510
|
-
];
|
|
1511
|
-
return await getDropsyDerivedAddress(seeds);
|
|
1512
|
-
}
|
|
1513
|
-
async function getAirdropDerivedAddress(authority, mint) {
|
|
1514
|
-
const seeds = [
|
|
1515
|
-
AIRDROP_SEED,
|
|
1516
|
-
getAddressEncoder8().encode(mint),
|
|
1517
|
-
getAddressEncoder8().encode(authority)
|
|
1518
|
-
];
|
|
1519
|
-
return await getDropsyDerivedAddress(seeds);
|
|
1520
|
-
}
|
|
1521
|
-
async function getClaimMapDerivedAddress(airdrop, id) {
|
|
1522
|
-
const idBuffer = Buffer.alloc(2);
|
|
1523
|
-
idBuffer.writeUInt16LE(id);
|
|
1524
|
-
const seeds = [
|
|
1525
|
-
BITMAP_SEED,
|
|
1526
|
-
getAddressEncoder8().encode(airdrop),
|
|
1527
|
-
idBuffer
|
|
1528
|
-
];
|
|
1529
|
-
return await getDropsyDerivedAddress(seeds);
|
|
1530
|
-
}
|
|
1531
|
-
|
|
1532
|
-
// src/utils/helper.ts
|
|
1533
|
-
function toUnixTimestamp(date) {
|
|
1534
|
-
if (!date) return null;
|
|
1535
|
-
return Math.floor(date.getTime() / 1e3);
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
// src/utils/merkle.ts
|
|
1539
|
-
import { createHash } from "crypto";
|
|
1540
|
-
import MerkleTree from "merkletreejs";
|
|
1541
|
-
function hashLeaf(index, address2, amount) {
|
|
1542
|
-
const data = `${index}:${address2}:${amount.toString()}`;
|
|
1543
|
-
return createHash("sha256").update(data).digest();
|
|
1544
|
-
}
|
|
1545
|
-
function hashAddress(address2) {
|
|
1546
|
-
return createHash("sha256").update(address2).digest();
|
|
1547
|
-
}
|
|
1548
|
-
var createWLMerkleTree = (wallets) => {
|
|
1549
|
-
const leaves = wallets.map((address2) => hashAddress(address2));
|
|
1550
|
-
return new MerkleTree(
|
|
1551
|
-
leaves,
|
|
1552
|
-
(data) => createHash("sha256").update(data).digest(),
|
|
1553
|
-
{ sortPairs: true }
|
|
1554
|
-
);
|
|
1555
|
-
};
|
|
1556
|
-
var getSimpleMerkleProof = (merkleTree, address2) => {
|
|
1557
|
-
const leaf = hashAddress(address2);
|
|
1558
|
-
return merkleTree.getProof(leaf).map((p) => p.data);
|
|
1559
|
-
};
|
|
1560
|
-
var getMerkleRootArray = (merkleTree) => {
|
|
1561
|
-
const root = merkleTree.getRoot();
|
|
1562
|
-
if (root.length !== 32) {
|
|
1563
|
-
throw new Error("Merkle root must be 32 bytes");
|
|
1564
|
-
}
|
|
1565
|
-
const uint8Root = new Uint8Array(root);
|
|
1566
|
-
return uint8Root;
|
|
1567
|
-
};
|
|
1568
|
-
var createMerkleTree = (claimList) => {
|
|
1569
|
-
const leaves = claimList.map(
|
|
1570
|
-
({ index, address: address2, amount }) => hashLeaf(index, address2, amount)
|
|
1571
|
-
);
|
|
1572
|
-
const merkleTree = new MerkleTree(
|
|
1573
|
-
leaves,
|
|
1574
|
-
(data) => createHash("sha256").update(data).digest(),
|
|
1575
|
-
{ sortPairs: true }
|
|
1576
|
-
);
|
|
1577
|
-
return merkleTree;
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
// src/instructions/createAirdrop.ts
|
|
1581
|
-
var CREATE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1582
|
-
227,
|
|
1583
|
-
135,
|
|
1584
|
-
208,
|
|
1585
|
-
66,
|
|
1586
|
-
137,
|
|
1587
|
-
177,
|
|
1588
|
-
80,
|
|
1589
|
-
94
|
|
1590
|
-
]);
|
|
1591
|
-
function getCreateAirdropDiscriminatorBytes() {
|
|
1592
|
-
return fixEncoderSize10(getBytesEncoder10(), 8).encode(
|
|
1593
|
-
CREATE_AIRDROP_DISCRIMINATOR
|
|
1594
|
-
);
|
|
1595
|
-
}
|
|
1596
|
-
function getCreateAirdropInstructionDataEncoder() {
|
|
1597
|
-
return transformEncoder9(
|
|
1598
|
-
getStructEncoder9([
|
|
1599
|
-
["discriminator", fixEncoderSize10(getBytesEncoder10(), 8)],
|
|
1600
|
-
["merkleRoot", getOptionEncoder(fixEncoderSize10(getBytesEncoder10(), 32))],
|
|
1601
|
-
["startsAt", getOptionEncoder(getI64Encoder3())],
|
|
1602
|
-
["endsAt", getOptionEncoder(getI64Encoder3())],
|
|
1603
|
-
["version", getOptionEncoder(getU8Encoder8())],
|
|
1604
|
-
["mutable", getOptionEncoder(getU8Encoder8())],
|
|
1605
|
-
["delegateAuthority", getOptionEncoder(getAddressEncoder9())],
|
|
1606
|
-
["delegatePermissions", getOptionEncoder(getU8Encoder8())]
|
|
1607
|
-
]),
|
|
1608
|
-
(value) => ({ ...value, discriminator: CREATE_AIRDROP_DISCRIMINATOR })
|
|
1609
|
-
);
|
|
1610
|
-
}
|
|
1611
|
-
function getCreateAirdropInstructionDataDecoder() {
|
|
1612
|
-
return getStructDecoder9([
|
|
1613
|
-
["discriminator", fixDecoderSize9(getBytesDecoder9(), 8)],
|
|
1614
|
-
["merkleRoot", getOptionDecoder(fixDecoderSize9(getBytesDecoder9(), 32))],
|
|
1615
|
-
["startsAt", getOptionDecoder(getI64Decoder3())],
|
|
1616
|
-
["endsAt", getOptionDecoder(getI64Decoder3())],
|
|
1617
|
-
["version", getOptionDecoder(getU8Decoder8())],
|
|
1618
|
-
["mutable", getOptionDecoder(getU8Decoder8())],
|
|
1619
|
-
["delegateAuthority", getOptionDecoder(getAddressDecoder7())],
|
|
1620
|
-
["delegatePermissions", getOptionDecoder(getU8Decoder8())]
|
|
1621
|
-
]);
|
|
1622
|
-
}
|
|
1623
|
-
function getCreateAirdropInstructionDataCodec() {
|
|
1624
|
-
return combineCodec9(
|
|
1625
|
-
getCreateAirdropInstructionDataEncoder(),
|
|
1626
|
-
getCreateAirdropInstructionDataDecoder()
|
|
1627
|
-
);
|
|
1628
|
-
}
|
|
1629
|
-
async function getCreateAirdropInstructionAsync(input, config) {
|
|
1630
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1631
|
-
const originalAccounts = {
|
|
1632
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1633
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1634
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1635
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1636
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1637
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1638
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1639
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
1640
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1641
|
-
};
|
|
1642
|
-
const accounts = originalAccounts;
|
|
1643
|
-
const args = { ...input };
|
|
1644
|
-
if (!accounts.master.value) {
|
|
1645
|
-
accounts.master.value = await getProgramDerivedAddress3({
|
|
1646
|
-
programAddress,
|
|
1647
|
-
seeds: [
|
|
1648
|
-
getBytesEncoder10().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
1649
|
-
]
|
|
1650
|
-
});
|
|
1651
|
-
}
|
|
1652
|
-
if (!accounts.config.value) {
|
|
1653
|
-
accounts.config.value = await getProgramDerivedAddress3({
|
|
1654
|
-
programAddress,
|
|
1655
|
-
seeds: [
|
|
1656
|
-
getBytesEncoder10().encode(
|
|
1657
|
-
new Uint8Array([
|
|
1658
|
-
97,
|
|
1659
|
-
105,
|
|
1660
|
-
114,
|
|
1661
|
-
100,
|
|
1662
|
-
114,
|
|
1663
|
-
111,
|
|
1664
|
-
112,
|
|
1665
|
-
95,
|
|
1666
|
-
99,
|
|
1667
|
-
111,
|
|
1668
|
-
110,
|
|
1669
|
-
102,
|
|
1670
|
-
105,
|
|
1671
|
-
103
|
|
1672
|
-
])
|
|
1673
|
-
)
|
|
1674
|
-
]
|
|
1675
|
-
});
|
|
1676
|
-
}
|
|
1677
|
-
if (!accounts.airdrop.value) {
|
|
1678
|
-
accounts.airdrop.value = await getProgramDerivedAddress3({
|
|
1679
|
-
programAddress,
|
|
1680
|
-
seeds: [
|
|
1681
|
-
getBytesEncoder10().encode(
|
|
1682
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1683
|
-
),
|
|
1684
|
-
getAddressEncoder9().encode(expectAddress(accounts.mint.value)),
|
|
1685
|
-
getAddressEncoder9().encode(expectAddress(accounts.authority.value))
|
|
1686
|
-
]
|
|
1687
|
-
});
|
|
1688
|
-
}
|
|
1689
|
-
if (!accounts.systemProgram.value) {
|
|
1690
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1691
|
-
}
|
|
1692
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1693
|
-
return Object.freeze({
|
|
1694
|
-
accounts: [
|
|
1695
|
-
getAccountMeta(accounts.master),
|
|
1696
|
-
getAccountMeta(accounts.config),
|
|
1697
|
-
getAccountMeta(accounts.treasury),
|
|
1698
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1699
|
-
getAccountMeta(accounts.affiliate),
|
|
1700
|
-
getAccountMeta(accounts.airdrop),
|
|
1701
|
-
getAccountMeta(accounts.mint),
|
|
1702
|
-
getAccountMeta(accounts.authority),
|
|
1703
|
-
getAccountMeta(accounts.systemProgram)
|
|
1704
|
-
],
|
|
1705
|
-
data: getCreateAirdropInstructionDataEncoder().encode(
|
|
1706
|
-
args
|
|
1707
|
-
),
|
|
1708
|
-
programAddress
|
|
1709
|
-
});
|
|
1710
|
-
}
|
|
1711
|
-
function getCreateAirdropInstruction(input, config) {
|
|
1712
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1713
|
-
const originalAccounts = {
|
|
1714
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1715
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1716
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1717
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1718
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1719
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1720
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1721
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
1722
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1723
|
-
};
|
|
1724
|
-
const accounts = originalAccounts;
|
|
1725
|
-
const args = { ...input };
|
|
1726
|
-
if (!accounts.systemProgram.value) {
|
|
1727
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1728
|
-
}
|
|
1729
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1730
|
-
return Object.freeze({
|
|
1731
|
-
accounts: [
|
|
1732
|
-
getAccountMeta(accounts.master),
|
|
1733
|
-
getAccountMeta(accounts.config),
|
|
1734
|
-
getAccountMeta(accounts.treasury),
|
|
1735
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1736
|
-
getAccountMeta(accounts.affiliate),
|
|
1737
|
-
getAccountMeta(accounts.airdrop),
|
|
1738
|
-
getAccountMeta(accounts.mint),
|
|
1739
|
-
getAccountMeta(accounts.authority),
|
|
1740
|
-
getAccountMeta(accounts.systemProgram)
|
|
1741
|
-
],
|
|
1742
|
-
data: getCreateAirdropInstructionDataEncoder().encode(
|
|
1743
|
-
args
|
|
1744
|
-
),
|
|
1745
|
-
programAddress
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
function parseCreateAirdropInstruction(instruction) {
|
|
1749
|
-
if (instruction.accounts.length < 9) {
|
|
1750
|
-
throw new Error("Not enough accounts");
|
|
1751
|
-
}
|
|
1752
|
-
let accountIndex = 0;
|
|
1753
|
-
const getNextAccount = () => {
|
|
1754
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1755
|
-
accountIndex += 1;
|
|
1756
|
-
return accountMeta;
|
|
1757
|
-
};
|
|
1758
|
-
const getNextOptionalAccount = () => {
|
|
1759
|
-
const accountMeta = getNextAccount();
|
|
1760
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
1761
|
-
};
|
|
1762
|
-
return {
|
|
1763
|
-
programAddress: instruction.programAddress,
|
|
1764
|
-
accounts: {
|
|
1765
|
-
master: getNextAccount(),
|
|
1766
|
-
config: getNextAccount(),
|
|
1767
|
-
treasury: getNextAccount(),
|
|
1768
|
-
airdropMaster: getNextAccount(),
|
|
1769
|
-
affiliate: getNextOptionalAccount(),
|
|
1770
|
-
airdrop: getNextAccount(),
|
|
1771
|
-
mint: getNextAccount(),
|
|
1772
|
-
authority: getNextAccount(),
|
|
1773
|
-
systemProgram: getNextAccount()
|
|
1774
|
-
},
|
|
1775
|
-
data: getCreateAirdropInstructionDataDecoder().decode(instruction.data)
|
|
1776
|
-
};
|
|
1777
|
-
}
|
|
1778
|
-
async function getCreateAirdropV0Instruction(input) {
|
|
1779
|
-
return await getCreateAirdropInstructionAsync({
|
|
1780
|
-
airdropMaster: input.airdropMaster ?? DEFAULT_MASTER_PDA,
|
|
1781
|
-
treasury: DROPSY_TREASURY,
|
|
1782
|
-
airdrop: input.airdrop,
|
|
1783
|
-
mint: input.mint,
|
|
1784
|
-
authority: input.authority,
|
|
1785
|
-
merkleRoot: input.merkleRoot ?? null,
|
|
1786
|
-
startsAt: toUnixTimestamp(input.startsAt),
|
|
1787
|
-
endsAt: toUnixTimestamp(input.endsAt),
|
|
1788
|
-
version: 0,
|
|
1789
|
-
mutable: null,
|
|
1790
|
-
delegateAuthority: null,
|
|
1791
|
-
delegatePermissions: null
|
|
1792
|
-
});
|
|
1793
|
-
}
|
|
1794
|
-
|
|
1795
|
-
// src/instructions/createClaimMap.ts
|
|
1796
|
-
import {
|
|
1797
|
-
combineCodec as combineCodec10,
|
|
1798
|
-
fixDecoderSize as fixDecoderSize10,
|
|
1799
|
-
fixEncoderSize as fixEncoderSize11,
|
|
1800
|
-
getAddressEncoder as getAddressEncoder10,
|
|
1801
|
-
getBytesDecoder as getBytesDecoder10,
|
|
1802
|
-
getBytesEncoder as getBytesEncoder11,
|
|
1803
|
-
getProgramDerivedAddress as getProgramDerivedAddress4,
|
|
1804
|
-
getStructDecoder as getStructDecoder10,
|
|
1805
|
-
getStructEncoder as getStructEncoder10,
|
|
1806
|
-
getU16Decoder as getU16Decoder5,
|
|
1807
|
-
getU16Encoder as getU16Encoder5,
|
|
1808
|
-
getU32Decoder as getU32Decoder3,
|
|
1809
|
-
getU32Encoder as getU32Encoder3,
|
|
1810
|
-
transformEncoder as transformEncoder10
|
|
1811
|
-
} from "@solana/kit";
|
|
1812
|
-
var CREATE_CLAIM_MAP_DISCRIMINATOR = new Uint8Array([
|
|
1813
|
-
22,
|
|
1814
|
-
150,
|
|
1815
|
-
81,
|
|
1816
|
-
49,
|
|
1817
|
-
214,
|
|
1818
|
-
142,
|
|
1819
|
-
189,
|
|
1820
|
-
122
|
|
1821
|
-
]);
|
|
1822
|
-
function getCreateClaimMapDiscriminatorBytes() {
|
|
1823
|
-
return fixEncoderSize11(getBytesEncoder11(), 8).encode(
|
|
1824
|
-
CREATE_CLAIM_MAP_DISCRIMINATOR
|
|
1825
|
-
);
|
|
1826
|
-
}
|
|
1827
|
-
function getCreateClaimMapInstructionDataEncoder() {
|
|
1828
|
-
return transformEncoder10(
|
|
1829
|
-
getStructEncoder10([
|
|
1830
|
-
["discriminator", fixEncoderSize11(getBytesEncoder11(), 8)],
|
|
1831
|
-
["id", getU16Encoder5()],
|
|
1832
|
-
["total", getU32Encoder3()]
|
|
1833
|
-
]),
|
|
1834
|
-
(value) => ({ ...value, discriminator: CREATE_CLAIM_MAP_DISCRIMINATOR })
|
|
1835
|
-
);
|
|
1836
|
-
}
|
|
1837
|
-
function getCreateClaimMapInstructionDataDecoder() {
|
|
1838
|
-
return getStructDecoder10([
|
|
1839
|
-
["discriminator", fixDecoderSize10(getBytesDecoder10(), 8)],
|
|
1840
|
-
["id", getU16Decoder5()],
|
|
1841
|
-
["total", getU32Decoder3()]
|
|
1842
|
-
]);
|
|
1843
|
-
}
|
|
1844
|
-
function getCreateClaimMapInstructionDataCodec() {
|
|
1845
|
-
return combineCodec10(
|
|
1846
|
-
getCreateClaimMapInstructionDataEncoder(),
|
|
1847
|
-
getCreateClaimMapInstructionDataDecoder()
|
|
1848
|
-
);
|
|
1849
|
-
}
|
|
1850
|
-
async function getCreateClaimMapInstructionAsync(input, config) {
|
|
1851
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1852
|
-
const originalAccounts = {
|
|
1853
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1854
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1855
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1856
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1857
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1858
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1859
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1860
|
-
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1861
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
1862
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1863
|
-
};
|
|
1864
|
-
const accounts = originalAccounts;
|
|
1865
|
-
const args = { ...input };
|
|
1866
|
-
if (!accounts.master.value) {
|
|
1867
|
-
accounts.master.value = await getProgramDerivedAddress4({
|
|
1868
|
-
programAddress,
|
|
1869
|
-
seeds: [
|
|
1870
|
-
getBytesEncoder11().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
1871
|
-
]
|
|
1872
|
-
});
|
|
1873
|
-
}
|
|
1874
|
-
if (!accounts.config.value) {
|
|
1875
|
-
accounts.config.value = await getProgramDerivedAddress4({
|
|
1876
|
-
programAddress,
|
|
1877
|
-
seeds: [
|
|
1878
|
-
getBytesEncoder11().encode(
|
|
1879
|
-
new Uint8Array([
|
|
1880
|
-
97,
|
|
1881
|
-
105,
|
|
1882
|
-
114,
|
|
1883
|
-
100,
|
|
1884
|
-
114,
|
|
1885
|
-
111,
|
|
1886
|
-
112,
|
|
1887
|
-
95,
|
|
1888
|
-
99,
|
|
1889
|
-
111,
|
|
1890
|
-
110,
|
|
1891
|
-
102,
|
|
1892
|
-
105,
|
|
1893
|
-
103
|
|
1894
|
-
])
|
|
1895
|
-
)
|
|
1896
|
-
]
|
|
1897
|
-
});
|
|
1898
|
-
}
|
|
1899
|
-
if (!accounts.airdrop.value) {
|
|
1900
|
-
accounts.airdrop.value = await getProgramDerivedAddress4({
|
|
1901
|
-
programAddress,
|
|
1902
|
-
seeds: [
|
|
1903
|
-
getBytesEncoder11().encode(
|
|
1904
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1905
|
-
),
|
|
1906
|
-
getAddressEncoder10().encode(expectAddress(accounts.mint.value)),
|
|
1907
|
-
getAddressEncoder10().encode(expectAddress(accounts.authority.value))
|
|
1908
|
-
]
|
|
1909
|
-
});
|
|
1910
|
-
}
|
|
1911
|
-
if (!accounts.bitmap.value) {
|
|
1912
|
-
accounts.bitmap.value = await getProgramDerivedAddress4({
|
|
1913
|
-
programAddress,
|
|
1914
|
-
seeds: [
|
|
1915
|
-
getBytesEncoder11().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
1916
|
-
getAddressEncoder10().encode(expectAddress(accounts.airdrop.value)),
|
|
1917
|
-
getU16Encoder5().encode(expectSome(args.id))
|
|
1918
|
-
]
|
|
1919
|
-
});
|
|
1920
|
-
}
|
|
1921
|
-
if (!accounts.systemProgram.value) {
|
|
1922
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1923
|
-
}
|
|
1924
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1925
|
-
return Object.freeze({
|
|
1926
|
-
accounts: [
|
|
1927
|
-
getAccountMeta(accounts.master),
|
|
1928
|
-
getAccountMeta(accounts.config),
|
|
1929
|
-
getAccountMeta(accounts.treasury),
|
|
1930
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1931
|
-
getAccountMeta(accounts.affiliate),
|
|
1932
|
-
getAccountMeta(accounts.airdrop),
|
|
1933
|
-
getAccountMeta(accounts.mint),
|
|
1934
|
-
getAccountMeta(accounts.bitmap),
|
|
1935
|
-
getAccountMeta(accounts.authority),
|
|
1936
|
-
getAccountMeta(accounts.systemProgram)
|
|
1937
|
-
],
|
|
1938
|
-
data: getCreateClaimMapInstructionDataEncoder().encode(
|
|
1939
|
-
args
|
|
1940
|
-
),
|
|
1941
|
-
programAddress
|
|
1942
|
-
});
|
|
1943
|
-
}
|
|
1944
|
-
function getCreateClaimMapInstruction(input, config) {
|
|
1945
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1946
|
-
const originalAccounts = {
|
|
1947
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
1948
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
1949
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1950
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1951
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1952
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1953
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
1954
|
-
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1955
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
1956
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1957
|
-
};
|
|
1958
|
-
const accounts = originalAccounts;
|
|
1959
|
-
const args = { ...input };
|
|
1960
|
-
if (!accounts.systemProgram.value) {
|
|
1961
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1962
|
-
}
|
|
1963
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1964
|
-
return Object.freeze({
|
|
1965
|
-
accounts: [
|
|
1966
|
-
getAccountMeta(accounts.master),
|
|
1967
|
-
getAccountMeta(accounts.config),
|
|
1968
|
-
getAccountMeta(accounts.treasury),
|
|
1969
|
-
getAccountMeta(accounts.airdropMaster),
|
|
1970
|
-
getAccountMeta(accounts.affiliate),
|
|
1971
|
-
getAccountMeta(accounts.airdrop),
|
|
1972
|
-
getAccountMeta(accounts.mint),
|
|
1973
|
-
getAccountMeta(accounts.bitmap),
|
|
1974
|
-
getAccountMeta(accounts.authority),
|
|
1975
|
-
getAccountMeta(accounts.systemProgram)
|
|
1976
|
-
],
|
|
1977
|
-
data: getCreateClaimMapInstructionDataEncoder().encode(
|
|
1978
|
-
args
|
|
1979
|
-
),
|
|
1980
|
-
programAddress
|
|
1981
|
-
});
|
|
1982
|
-
}
|
|
1983
|
-
function parseCreateClaimMapInstruction(instruction) {
|
|
1984
|
-
if (instruction.accounts.length < 10) {
|
|
1985
|
-
throw new Error("Not enough accounts");
|
|
1986
|
-
}
|
|
1987
|
-
let accountIndex = 0;
|
|
1988
|
-
const getNextAccount = () => {
|
|
1989
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
1990
|
-
accountIndex += 1;
|
|
1991
|
-
return accountMeta;
|
|
1992
|
-
};
|
|
1993
|
-
const getNextOptionalAccount = () => {
|
|
1994
|
-
const accountMeta = getNextAccount();
|
|
1995
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
1996
|
-
};
|
|
1997
|
-
return {
|
|
1998
|
-
programAddress: instruction.programAddress,
|
|
1999
|
-
accounts: {
|
|
2000
|
-
master: getNextAccount(),
|
|
2001
|
-
config: getNextAccount(),
|
|
2002
|
-
treasury: getNextAccount(),
|
|
2003
|
-
airdropMaster: getNextAccount(),
|
|
2004
|
-
affiliate: getNextOptionalAccount(),
|
|
2005
|
-
airdrop: getNextAccount(),
|
|
2006
|
-
mint: getNextAccount(),
|
|
2007
|
-
bitmap: getNextAccount(),
|
|
2008
|
-
authority: getNextAccount(),
|
|
2009
|
-
systemProgram: getNextAccount()
|
|
2010
|
-
},
|
|
2011
|
-
data: getCreateClaimMapInstructionDataDecoder().decode(instruction.data)
|
|
2012
|
-
};
|
|
2013
|
-
}
|
|
2014
|
-
async function getCreateClaimMapV0Instruction(input) {
|
|
2015
|
-
return await getCreateClaimMapInstructionAsync({
|
|
2016
|
-
airdropMaster: input.airdropMaster ?? DEFAULT_MASTER_PDA,
|
|
2017
|
-
treasury: DROPSY_TREASURY,
|
|
2018
|
-
airdrop: input.airdrop,
|
|
2019
|
-
bitmap: input.claimMap,
|
|
2020
|
-
mint: input.mint,
|
|
2021
|
-
authority: input.authority,
|
|
2022
|
-
id: input.id ?? 0,
|
|
2023
|
-
total: input.total ?? MAX_BITMAP_CLAIM
|
|
2024
|
-
});
|
|
2025
|
-
}
|
|
2026
|
-
|
|
2027
|
-
// src/instructions/depositTokens.ts
|
|
2028
|
-
import {
|
|
2029
|
-
combineCodec as combineCodec11,
|
|
2030
|
-
fixDecoderSize as fixDecoderSize11,
|
|
2031
|
-
fixEncoderSize as fixEncoderSize12,
|
|
2032
|
-
getAddressEncoder as getAddressEncoder11,
|
|
2033
|
-
getBytesDecoder as getBytesDecoder11,
|
|
2034
|
-
getBytesEncoder as getBytesEncoder12,
|
|
2035
|
-
getProgramDerivedAddress as getProgramDerivedAddress5,
|
|
2036
|
-
getStructDecoder as getStructDecoder11,
|
|
2037
|
-
getStructEncoder as getStructEncoder11,
|
|
2038
|
-
getU64Decoder as getU64Decoder8,
|
|
2039
|
-
getU64Encoder as getU64Encoder8,
|
|
2040
|
-
transformEncoder as transformEncoder11
|
|
2041
|
-
} from "@solana/kit";
|
|
2042
|
-
var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
2043
|
-
176,
|
|
2044
|
-
83,
|
|
2045
|
-
229,
|
|
2046
|
-
18,
|
|
2047
|
-
191,
|
|
2048
|
-
143,
|
|
2049
|
-
176,
|
|
2050
|
-
150
|
|
2051
|
-
]);
|
|
2052
|
-
function getDepositTokensDiscriminatorBytes() {
|
|
2053
|
-
return fixEncoderSize12(getBytesEncoder12(), 8).encode(
|
|
2054
|
-
DEPOSIT_TOKENS_DISCRIMINATOR
|
|
2055
|
-
);
|
|
2056
|
-
}
|
|
2057
|
-
function getDepositTokensInstructionDataEncoder() {
|
|
2058
|
-
return transformEncoder11(
|
|
2059
|
-
getStructEncoder11([
|
|
2060
|
-
["discriminator", fixEncoderSize12(getBytesEncoder12(), 8)],
|
|
2061
|
-
["amount", getU64Encoder8()]
|
|
2062
|
-
]),
|
|
2063
|
-
(value) => ({ ...value, discriminator: DEPOSIT_TOKENS_DISCRIMINATOR })
|
|
2064
|
-
);
|
|
2065
|
-
}
|
|
2066
|
-
function getDepositTokensInstructionDataDecoder() {
|
|
2067
|
-
return getStructDecoder11([
|
|
2068
|
-
["discriminator", fixDecoderSize11(getBytesDecoder11(), 8)],
|
|
2069
|
-
["amount", getU64Decoder8()]
|
|
2070
|
-
]);
|
|
2071
|
-
}
|
|
2072
|
-
function getDepositTokensInstructionDataCodec() {
|
|
2073
|
-
return combineCodec11(
|
|
2074
|
-
getDepositTokensInstructionDataEncoder(),
|
|
2075
|
-
getDepositTokensInstructionDataDecoder()
|
|
2076
|
-
);
|
|
2077
|
-
}
|
|
2078
|
-
async function getDepositTokensInstructionAsync(input, config) {
|
|
2079
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2080
|
-
const originalAccounts = {
|
|
2081
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
2082
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2083
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2084
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2085
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
2086
|
-
sourceTokenAccount: {
|
|
2087
|
-
value: input.sourceTokenAccount ?? null,
|
|
2088
|
-
isWritable: true
|
|
2089
|
-
},
|
|
2090
|
-
destinationTokenAccount: {
|
|
2091
|
-
value: input.destinationTokenAccount ?? null,
|
|
2092
|
-
isWritable: true
|
|
2093
|
-
},
|
|
2094
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
2095
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
2096
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
2097
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2098
|
-
associatedTokenProgram: {
|
|
2099
|
-
value: input.associatedTokenProgram ?? null,
|
|
2100
|
-
isWritable: false
|
|
2101
|
-
},
|
|
2102
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2103
|
-
};
|
|
2104
|
-
const accounts = originalAccounts;
|
|
2105
|
-
const args = { ...input };
|
|
2106
|
-
if (!accounts.master.value) {
|
|
2107
|
-
accounts.master.value = await getProgramDerivedAddress5({
|
|
2108
|
-
programAddress,
|
|
2109
|
-
seeds: [
|
|
2110
|
-
getBytesEncoder12().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
2111
|
-
]
|
|
2112
|
-
});
|
|
2113
|
-
}
|
|
2114
|
-
if (!accounts.config.value) {
|
|
2115
|
-
accounts.config.value = await getProgramDerivedAddress5({
|
|
2116
|
-
programAddress,
|
|
2117
|
-
seeds: [
|
|
2118
|
-
getBytesEncoder12().encode(
|
|
2119
|
-
new Uint8Array([
|
|
2120
|
-
97,
|
|
2121
|
-
105,
|
|
2122
|
-
114,
|
|
2123
|
-
100,
|
|
2124
|
-
114,
|
|
2125
|
-
111,
|
|
2126
|
-
112,
|
|
2127
|
-
95,
|
|
2128
|
-
99,
|
|
2129
|
-
111,
|
|
2130
|
-
110,
|
|
2131
|
-
102,
|
|
2132
|
-
105,
|
|
2133
|
-
103
|
|
2134
|
-
])
|
|
2135
|
-
)
|
|
2136
|
-
]
|
|
2137
|
-
});
|
|
2138
|
-
}
|
|
2139
|
-
if (!accounts.airdropMaster.value) {
|
|
2140
|
-
accounts.airdropMaster.value = DEFAULT_MASTER_PDA;
|
|
2141
|
-
}
|
|
2142
|
-
if (!accounts.treasury.value) {
|
|
2143
|
-
accounts.treasury.value = DROPSY_TREASURY;
|
|
2144
|
-
}
|
|
2145
|
-
if (!accounts.airdrop.value) {
|
|
2146
|
-
accounts.airdrop.value = await getProgramDerivedAddress5({
|
|
2147
|
-
programAddress,
|
|
2148
|
-
seeds: [
|
|
2149
|
-
getBytesEncoder12().encode(
|
|
2150
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
2151
|
-
),
|
|
2152
|
-
getAddressEncoder11().encode(expectAddress(accounts.mint.value)),
|
|
2153
|
-
getAddressEncoder11().encode(expectAddress(accounts.authority.value))
|
|
2154
|
-
]
|
|
2155
|
-
});
|
|
2156
|
-
}
|
|
2157
|
-
if (!accounts.tokenProgram.value) {
|
|
2158
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2159
|
-
}
|
|
2160
|
-
if (!accounts.destinationTokenAccount.value) {
|
|
2161
|
-
accounts.destinationTokenAccount.value = await getProgramDerivedAddress5({
|
|
2162
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2163
|
-
seeds: [
|
|
2164
|
-
getAddressEncoder11().encode(expectAddress(accounts.airdrop.value)),
|
|
2165
|
-
getAddressEncoder11().encode(expectAddress(accounts.tokenProgram.value)),
|
|
2166
|
-
getAddressEncoder11().encode(expectAddress(accounts.mint.value))
|
|
2167
|
-
]
|
|
2168
|
-
});
|
|
2169
|
-
}
|
|
2170
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
2171
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2172
|
-
}
|
|
2173
|
-
if (!accounts.systemProgram.value) {
|
|
2174
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2175
|
-
}
|
|
2176
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2177
|
-
return Object.freeze({
|
|
2178
|
-
accounts: [
|
|
2179
|
-
getAccountMeta(accounts.master),
|
|
2180
|
-
getAccountMeta(accounts.config),
|
|
2181
|
-
getAccountMeta(accounts.treasury),
|
|
2182
|
-
getAccountMeta(accounts.airdropMaster),
|
|
2183
|
-
getAccountMeta(accounts.affiliate),
|
|
2184
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
2185
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
2186
|
-
getAccountMeta(accounts.airdrop),
|
|
2187
|
-
getAccountMeta(accounts.mint),
|
|
2188
|
-
getAccountMeta(accounts.authority),
|
|
2189
|
-
getAccountMeta(accounts.tokenProgram),
|
|
2190
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
2191
|
-
getAccountMeta(accounts.systemProgram)
|
|
2192
|
-
],
|
|
2193
|
-
data: getDepositTokensInstructionDataEncoder().encode(
|
|
2194
|
-
args
|
|
2195
|
-
),
|
|
2196
|
-
programAddress
|
|
2197
|
-
});
|
|
2198
|
-
}
|
|
2199
|
-
function getDepositTokensInstruction(input, config) {
|
|
2200
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2201
|
-
const originalAccounts = {
|
|
2202
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
2203
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2204
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2205
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2206
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
2207
|
-
sourceTokenAccount: {
|
|
2208
|
-
value: input.sourceTokenAccount ?? null,
|
|
2209
|
-
isWritable: true
|
|
2210
|
-
},
|
|
2211
|
-
destinationTokenAccount: {
|
|
2212
|
-
value: input.destinationTokenAccount ?? null,
|
|
2213
|
-
isWritable: true
|
|
2214
|
-
},
|
|
2215
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
2216
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
2217
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
2218
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
2219
|
-
associatedTokenProgram: {
|
|
2220
|
-
value: input.associatedTokenProgram ?? null,
|
|
2221
|
-
isWritable: false
|
|
2222
|
-
},
|
|
2223
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2224
|
-
};
|
|
2225
|
-
const accounts = originalAccounts;
|
|
2226
|
-
const args = { ...input };
|
|
2227
|
-
if (!accounts.tokenProgram.value) {
|
|
2228
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2229
|
-
}
|
|
2230
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
2231
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
2232
|
-
}
|
|
2233
|
-
if (!accounts.systemProgram.value) {
|
|
2234
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2235
|
-
}
|
|
2236
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2237
|
-
return Object.freeze({
|
|
2238
|
-
accounts: [
|
|
2239
|
-
getAccountMeta(accounts.master),
|
|
2240
|
-
getAccountMeta(accounts.config),
|
|
2241
|
-
getAccountMeta(accounts.treasury),
|
|
2242
|
-
getAccountMeta(accounts.airdropMaster),
|
|
2243
|
-
getAccountMeta(accounts.affiliate),
|
|
2244
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
2245
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
2246
|
-
getAccountMeta(accounts.airdrop),
|
|
2247
|
-
getAccountMeta(accounts.mint),
|
|
2248
|
-
getAccountMeta(accounts.authority),
|
|
2249
|
-
getAccountMeta(accounts.tokenProgram),
|
|
2250
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
2251
|
-
getAccountMeta(accounts.systemProgram)
|
|
2252
|
-
],
|
|
2253
|
-
data: getDepositTokensInstructionDataEncoder().encode(
|
|
2254
|
-
args
|
|
2255
|
-
),
|
|
2256
|
-
programAddress
|
|
2257
|
-
});
|
|
2258
|
-
}
|
|
2259
|
-
function parseDepositTokensInstruction(instruction) {
|
|
2260
|
-
if (instruction.accounts.length < 13) {
|
|
2261
|
-
throw new Error("Not enough accounts");
|
|
2262
|
-
}
|
|
2263
|
-
let accountIndex = 0;
|
|
2264
|
-
const getNextAccount = () => {
|
|
2265
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2266
|
-
accountIndex += 1;
|
|
2267
|
-
return accountMeta;
|
|
2268
|
-
};
|
|
2269
|
-
const getNextOptionalAccount = () => {
|
|
2270
|
-
const accountMeta = getNextAccount();
|
|
2271
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
2272
|
-
};
|
|
2273
|
-
return {
|
|
2274
|
-
programAddress: instruction.programAddress,
|
|
2275
|
-
accounts: {
|
|
2276
|
-
master: getNextAccount(),
|
|
2277
|
-
config: getNextAccount(),
|
|
2278
|
-
treasury: getNextAccount(),
|
|
2279
|
-
airdropMaster: getNextAccount(),
|
|
2280
|
-
affiliate: getNextOptionalAccount(),
|
|
2281
|
-
sourceTokenAccount: getNextAccount(),
|
|
2282
|
-
destinationTokenAccount: getNextAccount(),
|
|
2283
|
-
airdrop: getNextAccount(),
|
|
2284
|
-
mint: getNextAccount(),
|
|
2285
|
-
authority: getNextAccount(),
|
|
2286
|
-
tokenProgram: getNextAccount(),
|
|
2287
|
-
associatedTokenProgram: getNextAccount(),
|
|
2288
|
-
systemProgram: getNextAccount()
|
|
2289
|
-
},
|
|
2290
|
-
data: getDepositTokensInstructionDataDecoder().decode(instruction.data)
|
|
2291
|
-
};
|
|
2292
|
-
}
|
|
2293
|
-
|
|
2294
|
-
// src/instructions/initializeAirdropMaster.ts
|
|
2295
|
-
import {
|
|
2296
|
-
combineCodec as combineCodec27,
|
|
2297
|
-
fixDecoderSize as fixDecoderSize14,
|
|
2298
|
-
fixEncoderSize as fixEncoderSize15,
|
|
2299
|
-
getAddressEncoder as getAddressEncoder22,
|
|
2300
|
-
getArrayDecoder as getArrayDecoder2,
|
|
2301
|
-
getArrayEncoder as getArrayEncoder2,
|
|
2302
|
-
getBytesDecoder as getBytesDecoder14,
|
|
2303
|
-
getBytesEncoder as getBytesEncoder15,
|
|
2304
|
-
getOptionDecoder as getOptionDecoder4,
|
|
2305
|
-
getOptionEncoder as getOptionEncoder4,
|
|
2306
|
-
getProgramDerivedAddress as getProgramDerivedAddress6,
|
|
2307
|
-
getStructDecoder as getStructDecoder27,
|
|
2308
|
-
getStructEncoder as getStructEncoder27,
|
|
2309
|
-
getU64Decoder as getU64Decoder15,
|
|
2310
|
-
getU64Encoder as getU64Encoder15,
|
|
2311
|
-
transformEncoder as transformEncoder12
|
|
2312
|
-
} from "@solana/kit";
|
|
2313
|
-
|
|
2314
|
-
// src/types/advancedFeeConfig.ts
|
|
2315
|
-
import {
|
|
2316
|
-
combineCodec as combineCodec12,
|
|
2317
|
-
getStructDecoder as getStructDecoder12,
|
|
2318
|
-
getStructEncoder as getStructEncoder12,
|
|
2319
|
-
getU64Decoder as getU64Decoder9,
|
|
2320
|
-
getU64Encoder as getU64Encoder9
|
|
2321
|
-
} from "@solana/kit";
|
|
2322
|
-
function getAdvancedFeeConfigEncoder() {
|
|
2323
|
-
return getStructEncoder12([
|
|
2324
|
-
["claimFee", getU64Encoder9()],
|
|
2325
|
-
["depositFee", getU64Encoder9()],
|
|
2326
|
-
["delegateFee", getU64Encoder9()]
|
|
2327
|
-
]);
|
|
2328
|
-
}
|
|
2329
|
-
function getAdvancedFeeConfigDecoder() {
|
|
2330
|
-
return getStructDecoder12([
|
|
2331
|
-
["claimFee", getU64Decoder9()],
|
|
2332
|
-
["depositFee", getU64Decoder9()],
|
|
2333
|
-
["delegateFee", getU64Decoder9()]
|
|
2334
|
-
]);
|
|
2335
|
-
}
|
|
2336
|
-
function getAdvancedFeeConfigCodec() {
|
|
2337
|
-
return combineCodec12(
|
|
2338
|
-
getAdvancedFeeConfigEncoder(),
|
|
2339
|
-
getAdvancedFeeConfigDecoder()
|
|
2340
|
-
);
|
|
2341
|
-
}
|
|
2342
|
-
|
|
2343
|
-
// src/types/airdropBoosted.ts
|
|
2344
|
-
import {
|
|
2345
|
-
combineCodec as combineCodec13,
|
|
2346
|
-
getAddressDecoder as getAddressDecoder8,
|
|
2347
|
-
getAddressEncoder as getAddressEncoder12,
|
|
2348
|
-
getI64Decoder as getI64Decoder4,
|
|
2349
|
-
getI64Encoder as getI64Encoder4,
|
|
2350
|
-
getStructDecoder as getStructDecoder13,
|
|
2351
|
-
getStructEncoder as getStructEncoder13,
|
|
2352
|
-
getU64Decoder as getU64Decoder10,
|
|
2353
|
-
getU64Encoder as getU64Encoder10
|
|
2354
|
-
} from "@solana/kit";
|
|
2355
|
-
function getAirdropBoostedEncoder() {
|
|
2356
|
-
return getStructEncoder13([
|
|
2357
|
-
["airdrop", getAddressEncoder12()],
|
|
2358
|
-
["boostedBy", getAddressEncoder12()],
|
|
2359
|
-
["boostAmount", getU64Encoder10()],
|
|
2360
|
-
["timestamp", getI64Encoder4()]
|
|
2361
|
-
]);
|
|
2362
|
-
}
|
|
2363
|
-
function getAirdropBoostedDecoder() {
|
|
2364
|
-
return getStructDecoder13([
|
|
2365
|
-
["airdrop", getAddressDecoder8()],
|
|
2366
|
-
["boostedBy", getAddressDecoder8()],
|
|
2367
|
-
["boostAmount", getU64Decoder10()],
|
|
2368
|
-
["timestamp", getI64Decoder4()]
|
|
2369
|
-
]);
|
|
2370
|
-
}
|
|
2371
|
-
function getAirdropBoostedCodec() {
|
|
2372
|
-
return combineCodec13(getAirdropBoostedEncoder(), getAirdropBoostedDecoder());
|
|
2373
|
-
}
|
|
2374
|
-
|
|
2375
|
-
// src/types/airdropClosed.ts
|
|
2376
|
-
import {
|
|
2377
|
-
combineCodec as combineCodec14,
|
|
2378
|
-
getAddressDecoder as getAddressDecoder9,
|
|
2379
|
-
getAddressEncoder as getAddressEncoder13,
|
|
2380
|
-
getI64Decoder as getI64Decoder5,
|
|
2381
|
-
getI64Encoder as getI64Encoder5,
|
|
2382
|
-
getStructDecoder as getStructDecoder14,
|
|
2383
|
-
getStructEncoder as getStructEncoder14
|
|
2384
|
-
} from "@solana/kit";
|
|
2385
|
-
function getAirdropClosedEncoder() {
|
|
2386
|
-
return getStructEncoder14([
|
|
2387
|
-
["airdrop", getAddressEncoder13()],
|
|
2388
|
-
["authority", getAddressEncoder13()],
|
|
2389
|
-
["timestamp", getI64Encoder5()]
|
|
2390
|
-
]);
|
|
2391
|
-
}
|
|
2392
|
-
function getAirdropClosedDecoder() {
|
|
2393
|
-
return getStructDecoder14([
|
|
2394
|
-
["airdrop", getAddressDecoder9()],
|
|
2395
|
-
["authority", getAddressDecoder9()],
|
|
2396
|
-
["timestamp", getI64Decoder5()]
|
|
2397
|
-
]);
|
|
2398
|
-
}
|
|
2399
|
-
function getAirdropClosedCodec() {
|
|
2400
|
-
return combineCodec14(getAirdropClosedEncoder(), getAirdropClosedDecoder());
|
|
2401
|
-
}
|
|
2402
|
-
|
|
2403
|
-
// src/types/airdropDelegated.ts
|
|
2404
|
-
import {
|
|
2405
|
-
combineCodec as combineCodec15,
|
|
2406
|
-
getAddressDecoder as getAddressDecoder10,
|
|
2407
|
-
getAddressEncoder as getAddressEncoder14,
|
|
2408
|
-
getStructDecoder as getStructDecoder15,
|
|
2409
|
-
getStructEncoder as getStructEncoder15,
|
|
2410
|
-
getU8Decoder as getU8Decoder9,
|
|
2411
|
-
getU8Encoder as getU8Encoder9
|
|
2412
|
-
} from "@solana/kit";
|
|
2413
|
-
function getAirdropDelegatedEncoder() {
|
|
2414
|
-
return getStructEncoder15([
|
|
2415
|
-
["airdrop", getAddressEncoder14()],
|
|
2416
|
-
["authority", getAddressEncoder14()],
|
|
2417
|
-
["delegate", getAddressEncoder14()],
|
|
2418
|
-
["permissions", getU8Encoder9()]
|
|
2419
|
-
]);
|
|
2420
|
-
}
|
|
2421
|
-
function getAirdropDelegatedDecoder() {
|
|
2422
|
-
return getStructDecoder15([
|
|
2423
|
-
["airdrop", getAddressDecoder10()],
|
|
2424
|
-
["authority", getAddressDecoder10()],
|
|
2425
|
-
["delegate", getAddressDecoder10()],
|
|
2426
|
-
["permissions", getU8Decoder9()]
|
|
2427
|
-
]);
|
|
2428
|
-
}
|
|
2429
|
-
function getAirdropDelegatedCodec() {
|
|
2430
|
-
return combineCodec15(
|
|
2431
|
-
getAirdropDelegatedEncoder(),
|
|
2432
|
-
getAirdropDelegatedDecoder()
|
|
2433
|
-
);
|
|
2434
|
-
}
|
|
2435
|
-
|
|
2436
|
-
// src/types/airdropInitialized.ts
|
|
2437
|
-
import {
|
|
2438
|
-
combineCodec as combineCodec16,
|
|
2439
|
-
fixDecoderSize as fixDecoderSize12,
|
|
2440
|
-
fixEncoderSize as fixEncoderSize13,
|
|
2441
|
-
getAddressDecoder as getAddressDecoder11,
|
|
2442
|
-
getAddressEncoder as getAddressEncoder15,
|
|
2443
|
-
getBytesDecoder as getBytesDecoder12,
|
|
2444
|
-
getBytesEncoder as getBytesEncoder13,
|
|
2445
|
-
getI64Decoder as getI64Decoder6,
|
|
2446
|
-
getI64Encoder as getI64Encoder6,
|
|
2447
|
-
getStructDecoder as getStructDecoder16,
|
|
2448
|
-
getStructEncoder as getStructEncoder16
|
|
2449
|
-
} from "@solana/kit";
|
|
2450
|
-
function getAirdropInitializedEncoder() {
|
|
2451
|
-
return getStructEncoder16([
|
|
2452
|
-
["airdrop", getAddressEncoder15()],
|
|
2453
|
-
["mint", getAddressEncoder15()],
|
|
2454
|
-
["authority", getAddressEncoder15()],
|
|
2455
|
-
["controller", getAddressEncoder15()],
|
|
2456
|
-
["merkleRoot", fixEncoderSize13(getBytesEncoder13(), 32)],
|
|
2457
|
-
["startTime", getI64Encoder6()],
|
|
2458
|
-
["endTime", getI64Encoder6()],
|
|
2459
|
-
["timestamp", getI64Encoder6()]
|
|
2460
|
-
]);
|
|
2461
|
-
}
|
|
2462
|
-
function getAirdropInitializedDecoder() {
|
|
2463
|
-
return getStructDecoder16([
|
|
2464
|
-
["airdrop", getAddressDecoder11()],
|
|
2465
|
-
["mint", getAddressDecoder11()],
|
|
2466
|
-
["authority", getAddressDecoder11()],
|
|
2467
|
-
["controller", getAddressDecoder11()],
|
|
2468
|
-
["merkleRoot", fixDecoderSize12(getBytesDecoder12(), 32)],
|
|
2469
|
-
["startTime", getI64Decoder6()],
|
|
2470
|
-
["endTime", getI64Decoder6()],
|
|
2471
|
-
["timestamp", getI64Decoder6()]
|
|
2472
|
-
]);
|
|
2473
|
-
}
|
|
2474
|
-
function getAirdropInitializedCodec() {
|
|
2475
|
-
return combineCodec16(
|
|
2476
|
-
getAirdropInitializedEncoder(),
|
|
2477
|
-
getAirdropInitializedDecoder()
|
|
2478
|
-
);
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
// src/types/airdropUpdated.ts
|
|
2482
|
-
import {
|
|
2483
|
-
combineCodec as combineCodec17,
|
|
2484
|
-
getAddressDecoder as getAddressDecoder12,
|
|
2485
|
-
getAddressEncoder as getAddressEncoder16,
|
|
2486
|
-
getStructDecoder as getStructDecoder17,
|
|
2487
|
-
getStructEncoder as getStructEncoder17
|
|
2488
|
-
} from "@solana/kit";
|
|
2489
|
-
function getAirdropUpdatedEncoder() {
|
|
2490
|
-
return getStructEncoder17([
|
|
2491
|
-
["airdrop", getAddressEncoder16()],
|
|
2492
|
-
["updatedBy", getAddressEncoder16()]
|
|
2493
|
-
]);
|
|
2494
|
-
}
|
|
2495
|
-
function getAirdropUpdatedDecoder() {
|
|
2496
|
-
return getStructDecoder17([
|
|
2497
|
-
["airdrop", getAddressDecoder12()],
|
|
2498
|
-
["updatedBy", getAddressDecoder12()]
|
|
2499
|
-
]);
|
|
2500
|
-
}
|
|
2501
|
-
function getAirdropUpdatedCodec() {
|
|
2502
|
-
return combineCodec17(getAirdropUpdatedEncoder(), getAirdropUpdatedDecoder());
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2505
|
-
// src/types/baseDurationConfig.ts
|
|
2506
|
-
import {
|
|
2507
|
-
combineCodec as combineCodec18,
|
|
2508
|
-
getI64Decoder as getI64Decoder7,
|
|
2509
|
-
getI64Encoder as getI64Encoder7,
|
|
2510
|
-
getStructDecoder as getStructDecoder18,
|
|
2511
|
-
getStructEncoder as getStructEncoder18
|
|
2512
|
-
} from "@solana/kit";
|
|
2513
|
-
function getBaseDurationConfigEncoder() {
|
|
2514
|
-
return getStructEncoder18([
|
|
2515
|
-
["minimum", getI64Encoder7()],
|
|
2516
|
-
["maximum", getI64Encoder7()],
|
|
2517
|
-
["updateGrace", getI64Encoder7()]
|
|
2518
|
-
]);
|
|
2519
|
-
}
|
|
2520
|
-
function getBaseDurationConfigDecoder() {
|
|
2521
|
-
return getStructDecoder18([
|
|
2522
|
-
["minimum", getI64Decoder7()],
|
|
2523
|
-
["maximum", getI64Decoder7()],
|
|
2524
|
-
["updateGrace", getI64Decoder7()]
|
|
2525
|
-
]);
|
|
2526
|
-
}
|
|
2527
|
-
function getBaseDurationConfigCodec() {
|
|
2528
|
-
return combineCodec18(
|
|
2529
|
-
getBaseDurationConfigEncoder(),
|
|
2530
|
-
getBaseDurationConfigDecoder()
|
|
2531
|
-
);
|
|
2532
|
-
}
|
|
2533
|
-
|
|
2534
|
-
// src/types/baseFeatureFeeConfig.ts
|
|
2535
|
-
import {
|
|
2536
|
-
combineCodec as combineCodec19,
|
|
2537
|
-
getStructDecoder as getStructDecoder19,
|
|
2538
|
-
getStructEncoder as getStructEncoder19,
|
|
2539
|
-
getU64Decoder as getU64Decoder11,
|
|
2540
|
-
getU64Encoder as getU64Encoder11
|
|
2541
|
-
} from "@solana/kit";
|
|
2542
|
-
function getBaseFeatureFeeConfigEncoder() {
|
|
2543
|
-
return getStructEncoder19([
|
|
2544
|
-
["creationFee", getU64Encoder11()],
|
|
2545
|
-
["upgradeFee", getU64Encoder11()],
|
|
2546
|
-
["withdrawFeeBasis", getU64Encoder11()]
|
|
2547
|
-
]);
|
|
2548
|
-
}
|
|
2549
|
-
function getBaseFeatureFeeConfigDecoder() {
|
|
2550
|
-
return getStructDecoder19([
|
|
2551
|
-
["creationFee", getU64Decoder11()],
|
|
2552
|
-
["upgradeFee", getU64Decoder11()],
|
|
2553
|
-
["withdrawFeeBasis", getU64Decoder11()]
|
|
2554
|
-
]);
|
|
2555
|
-
}
|
|
2556
|
-
function getBaseFeatureFeeConfigCodec() {
|
|
2557
|
-
return combineCodec19(
|
|
2558
|
-
getBaseFeatureFeeConfigEncoder(),
|
|
2559
|
-
getBaseFeatureFeeConfigDecoder()
|
|
2560
|
-
);
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2563
|
-
// src/types/baseFeeConfig.ts
|
|
2564
|
-
import {
|
|
2565
|
-
combineCodec as combineCodec20,
|
|
2566
|
-
getOptionDecoder as getOptionDecoder2,
|
|
2567
|
-
getOptionEncoder as getOptionEncoder2,
|
|
2568
|
-
getStructDecoder as getStructDecoder20,
|
|
2569
|
-
getStructEncoder as getStructEncoder20,
|
|
2570
|
-
getU64Decoder as getU64Decoder12,
|
|
2571
|
-
getU64Encoder as getU64Encoder12
|
|
2572
|
-
} from "@solana/kit";
|
|
2573
|
-
function getBaseFeeConfigEncoder() {
|
|
2574
|
-
return getStructEncoder20([
|
|
2575
|
-
["creationFee", getU64Encoder12()],
|
|
2576
|
-
["updateFee", getOptionEncoder2(getU64Encoder12())],
|
|
2577
|
-
["closeFee", getU64Encoder12()]
|
|
2578
|
-
]);
|
|
2579
|
-
}
|
|
2580
|
-
function getBaseFeeConfigDecoder() {
|
|
2581
|
-
return getStructDecoder20([
|
|
2582
|
-
["creationFee", getU64Decoder12()],
|
|
2583
|
-
["updateFee", getOptionDecoder2(getU64Decoder12())],
|
|
2584
|
-
["closeFee", getU64Decoder12()]
|
|
2585
|
-
]);
|
|
2586
|
-
}
|
|
2587
|
-
function getBaseFeeConfigCodec() {
|
|
2588
|
-
return combineCodec20(getBaseFeeConfigEncoder(), getBaseFeeConfigDecoder());
|
|
2589
|
-
}
|
|
2590
|
-
|
|
2591
|
-
// src/types/claimMapClosed.ts
|
|
2592
|
-
import {
|
|
2593
|
-
combineCodec as combineCodec21,
|
|
2594
|
-
getAddressDecoder as getAddressDecoder13,
|
|
2595
|
-
getAddressEncoder as getAddressEncoder17,
|
|
2596
|
-
getStructDecoder as getStructDecoder21,
|
|
2597
|
-
getStructEncoder as getStructEncoder21
|
|
2598
|
-
} from "@solana/kit";
|
|
2599
|
-
function getClaimMapClosedEncoder() {
|
|
2600
|
-
return getStructEncoder21([
|
|
2601
|
-
["airdrop", getAddressEncoder17()],
|
|
2602
|
-
["bitmap", getAddressEncoder17()],
|
|
2603
|
-
["authority", getAddressEncoder17()]
|
|
2604
|
-
]);
|
|
2605
|
-
}
|
|
2606
|
-
function getClaimMapClosedDecoder() {
|
|
2607
|
-
return getStructDecoder21([
|
|
2608
|
-
["airdrop", getAddressDecoder13()],
|
|
2609
|
-
["bitmap", getAddressDecoder13()],
|
|
2610
|
-
["authority", getAddressDecoder13()]
|
|
2611
|
-
]);
|
|
2612
|
-
}
|
|
2613
|
-
function getClaimMapClosedCodec() {
|
|
2614
|
-
return combineCodec21(getClaimMapClosedEncoder(), getClaimMapClosedDecoder());
|
|
2615
|
-
}
|
|
2616
|
-
|
|
2617
|
-
// src/types/claimMapInitialized.ts
|
|
2618
|
-
import {
|
|
2619
|
-
combineCodec as combineCodec22,
|
|
2620
|
-
getAddressDecoder as getAddressDecoder14,
|
|
2621
|
-
getAddressEncoder as getAddressEncoder18,
|
|
2622
|
-
getI64Decoder as getI64Decoder8,
|
|
2623
|
-
getI64Encoder as getI64Encoder8,
|
|
2624
|
-
getStructDecoder as getStructDecoder22,
|
|
2625
|
-
getStructEncoder as getStructEncoder22,
|
|
2626
|
-
getU16Decoder as getU16Decoder6,
|
|
2627
|
-
getU16Encoder as getU16Encoder6
|
|
2628
|
-
} from "@solana/kit";
|
|
2629
|
-
function getClaimMapInitializedEncoder() {
|
|
2630
|
-
return getStructEncoder22([
|
|
2631
|
-
["airdrop", getAddressEncoder18()],
|
|
2632
|
-
["bitmap", getAddressEncoder18()],
|
|
2633
|
-
["bitmapId", getU16Encoder6()],
|
|
2634
|
-
["timestamp", getI64Encoder8()]
|
|
2635
|
-
]);
|
|
2636
|
-
}
|
|
2637
|
-
function getClaimMapInitializedDecoder() {
|
|
2638
|
-
return getStructDecoder22([
|
|
2639
|
-
["airdrop", getAddressDecoder14()],
|
|
2640
|
-
["bitmap", getAddressDecoder14()],
|
|
2641
|
-
["bitmapId", getU16Decoder6()],
|
|
2642
|
-
["timestamp", getI64Decoder8()]
|
|
2643
|
-
]);
|
|
2644
|
-
}
|
|
2645
|
-
function getClaimMapInitializedCodec() {
|
|
2646
|
-
return combineCodec22(
|
|
2647
|
-
getClaimMapInitializedEncoder(),
|
|
2648
|
-
getClaimMapInitializedDecoder()
|
|
2649
|
-
);
|
|
2650
|
-
}
|
|
2651
|
-
|
|
2652
|
-
// src/types/initAirdropConfigArgs.ts
|
|
2653
|
-
import {
|
|
2654
|
-
combineCodec as combineCodec23,
|
|
2655
|
-
fixDecoderSize as fixDecoderSize13,
|
|
2656
|
-
fixEncoderSize as fixEncoderSize14,
|
|
2657
|
-
getBytesDecoder as getBytesDecoder13,
|
|
2658
|
-
getBytesEncoder as getBytesEncoder14,
|
|
2659
|
-
getOptionDecoder as getOptionDecoder3,
|
|
2660
|
-
getOptionEncoder as getOptionEncoder3,
|
|
2661
|
-
getStructDecoder as getStructDecoder23,
|
|
2662
|
-
getStructEncoder as getStructEncoder23,
|
|
2663
|
-
getU64Decoder as getU64Decoder13,
|
|
2664
|
-
getU64Encoder as getU64Encoder13
|
|
2665
|
-
} from "@solana/kit";
|
|
2666
|
-
function getInitAirdropConfigArgsEncoder() {
|
|
2667
|
-
return getStructEncoder23([
|
|
2668
|
-
["merkleRoot", getOptionEncoder3(fixEncoderSize14(getBytesEncoder14(), 32))],
|
|
2669
|
-
["durationConfig", getBaseDurationConfigEncoder()],
|
|
2670
|
-
["masterConfig", getBaseFeatureFeeConfigEncoder()],
|
|
2671
|
-
["bitmapActionFee", getU64Encoder13()],
|
|
2672
|
-
["perBoostAmount", getU64Encoder13()]
|
|
2673
|
-
]);
|
|
2674
|
-
}
|
|
2675
|
-
function getInitAirdropConfigArgsDecoder() {
|
|
2676
|
-
return getStructDecoder23([
|
|
2677
|
-
["merkleRoot", getOptionDecoder3(fixDecoderSize13(getBytesDecoder13(), 32))],
|
|
2678
|
-
["durationConfig", getBaseDurationConfigDecoder()],
|
|
2679
|
-
["masterConfig", getBaseFeatureFeeConfigDecoder()],
|
|
2680
|
-
["bitmapActionFee", getU64Decoder13()],
|
|
2681
|
-
["perBoostAmount", getU64Decoder13()]
|
|
2682
|
-
]);
|
|
2683
|
-
}
|
|
2684
|
-
function getInitAirdropConfigArgsCodec() {
|
|
2685
|
-
return combineCodec23(
|
|
2686
|
-
getInitAirdropConfigArgsEncoder(),
|
|
2687
|
-
getInitAirdropConfigArgsDecoder()
|
|
2688
|
-
);
|
|
2689
|
-
}
|
|
2690
|
-
|
|
2691
|
-
// src/types/masterInitialized.ts
|
|
2692
|
-
import {
|
|
2693
|
-
combineCodec as combineCodec24,
|
|
2694
|
-
getAddressDecoder as getAddressDecoder15,
|
|
2695
|
-
getAddressEncoder as getAddressEncoder19,
|
|
2696
|
-
getI64Decoder as getI64Decoder9,
|
|
2697
|
-
getI64Encoder as getI64Encoder9,
|
|
2698
|
-
getStructDecoder as getStructDecoder24,
|
|
2699
|
-
getStructEncoder as getStructEncoder24
|
|
2700
|
-
} from "@solana/kit";
|
|
2701
|
-
function getMasterInitializedEncoder() {
|
|
2702
|
-
return getStructEncoder24([
|
|
2703
|
-
["address", getAddressEncoder19()],
|
|
2704
|
-
["authority", getAddressEncoder19()],
|
|
2705
|
-
["treasury", getAddressEncoder19()],
|
|
2706
|
-
["timestamp", getI64Encoder9()]
|
|
2707
|
-
]);
|
|
2708
|
-
}
|
|
2709
|
-
function getMasterInitializedDecoder() {
|
|
2710
|
-
return getStructDecoder24([
|
|
2711
|
-
["address", getAddressDecoder15()],
|
|
2712
|
-
["authority", getAddressDecoder15()],
|
|
2713
|
-
["treasury", getAddressDecoder15()],
|
|
2714
|
-
["timestamp", getI64Decoder9()]
|
|
2715
|
-
]);
|
|
2716
|
-
}
|
|
2717
|
-
function getMasterInitializedCodec() {
|
|
2718
|
-
return combineCodec24(
|
|
2719
|
-
getMasterInitializedEncoder(),
|
|
2720
|
-
getMasterInitializedDecoder()
|
|
2721
|
-
);
|
|
2722
|
-
}
|
|
2723
|
-
|
|
2724
|
-
// src/types/tokensDeposited.ts
|
|
2725
|
-
import {
|
|
2726
|
-
combineCodec as combineCodec25,
|
|
2727
|
-
getAddressDecoder as getAddressDecoder16,
|
|
2728
|
-
getAddressEncoder as getAddressEncoder20,
|
|
2729
|
-
getI64Decoder as getI64Decoder10,
|
|
2730
|
-
getI64Encoder as getI64Encoder10,
|
|
2731
|
-
getStructDecoder as getStructDecoder25,
|
|
2732
|
-
getStructEncoder as getStructEncoder25,
|
|
2733
|
-
getU64Decoder as getU64Decoder14,
|
|
2734
|
-
getU64Encoder as getU64Encoder14
|
|
2735
|
-
} from "@solana/kit";
|
|
2736
|
-
function getTokensDepositedEncoder() {
|
|
2737
|
-
return getStructEncoder25([
|
|
2738
|
-
["airdrop", getAddressEncoder20()],
|
|
2739
|
-
["amount", getU64Encoder14()],
|
|
2740
|
-
["newSupply", getU64Encoder14()],
|
|
2741
|
-
["depositor", getAddressEncoder20()],
|
|
2742
|
-
["timestamp", getI64Encoder10()]
|
|
2743
|
-
]);
|
|
2744
|
-
}
|
|
2745
|
-
function getTokensDepositedDecoder() {
|
|
2746
|
-
return getStructDecoder25([
|
|
2747
|
-
["airdrop", getAddressDecoder16()],
|
|
2748
|
-
["amount", getU64Decoder14()],
|
|
2749
|
-
["newSupply", getU64Decoder14()],
|
|
2750
|
-
["depositor", getAddressDecoder16()],
|
|
2751
|
-
["timestamp", getI64Decoder10()]
|
|
2752
|
-
]);
|
|
2753
|
-
}
|
|
2754
|
-
function getTokensDepositedCodec() {
|
|
2755
|
-
return combineCodec25(getTokensDepositedEncoder(), getTokensDepositedDecoder());
|
|
2756
|
-
}
|
|
2757
|
-
|
|
2758
|
-
// src/types/tokensRedeemed.ts
|
|
2759
|
-
import {
|
|
2760
|
-
combineCodec as combineCodec26,
|
|
2761
|
-
getAddressDecoder as getAddressDecoder17,
|
|
2762
|
-
getAddressEncoder as getAddressEncoder21,
|
|
2763
|
-
getI64Decoder as getI64Decoder11,
|
|
2764
|
-
getI64Encoder as getI64Encoder11,
|
|
2765
|
-
getStructDecoder as getStructDecoder26,
|
|
2766
|
-
getStructEncoder as getStructEncoder26
|
|
2767
|
-
} from "@solana/kit";
|
|
2768
|
-
function getTokensRedeemedEncoder() {
|
|
2769
|
-
return getStructEncoder26([
|
|
2770
|
-
["airdrop", getAddressEncoder21()],
|
|
2771
|
-
["authority", getAddressEncoder21()],
|
|
2772
|
-
["timestamp", getI64Encoder11()]
|
|
2773
|
-
]);
|
|
2774
|
-
}
|
|
2775
|
-
function getTokensRedeemedDecoder() {
|
|
2776
|
-
return getStructDecoder26([
|
|
2777
|
-
["airdrop", getAddressDecoder17()],
|
|
2778
|
-
["authority", getAddressDecoder17()],
|
|
2779
|
-
["timestamp", getI64Decoder11()]
|
|
2780
|
-
]);
|
|
2781
|
-
}
|
|
2782
|
-
function getTokensRedeemedCodec() {
|
|
2783
|
-
return combineCodec26(getTokensRedeemedEncoder(), getTokensRedeemedDecoder());
|
|
2784
|
-
}
|
|
2785
|
-
|
|
2786
|
-
// src/instructions/initializeAirdropMaster.ts
|
|
2787
|
-
var INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
2788
|
-
163,
|
|
2789
|
-
197,
|
|
2790
|
-
170,
|
|
2791
|
-
44,
|
|
2792
|
-
57,
|
|
2793
|
-
57,
|
|
2794
|
-
90,
|
|
2795
|
-
65
|
|
2796
|
-
]);
|
|
2797
|
-
function getInitializeAirdropMasterDiscriminatorBytes() {
|
|
2798
|
-
return fixEncoderSize15(getBytesEncoder15(), 8).encode(
|
|
2799
|
-
INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR
|
|
2800
|
-
);
|
|
2801
|
-
}
|
|
2802
|
-
function getInitializeAirdropMasterInstructionDataEncoder() {
|
|
2803
|
-
return transformEncoder12(
|
|
2804
|
-
getStructEncoder27([
|
|
2805
|
-
["discriminator", fixEncoderSize15(getBytesEncoder15(), 8)],
|
|
2806
|
-
["merkleRoot", getOptionEncoder4(fixEncoderSize15(getBytesEncoder15(), 32))],
|
|
2807
|
-
["airdropCreateFee", getOptionEncoder4(getU64Encoder15())],
|
|
2808
|
-
["airdropUpdateFee", getOptionEncoder4(getU64Encoder15())],
|
|
2809
|
-
["bitmapCreateFee", getOptionEncoder4(getU64Encoder15())],
|
|
2810
|
-
["advancedConfig", getOptionEncoder4(getAdvancedFeeConfigEncoder())],
|
|
2811
|
-
[
|
|
2812
|
-
"wlProof",
|
|
2813
|
-
getOptionEncoder4(
|
|
2814
|
-
getArrayEncoder2(fixEncoderSize15(getBytesEncoder15(), 32))
|
|
2815
|
-
)
|
|
2816
|
-
]
|
|
2817
|
-
]),
|
|
2818
|
-
(value) => ({
|
|
2819
|
-
...value,
|
|
2820
|
-
discriminator: INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR
|
|
2821
|
-
})
|
|
2822
|
-
);
|
|
2823
|
-
}
|
|
2824
|
-
function getInitializeAirdropMasterInstructionDataDecoder() {
|
|
2825
|
-
return getStructDecoder27([
|
|
2826
|
-
["discriminator", fixDecoderSize14(getBytesDecoder14(), 8)],
|
|
2827
|
-
["merkleRoot", getOptionDecoder4(fixDecoderSize14(getBytesDecoder14(), 32))],
|
|
2828
|
-
["airdropCreateFee", getOptionDecoder4(getU64Decoder15())],
|
|
2829
|
-
["airdropUpdateFee", getOptionDecoder4(getU64Decoder15())],
|
|
2830
|
-
["bitmapCreateFee", getOptionDecoder4(getU64Decoder15())],
|
|
2831
|
-
["advancedConfig", getOptionDecoder4(getAdvancedFeeConfigDecoder())],
|
|
2832
|
-
[
|
|
2833
|
-
"wlProof",
|
|
2834
|
-
getOptionDecoder4(getArrayDecoder2(fixDecoderSize14(getBytesDecoder14(), 32)))
|
|
2835
|
-
]
|
|
2836
|
-
]);
|
|
2837
|
-
}
|
|
2838
|
-
function getInitializeAirdropMasterInstructionDataCodec() {
|
|
2839
|
-
return combineCodec27(
|
|
2840
|
-
getInitializeAirdropMasterInstructionDataEncoder(),
|
|
2841
|
-
getInitializeAirdropMasterInstructionDataDecoder()
|
|
2842
|
-
);
|
|
2843
|
-
}
|
|
2844
|
-
async function getInitializeAirdropMasterInstructionAsync(input, config) {
|
|
2845
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2846
|
-
const originalAccounts = {
|
|
2847
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
2848
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2849
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2850
|
-
affiliateMaster: {
|
|
2851
|
-
value: input.affiliateMaster ?? null,
|
|
2852
|
-
isWritable: false
|
|
2853
|
-
},
|
|
2854
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2855
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
2856
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2857
|
-
};
|
|
2858
|
-
const accounts = originalAccounts;
|
|
2859
|
-
const args = { ...input };
|
|
2860
|
-
if (!accounts.master.value) {
|
|
2861
|
-
accounts.master.value = await getProgramDerivedAddress6({
|
|
2862
|
-
programAddress,
|
|
2863
|
-
seeds: [
|
|
2864
|
-
getBytesEncoder15().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
2865
|
-
]
|
|
2866
|
-
});
|
|
2867
|
-
}
|
|
2868
|
-
if (!accounts.config.value) {
|
|
2869
|
-
accounts.config.value = await getProgramDerivedAddress6({
|
|
2870
|
-
programAddress,
|
|
2871
|
-
seeds: [
|
|
2872
|
-
getBytesEncoder15().encode(
|
|
2873
|
-
new Uint8Array([
|
|
2874
|
-
97,
|
|
2875
|
-
105,
|
|
2876
|
-
114,
|
|
2877
|
-
100,
|
|
2878
|
-
114,
|
|
2879
|
-
111,
|
|
2880
|
-
112,
|
|
2881
|
-
95,
|
|
2882
|
-
99,
|
|
2883
|
-
111,
|
|
2884
|
-
110,
|
|
2885
|
-
102,
|
|
2886
|
-
105,
|
|
2887
|
-
103
|
|
2888
|
-
])
|
|
2889
|
-
)
|
|
2890
|
-
]
|
|
2891
|
-
});
|
|
2892
|
-
}
|
|
2893
|
-
if (!accounts.airdropMaster.value) {
|
|
2894
|
-
accounts.airdropMaster.value = await getProgramDerivedAddress6({
|
|
2895
|
-
programAddress,
|
|
2896
|
-
seeds: [
|
|
2897
|
-
getBytesEncoder15().encode(
|
|
2898
|
-
new Uint8Array([
|
|
2899
|
-
97,
|
|
2900
|
-
105,
|
|
2901
|
-
114,
|
|
2902
|
-
100,
|
|
2903
|
-
114,
|
|
2904
|
-
111,
|
|
2905
|
-
112,
|
|
2906
|
-
95,
|
|
2907
|
-
109,
|
|
2908
|
-
97,
|
|
2909
|
-
115,
|
|
2910
|
-
116,
|
|
2911
|
-
101,
|
|
2912
|
-
114
|
|
2913
|
-
])
|
|
2914
|
-
),
|
|
2915
|
-
getAddressEncoder22().encode(expectAddress(accounts.authority.value))
|
|
2916
|
-
]
|
|
2917
|
-
});
|
|
2918
|
-
}
|
|
2919
|
-
if (!accounts.systemProgram.value) {
|
|
2920
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2921
|
-
}
|
|
2922
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2923
|
-
return Object.freeze({
|
|
2924
|
-
accounts: [
|
|
2925
|
-
getAccountMeta(accounts.master),
|
|
2926
|
-
getAccountMeta(accounts.config),
|
|
2927
|
-
getAccountMeta(accounts.treasury),
|
|
2928
|
-
getAccountMeta(accounts.affiliateMaster),
|
|
2929
|
-
getAccountMeta(accounts.airdropMaster),
|
|
2930
|
-
getAccountMeta(accounts.authority),
|
|
2931
|
-
getAccountMeta(accounts.systemProgram)
|
|
2932
|
-
],
|
|
2933
|
-
data: getInitializeAirdropMasterInstructionDataEncoder().encode(
|
|
2934
|
-
args
|
|
2935
|
-
),
|
|
2936
|
-
programAddress
|
|
2937
|
-
});
|
|
2938
|
-
}
|
|
2939
|
-
function getInitializeAirdropMasterInstruction(input, config) {
|
|
2940
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2941
|
-
const originalAccounts = {
|
|
2942
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
2943
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
2944
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2945
|
-
affiliateMaster: {
|
|
2946
|
-
value: input.affiliateMaster ?? null,
|
|
2947
|
-
isWritable: false
|
|
2948
|
-
},
|
|
2949
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2950
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
2951
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2952
|
-
};
|
|
2953
|
-
const accounts = originalAccounts;
|
|
2954
|
-
const args = { ...input };
|
|
2955
|
-
if (!accounts.systemProgram.value) {
|
|
2956
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2957
|
-
}
|
|
2958
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2959
|
-
return Object.freeze({
|
|
2960
|
-
accounts: [
|
|
2961
|
-
getAccountMeta(accounts.master),
|
|
2962
|
-
getAccountMeta(accounts.config),
|
|
2963
|
-
getAccountMeta(accounts.treasury),
|
|
2964
|
-
getAccountMeta(accounts.affiliateMaster),
|
|
2965
|
-
getAccountMeta(accounts.airdropMaster),
|
|
2966
|
-
getAccountMeta(accounts.authority),
|
|
2967
|
-
getAccountMeta(accounts.systemProgram)
|
|
2968
|
-
],
|
|
2969
|
-
data: getInitializeAirdropMasterInstructionDataEncoder().encode(
|
|
2970
|
-
args
|
|
2971
|
-
),
|
|
2972
|
-
programAddress
|
|
2973
|
-
});
|
|
2974
|
-
}
|
|
2975
|
-
function parseInitializeAirdropMasterInstruction(instruction) {
|
|
2976
|
-
if (instruction.accounts.length < 7) {
|
|
2977
|
-
throw new Error("Not enough accounts");
|
|
2978
|
-
}
|
|
2979
|
-
let accountIndex = 0;
|
|
2980
|
-
const getNextAccount = () => {
|
|
2981
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
2982
|
-
accountIndex += 1;
|
|
2983
|
-
return accountMeta;
|
|
2984
|
-
};
|
|
2985
|
-
const getNextOptionalAccount = () => {
|
|
2986
|
-
const accountMeta = getNextAccount();
|
|
2987
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
2988
|
-
};
|
|
2989
|
-
return {
|
|
2990
|
-
programAddress: instruction.programAddress,
|
|
2991
|
-
accounts: {
|
|
2992
|
-
master: getNextAccount(),
|
|
2993
|
-
config: getNextAccount(),
|
|
2994
|
-
treasury: getNextAccount(),
|
|
2995
|
-
affiliateMaster: getNextOptionalAccount(),
|
|
2996
|
-
airdropMaster: getNextAccount(),
|
|
2997
|
-
authority: getNextAccount(),
|
|
2998
|
-
systemProgram: getNextAccount()
|
|
2999
|
-
},
|
|
3000
|
-
data: getInitializeAirdropMasterInstructionDataDecoder().decode(
|
|
3001
|
-
instruction.data
|
|
3002
|
-
)
|
|
3003
|
-
};
|
|
3004
|
-
}
|
|
3005
|
-
|
|
3006
|
-
// src/instructions/initializeMaster.ts
|
|
3007
|
-
import {
|
|
3008
|
-
combineCodec as combineCodec28,
|
|
3009
|
-
fixDecoderSize as fixDecoderSize15,
|
|
3010
|
-
fixEncoderSize as fixEncoderSize16,
|
|
3011
|
-
getBytesDecoder as getBytesDecoder15,
|
|
3012
|
-
getBytesEncoder as getBytesEncoder16,
|
|
3013
|
-
getProgramDerivedAddress as getProgramDerivedAddress7,
|
|
3014
|
-
getStructDecoder as getStructDecoder28,
|
|
3015
|
-
getStructEncoder as getStructEncoder28,
|
|
3016
|
-
getU64Decoder as getU64Decoder16,
|
|
3017
|
-
getU64Encoder as getU64Encoder16,
|
|
3018
|
-
transformEncoder as transformEncoder13
|
|
3019
|
-
} from "@solana/kit";
|
|
3020
|
-
var INITIALIZE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
3021
|
-
206,
|
|
3022
|
-
91,
|
|
3023
|
-
246,
|
|
3024
|
-
30,
|
|
3025
|
-
216,
|
|
3026
|
-
101,
|
|
3027
|
-
134,
|
|
3028
|
-
166
|
|
3029
|
-
]);
|
|
3030
|
-
function getInitializeMasterDiscriminatorBytes() {
|
|
3031
|
-
return fixEncoderSize16(getBytesEncoder16(), 8).encode(
|
|
3032
|
-
INITIALIZE_MASTER_DISCRIMINATOR
|
|
3033
|
-
);
|
|
3034
|
-
}
|
|
3035
|
-
function getInitializeMasterInstructionDataEncoder() {
|
|
3036
|
-
return transformEncoder13(
|
|
3037
|
-
getStructEncoder28([
|
|
3038
|
-
["discriminator", fixEncoderSize16(getBytesEncoder16(), 8)],
|
|
3039
|
-
["airdropConfig", getInitAirdropConfigArgsEncoder()],
|
|
3040
|
-
["protocolFee", getU64Encoder16()]
|
|
3041
|
-
]),
|
|
3042
|
-
(value) => ({ ...value, discriminator: INITIALIZE_MASTER_DISCRIMINATOR })
|
|
3043
|
-
);
|
|
3044
|
-
}
|
|
3045
|
-
function getInitializeMasterInstructionDataDecoder() {
|
|
3046
|
-
return getStructDecoder28([
|
|
3047
|
-
["discriminator", fixDecoderSize15(getBytesDecoder15(), 8)],
|
|
3048
|
-
["airdropConfig", getInitAirdropConfigArgsDecoder()],
|
|
3049
|
-
["protocolFee", getU64Decoder16()]
|
|
3050
|
-
]);
|
|
3051
|
-
}
|
|
3052
|
-
function getInitializeMasterInstructionDataCodec() {
|
|
3053
|
-
return combineCodec28(
|
|
3054
|
-
getInitializeMasterInstructionDataEncoder(),
|
|
3055
|
-
getInitializeMasterInstructionDataDecoder()
|
|
3056
|
-
);
|
|
3057
|
-
}
|
|
3058
|
-
async function getInitializeMasterInstructionAsync(input, config) {
|
|
3059
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
3060
|
-
const originalAccounts = {
|
|
3061
|
-
master: { value: input.master ?? null, isWritable: true },
|
|
3062
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
3063
|
-
treasury: { value: input.treasury ?? null, isWritable: false },
|
|
3064
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
3065
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
3066
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3067
|
-
};
|
|
3068
|
-
const accounts = originalAccounts;
|
|
3069
|
-
const args = { ...input };
|
|
3070
|
-
if (!accounts.master.value) {
|
|
3071
|
-
accounts.master.value = await getProgramDerivedAddress7({
|
|
3072
|
-
programAddress,
|
|
3073
|
-
seeds: [
|
|
3074
|
-
getBytesEncoder16().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
3075
|
-
]
|
|
3076
|
-
});
|
|
3077
|
-
}
|
|
3078
|
-
if (!accounts.config.value) {
|
|
3079
|
-
accounts.config.value = await getProgramDerivedAddress7({
|
|
3080
|
-
programAddress,
|
|
3081
|
-
seeds: [
|
|
3082
|
-
getBytesEncoder16().encode(
|
|
3083
|
-
new Uint8Array([
|
|
3084
|
-
97,
|
|
3085
|
-
105,
|
|
3086
|
-
114,
|
|
3087
|
-
100,
|
|
3088
|
-
114,
|
|
3089
|
-
111,
|
|
3090
|
-
112,
|
|
3091
|
-
95,
|
|
3092
|
-
99,
|
|
3093
|
-
111,
|
|
3094
|
-
110,
|
|
3095
|
-
102,
|
|
3096
|
-
105,
|
|
3097
|
-
103
|
|
3098
|
-
])
|
|
3099
|
-
)
|
|
3100
|
-
]
|
|
3101
|
-
});
|
|
3102
|
-
}
|
|
3103
|
-
if (!accounts.authority.value) {
|
|
3104
|
-
accounts.authority.value = "8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT";
|
|
3105
|
-
}
|
|
3106
|
-
if (!accounts.systemProgram.value) {
|
|
3107
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3108
|
-
}
|
|
3109
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
3110
|
-
return Object.freeze({
|
|
3111
|
-
accounts: [
|
|
3112
|
-
getAccountMeta(accounts.master),
|
|
3113
|
-
getAccountMeta(accounts.config),
|
|
3114
|
-
getAccountMeta(accounts.treasury),
|
|
3115
|
-
getAccountMeta(accounts.tokenMint),
|
|
3116
|
-
getAccountMeta(accounts.authority),
|
|
3117
|
-
getAccountMeta(accounts.systemProgram)
|
|
3118
|
-
],
|
|
3119
|
-
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
3120
|
-
args
|
|
3121
|
-
),
|
|
3122
|
-
programAddress
|
|
3123
|
-
});
|
|
3124
|
-
}
|
|
3125
|
-
function getInitializeMasterInstruction(input, config) {
|
|
3126
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
3127
|
-
const originalAccounts = {
|
|
3128
|
-
master: { value: input.master ?? null, isWritable: true },
|
|
3129
|
-
config: { value: input.config ?? null, isWritable: true },
|
|
3130
|
-
treasury: { value: input.treasury ?? null, isWritable: false },
|
|
3131
|
-
tokenMint: { value: input.tokenMint ?? null, isWritable: false },
|
|
3132
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
3133
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3134
|
-
};
|
|
3135
|
-
const accounts = originalAccounts;
|
|
3136
|
-
const args = { ...input };
|
|
3137
|
-
if (!accounts.authority.value) {
|
|
3138
|
-
accounts.authority.value = "8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT";
|
|
3139
|
-
}
|
|
3140
|
-
if (!accounts.systemProgram.value) {
|
|
3141
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3142
|
-
}
|
|
3143
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
3144
|
-
return Object.freeze({
|
|
3145
|
-
accounts: [
|
|
3146
|
-
getAccountMeta(accounts.master),
|
|
3147
|
-
getAccountMeta(accounts.config),
|
|
3148
|
-
getAccountMeta(accounts.treasury),
|
|
3149
|
-
getAccountMeta(accounts.tokenMint),
|
|
3150
|
-
getAccountMeta(accounts.authority),
|
|
3151
|
-
getAccountMeta(accounts.systemProgram)
|
|
3152
|
-
],
|
|
3153
|
-
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
3154
|
-
args
|
|
3155
|
-
),
|
|
3156
|
-
programAddress
|
|
3157
|
-
});
|
|
3158
|
-
}
|
|
3159
|
-
function parseInitializeMasterInstruction(instruction) {
|
|
3160
|
-
if (instruction.accounts.length < 6) {
|
|
3161
|
-
throw new Error("Not enough accounts");
|
|
3162
|
-
}
|
|
3163
|
-
let accountIndex = 0;
|
|
3164
|
-
const getNextAccount = () => {
|
|
3165
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3166
|
-
accountIndex += 1;
|
|
3167
|
-
return accountMeta;
|
|
3168
|
-
};
|
|
3169
|
-
const getNextOptionalAccount = () => {
|
|
3170
|
-
const accountMeta = getNextAccount();
|
|
3171
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
3172
|
-
};
|
|
3173
|
-
return {
|
|
3174
|
-
programAddress: instruction.programAddress,
|
|
3175
|
-
accounts: {
|
|
3176
|
-
master: getNextAccount(),
|
|
3177
|
-
config: getNextAccount(),
|
|
3178
|
-
treasury: getNextAccount(),
|
|
3179
|
-
tokenMint: getNextOptionalAccount(),
|
|
3180
|
-
authority: getNextAccount(),
|
|
3181
|
-
systemProgram: getNextAccount()
|
|
3182
|
-
},
|
|
3183
|
-
data: getInitializeMasterInstructionDataDecoder().decode(instruction.data)
|
|
3184
|
-
};
|
|
3185
|
-
}
|
|
3186
|
-
|
|
3187
|
-
// src/instructions/redeemAirdropTokens.ts
|
|
3188
|
-
import {
|
|
3189
|
-
combineCodec as combineCodec29,
|
|
3190
|
-
fixDecoderSize as fixDecoderSize16,
|
|
3191
|
-
fixEncoderSize as fixEncoderSize17,
|
|
3192
|
-
getAddressEncoder as getAddressEncoder23,
|
|
3193
|
-
getBytesDecoder as getBytesDecoder16,
|
|
3194
|
-
getBytesEncoder as getBytesEncoder17,
|
|
3195
|
-
getProgramDerivedAddress as getProgramDerivedAddress8,
|
|
3196
|
-
getStructDecoder as getStructDecoder29,
|
|
3197
|
-
getStructEncoder as getStructEncoder29,
|
|
3198
|
-
transformEncoder as transformEncoder14
|
|
3199
|
-
} from "@solana/kit";
|
|
3200
|
-
var REDEEM_AIRDROP_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
3201
|
-
102,
|
|
3202
|
-
70,
|
|
3203
|
-
115,
|
|
3204
|
-
13,
|
|
3205
|
-
97,
|
|
3206
|
-
198,
|
|
3207
|
-
59,
|
|
3208
|
-
103
|
|
3209
|
-
]);
|
|
3210
|
-
function getRedeemAirdropTokensDiscriminatorBytes() {
|
|
3211
|
-
return fixEncoderSize17(getBytesEncoder17(), 8).encode(
|
|
3212
|
-
REDEEM_AIRDROP_TOKENS_DISCRIMINATOR
|
|
3213
|
-
);
|
|
3214
|
-
}
|
|
3215
|
-
function getRedeemAirdropTokensInstructionDataEncoder() {
|
|
3216
|
-
return transformEncoder14(
|
|
3217
|
-
getStructEncoder29([["discriminator", fixEncoderSize17(getBytesEncoder17(), 8)]]),
|
|
3218
|
-
(value) => ({
|
|
3219
|
-
...value,
|
|
3220
|
-
discriminator: REDEEM_AIRDROP_TOKENS_DISCRIMINATOR
|
|
3221
|
-
})
|
|
3222
|
-
);
|
|
3223
|
-
}
|
|
3224
|
-
function getRedeemAirdropTokensInstructionDataDecoder() {
|
|
3225
|
-
return getStructDecoder29([
|
|
3226
|
-
["discriminator", fixDecoderSize16(getBytesDecoder16(), 8)]
|
|
3227
|
-
]);
|
|
3228
|
-
}
|
|
3229
|
-
function getRedeemAirdropTokensInstructionDataCodec() {
|
|
3230
|
-
return combineCodec29(
|
|
3231
|
-
getRedeemAirdropTokensInstructionDataEncoder(),
|
|
3232
|
-
getRedeemAirdropTokensInstructionDataDecoder()
|
|
3233
|
-
);
|
|
3234
|
-
}
|
|
3235
|
-
async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
3236
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
3237
|
-
const originalAccounts = {
|
|
3238
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
3239
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
3240
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
3241
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
3242
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
3243
|
-
sourceTokenAccount: {
|
|
3244
|
-
value: input.sourceTokenAccount ?? null,
|
|
3245
|
-
isWritable: true
|
|
3246
|
-
},
|
|
3247
|
-
destinationTokenAccount: {
|
|
3248
|
-
value: input.destinationTokenAccount ?? null,
|
|
3249
|
-
isWritable: true
|
|
3250
|
-
},
|
|
3251
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
3252
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
3253
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
3254
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
3255
|
-
associatedTokenProgram: {
|
|
3256
|
-
value: input.associatedTokenProgram ?? null,
|
|
3257
|
-
isWritable: false
|
|
3258
|
-
},
|
|
3259
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3260
|
-
};
|
|
3261
|
-
const accounts = originalAccounts;
|
|
3262
|
-
if (!accounts.master.value) {
|
|
3263
|
-
accounts.master.value = await getProgramDerivedAddress8({
|
|
3264
|
-
programAddress,
|
|
3265
|
-
seeds: [
|
|
3266
|
-
getBytesEncoder17().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
3267
|
-
]
|
|
3268
|
-
});
|
|
3269
|
-
}
|
|
3270
|
-
if (!accounts.config.value) {
|
|
3271
|
-
accounts.config.value = await getProgramDerivedAddress8({
|
|
3272
|
-
programAddress,
|
|
3273
|
-
seeds: [
|
|
3274
|
-
getBytesEncoder17().encode(
|
|
3275
|
-
new Uint8Array([
|
|
3276
|
-
97,
|
|
3277
|
-
105,
|
|
3278
|
-
114,
|
|
3279
|
-
100,
|
|
3280
|
-
114,
|
|
3281
|
-
111,
|
|
3282
|
-
112,
|
|
3283
|
-
95,
|
|
3284
|
-
99,
|
|
3285
|
-
111,
|
|
3286
|
-
110,
|
|
3287
|
-
102,
|
|
3288
|
-
105,
|
|
3289
|
-
103
|
|
3290
|
-
])
|
|
3291
|
-
)
|
|
3292
|
-
]
|
|
3293
|
-
});
|
|
3294
|
-
}
|
|
3295
|
-
if (!accounts.airdrop.value) {
|
|
3296
|
-
accounts.airdrop.value = await getProgramDerivedAddress8({
|
|
3297
|
-
programAddress,
|
|
3298
|
-
seeds: [
|
|
3299
|
-
getBytesEncoder17().encode(
|
|
3300
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
3301
|
-
),
|
|
3302
|
-
getAddressEncoder23().encode(expectAddress(accounts.mint.value)),
|
|
3303
|
-
getAddressEncoder23().encode(expectAddress(accounts.authority.value))
|
|
3304
|
-
]
|
|
3305
|
-
});
|
|
3306
|
-
}
|
|
3307
|
-
if (!accounts.tokenProgram.value) {
|
|
3308
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
3309
|
-
}
|
|
3310
|
-
if (!accounts.destinationTokenAccount.value) {
|
|
3311
|
-
accounts.destinationTokenAccount.value = await getProgramDerivedAddress8({
|
|
3312
|
-
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
3313
|
-
seeds: [
|
|
3314
|
-
getAddressEncoder23().encode(expectAddress(accounts.airdrop.value)),
|
|
3315
|
-
getAddressEncoder23().encode(expectAddress(accounts.tokenProgram.value)),
|
|
3316
|
-
getAddressEncoder23().encode(expectAddress(accounts.mint.value))
|
|
3317
|
-
]
|
|
3318
|
-
});
|
|
3319
|
-
}
|
|
3320
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
3321
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
3322
|
-
}
|
|
3323
|
-
if (!accounts.systemProgram.value) {
|
|
3324
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3325
|
-
}
|
|
3326
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
3327
|
-
return Object.freeze({
|
|
3328
|
-
accounts: [
|
|
3329
|
-
getAccountMeta(accounts.master),
|
|
3330
|
-
getAccountMeta(accounts.config),
|
|
3331
|
-
getAccountMeta(accounts.treasury),
|
|
3332
|
-
getAccountMeta(accounts.airdropMaster),
|
|
3333
|
-
getAccountMeta(accounts.affiliate),
|
|
3334
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
3335
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
3336
|
-
getAccountMeta(accounts.airdrop),
|
|
3337
|
-
getAccountMeta(accounts.mint),
|
|
3338
|
-
getAccountMeta(accounts.authority),
|
|
3339
|
-
getAccountMeta(accounts.tokenProgram),
|
|
3340
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
3341
|
-
getAccountMeta(accounts.systemProgram)
|
|
3342
|
-
],
|
|
3343
|
-
data: getRedeemAirdropTokensInstructionDataEncoder().encode({}),
|
|
3344
|
-
programAddress
|
|
3345
|
-
});
|
|
3346
|
-
}
|
|
3347
|
-
function getRedeemAirdropTokensInstruction(input, config) {
|
|
3348
|
-
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
3349
|
-
const originalAccounts = {
|
|
3350
|
-
master: { value: input.master ?? null, isWritable: false },
|
|
3351
|
-
config: { value: input.config ?? null, isWritable: false },
|
|
3352
|
-
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
3353
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
3354
|
-
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
3355
|
-
sourceTokenAccount: {
|
|
3356
|
-
value: input.sourceTokenAccount ?? null,
|
|
3357
|
-
isWritable: true
|
|
3358
|
-
},
|
|
3359
|
-
destinationTokenAccount: {
|
|
3360
|
-
value: input.destinationTokenAccount ?? null,
|
|
3361
|
-
isWritable: true
|
|
3362
|
-
},
|
|
3363
|
-
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
3364
|
-
mint: { value: input.mint ?? null, isWritable: false },
|
|
3365
|
-
authority: { value: input.authority ?? null, isWritable: true },
|
|
3366
|
-
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
3367
|
-
associatedTokenProgram: {
|
|
3368
|
-
value: input.associatedTokenProgram ?? null,
|
|
3369
|
-
isWritable: false
|
|
3370
|
-
},
|
|
3371
|
-
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
3372
|
-
};
|
|
3373
|
-
const accounts = originalAccounts;
|
|
3374
|
-
if (!accounts.tokenProgram.value) {
|
|
3375
|
-
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
3376
|
-
}
|
|
3377
|
-
if (!accounts.associatedTokenProgram.value) {
|
|
3378
|
-
accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
3379
|
-
}
|
|
3380
|
-
if (!accounts.systemProgram.value) {
|
|
3381
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
3382
|
-
}
|
|
3383
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
3384
|
-
return Object.freeze({
|
|
3385
|
-
accounts: [
|
|
3386
|
-
getAccountMeta(accounts.master),
|
|
3387
|
-
getAccountMeta(accounts.config),
|
|
3388
|
-
getAccountMeta(accounts.treasury),
|
|
3389
|
-
getAccountMeta(accounts.airdropMaster),
|
|
3390
|
-
getAccountMeta(accounts.affiliate),
|
|
3391
|
-
getAccountMeta(accounts.sourceTokenAccount),
|
|
3392
|
-
getAccountMeta(accounts.destinationTokenAccount),
|
|
3393
|
-
getAccountMeta(accounts.airdrop),
|
|
3394
|
-
getAccountMeta(accounts.mint),
|
|
3395
|
-
getAccountMeta(accounts.authority),
|
|
3396
|
-
getAccountMeta(accounts.tokenProgram),
|
|
3397
|
-
getAccountMeta(accounts.associatedTokenProgram),
|
|
3398
|
-
getAccountMeta(accounts.systemProgram)
|
|
3399
|
-
],
|
|
3400
|
-
data: getRedeemAirdropTokensInstructionDataEncoder().encode({}),
|
|
3401
|
-
programAddress
|
|
3402
|
-
});
|
|
3403
|
-
}
|
|
3404
|
-
function parseRedeemAirdropTokensInstruction(instruction) {
|
|
3405
|
-
if (instruction.accounts.length < 13) {
|
|
3406
|
-
throw new Error("Not enough accounts");
|
|
3407
|
-
}
|
|
3408
|
-
let accountIndex = 0;
|
|
3409
|
-
const getNextAccount = () => {
|
|
3410
|
-
const accountMeta = instruction.accounts[accountIndex];
|
|
3411
|
-
accountIndex += 1;
|
|
3412
|
-
return accountMeta;
|
|
3413
|
-
};
|
|
3414
|
-
const getNextOptionalAccount = () => {
|
|
3415
|
-
const accountMeta = getNextAccount();
|
|
3416
|
-
return accountMeta.address === DROPSY_PROGRAM_ADDRESS ? void 0 : accountMeta;
|
|
3417
|
-
};
|
|
3418
|
-
return {
|
|
3419
|
-
programAddress: instruction.programAddress,
|
|
3420
|
-
accounts: {
|
|
3421
|
-
master: getNextAccount(),
|
|
3422
|
-
config: getNextAccount(),
|
|
3423
|
-
treasury: getNextAccount(),
|
|
3424
|
-
airdropMaster: getNextAccount(),
|
|
3425
|
-
affiliate: getNextOptionalAccount(),
|
|
3426
|
-
sourceTokenAccount: getNextAccount(),
|
|
3427
|
-
destinationTokenAccount: getNextAccount(),
|
|
3428
|
-
airdrop: getNextAccount(),
|
|
3429
|
-
mint: getNextAccount(),
|
|
3430
|
-
authority: getNextAccount(),
|
|
3431
|
-
tokenProgram: getNextAccount(),
|
|
3432
|
-
associatedTokenProgram: getNextAccount(),
|
|
3433
|
-
systemProgram: getNextAccount()
|
|
3434
|
-
},
|
|
3435
|
-
data: getRedeemAirdropTokensInstructionDataDecoder().decode(
|
|
3436
|
-
instruction.data
|
|
3437
|
-
)
|
|
3438
|
-
};
|
|
3439
|
-
}
|
|
3440
|
-
export {
|
|
3441
|
-
ADMIN,
|
|
3442
|
-
AFFILIATE_DISCRIMINATOR,
|
|
3443
|
-
AFFILIATE_MASTER_DISCRIMINATOR,
|
|
3444
|
-
AFFILIATE_MASTER_SEED,
|
|
3445
|
-
AFFILIATE_SEED,
|
|
3446
|
-
AIRDROP_CONFIG_DISCRIMINATOR,
|
|
3447
|
-
AIRDROP_CONFIG_SEED,
|
|
3448
|
-
AIRDROP_DISCRIMINATOR,
|
|
3449
|
-
AIRDROP_MASTER_DISCRIMINATOR,
|
|
3450
|
-
AIRDROP_MASTER_SEED,
|
|
3451
|
-
AIRDROP_SEED,
|
|
3452
|
-
BITMAP_SEED,
|
|
3453
|
-
BITMAP_SIZE,
|
|
3454
|
-
CLAIM_AIRDROP_DISCRIMINATOR,
|
|
3455
|
-
CLAIM_MAP_DISCRIMINATOR,
|
|
3456
|
-
CREATE_AIRDROP_DISCRIMINATOR,
|
|
3457
|
-
CREATE_CLAIM_MAP_DISCRIMINATOR,
|
|
3458
|
-
DEFAULT_MASTER_PDA,
|
|
3459
|
-
DEFAULT_MASTER_PDA_AUTHORITY,
|
|
3460
|
-
DEPOSIT_TOKENS_DISCRIMINATOR,
|
|
3461
|
-
DROPSY_ERROR__ACTIVE_BITMAPS_EXIST,
|
|
3462
|
-
DROPSY_ERROR__AIRDROP_ENDED,
|
|
3463
|
-
DROPSY_ERROR__AIRDROP_NOT_ENDED,
|
|
3464
|
-
DROPSY_ERROR__AIRDROP_NOT_STARTED,
|
|
3465
|
-
DROPSY_ERROR__ALREADY_CLAIMED,
|
|
3466
|
-
DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH,
|
|
3467
|
-
DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW,
|
|
3468
|
-
DROPSY_ERROR__BITMAP_TOO_LARGE,
|
|
3469
|
-
DROPSY_ERROR__CLAIM_FEE_TOO_HIGH,
|
|
3470
|
-
DROPSY_ERROR__CREATE_FEE_TOO_HIGH,
|
|
3471
|
-
DROPSY_ERROR__DESTINATION_MINT_MISMATCH,
|
|
3472
|
-
DROPSY_ERROR__DURATION_TOO_SHORT,
|
|
3473
|
-
DROPSY_ERROR__IMMUTABLE_AIRDROP,
|
|
3474
|
-
DROPSY_ERROR__IMMUTABLE_FIELD,
|
|
3475
|
-
DROPSY_ERROR__INSUFFICIENT_DEPOSIT,
|
|
3476
|
-
DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE,
|
|
3477
|
-
DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS,
|
|
3478
|
-
DROPSY_ERROR__INVALID_ADMIN,
|
|
3479
|
-
DROPSY_ERROR__INVALID_AFFILIATE_PDA,
|
|
3480
|
-
DROPSY_ERROR__INVALID_AIRDROP_MASTER_ACCOUNT,
|
|
3481
|
-
DROPSY_ERROR__INVALID_AIRDROP_PDA,
|
|
3482
|
-
DROPSY_ERROR__INVALID_AIRDROP_VERSION,
|
|
3483
|
-
DROPSY_ERROR__INVALID_AIRDROP_VESTING_VERSION,
|
|
3484
|
-
DROPSY_ERROR__INVALID_AMOUNT,
|
|
3485
|
-
DROPSY_ERROR__INVALID_BITMAP_ACCOUNT,
|
|
3486
|
-
DROPSY_ERROR__INVALID_BITMAP_INDEX,
|
|
3487
|
-
DROPSY_ERROR__INVALID_DELEGATE_PERMISSION,
|
|
3488
|
-
DROPSY_ERROR__INVALID_DESTINATION_OWNER,
|
|
3489
|
-
DROPSY_ERROR__INVALID_END_TIME,
|
|
3490
|
-
DROPSY_ERROR__INVALID_FEE_VAULT,
|
|
3491
|
-
DROPSY_ERROR__INVALID_FEE_VAULT_CURVE,
|
|
3492
|
-
DROPSY_ERROR__INVALID_FEE_VAULT_OWNER,
|
|
3493
|
-
DROPSY_ERROR__INVALID_MINT,
|
|
3494
|
-
DROPSY_ERROR__INVALID_MINT_OWNER,
|
|
3495
|
-
DROPSY_ERROR__INVALID_MUTABILITY,
|
|
3496
|
-
DROPSY_ERROR__INVALID_OWNER,
|
|
3497
|
-
DROPSY_ERROR__INVALID_PARENT_ACCOUNT,
|
|
3498
|
-
DROPSY_ERROR__INVALID_PDA,
|
|
3499
|
-
DROPSY_ERROR__INVALID_PERCENTAGE,
|
|
3500
|
-
DROPSY_ERROR__INVALID_PROOF,
|
|
3501
|
-
DROPSY_ERROR__INVALID_PUB_KEY,
|
|
3502
|
-
DROPSY_ERROR__INVALID_TIMESTAMP,
|
|
3503
|
-
DROPSY_ERROR__INVALID_TOTAL,
|
|
3504
|
-
DROPSY_ERROR__INVALID_TREASURY_ACCOUNT,
|
|
3505
|
-
DROPSY_ERROR__INVALID_VAULT_AUTHORITY,
|
|
3506
|
-
DROPSY_ERROR__INVALID_VESTING_SCHEDULE,
|
|
3507
|
-
DROPSY_ERROR__INVALID_VESTING_TYPE,
|
|
3508
|
-
DROPSY_ERROR__MAX_AIRDROPS_REACHED,
|
|
3509
|
-
DROPSY_ERROR__MAX_CLAIM_MAPS_REACHED,
|
|
3510
|
-
DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY,
|
|
3511
|
-
DROPSY_ERROR__MINT_IS_FROZEN,
|
|
3512
|
-
DROPSY_ERROR__MINT_IS_NOT_INITIALIZED,
|
|
3513
|
-
DROPSY_ERROR__MINT_MISMATCH,
|
|
3514
|
-
DROPSY_ERROR__MISSING_BITMAP_PDA,
|
|
3515
|
-
DROPSY_ERROR__NFT_NOT_ALLOWED,
|
|
3516
|
-
DROPSY_ERROR__NON_ZERO_VALUE_REQUIRED,
|
|
3517
|
-
DROPSY_ERROR__OVERFLOW,
|
|
3518
|
-
DROPSY_ERROR__OWNER_MISMATCH,
|
|
3519
|
-
DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN,
|
|
3520
|
-
DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY,
|
|
3521
|
-
DROPSY_ERROR__SOURCE_HAS_DELEGATE,
|
|
3522
|
-
DROPSY_ERROR__TOO_MANY_BITMAPS,
|
|
3523
|
-
DROPSY_ERROR__UNAUTHORIZED,
|
|
3524
|
-
DROPSY_ERROR__UN_AUTHORIZED,
|
|
3525
|
-
DROPSY_ERROR__UPDATE_CUTOFF_TIME_PASSED,
|
|
3526
|
-
DROPSY_ERROR__VALUE_BELOW_THE_MINIMUM,
|
|
3527
|
-
DROPSY_ERROR__VALUE_EXCEEDS_MAXIMUM,
|
|
3528
|
-
DROPSY_ERROR__VALUE_OUT_OF_RANGE,
|
|
3529
|
-
DROPSY_ERROR__VAULT_FROZEN,
|
|
3530
|
-
DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY,
|
|
3531
|
-
DROPSY_ERROR__VAULT_HAS_DELEGATE,
|
|
3532
|
-
DROPSY_ERROR__VAULT_MINT_MISMATCH,
|
|
3533
|
-
DROPSY_ERROR__VAULT_NOT_INITIALIZED,
|
|
3534
|
-
DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT,
|
|
3535
|
-
DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED,
|
|
3536
|
-
DROPSY_MASTER_SEED,
|
|
3537
|
-
DROPSY_PROGRAM_ADDRESS,
|
|
3538
|
-
DROPSY_TREASURY,
|
|
3539
|
-
DropsyAccount,
|
|
3540
|
-
DropsyInstruction,
|
|
3541
|
-
INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR,
|
|
3542
|
-
INITIALIZE_MASTER_DISCRIMINATOR,
|
|
3543
|
-
MASTER_DISCRIMINATOR,
|
|
3544
|
-
MAX_BITMAP_CLAIM,
|
|
3545
|
-
MUTABLE_NONE,
|
|
3546
|
-
PRESALE_SEED,
|
|
3547
|
-
REDEEM_AIRDROP_TOKENS_DISCRIMINATOR,
|
|
3548
|
-
STATE_DELEGATED,
|
|
3549
|
-
STATE_INITIALIZED,
|
|
3550
|
-
STATE_REDEEMED,
|
|
3551
|
-
VAULT_SEED,
|
|
3552
|
-
VERSION_BASIC,
|
|
3553
|
-
VERSION_VESTED,
|
|
3554
|
-
VESTING_SEED,
|
|
3555
|
-
createDefaultSolanaClient,
|
|
3556
|
-
createMerkleTree,
|
|
3557
|
-
createTransactionMessageFromInstructions,
|
|
3558
|
-
createWLMerkleTree,
|
|
3559
|
-
decodeAffiliate,
|
|
3560
|
-
decodeAffiliateMaster,
|
|
3561
|
-
decodeAirdrop,
|
|
3562
|
-
decodeAirdropConfig,
|
|
3563
|
-
decodeAirdropMaster,
|
|
3564
|
-
decodeClaimMap,
|
|
3565
|
-
decodeMaster,
|
|
3566
|
-
fetchAffiliate,
|
|
3567
|
-
fetchAffiliateMaster,
|
|
3568
|
-
fetchAirdrop,
|
|
3569
|
-
fetchAirdropConfig,
|
|
3570
|
-
fetchAirdropMaster,
|
|
3571
|
-
fetchAllAffiliate,
|
|
3572
|
-
fetchAllAffiliateMaster,
|
|
3573
|
-
fetchAllAirdrop,
|
|
3574
|
-
fetchAllAirdropConfig,
|
|
3575
|
-
fetchAllAirdropMaster,
|
|
3576
|
-
fetchAllClaimMap,
|
|
3577
|
-
fetchAllMaster,
|
|
3578
|
-
fetchAllMaybeAffiliate,
|
|
3579
|
-
fetchAllMaybeAffiliateMaster,
|
|
3580
|
-
fetchAllMaybeAirdrop,
|
|
3581
|
-
fetchAllMaybeAirdropConfig,
|
|
3582
|
-
fetchAllMaybeAirdropMaster,
|
|
3583
|
-
fetchAllMaybeClaimMap,
|
|
3584
|
-
fetchAllMaybeMaster,
|
|
3585
|
-
fetchClaimMap,
|
|
3586
|
-
fetchMaster,
|
|
3587
|
-
fetchMaybeAffiliate,
|
|
3588
|
-
fetchMaybeAffiliateMaster,
|
|
3589
|
-
fetchMaybeAirdrop,
|
|
3590
|
-
fetchMaybeAirdropConfig,
|
|
3591
|
-
fetchMaybeAirdropMaster,
|
|
3592
|
-
fetchMaybeClaimMap,
|
|
3593
|
-
fetchMaybeMaster,
|
|
3594
|
-
generateKeyPairSignerWithSol,
|
|
3595
|
-
getAdvancedFeeConfigCodec,
|
|
3596
|
-
getAdvancedFeeConfigDecoder,
|
|
3597
|
-
getAdvancedFeeConfigEncoder,
|
|
3598
|
-
getAffiliateCodec,
|
|
3599
|
-
getAffiliateDecoder,
|
|
3600
|
-
getAffiliateDerivedAddress,
|
|
3601
|
-
getAffiliateDiscriminatorBytes,
|
|
3602
|
-
getAffiliateEncoder,
|
|
3603
|
-
getAffiliateMasterCodec,
|
|
3604
|
-
getAffiliateMasterDecoder,
|
|
3605
|
-
getAffiliateMasterDiscriminatorBytes,
|
|
3606
|
-
getAffiliateMasterEncoder,
|
|
3607
|
-
getAffiliateMasterSize,
|
|
3608
|
-
getAffiliateSize,
|
|
3609
|
-
getAirdropBoostedCodec,
|
|
3610
|
-
getAirdropBoostedDecoder,
|
|
3611
|
-
getAirdropBoostedEncoder,
|
|
3612
|
-
getAirdropClosedCodec,
|
|
3613
|
-
getAirdropClosedDecoder,
|
|
3614
|
-
getAirdropClosedEncoder,
|
|
3615
|
-
getAirdropCodec,
|
|
3616
|
-
getAirdropConfigCodec,
|
|
3617
|
-
getAirdropConfigDecoder,
|
|
3618
|
-
getAirdropConfigDerivedAddress,
|
|
3619
|
-
getAirdropConfigDiscriminatorBytes,
|
|
3620
|
-
getAirdropConfigEncoder,
|
|
3621
|
-
getAirdropConfigSize,
|
|
3622
|
-
getAirdropDecoder,
|
|
3623
|
-
getAirdropDelegatedCodec,
|
|
3624
|
-
getAirdropDelegatedDecoder,
|
|
3625
|
-
getAirdropDelegatedEncoder,
|
|
3626
|
-
getAirdropDerivedAddress,
|
|
3627
|
-
getAirdropDiscriminatorBytes,
|
|
3628
|
-
getAirdropEncoder,
|
|
3629
|
-
getAirdropInitializedCodec,
|
|
3630
|
-
getAirdropInitializedDecoder,
|
|
3631
|
-
getAirdropInitializedEncoder,
|
|
3632
|
-
getAirdropMasterCodec,
|
|
3633
|
-
getAirdropMasterDecoder,
|
|
3634
|
-
getAirdropMasterDerivedAddress,
|
|
3635
|
-
getAirdropMasterDiscriminatorBytes,
|
|
3636
|
-
getAirdropMasterEncoder,
|
|
3637
|
-
getAirdropMasterSize,
|
|
3638
|
-
getAirdropSize,
|
|
3639
|
-
getAirdropUpdatedCodec,
|
|
3640
|
-
getAirdropUpdatedDecoder,
|
|
3641
|
-
getAirdropUpdatedEncoder,
|
|
3642
|
-
getBaseDurationConfigCodec,
|
|
3643
|
-
getBaseDurationConfigDecoder,
|
|
3644
|
-
getBaseDurationConfigEncoder,
|
|
3645
|
-
getBaseFeatureFeeConfigCodec,
|
|
3646
|
-
getBaseFeatureFeeConfigDecoder,
|
|
3647
|
-
getBaseFeatureFeeConfigEncoder,
|
|
3648
|
-
getBaseFeeConfigCodec,
|
|
3649
|
-
getBaseFeeConfigDecoder,
|
|
3650
|
-
getBaseFeeConfigEncoder,
|
|
3651
|
-
getClaimAirdropDiscriminatorBytes,
|
|
3652
|
-
getClaimAirdropInstruction,
|
|
3653
|
-
getClaimAirdropInstructionAsync,
|
|
3654
|
-
getClaimAirdropInstructionDataCodec,
|
|
3655
|
-
getClaimAirdropInstructionDataDecoder,
|
|
3656
|
-
getClaimAirdropInstructionDataEncoder,
|
|
3657
|
-
getClaimMapClosedCodec,
|
|
3658
|
-
getClaimMapClosedDecoder,
|
|
3659
|
-
getClaimMapClosedEncoder,
|
|
3660
|
-
getClaimMapCodec,
|
|
3661
|
-
getClaimMapDecoder,
|
|
3662
|
-
getClaimMapDerivedAddress,
|
|
3663
|
-
getClaimMapDiscriminatorBytes,
|
|
3664
|
-
getClaimMapEncoder,
|
|
3665
|
-
getClaimMapInitializedCodec,
|
|
3666
|
-
getClaimMapInitializedDecoder,
|
|
3667
|
-
getClaimMapInitializedEncoder,
|
|
3668
|
-
getClaimMapSize,
|
|
3669
|
-
getCreateAirdropDiscriminatorBytes,
|
|
3670
|
-
getCreateAirdropInstruction,
|
|
3671
|
-
getCreateAirdropInstructionAsync,
|
|
3672
|
-
getCreateAirdropInstructionDataCodec,
|
|
3673
|
-
getCreateAirdropInstructionDataDecoder,
|
|
3674
|
-
getCreateAirdropInstructionDataEncoder,
|
|
3675
|
-
getCreateAirdropV0Instruction,
|
|
3676
|
-
getCreateClaimMapDiscriminatorBytes,
|
|
3677
|
-
getCreateClaimMapInstruction,
|
|
3678
|
-
getCreateClaimMapInstructionAsync,
|
|
3679
|
-
getCreateClaimMapInstructionDataCodec,
|
|
3680
|
-
getCreateClaimMapInstructionDataDecoder,
|
|
3681
|
-
getCreateClaimMapInstructionDataEncoder,
|
|
3682
|
-
getCreateClaimMapV0Instruction,
|
|
3683
|
-
getDepositTokensDiscriminatorBytes,
|
|
3684
|
-
getDepositTokensInstruction,
|
|
3685
|
-
getDepositTokensInstructionAsync,
|
|
3686
|
-
getDepositTokensInstructionDataCodec,
|
|
3687
|
-
getDepositTokensInstructionDataDecoder,
|
|
3688
|
-
getDepositTokensInstructionDataEncoder,
|
|
3689
|
-
getDropsyDerivedAddress,
|
|
3690
|
-
getDropsyErrorMessage,
|
|
3691
|
-
getInitAirdropConfigArgsCodec,
|
|
3692
|
-
getInitAirdropConfigArgsDecoder,
|
|
3693
|
-
getInitAirdropConfigArgsEncoder,
|
|
3694
|
-
getInitializeAirdropMasterDiscriminatorBytes,
|
|
3695
|
-
getInitializeAirdropMasterInstruction,
|
|
3696
|
-
getInitializeAirdropMasterInstructionAsync,
|
|
3697
|
-
getInitializeAirdropMasterInstructionDataCodec,
|
|
3698
|
-
getInitializeAirdropMasterInstructionDataDecoder,
|
|
3699
|
-
getInitializeAirdropMasterInstructionDataEncoder,
|
|
3700
|
-
getInitializeMasterDiscriminatorBytes,
|
|
3701
|
-
getInitializeMasterInstruction,
|
|
3702
|
-
getInitializeMasterInstructionAsync,
|
|
3703
|
-
getInitializeMasterInstructionDataCodec,
|
|
3704
|
-
getInitializeMasterInstructionDataDecoder,
|
|
3705
|
-
getInitializeMasterInstructionDataEncoder,
|
|
3706
|
-
getMasterCodec,
|
|
3707
|
-
getMasterDecoder,
|
|
3708
|
-
getMasterDerivedAddress,
|
|
3709
|
-
getMasterDiscriminatorBytes,
|
|
3710
|
-
getMasterEncoder,
|
|
3711
|
-
getMasterInitializedCodec,
|
|
3712
|
-
getMasterInitializedDecoder,
|
|
3713
|
-
getMasterInitializedEncoder,
|
|
3714
|
-
getMasterSize,
|
|
3715
|
-
getMerkleRootArray,
|
|
3716
|
-
getRedeemAirdropTokensDiscriminatorBytes,
|
|
3717
|
-
getRedeemAirdropTokensInstruction,
|
|
3718
|
-
getRedeemAirdropTokensInstructionAsync,
|
|
3719
|
-
getRedeemAirdropTokensInstructionDataCodec,
|
|
3720
|
-
getRedeemAirdropTokensInstructionDataDecoder,
|
|
3721
|
-
getRedeemAirdropTokensInstructionDataEncoder,
|
|
3722
|
-
getSimpleMerkleProof,
|
|
3723
|
-
getTokensDepositedCodec,
|
|
3724
|
-
getTokensDepositedDecoder,
|
|
3725
|
-
getTokensDepositedEncoder,
|
|
3726
|
-
getTokensRedeemedCodec,
|
|
3727
|
-
getTokensRedeemedDecoder,
|
|
3728
|
-
getTokensRedeemedEncoder,
|
|
3729
|
-
identifyDropsyAccount,
|
|
3730
|
-
identifyDropsyInstruction,
|
|
3731
|
-
isDropsyError,
|
|
3732
|
-
parseClaimAirdropInstruction,
|
|
3733
|
-
parseCreateAirdropInstruction,
|
|
3734
|
-
parseCreateClaimMapInstruction,
|
|
3735
|
-
parseDepositTokensInstruction,
|
|
3736
|
-
parseInitializeAirdropMasterInstruction,
|
|
3737
|
-
parseInitializeMasterInstruction,
|
|
3738
|
-
parseRedeemAirdropTokensInstruction,
|
|
3739
|
-
toUnixTimestamp
|
|
3740
|
-
};
|
|
3741
|
-
//# sourceMappingURL=index.mjs.map
|