@dropsy/airdrop 0.0.1 → 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 -37
- package/readme.md +94 -10
- package/docs/.nojekyll +0 -1
- package/docs/assets/hierarchy.js +0 -1
- package/docs/assets/highlight.css +0 -50
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1640
- package/docs/functions/add.html +0 -1
- package/docs/hierarchy.html +0 -1
- package/docs/index.html +0 -13
- package/docs/modules.html +0 -1
- package/index.ts +0 -0
- package/new/index.js +0 -2
- package/new/node_modules/.package-lock.json +0 -14
- package/new/node_modules/@dropsy/easypublish/dist/index.d.mts +0 -3
- package/new/node_modules/@dropsy/easypublish/dist/index.d.ts +0 -3
- package/new/node_modules/@dropsy/easypublish/dist/index.js +0 -32
- package/new/node_modules/@dropsy/easypublish/dist/index.mjs +0 -7
- package/new/node_modules/@dropsy/easypublish/package.json +0 -25
- package/new/node_modules/@dropsy/easypublish/readme.md +0 -21
- package/new/node_modules/@dropsy/easypublish/tsup.config.ts +0 -10
- package/new/package-lock.json +0 -22
- package/new/package.json +0 -16
- package/tsup.config.ts +0 -10
- package/typedoc.json +0 -5
package/dist/index.mjs
CHANGED
|
@@ -1,43 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __async = (__this, __arguments, generator) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
var fulfilled = (value) => {
|
|
23
|
-
try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
} catch (e) {
|
|
26
|
-
reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var rejected = (value) => {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.throw(value));
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
1
|
// src/accounts/airdrop.ts
|
|
42
2
|
import {
|
|
43
3
|
assertAccountExists,
|
|
@@ -81,9 +41,8 @@ function getAirdropEncoder() {
|
|
|
81
41
|
return transformEncoder(
|
|
82
42
|
getStructEncoder([
|
|
83
43
|
["discriminator", fixEncoderSize(getBytesEncoder(), 8)],
|
|
84
|
-
["
|
|
44
|
+
["authority", getAddressEncoder()],
|
|
85
45
|
["mint", getAddressEncoder()],
|
|
86
|
-
["owner", getAddressEncoder()],
|
|
87
46
|
["controller", getAddressEncoder()],
|
|
88
47
|
["supply", getU64Encoder()],
|
|
89
48
|
["merkleRoot", getArrayEncoder(getU8Encoder(), { size: 32 })],
|
|
@@ -93,15 +52,14 @@ function getAirdropEncoder() {
|
|
|
93
52
|
["version", getU8Encoder()],
|
|
94
53
|
["bump", getU8Encoder()]
|
|
95
54
|
]),
|
|
96
|
-
(value) =>
|
|
55
|
+
(value) => ({ ...value, discriminator: AIRDROP_DISCRIMINATOR })
|
|
97
56
|
);
|
|
98
57
|
}
|
|
99
58
|
function getAirdropDecoder() {
|
|
100
59
|
return getStructDecoder([
|
|
101
60
|
["discriminator", fixDecoderSize(getBytesDecoder(), 8)],
|
|
102
|
-
["
|
|
61
|
+
["authority", getAddressDecoder()],
|
|
103
62
|
["mint", getAddressDecoder()],
|
|
104
|
-
["owner", getAddressDecoder()],
|
|
105
63
|
["controller", getAddressDecoder()],
|
|
106
64
|
["supply", getU64Decoder()],
|
|
107
65
|
["merkleRoot", getArrayDecoder(getU8Decoder(), { size: 32 })],
|
|
@@ -121,31 +79,23 @@ function decodeAirdrop(encodedAccount) {
|
|
|
121
79
|
getAirdropDecoder()
|
|
122
80
|
);
|
|
123
81
|
}
|
|
124
|
-
function fetchAirdrop(rpc, address, config) {
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return maybeAccount;
|
|
129
|
-
});
|
|
82
|
+
async function fetchAirdrop(rpc, address, config) {
|
|
83
|
+
const maybeAccount = await fetchMaybeAirdrop(rpc, address, config);
|
|
84
|
+
assertAccountExists(maybeAccount);
|
|
85
|
+
return maybeAccount;
|
|
130
86
|
}
|
|
131
|
-
function fetchMaybeAirdrop(rpc, address, config) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return decodeAirdrop(maybeAccount);
|
|
135
|
-
});
|
|
87
|
+
async function fetchMaybeAirdrop(rpc, address, config) {
|
|
88
|
+
const maybeAccount = await fetchEncodedAccount(rpc, address, config);
|
|
89
|
+
return decodeAirdrop(maybeAccount);
|
|
136
90
|
}
|
|
137
|
-
function fetchAllAirdrop(rpc, addresses, config) {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
return maybeAccounts;
|
|
142
|
-
});
|
|
91
|
+
async function fetchAllAirdrop(rpc, addresses, config) {
|
|
92
|
+
const maybeAccounts = await fetchAllMaybeAirdrop(rpc, addresses, config);
|
|
93
|
+
assertAccountsExist(maybeAccounts);
|
|
94
|
+
return maybeAccounts;
|
|
143
95
|
}
|
|
144
|
-
function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
148
|
-
});
|
|
96
|
+
async function fetchAllMaybeAirdrop(rpc, addresses, config) {
|
|
97
|
+
const maybeAccounts = await fetchEncodedAccounts(rpc, addresses, config);
|
|
98
|
+
return maybeAccounts.map((maybeAccount) => decodeAirdrop(maybeAccount));
|
|
149
99
|
}
|
|
150
100
|
|
|
151
101
|
// src/accounts/bitmapAccount.ts
|
|
@@ -191,7 +141,7 @@ function getBitmapAccountEncoder() {
|
|
|
191
141
|
return transformEncoder2(
|
|
192
142
|
getStructEncoder2([
|
|
193
143
|
["discriminator", fixEncoderSize2(getBytesEncoder2(), 8)],
|
|
194
|
-
["
|
|
144
|
+
["authority", getAddressEncoder2()],
|
|
195
145
|
["airdrop", getAddressEncoder2()],
|
|
196
146
|
[
|
|
197
147
|
"claimedBitmap",
|
|
@@ -201,13 +151,13 @@ function getBitmapAccountEncoder() {
|
|
|
201
151
|
["version", getU8Encoder2()],
|
|
202
152
|
["bump", getU8Encoder2()]
|
|
203
153
|
]),
|
|
204
|
-
(value) =>
|
|
154
|
+
(value) => ({ ...value, discriminator: BITMAP_ACCOUNT_DISCRIMINATOR })
|
|
205
155
|
);
|
|
206
156
|
}
|
|
207
157
|
function getBitmapAccountDecoder() {
|
|
208
158
|
return getStructDecoder2([
|
|
209
159
|
["discriminator", fixDecoderSize2(getBytesDecoder2(), 8)],
|
|
210
|
-
["
|
|
160
|
+
["authority", getAddressDecoder2()],
|
|
211
161
|
["airdrop", getAddressDecoder2()],
|
|
212
162
|
["claimedBitmap", addDecoderSizePrefix(getBytesDecoder2(), getU32Decoder())],
|
|
213
163
|
["id", getU8Decoder2()],
|
|
@@ -224,35 +174,27 @@ function decodeBitmapAccount(encodedAccount) {
|
|
|
224
174
|
getBitmapAccountDecoder()
|
|
225
175
|
);
|
|
226
176
|
}
|
|
227
|
-
function fetchBitmapAccount(rpc, address, config) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return maybeAccount;
|
|
232
|
-
});
|
|
177
|
+
async function fetchBitmapAccount(rpc, address, config) {
|
|
178
|
+
const maybeAccount = await fetchMaybeBitmapAccount(rpc, address, config);
|
|
179
|
+
assertAccountExists2(maybeAccount);
|
|
180
|
+
return maybeAccount;
|
|
233
181
|
}
|
|
234
|
-
function fetchMaybeBitmapAccount(rpc, address, config) {
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return decodeBitmapAccount(maybeAccount);
|
|
238
|
-
});
|
|
182
|
+
async function fetchMaybeBitmapAccount(rpc, address, config) {
|
|
183
|
+
const maybeAccount = await fetchEncodedAccount2(rpc, address, config);
|
|
184
|
+
return decodeBitmapAccount(maybeAccount);
|
|
239
185
|
}
|
|
240
|
-
function fetchAllBitmapAccount(rpc, addresses, config) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
return maybeAccounts;
|
|
249
|
-
});
|
|
186
|
+
async function fetchAllBitmapAccount(rpc, addresses, config) {
|
|
187
|
+
const maybeAccounts = await fetchAllMaybeBitmapAccount(
|
|
188
|
+
rpc,
|
|
189
|
+
addresses,
|
|
190
|
+
config
|
|
191
|
+
);
|
|
192
|
+
assertAccountsExist2(maybeAccounts);
|
|
193
|
+
return maybeAccounts;
|
|
250
194
|
}
|
|
251
|
-
function fetchAllMaybeBitmapAccount(rpc, addresses, config) {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return maybeAccounts.map((maybeAccount) => decodeBitmapAccount(maybeAccount));
|
|
255
|
-
});
|
|
195
|
+
async function fetchAllMaybeBitmapAccount(rpc, addresses, config) {
|
|
196
|
+
const maybeAccounts = await fetchEncodedAccounts2(rpc, addresses, config);
|
|
197
|
+
return maybeAccounts.map((maybeAccount) => decodeBitmapAccount(maybeAccount));
|
|
256
198
|
}
|
|
257
199
|
|
|
258
200
|
// src/accounts/controller.ts
|
|
@@ -296,12 +238,12 @@ function getControllerEncoder() {
|
|
|
296
238
|
["discriminator", fixEncoderSize3(getBytesEncoder3(), 8)],
|
|
297
239
|
["authority", getAddressEncoder3()],
|
|
298
240
|
["feeVault", getAddressEncoder3()],
|
|
299
|
-
["
|
|
300
|
-
["claimFee", getU64Encoder2()],
|
|
241
|
+
["feeLamports", getU64Encoder2()],
|
|
301
242
|
["version", getU8Encoder3()],
|
|
302
|
-
["bump", getU8Encoder3()]
|
|
243
|
+
["bump", getU8Encoder3()],
|
|
244
|
+
["feeVaultBump", getU8Encoder3()]
|
|
303
245
|
]),
|
|
304
|
-
(value) =>
|
|
246
|
+
(value) => ({ ...value, discriminator: CONTROLLER_DISCRIMINATOR })
|
|
305
247
|
);
|
|
306
248
|
}
|
|
307
249
|
function getControllerDecoder() {
|
|
@@ -309,10 +251,10 @@ function getControllerDecoder() {
|
|
|
309
251
|
["discriminator", fixDecoderSize3(getBytesDecoder3(), 8)],
|
|
310
252
|
["authority", getAddressDecoder3()],
|
|
311
253
|
["feeVault", getAddressDecoder3()],
|
|
312
|
-
["
|
|
313
|
-
["claimFee", getU64Decoder2()],
|
|
254
|
+
["feeLamports", getU64Decoder2()],
|
|
314
255
|
["version", getU8Decoder3()],
|
|
315
|
-
["bump", getU8Decoder3()]
|
|
256
|
+
["bump", getU8Decoder3()],
|
|
257
|
+
["feeVaultBump", getU8Decoder3()]
|
|
316
258
|
]);
|
|
317
259
|
}
|
|
318
260
|
function getControllerCodec() {
|
|
@@ -324,31 +266,199 @@ function decodeController(encodedAccount) {
|
|
|
324
266
|
getControllerDecoder()
|
|
325
267
|
);
|
|
326
268
|
}
|
|
327
|
-
function fetchController(rpc, address, config) {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
return maybeAccount;
|
|
332
|
-
});
|
|
269
|
+
async function fetchController(rpc, address, config) {
|
|
270
|
+
const maybeAccount = await fetchMaybeController(rpc, address, config);
|
|
271
|
+
assertAccountExists3(maybeAccount);
|
|
272
|
+
return maybeAccount;
|
|
333
273
|
}
|
|
334
|
-
function fetchMaybeController(rpc, address, config) {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
return decodeController(maybeAccount);
|
|
338
|
-
});
|
|
274
|
+
async function fetchMaybeController(rpc, address, config) {
|
|
275
|
+
const maybeAccount = await fetchEncodedAccount3(rpc, address, config);
|
|
276
|
+
return decodeController(maybeAccount);
|
|
339
277
|
}
|
|
340
|
-
function fetchAllController(rpc, addresses, config) {
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return maybeAccounts;
|
|
345
|
-
});
|
|
278
|
+
async function fetchAllController(rpc, addresses, config) {
|
|
279
|
+
const maybeAccounts = await fetchAllMaybeController(rpc, addresses, config);
|
|
280
|
+
assertAccountsExist3(maybeAccounts);
|
|
281
|
+
return maybeAccounts;
|
|
346
282
|
}
|
|
347
|
-
function fetchAllMaybeController(rpc, addresses, config) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
283
|
+
async function fetchAllMaybeController(rpc, addresses, config) {
|
|
284
|
+
const maybeAccounts = await fetchEncodedAccounts3(rpc, addresses, config);
|
|
285
|
+
return maybeAccounts.map((maybeAccount) => decodeController(maybeAccount));
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// src/accounts/master.ts
|
|
289
|
+
import {
|
|
290
|
+
assertAccountExists as assertAccountExists4,
|
|
291
|
+
assertAccountsExist as assertAccountsExist4,
|
|
292
|
+
combineCodec as combineCodec4,
|
|
293
|
+
decodeAccount as decodeAccount4,
|
|
294
|
+
fetchEncodedAccount as fetchEncodedAccount4,
|
|
295
|
+
fetchEncodedAccounts as fetchEncodedAccounts4,
|
|
296
|
+
fixDecoderSize as fixDecoderSize4,
|
|
297
|
+
fixEncoderSize as fixEncoderSize4,
|
|
298
|
+
getAddressDecoder as getAddressDecoder4,
|
|
299
|
+
getAddressEncoder as getAddressEncoder4,
|
|
300
|
+
getBytesDecoder as getBytesDecoder4,
|
|
301
|
+
getBytesEncoder as getBytesEncoder4,
|
|
302
|
+
getStructDecoder as getStructDecoder4,
|
|
303
|
+
getStructEncoder as getStructEncoder4,
|
|
304
|
+
getU64Decoder as getU64Decoder3,
|
|
305
|
+
getU64Encoder as getU64Encoder3,
|
|
306
|
+
getU8Decoder as getU8Decoder4,
|
|
307
|
+
getU8Encoder as getU8Encoder4,
|
|
308
|
+
transformEncoder as transformEncoder4
|
|
309
|
+
} from "@solana/kit";
|
|
310
|
+
var MASTER_DISCRIMINATOR = new Uint8Array([
|
|
311
|
+
168,
|
|
312
|
+
213,
|
|
313
|
+
193,
|
|
314
|
+
12,
|
|
315
|
+
77,
|
|
316
|
+
162,
|
|
317
|
+
58,
|
|
318
|
+
235
|
|
319
|
+
]);
|
|
320
|
+
function getMasterDiscriminatorBytes() {
|
|
321
|
+
return fixEncoderSize4(getBytesEncoder4(), 8).encode(MASTER_DISCRIMINATOR);
|
|
322
|
+
}
|
|
323
|
+
function getMasterEncoder() {
|
|
324
|
+
return transformEncoder4(
|
|
325
|
+
getStructEncoder4([
|
|
326
|
+
["discriminator", fixEncoderSize4(getBytesEncoder4(), 8)],
|
|
327
|
+
["authority", getAddressEncoder4()],
|
|
328
|
+
["feeVault", getAddressEncoder4()],
|
|
329
|
+
["protocolFee", getU64Encoder3()],
|
|
330
|
+
["withdrawFee", getU64Encoder3()],
|
|
331
|
+
["initControllerFee", getU64Encoder3()],
|
|
332
|
+
["version", getU8Encoder4()],
|
|
333
|
+
["bump", getU8Encoder4()]
|
|
334
|
+
]),
|
|
335
|
+
(value) => ({ ...value, discriminator: MASTER_DISCRIMINATOR })
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
function getMasterDecoder() {
|
|
339
|
+
return getStructDecoder4([
|
|
340
|
+
["discriminator", fixDecoderSize4(getBytesDecoder4(), 8)],
|
|
341
|
+
["authority", getAddressDecoder4()],
|
|
342
|
+
["feeVault", getAddressDecoder4()],
|
|
343
|
+
["protocolFee", getU64Decoder3()],
|
|
344
|
+
["withdrawFee", getU64Decoder3()],
|
|
345
|
+
["initControllerFee", getU64Decoder3()],
|
|
346
|
+
["version", getU8Decoder4()],
|
|
347
|
+
["bump", getU8Decoder4()]
|
|
348
|
+
]);
|
|
349
|
+
}
|
|
350
|
+
function getMasterCodec() {
|
|
351
|
+
return combineCodec4(getMasterEncoder(), getMasterDecoder());
|
|
352
|
+
}
|
|
353
|
+
function decodeMaster(encodedAccount) {
|
|
354
|
+
return decodeAccount4(
|
|
355
|
+
encodedAccount,
|
|
356
|
+
getMasterDecoder()
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
async function fetchMaster(rpc, address, config) {
|
|
360
|
+
const maybeAccount = await fetchMaybeMaster(rpc, address, config);
|
|
361
|
+
assertAccountExists4(maybeAccount);
|
|
362
|
+
return maybeAccount;
|
|
363
|
+
}
|
|
364
|
+
async function fetchMaybeMaster(rpc, address, config) {
|
|
365
|
+
const maybeAccount = await fetchEncodedAccount4(rpc, address, config);
|
|
366
|
+
return decodeMaster(maybeAccount);
|
|
367
|
+
}
|
|
368
|
+
async function fetchAllMaster(rpc, addresses, config) {
|
|
369
|
+
const maybeAccounts = await fetchAllMaybeMaster(rpc, addresses, config);
|
|
370
|
+
assertAccountsExist4(maybeAccounts);
|
|
371
|
+
return maybeAccounts;
|
|
372
|
+
}
|
|
373
|
+
async function fetchAllMaybeMaster(rpc, addresses, config) {
|
|
374
|
+
const maybeAccounts = await fetchEncodedAccounts4(rpc, addresses, config);
|
|
375
|
+
return maybeAccounts.map((maybeAccount) => decodeMaster(maybeAccount));
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
// src/accounts/stats.ts
|
|
379
|
+
import {
|
|
380
|
+
assertAccountExists as assertAccountExists5,
|
|
381
|
+
assertAccountsExist as assertAccountsExist5,
|
|
382
|
+
combineCodec as combineCodec5,
|
|
383
|
+
decodeAccount as decodeAccount5,
|
|
384
|
+
fetchEncodedAccount as fetchEncodedAccount5,
|
|
385
|
+
fetchEncodedAccounts as fetchEncodedAccounts5,
|
|
386
|
+
fixDecoderSize as fixDecoderSize5,
|
|
387
|
+
fixEncoderSize as fixEncoderSize5,
|
|
388
|
+
getBytesDecoder as getBytesDecoder5,
|
|
389
|
+
getBytesEncoder as getBytesEncoder5,
|
|
390
|
+
getStructDecoder as getStructDecoder5,
|
|
391
|
+
getStructEncoder as getStructEncoder5,
|
|
392
|
+
getU64Decoder as getU64Decoder4,
|
|
393
|
+
getU64Encoder as getU64Encoder4,
|
|
394
|
+
getU8Decoder as getU8Decoder5,
|
|
395
|
+
getU8Encoder as getU8Encoder5,
|
|
396
|
+
transformEncoder as transformEncoder5
|
|
397
|
+
} from "@solana/kit";
|
|
398
|
+
var STATS_DISCRIMINATOR = new Uint8Array([
|
|
399
|
+
190,
|
|
400
|
+
125,
|
|
401
|
+
51,
|
|
402
|
+
63,
|
|
403
|
+
169,
|
|
404
|
+
197,
|
|
405
|
+
36,
|
|
406
|
+
238
|
|
407
|
+
]);
|
|
408
|
+
function getStatsDiscriminatorBytes() {
|
|
409
|
+
return fixEncoderSize5(getBytesEncoder5(), 8).encode(STATS_DISCRIMINATOR);
|
|
410
|
+
}
|
|
411
|
+
function getStatsEncoder() {
|
|
412
|
+
return transformEncoder5(
|
|
413
|
+
getStructEncoder5([
|
|
414
|
+
["discriminator", fixEncoderSize5(getBytesEncoder5(), 8)],
|
|
415
|
+
["initializedControllers", getU64Encoder4()],
|
|
416
|
+
["initializedAirdrops", getU64Encoder4()],
|
|
417
|
+
["initializedClaimMaps", getU64Encoder4()],
|
|
418
|
+
["closedAirdrops", getU64Encoder4()],
|
|
419
|
+
["closedClaimMap", getU64Encoder4()],
|
|
420
|
+
["bump", getU8Encoder5()]
|
|
421
|
+
]),
|
|
422
|
+
(value) => ({ ...value, discriminator: STATS_DISCRIMINATOR })
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
function getStatsDecoder() {
|
|
426
|
+
return getStructDecoder5([
|
|
427
|
+
["discriminator", fixDecoderSize5(getBytesDecoder5(), 8)],
|
|
428
|
+
["initializedControllers", getU64Decoder4()],
|
|
429
|
+
["initializedAirdrops", getU64Decoder4()],
|
|
430
|
+
["initializedClaimMaps", getU64Decoder4()],
|
|
431
|
+
["closedAirdrops", getU64Decoder4()],
|
|
432
|
+
["closedClaimMap", getU64Decoder4()],
|
|
433
|
+
["bump", getU8Decoder5()]
|
|
434
|
+
]);
|
|
435
|
+
}
|
|
436
|
+
function getStatsCodec() {
|
|
437
|
+
return combineCodec5(getStatsEncoder(), getStatsDecoder());
|
|
438
|
+
}
|
|
439
|
+
function decodeStats(encodedAccount) {
|
|
440
|
+
return decodeAccount5(
|
|
441
|
+
encodedAccount,
|
|
442
|
+
getStatsDecoder()
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
async function fetchStats(rpc, address, config) {
|
|
446
|
+
const maybeAccount = await fetchMaybeStats(rpc, address, config);
|
|
447
|
+
assertAccountExists5(maybeAccount);
|
|
448
|
+
return maybeAccount;
|
|
449
|
+
}
|
|
450
|
+
async function fetchMaybeStats(rpc, address, config) {
|
|
451
|
+
const maybeAccount = await fetchEncodedAccount5(rpc, address, config);
|
|
452
|
+
return decodeStats(maybeAccount);
|
|
453
|
+
}
|
|
454
|
+
async function fetchAllStats(rpc, addresses, config) {
|
|
455
|
+
const maybeAccounts = await fetchAllMaybeStats(rpc, addresses, config);
|
|
456
|
+
assertAccountsExist5(maybeAccounts);
|
|
457
|
+
return maybeAccounts;
|
|
458
|
+
}
|
|
459
|
+
async function fetchAllMaybeStats(rpc, addresses, config) {
|
|
460
|
+
const maybeAccounts = await fetchEncodedAccounts5(rpc, addresses, config);
|
|
461
|
+
return maybeAccounts.map((maybeAccount) => decodeStats(maybeAccount));
|
|
352
462
|
}
|
|
353
463
|
|
|
354
464
|
// src/errors/dropsy.ts
|
|
@@ -359,21 +469,23 @@ import {
|
|
|
359
469
|
// src/programs/dropsy.ts
|
|
360
470
|
import {
|
|
361
471
|
containsBytes,
|
|
362
|
-
fixEncoderSize as
|
|
363
|
-
getBytesEncoder as
|
|
472
|
+
fixEncoderSize as fixEncoderSize6,
|
|
473
|
+
getBytesEncoder as getBytesEncoder6
|
|
364
474
|
} from "@solana/kit";
|
|
365
|
-
var DROPSY_PROGRAM_ADDRESS = "
|
|
475
|
+
var DROPSY_PROGRAM_ADDRESS = "DropmEfonJRZyPaRQbPgn4nrt3cDi5678bLbzVQRvgLp";
|
|
366
476
|
var DropsyAccount = /* @__PURE__ */ ((DropsyAccount2) => {
|
|
367
477
|
DropsyAccount2[DropsyAccount2["Airdrop"] = 0] = "Airdrop";
|
|
368
478
|
DropsyAccount2[DropsyAccount2["BitmapAccount"] = 1] = "BitmapAccount";
|
|
369
479
|
DropsyAccount2[DropsyAccount2["Controller"] = 2] = "Controller";
|
|
480
|
+
DropsyAccount2[DropsyAccount2["Master"] = 3] = "Master";
|
|
481
|
+
DropsyAccount2[DropsyAccount2["Stats"] = 4] = "Stats";
|
|
370
482
|
return DropsyAccount2;
|
|
371
483
|
})(DropsyAccount || {});
|
|
372
484
|
function identifyDropsyAccount(account) {
|
|
373
485
|
const data = "data" in account ? account.data : account;
|
|
374
486
|
if (containsBytes(
|
|
375
487
|
data,
|
|
376
|
-
|
|
488
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
377
489
|
new Uint8Array([31, 112, 159, 158, 124, 237, 9, 241])
|
|
378
490
|
),
|
|
379
491
|
0
|
|
@@ -382,7 +494,7 @@ function identifyDropsyAccount(account) {
|
|
|
382
494
|
}
|
|
383
495
|
if (containsBytes(
|
|
384
496
|
data,
|
|
385
|
-
|
|
497
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
386
498
|
new Uint8Array([152, 161, 147, 85, 213, 38, 59, 48])
|
|
387
499
|
),
|
|
388
500
|
0
|
|
@@ -391,13 +503,31 @@ function identifyDropsyAccount(account) {
|
|
|
391
503
|
}
|
|
392
504
|
if (containsBytes(
|
|
393
505
|
data,
|
|
394
|
-
|
|
506
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
395
507
|
new Uint8Array([184, 79, 171, 0, 183, 43, 113, 110])
|
|
396
508
|
),
|
|
397
509
|
0
|
|
398
510
|
)) {
|
|
399
511
|
return 2 /* Controller */;
|
|
400
512
|
}
|
|
513
|
+
if (containsBytes(
|
|
514
|
+
data,
|
|
515
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
516
|
+
new Uint8Array([168, 213, 193, 12, 77, 162, 58, 235])
|
|
517
|
+
),
|
|
518
|
+
0
|
|
519
|
+
)) {
|
|
520
|
+
return 3 /* Master */;
|
|
521
|
+
}
|
|
522
|
+
if (containsBytes(
|
|
523
|
+
data,
|
|
524
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
525
|
+
new Uint8Array([190, 125, 51, 63, 169, 197, 36, 238])
|
|
526
|
+
),
|
|
527
|
+
0
|
|
528
|
+
)) {
|
|
529
|
+
return 4 /* Stats */;
|
|
530
|
+
}
|
|
401
531
|
throw new Error(
|
|
402
532
|
"The provided account could not be identified as a dropsy account."
|
|
403
533
|
);
|
|
@@ -410,13 +540,15 @@ var DropsyInstruction = /* @__PURE__ */ ((DropsyInstruction2) => {
|
|
|
410
540
|
DropsyInstruction2[DropsyInstruction2["InitializeAirdrop"] = 4] = "InitializeAirdrop";
|
|
411
541
|
DropsyInstruction2[DropsyInstruction2["InitializeBitmap"] = 5] = "InitializeBitmap";
|
|
412
542
|
DropsyInstruction2[DropsyInstruction2["InitializeController"] = 6] = "InitializeController";
|
|
543
|
+
DropsyInstruction2[DropsyInstruction2["InitializeMaster"] = 7] = "InitializeMaster";
|
|
544
|
+
DropsyInstruction2[DropsyInstruction2["WithdrawControllerFees"] = 8] = "WithdrawControllerFees";
|
|
413
545
|
return DropsyInstruction2;
|
|
414
546
|
})(DropsyInstruction || {});
|
|
415
547
|
function identifyDropsyInstruction(instruction) {
|
|
416
548
|
const data = "data" in instruction ? instruction.data : instruction;
|
|
417
549
|
if (containsBytes(
|
|
418
550
|
data,
|
|
419
|
-
|
|
551
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
420
552
|
new Uint8Array([108, 216, 210, 231, 0, 212, 42, 64])
|
|
421
553
|
),
|
|
422
554
|
0
|
|
@@ -425,7 +557,7 @@ function identifyDropsyInstruction(instruction) {
|
|
|
425
557
|
}
|
|
426
558
|
if (containsBytes(
|
|
427
559
|
data,
|
|
428
|
-
|
|
560
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
429
561
|
new Uint8Array([85, 138, 99, 129, 104, 203, 94, 4])
|
|
430
562
|
),
|
|
431
563
|
0
|
|
@@ -434,7 +566,7 @@ function identifyDropsyInstruction(instruction) {
|
|
|
434
566
|
}
|
|
435
567
|
if (containsBytes(
|
|
436
568
|
data,
|
|
437
|
-
|
|
569
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
438
570
|
new Uint8Array([59, 123, 115, 204, 163, 227, 37, 118])
|
|
439
571
|
),
|
|
440
572
|
0
|
|
@@ -443,7 +575,7 @@ function identifyDropsyInstruction(instruction) {
|
|
|
443
575
|
}
|
|
444
576
|
if (containsBytes(
|
|
445
577
|
data,
|
|
446
|
-
|
|
578
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
447
579
|
new Uint8Array([176, 83, 229, 18, 191, 143, 176, 150])
|
|
448
580
|
),
|
|
449
581
|
0
|
|
@@ -452,7 +584,7 @@ function identifyDropsyInstruction(instruction) {
|
|
|
452
584
|
}
|
|
453
585
|
if (containsBytes(
|
|
454
586
|
data,
|
|
455
|
-
|
|
587
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
456
588
|
new Uint8Array([96, 196, 74, 102, 61, 195, 48, 184])
|
|
457
589
|
),
|
|
458
590
|
0
|
|
@@ -461,7 +593,7 @@ function identifyDropsyInstruction(instruction) {
|
|
|
461
593
|
}
|
|
462
594
|
if (containsBytes(
|
|
463
595
|
data,
|
|
464
|
-
|
|
596
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
465
597
|
new Uint8Array([25, 109, 200, 45, 209, 118, 74, 69])
|
|
466
598
|
),
|
|
467
599
|
0
|
|
@@ -470,13 +602,31 @@ function identifyDropsyInstruction(instruction) {
|
|
|
470
602
|
}
|
|
471
603
|
if (containsBytes(
|
|
472
604
|
data,
|
|
473
|
-
|
|
605
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
474
606
|
new Uint8Array([137, 255, 100, 190, 201, 247, 241, 81])
|
|
475
607
|
),
|
|
476
608
|
0
|
|
477
609
|
)) {
|
|
478
610
|
return 6 /* InitializeController */;
|
|
479
611
|
}
|
|
612
|
+
if (containsBytes(
|
|
613
|
+
data,
|
|
614
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
615
|
+
new Uint8Array([206, 91, 246, 30, 216, 101, 134, 166])
|
|
616
|
+
),
|
|
617
|
+
0
|
|
618
|
+
)) {
|
|
619
|
+
return 7 /* InitializeMaster */;
|
|
620
|
+
}
|
|
621
|
+
if (containsBytes(
|
|
622
|
+
data,
|
|
623
|
+
fixEncoderSize6(getBytesEncoder6(), 8).encode(
|
|
624
|
+
new Uint8Array([252, 199, 14, 46, 100, 156, 176, 230])
|
|
625
|
+
),
|
|
626
|
+
0
|
|
627
|
+
)) {
|
|
628
|
+
return 8 /* WithdrawControllerFees */;
|
|
629
|
+
}
|
|
480
630
|
throw new Error(
|
|
481
631
|
"The provided instruction could not be identified as a dropsy instruction."
|
|
482
632
|
);
|
|
@@ -607,20 +757,20 @@ function isDropsyError(error, transactionMessage, code) {
|
|
|
607
757
|
|
|
608
758
|
// src/instructions/claimTokens.ts
|
|
609
759
|
import {
|
|
610
|
-
combineCodec as
|
|
611
|
-
fixDecoderSize as
|
|
612
|
-
fixEncoderSize as
|
|
760
|
+
combineCodec as combineCodec6,
|
|
761
|
+
fixDecoderSize as fixDecoderSize6,
|
|
762
|
+
fixEncoderSize as fixEncoderSize7,
|
|
613
763
|
getArrayDecoder as getArrayDecoder2,
|
|
614
764
|
getArrayEncoder as getArrayEncoder2,
|
|
615
|
-
getBytesDecoder as
|
|
616
|
-
getBytesEncoder as
|
|
617
|
-
getStructDecoder as
|
|
618
|
-
getStructEncoder as
|
|
619
|
-
getU64Decoder as
|
|
620
|
-
getU64Encoder as
|
|
621
|
-
getU8Decoder as
|
|
622
|
-
getU8Encoder as
|
|
623
|
-
transformEncoder as
|
|
765
|
+
getBytesDecoder as getBytesDecoder6,
|
|
766
|
+
getBytesEncoder as getBytesEncoder7,
|
|
767
|
+
getStructDecoder as getStructDecoder6,
|
|
768
|
+
getStructEncoder as getStructEncoder6,
|
|
769
|
+
getU64Decoder as getU64Decoder5,
|
|
770
|
+
getU64Encoder as getU64Encoder5,
|
|
771
|
+
getU8Decoder as getU8Decoder6,
|
|
772
|
+
getU8Encoder as getU8Encoder6,
|
|
773
|
+
transformEncoder as transformEncoder6
|
|
624
774
|
} from "@solana/kit";
|
|
625
775
|
|
|
626
776
|
// src/shared/index.ts
|
|
@@ -658,10 +808,11 @@ function getAccountMetaFactory(programAddress, optionalAccountStrategy) {
|
|
|
658
808
|
});
|
|
659
809
|
}
|
|
660
810
|
const writableRole = account.isWritable ? AccountRole.WRITABLE : AccountRole.READONLY;
|
|
661
|
-
return Object.freeze(
|
|
811
|
+
return Object.freeze({
|
|
662
812
|
address: expectAddress(account.value),
|
|
663
|
-
role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole
|
|
664
|
-
|
|
813
|
+
role: isTransactionSigner(account.value) ? upgradeRoleToSigner(writableRole) : writableRole,
|
|
814
|
+
...isTransactionSigner(account.value) ? { signer: account.value } : {}
|
|
815
|
+
});
|
|
665
816
|
};
|
|
666
817
|
}
|
|
667
818
|
function isTransactionSigner(value) {
|
|
@@ -680,56 +831,53 @@ var CLAIM_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
680
831
|
64
|
|
681
832
|
]);
|
|
682
833
|
function getClaimTokensDiscriminatorBytes() {
|
|
683
|
-
return
|
|
834
|
+
return fixEncoderSize7(getBytesEncoder7(), 8).encode(
|
|
684
835
|
CLAIM_TOKENS_DISCRIMINATOR
|
|
685
836
|
);
|
|
686
837
|
}
|
|
687
838
|
function getClaimTokensInstructionDataEncoder() {
|
|
688
|
-
return
|
|
689
|
-
|
|
690
|
-
["discriminator",
|
|
691
|
-
["index",
|
|
692
|
-
["proof", getArrayEncoder2(getArrayEncoder2(
|
|
693
|
-
["amount",
|
|
839
|
+
return transformEncoder6(
|
|
840
|
+
getStructEncoder6([
|
|
841
|
+
["discriminator", fixEncoderSize7(getBytesEncoder7(), 8)],
|
|
842
|
+
["index", getU64Encoder5()],
|
|
843
|
+
["proof", getArrayEncoder2(getArrayEncoder2(getU8Encoder6(), { size: 32 }))],
|
|
844
|
+
["amount", getU64Encoder5()]
|
|
694
845
|
]),
|
|
695
|
-
(value) =>
|
|
846
|
+
(value) => ({ ...value, discriminator: CLAIM_TOKENS_DISCRIMINATOR })
|
|
696
847
|
);
|
|
697
848
|
}
|
|
698
849
|
function getClaimTokensInstructionDataDecoder() {
|
|
699
|
-
return
|
|
700
|
-
["discriminator",
|
|
701
|
-
["index",
|
|
702
|
-
["proof", getArrayDecoder2(getArrayDecoder2(
|
|
703
|
-
["amount",
|
|
850
|
+
return getStructDecoder6([
|
|
851
|
+
["discriminator", fixDecoderSize6(getBytesDecoder6(), 8)],
|
|
852
|
+
["index", getU64Decoder5()],
|
|
853
|
+
["proof", getArrayDecoder2(getArrayDecoder2(getU8Decoder6(), { size: 32 }))],
|
|
854
|
+
["amount", getU64Decoder5()]
|
|
704
855
|
]);
|
|
705
856
|
}
|
|
706
857
|
function getClaimTokensInstructionDataCodec() {
|
|
707
|
-
return
|
|
858
|
+
return combineCodec6(
|
|
708
859
|
getClaimTokensInstructionDataEncoder(),
|
|
709
860
|
getClaimTokensInstructionDataDecoder()
|
|
710
861
|
);
|
|
711
862
|
}
|
|
712
863
|
function getClaimTokensInstruction(input, config) {
|
|
713
|
-
|
|
714
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
864
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
715
865
|
const originalAccounts = {
|
|
716
|
-
vault: { value:
|
|
866
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
717
867
|
destinationTokenAccount: {
|
|
718
|
-
value:
|
|
868
|
+
value: input.destinationTokenAccount ?? null,
|
|
719
869
|
isWritable: true
|
|
720
870
|
},
|
|
721
|
-
airdrop: { value:
|
|
722
|
-
bitmap: { value:
|
|
723
|
-
mint: { value:
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
tokenProgram: { value: (_k = input.tokenProgram) != null ? _k : null, isWritable: false },
|
|
729
|
-
systemProgram: { value: (_l = input.systemProgram) != null ? _l : null, isWritable: false }
|
|
871
|
+
airdrop: { value: input.airdrop ?? null, isWritable: false },
|
|
872
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
873
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
874
|
+
claimer: { value: input.claimer ?? null, isWritable: true },
|
|
875
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
876
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
877
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
730
878
|
};
|
|
731
879
|
const accounts = originalAccounts;
|
|
732
|
-
const args =
|
|
880
|
+
const args = { ...input };
|
|
733
881
|
if (!accounts.treasury.value) {
|
|
734
882
|
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
735
883
|
}
|
|
@@ -747,8 +895,6 @@ function getClaimTokensInstruction(input, config) {
|
|
|
747
895
|
getAccountMeta(accounts.airdrop),
|
|
748
896
|
getAccountMeta(accounts.bitmap),
|
|
749
897
|
getAccountMeta(accounts.mint),
|
|
750
|
-
getAccountMeta(accounts.feeVault),
|
|
751
|
-
getAccountMeta(accounts.controller),
|
|
752
898
|
getAccountMeta(accounts.claimer),
|
|
753
899
|
getAccountMeta(accounts.treasury),
|
|
754
900
|
getAccountMeta(accounts.tokenProgram),
|
|
@@ -762,7 +908,7 @@ function getClaimTokensInstruction(input, config) {
|
|
|
762
908
|
return instruction;
|
|
763
909
|
}
|
|
764
910
|
function parseClaimTokensInstruction(instruction) {
|
|
765
|
-
if (instruction.accounts.length <
|
|
911
|
+
if (instruction.accounts.length < 9) {
|
|
766
912
|
throw new Error("Not enough accounts");
|
|
767
913
|
}
|
|
768
914
|
let accountIndex = 0;
|
|
@@ -779,8 +925,6 @@ function parseClaimTokensInstruction(instruction) {
|
|
|
779
925
|
airdrop: getNextAccount(),
|
|
780
926
|
bitmap: getNextAccount(),
|
|
781
927
|
mint: getNextAccount(),
|
|
782
|
-
feeVault: getNextAccount(),
|
|
783
|
-
controller: getNextAccount(),
|
|
784
928
|
claimer: getNextAccount(),
|
|
785
929
|
treasury: getNextAccount(),
|
|
786
930
|
tokenProgram: getNextAccount(),
|
|
@@ -792,14 +936,16 @@ function parseClaimTokensInstruction(instruction) {
|
|
|
792
936
|
|
|
793
937
|
// src/instructions/closeAirdrop.ts
|
|
794
938
|
import {
|
|
795
|
-
combineCodec as
|
|
796
|
-
fixDecoderSize as
|
|
797
|
-
fixEncoderSize as
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
939
|
+
combineCodec as combineCodec7,
|
|
940
|
+
fixDecoderSize as fixDecoderSize7,
|
|
941
|
+
fixEncoderSize as fixEncoderSize8,
|
|
942
|
+
getAddressEncoder as getAddressEncoder5,
|
|
943
|
+
getBytesDecoder as getBytesDecoder7,
|
|
944
|
+
getBytesEncoder as getBytesEncoder8,
|
|
945
|
+
getProgramDerivedAddress,
|
|
946
|
+
getStructDecoder as getStructDecoder7,
|
|
947
|
+
getStructEncoder as getStructEncoder7,
|
|
948
|
+
transformEncoder as transformEncoder7
|
|
803
949
|
} from "@solana/kit";
|
|
804
950
|
var CLOSE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
805
951
|
85,
|
|
@@ -812,54 +958,124 @@ var CLOSE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
|
812
958
|
4
|
|
813
959
|
]);
|
|
814
960
|
function getCloseAirdropDiscriminatorBytes() {
|
|
815
|
-
return
|
|
961
|
+
return fixEncoderSize8(getBytesEncoder8(), 8).encode(
|
|
816
962
|
CLOSE_AIRDROP_DISCRIMINATOR
|
|
817
963
|
);
|
|
818
964
|
}
|
|
819
965
|
function getCloseAirdropInstructionDataEncoder() {
|
|
820
|
-
return
|
|
821
|
-
|
|
822
|
-
(value) =>
|
|
966
|
+
return transformEncoder7(
|
|
967
|
+
getStructEncoder7([["discriminator", fixEncoderSize8(getBytesEncoder8(), 8)]]),
|
|
968
|
+
(value) => ({ ...value, discriminator: CLOSE_AIRDROP_DISCRIMINATOR })
|
|
823
969
|
);
|
|
824
970
|
}
|
|
825
971
|
function getCloseAirdropInstructionDataDecoder() {
|
|
826
|
-
return
|
|
827
|
-
["discriminator",
|
|
972
|
+
return getStructDecoder7([
|
|
973
|
+
["discriminator", fixDecoderSize7(getBytesDecoder7(), 8)]
|
|
828
974
|
]);
|
|
829
975
|
}
|
|
830
976
|
function getCloseAirdropInstructionDataCodec() {
|
|
831
|
-
return
|
|
977
|
+
return combineCodec7(
|
|
832
978
|
getCloseAirdropInstructionDataEncoder(),
|
|
833
979
|
getCloseAirdropInstructionDataDecoder()
|
|
834
980
|
);
|
|
835
981
|
}
|
|
982
|
+
async function getCloseAirdropInstructionAsync(input, config) {
|
|
983
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
984
|
+
const originalAccounts = {
|
|
985
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
986
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
987
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
988
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
989
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
990
|
+
destinationTokenAccount: {
|
|
991
|
+
value: input.destinationTokenAccount ?? null,
|
|
992
|
+
isWritable: true
|
|
993
|
+
},
|
|
994
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
995
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
996
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
997
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
998
|
+
};
|
|
999
|
+
const accounts = originalAccounts;
|
|
1000
|
+
if (!accounts.stats.value) {
|
|
1001
|
+
accounts.stats.value = await getProgramDerivedAddress({
|
|
1002
|
+
programAddress,
|
|
1003
|
+
seeds: [
|
|
1004
|
+
getBytesEncoder8().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1005
|
+
]
|
|
1006
|
+
});
|
|
1007
|
+
}
|
|
1008
|
+
if (!accounts.feeVault.value) {
|
|
1009
|
+
accounts.feeVault.value = await getProgramDerivedAddress({
|
|
1010
|
+
programAddress,
|
|
1011
|
+
seeds: [
|
|
1012
|
+
getBytesEncoder8().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1013
|
+
getAddressEncoder5().encode(expectAddress(accounts.controller.value))
|
|
1014
|
+
]
|
|
1015
|
+
});
|
|
1016
|
+
}
|
|
1017
|
+
if (!accounts.tokenProgram.value) {
|
|
1018
|
+
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
1019
|
+
}
|
|
1020
|
+
if (!accounts.systemProgram.value) {
|
|
1021
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1022
|
+
}
|
|
1023
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1024
|
+
const instruction = {
|
|
1025
|
+
accounts: [
|
|
1026
|
+
getAccountMeta(accounts.stats),
|
|
1027
|
+
getAccountMeta(accounts.controller),
|
|
1028
|
+
getAccountMeta(accounts.feeVault),
|
|
1029
|
+
getAccountMeta(accounts.airdrop),
|
|
1030
|
+
getAccountMeta(accounts.vault),
|
|
1031
|
+
getAccountMeta(accounts.destinationTokenAccount),
|
|
1032
|
+
getAccountMeta(accounts.authority),
|
|
1033
|
+
getAccountMeta(accounts.mint),
|
|
1034
|
+
getAccountMeta(accounts.tokenProgram),
|
|
1035
|
+
getAccountMeta(accounts.systemProgram)
|
|
1036
|
+
],
|
|
1037
|
+
programAddress,
|
|
1038
|
+
data: getCloseAirdropInstructionDataEncoder().encode({})
|
|
1039
|
+
};
|
|
1040
|
+
return instruction;
|
|
1041
|
+
}
|
|
836
1042
|
function getCloseAirdropInstruction(input, config) {
|
|
837
|
-
|
|
838
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1043
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
839
1044
|
const originalAccounts = {
|
|
840
|
-
|
|
841
|
-
|
|
1045
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1046
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1047
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1048
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1049
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
842
1050
|
destinationTokenAccount: {
|
|
843
|
-
value:
|
|
1051
|
+
value: input.destinationTokenAccount ?? null,
|
|
844
1052
|
isWritable: true
|
|
845
1053
|
},
|
|
846
|
-
|
|
847
|
-
mint: { value:
|
|
848
|
-
tokenProgram: { value:
|
|
1054
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1055
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1056
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false },
|
|
1057
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
849
1058
|
};
|
|
850
1059
|
const accounts = originalAccounts;
|
|
851
1060
|
if (!accounts.tokenProgram.value) {
|
|
852
1061
|
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
853
1062
|
}
|
|
1063
|
+
if (!accounts.systemProgram.value) {
|
|
1064
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1065
|
+
}
|
|
854
1066
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
855
1067
|
const instruction = {
|
|
856
1068
|
accounts: [
|
|
1069
|
+
getAccountMeta(accounts.stats),
|
|
1070
|
+
getAccountMeta(accounts.controller),
|
|
1071
|
+
getAccountMeta(accounts.feeVault),
|
|
857
1072
|
getAccountMeta(accounts.airdrop),
|
|
858
1073
|
getAccountMeta(accounts.vault),
|
|
859
1074
|
getAccountMeta(accounts.destinationTokenAccount),
|
|
860
|
-
getAccountMeta(accounts.
|
|
1075
|
+
getAccountMeta(accounts.authority),
|
|
861
1076
|
getAccountMeta(accounts.mint),
|
|
862
|
-
getAccountMeta(accounts.tokenProgram)
|
|
1077
|
+
getAccountMeta(accounts.tokenProgram),
|
|
1078
|
+
getAccountMeta(accounts.systemProgram)
|
|
863
1079
|
],
|
|
864
1080
|
programAddress,
|
|
865
1081
|
data: getCloseAirdropInstructionDataEncoder().encode({})
|
|
@@ -867,7 +1083,7 @@ function getCloseAirdropInstruction(input, config) {
|
|
|
867
1083
|
return instruction;
|
|
868
1084
|
}
|
|
869
1085
|
function parseCloseAirdropInstruction(instruction) {
|
|
870
|
-
if (instruction.accounts.length <
|
|
1086
|
+
if (instruction.accounts.length < 10) {
|
|
871
1087
|
throw new Error("Not enough accounts");
|
|
872
1088
|
}
|
|
873
1089
|
let accountIndex = 0;
|
|
@@ -879,12 +1095,16 @@ function parseCloseAirdropInstruction(instruction) {
|
|
|
879
1095
|
return {
|
|
880
1096
|
programAddress: instruction.programAddress,
|
|
881
1097
|
accounts: {
|
|
1098
|
+
stats: getNextAccount(),
|
|
1099
|
+
controller: getNextAccount(),
|
|
1100
|
+
feeVault: getNextAccount(),
|
|
882
1101
|
airdrop: getNextAccount(),
|
|
883
1102
|
vault: getNextAccount(),
|
|
884
1103
|
destinationTokenAccount: getNextAccount(),
|
|
885
|
-
|
|
1104
|
+
authority: getNextAccount(),
|
|
886
1105
|
mint: getNextAccount(),
|
|
887
|
-
tokenProgram: getNextAccount()
|
|
1106
|
+
tokenProgram: getNextAccount(),
|
|
1107
|
+
systemProgram: getNextAccount()
|
|
888
1108
|
},
|
|
889
1109
|
data: getCloseAirdropInstructionDataDecoder().decode(instruction.data)
|
|
890
1110
|
};
|
|
@@ -892,14 +1112,15 @@ function parseCloseAirdropInstruction(instruction) {
|
|
|
892
1112
|
|
|
893
1113
|
// src/instructions/closeBitmap.ts
|
|
894
1114
|
import {
|
|
895
|
-
combineCodec as
|
|
896
|
-
fixDecoderSize as
|
|
897
|
-
fixEncoderSize as
|
|
898
|
-
getBytesDecoder as
|
|
899
|
-
getBytesEncoder as
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1115
|
+
combineCodec as combineCodec8,
|
|
1116
|
+
fixDecoderSize as fixDecoderSize8,
|
|
1117
|
+
fixEncoderSize as fixEncoderSize9,
|
|
1118
|
+
getBytesDecoder as getBytesDecoder8,
|
|
1119
|
+
getBytesEncoder as getBytesEncoder9,
|
|
1120
|
+
getProgramDerivedAddress as getProgramDerivedAddress2,
|
|
1121
|
+
getStructDecoder as getStructDecoder8,
|
|
1122
|
+
getStructEncoder as getStructEncoder8,
|
|
1123
|
+
transformEncoder as transformEncoder8
|
|
903
1124
|
} from "@solana/kit";
|
|
904
1125
|
var CLOSE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
905
1126
|
59,
|
|
@@ -912,50 +1133,115 @@ var CLOSE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
|
912
1133
|
118
|
|
913
1134
|
]);
|
|
914
1135
|
function getCloseBitmapDiscriminatorBytes() {
|
|
915
|
-
return
|
|
1136
|
+
return fixEncoderSize9(getBytesEncoder9(), 8).encode(
|
|
916
1137
|
CLOSE_BITMAP_DISCRIMINATOR
|
|
917
1138
|
);
|
|
918
1139
|
}
|
|
919
1140
|
function getCloseBitmapInstructionDataEncoder() {
|
|
920
|
-
return
|
|
921
|
-
|
|
922
|
-
(value) =>
|
|
1141
|
+
return transformEncoder8(
|
|
1142
|
+
getStructEncoder8([["discriminator", fixEncoderSize9(getBytesEncoder9(), 8)]]),
|
|
1143
|
+
(value) => ({ ...value, discriminator: CLOSE_BITMAP_DISCRIMINATOR })
|
|
923
1144
|
);
|
|
924
1145
|
}
|
|
925
1146
|
function getCloseBitmapInstructionDataDecoder() {
|
|
926
|
-
return
|
|
927
|
-
["discriminator",
|
|
1147
|
+
return getStructDecoder8([
|
|
1148
|
+
["discriminator", fixDecoderSize8(getBytesDecoder8(), 8)]
|
|
928
1149
|
]);
|
|
929
1150
|
}
|
|
930
1151
|
function getCloseBitmapInstructionDataCodec() {
|
|
931
|
-
return
|
|
1152
|
+
return combineCodec8(
|
|
932
1153
|
getCloseBitmapInstructionDataEncoder(),
|
|
933
1154
|
getCloseBitmapInstructionDataDecoder()
|
|
934
1155
|
);
|
|
935
1156
|
}
|
|
936
|
-
function
|
|
937
|
-
|
|
938
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1157
|
+
async function getCloseBitmapInstructionAsync(input, config) {
|
|
1158
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
939
1159
|
const originalAccounts = {
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
1160
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1161
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1162
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1163
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1164
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1165
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1166
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
943
1167
|
};
|
|
944
1168
|
const accounts = originalAccounts;
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
}
|
|
1169
|
+
if (!accounts.master.value) {
|
|
1170
|
+
accounts.master.value = await getProgramDerivedAddress2({
|
|
1171
|
+
programAddress,
|
|
1172
|
+
seeds: [
|
|
1173
|
+
getBytesEncoder9().encode(
|
|
1174
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1175
|
+
)
|
|
1176
|
+
]
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
if (!accounts.stats.value) {
|
|
1180
|
+
accounts.stats.value = await getProgramDerivedAddress2({
|
|
1181
|
+
programAddress,
|
|
1182
|
+
seeds: [
|
|
1183
|
+
getBytesEncoder9().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1184
|
+
]
|
|
1185
|
+
});
|
|
1186
|
+
}
|
|
1187
|
+
if (!accounts.treasury.value) {
|
|
1188
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1189
|
+
}
|
|
1190
|
+
if (!accounts.systemProgram.value) {
|
|
1191
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1192
|
+
}
|
|
1193
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1194
|
+
const instruction = {
|
|
1195
|
+
accounts: [
|
|
1196
|
+
getAccountMeta(accounts.master),
|
|
1197
|
+
getAccountMeta(accounts.stats),
|
|
1198
|
+
getAccountMeta(accounts.airdrop),
|
|
1199
|
+
getAccountMeta(accounts.bitmap),
|
|
1200
|
+
getAccountMeta(accounts.treasury),
|
|
1201
|
+
getAccountMeta(accounts.authority),
|
|
1202
|
+
getAccountMeta(accounts.systemProgram)
|
|
1203
|
+
],
|
|
1204
|
+
programAddress,
|
|
1205
|
+
data: getCloseBitmapInstructionDataEncoder().encode({})
|
|
1206
|
+
};
|
|
1207
|
+
return instruction;
|
|
1208
|
+
}
|
|
1209
|
+
function getCloseBitmapInstruction(input, config) {
|
|
1210
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1211
|
+
const originalAccounts = {
|
|
1212
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1213
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1214
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1215
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1216
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1217
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1218
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1219
|
+
};
|
|
1220
|
+
const accounts = originalAccounts;
|
|
1221
|
+
if (!accounts.treasury.value) {
|
|
1222
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1223
|
+
}
|
|
1224
|
+
if (!accounts.systemProgram.value) {
|
|
1225
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1226
|
+
}
|
|
1227
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1228
|
+
const instruction = {
|
|
1229
|
+
accounts: [
|
|
1230
|
+
getAccountMeta(accounts.master),
|
|
1231
|
+
getAccountMeta(accounts.stats),
|
|
1232
|
+
getAccountMeta(accounts.airdrop),
|
|
1233
|
+
getAccountMeta(accounts.bitmap),
|
|
1234
|
+
getAccountMeta(accounts.treasury),
|
|
1235
|
+
getAccountMeta(accounts.authority),
|
|
1236
|
+
getAccountMeta(accounts.systemProgram)
|
|
1237
|
+
],
|
|
1238
|
+
programAddress,
|
|
1239
|
+
data: getCloseBitmapInstructionDataEncoder().encode({})
|
|
1240
|
+
};
|
|
955
1241
|
return instruction;
|
|
956
1242
|
}
|
|
957
1243
|
function parseCloseBitmapInstruction(instruction) {
|
|
958
|
-
if (instruction.accounts.length <
|
|
1244
|
+
if (instruction.accounts.length < 7) {
|
|
959
1245
|
throw new Error("Not enough accounts");
|
|
960
1246
|
}
|
|
961
1247
|
let accountIndex = 0;
|
|
@@ -967,9 +1253,13 @@ function parseCloseBitmapInstruction(instruction) {
|
|
|
967
1253
|
return {
|
|
968
1254
|
programAddress: instruction.programAddress,
|
|
969
1255
|
accounts: {
|
|
1256
|
+
master: getNextAccount(),
|
|
1257
|
+
stats: getNextAccount(),
|
|
970
1258
|
airdrop: getNextAccount(),
|
|
971
1259
|
bitmap: getNextAccount(),
|
|
972
|
-
|
|
1260
|
+
treasury: getNextAccount(),
|
|
1261
|
+
authority: getNextAccount(),
|
|
1262
|
+
systemProgram: getNextAccount()
|
|
973
1263
|
},
|
|
974
1264
|
data: getCloseBitmapInstructionDataDecoder().decode(instruction.data)
|
|
975
1265
|
};
|
|
@@ -977,16 +1267,16 @@ function parseCloseBitmapInstruction(instruction) {
|
|
|
977
1267
|
|
|
978
1268
|
// src/instructions/depositTokens.ts
|
|
979
1269
|
import {
|
|
980
|
-
combineCodec as
|
|
981
|
-
fixDecoderSize as
|
|
982
|
-
fixEncoderSize as
|
|
983
|
-
getBytesDecoder as
|
|
984
|
-
getBytesEncoder as
|
|
985
|
-
getStructDecoder as
|
|
986
|
-
getStructEncoder as
|
|
987
|
-
getU64Decoder as
|
|
988
|
-
getU64Encoder as
|
|
989
|
-
transformEncoder as
|
|
1270
|
+
combineCodec as combineCodec9,
|
|
1271
|
+
fixDecoderSize as fixDecoderSize9,
|
|
1272
|
+
fixEncoderSize as fixEncoderSize10,
|
|
1273
|
+
getBytesDecoder as getBytesDecoder9,
|
|
1274
|
+
getBytesEncoder as getBytesEncoder10,
|
|
1275
|
+
getStructDecoder as getStructDecoder9,
|
|
1276
|
+
getStructEncoder as getStructEncoder9,
|
|
1277
|
+
getU64Decoder as getU64Decoder6,
|
|
1278
|
+
getU64Encoder as getU64Encoder6,
|
|
1279
|
+
transformEncoder as transformEncoder9
|
|
990
1280
|
} from "@solana/kit";
|
|
991
1281
|
var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
992
1282
|
176,
|
|
@@ -999,47 +1289,46 @@ var DEPOSIT_TOKENS_DISCRIMINATOR = new Uint8Array([
|
|
|
999
1289
|
150
|
|
1000
1290
|
]);
|
|
1001
1291
|
function getDepositTokensDiscriminatorBytes() {
|
|
1002
|
-
return
|
|
1292
|
+
return fixEncoderSize10(getBytesEncoder10(), 8).encode(
|
|
1003
1293
|
DEPOSIT_TOKENS_DISCRIMINATOR
|
|
1004
1294
|
);
|
|
1005
1295
|
}
|
|
1006
1296
|
function getDepositTokensInstructionDataEncoder() {
|
|
1007
|
-
return
|
|
1008
|
-
|
|
1009
|
-
["discriminator",
|
|
1010
|
-
["amount",
|
|
1297
|
+
return transformEncoder9(
|
|
1298
|
+
getStructEncoder9([
|
|
1299
|
+
["discriminator", fixEncoderSize10(getBytesEncoder10(), 8)],
|
|
1300
|
+
["amount", getU64Encoder6()]
|
|
1011
1301
|
]),
|
|
1012
|
-
(value) =>
|
|
1302
|
+
(value) => ({ ...value, discriminator: DEPOSIT_TOKENS_DISCRIMINATOR })
|
|
1013
1303
|
);
|
|
1014
1304
|
}
|
|
1015
1305
|
function getDepositTokensInstructionDataDecoder() {
|
|
1016
|
-
return
|
|
1017
|
-
["discriminator",
|
|
1018
|
-
["amount",
|
|
1306
|
+
return getStructDecoder9([
|
|
1307
|
+
["discriminator", fixDecoderSize9(getBytesDecoder9(), 8)],
|
|
1308
|
+
["amount", getU64Decoder6()]
|
|
1019
1309
|
]);
|
|
1020
1310
|
}
|
|
1021
1311
|
function getDepositTokensInstructionDataCodec() {
|
|
1022
|
-
return
|
|
1312
|
+
return combineCodec9(
|
|
1023
1313
|
getDepositTokensInstructionDataEncoder(),
|
|
1024
1314
|
getDepositTokensInstructionDataDecoder()
|
|
1025
1315
|
);
|
|
1026
1316
|
}
|
|
1027
1317
|
function getDepositTokensInstruction(input, config) {
|
|
1028
|
-
|
|
1029
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1318
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1030
1319
|
const originalAccounts = {
|
|
1031
1320
|
sourceTokenAccount: {
|
|
1032
|
-
value:
|
|
1321
|
+
value: input.sourceTokenAccount ?? null,
|
|
1033
1322
|
isWritable: true
|
|
1034
1323
|
},
|
|
1035
|
-
vault: { value:
|
|
1036
|
-
airdrop: { value:
|
|
1037
|
-
mint: { value:
|
|
1038
|
-
|
|
1039
|
-
tokenProgram: { value:
|
|
1324
|
+
vault: { value: input.vault ?? null, isWritable: true },
|
|
1325
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1326
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1327
|
+
authority: { value: input.authority ?? null, isWritable: false },
|
|
1328
|
+
tokenProgram: { value: input.tokenProgram ?? null, isWritable: false }
|
|
1040
1329
|
};
|
|
1041
1330
|
const accounts = originalAccounts;
|
|
1042
|
-
const args =
|
|
1331
|
+
const args = { ...input };
|
|
1043
1332
|
if (!accounts.tokenProgram.value) {
|
|
1044
1333
|
accounts.tokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
1045
1334
|
}
|
|
@@ -1050,7 +1339,7 @@ function getDepositTokensInstruction(input, config) {
|
|
|
1050
1339
|
getAccountMeta(accounts.vault),
|
|
1051
1340
|
getAccountMeta(accounts.airdrop),
|
|
1052
1341
|
getAccountMeta(accounts.mint),
|
|
1053
|
-
getAccountMeta(accounts.
|
|
1342
|
+
getAccountMeta(accounts.authority),
|
|
1054
1343
|
getAccountMeta(accounts.tokenProgram)
|
|
1055
1344
|
],
|
|
1056
1345
|
programAddress,
|
|
@@ -1077,7 +1366,7 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
1077
1366
|
vault: getNextAccount(),
|
|
1078
1367
|
airdrop: getNextAccount(),
|
|
1079
1368
|
mint: getNextAccount(),
|
|
1080
|
-
|
|
1369
|
+
authority: getNextAccount(),
|
|
1081
1370
|
tokenProgram: getNextAccount()
|
|
1082
1371
|
},
|
|
1083
1372
|
data: getDepositTokensInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1086,24 +1375,24 @@ function parseDepositTokensInstruction(instruction) {
|
|
|
1086
1375
|
|
|
1087
1376
|
// src/instructions/initializeAirdrop.ts
|
|
1088
1377
|
import {
|
|
1089
|
-
combineCodec as
|
|
1090
|
-
fixDecoderSize as
|
|
1091
|
-
fixEncoderSize as
|
|
1092
|
-
getAddressEncoder as
|
|
1378
|
+
combineCodec as combineCodec10,
|
|
1379
|
+
fixDecoderSize as fixDecoderSize10,
|
|
1380
|
+
fixEncoderSize as fixEncoderSize11,
|
|
1381
|
+
getAddressEncoder as getAddressEncoder6,
|
|
1093
1382
|
getArrayDecoder as getArrayDecoder3,
|
|
1094
1383
|
getArrayEncoder as getArrayEncoder3,
|
|
1095
|
-
getBytesDecoder as
|
|
1096
|
-
getBytesEncoder as
|
|
1384
|
+
getBytesDecoder as getBytesDecoder10,
|
|
1385
|
+
getBytesEncoder as getBytesEncoder11,
|
|
1097
1386
|
getI64Decoder as getI64Decoder2,
|
|
1098
1387
|
getI64Encoder as getI64Encoder2,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
getU8Decoder as
|
|
1105
|
-
getU8Encoder as
|
|
1106
|
-
transformEncoder as
|
|
1388
|
+
getOptionDecoder,
|
|
1389
|
+
getOptionEncoder,
|
|
1390
|
+
getProgramDerivedAddress as getProgramDerivedAddress3,
|
|
1391
|
+
getStructDecoder as getStructDecoder10,
|
|
1392
|
+
getStructEncoder as getStructEncoder10,
|
|
1393
|
+
getU8Decoder as getU8Decoder7,
|
|
1394
|
+
getU8Encoder as getU8Encoder7,
|
|
1395
|
+
transformEncoder as transformEncoder10
|
|
1107
1396
|
} from "@solana/kit";
|
|
1108
1397
|
var INITIALIZE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
1109
1398
|
96,
|
|
@@ -1116,119 +1405,123 @@ var INITIALIZE_AIRDROP_DISCRIMINATOR = new Uint8Array([
|
|
|
1116
1405
|
184
|
|
1117
1406
|
]);
|
|
1118
1407
|
function getInitializeAirdropDiscriminatorBytes() {
|
|
1119
|
-
return
|
|
1408
|
+
return fixEncoderSize11(getBytesEncoder11(), 8).encode(
|
|
1120
1409
|
INITIALIZE_AIRDROP_DISCRIMINATOR
|
|
1121
1410
|
);
|
|
1122
1411
|
}
|
|
1123
1412
|
function getInitializeAirdropInstructionDataEncoder() {
|
|
1124
|
-
return
|
|
1125
|
-
|
|
1126
|
-
["discriminator",
|
|
1127
|
-
["
|
|
1128
|
-
["
|
|
1129
|
-
["
|
|
1130
|
-
["endTime", getI64Encoder2()]
|
|
1413
|
+
return transformEncoder10(
|
|
1414
|
+
getStructEncoder10([
|
|
1415
|
+
["discriminator", fixEncoderSize11(getBytesEncoder11(), 8)],
|
|
1416
|
+
["merkleRoot", getArrayEncoder3(getU8Encoder7(), { size: 32 })],
|
|
1417
|
+
["startsTime", getOptionEncoder(getI64Encoder2())],
|
|
1418
|
+
["endTime", getOptionEncoder(getI64Encoder2())]
|
|
1131
1419
|
]),
|
|
1132
|
-
(value) =>
|
|
1420
|
+
(value) => ({ ...value, discriminator: INITIALIZE_AIRDROP_DISCRIMINATOR })
|
|
1133
1421
|
);
|
|
1134
1422
|
}
|
|
1135
1423
|
function getInitializeAirdropInstructionDataDecoder() {
|
|
1136
|
-
return
|
|
1137
|
-
["discriminator",
|
|
1138
|
-
["
|
|
1139
|
-
["
|
|
1140
|
-
["
|
|
1141
|
-
["endTime", getI64Decoder2()]
|
|
1424
|
+
return getStructDecoder10([
|
|
1425
|
+
["discriminator", fixDecoderSize10(getBytesDecoder10(), 8)],
|
|
1426
|
+
["merkleRoot", getArrayDecoder3(getU8Decoder7(), { size: 32 })],
|
|
1427
|
+
["startsTime", getOptionDecoder(getI64Decoder2())],
|
|
1428
|
+
["endTime", getOptionDecoder(getI64Decoder2())]
|
|
1142
1429
|
]);
|
|
1143
1430
|
}
|
|
1144
1431
|
function getInitializeAirdropInstructionDataCodec() {
|
|
1145
|
-
return
|
|
1432
|
+
return combineCodec10(
|
|
1146
1433
|
getInitializeAirdropInstructionDataEncoder(),
|
|
1147
1434
|
getInitializeAirdropInstructionDataDecoder()
|
|
1148
1435
|
);
|
|
1149
1436
|
}
|
|
1150
|
-
function getInitializeAirdropInstructionAsync(input, config) {
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
if (!accounts.airdrop.value) {
|
|
1166
|
-
accounts.airdrop.value = yield getProgramDerivedAddress({
|
|
1167
|
-
programAddress,
|
|
1168
|
-
seeds: [
|
|
1169
|
-
getBytesEncoder9().encode(
|
|
1170
|
-
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1171
|
-
),
|
|
1172
|
-
getAddressEncoder4().encode(expectAddress(accounts.mint.value)),
|
|
1173
|
-
getAddressEncoder4().encode(expectAddress(accounts.owner.value)),
|
|
1174
|
-
getU64Encoder5().encode(expectSome(args.id))
|
|
1175
|
-
]
|
|
1176
|
-
});
|
|
1177
|
-
}
|
|
1178
|
-
if (!accounts.treasury.value) {
|
|
1179
|
-
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1180
|
-
}
|
|
1181
|
-
if (!accounts.systemProgram.value) {
|
|
1182
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1183
|
-
}
|
|
1184
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1185
|
-
const instruction = {
|
|
1186
|
-
accounts: [
|
|
1187
|
-
getAccountMeta(accounts.mint),
|
|
1188
|
-
getAccountMeta(accounts.airdrop),
|
|
1189
|
-
getAccountMeta(accounts.controller),
|
|
1190
|
-
getAccountMeta(accounts.feeVault),
|
|
1191
|
-
getAccountMeta(accounts.owner),
|
|
1192
|
-
getAccountMeta(accounts.treasury),
|
|
1193
|
-
getAccountMeta(accounts.systemProgram)
|
|
1194
|
-
],
|
|
1437
|
+
async function getInitializeAirdropInstructionAsync(input, config) {
|
|
1438
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1439
|
+
const originalAccounts = {
|
|
1440
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1441
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1442
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1443
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1444
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1445
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1446
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1447
|
+
};
|
|
1448
|
+
const accounts = originalAccounts;
|
|
1449
|
+
const args = { ...input };
|
|
1450
|
+
if (!accounts.stats.value) {
|
|
1451
|
+
accounts.stats.value = await getProgramDerivedAddress3({
|
|
1195
1452
|
programAddress,
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
|
|
1453
|
+
seeds: [
|
|
1454
|
+
getBytesEncoder11().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1455
|
+
]
|
|
1456
|
+
});
|
|
1457
|
+
}
|
|
1458
|
+
if (!accounts.airdrop.value) {
|
|
1459
|
+
accounts.airdrop.value = await getProgramDerivedAddress3({
|
|
1460
|
+
programAddress,
|
|
1461
|
+
seeds: [
|
|
1462
|
+
getBytesEncoder11().encode(
|
|
1463
|
+
new Uint8Array([97, 105, 114, 100, 114, 111, 112])
|
|
1464
|
+
),
|
|
1465
|
+
getAddressEncoder6().encode(expectAddress(accounts.mint.value)),
|
|
1466
|
+
getAddressEncoder6().encode(expectAddress(accounts.authority.value))
|
|
1467
|
+
]
|
|
1468
|
+
});
|
|
1469
|
+
}
|
|
1470
|
+
if (!accounts.feeVault.value) {
|
|
1471
|
+
accounts.feeVault.value = await getProgramDerivedAddress3({
|
|
1472
|
+
programAddress,
|
|
1473
|
+
seeds: [
|
|
1474
|
+
getBytesEncoder11().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1475
|
+
getAddressEncoder6().encode(expectAddress(accounts.controller.value))
|
|
1476
|
+
]
|
|
1477
|
+
});
|
|
1478
|
+
}
|
|
1479
|
+
if (!accounts.systemProgram.value) {
|
|
1480
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1481
|
+
}
|
|
1482
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1483
|
+
const instruction = {
|
|
1484
|
+
accounts: [
|
|
1485
|
+
getAccountMeta(accounts.stats),
|
|
1486
|
+
getAccountMeta(accounts.controller),
|
|
1487
|
+
getAccountMeta(accounts.airdrop),
|
|
1488
|
+
getAccountMeta(accounts.feeVault),
|
|
1489
|
+
getAccountMeta(accounts.mint),
|
|
1490
|
+
getAccountMeta(accounts.authority),
|
|
1491
|
+
getAccountMeta(accounts.systemProgram)
|
|
1492
|
+
],
|
|
1493
|
+
programAddress,
|
|
1494
|
+
data: getInitializeAirdropInstructionDataEncoder().encode(
|
|
1495
|
+
args
|
|
1496
|
+
)
|
|
1497
|
+
};
|
|
1498
|
+
return instruction;
|
|
1202
1499
|
}
|
|
1203
1500
|
function getInitializeAirdropInstruction(input, config) {
|
|
1204
|
-
|
|
1205
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1501
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1206
1502
|
const originalAccounts = {
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
feeVault: { value:
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
systemProgram: { value:
|
|
1503
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1504
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1505
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1506
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1507
|
+
mint: { value: input.mint ?? null, isWritable: false },
|
|
1508
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1509
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1214
1510
|
};
|
|
1215
1511
|
const accounts = originalAccounts;
|
|
1216
|
-
const args =
|
|
1217
|
-
if (!accounts.treasury.value) {
|
|
1218
|
-
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1219
|
-
}
|
|
1512
|
+
const args = { ...input };
|
|
1220
1513
|
if (!accounts.systemProgram.value) {
|
|
1221
1514
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1222
1515
|
}
|
|
1223
1516
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1224
1517
|
const instruction = {
|
|
1225
1518
|
accounts: [
|
|
1226
|
-
getAccountMeta(accounts.
|
|
1227
|
-
getAccountMeta(accounts.airdrop),
|
|
1519
|
+
getAccountMeta(accounts.stats),
|
|
1228
1520
|
getAccountMeta(accounts.controller),
|
|
1521
|
+
getAccountMeta(accounts.airdrop),
|
|
1229
1522
|
getAccountMeta(accounts.feeVault),
|
|
1230
|
-
getAccountMeta(accounts.
|
|
1231
|
-
getAccountMeta(accounts.
|
|
1523
|
+
getAccountMeta(accounts.mint),
|
|
1524
|
+
getAccountMeta(accounts.authority),
|
|
1232
1525
|
getAccountMeta(accounts.systemProgram)
|
|
1233
1526
|
],
|
|
1234
1527
|
programAddress,
|
|
@@ -1251,12 +1544,12 @@ function parseInitializeAirdropInstruction(instruction) {
|
|
|
1251
1544
|
return {
|
|
1252
1545
|
programAddress: instruction.programAddress,
|
|
1253
1546
|
accounts: {
|
|
1254
|
-
|
|
1255
|
-
airdrop: getNextAccount(),
|
|
1547
|
+
stats: getNextAccount(),
|
|
1256
1548
|
controller: getNextAccount(),
|
|
1549
|
+
airdrop: getNextAccount(),
|
|
1257
1550
|
feeVault: getNextAccount(),
|
|
1258
|
-
|
|
1259
|
-
|
|
1551
|
+
mint: getNextAccount(),
|
|
1552
|
+
authority: getNextAccount(),
|
|
1260
1553
|
systemProgram: getNextAccount()
|
|
1261
1554
|
},
|
|
1262
1555
|
data: getInitializeAirdropInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1265,20 +1558,20 @@ function parseInitializeAirdropInstruction(instruction) {
|
|
|
1265
1558
|
|
|
1266
1559
|
// src/instructions/initializeBitmap.ts
|
|
1267
1560
|
import {
|
|
1268
|
-
combineCodec as
|
|
1269
|
-
fixDecoderSize as
|
|
1270
|
-
fixEncoderSize as
|
|
1271
|
-
getAddressEncoder as
|
|
1272
|
-
getBytesDecoder as
|
|
1273
|
-
getBytesEncoder as
|
|
1274
|
-
getProgramDerivedAddress as
|
|
1275
|
-
getStructDecoder as
|
|
1276
|
-
getStructEncoder as
|
|
1277
|
-
getU64Decoder as
|
|
1278
|
-
getU64Encoder as
|
|
1279
|
-
getU8Decoder as
|
|
1280
|
-
getU8Encoder as
|
|
1281
|
-
transformEncoder as
|
|
1561
|
+
combineCodec as combineCodec11,
|
|
1562
|
+
fixDecoderSize as fixDecoderSize11,
|
|
1563
|
+
fixEncoderSize as fixEncoderSize12,
|
|
1564
|
+
getAddressEncoder as getAddressEncoder7,
|
|
1565
|
+
getBytesDecoder as getBytesDecoder11,
|
|
1566
|
+
getBytesEncoder as getBytesEncoder12,
|
|
1567
|
+
getProgramDerivedAddress as getProgramDerivedAddress4,
|
|
1568
|
+
getStructDecoder as getStructDecoder11,
|
|
1569
|
+
getStructEncoder as getStructEncoder11,
|
|
1570
|
+
getU64Decoder as getU64Decoder7,
|
|
1571
|
+
getU64Encoder as getU64Encoder7,
|
|
1572
|
+
getU8Decoder as getU8Decoder8,
|
|
1573
|
+
getU8Encoder as getU8Encoder8,
|
|
1574
|
+
transformEncoder as transformEncoder11
|
|
1282
1575
|
} from "@solana/kit";
|
|
1283
1576
|
var INITIALIZE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
1284
1577
|
25,
|
|
@@ -1291,94 +1584,126 @@ var INITIALIZE_BITMAP_DISCRIMINATOR = new Uint8Array([
|
|
|
1291
1584
|
69
|
|
1292
1585
|
]);
|
|
1293
1586
|
function getInitializeBitmapDiscriminatorBytes() {
|
|
1294
|
-
return
|
|
1587
|
+
return fixEncoderSize12(getBytesEncoder12(), 8).encode(
|
|
1295
1588
|
INITIALIZE_BITMAP_DISCRIMINATOR
|
|
1296
1589
|
);
|
|
1297
1590
|
}
|
|
1298
1591
|
function getInitializeBitmapInstructionDataEncoder() {
|
|
1299
|
-
return
|
|
1300
|
-
|
|
1301
|
-
["discriminator",
|
|
1302
|
-
["id",
|
|
1303
|
-
["total",
|
|
1592
|
+
return transformEncoder11(
|
|
1593
|
+
getStructEncoder11([
|
|
1594
|
+
["discriminator", fixEncoderSize12(getBytesEncoder12(), 8)],
|
|
1595
|
+
["id", getU8Encoder8()],
|
|
1596
|
+
["total", getU64Encoder7()]
|
|
1304
1597
|
]),
|
|
1305
|
-
(value) =>
|
|
1598
|
+
(value) => ({ ...value, discriminator: INITIALIZE_BITMAP_DISCRIMINATOR })
|
|
1306
1599
|
);
|
|
1307
1600
|
}
|
|
1308
1601
|
function getInitializeBitmapInstructionDataDecoder() {
|
|
1309
|
-
return
|
|
1310
|
-
["discriminator",
|
|
1311
|
-
["id",
|
|
1312
|
-
["total",
|
|
1602
|
+
return getStructDecoder11([
|
|
1603
|
+
["discriminator", fixDecoderSize11(getBytesDecoder11(), 8)],
|
|
1604
|
+
["id", getU8Decoder8()],
|
|
1605
|
+
["total", getU64Decoder7()]
|
|
1313
1606
|
]);
|
|
1314
1607
|
}
|
|
1315
1608
|
function getInitializeBitmapInstructionDataCodec() {
|
|
1316
|
-
return
|
|
1609
|
+
return combineCodec11(
|
|
1317
1610
|
getInitializeBitmapInstructionDataEncoder(),
|
|
1318
1611
|
getInitializeBitmapInstructionDataDecoder()
|
|
1319
1612
|
);
|
|
1320
1613
|
}
|
|
1321
|
-
function getInitializeBitmapInstructionAsync(input, config) {
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
seeds: [
|
|
1337
|
-
getBytesEncoder10().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
1338
|
-
getAddressEncoder5().encode(expectAddress(accounts.airdrop.value)),
|
|
1339
|
-
getU8Encoder6().encode(expectSome(args.id))
|
|
1340
|
-
]
|
|
1341
|
-
});
|
|
1342
|
-
}
|
|
1343
|
-
if (!accounts.systemProgram.value) {
|
|
1344
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1345
|
-
}
|
|
1346
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1347
|
-
const instruction = {
|
|
1348
|
-
accounts: [
|
|
1349
|
-
getAccountMeta(accounts.bitmap),
|
|
1350
|
-
getAccountMeta(accounts.airdrop),
|
|
1351
|
-
getAccountMeta(accounts.owner),
|
|
1352
|
-
getAccountMeta(accounts.systemProgram)
|
|
1353
|
-
],
|
|
1614
|
+
async function getInitializeBitmapInstructionAsync(input, config) {
|
|
1615
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1616
|
+
const originalAccounts = {
|
|
1617
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1618
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1619
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1620
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1621
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1622
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1623
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1624
|
+
};
|
|
1625
|
+
const accounts = originalAccounts;
|
|
1626
|
+
const args = { ...input };
|
|
1627
|
+
if (!accounts.master.value) {
|
|
1628
|
+
accounts.master.value = await getProgramDerivedAddress4({
|
|
1354
1629
|
programAddress,
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1630
|
+
seeds: [
|
|
1631
|
+
getBytesEncoder12().encode(
|
|
1632
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1633
|
+
)
|
|
1634
|
+
]
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
if (!accounts.stats.value) {
|
|
1638
|
+
accounts.stats.value = await getProgramDerivedAddress4({
|
|
1639
|
+
programAddress,
|
|
1640
|
+
seeds: [
|
|
1641
|
+
getBytesEncoder12().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1642
|
+
]
|
|
1643
|
+
});
|
|
1644
|
+
}
|
|
1645
|
+
if (!accounts.bitmap.value) {
|
|
1646
|
+
accounts.bitmap.value = await getProgramDerivedAddress4({
|
|
1647
|
+
programAddress,
|
|
1648
|
+
seeds: [
|
|
1649
|
+
getBytesEncoder12().encode(new Uint8Array([98, 105, 116, 109, 97, 112])),
|
|
1650
|
+
getAddressEncoder7().encode(expectAddress(accounts.airdrop.value)),
|
|
1651
|
+
getU8Encoder8().encode(expectSome(args.id))
|
|
1652
|
+
]
|
|
1653
|
+
});
|
|
1654
|
+
}
|
|
1655
|
+
if (!accounts.treasury.value) {
|
|
1656
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1657
|
+
}
|
|
1658
|
+
if (!accounts.systemProgram.value) {
|
|
1659
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1660
|
+
}
|
|
1661
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1662
|
+
const instruction = {
|
|
1663
|
+
accounts: [
|
|
1664
|
+
getAccountMeta(accounts.master),
|
|
1665
|
+
getAccountMeta(accounts.stats),
|
|
1666
|
+
getAccountMeta(accounts.bitmap),
|
|
1667
|
+
getAccountMeta(accounts.airdrop),
|
|
1668
|
+
getAccountMeta(accounts.treasury),
|
|
1669
|
+
getAccountMeta(accounts.authority),
|
|
1670
|
+
getAccountMeta(accounts.systemProgram)
|
|
1671
|
+
],
|
|
1672
|
+
programAddress,
|
|
1673
|
+
data: getInitializeBitmapInstructionDataEncoder().encode(
|
|
1674
|
+
args
|
|
1675
|
+
)
|
|
1676
|
+
};
|
|
1677
|
+
return instruction;
|
|
1361
1678
|
}
|
|
1362
1679
|
function getInitializeBitmapInstruction(input, config) {
|
|
1363
|
-
|
|
1364
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1680
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1365
1681
|
const originalAccounts = {
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1682
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1683
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1684
|
+
bitmap: { value: input.bitmap ?? null, isWritable: true },
|
|
1685
|
+
airdrop: { value: input.airdrop ?? null, isWritable: true },
|
|
1686
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1687
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1688
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1370
1689
|
};
|
|
1371
1690
|
const accounts = originalAccounts;
|
|
1372
|
-
const args =
|
|
1691
|
+
const args = { ...input };
|
|
1692
|
+
if (!accounts.treasury.value) {
|
|
1693
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1694
|
+
}
|
|
1373
1695
|
if (!accounts.systemProgram.value) {
|
|
1374
1696
|
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1375
1697
|
}
|
|
1376
1698
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1377
1699
|
const instruction = {
|
|
1378
1700
|
accounts: [
|
|
1701
|
+
getAccountMeta(accounts.master),
|
|
1702
|
+
getAccountMeta(accounts.stats),
|
|
1379
1703
|
getAccountMeta(accounts.bitmap),
|
|
1380
1704
|
getAccountMeta(accounts.airdrop),
|
|
1381
|
-
getAccountMeta(accounts.
|
|
1705
|
+
getAccountMeta(accounts.treasury),
|
|
1706
|
+
getAccountMeta(accounts.authority),
|
|
1382
1707
|
getAccountMeta(accounts.systemProgram)
|
|
1383
1708
|
],
|
|
1384
1709
|
programAddress,
|
|
@@ -1389,7 +1714,7 @@ function getInitializeBitmapInstruction(input, config) {
|
|
|
1389
1714
|
return instruction;
|
|
1390
1715
|
}
|
|
1391
1716
|
function parseInitializeBitmapInstruction(instruction) {
|
|
1392
|
-
if (instruction.accounts.length <
|
|
1717
|
+
if (instruction.accounts.length < 7) {
|
|
1393
1718
|
throw new Error("Not enough accounts");
|
|
1394
1719
|
}
|
|
1395
1720
|
let accountIndex = 0;
|
|
@@ -1401,9 +1726,12 @@ function parseInitializeBitmapInstruction(instruction) {
|
|
|
1401
1726
|
return {
|
|
1402
1727
|
programAddress: instruction.programAddress,
|
|
1403
1728
|
accounts: {
|
|
1729
|
+
master: getNextAccount(),
|
|
1730
|
+
stats: getNextAccount(),
|
|
1404
1731
|
bitmap: getNextAccount(),
|
|
1405
1732
|
airdrop: getNextAccount(),
|
|
1406
|
-
|
|
1733
|
+
treasury: getNextAccount(),
|
|
1734
|
+
authority: getNextAccount(),
|
|
1407
1735
|
systemProgram: getNextAccount()
|
|
1408
1736
|
},
|
|
1409
1737
|
data: getInitializeBitmapInstructionDataDecoder().decode(instruction.data)
|
|
@@ -1412,18 +1740,18 @@ function parseInitializeBitmapInstruction(instruction) {
|
|
|
1412
1740
|
|
|
1413
1741
|
// src/instructions/initializeController.ts
|
|
1414
1742
|
import {
|
|
1415
|
-
combineCodec as
|
|
1416
|
-
fixDecoderSize as
|
|
1417
|
-
fixEncoderSize as
|
|
1418
|
-
getAddressEncoder as
|
|
1419
|
-
getBytesDecoder as
|
|
1420
|
-
getBytesEncoder as
|
|
1421
|
-
getProgramDerivedAddress as
|
|
1422
|
-
getStructDecoder as
|
|
1423
|
-
getStructEncoder as
|
|
1424
|
-
getU64Decoder as
|
|
1425
|
-
getU64Encoder as
|
|
1426
|
-
transformEncoder as
|
|
1743
|
+
combineCodec as combineCodec12,
|
|
1744
|
+
fixDecoderSize as fixDecoderSize12,
|
|
1745
|
+
fixEncoderSize as fixEncoderSize13,
|
|
1746
|
+
getAddressEncoder as getAddressEncoder8,
|
|
1747
|
+
getBytesDecoder as getBytesDecoder12,
|
|
1748
|
+
getBytesEncoder as getBytesEncoder13,
|
|
1749
|
+
getProgramDerivedAddress as getProgramDerivedAddress5,
|
|
1750
|
+
getStructDecoder as getStructDecoder12,
|
|
1751
|
+
getStructEncoder as getStructEncoder12,
|
|
1752
|
+
getU64Decoder as getU64Decoder8,
|
|
1753
|
+
getU64Encoder as getU64Encoder8,
|
|
1754
|
+
transformEncoder as transformEncoder12
|
|
1427
1755
|
} from "@solana/kit";
|
|
1428
1756
|
var INITIALIZE_CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
1429
1757
|
137,
|
|
@@ -1436,112 +1764,140 @@ var INITIALIZE_CONTROLLER_DISCRIMINATOR = new Uint8Array([
|
|
|
1436
1764
|
81
|
|
1437
1765
|
]);
|
|
1438
1766
|
function getInitializeControllerDiscriminatorBytes() {
|
|
1439
|
-
return
|
|
1767
|
+
return fixEncoderSize13(getBytesEncoder13(), 8).encode(
|
|
1440
1768
|
INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1441
1769
|
);
|
|
1442
1770
|
}
|
|
1443
1771
|
function getInitializeControllerInstructionDataEncoder() {
|
|
1444
|
-
return
|
|
1445
|
-
|
|
1446
|
-
["discriminator",
|
|
1447
|
-
["
|
|
1448
|
-
["claimFee", getU64Encoder7()]
|
|
1772
|
+
return transformEncoder12(
|
|
1773
|
+
getStructEncoder12([
|
|
1774
|
+
["discriminator", fixEncoderSize13(getBytesEncoder13(), 8)],
|
|
1775
|
+
["feeLamports", getU64Encoder8()]
|
|
1449
1776
|
]),
|
|
1450
|
-
(value) =>
|
|
1777
|
+
(value) => ({
|
|
1778
|
+
...value,
|
|
1451
1779
|
discriminator: INITIALIZE_CONTROLLER_DISCRIMINATOR
|
|
1452
1780
|
})
|
|
1453
1781
|
);
|
|
1454
1782
|
}
|
|
1455
1783
|
function getInitializeControllerInstructionDataDecoder() {
|
|
1456
|
-
return
|
|
1457
|
-
["discriminator",
|
|
1458
|
-
["
|
|
1459
|
-
["claimFee", getU64Decoder7()]
|
|
1784
|
+
return getStructDecoder12([
|
|
1785
|
+
["discriminator", fixDecoderSize12(getBytesDecoder12(), 8)],
|
|
1786
|
+
["feeLamports", getU64Decoder8()]
|
|
1460
1787
|
]);
|
|
1461
1788
|
}
|
|
1462
1789
|
function getInitializeControllerInstructionDataCodec() {
|
|
1463
|
-
return
|
|
1790
|
+
return combineCodec12(
|
|
1464
1791
|
getInitializeControllerInstructionDataEncoder(),
|
|
1465
1792
|
getInitializeControllerInstructionDataDecoder()
|
|
1466
1793
|
);
|
|
1467
1794
|
}
|
|
1468
|
-
function getInitializeControllerInstructionAsync(input, config) {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
programAddress,
|
|
1484
|
-
seeds: [
|
|
1485
|
-
getBytesEncoder11().encode(
|
|
1486
|
-
new Uint8Array([
|
|
1487
|
-
99,
|
|
1488
|
-
111,
|
|
1489
|
-
110,
|
|
1490
|
-
116,
|
|
1491
|
-
114,
|
|
1492
|
-
111,
|
|
1493
|
-
108,
|
|
1494
|
-
108,
|
|
1495
|
-
101,
|
|
1496
|
-
114,
|
|
1497
|
-
45,
|
|
1498
|
-
100,
|
|
1499
|
-
114,
|
|
1500
|
-
111,
|
|
1501
|
-
112,
|
|
1502
|
-
115,
|
|
1503
|
-
121
|
|
1504
|
-
])
|
|
1505
|
-
),
|
|
1506
|
-
getAddressEncoder6().encode(expectAddress(accounts.payer.value))
|
|
1507
|
-
]
|
|
1508
|
-
});
|
|
1509
|
-
}
|
|
1510
|
-
if (!accounts.treasury.value) {
|
|
1511
|
-
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1512
|
-
}
|
|
1513
|
-
if (!accounts.systemProgram.value) {
|
|
1514
|
-
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1515
|
-
}
|
|
1516
|
-
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1517
|
-
const instruction = {
|
|
1518
|
-
accounts: [
|
|
1519
|
-
getAccountMeta(accounts.controller),
|
|
1520
|
-
getAccountMeta(accounts.feeVault),
|
|
1521
|
-
getAccountMeta(accounts.treasury),
|
|
1522
|
-
getAccountMeta(accounts.payer),
|
|
1523
|
-
getAccountMeta(accounts.systemProgram)
|
|
1524
|
-
],
|
|
1795
|
+
async function getInitializeControllerInstructionAsync(input, config) {
|
|
1796
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1797
|
+
const originalAccounts = {
|
|
1798
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1799
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1800
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1801
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1802
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1803
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1804
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1805
|
+
};
|
|
1806
|
+
const accounts = originalAccounts;
|
|
1807
|
+
const args = { ...input };
|
|
1808
|
+
if (!accounts.master.value) {
|
|
1809
|
+
accounts.master.value = await getProgramDerivedAddress5({
|
|
1525
1810
|
programAddress,
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1811
|
+
seeds: [
|
|
1812
|
+
getBytesEncoder13().encode(
|
|
1813
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
1814
|
+
)
|
|
1815
|
+
]
|
|
1816
|
+
});
|
|
1817
|
+
}
|
|
1818
|
+
if (!accounts.stats.value) {
|
|
1819
|
+
accounts.stats.value = await getProgramDerivedAddress5({
|
|
1820
|
+
programAddress,
|
|
1821
|
+
seeds: [
|
|
1822
|
+
getBytesEncoder13().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
1823
|
+
]
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
if (!accounts.controller.value) {
|
|
1827
|
+
accounts.controller.value = await getProgramDerivedAddress5({
|
|
1828
|
+
programAddress,
|
|
1829
|
+
seeds: [
|
|
1830
|
+
getBytesEncoder13().encode(
|
|
1831
|
+
new Uint8Array([
|
|
1832
|
+
99,
|
|
1833
|
+
111,
|
|
1834
|
+
110,
|
|
1835
|
+
116,
|
|
1836
|
+
114,
|
|
1837
|
+
111,
|
|
1838
|
+
108,
|
|
1839
|
+
108,
|
|
1840
|
+
101,
|
|
1841
|
+
114,
|
|
1842
|
+
45,
|
|
1843
|
+
100,
|
|
1844
|
+
114,
|
|
1845
|
+
111,
|
|
1846
|
+
112,
|
|
1847
|
+
115,
|
|
1848
|
+
121
|
|
1849
|
+
])
|
|
1850
|
+
),
|
|
1851
|
+
getAddressEncoder8().encode(expectAddress(accounts.authority.value))
|
|
1852
|
+
]
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
if (!accounts.feeVault.value) {
|
|
1856
|
+
accounts.feeVault.value = await getProgramDerivedAddress5({
|
|
1857
|
+
programAddress,
|
|
1858
|
+
seeds: [
|
|
1859
|
+
getBytesEncoder13().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
1860
|
+
getAddressEncoder8().encode(expectAddress(accounts.controller.value))
|
|
1861
|
+
]
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
if (!accounts.treasury.value) {
|
|
1865
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1866
|
+
}
|
|
1867
|
+
if (!accounts.systemProgram.value) {
|
|
1868
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
1869
|
+
}
|
|
1870
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1871
|
+
const instruction = {
|
|
1872
|
+
accounts: [
|
|
1873
|
+
getAccountMeta(accounts.master),
|
|
1874
|
+
getAccountMeta(accounts.stats),
|
|
1875
|
+
getAccountMeta(accounts.controller),
|
|
1876
|
+
getAccountMeta(accounts.feeVault),
|
|
1877
|
+
getAccountMeta(accounts.treasury),
|
|
1878
|
+
getAccountMeta(accounts.authority),
|
|
1879
|
+
getAccountMeta(accounts.systemProgram)
|
|
1880
|
+
],
|
|
1881
|
+
programAddress,
|
|
1882
|
+
data: getInitializeControllerInstructionDataEncoder().encode(
|
|
1883
|
+
args
|
|
1884
|
+
)
|
|
1885
|
+
};
|
|
1886
|
+
return instruction;
|
|
1532
1887
|
}
|
|
1533
1888
|
function getInitializeControllerInstruction(input, config) {
|
|
1534
|
-
|
|
1535
|
-
const programAddress = (_a = config == null ? void 0 : config.programAddress) != null ? _a : DROPSY_PROGRAM_ADDRESS;
|
|
1889
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
1536
1890
|
const originalAccounts = {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1891
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
1892
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
1893
|
+
controller: { value: input.controller ?? null, isWritable: true },
|
|
1894
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
1895
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
1896
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
1897
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
1542
1898
|
};
|
|
1543
1899
|
const accounts = originalAccounts;
|
|
1544
|
-
const args =
|
|
1900
|
+
const args = { ...input };
|
|
1545
1901
|
if (!accounts.treasury.value) {
|
|
1546
1902
|
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
1547
1903
|
}
|
|
@@ -1551,10 +1907,12 @@ function getInitializeControllerInstruction(input, config) {
|
|
|
1551
1907
|
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
1552
1908
|
const instruction = {
|
|
1553
1909
|
accounts: [
|
|
1910
|
+
getAccountMeta(accounts.master),
|
|
1911
|
+
getAccountMeta(accounts.stats),
|
|
1554
1912
|
getAccountMeta(accounts.controller),
|
|
1555
1913
|
getAccountMeta(accounts.feeVault),
|
|
1556
1914
|
getAccountMeta(accounts.treasury),
|
|
1557
|
-
getAccountMeta(accounts.
|
|
1915
|
+
getAccountMeta(accounts.authority),
|
|
1558
1916
|
getAccountMeta(accounts.systemProgram)
|
|
1559
1917
|
],
|
|
1560
1918
|
programAddress,
|
|
@@ -1565,7 +1923,7 @@ function getInitializeControllerInstruction(input, config) {
|
|
|
1565
1923
|
return instruction;
|
|
1566
1924
|
}
|
|
1567
1925
|
function parseInitializeControllerInstruction(instruction) {
|
|
1568
|
-
if (instruction.accounts.length <
|
|
1926
|
+
if (instruction.accounts.length < 7) {
|
|
1569
1927
|
throw new Error("Not enough accounts");
|
|
1570
1928
|
}
|
|
1571
1929
|
let accountIndex = 0;
|
|
@@ -1577,10 +1935,12 @@ function parseInitializeControllerInstruction(instruction) {
|
|
|
1577
1935
|
return {
|
|
1578
1936
|
programAddress: instruction.programAddress,
|
|
1579
1937
|
accounts: {
|
|
1938
|
+
master: getNextAccount(),
|
|
1939
|
+
stats: getNextAccount(),
|
|
1580
1940
|
controller: getNextAccount(),
|
|
1581
1941
|
feeVault: getNextAccount(),
|
|
1582
1942
|
treasury: getNextAccount(),
|
|
1583
|
-
|
|
1943
|
+
authority: getNextAccount(),
|
|
1584
1944
|
systemProgram: getNextAccount()
|
|
1585
1945
|
},
|
|
1586
1946
|
data: getInitializeControllerInstructionDataDecoder().decode(
|
|
@@ -1589,76 +1949,435 @@ function parseInitializeControllerInstruction(instruction) {
|
|
|
1589
1949
|
};
|
|
1590
1950
|
}
|
|
1591
1951
|
|
|
1952
|
+
// src/instructions/initializeMaster.ts
|
|
1953
|
+
import {
|
|
1954
|
+
combineCodec as combineCodec13,
|
|
1955
|
+
fixDecoderSize as fixDecoderSize13,
|
|
1956
|
+
fixEncoderSize as fixEncoderSize14,
|
|
1957
|
+
getBytesDecoder as getBytesDecoder13,
|
|
1958
|
+
getBytesEncoder as getBytesEncoder14,
|
|
1959
|
+
getProgramDerivedAddress as getProgramDerivedAddress6,
|
|
1960
|
+
getStructDecoder as getStructDecoder13,
|
|
1961
|
+
getStructEncoder as getStructEncoder13,
|
|
1962
|
+
getU64Decoder as getU64Decoder9,
|
|
1963
|
+
getU64Encoder as getU64Encoder9,
|
|
1964
|
+
transformEncoder as transformEncoder13
|
|
1965
|
+
} from "@solana/kit";
|
|
1966
|
+
var INITIALIZE_MASTER_DISCRIMINATOR = new Uint8Array([
|
|
1967
|
+
206,
|
|
1968
|
+
91,
|
|
1969
|
+
246,
|
|
1970
|
+
30,
|
|
1971
|
+
216,
|
|
1972
|
+
101,
|
|
1973
|
+
134,
|
|
1974
|
+
166
|
|
1975
|
+
]);
|
|
1976
|
+
function getInitializeMasterDiscriminatorBytes() {
|
|
1977
|
+
return fixEncoderSize14(getBytesEncoder14(), 8).encode(
|
|
1978
|
+
INITIALIZE_MASTER_DISCRIMINATOR
|
|
1979
|
+
);
|
|
1980
|
+
}
|
|
1981
|
+
function getInitializeMasterInstructionDataEncoder() {
|
|
1982
|
+
return transformEncoder13(
|
|
1983
|
+
getStructEncoder13([
|
|
1984
|
+
["discriminator", fixEncoderSize14(getBytesEncoder14(), 8)],
|
|
1985
|
+
["protocolFee", getU64Encoder9()],
|
|
1986
|
+
["initControllerFee", getU64Encoder9()],
|
|
1987
|
+
["withdrawFee", getU64Encoder9()]
|
|
1988
|
+
]),
|
|
1989
|
+
(value) => ({ ...value, discriminator: INITIALIZE_MASTER_DISCRIMINATOR })
|
|
1990
|
+
);
|
|
1991
|
+
}
|
|
1992
|
+
function getInitializeMasterInstructionDataDecoder() {
|
|
1993
|
+
return getStructDecoder13([
|
|
1994
|
+
["discriminator", fixDecoderSize13(getBytesDecoder13(), 8)],
|
|
1995
|
+
["protocolFee", getU64Decoder9()],
|
|
1996
|
+
["initControllerFee", getU64Decoder9()],
|
|
1997
|
+
["withdrawFee", getU64Decoder9()]
|
|
1998
|
+
]);
|
|
1999
|
+
}
|
|
2000
|
+
function getInitializeMasterInstructionDataCodec() {
|
|
2001
|
+
return combineCodec13(
|
|
2002
|
+
getInitializeMasterInstructionDataEncoder(),
|
|
2003
|
+
getInitializeMasterInstructionDataDecoder()
|
|
2004
|
+
);
|
|
2005
|
+
}
|
|
2006
|
+
async function getInitializeMasterInstructionAsync(input, config) {
|
|
2007
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2008
|
+
const originalAccounts = {
|
|
2009
|
+
master: { value: input.master ?? null, isWritable: true },
|
|
2010
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
2011
|
+
feeVault: { value: input.feeVault ?? null, isWritable: false },
|
|
2012
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2013
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2014
|
+
};
|
|
2015
|
+
const accounts = originalAccounts;
|
|
2016
|
+
const args = { ...input };
|
|
2017
|
+
if (!accounts.master.value) {
|
|
2018
|
+
accounts.master.value = await getProgramDerivedAddress6({
|
|
2019
|
+
programAddress,
|
|
2020
|
+
seeds: [
|
|
2021
|
+
getBytesEncoder14().encode(
|
|
2022
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
2023
|
+
)
|
|
2024
|
+
]
|
|
2025
|
+
});
|
|
2026
|
+
}
|
|
2027
|
+
if (!accounts.stats.value) {
|
|
2028
|
+
accounts.stats.value = await getProgramDerivedAddress6({
|
|
2029
|
+
programAddress,
|
|
2030
|
+
seeds: [
|
|
2031
|
+
getBytesEncoder14().encode(new Uint8Array([115, 116, 97, 116, 115]))
|
|
2032
|
+
]
|
|
2033
|
+
});
|
|
2034
|
+
}
|
|
2035
|
+
if (!accounts.feeVault.value) {
|
|
2036
|
+
accounts.feeVault.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2037
|
+
}
|
|
2038
|
+
if (!accounts.systemProgram.value) {
|
|
2039
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2040
|
+
}
|
|
2041
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2042
|
+
const instruction = {
|
|
2043
|
+
accounts: [
|
|
2044
|
+
getAccountMeta(accounts.master),
|
|
2045
|
+
getAccountMeta(accounts.stats),
|
|
2046
|
+
getAccountMeta(accounts.feeVault),
|
|
2047
|
+
getAccountMeta(accounts.authority),
|
|
2048
|
+
getAccountMeta(accounts.systemProgram)
|
|
2049
|
+
],
|
|
2050
|
+
programAddress,
|
|
2051
|
+
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
2052
|
+
args
|
|
2053
|
+
)
|
|
2054
|
+
};
|
|
2055
|
+
return instruction;
|
|
2056
|
+
}
|
|
2057
|
+
function getInitializeMasterInstruction(input, config) {
|
|
2058
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2059
|
+
const originalAccounts = {
|
|
2060
|
+
master: { value: input.master ?? null, isWritable: true },
|
|
2061
|
+
stats: { value: input.stats ?? null, isWritable: true },
|
|
2062
|
+
feeVault: { value: input.feeVault ?? null, isWritable: false },
|
|
2063
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2064
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2065
|
+
};
|
|
2066
|
+
const accounts = originalAccounts;
|
|
2067
|
+
const args = { ...input };
|
|
2068
|
+
if (!accounts.feeVault.value) {
|
|
2069
|
+
accounts.feeVault.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2070
|
+
}
|
|
2071
|
+
if (!accounts.systemProgram.value) {
|
|
2072
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2073
|
+
}
|
|
2074
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2075
|
+
const instruction = {
|
|
2076
|
+
accounts: [
|
|
2077
|
+
getAccountMeta(accounts.master),
|
|
2078
|
+
getAccountMeta(accounts.stats),
|
|
2079
|
+
getAccountMeta(accounts.feeVault),
|
|
2080
|
+
getAccountMeta(accounts.authority),
|
|
2081
|
+
getAccountMeta(accounts.systemProgram)
|
|
2082
|
+
],
|
|
2083
|
+
programAddress,
|
|
2084
|
+
data: getInitializeMasterInstructionDataEncoder().encode(
|
|
2085
|
+
args
|
|
2086
|
+
)
|
|
2087
|
+
};
|
|
2088
|
+
return instruction;
|
|
2089
|
+
}
|
|
2090
|
+
function parseInitializeMasterInstruction(instruction) {
|
|
2091
|
+
if (instruction.accounts.length < 5) {
|
|
2092
|
+
throw new Error("Not enough accounts");
|
|
2093
|
+
}
|
|
2094
|
+
let accountIndex = 0;
|
|
2095
|
+
const getNextAccount = () => {
|
|
2096
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2097
|
+
accountIndex += 1;
|
|
2098
|
+
return accountMeta;
|
|
2099
|
+
};
|
|
2100
|
+
return {
|
|
2101
|
+
programAddress: instruction.programAddress,
|
|
2102
|
+
accounts: {
|
|
2103
|
+
master: getNextAccount(),
|
|
2104
|
+
stats: getNextAccount(),
|
|
2105
|
+
feeVault: getNextAccount(),
|
|
2106
|
+
authority: getNextAccount(),
|
|
2107
|
+
systemProgram: getNextAccount()
|
|
2108
|
+
},
|
|
2109
|
+
data: getInitializeMasterInstructionDataDecoder().decode(instruction.data)
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
|
|
2113
|
+
// src/instructions/withdrawControllerFees.ts
|
|
2114
|
+
import {
|
|
2115
|
+
combineCodec as combineCodec14,
|
|
2116
|
+
fixDecoderSize as fixDecoderSize14,
|
|
2117
|
+
fixEncoderSize as fixEncoderSize15,
|
|
2118
|
+
getAddressEncoder as getAddressEncoder9,
|
|
2119
|
+
getBytesDecoder as getBytesDecoder14,
|
|
2120
|
+
getBytesEncoder as getBytesEncoder15,
|
|
2121
|
+
getProgramDerivedAddress as getProgramDerivedAddress7,
|
|
2122
|
+
getStructDecoder as getStructDecoder14,
|
|
2123
|
+
getStructEncoder as getStructEncoder14,
|
|
2124
|
+
getU64Decoder as getU64Decoder10,
|
|
2125
|
+
getU64Encoder as getU64Encoder10,
|
|
2126
|
+
transformEncoder as transformEncoder14
|
|
2127
|
+
} from "@solana/kit";
|
|
2128
|
+
var WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR = new Uint8Array([
|
|
2129
|
+
252,
|
|
2130
|
+
199,
|
|
2131
|
+
14,
|
|
2132
|
+
46,
|
|
2133
|
+
100,
|
|
2134
|
+
156,
|
|
2135
|
+
176,
|
|
2136
|
+
230
|
|
2137
|
+
]);
|
|
2138
|
+
function getWithdrawControllerFeesDiscriminatorBytes() {
|
|
2139
|
+
return fixEncoderSize15(getBytesEncoder15(), 8).encode(
|
|
2140
|
+
WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR
|
|
2141
|
+
);
|
|
2142
|
+
}
|
|
2143
|
+
function getWithdrawControllerFeesInstructionDataEncoder() {
|
|
2144
|
+
return transformEncoder14(
|
|
2145
|
+
getStructEncoder14([
|
|
2146
|
+
["discriminator", fixEncoderSize15(getBytesEncoder15(), 8)],
|
|
2147
|
+
["amount", getU64Encoder10()]
|
|
2148
|
+
]),
|
|
2149
|
+
(value) => ({
|
|
2150
|
+
...value,
|
|
2151
|
+
discriminator: WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR
|
|
2152
|
+
})
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
function getWithdrawControllerFeesInstructionDataDecoder() {
|
|
2156
|
+
return getStructDecoder14([
|
|
2157
|
+
["discriminator", fixDecoderSize14(getBytesDecoder14(), 8)],
|
|
2158
|
+
["amount", getU64Decoder10()]
|
|
2159
|
+
]);
|
|
2160
|
+
}
|
|
2161
|
+
function getWithdrawControllerFeesInstructionDataCodec() {
|
|
2162
|
+
return combineCodec14(
|
|
2163
|
+
getWithdrawControllerFeesInstructionDataEncoder(),
|
|
2164
|
+
getWithdrawControllerFeesInstructionDataDecoder()
|
|
2165
|
+
);
|
|
2166
|
+
}
|
|
2167
|
+
async function getWithdrawControllerFeesInstructionAsync(input, config) {
|
|
2168
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2169
|
+
const originalAccounts = {
|
|
2170
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
2171
|
+
controller: { value: input.controller ?? null, isWritable: false },
|
|
2172
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
2173
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2174
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2175
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2176
|
+
};
|
|
2177
|
+
const accounts = originalAccounts;
|
|
2178
|
+
const args = { ...input };
|
|
2179
|
+
if (!accounts.master.value) {
|
|
2180
|
+
accounts.master.value = await getProgramDerivedAddress7({
|
|
2181
|
+
programAddress,
|
|
2182
|
+
seeds: [
|
|
2183
|
+
getBytesEncoder15().encode(
|
|
2184
|
+
new Uint8Array([109, 97, 115, 116, 101, 114, 51])
|
|
2185
|
+
)
|
|
2186
|
+
]
|
|
2187
|
+
});
|
|
2188
|
+
}
|
|
2189
|
+
if (!accounts.controller.value) {
|
|
2190
|
+
accounts.controller.value = await getProgramDerivedAddress7({
|
|
2191
|
+
programAddress,
|
|
2192
|
+
seeds: [
|
|
2193
|
+
getBytesEncoder15().encode(
|
|
2194
|
+
new Uint8Array([
|
|
2195
|
+
99,
|
|
2196
|
+
111,
|
|
2197
|
+
110,
|
|
2198
|
+
116,
|
|
2199
|
+
114,
|
|
2200
|
+
111,
|
|
2201
|
+
108,
|
|
2202
|
+
108,
|
|
2203
|
+
101,
|
|
2204
|
+
114,
|
|
2205
|
+
45,
|
|
2206
|
+
100,
|
|
2207
|
+
114,
|
|
2208
|
+
111,
|
|
2209
|
+
112,
|
|
2210
|
+
115,
|
|
2211
|
+
121
|
|
2212
|
+
])
|
|
2213
|
+
),
|
|
2214
|
+
getAddressEncoder9().encode(expectAddress(accounts.authority.value))
|
|
2215
|
+
]
|
|
2216
|
+
});
|
|
2217
|
+
}
|
|
2218
|
+
if (!accounts.feeVault.value) {
|
|
2219
|
+
accounts.feeVault.value = await getProgramDerivedAddress7({
|
|
2220
|
+
programAddress,
|
|
2221
|
+
seeds: [
|
|
2222
|
+
getBytesEncoder15().encode(new Uint8Array([118, 97, 117, 108, 116])),
|
|
2223
|
+
getAddressEncoder9().encode(expectAddress(accounts.controller.value))
|
|
2224
|
+
]
|
|
2225
|
+
});
|
|
2226
|
+
}
|
|
2227
|
+
if (!accounts.treasury.value) {
|
|
2228
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2229
|
+
}
|
|
2230
|
+
if (!accounts.systemProgram.value) {
|
|
2231
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2232
|
+
}
|
|
2233
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2234
|
+
const instruction = {
|
|
2235
|
+
accounts: [
|
|
2236
|
+
getAccountMeta(accounts.master),
|
|
2237
|
+
getAccountMeta(accounts.controller),
|
|
2238
|
+
getAccountMeta(accounts.feeVault),
|
|
2239
|
+
getAccountMeta(accounts.authority),
|
|
2240
|
+
getAccountMeta(accounts.treasury),
|
|
2241
|
+
getAccountMeta(accounts.systemProgram)
|
|
2242
|
+
],
|
|
2243
|
+
programAddress,
|
|
2244
|
+
data: getWithdrawControllerFeesInstructionDataEncoder().encode(
|
|
2245
|
+
args
|
|
2246
|
+
)
|
|
2247
|
+
};
|
|
2248
|
+
return instruction;
|
|
2249
|
+
}
|
|
2250
|
+
function getWithdrawControllerFeesInstruction(input, config) {
|
|
2251
|
+
const programAddress = config?.programAddress ?? DROPSY_PROGRAM_ADDRESS;
|
|
2252
|
+
const originalAccounts = {
|
|
2253
|
+
master: { value: input.master ?? null, isWritable: false },
|
|
2254
|
+
controller: { value: input.controller ?? null, isWritable: false },
|
|
2255
|
+
feeVault: { value: input.feeVault ?? null, isWritable: true },
|
|
2256
|
+
authority: { value: input.authority ?? null, isWritable: true },
|
|
2257
|
+
treasury: { value: input.treasury ?? null, isWritable: true },
|
|
2258
|
+
systemProgram: { value: input.systemProgram ?? null, isWritable: false }
|
|
2259
|
+
};
|
|
2260
|
+
const accounts = originalAccounts;
|
|
2261
|
+
const args = { ...input };
|
|
2262
|
+
if (!accounts.treasury.value) {
|
|
2263
|
+
accounts.treasury.value = "DHffy4rNMtuL8VKgyBEay4jcq8AYHyoAzxLKU6aEijUV";
|
|
2264
|
+
}
|
|
2265
|
+
if (!accounts.systemProgram.value) {
|
|
2266
|
+
accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
2267
|
+
}
|
|
2268
|
+
const getAccountMeta = getAccountMetaFactory(programAddress, "programId");
|
|
2269
|
+
const instruction = {
|
|
2270
|
+
accounts: [
|
|
2271
|
+
getAccountMeta(accounts.master),
|
|
2272
|
+
getAccountMeta(accounts.controller),
|
|
2273
|
+
getAccountMeta(accounts.feeVault),
|
|
2274
|
+
getAccountMeta(accounts.authority),
|
|
2275
|
+
getAccountMeta(accounts.treasury),
|
|
2276
|
+
getAccountMeta(accounts.systemProgram)
|
|
2277
|
+
],
|
|
2278
|
+
programAddress,
|
|
2279
|
+
data: getWithdrawControllerFeesInstructionDataEncoder().encode(
|
|
2280
|
+
args
|
|
2281
|
+
)
|
|
2282
|
+
};
|
|
2283
|
+
return instruction;
|
|
2284
|
+
}
|
|
2285
|
+
function parseWithdrawControllerFeesInstruction(instruction) {
|
|
2286
|
+
if (instruction.accounts.length < 6) {
|
|
2287
|
+
throw new Error("Not enough accounts");
|
|
2288
|
+
}
|
|
2289
|
+
let accountIndex = 0;
|
|
2290
|
+
const getNextAccount = () => {
|
|
2291
|
+
const accountMeta = instruction.accounts[accountIndex];
|
|
2292
|
+
accountIndex += 1;
|
|
2293
|
+
return accountMeta;
|
|
2294
|
+
};
|
|
2295
|
+
return {
|
|
2296
|
+
programAddress: instruction.programAddress,
|
|
2297
|
+
accounts: {
|
|
2298
|
+
master: getNextAccount(),
|
|
2299
|
+
controller: getNextAccount(),
|
|
2300
|
+
feeVault: getNextAccount(),
|
|
2301
|
+
authority: getNextAccount(),
|
|
2302
|
+
treasury: getNextAccount(),
|
|
2303
|
+
systemProgram: getNextAccount()
|
|
2304
|
+
},
|
|
2305
|
+
data: getWithdrawControllerFeesInstructionDataDecoder().decode(
|
|
2306
|
+
instruction.data
|
|
2307
|
+
)
|
|
2308
|
+
};
|
|
2309
|
+
}
|
|
2310
|
+
|
|
1592
2311
|
// src/types/airdropClosed.ts
|
|
1593
2312
|
import {
|
|
1594
|
-
combineCodec as
|
|
1595
|
-
getAddressDecoder as
|
|
1596
|
-
getAddressEncoder as
|
|
2313
|
+
combineCodec as combineCodec15,
|
|
2314
|
+
getAddressDecoder as getAddressDecoder5,
|
|
2315
|
+
getAddressEncoder as getAddressEncoder10,
|
|
1597
2316
|
getI64Decoder as getI64Decoder3,
|
|
1598
2317
|
getI64Encoder as getI64Encoder3,
|
|
1599
|
-
getStructDecoder as
|
|
1600
|
-
getStructEncoder as
|
|
2318
|
+
getStructDecoder as getStructDecoder15,
|
|
2319
|
+
getStructEncoder as getStructEncoder15
|
|
1601
2320
|
} from "@solana/kit";
|
|
1602
2321
|
function getAirdropClosedEncoder() {
|
|
1603
|
-
return
|
|
1604
|
-
["airdrop",
|
|
1605
|
-
["
|
|
2322
|
+
return getStructEncoder15([
|
|
2323
|
+
["airdrop", getAddressEncoder10()],
|
|
2324
|
+
["authority", getAddressEncoder10()],
|
|
1606
2325
|
["timestamp", getI64Encoder3()]
|
|
1607
2326
|
]);
|
|
1608
2327
|
}
|
|
1609
2328
|
function getAirdropClosedDecoder() {
|
|
1610
|
-
return
|
|
1611
|
-
["airdrop",
|
|
1612
|
-
["
|
|
2329
|
+
return getStructDecoder15([
|
|
2330
|
+
["airdrop", getAddressDecoder5()],
|
|
2331
|
+
["authority", getAddressDecoder5()],
|
|
1613
2332
|
["timestamp", getI64Decoder3()]
|
|
1614
2333
|
]);
|
|
1615
2334
|
}
|
|
1616
2335
|
function getAirdropClosedCodec() {
|
|
1617
|
-
return
|
|
2336
|
+
return combineCodec15(getAirdropClosedEncoder(), getAirdropClosedDecoder());
|
|
1618
2337
|
}
|
|
1619
2338
|
|
|
1620
2339
|
// src/types/airdropInitialized.ts
|
|
1621
2340
|
import {
|
|
1622
|
-
combineCodec as
|
|
1623
|
-
getAddressDecoder as
|
|
1624
|
-
getAddressEncoder as
|
|
2341
|
+
combineCodec as combineCodec16,
|
|
2342
|
+
getAddressDecoder as getAddressDecoder6,
|
|
2343
|
+
getAddressEncoder as getAddressEncoder11,
|
|
1625
2344
|
getArrayDecoder as getArrayDecoder4,
|
|
1626
2345
|
getArrayEncoder as getArrayEncoder4,
|
|
1627
2346
|
getI64Decoder as getI64Decoder4,
|
|
1628
2347
|
getI64Encoder as getI64Encoder4,
|
|
1629
|
-
getStructDecoder as
|
|
1630
|
-
getStructEncoder as
|
|
1631
|
-
getU8Decoder as
|
|
1632
|
-
getU8Encoder as
|
|
2348
|
+
getStructDecoder as getStructDecoder16,
|
|
2349
|
+
getStructEncoder as getStructEncoder16,
|
|
2350
|
+
getU8Decoder as getU8Decoder9,
|
|
2351
|
+
getU8Encoder as getU8Encoder9
|
|
1633
2352
|
} from "@solana/kit";
|
|
1634
2353
|
function getAirdropInitializedEncoder() {
|
|
1635
|
-
return
|
|
1636
|
-
["airdrop",
|
|
1637
|
-
["mint",
|
|
1638
|
-
["
|
|
1639
|
-
["controller",
|
|
1640
|
-
["
|
|
1641
|
-
["merkleRoot", getArrayEncoder4(
|
|
2354
|
+
return getStructEncoder16([
|
|
2355
|
+
["airdrop", getAddressEncoder11()],
|
|
2356
|
+
["mint", getAddressEncoder11()],
|
|
2357
|
+
["authority", getAddressEncoder11()],
|
|
2358
|
+
["controller", getAddressEncoder11()],
|
|
2359
|
+
["controllerFeeVault", getAddressEncoder11()],
|
|
2360
|
+
["merkleRoot", getArrayEncoder4(getU8Encoder9(), { size: 32 })],
|
|
1642
2361
|
["startTime", getI64Encoder4()],
|
|
1643
2362
|
["endTime", getI64Encoder4()],
|
|
1644
2363
|
["timestamp", getI64Encoder4()]
|
|
1645
2364
|
]);
|
|
1646
2365
|
}
|
|
1647
2366
|
function getAirdropInitializedDecoder() {
|
|
1648
|
-
return
|
|
1649
|
-
["airdrop",
|
|
1650
|
-
["mint",
|
|
1651
|
-
["
|
|
1652
|
-
["controller",
|
|
1653
|
-
["
|
|
1654
|
-
["merkleRoot", getArrayDecoder4(
|
|
2367
|
+
return getStructDecoder16([
|
|
2368
|
+
["airdrop", getAddressDecoder6()],
|
|
2369
|
+
["mint", getAddressDecoder6()],
|
|
2370
|
+
["authority", getAddressDecoder6()],
|
|
2371
|
+
["controller", getAddressDecoder6()],
|
|
2372
|
+
["controllerFeeVault", getAddressDecoder6()],
|
|
2373
|
+
["merkleRoot", getArrayDecoder4(getU8Decoder9(), { size: 32 })],
|
|
1655
2374
|
["startTime", getI64Decoder4()],
|
|
1656
2375
|
["endTime", getI64Decoder4()],
|
|
1657
2376
|
["timestamp", getI64Decoder4()]
|
|
1658
2377
|
]);
|
|
1659
2378
|
}
|
|
1660
2379
|
function getAirdropInitializedCodec() {
|
|
1661
|
-
return
|
|
2380
|
+
return combineCodec16(
|
|
1662
2381
|
getAirdropInitializedEncoder(),
|
|
1663
2382
|
getAirdropInitializedDecoder()
|
|
1664
2383
|
);
|
|
@@ -1666,60 +2385,60 @@ function getAirdropInitializedCodec() {
|
|
|
1666
2385
|
|
|
1667
2386
|
// src/types/bitmapClosed.ts
|
|
1668
2387
|
import {
|
|
1669
|
-
combineCodec as
|
|
1670
|
-
getAddressDecoder as
|
|
1671
|
-
getAddressEncoder as
|
|
1672
|
-
getStructDecoder as
|
|
1673
|
-
getStructEncoder as
|
|
2388
|
+
combineCodec as combineCodec17,
|
|
2389
|
+
getAddressDecoder as getAddressDecoder7,
|
|
2390
|
+
getAddressEncoder as getAddressEncoder12,
|
|
2391
|
+
getStructDecoder as getStructDecoder17,
|
|
2392
|
+
getStructEncoder as getStructEncoder17
|
|
1674
2393
|
} from "@solana/kit";
|
|
1675
2394
|
function getBitmapClosedEncoder() {
|
|
1676
|
-
return
|
|
1677
|
-
["airdrop",
|
|
1678
|
-
["bitmap",
|
|
1679
|
-
["
|
|
2395
|
+
return getStructEncoder17([
|
|
2396
|
+
["airdrop", getAddressEncoder12()],
|
|
2397
|
+
["bitmap", getAddressEncoder12()],
|
|
2398
|
+
["authority", getAddressEncoder12()]
|
|
1680
2399
|
]);
|
|
1681
2400
|
}
|
|
1682
2401
|
function getBitmapClosedDecoder() {
|
|
1683
|
-
return
|
|
1684
|
-
["airdrop",
|
|
1685
|
-
["bitmap",
|
|
1686
|
-
["
|
|
2402
|
+
return getStructDecoder17([
|
|
2403
|
+
["airdrop", getAddressDecoder7()],
|
|
2404
|
+
["bitmap", getAddressDecoder7()],
|
|
2405
|
+
["authority", getAddressDecoder7()]
|
|
1687
2406
|
]);
|
|
1688
2407
|
}
|
|
1689
2408
|
function getBitmapClosedCodec() {
|
|
1690
|
-
return
|
|
2409
|
+
return combineCodec17(getBitmapClosedEncoder(), getBitmapClosedDecoder());
|
|
1691
2410
|
}
|
|
1692
2411
|
|
|
1693
2412
|
// src/types/bitmapInitialized.ts
|
|
1694
2413
|
import {
|
|
1695
|
-
combineCodec as
|
|
1696
|
-
getAddressDecoder as
|
|
1697
|
-
getAddressEncoder as
|
|
1698
|
-
getStructDecoder as
|
|
1699
|
-
getStructEncoder as
|
|
1700
|
-
getU64Decoder as
|
|
1701
|
-
getU64Encoder as
|
|
1702
|
-
getU8Decoder as
|
|
1703
|
-
getU8Encoder as
|
|
2414
|
+
combineCodec as combineCodec18,
|
|
2415
|
+
getAddressDecoder as getAddressDecoder8,
|
|
2416
|
+
getAddressEncoder as getAddressEncoder13,
|
|
2417
|
+
getStructDecoder as getStructDecoder18,
|
|
2418
|
+
getStructEncoder as getStructEncoder18,
|
|
2419
|
+
getU64Decoder as getU64Decoder11,
|
|
2420
|
+
getU64Encoder as getU64Encoder11,
|
|
2421
|
+
getU8Decoder as getU8Decoder10,
|
|
2422
|
+
getU8Encoder as getU8Encoder10
|
|
1704
2423
|
} from "@solana/kit";
|
|
1705
2424
|
function getBitmapInitializedEncoder() {
|
|
1706
|
-
return
|
|
1707
|
-
["airdrop",
|
|
1708
|
-
["bitmap",
|
|
1709
|
-
["bitmapId",
|
|
1710
|
-
["totalClaims",
|
|
2425
|
+
return getStructEncoder18([
|
|
2426
|
+
["airdrop", getAddressEncoder13()],
|
|
2427
|
+
["bitmap", getAddressEncoder13()],
|
|
2428
|
+
["bitmapId", getU8Encoder10()],
|
|
2429
|
+
["totalClaims", getU64Encoder11()]
|
|
1711
2430
|
]);
|
|
1712
2431
|
}
|
|
1713
2432
|
function getBitmapInitializedDecoder() {
|
|
1714
|
-
return
|
|
1715
|
-
["airdrop",
|
|
1716
|
-
["bitmap",
|
|
1717
|
-
["bitmapId",
|
|
1718
|
-
["totalClaims",
|
|
2433
|
+
return getStructDecoder18([
|
|
2434
|
+
["airdrop", getAddressDecoder8()],
|
|
2435
|
+
["bitmap", getAddressDecoder8()],
|
|
2436
|
+
["bitmapId", getU8Decoder10()],
|
|
2437
|
+
["totalClaims", getU64Decoder11()]
|
|
1719
2438
|
]);
|
|
1720
2439
|
}
|
|
1721
2440
|
function getBitmapInitializedCodec() {
|
|
1722
|
-
return
|
|
2441
|
+
return combineCodec18(
|
|
1723
2442
|
getBitmapInitializedEncoder(),
|
|
1724
2443
|
getBitmapInitializedDecoder()
|
|
1725
2444
|
);
|
|
@@ -1727,77 +2446,248 @@ function getBitmapInitializedCodec() {
|
|
|
1727
2446
|
|
|
1728
2447
|
// src/types/controllerInitialized.ts
|
|
1729
2448
|
import {
|
|
1730
|
-
combineCodec as
|
|
1731
|
-
getAddressDecoder as
|
|
1732
|
-
getAddressEncoder as
|
|
2449
|
+
combineCodec as combineCodec19,
|
|
2450
|
+
getAddressDecoder as getAddressDecoder9,
|
|
2451
|
+
getAddressEncoder as getAddressEncoder14,
|
|
1733
2452
|
getI64Decoder as getI64Decoder5,
|
|
1734
2453
|
getI64Encoder as getI64Encoder5,
|
|
1735
|
-
getStructDecoder as
|
|
1736
|
-
getStructEncoder as
|
|
1737
|
-
getU64Decoder as
|
|
1738
|
-
getU64Encoder as
|
|
1739
|
-
getU8Decoder as
|
|
1740
|
-
getU8Encoder as
|
|
2454
|
+
getStructDecoder as getStructDecoder19,
|
|
2455
|
+
getStructEncoder as getStructEncoder19,
|
|
2456
|
+
getU64Decoder as getU64Decoder12,
|
|
2457
|
+
getU64Encoder as getU64Encoder12,
|
|
2458
|
+
getU8Decoder as getU8Decoder11,
|
|
2459
|
+
getU8Encoder as getU8Encoder11
|
|
1741
2460
|
} from "@solana/kit";
|
|
1742
2461
|
function getControllerInitializedEncoder() {
|
|
1743
|
-
return
|
|
1744
|
-
["
|
|
1745
|
-
["
|
|
1746
|
-
["
|
|
1747
|
-
["
|
|
1748
|
-
["bump",
|
|
2462
|
+
return getStructEncoder19([
|
|
2463
|
+
["masterVault", getAddressEncoder14()],
|
|
2464
|
+
["authority", getAddressEncoder14()],
|
|
2465
|
+
["feeVault", getAddressEncoder14()],
|
|
2466
|
+
["feeLamports", getU64Encoder12()],
|
|
2467
|
+
["bump", getU8Encoder11()],
|
|
1749
2468
|
["timestamp", getI64Encoder5()]
|
|
1750
2469
|
]);
|
|
1751
2470
|
}
|
|
1752
2471
|
function getControllerInitializedDecoder() {
|
|
1753
|
-
return
|
|
1754
|
-
["
|
|
1755
|
-
["
|
|
1756
|
-
["
|
|
1757
|
-
["
|
|
1758
|
-
["bump",
|
|
2472
|
+
return getStructDecoder19([
|
|
2473
|
+
["masterVault", getAddressDecoder9()],
|
|
2474
|
+
["authority", getAddressDecoder9()],
|
|
2475
|
+
["feeVault", getAddressDecoder9()],
|
|
2476
|
+
["feeLamports", getU64Decoder12()],
|
|
2477
|
+
["bump", getU8Decoder11()],
|
|
1759
2478
|
["timestamp", getI64Decoder5()]
|
|
1760
2479
|
]);
|
|
1761
2480
|
}
|
|
1762
2481
|
function getControllerInitializedCodec() {
|
|
1763
|
-
return
|
|
2482
|
+
return combineCodec19(
|
|
1764
2483
|
getControllerInitializedEncoder(),
|
|
1765
2484
|
getControllerInitializedDecoder()
|
|
1766
2485
|
);
|
|
1767
2486
|
}
|
|
1768
2487
|
|
|
1769
|
-
// src/types/
|
|
2488
|
+
// src/types/feesCollected.ts
|
|
1770
2489
|
import {
|
|
1771
|
-
combineCodec as
|
|
1772
|
-
getAddressDecoder as
|
|
1773
|
-
getAddressEncoder as
|
|
2490
|
+
combineCodec as combineCodec20,
|
|
2491
|
+
getAddressDecoder as getAddressDecoder10,
|
|
2492
|
+
getAddressEncoder as getAddressEncoder15,
|
|
1774
2493
|
getI64Decoder as getI64Decoder6,
|
|
1775
2494
|
getI64Encoder as getI64Encoder6,
|
|
1776
|
-
getStructDecoder as
|
|
1777
|
-
getStructEncoder as
|
|
1778
|
-
getU64Decoder as
|
|
1779
|
-
getU64Encoder as
|
|
2495
|
+
getStructDecoder as getStructDecoder20,
|
|
2496
|
+
getStructEncoder as getStructEncoder20,
|
|
2497
|
+
getU64Decoder as getU64Decoder13,
|
|
2498
|
+
getU64Encoder as getU64Encoder13
|
|
1780
2499
|
} from "@solana/kit";
|
|
1781
|
-
function
|
|
1782
|
-
return
|
|
1783
|
-
["
|
|
1784
|
-
["
|
|
1785
|
-
["
|
|
1786
|
-
["
|
|
2500
|
+
function getFeesCollectedEncoder() {
|
|
2501
|
+
return getStructEncoder20([
|
|
2502
|
+
["controller", getAddressEncoder15()],
|
|
2503
|
+
["authority", getAddressEncoder15()],
|
|
2504
|
+
["feeVault", getAddressEncoder15()],
|
|
2505
|
+
["amount", getU64Encoder13()],
|
|
1787
2506
|
["timestamp", getI64Encoder6()]
|
|
1788
2507
|
]);
|
|
1789
2508
|
}
|
|
1790
|
-
function
|
|
1791
|
-
return
|
|
1792
|
-
["
|
|
1793
|
-
["
|
|
1794
|
-
["
|
|
1795
|
-
["
|
|
2509
|
+
function getFeesCollectedDecoder() {
|
|
2510
|
+
return getStructDecoder20([
|
|
2511
|
+
["controller", getAddressDecoder10()],
|
|
2512
|
+
["authority", getAddressDecoder10()],
|
|
2513
|
+
["feeVault", getAddressDecoder10()],
|
|
2514
|
+
["amount", getU64Decoder13()],
|
|
1796
2515
|
["timestamp", getI64Decoder6()]
|
|
1797
2516
|
]);
|
|
1798
2517
|
}
|
|
2518
|
+
function getFeesCollectedCodec() {
|
|
2519
|
+
return combineCodec20(getFeesCollectedEncoder(), getFeesCollectedDecoder());
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
// src/types/masterInitialized.ts
|
|
2523
|
+
import {
|
|
2524
|
+
combineCodec as combineCodec21,
|
|
2525
|
+
getAddressDecoder as getAddressDecoder11,
|
|
2526
|
+
getAddressEncoder as getAddressEncoder16,
|
|
2527
|
+
getI64Decoder as getI64Decoder7,
|
|
2528
|
+
getI64Encoder as getI64Encoder7,
|
|
2529
|
+
getStructDecoder as getStructDecoder21,
|
|
2530
|
+
getStructEncoder as getStructEncoder21,
|
|
2531
|
+
getU64Decoder as getU64Decoder14,
|
|
2532
|
+
getU64Encoder as getU64Encoder14,
|
|
2533
|
+
getU8Decoder as getU8Decoder12,
|
|
2534
|
+
getU8Encoder as getU8Encoder12
|
|
2535
|
+
} from "@solana/kit";
|
|
2536
|
+
function getMasterInitializedEncoder() {
|
|
2537
|
+
return getStructEncoder21([
|
|
2538
|
+
["authority", getAddressEncoder16()],
|
|
2539
|
+
["feeVault", getAddressEncoder16()],
|
|
2540
|
+
["protocolFee", getU64Encoder14()],
|
|
2541
|
+
["initControllerFee", getU64Encoder14()],
|
|
2542
|
+
["withdrawFee", getU64Encoder14()],
|
|
2543
|
+
["bump", getU8Encoder12()],
|
|
2544
|
+
["timestamp", getI64Encoder7()]
|
|
2545
|
+
]);
|
|
2546
|
+
}
|
|
2547
|
+
function getMasterInitializedDecoder() {
|
|
2548
|
+
return getStructDecoder21([
|
|
2549
|
+
["authority", getAddressDecoder11()],
|
|
2550
|
+
["feeVault", getAddressDecoder11()],
|
|
2551
|
+
["protocolFee", getU64Decoder14()],
|
|
2552
|
+
["initControllerFee", getU64Decoder14()],
|
|
2553
|
+
["withdrawFee", getU64Decoder14()],
|
|
2554
|
+
["bump", getU8Decoder12()],
|
|
2555
|
+
["timestamp", getI64Decoder7()]
|
|
2556
|
+
]);
|
|
2557
|
+
}
|
|
2558
|
+
function getMasterInitializedCodec() {
|
|
2559
|
+
return combineCodec21(
|
|
2560
|
+
getMasterInitializedEncoder(),
|
|
2561
|
+
getMasterInitializedDecoder()
|
|
2562
|
+
);
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
// src/types/tokensDeposited.ts
|
|
2566
|
+
import {
|
|
2567
|
+
combineCodec as combineCodec22,
|
|
2568
|
+
getAddressDecoder as getAddressDecoder12,
|
|
2569
|
+
getAddressEncoder as getAddressEncoder17,
|
|
2570
|
+
getI64Decoder as getI64Decoder8,
|
|
2571
|
+
getI64Encoder as getI64Encoder8,
|
|
2572
|
+
getStructDecoder as getStructDecoder22,
|
|
2573
|
+
getStructEncoder as getStructEncoder22,
|
|
2574
|
+
getU64Decoder as getU64Decoder15,
|
|
2575
|
+
getU64Encoder as getU64Encoder15
|
|
2576
|
+
} from "@solana/kit";
|
|
2577
|
+
function getTokensDepositedEncoder() {
|
|
2578
|
+
return getStructEncoder22([
|
|
2579
|
+
["airdrop", getAddressEncoder17()],
|
|
2580
|
+
["amount", getU64Encoder15()],
|
|
2581
|
+
["newSupply", getU64Encoder15()],
|
|
2582
|
+
["depositor", getAddressEncoder17()],
|
|
2583
|
+
["timestamp", getI64Encoder8()]
|
|
2584
|
+
]);
|
|
2585
|
+
}
|
|
2586
|
+
function getTokensDepositedDecoder() {
|
|
2587
|
+
return getStructDecoder22([
|
|
2588
|
+
["airdrop", getAddressDecoder12()],
|
|
2589
|
+
["amount", getU64Decoder15()],
|
|
2590
|
+
["newSupply", getU64Decoder15()],
|
|
2591
|
+
["depositor", getAddressDecoder12()],
|
|
2592
|
+
["timestamp", getI64Decoder8()]
|
|
2593
|
+
]);
|
|
2594
|
+
}
|
|
1799
2595
|
function getTokensDepositedCodec() {
|
|
1800
|
-
return
|
|
2596
|
+
return combineCodec22(getTokensDepositedEncoder(), getTokensDepositedDecoder());
|
|
2597
|
+
}
|
|
2598
|
+
|
|
2599
|
+
// src/utils/client.ts
|
|
2600
|
+
import {
|
|
2601
|
+
airdropFactory,
|
|
2602
|
+
appendTransactionMessageInstructions,
|
|
2603
|
+
createSolanaRpc,
|
|
2604
|
+
createSolanaRpcSubscriptions,
|
|
2605
|
+
createTransactionMessage,
|
|
2606
|
+
generateKeyPairSigner,
|
|
2607
|
+
lamports,
|
|
2608
|
+
pipe,
|
|
2609
|
+
setTransactionMessageFeePayerSigner,
|
|
2610
|
+
setTransactionMessageLifetimeUsingBlockhash
|
|
2611
|
+
} from "@solana/kit";
|
|
2612
|
+
var generateKeyPairSignerWithSol = async (rpcClient, putativeLamports = 1000000000n) => {
|
|
2613
|
+
const signer = await generateKeyPairSigner();
|
|
2614
|
+
await airdropFactory(rpcClient)({
|
|
2615
|
+
recipientAddress: signer.address,
|
|
2616
|
+
lamports: lamports(putativeLamports),
|
|
2617
|
+
commitment: "confirmed"
|
|
2618
|
+
});
|
|
2619
|
+
return signer;
|
|
2620
|
+
};
|
|
2621
|
+
var createDefaultSolanaClient = () => {
|
|
2622
|
+
const rpc = createSolanaRpc("https://api.devnet.solana.com");
|
|
2623
|
+
const rpcSubscriptions = createSolanaRpcSubscriptions(
|
|
2624
|
+
"wss://api.devnet.solana.com"
|
|
2625
|
+
);
|
|
2626
|
+
return { rpc, rpcSubscriptions };
|
|
2627
|
+
};
|
|
2628
|
+
var createTransactionMessageFromInstruction = async (rpc, signer, instruction) => {
|
|
2629
|
+
const { value: latestBlockhash } = await rpc.getLatestBlockhash().send();
|
|
2630
|
+
return pipe(
|
|
2631
|
+
createTransactionMessage({ version: 0 }),
|
|
2632
|
+
(tx) => setTransactionMessageLifetimeUsingBlockhash(latestBlockhash, tx),
|
|
2633
|
+
(tx) => setTransactionMessageFeePayerSigner(signer, tx),
|
|
2634
|
+
(tx) => appendTransactionMessageInstructions(instruction, tx)
|
|
2635
|
+
);
|
|
2636
|
+
};
|
|
2637
|
+
|
|
2638
|
+
// src/utils/derive.ts
|
|
2639
|
+
import {
|
|
2640
|
+
getAddressEncoder as getAddressEncoder18,
|
|
2641
|
+
getProgramDerivedAddress as getProgramDerivedAddress8
|
|
2642
|
+
} from "@solana/kit";
|
|
2643
|
+
|
|
2644
|
+
// src/constants/index.ts
|
|
2645
|
+
var masterSeed = "master3";
|
|
2646
|
+
var statsSeed = "stats";
|
|
2647
|
+
var controllerSeed = "controller-dropsy";
|
|
2648
|
+
var feeVaultSeed = "vault";
|
|
2649
|
+
var airdropSeed = "airdrop";
|
|
2650
|
+
var claimMapSeed = "bitmap";
|
|
2651
|
+
|
|
2652
|
+
// src/utils/derive.ts
|
|
2653
|
+
async function getDropsyDerivedAddress(seeds) {
|
|
2654
|
+
return await getProgramDerivedAddress8({
|
|
2655
|
+
seeds,
|
|
2656
|
+
programAddress: DROPSY_PROGRAM_ADDRESS
|
|
2657
|
+
});
|
|
2658
|
+
}
|
|
2659
|
+
async function getMasterDerivedAddress() {
|
|
2660
|
+
return await getDropsyDerivedAddress([Buffer.from(masterSeed)]);
|
|
2661
|
+
}
|
|
2662
|
+
async function getStatsDerivedAddress() {
|
|
2663
|
+
return await getDropsyDerivedAddress([Buffer.from(statsSeed)]);
|
|
2664
|
+
}
|
|
2665
|
+
async function getControllerDerivedAddress(authority) {
|
|
2666
|
+
const seeds = [
|
|
2667
|
+
Buffer.from(controllerSeed),
|
|
2668
|
+
getAddressEncoder18().encode(authority)
|
|
2669
|
+
];
|
|
2670
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2671
|
+
}
|
|
2672
|
+
async function getAirdropDerivedAddress(authority, mint) {
|
|
2673
|
+
const seeds = [
|
|
2674
|
+
Buffer.from(airdropSeed),
|
|
2675
|
+
getAddressEncoder18().encode(mint),
|
|
2676
|
+
getAddressEncoder18().encode(authority)
|
|
2677
|
+
];
|
|
2678
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2679
|
+
}
|
|
2680
|
+
async function getControllerVaultAddress(controller) {
|
|
2681
|
+
const seeds = [Buffer.from(feeVaultSeed), getAddressEncoder18().encode(controller)];
|
|
2682
|
+
return await getDropsyDerivedAddress(seeds);
|
|
2683
|
+
}
|
|
2684
|
+
async function getClaimMapAddress(airdrop, id) {
|
|
2685
|
+
const seeds = [
|
|
2686
|
+
Buffer.from(claimMapSeed),
|
|
2687
|
+
getAddressEncoder18().encode(airdrop),
|
|
2688
|
+
Buffer.from([id])
|
|
2689
|
+
];
|
|
2690
|
+
return await getDropsyDerivedAddress(seeds);
|
|
1801
2691
|
}
|
|
1802
2692
|
export {
|
|
1803
2693
|
AIRDROP_DISCRIMINATOR,
|
|
@@ -1864,26 +2754,44 @@ export {
|
|
|
1864
2754
|
INITIALIZE_AIRDROP_DISCRIMINATOR,
|
|
1865
2755
|
INITIALIZE_BITMAP_DISCRIMINATOR,
|
|
1866
2756
|
INITIALIZE_CONTROLLER_DISCRIMINATOR,
|
|
2757
|
+
INITIALIZE_MASTER_DISCRIMINATOR,
|
|
2758
|
+
MASTER_DISCRIMINATOR,
|
|
2759
|
+
STATS_DISCRIMINATOR,
|
|
2760
|
+
WITHDRAW_CONTROLLER_FEES_DISCRIMINATOR,
|
|
2761
|
+
createDefaultSolanaClient,
|
|
2762
|
+
createTransactionMessageFromInstruction,
|
|
1867
2763
|
decodeAirdrop,
|
|
1868
2764
|
decodeBitmapAccount,
|
|
1869
2765
|
decodeController,
|
|
2766
|
+
decodeMaster,
|
|
2767
|
+
decodeStats,
|
|
1870
2768
|
fetchAirdrop,
|
|
1871
2769
|
fetchAllAirdrop,
|
|
1872
2770
|
fetchAllBitmapAccount,
|
|
1873
2771
|
fetchAllController,
|
|
2772
|
+
fetchAllMaster,
|
|
1874
2773
|
fetchAllMaybeAirdrop,
|
|
1875
2774
|
fetchAllMaybeBitmapAccount,
|
|
1876
2775
|
fetchAllMaybeController,
|
|
2776
|
+
fetchAllMaybeMaster,
|
|
2777
|
+
fetchAllMaybeStats,
|
|
2778
|
+
fetchAllStats,
|
|
1877
2779
|
fetchBitmapAccount,
|
|
1878
2780
|
fetchController,
|
|
2781
|
+
fetchMaster,
|
|
1879
2782
|
fetchMaybeAirdrop,
|
|
1880
2783
|
fetchMaybeBitmapAccount,
|
|
1881
2784
|
fetchMaybeController,
|
|
2785
|
+
fetchMaybeMaster,
|
|
2786
|
+
fetchMaybeStats,
|
|
2787
|
+
fetchStats,
|
|
2788
|
+
generateKeyPairSignerWithSol,
|
|
1882
2789
|
getAirdropClosedCodec,
|
|
1883
2790
|
getAirdropClosedDecoder,
|
|
1884
2791
|
getAirdropClosedEncoder,
|
|
1885
2792
|
getAirdropCodec,
|
|
1886
2793
|
getAirdropDecoder,
|
|
2794
|
+
getAirdropDerivedAddress,
|
|
1887
2795
|
getAirdropDiscriminatorBytes,
|
|
1888
2796
|
getAirdropEncoder,
|
|
1889
2797
|
getAirdropInitializedCodec,
|
|
@@ -1899,6 +2807,7 @@ export {
|
|
|
1899
2807
|
getBitmapInitializedCodec,
|
|
1900
2808
|
getBitmapInitializedDecoder,
|
|
1901
2809
|
getBitmapInitializedEncoder,
|
|
2810
|
+
getClaimMapAddress,
|
|
1902
2811
|
getClaimTokensDiscriminatorBytes,
|
|
1903
2812
|
getClaimTokensInstruction,
|
|
1904
2813
|
getClaimTokensInstructionDataCodec,
|
|
@@ -1906,27 +2815,35 @@ export {
|
|
|
1906
2815
|
getClaimTokensInstructionDataEncoder,
|
|
1907
2816
|
getCloseAirdropDiscriminatorBytes,
|
|
1908
2817
|
getCloseAirdropInstruction,
|
|
2818
|
+
getCloseAirdropInstructionAsync,
|
|
1909
2819
|
getCloseAirdropInstructionDataCodec,
|
|
1910
2820
|
getCloseAirdropInstructionDataDecoder,
|
|
1911
2821
|
getCloseAirdropInstructionDataEncoder,
|
|
1912
2822
|
getCloseBitmapDiscriminatorBytes,
|
|
1913
2823
|
getCloseBitmapInstruction,
|
|
2824
|
+
getCloseBitmapInstructionAsync,
|
|
1914
2825
|
getCloseBitmapInstructionDataCodec,
|
|
1915
2826
|
getCloseBitmapInstructionDataDecoder,
|
|
1916
2827
|
getCloseBitmapInstructionDataEncoder,
|
|
1917
2828
|
getControllerCodec,
|
|
1918
2829
|
getControllerDecoder,
|
|
2830
|
+
getControllerDerivedAddress,
|
|
1919
2831
|
getControllerDiscriminatorBytes,
|
|
1920
2832
|
getControllerEncoder,
|
|
1921
2833
|
getControllerInitializedCodec,
|
|
1922
2834
|
getControllerInitializedDecoder,
|
|
1923
2835
|
getControllerInitializedEncoder,
|
|
2836
|
+
getControllerVaultAddress,
|
|
1924
2837
|
getDepositTokensDiscriminatorBytes,
|
|
1925
2838
|
getDepositTokensInstruction,
|
|
1926
2839
|
getDepositTokensInstructionDataCodec,
|
|
1927
2840
|
getDepositTokensInstructionDataDecoder,
|
|
1928
2841
|
getDepositTokensInstructionDataEncoder,
|
|
2842
|
+
getDropsyDerivedAddress,
|
|
1929
2843
|
getDropsyErrorMessage,
|
|
2844
|
+
getFeesCollectedCodec,
|
|
2845
|
+
getFeesCollectedDecoder,
|
|
2846
|
+
getFeesCollectedEncoder,
|
|
1930
2847
|
getInitializeAirdropDiscriminatorBytes,
|
|
1931
2848
|
getInitializeAirdropInstruction,
|
|
1932
2849
|
getInitializeAirdropInstructionAsync,
|
|
@@ -1945,9 +2862,34 @@ export {
|
|
|
1945
2862
|
getInitializeControllerInstructionDataCodec,
|
|
1946
2863
|
getInitializeControllerInstructionDataDecoder,
|
|
1947
2864
|
getInitializeControllerInstructionDataEncoder,
|
|
2865
|
+
getInitializeMasterDiscriminatorBytes,
|
|
2866
|
+
getInitializeMasterInstruction,
|
|
2867
|
+
getInitializeMasterInstructionAsync,
|
|
2868
|
+
getInitializeMasterInstructionDataCodec,
|
|
2869
|
+
getInitializeMasterInstructionDataDecoder,
|
|
2870
|
+
getInitializeMasterInstructionDataEncoder,
|
|
2871
|
+
getMasterCodec,
|
|
2872
|
+
getMasterDecoder,
|
|
2873
|
+
getMasterDerivedAddress,
|
|
2874
|
+
getMasterDiscriminatorBytes,
|
|
2875
|
+
getMasterEncoder,
|
|
2876
|
+
getMasterInitializedCodec,
|
|
2877
|
+
getMasterInitializedDecoder,
|
|
2878
|
+
getMasterInitializedEncoder,
|
|
2879
|
+
getStatsCodec,
|
|
2880
|
+
getStatsDecoder,
|
|
2881
|
+
getStatsDerivedAddress,
|
|
2882
|
+
getStatsDiscriminatorBytes,
|
|
2883
|
+
getStatsEncoder,
|
|
1948
2884
|
getTokensDepositedCodec,
|
|
1949
2885
|
getTokensDepositedDecoder,
|
|
1950
2886
|
getTokensDepositedEncoder,
|
|
2887
|
+
getWithdrawControllerFeesDiscriminatorBytes,
|
|
2888
|
+
getWithdrawControllerFeesInstruction,
|
|
2889
|
+
getWithdrawControllerFeesInstructionAsync,
|
|
2890
|
+
getWithdrawControllerFeesInstructionDataCodec,
|
|
2891
|
+
getWithdrawControllerFeesInstructionDataDecoder,
|
|
2892
|
+
getWithdrawControllerFeesInstructionDataEncoder,
|
|
1951
2893
|
identifyDropsyAccount,
|
|
1952
2894
|
identifyDropsyInstruction,
|
|
1953
2895
|
isDropsyError,
|
|
@@ -1957,5 +2899,8 @@ export {
|
|
|
1957
2899
|
parseDepositTokensInstruction,
|
|
1958
2900
|
parseInitializeAirdropInstruction,
|
|
1959
2901
|
parseInitializeBitmapInstruction,
|
|
1960
|
-
parseInitializeControllerInstruction
|
|
2902
|
+
parseInitializeControllerInstruction,
|
|
2903
|
+
parseInitializeMasterInstruction,
|
|
2904
|
+
parseWithdrawControllerFeesInstruction
|
|
1961
2905
|
};
|
|
2906
|
+
//# sourceMappingURL=index.mjs.map
|