@dropsy/airdrop 0.0.3 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +535 -152
- package/dist/index.d.ts +535 -152
- package/dist/index.js +1470 -570
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1610 -665
- package/dist/index.mjs.map +1 -0
- package/package.json +56 -52
- package/readme.md +105 -0
- package/README.md +0 -30
package/dist/index.js
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
5
|
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
6
|
var __export = (target, all) => {
|
|
24
7
|
for (var name in all)
|
|
25
8
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -33,26 +16,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
33
16
|
return to;
|
|
34
17
|
};
|
|
35
18
|
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
19
|
|
|
57
20
|
// src/index.ts
|
|
58
21
|
var index_exports = {};
|
|
@@ -121,26 +84,44 @@ __export(index_exports, {
|
|
|
121
84
|
INITIALIZE_AIRDROP_DISCRIMINATOR: () => INITIALIZE_AIRDROP_DISCRIMINATOR,
|
|
122
85
|
INITIALIZE_BITMAP_DISCRIMINATOR: () => INITIALIZE_BITMAP_DISCRIMINATOR,
|
|
123
86
|
INITIALIZE_CONTROLLER_DISCRIMINATOR: () => INITIALIZE_CONTROLLER_DISCRIMINATOR,
|
|
87
|
+
INITIALIZE_MASTER_DISCRIMINATOR: () => INITIALIZE_MASTER_DISCRIMINATOR,
|
|
88
|
+
MASTER_DISCRIMINATOR: () => MASTER_DISCRIMINATOR,
|
|
89
|
+
STATS_DISCRIMINATOR: () => STATS_DISCRIMINATOR,
|
|
90
|
+
WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR: () => WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR,
|
|
91
|
+
createDefaultSolanaClient: () => createDefaultSolanaClient,
|
|
92
|
+
createTransactionMessageFromInstruction: () => createTransactionMessageFromInstruction,
|
|
124
93
|
decodeAirdrop: () => decodeAirdrop,
|
|
125
94
|
decodeBitmapAccount: () => decodeBitmapAccount,
|
|
126
95
|
decodeController: () => decodeController,
|
|
96
|
+
decodeMaster: () => decodeMaster,
|
|
97
|
+
decodeStats: () => decodeStats,
|
|
127
98
|
fetchAirdrop: () => fetchAirdrop,
|
|
128
99
|
fetchAllAirdrop: () => fetchAllAirdrop,
|
|
129
100
|
fetchAllBitmapAccount: () => fetchAllBitmapAccount,
|
|
130
101
|
fetchAllController: () => fetchAllController,
|
|
102
|
+
fetchAllMaster: () => fetchAllMaster,
|
|
131
103
|
fetchAllMaybeAirdrop: () => fetchAllMaybeAirdrop,
|
|
132
104
|
fetchAllMaybeBitmapAccount: () => fetchAllMaybeBitmapAccount,
|
|
133
105
|
fetchAllMaybeController: () => fetchAllMaybeController,
|
|
106
|
+
fetchAllMaybeMaster: () => fetchAllMaybeMaster,
|
|
107
|
+
fetchAllMaybeStats: () => fetchAllMaybeStats,
|
|
108
|
+
fetchAllStats: () => fetchAllStats,
|
|
134
109
|
fetchBitmapAccount: () => fetchBitmapAccount,
|
|
135
110
|
fetchController: () => fetchController,
|
|
111
|
+
fetchMaster: () => fetchMaster,
|
|
136
112
|
fetchMaybeAirdrop: () => fetchMaybeAirdrop,
|
|
137
113
|
fetchMaybeBitmapAccount: () => fetchMaybeBitmapAccount,
|
|
138
114
|
fetchMaybeController: () => fetchMaybeController,
|
|
115
|
+
fetchMaybeMaster: () => fetchMaybeMaster,
|
|
116
|
+
fetchMaybeStats: () => fetchMaybeStats,
|
|
117
|
+
fetchStats: () => fetchStats,
|
|
118
|
+
generateKeyPairSignerWithSol: () => generateKeyPairSignerWithSol,
|
|
139
119
|
getAirdropClosedCodec: () => getAirdropClosedCodec,
|
|
140
120
|
getAirdropClosedDecoder: () => getAirdropClosedDecoder,
|
|
141
121
|
getAirdropClosedEncoder: () => getAirdropClosedEncoder,
|
|
142
122
|
getAirdropCodec: () => getAirdropCodec,
|
|
143
123
|
getAirdropDecoder: () => getAirdropDecoder,
|
|
124
|
+
getAirdropDerivedAddress: () => getAirdropDerivedAddress,
|
|
144
125
|
getAirdropDiscriminatorBytes: () => getAirdropDiscriminatorBytes,
|
|
145
126
|
getAirdropEncoder: () => getAirdropEncoder,
|
|
146
127
|
getAirdropInitializedCodec: () => getAirdropInitializedCodec,
|
|
@@ -156,6 +137,7 @@ __export(index_exports, {
|
|
|
156
137
|
getBitmapInitializedCodec: () => getBitmapInitializedCodec,
|
|
157
138
|
getBitmapInitializedDecoder: () => getBitmapInitializedDecoder,
|
|
158
139
|
getBitmapInitializedEncoder: () => getBitmapInitializedEncoder,
|
|
140
|
+
getClaimMapAddress: () => getClaimMapAddress,
|
|
159
141
|
getClaimTokensDiscriminatorBytes: () => getClaimTokensDiscriminatorBytes,
|
|
160
142
|
getClaimTokensInstruction: () => getClaimTokensInstruction,
|
|
161
143
|
getClaimTokensInstructionDataCodec: () => getClaimTokensInstructionDataCodec,
|
|
@@ -163,27 +145,35 @@ __export(index_exports, {
|
|
|
163
145
|
getClaimTokensInstructionDataEncoder: () => getClaimTokensInstructionDataEncoder,
|
|
164
146
|
getCloseAirdropDiscriminatorBytes: () => getCloseAirdropDiscriminatorBytes,
|
|
165
147
|
getCloseAirdropInstruction: () => getCloseAirdropInstruction,
|
|
148
|
+
getCloseAirdropInstructionAsync: () => getCloseAirdropInstructionAsync,
|
|
166
149
|
getCloseAirdropInstructionDataCodec: () => getCloseAirdropInstructionDataCodec,
|
|
167
150
|
getCloseAirdropInstructionDataDecoder: () => getCloseAirdropInstructionDataDecoder,
|
|
168
151
|
getCloseAirdropInstructionDataEncoder: () => getCloseAirdropInstructionDataEncoder,
|
|
169
152
|
getCloseBitmapDiscriminatorBytes: () => getCloseBitmapDiscriminatorBytes,
|
|
170
153
|
getCloseBitmapInstruction: () => getCloseBitmapInstruction,
|
|
154
|
+
getCloseBitmapInstructionAsync: () => getCloseBitmapInstructionAsync,
|
|
171
155
|
getCloseBitmapInstructionDataCodec: () => getCloseBitmapInstructionDataCodec,
|
|
172
156
|
getCloseBitmapInstructionDataDecoder: () => getCloseBitmapInstructionDataDecoder,
|
|
173
157
|
getCloseBitmapInstructionDataEncoder: () => getCloseBitmapInstructionDataEncoder,
|
|
174
158
|
getControllerCodec: () => getControllerCodec,
|
|
175
159
|
getControllerDecoder: () => getControllerDecoder,
|
|
160
|
+
getControllerDerivedAddress: () => getControllerDerivedAddress,
|
|
176
161
|
getControllerDiscriminatorBytes: () => getControllerDiscriminatorBytes,
|
|
177
162
|
getControllerEncoder: () => getControllerEncoder,
|
|
178
163
|
getControllerInitializedCodec: () => getControllerInitializedCodec,
|
|
179
164
|
getControllerInitializedDecoder: () => getControllerInitializedDecoder,
|
|
180
165
|
getControllerInitializedEncoder: () => getControllerInitializedEncoder,
|
|
166
|
+
getControllerVaultAddress: () => getControllerVaultAddress,
|
|
181
167
|
getDepositTokensDiscriminatorBytes: () => getDepositTokensDiscriminatorBytes,
|
|
182
168
|
getDepositTokensInstruction: () => getDepositTokensInstruction,
|
|
183
169
|
getDepositTokensInstructionDataCodec: () => getDepositTokensInstructionDataCodec,
|
|
184
170
|
getDepositTokensInstructionDataDecoder: () => getDepositTokensInstructionDataDecoder,
|
|
185
171
|
getDepositTokensInstructionDataEncoder: () => getDepositTokensInstructionDataEncoder,
|
|
172
|
+
getDropsyDerivedAddress: () => getDropsyDerivedAddress,
|
|
186
173
|
getDropsyErrorMessage: () => getDropsyErrorMessage,
|
|
174
|
+
getFeesCollectedCodec: () => getFeesCollectedCodec,
|
|
175
|
+
getFeesCollectedDecoder: () => getFeesCollectedDecoder,
|
|
176
|
+
getFeesCollectedEncoder: () => getFeesCollectedEncoder,
|
|
187
177
|
getInitializeAirdropDiscriminatorBytes: () => getInitializeAirdropDiscriminatorBytes,
|
|
188
178
|
getInitializeAirdropInstruction: () => getInitializeAirdropInstruction,
|
|
189
179
|
getInitializeAirdropInstructionAsync: () => getInitializeAirdropInstructionAsync,
|
|
@@ -202,9 +192,34 @@ __export(index_exports, {
|
|
|
202
192
|
getInitializeControllerInstructionDataCodec: () => getInitializeControllerInstructionDataCodec,
|
|
203
193
|
getInitializeControllerInstructionDataDecoder: () => getInitializeControllerInstructionDataDecoder,
|
|
204
194
|
getInitializeControllerInstructionDataEncoder: () => getInitializeControllerInstructionDataEncoder,
|
|
195
|
+
getInitializeMasterDiscriminatorBytes: () => getInitializeMasterDiscriminatorBytes,
|
|
196
|
+
getInitializeMasterInstruction: () => getInitializeMasterInstruction,
|
|
197
|
+
getInitializeMasterInstructionAsync: () => getInitializeMasterInstructionAsync,
|
|
198
|
+
getInitializeMasterInstructionDataCodec: () => getInitializeMasterInstructionDataCodec,
|
|
199
|
+
getInitializeMasterInstructionDataDecoder: () => getInitializeMasterInstructionDataDecoder,
|
|
200
|
+
getInitializeMasterInstructionDataEncoder: () => getInitializeMasterInstructionDataEncoder,
|
|
201
|
+
getMasterCodec: () => getMasterCodec,
|
|
202
|
+
getMasterDecoder: () => getMasterDecoder,
|
|
203
|
+
getMasterDerivedAddress: () => getMasterDerivedAddress,
|
|
204
|
+
getMasterDiscriminatorBytes: () => getMasterDiscriminatorBytes,
|
|
205
|
+
getMasterEncoder: () => getMasterEncoder,
|
|
206
|
+
getMasterInitializedCodec: () => getMasterInitializedCodec,
|
|
207
|
+
getMasterInitializedDecoder: () => getMasterInitializedDecoder,
|
|
208
|
+
getMasterInitializedEncoder: () => getMasterInitializedEncoder,
|
|
209
|
+
getStatsCodec: () => getStatsCodec,
|
|
210
|
+
getStatsDecoder: () => getStatsDecoder,
|
|
211
|
+
getStatsDerivedAddress: () => getStatsDerivedAddress,
|
|
212
|
+
getStatsDiscriminatorBytes: () => getStatsDiscriminatorBytes,
|
|
213
|
+
getStatsEncoder: () => getStatsEncoder,
|
|
205
214
|
getTokensDepositedCodec: () => getTokensDepositedCodec,
|
|
206
215
|
getTokensDepositedDecoder: () => getTokensDepositedDecoder,
|
|
207
216
|
getTokensDepositedEncoder: () => getTokensDepositedEncoder,
|
|
217
|
+
getWithdrawControllerFeesDiscriminatorBytes: () => getWithdrawControllerFeesDiscriminatorBytes,
|
|
218
|
+
getWithdrawControllerFeesInstruction: () => getWithdrawControllerFeesInstruction,
|
|
219
|
+
getWithdrawControllerFeesInstructionAsync: () => getWithdrawControllerFeesInstructionAsync,
|
|
220
|
+
getWithdrawControllerFeesInstructionDataCodec: () => getWithdrawControllerFeesInstructionDataCodec,
|
|
221
|
+
getWithdrawControllerFeesInstructionDataDecoder: () => getWithdrawControllerFeesInstructionDataDecoder,
|
|
222
|
+
getWithdrawControllerFeesInstructionDataEncoder: () => getWithdrawControllerFeesInstructionDataEncoder,
|
|
208
223
|
identifyDropsyAccount: () => identifyDropsyAccount,
|
|
209
224
|
identifyDropsyInstruction: () => identifyDropsyInstruction,
|
|
210
225
|
isDropsyError: () => isDropsyError,
|
|
@@ -214,7 +229,9 @@ __export(index_exports, {
|
|
|
214
229
|
parseDepositTokensInstruction: () => parseDepositTokensInstruction,
|
|
215
230
|
parseInitializeAirdropInstruction: () => parseInitializeAirdropInstruction,
|
|
216
231
|
parseInitializeBitmapInstruction: () => parseInitializeBitmapInstruction,
|
|
217
|
-
parseInitializeControllerInstruction: () => parseInitializeControllerInstruction
|
|
232
|
+
parseInitializeControllerInstruction: () => parseInitializeControllerInstruction,
|
|
233
|
+
parseInitializeMasterInstruction: () => parseInitializeMasterInstruction,
|
|
234
|
+
parseWithdrawControllerFeesInstruction: () => parseWithdrawControllerFeesInstruction
|
|
218
235
|
});
|
|
219
236
|
module.exports = __toCommonJS(index_exports);
|
|
220
237
|
|
|
@@ -237,9 +254,8 @@ function getAirdropEncoder() {
|
|
|
237
254
|
return (0, import_kit.transformEncoder)(
|
|
238
255
|
(0, import_kit.getStructEncoder)([
|
|
239
256
|
["discriminator", (0, import_kit.fixEncoderSize)((0, import_kit.getBytesEncoder)(), 8)],
|
|
240
|
-
["
|
|
257
|
+
["authority", (0, import_kit.getAddressEncoder)()],
|
|
241
258
|
["mint", (0, import_kit.getAddressEncoder)()],
|
|
242
|
-
["owner", (0, import_kit.getAddressEncoder)()],
|
|
243
259
|
["controller", (0, import_kit.getAddressEncoder)()],
|
|
244
260
|
["supply", (0, import_kit.getU64Encoder)()],
|
|
245
261
|
["merkleRoot", (0, import_kit.getArrayEncoder)((0, import_kit.getU8Encoder)(), { size: 32 })],
|
|
@@ -249,15 +265,14 @@ function getAirdropEncoder() {
|
|
|
249
265
|
["version", (0, import_kit.getU8Encoder)()],
|
|
250
266
|
["bump", (0, import_kit.getU8Encoder)()]
|
|
251
267
|
]),
|
|
252
|
-
(value) =>
|
|
268
|
+
(value) => ({ ...value, discriminator: AIRDROP_DISCRIMINATOR })
|
|
253
269
|
);
|
|
254
270
|
}
|
|
255
271
|
function getAirdropDecoder() {
|
|
256
272
|
return (0, import_kit.getStructDecoder)([
|
|
257
273
|
["discriminator", (0, import_kit.fixDecoderSize)((0, import_kit.getBytesDecoder)(), 8)],
|
|
258
|
-
["
|
|
274
|
+
["authority", (0, import_kit.getAddressDecoder)()],
|
|
259
275
|
["mint", (0, import_kit.getAddressDecoder)()],
|
|
260
|
-
["owner", (0, import_kit.getAddressDecoder)()],
|
|
261
276
|
["controller", (0, import_kit.getAddressDecoder)()],
|
|
262
277
|
["supply", (0, import_kit.getU64Decoder)()],
|
|
263
278
|
["merkleRoot", (0, import_kit.getArrayDecoder)((0, import_kit.getU8Decoder)(), { size: 32 })],
|
|
@@ -277,31 +292,23 @@ function decodeAirdrop(encodedAccount) {
|
|
|
277
292
|
getAirdropDecoder()
|
|
278
293
|
);
|
|
279
294
|
}
|
|
280
|
-
function fetchAirdrop(rpc, address, config) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
return maybeAccount;
|
|
285
|
-
});
|
|
295
|
+
async function fetchAirdrop(rpc, address, config) {
|
|
296
|
+
const maybeAccount = await fetchMaybeAirdrop(rpc, address, config);
|
|
297
|
+
(0, import_kit.assertAccountExists)(maybeAccount);
|
|
298
|
+
return maybeAccount;
|
|
286
299
|
}
|
|
287
|
-
function fetchMaybeAirdrop(rpc, address, config) {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
return decodeAirdrop(maybeAccount);
|
|
291
|
-
});
|
|
300
|
+
async function fetchMaybeAirdrop(rpc, address, config) {
|
|
301
|
+
const maybeAccount = await (0, import_kit.fetchEncodedAccount)(rpc, address, config);
|
|
302
|
+
return decodeAirdrop(maybeAccount);
|
|
292
303
|
}
|
|
293
|
-
function fetchAllAirdrop(rpc, addresses, config) {
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
return maybeAccounts;
|
|
298
|
-
});
|
|
304
|
+
async function fetchAllAirdrop(rpc, addresses, config) {
|
|
305
|
+
const maybeAccounts = await fetchAllMaybeAirdrop(rpc, addresses, config);
|
|
306
|
+
(0, import_kit.assertAccountsExist)(maybeAccounts);
|
|
307
|
+
return maybeAccounts;
|
|
299
308
|
}
|
|
300
|
-
function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
304
|
-
});
|
|
309
|
+
async function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
310
|
+
const maybeAccounts = await (0, import_kit.fetchEncodedAccounts)(rpc, addresses, config);
|
|
311
|
+
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
305
312
|
}
|
|
306
313
|
|
|
307
314
|
// src/accounts/bitmapAccount.ts
|
|
@@ -325,7 +332,7 @@ function getBitmapAccountEncoder() {
|
|
|
325
332
|
return (0, import_kit2.transformEncoder)(
|
|
326
333
|
(0, import_kit2.getStructEncoder)([
|
|
327
334
|
["discriminator", (0, import_kit2.fixEncoderSize)((0, import_kit2.getBytesEncoder)(), 8)],
|
|
328
|
-
["
|
|
335
|
+
["authority", (0, import_kit2.getAddressEncoder)()],
|
|
329
336
|
["airdrop", (0, import_kit2.getAddressEncoder)()],
|
|
330
337
|
[
|
|
331
338
|
"claimedBitmap",
|
|
@@ -335,13 +342,13 @@ function getBitmapAccountEncoder() {
|
|
|
335
342
|
["version", (0, import_kit2.getU8Encoder)()],
|
|
336
343
|
["bump", (0, import_kit2.getU8Encoder)()]
|
|
337
344
|
]),
|
|
338
|
-
(value) =>
|
|
345
|
+
(value) => ({ ...value, discriminator: BITMAP_ACCOUNT_DISCRIMINATOR })
|
|
339
346
|
);
|
|
340
347
|
}
|
|
341
348
|
function getBitmapAccountDecoder() {
|
|
342
349
|
return (0, import_kit2.getStructDecoder)([
|
|
343
350
|
["discriminator", (0, import_kit2.fixDecoderSize)((0, import_kit2.getBytesDecoder)(), 8)],
|
|
344
|
-
["
|
|
351
|
+
["authority", (0, import_kit2.getAddressDecoder)()],
|
|
345
352
|
["airdrop", (0, import_kit2.getAddressDecoder)()],
|
|
346
353
|
["claimedBitmap", (0, import_kit2.addDecoderSizePrefix)((0, import_kit2.getBytesDecoder)(), (0, import_kit2.getU32Decoder)())],
|
|
347
354
|
["id", (0, import_kit2.getU8Decoder)()],
|
|
@@ -358,35 +365,27 @@ function decodeBitmapAccount(encodedAccount) {
|
|
|
358
365
|
getBitmapAccountDecoder()
|
|
359
366
|
);
|
|
360
367
|
}
|
|
361
|
-
function fetchBitmapAccount(rpc, address, config) {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
return maybeAccount;
|
|
366
|
-
});
|
|
368
|
+
async function fetchBitmapAccount(rpc, address, config) {
|
|
369
|
+
const maybeAccount = await fetchMaybeBitmapAccount(rpc, address, config);
|
|
370
|
+
(0, import_kit2.assertAccountExists)(maybeAccount);
|
|
371
|
+
return maybeAccount;
|
|
367
372
|
}
|
|
368
|
-
function fetchMaybeBitmapAccount(rpc, address, config) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
return decodeBitmapAccount(maybeAccount);
|
|
372
|
-
});
|
|
373
|
+
async function fetchMaybeBitmapAccount(rpc, address, config) {
|
|
374
|
+
const maybeAccount = await (0, import_kit2.fetchEncodedAccount)(rpc, address, config);
|
|
375
|
+
return decodeBitmapAccount(maybeAccount);
|
|
373
376
|
}
|
|
374
|
-
function fetchAllBitmapAccount(rpc, addresses, config) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
return maybeAccounts;
|
|
383
|
-
});
|
|
377
|
+
async function fetchAllBitmapAccount(rpc, addresses, config) {
|
|
378
|
+
const maybeAccounts = await fetchAllMaybeBitmapAccount(
|
|
379
|
+
rpc,
|
|
380
|
+
addresses,
|
|
381
|
+
config
|
|
382
|
+
);
|
|
383
|
+
(0, import_kit2.assertAccountsExist)(maybeAccounts);
|
|
384
|
+
return maybeAccounts;
|
|
384
385
|
}
|
|
385
|
-
function fetchAllMaybeBitmapAccount(rpc, addresses, config) {
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
return maybeAccounts.map((maybeAccount) => decodeBitmapAccount(maybeAccount));
|
|
389
|
-
});
|
|
386
|
+
async function fetchAllMaybeBitmapAccount(rpc, addresses, config) {
|
|
387
|
+
const maybeAccounts = await (0, import_kit2.fetchEncodedAccounts)(rpc, addresses, config);
|
|
388
|
+
return maybeAccounts.map((maybeAccount) => decodeBitmapAccount(maybeAccount));
|
|
390
389
|
}
|
|
391
390
|
|
|
392
391
|
// src/accounts/controller.ts
|
|
@@ -410,12 +409,12 @@ function getControllerEncoder() {
|
|
|
410
409
|
["discriminator", (0, import_kit3.fixEncoderSize)((0, import_kit3.getBytesEncoder)(), 8)],
|
|
411
410
|
["authority", (0, import_kit3.getAddressEncoder)()],
|
|
412
411
|
["feeVault", (0, import_kit3.getAddressEncoder)()],
|
|
413
|
-
["
|
|
414
|
-
["claimFee", (0, import_kit3.getU64Encoder)()],
|
|
412
|
+
["feeLamports", (0, import_kit3.getU64Encoder)()],
|
|
415
413
|
["version", (0, import_kit3.getU8Encoder)()],
|
|
416
|
-
["bump", (0, import_kit3.getU8Encoder)()]
|
|
414
|
+
["bump", (0, import_kit3.getU8Encoder)()],
|
|
415
|
+
["feeVaultBump", (0, import_kit3.getU8Encoder)()]
|
|
417
416
|
]),
|
|
418
|
-
(value) =>
|
|
417
|
+
(value) => ({ ...value, discriminator: CONTROLLER_DISCRIMINATOR })
|
|
419
418
|
);
|
|
420
419
|
}
|
|
421
420
|
function getControllerDecoder() {
|
|
@@ -423,10 +422,10 @@ function getControllerDecoder() {
|
|
|
423
422
|
["discriminator", (0, import_kit3.fixDecoderSize)((0, import_kit3.getBytesDecoder)(), 8)],
|
|
424
423
|
["authority", (0, import_kit3.getAddressDecoder)()],
|
|
425
424
|
["feeVault", (0, import_kit3.getAddressDecoder)()],
|
|
426
|
-
["
|
|
427
|
-
["claimFee", (0, import_kit3.getU64Decoder)()],
|
|
425
|
+
["feeLamports", (0, import_kit3.getU64Decoder)()],
|
|
428
426
|
["version", (0, import_kit3.getU8Decoder)()],
|
|
429
|
-
["bump", (0, import_kit3.getU8Decoder)()]
|
|
427
|
+
["bump", (0, import_kit3.getU8Decoder)()],
|
|
428
|
+
["feeVaultBump", (0, import_kit3.getU8Decoder)()]
|
|
430
429
|
]);
|
|
431
430
|
}
|
|
432
431
|
function getControllerCodec() {
|
|
@@ -438,74 +437,224 @@ function decodeController(encodedAccount) {
|
|
|
438
437
|
getControllerDecoder()
|
|
439
438
|
);
|
|
440
439
|
}
|
|
441
|
-
function fetchController(rpc, address, config) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
return maybeAccount;
|
|
446
|
-
});
|
|
440
|
+
async function fetchController(rpc, address, config) {
|
|
441
|
+
const maybeAccount = await fetchMaybeController(rpc, address, config);
|
|
442
|
+
(0, import_kit3.assertAccountExists)(maybeAccount);
|
|
443
|
+
return maybeAccount;
|
|
447
444
|
}
|
|
448
|
-
function fetchMaybeController(rpc, address, config) {
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
return decodeController(maybeAccount);
|
|
452
|
-
});
|
|
445
|
+
async function fetchMaybeController(rpc, address, config) {
|
|
446
|
+
const maybeAccount = await (0, import_kit3.fetchEncodedAccount)(rpc, address, config);
|
|
447
|
+
return decodeController(maybeAccount);
|
|
453
448
|
}
|
|
454
|
-
function fetchAllController(rpc, addresses, config) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
return maybeAccounts;
|
|
459
|
-
});
|
|
449
|
+
async function fetchAllController(rpc, addresses, config) {
|
|
450
|
+
const maybeAccounts = await fetchAllMaybeController(rpc, addresses, config);
|
|
451
|
+
(0, import_kit3.assertAccountsExist)(maybeAccounts);
|
|
452
|
+
return maybeAccounts;
|
|
460
453
|
}
|
|
461
|
-
function fetchAllMaybeController(rpc, addresses, config) {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
465
|
-
});
|
|
454
|
+
async function fetchAllMaybeController(rpc, addresses, config) {
|
|
455
|
+
const maybeAccounts = await (0, import_kit3.fetchEncodedAccounts)(rpc, addresses, config);
|
|
456
|
+
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
466
457
|
}
|
|
467
458
|
|
|
468
|
-
// src/
|
|
459
|
+
// src/accounts/master.ts
|
|
460
|
+
var import_kit4 = require("@solana/kit");
|
|
461
|
+
var MASTER_DISCRIMINATOR = new Uint8Array([
|
|
462
|
+
168,
|
|
463
|
+
213,
|
|
464
|
+
193,
|
|
465
|
+
12,
|
|
466
|
+
77,
|
|
467
|
+
162,
|
|
468
|
+
58,
|
|
469
|
+
235
|
|
470
|
+
]);
|
|
471
|
+
function getMasterDiscriminatorBytes() {
|
|
472
|
+
return (0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8).encode(MASTER_DISCRIMINATOR);
|
|
473
|
+
}
|
|
474
|
+
function getMasterEncoder() {
|
|
475
|
+
return (0, import_kit4.transformEncoder)(
|
|
476
|
+
(0, import_kit4.getStructEncoder)([
|
|
477
|
+
["discriminator", (0, import_kit4.fixEncoderSize)((0, import_kit4.getBytesEncoder)(), 8)],
|
|
478
|
+
["authority", (0, import_kit4.getAddressEncoder)()],
|
|
479
|
+
["feeVault", (0, import_kit4.getAddressEncoder)()],
|
|
480
|
+
["protocolFee", (0, import_kit4.getU64Encoder)()],
|
|
481
|
+
["withdrawFee", (0, import_kit4.getU64Encoder)()],
|
|
482
|
+
["initControllerFee", (0, import_kit4.getU64Encoder)()],
|
|
483
|
+
["version", (0, import_kit4.getU8Encoder)()],
|
|
484
|
+
["bump", (0, import_kit4.getU8Encoder)()]
|
|
485
|
+
]),
|
|
486
|
+
(value) => ({ ...value, discriminator: MASTER_DISCRIMINATOR })
|
|
487
|
+
);
|
|
488
|
+
}
|
|
489
|
+
function getMasterDecoder() {
|
|
490
|
+
return (0, import_kit4.getStructDecoder)([
|
|
491
|
+
["discriminator", (0, import_kit4.fixDecoderSize)((0, import_kit4.getBytesDecoder)(), 8)],
|
|
492
|
+
["authority", (0, import_kit4.getAddressDecoder)()],
|
|
493
|
+
["feeVault", (0, import_kit4.getAddressDecoder)()],
|
|
494
|
+
["protocolFee", (0, import_kit4.getU64Decoder)()],
|
|
495
|
+
["withdrawFee", (0, import_kit4.getU64Decoder)()],
|
|
496
|
+
["initControllerFee", (0, import_kit4.getU64Decoder)()],
|
|
497
|
+
["version", (0, import_kit4.getU8Decoder)()],
|
|
498
|
+
["bump", (0, import_kit4.getU8Decoder)()]
|
|
499
|
+
]);
|
|
500
|
+
}
|
|
501
|
+
function getMasterCodec() {
|
|
502
|
+
return (0, import_kit4.combineCodec)(getMasterEncoder(), getMasterDecoder());
|
|
503
|
+
}
|
|
504
|
+
function decodeMaster(encodedAccount) {
|
|
505
|
+
return (0, import_kit4.decodeAccount)(
|
|
506
|
+
encodedAccount,
|
|
507
|
+
getMasterDecoder()
|
|
508
|
+
);
|
|
509
|
+
}
|
|
510
|
+
async function fetchMaster(rpc, address, config) {
|
|
511
|
+
const maybeAccount = await fetchMaybeMaster(rpc, address, config);
|
|
512
|
+
(0, import_kit4.assertAccountExists)(maybeAccount);
|
|
513
|
+
return maybeAccount;
|
|
514
|
+
}
|
|
515
|
+
async function fetchMaybeMaster(rpc, address, config) {
|
|
516
|
+
const maybeAccount = await (0, import_kit4.fetchEncodedAccount)(rpc, address, config);
|
|
517
|
+
return decodeMaster(maybeAccount);
|
|
518
|
+
}
|
|
519
|
+
async function fetchAllMaster(rpc, addresses, config) {
|
|
520
|
+
const maybeAccounts = await fetchAllMaybeMaster(rpc, addresses, config);
|
|
521
|
+
(0, import_kit4.assertAccountsExist)(maybeAccounts);
|
|
522
|
+
return maybeAccounts;
|
|
523
|
+
}
|
|
524
|
+
async function fetchAllMaybeMaster(rpc, addresses, config) {
|
|
525
|
+
const maybeAccounts = await (0, import_kit4.fetchEncodedAccounts)(rpc, addresses, config);
|
|
526
|
+
return maybeAccounts.map((maybeAccount) => decodeMaster(maybeAccount));
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// src/accounts/stats.ts
|
|
469
530
|
var import_kit5 = require("@solana/kit");
|
|
531
|
+
var STATS_DISCRIMINATOR = new Uint8Array([
|
|
532
|
+
190,
|
|
533
|
+
125,
|
|
534
|
+
51,
|
|
535
|
+
63,
|
|
536
|
+
169,
|
|
537
|
+
197,
|
|
538
|
+
36,
|
|
539
|
+
238
|
|
540
|
+
]);
|
|
541
|
+
function getStatsDiscriminatorBytes() {
|
|
542
|
+
return (0, import_kit5.fixEncoderSize)((0, import_kit5.getBytesEncoder)(), 8).encode(STATS_DISCRIMINATOR);
|
|
543
|
+
}
|
|
544
|
+
function getStatsEncoder() {
|
|
545
|
+
return (0, import_kit5.transformEncoder)(
|
|
546
|
+
(0, import_kit5.getStructEncoder)([
|
|
547
|
+
["discriminator", (0, import_kit5.fixEncoderSize)((0, import_kit5.getBytesEncoder)(), 8)],
|
|
548
|
+
["initializedControllers", (0, import_kit5.getU64Encoder)()],
|
|
549
|
+
["initializedAirdrops", (0, import_kit5.getU64Encoder)()],
|
|
550
|
+
["initializedClaimMaps", (0, import_kit5.getU64Encoder)()],
|
|
551
|
+
["closedAirdrops", (0, import_kit5.getU64Encoder)()],
|
|
552
|
+
["closedClaimMap", (0, import_kit5.getU64Encoder)()],
|
|
553
|
+
["bump", (0, import_kit5.getU8Encoder)()]
|
|
554
|
+
]),
|
|
555
|
+
(value) => ({ ...value, discriminator: STATS_DISCRIMINATOR })
|
|
556
|
+
);
|
|
557
|
+
}
|
|
558
|
+
function getStatsDecoder() {
|
|
559
|
+
return (0, import_kit5.getStructDecoder)([
|
|
560
|
+
["discriminator", (0, import_kit5.fixDecoderSize)((0, import_kit5.getBytesDecoder)(), 8)],
|
|
561
|
+
["initializedControllers", (0, import_kit5.getU64Decoder)()],
|
|
562
|
+
["initializedAirdrops", (0, import_kit5.getU64Decoder)()],
|
|
563
|
+
["initializedClaimMaps", (0, import_kit5.getU64Decoder)()],
|
|
564
|
+
["closedAirdrops", (0, import_kit5.getU64Decoder)()],
|
|
565
|
+
["closedClaimMap", (0, import_kit5.getU64Decoder)()],
|
|
566
|
+
["bump", (0, import_kit5.getU8Decoder)()]
|
|
567
|
+
]);
|
|
568
|
+
}
|
|
569
|
+
function getStatsCodec() {
|
|
570
|
+
return (0, import_kit5.combineCodec)(getStatsEncoder(), getStatsDecoder());
|
|
571
|
+
}
|
|
572
|
+
function decodeStats(encodedAccount) {
|
|
573
|
+
return (0, import_kit5.decodeAccount)(
|
|
574
|
+
encodedAccount,
|
|
575
|
+
getStatsDecoder()
|
|
576
|
+
);
|
|
577
|
+
}
|
|
578
|
+
async function fetchStats(rpc, address, config) {
|
|
579
|
+
const maybeAccount = await fetchMaybeStats(rpc, address, config);
|
|
580
|
+
(0, import_kit5.assertAccountExists)(maybeAccount);
|
|
581
|
+
return maybeAccount;
|
|
582
|
+
}
|
|
583
|
+
async function fetchMaybeStats(rpc, address, config) {
|
|
584
|
+
const maybeAccount = await (0, import_kit5.fetchEncodedAccount)(rpc, address, config);
|
|
585
|
+
return decodeStats(maybeAccount);
|
|
586
|
+
}
|
|
587
|
+
async function fetchAllStats(rpc, addresses, config) {
|
|
588
|
+
const maybeAccounts = await fetchAllMaybeStats(rpc, addresses, config);
|
|
589
|
+
(0, import_kit5.assertAccountsExist)(maybeAccounts);
|
|
590
|
+
return maybeAccounts;
|
|
591
|
+
}
|
|
592
|
+
async function fetchAllMaybeStats(rpc, addresses, config) {
|
|
593
|
+
const maybeAccounts = await (0, import_kit5.fetchEncodedAccounts)(rpc, addresses, config);
|
|
594
|
+
return maybeAccounts.map((maybeAccount) => decodeStats(maybeAccount));
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
// src/errors/dropsy.ts
|
|
598
|
+
var import_kit7 = require("@solana/kit");
|
|
470
599
|
|
|
471
600
|
// src/programs/dropsy.ts
|
|
472
|
-
var
|
|
473
|
-
var DROPSY_PROGRAM_ADDRESS = "
|
|
601
|
+
var import_kit6 = require("@solana/kit");
|
|
602
|
+
var DROPSY_PROGRAM_ADDRESS = "DropmEfonJRZyPaRQbPgn4nrt3cDi5678bLbzVQRvgLp";
|
|
474
603
|
var DropsyAccount = /* @__PURE__ */ ((DropsyAccount2) => {
|
|
475
604
|
DropsyAccount2[DropsyAccount2["Airdrop"] = 0] = "Airdrop";
|
|
476
605
|
DropsyAccount2[DropsyAccount2["BitmapAccount"] = 1] = "BitmapAccount";
|
|
477
606
|
DropsyAccount2[DropsyAccount2["Controller"] = 2] = "Controller";
|
|
607
|
+
DropsyAccount2[DropsyAccount2["Master"] = 3] = "Master";
|
|
608
|
+
DropsyAccount2[DropsyAccount2["Stats"] = 4] = "Stats";
|
|
478
609
|
return DropsyAccount2;
|
|
479
610
|
})(DropsyAccount || {});
|
|
480
611
|
function identifyDropsyAccount(account) {
|
|
481
612
|
const data = "data" in account ? account.data : account;
|
|
482
|
-
if ((0,
|
|
613
|
+
if ((0, import_kit6.containsBytes)(
|
|
483
614
|
data,
|
|
484
|
-
(0,
|
|
615
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
485
616
|
new Uint8Array([31, 112, 159, 158, 124, 237, 9, 241])
|
|
486
617
|
),
|
|
487
618
|
0
|
|
488
619
|
)) {
|
|
489
620
|
return 0 /* Airdrop */;
|
|
490
621
|
}
|
|
491
|
-
if ((0,
|
|
622
|
+
if ((0, import_kit6.containsBytes)(
|
|
492
623
|
data,
|
|
493
|
-
(0,
|
|
624
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
494
625
|
new Uint8Array([152, 161, 147, 85, 213, 38, 59, 48])
|
|
495
626
|
),
|
|
496
627
|
0
|
|
497
628
|
)) {
|
|
498
629
|
return 1 /* BitmapAccount */;
|
|
499
630
|
}
|
|
500
|
-
if ((0,
|
|
631
|
+
if ((0, import_kit6.containsBytes)(
|
|
501
632
|
data,
|
|
502
|
-
(0,
|
|
633
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
503
634
|
new Uint8Array([184, 79, 171, 0, 183, 43, 113, 110])
|
|
504
635
|
),
|
|
505
636
|
0
|
|
506
637
|
)) {
|
|
507
638
|
return 2 /* Controller */;
|
|
508
639
|
}
|
|
640
|
+
if ((0, import_kit6.containsBytes)(
|
|
641
|
+
data,
|
|
642
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
643
|
+
new Uint8Array([168, 213, 193, 12, 77, 162, 58, 235])
|
|
644
|
+
),
|
|
645
|
+
0
|
|
646
|
+
)) {
|
|
647
|
+
return 3 /* Master */;
|
|
648
|
+
}
|
|
649
|
+
if ((0, import_kit6.containsBytes)(
|
|
650
|
+
data,
|
|
651
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
652
|
+
new Uint8Array([190, 125, 51, 63, 169, 197, 36, 238])
|
|
653
|
+
),
|
|
654
|
+
0
|
|
655
|
+
)) {
|
|
656
|
+
return 4 /* Stats */;
|
|
657
|
+
}
|
|
509
658
|
throw new Error(
|
|
510
659
|
"The provided account could not be identified as a dropsy account."
|
|
511
660
|
);
|
|
@@ -518,73 +667,93 @@ var DropsyInstruction = /* @__PURE__ */ ((DropsyInstruction2) => {
|
|
|
518
667
|
DropsyInstruction2[DropsyInstruction2["InitializeAirdrop"] = 4] = "InitializeAirdrop";
|
|
519
668
|
DropsyInstruction2[DropsyInstruction2["InitializeBitmap"] = 5] = "InitializeBitmap";
|
|
520
669
|
DropsyInstruction2[DropsyInstruction2["InitializeController"] = 6] = "InitializeController";
|
|
670
|
+
DropsyInstruction2[DropsyInstruction2["InitializeMaster"] = 7] = "InitializeMaster";
|
|
671
|
+
DropsyInstruction2[DropsyInstruction2["WithdrawControllerFees"] = 8] = "WithdrawControllerFees";
|
|
521
672
|
return DropsyInstruction2;
|
|
522
673
|
})(DropsyInstruction || {});
|
|
523
674
|
function identifyDropsyInstruction(instruction) {
|
|
524
675
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
525
|
-
if ((0,
|
|
676
|
+
if ((0, import_kit6.containsBytes)(
|
|
526
677
|
data,
|
|
527
|
-
(0,
|
|
678
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
528
679
|
new Uint8Array([108, 216, 210, 231, 0, 212, 42, 64])
|
|
529
680
|
),
|
|
530
681
|
0
|
|
531
682
|
)) {
|
|
532
683
|
return 0 /* ClaimTokens */;
|
|
533
684
|
}
|
|
534
|
-
if ((0,
|
|
685
|
+
if ((0, import_kit6.containsBytes)(
|
|
535
686
|
data,
|
|
536
|
-
(0,
|
|
687
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
537
688
|
new Uint8Array([85, 138, 99, 129, 104, 203, 94, 4])
|
|
538
689
|
),
|
|
539
690
|
0
|
|
540
691
|
)) {
|
|
541
692
|
return 1 /* CloseAirdrop */;
|
|
542
693
|
}
|
|
543
|
-
if ((0,
|
|
694
|
+
if ((0, import_kit6.containsBytes)(
|
|
544
695
|
data,
|
|
545
|
-
(0,
|
|
696
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
546
697
|
new Uint8Array([59, 123, 115, 204, 163, 227, 37, 118])
|
|
547
698
|
),
|
|
548
699
|
0
|
|
549
700
|
)) {
|
|
550
701
|
return 2 /* CloseBitmap */;
|
|
551
702
|
}
|
|
552
|
-
if ((0,
|
|
703
|
+
if ((0, import_kit6.containsBytes)(
|
|
553
704
|
data,
|
|
554
|
-
(0,
|
|
705
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
555
706
|
new Uint8Array([176, 83, 229, 18, 191, 143, 176, 150])
|
|
556
707
|
),
|
|
557
708
|
0
|
|
558
709
|
)) {
|
|
559
710
|
return 3 /* DepositTokens */;
|
|
560
711
|
}
|
|
561
|
-
if ((0,
|
|
712
|
+
if ((0, import_kit6.containsBytes)(
|
|
562
713
|
data,
|
|
563
|
-
(0,
|
|
714
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
564
715
|
new Uint8Array([96, 196, 74, 102, 61, 195, 48, 184])
|
|
565
716
|
),
|
|
566
717
|
0
|
|
567
718
|
)) {
|
|
568
719
|
return 4 /* InitializeAirdrop */;
|
|
569
720
|
}
|
|
570
|
-
if ((0,
|
|
721
|
+
if ((0, import_kit6.containsBytes)(
|
|
571
722
|
data,
|
|
572
|
-
(0,
|
|
723
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
573
724
|
new Uint8Array([25, 109, 200, 45, 209, 118, 74, 69])
|
|
574
725
|
),
|
|
575
726
|
0
|
|
576
727
|
)) {
|
|
577
728
|
return 5 /* InitializeBitmap */;
|
|
578
729
|
}
|
|
579
|
-
if ((0,
|
|
730
|
+
if ((0, import_kit6.containsBytes)(
|
|
580
731
|
data,
|
|
581
|
-
(0,
|
|
732
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
582
733
|
new Uint8Array([137, 255, 100, 190, 201, 247, 241, 81])
|
|
583
734
|
),
|
|
584
735
|
0
|
|
585
736
|
)) {
|
|
586
737
|
return 6 /* InitializeController */;
|
|
587
738
|
}
|
|
739
|
+
if ((0, import_kit6.containsBytes)(
|
|
740
|
+
data,
|
|
741
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
742
|
+
new Uint8Array([206, 91, 246, 30, 216, 101, 134, 166])
|
|
743
|
+
),
|
|
744
|
+
0
|
|
745
|
+
)) {
|
|
746
|
+
return 7 /* InitializeMaster */;
|
|
747
|
+
}
|
|
748
|
+
if ((0, import_kit6.containsBytes)(
|
|
749
|
+
data,
|
|
750
|
+
(0, import_kit6.fixEncoderSize)((0, import_kit6.getBytesEncoder)(), 8).encode(
|
|
751
|
+
new Uint8Array([252, 199, 14, 46, 100, 156, 176, 230])
|
|
752
|
+
),
|
|
753
|
+
0
|
|
754
|
+
)) {
|
|
755
|
+
return 8 /* WithdrawControllerFees */;
|
|
756
|
+
}
|
|
588
757
|
throw new Error(
|
|
589
758
|
"The provided instruction could not be identified as a dropsy instruction."
|
|
590
759
|
);
|
|
@@ -705,7 +874,7 @@ function getDropsyErrorMessage(code) {
|
|
|
705
874
|
return "Error message not available in production bundles.";
|
|
706
875
|
}
|
|
707
876
|
function isDropsyError(error, transactionMessage, code) {
|
|
708
|
-
return (0,
|
|
877
|
+
return (0, import_kit7.isProgramError)(
|
|
709
878
|
error,
|
|
710
879
|
transactionMessage,
|
|
711
880
|
DROPSY_PROGRAM_ADDRESS,
|
|
@@ -714,10 +883,10 @@ function isDropsyError(error, transactionMessage, code) {
|
|
|
714
883
|
}
|
|
715
884
|
|
|
716
885
|
// src/instructions/claimTokens.ts
|
|
717
|
-
var
|
|
886
|
+
var import_kit9 = require("@solana/kit");
|
|
718
887
|
|
|
719
888
|
// src/shared/index.ts
|
|
720
|
-
var
|
|
889
|
+
var import_kit8 = require("@solana/kit");
|
|
721
890
|
function expectSome(value) {
|
|
722
891
|
if (value == null) {
|
|
723
892
|
throw new Error("Expected a value but received null or undefined.");
|
|
@@ -742,18 +911,19 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
|
742
911
|
if (optionalAccountStrategy === "omitted") return;
|
|
743
912
|
return Object.freeze({
|
|
744
913
|
address: programAddress,
|
|
745
|
-
role:
|
|
914
|
+
role: import_kit8.AccountRole.READONLY
|
|
746
915
|
});
|
|
747
916
|
}
|
|
748
|
-
const writableRole = account.isWritable ?
|
|
749
|
-
return Object.freeze(
|
|
917
|
+
const writableRole = account.isWritable ? import_kit8.AccountRole.WRITABLE : import_kit8.AccountRole.READONLY;
|
|
918
|
+
return Object.freeze({
|
|
750
919
|
address: expectAddress(account.value),
|
|
751
|
-
role: isTransactionSigner(account.value) ? (0,
|
|
752
|
-
|
|
920
|
+
role: isTransactionSigner(account.value) ? (0, import_kit8.upgradeRoleToSigner)(writableRole) : writableRole,
|
|
921
|
+
...isTransactionSigner(account.value) ? { signer: account.value } : {}
|
|
922
|
+
});
|
|
753
923
|
};
|
|
754
924
|
}
|
|
755
925
|
function isTransactionSigner(value) {
|
|
756
|
-
return !!value && typeof value === "object" && "address" in value && (0,
|
|
926
|
+
return !!value && typeof value === "object" && "address" in value && (0, import_kit8.isTransactionSigner)(value);
|
|
757
927
|
}
|
|
758
928
|
|
|
759
929
|
// src/instructions/claimTokens.ts
|
|
@@ -768,56 +938,53 @@ var CLAIM_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
768
938
|
64
|
|
769
939
|
]);
|
|
770
940
|
function getClaimTokensDiscriminatorBytes() {
|
|
771
|
-
return (0,
|
|
941
|
+
return (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(), 8).encode(
|
|
772
942
|
CLAIM_TOKENS_DISCRIMINATOR
|
|
773
943
|
);
|
|
774
944
|
}
|
|
775
945
|
function getClaimTokensInstructionDataEncoder() {
|
|
776
|
-
return (0,
|
|
777
|
-
(0,
|
|
778
|
-
["discriminator", (0,
|
|
779
|
-
["index", (0,
|
|
780
|
-
["proof", (0,
|
|
781
|
-
["amount", (0,
|
|
946
|
+
return (0, import_kit9.transformEncoder)(
|
|
947
|
+
(0, import_kit9.getStructEncoder)([
|
|
948
|
+
["discriminator", (0, import_kit9.fixEncoderSize)((0, import_kit9.getBytesEncoder)(), 8)],
|
|
949
|
+
["index", (0, import_kit9.getU64Encoder)()],
|
|
950
|
+
["proof", (0, import_kit9.getArrayEncoder)((0, import_kit9.getArrayEncoder)((0, import_kit9.getU8Encoder)(), { size: 32 }))],
|
|
951
|
+
["amount", (0, import_kit9.getU64Encoder)()]
|
|
782
952
|
]),
|
|
783
|
-
(value) =>
|
|
953
|
+
(value) => ({ ...value, discriminator: CLAIM_TOKENS_DISCRIMINATOR })
|
|
784
954
|
);
|
|
785
955
|
}
|
|
786
956
|
function getClaimTokensInstructionDataDecoder() {
|
|
787
|
-
return (0,
|
|
788
|
-
["discriminator", (0,
|
|
789
|
-
["index", (0,
|
|
790
|
-
["proof", (0,
|
|
791
|
-
["amount", (0,
|
|
957
|
+
return (0, import_kit9.getStructDecoder)([
|
|
958
|
+
["discriminator", (0, import_kit9.fixDecoderSize)((0, import_kit9.getBytesDecoder)(), 8)],
|
|
959
|
+
["index", (0, import_kit9.getU64Decoder)()],
|
|
960
|
+
["proof", (0, import_kit9.getArrayDecoder)((0, import_kit9.getArrayDecoder)((0, import_kit9.getU8Decoder)(), { size: 32 }))],
|
|
961
|
+
["amount", (0, import_kit9.getU64Decoder)()]
|
|
792
962
|
]);
|
|
793
963
|
}
|
|
794
964
|
function getClaimTokensInstructionDataCodec() {
|
|
795
|
-
return (0,
|
|
965
|
+
return (0, import_kit9.combineCodec)(
|
|
796
966
|
getClaimTokensInstructionDataEncoder(),
|
|
797
967
|
getClaimTokensInstructionDataDecoder()
|
|
798
968
|
);
|
|
799
969
|
}
|
|
800
970
|
function getClaimTokensInstruction(input, config) {
|
|
801
|
-
|
|
802
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
971
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
803
972
|
const originalAccounts = {
|
|
804
|
-
vault: { value:
|
|
973
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
805
974
|
destinationTokenAccount: {
|
|
806
|
-
value:
|
|
975
|
+
value: input.destinationTokenAccount ?? null,
|
|
807
976
|
isWritable: true
|
|
808
977
|
},
|
|
809
|
-
airdrop: { value:
|
|
810
|
-
bitmap: { value:
|
|
811
|
-
mint: { value:
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
tokenProgram: { value: (_k = input.tokenProgram) != null ? _k : null, isWritable: false },
|
|
817
|
-
systemProgram: { value: (_l = input.systemProgram) != null ? _l : null, isWritable: false }
|
|
978
|
+
airdrop: { value: input.airdrop ?? null, isWritable: false },
|
|
979
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
980
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
981
|
+
claimer: { value: input.claimer ?? null, isWritable: true },
|
|
982
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
983
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
984
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
818
985
|
};
|
|
819
986
|
const accounts = originalAccounts;
|
|
820
|
-
const args =
|
|
987
|
+
const args = { ...input };
|
|
821
988
|
if (!accounts.treasury.value) {
|
|
822
989
|
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
823
990
|
}
|
|
@@ -835,8 +1002,6 @@ function getClaimTokensInstruction(input, config) {
|
|
|
835
1002
|
getAccountMeta(accounts.airdrop),
|
|
836
1003
|
getAccountMeta(accounts.bitmap),
|
|
837
1004
|
getAccountMeta(accounts.mint),
|
|
838
|
-
getAccountMeta(accounts.feeVault),
|
|
839
|
-
getAccountMeta(accounts.controller),
|
|
840
1005
|
getAccountMeta(accounts.claimer),
|
|
841
1006
|
getAccountMeta(accounts.treasury),
|
|
842
1007
|
getAccountMeta(accounts.tokenProgram),
|
|
@@ -850,7 +1015,7 @@ function getClaimTokensInstruction(input, config) {
|
|
|
850
1015
|
return instruction;
|
|
851
1016
|
}
|
|
852
1017
|
function parseClaimTokensInstruction(instruction) {
|
|
853
|
-
if (instruction.accounts.length <
|
|
1018
|
+
if (instruction.accounts.length < 9) {
|
|
854
1019
|
throw new Error("Not enough accounts");
|
|
855
1020
|
}
|
|
856
1021
|
let accountIndex = 0;
|
|
@@ -867,8 +1032,6 @@ function parseClaimTokensInstruction(instruction) {
|
|
|
867
1032
|
airdrop: getNextAccount(),
|
|
868
1033
|
bitmap: getNextAccount(),
|
|
869
1034
|
mint: getNextAccount(),
|
|
870
|
-
feeVault: getNextAccount(),
|
|
871
|
-
controller: getNextAccount(),
|
|
872
1035
|
claimer: getNextAccount(),
|
|
873
1036
|
treasury: getNextAccount(),
|
|
874
1037
|
tokenProgram: getNextAccount(),
|
|
@@ -879,7 +1042,7 @@ function parseClaimTokensInstruction(instruction) {
|
|
|
879
1042
|
}
|
|
880
1043
|
|
|
881
1044
|
// src/instructions/closeAirdrop.ts
|
|
882
|
-
var
|
|
1045
|
+
var import_kit10 = require("@solana/kit");
|
|
883
1046
|
var CLOSE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
884
1047
|
85,
|
|
885
1048
|
138,
|
|
@@ -891,54 +1054,124 @@ var CLOSE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
|
891
1054
|
4
|
|
892
1055
|
]);
|
|
893
1056
|
function getCloseAirdropDiscriminatorBytes() {
|
|
894
|
-
return (0,
|
|
1057
|
+
return (0, import_kit10.fixEncoderSize)((0, import_kit10.getBytesEncoder)(), 8).encode(
|
|
895
1058
|
CLOSE_AIRDROP_DISCRIMINATOR
|
|
896
1059
|
);
|
|
897
1060
|
}
|
|
898
1061
|
function getCloseAirdropInstructionDataEncoder() {
|
|
899
|
-
return (0,
|
|
900
|
-
(0,
|
|
901
|
-
(value) =>
|
|
1062
|
+
return (0, import_kit10.transformEncoder)(
|
|
1063
|
+
(0, import_kit10.getStructEncoder)([["discriminator", (0, import_kit10.fixEncoderSize)((0, import_kit10.getBytesEncoder)(), 8)]]),
|
|
1064
|
+
(value) => ({ ...value, discriminator: CLOSE_AIRDROP_DISCRIMINATOR })
|
|
902
1065
|
);
|
|
903
1066
|
}
|
|
904
1067
|
function getCloseAirdropInstructionDataDecoder() {
|
|
905
|
-
return (0,
|
|
906
|
-
["discriminator", (0,
|
|
1068
|
+
return (0, import_kit10.getStructDecoder)([
|
|
1069
|
+
["discriminator", (0, import_kit10.fixDecoderSize)((0, import_kit10.getBytesDecoder)(), 8)]
|
|
907
1070
|
]);
|
|
908
1071
|
}
|
|
909
1072
|
function getCloseAirdropInstructionDataCodec() {
|
|
910
|
-
return (0,
|
|
1073
|
+
return (0, import_kit10.combineCodec)(
|
|
911
1074
|
getCloseAirdropInstructionDataEncoder(),
|
|
912
1075
|
getCloseAirdropInstructionDataDecoder()
|
|
913
1076
|
);
|
|
914
1077
|
}
|
|
1078
|
+
async function getCloseAirdropInstructionAsync(input, config) {
|
|
1079
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1080
|
+
const originalAccounts = {
|
|
1081
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1082
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1083
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1084
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1085
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
1086
|
+
destinationTokenAccount: {
|
|
1087
|
+
value: input.destinationTokenAccount ?? null,
|
|
1088
|
+
isWritable: true
|
|
1089
|
+
},
|
|
1090
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1091
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1092
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1093
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1094
|
+
};
|
|
1095
|
+
const accounts = originalAccounts;
|
|
1096
|
+
if (!accounts.stats.value) {
|
|
1097
|
+
accounts.stats.value = await (0, import_kit10.getProgramDerivedAddress)({
|
|
1098
|
+
programAddress,
|
|
1099
|
+
seeds: [
|
|
1100
|
+
(0, import_kit10.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1101
|
+
]
|
|
1102
|
+
});
|
|
1103
|
+
}
|
|
1104
|
+
if (!accounts.feeVault.value) {
|
|
1105
|
+
accounts.feeVault.value = await (0, import_kit10.getProgramDerivedAddress)({
|
|
1106
|
+
programAddress,
|
|
1107
|
+
seeds: [
|
|
1108
|
+
(0, import_kit10.getBytesEncoder)().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1109
|
+
(0, import_kit10.getAddressEncoder)().encode(expectAddress(accounts.controller.value))
|
|
1110
|
+
]
|
|
1111
|
+
});
|
|
1112
|
+
}
|
|
1113
|
+
if (!accounts.tokenProgram.value) {
|
|
1114
|
+
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
1115
|
+
}
|
|
1116
|
+
if (!accounts.systemProgram.value) {
|
|
1117
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1118
|
+
}
|
|
1119
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1120
|
+
const instruction = {
|
|
1121
|
+
accounts: [
|
|
1122
|
+
getAccountMeta(accounts.stats),
|
|
1123
|
+
getAccountMeta(accounts.controller),
|
|
1124
|
+
getAccountMeta(accounts.feeVault),
|
|
1125
|
+
getAccountMeta(accounts.airdrop),
|
|
1126
|
+
getAccountMeta(accounts.vault),
|
|
1127
|
+
getAccountMeta(accounts.destinationTokenAccount),
|
|
1128
|
+
getAccountMeta(accounts.authority),
|
|
1129
|
+
getAccountMeta(accounts.mint),
|
|
1130
|
+
getAccountMeta(accounts.tokenProgram),
|
|
1131
|
+
getAccountMeta(accounts.systemProgram)
|
|
1132
|
+
],
|
|
1133
|
+
programAddress,
|
|
1134
|
+
data: getCloseAirdropInstructionDataEncoder().encode({})
|
|
1135
|
+
};
|
|
1136
|
+
return instruction;
|
|
1137
|
+
}
|
|
915
1138
|
function getCloseAirdropInstruction(input, config) {
|
|
916
|
-
|
|
917
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1139
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
918
1140
|
const originalAccounts = {
|
|
919
|
-
|
|
920
|
-
|
|
1141
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1142
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1143
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1144
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1145
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
921
1146
|
destinationTokenAccount: {
|
|
922
|
-
value:
|
|
1147
|
+
value: input.destinationTokenAccount ?? null,
|
|
923
1148
|
isWritable: true
|
|
924
1149
|
},
|
|
925
|
-
|
|
926
|
-
mint: { value:
|
|
927
|
-
tokenProgram: { value:
|
|
1150
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1151
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1152
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1153
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
928
1154
|
};
|
|
929
1155
|
const accounts = originalAccounts;
|
|
930
1156
|
if (!accounts.tokenProgram.value) {
|
|
931
1157
|
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
932
1158
|
}
|
|
1159
|
+
if (!accounts.systemProgram.value) {
|
|
1160
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1161
|
+
}
|
|
933
1162
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
934
1163
|
const instruction = {
|
|
935
1164
|
accounts: [
|
|
1165
|
+
getAccountMeta(accounts.stats),
|
|
1166
|
+
getAccountMeta(accounts.controller),
|
|
1167
|
+
getAccountMeta(accounts.feeVault),
|
|
936
1168
|
getAccountMeta(accounts.airdrop),
|
|
937
1169
|
getAccountMeta(accounts.vault),
|
|
938
1170
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
939
|
-
getAccountMeta(accounts.
|
|
1171
|
+
getAccountMeta(accounts.authority),
|
|
940
1172
|
getAccountMeta(accounts.mint),
|
|
941
|
-
getAccountMeta(accounts.tokenProgram)
|
|
1173
|
+
getAccountMeta(accounts.tokenProgram),
|
|
1174
|
+
getAccountMeta(accounts.systemProgram)
|
|
942
1175
|
],
|
|
943
1176
|
programAddress,
|
|
944
1177
|
data: getCloseAirdropInstructionDataEncoder().encode({})
|
|
@@ -946,7 +1179,7 @@ function getCloseAirdropInstruction(input, config) {
|
|
|
946
1179
|
return instruction;
|
|
947
1180
|
}
|
|
948
1181
|
function parseCloseAirdropInstruction(instruction) {
|
|
949
|
-
if (instruction.accounts.length <
|
|
1182
|
+
if (instruction.accounts.length < 10) {
|
|
950
1183
|
throw new Error("Not enough accounts");
|
|
951
1184
|
}
|
|
952
1185
|
let accountIndex = 0;
|
|
@@ -958,19 +1191,23 @@ function parseCloseAirdropInstruction(instruction) {
|
|
|
958
1191
|
return {
|
|
959
1192
|
programAddress: instruction.programAddress,
|
|
960
1193
|
accounts: {
|
|
1194
|
+
stats: getNextAccount(),
|
|
1195
|
+
controller: getNextAccount(),
|
|
1196
|
+
feeVault: getNextAccount(),
|
|
961
1197
|
airdrop: getNextAccount(),
|
|
962
1198
|
vault: getNextAccount(),
|
|
963
1199
|
destinationTokenAccount: getNextAccount(),
|
|
964
|
-
|
|
1200
|
+
authority: getNextAccount(),
|
|
965
1201
|
mint: getNextAccount(),
|
|
966
|
-
tokenProgram: getNextAccount()
|
|
1202
|
+
tokenProgram: getNextAccount(),
|
|
1203
|
+
systemProgram: getNextAccount()
|
|
967
1204
|
},
|
|
968
1205
|
data: getCloseAirdropInstructionDataDecoder().decode(instruction.data)
|
|
969
1206
|
};
|
|
970
1207
|
}
|
|
971
1208
|
|
|
972
1209
|
// src/instructions/closeBitmap.ts
|
|
973
|
-
var
|
|
1210
|
+
var import_kit11 = require("@solana/kit");
|
|
974
1211
|
var CLOSE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
975
1212
|
59,
|
|
976
1213
|
123,
|
|
@@ -982,42 +1219,107 @@ var CLOSE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
|
982
1219
|
118
|
|
983
1220
|
]);
|
|
984
1221
|
function getCloseBitmapDiscriminatorBytes() {
|
|
985
|
-
return (0,
|
|
1222
|
+
return (0, import_kit11.fixEncoderSize)((0, import_kit11.getBytesEncoder)(), 8).encode(
|
|
986
1223
|
CLOSE_BITMAP_DISCRIMINATOR
|
|
987
1224
|
);
|
|
988
1225
|
}
|
|
989
1226
|
function getCloseBitmapInstructionDataEncoder() {
|
|
990
|
-
return (0,
|
|
991
|
-
(0,
|
|
992
|
-
(value) =>
|
|
1227
|
+
return (0, import_kit11.transformEncoder)(
|
|
1228
|
+
(0, import_kit11.getStructEncoder)([["discriminator", (0, import_kit11.fixEncoderSize)((0, import_kit11.getBytesEncoder)(), 8)]]),
|
|
1229
|
+
(value) => ({ ...value, discriminator: CLOSE_BITMAP_DISCRIMINATOR })
|
|
993
1230
|
);
|
|
994
1231
|
}
|
|
995
1232
|
function getCloseBitmapInstructionDataDecoder() {
|
|
996
|
-
return (0,
|
|
997
|
-
["discriminator", (0,
|
|
1233
|
+
return (0, import_kit11.getStructDecoder)([
|
|
1234
|
+
["discriminator", (0, import_kit11.fixDecoderSize)((0, import_kit11.getBytesDecoder)(), 8)]
|
|
998
1235
|
]);
|
|
999
1236
|
}
|
|
1000
1237
|
function getCloseBitmapInstructionDataCodec() {
|
|
1001
|
-
return (0,
|
|
1238
|
+
return (0, import_kit11.combineCodec)(
|
|
1002
1239
|
getCloseBitmapInstructionDataEncoder(),
|
|
1003
1240
|
getCloseBitmapInstructionDataDecoder()
|
|
1004
1241
|
);
|
|
1005
1242
|
}
|
|
1243
|
+
async function getCloseBitmapInstructionAsync(input, config) {
|
|
1244
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1245
|
+
const originalAccounts = {
|
|
1246
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1247
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1248
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1249
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1250
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1251
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1252
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1253
|
+
};
|
|
1254
|
+
const accounts = originalAccounts;
|
|
1255
|
+
if (!accounts.master.value) {
|
|
1256
|
+
accounts.master.value = await (0, import_kit11.getProgramDerivedAddress)({
|
|
1257
|
+
programAddress,
|
|
1258
|
+
seeds: [
|
|
1259
|
+
(0, import_kit11.getBytesEncoder)().encode(
|
|
1260
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1261
|
+
)
|
|
1262
|
+
]
|
|
1263
|
+
});
|
|
1264
|
+
}
|
|
1265
|
+
if (!accounts.stats.value) {
|
|
1266
|
+
accounts.stats.value = await (0, import_kit11.getProgramDerivedAddress)({
|
|
1267
|
+
programAddress,
|
|
1268
|
+
seeds: [
|
|
1269
|
+
(0, import_kit11.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1270
|
+
]
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
if (!accounts.treasury.value) {
|
|
1274
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1275
|
+
}
|
|
1276
|
+
if (!accounts.systemProgram.value) {
|
|
1277
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1278
|
+
}
|
|
1279
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1280
|
+
const instruction = {
|
|
1281
|
+
accounts: [
|
|
1282
|
+
getAccountMeta(accounts.master),
|
|
1283
|
+
getAccountMeta(accounts.stats),
|
|
1284
|
+
getAccountMeta(accounts.airdrop),
|
|
1285
|
+
getAccountMeta(accounts.bitmap),
|
|
1286
|
+
getAccountMeta(accounts.treasury),
|
|
1287
|
+
getAccountMeta(accounts.authority),
|
|
1288
|
+
getAccountMeta(accounts.systemProgram)
|
|
1289
|
+
],
|
|
1290
|
+
programAddress,
|
|
1291
|
+
data: getCloseBitmapInstructionDataEncoder().encode({})
|
|
1292
|
+
};
|
|
1293
|
+
return instruction;
|
|
1294
|
+
}
|
|
1006
1295
|
function getCloseBitmapInstruction(input, config) {
|
|
1007
|
-
|
|
1008
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1296
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1009
1297
|
const originalAccounts = {
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1298
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1299
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1300
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1301
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1302
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1303
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1304
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1013
1305
|
};
|
|
1014
1306
|
const accounts = originalAccounts;
|
|
1307
|
+
if (!accounts.treasury.value) {
|
|
1308
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1309
|
+
}
|
|
1310
|
+
if (!accounts.systemProgram.value) {
|
|
1311
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1312
|
+
}
|
|
1015
1313
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1016
1314
|
const instruction = {
|
|
1017
1315
|
accounts: [
|
|
1316
|
+
getAccountMeta(accounts.master),
|
|
1317
|
+
getAccountMeta(accounts.stats),
|
|
1018
1318
|
getAccountMeta(accounts.airdrop),
|
|
1019
1319
|
getAccountMeta(accounts.bitmap),
|
|
1020
|
-
getAccountMeta(accounts.
|
|
1320
|
+
getAccountMeta(accounts.treasury),
|
|
1321
|
+
getAccountMeta(accounts.authority),
|
|
1322
|
+
getAccountMeta(accounts.systemProgram)
|
|
1021
1323
|
],
|
|
1022
1324
|
programAddress,
|
|
1023
1325
|
data: getCloseBitmapInstructionDataEncoder().encode({})
|
|
@@ -1025,7 +1327,7 @@ function getCloseBitmapInstruction(input, config) {
|
|
|
1025
1327
|
return instruction;
|
|
1026
1328
|
}
|
|
1027
1329
|
function parseCloseBitmapInstruction(instruction) {
|
|
1028
|
-
if (instruction.accounts.length <
|
|
1330
|
+
if (instruction.accounts.length < 7) {
|
|
1029
1331
|
throw new Error("Not enough accounts");
|
|
1030
1332
|
}
|
|
1031
1333
|
let accountIndex = 0;
|
|
@@ -1037,16 +1339,20 @@ function parseCloseBitmapInstruction(instruction) {
|
|
|
1037
1339
|
return {
|
|
1038
1340
|
programAddress: instruction.programAddress,
|
|
1039
1341
|
accounts: {
|
|
1342
|
+
master: getNextAccount(),
|
|
1343
|
+
stats: getNextAccount(),
|
|
1040
1344
|
airdrop: getNextAccount(),
|
|
1041
1345
|
bitmap: getNextAccount(),
|
|
1042
|
-
|
|
1346
|
+
treasury: getNextAccount(),
|
|
1347
|
+
authority: getNextAccount(),
|
|
1348
|
+
systemProgram: getNextAccount()
|
|
1043
1349
|
},
|
|
1044
1350
|
data: getCloseBitmapInstructionDataDecoder().decode(instruction.data)
|
|
1045
1351
|
};
|
|
1046
1352
|
}
|
|
1047
1353
|
|
|
1048
1354
|
// src/instructions/depositTokens.ts
|
|
1049
|
-
var
|
|
1355
|
+
var import_kit12 = require("@solana/kit");
|
|
1050
1356
|
var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
1051
1357
|
176,
|
|
1052
1358
|
83,
|
|
@@ -1058,47 +1364,46 @@ var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
1058
1364
|
150
|
|
1059
1365
|
]);
|
|
1060
1366
|
function getDepositTokensDiscriminatorBytes() {
|
|
1061
|
-
return (0,
|
|
1367
|
+
return (0, import_kit12.fixEncoderSize)((0, import_kit12.getBytesEncoder)(), 8).encode(
|
|
1062
1368
|
DEPOSIT_TOKENS_DISCRIMINATOR
|
|
1063
1369
|
);
|
|
1064
1370
|
}
|
|
1065
1371
|
function getDepositTokensInstructionDataEncoder() {
|
|
1066
|
-
return (0,
|
|
1067
|
-
(0,
|
|
1068
|
-
["discriminator", (0,
|
|
1069
|
-
["amount", (0,
|
|
1372
|
+
return (0, import_kit12.transformEncoder)(
|
|
1373
|
+
(0, import_kit12.getStructEncoder)([
|
|
1374
|
+
["discriminator", (0, import_kit12.fixEncoderSize)((0, import_kit12.getBytesEncoder)(), 8)],
|
|
1375
|
+
["amount", (0, import_kit12.getU64Encoder)()]
|
|
1070
1376
|
]),
|
|
1071
|
-
(value) =>
|
|
1377
|
+
(value) => ({ ...value, discriminator: DEPOSIT_TOKENS_DISCRIMINATOR })
|
|
1072
1378
|
);
|
|
1073
1379
|
}
|
|
1074
1380
|
function getDepositTokensInstructionDataDecoder() {
|
|
1075
|
-
return (0,
|
|
1076
|
-
["discriminator", (0,
|
|
1077
|
-
["amount", (0,
|
|
1381
|
+
return (0, import_kit12.getStructDecoder)([
|
|
1382
|
+
["discriminator", (0, import_kit12.fixDecoderSize)((0, import_kit12.getBytesDecoder)(), 8)],
|
|
1383
|
+
["amount", (0, import_kit12.getU64Decoder)()]
|
|
1078
1384
|
]);
|
|
1079
1385
|
}
|
|
1080
1386
|
function getDepositTokensInstructionDataCodec() {
|
|
1081
|
-
return (0,
|
|
1387
|
+
return (0, import_kit12.combineCodec)(
|
|
1082
1388
|
getDepositTokensInstructionDataEncoder(),
|
|
1083
1389
|
getDepositTokensInstructionDataDecoder()
|
|
1084
1390
|
);
|
|
1085
1391
|
}
|
|
1086
1392
|
function getDepositTokensInstruction(input, config) {
|
|
1087
|
-
|
|
1088
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1393
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1089
1394
|
const originalAccounts = {
|
|
1090
1395
|
sourceTokenAccount: {
|
|
1091
|
-
value:
|
|
1396
|
+
value: input.sourceTokenAccount ?? null,
|
|
1092
1397
|
isWritable: true
|
|
1093
1398
|
},
|
|
1094
|
-
vault: { value:
|
|
1095
|
-
airdrop: { value:
|
|
1096
|
-
mint: { value:
|
|
1097
|
-
|
|
1098
|
-
tokenProgram: { value:
|
|
1399
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
1400
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1401
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1402
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
1403
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
|
|
1099
1404
|
};
|
|
1100
1405
|
const accounts = originalAccounts;
|
|
1101
|
-
const args =
|
|
1406
|
+
const args = { ...input };
|
|
1102
1407
|
if (!accounts.tokenProgram.value) {
|
|
1103
1408
|
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
1104
1409
|
}
|
|
@@ -1109,7 +1414,7 @@ function getDepositTokensInstruction(input, config) {
|
|
|
1109
1414
|
getAccountMeta(accounts.vault),
|
|
1110
1415
|
getAccountMeta(accounts.airdrop),
|
|
1111
1416
|
getAccountMeta(accounts.mint),
|
|
1112
|
-
getAccountMeta(accounts.
|
|
1417
|
+
getAccountMeta(accounts.authority),
|
|
1113
1418
|
getAccountMeta(accounts.tokenProgram)
|
|
1114
1419
|
],
|
|
1115
1420
|
programAddress,
|
|
@@ -1136,7 +1441,7 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
1136
1441
|
vault: getNextAccount(),
|
|
1137
1442
|
airdrop: getNextAccount(),
|
|
1138
1443
|
mint: getNextAccount(),
|
|
1139
|
-
|
|
1444
|
+
authority: getNextAccount(),
|
|
1140
1445
|
tokenProgram: getNextAccount()
|
|
1141
1446
|
},
|
|
1142
1447
|
data: getDepositTokensInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1144,7 +1449,7 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
1144
1449
|
}
|
|
1145
1450
|
|
|
1146
1451
|
// src/instructions/initializeAirdrop.ts
|
|
1147
|
-
var
|
|
1452
|
+
var import_kit13 = require("@solana/kit");
|
|
1148
1453
|
var INITIALIZE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1149
1454
|
96,
|
|
1150
1455
|
196,
|
|
@@ -1156,119 +1461,123 @@ var INITIALIZE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
|
1156
1461
|
184
|
|
1157
1462
|
]);
|
|
1158
1463
|
function getInitializeAirdropDiscriminatorBytes() {
|
|
1159
|
-
return (0,
|
|
1464
|
+
return (0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8).encode(
|
|
1160
1465
|
INITIALIZE_AIRDROP_DISCRIMINATOR
|
|
1161
1466
|
);
|
|
1162
1467
|
}
|
|
1163
1468
|
function getInitializeAirdropInstructionDataEncoder() {
|
|
1164
|
-
return (0,
|
|
1165
|
-
(0,
|
|
1166
|
-
["discriminator", (0,
|
|
1167
|
-
["
|
|
1168
|
-
["
|
|
1169
|
-
["
|
|
1170
|
-
["endTime", (0, import_kit11.getI64Encoder)()]
|
|
1469
|
+
return (0, import_kit13.transformEncoder)(
|
|
1470
|
+
(0, import_kit13.getStructEncoder)([
|
|
1471
|
+
["discriminator", (0, import_kit13.fixEncoderSize)((0, import_kit13.getBytesEncoder)(), 8)],
|
|
1472
|
+
["merkleRoot", (0, import_kit13.getArrayEncoder)((0, import_kit13.getU8Encoder)(), { size: 32 })],
|
|
1473
|
+
["startsTime", (0, import_kit13.getOptionEncoder)((0, import_kit13.getI64Encoder)())],
|
|
1474
|
+
["endTime", (0, import_kit13.getOptionEncoder)((0, import_kit13.getI64Encoder)())]
|
|
1171
1475
|
]),
|
|
1172
|
-
(value) =>
|
|
1476
|
+
(value) => ({ ...value, discriminator: INITIALIZE_AIRDROP_DISCRIMINATOR })
|
|
1173
1477
|
);
|
|
1174
1478
|
}
|
|
1175
1479
|
function getInitializeAirdropInstructionDataDecoder() {
|
|
1176
|
-
return (0,
|
|
1177
|
-
["discriminator", (0,
|
|
1178
|
-
["
|
|
1179
|
-
["
|
|
1180
|
-
["
|
|
1181
|
-
["endTime", (0, import_kit11.getI64Decoder)()]
|
|
1480
|
+
return (0, import_kit13.getStructDecoder)([
|
|
1481
|
+
["discriminator", (0, import_kit13.fixDecoderSize)((0, import_kit13.getBytesDecoder)(), 8)],
|
|
1482
|
+
["merkleRoot", (0, import_kit13.getArrayDecoder)((0, import_kit13.getU8Decoder)(), { size: 32 })],
|
|
1483
|
+
["startsTime", (0, import_kit13.getOptionDecoder)((0, import_kit13.getI64Decoder)())],
|
|
1484
|
+
["endTime", (0, import_kit13.getOptionDecoder)((0, import_kit13.getI64Decoder)())]
|
|
1182
1485
|
]);
|
|
1183
1486
|
}
|
|
1184
1487
|
function getInitializeAirdropInstructionDataCodec() {
|
|
1185
|
-
return (0,
|
|
1488
|
+
return (0, import_kit13.combineCodec)(
|
|
1186
1489
|
getInitializeAirdropInstructionDataEncoder(),
|
|
1187
1490
|
getInitializeAirdropInstructionDataDecoder()
|
|
1188
1491
|
);
|
|
1189
1492
|
}
|
|
1190
|
-
function getInitializeAirdropInstructionAsync(input, config) {
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
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
|
-
],
|
|
1493
|
+
async function getInitializeAirdropInstructionAsync(input, config) {
|
|
1494
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1495
|
+
const originalAccounts = {
|
|
1496
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1497
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1498
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1499
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1500
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1501
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1502
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1503
|
+
};
|
|
1504
|
+
const accounts = originalAccounts;
|
|
1505
|
+
const args = { ...input };
|
|
1506
|
+
if (!accounts.stats.value) {
|
|
1507
|
+
accounts.stats.value = await (0, import_kit13.getProgramDerivedAddress)({
|
|
1235
1508
|
programAddress,
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
};
|
|
1240
|
-
|
|
1241
|
-
|
|
1509
|
+
seeds: [
|
|
1510
|
+
(0, import_kit13.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1511
|
+
]
|
|
1512
|
+
});
|
|
1513
|
+
}
|
|
1514
|
+
if (!accounts.airdrop.value) {
|
|
1515
|
+
accounts.airdrop.value = await (0, import_kit13.getProgramDerivedAddress)({
|
|
1516
|
+
programAddress,
|
|
1517
|
+
seeds: [
|
|
1518
|
+
(0, import_kit13.getBytesEncoder)().encode(
|
|
1519
|
+
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1520
|
+
),
|
|
1521
|
+
(0, import_kit13.getAddressEncoder)().encode(expectAddress(accounts.mint.value)),
|
|
1522
|
+
(0, import_kit13.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
1523
|
+
]
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
if (!accounts.feeVault.value) {
|
|
1527
|
+
accounts.feeVault.value = await (0, import_kit13.getProgramDerivedAddress)({
|
|
1528
|
+
programAddress,
|
|
1529
|
+
seeds: [
|
|
1530
|
+
(0, import_kit13.getBytesEncoder)().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1531
|
+
(0, import_kit13.getAddressEncoder)().encode(expectAddress(accounts.controller.value))
|
|
1532
|
+
]
|
|
1533
|
+
});
|
|
1534
|
+
}
|
|
1535
|
+
if (!accounts.systemProgram.value) {
|
|
1536
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1537
|
+
}
|
|
1538
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1539
|
+
const instruction = {
|
|
1540
|
+
accounts: [
|
|
1541
|
+
getAccountMeta(accounts.stats),
|
|
1542
|
+
getAccountMeta(accounts.controller),
|
|
1543
|
+
getAccountMeta(accounts.airdrop),
|
|
1544
|
+
getAccountMeta(accounts.feeVault),
|
|
1545
|
+
getAccountMeta(accounts.mint),
|
|
1546
|
+
getAccountMeta(accounts.authority),
|
|
1547
|
+
getAccountMeta(accounts.systemProgram)
|
|
1548
|
+
],
|
|
1549
|
+
programAddress,
|
|
1550
|
+
data: getInitializeAirdropInstructionDataEncoder().encode(
|
|
1551
|
+
args
|
|
1552
|
+
)
|
|
1553
|
+
};
|
|
1554
|
+
return instruction;
|
|
1242
1555
|
}
|
|
1243
1556
|
function getInitializeAirdropInstruction(input, config) {
|
|
1244
|
-
|
|
1245
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1557
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1246
1558
|
const originalAccounts = {
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
feeVault: { value:
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
systemProgram: { value:
|
|
1559
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1560
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1561
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1562
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1563
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1564
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1565
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1254
1566
|
};
|
|
1255
1567
|
const accounts = originalAccounts;
|
|
1256
|
-
const args =
|
|
1257
|
-
if (!accounts.treasury.value) {
|
|
1258
|
-
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1259
|
-
}
|
|
1568
|
+
const args = { ...input };
|
|
1260
1569
|
if (!accounts.systemProgram.value) {
|
|
1261
1570
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1262
1571
|
}
|
|
1263
1572
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1264
1573
|
const instruction = {
|
|
1265
1574
|
accounts: [
|
|
1266
|
-
getAccountMeta(accounts.
|
|
1267
|
-
getAccountMeta(accounts.airdrop),
|
|
1575
|
+
getAccountMeta(accounts.stats),
|
|
1268
1576
|
getAccountMeta(accounts.controller),
|
|
1577
|
+
getAccountMeta(accounts.airdrop),
|
|
1269
1578
|
getAccountMeta(accounts.feeVault),
|
|
1270
|
-
getAccountMeta(accounts.
|
|
1271
|
-
getAccountMeta(accounts.
|
|
1579
|
+
getAccountMeta(accounts.mint),
|
|
1580
|
+
getAccountMeta(accounts.authority),
|
|
1272
1581
|
getAccountMeta(accounts.systemProgram)
|
|
1273
1582
|
],
|
|
1274
1583
|
programAddress,
|
|
@@ -1291,12 +1600,12 @@ function parseInitializeAirdropInstruction(instruction) {
|
|
|
1291
1600
|
return {
|
|
1292
1601
|
programAddress: instruction.programAddress,
|
|
1293
1602
|
accounts: {
|
|
1294
|
-
|
|
1295
|
-
airdrop: getNextAccount(),
|
|
1603
|
+
stats: getNextAccount(),
|
|
1296
1604
|
controller: getNextAccount(),
|
|
1605
|
+
airdrop: getNextAccount(),
|
|
1297
1606
|
feeVault: getNextAccount(),
|
|
1298
|
-
|
|
1299
|
-
|
|
1607
|
+
mint: getNextAccount(),
|
|
1608
|
+
authority: getNextAccount(),
|
|
1300
1609
|
systemProgram: getNextAccount()
|
|
1301
1610
|
},
|
|
1302
1611
|
data: getInitializeAirdropInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1304,7 +1613,7 @@ function parseInitializeAirdropInstruction(instruction) {
|
|
|
1304
1613
|
}
|
|
1305
1614
|
|
|
1306
1615
|
// src/instructions/initializeBitmap.ts
|
|
1307
|
-
var
|
|
1616
|
+
var import_kit14 = require("@solana/kit");
|
|
1308
1617
|
var INITIALIZE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
1309
1618
|
25,
|
|
1310
1619
|
109,
|
|
@@ -1316,94 +1625,126 @@ var INITIALIZE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
|
1316
1625
|
69
|
|
1317
1626
|
]);
|
|
1318
1627
|
function getInitializeBitmapDiscriminatorBytes() {
|
|
1319
|
-
return (0,
|
|
1628
|
+
return (0, import_kit14.fixEncoderSize)((0, import_kit14.getBytesEncoder)(), 8).encode(
|
|
1320
1629
|
INITIALIZE_BITMAP_DISCRIMINATOR
|
|
1321
1630
|
);
|
|
1322
1631
|
}
|
|
1323
1632
|
function getInitializeBitmapInstructionDataEncoder() {
|
|
1324
|
-
return (0,
|
|
1325
|
-
(0,
|
|
1326
|
-
["discriminator", (0,
|
|
1327
|
-
["id", (0,
|
|
1328
|
-
["total", (0,
|
|
1633
|
+
return (0, import_kit14.transformEncoder)(
|
|
1634
|
+
(0, import_kit14.getStructEncoder)([
|
|
1635
|
+
["discriminator", (0, import_kit14.fixEncoderSize)((0, import_kit14.getBytesEncoder)(), 8)],
|
|
1636
|
+
["id", (0, import_kit14.getU8Encoder)()],
|
|
1637
|
+
["total", (0, import_kit14.getU64Encoder)()]
|
|
1329
1638
|
]),
|
|
1330
|
-
(value) =>
|
|
1639
|
+
(value) => ({ ...value, discriminator: INITIALIZE_BITMAP_DISCRIMINATOR })
|
|
1331
1640
|
);
|
|
1332
1641
|
}
|
|
1333
1642
|
function getInitializeBitmapInstructionDataDecoder() {
|
|
1334
|
-
return (0,
|
|
1335
|
-
["discriminator", (0,
|
|
1336
|
-
["id", (0,
|
|
1337
|
-
["total", (0,
|
|
1643
|
+
return (0, import_kit14.getStructDecoder)([
|
|
1644
|
+
["discriminator", (0, import_kit14.fixDecoderSize)((0, import_kit14.getBytesDecoder)(), 8)],
|
|
1645
|
+
["id", (0, import_kit14.getU8Decoder)()],
|
|
1646
|
+
["total", (0, import_kit14.getU64Decoder)()]
|
|
1338
1647
|
]);
|
|
1339
1648
|
}
|
|
1340
1649
|
function getInitializeBitmapInstructionDataCodec() {
|
|
1341
|
-
return (0,
|
|
1650
|
+
return (0, import_kit14.combineCodec)(
|
|
1342
1651
|
getInitializeBitmapInstructionDataEncoder(),
|
|
1343
1652
|
getInitializeBitmapInstructionDataDecoder()
|
|
1344
1653
|
);
|
|
1345
1654
|
}
|
|
1346
|
-
function getInitializeBitmapInstructionAsync(input, config) {
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
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
|
-
],
|
|
1655
|
+
async function getInitializeBitmapInstructionAsync(input, config) {
|
|
1656
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1657
|
+
const originalAccounts = {
|
|
1658
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1659
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1660
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1661
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1662
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1663
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1664
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1665
|
+
};
|
|
1666
|
+
const accounts = originalAccounts;
|
|
1667
|
+
const args = { ...input };
|
|
1668
|
+
if (!accounts.master.value) {
|
|
1669
|
+
accounts.master.value = await (0, import_kit14.getProgramDerivedAddress)({
|
|
1379
1670
|
programAddress,
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1671
|
+
seeds: [
|
|
1672
|
+
(0, import_kit14.getBytesEncoder)().encode(
|
|
1673
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1674
|
+
)
|
|
1675
|
+
]
|
|
1676
|
+
});
|
|
1677
|
+
}
|
|
1678
|
+
if (!accounts.stats.value) {
|
|
1679
|
+
accounts.stats.value = await (0, import_kit14.getProgramDerivedAddress)({
|
|
1680
|
+
programAddress,
|
|
1681
|
+
seeds: [
|
|
1682
|
+
(0, import_kit14.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1683
|
+
]
|
|
1684
|
+
});
|
|
1685
|
+
}
|
|
1686
|
+
if (!accounts.bitmap.value) {
|
|
1687
|
+
accounts.bitmap.value = await (0, import_kit14.getProgramDerivedAddress)({
|
|
1688
|
+
programAddress,
|
|
1689
|
+
seeds: [
|
|
1690
|
+
(0, import_kit14.getBytesEncoder)().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
1691
|
+
(0, import_kit14.getAddressEncoder)().encode(expectAddress(accounts.airdrop.value)),
|
|
1692
|
+
(0, import_kit14.getU8Encoder)().encode(expectSome(args.id))
|
|
1693
|
+
]
|
|
1694
|
+
});
|
|
1695
|
+
}
|
|
1696
|
+
if (!accounts.treasury.value) {
|
|
1697
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1698
|
+
}
|
|
1699
|
+
if (!accounts.systemProgram.value) {
|
|
1700
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1701
|
+
}
|
|
1702
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1703
|
+
const instruction = {
|
|
1704
|
+
accounts: [
|
|
1705
|
+
getAccountMeta(accounts.master),
|
|
1706
|
+
getAccountMeta(accounts.stats),
|
|
1707
|
+
getAccountMeta(accounts.bitmap),
|
|
1708
|
+
getAccountMeta(accounts.airdrop),
|
|
1709
|
+
getAccountMeta(accounts.treasury),
|
|
1710
|
+
getAccountMeta(accounts.authority),
|
|
1711
|
+
getAccountMeta(accounts.systemProgram)
|
|
1712
|
+
],
|
|
1713
|
+
programAddress,
|
|
1714
|
+
data: getInitializeBitmapInstructionDataEncoder().encode(
|
|
1715
|
+
args
|
|
1716
|
+
)
|
|
1717
|
+
};
|
|
1718
|
+
return instruction;
|
|
1386
1719
|
}
|
|
1387
1720
|
function getInitializeBitmapInstruction(input, config) {
|
|
1388
|
-
|
|
1389
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1721
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1390
1722
|
const originalAccounts = {
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1723
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1724
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1725
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1726
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1727
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1728
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1729
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1395
1730
|
};
|
|
1396
1731
|
const accounts = originalAccounts;
|
|
1397
|
-
const args =
|
|
1732
|
+
const args = { ...input };
|
|
1733
|
+
if (!accounts.treasury.value) {
|
|
1734
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1735
|
+
}
|
|
1398
1736
|
if (!accounts.systemProgram.value) {
|
|
1399
1737
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1400
1738
|
}
|
|
1401
1739
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1402
1740
|
const instruction = {
|
|
1403
1741
|
accounts: [
|
|
1742
|
+
getAccountMeta(accounts.master),
|
|
1743
|
+
getAccountMeta(accounts.stats),
|
|
1404
1744
|
getAccountMeta(accounts.bitmap),
|
|
1405
1745
|
getAccountMeta(accounts.airdrop),
|
|
1406
|
-
getAccountMeta(accounts.
|
|
1746
|
+
getAccountMeta(accounts.treasury),
|
|
1747
|
+
getAccountMeta(accounts.authority),
|
|
1407
1748
|
getAccountMeta(accounts.systemProgram)
|
|
1408
1749
|
],
|
|
1409
1750
|
programAddress,
|
|
@@ -1414,7 +1755,7 @@ function getInitializeBitmapInstruction(input, config) {
|
|
|
1414
1755
|
return instruction;
|
|
1415
1756
|
}
|
|
1416
1757
|
function parseInitializeBitmapInstruction(instruction) {
|
|
1417
|
-
if (instruction.accounts.length <
|
|
1758
|
+
if (instruction.accounts.length < 7) {
|
|
1418
1759
|
throw new Error("Not enough accounts");
|
|
1419
1760
|
}
|
|
1420
1761
|
let accountIndex = 0;
|
|
@@ -1426,9 +1767,12 @@ function parseInitializeBitmapInstruction(instruction) {
|
|
|
1426
1767
|
return {
|
|
1427
1768
|
programAddress: instruction.programAddress,
|
|
1428
1769
|
accounts: {
|
|
1770
|
+
master: getNextAccount(),
|
|
1771
|
+
stats: getNextAccount(),
|
|
1429
1772
|
bitmap: getNextAccount(),
|
|
1430
1773
|
airdrop: getNextAccount(),
|
|
1431
|
-
|
|
1774
|
+
treasury: getNextAccount(),
|
|
1775
|
+
authority: getNextAccount(),
|
|
1432
1776
|
systemProgram: getNextAccount()
|
|
1433
1777
|
},
|
|
1434
1778
|
data: getInitializeBitmapInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1436,7 +1780,7 @@ function parseInitializeBitmapInstruction(instruction) {
|
|
|
1436
1780
|
}
|
|
1437
1781
|
|
|
1438
1782
|
// src/instructions/initializeController.ts
|
|
1439
|
-
var
|
|
1783
|
+
var import_kit15 = require("@solana/kit");
|
|
1440
1784
|
var INITIALIZE_CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
1441
1785
|
137,
|
|
1442
1786
|
255,
|
|
@@ -1448,112 +1792,140 @@ var INITIALIZE_CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
|
1448
1792
|
81
|
|
1449
1793
|
]);
|
|
1450
1794
|
function getInitializeControllerDiscriminatorBytes() {
|
|
1451
|
-
return (0,
|
|
1795
|
+
return (0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8).encode(
|
|
1452
1796
|
INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1453
1797
|
);
|
|
1454
1798
|
}
|
|
1455
1799
|
function getInitializeControllerInstructionDataEncoder() {
|
|
1456
|
-
return (0,
|
|
1457
|
-
(0,
|
|
1458
|
-
["discriminator", (0,
|
|
1459
|
-
["
|
|
1460
|
-
["claimFee", (0, import_kit13.getU64Encoder)()]
|
|
1800
|
+
return (0, import_kit15.transformEncoder)(
|
|
1801
|
+
(0, import_kit15.getStructEncoder)([
|
|
1802
|
+
["discriminator", (0, import_kit15.fixEncoderSize)((0, import_kit15.getBytesEncoder)(), 8)],
|
|
1803
|
+
["feeLamports", (0, import_kit15.getU64Encoder)()]
|
|
1461
1804
|
]),
|
|
1462
|
-
(value) =>
|
|
1805
|
+
(value) => ({
|
|
1806
|
+
...value,
|
|
1463
1807
|
discriminator: INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1464
1808
|
})
|
|
1465
1809
|
);
|
|
1466
1810
|
}
|
|
1467
1811
|
function getInitializeControllerInstructionDataDecoder() {
|
|
1468
|
-
return (0,
|
|
1469
|
-
["discriminator", (0,
|
|
1470
|
-
["
|
|
1471
|
-
["claimFee", (0, import_kit13.getU64Decoder)()]
|
|
1812
|
+
return (0, import_kit15.getStructDecoder)([
|
|
1813
|
+
["discriminator", (0, import_kit15.fixDecoderSize)((0, import_kit15.getBytesDecoder)(), 8)],
|
|
1814
|
+
["feeLamports", (0, import_kit15.getU64Decoder)()]
|
|
1472
1815
|
]);
|
|
1473
1816
|
}
|
|
1474
1817
|
function getInitializeControllerInstructionDataCodec() {
|
|
1475
|
-
return (0,
|
|
1818
|
+
return (0, import_kit15.combineCodec)(
|
|
1476
1819
|
getInitializeControllerInstructionDataEncoder(),
|
|
1477
1820
|
getInitializeControllerInstructionDataDecoder()
|
|
1478
1821
|
);
|
|
1479
1822
|
}
|
|
1480
|
-
function getInitializeControllerInstructionAsync(input, config) {
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
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
|
-
],
|
|
1823
|
+
async function getInitializeControllerInstructionAsync(input, config) {
|
|
1824
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1825
|
+
const originalAccounts = {
|
|
1826
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1827
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1828
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1829
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1830
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1831
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1832
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1833
|
+
};
|
|
1834
|
+
const accounts = originalAccounts;
|
|
1835
|
+
const args = { ...input };
|
|
1836
|
+
if (!accounts.master.value) {
|
|
1837
|
+
accounts.master.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1537
1838
|
programAddress,
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1839
|
+
seeds: [
|
|
1840
|
+
(0, import_kit15.getBytesEncoder)().encode(
|
|
1841
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1842
|
+
)
|
|
1843
|
+
]
|
|
1844
|
+
});
|
|
1845
|
+
}
|
|
1846
|
+
if (!accounts.stats.value) {
|
|
1847
|
+
accounts.stats.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1848
|
+
programAddress,
|
|
1849
|
+
seeds: [
|
|
1850
|
+
(0, import_kit15.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1851
|
+
]
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
if (!accounts.controller.value) {
|
|
1855
|
+
accounts.controller.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1856
|
+
programAddress,
|
|
1857
|
+
seeds: [
|
|
1858
|
+
(0, import_kit15.getBytesEncoder)().encode(
|
|
1859
|
+
new Uint8Array([
|
|
1860
|
+
99,
|
|
1861
|
+
111,
|
|
1862
|
+
110,
|
|
1863
|
+
116,
|
|
1864
|
+
114,
|
|
1865
|
+
111,
|
|
1866
|
+
108,
|
|
1867
|
+
108,
|
|
1868
|
+
101,
|
|
1869
|
+
114,
|
|
1870
|
+
45,
|
|
1871
|
+
100,
|
|
1872
|
+
114,
|
|
1873
|
+
111,
|
|
1874
|
+
112,
|
|
1875
|
+
115,
|
|
1876
|
+
121
|
|
1877
|
+
])
|
|
1878
|
+
),
|
|
1879
|
+
(0, import_kit15.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
1880
|
+
]
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
if (!accounts.feeVault.value) {
|
|
1884
|
+
accounts.feeVault.value = await (0, import_kit15.getProgramDerivedAddress)({
|
|
1885
|
+
programAddress,
|
|
1886
|
+
seeds: [
|
|
1887
|
+
(0, import_kit15.getBytesEncoder)().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1888
|
+
(0, import_kit15.getAddressEncoder)().encode(expectAddress(accounts.controller.value))
|
|
1889
|
+
]
|
|
1890
|
+
});
|
|
1891
|
+
}
|
|
1892
|
+
if (!accounts.treasury.value) {
|
|
1893
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1894
|
+
}
|
|
1895
|
+
if (!accounts.systemProgram.value) {
|
|
1896
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1897
|
+
}
|
|
1898
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1899
|
+
const instruction = {
|
|
1900
|
+
accounts: [
|
|
1901
|
+
getAccountMeta(accounts.master),
|
|
1902
|
+
getAccountMeta(accounts.stats),
|
|
1903
|
+
getAccountMeta(accounts.controller),
|
|
1904
|
+
getAccountMeta(accounts.feeVault),
|
|
1905
|
+
getAccountMeta(accounts.treasury),
|
|
1906
|
+
getAccountMeta(accounts.authority),
|
|
1907
|
+
getAccountMeta(accounts.systemProgram)
|
|
1908
|
+
],
|
|
1909
|
+
programAddress,
|
|
1910
|
+
data: getInitializeControllerInstructionDataEncoder().encode(
|
|
1911
|
+
args
|
|
1912
|
+
)
|
|
1913
|
+
};
|
|
1914
|
+
return instruction;
|
|
1544
1915
|
}
|
|
1545
1916
|
function getInitializeControllerInstruction(input, config) {
|
|
1546
|
-
|
|
1547
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1917
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1548
1918
|
const originalAccounts = {
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1919
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1920
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1921
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1922
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1923
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1924
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1925
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1554
1926
|
};
|
|
1555
1927
|
const accounts = originalAccounts;
|
|
1556
|
-
const args =
|
|
1928
|
+
const args = { ...input };
|
|
1557
1929
|
if (!accounts.treasury.value) {
|
|
1558
1930
|
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1559
1931
|
}
|
|
@@ -1563,10 +1935,12 @@ function getInitializeControllerInstruction(input, config) {
|
|
|
1563
1935
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1564
1936
|
const instruction = {
|
|
1565
1937
|
accounts: [
|
|
1938
|
+
getAccountMeta(accounts.master),
|
|
1939
|
+
getAccountMeta(accounts.stats),
|
|
1566
1940
|
getAccountMeta(accounts.controller),
|
|
1567
1941
|
getAccountMeta(accounts.feeVault),
|
|
1568
1942
|
getAccountMeta(accounts.treasury),
|
|
1569
|
-
getAccountMeta(accounts.
|
|
1943
|
+
getAccountMeta(accounts.authority),
|
|
1570
1944
|
getAccountMeta(accounts.systemProgram)
|
|
1571
1945
|
],
|
|
1572
1946
|
programAddress,
|
|
@@ -1577,7 +1951,7 @@ function getInitializeControllerInstruction(input, config) {
|
|
|
1577
1951
|
return instruction;
|
|
1578
1952
|
}
|
|
1579
1953
|
function parseInitializeControllerInstruction(instruction) {
|
|
1580
|
-
if (instruction.accounts.length <
|
|
1954
|
+
if (instruction.accounts.length < 7) {
|
|
1581
1955
|
throw new Error("Not enough accounts");
|
|
1582
1956
|
}
|
|
1583
1957
|
let accountIndex = 0;
|
|
@@ -1589,10 +1963,12 @@ function parseInitializeControllerInstruction(instruction) {
|
|
|
1589
1963
|
return {
|
|
1590
1964
|
programAddress: instruction.programAddress,
|
|
1591
1965
|
accounts: {
|
|
1966
|
+
master: getNextAccount(),
|
|
1967
|
+
stats: getNextAccount(),
|
|
1592
1968
|
controller: getNextAccount(),
|
|
1593
1969
|
feeVault: getNextAccount(),
|
|
1594
1970
|
treasury: getNextAccount(),
|
|
1595
|
-
|
|
1971
|
+
authority: getNextAccount(),
|
|
1596
1972
|
systemProgram: getNextAccount()
|
|
1597
1973
|
},
|
|
1598
1974
|
data: getInitializeControllerInstructionDataDecoder().decode(
|
|
@@ -1601,157 +1977,626 @@ function parseInitializeControllerInstruction(instruction) {
|
|
|
1601
1977
|
};
|
|
1602
1978
|
}
|
|
1603
1979
|
|
|
1980
|
+
// src/instructions/initializeMaster.ts
|
|
1981
|
+
var import_kit16 = require("@solana/kit");
|
|
1982
|
+
var INITIALIZE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
1983
|
+
206,
|
|
1984
|
+
91,
|
|
1985
|
+
246,
|
|
1986
|
+
30,
|
|
1987
|
+
216,
|
|
1988
|
+
101,
|
|
1989
|
+
134,
|
|
1990
|
+
166
|
|
1991
|
+
]);
|
|
1992
|
+
function getInitializeMasterDiscriminatorBytes() {
|
|
1993
|
+
return (0, import_kit16.fixEncoderSize)((0, import_kit16.getBytesEncoder)(), 8).encode(
|
|
1994
|
+
INITIALIZE_MASTER_DISCRIMINATOR
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1997
|
+
function getInitializeMasterInstructionDataEncoder() {
|
|
1998
|
+
return (0, import_kit16.transformEncoder)(
|
|
1999
|
+
(0, import_kit16.getStructEncoder)([
|
|
2000
|
+
["discriminator", (0, import_kit16.fixEncoderSize)((0, import_kit16.getBytesEncoder)(), 8)],
|
|
2001
|
+
["protocolFee", (0, import_kit16.getU64Encoder)()],
|
|
2002
|
+
["initControllerFee", (0, import_kit16.getU64Encoder)()],
|
|
2003
|
+
["withdrawFee", (0, import_kit16.getU64Encoder)()]
|
|
2004
|
+
]),
|
|
2005
|
+
(value) => ({ ...value, discriminator: INITIALIZE_MASTER_DISCRIMINATOR })
|
|
2006
|
+
);
|
|
2007
|
+
}
|
|
2008
|
+
function getInitializeMasterInstructionDataDecoder() {
|
|
2009
|
+
return (0, import_kit16.getStructDecoder)([
|
|
2010
|
+
["discriminator", (0, import_kit16.fixDecoderSize)((0, import_kit16.getBytesDecoder)(), 8)],
|
|
2011
|
+
["protocolFee", (0, import_kit16.getU64Decoder)()],
|
|
2012
|
+
["initControllerFee", (0, import_kit16.getU64Decoder)()],
|
|
2013
|
+
["withdrawFee", (0, import_kit16.getU64Decoder)()]
|
|
2014
|
+
]);
|
|
2015
|
+
}
|
|
2016
|
+
function getInitializeMasterInstructionDataCodec() {
|
|
2017
|
+
return (0, import_kit16.combineCodec)(
|
|
2018
|
+
getInitializeMasterInstructionDataEncoder(),
|
|
2019
|
+
getInitializeMasterInstructionDataDecoder()
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
async function getInitializeMasterInstructionAsync(input, config) {
|
|
2023
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2024
|
+
const originalAccounts = {
|
|
2025
|
+
master: { value: input.master ?? null, isWritable: true },
|
|
2026
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
2027
|
+
feeVault: { value: input.feeVault ?? null, isWritable: false },
|
|
2028
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2029
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2030
|
+
};
|
|
2031
|
+
const accounts = originalAccounts;
|
|
2032
|
+
const args = { ...input };
|
|
2033
|
+
if (!accounts.master.value) {
|
|
2034
|
+
accounts.master.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
2035
|
+
programAddress,
|
|
2036
|
+
seeds: [
|
|
2037
|
+
(0, import_kit16.getBytesEncoder)().encode(
|
|
2038
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
2039
|
+
)
|
|
2040
|
+
]
|
|
2041
|
+
});
|
|
2042
|
+
}
|
|
2043
|
+
if (!accounts.stats.value) {
|
|
2044
|
+
accounts.stats.value = await (0, import_kit16.getProgramDerivedAddress)({
|
|
2045
|
+
programAddress,
|
|
2046
|
+
seeds: [
|
|
2047
|
+
(0, import_kit16.getBytesEncoder)().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
2048
|
+
]
|
|
2049
|
+
});
|
|
2050
|
+
}
|
|
2051
|
+
if (!accounts.feeVault.value) {
|
|
2052
|
+
accounts.feeVault.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2053
|
+
}
|
|
2054
|
+
if (!accounts.systemProgram.value) {
|
|
2055
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2056
|
+
}
|
|
2057
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2058
|
+
const instruction = {
|
|
2059
|
+
accounts: [
|
|
2060
|
+
getAccountMeta(accounts.master),
|
|
2061
|
+
getAccountMeta(accounts.stats),
|
|
2062
|
+
getAccountMeta(accounts.feeVault),
|
|
2063
|
+
getAccountMeta(accounts.authority),
|
|
2064
|
+
getAccountMeta(accounts.systemProgram)
|
|
2065
|
+
],
|
|
2066
|
+
programAddress,
|
|
2067
|
+
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
2068
|
+
args
|
|
2069
|
+
)
|
|
2070
|
+
};
|
|
2071
|
+
return instruction;
|
|
2072
|
+
}
|
|
2073
|
+
function getInitializeMasterInstruction(input, config) {
|
|
2074
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2075
|
+
const originalAccounts = {
|
|
2076
|
+
master: { value: input.master ?? null, isWritable: true },
|
|
2077
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
2078
|
+
feeVault: { value: input.feeVault ?? null, isWritable: false },
|
|
2079
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2080
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2081
|
+
};
|
|
2082
|
+
const accounts = originalAccounts;
|
|
2083
|
+
const args = { ...input };
|
|
2084
|
+
if (!accounts.feeVault.value) {
|
|
2085
|
+
accounts.feeVault.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2086
|
+
}
|
|
2087
|
+
if (!accounts.systemProgram.value) {
|
|
2088
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2089
|
+
}
|
|
2090
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2091
|
+
const instruction = {
|
|
2092
|
+
accounts: [
|
|
2093
|
+
getAccountMeta(accounts.master),
|
|
2094
|
+
getAccountMeta(accounts.stats),
|
|
2095
|
+
getAccountMeta(accounts.feeVault),
|
|
2096
|
+
getAccountMeta(accounts.authority),
|
|
2097
|
+
getAccountMeta(accounts.systemProgram)
|
|
2098
|
+
],
|
|
2099
|
+
programAddress,
|
|
2100
|
+
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
2101
|
+
args
|
|
2102
|
+
)
|
|
2103
|
+
};
|
|
2104
|
+
return instruction;
|
|
2105
|
+
}
|
|
2106
|
+
function parseInitializeMasterInstruction(instruction) {
|
|
2107
|
+
if (instruction.accounts.length < 5) {
|
|
2108
|
+
throw new Error("Not enough accounts");
|
|
2109
|
+
}
|
|
2110
|
+
let accountIndex = 0;
|
|
2111
|
+
const getNextAccount = () => {
|
|
2112
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2113
|
+
accountIndex += 1;
|
|
2114
|
+
return accountMeta;
|
|
2115
|
+
};
|
|
2116
|
+
return {
|
|
2117
|
+
programAddress: instruction.programAddress,
|
|
2118
|
+
accounts: {
|
|
2119
|
+
master: getNextAccount(),
|
|
2120
|
+
stats: getNextAccount(),
|
|
2121
|
+
feeVault: getNextAccount(),
|
|
2122
|
+
authority: getNextAccount(),
|
|
2123
|
+
systemProgram: getNextAccount()
|
|
2124
|
+
},
|
|
2125
|
+
data: getInitializeMasterInstructionDataDecoder().decode(instruction.data)
|
|
2126
|
+
};
|
|
2127
|
+
}
|
|
2128
|
+
|
|
2129
|
+
// src/instructions/withdrawControllerFees.ts
|
|
2130
|
+
var import_kit17 = require("@solana/kit");
|
|
2131
|
+
var WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR = new Uint8Array([
|
|
2132
|
+
252,
|
|
2133
|
+
199,
|
|
2134
|
+
14,
|
|
2135
|
+
46,
|
|
2136
|
+
100,
|
|
2137
|
+
156,
|
|
2138
|
+
176,
|
|
2139
|
+
230
|
|
2140
|
+
]);
|
|
2141
|
+
function getWithdrawControllerFeesDiscriminatorBytes() {
|
|
2142
|
+
return (0, import_kit17.fixEncoderSize)((0, import_kit17.getBytesEncoder)(), 8).encode(
|
|
2143
|
+
WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR
|
|
2144
|
+
);
|
|
2145
|
+
}
|
|
2146
|
+
function getWithdrawControllerFeesInstructionDataEncoder() {
|
|
2147
|
+
return (0, import_kit17.transformEncoder)(
|
|
2148
|
+
(0, import_kit17.getStructEncoder)([
|
|
2149
|
+
["discriminator", (0, import_kit17.fixEncoderSize)((0, import_kit17.getBytesEncoder)(), 8)],
|
|
2150
|
+
["amount", (0, import_kit17.getU64Encoder)()]
|
|
2151
|
+
]),
|
|
2152
|
+
(value) => ({
|
|
2153
|
+
...value,
|
|
2154
|
+
discriminator: WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR
|
|
2155
|
+
})
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
function getWithdrawControllerFeesInstructionDataDecoder() {
|
|
2159
|
+
return (0, import_kit17.getStructDecoder)([
|
|
2160
|
+
["discriminator", (0, import_kit17.fixDecoderSize)((0, import_kit17.getBytesDecoder)(), 8)],
|
|
2161
|
+
["amount", (0, import_kit17.getU64Decoder)()]
|
|
2162
|
+
]);
|
|
2163
|
+
}
|
|
2164
|
+
function getWithdrawControllerFeesInstructionDataCodec() {
|
|
2165
|
+
return (0, import_kit17.combineCodec)(
|
|
2166
|
+
getWithdrawControllerFeesInstructionDataEncoder(),
|
|
2167
|
+
getWithdrawControllerFeesInstructionDataDecoder()
|
|
2168
|
+
);
|
|
2169
|
+
}
|
|
2170
|
+
async function getWithdrawControllerFeesInstructionAsync(input, config) {
|
|
2171
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2172
|
+
const originalAccounts = {
|
|
2173
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
2174
|
+
controller: { value: input.controller ?? null, isWritable: false },
|
|
2175
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
2176
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2177
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2178
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2179
|
+
};
|
|
2180
|
+
const accounts = originalAccounts;
|
|
2181
|
+
const args = { ...input };
|
|
2182
|
+
if (!accounts.master.value) {
|
|
2183
|
+
accounts.master.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2184
|
+
programAddress,
|
|
2185
|
+
seeds: [
|
|
2186
|
+
(0, import_kit17.getBytesEncoder)().encode(
|
|
2187
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
2188
|
+
)
|
|
2189
|
+
]
|
|
2190
|
+
});
|
|
2191
|
+
}
|
|
2192
|
+
if (!accounts.controller.value) {
|
|
2193
|
+
accounts.controller.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2194
|
+
programAddress,
|
|
2195
|
+
seeds: [
|
|
2196
|
+
(0, import_kit17.getBytesEncoder)().encode(
|
|
2197
|
+
new Uint8Array([
|
|
2198
|
+
99,
|
|
2199
|
+
111,
|
|
2200
|
+
110,
|
|
2201
|
+
116,
|
|
2202
|
+
114,
|
|
2203
|
+
111,
|
|
2204
|
+
108,
|
|
2205
|
+
108,
|
|
2206
|
+
101,
|
|
2207
|
+
114,
|
|
2208
|
+
45,
|
|
2209
|
+
100,
|
|
2210
|
+
114,
|
|
2211
|
+
111,
|
|
2212
|
+
112,
|
|
2213
|
+
115,
|
|
2214
|
+
121
|
|
2215
|
+
])
|
|
2216
|
+
),
|
|
2217
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.authority.value))
|
|
2218
|
+
]
|
|
2219
|
+
});
|
|
2220
|
+
}
|
|
2221
|
+
if (!accounts.feeVault.value) {
|
|
2222
|
+
accounts.feeVault.value = await (0, import_kit17.getProgramDerivedAddress)({
|
|
2223
|
+
programAddress,
|
|
2224
|
+
seeds: [
|
|
2225
|
+
(0, import_kit17.getBytesEncoder)().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
2226
|
+
(0, import_kit17.getAddressEncoder)().encode(expectAddress(accounts.controller.value))
|
|
2227
|
+
]
|
|
2228
|
+
});
|
|
2229
|
+
}
|
|
2230
|
+
if (!accounts.treasury.value) {
|
|
2231
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2232
|
+
}
|
|
2233
|
+
if (!accounts.systemProgram.value) {
|
|
2234
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2235
|
+
}
|
|
2236
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2237
|
+
const instruction = {
|
|
2238
|
+
accounts: [
|
|
2239
|
+
getAccountMeta(accounts.master),
|
|
2240
|
+
getAccountMeta(accounts.controller),
|
|
2241
|
+
getAccountMeta(accounts.feeVault),
|
|
2242
|
+
getAccountMeta(accounts.authority),
|
|
2243
|
+
getAccountMeta(accounts.treasury),
|
|
2244
|
+
getAccountMeta(accounts.systemProgram)
|
|
2245
|
+
],
|
|
2246
|
+
programAddress,
|
|
2247
|
+
data: getWithdrawControllerFeesInstructionDataEncoder().encode(
|
|
2248
|
+
args
|
|
2249
|
+
)
|
|
2250
|
+
};
|
|
2251
|
+
return instruction;
|
|
2252
|
+
}
|
|
2253
|
+
function getWithdrawControllerFeesInstruction(input, config) {
|
|
2254
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2255
|
+
const originalAccounts = {
|
|
2256
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
2257
|
+
controller: { value: input.controller ?? null, isWritable: false },
|
|
2258
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
2259
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2260
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2261
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2262
|
+
};
|
|
2263
|
+
const accounts = originalAccounts;
|
|
2264
|
+
const args = { ...input };
|
|
2265
|
+
if (!accounts.treasury.value) {
|
|
2266
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2267
|
+
}
|
|
2268
|
+
if (!accounts.systemProgram.value) {
|
|
2269
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2270
|
+
}
|
|
2271
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2272
|
+
const instruction = {
|
|
2273
|
+
accounts: [
|
|
2274
|
+
getAccountMeta(accounts.master),
|
|
2275
|
+
getAccountMeta(accounts.controller),
|
|
2276
|
+
getAccountMeta(accounts.feeVault),
|
|
2277
|
+
getAccountMeta(accounts.authority),
|
|
2278
|
+
getAccountMeta(accounts.treasury),
|
|
2279
|
+
getAccountMeta(accounts.systemProgram)
|
|
2280
|
+
],
|
|
2281
|
+
programAddress,
|
|
2282
|
+
data: getWithdrawControllerFeesInstructionDataEncoder().encode(
|
|
2283
|
+
args
|
|
2284
|
+
)
|
|
2285
|
+
};
|
|
2286
|
+
return instruction;
|
|
2287
|
+
}
|
|
2288
|
+
function parseWithdrawControllerFeesInstruction(instruction) {
|
|
2289
|
+
if (instruction.accounts.length < 6) {
|
|
2290
|
+
throw new Error("Not enough accounts");
|
|
2291
|
+
}
|
|
2292
|
+
let accountIndex = 0;
|
|
2293
|
+
const getNextAccount = () => {
|
|
2294
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2295
|
+
accountIndex += 1;
|
|
2296
|
+
return accountMeta;
|
|
2297
|
+
};
|
|
2298
|
+
return {
|
|
2299
|
+
programAddress: instruction.programAddress,
|
|
2300
|
+
accounts: {
|
|
2301
|
+
master: getNextAccount(),
|
|
2302
|
+
controller: getNextAccount(),
|
|
2303
|
+
feeVault: getNextAccount(),
|
|
2304
|
+
authority: getNextAccount(),
|
|
2305
|
+
treasury: getNextAccount(),
|
|
2306
|
+
systemProgram: getNextAccount()
|
|
2307
|
+
},
|
|
2308
|
+
data: getWithdrawControllerFeesInstructionDataDecoder().decode(
|
|
2309
|
+
instruction.data
|
|
2310
|
+
)
|
|
2311
|
+
};
|
|
2312
|
+
}
|
|
2313
|
+
|
|
1604
2314
|
// src/types/airdropClosed.ts
|
|
1605
|
-
var
|
|
2315
|
+
var import_kit18 = require("@solana/kit");
|
|
1606
2316
|
function getAirdropClosedEncoder() {
|
|
1607
|
-
return (0,
|
|
1608
|
-
["airdrop", (0,
|
|
1609
|
-
["
|
|
1610
|
-
["timestamp", (0,
|
|
2317
|
+
return (0, import_kit18.getStructEncoder)([
|
|
2318
|
+
["airdrop", (0, import_kit18.getAddressEncoder)()],
|
|
2319
|
+
["authority", (0, import_kit18.getAddressEncoder)()],
|
|
2320
|
+
["timestamp", (0, import_kit18.getI64Encoder)()]
|
|
1611
2321
|
]);
|
|
1612
2322
|
}
|
|
1613
2323
|
function getAirdropClosedDecoder() {
|
|
1614
|
-
return (0,
|
|
1615
|
-
["airdrop", (0,
|
|
1616
|
-
["
|
|
1617
|
-
["timestamp", (0,
|
|
2324
|
+
return (0, import_kit18.getStructDecoder)([
|
|
2325
|
+
["airdrop", (0, import_kit18.getAddressDecoder)()],
|
|
2326
|
+
["authority", (0, import_kit18.getAddressDecoder)()],
|
|
2327
|
+
["timestamp", (0, import_kit18.getI64Decoder)()]
|
|
1618
2328
|
]);
|
|
1619
2329
|
}
|
|
1620
2330
|
function getAirdropClosedCodec() {
|
|
1621
|
-
return (0,
|
|
2331
|
+
return (0, import_kit18.combineCodec)(getAirdropClosedEncoder(), getAirdropClosedDecoder());
|
|
1622
2332
|
}
|
|
1623
2333
|
|
|
1624
2334
|
// src/types/airdropInitialized.ts
|
|
1625
|
-
var
|
|
2335
|
+
var import_kit19 = require("@solana/kit");
|
|
1626
2336
|
function getAirdropInitializedEncoder() {
|
|
1627
|
-
return (0,
|
|
1628
|
-
["airdrop", (0,
|
|
1629
|
-
["mint", (0,
|
|
1630
|
-
["
|
|
1631
|
-
["controller", (0,
|
|
1632
|
-
["
|
|
1633
|
-
["merkleRoot", (0,
|
|
1634
|
-
["startTime", (0,
|
|
1635
|
-
["endTime", (0,
|
|
1636
|
-
["timestamp", (0,
|
|
2337
|
+
return (0, import_kit19.getStructEncoder)([
|
|
2338
|
+
["airdrop", (0, import_kit19.getAddressEncoder)()],
|
|
2339
|
+
["mint", (0, import_kit19.getAddressEncoder)()],
|
|
2340
|
+
["authority", (0, import_kit19.getAddressEncoder)()],
|
|
2341
|
+
["controller", (0, import_kit19.getAddressEncoder)()],
|
|
2342
|
+
["controllerFeeVault", (0, import_kit19.getAddressEncoder)()],
|
|
2343
|
+
["merkleRoot", (0, import_kit19.getArrayEncoder)((0, import_kit19.getU8Encoder)(), { size: 32 })],
|
|
2344
|
+
["startTime", (0, import_kit19.getI64Encoder)()],
|
|
2345
|
+
["endTime", (0, import_kit19.getI64Encoder)()],
|
|
2346
|
+
["timestamp", (0, import_kit19.getI64Encoder)()]
|
|
1637
2347
|
]);
|
|
1638
2348
|
}
|
|
1639
2349
|
function getAirdropInitializedDecoder() {
|
|
1640
|
-
return (0,
|
|
1641
|
-
["airdrop", (0,
|
|
1642
|
-
["mint", (0,
|
|
1643
|
-
["
|
|
1644
|
-
["controller", (0,
|
|
1645
|
-
["
|
|
1646
|
-
["merkleRoot", (0,
|
|
1647
|
-
["startTime", (0,
|
|
1648
|
-
["endTime", (0,
|
|
1649
|
-
["timestamp", (0,
|
|
2350
|
+
return (0, import_kit19.getStructDecoder)([
|
|
2351
|
+
["airdrop", (0, import_kit19.getAddressDecoder)()],
|
|
2352
|
+
["mint", (0, import_kit19.getAddressDecoder)()],
|
|
2353
|
+
["authority", (0, import_kit19.getAddressDecoder)()],
|
|
2354
|
+
["controller", (0, import_kit19.getAddressDecoder)()],
|
|
2355
|
+
["controllerFeeVault", (0, import_kit19.getAddressDecoder)()],
|
|
2356
|
+
["merkleRoot", (0, import_kit19.getArrayDecoder)((0, import_kit19.getU8Decoder)(), { size: 32 })],
|
|
2357
|
+
["startTime", (0, import_kit19.getI64Decoder)()],
|
|
2358
|
+
["endTime", (0, import_kit19.getI64Decoder)()],
|
|
2359
|
+
["timestamp", (0, import_kit19.getI64Decoder)()]
|
|
1650
2360
|
]);
|
|
1651
2361
|
}
|
|
1652
2362
|
function getAirdropInitializedCodec() {
|
|
1653
|
-
return (0,
|
|
2363
|
+
return (0, import_kit19.combineCodec)(
|
|
1654
2364
|
getAirdropInitializedEncoder(),
|
|
1655
2365
|
getAirdropInitializedDecoder()
|
|
1656
2366
|
);
|
|
1657
2367
|
}
|
|
1658
2368
|
|
|
1659
2369
|
// src/types/bitmapClosed.ts
|
|
1660
|
-
var
|
|
2370
|
+
var import_kit20 = require("@solana/kit");
|
|
1661
2371
|
function getBitmapClosedEncoder() {
|
|
1662
|
-
return (0,
|
|
1663
|
-
["airdrop", (0,
|
|
1664
|
-
["bitmap", (0,
|
|
1665
|
-
["
|
|
2372
|
+
return (0, import_kit20.getStructEncoder)([
|
|
2373
|
+
["airdrop", (0, import_kit20.getAddressEncoder)()],
|
|
2374
|
+
["bitmap", (0, import_kit20.getAddressEncoder)()],
|
|
2375
|
+
["authority", (0, import_kit20.getAddressEncoder)()]
|
|
1666
2376
|
]);
|
|
1667
2377
|
}
|
|
1668
2378
|
function getBitmapClosedDecoder() {
|
|
1669
|
-
return (0,
|
|
1670
|
-
["airdrop", (0,
|
|
1671
|
-
["bitmap", (0,
|
|
1672
|
-
["
|
|
2379
|
+
return (0, import_kit20.getStructDecoder)([
|
|
2380
|
+
["airdrop", (0, import_kit20.getAddressDecoder)()],
|
|
2381
|
+
["bitmap", (0, import_kit20.getAddressDecoder)()],
|
|
2382
|
+
["authority", (0, import_kit20.getAddressDecoder)()]
|
|
1673
2383
|
]);
|
|
1674
2384
|
}
|
|
1675
2385
|
function getBitmapClosedCodec() {
|
|
1676
|
-
return (0,
|
|
2386
|
+
return (0, import_kit20.combineCodec)(getBitmapClosedEncoder(), getBitmapClosedDecoder());
|
|
1677
2387
|
}
|
|
1678
2388
|
|
|
1679
2389
|
// src/types/bitmapInitialized.ts
|
|
1680
|
-
var
|
|
2390
|
+
var import_kit21 = require("@solana/kit");
|
|
1681
2391
|
function getBitmapInitializedEncoder() {
|
|
1682
|
-
return (0,
|
|
1683
|
-
["airdrop", (0,
|
|
1684
|
-
["bitmap", (0,
|
|
1685
|
-
["bitmapId", (0,
|
|
1686
|
-
["totalClaims", (0,
|
|
2392
|
+
return (0, import_kit21.getStructEncoder)([
|
|
2393
|
+
["airdrop", (0, import_kit21.getAddressEncoder)()],
|
|
2394
|
+
["bitmap", (0, import_kit21.getAddressEncoder)()],
|
|
2395
|
+
["bitmapId", (0, import_kit21.getU8Encoder)()],
|
|
2396
|
+
["totalClaims", (0, import_kit21.getU64Encoder)()]
|
|
1687
2397
|
]);
|
|
1688
2398
|
}
|
|
1689
2399
|
function getBitmapInitializedDecoder() {
|
|
1690
|
-
return (0,
|
|
1691
|
-
["airdrop", (0,
|
|
1692
|
-
["bitmap", (0,
|
|
1693
|
-
["bitmapId", (0,
|
|
1694
|
-
["totalClaims", (0,
|
|
2400
|
+
return (0, import_kit21.getStructDecoder)([
|
|
2401
|
+
["airdrop", (0, import_kit21.getAddressDecoder)()],
|
|
2402
|
+
["bitmap", (0, import_kit21.getAddressDecoder)()],
|
|
2403
|
+
["bitmapId", (0, import_kit21.getU8Decoder)()],
|
|
2404
|
+
["totalClaims", (0, import_kit21.getU64Decoder)()]
|
|
1695
2405
|
]);
|
|
1696
2406
|
}
|
|
1697
2407
|
function getBitmapInitializedCodec() {
|
|
1698
|
-
return (0,
|
|
2408
|
+
return (0, import_kit21.combineCodec)(
|
|
1699
2409
|
getBitmapInitializedEncoder(),
|
|
1700
2410
|
getBitmapInitializedDecoder()
|
|
1701
2411
|
);
|
|
1702
2412
|
}
|
|
1703
2413
|
|
|
1704
2414
|
// src/types/controllerInitialized.ts
|
|
1705
|
-
var
|
|
2415
|
+
var import_kit22 = require("@solana/kit");
|
|
1706
2416
|
function getControllerInitializedEncoder() {
|
|
1707
|
-
return (0,
|
|
1708
|
-
["
|
|
1709
|
-
["
|
|
1710
|
-
["
|
|
1711
|
-
["
|
|
1712
|
-
["bump", (0,
|
|
1713
|
-
["timestamp", (0,
|
|
2417
|
+
return (0, import_kit22.getStructEncoder)([
|
|
2418
|
+
["masterVault", (0, import_kit22.getAddressEncoder)()],
|
|
2419
|
+
["authority", (0, import_kit22.getAddressEncoder)()],
|
|
2420
|
+
["feeVault", (0, import_kit22.getAddressEncoder)()],
|
|
2421
|
+
["feeLamports", (0, import_kit22.getU64Encoder)()],
|
|
2422
|
+
["bump", (0, import_kit22.getU8Encoder)()],
|
|
2423
|
+
["timestamp", (0, import_kit22.getI64Encoder)()]
|
|
1714
2424
|
]);
|
|
1715
2425
|
}
|
|
1716
2426
|
function getControllerInitializedDecoder() {
|
|
1717
|
-
return (0,
|
|
1718
|
-
["
|
|
1719
|
-
["
|
|
1720
|
-
["
|
|
1721
|
-
["
|
|
1722
|
-
["bump", (0,
|
|
1723
|
-
["timestamp", (0,
|
|
2427
|
+
return (0, import_kit22.getStructDecoder)([
|
|
2428
|
+
["masterVault", (0, import_kit22.getAddressDecoder)()],
|
|
2429
|
+
["authority", (0, import_kit22.getAddressDecoder)()],
|
|
2430
|
+
["feeVault", (0, import_kit22.getAddressDecoder)()],
|
|
2431
|
+
["feeLamports", (0, import_kit22.getU64Decoder)()],
|
|
2432
|
+
["bump", (0, import_kit22.getU8Decoder)()],
|
|
2433
|
+
["timestamp", (0, import_kit22.getI64Decoder)()]
|
|
1724
2434
|
]);
|
|
1725
2435
|
}
|
|
1726
2436
|
function getControllerInitializedCodec() {
|
|
1727
|
-
return (0,
|
|
2437
|
+
return (0, import_kit22.combineCodec)(
|
|
1728
2438
|
getControllerInitializedEncoder(),
|
|
1729
2439
|
getControllerInitializedDecoder()
|
|
1730
2440
|
);
|
|
1731
2441
|
}
|
|
1732
2442
|
|
|
2443
|
+
// src/types/feesCollected.ts
|
|
2444
|
+
var import_kit23 = require("@solana/kit");
|
|
2445
|
+
function getFeesCollectedEncoder() {
|
|
2446
|
+
return (0, import_kit23.getStructEncoder)([
|
|
2447
|
+
["controller", (0, import_kit23.getAddressEncoder)()],
|
|
2448
|
+
["authority", (0, import_kit23.getAddressEncoder)()],
|
|
2449
|
+
["feeVault", (0, import_kit23.getAddressEncoder)()],
|
|
2450
|
+
["amount", (0, import_kit23.getU64Encoder)()],
|
|
2451
|
+
["timestamp", (0, import_kit23.getI64Encoder)()]
|
|
2452
|
+
]);
|
|
2453
|
+
}
|
|
2454
|
+
function getFeesCollectedDecoder() {
|
|
2455
|
+
return (0, import_kit23.getStructDecoder)([
|
|
2456
|
+
["controller", (0, import_kit23.getAddressDecoder)()],
|
|
2457
|
+
["authority", (0, import_kit23.getAddressDecoder)()],
|
|
2458
|
+
["feeVault", (0, import_kit23.getAddressDecoder)()],
|
|
2459
|
+
["amount", (0, import_kit23.getU64Decoder)()],
|
|
2460
|
+
["timestamp", (0, import_kit23.getI64Decoder)()]
|
|
2461
|
+
]);
|
|
2462
|
+
}
|
|
2463
|
+
function getFeesCollectedCodec() {
|
|
2464
|
+
return (0, import_kit23.combineCodec)(getFeesCollectedEncoder(), getFeesCollectedDecoder());
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
// src/types/masterInitialized.ts
|
|
2468
|
+
var import_kit24 = require("@solana/kit");
|
|
2469
|
+
function getMasterInitializedEncoder() {
|
|
2470
|
+
return (0, import_kit24.getStructEncoder)([
|
|
2471
|
+
["authority", (0, import_kit24.getAddressEncoder)()],
|
|
2472
|
+
["feeVault", (0, import_kit24.getAddressEncoder)()],
|
|
2473
|
+
["protocolFee", (0, import_kit24.getU64Encoder)()],
|
|
2474
|
+
["initControllerFee", (0, import_kit24.getU64Encoder)()],
|
|
2475
|
+
["withdrawFee", (0, import_kit24.getU64Encoder)()],
|
|
2476
|
+
["bump", (0, import_kit24.getU8Encoder)()],
|
|
2477
|
+
["timestamp", (0, import_kit24.getI64Encoder)()]
|
|
2478
|
+
]);
|
|
2479
|
+
}
|
|
2480
|
+
function getMasterInitializedDecoder() {
|
|
2481
|
+
return (0, import_kit24.getStructDecoder)([
|
|
2482
|
+
["authority", (0, import_kit24.getAddressDecoder)()],
|
|
2483
|
+
["feeVault", (0, import_kit24.getAddressDecoder)()],
|
|
2484
|
+
["protocolFee", (0, import_kit24.getU64Decoder)()],
|
|
2485
|
+
["initControllerFee", (0, import_kit24.getU64Decoder)()],
|
|
2486
|
+
["withdrawFee", (0, import_kit24.getU64Decoder)()],
|
|
2487
|
+
["bump", (0, import_kit24.getU8Decoder)()],
|
|
2488
|
+
["timestamp", (0, import_kit24.getI64Decoder)()]
|
|
2489
|
+
]);
|
|
2490
|
+
}
|
|
2491
|
+
function getMasterInitializedCodec() {
|
|
2492
|
+
return (0, import_kit24.combineCodec)(
|
|
2493
|
+
getMasterInitializedEncoder(),
|
|
2494
|
+
getMasterInitializedDecoder()
|
|
2495
|
+
);
|
|
2496
|
+
}
|
|
2497
|
+
|
|
1733
2498
|
// src/types/tokensDeposited.ts
|
|
1734
|
-
var
|
|
2499
|
+
var import_kit25 = require("@solana/kit");
|
|
1735
2500
|
function getTokensDepositedEncoder() {
|
|
1736
|
-
return (0,
|
|
1737
|
-
["airdrop", (0,
|
|
1738
|
-
["amount", (0,
|
|
1739
|
-
["newSupply", (0,
|
|
1740
|
-
["depositor", (0,
|
|
1741
|
-
["timestamp", (0,
|
|
2501
|
+
return (0, import_kit25.getStructEncoder)([
|
|
2502
|
+
["airdrop", (0, import_kit25.getAddressEncoder)()],
|
|
2503
|
+
["amount", (0, import_kit25.getU64Encoder)()],
|
|
2504
|
+
["newSupply", (0, import_kit25.getU64Encoder)()],
|
|
2505
|
+
["depositor", (0, import_kit25.getAddressEncoder)()],
|
|
2506
|
+
["timestamp", (0, import_kit25.getI64Encoder)()]
|
|
1742
2507
|
]);
|
|
1743
2508
|
}
|
|
1744
2509
|
function getTokensDepositedDecoder() {
|
|
1745
|
-
return (0,
|
|
1746
|
-
["airdrop", (0,
|
|
1747
|
-
["amount", (0,
|
|
1748
|
-
["newSupply", (0,
|
|
1749
|
-
["depositor", (0,
|
|
1750
|
-
["timestamp", (0,
|
|
2510
|
+
return (0, import_kit25.getStructDecoder)([
|
|
2511
|
+
["airdrop", (0, import_kit25.getAddressDecoder)()],
|
|
2512
|
+
["amount", (0, import_kit25.getU64Decoder)()],
|
|
2513
|
+
["newSupply", (0, import_kit25.getU64Decoder)()],
|
|
2514
|
+
["depositor", (0, import_kit25.getAddressDecoder)()],
|
|
2515
|
+
["timestamp", (0, import_kit25.getI64Decoder)()]
|
|
1751
2516
|
]);
|
|
1752
2517
|
}
|
|
1753
2518
|
function getTokensDepositedCodec() {
|
|
1754
|
-
return (0,
|
|
2519
|
+
return (0, import_kit25.combineCodec)(getTokensDepositedEncoder(), getTokensDepositedDecoder());
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// src/utils/client.ts
|
|
2523
|
+
var import_kit26 = require("@solana/kit");
|
|
2524
|
+
var generateKeyPairSignerWithSol = async (rpcClient, putativeLamports = 1000000000n) => {
|
|
2525
|
+
const signer = await (0, import_kit26.generateKeyPairSigner)();
|
|
2526
|
+
await (0, import_kit26.airdropFactory)(rpcClient)({
|
|
2527
|
+
recipientAddress: signer.address,
|
|
2528
|
+
lamports: (0, import_kit26.lamports)(putativeLamports),
|
|
2529
|
+
commitment: "confirmed"
|
|
2530
|
+
});
|
|
2531
|
+
return signer;
|
|
2532
|
+
};
|
|
2533
|
+
var createDefaultSolanaClient = () => {
|
|
2534
|
+
const rpc = (0, import_kit26.createSolanaRpc)("https://api.devnet.solana.com");
|
|
2535
|
+
const rpcSubscriptions = (0, import_kit26.createSolanaRpcSubscriptions)(
|
|
2536
|
+
"wss://api.devnet.solana.com"
|
|
2537
|
+
);
|
|
2538
|
+
return { rpc, rpcSubscriptions };
|
|
2539
|
+
};
|
|
2540
|
+
var createTransactionMessageFromInstruction = async (rpc, signer, instruction) => {
|
|
2541
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
2542
|
+
return (0, import_kit26.pipe)(
|
|
2543
|
+
(0, import_kit26.createTransactionMessage)({ version: 0 }),
|
|
2544
|
+
(tx) => (0, import_kit26.setTransactionMessageLifetimeUsingBlockhash)(latestBlockhash, tx),
|
|
2545
|
+
(tx) => (0, import_kit26.setTransactionMessageFeePayerSigner)(signer, tx),
|
|
2546
|
+
(tx) => (0, import_kit26.appendTransactionMessageInstructions)(instruction, tx)
|
|
2547
|
+
);
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2550
|
+
// src/utils/derive.ts
|
|
2551
|
+
var import_kit27 = require("@solana/kit");
|
|
2552
|
+
|
|
2553
|
+
// src/constants/index.ts
|
|
2554
|
+
var masterSeed = "master3";
|
|
2555
|
+
var statsSeed = "stats";
|
|
2556
|
+
var controllerSeed = "controller-dropsy";
|
|
2557
|
+
var feeVaultSeed = "vault";
|
|
2558
|
+
var airdropSeed = "airdrop";
|
|
2559
|
+
var claimMapSeed = "bitmap";
|
|
2560
|
+
|
|
2561
|
+
// src/utils/derive.ts
|
|
2562
|
+
async function getDropsyDerivedAddress(seeds) {
|
|
2563
|
+
return await (0, import_kit27.getProgramDerivedAddress)({
|
|
2564
|
+
seeds,
|
|
2565
|
+
programAddress: DROPSY_PROGRAM_ADDRESS
|
|
2566
|
+
});
|
|
2567
|
+
}
|
|
2568
|
+
async function getMasterDerivedAddress() {
|
|
2569
|
+
return await getDropsyDerivedAddress([Buffer.from(masterSeed)]);
|
|
2570
|
+
}
|
|
2571
|
+
async function getStatsDerivedAddress() {
|
|
2572
|
+
return await getDropsyDerivedAddress([Buffer.from(statsSeed)]);
|
|
2573
|
+
}
|
|
2574
|
+
async function getControllerDerivedAddress(authority) {
|
|
2575
|
+
const seeds = [
|
|
2576
|
+
Buffer.from(controllerSeed),
|
|
2577
|
+
(0, import_kit27.getAddressEncoder)().encode(authority)
|
|
2578
|
+
];
|
|
2579
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2580
|
+
}
|
|
2581
|
+
async function getAirdropDerivedAddress(authority, mint) {
|
|
2582
|
+
const seeds = [
|
|
2583
|
+
Buffer.from(airdropSeed),
|
|
2584
|
+
(0, import_kit27.getAddressEncoder)().encode(mint),
|
|
2585
|
+
(0, import_kit27.getAddressEncoder)().encode(authority)
|
|
2586
|
+
];
|
|
2587
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2588
|
+
}
|
|
2589
|
+
async function getControllerVaultAddress(controller) {
|
|
2590
|
+
const seeds = [Buffer.from(feeVaultSeed), (0, import_kit27.getAddressEncoder)().encode(controller)];
|
|
2591
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2592
|
+
}
|
|
2593
|
+
async function getClaimMapAddress(airdrop, id) {
|
|
2594
|
+
const seeds = [
|
|
2595
|
+
Buffer.from(claimMapSeed),
|
|
2596
|
+
(0, import_kit27.getAddressEncoder)().encode(airdrop),
|
|
2597
|
+
Buffer.from([id])
|
|
2598
|
+
];
|
|
2599
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1755
2600
|
}
|
|
1756
2601
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1757
2602
|
0 && (module.exports = {
|
|
@@ -1819,26 +2664,44 @@ function getTokensDepositedCodec() {
|
|
|
1819
2664
|
INITIALIZE_AIRDROP_DISCRIMINATOR,
|
|
1820
2665
|
INITIALIZE_BITMAP_DISCRIMINATOR,
|
|
1821
2666
|
INITIALIZE_CONTROLLER_DISCRIMINATOR,
|
|
2667
|
+
INITIALIZE_MASTER_DISCRIMINATOR,
|
|
2668
|
+
MASTER_DISCRIMINATOR,
|
|
2669
|
+
STATS_DISCRIMINATOR,
|
|
2670
|
+
WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR,
|
|
2671
|
+
createDefaultSolanaClient,
|
|
2672
|
+
createTransactionMessageFromInstruction,
|
|
1822
2673
|
decodeAirdrop,
|
|
1823
2674
|
decodeBitmapAccount,
|
|
1824
2675
|
decodeController,
|
|
2676
|
+
decodeMaster,
|
|
2677
|
+
decodeStats,
|
|
1825
2678
|
fetchAirdrop,
|
|
1826
2679
|
fetchAllAirdrop,
|
|
1827
2680
|
fetchAllBitmapAccount,
|
|
1828
2681
|
fetchAllController,
|
|
2682
|
+
fetchAllMaster,
|
|
1829
2683
|
fetchAllMaybeAirdrop,
|
|
1830
2684
|
fetchAllMaybeBitmapAccount,
|
|
1831
2685
|
fetchAllMaybeController,
|
|
2686
|
+
fetchAllMaybeMaster,
|
|
2687
|
+
fetchAllMaybeStats,
|
|
2688
|
+
fetchAllStats,
|
|
1832
2689
|
fetchBitmapAccount,
|
|
1833
2690
|
fetchController,
|
|
2691
|
+
fetchMaster,
|
|
1834
2692
|
fetchMaybeAirdrop,
|
|
1835
2693
|
fetchMaybeBitmapAccount,
|
|
1836
2694
|
fetchMaybeController,
|
|
2695
|
+
fetchMaybeMaster,
|
|
2696
|
+
fetchMaybeStats,
|
|
2697
|
+
fetchStats,
|
|
2698
|
+
generateKeyPairSignerWithSol,
|
|
1837
2699
|
getAirdropClosedCodec,
|
|
1838
2700
|
getAirdropClosedDecoder,
|
|
1839
2701
|
getAirdropClosedEncoder,
|
|
1840
2702
|
getAirdropCodec,
|
|
1841
2703
|
getAirdropDecoder,
|
|
2704
|
+
getAirdropDerivedAddress,
|
|
1842
2705
|
getAirdropDiscriminatorBytes,
|
|
1843
2706
|
getAirdropEncoder,
|
|
1844
2707
|
getAirdropInitializedCodec,
|
|
@@ -1854,6 +2717,7 @@ function getTokensDepositedCodec() {
|
|
|
1854
2717
|
getBitmapInitializedCodec,
|
|
1855
2718
|
getBitmapInitializedDecoder,
|
|
1856
2719
|
getBitmapInitializedEncoder,
|
|
2720
|
+
getClaimMapAddress,
|
|
1857
2721
|
getClaimTokensDiscriminatorBytes,
|
|
1858
2722
|
getClaimTokensInstruction,
|
|
1859
2723
|
getClaimTokensInstructionDataCodec,
|
|
@@ -1861,27 +2725,35 @@ function getTokensDepositedCodec() {
|
|
|
1861
2725
|
getClaimTokensInstructionDataEncoder,
|
|
1862
2726
|
getCloseAirdropDiscriminatorBytes,
|
|
1863
2727
|
getCloseAirdropInstruction,
|
|
2728
|
+
getCloseAirdropInstructionAsync,
|
|
1864
2729
|
getCloseAirdropInstructionDataCodec,
|
|
1865
2730
|
getCloseAirdropInstructionDataDecoder,
|
|
1866
2731
|
getCloseAirdropInstructionDataEncoder,
|
|
1867
2732
|
getCloseBitmapDiscriminatorBytes,
|
|
1868
2733
|
getCloseBitmapInstruction,
|
|
2734
|
+
getCloseBitmapInstructionAsync,
|
|
1869
2735
|
getCloseBitmapInstructionDataCodec,
|
|
1870
2736
|
getCloseBitmapInstructionDataDecoder,
|
|
1871
2737
|
getCloseBitmapInstructionDataEncoder,
|
|
1872
2738
|
getControllerCodec,
|
|
1873
2739
|
getControllerDecoder,
|
|
2740
|
+
getControllerDerivedAddress,
|
|
1874
2741
|
getControllerDiscriminatorBytes,
|
|
1875
2742
|
getControllerEncoder,
|
|
1876
2743
|
getControllerInitializedCodec,
|
|
1877
2744
|
getControllerInitializedDecoder,
|
|
1878
2745
|
getControllerInitializedEncoder,
|
|
2746
|
+
getControllerVaultAddress,
|
|
1879
2747
|
getDepositTokensDiscriminatorBytes,
|
|
1880
2748
|
getDepositTokensInstruction,
|
|
1881
2749
|
getDepositTokensInstructionDataCodec,
|
|
1882
2750
|
getDepositTokensInstructionDataDecoder,
|
|
1883
2751
|
getDepositTokensInstructionDataEncoder,
|
|
2752
|
+
getDropsyDerivedAddress,
|
|
1884
2753
|
getDropsyErrorMessage,
|
|
2754
|
+
getFeesCollectedCodec,
|
|
2755
|
+
getFeesCollectedDecoder,
|
|
2756
|
+
getFeesCollectedEncoder,
|
|
1885
2757
|
getInitializeAirdropDiscriminatorBytes,
|
|
1886
2758
|
getInitializeAirdropInstruction,
|
|
1887
2759
|
getInitializeAirdropInstructionAsync,
|
|
@@ -1900,9 +2772,34 @@ function getTokensDepositedCodec() {
|
|
|
1900
2772
|
getInitializeControllerInstructionDataCodec,
|
|
1901
2773
|
getInitializeControllerInstructionDataDecoder,
|
|
1902
2774
|
getInitializeControllerInstructionDataEncoder,
|
|
2775
|
+
getInitializeMasterDiscriminatorBytes,
|
|
2776
|
+
getInitializeMasterInstruction,
|
|
2777
|
+
getInitializeMasterInstructionAsync,
|
|
2778
|
+
getInitializeMasterInstructionDataCodec,
|
|
2779
|
+
getInitializeMasterInstructionDataDecoder,
|
|
2780
|
+
getInitializeMasterInstructionDataEncoder,
|
|
2781
|
+
getMasterCodec,
|
|
2782
|
+
getMasterDecoder,
|
|
2783
|
+
getMasterDerivedAddress,
|
|
2784
|
+
getMasterDiscriminatorBytes,
|
|
2785
|
+
getMasterEncoder,
|
|
2786
|
+
getMasterInitializedCodec,
|
|
2787
|
+
getMasterInitializedDecoder,
|
|
2788
|
+
getMasterInitializedEncoder,
|
|
2789
|
+
getStatsCodec,
|
|
2790
|
+
getStatsDecoder,
|
|
2791
|
+
getStatsDerivedAddress,
|
|
2792
|
+
getStatsDiscriminatorBytes,
|
|
2793
|
+
getStatsEncoder,
|
|
1903
2794
|
getTokensDepositedCodec,
|
|
1904
2795
|
getTokensDepositedDecoder,
|
|
1905
2796
|
getTokensDepositedEncoder,
|
|
2797
|
+
getWithdrawControllerFeesDiscriminatorBytes,
|
|
2798
|
+
getWithdrawControllerFeesInstruction,
|
|
2799
|
+
getWithdrawControllerFeesInstructionAsync,
|
|
2800
|
+
getWithdrawControllerFeesInstructionDataCodec,
|
|
2801
|
+
getWithdrawControllerFeesInstructionDataDecoder,
|
|
2802
|
+
getWithdrawControllerFeesInstructionDataEncoder,
|
|
1906
2803
|
identifyDropsyAccount,
|
|
1907
2804
|
identifyDropsyInstruction,
|
|
1908
2805
|
isDropsyError,
|
|
@@ -1912,5 +2809,8 @@ function getTokensDepositedCodec() {
|
|
|
1912
2809
|
parseDepositTokensInstruction,
|
|
1913
2810
|
parseInitializeAirdropInstruction,
|
|
1914
2811
|
parseInitializeBitmapInstruction,
|
|
1915
|
-
parseInitializeControllerInstruction
|
|
2812
|
+
parseInitializeControllerInstruction,
|
|
2813
|
+
parseInitializeMasterInstruction,
|
|
2814
|
+
parseWithdrawControllerFeesInstruction
|
|
1916
2815
|
});
|
|
2816
|
+
//# sourceMappingURL=index.js.map
|