@dropsy/airdrop 0.2.5 → 0.2.7
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.d.mts +156 -148
- package/dist/index.d.ts +156 -148
- package/dist/index.js +534 -590
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +325 -386
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/index.ts
|
|
@@ -37,6 +47,8 @@ __export(index_exports, {
|
|
|
37
47
|
CLAIM_MAP_DISCRIMINATOR: () => CLAIM_MAP_DISCRIMINATOR,
|
|
38
48
|
CREATE_AIRDROP_DISCRIMINATOR: () => CREATE_AIRDROP_DISCRIMINATOR,
|
|
39
49
|
CREATE_CLAIM_MAP_DISCRIMINATOR: () => CREATE_CLAIM_MAP_DISCRIMINATOR,
|
|
50
|
+
DEFAULT_MASTER_PDA: () => DEFAULT_MASTER_PDA,
|
|
51
|
+
DEFAULT_MASTER_PDA_AUTHORITY: () => DEFAULT_MASTER_PDA_AUTHORITY,
|
|
40
52
|
DEPOSIT_TOKENS_DISCRIMINATOR: () => DEPOSIT_TOKENS_DISCRIMINATOR,
|
|
41
53
|
DROPSY_ERROR__ACTIVE_BITMAPS_EXIST: () => DROPSY_ERROR__ACTIVE_BITMAPS_EXIST,
|
|
42
54
|
DROPSY_ERROR__AIRDROP_ENDED: () => DROPSY_ERROR__AIRDROP_ENDED,
|
|
@@ -115,6 +127,7 @@ __export(index_exports, {
|
|
|
115
127
|
DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED: () => DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED,
|
|
116
128
|
DROPSY_MASTER_SEED: () => DROPSY_MASTER_SEED,
|
|
117
129
|
DROPSY_PROGRAM_ADDRESS: () => DROPSY_PROGRAM_ADDRESS,
|
|
130
|
+
DROPSY_TREASURY: () => DROPSY_TREASURY,
|
|
118
131
|
DropsyAccount: () => DropsyAccount,
|
|
119
132
|
DropsyInstruction: () => DropsyInstruction,
|
|
120
133
|
INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR: () => INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR,
|
|
@@ -131,6 +144,10 @@ __export(index_exports, {
|
|
|
131
144
|
VERSION_BASIC: () => VERSION_BASIC,
|
|
132
145
|
VERSION_VESTED: () => VERSION_VESTED,
|
|
133
146
|
VESTING_SEED: () => VESTING_SEED,
|
|
147
|
+
createDefaultSolanaClient: () => createDefaultSolanaClient,
|
|
148
|
+
createMerkleTree: () => createMerkleTree,
|
|
149
|
+
createTransactionMessageFromInstructions: () => createTransactionMessageFromInstructions,
|
|
150
|
+
createWLMerkleTree: () => createWLMerkleTree,
|
|
134
151
|
decodeAffiliate: () => decodeAffiliate,
|
|
135
152
|
decodeAffiliateMaster: () => decodeAffiliateMaster,
|
|
136
153
|
decodeAirdrop: () => decodeAirdrop,
|
|
@@ -166,6 +183,7 @@ __export(index_exports, {
|
|
|
166
183
|
fetchMaybeAirdropMaster: () => fetchMaybeAirdropMaster,
|
|
167
184
|
fetchMaybeClaimMap: () => fetchMaybeClaimMap,
|
|
168
185
|
fetchMaybeMaster: () => fetchMaybeMaster,
|
|
186
|
+
generateKeyPairSignerWithSol: () => generateKeyPairSignerWithSol,
|
|
169
187
|
getAdvancedFeeConfigCodec: () => getAdvancedFeeConfigCodec,
|
|
170
188
|
getAdvancedFeeConfigDecoder: () => getAdvancedFeeConfigDecoder,
|
|
171
189
|
getAdvancedFeeConfigEncoder: () => getAdvancedFeeConfigEncoder,
|
|
@@ -253,6 +271,7 @@ __export(index_exports, {
|
|
|
253
271
|
getCreateClaimMapInstructionDataCodec: () => getCreateClaimMapInstructionDataCodec,
|
|
254
272
|
getCreateClaimMapInstructionDataDecoder: () => getCreateClaimMapInstructionDataDecoder,
|
|
255
273
|
getCreateClaimMapInstructionDataEncoder: () => getCreateClaimMapInstructionDataEncoder,
|
|
274
|
+
getCreateClaimMapV0Instruction: () => getCreateClaimMapV0Instruction,
|
|
256
275
|
getDepositTokensDiscriminatorBytes: () => getDepositTokensDiscriminatorBytes,
|
|
257
276
|
getDepositTokensInstruction: () => getDepositTokensInstruction,
|
|
258
277
|
getDepositTokensInstructionAsync: () => getDepositTokensInstructionAsync,
|
|
@@ -285,12 +304,14 @@ __export(index_exports, {
|
|
|
285
304
|
getMasterInitializedDecoder: () => getMasterInitializedDecoder,
|
|
286
305
|
getMasterInitializedEncoder: () => getMasterInitializedEncoder,
|
|
287
306
|
getMasterSize: () => getMasterSize,
|
|
307
|
+
getMerkleRootArray: () => getMerkleRootArray,
|
|
288
308
|
getRedeemAirdropTokensDiscriminatorBytes: () => getRedeemAirdropTokensDiscriminatorBytes,
|
|
289
309
|
getRedeemAirdropTokensInstruction: () => getRedeemAirdropTokensInstruction,
|
|
290
310
|
getRedeemAirdropTokensInstructionAsync: () => getRedeemAirdropTokensInstructionAsync,
|
|
291
311
|
getRedeemAirdropTokensInstructionDataCodec: () => getRedeemAirdropTokensInstructionDataCodec,
|
|
292
312
|
getRedeemAirdropTokensInstructionDataDecoder: () => getRedeemAirdropTokensInstructionDataDecoder,
|
|
293
313
|
getRedeemAirdropTokensInstructionDataEncoder: () => getRedeemAirdropTokensInstructionDataEncoder,
|
|
314
|
+
getSimpleMerkleProof: () => getSimpleMerkleProof,
|
|
294
315
|
getTokensDepositedCodec: () => getTokensDepositedCodec,
|
|
295
316
|
getTokensDepositedDecoder: () => getTokensDepositedDecoder,
|
|
296
317
|
getTokensDepositedEncoder: () => getTokensDepositedEncoder,
|
|
@@ -306,7 +327,8 @@ __export(index_exports, {
|
|
|
306
327
|
parseDepositTokensInstruction: () => parseDepositTokensInstruction,
|
|
307
328
|
parseInitializeAirdropMasterInstruction: () => parseInitializeAirdropMasterInstruction,
|
|
308
329
|
parseInitializeMasterInstruction: () => parseInitializeMasterInstruction,
|
|
309
|
-
parseRedeemAirdropTokensInstruction: () => parseRedeemAirdropTokensInstruction
|
|
330
|
+
parseRedeemAirdropTokensInstruction: () => parseRedeemAirdropTokensInstruction,
|
|
331
|
+
toUnixTimestamp: () => toUnixTimestamp
|
|
310
332
|
});
|
|
311
333
|
module.exports = __toCommonJS(index_exports);
|
|
312
334
|
|
|
@@ -677,13 +699,11 @@ function getAirdropMasterEncoder() {
|
|
|
677
699
|
["bitmapCreated", (0, import_kit5.getU64Encoder)()],
|
|
678
700
|
["maxBitmapAllowed", (0, import_kit5.getU64Encoder)()],
|
|
679
701
|
["airdropCreationFee", (0, import_kit5.getU64Encoder)()],
|
|
702
|
+
["bitmapCreationFee", (0, import_kit5.getU64Encoder)()],
|
|
680
703
|
["airdropUpdateFee", (0, import_kit5.getU64Encoder)()],
|
|
681
|
-
["airdropCloseFee", (0, import_kit5.getU64Encoder)()],
|
|
682
704
|
["airdropClaimFee", (0, import_kit5.getU64Encoder)()],
|
|
683
705
|
["airdropDelegateFee", (0, import_kit5.getU64Encoder)()],
|
|
684
706
|
["airdropDepositFee", (0, import_kit5.getU64Encoder)()],
|
|
685
|
-
["bitmapCreationFee", (0, import_kit5.getU64Encoder)()],
|
|
686
|
-
["bitmapCloseFee", (0, import_kit5.getU64Encoder)()],
|
|
687
707
|
["bump", (0, import_kit5.getU8Encoder)()],
|
|
688
708
|
["padding", (0, import_kit5.fixEncoderSize)((0, import_kit5.getBytesEncoder)(), 7)]
|
|
689
709
|
]),
|
|
@@ -701,13 +721,11 @@ function getAirdropMasterDecoder() {
|
|
|
701
721
|
["bitmapCreated", (0, import_kit5.getU64Decoder)()],
|
|
702
722
|
["maxBitmapAllowed", (0, import_kit5.getU64Decoder)()],
|
|
703
723
|
["airdropCreationFee", (0, import_kit5.getU64Decoder)()],
|
|
724
|
+
["bitmapCreationFee", (0, import_kit5.getU64Decoder)()],
|
|
704
725
|
["airdropUpdateFee", (0, import_kit5.getU64Decoder)()],
|
|
705
|
-
["airdropCloseFee", (0, import_kit5.getU64Decoder)()],
|
|
706
726
|
["airdropClaimFee", (0, import_kit5.getU64Decoder)()],
|
|
707
727
|
["airdropDelegateFee", (0, import_kit5.getU64Decoder)()],
|
|
708
728
|
["airdropDepositFee", (0, import_kit5.getU64Decoder)()],
|
|
709
|
-
["bitmapCreationFee", (0, import_kit5.getU64Decoder)()],
|
|
710
|
-
["bitmapCloseFee", (0, import_kit5.getU64Decoder)()],
|
|
711
729
|
["bump", (0, import_kit5.getU8Decoder)()],
|
|
712
730
|
["padding", (0, import_kit5.fixDecoderSize)((0, import_kit5.getBytesDecoder)(), 7)]
|
|
713
731
|
]);
|
|
@@ -744,7 +762,7 @@ async function fetchAllMaybeAirdropMaster(rpc, addresses, config) {
|
|
|
744
762
|
return maybeAccounts.map((maybeAccount) => decodeAirdropMaster(maybeAccount));
|
|
745
763
|
}
|
|
746
764
|
function getAirdropMasterSize() {
|
|
747
|
-
return
|
|
765
|
+
return 192;
|
|
748
766
|
}
|
|
749
767
|
|
|
750
768
|
// src/accounts/claimMap.ts
|
|
@@ -1318,11 +1336,7 @@ async function getClaimAirdropInstructionAsync(input, config) {
|
|
|
1318
1336
|
master: { value: input.master ?? null, isWritable: false },
|
|
1319
1337
|
config: { value: input.config ?? null, isWritable: false },
|
|
1320
1338
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1321
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
1322
|
-
airdropMasterAuthority: {
|
|
1323
|
-
value: input.airdropMasterAuthority ?? null,
|
|
1324
|
-
isWritable: false
|
|
1325
|
-
},
|
|
1339
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1326
1340
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1327
1341
|
sourceTokenAccount: {
|
|
1328
1342
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -1379,34 +1393,6 @@ async function getClaimAirdropInstructionAsync(input, config) {
|
|
|
1379
1393
|
]
|
|
1380
1394
|
});
|
|
1381
1395
|
}
|
|
1382
|
-
if (!accounts.airdropMaster.value) {
|
|
1383
|
-
accounts.airdropMaster.value = await (0, import_kit11.getProgramDerivedAddress)({
|
|
1384
|
-
programAddress,
|
|
1385
|
-
seeds: [
|
|
1386
|
-
(0, import_kit11.getBytesEncoder)().encode(
|
|
1387
|
-
new Uint8Array([
|
|
1388
|
-
97,
|
|
1389
|
-
105,
|
|
1390
|
-
114,
|
|
1391
|
-
100,
|
|
1392
|
-
114,
|
|
1393
|
-
111,
|
|
1394
|
-
112,
|
|
1395
|
-
95,
|
|
1396
|
-
109,
|
|
1397
|
-
97,
|
|
1398
|
-
115,
|
|
1399
|
-
116,
|
|
1400
|
-
101,
|
|
1401
|
-
114
|
|
1402
|
-
])
|
|
1403
|
-
),
|
|
1404
|
-
(0, import_kit11.getAddressEncoder)().encode(
|
|
1405
|
-
expectAddress(accounts.airdropMasterAuthority.value)
|
|
1406
|
-
)
|
|
1407
|
-
]
|
|
1408
|
-
});
|
|
1409
|
-
}
|
|
1410
1396
|
if (!accounts.tokenProgram.value) {
|
|
1411
1397
|
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
1412
1398
|
}
|
|
@@ -1445,7 +1431,6 @@ async function getClaimAirdropInstructionAsync(input, config) {
|
|
|
1445
1431
|
getAccountMeta(accounts.config),
|
|
1446
1432
|
getAccountMeta(accounts.treasury),
|
|
1447
1433
|
getAccountMeta(accounts.airdropMaster),
|
|
1448
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
1449
1434
|
getAccountMeta(accounts.affiliate),
|
|
1450
1435
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
1451
1436
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -1470,11 +1455,7 @@ function getClaimAirdropInstruction(input, config) {
|
|
|
1470
1455
|
master: { value: input.master ?? null, isWritable: false },
|
|
1471
1456
|
config: { value: input.config ?? null, isWritable: false },
|
|
1472
1457
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1473
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
1474
|
-
airdropMasterAuthority: {
|
|
1475
|
-
value: input.airdropMasterAuthority ?? null,
|
|
1476
|
-
isWritable: false
|
|
1477
|
-
},
|
|
1458
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1478
1459
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1479
1460
|
sourceTokenAccount: {
|
|
1480
1461
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -1514,7 +1495,6 @@ function getClaimAirdropInstruction(input, config) {
|
|
|
1514
1495
|
getAccountMeta(accounts.config),
|
|
1515
1496
|
getAccountMeta(accounts.treasury),
|
|
1516
1497
|
getAccountMeta(accounts.airdropMaster),
|
|
1517
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
1518
1498
|
getAccountMeta(accounts.affiliate),
|
|
1519
1499
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
1520
1500
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -1534,7 +1514,7 @@ function getClaimAirdropInstruction(input, config) {
|
|
|
1534
1514
|
});
|
|
1535
1515
|
}
|
|
1536
1516
|
function parseClaimAirdropInstruction(instruction) {
|
|
1537
|
-
if (instruction.accounts.length <
|
|
1517
|
+
if (instruction.accounts.length < 15) {
|
|
1538
1518
|
throw new Error("Not enough accounts");
|
|
1539
1519
|
}
|
|
1540
1520
|
let accountIndex = 0;
|
|
@@ -1554,7 +1534,6 @@ function parseClaimAirdropInstruction(instruction) {
|
|
|
1554
1534
|
config: getNextAccount(),
|
|
1555
1535
|
treasury: getNextAccount(),
|
|
1556
1536
|
airdropMaster: getNextAccount(),
|
|
1557
|
-
airdropMasterAuthority: getNextAccount(),
|
|
1558
1537
|
affiliate: getNextOptionalAccount(),
|
|
1559
1538
|
sourceTokenAccount: getNextAccount(),
|
|
1560
1539
|
destinationTokenAccount: getNextAccount(),
|
|
@@ -1572,7 +1551,157 @@ function parseClaimAirdropInstruction(instruction) {
|
|
|
1572
1551
|
}
|
|
1573
1552
|
|
|
1574
1553
|
// src/instructions/createAirdrop.ts
|
|
1554
|
+
var import_kit15 = require("@solana/kit");
|
|
1555
|
+
|
|
1556
|
+
// src/constants/index.ts
|
|
1575
1557
|
var import_kit12 = require("@solana/kit");
|
|
1558
|
+
var DROPSY_MASTER_SEED = "master";
|
|
1559
|
+
var AIRDROP_CONFIG_SEED = "airdrop_config";
|
|
1560
|
+
var AFFILIATE_MASTER_SEED = "affiliate_master";
|
|
1561
|
+
var AIRDROP_MASTER_SEED = "airdrop_master";
|
|
1562
|
+
var AIRDROP_SEED = "airdrop";
|
|
1563
|
+
var AFFILIATE_SEED = "affiliate";
|
|
1564
|
+
var BITMAP_SEED = "bitmap";
|
|
1565
|
+
var VESTING_SEED = "vesting";
|
|
1566
|
+
var PRESALE_SEED = "presale";
|
|
1567
|
+
var VAULT_SEED = "vault";
|
|
1568
|
+
var ADMIN = (0, import_kit12.address)("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1569
|
+
var DROPSY_TREASURY = (0, import_kit12.address)("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1570
|
+
var DEFAULT_MASTER_PDA = (0, import_kit12.address)("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1571
|
+
var DEFAULT_MASTER_PDA_AUTHORITY = (0, import_kit12.address)("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
1572
|
+
var BITMAP_SIZE = 8e3;
|
|
1573
|
+
var MAX_BITMAP_CLAIM = BITMAP_SIZE * 8;
|
|
1574
|
+
var VERSION_BASIC = 0;
|
|
1575
|
+
var VERSION_VESTED = 1;
|
|
1576
|
+
var STATE_INITIALIZED = 0;
|
|
1577
|
+
var STATE_DELEGATED = 1;
|
|
1578
|
+
var STATE_REDEEMED = 2;
|
|
1579
|
+
var MUTABLE_NONE = 0;
|
|
1580
|
+
|
|
1581
|
+
// src/utils/client.ts
|
|
1582
|
+
var import_kit13 = require("@solana/kit");
|
|
1583
|
+
var generateKeyPairSignerWithSol = async (rpcClient, putativeLamports = 1000000000n) => {
|
|
1584
|
+
const signer = await (0, import_kit13.generateKeyPairSigner)();
|
|
1585
|
+
await (0, import_kit13.airdropFactory)(rpcClient)({
|
|
1586
|
+
recipientAddress: signer.address,
|
|
1587
|
+
lamports: (0, import_kit13.lamports)(putativeLamports),
|
|
1588
|
+
commitment: "confirmed"
|
|
1589
|
+
});
|
|
1590
|
+
return signer;
|
|
1591
|
+
};
|
|
1592
|
+
var createDefaultSolanaClient = () => {
|
|
1593
|
+
const rpc = (0, import_kit13.createSolanaRpc)("https://api.devnet.solana.com");
|
|
1594
|
+
const rpcSubscriptions = (0, import_kit13.createSolanaRpcSubscriptions)(
|
|
1595
|
+
"wss://api.devnet.solana.com"
|
|
1596
|
+
);
|
|
1597
|
+
return { rpc, rpcSubscriptions };
|
|
1598
|
+
};
|
|
1599
|
+
var createTransactionMessageFromInstructions = async (rpc, signer, instruction) => {
|
|
1600
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
1601
|
+
return (0, import_kit13.pipe)(
|
|
1602
|
+
(0, import_kit13.createTransactionMessage)({ version: 0 }),
|
|
1603
|
+
(tx) => (0, import_kit13.setTransactionMessageLifetimeUsingBlockhash)(latestBlockhash, tx),
|
|
1604
|
+
(tx) => (0, import_kit13.setTransactionMessageFeePayerSigner)(signer, tx),
|
|
1605
|
+
(tx) => (0, import_kit13.appendTransactionMessageInstructions)(instruction, tx)
|
|
1606
|
+
);
|
|
1607
|
+
};
|
|
1608
|
+
|
|
1609
|
+
// src/utils/derive.ts
|
|
1610
|
+
var import_kit14 = require("@solana/kit");
|
|
1611
|
+
async function getDropsyDerivedAddress(seeds) {
|
|
1612
|
+
return await (0, import_kit14.getProgramDerivedAddress)({
|
|
1613
|
+
seeds,
|
|
1614
|
+
programAddress: DROPSY_PROGRAM_ADDRESS
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1617
|
+
async function getMasterDerivedAddress() {
|
|
1618
|
+
return await getDropsyDerivedAddress([DROPSY_MASTER_SEED]);
|
|
1619
|
+
}
|
|
1620
|
+
async function getAirdropConfigDerivedAddress() {
|
|
1621
|
+
return await getDropsyDerivedAddress([AIRDROP_CONFIG_SEED]);
|
|
1622
|
+
}
|
|
1623
|
+
async function getAirdropMasterDerivedAddress(authority) {
|
|
1624
|
+
const seeds = [
|
|
1625
|
+
AIRDROP_MASTER_SEED,
|
|
1626
|
+
(0, import_kit14.getAddressEncoder)().encode(authority)
|
|
1627
|
+
];
|
|
1628
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1629
|
+
}
|
|
1630
|
+
async function getAffiliateDerivedAddress(authority) {
|
|
1631
|
+
const seeds = [
|
|
1632
|
+
AFFILIATE_SEED,
|
|
1633
|
+
(0, import_kit14.getAddressEncoder)().encode(authority)
|
|
1634
|
+
];
|
|
1635
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1636
|
+
}
|
|
1637
|
+
async function getAirdropDerivedAddress(authority, mint) {
|
|
1638
|
+
const seeds = [
|
|
1639
|
+
AIRDROP_SEED,
|
|
1640
|
+
(0, import_kit14.getAddressEncoder)().encode(mint),
|
|
1641
|
+
(0, import_kit14.getAddressEncoder)().encode(authority)
|
|
1642
|
+
];
|
|
1643
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1644
|
+
}
|
|
1645
|
+
async function getClaimMapDerivedAddress(airdrop, id) {
|
|
1646
|
+
const idBuffer = Buffer.alloc(2);
|
|
1647
|
+
idBuffer.writeUInt16LE(id);
|
|
1648
|
+
const seeds = [
|
|
1649
|
+
BITMAP_SEED,
|
|
1650
|
+
(0, import_kit14.getAddressEncoder)().encode(airdrop),
|
|
1651
|
+
idBuffer
|
|
1652
|
+
];
|
|
1653
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1654
|
+
}
|
|
1655
|
+
|
|
1656
|
+
// src/utils/helper.ts
|
|
1657
|
+
function toUnixTimestamp(date) {
|
|
1658
|
+
if (!date) return null;
|
|
1659
|
+
return Math.floor(date.getTime() / 1e3);
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
// src/utils/merkle.ts
|
|
1663
|
+
var import_crypto = require("crypto");
|
|
1664
|
+
var import_merkletreejs = __toESM(require("merkletreejs"));
|
|
1665
|
+
function hashLeaf(index, address2, amount) {
|
|
1666
|
+
const data = `${index}:${address2}:${amount.toString()}`;
|
|
1667
|
+
return (0, import_crypto.createHash)("sha256").update(data).digest();
|
|
1668
|
+
}
|
|
1669
|
+
function hashAddress(address2) {
|
|
1670
|
+
return (0, import_crypto.createHash)("sha256").update(address2).digest();
|
|
1671
|
+
}
|
|
1672
|
+
var createWLMerkleTree = (wallets) => {
|
|
1673
|
+
const leaves = wallets.map((address2) => hashAddress(address2));
|
|
1674
|
+
return new import_merkletreejs.default(
|
|
1675
|
+
leaves,
|
|
1676
|
+
(data) => (0, import_crypto.createHash)("sha256").update(data).digest(),
|
|
1677
|
+
{ sortPairs: true }
|
|
1678
|
+
);
|
|
1679
|
+
};
|
|
1680
|
+
var getSimpleMerkleProof = (merkleTree, address2) => {
|
|
1681
|
+
const leaf = hashAddress(address2);
|
|
1682
|
+
return merkleTree.getProof(leaf).map((p) => p.data);
|
|
1683
|
+
};
|
|
1684
|
+
var getMerkleRootArray = (merkleTree) => {
|
|
1685
|
+
const root = merkleTree.getRoot();
|
|
1686
|
+
if (root.length !== 32) {
|
|
1687
|
+
throw new Error("Merkle root must be 32 bytes");
|
|
1688
|
+
}
|
|
1689
|
+
const uint8Root = new Uint8Array(root);
|
|
1690
|
+
return uint8Root;
|
|
1691
|
+
};
|
|
1692
|
+
var createMerkleTree = (claimList) => {
|
|
1693
|
+
const leaves = claimList.map(
|
|
1694
|
+
({ index, address: address2, amount }) => hashLeaf(index, address2, amount)
|
|
1695
|
+
);
|
|
1696
|
+
const merkleTree = new import_merkletreejs.default(
|
|
1697
|
+
leaves,
|
|
1698
|
+
(data) => (0, import_crypto.createHash)("sha256").update(data).digest(),
|
|
1699
|
+
{ sortPairs: true }
|
|
1700
|
+
);
|
|
1701
|
+
return merkleTree;
|
|
1702
|
+
};
|
|
1703
|
+
|
|
1704
|
+
// src/instructions/createAirdrop.ts
|
|
1576
1705
|
var CREATE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1577
1706
|
227,
|
|
1578
1707
|
135,
|
|
@@ -1584,39 +1713,39 @@ var CREATE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
|
1584
1713
|
94
|
|
1585
1714
|
]);
|
|
1586
1715
|
function getCreateAirdropDiscriminatorBytes() {
|
|
1587
|
-
return (0,
|
|
1716
|
+
return (0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8).encode(
|
|
1588
1717
|
CREATE_AIRDROP_DISCRIMINATOR
|
|
1589
1718
|
);
|
|
1590
1719
|
}
|
|
1591
1720
|
function getCreateAirdropInstructionDataEncoder() {
|
|
1592
|
-
return (0,
|
|
1593
|
-
(0,
|
|
1594
|
-
["discriminator", (0,
|
|
1595
|
-
["merkleRoot", (0,
|
|
1596
|
-
["startsAt", (0,
|
|
1597
|
-
["endsAt", (0,
|
|
1598
|
-
["version", (0,
|
|
1599
|
-
["mutable", (0,
|
|
1600
|
-
["delegateAuthority", (0,
|
|
1601
|
-
["delegatePermissions", (0,
|
|
1721
|
+
return (0, import_kit15.transformEncoder)(
|
|
1722
|
+
(0, import_kit15.getStructEncoder)([
|
|
1723
|
+
["discriminator", (0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8)],
|
|
1724
|
+
["merkleRoot", (0, import_kit15.getOptionEncoder)((0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 32))],
|
|
1725
|
+
["startsAt", (0, import_kit15.getOptionEncoder)((0, import_kit15.getI64Encoder)())],
|
|
1726
|
+
["endsAt", (0, import_kit15.getOptionEncoder)((0, import_kit15.getI64Encoder)())],
|
|
1727
|
+
["version", (0, import_kit15.getOptionEncoder)((0, import_kit15.getU8Encoder)())],
|
|
1728
|
+
["mutable", (0, import_kit15.getOptionEncoder)((0, import_kit15.getU8Encoder)())],
|
|
1729
|
+
["delegateAuthority", (0, import_kit15.getOptionEncoder)((0, import_kit15.getAddressEncoder)())],
|
|
1730
|
+
["delegatePermissions", (0, import_kit15.getOptionEncoder)((0, import_kit15.getU8Encoder)())]
|
|
1602
1731
|
]),
|
|
1603
1732
|
(value) => ({ ...value, discriminator: CREATE_AIRDROP_DISCRIMINATOR })
|
|
1604
1733
|
);
|
|
1605
1734
|
}
|
|
1606
1735
|
function getCreateAirdropInstructionDataDecoder() {
|
|
1607
|
-
return (0,
|
|
1608
|
-
["discriminator", (0,
|
|
1609
|
-
["merkleRoot", (0,
|
|
1610
|
-
["startsAt", (0,
|
|
1611
|
-
["endsAt", (0,
|
|
1612
|
-
["version", (0,
|
|
1613
|
-
["mutable", (0,
|
|
1614
|
-
["delegateAuthority", (0,
|
|
1615
|
-
["delegatePermissions", (0,
|
|
1736
|
+
return (0, import_kit15.getStructDecoder)([
|
|
1737
|
+
["discriminator", (0, import_kit15.fixDecoderSize)((0, import_kit15.getBytesDecoder)(), 8)],
|
|
1738
|
+
["merkleRoot", (0, import_kit15.getOptionDecoder)((0, import_kit15.fixDecoderSize)((0, import_kit15.getBytesDecoder)(), 32))],
|
|
1739
|
+
["startsAt", (0, import_kit15.getOptionDecoder)((0, import_kit15.getI64Decoder)())],
|
|
1740
|
+
["endsAt", (0, import_kit15.getOptionDecoder)((0, import_kit15.getI64Decoder)())],
|
|
1741
|
+
["version", (0, import_kit15.getOptionDecoder)((0, import_kit15.getU8Decoder)())],
|
|
1742
|
+
["mutable", (0, import_kit15.getOptionDecoder)((0, import_kit15.getU8Decoder)())],
|
|
1743
|
+
["delegateAuthority", (0, import_kit15.getOptionDecoder)((0, import_kit15.getAddressDecoder)())],
|
|
1744
|
+
["delegatePermissions", (0, import_kit15.getOptionDecoder)((0, import_kit15.getU8Decoder)())]
|
|
1616
1745
|
]);
|
|
1617
1746
|
}
|
|
1618
1747
|
function getCreateAirdropInstructionDataCodec() {
|
|
1619
|
-
return (0,
|
|
1748
|
+
return (0, import_kit15.combineCodec)(
|
|
1620
1749
|
getCreateAirdropInstructionDataEncoder(),
|
|
1621
1750
|
getCreateAirdropInstructionDataDecoder()
|
|
1622
1751
|
);
|
|
@@ -1628,10 +1757,6 @@ async function getCreateAirdropInstructionAsync(input, config) {
|
|
|
1628
1757
|
config: { value: input.config ?? null, isWritable: false },
|
|
1629
1758
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1630
1759
|
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1631
|
-
airdropMasterAuthority: {
|
|
1632
|
-
value: input.airdropMasterAuthority ?? null,
|
|
1633
|
-
isWritable: false
|
|
1634
|
-
},
|
|
1635
1760
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1636
1761
|
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1637
1762
|
mint: { value: input.mint ?? null, isWritable: false },
|
|
@@ -1641,18 +1766,18 @@ async function getCreateAirdropInstructionAsync(input, config) {
|
|
|
1641
1766
|
const accounts = originalAccounts;
|
|
1642
1767
|
const args = { ...input };
|
|
1643
1768
|
if (!accounts.master.value) {
|
|
1644
|
-
accounts.master.value = await (0,
|
|
1769
|
+
accounts.master.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1645
1770
|
programAddress,
|
|
1646
1771
|
seeds: [
|
|
1647
|
-
(0,
|
|
1772
|
+
(0, import_kit15.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
1648
1773
|
]
|
|
1649
1774
|
});
|
|
1650
1775
|
}
|
|
1651
1776
|
if (!accounts.config.value) {
|
|
1652
|
-
accounts.config.value = await (0,
|
|
1777
|
+
accounts.config.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1653
1778
|
programAddress,
|
|
1654
1779
|
seeds: [
|
|
1655
|
-
(0,
|
|
1780
|
+
(0, import_kit15.getBytesEncoder)().encode(
|
|
1656
1781
|
new Uint8Array([
|
|
1657
1782
|
97,
|
|
1658
1783
|
105,
|
|
@@ -1673,43 +1798,15 @@ async function getCreateAirdropInstructionAsync(input, config) {
|
|
|
1673
1798
|
]
|
|
1674
1799
|
});
|
|
1675
1800
|
}
|
|
1676
|
-
if (!accounts.airdropMaster.value) {
|
|
1677
|
-
accounts.airdropMaster.value = await (0, import_kit12.getProgramDerivedAddress)({
|
|
1678
|
-
programAddress,
|
|
1679
|
-
seeds: [
|
|
1680
|
-
(0, import_kit12.getBytesEncoder)().encode(
|
|
1681
|
-
new Uint8Array([
|
|
1682
|
-
97,
|
|
1683
|
-
105,
|
|
1684
|
-
114,
|
|
1685
|
-
100,
|
|
1686
|
-
114,
|
|
1687
|
-
111,
|
|
1688
|
-
112,
|
|
1689
|
-
95,
|
|
1690
|
-
109,
|
|
1691
|
-
97,
|
|
1692
|
-
115,
|
|
1693
|
-
116,
|
|
1694
|
-
101,
|
|
1695
|
-
114
|
|
1696
|
-
])
|
|
1697
|
-
),
|
|
1698
|
-
(0, import_kit12.getAddressEncoder)().encode(
|
|
1699
|
-
expectAddress(accounts.airdropMasterAuthority.value)
|
|
1700
|
-
)
|
|
1701
|
-
]
|
|
1702
|
-
});
|
|
1703
|
-
}
|
|
1704
1801
|
if (!accounts.airdrop.value) {
|
|
1705
|
-
accounts.airdrop.value = await (0,
|
|
1802
|
+
accounts.airdrop.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1706
1803
|
programAddress,
|
|
1707
1804
|
seeds: [
|
|
1708
|
-
(0,
|
|
1805
|
+
(0, import_kit15.getBytesEncoder)().encode(
|
|
1709
1806
|
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1710
1807
|
),
|
|
1711
|
-
(0,
|
|
1712
|
-
(0,
|
|
1808
|
+
(0, import_kit15.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
1809
|
+
(0, import_kit15.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
1713
1810
|
]
|
|
1714
1811
|
});
|
|
1715
1812
|
}
|
|
@@ -1723,7 +1820,6 @@ async function getCreateAirdropInstructionAsync(input, config) {
|
|
|
1723
1820
|
getAccountMeta(accounts.config),
|
|
1724
1821
|
getAccountMeta(accounts.treasury),
|
|
1725
1822
|
getAccountMeta(accounts.airdropMaster),
|
|
1726
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
1727
1823
|
getAccountMeta(accounts.affiliate),
|
|
1728
1824
|
getAccountMeta(accounts.airdrop),
|
|
1729
1825
|
getAccountMeta(accounts.mint),
|
|
@@ -1742,11 +1838,7 @@ function getCreateAirdropInstruction(input, config) {
|
|
|
1742
1838
|
master: { value: input.master ?? null, isWritable: false },
|
|
1743
1839
|
config: { value: input.config ?? null, isWritable: false },
|
|
1744
1840
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1745
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
1746
|
-
airdropMasterAuthority: {
|
|
1747
|
-
value: input.airdropMasterAuthority ?? null,
|
|
1748
|
-
isWritable: false
|
|
1749
|
-
},
|
|
1841
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1750
1842
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1751
1843
|
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1752
1844
|
mint: { value: input.mint ?? null, isWritable: false },
|
|
@@ -1765,7 +1857,6 @@ function getCreateAirdropInstruction(input, config) {
|
|
|
1765
1857
|
getAccountMeta(accounts.config),
|
|
1766
1858
|
getAccountMeta(accounts.treasury),
|
|
1767
1859
|
getAccountMeta(accounts.airdropMaster),
|
|
1768
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
1769
1860
|
getAccountMeta(accounts.affiliate),
|
|
1770
1861
|
getAccountMeta(accounts.airdrop),
|
|
1771
1862
|
getAccountMeta(accounts.mint),
|
|
@@ -1779,7 +1870,7 @@ function getCreateAirdropInstruction(input, config) {
|
|
|
1779
1870
|
});
|
|
1780
1871
|
}
|
|
1781
1872
|
function parseCreateAirdropInstruction(instruction) {
|
|
1782
|
-
if (instruction.accounts.length <
|
|
1873
|
+
if (instruction.accounts.length < 9) {
|
|
1783
1874
|
throw new Error("Not enough accounts");
|
|
1784
1875
|
}
|
|
1785
1876
|
let accountIndex = 0;
|
|
@@ -1799,7 +1890,6 @@ function parseCreateAirdropInstruction(instruction) {
|
|
|
1799
1890
|
config: getNextAccount(),
|
|
1800
1891
|
treasury: getNextAccount(),
|
|
1801
1892
|
airdropMaster: getNextAccount(),
|
|
1802
|
-
airdropMasterAuthority: getNextAccount(),
|
|
1803
1893
|
affiliate: getNextOptionalAccount(),
|
|
1804
1894
|
airdrop: getNextAccount(),
|
|
1805
1895
|
mint: getNextAccount(),
|
|
@@ -1811,14 +1901,14 @@ function parseCreateAirdropInstruction(instruction) {
|
|
|
1811
1901
|
}
|
|
1812
1902
|
async function getCreateAirdropV0Instruction(input) {
|
|
1813
1903
|
return await getCreateAirdropInstructionAsync({
|
|
1814
|
-
|
|
1815
|
-
treasury:
|
|
1904
|
+
airdropMaster: input.airdropMaster ?? DEFAULT_MASTER_PDA,
|
|
1905
|
+
treasury: DROPSY_TREASURY,
|
|
1816
1906
|
airdrop: input.airdrop,
|
|
1817
1907
|
mint: input.mint,
|
|
1818
1908
|
authority: input.authority,
|
|
1819
1909
|
merkleRoot: input.merkleRoot ?? null,
|
|
1820
|
-
startsAt: input.startsAt
|
|
1821
|
-
endsAt: input.endsAt
|
|
1910
|
+
startsAt: toUnixTimestamp(input.startsAt),
|
|
1911
|
+
endsAt: toUnixTimestamp(input.endsAt),
|
|
1822
1912
|
version: 0,
|
|
1823
1913
|
mutable: null,
|
|
1824
1914
|
delegateAuthority: null,
|
|
@@ -1827,7 +1917,7 @@ async function getCreateAirdropV0Instruction(input) {
|
|
|
1827
1917
|
}
|
|
1828
1918
|
|
|
1829
1919
|
// src/instructions/createClaimMap.ts
|
|
1830
|
-
var
|
|
1920
|
+
var import_kit16 = require("@solana/kit");
|
|
1831
1921
|
var CREATE_CLAIM_MAP_DISCRIMINATOR = new Uint8Array([
|
|
1832
1922
|
22,
|
|
1833
1923
|
150,
|
|
@@ -1839,29 +1929,29 @@ var CREATE_CLAIM_MAP_DISCRIMINATOR = new Uint8Array([
|
|
|
1839
1929
|
122
|
|
1840
1930
|
]);
|
|
1841
1931
|
function getCreateClaimMapDiscriminatorBytes() {
|
|
1842
|
-
return (0,
|
|
1932
|
+
return (0, import_kit16.fixEncoderSize)((0, import_kit16.getBytesEncoder)(), 8).encode(
|
|
1843
1933
|
CREATE_CLAIM_MAP_DISCRIMINATOR
|
|
1844
1934
|
);
|
|
1845
1935
|
}
|
|
1846
1936
|
function getCreateClaimMapInstructionDataEncoder() {
|
|
1847
|
-
return (0,
|
|
1848
|
-
(0,
|
|
1849
|
-
["discriminator", (0,
|
|
1850
|
-
["id", (0,
|
|
1851
|
-
["total", (0,
|
|
1937
|
+
return (0, import_kit16.transformEncoder)(
|
|
1938
|
+
(0, import_kit16.getStructEncoder)([
|
|
1939
|
+
["discriminator", (0, import_kit16.fixEncoderSize)((0, import_kit16.getBytesEncoder)(), 8)],
|
|
1940
|
+
["id", (0, import_kit16.getU16Encoder)()],
|
|
1941
|
+
["total", (0, import_kit16.getU32Encoder)()]
|
|
1852
1942
|
]),
|
|
1853
1943
|
(value) => ({ ...value, discriminator: CREATE_CLAIM_MAP_DISCRIMINATOR })
|
|
1854
1944
|
);
|
|
1855
1945
|
}
|
|
1856
1946
|
function getCreateClaimMapInstructionDataDecoder() {
|
|
1857
|
-
return (0,
|
|
1858
|
-
["discriminator", (0,
|
|
1859
|
-
["id", (0,
|
|
1860
|
-
["total", (0,
|
|
1947
|
+
return (0, import_kit16.getStructDecoder)([
|
|
1948
|
+
["discriminator", (0, import_kit16.fixDecoderSize)((0, import_kit16.getBytesDecoder)(), 8)],
|
|
1949
|
+
["id", (0, import_kit16.getU16Decoder)()],
|
|
1950
|
+
["total", (0, import_kit16.getU32Decoder)()]
|
|
1861
1951
|
]);
|
|
1862
1952
|
}
|
|
1863
1953
|
function getCreateClaimMapInstructionDataCodec() {
|
|
1864
|
-
return (0,
|
|
1954
|
+
return (0, import_kit16.combineCodec)(
|
|
1865
1955
|
getCreateClaimMapInstructionDataEncoder(),
|
|
1866
1956
|
getCreateClaimMapInstructionDataDecoder()
|
|
1867
1957
|
);
|
|
@@ -1873,10 +1963,6 @@ async function getCreateClaimMapInstructionAsync(input, config) {
|
|
|
1873
1963
|
config: { value: input.config ?? null, isWritable: false },
|
|
1874
1964
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1875
1965
|
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
1876
|
-
airdropMasterAuthority: {
|
|
1877
|
-
value: input.airdropMasterAuthority ?? null,
|
|
1878
|
-
isWritable: false
|
|
1879
|
-
},
|
|
1880
1966
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
1881
1967
|
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1882
1968
|
mint: { value: input.mint ?? null, isWritable: false },
|
|
@@ -1887,18 +1973,18 @@ async function getCreateClaimMapInstructionAsync(input, config) {
|
|
|
1887
1973
|
const accounts = originalAccounts;
|
|
1888
1974
|
const args = { ...input };
|
|
1889
1975
|
if (!accounts.master.value) {
|
|
1890
|
-
accounts.master.value = await (0,
|
|
1976
|
+
accounts.master.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
1891
1977
|
programAddress,
|
|
1892
1978
|
seeds: [
|
|
1893
|
-
(0,
|
|
1979
|
+
(0, import_kit16.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
1894
1980
|
]
|
|
1895
1981
|
});
|
|
1896
1982
|
}
|
|
1897
1983
|
if (!accounts.config.value) {
|
|
1898
|
-
accounts.config.value = await (0,
|
|
1984
|
+
accounts.config.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
1899
1985
|
programAddress,
|
|
1900
1986
|
seeds: [
|
|
1901
|
-
(0,
|
|
1987
|
+
(0, import_kit16.getBytesEncoder)().encode(
|
|
1902
1988
|
new Uint8Array([
|
|
1903
1989
|
97,
|
|
1904
1990
|
105,
|
|
@@ -1919,53 +2005,25 @@ async function getCreateClaimMapInstructionAsync(input, config) {
|
|
|
1919
2005
|
]
|
|
1920
2006
|
});
|
|
1921
2007
|
}
|
|
1922
|
-
if (!accounts.airdropMaster.value) {
|
|
1923
|
-
accounts.airdropMaster.value = await (0, import_kit13.getProgramDerivedAddress)({
|
|
1924
|
-
programAddress,
|
|
1925
|
-
seeds: [
|
|
1926
|
-
(0, import_kit13.getBytesEncoder)().encode(
|
|
1927
|
-
new Uint8Array([
|
|
1928
|
-
97,
|
|
1929
|
-
105,
|
|
1930
|
-
114,
|
|
1931
|
-
100,
|
|
1932
|
-
114,
|
|
1933
|
-
111,
|
|
1934
|
-
112,
|
|
1935
|
-
95,
|
|
1936
|
-
109,
|
|
1937
|
-
97,
|
|
1938
|
-
115,
|
|
1939
|
-
116,
|
|
1940
|
-
101,
|
|
1941
|
-
114
|
|
1942
|
-
])
|
|
1943
|
-
),
|
|
1944
|
-
(0, import_kit13.getAddressEncoder)().encode(
|
|
1945
|
-
expectAddress(accounts.airdropMasterAuthority.value)
|
|
1946
|
-
)
|
|
1947
|
-
]
|
|
1948
|
-
});
|
|
1949
|
-
}
|
|
1950
2008
|
if (!accounts.airdrop.value) {
|
|
1951
|
-
accounts.airdrop.value = await (0,
|
|
2009
|
+
accounts.airdrop.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
1952
2010
|
programAddress,
|
|
1953
2011
|
seeds: [
|
|
1954
|
-
(0,
|
|
2012
|
+
(0, import_kit16.getBytesEncoder)().encode(
|
|
1955
2013
|
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1956
2014
|
),
|
|
1957
|
-
(0,
|
|
1958
|
-
(0,
|
|
2015
|
+
(0, import_kit16.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
2016
|
+
(0, import_kit16.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
1959
2017
|
]
|
|
1960
2018
|
});
|
|
1961
2019
|
}
|
|
1962
2020
|
if (!accounts.bitmap.value) {
|
|
1963
|
-
accounts.bitmap.value = await (0,
|
|
2021
|
+
accounts.bitmap.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
1964
2022
|
programAddress,
|
|
1965
2023
|
seeds: [
|
|
1966
|
-
(0,
|
|
1967
|
-
(0,
|
|
1968
|
-
(0,
|
|
2024
|
+
(0, import_kit16.getBytesEncoder)().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
2025
|
+
(0, import_kit16.getAddressEncoder)().encode(expectAddress(accounts.airdrop.value)),
|
|
2026
|
+
(0, import_kit16.getU16Encoder)().encode(expectSome(args.id))
|
|
1969
2027
|
]
|
|
1970
2028
|
});
|
|
1971
2029
|
}
|
|
@@ -1979,7 +2037,6 @@ async function getCreateClaimMapInstructionAsync(input, config) {
|
|
|
1979
2037
|
getAccountMeta(accounts.config),
|
|
1980
2038
|
getAccountMeta(accounts.treasury),
|
|
1981
2039
|
getAccountMeta(accounts.airdropMaster),
|
|
1982
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
1983
2040
|
getAccountMeta(accounts.affiliate),
|
|
1984
2041
|
getAccountMeta(accounts.airdrop),
|
|
1985
2042
|
getAccountMeta(accounts.mint),
|
|
@@ -2000,10 +2057,6 @@ function getCreateClaimMapInstruction(input, config) {
|
|
|
2000
2057
|
config: { value: input.config ?? null, isWritable: false },
|
|
2001
2058
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2002
2059
|
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2003
|
-
airdropMasterAuthority: {
|
|
2004
|
-
value: input.airdropMasterAuthority ?? null,
|
|
2005
|
-
isWritable: false
|
|
2006
|
-
},
|
|
2007
2060
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
2008
2061
|
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
2009
2062
|
mint: { value: input.mint ?? null, isWritable: false },
|
|
@@ -2023,7 +2076,6 @@ function getCreateClaimMapInstruction(input, config) {
|
|
|
2023
2076
|
getAccountMeta(accounts.config),
|
|
2024
2077
|
getAccountMeta(accounts.treasury),
|
|
2025
2078
|
getAccountMeta(accounts.airdropMaster),
|
|
2026
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
2027
2079
|
getAccountMeta(accounts.affiliate),
|
|
2028
2080
|
getAccountMeta(accounts.airdrop),
|
|
2029
2081
|
getAccountMeta(accounts.mint),
|
|
@@ -2038,7 +2090,7 @@ function getCreateClaimMapInstruction(input, config) {
|
|
|
2038
2090
|
});
|
|
2039
2091
|
}
|
|
2040
2092
|
function parseCreateClaimMapInstruction(instruction) {
|
|
2041
|
-
if (instruction.accounts.length <
|
|
2093
|
+
if (instruction.accounts.length < 10) {
|
|
2042
2094
|
throw new Error("Not enough accounts");
|
|
2043
2095
|
}
|
|
2044
2096
|
let accountIndex = 0;
|
|
@@ -2058,7 +2110,6 @@ function parseCreateClaimMapInstruction(instruction) {
|
|
|
2058
2110
|
config: getNextAccount(),
|
|
2059
2111
|
treasury: getNextAccount(),
|
|
2060
2112
|
airdropMaster: getNextAccount(),
|
|
2061
|
-
airdropMasterAuthority: getNextAccount(),
|
|
2062
2113
|
affiliate: getNextOptionalAccount(),
|
|
2063
2114
|
airdrop: getNextAccount(),
|
|
2064
2115
|
mint: getNextAccount(),
|
|
@@ -2069,9 +2120,21 @@ function parseCreateClaimMapInstruction(instruction) {
|
|
|
2069
2120
|
data: getCreateClaimMapInstructionDataDecoder().decode(instruction.data)
|
|
2070
2121
|
};
|
|
2071
2122
|
}
|
|
2123
|
+
async function getCreateClaimMapV0Instruction(input) {
|
|
2124
|
+
return await getCreateClaimMapInstructionAsync({
|
|
2125
|
+
airdropMaster: input.airdropMaster ?? DEFAULT_MASTER_PDA,
|
|
2126
|
+
treasury: DROPSY_TREASURY,
|
|
2127
|
+
airdrop: input.airdrop,
|
|
2128
|
+
bitmap: input.claimMap,
|
|
2129
|
+
mint: input.mint,
|
|
2130
|
+
authority: input.authority,
|
|
2131
|
+
id: input.id ?? 0,
|
|
2132
|
+
total: input.total ?? MAX_BITMAP_CLAIM
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2072
2135
|
|
|
2073
2136
|
// src/instructions/depositTokens.ts
|
|
2074
|
-
var
|
|
2137
|
+
var import_kit17 = require("@solana/kit");
|
|
2075
2138
|
var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
2076
2139
|
176,
|
|
2077
2140
|
83,
|
|
@@ -2083,27 +2146,27 @@ var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
2083
2146
|
150
|
|
2084
2147
|
]);
|
|
2085
2148
|
function getDepositTokensDiscriminatorBytes() {
|
|
2086
|
-
return (0,
|
|
2149
|
+
return (0, import_kit17.fixEncoderSize)((0, import_kit17.getBytesEncoder)(), 8).encode(
|
|
2087
2150
|
DEPOSIT_TOKENS_DISCRIMINATOR
|
|
2088
2151
|
);
|
|
2089
2152
|
}
|
|
2090
2153
|
function getDepositTokensInstructionDataEncoder() {
|
|
2091
|
-
return (0,
|
|
2092
|
-
(0,
|
|
2093
|
-
["discriminator", (0,
|
|
2094
|
-
["amount", (0,
|
|
2154
|
+
return (0, import_kit17.transformEncoder)(
|
|
2155
|
+
(0, import_kit17.getStructEncoder)([
|
|
2156
|
+
["discriminator", (0, import_kit17.fixEncoderSize)((0, import_kit17.getBytesEncoder)(), 8)],
|
|
2157
|
+
["amount", (0, import_kit17.getU64Encoder)()]
|
|
2095
2158
|
]),
|
|
2096
2159
|
(value) => ({ ...value, discriminator: DEPOSIT_TOKENS_DISCRIMINATOR })
|
|
2097
2160
|
);
|
|
2098
2161
|
}
|
|
2099
2162
|
function getDepositTokensInstructionDataDecoder() {
|
|
2100
|
-
return (0,
|
|
2101
|
-
["discriminator", (0,
|
|
2102
|
-
["amount", (0,
|
|
2163
|
+
return (0, import_kit17.getStructDecoder)([
|
|
2164
|
+
["discriminator", (0, import_kit17.fixDecoderSize)((0, import_kit17.getBytesDecoder)(), 8)],
|
|
2165
|
+
["amount", (0, import_kit17.getU64Decoder)()]
|
|
2103
2166
|
]);
|
|
2104
2167
|
}
|
|
2105
2168
|
function getDepositTokensInstructionDataCodec() {
|
|
2106
|
-
return (0,
|
|
2169
|
+
return (0, import_kit17.combineCodec)(
|
|
2107
2170
|
getDepositTokensInstructionDataEncoder(),
|
|
2108
2171
|
getDepositTokensInstructionDataDecoder()
|
|
2109
2172
|
);
|
|
@@ -2114,11 +2177,7 @@ async function getDepositTokensInstructionAsync(input, config) {
|
|
|
2114
2177
|
master: { value: input.master ?? null, isWritable: false },
|
|
2115
2178
|
config: { value: input.config ?? null, isWritable: false },
|
|
2116
2179
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2117
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
2118
|
-
airdropMasterAuthority: {
|
|
2119
|
-
value: input.airdropMasterAuthority ?? null,
|
|
2120
|
-
isWritable: false
|
|
2121
|
-
},
|
|
2180
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2122
2181
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
2123
2182
|
sourceTokenAccount: {
|
|
2124
2183
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -2141,18 +2200,18 @@ async function getDepositTokensInstructionAsync(input, config) {
|
|
|
2141
2200
|
const accounts = originalAccounts;
|
|
2142
2201
|
const args = { ...input };
|
|
2143
2202
|
if (!accounts.master.value) {
|
|
2144
|
-
accounts.master.value = await (0,
|
|
2203
|
+
accounts.master.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2145
2204
|
programAddress,
|
|
2146
2205
|
seeds: [
|
|
2147
|
-
(0,
|
|
2206
|
+
(0, import_kit17.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
2148
2207
|
]
|
|
2149
2208
|
});
|
|
2150
2209
|
}
|
|
2151
2210
|
if (!accounts.config.value) {
|
|
2152
|
-
accounts.config.value = await (0,
|
|
2211
|
+
accounts.config.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2153
2212
|
programAddress,
|
|
2154
2213
|
seeds: [
|
|
2155
|
-
(0,
|
|
2214
|
+
(0, import_kit17.getBytesEncoder)().encode(
|
|
2156
2215
|
new Uint8Array([
|
|
2157
2216
|
97,
|
|
2158
2217
|
105,
|
|
@@ -2174,42 +2233,20 @@ async function getDepositTokensInstructionAsync(input, config) {
|
|
|
2174
2233
|
});
|
|
2175
2234
|
}
|
|
2176
2235
|
if (!accounts.airdropMaster.value) {
|
|
2177
|
-
accounts.airdropMaster.value =
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
new Uint8Array([
|
|
2182
|
-
97,
|
|
2183
|
-
105,
|
|
2184
|
-
114,
|
|
2185
|
-
100,
|
|
2186
|
-
114,
|
|
2187
|
-
111,
|
|
2188
|
-
112,
|
|
2189
|
-
95,
|
|
2190
|
-
109,
|
|
2191
|
-
97,
|
|
2192
|
-
115,
|
|
2193
|
-
116,
|
|
2194
|
-
101,
|
|
2195
|
-
114
|
|
2196
|
-
])
|
|
2197
|
-
),
|
|
2198
|
-
(0, import_kit14.getAddressEncoder)().encode(
|
|
2199
|
-
expectAddress(accounts.airdropMasterAuthority.value)
|
|
2200
|
-
)
|
|
2201
|
-
]
|
|
2202
|
-
});
|
|
2236
|
+
accounts.airdropMaster.value = DEFAULT_MASTER_PDA;
|
|
2237
|
+
}
|
|
2238
|
+
if (!accounts.treasury.value) {
|
|
2239
|
+
accounts.treasury.value = DROPSY_TREASURY;
|
|
2203
2240
|
}
|
|
2204
2241
|
if (!accounts.airdrop.value) {
|
|
2205
|
-
accounts.airdrop.value = await (0,
|
|
2242
|
+
accounts.airdrop.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2206
2243
|
programAddress,
|
|
2207
2244
|
seeds: [
|
|
2208
|
-
(0,
|
|
2245
|
+
(0, import_kit17.getBytesEncoder)().encode(
|
|
2209
2246
|
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
2210
2247
|
),
|
|
2211
|
-
(0,
|
|
2212
|
-
(0,
|
|
2248
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
2249
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
2213
2250
|
]
|
|
2214
2251
|
});
|
|
2215
2252
|
}
|
|
@@ -2217,12 +2254,12 @@ async function getDepositTokensInstructionAsync(input, config) {
|
|
|
2217
2254
|
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
2218
2255
|
}
|
|
2219
2256
|
if (!accounts.destinationTokenAccount.value) {
|
|
2220
|
-
accounts.destinationTokenAccount.value = await (0,
|
|
2257
|
+
accounts.destinationTokenAccount.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2221
2258
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
2222
2259
|
seeds: [
|
|
2223
|
-
(0,
|
|
2224
|
-
(0,
|
|
2225
|
-
(0,
|
|
2260
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.airdrop.value)),
|
|
2261
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.tokenProgram.value)),
|
|
2262
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.mint.value))
|
|
2226
2263
|
]
|
|
2227
2264
|
});
|
|
2228
2265
|
}
|
|
@@ -2239,7 +2276,6 @@ async function getDepositTokensInstructionAsync(input, config) {
|
|
|
2239
2276
|
getAccountMeta(accounts.config),
|
|
2240
2277
|
getAccountMeta(accounts.treasury),
|
|
2241
2278
|
getAccountMeta(accounts.airdropMaster),
|
|
2242
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
2243
2279
|
getAccountMeta(accounts.affiliate),
|
|
2244
2280
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
2245
2281
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -2262,11 +2298,7 @@ function getDepositTokensInstruction(input, config) {
|
|
|
2262
2298
|
master: { value: input.master ?? null, isWritable: false },
|
|
2263
2299
|
config: { value: input.config ?? null, isWritable: false },
|
|
2264
2300
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2265
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
2266
|
-
airdropMasterAuthority: {
|
|
2267
|
-
value: input.airdropMasterAuthority ?? null,
|
|
2268
|
-
isWritable: false
|
|
2269
|
-
},
|
|
2301
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
2270
2302
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
2271
2303
|
sourceTokenAccount: {
|
|
2272
2304
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -2304,7 +2336,6 @@ function getDepositTokensInstruction(input, config) {
|
|
|
2304
2336
|
getAccountMeta(accounts.config),
|
|
2305
2337
|
getAccountMeta(accounts.treasury),
|
|
2306
2338
|
getAccountMeta(accounts.airdropMaster),
|
|
2307
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
2308
2339
|
getAccountMeta(accounts.affiliate),
|
|
2309
2340
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
2310
2341
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -2322,7 +2353,7 @@ function getDepositTokensInstruction(input, config) {
|
|
|
2322
2353
|
});
|
|
2323
2354
|
}
|
|
2324
2355
|
function parseDepositTokensInstruction(instruction) {
|
|
2325
|
-
if (instruction.accounts.length <
|
|
2356
|
+
if (instruction.accounts.length < 13) {
|
|
2326
2357
|
throw new Error("Not enough accounts");
|
|
2327
2358
|
}
|
|
2328
2359
|
let accountIndex = 0;
|
|
@@ -2342,7 +2373,6 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
2342
2373
|
config: getNextAccount(),
|
|
2343
2374
|
treasury: getNextAccount(),
|
|
2344
2375
|
airdropMaster: getNextAccount(),
|
|
2345
|
-
airdropMasterAuthority: getNextAccount(),
|
|
2346
2376
|
affiliate: getNextOptionalAccount(),
|
|
2347
2377
|
sourceTokenAccount: getNextAccount(),
|
|
2348
2378
|
destinationTokenAccount: getNextAccount(),
|
|
@@ -2358,354 +2388,354 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
2358
2388
|
}
|
|
2359
2389
|
|
|
2360
2390
|
// src/instructions/initializeAirdropMaster.ts
|
|
2361
|
-
var
|
|
2391
|
+
var import_kit33 = require("@solana/kit");
|
|
2362
2392
|
|
|
2363
2393
|
// src/types/advancedFeeConfig.ts
|
|
2364
|
-
var
|
|
2394
|
+
var import_kit18 = require("@solana/kit");
|
|
2365
2395
|
function getAdvancedFeeConfigEncoder() {
|
|
2366
|
-
return (0,
|
|
2367
|
-
["claimFee", (0,
|
|
2368
|
-
["depositFee", (0,
|
|
2369
|
-
["delegateFee", (0,
|
|
2396
|
+
return (0, import_kit18.getStructEncoder)([
|
|
2397
|
+
["claimFee", (0, import_kit18.getU64Encoder)()],
|
|
2398
|
+
["depositFee", (0, import_kit18.getU64Encoder)()],
|
|
2399
|
+
["delegateFee", (0, import_kit18.getU64Encoder)()]
|
|
2370
2400
|
]);
|
|
2371
2401
|
}
|
|
2372
2402
|
function getAdvancedFeeConfigDecoder() {
|
|
2373
|
-
return (0,
|
|
2374
|
-
["claimFee", (0,
|
|
2375
|
-
["depositFee", (0,
|
|
2376
|
-
["delegateFee", (0,
|
|
2403
|
+
return (0, import_kit18.getStructDecoder)([
|
|
2404
|
+
["claimFee", (0, import_kit18.getU64Decoder)()],
|
|
2405
|
+
["depositFee", (0, import_kit18.getU64Decoder)()],
|
|
2406
|
+
["delegateFee", (0, import_kit18.getU64Decoder)()]
|
|
2377
2407
|
]);
|
|
2378
2408
|
}
|
|
2379
2409
|
function getAdvancedFeeConfigCodec() {
|
|
2380
|
-
return (0,
|
|
2410
|
+
return (0, import_kit18.combineCodec)(
|
|
2381
2411
|
getAdvancedFeeConfigEncoder(),
|
|
2382
2412
|
getAdvancedFeeConfigDecoder()
|
|
2383
2413
|
);
|
|
2384
2414
|
}
|
|
2385
2415
|
|
|
2386
2416
|
// src/types/airdropBoosted.ts
|
|
2387
|
-
var
|
|
2417
|
+
var import_kit19 = require("@solana/kit");
|
|
2388
2418
|
function getAirdropBoostedEncoder() {
|
|
2389
|
-
return (0,
|
|
2390
|
-
["airdrop", (0,
|
|
2391
|
-
["boostedBy", (0,
|
|
2392
|
-
["boostAmount", (0,
|
|
2393
|
-
["timestamp", (0,
|
|
2419
|
+
return (0, import_kit19.getStructEncoder)([
|
|
2420
|
+
["airdrop", (0, import_kit19.getAddressEncoder)()],
|
|
2421
|
+
["boostedBy", (0, import_kit19.getAddressEncoder)()],
|
|
2422
|
+
["boostAmount", (0, import_kit19.getU64Encoder)()],
|
|
2423
|
+
["timestamp", (0, import_kit19.getI64Encoder)()]
|
|
2394
2424
|
]);
|
|
2395
2425
|
}
|
|
2396
2426
|
function getAirdropBoostedDecoder() {
|
|
2397
|
-
return (0,
|
|
2398
|
-
["airdrop", (0,
|
|
2399
|
-
["boostedBy", (0,
|
|
2400
|
-
["boostAmount", (0,
|
|
2401
|
-
["timestamp", (0,
|
|
2427
|
+
return (0, import_kit19.getStructDecoder)([
|
|
2428
|
+
["airdrop", (0, import_kit19.getAddressDecoder)()],
|
|
2429
|
+
["boostedBy", (0, import_kit19.getAddressDecoder)()],
|
|
2430
|
+
["boostAmount", (0, import_kit19.getU64Decoder)()],
|
|
2431
|
+
["timestamp", (0, import_kit19.getI64Decoder)()]
|
|
2402
2432
|
]);
|
|
2403
2433
|
}
|
|
2404
2434
|
function getAirdropBoostedCodec() {
|
|
2405
|
-
return (0,
|
|
2435
|
+
return (0, import_kit19.combineCodec)(getAirdropBoostedEncoder(), getAirdropBoostedDecoder());
|
|
2406
2436
|
}
|
|
2407
2437
|
|
|
2408
2438
|
// src/types/airdropClosed.ts
|
|
2409
|
-
var
|
|
2439
|
+
var import_kit20 = require("@solana/kit");
|
|
2410
2440
|
function getAirdropClosedEncoder() {
|
|
2411
|
-
return (0,
|
|
2412
|
-
["airdrop", (0,
|
|
2413
|
-
["authority", (0,
|
|
2414
|
-
["timestamp", (0,
|
|
2441
|
+
return (0, import_kit20.getStructEncoder)([
|
|
2442
|
+
["airdrop", (0, import_kit20.getAddressEncoder)()],
|
|
2443
|
+
["authority", (0, import_kit20.getAddressEncoder)()],
|
|
2444
|
+
["timestamp", (0, import_kit20.getI64Encoder)()]
|
|
2415
2445
|
]);
|
|
2416
2446
|
}
|
|
2417
2447
|
function getAirdropClosedDecoder() {
|
|
2418
|
-
return (0,
|
|
2419
|
-
["airdrop", (0,
|
|
2420
|
-
["authority", (0,
|
|
2421
|
-
["timestamp", (0,
|
|
2448
|
+
return (0, import_kit20.getStructDecoder)([
|
|
2449
|
+
["airdrop", (0, import_kit20.getAddressDecoder)()],
|
|
2450
|
+
["authority", (0, import_kit20.getAddressDecoder)()],
|
|
2451
|
+
["timestamp", (0, import_kit20.getI64Decoder)()]
|
|
2422
2452
|
]);
|
|
2423
2453
|
}
|
|
2424
2454
|
function getAirdropClosedCodec() {
|
|
2425
|
-
return (0,
|
|
2455
|
+
return (0, import_kit20.combineCodec)(getAirdropClosedEncoder(), getAirdropClosedDecoder());
|
|
2426
2456
|
}
|
|
2427
2457
|
|
|
2428
2458
|
// src/types/airdropDelegated.ts
|
|
2429
|
-
var
|
|
2459
|
+
var import_kit21 = require("@solana/kit");
|
|
2430
2460
|
function getAirdropDelegatedEncoder() {
|
|
2431
|
-
return (0,
|
|
2432
|
-
["airdrop", (0,
|
|
2433
|
-
["authority", (0,
|
|
2434
|
-
["delegate", (0,
|
|
2435
|
-
["permissions", (0,
|
|
2461
|
+
return (0, import_kit21.getStructEncoder)([
|
|
2462
|
+
["airdrop", (0, import_kit21.getAddressEncoder)()],
|
|
2463
|
+
["authority", (0, import_kit21.getAddressEncoder)()],
|
|
2464
|
+
["delegate", (0, import_kit21.getAddressEncoder)()],
|
|
2465
|
+
["permissions", (0, import_kit21.getU8Encoder)()]
|
|
2436
2466
|
]);
|
|
2437
2467
|
}
|
|
2438
2468
|
function getAirdropDelegatedDecoder() {
|
|
2439
|
-
return (0,
|
|
2440
|
-
["airdrop", (0,
|
|
2441
|
-
["authority", (0,
|
|
2442
|
-
["delegate", (0,
|
|
2443
|
-
["permissions", (0,
|
|
2469
|
+
return (0, import_kit21.getStructDecoder)([
|
|
2470
|
+
["airdrop", (0, import_kit21.getAddressDecoder)()],
|
|
2471
|
+
["authority", (0, import_kit21.getAddressDecoder)()],
|
|
2472
|
+
["delegate", (0, import_kit21.getAddressDecoder)()],
|
|
2473
|
+
["permissions", (0, import_kit21.getU8Decoder)()]
|
|
2444
2474
|
]);
|
|
2445
2475
|
}
|
|
2446
2476
|
function getAirdropDelegatedCodec() {
|
|
2447
|
-
return (0,
|
|
2477
|
+
return (0, import_kit21.combineCodec)(
|
|
2448
2478
|
getAirdropDelegatedEncoder(),
|
|
2449
2479
|
getAirdropDelegatedDecoder()
|
|
2450
2480
|
);
|
|
2451
2481
|
}
|
|
2452
2482
|
|
|
2453
2483
|
// src/types/airdropInitialized.ts
|
|
2454
|
-
var
|
|
2484
|
+
var import_kit22 = require("@solana/kit");
|
|
2455
2485
|
function getAirdropInitializedEncoder() {
|
|
2456
|
-
return (0,
|
|
2457
|
-
["airdrop", (0,
|
|
2458
|
-
["mint", (0,
|
|
2459
|
-
["authority", (0,
|
|
2460
|
-
["controller", (0,
|
|
2461
|
-
["merkleRoot", (0,
|
|
2462
|
-
["startTime", (0,
|
|
2463
|
-
["endTime", (0,
|
|
2464
|
-
["timestamp", (0,
|
|
2486
|
+
return (0, import_kit22.getStructEncoder)([
|
|
2487
|
+
["airdrop", (0, import_kit22.getAddressEncoder)()],
|
|
2488
|
+
["mint", (0, import_kit22.getAddressEncoder)()],
|
|
2489
|
+
["authority", (0, import_kit22.getAddressEncoder)()],
|
|
2490
|
+
["controller", (0, import_kit22.getAddressEncoder)()],
|
|
2491
|
+
["merkleRoot", (0, import_kit22.fixEncoderSize)((0, import_kit22.getBytesEncoder)(), 32)],
|
|
2492
|
+
["startTime", (0, import_kit22.getI64Encoder)()],
|
|
2493
|
+
["endTime", (0, import_kit22.getI64Encoder)()],
|
|
2494
|
+
["timestamp", (0, import_kit22.getI64Encoder)()]
|
|
2465
2495
|
]);
|
|
2466
2496
|
}
|
|
2467
2497
|
function getAirdropInitializedDecoder() {
|
|
2468
|
-
return (0,
|
|
2469
|
-
["airdrop", (0,
|
|
2470
|
-
["mint", (0,
|
|
2471
|
-
["authority", (0,
|
|
2472
|
-
["controller", (0,
|
|
2473
|
-
["merkleRoot", (0,
|
|
2474
|
-
["startTime", (0,
|
|
2475
|
-
["endTime", (0,
|
|
2476
|
-
["timestamp", (0,
|
|
2498
|
+
return (0, import_kit22.getStructDecoder)([
|
|
2499
|
+
["airdrop", (0, import_kit22.getAddressDecoder)()],
|
|
2500
|
+
["mint", (0, import_kit22.getAddressDecoder)()],
|
|
2501
|
+
["authority", (0, import_kit22.getAddressDecoder)()],
|
|
2502
|
+
["controller", (0, import_kit22.getAddressDecoder)()],
|
|
2503
|
+
["merkleRoot", (0, import_kit22.fixDecoderSize)((0, import_kit22.getBytesDecoder)(), 32)],
|
|
2504
|
+
["startTime", (0, import_kit22.getI64Decoder)()],
|
|
2505
|
+
["endTime", (0, import_kit22.getI64Decoder)()],
|
|
2506
|
+
["timestamp", (0, import_kit22.getI64Decoder)()]
|
|
2477
2507
|
]);
|
|
2478
2508
|
}
|
|
2479
2509
|
function getAirdropInitializedCodec() {
|
|
2480
|
-
return (0,
|
|
2510
|
+
return (0, import_kit22.combineCodec)(
|
|
2481
2511
|
getAirdropInitializedEncoder(),
|
|
2482
2512
|
getAirdropInitializedDecoder()
|
|
2483
2513
|
);
|
|
2484
2514
|
}
|
|
2485
2515
|
|
|
2486
2516
|
// src/types/airdropUpdated.ts
|
|
2487
|
-
var
|
|
2517
|
+
var import_kit23 = require("@solana/kit");
|
|
2488
2518
|
function getAirdropUpdatedEncoder() {
|
|
2489
|
-
return (0,
|
|
2490
|
-
["airdrop", (0,
|
|
2491
|
-
["updatedBy", (0,
|
|
2519
|
+
return (0, import_kit23.getStructEncoder)([
|
|
2520
|
+
["airdrop", (0, import_kit23.getAddressEncoder)()],
|
|
2521
|
+
["updatedBy", (0, import_kit23.getAddressEncoder)()]
|
|
2492
2522
|
]);
|
|
2493
2523
|
}
|
|
2494
2524
|
function getAirdropUpdatedDecoder() {
|
|
2495
|
-
return (0,
|
|
2496
|
-
["airdrop", (0,
|
|
2497
|
-
["updatedBy", (0,
|
|
2525
|
+
return (0, import_kit23.getStructDecoder)([
|
|
2526
|
+
["airdrop", (0, import_kit23.getAddressDecoder)()],
|
|
2527
|
+
["updatedBy", (0, import_kit23.getAddressDecoder)()]
|
|
2498
2528
|
]);
|
|
2499
2529
|
}
|
|
2500
2530
|
function getAirdropUpdatedCodec() {
|
|
2501
|
-
return (0,
|
|
2531
|
+
return (0, import_kit23.combineCodec)(getAirdropUpdatedEncoder(), getAirdropUpdatedDecoder());
|
|
2502
2532
|
}
|
|
2503
2533
|
|
|
2504
2534
|
// src/types/baseDurationConfig.ts
|
|
2505
|
-
var
|
|
2535
|
+
var import_kit24 = require("@solana/kit");
|
|
2506
2536
|
function getBaseDurationConfigEncoder() {
|
|
2507
|
-
return (0,
|
|
2508
|
-
["minimum", (0,
|
|
2509
|
-
["maximum", (0,
|
|
2510
|
-
["updateGrace", (0,
|
|
2537
|
+
return (0, import_kit24.getStructEncoder)([
|
|
2538
|
+
["minimum", (0, import_kit24.getI64Encoder)()],
|
|
2539
|
+
["maximum", (0, import_kit24.getI64Encoder)()],
|
|
2540
|
+
["updateGrace", (0, import_kit24.getI64Encoder)()]
|
|
2511
2541
|
]);
|
|
2512
2542
|
}
|
|
2513
2543
|
function getBaseDurationConfigDecoder() {
|
|
2514
|
-
return (0,
|
|
2515
|
-
["minimum", (0,
|
|
2516
|
-
["maximum", (0,
|
|
2517
|
-
["updateGrace", (0,
|
|
2544
|
+
return (0, import_kit24.getStructDecoder)([
|
|
2545
|
+
["minimum", (0, import_kit24.getI64Decoder)()],
|
|
2546
|
+
["maximum", (0, import_kit24.getI64Decoder)()],
|
|
2547
|
+
["updateGrace", (0, import_kit24.getI64Decoder)()]
|
|
2518
2548
|
]);
|
|
2519
2549
|
}
|
|
2520
2550
|
function getBaseDurationConfigCodec() {
|
|
2521
|
-
return (0,
|
|
2551
|
+
return (0, import_kit24.combineCodec)(
|
|
2522
2552
|
getBaseDurationConfigEncoder(),
|
|
2523
2553
|
getBaseDurationConfigDecoder()
|
|
2524
2554
|
);
|
|
2525
2555
|
}
|
|
2526
2556
|
|
|
2527
2557
|
// src/types/baseFeatureFeeConfig.ts
|
|
2528
|
-
var
|
|
2558
|
+
var import_kit25 = require("@solana/kit");
|
|
2529
2559
|
function getBaseFeatureFeeConfigEncoder() {
|
|
2530
|
-
return (0,
|
|
2531
|
-
["creationFee", (0,
|
|
2532
|
-
["upgradeFee", (0,
|
|
2533
|
-
["withdrawFeeBasis", (0,
|
|
2560
|
+
return (0, import_kit25.getStructEncoder)([
|
|
2561
|
+
["creationFee", (0, import_kit25.getU64Encoder)()],
|
|
2562
|
+
["upgradeFee", (0, import_kit25.getU64Encoder)()],
|
|
2563
|
+
["withdrawFeeBasis", (0, import_kit25.getU64Encoder)()]
|
|
2534
2564
|
]);
|
|
2535
2565
|
}
|
|
2536
2566
|
function getBaseFeatureFeeConfigDecoder() {
|
|
2537
|
-
return (0,
|
|
2538
|
-
["creationFee", (0,
|
|
2539
|
-
["upgradeFee", (0,
|
|
2540
|
-
["withdrawFeeBasis", (0,
|
|
2567
|
+
return (0, import_kit25.getStructDecoder)([
|
|
2568
|
+
["creationFee", (0, import_kit25.getU64Decoder)()],
|
|
2569
|
+
["upgradeFee", (0, import_kit25.getU64Decoder)()],
|
|
2570
|
+
["withdrawFeeBasis", (0, import_kit25.getU64Decoder)()]
|
|
2541
2571
|
]);
|
|
2542
2572
|
}
|
|
2543
2573
|
function getBaseFeatureFeeConfigCodec() {
|
|
2544
|
-
return (0,
|
|
2574
|
+
return (0, import_kit25.combineCodec)(
|
|
2545
2575
|
getBaseFeatureFeeConfigEncoder(),
|
|
2546
2576
|
getBaseFeatureFeeConfigDecoder()
|
|
2547
2577
|
);
|
|
2548
2578
|
}
|
|
2549
2579
|
|
|
2550
2580
|
// src/types/baseFeeConfig.ts
|
|
2551
|
-
var
|
|
2581
|
+
var import_kit26 = require("@solana/kit");
|
|
2552
2582
|
function getBaseFeeConfigEncoder() {
|
|
2553
|
-
return (0,
|
|
2554
|
-
["creationFee", (0,
|
|
2555
|
-
["updateFee", (0,
|
|
2556
|
-
["closeFee", (0,
|
|
2583
|
+
return (0, import_kit26.getStructEncoder)([
|
|
2584
|
+
["creationFee", (0, import_kit26.getU64Encoder)()],
|
|
2585
|
+
["updateFee", (0, import_kit26.getOptionEncoder)((0, import_kit26.getU64Encoder)())],
|
|
2586
|
+
["closeFee", (0, import_kit26.getU64Encoder)()]
|
|
2557
2587
|
]);
|
|
2558
2588
|
}
|
|
2559
2589
|
function getBaseFeeConfigDecoder() {
|
|
2560
|
-
return (0,
|
|
2561
|
-
["creationFee", (0,
|
|
2562
|
-
["updateFee", (0,
|
|
2563
|
-
["closeFee", (0,
|
|
2590
|
+
return (0, import_kit26.getStructDecoder)([
|
|
2591
|
+
["creationFee", (0, import_kit26.getU64Decoder)()],
|
|
2592
|
+
["updateFee", (0, import_kit26.getOptionDecoder)((0, import_kit26.getU64Decoder)())],
|
|
2593
|
+
["closeFee", (0, import_kit26.getU64Decoder)()]
|
|
2564
2594
|
]);
|
|
2565
2595
|
}
|
|
2566
2596
|
function getBaseFeeConfigCodec() {
|
|
2567
|
-
return (0,
|
|
2597
|
+
return (0, import_kit26.combineCodec)(getBaseFeeConfigEncoder(), getBaseFeeConfigDecoder());
|
|
2568
2598
|
}
|
|
2569
2599
|
|
|
2570
2600
|
// src/types/claimMapClosed.ts
|
|
2571
|
-
var
|
|
2601
|
+
var import_kit27 = require("@solana/kit");
|
|
2572
2602
|
function getClaimMapClosedEncoder() {
|
|
2573
|
-
return (0,
|
|
2574
|
-
["airdrop", (0,
|
|
2575
|
-
["bitmap", (0,
|
|
2576
|
-
["authority", (0,
|
|
2603
|
+
return (0, import_kit27.getStructEncoder)([
|
|
2604
|
+
["airdrop", (0, import_kit27.getAddressEncoder)()],
|
|
2605
|
+
["bitmap", (0, import_kit27.getAddressEncoder)()],
|
|
2606
|
+
["authority", (0, import_kit27.getAddressEncoder)()]
|
|
2577
2607
|
]);
|
|
2578
2608
|
}
|
|
2579
2609
|
function getClaimMapClosedDecoder() {
|
|
2580
|
-
return (0,
|
|
2581
|
-
["airdrop", (0,
|
|
2582
|
-
["bitmap", (0,
|
|
2583
|
-
["authority", (0,
|
|
2610
|
+
return (0, import_kit27.getStructDecoder)([
|
|
2611
|
+
["airdrop", (0, import_kit27.getAddressDecoder)()],
|
|
2612
|
+
["bitmap", (0, import_kit27.getAddressDecoder)()],
|
|
2613
|
+
["authority", (0, import_kit27.getAddressDecoder)()]
|
|
2584
2614
|
]);
|
|
2585
2615
|
}
|
|
2586
2616
|
function getClaimMapClosedCodec() {
|
|
2587
|
-
return (0,
|
|
2617
|
+
return (0, import_kit27.combineCodec)(getClaimMapClosedEncoder(), getClaimMapClosedDecoder());
|
|
2588
2618
|
}
|
|
2589
2619
|
|
|
2590
2620
|
// src/types/claimMapInitialized.ts
|
|
2591
|
-
var
|
|
2621
|
+
var import_kit28 = require("@solana/kit");
|
|
2592
2622
|
function getClaimMapInitializedEncoder() {
|
|
2593
|
-
return (0,
|
|
2594
|
-
["airdrop", (0,
|
|
2595
|
-
["bitmap", (0,
|
|
2596
|
-
["bitmapId", (0,
|
|
2597
|
-
["timestamp", (0,
|
|
2623
|
+
return (0, import_kit28.getStructEncoder)([
|
|
2624
|
+
["airdrop", (0, import_kit28.getAddressEncoder)()],
|
|
2625
|
+
["bitmap", (0, import_kit28.getAddressEncoder)()],
|
|
2626
|
+
["bitmapId", (0, import_kit28.getU16Encoder)()],
|
|
2627
|
+
["timestamp", (0, import_kit28.getI64Encoder)()]
|
|
2598
2628
|
]);
|
|
2599
2629
|
}
|
|
2600
2630
|
function getClaimMapInitializedDecoder() {
|
|
2601
|
-
return (0,
|
|
2602
|
-
["airdrop", (0,
|
|
2603
|
-
["bitmap", (0,
|
|
2604
|
-
["bitmapId", (0,
|
|
2605
|
-
["timestamp", (0,
|
|
2631
|
+
return (0, import_kit28.getStructDecoder)([
|
|
2632
|
+
["airdrop", (0, import_kit28.getAddressDecoder)()],
|
|
2633
|
+
["bitmap", (0, import_kit28.getAddressDecoder)()],
|
|
2634
|
+
["bitmapId", (0, import_kit28.getU16Decoder)()],
|
|
2635
|
+
["timestamp", (0, import_kit28.getI64Decoder)()]
|
|
2606
2636
|
]);
|
|
2607
2637
|
}
|
|
2608
2638
|
function getClaimMapInitializedCodec() {
|
|
2609
|
-
return (0,
|
|
2639
|
+
return (0, import_kit28.combineCodec)(
|
|
2610
2640
|
getClaimMapInitializedEncoder(),
|
|
2611
2641
|
getClaimMapInitializedDecoder()
|
|
2612
2642
|
);
|
|
2613
2643
|
}
|
|
2614
2644
|
|
|
2615
2645
|
// src/types/initAirdropConfigArgs.ts
|
|
2616
|
-
var
|
|
2646
|
+
var import_kit29 = require("@solana/kit");
|
|
2617
2647
|
function getInitAirdropConfigArgsEncoder() {
|
|
2618
|
-
return (0,
|
|
2619
|
-
["merkleRoot", (0,
|
|
2648
|
+
return (0, import_kit29.getStructEncoder)([
|
|
2649
|
+
["merkleRoot", (0, import_kit29.getOptionEncoder)((0, import_kit29.fixEncoderSize)((0, import_kit29.getBytesEncoder)(), 32))],
|
|
2620
2650
|
["durationConfig", getBaseDurationConfigEncoder()],
|
|
2621
2651
|
["masterConfig", getBaseFeatureFeeConfigEncoder()],
|
|
2622
|
-
["bitmapActionFee", (0,
|
|
2623
|
-
["perBoostAmount", (0,
|
|
2652
|
+
["bitmapActionFee", (0, import_kit29.getU64Encoder)()],
|
|
2653
|
+
["perBoostAmount", (0, import_kit29.getU64Encoder)()]
|
|
2624
2654
|
]);
|
|
2625
2655
|
}
|
|
2626
2656
|
function getInitAirdropConfigArgsDecoder() {
|
|
2627
|
-
return (0,
|
|
2628
|
-
["merkleRoot", (0,
|
|
2657
|
+
return (0, import_kit29.getStructDecoder)([
|
|
2658
|
+
["merkleRoot", (0, import_kit29.getOptionDecoder)((0, import_kit29.fixDecoderSize)((0, import_kit29.getBytesDecoder)(), 32))],
|
|
2629
2659
|
["durationConfig", getBaseDurationConfigDecoder()],
|
|
2630
2660
|
["masterConfig", getBaseFeatureFeeConfigDecoder()],
|
|
2631
|
-
["bitmapActionFee", (0,
|
|
2632
|
-
["perBoostAmount", (0,
|
|
2661
|
+
["bitmapActionFee", (0, import_kit29.getU64Decoder)()],
|
|
2662
|
+
["perBoostAmount", (0, import_kit29.getU64Decoder)()]
|
|
2633
2663
|
]);
|
|
2634
2664
|
}
|
|
2635
2665
|
function getInitAirdropConfigArgsCodec() {
|
|
2636
|
-
return (0,
|
|
2666
|
+
return (0, import_kit29.combineCodec)(
|
|
2637
2667
|
getInitAirdropConfigArgsEncoder(),
|
|
2638
2668
|
getInitAirdropConfigArgsDecoder()
|
|
2639
2669
|
);
|
|
2640
2670
|
}
|
|
2641
2671
|
|
|
2642
2672
|
// src/types/masterInitialized.ts
|
|
2643
|
-
var
|
|
2673
|
+
var import_kit30 = require("@solana/kit");
|
|
2644
2674
|
function getMasterInitializedEncoder() {
|
|
2645
|
-
return (0,
|
|
2646
|
-
["address", (0,
|
|
2647
|
-
["authority", (0,
|
|
2648
|
-
["treasury", (0,
|
|
2649
|
-
["timestamp", (0,
|
|
2675
|
+
return (0, import_kit30.getStructEncoder)([
|
|
2676
|
+
["address", (0, import_kit30.getAddressEncoder)()],
|
|
2677
|
+
["authority", (0, import_kit30.getAddressEncoder)()],
|
|
2678
|
+
["treasury", (0, import_kit30.getAddressEncoder)()],
|
|
2679
|
+
["timestamp", (0, import_kit30.getI64Encoder)()]
|
|
2650
2680
|
]);
|
|
2651
2681
|
}
|
|
2652
2682
|
function getMasterInitializedDecoder() {
|
|
2653
|
-
return (0,
|
|
2654
|
-
["address", (0,
|
|
2655
|
-
["authority", (0,
|
|
2656
|
-
["treasury", (0,
|
|
2657
|
-
["timestamp", (0,
|
|
2683
|
+
return (0, import_kit30.getStructDecoder)([
|
|
2684
|
+
["address", (0, import_kit30.getAddressDecoder)()],
|
|
2685
|
+
["authority", (0, import_kit30.getAddressDecoder)()],
|
|
2686
|
+
["treasury", (0, import_kit30.getAddressDecoder)()],
|
|
2687
|
+
["timestamp", (0, import_kit30.getI64Decoder)()]
|
|
2658
2688
|
]);
|
|
2659
2689
|
}
|
|
2660
2690
|
function getMasterInitializedCodec() {
|
|
2661
|
-
return (0,
|
|
2691
|
+
return (0, import_kit30.combineCodec)(
|
|
2662
2692
|
getMasterInitializedEncoder(),
|
|
2663
2693
|
getMasterInitializedDecoder()
|
|
2664
2694
|
);
|
|
2665
2695
|
}
|
|
2666
2696
|
|
|
2667
2697
|
// src/types/tokensDeposited.ts
|
|
2668
|
-
var
|
|
2698
|
+
var import_kit31 = require("@solana/kit");
|
|
2669
2699
|
function getTokensDepositedEncoder() {
|
|
2670
|
-
return (0,
|
|
2671
|
-
["airdrop", (0,
|
|
2672
|
-
["amount", (0,
|
|
2673
|
-
["newSupply", (0,
|
|
2674
|
-
["depositor", (0,
|
|
2675
|
-
["timestamp", (0,
|
|
2700
|
+
return (0, import_kit31.getStructEncoder)([
|
|
2701
|
+
["airdrop", (0, import_kit31.getAddressEncoder)()],
|
|
2702
|
+
["amount", (0, import_kit31.getU64Encoder)()],
|
|
2703
|
+
["newSupply", (0, import_kit31.getU64Encoder)()],
|
|
2704
|
+
["depositor", (0, import_kit31.getAddressEncoder)()],
|
|
2705
|
+
["timestamp", (0, import_kit31.getI64Encoder)()]
|
|
2676
2706
|
]);
|
|
2677
2707
|
}
|
|
2678
2708
|
function getTokensDepositedDecoder() {
|
|
2679
|
-
return (0,
|
|
2680
|
-
["airdrop", (0,
|
|
2681
|
-
["amount", (0,
|
|
2682
|
-
["newSupply", (0,
|
|
2683
|
-
["depositor", (0,
|
|
2684
|
-
["timestamp", (0,
|
|
2709
|
+
return (0, import_kit31.getStructDecoder)([
|
|
2710
|
+
["airdrop", (0, import_kit31.getAddressDecoder)()],
|
|
2711
|
+
["amount", (0, import_kit31.getU64Decoder)()],
|
|
2712
|
+
["newSupply", (0, import_kit31.getU64Decoder)()],
|
|
2713
|
+
["depositor", (0, import_kit31.getAddressDecoder)()],
|
|
2714
|
+
["timestamp", (0, import_kit31.getI64Decoder)()]
|
|
2685
2715
|
]);
|
|
2686
2716
|
}
|
|
2687
2717
|
function getTokensDepositedCodec() {
|
|
2688
|
-
return (0,
|
|
2718
|
+
return (0, import_kit31.combineCodec)(getTokensDepositedEncoder(), getTokensDepositedDecoder());
|
|
2689
2719
|
}
|
|
2690
2720
|
|
|
2691
2721
|
// src/types/tokensRedeemed.ts
|
|
2692
|
-
var
|
|
2722
|
+
var import_kit32 = require("@solana/kit");
|
|
2693
2723
|
function getTokensRedeemedEncoder() {
|
|
2694
|
-
return (0,
|
|
2695
|
-
["airdrop", (0,
|
|
2696
|
-
["authority", (0,
|
|
2697
|
-
["timestamp", (0,
|
|
2724
|
+
return (0, import_kit32.getStructEncoder)([
|
|
2725
|
+
["airdrop", (0, import_kit32.getAddressEncoder)()],
|
|
2726
|
+
["authority", (0, import_kit32.getAddressEncoder)()],
|
|
2727
|
+
["timestamp", (0, import_kit32.getI64Encoder)()]
|
|
2698
2728
|
]);
|
|
2699
2729
|
}
|
|
2700
2730
|
function getTokensRedeemedDecoder() {
|
|
2701
|
-
return (0,
|
|
2702
|
-
["airdrop", (0,
|
|
2703
|
-
["authority", (0,
|
|
2704
|
-
["timestamp", (0,
|
|
2731
|
+
return (0, import_kit32.getStructDecoder)([
|
|
2732
|
+
["airdrop", (0, import_kit32.getAddressDecoder)()],
|
|
2733
|
+
["authority", (0, import_kit32.getAddressDecoder)()],
|
|
2734
|
+
["timestamp", (0, import_kit32.getI64Decoder)()]
|
|
2705
2735
|
]);
|
|
2706
2736
|
}
|
|
2707
2737
|
function getTokensRedeemedCodec() {
|
|
2708
|
-
return (0,
|
|
2738
|
+
return (0, import_kit32.combineCodec)(getTokensRedeemedEncoder(), getTokensRedeemedDecoder());
|
|
2709
2739
|
}
|
|
2710
2740
|
|
|
2711
2741
|
// src/instructions/initializeAirdropMaster.ts
|
|
@@ -2720,18 +2750,25 @@ var INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
|
2720
2750
|
65
|
|
2721
2751
|
]);
|
|
2722
2752
|
function getInitializeAirdropMasterDiscriminatorBytes() {
|
|
2723
|
-
return (0,
|
|
2753
|
+
return (0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 8).encode(
|
|
2724
2754
|
INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR
|
|
2725
2755
|
);
|
|
2726
2756
|
}
|
|
2727
2757
|
function getInitializeAirdropMasterInstructionDataEncoder() {
|
|
2728
|
-
return (0,
|
|
2729
|
-
(0,
|
|
2730
|
-
["discriminator", (0,
|
|
2731
|
-
["merkleRoot", (0,
|
|
2732
|
-
["
|
|
2733
|
-
["
|
|
2734
|
-
["
|
|
2758
|
+
return (0, import_kit33.transformEncoder)(
|
|
2759
|
+
(0, import_kit33.getStructEncoder)([
|
|
2760
|
+
["discriminator", (0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 8)],
|
|
2761
|
+
["merkleRoot", (0, import_kit33.getOptionEncoder)((0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 32))],
|
|
2762
|
+
["airdropCreateFee", (0, import_kit33.getOptionEncoder)((0, import_kit33.getU64Encoder)())],
|
|
2763
|
+
["airdropUpdateFee", (0, import_kit33.getOptionEncoder)((0, import_kit33.getU64Encoder)())],
|
|
2764
|
+
["bitmapCreateFee", (0, import_kit33.getOptionEncoder)((0, import_kit33.getU64Encoder)())],
|
|
2765
|
+
["advancedConfig", (0, import_kit33.getOptionEncoder)(getAdvancedFeeConfigEncoder())],
|
|
2766
|
+
[
|
|
2767
|
+
"wlProof",
|
|
2768
|
+
(0, import_kit33.getOptionEncoder)(
|
|
2769
|
+
(0, import_kit33.getArrayEncoder)((0, import_kit33.fixEncoderSize)((0, import_kit33.getBytesEncoder)(), 32))
|
|
2770
|
+
)
|
|
2771
|
+
]
|
|
2735
2772
|
]),
|
|
2736
2773
|
(value) => ({
|
|
2737
2774
|
...value,
|
|
@@ -2740,16 +2777,21 @@ function getInitializeAirdropMasterInstructionDataEncoder() {
|
|
|
2740
2777
|
);
|
|
2741
2778
|
}
|
|
2742
2779
|
function getInitializeAirdropMasterInstructionDataDecoder() {
|
|
2743
|
-
return (0,
|
|
2744
|
-
["discriminator", (0,
|
|
2745
|
-
["merkleRoot", (0,
|
|
2746
|
-
["
|
|
2747
|
-
["
|
|
2748
|
-
["
|
|
2780
|
+
return (0, import_kit33.getStructDecoder)([
|
|
2781
|
+
["discriminator", (0, import_kit33.fixDecoderSize)((0, import_kit33.getBytesDecoder)(), 8)],
|
|
2782
|
+
["merkleRoot", (0, import_kit33.getOptionDecoder)((0, import_kit33.fixDecoderSize)((0, import_kit33.getBytesDecoder)(), 32))],
|
|
2783
|
+
["airdropCreateFee", (0, import_kit33.getOptionDecoder)((0, import_kit33.getU64Decoder)())],
|
|
2784
|
+
["airdropUpdateFee", (0, import_kit33.getOptionDecoder)((0, import_kit33.getU64Decoder)())],
|
|
2785
|
+
["bitmapCreateFee", (0, import_kit33.getOptionDecoder)((0, import_kit33.getU64Decoder)())],
|
|
2786
|
+
["advancedConfig", (0, import_kit33.getOptionDecoder)(getAdvancedFeeConfigDecoder())],
|
|
2787
|
+
[
|
|
2788
|
+
"wlProof",
|
|
2789
|
+
(0, import_kit33.getOptionDecoder)((0, import_kit33.getArrayDecoder)((0, import_kit33.fixDecoderSize)((0, import_kit33.getBytesDecoder)(), 32)))
|
|
2790
|
+
]
|
|
2749
2791
|
]);
|
|
2750
2792
|
}
|
|
2751
2793
|
function getInitializeAirdropMasterInstructionDataCodec() {
|
|
2752
|
-
return (0,
|
|
2794
|
+
return (0, import_kit33.combineCodec)(
|
|
2753
2795
|
getInitializeAirdropMasterInstructionDataEncoder(),
|
|
2754
2796
|
getInitializeAirdropMasterInstructionDataDecoder()
|
|
2755
2797
|
);
|
|
@@ -2771,18 +2813,18 @@ async function getInitializeAirdropMasterInstructionAsync(input, config) {
|
|
|
2771
2813
|
const accounts = originalAccounts;
|
|
2772
2814
|
const args = { ...input };
|
|
2773
2815
|
if (!accounts.master.value) {
|
|
2774
|
-
accounts.master.value = await (0,
|
|
2816
|
+
accounts.master.value = await (0, import_kit33.getProgramDerivedAddress)({
|
|
2775
2817
|
programAddress,
|
|
2776
2818
|
seeds: [
|
|
2777
|
-
(0,
|
|
2819
|
+
(0, import_kit33.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
2778
2820
|
]
|
|
2779
2821
|
});
|
|
2780
2822
|
}
|
|
2781
2823
|
if (!accounts.config.value) {
|
|
2782
|
-
accounts.config.value = await (0,
|
|
2824
|
+
accounts.config.value = await (0, import_kit33.getProgramDerivedAddress)({
|
|
2783
2825
|
programAddress,
|
|
2784
2826
|
seeds: [
|
|
2785
|
-
(0,
|
|
2827
|
+
(0, import_kit33.getBytesEncoder)().encode(
|
|
2786
2828
|
new Uint8Array([
|
|
2787
2829
|
97,
|
|
2788
2830
|
105,
|
|
@@ -2804,10 +2846,10 @@ async function getInitializeAirdropMasterInstructionAsync(input, config) {
|
|
|
2804
2846
|
});
|
|
2805
2847
|
}
|
|
2806
2848
|
if (!accounts.airdropMaster.value) {
|
|
2807
|
-
accounts.airdropMaster.value = await (0,
|
|
2849
|
+
accounts.airdropMaster.value = await (0, import_kit33.getProgramDerivedAddress)({
|
|
2808
2850
|
programAddress,
|
|
2809
2851
|
seeds: [
|
|
2810
|
-
(0,
|
|
2852
|
+
(0, import_kit33.getBytesEncoder)().encode(
|
|
2811
2853
|
new Uint8Array([
|
|
2812
2854
|
97,
|
|
2813
2855
|
105,
|
|
@@ -2825,7 +2867,7 @@ async function getInitializeAirdropMasterInstructionAsync(input, config) {
|
|
|
2825
2867
|
114
|
|
2826
2868
|
])
|
|
2827
2869
|
),
|
|
2828
|
-
(0,
|
|
2870
|
+
(0, import_kit33.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
2829
2871
|
]
|
|
2830
2872
|
});
|
|
2831
2873
|
}
|
|
@@ -2917,7 +2959,7 @@ function parseInitializeAirdropMasterInstruction(instruction) {
|
|
|
2917
2959
|
}
|
|
2918
2960
|
|
|
2919
2961
|
// src/instructions/initializeMaster.ts
|
|
2920
|
-
var
|
|
2962
|
+
var import_kit34 = require("@solana/kit");
|
|
2921
2963
|
var INITIALIZE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
2922
2964
|
206,
|
|
2923
2965
|
91,
|
|
@@ -2929,29 +2971,29 @@ var INITIALIZE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
|
2929
2971
|
166
|
|
2930
2972
|
]);
|
|
2931
2973
|
function getInitializeMasterDiscriminatorBytes() {
|
|
2932
|
-
return (0,
|
|
2974
|
+
return (0, import_kit34.fixEncoderSize)((0, import_kit34.getBytesEncoder)(), 8).encode(
|
|
2933
2975
|
INITIALIZE_MASTER_DISCRIMINATOR
|
|
2934
2976
|
);
|
|
2935
2977
|
}
|
|
2936
2978
|
function getInitializeMasterInstructionDataEncoder() {
|
|
2937
|
-
return (0,
|
|
2938
|
-
(0,
|
|
2939
|
-
["discriminator", (0,
|
|
2979
|
+
return (0, import_kit34.transformEncoder)(
|
|
2980
|
+
(0, import_kit34.getStructEncoder)([
|
|
2981
|
+
["discriminator", (0, import_kit34.fixEncoderSize)((0, import_kit34.getBytesEncoder)(), 8)],
|
|
2940
2982
|
["airdropConfig", getInitAirdropConfigArgsEncoder()],
|
|
2941
|
-
["protocolFee", (0,
|
|
2983
|
+
["protocolFee", (0, import_kit34.getU64Encoder)()]
|
|
2942
2984
|
]),
|
|
2943
2985
|
(value) => ({ ...value, discriminator: INITIALIZE_MASTER_DISCRIMINATOR })
|
|
2944
2986
|
);
|
|
2945
2987
|
}
|
|
2946
2988
|
function getInitializeMasterInstructionDataDecoder() {
|
|
2947
|
-
return (0,
|
|
2948
|
-
["discriminator", (0,
|
|
2989
|
+
return (0, import_kit34.getStructDecoder)([
|
|
2990
|
+
["discriminator", (0, import_kit34.fixDecoderSize)((0, import_kit34.getBytesDecoder)(), 8)],
|
|
2949
2991
|
["airdropConfig", getInitAirdropConfigArgsDecoder()],
|
|
2950
|
-
["protocolFee", (0,
|
|
2992
|
+
["protocolFee", (0, import_kit34.getU64Decoder)()]
|
|
2951
2993
|
]);
|
|
2952
2994
|
}
|
|
2953
2995
|
function getInitializeMasterInstructionDataCodec() {
|
|
2954
|
-
return (0,
|
|
2996
|
+
return (0, import_kit34.combineCodec)(
|
|
2955
2997
|
getInitializeMasterInstructionDataEncoder(),
|
|
2956
2998
|
getInitializeMasterInstructionDataDecoder()
|
|
2957
2999
|
);
|
|
@@ -2969,18 +3011,18 @@ async function getInitializeMasterInstructionAsync(input, config) {
|
|
|
2969
3011
|
const accounts = originalAccounts;
|
|
2970
3012
|
const args = { ...input };
|
|
2971
3013
|
if (!accounts.master.value) {
|
|
2972
|
-
accounts.master.value = await (0,
|
|
3014
|
+
accounts.master.value = await (0, import_kit34.getProgramDerivedAddress)({
|
|
2973
3015
|
programAddress,
|
|
2974
3016
|
seeds: [
|
|
2975
|
-
(0,
|
|
3017
|
+
(0, import_kit34.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
2976
3018
|
]
|
|
2977
3019
|
});
|
|
2978
3020
|
}
|
|
2979
3021
|
if (!accounts.config.value) {
|
|
2980
|
-
accounts.config.value = await (0,
|
|
3022
|
+
accounts.config.value = await (0, import_kit34.getProgramDerivedAddress)({
|
|
2981
3023
|
programAddress,
|
|
2982
3024
|
seeds: [
|
|
2983
|
-
(0,
|
|
3025
|
+
(0, import_kit34.getBytesEncoder)().encode(
|
|
2984
3026
|
new Uint8Array([
|
|
2985
3027
|
97,
|
|
2986
3028
|
105,
|
|
@@ -3086,7 +3128,7 @@ function parseInitializeMasterInstruction(instruction) {
|
|
|
3086
3128
|
}
|
|
3087
3129
|
|
|
3088
3130
|
// src/instructions/redeemAirdropTokens.ts
|
|
3089
|
-
var
|
|
3131
|
+
var import_kit35 = require("@solana/kit");
|
|
3090
3132
|
var REDEEM_AIRDROP_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
3091
3133
|
102,
|
|
3092
3134
|
70,
|
|
@@ -3098,13 +3140,13 @@ var REDEEM_AIRDROP_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
3098
3140
|
103
|
|
3099
3141
|
]);
|
|
3100
3142
|
function getRedeemAirdropTokensDiscriminatorBytes() {
|
|
3101
|
-
return (0,
|
|
3143
|
+
return (0, import_kit35.fixEncoderSize)((0, import_kit35.getBytesEncoder)(), 8).encode(
|
|
3102
3144
|
REDEEM_AIRDROP_TOKENS_DISCRIMINATOR
|
|
3103
3145
|
);
|
|
3104
3146
|
}
|
|
3105
3147
|
function getRedeemAirdropTokensInstructionDataEncoder() {
|
|
3106
|
-
return (0,
|
|
3107
|
-
(0,
|
|
3148
|
+
return (0, import_kit35.transformEncoder)(
|
|
3149
|
+
(0, import_kit35.getStructEncoder)([["discriminator", (0, import_kit35.fixEncoderSize)((0, import_kit35.getBytesEncoder)(), 8)]]),
|
|
3108
3150
|
(value) => ({
|
|
3109
3151
|
...value,
|
|
3110
3152
|
discriminator: REDEEM_AIRDROP_TOKENS_DISCRIMINATOR
|
|
@@ -3112,12 +3154,12 @@ function getRedeemAirdropTokensInstructionDataEncoder() {
|
|
|
3112
3154
|
);
|
|
3113
3155
|
}
|
|
3114
3156
|
function getRedeemAirdropTokensInstructionDataDecoder() {
|
|
3115
|
-
return (0,
|
|
3116
|
-
["discriminator", (0,
|
|
3157
|
+
return (0, import_kit35.getStructDecoder)([
|
|
3158
|
+
["discriminator", (0, import_kit35.fixDecoderSize)((0, import_kit35.getBytesDecoder)(), 8)]
|
|
3117
3159
|
]);
|
|
3118
3160
|
}
|
|
3119
3161
|
function getRedeemAirdropTokensInstructionDataCodec() {
|
|
3120
|
-
return (0,
|
|
3162
|
+
return (0, import_kit35.combineCodec)(
|
|
3121
3163
|
getRedeemAirdropTokensInstructionDataEncoder(),
|
|
3122
3164
|
getRedeemAirdropTokensInstructionDataDecoder()
|
|
3123
3165
|
);
|
|
@@ -3128,11 +3170,7 @@ async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
|
3128
3170
|
master: { value: input.master ?? null, isWritable: false },
|
|
3129
3171
|
config: { value: input.config ?? null, isWritable: false },
|
|
3130
3172
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
3131
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
3132
|
-
airdropMasterAuthority: {
|
|
3133
|
-
value: input.airdropMasterAuthority ?? null,
|
|
3134
|
-
isWritable: false
|
|
3135
|
-
},
|
|
3173
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
3136
3174
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
3137
3175
|
sourceTokenAccount: {
|
|
3138
3176
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -3154,18 +3192,18 @@ async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
|
3154
3192
|
};
|
|
3155
3193
|
const accounts = originalAccounts;
|
|
3156
3194
|
if (!accounts.master.value) {
|
|
3157
|
-
accounts.master.value = await (0,
|
|
3195
|
+
accounts.master.value = await (0, import_kit35.getProgramDerivedAddress)({
|
|
3158
3196
|
programAddress,
|
|
3159
3197
|
seeds: [
|
|
3160
|
-
(0,
|
|
3198
|
+
(0, import_kit35.getBytesEncoder)().encode(new Uint8Array([109, 97, 115, 116, 101, 114]))
|
|
3161
3199
|
]
|
|
3162
3200
|
});
|
|
3163
3201
|
}
|
|
3164
3202
|
if (!accounts.config.value) {
|
|
3165
|
-
accounts.config.value = await (0,
|
|
3203
|
+
accounts.config.value = await (0, import_kit35.getProgramDerivedAddress)({
|
|
3166
3204
|
programAddress,
|
|
3167
3205
|
seeds: [
|
|
3168
|
-
(0,
|
|
3206
|
+
(0, import_kit35.getBytesEncoder)().encode(
|
|
3169
3207
|
new Uint8Array([
|
|
3170
3208
|
97,
|
|
3171
3209
|
105,
|
|
@@ -3186,43 +3224,15 @@ async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
|
3186
3224
|
]
|
|
3187
3225
|
});
|
|
3188
3226
|
}
|
|
3189
|
-
if (!accounts.airdropMaster.value) {
|
|
3190
|
-
accounts.airdropMaster.value = await (0, import_kit32.getProgramDerivedAddress)({
|
|
3191
|
-
programAddress,
|
|
3192
|
-
seeds: [
|
|
3193
|
-
(0, import_kit32.getBytesEncoder)().encode(
|
|
3194
|
-
new Uint8Array([
|
|
3195
|
-
97,
|
|
3196
|
-
105,
|
|
3197
|
-
114,
|
|
3198
|
-
100,
|
|
3199
|
-
114,
|
|
3200
|
-
111,
|
|
3201
|
-
112,
|
|
3202
|
-
95,
|
|
3203
|
-
109,
|
|
3204
|
-
97,
|
|
3205
|
-
115,
|
|
3206
|
-
116,
|
|
3207
|
-
101,
|
|
3208
|
-
114
|
|
3209
|
-
])
|
|
3210
|
-
),
|
|
3211
|
-
(0, import_kit32.getAddressEncoder)().encode(
|
|
3212
|
-
expectAddress(accounts.airdropMasterAuthority.value)
|
|
3213
|
-
)
|
|
3214
|
-
]
|
|
3215
|
-
});
|
|
3216
|
-
}
|
|
3217
3227
|
if (!accounts.airdrop.value) {
|
|
3218
|
-
accounts.airdrop.value = await (0,
|
|
3228
|
+
accounts.airdrop.value = await (0, import_kit35.getProgramDerivedAddress)({
|
|
3219
3229
|
programAddress,
|
|
3220
3230
|
seeds: [
|
|
3221
|
-
(0,
|
|
3231
|
+
(0, import_kit35.getBytesEncoder)().encode(
|
|
3222
3232
|
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
3223
3233
|
),
|
|
3224
|
-
(0,
|
|
3225
|
-
(0,
|
|
3234
|
+
(0, import_kit35.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
3235
|
+
(0, import_kit35.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
3226
3236
|
]
|
|
3227
3237
|
});
|
|
3228
3238
|
}
|
|
@@ -3230,12 +3240,12 @@ async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
|
3230
3240
|
accounts.tokenProgram.value = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
|
3231
3241
|
}
|
|
3232
3242
|
if (!accounts.destinationTokenAccount.value) {
|
|
3233
|
-
accounts.destinationTokenAccount.value = await (0,
|
|
3243
|
+
accounts.destinationTokenAccount.value = await (0, import_kit35.getProgramDerivedAddress)({
|
|
3234
3244
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
3235
3245
|
seeds: [
|
|
3236
|
-
(0,
|
|
3237
|
-
(0,
|
|
3238
|
-
(0,
|
|
3246
|
+
(0, import_kit35.getAddressEncoder)().encode(expectAddress(accounts.airdrop.value)),
|
|
3247
|
+
(0, import_kit35.getAddressEncoder)().encode(expectAddress(accounts.tokenProgram.value)),
|
|
3248
|
+
(0, import_kit35.getAddressEncoder)().encode(expectAddress(accounts.mint.value))
|
|
3239
3249
|
]
|
|
3240
3250
|
});
|
|
3241
3251
|
}
|
|
@@ -3252,7 +3262,6 @@ async function getRedeemAirdropTokensInstructionAsync(input, config) {
|
|
|
3252
3262
|
getAccountMeta(accounts.config),
|
|
3253
3263
|
getAccountMeta(accounts.treasury),
|
|
3254
3264
|
getAccountMeta(accounts.airdropMaster),
|
|
3255
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
3256
3265
|
getAccountMeta(accounts.affiliate),
|
|
3257
3266
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
3258
3267
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -3273,11 +3282,7 @@ function getRedeemAirdropTokensInstruction(input, config) {
|
|
|
3273
3282
|
master: { value: input.master ?? null, isWritable: false },
|
|
3274
3283
|
config: { value: input.config ?? null, isWritable: false },
|
|
3275
3284
|
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
3276
|
-
airdropMaster: { value: input.airdropMaster ?? null, isWritable:
|
|
3277
|
-
airdropMasterAuthority: {
|
|
3278
|
-
value: input.airdropMasterAuthority ?? null,
|
|
3279
|
-
isWritable: false
|
|
3280
|
-
},
|
|
3285
|
+
airdropMaster: { value: input.airdropMaster ?? null, isWritable: true },
|
|
3281
3286
|
affiliate: { value: input.affiliate ?? null, isWritable: true },
|
|
3282
3287
|
sourceTokenAccount: {
|
|
3283
3288
|
value: input.sourceTokenAccount ?? null,
|
|
@@ -3314,7 +3319,6 @@ function getRedeemAirdropTokensInstruction(input, config) {
|
|
|
3314
3319
|
getAccountMeta(accounts.config),
|
|
3315
3320
|
getAccountMeta(accounts.treasury),
|
|
3316
3321
|
getAccountMeta(accounts.airdropMaster),
|
|
3317
|
-
getAccountMeta(accounts.airdropMasterAuthority),
|
|
3318
3322
|
getAccountMeta(accounts.affiliate),
|
|
3319
3323
|
getAccountMeta(accounts.sourceTokenAccount),
|
|
3320
3324
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
@@ -3330,7 +3334,7 @@ function getRedeemAirdropTokensInstruction(input, config) {
|
|
|
3330
3334
|
});
|
|
3331
3335
|
}
|
|
3332
3336
|
function parseRedeemAirdropTokensInstruction(instruction) {
|
|
3333
|
-
if (instruction.accounts.length <
|
|
3337
|
+
if (instruction.accounts.length < 13) {
|
|
3334
3338
|
throw new Error("Not enough accounts");
|
|
3335
3339
|
}
|
|
3336
3340
|
let accountIndex = 0;
|
|
@@ -3350,7 +3354,6 @@ function parseRedeemAirdropTokensInstruction(instruction) {
|
|
|
3350
3354
|
config: getNextAccount(),
|
|
3351
3355
|
treasury: getNextAccount(),
|
|
3352
3356
|
airdropMaster: getNextAccount(),
|
|
3353
|
-
airdropMasterAuthority: getNextAccount(),
|
|
3354
3357
|
affiliate: getNextOptionalAccount(),
|
|
3355
3358
|
sourceTokenAccount: getNextAccount(),
|
|
3356
3359
|
destinationTokenAccount: getNextAccount(),
|
|
@@ -3366,77 +3369,6 @@ function parseRedeemAirdropTokensInstruction(instruction) {
|
|
|
3366
3369
|
)
|
|
3367
3370
|
};
|
|
3368
3371
|
}
|
|
3369
|
-
|
|
3370
|
-
// src/utils/derive.ts
|
|
3371
|
-
var import_kit34 = require("@solana/kit");
|
|
3372
|
-
|
|
3373
|
-
// src/constants/index.ts
|
|
3374
|
-
var import_kit33 = require("@solana/kit");
|
|
3375
|
-
var DROPSY_MASTER_SEED = "master";
|
|
3376
|
-
var AIRDROP_CONFIG_SEED = "airdrop_config";
|
|
3377
|
-
var AFFILIATE_MASTER_SEED = "affiliate_master";
|
|
3378
|
-
var AIRDROP_MASTER_SEED = "airdrop_master";
|
|
3379
|
-
var AIRDROP_SEED = "airdrop";
|
|
3380
|
-
var AFFILIATE_SEED = "affiliate";
|
|
3381
|
-
var BITMAP_SEED = "bitmap";
|
|
3382
|
-
var VESTING_SEED = "vesting";
|
|
3383
|
-
var PRESALE_SEED = "presale";
|
|
3384
|
-
var VAULT_SEED = "vault";
|
|
3385
|
-
var ADMIN = (0, import_kit33.address)("8mtUD2XrkNnTxnjCehZ4DEtTXeGR1yrepSEGhCaSj2kT");
|
|
3386
|
-
var BITMAP_SIZE = 8e3;
|
|
3387
|
-
var MAX_BITMAP_CLAIM = BITMAP_SIZE * 8;
|
|
3388
|
-
var VERSION_BASIC = 0;
|
|
3389
|
-
var VERSION_VESTED = 1;
|
|
3390
|
-
var STATE_INITIALIZED = 0;
|
|
3391
|
-
var STATE_DELEGATED = 1;
|
|
3392
|
-
var STATE_REDEEMED = 2;
|
|
3393
|
-
var MUTABLE_NONE = 0;
|
|
3394
|
-
|
|
3395
|
-
// src/utils/derive.ts
|
|
3396
|
-
async function getDropsyDerivedAddress(seeds) {
|
|
3397
|
-
return await (0, import_kit34.getProgramDerivedAddress)({
|
|
3398
|
-
seeds,
|
|
3399
|
-
programAddress: DROPSY_PROGRAM_ADDRESS
|
|
3400
|
-
});
|
|
3401
|
-
}
|
|
3402
|
-
async function getMasterDerivedAddress() {
|
|
3403
|
-
return await getDropsyDerivedAddress([DROPSY_MASTER_SEED]);
|
|
3404
|
-
}
|
|
3405
|
-
async function getAirdropConfigDerivedAddress() {
|
|
3406
|
-
return await getDropsyDerivedAddress([AIRDROP_CONFIG_SEED]);
|
|
3407
|
-
}
|
|
3408
|
-
async function getAirdropMasterDerivedAddress(authority) {
|
|
3409
|
-
const seeds = [
|
|
3410
|
-
AIRDROP_MASTER_SEED,
|
|
3411
|
-
(0, import_kit34.getAddressEncoder)().encode(authority)
|
|
3412
|
-
];
|
|
3413
|
-
return await getDropsyDerivedAddress(seeds);
|
|
3414
|
-
}
|
|
3415
|
-
async function getAffiliateDerivedAddress(authority) {
|
|
3416
|
-
const seeds = [
|
|
3417
|
-
AFFILIATE_SEED,
|
|
3418
|
-
(0, import_kit34.getAddressEncoder)().encode(authority)
|
|
3419
|
-
];
|
|
3420
|
-
return await getDropsyDerivedAddress(seeds);
|
|
3421
|
-
}
|
|
3422
|
-
async function getAirdropDerivedAddress(authority, mint) {
|
|
3423
|
-
const seeds = [
|
|
3424
|
-
AIRDROP_SEED,
|
|
3425
|
-
(0, import_kit34.getAddressEncoder)().encode(mint),
|
|
3426
|
-
(0, import_kit34.getAddressEncoder)().encode(authority)
|
|
3427
|
-
];
|
|
3428
|
-
return await getDropsyDerivedAddress(seeds);
|
|
3429
|
-
}
|
|
3430
|
-
async function getClaimMapDerivedAddress(airdrop, id) {
|
|
3431
|
-
const idBuffer = Buffer.alloc(2);
|
|
3432
|
-
idBuffer.writeUInt16LE(id);
|
|
3433
|
-
const seeds = [
|
|
3434
|
-
BITMAP_SEED,
|
|
3435
|
-
(0, import_kit34.getAddressEncoder)().encode(airdrop),
|
|
3436
|
-
idBuffer
|
|
3437
|
-
];
|
|
3438
|
-
return await getDropsyDerivedAddress(seeds);
|
|
3439
|
-
}
|
|
3440
3372
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3441
3373
|
0 && (module.exports = {
|
|
3442
3374
|
ADMIN,
|
|
@@ -3456,6 +3388,8 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3456
3388
|
CLAIM_MAP_DISCRIMINATOR,
|
|
3457
3389
|
CREATE_AIRDROP_DISCRIMINATOR,
|
|
3458
3390
|
CREATE_CLAIM_MAP_DISCRIMINATOR,
|
|
3391
|
+
DEFAULT_MASTER_PDA,
|
|
3392
|
+
DEFAULT_MASTER_PDA_AUTHORITY,
|
|
3459
3393
|
DEPOSIT_TOKENS_DISCRIMINATOR,
|
|
3460
3394
|
DROPSY_ERROR__ACTIVE_BITMAPS_EXIST,
|
|
3461
3395
|
DROPSY_ERROR__AIRDROP_ENDED,
|
|
@@ -3534,6 +3468,7 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3534
3468
|
DROPSY_ERROR__VESTING_ACCOUNT_REQUIRED,
|
|
3535
3469
|
DROPSY_MASTER_SEED,
|
|
3536
3470
|
DROPSY_PROGRAM_ADDRESS,
|
|
3471
|
+
DROPSY_TREASURY,
|
|
3537
3472
|
DropsyAccount,
|
|
3538
3473
|
DropsyInstruction,
|
|
3539
3474
|
INITIALIZE_AIRDROP_MASTER_DISCRIMINATOR,
|
|
@@ -3550,6 +3485,10 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3550
3485
|
VERSION_BASIC,
|
|
3551
3486
|
VERSION_VESTED,
|
|
3552
3487
|
VESTING_SEED,
|
|
3488
|
+
createDefaultSolanaClient,
|
|
3489
|
+
createMerkleTree,
|
|
3490
|
+
createTransactionMessageFromInstructions,
|
|
3491
|
+
createWLMerkleTree,
|
|
3553
3492
|
decodeAffiliate,
|
|
3554
3493
|
decodeAffiliateMaster,
|
|
3555
3494
|
decodeAirdrop,
|
|
@@ -3585,6 +3524,7 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3585
3524
|
fetchMaybeAirdropMaster,
|
|
3586
3525
|
fetchMaybeClaimMap,
|
|
3587
3526
|
fetchMaybeMaster,
|
|
3527
|
+
generateKeyPairSignerWithSol,
|
|
3588
3528
|
getAdvancedFeeConfigCodec,
|
|
3589
3529
|
getAdvancedFeeConfigDecoder,
|
|
3590
3530
|
getAdvancedFeeConfigEncoder,
|
|
@@ -3672,6 +3612,7 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3672
3612
|
getCreateClaimMapInstructionDataCodec,
|
|
3673
3613
|
getCreateClaimMapInstructionDataDecoder,
|
|
3674
3614
|
getCreateClaimMapInstructionDataEncoder,
|
|
3615
|
+
getCreateClaimMapV0Instruction,
|
|
3675
3616
|
getDepositTokensDiscriminatorBytes,
|
|
3676
3617
|
getDepositTokensInstruction,
|
|
3677
3618
|
getDepositTokensInstructionAsync,
|
|
@@ -3704,12 +3645,14 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3704
3645
|
getMasterInitializedDecoder,
|
|
3705
3646
|
getMasterInitializedEncoder,
|
|
3706
3647
|
getMasterSize,
|
|
3648
|
+
getMerkleRootArray,
|
|
3707
3649
|
getRedeemAirdropTokensDiscriminatorBytes,
|
|
3708
3650
|
getRedeemAirdropTokensInstruction,
|
|
3709
3651
|
getRedeemAirdropTokensInstructionAsync,
|
|
3710
3652
|
getRedeemAirdropTokensInstructionDataCodec,
|
|
3711
3653
|
getRedeemAirdropTokensInstructionDataDecoder,
|
|
3712
3654
|
getRedeemAirdropTokensInstructionDataEncoder,
|
|
3655
|
+
getSimpleMerkleProof,
|
|
3713
3656
|
getTokensDepositedCodec,
|
|
3714
3657
|
getTokensDepositedDecoder,
|
|
3715
3658
|
getTokensDepositedEncoder,
|
|
@@ -3725,6 +3668,7 @@ async function getClaimMapDerivedAddress(airdrop, id) {
|
|
|
3725
3668
|
parseDepositTokensInstruction,
|
|
3726
3669
|
parseInitializeAirdropMasterInstruction,
|
|
3727
3670
|
parseInitializeMasterInstruction,
|
|
3728
|
-
parseRedeemAirdropTokensInstruction
|
|
3671
|
+
parseRedeemAirdropTokensInstruction,
|
|
3672
|
+
toUnixTimestamp
|
|
3729
3673
|
});
|
|
3730
3674
|
//# sourceMappingURL=index.js.map
|