@dropsy/airdrop 0.0.1
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 +890 -0
- package/dist/index.d.ts +890 -0
- package/dist/index.js +1916 -0
- package/dist/index.mjs +1961 -0
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +50 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1640 -0
- package/docs/functions/add.html +1 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +13 -0
- package/docs/modules.html +1 -0
- package/index.ts +0 -0
- package/new/index.js +2 -0
- package/new/node_modules/.package-lock.json +14 -0
- package/new/node_modules/@dropsy/easypublish/dist/index.d.mts +3 -0
- package/new/node_modules/@dropsy/easypublish/dist/index.d.ts +3 -0
- package/new/node_modules/@dropsy/easypublish/dist/index.js +32 -0
- package/new/node_modules/@dropsy/easypublish/dist/index.mjs +7 -0
- package/new/node_modules/@dropsy/easypublish/package.json +25 -0
- package/new/node_modules/@dropsy/easypublish/readme.md +21 -0
- package/new/node_modules/@dropsy/easypublish/tsup.config.ts +10 -0
- package/new/package-lock.json +22 -0
- package/new/package.json +16 -0
- package/package.json +37 -0
- package/readme.md +21 -0
- package/tsup.config.ts +10 -0
- package/typedoc.json +5 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1916 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
var __async = (__this, __arguments, generator) => {
|
|
37
|
+
return new Promise((resolve, reject) => {
|
|
38
|
+
var fulfilled = (value) => {
|
|
39
|
+
try {
|
|
40
|
+
step(generator.next(value));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var rejected = (value) => {
|
|
46
|
+
try {
|
|
47
|
+
step(generator.throw(value));
|
|
48
|
+
} catch (e) {
|
|
49
|
+
reject(e);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
53
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// src/index.ts
|
|
58
|
+
var index_exports = {};
|
|
59
|
+
__export(index_exports, {
|
|
60
|
+
AIRDROP_DISCRIMINATOR: () => AIRDROP_DISCRIMINATOR,
|
|
61
|
+
BITMAP_ACCOUNT_DISCRIMINATOR: () => BITMAP_ACCOUNT_DISCRIMINATOR,
|
|
62
|
+
CLAIM_TOKENS_DISCRIMINATOR: () => CLAIM_TOKENS_DISCRIMINATOR,
|
|
63
|
+
CLOSE_AIRDROP_DISCRIMINATOR: () => CLOSE_AIRDROP_DISCRIMINATOR,
|
|
64
|
+
CLOSE_BITMAP_DISCRIMINATOR: () => CLOSE_BITMAP_DISCRIMINATOR,
|
|
65
|
+
CONTROLLER_DISCRIMINATOR: () => CONTROLLER_DISCRIMINATOR,
|
|
66
|
+
DEPOSIT_TOKENS_DISCRIMINATOR: () => DEPOSIT_TOKENS_DISCRIMINATOR,
|
|
67
|
+
DROPSY_ERROR__ACTIVE_BITMAPS_EXIST: () => DROPSY_ERROR__ACTIVE_BITMAPS_EXIST,
|
|
68
|
+
DROPSY_ERROR__AIRDROP_ENDED: () => DROPSY_ERROR__AIRDROP_ENDED,
|
|
69
|
+
DROPSY_ERROR__AIRDROP_NOT_ENDED: () => DROPSY_ERROR__AIRDROP_NOT_ENDED,
|
|
70
|
+
DROPSY_ERROR__AIRDROP_NOT_STARTED: () => DROPSY_ERROR__AIRDROP_NOT_STARTED,
|
|
71
|
+
DROPSY_ERROR__ALREADY_CLAIMED: () => DROPSY_ERROR__ALREADY_CLAIMED,
|
|
72
|
+
DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH: () => DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH,
|
|
73
|
+
DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW: () => DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW,
|
|
74
|
+
DROPSY_ERROR__BITMAP_TOO_LARGE: () => DROPSY_ERROR__BITMAP_TOO_LARGE,
|
|
75
|
+
DROPSY_ERROR__CLAIM_FEE_TOO_HIGH: () => DROPSY_ERROR__CLAIM_FEE_TOO_HIGH,
|
|
76
|
+
DROPSY_ERROR__CONTROLLER_MISMATCH: () => DROPSY_ERROR__CONTROLLER_MISMATCH,
|
|
77
|
+
DROPSY_ERROR__CREATE_FEE_TOO_HIGH: () => DROPSY_ERROR__CREATE_FEE_TOO_HIGH,
|
|
78
|
+
DROPSY_ERROR__DESTINATION_MINT_MISMATCH: () => DROPSY_ERROR__DESTINATION_MINT_MISMATCH,
|
|
79
|
+
DROPSY_ERROR__DURATION_TOO_SHORT: () => DROPSY_ERROR__DURATION_TOO_SHORT,
|
|
80
|
+
DROPSY_ERROR__INSUFFICIENT_DEPOSIT: () => DROPSY_ERROR__INSUFFICIENT_DEPOSIT,
|
|
81
|
+
DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE: () => DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE,
|
|
82
|
+
DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS: () => DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS,
|
|
83
|
+
DROPSY_ERROR__INVALID_AIRDROP_PDA: () => DROPSY_ERROR__INVALID_AIRDROP_PDA,
|
|
84
|
+
DROPSY_ERROR__INVALID_AMOUNT: () => DROPSY_ERROR__INVALID_AMOUNT,
|
|
85
|
+
DROPSY_ERROR__INVALID_BITMAP_ACCOUNT: () => DROPSY_ERROR__INVALID_BITMAP_ACCOUNT,
|
|
86
|
+
DROPSY_ERROR__INVALID_BITMAP_INDEX: () => DROPSY_ERROR__INVALID_BITMAP_INDEX,
|
|
87
|
+
DROPSY_ERROR__INVALID_DESTINATION_OWNER: () => DROPSY_ERROR__INVALID_DESTINATION_OWNER,
|
|
88
|
+
DROPSY_ERROR__INVALID_END_TIME: () => DROPSY_ERROR__INVALID_END_TIME,
|
|
89
|
+
DROPSY_ERROR__INVALID_FEE_VAULT: () => DROPSY_ERROR__INVALID_FEE_VAULT,
|
|
90
|
+
DROPSY_ERROR__INVALID_FEE_VAULT_CURVE: () => DROPSY_ERROR__INVALID_FEE_VAULT_CURVE,
|
|
91
|
+
DROPSY_ERROR__INVALID_FEE_VAULT_OWNER: () => DROPSY_ERROR__INVALID_FEE_VAULT_OWNER,
|
|
92
|
+
DROPSY_ERROR__INVALID_MINT: () => DROPSY_ERROR__INVALID_MINT,
|
|
93
|
+
DROPSY_ERROR__INVALID_MINT_OWNER: () => DROPSY_ERROR__INVALID_MINT_OWNER,
|
|
94
|
+
DROPSY_ERROR__INVALID_OWNER: () => DROPSY_ERROR__INVALID_OWNER,
|
|
95
|
+
DROPSY_ERROR__INVALID_PDA: () => DROPSY_ERROR__INVALID_PDA,
|
|
96
|
+
DROPSY_ERROR__INVALID_PROOF: () => DROPSY_ERROR__INVALID_PROOF,
|
|
97
|
+
DROPSY_ERROR__INVALID_TOTAL: () => DROPSY_ERROR__INVALID_TOTAL,
|
|
98
|
+
DROPSY_ERROR__INVALID_TREASURY_ACCOUNT: () => DROPSY_ERROR__INVALID_TREASURY_ACCOUNT,
|
|
99
|
+
DROPSY_ERROR__INVALID_VAULT_AUTHORITY: () => DROPSY_ERROR__INVALID_VAULT_AUTHORITY,
|
|
100
|
+
DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY: () => DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY,
|
|
101
|
+
DROPSY_ERROR__MINT_IS_FROZEN: () => DROPSY_ERROR__MINT_IS_FROZEN,
|
|
102
|
+
DROPSY_ERROR__MINT_IS_NOT_INITIALIZED: () => DROPSY_ERROR__MINT_IS_NOT_INITIALIZED,
|
|
103
|
+
DROPSY_ERROR__MINT_MISMATCH: () => DROPSY_ERROR__MINT_MISMATCH,
|
|
104
|
+
DROPSY_ERROR__MISSING_BITMAP_PDA: () => DROPSY_ERROR__MISSING_BITMAP_PDA,
|
|
105
|
+
DROPSY_ERROR__NFT_NOT_ALLOWED: () => DROPSY_ERROR__NFT_NOT_ALLOWED,
|
|
106
|
+
DROPSY_ERROR__OVERFLOW: () => DROPSY_ERROR__OVERFLOW,
|
|
107
|
+
DROPSY_ERROR__OWNER_MISMATCH: () => DROPSY_ERROR__OWNER_MISMATCH,
|
|
108
|
+
DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN: () => DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN,
|
|
109
|
+
DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY: () => DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY,
|
|
110
|
+
DROPSY_ERROR__SOURCE_HAS_DELEGATE: () => DROPSY_ERROR__SOURCE_HAS_DELEGATE,
|
|
111
|
+
DROPSY_ERROR__TOO_MANY_BITMAPS: () => DROPSY_ERROR__TOO_MANY_BITMAPS,
|
|
112
|
+
DROPSY_ERROR__VAULT_FROZEN: () => DROPSY_ERROR__VAULT_FROZEN,
|
|
113
|
+
DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY: () => DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY,
|
|
114
|
+
DROPSY_ERROR__VAULT_HAS_DELEGATE: () => DROPSY_ERROR__VAULT_HAS_DELEGATE,
|
|
115
|
+
DROPSY_ERROR__VAULT_MINT_MISMATCH: () => DROPSY_ERROR__VAULT_MINT_MISMATCH,
|
|
116
|
+
DROPSY_ERROR__VAULT_NOT_INITIALIZED: () => DROPSY_ERROR__VAULT_NOT_INITIALIZED,
|
|
117
|
+
DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT: () => DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT,
|
|
118
|
+
DROPSY_PROGRAM_ADDRESS: () => DROPSY_PROGRAM_ADDRESS,
|
|
119
|
+
DropsyAccount: () => DropsyAccount,
|
|
120
|
+
DropsyInstruction: () => DropsyInstruction,
|
|
121
|
+
INITIALIZE_AIRDROP_DISCRIMINATOR: () => INITIALIZE_AIRDROP_DISCRIMINATOR,
|
|
122
|
+
INITIALIZE_BITMAP_DISCRIMINATOR: () => INITIALIZE_BITMAP_DISCRIMINATOR,
|
|
123
|
+
INITIALIZE_CONTROLLER_DISCRIMINATOR: () => INITIALIZE_CONTROLLER_DISCRIMINATOR,
|
|
124
|
+
decodeAirdrop: () => decodeAirdrop,
|
|
125
|
+
decodeBitmapAccount: () => decodeBitmapAccount,
|
|
126
|
+
decodeController: () => decodeController,
|
|
127
|
+
fetchAirdrop: () => fetchAirdrop,
|
|
128
|
+
fetchAllAirdrop: () => fetchAllAirdrop,
|
|
129
|
+
fetchAllBitmapAccount: () => fetchAllBitmapAccount,
|
|
130
|
+
fetchAllController: () => fetchAllController,
|
|
131
|
+
fetchAllMaybeAirdrop: () => fetchAllMaybeAirdrop,
|
|
132
|
+
fetchAllMaybeBitmapAccount: () => fetchAllMaybeBitmapAccount,
|
|
133
|
+
fetchAllMaybeController: () => fetchAllMaybeController,
|
|
134
|
+
fetchBitmapAccount: () => fetchBitmapAccount,
|
|
135
|
+
fetchController: () => fetchController,
|
|
136
|
+
fetchMaybeAirdrop: () => fetchMaybeAirdrop,
|
|
137
|
+
fetchMaybeBitmapAccount: () => fetchMaybeBitmapAccount,
|
|
138
|
+
fetchMaybeController: () => fetchMaybeController,
|
|
139
|
+
getAirdropClosedCodec: () => getAirdropClosedCodec,
|
|
140
|
+
getAirdropClosedDecoder: () => getAirdropClosedDecoder,
|
|
141
|
+
getAirdropClosedEncoder: () => getAirdropClosedEncoder,
|
|
142
|
+
getAirdropCodec: () => getAirdropCodec,
|
|
143
|
+
getAirdropDecoder: () => getAirdropDecoder,
|
|
144
|
+
getAirdropDiscriminatorBytes: () => getAirdropDiscriminatorBytes,
|
|
145
|
+
getAirdropEncoder: () => getAirdropEncoder,
|
|
146
|
+
getAirdropInitializedCodec: () => getAirdropInitializedCodec,
|
|
147
|
+
getAirdropInitializedDecoder: () => getAirdropInitializedDecoder,
|
|
148
|
+
getAirdropInitializedEncoder: () => getAirdropInitializedEncoder,
|
|
149
|
+
getBitmapAccountCodec: () => getBitmapAccountCodec,
|
|
150
|
+
getBitmapAccountDecoder: () => getBitmapAccountDecoder,
|
|
151
|
+
getBitmapAccountDiscriminatorBytes: () => getBitmapAccountDiscriminatorBytes,
|
|
152
|
+
getBitmapAccountEncoder: () => getBitmapAccountEncoder,
|
|
153
|
+
getBitmapClosedCodec: () => getBitmapClosedCodec,
|
|
154
|
+
getBitmapClosedDecoder: () => getBitmapClosedDecoder,
|
|
155
|
+
getBitmapClosedEncoder: () => getBitmapClosedEncoder,
|
|
156
|
+
getBitmapInitializedCodec: () => getBitmapInitializedCodec,
|
|
157
|
+
getBitmapInitializedDecoder: () => getBitmapInitializedDecoder,
|
|
158
|
+
getBitmapInitializedEncoder: () => getBitmapInitializedEncoder,
|
|
159
|
+
getClaimTokensDiscriminatorBytes: () => getClaimTokensDiscriminatorBytes,
|
|
160
|
+
getClaimTokensInstruction: () => getClaimTokensInstruction,
|
|
161
|
+
getClaimTokensInstructionDataCodec: () => getClaimTokensInstructionDataCodec,
|
|
162
|
+
getClaimTokensInstructionDataDecoder: () => getClaimTokensInstructionDataDecoder,
|
|
163
|
+
getClaimTokensInstructionDataEncoder: () => getClaimTokensInstructionDataEncoder,
|
|
164
|
+
getCloseAirdropDiscriminatorBytes: () => getCloseAirdropDiscriminatorBytes,
|
|
165
|
+
getCloseAirdropInstruction: () => getCloseAirdropInstruction,
|
|
166
|
+
getCloseAirdropInstructionDataCodec: () => getCloseAirdropInstructionDataCodec,
|
|
167
|
+
getCloseAirdropInstructionDataDecoder: () => getCloseAirdropInstructionDataDecoder,
|
|
168
|
+
getCloseAirdropInstructionDataEncoder: () => getCloseAirdropInstructionDataEncoder,
|
|
169
|
+
getCloseBitmapDiscriminatorBytes: () => getCloseBitmapDiscriminatorBytes,
|
|
170
|
+
getCloseBitmapInstruction: () => getCloseBitmapInstruction,
|
|
171
|
+
getCloseBitmapInstructionDataCodec: () => getCloseBitmapInstructionDataCodec,
|
|
172
|
+
getCloseBitmapInstructionDataDecoder: () => getCloseBitmapInstructionDataDecoder,
|
|
173
|
+
getCloseBitmapInstructionDataEncoder: () => getCloseBitmapInstructionDataEncoder,
|
|
174
|
+
getControllerCodec: () => getControllerCodec,
|
|
175
|
+
getControllerDecoder: () => getControllerDecoder,
|
|
176
|
+
getControllerDiscriminatorBytes: () => getControllerDiscriminatorBytes,
|
|
177
|
+
getControllerEncoder: () => getControllerEncoder,
|
|
178
|
+
getControllerInitializedCodec: () => getControllerInitializedCodec,
|
|
179
|
+
getControllerInitializedDecoder: () => getControllerInitializedDecoder,
|
|
180
|
+
getControllerInitializedEncoder: () => getControllerInitializedEncoder,
|
|
181
|
+
getDepositTokensDiscriminatorBytes: () => getDepositTokensDiscriminatorBytes,
|
|
182
|
+
getDepositTokensInstruction: () => getDepositTokensInstruction,
|
|
183
|
+
getDepositTokensInstructionDataCodec: () => getDepositTokensInstructionDataCodec,
|
|
184
|
+
getDepositTokensInstructionDataDecoder: () => getDepositTokensInstructionDataDecoder,
|
|
185
|
+
getDepositTokensInstructionDataEncoder: () => getDepositTokensInstructionDataEncoder,
|
|
186
|
+
getDropsyErrorMessage: () => getDropsyErrorMessage,
|
|
187
|
+
getInitializeAirdropDiscriminatorBytes: () => getInitializeAirdropDiscriminatorBytes,
|
|
188
|
+
getInitializeAirdropInstruction: () => getInitializeAirdropInstruction,
|
|
189
|
+
getInitializeAirdropInstructionAsync: () => getInitializeAirdropInstructionAsync,
|
|
190
|
+
getInitializeAirdropInstructionDataCodec: () => getInitializeAirdropInstructionDataCodec,
|
|
191
|
+
getInitializeAirdropInstructionDataDecoder: () => getInitializeAirdropInstructionDataDecoder,
|
|
192
|
+
getInitializeAirdropInstructionDataEncoder: () => getInitializeAirdropInstructionDataEncoder,
|
|
193
|
+
getInitializeBitmapDiscriminatorBytes: () => getInitializeBitmapDiscriminatorBytes,
|
|
194
|
+
getInitializeBitmapInstruction: () => getInitializeBitmapInstruction,
|
|
195
|
+
getInitializeBitmapInstructionAsync: () => getInitializeBitmapInstructionAsync,
|
|
196
|
+
getInitializeBitmapInstructionDataCodec: () => getInitializeBitmapInstructionDataCodec,
|
|
197
|
+
getInitializeBitmapInstructionDataDecoder: () => getInitializeBitmapInstructionDataDecoder,
|
|
198
|
+
getInitializeBitmapInstructionDataEncoder: () => getInitializeBitmapInstructionDataEncoder,
|
|
199
|
+
getInitializeControllerDiscriminatorBytes: () => getInitializeControllerDiscriminatorBytes,
|
|
200
|
+
getInitializeControllerInstruction: () => getInitializeControllerInstruction,
|
|
201
|
+
getInitializeControllerInstructionAsync: () => getInitializeControllerInstructionAsync,
|
|
202
|
+
getInitializeControllerInstructionDataCodec: () => getInitializeControllerInstructionDataCodec,
|
|
203
|
+
getInitializeControllerInstructionDataDecoder: () => getInitializeControllerInstructionDataDecoder,
|
|
204
|
+
getInitializeControllerInstructionDataEncoder: () => getInitializeControllerInstructionDataEncoder,
|
|
205
|
+
getTokensDepositedCodec: () => getTokensDepositedCodec,
|
|
206
|
+
getTokensDepositedDecoder: () => getTokensDepositedDecoder,
|
|
207
|
+
getTokensDepositedEncoder: () => getTokensDepositedEncoder,
|
|
208
|
+
identifyDropsyAccount: () => identifyDropsyAccount,
|
|
209
|
+
identifyDropsyInstruction: () => identifyDropsyInstruction,
|
|
210
|
+
isDropsyError: () => isDropsyError,
|
|
211
|
+
parseClaimTokensInstruction: () => parseClaimTokensInstruction,
|
|
212
|
+
parseCloseAirdropInstruction: () => parseCloseAirdropInstruction,
|
|
213
|
+
parseCloseBitmapInstruction: () => parseCloseBitmapInstruction,
|
|
214
|
+
parseDepositTokensInstruction: () => parseDepositTokensInstruction,
|
|
215
|
+
parseInitializeAirdropInstruction: () => parseInitializeAirdropInstruction,
|
|
216
|
+
parseInitializeBitmapInstruction: () => parseInitializeBitmapInstruction,
|
|
217
|
+
parseInitializeControllerInstruction: () => parseInitializeControllerInstruction
|
|
218
|
+
});
|
|
219
|
+
module.exports = __toCommonJS(index_exports);
|
|
220
|
+
|
|
221
|
+
// src/accounts/airdrop.ts
|
|
222
|
+
var import_kit = require("@solana/kit");
|
|
223
|
+
var AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
224
|
+
31,
|
|
225
|
+
112,
|
|
226
|
+
159,
|
|
227
|
+
158,
|
|
228
|
+
124,
|
|
229
|
+
237,
|
|
230
|
+
9,
|
|
231
|
+
241
|
|
232
|
+
]);
|
|
233
|
+
function getAirdropDiscriminatorBytes() {
|
|
234
|
+
return (0, import_kit.fixEncoderSize)((0, import_kit.getBytesEncoder)(), 8).encode(AIRDROP_DISCRIMINATOR);
|
|
235
|
+
}
|
|
236
|
+
function getAirdropEncoder() {
|
|
237
|
+
return (0, import_kit.transformEncoder)(
|
|
238
|
+
(0, import_kit.getStructEncoder)([
|
|
239
|
+
["discriminator", (0, import_kit.fixEncoderSize)((0, import_kit.getBytesEncoder)(), 8)],
|
|
240
|
+
["id", (0, import_kit.getU64Encoder)()],
|
|
241
|
+
["mint", (0, import_kit.getAddressEncoder)()],
|
|
242
|
+
["owner", (0, import_kit.getAddressEncoder)()],
|
|
243
|
+
["controller", (0, import_kit.getAddressEncoder)()],
|
|
244
|
+
["supply", (0, import_kit.getU64Encoder)()],
|
|
245
|
+
["merkleRoot", (0, import_kit.getArrayEncoder)((0, import_kit.getU8Encoder)(), { size: 32 })],
|
|
246
|
+
["startsAt", (0, import_kit.getI64Encoder)()],
|
|
247
|
+
["endsAt", (0, import_kit.getI64Encoder)()],
|
|
248
|
+
["bitmapCount", (0, import_kit.getU8Encoder)()],
|
|
249
|
+
["version", (0, import_kit.getU8Encoder)()],
|
|
250
|
+
["bump", (0, import_kit.getU8Encoder)()]
|
|
251
|
+
]),
|
|
252
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: AIRDROP_DISCRIMINATOR })
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
function getAirdropDecoder() {
|
|
256
|
+
return (0, import_kit.getStructDecoder)([
|
|
257
|
+
["discriminator", (0, import_kit.fixDecoderSize)((0, import_kit.getBytesDecoder)(), 8)],
|
|
258
|
+
["id", (0, import_kit.getU64Decoder)()],
|
|
259
|
+
["mint", (0, import_kit.getAddressDecoder)()],
|
|
260
|
+
["owner", (0, import_kit.getAddressDecoder)()],
|
|
261
|
+
["controller", (0, import_kit.getAddressDecoder)()],
|
|
262
|
+
["supply", (0, import_kit.getU64Decoder)()],
|
|
263
|
+
["merkleRoot", (0, import_kit.getArrayDecoder)((0, import_kit.getU8Decoder)(), { size: 32 })],
|
|
264
|
+
["startsAt", (0, import_kit.getI64Decoder)()],
|
|
265
|
+
["endsAt", (0, import_kit.getI64Decoder)()],
|
|
266
|
+
["bitmapCount", (0, import_kit.getU8Decoder)()],
|
|
267
|
+
["version", (0, import_kit.getU8Decoder)()],
|
|
268
|
+
["bump", (0, import_kit.getU8Decoder)()]
|
|
269
|
+
]);
|
|
270
|
+
}
|
|
271
|
+
function getAirdropCodec() {
|
|
272
|
+
return (0, import_kit.combineCodec)(getAirdropEncoder(), getAirdropDecoder());
|
|
273
|
+
}
|
|
274
|
+
function decodeAirdrop(encodedAccount) {
|
|
275
|
+
return (0, import_kit.decodeAccount)(
|
|
276
|
+
encodedAccount,
|
|
277
|
+
getAirdropDecoder()
|
|
278
|
+
);
|
|
279
|
+
}
|
|
280
|
+
function fetchAirdrop(rpc, address, config) {
|
|
281
|
+
return __async(this, null, function* () {
|
|
282
|
+
const maybeAccount = yield fetchMaybeAirdrop(rpc, address, config);
|
|
283
|
+
(0, import_kit.assertAccountExists)(maybeAccount);
|
|
284
|
+
return maybeAccount;
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
function fetchMaybeAirdrop(rpc, address, config) {
|
|
288
|
+
return __async(this, null, function* () {
|
|
289
|
+
const maybeAccount = yield (0, import_kit.fetchEncodedAccount)(rpc, address, config);
|
|
290
|
+
return decodeAirdrop(maybeAccount);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
function fetchAllAirdrop(rpc, addresses, config) {
|
|
294
|
+
return __async(this, null, function* () {
|
|
295
|
+
const maybeAccounts = yield fetchAllMaybeAirdrop(rpc, addresses, config);
|
|
296
|
+
(0, import_kit.assertAccountsExist)(maybeAccounts);
|
|
297
|
+
return maybeAccounts;
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
301
|
+
return __async(this, null, function* () {
|
|
302
|
+
const maybeAccounts = yield (0, import_kit.fetchEncodedAccounts)(rpc, addresses, config);
|
|
303
|
+
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
// src/accounts/bitmapAccount.ts
|
|
308
|
+
var import_kit2 = require("@solana/kit");
|
|
309
|
+
var BITMAP_ACCOUNT_DISCRIMINATOR = new Uint8Array([
|
|
310
|
+
152,
|
|
311
|
+
161,
|
|
312
|
+
147,
|
|
313
|
+
85,
|
|
314
|
+
213,
|
|
315
|
+
38,
|
|
316
|
+
59,
|
|
317
|
+
48
|
|
318
|
+
]);
|
|
319
|
+
function getBitmapAccountDiscriminatorBytes() {
|
|
320
|
+
return (0, import_kit2.fixEncoderSize)((0, import_kit2.getBytesEncoder)(), 8).encode(
|
|
321
|
+
BITMAP_ACCOUNT_DISCRIMINATOR
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
function getBitmapAccountEncoder() {
|
|
325
|
+
return (0, import_kit2.transformEncoder)(
|
|
326
|
+
(0, import_kit2.getStructEncoder)([
|
|
327
|
+
["discriminator", (0, import_kit2.fixEncoderSize)((0, import_kit2.getBytesEncoder)(), 8)],
|
|
328
|
+
["owner", (0, import_kit2.getAddressEncoder)()],
|
|
329
|
+
["airdrop", (0, import_kit2.getAddressEncoder)()],
|
|
330
|
+
[
|
|
331
|
+
"claimedBitmap",
|
|
332
|
+
(0, import_kit2.addEncoderSizePrefix)((0, import_kit2.getBytesEncoder)(), (0, import_kit2.getU32Encoder)())
|
|
333
|
+
],
|
|
334
|
+
["id", (0, import_kit2.getU8Encoder)()],
|
|
335
|
+
["version", (0, import_kit2.getU8Encoder)()],
|
|
336
|
+
["bump", (0, import_kit2.getU8Encoder)()]
|
|
337
|
+
]),
|
|
338
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: BITMAP_ACCOUNT_DISCRIMINATOR })
|
|
339
|
+
);
|
|
340
|
+
}
|
|
341
|
+
function getBitmapAccountDecoder() {
|
|
342
|
+
return (0, import_kit2.getStructDecoder)([
|
|
343
|
+
["discriminator", (0, import_kit2.fixDecoderSize)((0, import_kit2.getBytesDecoder)(), 8)],
|
|
344
|
+
["owner", (0, import_kit2.getAddressDecoder)()],
|
|
345
|
+
["airdrop", (0, import_kit2.getAddressDecoder)()],
|
|
346
|
+
["claimedBitmap", (0, import_kit2.addDecoderSizePrefix)((0, import_kit2.getBytesDecoder)(), (0, import_kit2.getU32Decoder)())],
|
|
347
|
+
["id", (0, import_kit2.getU8Decoder)()],
|
|
348
|
+
["version", (0, import_kit2.getU8Decoder)()],
|
|
349
|
+
["bump", (0, import_kit2.getU8Decoder)()]
|
|
350
|
+
]);
|
|
351
|
+
}
|
|
352
|
+
function getBitmapAccountCodec() {
|
|
353
|
+
return (0, import_kit2.combineCodec)(getBitmapAccountEncoder(), getBitmapAccountDecoder());
|
|
354
|
+
}
|
|
355
|
+
function decodeBitmapAccount(encodedAccount) {
|
|
356
|
+
return (0, import_kit2.decodeAccount)(
|
|
357
|
+
encodedAccount,
|
|
358
|
+
getBitmapAccountDecoder()
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
function fetchBitmapAccount(rpc, address, config) {
|
|
362
|
+
return __async(this, null, function* () {
|
|
363
|
+
const maybeAccount = yield fetchMaybeBitmapAccount(rpc, address, config);
|
|
364
|
+
(0, import_kit2.assertAccountExists)(maybeAccount);
|
|
365
|
+
return maybeAccount;
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function fetchMaybeBitmapAccount(rpc, address, config) {
|
|
369
|
+
return __async(this, null, function* () {
|
|
370
|
+
const maybeAccount = yield (0, import_kit2.fetchEncodedAccount)(rpc, address, config);
|
|
371
|
+
return decodeBitmapAccount(maybeAccount);
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
function fetchAllBitmapAccount(rpc, addresses, config) {
|
|
375
|
+
return __async(this, null, function* () {
|
|
376
|
+
const maybeAccounts = yield fetchAllMaybeBitmapAccount(
|
|
377
|
+
rpc,
|
|
378
|
+
addresses,
|
|
379
|
+
config
|
|
380
|
+
);
|
|
381
|
+
(0, import_kit2.assertAccountsExist)(maybeAccounts);
|
|
382
|
+
return maybeAccounts;
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
function fetchAllMaybeBitmapAccount(rpc, addresses, config) {
|
|
386
|
+
return __async(this, null, function* () {
|
|
387
|
+
const maybeAccounts = yield (0, import_kit2.fetchEncodedAccounts)(rpc, addresses, config);
|
|
388
|
+
return maybeAccounts.map((maybeAccount) => decodeBitmapAccount(maybeAccount));
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
// src/accounts/controller.ts
|
|
393
|
+
var import_kit3 = require("@solana/kit");
|
|
394
|
+
var CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
395
|
+
184,
|
|
396
|
+
79,
|
|
397
|
+
171,
|
|
398
|
+
0,
|
|
399
|
+
183,
|
|
400
|
+
43,
|
|
401
|
+
113,
|
|
402
|
+
110
|
|
403
|
+
]);
|
|
404
|
+
function getControllerDiscriminatorBytes() {
|
|
405
|
+
return (0, import_kit3.fixEncoderSize)((0, import_kit3.getBytesEncoder)(), 8).encode(CONTROLLER_DISCRIMINATOR);
|
|
406
|
+
}
|
|
407
|
+
function getControllerEncoder() {
|
|
408
|
+
return (0, import_kit3.transformEncoder)(
|
|
409
|
+
(0, import_kit3.getStructEncoder)([
|
|
410
|
+
["discriminator", (0, import_kit3.fixEncoderSize)((0, import_kit3.getBytesEncoder)(), 8)],
|
|
411
|
+
["authority", (0, import_kit3.getAddressEncoder)()],
|
|
412
|
+
["feeVault", (0, import_kit3.getAddressEncoder)()],
|
|
413
|
+
["createFee", (0, import_kit3.getU64Encoder)()],
|
|
414
|
+
["claimFee", (0, import_kit3.getU64Encoder)()],
|
|
415
|
+
["version", (0, import_kit3.getU8Encoder)()],
|
|
416
|
+
["bump", (0, import_kit3.getU8Encoder)()]
|
|
417
|
+
]),
|
|
418
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: CONTROLLER_DISCRIMINATOR })
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
function getControllerDecoder() {
|
|
422
|
+
return (0, import_kit3.getStructDecoder)([
|
|
423
|
+
["discriminator", (0, import_kit3.fixDecoderSize)((0, import_kit3.getBytesDecoder)(), 8)],
|
|
424
|
+
["authority", (0, import_kit3.getAddressDecoder)()],
|
|
425
|
+
["feeVault", (0, import_kit3.getAddressDecoder)()],
|
|
426
|
+
["createFee", (0, import_kit3.getU64Decoder)()],
|
|
427
|
+
["claimFee", (0, import_kit3.getU64Decoder)()],
|
|
428
|
+
["version", (0, import_kit3.getU8Decoder)()],
|
|
429
|
+
["bump", (0, import_kit3.getU8Decoder)()]
|
|
430
|
+
]);
|
|
431
|
+
}
|
|
432
|
+
function getControllerCodec() {
|
|
433
|
+
return (0, import_kit3.combineCodec)(getControllerEncoder(), getControllerDecoder());
|
|
434
|
+
}
|
|
435
|
+
function decodeController(encodedAccount) {
|
|
436
|
+
return (0, import_kit3.decodeAccount)(
|
|
437
|
+
encodedAccount,
|
|
438
|
+
getControllerDecoder()
|
|
439
|
+
);
|
|
440
|
+
}
|
|
441
|
+
function fetchController(rpc, address, config) {
|
|
442
|
+
return __async(this, null, function* () {
|
|
443
|
+
const maybeAccount = yield fetchMaybeController(rpc, address, config);
|
|
444
|
+
(0, import_kit3.assertAccountExists)(maybeAccount);
|
|
445
|
+
return maybeAccount;
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
function fetchMaybeController(rpc, address, config) {
|
|
449
|
+
return __async(this, null, function* () {
|
|
450
|
+
const maybeAccount = yield (0, import_kit3.fetchEncodedAccount)(rpc, address, config);
|
|
451
|
+
return decodeController(maybeAccount);
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
function fetchAllController(rpc, addresses, config) {
|
|
455
|
+
return __async(this, null, function* () {
|
|
456
|
+
const maybeAccounts = yield fetchAllMaybeController(rpc, addresses, config);
|
|
457
|
+
(0, import_kit3.assertAccountsExist)(maybeAccounts);
|
|
458
|
+
return maybeAccounts;
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
function fetchAllMaybeController(rpc, addresses, config) {
|
|
462
|
+
return __async(this, null, function* () {
|
|
463
|
+
const maybeAccounts = yield (0, import_kit3.fetchEncodedAccounts)(rpc, addresses, config);
|
|
464
|
+
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
465
|
+
});
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// src/errors/dropsy.ts
|
|
469
|
+
var import_kit5 = require("@solana/kit");
|
|
470
|
+
|
|
471
|
+
// src/programs/dropsy.ts
|
|
472
|
+
var import_kit4 = require("@solana/kit");
|
|
473
|
+
var DROPSY_PROGRAM_ADDRESS = "DropyEMekkCgKmsWiJVcTCAEeFgvHpDAW19ipWebFaPv";
|
|
474
|
+
var DropsyAccount = /* @__PURE__ */ ((DropsyAccount2) => {
|
|
475
|
+
DropsyAccount2[DropsyAccount2["Airdrop"] = 0] = "Airdrop";
|
|
476
|
+
DropsyAccount2[DropsyAccount2["BitmapAccount"] = 1] = "BitmapAccount";
|
|
477
|
+
DropsyAccount2[DropsyAccount2["Controller"] = 2] = "Controller";
|
|
478
|
+
return DropsyAccount2;
|
|
479
|
+
})(DropsyAccount || {});
|
|
480
|
+
function identifyDropsyAccount(account) {
|
|
481
|
+
const data = "data" in account ? account.data : account;
|
|
482
|
+
if ((0, import_kit4.containsBytes)(
|
|
483
|
+
data,
|
|
484
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
485
|
+
new Uint8Array([31, 112, 159, 158, 124, 237, 9, 241])
|
|
486
|
+
),
|
|
487
|
+
0
|
|
488
|
+
)) {
|
|
489
|
+
return 0 /* Airdrop */;
|
|
490
|
+
}
|
|
491
|
+
if ((0, import_kit4.containsBytes)(
|
|
492
|
+
data,
|
|
493
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
494
|
+
new Uint8Array([152, 161, 147, 85, 213, 38, 59, 48])
|
|
495
|
+
),
|
|
496
|
+
0
|
|
497
|
+
)) {
|
|
498
|
+
return 1 /* BitmapAccount */;
|
|
499
|
+
}
|
|
500
|
+
if ((0, import_kit4.containsBytes)(
|
|
501
|
+
data,
|
|
502
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
503
|
+
new Uint8Array([184, 79, 171, 0, 183, 43, 113, 110])
|
|
504
|
+
),
|
|
505
|
+
0
|
|
506
|
+
)) {
|
|
507
|
+
return 2 /* Controller */;
|
|
508
|
+
}
|
|
509
|
+
throw new Error(
|
|
510
|
+
"The provided account could not be identified as a dropsy account."
|
|
511
|
+
);
|
|
512
|
+
}
|
|
513
|
+
var DropsyInstruction = /* @__PURE__ */ ((DropsyInstruction2) => {
|
|
514
|
+
DropsyInstruction2[DropsyInstruction2["ClaimTokens"] = 0] = "ClaimTokens";
|
|
515
|
+
DropsyInstruction2[DropsyInstruction2["CloseAirdrop"] = 1] = "CloseAirdrop";
|
|
516
|
+
DropsyInstruction2[DropsyInstruction2["CloseBitmap"] = 2] = "CloseBitmap";
|
|
517
|
+
DropsyInstruction2[DropsyInstruction2["DepositTokens"] = 3] = "DepositTokens";
|
|
518
|
+
DropsyInstruction2[DropsyInstruction2["InitializeAirdrop"] = 4] = "InitializeAirdrop";
|
|
519
|
+
DropsyInstruction2[DropsyInstruction2["InitializeBitmap"] = 5] = "InitializeBitmap";
|
|
520
|
+
DropsyInstruction2[DropsyInstruction2["InitializeController"] = 6] = "InitializeController";
|
|
521
|
+
return DropsyInstruction2;
|
|
522
|
+
})(DropsyInstruction || {});
|
|
523
|
+
function identifyDropsyInstruction(instruction) {
|
|
524
|
+
const data = "data" in instruction ? instruction.data : instruction;
|
|
525
|
+
if ((0, import_kit4.containsBytes)(
|
|
526
|
+
data,
|
|
527
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
528
|
+
new Uint8Array([108, 216, 210, 231, 0, 212, 42, 64])
|
|
529
|
+
),
|
|
530
|
+
0
|
|
531
|
+
)) {
|
|
532
|
+
return 0 /* ClaimTokens */;
|
|
533
|
+
}
|
|
534
|
+
if ((0, import_kit4.containsBytes)(
|
|
535
|
+
data,
|
|
536
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
537
|
+
new Uint8Array([85, 138, 99, 129, 104, 203, 94, 4])
|
|
538
|
+
),
|
|
539
|
+
0
|
|
540
|
+
)) {
|
|
541
|
+
return 1 /* CloseAirdrop */;
|
|
542
|
+
}
|
|
543
|
+
if ((0, import_kit4.containsBytes)(
|
|
544
|
+
data,
|
|
545
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
546
|
+
new Uint8Array([59, 123, 115, 204, 163, 227, 37, 118])
|
|
547
|
+
),
|
|
548
|
+
0
|
|
549
|
+
)) {
|
|
550
|
+
return 2 /* CloseBitmap */;
|
|
551
|
+
}
|
|
552
|
+
if ((0, import_kit4.containsBytes)(
|
|
553
|
+
data,
|
|
554
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
555
|
+
new Uint8Array([176, 83, 229, 18, 191, 143, 176, 150])
|
|
556
|
+
),
|
|
557
|
+
0
|
|
558
|
+
)) {
|
|
559
|
+
return 3 /* DepositTokens */;
|
|
560
|
+
}
|
|
561
|
+
if ((0, import_kit4.containsBytes)(
|
|
562
|
+
data,
|
|
563
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
564
|
+
new Uint8Array([96, 196, 74, 102, 61, 195, 48, 184])
|
|
565
|
+
),
|
|
566
|
+
0
|
|
567
|
+
)) {
|
|
568
|
+
return 4 /* InitializeAirdrop */;
|
|
569
|
+
}
|
|
570
|
+
if ((0, import_kit4.containsBytes)(
|
|
571
|
+
data,
|
|
572
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
573
|
+
new Uint8Array([25, 109, 200, 45, 209, 118, 74, 69])
|
|
574
|
+
),
|
|
575
|
+
0
|
|
576
|
+
)) {
|
|
577
|
+
return 5 /* InitializeBitmap */;
|
|
578
|
+
}
|
|
579
|
+
if ((0, import_kit4.containsBytes)(
|
|
580
|
+
data,
|
|
581
|
+
(0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(
|
|
582
|
+
new Uint8Array([137, 255, 100, 190, 201, 247, 241, 81])
|
|
583
|
+
),
|
|
584
|
+
0
|
|
585
|
+
)) {
|
|
586
|
+
return 6 /* InitializeController */;
|
|
587
|
+
}
|
|
588
|
+
throw new Error(
|
|
589
|
+
"The provided instruction could not be identified as a dropsy instruction."
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
// src/errors/dropsy.ts
|
|
594
|
+
var DROPSY_ERROR__AIRDROP_NOT_STARTED = 6100;
|
|
595
|
+
var DROPSY_ERROR__AIRDROP_ENDED = 6101;
|
|
596
|
+
var DROPSY_ERROR__AIRDROP_NOT_ENDED = 6102;
|
|
597
|
+
var DROPSY_ERROR__DURATION_TOO_SHORT = 6103;
|
|
598
|
+
var DROPSY_ERROR__INVALID_END_TIME = 6104;
|
|
599
|
+
var DROPSY_ERROR__INVALID_OWNER = 6200;
|
|
600
|
+
var DROPSY_ERROR__OWNER_MISMATCH = 6201;
|
|
601
|
+
var DROPSY_ERROR__INVALID_VAULT_AUTHORITY = 6202;
|
|
602
|
+
var DROPSY_ERROR__INVALID_DESTINATION_OWNER = 6203;
|
|
603
|
+
var DROPSY_ERROR__CONTROLLER_MISMATCH = 6204;
|
|
604
|
+
var DROPSY_ERROR__INVALID_MINT = 6300;
|
|
605
|
+
var DROPSY_ERROR__MINT_MISMATCH = 6301;
|
|
606
|
+
var DROPSY_ERROR__VAULT_MINT_MISMATCH = 6302;
|
|
607
|
+
var DROPSY_ERROR__DESTINATION_MINT_MISMATCH = 6303;
|
|
608
|
+
var DROPSY_ERROR__MINT_IS_FROZEN = 6304;
|
|
609
|
+
var DROPSY_ERROR__INVALID_MINT_OWNER = 6305;
|
|
610
|
+
var DROPSY_ERROR__MINT_IS_NOT_INITIALIZED = 6306;
|
|
611
|
+
var DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY = 6307;
|
|
612
|
+
var DROPSY_ERROR__NFT_NOT_ALLOWED = 6308;
|
|
613
|
+
var DROPSY_ERROR__VAULT_HAS_DELEGATE = 6401;
|
|
614
|
+
var DROPSY_ERROR__VAULT_FROZEN = 6402;
|
|
615
|
+
var DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY = 6403;
|
|
616
|
+
var DROPSY_ERROR__INVALID_AIRDROP_PDA = 6404;
|
|
617
|
+
var DROPSY_ERROR__VAULT_NOT_INITIALIZED = 6405;
|
|
618
|
+
var DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS = 6406;
|
|
619
|
+
var DROPSY_ERROR__SOURCE_HAS_DELEGATE = 6450;
|
|
620
|
+
var DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN = 6451;
|
|
621
|
+
var DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY = 6452;
|
|
622
|
+
var DROPSY_ERROR__INVALID_PROOF = 6500;
|
|
623
|
+
var DROPSY_ERROR__ALREADY_CLAIMED = 6501;
|
|
624
|
+
var DROPSY_ERROR__MISSING_BITMAP_PDA = 6502;
|
|
625
|
+
var DROPSY_ERROR__INVALID_BITMAP_ACCOUNT = 6503;
|
|
626
|
+
var DROPSY_ERROR__INVALID_BITMAP_INDEX = 6504;
|
|
627
|
+
var DROPSY_ERROR__TOO_MANY_BITMAPS = 6505;
|
|
628
|
+
var DROPSY_ERROR__BITMAP_TOO_LARGE = 6506;
|
|
629
|
+
var DROPSY_ERROR__INVALID_TOTAL = 6507;
|
|
630
|
+
var DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH = 6508;
|
|
631
|
+
var DROPSY_ERROR__ACTIVE_BITMAPS_EXIST = 6509;
|
|
632
|
+
var DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW = 6510;
|
|
633
|
+
var DROPSY_ERROR__INSUFFICIENT_DEPOSIT = 6600;
|
|
634
|
+
var DROPSY_ERROR__CREATE_FEE_TOO_HIGH = 6601;
|
|
635
|
+
var DROPSY_ERROR__CLAIM_FEE_TOO_HIGH = 6602;
|
|
636
|
+
var DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE = 6603;
|
|
637
|
+
var DROPSY_ERROR__INVALID_FEE_VAULT = 6604;
|
|
638
|
+
var DROPSY_ERROR__INVALID_FEE_VAULT_OWNER = 6605;
|
|
639
|
+
var DROPSY_ERROR__INVALID_FEE_VAULT_CURVE = 6606;
|
|
640
|
+
var DROPSY_ERROR__INVALID_PDA = 6700;
|
|
641
|
+
var DROPSY_ERROR__INVALID_AMOUNT = 6701;
|
|
642
|
+
var DROPSY_ERROR__OVERFLOW = 6702;
|
|
643
|
+
var DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT = 6703;
|
|
644
|
+
var DROPSY_ERROR__INVALID_TREASURY_ACCOUNT = 6704;
|
|
645
|
+
var dropsyErrorMessages;
|
|
646
|
+
if (process.env.NODE_ENV !== "production") {
|
|
647
|
+
dropsyErrorMessages = {
|
|
648
|
+
[DROPSY_ERROR__ACTIVE_BITMAPS_EXIST]: `Active bitmaps exist`,
|
|
649
|
+
[DROPSY_ERROR__AIRDROP_ENDED]: `Airdrop has already ended`,
|
|
650
|
+
[DROPSY_ERROR__AIRDROP_NOT_ENDED]: `Airdrop not yet ended`,
|
|
651
|
+
[DROPSY_ERROR__AIRDROP_NOT_STARTED]: `Airdrop has not started yet`,
|
|
652
|
+
[DROPSY_ERROR__ALREADY_CLAIMED]: `Tokens already claimed`,
|
|
653
|
+
[DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH]: `Bitmap/airdrop mismatch`,
|
|
654
|
+
[DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW]: `Bitmaps already closed`,
|
|
655
|
+
[DROPSY_ERROR__BITMAP_TOO_LARGE]: `Bitmap size exceeds limit`,
|
|
656
|
+
[DROPSY_ERROR__CLAIM_FEE_TOO_HIGH]: `Claim fee too high (>0.005 SOL)`,
|
|
657
|
+
[DROPSY_ERROR__CONTROLLER_MISMATCH]: `Mismatched controller`,
|
|
658
|
+
[DROPSY_ERROR__CREATE_FEE_TOO_HIGH]: `Create fee too high (>0.05 SOL)`,
|
|
659
|
+
[DROPSY_ERROR__DESTINATION_MINT_MISMATCH]: `Destination mint doesn't match`,
|
|
660
|
+
[DROPSY_ERROR__DURATION_TOO_SHORT]: `Airdrop duration must be at least 24 hours`,
|
|
661
|
+
[DROPSY_ERROR__INSUFFICIENT_DEPOSIT]: `Insufficient SOL deposit`,
|
|
662
|
+
[DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE]: `Insufficient funds for fee`,
|
|
663
|
+
[DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS]: `Insufficient vault funds`,
|
|
664
|
+
[DROPSY_ERROR__INVALID_AIRDROP_PDA]: `Invalid vault account`,
|
|
665
|
+
[DROPSY_ERROR__INVALID_AMOUNT]: `Invalid amount`,
|
|
666
|
+
[DROPSY_ERROR__INVALID_BITMAP_ACCOUNT]: `Invalid bitmap account`,
|
|
667
|
+
[DROPSY_ERROR__INVALID_BITMAP_INDEX]: `Invalid bitmap index`,
|
|
668
|
+
[DROPSY_ERROR__INVALID_DESTINATION_OWNER]: `Destination account owner is not the signer`,
|
|
669
|
+
[DROPSY_ERROR__INVALID_END_TIME]: `Airdrop must end at least 24 hours in the future`,
|
|
670
|
+
[DROPSY_ERROR__INVALID_FEE_VAULT]: `Invalid fee vault`,
|
|
671
|
+
[DROPSY_ERROR__INVALID_FEE_VAULT_CURVE]: `Fee vault not in curve`,
|
|
672
|
+
[DROPSY_ERROR__INVALID_FEE_VAULT_OWNER]: `Invalid fee vault owner`,
|
|
673
|
+
[DROPSY_ERROR__INVALID_MINT]: `Mint does not match stored state`,
|
|
674
|
+
[DROPSY_ERROR__INVALID_MINT_OWNER]: `Invalid token program owner`,
|
|
675
|
+
[DROPSY_ERROR__INVALID_OWNER]: `Transaction sender is not the owner`,
|
|
676
|
+
[DROPSY_ERROR__INVALID_PDA]: `Invalid PDA account`,
|
|
677
|
+
[DROPSY_ERROR__INVALID_PROOF]: `Invalid merkle proof`,
|
|
678
|
+
[DROPSY_ERROR__INVALID_TOTAL]: `Invalid total claimers`,
|
|
679
|
+
[DROPSY_ERROR__INVALID_TREASURY_ACCOUNT]: `invalid treasury account`,
|
|
680
|
+
[DROPSY_ERROR__INVALID_VAULT_AUTHORITY]: `Invalid vault authority`,
|
|
681
|
+
[DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY]: `Mint has freeze authority`,
|
|
682
|
+
[DROPSY_ERROR__MINT_IS_FROZEN]: `Mint is frozen`,
|
|
683
|
+
[DROPSY_ERROR__MINT_IS_NOT_INITIALIZED]: `Mint must be initialized`,
|
|
684
|
+
[DROPSY_ERROR__MINT_MISMATCH]: `Provided mint doesn't match airdrop's mint`,
|
|
685
|
+
[DROPSY_ERROR__MISSING_BITMAP_PDA]: `Missing bitmap PDA`,
|
|
686
|
+
[DROPSY_ERROR__NFT_NOT_ALLOWED]: `Fungible tokens only (no NFTs)`,
|
|
687
|
+
[DROPSY_ERROR__OVERFLOW]: `Arithmetic overflow`,
|
|
688
|
+
[DROPSY_ERROR__OWNER_MISMATCH]: `Airdrop owner mismatch`,
|
|
689
|
+
[DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN]: `Source account is frozen`,
|
|
690
|
+
[DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY]: `Source has close authority`,
|
|
691
|
+
[DROPSY_ERROR__SOURCE_HAS_DELEGATE]: `Source has delegate set`,
|
|
692
|
+
[DROPSY_ERROR__TOO_MANY_BITMAPS]: `Too many bitmap accounts`,
|
|
693
|
+
[DROPSY_ERROR__VAULT_FROZEN]: `Vault is frozen`,
|
|
694
|
+
[DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY]: `Vault has close authority`,
|
|
695
|
+
[DROPSY_ERROR__VAULT_HAS_DELEGATE]: `Vault has delegate set`,
|
|
696
|
+
[DROPSY_ERROR__VAULT_MINT_MISMATCH]: `Vault mint doesn't match airdrop mint`,
|
|
697
|
+
[DROPSY_ERROR__VAULT_NOT_INITIALIZED]: `Vault not initialized`,
|
|
698
|
+
[DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT]: `Vault not rent exempt`
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
function getDropsyErrorMessage(code) {
|
|
702
|
+
if (process.env.NODE_ENV !== "production") {
|
|
703
|
+
return dropsyErrorMessages[code];
|
|
704
|
+
}
|
|
705
|
+
return "Error message not available in production bundles.";
|
|
706
|
+
}
|
|
707
|
+
function isDropsyError(error, transactionMessage, code) {
|
|
708
|
+
return (0, import_kit5.isProgramError)(
|
|
709
|
+
error,
|
|
710
|
+
transactionMessage,
|
|
711
|
+
DROPSY_PROGRAM_ADDRESS,
|
|
712
|
+
code
|
|
713
|
+
);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// src/instructions/claimTokens.ts
|
|
717
|
+
var import_kit7 = require("@solana/kit");
|
|
718
|
+
|
|
719
|
+
// src/shared/index.ts
|
|
720
|
+
var import_kit6 = require("@solana/kit");
|
|
721
|
+
function expectSome(value) {
|
|
722
|
+
if (value == null) {
|
|
723
|
+
throw new Error("Expected a value but received null or undefined.");
|
|
724
|
+
}
|
|
725
|
+
return value;
|
|
726
|
+
}
|
|
727
|
+
function expectAddress(value) {
|
|
728
|
+
if (!value) {
|
|
729
|
+
throw new Error("Expected a Address.");
|
|
730
|
+
}
|
|
731
|
+
if (typeof value === "object" && "address" in value) {
|
|
732
|
+
return value.address;
|
|
733
|
+
}
|
|
734
|
+
if (Array.isArray(value)) {
|
|
735
|
+
return value[0];
|
|
736
|
+
}
|
|
737
|
+
return value;
|
|
738
|
+
}
|
|
739
|
+
function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
740
|
+
return (account) => {
|
|
741
|
+
if (!account.value) {
|
|
742
|
+
if (optionalAccountStrategy === "omitted") return;
|
|
743
|
+
return Object.freeze({
|
|
744
|
+
address: programAddress,
|
|
745
|
+
role: import_kit6.AccountRole.READONLY
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
const writableRole = account.isWritable ? import_kit6.AccountRole.WRITABLE : import_kit6.AccountRole.READONLY;
|
|
749
|
+
return Object.freeze(__spreadValues({
|
|
750
|
+
address: expectAddress(account.value),
|
|
751
|
+
role: isTransactionSigner(account.value) ? (0, import_kit6.upgradeRoleToSigner)(writableRole) : writableRole
|
|
752
|
+
}, isTransactionSigner(account.value) ? { signer: account.value } : {}));
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function isTransactionSigner(value) {
|
|
756
|
+
return !!value && typeof value === "object" && "address" in value && (0, import_kit6.isTransactionSigner)(value);
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
// src/instructions/claimTokens.ts
|
|
760
|
+
var CLAIM_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
761
|
+
108,
|
|
762
|
+
216,
|
|
763
|
+
210,
|
|
764
|
+
231,
|
|
765
|
+
0,
|
|
766
|
+
212,
|
|
767
|
+
42,
|
|
768
|
+
64
|
|
769
|
+
]);
|
|
770
|
+
function getClaimTokensDiscriminatorBytes() {
|
|
771
|
+
return (0, import_kit7.fixEncoderSize)((0, import_kit7.getBytesEncoder)(), 8).encode(
|
|
772
|
+
CLAIM_TOKENS_DISCRIMINATOR
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
function getClaimTokensInstructionDataEncoder() {
|
|
776
|
+
return (0, import_kit7.transformEncoder)(
|
|
777
|
+
(0, import_kit7.getStructEncoder)([
|
|
778
|
+
["discriminator", (0, import_kit7.fixEncoderSize)((0, import_kit7.getBytesEncoder)(), 8)],
|
|
779
|
+
["index", (0, import_kit7.getU64Encoder)()],
|
|
780
|
+
["proof", (0, import_kit7.getArrayEncoder)((0, import_kit7.getArrayEncoder)((0, import_kit7.getU8Encoder)(), { size: 32 }))],
|
|
781
|
+
["amount", (0, import_kit7.getU64Encoder)()]
|
|
782
|
+
]),
|
|
783
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: CLAIM_TOKENS_DISCRIMINATOR })
|
|
784
|
+
);
|
|
785
|
+
}
|
|
786
|
+
function getClaimTokensInstructionDataDecoder() {
|
|
787
|
+
return (0, import_kit7.getStructDecoder)([
|
|
788
|
+
["discriminator", (0, import_kit7.fixDecoderSize)((0, import_kit7.getBytesDecoder)(), 8)],
|
|
789
|
+
["index", (0, import_kit7.getU64Decoder)()],
|
|
790
|
+
["proof", (0, import_kit7.getArrayDecoder)((0, import_kit7.getArrayDecoder)((0, import_kit7.getU8Decoder)(), { size: 32 }))],
|
|
791
|
+
["amount", (0, import_kit7.getU64Decoder)()]
|
|
792
|
+
]);
|
|
793
|
+
}
|
|
794
|
+
function getClaimTokensInstructionDataCodec() {
|
|
795
|
+
return (0, import_kit7.combineCodec)(
|
|
796
|
+
getClaimTokensInstructionDataEncoder(),
|
|
797
|
+
getClaimTokensInstructionDataDecoder()
|
|
798
|
+
);
|
|
799
|
+
}
|
|
800
|
+
function getClaimTokensInstruction(input, config) {
|
|
801
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
802
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
803
|
+
const originalAccounts = {
|
|
804
|
+
vault: { value: (_b = input.vault) != null ? _b : null, isWritable: true },
|
|
805
|
+
destinationTokenAccount: {
|
|
806
|
+
value: (_c = input.destinationTokenAccount) != null ? _c : null,
|
|
807
|
+
isWritable: true
|
|
808
|
+
},
|
|
809
|
+
airdrop: { value: (_d = input.airdrop) != null ? _d : null, isWritable: false },
|
|
810
|
+
bitmap: { value: (_e = input.bitmap) != null ? _e : null, isWritable: true },
|
|
811
|
+
mint: { value: (_f = input.mint) != null ? _f : null, isWritable: false },
|
|
812
|
+
feeVault: { value: (_g = input.feeVault) != null ? _g : null, isWritable: true },
|
|
813
|
+
controller: { value: (_h = input.controller) != null ? _h : null, isWritable: false },
|
|
814
|
+
claimer: { value: (_i = input.claimer) != null ? _i : null, isWritable: true },
|
|
815
|
+
treasury: { value: (_j = input.treasury) != null ? _j : null, isWritable: true },
|
|
816
|
+
tokenProgram: { value: (_k = input.tokenProgram) != null ? _k : null, isWritable: false },
|
|
817
|
+
systemProgram: { value: (_l = input.systemProgram) != null ? _l : null, isWritable: false }
|
|
818
|
+
};
|
|
819
|
+
const accounts = originalAccounts;
|
|
820
|
+
const args = __spreadValues({}, input);
|
|
821
|
+
if (!accounts.treasury.value) {
|
|
822
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
823
|
+
}
|
|
824
|
+
if (!accounts.tokenProgram.value) {
|
|
825
|
+
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
826
|
+
}
|
|
827
|
+
if (!accounts.systemProgram.value) {
|
|
828
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
829
|
+
}
|
|
830
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
831
|
+
const instruction = {
|
|
832
|
+
accounts: [
|
|
833
|
+
getAccountMeta(accounts.vault),
|
|
834
|
+
getAccountMeta(accounts.destinationTokenAccount),
|
|
835
|
+
getAccountMeta(accounts.airdrop),
|
|
836
|
+
getAccountMeta(accounts.bitmap),
|
|
837
|
+
getAccountMeta(accounts.mint),
|
|
838
|
+
getAccountMeta(accounts.feeVault),
|
|
839
|
+
getAccountMeta(accounts.controller),
|
|
840
|
+
getAccountMeta(accounts.claimer),
|
|
841
|
+
getAccountMeta(accounts.treasury),
|
|
842
|
+
getAccountMeta(accounts.tokenProgram),
|
|
843
|
+
getAccountMeta(accounts.systemProgram)
|
|
844
|
+
],
|
|
845
|
+
programAddress,
|
|
846
|
+
data: getClaimTokensInstructionDataEncoder().encode(
|
|
847
|
+
args
|
|
848
|
+
)
|
|
849
|
+
};
|
|
850
|
+
return instruction;
|
|
851
|
+
}
|
|
852
|
+
function parseClaimTokensInstruction(instruction) {
|
|
853
|
+
if (instruction.accounts.length < 11) {
|
|
854
|
+
throw new Error("Not enough accounts");
|
|
855
|
+
}
|
|
856
|
+
let accountIndex = 0;
|
|
857
|
+
const getNextAccount = () => {
|
|
858
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
859
|
+
accountIndex += 1;
|
|
860
|
+
return accountMeta;
|
|
861
|
+
};
|
|
862
|
+
return {
|
|
863
|
+
programAddress: instruction.programAddress,
|
|
864
|
+
accounts: {
|
|
865
|
+
vault: getNextAccount(),
|
|
866
|
+
destinationTokenAccount: getNextAccount(),
|
|
867
|
+
airdrop: getNextAccount(),
|
|
868
|
+
bitmap: getNextAccount(),
|
|
869
|
+
mint: getNextAccount(),
|
|
870
|
+
feeVault: getNextAccount(),
|
|
871
|
+
controller: getNextAccount(),
|
|
872
|
+
claimer: getNextAccount(),
|
|
873
|
+
treasury: getNextAccount(),
|
|
874
|
+
tokenProgram: getNextAccount(),
|
|
875
|
+
systemProgram: getNextAccount()
|
|
876
|
+
},
|
|
877
|
+
data: getClaimTokensInstructionDataDecoder().decode(instruction.data)
|
|
878
|
+
};
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// src/instructions/closeAirdrop.ts
|
|
882
|
+
var import_kit8 = require("@solana/kit");
|
|
883
|
+
var CLOSE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
884
|
+
85,
|
|
885
|
+
138,
|
|
886
|
+
99,
|
|
887
|
+
129,
|
|
888
|
+
104,
|
|
889
|
+
203,
|
|
890
|
+
94,
|
|
891
|
+
4
|
|
892
|
+
]);
|
|
893
|
+
function getCloseAirdropDiscriminatorBytes() {
|
|
894
|
+
return (0, import_kit8.fixEncoderSize)((0, import_kit8.getBytesEncoder)(), 8).encode(
|
|
895
|
+
CLOSE_AIRDROP_DISCRIMINATOR
|
|
896
|
+
);
|
|
897
|
+
}
|
|
898
|
+
function getCloseAirdropInstructionDataEncoder() {
|
|
899
|
+
return (0, import_kit8.transformEncoder)(
|
|
900
|
+
(0, import_kit8.getStructEncoder)([["discriminator", (0, import_kit8.fixEncoderSize)((0, import_kit8.getBytesEncoder)(), 8)]]),
|
|
901
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: CLOSE_AIRDROP_DISCRIMINATOR })
|
|
902
|
+
);
|
|
903
|
+
}
|
|
904
|
+
function getCloseAirdropInstructionDataDecoder() {
|
|
905
|
+
return (0, import_kit8.getStructDecoder)([
|
|
906
|
+
["discriminator", (0, import_kit8.fixDecoderSize)((0, import_kit8.getBytesDecoder)(), 8)]
|
|
907
|
+
]);
|
|
908
|
+
}
|
|
909
|
+
function getCloseAirdropInstructionDataCodec() {
|
|
910
|
+
return (0, import_kit8.combineCodec)(
|
|
911
|
+
getCloseAirdropInstructionDataEncoder(),
|
|
912
|
+
getCloseAirdropInstructionDataDecoder()
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
function getCloseAirdropInstruction(input, config) {
|
|
916
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
917
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
918
|
+
const originalAccounts = {
|
|
919
|
+
airdrop: { value: (_b = input.airdrop) != null ? _b : null, isWritable: true },
|
|
920
|
+
vault: { value: (_c = input.vault) != null ? _c : null, isWritable: true },
|
|
921
|
+
destinationTokenAccount: {
|
|
922
|
+
value: (_d = input.destinationTokenAccount) != null ? _d : null,
|
|
923
|
+
isWritable: true
|
|
924
|
+
},
|
|
925
|
+
owner: { value: (_e = input.owner) != null ? _e : null, isWritable: true },
|
|
926
|
+
mint: { value: (_f = input.mint) != null ? _f : null, isWritable: false },
|
|
927
|
+
tokenProgram: { value: (_g = input.tokenProgram) != null ? _g : null, isWritable: false }
|
|
928
|
+
};
|
|
929
|
+
const accounts = originalAccounts;
|
|
930
|
+
if (!accounts.tokenProgram.value) {
|
|
931
|
+
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
932
|
+
}
|
|
933
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
934
|
+
const instruction = {
|
|
935
|
+
accounts: [
|
|
936
|
+
getAccountMeta(accounts.airdrop),
|
|
937
|
+
getAccountMeta(accounts.vault),
|
|
938
|
+
getAccountMeta(accounts.destinationTokenAccount),
|
|
939
|
+
getAccountMeta(accounts.owner),
|
|
940
|
+
getAccountMeta(accounts.mint),
|
|
941
|
+
getAccountMeta(accounts.tokenProgram)
|
|
942
|
+
],
|
|
943
|
+
programAddress,
|
|
944
|
+
data: getCloseAirdropInstructionDataEncoder().encode({})
|
|
945
|
+
};
|
|
946
|
+
return instruction;
|
|
947
|
+
}
|
|
948
|
+
function parseCloseAirdropInstruction(instruction) {
|
|
949
|
+
if (instruction.accounts.length < 6) {
|
|
950
|
+
throw new Error("Not enough accounts");
|
|
951
|
+
}
|
|
952
|
+
let accountIndex = 0;
|
|
953
|
+
const getNextAccount = () => {
|
|
954
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
955
|
+
accountIndex += 1;
|
|
956
|
+
return accountMeta;
|
|
957
|
+
};
|
|
958
|
+
return {
|
|
959
|
+
programAddress: instruction.programAddress,
|
|
960
|
+
accounts: {
|
|
961
|
+
airdrop: getNextAccount(),
|
|
962
|
+
vault: getNextAccount(),
|
|
963
|
+
destinationTokenAccount: getNextAccount(),
|
|
964
|
+
owner: getNextAccount(),
|
|
965
|
+
mint: getNextAccount(),
|
|
966
|
+
tokenProgram: getNextAccount()
|
|
967
|
+
},
|
|
968
|
+
data: getCloseAirdropInstructionDataDecoder().decode(instruction.data)
|
|
969
|
+
};
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
// src/instructions/closeBitmap.ts
|
|
973
|
+
var import_kit9 = require("@solana/kit");
|
|
974
|
+
var CLOSE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
975
|
+
59,
|
|
976
|
+
123,
|
|
977
|
+
115,
|
|
978
|
+
204,
|
|
979
|
+
163,
|
|
980
|
+
227,
|
|
981
|
+
37,
|
|
982
|
+
118
|
|
983
|
+
]);
|
|
984
|
+
function getCloseBitmapDiscriminatorBytes() {
|
|
985
|
+
return (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(), 8).encode(
|
|
986
|
+
CLOSE_BITMAP_DISCRIMINATOR
|
|
987
|
+
);
|
|
988
|
+
}
|
|
989
|
+
function getCloseBitmapInstructionDataEncoder() {
|
|
990
|
+
return (0, import_kit9.transformEncoder)(
|
|
991
|
+
(0, import_kit9.getStructEncoder)([["discriminator", (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(), 8)]]),
|
|
992
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: CLOSE_BITMAP_DISCRIMINATOR })
|
|
993
|
+
);
|
|
994
|
+
}
|
|
995
|
+
function getCloseBitmapInstructionDataDecoder() {
|
|
996
|
+
return (0, import_kit9.getStructDecoder)([
|
|
997
|
+
["discriminator", (0, import_kit9.fixDecoderSize)((0, import_kit9.getBytesDecoder)(), 8)]
|
|
998
|
+
]);
|
|
999
|
+
}
|
|
1000
|
+
function getCloseBitmapInstructionDataCodec() {
|
|
1001
|
+
return (0, import_kit9.combineCodec)(
|
|
1002
|
+
getCloseBitmapInstructionDataEncoder(),
|
|
1003
|
+
getCloseBitmapInstructionDataDecoder()
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
function getCloseBitmapInstruction(input, config) {
|
|
1007
|
+
var _a, _b, _c, _d;
|
|
1008
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1009
|
+
const originalAccounts = {
|
|
1010
|
+
airdrop: { value: (_b = input.airdrop) != null ? _b : null, isWritable: true },
|
|
1011
|
+
bitmap: { value: (_c = input.bitmap) != null ? _c : null, isWritable: true },
|
|
1012
|
+
owner: { value: (_d = input.owner) != null ? _d : null, isWritable: true }
|
|
1013
|
+
};
|
|
1014
|
+
const accounts = originalAccounts;
|
|
1015
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1016
|
+
const instruction = {
|
|
1017
|
+
accounts: [
|
|
1018
|
+
getAccountMeta(accounts.airdrop),
|
|
1019
|
+
getAccountMeta(accounts.bitmap),
|
|
1020
|
+
getAccountMeta(accounts.owner)
|
|
1021
|
+
],
|
|
1022
|
+
programAddress,
|
|
1023
|
+
data: getCloseBitmapInstructionDataEncoder().encode({})
|
|
1024
|
+
};
|
|
1025
|
+
return instruction;
|
|
1026
|
+
}
|
|
1027
|
+
function parseCloseBitmapInstruction(instruction) {
|
|
1028
|
+
if (instruction.accounts.length < 3) {
|
|
1029
|
+
throw new Error("Not enough accounts");
|
|
1030
|
+
}
|
|
1031
|
+
let accountIndex = 0;
|
|
1032
|
+
const getNextAccount = () => {
|
|
1033
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1034
|
+
accountIndex += 1;
|
|
1035
|
+
return accountMeta;
|
|
1036
|
+
};
|
|
1037
|
+
return {
|
|
1038
|
+
programAddress: instruction.programAddress,
|
|
1039
|
+
accounts: {
|
|
1040
|
+
airdrop: getNextAccount(),
|
|
1041
|
+
bitmap: getNextAccount(),
|
|
1042
|
+
owner: getNextAccount()
|
|
1043
|
+
},
|
|
1044
|
+
data: getCloseBitmapInstructionDataDecoder().decode(instruction.data)
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
// src/instructions/depositTokens.ts
|
|
1049
|
+
var import_kit10 = require("@solana/kit");
|
|
1050
|
+
var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
1051
|
+
176,
|
|
1052
|
+
83,
|
|
1053
|
+
229,
|
|
1054
|
+
18,
|
|
1055
|
+
191,
|
|
1056
|
+
143,
|
|
1057
|
+
176,
|
|
1058
|
+
150
|
|
1059
|
+
]);
|
|
1060
|
+
function getDepositTokensDiscriminatorBytes() {
|
|
1061
|
+
return (0, import_kit10.fixEncoderSize)((0, import_kit10.getBytesEncoder)(), 8).encode(
|
|
1062
|
+
DEPOSIT_TOKENS_DISCRIMINATOR
|
|
1063
|
+
);
|
|
1064
|
+
}
|
|
1065
|
+
function getDepositTokensInstructionDataEncoder() {
|
|
1066
|
+
return (0, import_kit10.transformEncoder)(
|
|
1067
|
+
(0, import_kit10.getStructEncoder)([
|
|
1068
|
+
["discriminator", (0, import_kit10.fixEncoderSize)((0, import_kit10.getBytesEncoder)(), 8)],
|
|
1069
|
+
["amount", (0, import_kit10.getU64Encoder)()]
|
|
1070
|
+
]),
|
|
1071
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: DEPOSIT_TOKENS_DISCRIMINATOR })
|
|
1072
|
+
);
|
|
1073
|
+
}
|
|
1074
|
+
function getDepositTokensInstructionDataDecoder() {
|
|
1075
|
+
return (0, import_kit10.getStructDecoder)([
|
|
1076
|
+
["discriminator", (0, import_kit10.fixDecoderSize)((0, import_kit10.getBytesDecoder)(), 8)],
|
|
1077
|
+
["amount", (0, import_kit10.getU64Decoder)()]
|
|
1078
|
+
]);
|
|
1079
|
+
}
|
|
1080
|
+
function getDepositTokensInstructionDataCodec() {
|
|
1081
|
+
return (0, import_kit10.combineCodec)(
|
|
1082
|
+
getDepositTokensInstructionDataEncoder(),
|
|
1083
|
+
getDepositTokensInstructionDataDecoder()
|
|
1084
|
+
);
|
|
1085
|
+
}
|
|
1086
|
+
function getDepositTokensInstruction(input, config) {
|
|
1087
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
1088
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1089
|
+
const originalAccounts = {
|
|
1090
|
+
sourceTokenAccount: {
|
|
1091
|
+
value: (_b = input.sourceTokenAccount) != null ? _b : null,
|
|
1092
|
+
isWritable: true
|
|
1093
|
+
},
|
|
1094
|
+
vault: { value: (_c = input.vault) != null ? _c : null, isWritable: true },
|
|
1095
|
+
airdrop: { value: (_d = input.airdrop) != null ? _d : null, isWritable: true },
|
|
1096
|
+
mint: { value: (_e = input.mint) != null ? _e : null, isWritable: false },
|
|
1097
|
+
owner: { value: (_f = input.owner) != null ? _f : null, isWritable: false },
|
|
1098
|
+
tokenProgram: { value: (_g = input.tokenProgram) != null ? _g : null, isWritable: false }
|
|
1099
|
+
};
|
|
1100
|
+
const accounts = originalAccounts;
|
|
1101
|
+
const args = __spreadValues({}, input);
|
|
1102
|
+
if (!accounts.tokenProgram.value) {
|
|
1103
|
+
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
1104
|
+
}
|
|
1105
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1106
|
+
const instruction = {
|
|
1107
|
+
accounts: [
|
|
1108
|
+
getAccountMeta(accounts.sourceTokenAccount),
|
|
1109
|
+
getAccountMeta(accounts.vault),
|
|
1110
|
+
getAccountMeta(accounts.airdrop),
|
|
1111
|
+
getAccountMeta(accounts.mint),
|
|
1112
|
+
getAccountMeta(accounts.owner),
|
|
1113
|
+
getAccountMeta(accounts.tokenProgram)
|
|
1114
|
+
],
|
|
1115
|
+
programAddress,
|
|
1116
|
+
data: getDepositTokensInstructionDataEncoder().encode(
|
|
1117
|
+
args
|
|
1118
|
+
)
|
|
1119
|
+
};
|
|
1120
|
+
return instruction;
|
|
1121
|
+
}
|
|
1122
|
+
function parseDepositTokensInstruction(instruction) {
|
|
1123
|
+
if (instruction.accounts.length < 6) {
|
|
1124
|
+
throw new Error("Not enough accounts");
|
|
1125
|
+
}
|
|
1126
|
+
let accountIndex = 0;
|
|
1127
|
+
const getNextAccount = () => {
|
|
1128
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1129
|
+
accountIndex += 1;
|
|
1130
|
+
return accountMeta;
|
|
1131
|
+
};
|
|
1132
|
+
return {
|
|
1133
|
+
programAddress: instruction.programAddress,
|
|
1134
|
+
accounts: {
|
|
1135
|
+
sourceTokenAccount: getNextAccount(),
|
|
1136
|
+
vault: getNextAccount(),
|
|
1137
|
+
airdrop: getNextAccount(),
|
|
1138
|
+
mint: getNextAccount(),
|
|
1139
|
+
owner: getNextAccount(),
|
|
1140
|
+
tokenProgram: getNextAccount()
|
|
1141
|
+
},
|
|
1142
|
+
data: getDepositTokensInstructionDataDecoder().decode(instruction.data)
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1145
|
+
|
|
1146
|
+
// src/instructions/initializeAirdrop.ts
|
|
1147
|
+
var import_kit11 = require("@solana/kit");
|
|
1148
|
+
var INITIALIZE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1149
|
+
96,
|
|
1150
|
+
196,
|
|
1151
|
+
74,
|
|
1152
|
+
102,
|
|
1153
|
+
61,
|
|
1154
|
+
195,
|
|
1155
|
+
48,
|
|
1156
|
+
184
|
|
1157
|
+
]);
|
|
1158
|
+
function getInitializeAirdropDiscriminatorBytes() {
|
|
1159
|
+
return (0, import_kit11.fixEncoderSize)((0, import_kit11.getBytesEncoder)(), 8).encode(
|
|
1160
|
+
INITIALIZE_AIRDROP_DISCRIMINATOR
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
function getInitializeAirdropInstructionDataEncoder() {
|
|
1164
|
+
return (0, import_kit11.transformEncoder)(
|
|
1165
|
+
(0, import_kit11.getStructEncoder)([
|
|
1166
|
+
["discriminator", (0, import_kit11.fixEncoderSize)((0, import_kit11.getBytesEncoder)(), 8)],
|
|
1167
|
+
["id", (0, import_kit11.getU64Encoder)()],
|
|
1168
|
+
["merkleRoot", (0, import_kit11.getArrayEncoder)((0, import_kit11.getU8Encoder)(), { size: 32 })],
|
|
1169
|
+
["startsTime", (0, import_kit11.getI64Encoder)()],
|
|
1170
|
+
["endTime", (0, import_kit11.getI64Encoder)()]
|
|
1171
|
+
]),
|
|
1172
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: INITIALIZE_AIRDROP_DISCRIMINATOR })
|
|
1173
|
+
);
|
|
1174
|
+
}
|
|
1175
|
+
function getInitializeAirdropInstructionDataDecoder() {
|
|
1176
|
+
return (0, import_kit11.getStructDecoder)([
|
|
1177
|
+
["discriminator", (0, import_kit11.fixDecoderSize)((0, import_kit11.getBytesDecoder)(), 8)],
|
|
1178
|
+
["id", (0, import_kit11.getU64Decoder)()],
|
|
1179
|
+
["merkleRoot", (0, import_kit11.getArrayDecoder)((0, import_kit11.getU8Decoder)(), { size: 32 })],
|
|
1180
|
+
["startsTime", (0, import_kit11.getI64Decoder)()],
|
|
1181
|
+
["endTime", (0, import_kit11.getI64Decoder)()]
|
|
1182
|
+
]);
|
|
1183
|
+
}
|
|
1184
|
+
function getInitializeAirdropInstructionDataCodec() {
|
|
1185
|
+
return (0, import_kit11.combineCodec)(
|
|
1186
|
+
getInitializeAirdropInstructionDataEncoder(),
|
|
1187
|
+
getInitializeAirdropInstructionDataDecoder()
|
|
1188
|
+
);
|
|
1189
|
+
}
|
|
1190
|
+
function getInitializeAirdropInstructionAsync(input, config) {
|
|
1191
|
+
return __async(this, null, function* () {
|
|
1192
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1193
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1194
|
+
const originalAccounts = {
|
|
1195
|
+
mint: { value: (_b = input.mint) != null ? _b : null, isWritable: false },
|
|
1196
|
+
airdrop: { value: (_c = input.airdrop) != null ? _c : null, isWritable: true },
|
|
1197
|
+
controller: { value: (_d = input.controller) != null ? _d : null, isWritable: true },
|
|
1198
|
+
feeVault: { value: (_e = input.feeVault) != null ? _e : null, isWritable: true },
|
|
1199
|
+
owner: { value: (_f = input.owner) != null ? _f : null, isWritable: true },
|
|
1200
|
+
treasury: { value: (_g = input.treasury) != null ? _g : null, isWritable: true },
|
|
1201
|
+
systemProgram: { value: (_h = input.systemProgram) != null ? _h : null, isWritable: false }
|
|
1202
|
+
};
|
|
1203
|
+
const accounts = originalAccounts;
|
|
1204
|
+
const args = __spreadValues({}, input);
|
|
1205
|
+
if (!accounts.airdrop.value) {
|
|
1206
|
+
accounts.airdrop.value = yield (0, import_kit11.getProgramDerivedAddress)({
|
|
1207
|
+
programAddress,
|
|
1208
|
+
seeds: [
|
|
1209
|
+
(0, import_kit11.getBytesEncoder)().encode(
|
|
1210
|
+
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1211
|
+
),
|
|
1212
|
+
(0, import_kit11.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
1213
|
+
(0, import_kit11.getAddressEncoder)().encode(expectAddress(accounts.owner.value)),
|
|
1214
|
+
(0, import_kit11.getU64Encoder)().encode(expectSome(args.id))
|
|
1215
|
+
]
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
if (!accounts.treasury.value) {
|
|
1219
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1220
|
+
}
|
|
1221
|
+
if (!accounts.systemProgram.value) {
|
|
1222
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1223
|
+
}
|
|
1224
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1225
|
+
const instruction = {
|
|
1226
|
+
accounts: [
|
|
1227
|
+
getAccountMeta(accounts.mint),
|
|
1228
|
+
getAccountMeta(accounts.airdrop),
|
|
1229
|
+
getAccountMeta(accounts.controller),
|
|
1230
|
+
getAccountMeta(accounts.feeVault),
|
|
1231
|
+
getAccountMeta(accounts.owner),
|
|
1232
|
+
getAccountMeta(accounts.treasury),
|
|
1233
|
+
getAccountMeta(accounts.systemProgram)
|
|
1234
|
+
],
|
|
1235
|
+
programAddress,
|
|
1236
|
+
data: getInitializeAirdropInstructionDataEncoder().encode(
|
|
1237
|
+
args
|
|
1238
|
+
)
|
|
1239
|
+
};
|
|
1240
|
+
return instruction;
|
|
1241
|
+
});
|
|
1242
|
+
}
|
|
1243
|
+
function getInitializeAirdropInstruction(input, config) {
|
|
1244
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
1245
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1246
|
+
const originalAccounts = {
|
|
1247
|
+
mint: { value: (_b = input.mint) != null ? _b : null, isWritable: false },
|
|
1248
|
+
airdrop: { value: (_c = input.airdrop) != null ? _c : null, isWritable: true },
|
|
1249
|
+
controller: { value: (_d = input.controller) != null ? _d : null, isWritable: true },
|
|
1250
|
+
feeVault: { value: (_e = input.feeVault) != null ? _e : null, isWritable: true },
|
|
1251
|
+
owner: { value: (_f = input.owner) != null ? _f : null, isWritable: true },
|
|
1252
|
+
treasury: { value: (_g = input.treasury) != null ? _g : null, isWritable: true },
|
|
1253
|
+
systemProgram: { value: (_h = input.systemProgram) != null ? _h : null, isWritable: false }
|
|
1254
|
+
};
|
|
1255
|
+
const accounts = originalAccounts;
|
|
1256
|
+
const args = __spreadValues({}, input);
|
|
1257
|
+
if (!accounts.treasury.value) {
|
|
1258
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1259
|
+
}
|
|
1260
|
+
if (!accounts.systemProgram.value) {
|
|
1261
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1262
|
+
}
|
|
1263
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1264
|
+
const instruction = {
|
|
1265
|
+
accounts: [
|
|
1266
|
+
getAccountMeta(accounts.mint),
|
|
1267
|
+
getAccountMeta(accounts.airdrop),
|
|
1268
|
+
getAccountMeta(accounts.controller),
|
|
1269
|
+
getAccountMeta(accounts.feeVault),
|
|
1270
|
+
getAccountMeta(accounts.owner),
|
|
1271
|
+
getAccountMeta(accounts.treasury),
|
|
1272
|
+
getAccountMeta(accounts.systemProgram)
|
|
1273
|
+
],
|
|
1274
|
+
programAddress,
|
|
1275
|
+
data: getInitializeAirdropInstructionDataEncoder().encode(
|
|
1276
|
+
args
|
|
1277
|
+
)
|
|
1278
|
+
};
|
|
1279
|
+
return instruction;
|
|
1280
|
+
}
|
|
1281
|
+
function parseInitializeAirdropInstruction(instruction) {
|
|
1282
|
+
if (instruction.accounts.length < 7) {
|
|
1283
|
+
throw new Error("Not enough accounts");
|
|
1284
|
+
}
|
|
1285
|
+
let accountIndex = 0;
|
|
1286
|
+
const getNextAccount = () => {
|
|
1287
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1288
|
+
accountIndex += 1;
|
|
1289
|
+
return accountMeta;
|
|
1290
|
+
};
|
|
1291
|
+
return {
|
|
1292
|
+
programAddress: instruction.programAddress,
|
|
1293
|
+
accounts: {
|
|
1294
|
+
mint: getNextAccount(),
|
|
1295
|
+
airdrop: getNextAccount(),
|
|
1296
|
+
controller: getNextAccount(),
|
|
1297
|
+
feeVault: getNextAccount(),
|
|
1298
|
+
owner: getNextAccount(),
|
|
1299
|
+
treasury: getNextAccount(),
|
|
1300
|
+
systemProgram: getNextAccount()
|
|
1301
|
+
},
|
|
1302
|
+
data: getInitializeAirdropInstructionDataDecoder().decode(instruction.data)
|
|
1303
|
+
};
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
// src/instructions/initializeBitmap.ts
|
|
1307
|
+
var import_kit12 = require("@solana/kit");
|
|
1308
|
+
var INITIALIZE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
1309
|
+
25,
|
|
1310
|
+
109,
|
|
1311
|
+
200,
|
|
1312
|
+
45,
|
|
1313
|
+
209,
|
|
1314
|
+
118,
|
|
1315
|
+
74,
|
|
1316
|
+
69
|
|
1317
|
+
]);
|
|
1318
|
+
function getInitializeBitmapDiscriminatorBytes() {
|
|
1319
|
+
return (0, import_kit12.fixEncoderSize)((0, import_kit12.getBytesEncoder)(), 8).encode(
|
|
1320
|
+
INITIALIZE_BITMAP_DISCRIMINATOR
|
|
1321
|
+
);
|
|
1322
|
+
}
|
|
1323
|
+
function getInitializeBitmapInstructionDataEncoder() {
|
|
1324
|
+
return (0, import_kit12.transformEncoder)(
|
|
1325
|
+
(0, import_kit12.getStructEncoder)([
|
|
1326
|
+
["discriminator", (0, import_kit12.fixEncoderSize)((0, import_kit12.getBytesEncoder)(), 8)],
|
|
1327
|
+
["id", (0, import_kit12.getU8Encoder)()],
|
|
1328
|
+
["total", (0, import_kit12.getU64Encoder)()]
|
|
1329
|
+
]),
|
|
1330
|
+
(value) => __spreadProps(__spreadValues({}, value), { discriminator: INITIALIZE_BITMAP_DISCRIMINATOR })
|
|
1331
|
+
);
|
|
1332
|
+
}
|
|
1333
|
+
function getInitializeBitmapInstructionDataDecoder() {
|
|
1334
|
+
return (0, import_kit12.getStructDecoder)([
|
|
1335
|
+
["discriminator", (0, import_kit12.fixDecoderSize)((0, import_kit12.getBytesDecoder)(), 8)],
|
|
1336
|
+
["id", (0, import_kit12.getU8Decoder)()],
|
|
1337
|
+
["total", (0, import_kit12.getU64Decoder)()]
|
|
1338
|
+
]);
|
|
1339
|
+
}
|
|
1340
|
+
function getInitializeBitmapInstructionDataCodec() {
|
|
1341
|
+
return (0, import_kit12.combineCodec)(
|
|
1342
|
+
getInitializeBitmapInstructionDataEncoder(),
|
|
1343
|
+
getInitializeBitmapInstructionDataDecoder()
|
|
1344
|
+
);
|
|
1345
|
+
}
|
|
1346
|
+
function getInitializeBitmapInstructionAsync(input, config) {
|
|
1347
|
+
return __async(this, null, function* () {
|
|
1348
|
+
var _a, _b, _c, _d, _e;
|
|
1349
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1350
|
+
const originalAccounts = {
|
|
1351
|
+
bitmap: { value: (_b = input.bitmap) != null ? _b : null, isWritable: true },
|
|
1352
|
+
airdrop: { value: (_c = input.airdrop) != null ? _c : null, isWritable: true },
|
|
1353
|
+
owner: { value: (_d = input.owner) != null ? _d : null, isWritable: true },
|
|
1354
|
+
systemProgram: { value: (_e = input.systemProgram) != null ? _e : null, isWritable: false }
|
|
1355
|
+
};
|
|
1356
|
+
const accounts = originalAccounts;
|
|
1357
|
+
const args = __spreadValues({}, input);
|
|
1358
|
+
if (!accounts.bitmap.value) {
|
|
1359
|
+
accounts.bitmap.value = yield (0, import_kit12.getProgramDerivedAddress)({
|
|
1360
|
+
programAddress,
|
|
1361
|
+
seeds: [
|
|
1362
|
+
(0, import_kit12.getBytesEncoder)().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
1363
|
+
(0, import_kit12.getAddressEncoder)().encode(expectAddress(accounts.airdrop.value)),
|
|
1364
|
+
(0, import_kit12.getU8Encoder)().encode(expectSome(args.id))
|
|
1365
|
+
]
|
|
1366
|
+
});
|
|
1367
|
+
}
|
|
1368
|
+
if (!accounts.systemProgram.value) {
|
|
1369
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1370
|
+
}
|
|
1371
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1372
|
+
const instruction = {
|
|
1373
|
+
accounts: [
|
|
1374
|
+
getAccountMeta(accounts.bitmap),
|
|
1375
|
+
getAccountMeta(accounts.airdrop),
|
|
1376
|
+
getAccountMeta(accounts.owner),
|
|
1377
|
+
getAccountMeta(accounts.systemProgram)
|
|
1378
|
+
],
|
|
1379
|
+
programAddress,
|
|
1380
|
+
data: getInitializeBitmapInstructionDataEncoder().encode(
|
|
1381
|
+
args
|
|
1382
|
+
)
|
|
1383
|
+
};
|
|
1384
|
+
return instruction;
|
|
1385
|
+
});
|
|
1386
|
+
}
|
|
1387
|
+
function getInitializeBitmapInstruction(input, config) {
|
|
1388
|
+
var _a, _b, _c, _d, _e;
|
|
1389
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1390
|
+
const originalAccounts = {
|
|
1391
|
+
bitmap: { value: (_b = input.bitmap) != null ? _b : null, isWritable: true },
|
|
1392
|
+
airdrop: { value: (_c = input.airdrop) != null ? _c : null, isWritable: true },
|
|
1393
|
+
owner: { value: (_d = input.owner) != null ? _d : null, isWritable: true },
|
|
1394
|
+
systemProgram: { value: (_e = input.systemProgram) != null ? _e : null, isWritable: false }
|
|
1395
|
+
};
|
|
1396
|
+
const accounts = originalAccounts;
|
|
1397
|
+
const args = __spreadValues({}, input);
|
|
1398
|
+
if (!accounts.systemProgram.value) {
|
|
1399
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1400
|
+
}
|
|
1401
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1402
|
+
const instruction = {
|
|
1403
|
+
accounts: [
|
|
1404
|
+
getAccountMeta(accounts.bitmap),
|
|
1405
|
+
getAccountMeta(accounts.airdrop),
|
|
1406
|
+
getAccountMeta(accounts.owner),
|
|
1407
|
+
getAccountMeta(accounts.systemProgram)
|
|
1408
|
+
],
|
|
1409
|
+
programAddress,
|
|
1410
|
+
data: getInitializeBitmapInstructionDataEncoder().encode(
|
|
1411
|
+
args
|
|
1412
|
+
)
|
|
1413
|
+
};
|
|
1414
|
+
return instruction;
|
|
1415
|
+
}
|
|
1416
|
+
function parseInitializeBitmapInstruction(instruction) {
|
|
1417
|
+
if (instruction.accounts.length < 4) {
|
|
1418
|
+
throw new Error("Not enough accounts");
|
|
1419
|
+
}
|
|
1420
|
+
let accountIndex = 0;
|
|
1421
|
+
const getNextAccount = () => {
|
|
1422
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1423
|
+
accountIndex += 1;
|
|
1424
|
+
return accountMeta;
|
|
1425
|
+
};
|
|
1426
|
+
return {
|
|
1427
|
+
programAddress: instruction.programAddress,
|
|
1428
|
+
accounts: {
|
|
1429
|
+
bitmap: getNextAccount(),
|
|
1430
|
+
airdrop: getNextAccount(),
|
|
1431
|
+
owner: getNextAccount(),
|
|
1432
|
+
systemProgram: getNextAccount()
|
|
1433
|
+
},
|
|
1434
|
+
data: getInitializeBitmapInstructionDataDecoder().decode(instruction.data)
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
// src/instructions/initializeController.ts
|
|
1439
|
+
var import_kit13 = require("@solana/kit");
|
|
1440
|
+
var INITIALIZE_CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
1441
|
+
137,
|
|
1442
|
+
255,
|
|
1443
|
+
100,
|
|
1444
|
+
190,
|
|
1445
|
+
201,
|
|
1446
|
+
247,
|
|
1447
|
+
241,
|
|
1448
|
+
81
|
|
1449
|
+
]);
|
|
1450
|
+
function getInitializeControllerDiscriminatorBytes() {
|
|
1451
|
+
return (0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
1452
|
+
INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1453
|
+
);
|
|
1454
|
+
}
|
|
1455
|
+
function getInitializeControllerInstructionDataEncoder() {
|
|
1456
|
+
return (0, import_kit13.transformEncoder)(
|
|
1457
|
+
(0, import_kit13.getStructEncoder)([
|
|
1458
|
+
["discriminator", (0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8)],
|
|
1459
|
+
["createFee", (0, import_kit13.getU64Encoder)()],
|
|
1460
|
+
["claimFee", (0, import_kit13.getU64Encoder)()]
|
|
1461
|
+
]),
|
|
1462
|
+
(value) => __spreadProps(__spreadValues({}, value), {
|
|
1463
|
+
discriminator: INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1464
|
+
})
|
|
1465
|
+
);
|
|
1466
|
+
}
|
|
1467
|
+
function getInitializeControllerInstructionDataDecoder() {
|
|
1468
|
+
return (0, import_kit13.getStructDecoder)([
|
|
1469
|
+
["discriminator", (0, import_kit13.fixDecoderSize)((0, import_kit13.getBytesDecoder)(), 8)],
|
|
1470
|
+
["createFee", (0, import_kit13.getU64Decoder)()],
|
|
1471
|
+
["claimFee", (0, import_kit13.getU64Decoder)()]
|
|
1472
|
+
]);
|
|
1473
|
+
}
|
|
1474
|
+
function getInitializeControllerInstructionDataCodec() {
|
|
1475
|
+
return (0, import_kit13.combineCodec)(
|
|
1476
|
+
getInitializeControllerInstructionDataEncoder(),
|
|
1477
|
+
getInitializeControllerInstructionDataDecoder()
|
|
1478
|
+
);
|
|
1479
|
+
}
|
|
1480
|
+
function getInitializeControllerInstructionAsync(input, config) {
|
|
1481
|
+
return __async(this, null, function* () {
|
|
1482
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1483
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1484
|
+
const originalAccounts = {
|
|
1485
|
+
controller: { value: (_b = input.controller) != null ? _b : null, isWritable: true },
|
|
1486
|
+
feeVault: { value: (_c = input.feeVault) != null ? _c : null, isWritable: false },
|
|
1487
|
+
treasury: { value: (_d = input.treasury) != null ? _d : null, isWritable: true },
|
|
1488
|
+
payer: { value: (_e = input.payer) != null ? _e : null, isWritable: true },
|
|
1489
|
+
systemProgram: { value: (_f = input.systemProgram) != null ? _f : null, isWritable: false }
|
|
1490
|
+
};
|
|
1491
|
+
const accounts = originalAccounts;
|
|
1492
|
+
const args = __spreadValues({}, input);
|
|
1493
|
+
if (!accounts.controller.value) {
|
|
1494
|
+
accounts.controller.value = yield (0, import_kit13.getProgramDerivedAddress)({
|
|
1495
|
+
programAddress,
|
|
1496
|
+
seeds: [
|
|
1497
|
+
(0, import_kit13.getBytesEncoder)().encode(
|
|
1498
|
+
new Uint8Array([
|
|
1499
|
+
99,
|
|
1500
|
+
111,
|
|
1501
|
+
110,
|
|
1502
|
+
116,
|
|
1503
|
+
114,
|
|
1504
|
+
111,
|
|
1505
|
+
108,
|
|
1506
|
+
108,
|
|
1507
|
+
101,
|
|
1508
|
+
114,
|
|
1509
|
+
45,
|
|
1510
|
+
100,
|
|
1511
|
+
114,
|
|
1512
|
+
111,
|
|
1513
|
+
112,
|
|
1514
|
+
115,
|
|
1515
|
+
121
|
|
1516
|
+
])
|
|
1517
|
+
),
|
|
1518
|
+
(0, import_kit13.getAddressEncoder)().encode(expectAddress(accounts.payer.value))
|
|
1519
|
+
]
|
|
1520
|
+
});
|
|
1521
|
+
}
|
|
1522
|
+
if (!accounts.treasury.value) {
|
|
1523
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1524
|
+
}
|
|
1525
|
+
if (!accounts.systemProgram.value) {
|
|
1526
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1527
|
+
}
|
|
1528
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1529
|
+
const instruction = {
|
|
1530
|
+
accounts: [
|
|
1531
|
+
getAccountMeta(accounts.controller),
|
|
1532
|
+
getAccountMeta(accounts.feeVault),
|
|
1533
|
+
getAccountMeta(accounts.treasury),
|
|
1534
|
+
getAccountMeta(accounts.payer),
|
|
1535
|
+
getAccountMeta(accounts.systemProgram)
|
|
1536
|
+
],
|
|
1537
|
+
programAddress,
|
|
1538
|
+
data: getInitializeControllerInstructionDataEncoder().encode(
|
|
1539
|
+
args
|
|
1540
|
+
)
|
|
1541
|
+
};
|
|
1542
|
+
return instruction;
|
|
1543
|
+
});
|
|
1544
|
+
}
|
|
1545
|
+
function getInitializeControllerInstruction(input, config) {
|
|
1546
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1547
|
+
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1548
|
+
const originalAccounts = {
|
|
1549
|
+
controller: { value: (_b = input.controller) != null ? _b : null, isWritable: true },
|
|
1550
|
+
feeVault: { value: (_c = input.feeVault) != null ? _c : null, isWritable: false },
|
|
1551
|
+
treasury: { value: (_d = input.treasury) != null ? _d : null, isWritable: true },
|
|
1552
|
+
payer: { value: (_e = input.payer) != null ? _e : null, isWritable: true },
|
|
1553
|
+
systemProgram: { value: (_f = input.systemProgram) != null ? _f : null, isWritable: false }
|
|
1554
|
+
};
|
|
1555
|
+
const accounts = originalAccounts;
|
|
1556
|
+
const args = __spreadValues({}, input);
|
|
1557
|
+
if (!accounts.treasury.value) {
|
|
1558
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1559
|
+
}
|
|
1560
|
+
if (!accounts.systemProgram.value) {
|
|
1561
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1562
|
+
}
|
|
1563
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1564
|
+
const instruction = {
|
|
1565
|
+
accounts: [
|
|
1566
|
+
getAccountMeta(accounts.controller),
|
|
1567
|
+
getAccountMeta(accounts.feeVault),
|
|
1568
|
+
getAccountMeta(accounts.treasury),
|
|
1569
|
+
getAccountMeta(accounts.payer),
|
|
1570
|
+
getAccountMeta(accounts.systemProgram)
|
|
1571
|
+
],
|
|
1572
|
+
programAddress,
|
|
1573
|
+
data: getInitializeControllerInstructionDataEncoder().encode(
|
|
1574
|
+
args
|
|
1575
|
+
)
|
|
1576
|
+
};
|
|
1577
|
+
return instruction;
|
|
1578
|
+
}
|
|
1579
|
+
function parseInitializeControllerInstruction(instruction) {
|
|
1580
|
+
if (instruction.accounts.length < 5) {
|
|
1581
|
+
throw new Error("Not enough accounts");
|
|
1582
|
+
}
|
|
1583
|
+
let accountIndex = 0;
|
|
1584
|
+
const getNextAccount = () => {
|
|
1585
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
1586
|
+
accountIndex += 1;
|
|
1587
|
+
return accountMeta;
|
|
1588
|
+
};
|
|
1589
|
+
return {
|
|
1590
|
+
programAddress: instruction.programAddress,
|
|
1591
|
+
accounts: {
|
|
1592
|
+
controller: getNextAccount(),
|
|
1593
|
+
feeVault: getNextAccount(),
|
|
1594
|
+
treasury: getNextAccount(),
|
|
1595
|
+
payer: getNextAccount(),
|
|
1596
|
+
systemProgram: getNextAccount()
|
|
1597
|
+
},
|
|
1598
|
+
data: getInitializeControllerInstructionDataDecoder().decode(
|
|
1599
|
+
instruction.data
|
|
1600
|
+
)
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
// src/types/airdropClosed.ts
|
|
1605
|
+
var import_kit14 = require("@solana/kit");
|
|
1606
|
+
function getAirdropClosedEncoder() {
|
|
1607
|
+
return (0, import_kit14.getStructEncoder)([
|
|
1608
|
+
["airdrop", (0, import_kit14.getAddressEncoder)()],
|
|
1609
|
+
["owner", (0, import_kit14.getAddressEncoder)()],
|
|
1610
|
+
["timestamp", (0, import_kit14.getI64Encoder)()]
|
|
1611
|
+
]);
|
|
1612
|
+
}
|
|
1613
|
+
function getAirdropClosedDecoder() {
|
|
1614
|
+
return (0, import_kit14.getStructDecoder)([
|
|
1615
|
+
["airdrop", (0, import_kit14.getAddressDecoder)()],
|
|
1616
|
+
["owner", (0, import_kit14.getAddressDecoder)()],
|
|
1617
|
+
["timestamp", (0, import_kit14.getI64Decoder)()]
|
|
1618
|
+
]);
|
|
1619
|
+
}
|
|
1620
|
+
function getAirdropClosedCodec() {
|
|
1621
|
+
return (0, import_kit14.combineCodec)(getAirdropClosedEncoder(), getAirdropClosedDecoder());
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
// src/types/airdropInitialized.ts
|
|
1625
|
+
var import_kit15 = require("@solana/kit");
|
|
1626
|
+
function getAirdropInitializedEncoder() {
|
|
1627
|
+
return (0, import_kit15.getStructEncoder)([
|
|
1628
|
+
["airdrop", (0, import_kit15.getAddressEncoder)()],
|
|
1629
|
+
["mint", (0, import_kit15.getAddressEncoder)()],
|
|
1630
|
+
["owner", (0, import_kit15.getAddressEncoder)()],
|
|
1631
|
+
["controller", (0, import_kit15.getAddressEncoder)()],
|
|
1632
|
+
["controllerAuthority", (0, import_kit15.getAddressEncoder)()],
|
|
1633
|
+
["merkleRoot", (0, import_kit15.getArrayEncoder)((0, import_kit15.getU8Encoder)(), { size: 32 })],
|
|
1634
|
+
["startTime", (0, import_kit15.getI64Encoder)()],
|
|
1635
|
+
["endTime", (0, import_kit15.getI64Encoder)()],
|
|
1636
|
+
["timestamp", (0, import_kit15.getI64Encoder)()]
|
|
1637
|
+
]);
|
|
1638
|
+
}
|
|
1639
|
+
function getAirdropInitializedDecoder() {
|
|
1640
|
+
return (0, import_kit15.getStructDecoder)([
|
|
1641
|
+
["airdrop", (0, import_kit15.getAddressDecoder)()],
|
|
1642
|
+
["mint", (0, import_kit15.getAddressDecoder)()],
|
|
1643
|
+
["owner", (0, import_kit15.getAddressDecoder)()],
|
|
1644
|
+
["controller", (0, import_kit15.getAddressDecoder)()],
|
|
1645
|
+
["controllerAuthority", (0, import_kit15.getAddressDecoder)()],
|
|
1646
|
+
["merkleRoot", (0, import_kit15.getArrayDecoder)((0, import_kit15.getU8Decoder)(), { size: 32 })],
|
|
1647
|
+
["startTime", (0, import_kit15.getI64Decoder)()],
|
|
1648
|
+
["endTime", (0, import_kit15.getI64Decoder)()],
|
|
1649
|
+
["timestamp", (0, import_kit15.getI64Decoder)()]
|
|
1650
|
+
]);
|
|
1651
|
+
}
|
|
1652
|
+
function getAirdropInitializedCodec() {
|
|
1653
|
+
return (0, import_kit15.combineCodec)(
|
|
1654
|
+
getAirdropInitializedEncoder(),
|
|
1655
|
+
getAirdropInitializedDecoder()
|
|
1656
|
+
);
|
|
1657
|
+
}
|
|
1658
|
+
|
|
1659
|
+
// src/types/bitmapClosed.ts
|
|
1660
|
+
var import_kit16 = require("@solana/kit");
|
|
1661
|
+
function getBitmapClosedEncoder() {
|
|
1662
|
+
return (0, import_kit16.getStructEncoder)([
|
|
1663
|
+
["airdrop", (0, import_kit16.getAddressEncoder)()],
|
|
1664
|
+
["bitmap", (0, import_kit16.getAddressEncoder)()],
|
|
1665
|
+
["owner", (0, import_kit16.getAddressEncoder)()]
|
|
1666
|
+
]);
|
|
1667
|
+
}
|
|
1668
|
+
function getBitmapClosedDecoder() {
|
|
1669
|
+
return (0, import_kit16.getStructDecoder)([
|
|
1670
|
+
["airdrop", (0, import_kit16.getAddressDecoder)()],
|
|
1671
|
+
["bitmap", (0, import_kit16.getAddressDecoder)()],
|
|
1672
|
+
["owner", (0, import_kit16.getAddressDecoder)()]
|
|
1673
|
+
]);
|
|
1674
|
+
}
|
|
1675
|
+
function getBitmapClosedCodec() {
|
|
1676
|
+
return (0, import_kit16.combineCodec)(getBitmapClosedEncoder(), getBitmapClosedDecoder());
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
// src/types/bitmapInitialized.ts
|
|
1680
|
+
var import_kit17 = require("@solana/kit");
|
|
1681
|
+
function getBitmapInitializedEncoder() {
|
|
1682
|
+
return (0, import_kit17.getStructEncoder)([
|
|
1683
|
+
["airdrop", (0, import_kit17.getAddressEncoder)()],
|
|
1684
|
+
["bitmap", (0, import_kit17.getAddressEncoder)()],
|
|
1685
|
+
["bitmapId", (0, import_kit17.getU8Encoder)()],
|
|
1686
|
+
["totalClaims", (0, import_kit17.getU64Encoder)()]
|
|
1687
|
+
]);
|
|
1688
|
+
}
|
|
1689
|
+
function getBitmapInitializedDecoder() {
|
|
1690
|
+
return (0, import_kit17.getStructDecoder)([
|
|
1691
|
+
["airdrop", (0, import_kit17.getAddressDecoder)()],
|
|
1692
|
+
["bitmap", (0, import_kit17.getAddressDecoder)()],
|
|
1693
|
+
["bitmapId", (0, import_kit17.getU8Decoder)()],
|
|
1694
|
+
["totalClaims", (0, import_kit17.getU64Decoder)()]
|
|
1695
|
+
]);
|
|
1696
|
+
}
|
|
1697
|
+
function getBitmapInitializedCodec() {
|
|
1698
|
+
return (0, import_kit17.combineCodec)(
|
|
1699
|
+
getBitmapInitializedEncoder(),
|
|
1700
|
+
getBitmapInitializedDecoder()
|
|
1701
|
+
);
|
|
1702
|
+
}
|
|
1703
|
+
|
|
1704
|
+
// src/types/controllerInitialized.ts
|
|
1705
|
+
var import_kit18 = require("@solana/kit");
|
|
1706
|
+
function getControllerInitializedEncoder() {
|
|
1707
|
+
return (0, import_kit18.getStructEncoder)([
|
|
1708
|
+
["authority", (0, import_kit18.getAddressEncoder)()],
|
|
1709
|
+
["feeVault", (0, import_kit18.getAddressEncoder)()],
|
|
1710
|
+
["createFee", (0, import_kit18.getU64Encoder)()],
|
|
1711
|
+
["claimFee", (0, import_kit18.getU64Encoder)()],
|
|
1712
|
+
["bump", (0, import_kit18.getU8Encoder)()],
|
|
1713
|
+
["timestamp", (0, import_kit18.getI64Encoder)()]
|
|
1714
|
+
]);
|
|
1715
|
+
}
|
|
1716
|
+
function getControllerInitializedDecoder() {
|
|
1717
|
+
return (0, import_kit18.getStructDecoder)([
|
|
1718
|
+
["authority", (0, import_kit18.getAddressDecoder)()],
|
|
1719
|
+
["feeVault", (0, import_kit18.getAddressDecoder)()],
|
|
1720
|
+
["createFee", (0, import_kit18.getU64Decoder)()],
|
|
1721
|
+
["claimFee", (0, import_kit18.getU64Decoder)()],
|
|
1722
|
+
["bump", (0, import_kit18.getU8Decoder)()],
|
|
1723
|
+
["timestamp", (0, import_kit18.getI64Decoder)()]
|
|
1724
|
+
]);
|
|
1725
|
+
}
|
|
1726
|
+
function getControllerInitializedCodec() {
|
|
1727
|
+
return (0, import_kit18.combineCodec)(
|
|
1728
|
+
getControllerInitializedEncoder(),
|
|
1729
|
+
getControllerInitializedDecoder()
|
|
1730
|
+
);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
// src/types/tokensDeposited.ts
|
|
1734
|
+
var import_kit19 = require("@solana/kit");
|
|
1735
|
+
function getTokensDepositedEncoder() {
|
|
1736
|
+
return (0, import_kit19.getStructEncoder)([
|
|
1737
|
+
["airdrop", (0, import_kit19.getAddressEncoder)()],
|
|
1738
|
+
["amount", (0, import_kit19.getU64Encoder)()],
|
|
1739
|
+
["newSupply", (0, import_kit19.getU64Encoder)()],
|
|
1740
|
+
["depositor", (0, import_kit19.getAddressEncoder)()],
|
|
1741
|
+
["timestamp", (0, import_kit19.getI64Encoder)()]
|
|
1742
|
+
]);
|
|
1743
|
+
}
|
|
1744
|
+
function getTokensDepositedDecoder() {
|
|
1745
|
+
return (0, import_kit19.getStructDecoder)([
|
|
1746
|
+
["airdrop", (0, import_kit19.getAddressDecoder)()],
|
|
1747
|
+
["amount", (0, import_kit19.getU64Decoder)()],
|
|
1748
|
+
["newSupply", (0, import_kit19.getU64Decoder)()],
|
|
1749
|
+
["depositor", (0, import_kit19.getAddressDecoder)()],
|
|
1750
|
+
["timestamp", (0, import_kit19.getI64Decoder)()]
|
|
1751
|
+
]);
|
|
1752
|
+
}
|
|
1753
|
+
function getTokensDepositedCodec() {
|
|
1754
|
+
return (0, import_kit19.combineCodec)(getTokensDepositedEncoder(), getTokensDepositedDecoder());
|
|
1755
|
+
}
|
|
1756
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
1757
|
+
0 && (module.exports = {
|
|
1758
|
+
AIRDROP_DISCRIMINATOR,
|
|
1759
|
+
BITMAP_ACCOUNT_DISCRIMINATOR,
|
|
1760
|
+
CLAIM_TOKENS_DISCRIMINATOR,
|
|
1761
|
+
CLOSE_AIRDROP_DISCRIMINATOR,
|
|
1762
|
+
CLOSE_BITMAP_DISCRIMINATOR,
|
|
1763
|
+
CONTROLLER_DISCRIMINATOR,
|
|
1764
|
+
DEPOSIT_TOKENS_DISCRIMINATOR,
|
|
1765
|
+
DROPSY_ERROR__ACTIVE_BITMAPS_EXIST,
|
|
1766
|
+
DROPSY_ERROR__AIRDROP_ENDED,
|
|
1767
|
+
DROPSY_ERROR__AIRDROP_NOT_ENDED,
|
|
1768
|
+
DROPSY_ERROR__AIRDROP_NOT_STARTED,
|
|
1769
|
+
DROPSY_ERROR__ALREADY_CLAIMED,
|
|
1770
|
+
DROPSY_ERROR__BITMAP_AIRDROP_MISMATCH,
|
|
1771
|
+
DROPSY_ERROR__BITMAP_COUNT_UNDERFLOW,
|
|
1772
|
+
DROPSY_ERROR__BITMAP_TOO_LARGE,
|
|
1773
|
+
DROPSY_ERROR__CLAIM_FEE_TOO_HIGH,
|
|
1774
|
+
DROPSY_ERROR__CONTROLLER_MISMATCH,
|
|
1775
|
+
DROPSY_ERROR__CREATE_FEE_TOO_HIGH,
|
|
1776
|
+
DROPSY_ERROR__DESTINATION_MINT_MISMATCH,
|
|
1777
|
+
DROPSY_ERROR__DURATION_TOO_SHORT,
|
|
1778
|
+
DROPSY_ERROR__INSUFFICIENT_DEPOSIT,
|
|
1779
|
+
DROPSY_ERROR__INSUFFICIENT_FUNDS_FOR_FEE,
|
|
1780
|
+
DROPSY_ERROR__INSUFFICIENT_VAULT_FUNDS,
|
|
1781
|
+
DROPSY_ERROR__INVALID_AIRDROP_PDA,
|
|
1782
|
+
DROPSY_ERROR__INVALID_AMOUNT,
|
|
1783
|
+
DROPSY_ERROR__INVALID_BITMAP_ACCOUNT,
|
|
1784
|
+
DROPSY_ERROR__INVALID_BITMAP_INDEX,
|
|
1785
|
+
DROPSY_ERROR__INVALID_DESTINATION_OWNER,
|
|
1786
|
+
DROPSY_ERROR__INVALID_END_TIME,
|
|
1787
|
+
DROPSY_ERROR__INVALID_FEE_VAULT,
|
|
1788
|
+
DROPSY_ERROR__INVALID_FEE_VAULT_CURVE,
|
|
1789
|
+
DROPSY_ERROR__INVALID_FEE_VAULT_OWNER,
|
|
1790
|
+
DROPSY_ERROR__INVALID_MINT,
|
|
1791
|
+
DROPSY_ERROR__INVALID_MINT_OWNER,
|
|
1792
|
+
DROPSY_ERROR__INVALID_OWNER,
|
|
1793
|
+
DROPSY_ERROR__INVALID_PDA,
|
|
1794
|
+
DROPSY_ERROR__INVALID_PROOF,
|
|
1795
|
+
DROPSY_ERROR__INVALID_TOTAL,
|
|
1796
|
+
DROPSY_ERROR__INVALID_TREASURY_ACCOUNT,
|
|
1797
|
+
DROPSY_ERROR__INVALID_VAULT_AUTHORITY,
|
|
1798
|
+
DROPSY_ERROR__MINT_HAS_FREEZE_AUTHORITY,
|
|
1799
|
+
DROPSY_ERROR__MINT_IS_FROZEN,
|
|
1800
|
+
DROPSY_ERROR__MINT_IS_NOT_INITIALIZED,
|
|
1801
|
+
DROPSY_ERROR__MINT_MISMATCH,
|
|
1802
|
+
DROPSY_ERROR__MISSING_BITMAP_PDA,
|
|
1803
|
+
DROPSY_ERROR__NFT_NOT_ALLOWED,
|
|
1804
|
+
DROPSY_ERROR__OVERFLOW,
|
|
1805
|
+
DROPSY_ERROR__OWNER_MISMATCH,
|
|
1806
|
+
DROPSY_ERROR__SOURCE_ACCOUNT_FROZEN,
|
|
1807
|
+
DROPSY_ERROR__SOURCE_HAS_CLOSE_AUTHORITY,
|
|
1808
|
+
DROPSY_ERROR__SOURCE_HAS_DELEGATE,
|
|
1809
|
+
DROPSY_ERROR__TOO_MANY_BITMAPS,
|
|
1810
|
+
DROPSY_ERROR__VAULT_FROZEN,
|
|
1811
|
+
DROPSY_ERROR__VAULT_HAS_CLOSE_AUTHORITY,
|
|
1812
|
+
DROPSY_ERROR__VAULT_HAS_DELEGATE,
|
|
1813
|
+
DROPSY_ERROR__VAULT_MINT_MISMATCH,
|
|
1814
|
+
DROPSY_ERROR__VAULT_NOT_INITIALIZED,
|
|
1815
|
+
DROPSY_ERROR__VAULT_NOT_RENT_EXEMPT,
|
|
1816
|
+
DROPSY_PROGRAM_ADDRESS,
|
|
1817
|
+
DropsyAccount,
|
|
1818
|
+
DropsyInstruction,
|
|
1819
|
+
INITIALIZE_AIRDROP_DISCRIMINATOR,
|
|
1820
|
+
INITIALIZE_BITMAP_DISCRIMINATOR,
|
|
1821
|
+
INITIALIZE_CONTROLLER_DISCRIMINATOR,
|
|
1822
|
+
decodeAirdrop,
|
|
1823
|
+
decodeBitmapAccount,
|
|
1824
|
+
decodeController,
|
|
1825
|
+
fetchAirdrop,
|
|
1826
|
+
fetchAllAirdrop,
|
|
1827
|
+
fetchAllBitmapAccount,
|
|
1828
|
+
fetchAllController,
|
|
1829
|
+
fetchAllMaybeAirdrop,
|
|
1830
|
+
fetchAllMaybeBitmapAccount,
|
|
1831
|
+
fetchAllMaybeController,
|
|
1832
|
+
fetchBitmapAccount,
|
|
1833
|
+
fetchController,
|
|
1834
|
+
fetchMaybeAirdrop,
|
|
1835
|
+
fetchMaybeBitmapAccount,
|
|
1836
|
+
fetchMaybeController,
|
|
1837
|
+
getAirdropClosedCodec,
|
|
1838
|
+
getAirdropClosedDecoder,
|
|
1839
|
+
getAirdropClosedEncoder,
|
|
1840
|
+
getAirdropCodec,
|
|
1841
|
+
getAirdropDecoder,
|
|
1842
|
+
getAirdropDiscriminatorBytes,
|
|
1843
|
+
getAirdropEncoder,
|
|
1844
|
+
getAirdropInitializedCodec,
|
|
1845
|
+
getAirdropInitializedDecoder,
|
|
1846
|
+
getAirdropInitializedEncoder,
|
|
1847
|
+
getBitmapAccountCodec,
|
|
1848
|
+
getBitmapAccountDecoder,
|
|
1849
|
+
getBitmapAccountDiscriminatorBytes,
|
|
1850
|
+
getBitmapAccountEncoder,
|
|
1851
|
+
getBitmapClosedCodec,
|
|
1852
|
+
getBitmapClosedDecoder,
|
|
1853
|
+
getBitmapClosedEncoder,
|
|
1854
|
+
getBitmapInitializedCodec,
|
|
1855
|
+
getBitmapInitializedDecoder,
|
|
1856
|
+
getBitmapInitializedEncoder,
|
|
1857
|
+
getClaimTokensDiscriminatorBytes,
|
|
1858
|
+
getClaimTokensInstruction,
|
|
1859
|
+
getClaimTokensInstructionDataCodec,
|
|
1860
|
+
getClaimTokensInstructionDataDecoder,
|
|
1861
|
+
getClaimTokensInstructionDataEncoder,
|
|
1862
|
+
getCloseAirdropDiscriminatorBytes,
|
|
1863
|
+
getCloseAirdropInstruction,
|
|
1864
|
+
getCloseAirdropInstructionDataCodec,
|
|
1865
|
+
getCloseAirdropInstructionDataDecoder,
|
|
1866
|
+
getCloseAirdropInstructionDataEncoder,
|
|
1867
|
+
getCloseBitmapDiscriminatorBytes,
|
|
1868
|
+
getCloseBitmapInstruction,
|
|
1869
|
+
getCloseBitmapInstructionDataCodec,
|
|
1870
|
+
getCloseBitmapInstructionDataDecoder,
|
|
1871
|
+
getCloseBitmapInstructionDataEncoder,
|
|
1872
|
+
getControllerCodec,
|
|
1873
|
+
getControllerDecoder,
|
|
1874
|
+
getControllerDiscriminatorBytes,
|
|
1875
|
+
getControllerEncoder,
|
|
1876
|
+
getControllerInitializedCodec,
|
|
1877
|
+
getControllerInitializedDecoder,
|
|
1878
|
+
getControllerInitializedEncoder,
|
|
1879
|
+
getDepositTokensDiscriminatorBytes,
|
|
1880
|
+
getDepositTokensInstruction,
|
|
1881
|
+
getDepositTokensInstructionDataCodec,
|
|
1882
|
+
getDepositTokensInstructionDataDecoder,
|
|
1883
|
+
getDepositTokensInstructionDataEncoder,
|
|
1884
|
+
getDropsyErrorMessage,
|
|
1885
|
+
getInitializeAirdropDiscriminatorBytes,
|
|
1886
|
+
getInitializeAirdropInstruction,
|
|
1887
|
+
getInitializeAirdropInstructionAsync,
|
|
1888
|
+
getInitializeAirdropInstructionDataCodec,
|
|
1889
|
+
getInitializeAirdropInstructionDataDecoder,
|
|
1890
|
+
getInitializeAirdropInstructionDataEncoder,
|
|
1891
|
+
getInitializeBitmapDiscriminatorBytes,
|
|
1892
|
+
getInitializeBitmapInstruction,
|
|
1893
|
+
getInitializeBitmapInstructionAsync,
|
|
1894
|
+
getInitializeBitmapInstructionDataCodec,
|
|
1895
|
+
getInitializeBitmapInstructionDataDecoder,
|
|
1896
|
+
getInitializeBitmapInstructionDataEncoder,
|
|
1897
|
+
getInitializeControllerDiscriminatorBytes,
|
|
1898
|
+
getInitializeControllerInstruction,
|
|
1899
|
+
getInitializeControllerInstructionAsync,
|
|
1900
|
+
getInitializeControllerInstructionDataCodec,
|
|
1901
|
+
getInitializeControllerInstructionDataDecoder,
|
|
1902
|
+
getInitializeControllerInstructionDataEncoder,
|
|
1903
|
+
getTokensDepositedCodec,
|
|
1904
|
+
getTokensDepositedDecoder,
|
|
1905
|
+
getTokensDepositedEncoder,
|
|
1906
|
+
identifyDropsyAccount,
|
|
1907
|
+
identifyDropsyInstruction,
|
|
1908
|
+
isDropsyError,
|
|
1909
|
+
parseClaimTokensInstruction,
|
|
1910
|
+
parseCloseAirdropInstruction,
|
|
1911
|
+
parseCloseBitmapInstruction,
|
|
1912
|
+
parseDepositTokensInstruction,
|
|
1913
|
+
parseInitializeAirdropInstruction,
|
|
1914
|
+
parseInitializeBitmapInstruction,
|
|
1915
|
+
parseInitializeControllerInstruction
|
|
1916
|
+
});
|