@streamflow/distributor 8.0.1 → 8.0.2-alpha.p287.a3616ff
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/cjs/index.cjs +1572 -214
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.d.cts +1 -0
- package/dist/cjs/solana/descriptor/aligned_distributor.d.cts +962 -505
- package/dist/cjs/solana/descriptor/merkle_distributor.d.cts +1272 -560
- package/dist/cjs/solana/index.cjs +1572 -214
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +37 -96
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1571 -213
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/descriptor/aligned_distributor.d.ts +962 -505
- package/dist/esm/solana/descriptor/idl/aligned_distributor.json +86 -2
- package/dist/esm/solana/descriptor/idl/merkle_distributor.json +194 -6
- package/dist/esm/solana/descriptor/merkle_distributor.d.ts +1272 -560
- package/dist/esm/solana/index.d.ts +37 -96
- package/dist/esm/solana/index.js +1572 -213
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/esm/solana/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { PublicKey, TransactionInstruction, Connection, SystemProgram } from '@solana/web3.js';
|
|
2
2
|
import '@solana/wallet-adapter-base';
|
|
3
3
|
import { ICluster, ContractError, divCeilN, invariant, getNumberFromBN, getBN } from '@streamflow/common';
|
|
4
|
-
import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, prepareTransaction, checkOrCreateAtaBatch, pk } from '@streamflow/common/solana';
|
|
4
|
+
import { signAndExecuteTransaction, buildSendThrottler, prepareBaseInstructions, getMintAndProgram, ata, prepareWrappedAccount, createAndEstimateTransaction, prepareTransaction, checkOrCreateAtaBatch, pk, unwrapExecutionParams } from '@streamflow/common/solana';
|
|
5
5
|
import { Program } from '@coral-xyz/anchor';
|
|
6
|
-
import * as
|
|
6
|
+
import * as borsh7 from '@coral-xyz/borsh';
|
|
7
7
|
import { Buffer as Buffer$1 } from 'buffer';
|
|
8
|
-
import
|
|
8
|
+
import BN5 from 'bn.js';
|
|
9
9
|
import { NATIVE_MINT, getTransferFeeConfig, ASSOCIATED_TOKEN_PROGRAM_ID, createTransferCheckedWithFeeInstruction, createTransferCheckedInstruction } from '@solana/spl-token';
|
|
10
10
|
import bs58 from 'bs58';
|
|
11
11
|
|
|
@@ -99,21 +99,21 @@ var PROGRAM_ID_CLI = new PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
|
|
|
99
99
|
var PROGRAM_ID = PROGRAM_ID_CLI;
|
|
100
100
|
|
|
101
101
|
// solana/generated/instructions/newDistributor.ts
|
|
102
|
-
var layout =
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
102
|
+
var layout = borsh7.struct([
|
|
103
|
+
borsh7.u64("version"),
|
|
104
|
+
borsh7.array(borsh7.u8(), 32, "root"),
|
|
105
|
+
borsh7.u64("maxTotalClaim"),
|
|
106
|
+
borsh7.u64("maxNumNodes"),
|
|
107
|
+
borsh7.u64("unlockPeriod"),
|
|
108
|
+
borsh7.u64("startVestingTs"),
|
|
109
|
+
borsh7.u64("endVestingTs"),
|
|
110
|
+
borsh7.u64("clawbackStartTs"),
|
|
111
|
+
borsh7.bool("claimsClosableByAdmin"),
|
|
112
|
+
borsh7.option(borsh7.bool(), "canUpdateDuration"),
|
|
113
|
+
borsh7.option(borsh7.u64(), "totalAmountUnlocked"),
|
|
114
|
+
borsh7.option(borsh7.u64(), "totalAmountLocked"),
|
|
115
|
+
borsh7.option(borsh7.bool(), "claimsClosableByClaimant"),
|
|
116
|
+
borsh7.option(borsh7.u16(), "claimsLimit")
|
|
117
117
|
]);
|
|
118
118
|
function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
119
119
|
const keys = [
|
|
@@ -155,10 +155,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
|
155
155
|
const ix = new TransactionInstruction({ keys, programId, data });
|
|
156
156
|
return ix;
|
|
157
157
|
}
|
|
158
|
-
var layout2 =
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
var layout2 = borsh7.struct([
|
|
159
|
+
borsh7.u64("amountUnlocked"),
|
|
160
|
+
borsh7.u64("amountLocked"),
|
|
161
|
+
borsh7.vec(borsh7.array(borsh7.u8(), 32), "proof")
|
|
162
162
|
]);
|
|
163
163
|
function newClaim(args, accounts, programId = PROGRAM_ID) {
|
|
164
164
|
const keys = [
|
|
@@ -219,10 +219,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
|
|
|
219
219
|
const ix = new TransactionInstruction({ keys, programId, data });
|
|
220
220
|
return ix;
|
|
221
221
|
}
|
|
222
|
-
var layout3 =
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
222
|
+
var layout3 = borsh7.struct([
|
|
223
|
+
borsh7.option(borsh7.u64(), "amountUnlocked"),
|
|
224
|
+
borsh7.option(borsh7.u64(), "amountLocked"),
|
|
225
|
+
borsh7.option(borsh7.vec(borsh7.array(borsh7.u8(), 32)), "proof")
|
|
226
226
|
]);
|
|
227
227
|
function closeClaim(args, accounts, programId = PROGRAM_ID) {
|
|
228
228
|
const keys = [
|
|
@@ -271,6 +271,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
|
|
|
271
271
|
return ix;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
// solana/descriptor/idl/merkle_distributor.json
|
|
275
|
+
var merkle_distributor_default = {
|
|
276
|
+
address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
277
|
+
metadata: {
|
|
278
|
+
name: "merkle_distributor",
|
|
279
|
+
version: "1.5.0",
|
|
280
|
+
spec: "0.1.0",
|
|
281
|
+
description: "A Solana program for distributing tokens according to a Merkle root.",
|
|
282
|
+
repository: "https://github.com/streamflow-finance/distributor"
|
|
283
|
+
},
|
|
284
|
+
instructions: [
|
|
285
|
+
{
|
|
286
|
+
name: "_expose_claim",
|
|
287
|
+
discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
|
|
288
|
+
accounts: [
|
|
289
|
+
{
|
|
290
|
+
name: "distributor",
|
|
291
|
+
docs: ["The [MerkleDistributor]."]
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
name: "claim_status",
|
|
295
|
+
docs: ["Claim Status PDA"],
|
|
296
|
+
optional: true,
|
|
297
|
+
pda: {
|
|
298
|
+
seeds: [
|
|
299
|
+
{
|
|
300
|
+
kind: "const",
|
|
301
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
kind: "account",
|
|
305
|
+
path: "claimant"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
kind: "account",
|
|
309
|
+
path: "distributor"
|
|
310
|
+
}
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
name: "compressed_claim_status",
|
|
316
|
+
docs: ["Compress Claim Status PDA"],
|
|
317
|
+
optional: true,
|
|
318
|
+
pda: {
|
|
319
|
+
seeds: [
|
|
320
|
+
{
|
|
321
|
+
kind: "const",
|
|
322
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
323
|
+
},
|
|
324
|
+
{
|
|
325
|
+
kind: "account",
|
|
326
|
+
path: "claimant"
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "account",
|
|
330
|
+
path: "distributor"
|
|
331
|
+
}
|
|
332
|
+
]
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
name: "claimant",
|
|
337
|
+
docs: ["Who is claiming the tokens."],
|
|
338
|
+
signer: true
|
|
339
|
+
}
|
|
340
|
+
],
|
|
341
|
+
args: []
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "claim_locked",
|
|
345
|
+
discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
|
|
346
|
+
accounts: [
|
|
347
|
+
{
|
|
348
|
+
name: "distributor",
|
|
349
|
+
docs: ["The [MerkleDistributor]."],
|
|
350
|
+
writable: true
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
name: "claim_status",
|
|
354
|
+
writable: true,
|
|
355
|
+
pda: {
|
|
356
|
+
seeds: [
|
|
357
|
+
{
|
|
358
|
+
kind: "const",
|
|
359
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
kind: "account",
|
|
363
|
+
path: "claimant"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
kind: "account",
|
|
367
|
+
path: "distributor"
|
|
368
|
+
}
|
|
369
|
+
]
|
|
370
|
+
}
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
name: "from",
|
|
374
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
375
|
+
writable: true,
|
|
376
|
+
pda: {
|
|
377
|
+
seeds: [
|
|
378
|
+
{
|
|
379
|
+
kind: "account",
|
|
380
|
+
path: "distributor"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
kind: "account",
|
|
384
|
+
path: "token_program"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
kind: "account",
|
|
388
|
+
path: "distributor.mint",
|
|
389
|
+
account: "MerkleDistributor"
|
|
390
|
+
}
|
|
391
|
+
],
|
|
392
|
+
program: {
|
|
393
|
+
kind: "const",
|
|
394
|
+
value: [
|
|
395
|
+
140,
|
|
396
|
+
151,
|
|
397
|
+
37,
|
|
398
|
+
143,
|
|
399
|
+
78,
|
|
400
|
+
36,
|
|
401
|
+
137,
|
|
402
|
+
241,
|
|
403
|
+
187,
|
|
404
|
+
61,
|
|
405
|
+
16,
|
|
406
|
+
41,
|
|
407
|
+
20,
|
|
408
|
+
142,
|
|
409
|
+
13,
|
|
410
|
+
131,
|
|
411
|
+
11,
|
|
412
|
+
90,
|
|
413
|
+
19,
|
|
414
|
+
153,
|
|
415
|
+
218,
|
|
416
|
+
255,
|
|
417
|
+
16,
|
|
418
|
+
132,
|
|
419
|
+
4,
|
|
420
|
+
142,
|
|
421
|
+
123,
|
|
422
|
+
216,
|
|
423
|
+
219,
|
|
424
|
+
233,
|
|
425
|
+
248,
|
|
426
|
+
89
|
|
427
|
+
]
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
name: "to",
|
|
433
|
+
docs: [
|
|
434
|
+
"Account to send the claimed tokens to.",
|
|
435
|
+
"Claimant must sign the transaction and can only claim on behalf of themself"
|
|
436
|
+
],
|
|
437
|
+
writable: true
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
name: "claimant",
|
|
441
|
+
docs: ["Who is claiming the tokens."],
|
|
442
|
+
writable: true,
|
|
443
|
+
signer: true
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
name: "mint",
|
|
447
|
+
docs: ["The mint to claim."],
|
|
448
|
+
relations: ["distributor"]
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
name: "token_program",
|
|
452
|
+
docs: ["SPL [Token] program."]
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
name: "event_authority",
|
|
456
|
+
pda: {
|
|
457
|
+
seeds: [
|
|
458
|
+
{
|
|
459
|
+
kind: "const",
|
|
460
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
461
|
+
}
|
|
462
|
+
]
|
|
463
|
+
}
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: "program"
|
|
467
|
+
}
|
|
468
|
+
],
|
|
469
|
+
args: []
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "clawback",
|
|
473
|
+
discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
|
|
474
|
+
accounts: [
|
|
475
|
+
{
|
|
476
|
+
name: "distributor",
|
|
477
|
+
docs: ["The [MerkleDistributor]."],
|
|
478
|
+
writable: true
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "from",
|
|
482
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
483
|
+
writable: true
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
name: "to",
|
|
487
|
+
docs: ["The Clawback token account."],
|
|
488
|
+
writable: true
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
name: "admin",
|
|
492
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
493
|
+
writable: true,
|
|
494
|
+
signer: true
|
|
495
|
+
},
|
|
496
|
+
{
|
|
497
|
+
name: "mint"
|
|
498
|
+
},
|
|
499
|
+
{
|
|
500
|
+
name: "system_program",
|
|
501
|
+
docs: ["The [System] program."],
|
|
502
|
+
address: "11111111111111111111111111111111"
|
|
503
|
+
},
|
|
504
|
+
{
|
|
505
|
+
name: "token_program",
|
|
506
|
+
docs: ["SPL [Token] program."]
|
|
507
|
+
}
|
|
508
|
+
],
|
|
509
|
+
args: []
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: "close_claim",
|
|
513
|
+
discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
|
|
514
|
+
accounts: [
|
|
515
|
+
{
|
|
516
|
+
name: "distributor",
|
|
517
|
+
docs: ["The [MerkleDistributor]."],
|
|
518
|
+
writable: true
|
|
519
|
+
},
|
|
520
|
+
{
|
|
521
|
+
name: "admin_or_claimant",
|
|
522
|
+
docs: ["Admin signer"],
|
|
523
|
+
writable: true,
|
|
524
|
+
signer: true
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
name: "claimant",
|
|
528
|
+
writable: true
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: "claim_status",
|
|
532
|
+
writable: true,
|
|
533
|
+
pda: {
|
|
534
|
+
seeds: [
|
|
535
|
+
{
|
|
536
|
+
kind: "const",
|
|
537
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
kind: "account",
|
|
541
|
+
path: "claimant"
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
kind: "account",
|
|
545
|
+
path: "distributor"
|
|
546
|
+
}
|
|
547
|
+
]
|
|
548
|
+
}
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
name: "system_program",
|
|
552
|
+
docs: ["The [System] program."],
|
|
553
|
+
address: "11111111111111111111111111111111"
|
|
554
|
+
},
|
|
555
|
+
{
|
|
556
|
+
name: "event_authority",
|
|
557
|
+
pda: {
|
|
558
|
+
seeds: [
|
|
559
|
+
{
|
|
560
|
+
kind: "const",
|
|
561
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
562
|
+
}
|
|
563
|
+
]
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: "program"
|
|
568
|
+
}
|
|
569
|
+
],
|
|
570
|
+
args: [
|
|
571
|
+
{
|
|
572
|
+
name: "amount_unlocked",
|
|
573
|
+
type: {
|
|
574
|
+
option: "u64"
|
|
575
|
+
}
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
name: "amount_locked",
|
|
579
|
+
type: {
|
|
580
|
+
option: "u64"
|
|
581
|
+
}
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "proof",
|
|
585
|
+
type: {
|
|
586
|
+
option: {
|
|
587
|
+
vec: {
|
|
588
|
+
array: ["u8", 32]
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
]
|
|
594
|
+
},
|
|
595
|
+
{
|
|
596
|
+
name: "compress_claim",
|
|
597
|
+
discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
|
|
598
|
+
accounts: [
|
|
599
|
+
{
|
|
600
|
+
name: "distributor",
|
|
601
|
+
docs: ["The [MerkleDistributor]."],
|
|
602
|
+
writable: true
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
name: "claim_status",
|
|
606
|
+
writable: true,
|
|
607
|
+
pda: {
|
|
608
|
+
seeds: [
|
|
609
|
+
{
|
|
610
|
+
kind: "const",
|
|
611
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
kind: "account",
|
|
615
|
+
path: "claimant"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
kind: "account",
|
|
619
|
+
path: "distributor"
|
|
620
|
+
}
|
|
621
|
+
]
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
name: "signer",
|
|
626
|
+
docs: ["Signer account"],
|
|
627
|
+
writable: true,
|
|
628
|
+
signer: true
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
name: "claimant"
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
name: "system_program",
|
|
635
|
+
docs: ["The [System] program."],
|
|
636
|
+
address: "11111111111111111111111111111111"
|
|
637
|
+
}
|
|
638
|
+
],
|
|
639
|
+
args: []
|
|
640
|
+
},
|
|
641
|
+
{
|
|
642
|
+
name: "new_claim",
|
|
643
|
+
discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
|
|
644
|
+
accounts: [
|
|
645
|
+
{
|
|
646
|
+
name: "distributor",
|
|
647
|
+
docs: ["The [MerkleDistributor]."],
|
|
648
|
+
writable: true
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "claim_status",
|
|
652
|
+
writable: true,
|
|
653
|
+
pda: {
|
|
654
|
+
seeds: [
|
|
655
|
+
{
|
|
656
|
+
kind: "const",
|
|
657
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
kind: "account",
|
|
661
|
+
path: "claimant"
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
kind: "account",
|
|
665
|
+
path: "distributor"
|
|
666
|
+
}
|
|
667
|
+
]
|
|
668
|
+
}
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
name: "from",
|
|
672
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
673
|
+
writable: true,
|
|
674
|
+
pda: {
|
|
675
|
+
seeds: [
|
|
676
|
+
{
|
|
677
|
+
kind: "account",
|
|
678
|
+
path: "distributor"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
kind: "account",
|
|
682
|
+
path: "token_program"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
kind: "account",
|
|
686
|
+
path: "distributor.mint",
|
|
687
|
+
account: "MerkleDistributor"
|
|
688
|
+
}
|
|
689
|
+
],
|
|
690
|
+
program: {
|
|
691
|
+
kind: "const",
|
|
692
|
+
value: [
|
|
693
|
+
140,
|
|
694
|
+
151,
|
|
695
|
+
37,
|
|
696
|
+
143,
|
|
697
|
+
78,
|
|
698
|
+
36,
|
|
699
|
+
137,
|
|
700
|
+
241,
|
|
701
|
+
187,
|
|
702
|
+
61,
|
|
703
|
+
16,
|
|
704
|
+
41,
|
|
705
|
+
20,
|
|
706
|
+
142,
|
|
707
|
+
13,
|
|
708
|
+
131,
|
|
709
|
+
11,
|
|
710
|
+
90,
|
|
711
|
+
19,
|
|
712
|
+
153,
|
|
713
|
+
218,
|
|
714
|
+
255,
|
|
715
|
+
16,
|
|
716
|
+
132,
|
|
717
|
+
4,
|
|
718
|
+
142,
|
|
719
|
+
123,
|
|
720
|
+
216,
|
|
721
|
+
219,
|
|
722
|
+
233,
|
|
723
|
+
248,
|
|
724
|
+
89
|
|
725
|
+
]
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: "to",
|
|
731
|
+
docs: ["Account to send the claimed tokens to."],
|
|
732
|
+
writable: true
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
name: "claimant",
|
|
736
|
+
docs: ["Who is claiming the tokens."],
|
|
737
|
+
writable: true,
|
|
738
|
+
signer: true
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
name: "mint",
|
|
742
|
+
docs: ["The mint to claim."],
|
|
743
|
+
relations: ["distributor"]
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
name: "token_program",
|
|
747
|
+
docs: ["SPL [Token] program."]
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "system_program",
|
|
751
|
+
docs: ["The [System] program."],
|
|
752
|
+
address: "11111111111111111111111111111111"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
name: "event_authority",
|
|
756
|
+
pda: {
|
|
757
|
+
seeds: [
|
|
758
|
+
{
|
|
759
|
+
kind: "const",
|
|
760
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
761
|
+
}
|
|
762
|
+
]
|
|
763
|
+
}
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
name: "program"
|
|
767
|
+
}
|
|
768
|
+
],
|
|
769
|
+
args: [
|
|
770
|
+
{
|
|
771
|
+
name: "amount_unlocked",
|
|
772
|
+
type: "u64"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
name: "amount_locked",
|
|
776
|
+
type: "u64"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
name: "proof",
|
|
780
|
+
type: {
|
|
781
|
+
vec: {
|
|
782
|
+
array: ["u8", 32]
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
name: "new_distributor",
|
|
790
|
+
docs: [
|
|
791
|
+
"READ THE FOLLOWING:",
|
|
792
|
+
"",
|
|
793
|
+
"This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
|
|
794
|
+
"",
|
|
795
|
+
"An attack could look like:",
|
|
796
|
+
"- A legitimate user opens a new distributor.",
|
|
797
|
+
"- Someone observes the call to this instruction.",
|
|
798
|
+
"- They replace the clawback_receiver, admin, or time parameters with their own.",
|
|
799
|
+
"",
|
|
800
|
+
"One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
|
|
801
|
+
"and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
|
|
802
|
+
"the attacker can steal all funds from the distributor to their own clawback_receiver account.",
|
|
803
|
+
"",
|
|
804
|
+
"HOW TO AVOID:",
|
|
805
|
+
"- When you call into this instruction, ensure your transaction succeeds.",
|
|
806
|
+
"- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
|
|
807
|
+
"assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
|
|
808
|
+
"- If your transaction fails, double check the value on-chain matches what you expect."
|
|
809
|
+
],
|
|
810
|
+
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
811
|
+
accounts: [
|
|
812
|
+
{
|
|
813
|
+
name: "distributor",
|
|
814
|
+
docs: ["[MerkleDistributor]."],
|
|
815
|
+
writable: true,
|
|
816
|
+
pda: {
|
|
817
|
+
seeds: [
|
|
818
|
+
{
|
|
819
|
+
kind: "const",
|
|
820
|
+
value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
|
|
821
|
+
},
|
|
822
|
+
{
|
|
823
|
+
kind: "account",
|
|
824
|
+
path: "mint"
|
|
825
|
+
},
|
|
826
|
+
{
|
|
827
|
+
kind: "arg",
|
|
828
|
+
path: "version"
|
|
829
|
+
}
|
|
830
|
+
]
|
|
831
|
+
}
|
|
832
|
+
},
|
|
833
|
+
{
|
|
834
|
+
name: "clawback_receiver",
|
|
835
|
+
docs: ["Clawback receiver token account"],
|
|
836
|
+
writable: true
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
name: "mint",
|
|
840
|
+
docs: ["The mint to distribute."]
|
|
841
|
+
},
|
|
842
|
+
{
|
|
843
|
+
name: "token_vault",
|
|
844
|
+
docs: ["Token vault"],
|
|
845
|
+
writable: true,
|
|
846
|
+
pda: {
|
|
847
|
+
seeds: [
|
|
848
|
+
{
|
|
849
|
+
kind: "account",
|
|
850
|
+
path: "distributor"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
kind: "account",
|
|
854
|
+
path: "token_program"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
kind: "account",
|
|
858
|
+
path: "mint"
|
|
859
|
+
}
|
|
860
|
+
],
|
|
861
|
+
program: {
|
|
862
|
+
kind: "const",
|
|
863
|
+
value: [
|
|
864
|
+
140,
|
|
865
|
+
151,
|
|
866
|
+
37,
|
|
867
|
+
143,
|
|
868
|
+
78,
|
|
869
|
+
36,
|
|
870
|
+
137,
|
|
871
|
+
241,
|
|
872
|
+
187,
|
|
873
|
+
61,
|
|
874
|
+
16,
|
|
875
|
+
41,
|
|
876
|
+
20,
|
|
877
|
+
142,
|
|
878
|
+
13,
|
|
879
|
+
131,
|
|
880
|
+
11,
|
|
881
|
+
90,
|
|
882
|
+
19,
|
|
883
|
+
153,
|
|
884
|
+
218,
|
|
885
|
+
255,
|
|
886
|
+
16,
|
|
887
|
+
132,
|
|
888
|
+
4,
|
|
889
|
+
142,
|
|
890
|
+
123,
|
|
891
|
+
216,
|
|
892
|
+
219,
|
|
893
|
+
233,
|
|
894
|
+
248,
|
|
895
|
+
89
|
|
896
|
+
]
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
},
|
|
900
|
+
{
|
|
901
|
+
name: "admin",
|
|
902
|
+
docs: [
|
|
903
|
+
"Admin wallet, responsible for creating the distributor and paying for the transaction.",
|
|
904
|
+
"Also has the authority to set the clawback receiver and change itself."
|
|
905
|
+
],
|
|
906
|
+
writable: true,
|
|
907
|
+
signer: true
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
name: "system_program",
|
|
911
|
+
docs: ["The [System] program."],
|
|
912
|
+
address: "11111111111111111111111111111111"
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
name: "associated_token_program",
|
|
916
|
+
docs: ["The [Associated Token] program."],
|
|
917
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
918
|
+
},
|
|
919
|
+
{
|
|
920
|
+
name: "token_program",
|
|
921
|
+
docs: ["The [Token] program."]
|
|
922
|
+
}
|
|
923
|
+
],
|
|
924
|
+
args: [
|
|
925
|
+
{
|
|
926
|
+
name: "version",
|
|
927
|
+
type: "u64"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
name: "root",
|
|
931
|
+
type: {
|
|
932
|
+
array: ["u8", 32]
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
name: "max_total_claim",
|
|
937
|
+
type: "u64"
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
name: "max_num_nodes",
|
|
941
|
+
type: "u64"
|
|
942
|
+
},
|
|
943
|
+
{
|
|
944
|
+
name: "unlock_period",
|
|
945
|
+
type: "u64"
|
|
946
|
+
},
|
|
947
|
+
{
|
|
948
|
+
name: "start_vesting_ts",
|
|
949
|
+
type: "u64"
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
name: "end_vesting_ts",
|
|
953
|
+
type: "u64"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
name: "clawback_start_ts",
|
|
957
|
+
type: "u64"
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
name: "claims_closable_by_admin",
|
|
961
|
+
type: "bool"
|
|
962
|
+
},
|
|
963
|
+
{
|
|
964
|
+
name: "can_update_duration",
|
|
965
|
+
type: {
|
|
966
|
+
option: "bool"
|
|
967
|
+
}
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
name: "total_amount_unlocked",
|
|
971
|
+
type: {
|
|
972
|
+
option: "u64"
|
|
973
|
+
}
|
|
974
|
+
},
|
|
975
|
+
{
|
|
976
|
+
name: "total_amount_locked",
|
|
977
|
+
type: {
|
|
978
|
+
option: "u64"
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
name: "claims_closable_by_claimant",
|
|
983
|
+
type: {
|
|
984
|
+
option: "bool"
|
|
985
|
+
}
|
|
986
|
+
},
|
|
987
|
+
{
|
|
988
|
+
name: "claims_limit",
|
|
989
|
+
type: {
|
|
990
|
+
option: "u16"
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
]
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
name: "refund_claim",
|
|
997
|
+
discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
|
|
998
|
+
accounts: [
|
|
999
|
+
{
|
|
1000
|
+
name: "distributor",
|
|
1001
|
+
docs: ["The [MerkleDistributor]."],
|
|
1002
|
+
writable: true
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
name: "claim_status",
|
|
1006
|
+
writable: true,
|
|
1007
|
+
pda: {
|
|
1008
|
+
seeds: [
|
|
1009
|
+
{
|
|
1010
|
+
kind: "const",
|
|
1011
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
kind: "account",
|
|
1015
|
+
path: "claimant"
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
kind: "account",
|
|
1019
|
+
path: "distributor"
|
|
1020
|
+
}
|
|
1021
|
+
]
|
|
1022
|
+
}
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
name: "signer",
|
|
1026
|
+
docs: ["Signer account"],
|
|
1027
|
+
writable: true,
|
|
1028
|
+
signer: true
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
name: "claimant"
|
|
1032
|
+
},
|
|
1033
|
+
{
|
|
1034
|
+
name: "streamflow_treasury",
|
|
1035
|
+
writable: true,
|
|
1036
|
+
address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: "system_program",
|
|
1040
|
+
docs: ["The [System] program."],
|
|
1041
|
+
address: "11111111111111111111111111111111"
|
|
1042
|
+
}
|
|
1043
|
+
],
|
|
1044
|
+
args: []
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: "set_admin",
|
|
1048
|
+
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
1049
|
+
accounts: [
|
|
1050
|
+
{
|
|
1051
|
+
name: "distributor",
|
|
1052
|
+
docs: ["The [MerkleDistributor]."],
|
|
1053
|
+
writable: true
|
|
1054
|
+
},
|
|
1055
|
+
{
|
|
1056
|
+
name: "admin",
|
|
1057
|
+
docs: ["Admin signer"],
|
|
1058
|
+
writable: true,
|
|
1059
|
+
signer: true
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
name: "new_admin",
|
|
1063
|
+
docs: ["New admin account"],
|
|
1064
|
+
writable: true
|
|
1065
|
+
}
|
|
1066
|
+
],
|
|
1067
|
+
args: []
|
|
1068
|
+
},
|
|
1069
|
+
{
|
|
1070
|
+
name: "set_clawback_receiver",
|
|
1071
|
+
discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
|
|
1072
|
+
accounts: [
|
|
1073
|
+
{
|
|
1074
|
+
name: "distributor",
|
|
1075
|
+
docs: ["The [MerkleDistributor]."],
|
|
1076
|
+
writable: true
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
name: "new_clawback_account",
|
|
1080
|
+
docs: ["New clawback account"]
|
|
1081
|
+
},
|
|
1082
|
+
{
|
|
1083
|
+
name: "admin",
|
|
1084
|
+
docs: ["Admin signer"],
|
|
1085
|
+
writable: true,
|
|
1086
|
+
signer: true
|
|
1087
|
+
}
|
|
1088
|
+
],
|
|
1089
|
+
args: []
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: "update",
|
|
1093
|
+
discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
|
|
1094
|
+
accounts: [
|
|
1095
|
+
{
|
|
1096
|
+
name: "distributor",
|
|
1097
|
+
docs: ["The [MerkleDistributor]."],
|
|
1098
|
+
writable: true
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
name: "admin",
|
|
1102
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
1103
|
+
writable: true,
|
|
1104
|
+
signer: true
|
|
1105
|
+
},
|
|
1106
|
+
{
|
|
1107
|
+
name: "system_program",
|
|
1108
|
+
docs: ["The [System] program."],
|
|
1109
|
+
address: "11111111111111111111111111111111"
|
|
1110
|
+
}
|
|
1111
|
+
],
|
|
1112
|
+
args: [
|
|
1113
|
+
{
|
|
1114
|
+
name: "end_ts",
|
|
1115
|
+
type: {
|
|
1116
|
+
option: "u64"
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
]
|
|
1120
|
+
}
|
|
1121
|
+
],
|
|
1122
|
+
accounts: [
|
|
1123
|
+
{
|
|
1124
|
+
name: "ClaimStatus",
|
|
1125
|
+
discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
|
|
1126
|
+
},
|
|
1127
|
+
{
|
|
1128
|
+
name: "CompressedClaimStatus",
|
|
1129
|
+
discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
name: "MerkleDistributor",
|
|
1133
|
+
discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
|
|
1134
|
+
}
|
|
1135
|
+
],
|
|
1136
|
+
events: [
|
|
1137
|
+
{
|
|
1138
|
+
name: "ClaimClosedEvent",
|
|
1139
|
+
discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
|
|
1140
|
+
},
|
|
1141
|
+
{
|
|
1142
|
+
name: "ClaimedEvent",
|
|
1143
|
+
discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
|
|
1144
|
+
},
|
|
1145
|
+
{
|
|
1146
|
+
name: "NewClaimEvent",
|
|
1147
|
+
discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
|
|
1148
|
+
}
|
|
1149
|
+
],
|
|
1150
|
+
errors: [
|
|
1151
|
+
{
|
|
1152
|
+
code: 6e3,
|
|
1153
|
+
name: "InsufficientUnlockedTokens",
|
|
1154
|
+
msg: "Insufficient unlocked tokens"
|
|
1155
|
+
},
|
|
1156
|
+
{
|
|
1157
|
+
code: 6001,
|
|
1158
|
+
name: "InvalidProof",
|
|
1159
|
+
msg: "Invalid Merkle proof"
|
|
1160
|
+
},
|
|
1161
|
+
{
|
|
1162
|
+
code: 6002,
|
|
1163
|
+
name: "ExceededMaxClaim",
|
|
1164
|
+
msg: "Exceeded maximum claim amount"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
code: 6003,
|
|
1168
|
+
name: "MaxNodesExceeded",
|
|
1169
|
+
msg: "Exceeded maximum node count"
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
code: 6004,
|
|
1173
|
+
name: "Unauthorized",
|
|
1174
|
+
msg: "Account is not authorized to execute this instruction"
|
|
1175
|
+
},
|
|
1176
|
+
{
|
|
1177
|
+
code: 6005,
|
|
1178
|
+
name: "OwnerMismatch",
|
|
1179
|
+
msg: "Token account owner did not match intended owner"
|
|
1180
|
+
},
|
|
1181
|
+
{
|
|
1182
|
+
code: 6006,
|
|
1183
|
+
name: "ClawbackBeforeStart",
|
|
1184
|
+
msg: "Attempted clawback before start"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
code: 6007,
|
|
1188
|
+
name: "ClawbackAlreadyClaimed",
|
|
1189
|
+
msg: "Clawback already claimed"
|
|
1190
|
+
},
|
|
1191
|
+
{
|
|
1192
|
+
code: 6008,
|
|
1193
|
+
name: "SameClawbackReceiver",
|
|
1194
|
+
msg: "New and old Clawback receivers are identical"
|
|
1195
|
+
},
|
|
1196
|
+
{
|
|
1197
|
+
code: 6009,
|
|
1198
|
+
name: "ClawbackReceiverIsTokenVault",
|
|
1199
|
+
msg: "Clawback receiver can not be the Token Vault"
|
|
1200
|
+
},
|
|
1201
|
+
{
|
|
1202
|
+
code: 6010,
|
|
1203
|
+
name: "SameAdmin",
|
|
1204
|
+
msg: "New and old admin are identical"
|
|
1205
|
+
},
|
|
1206
|
+
{
|
|
1207
|
+
code: 6011,
|
|
1208
|
+
name: "ClaimExpired",
|
|
1209
|
+
msg: "Claim window expired"
|
|
1210
|
+
},
|
|
1211
|
+
{
|
|
1212
|
+
code: 6012,
|
|
1213
|
+
name: "ArithmeticError",
|
|
1214
|
+
msg: "Arithmetic Error (overflow/underflow)"
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
code: 6013,
|
|
1218
|
+
name: "StartTimestampAfterEnd",
|
|
1219
|
+
msg: "Start Timestamp cannot be after end Timestamp"
|
|
1220
|
+
},
|
|
1221
|
+
{
|
|
1222
|
+
code: 6014,
|
|
1223
|
+
name: "TimestampsNotInFuture",
|
|
1224
|
+
msg: "Timestamps cannot be in the past"
|
|
1225
|
+
},
|
|
1226
|
+
{
|
|
1227
|
+
code: 6015,
|
|
1228
|
+
name: "InvalidMint",
|
|
1229
|
+
msg: "Invalid Mint"
|
|
1230
|
+
},
|
|
1231
|
+
{
|
|
1232
|
+
code: 6016,
|
|
1233
|
+
name: "ClaimIsClosed",
|
|
1234
|
+
msg: "Claim is closed"
|
|
1235
|
+
},
|
|
1236
|
+
{
|
|
1237
|
+
code: 6017,
|
|
1238
|
+
name: "ClaimsAreNotClosable",
|
|
1239
|
+
msg: "Claims are not closable"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
code: 6018,
|
|
1243
|
+
name: "InvalidUnlockPeriod",
|
|
1244
|
+
msg: "Invalid unlock period"
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
code: 6019,
|
|
1248
|
+
name: "DurationUpdateNotAllowed",
|
|
1249
|
+
msg: "Duration update is not allowed"
|
|
1250
|
+
},
|
|
1251
|
+
{
|
|
1252
|
+
code: 6020,
|
|
1253
|
+
name: "NoVestingAmount",
|
|
1254
|
+
msg: "Vesting amounts are not set"
|
|
1255
|
+
},
|
|
1256
|
+
{
|
|
1257
|
+
code: 6021,
|
|
1258
|
+
name: "VestingAlreadyFinished",
|
|
1259
|
+
msg: "Vesting already finished"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
code: 6022,
|
|
1263
|
+
name: "InvalidAmounts",
|
|
1264
|
+
msg: "Provided amounts are invalid"
|
|
1265
|
+
},
|
|
1266
|
+
{
|
|
1267
|
+
code: 6023,
|
|
1268
|
+
name: "ClaimsLimitReached",
|
|
1269
|
+
msg: "Claims limit has been reached"
|
|
1270
|
+
}
|
|
1271
|
+
],
|
|
1272
|
+
types: [
|
|
1273
|
+
{
|
|
1274
|
+
name: "ClaimClosedEvent",
|
|
1275
|
+
docs: ["Emitted when a new claim is created."],
|
|
1276
|
+
type: {
|
|
1277
|
+
kind: "struct",
|
|
1278
|
+
fields: [
|
|
1279
|
+
{
|
|
1280
|
+
name: "claimant",
|
|
1281
|
+
docs: ["User that claimed."],
|
|
1282
|
+
type: "pubkey"
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
name: "timestamp",
|
|
1286
|
+
docs: ["Timestamp."],
|
|
1287
|
+
type: "u64"
|
|
1288
|
+
}
|
|
1289
|
+
]
|
|
1290
|
+
}
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
name: "ClaimStatus",
|
|
1294
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1295
|
+
type: {
|
|
1296
|
+
kind: "struct",
|
|
1297
|
+
fields: [
|
|
1298
|
+
{
|
|
1299
|
+
name: "claimant",
|
|
1300
|
+
docs: ["Authority that claimed the tokens."],
|
|
1301
|
+
type: "pubkey"
|
|
1302
|
+
},
|
|
1303
|
+
{
|
|
1304
|
+
name: "locked_amount",
|
|
1305
|
+
docs: ["Locked amount"],
|
|
1306
|
+
type: "u64"
|
|
1307
|
+
},
|
|
1308
|
+
{
|
|
1309
|
+
name: "locked_amount_withdrawn",
|
|
1310
|
+
docs: ["Locked amount withdrawn"],
|
|
1311
|
+
type: "u64"
|
|
1312
|
+
},
|
|
1313
|
+
{
|
|
1314
|
+
name: "unlocked_amount",
|
|
1315
|
+
docs: ["Unlocked amount"],
|
|
1316
|
+
type: "u64"
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
name: "last_claim_ts",
|
|
1320
|
+
docs: ["Last claim time"],
|
|
1321
|
+
type: "u64"
|
|
1322
|
+
},
|
|
1323
|
+
{
|
|
1324
|
+
name: "last_amount_per_unlock",
|
|
1325
|
+
docs: ["Track amount per unlock, can be useful for non-linear vesting"],
|
|
1326
|
+
type: "u64"
|
|
1327
|
+
},
|
|
1328
|
+
{
|
|
1329
|
+
name: "closed",
|
|
1330
|
+
docs: ["Whether claim is closed"],
|
|
1331
|
+
type: "bool"
|
|
1332
|
+
},
|
|
1333
|
+
{
|
|
1334
|
+
name: "distributor",
|
|
1335
|
+
docs: [
|
|
1336
|
+
"Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
|
|
1337
|
+
],
|
|
1338
|
+
type: "pubkey"
|
|
1339
|
+
},
|
|
1340
|
+
{
|
|
1341
|
+
name: "claims_count",
|
|
1342
|
+
docs: ["Number of time amount has been claimed"],
|
|
1343
|
+
type: "u16"
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
name: "closed_ts",
|
|
1347
|
+
docs: ["Time when claim has been closed"],
|
|
1348
|
+
type: "u64"
|
|
1349
|
+
},
|
|
1350
|
+
{
|
|
1351
|
+
name: "buffer_2",
|
|
1352
|
+
docs: ["Buffer for additional fields"],
|
|
1353
|
+
type: {
|
|
1354
|
+
array: ["u8", 22]
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
]
|
|
1358
|
+
}
|
|
1359
|
+
},
|
|
1360
|
+
{
|
|
1361
|
+
name: "ClaimedEvent",
|
|
1362
|
+
docs: ["Emitted when tokens are claimed."],
|
|
1363
|
+
type: {
|
|
1364
|
+
kind: "struct",
|
|
1365
|
+
fields: [
|
|
1366
|
+
{
|
|
1367
|
+
name: "claimant",
|
|
1368
|
+
docs: ["User that claimed."],
|
|
1369
|
+
type: "pubkey"
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
name: "amount",
|
|
1373
|
+
docs: ["Amount of tokens to distribute."],
|
|
1374
|
+
type: "u64"
|
|
1375
|
+
}
|
|
1376
|
+
]
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
{
|
|
1380
|
+
name: "CompressedClaimStatus",
|
|
1381
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1382
|
+
type: {
|
|
1383
|
+
kind: "struct",
|
|
1384
|
+
fields: [
|
|
1385
|
+
{
|
|
1386
|
+
name: "state",
|
|
1387
|
+
type: {
|
|
1388
|
+
defined: {
|
|
1389
|
+
name: "State"
|
|
1390
|
+
}
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
]
|
|
1394
|
+
}
|
|
1395
|
+
},
|
|
1396
|
+
{
|
|
1397
|
+
name: "MerkleDistributor",
|
|
1398
|
+
docs: ["State for the account which distributes tokens."],
|
|
1399
|
+
type: {
|
|
1400
|
+
kind: "struct",
|
|
1401
|
+
fields: [
|
|
1402
|
+
{
|
|
1403
|
+
name: "bump",
|
|
1404
|
+
docs: ["Bump seed."],
|
|
1405
|
+
type: "u8"
|
|
1406
|
+
},
|
|
1407
|
+
{
|
|
1408
|
+
name: "version",
|
|
1409
|
+
docs: ["Version of the airdrop"],
|
|
1410
|
+
type: "u64"
|
|
1411
|
+
},
|
|
1412
|
+
{
|
|
1413
|
+
name: "root",
|
|
1414
|
+
docs: ["The 256-bit merkle root."],
|
|
1415
|
+
type: {
|
|
1416
|
+
array: ["u8", 32]
|
|
1417
|
+
}
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
name: "mint",
|
|
1421
|
+
docs: ["[Mint] of the token to be distributed."],
|
|
1422
|
+
type: "pubkey"
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: "token_vault",
|
|
1426
|
+
docs: ["Token Address of the vault"],
|
|
1427
|
+
type: "pubkey"
|
|
1428
|
+
},
|
|
1429
|
+
{
|
|
1430
|
+
name: "max_total_claim",
|
|
1431
|
+
docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
|
|
1432
|
+
type: "u64"
|
|
1433
|
+
},
|
|
1434
|
+
{
|
|
1435
|
+
name: "max_num_nodes",
|
|
1436
|
+
docs: ["Maximum number of nodes in [MerkleDistributor]."],
|
|
1437
|
+
type: "u64"
|
|
1438
|
+
},
|
|
1439
|
+
{
|
|
1440
|
+
name: "unlock_period",
|
|
1441
|
+
docs: ["Time step (period) in seconds per which the unlock occurs"],
|
|
1442
|
+
type: "u64"
|
|
1443
|
+
},
|
|
1444
|
+
{
|
|
1445
|
+
name: "total_amount_claimed",
|
|
1446
|
+
docs: ["Total amount of tokens that have been claimed."],
|
|
1447
|
+
type: "u64"
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
name: "num_nodes_claimed",
|
|
1451
|
+
docs: ["Number of nodes that have been claimed."],
|
|
1452
|
+
type: "u64"
|
|
1453
|
+
},
|
|
1454
|
+
{
|
|
1455
|
+
name: "start_ts",
|
|
1456
|
+
docs: ["Lockup time start (Unix Timestamp)"],
|
|
1457
|
+
type: "u64"
|
|
1458
|
+
},
|
|
1459
|
+
{
|
|
1460
|
+
name: "end_ts",
|
|
1461
|
+
docs: ["Lockup time end (Unix Timestamp)"],
|
|
1462
|
+
type: "u64"
|
|
1463
|
+
},
|
|
1464
|
+
{
|
|
1465
|
+
name: "clawback_start_ts",
|
|
1466
|
+
docs: ["Clawback start (Unix Timestamp)"],
|
|
1467
|
+
type: "u64"
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
name: "clawback_receiver",
|
|
1471
|
+
docs: ["Clawback receiver"],
|
|
1472
|
+
type: "pubkey"
|
|
1473
|
+
},
|
|
1474
|
+
{
|
|
1475
|
+
name: "admin",
|
|
1476
|
+
docs: ["Admin wallet"],
|
|
1477
|
+
type: "pubkey"
|
|
1478
|
+
},
|
|
1479
|
+
{
|
|
1480
|
+
name: "clawed_back",
|
|
1481
|
+
docs: ["Whether or not the distributor has been clawed back"],
|
|
1482
|
+
type: "bool"
|
|
1483
|
+
},
|
|
1484
|
+
{
|
|
1485
|
+
name: "claims_closable_by_admin",
|
|
1486
|
+
docs: ["Whether claims are closable by the admin or not"],
|
|
1487
|
+
type: "bool"
|
|
1488
|
+
},
|
|
1489
|
+
{
|
|
1490
|
+
name: "can_update_duration",
|
|
1491
|
+
docs: ["Whether admin can update vesting duration"],
|
|
1492
|
+
type: "bool"
|
|
1493
|
+
},
|
|
1494
|
+
{
|
|
1495
|
+
name: "total_amount_unlocked",
|
|
1496
|
+
docs: ["Total amount of funds unlocked (cliff/instant)"],
|
|
1497
|
+
type: "u64"
|
|
1498
|
+
},
|
|
1499
|
+
{
|
|
1500
|
+
name: "total_amount_locked",
|
|
1501
|
+
docs: ["Total amount of funds locked (vested)"],
|
|
1502
|
+
type: "u64"
|
|
1503
|
+
},
|
|
1504
|
+
{
|
|
1505
|
+
name: "last_duration_update_ts",
|
|
1506
|
+
docs: ["Timestamp when update was last called"],
|
|
1507
|
+
type: "u64"
|
|
1508
|
+
},
|
|
1509
|
+
{
|
|
1510
|
+
name: "total_claimable_pre_update",
|
|
1511
|
+
docs: [
|
|
1512
|
+
"Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
|
|
1513
|
+
],
|
|
1514
|
+
type: "u64"
|
|
1515
|
+
},
|
|
1516
|
+
{
|
|
1517
|
+
name: "clawed_back_ts",
|
|
1518
|
+
docs: ["Timestamp when funds were clawed back"],
|
|
1519
|
+
type: "u64"
|
|
1520
|
+
},
|
|
1521
|
+
{
|
|
1522
|
+
name: "claims_closable_by_claimant",
|
|
1523
|
+
docs: ["Whether claims are closable by claimant or not"],
|
|
1524
|
+
type: "bool"
|
|
1525
|
+
},
|
|
1526
|
+
{
|
|
1527
|
+
name: "claims_limit",
|
|
1528
|
+
docs: ["Limit number of claims"],
|
|
1529
|
+
type: "u16"
|
|
1530
|
+
},
|
|
1531
|
+
{
|
|
1532
|
+
name: "buffer_2",
|
|
1533
|
+
docs: ["Buffer for additional fields"],
|
|
1534
|
+
type: {
|
|
1535
|
+
array: ["u8", 20]
|
|
1536
|
+
}
|
|
1537
|
+
},
|
|
1538
|
+
{
|
|
1539
|
+
name: "buffer_3",
|
|
1540
|
+
docs: ["Buffer for additional fields"],
|
|
1541
|
+
type: {
|
|
1542
|
+
array: ["u8", 32]
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
]
|
|
1546
|
+
}
|
|
1547
|
+
},
|
|
1548
|
+
{
|
|
1549
|
+
name: "NewClaimEvent",
|
|
1550
|
+
docs: ["Emitted when a new claim is created."],
|
|
1551
|
+
type: {
|
|
1552
|
+
kind: "struct",
|
|
1553
|
+
fields: [
|
|
1554
|
+
{
|
|
1555
|
+
name: "claimant",
|
|
1556
|
+
docs: ["User that claimed."],
|
|
1557
|
+
type: "pubkey"
|
|
1558
|
+
},
|
|
1559
|
+
{
|
|
1560
|
+
name: "timestamp",
|
|
1561
|
+
docs: ["Timestamp."],
|
|
1562
|
+
type: "u64"
|
|
1563
|
+
}
|
|
1564
|
+
]
|
|
1565
|
+
}
|
|
1566
|
+
},
|
|
1567
|
+
{
|
|
1568
|
+
name: "State",
|
|
1569
|
+
type: {
|
|
1570
|
+
kind: "enum",
|
|
1571
|
+
variants: [
|
|
1572
|
+
{
|
|
1573
|
+
name: "Claimed"
|
|
1574
|
+
},
|
|
1575
|
+
{
|
|
1576
|
+
name: "Closed"
|
|
1577
|
+
}
|
|
1578
|
+
]
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
]
|
|
1582
|
+
};
|
|
1583
|
+
|
|
274
1584
|
// solana/constants.ts
|
|
275
1585
|
var constants_exports = {};
|
|
276
1586
|
__export(constants_exports, {
|
|
@@ -311,107 +1621,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
|
|
|
311
1621
|
[ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
312
1622
|
[ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
|
|
313
1623
|
};
|
|
314
|
-
var _ClaimStatus = class _ClaimStatus {
|
|
315
|
-
constructor(fields) {
|
|
316
|
-
this.claimant = fields.claimant;
|
|
317
|
-
this.lockedAmount = fields.lockedAmount;
|
|
318
|
-
this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
|
|
319
|
-
this.unlockedAmount = fields.unlockedAmount;
|
|
320
|
-
this.lastClaimTs = fields.lastClaimTs;
|
|
321
|
-
this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
|
|
322
|
-
this.closed = fields.closed;
|
|
323
|
-
this.distributor = fields.distributor;
|
|
324
|
-
this.claimsCount = fields.claimsCount;
|
|
325
|
-
this.closedTs = fields.closedTs;
|
|
326
|
-
this.buffer2 = fields.buffer2;
|
|
327
|
-
}
|
|
328
|
-
static async fetch(c, address, programId = PROGRAM_ID) {
|
|
329
|
-
const info = await c.getAccountInfo(address);
|
|
330
|
-
if (info === null) {
|
|
331
|
-
return null;
|
|
332
|
-
}
|
|
333
|
-
if (!info.owner.equals(programId)) {
|
|
334
|
-
throw new Error("account doesn't belong to this program");
|
|
335
|
-
}
|
|
336
|
-
return this.decode(info.data);
|
|
337
|
-
}
|
|
338
|
-
static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
|
|
339
|
-
const infos = await c.getMultipleAccountsInfo(addresses);
|
|
340
|
-
return infos.map((info) => {
|
|
341
|
-
if (info === null) {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
if (!info.owner.equals(programId)) {
|
|
345
|
-
throw new Error("account doesn't belong to this program");
|
|
346
|
-
}
|
|
347
|
-
return this.decode(info.data);
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
|
-
static decode(data) {
|
|
351
|
-
if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
|
|
352
|
-
throw new Error("invalid account discriminator");
|
|
353
|
-
}
|
|
354
|
-
const dec = _ClaimStatus.layout.decode(data.slice(8));
|
|
355
|
-
return new _ClaimStatus({
|
|
356
|
-
claimant: dec.claimant,
|
|
357
|
-
lockedAmount: dec.lockedAmount,
|
|
358
|
-
lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
|
|
359
|
-
unlockedAmount: dec.unlockedAmount,
|
|
360
|
-
lastClaimTs: dec.lastClaimTs,
|
|
361
|
-
lastAmountPerUnlock: dec.lastAmountPerUnlock,
|
|
362
|
-
closed: dec.closed,
|
|
363
|
-
distributor: dec.distributor,
|
|
364
|
-
claimsCount: dec.claimsCount,
|
|
365
|
-
closedTs: dec.closedTs,
|
|
366
|
-
buffer2: dec.buffer2
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
toJSON() {
|
|
370
|
-
return {
|
|
371
|
-
claimant: this.claimant.toString(),
|
|
372
|
-
lockedAmount: this.lockedAmount.toString(),
|
|
373
|
-
lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
|
|
374
|
-
unlockedAmount: this.unlockedAmount.toString(),
|
|
375
|
-
lastClaimTs: this.lastClaimTs.toString(),
|
|
376
|
-
lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
|
|
377
|
-
closed: this.closed,
|
|
378
|
-
distributor: this.distributor.toString(),
|
|
379
|
-
claimsCount: this.claimsCount,
|
|
380
|
-
closedTs: this.closedTs.toString(),
|
|
381
|
-
buffer2: this.buffer2
|
|
382
|
-
};
|
|
383
|
-
}
|
|
384
|
-
static fromJSON(obj) {
|
|
385
|
-
return new _ClaimStatus({
|
|
386
|
-
claimant: new PublicKey(obj.claimant),
|
|
387
|
-
lockedAmount: new BN6(obj.lockedAmount),
|
|
388
|
-
lockedAmountWithdrawn: new BN6(obj.lockedAmountWithdrawn),
|
|
389
|
-
unlockedAmount: new BN6(obj.unlockedAmount),
|
|
390
|
-
lastClaimTs: new BN6(obj.lastClaimTs),
|
|
391
|
-
lastAmountPerUnlock: new BN6(obj.lastAmountPerUnlock),
|
|
392
|
-
closed: obj.closed,
|
|
393
|
-
distributor: new PublicKey(obj.distributor),
|
|
394
|
-
claimsCount: obj.claimsCount,
|
|
395
|
-
closedTs: new BN6(obj.closedTs),
|
|
396
|
-
buffer2: obj.buffer2
|
|
397
|
-
});
|
|
398
|
-
}
|
|
399
|
-
};
|
|
400
|
-
_ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
|
|
401
|
-
_ClaimStatus.layout = borsh8.struct([
|
|
402
|
-
borsh8.publicKey("claimant"),
|
|
403
|
-
borsh8.u64("lockedAmount"),
|
|
404
|
-
borsh8.u64("lockedAmountWithdrawn"),
|
|
405
|
-
borsh8.u64("unlockedAmount"),
|
|
406
|
-
borsh8.u64("lastClaimTs"),
|
|
407
|
-
borsh8.u64("lastAmountPerUnlock"),
|
|
408
|
-
borsh8.bool("closed"),
|
|
409
|
-
borsh8.publicKey("distributor"),
|
|
410
|
-
borsh8.u16("claimsCount"),
|
|
411
|
-
borsh8.u64("closedTs"),
|
|
412
|
-
borsh8.array(borsh8.u8(), 22, "buffer2")
|
|
413
|
-
]);
|
|
414
|
-
var ClaimStatus = _ClaimStatus;
|
|
415
1624
|
var _MerkleDistributor = class _MerkleDistributor {
|
|
416
1625
|
constructor(fields) {
|
|
417
1626
|
this.bump = fields.bump;
|
|
@@ -533,28 +1742,28 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
533
1742
|
static fromJSON(obj) {
|
|
534
1743
|
return new _MerkleDistributor({
|
|
535
1744
|
bump: obj.bump,
|
|
536
|
-
version: new
|
|
1745
|
+
version: new BN5(obj.version),
|
|
537
1746
|
root: obj.root,
|
|
538
1747
|
mint: new PublicKey(obj.mint),
|
|
539
1748
|
tokenVault: new PublicKey(obj.tokenVault),
|
|
540
|
-
maxTotalClaim: new
|
|
541
|
-
maxNumNodes: new
|
|
542
|
-
unlockPeriod: new
|
|
543
|
-
totalAmountClaimed: new
|
|
544
|
-
numNodesClaimed: new
|
|
545
|
-
startTs: new
|
|
546
|
-
endTs: new
|
|
547
|
-
clawbackStartTs: new
|
|
1749
|
+
maxTotalClaim: new BN5(obj.maxTotalClaim),
|
|
1750
|
+
maxNumNodes: new BN5(obj.maxNumNodes),
|
|
1751
|
+
unlockPeriod: new BN5(obj.unlockPeriod),
|
|
1752
|
+
totalAmountClaimed: new BN5(obj.totalAmountClaimed),
|
|
1753
|
+
numNodesClaimed: new BN5(obj.numNodesClaimed),
|
|
1754
|
+
startTs: new BN5(obj.startTs),
|
|
1755
|
+
endTs: new BN5(obj.endTs),
|
|
1756
|
+
clawbackStartTs: new BN5(obj.clawbackStartTs),
|
|
548
1757
|
clawbackReceiver: new PublicKey(obj.clawbackReceiver),
|
|
549
1758
|
admin: new PublicKey(obj.admin),
|
|
550
1759
|
clawedBack: obj.clawedBack,
|
|
551
1760
|
claimsClosableByAdmin: obj.claimsClosableByAdmin,
|
|
552
1761
|
canUpdateDuration: obj.canUpdateDuration,
|
|
553
|
-
totalAmountUnlocked: new
|
|
554
|
-
totalAmountLocked: new
|
|
555
|
-
lastDurationUpdateTs: new
|
|
556
|
-
totalClaimablePreUpdate: new
|
|
557
|
-
clawedBackTs: new
|
|
1762
|
+
totalAmountUnlocked: new BN5(obj.totalAmountUnlocked),
|
|
1763
|
+
totalAmountLocked: new BN5(obj.totalAmountLocked),
|
|
1764
|
+
lastDurationUpdateTs: new BN5(obj.lastDurationUpdateTs),
|
|
1765
|
+
totalClaimablePreUpdate: new BN5(obj.totalClaimablePreUpdate),
|
|
1766
|
+
clawedBackTs: new BN5(obj.clawedBackTs),
|
|
558
1767
|
claimsClosableByClaimant: obj.claimsClosableByClaimant,
|
|
559
1768
|
claimsLimit: obj.claimsLimit,
|
|
560
1769
|
buffer2: obj.buffer2,
|
|
@@ -563,34 +1772,34 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
563
1772
|
}
|
|
564
1773
|
};
|
|
565
1774
|
_MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
|
|
566
|
-
_MerkleDistributor.layout =
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
1775
|
+
_MerkleDistributor.layout = borsh7.struct([
|
|
1776
|
+
borsh7.u8("bump"),
|
|
1777
|
+
borsh7.u64("version"),
|
|
1778
|
+
borsh7.array(borsh7.u8(), 32, "root"),
|
|
1779
|
+
borsh7.publicKey("mint"),
|
|
1780
|
+
borsh7.publicKey("tokenVault"),
|
|
1781
|
+
borsh7.u64("maxTotalClaim"),
|
|
1782
|
+
borsh7.u64("maxNumNodes"),
|
|
1783
|
+
borsh7.u64("unlockPeriod"),
|
|
1784
|
+
borsh7.u64("totalAmountClaimed"),
|
|
1785
|
+
borsh7.u64("numNodesClaimed"),
|
|
1786
|
+
borsh7.u64("startTs"),
|
|
1787
|
+
borsh7.u64("endTs"),
|
|
1788
|
+
borsh7.u64("clawbackStartTs"),
|
|
1789
|
+
borsh7.publicKey("clawbackReceiver"),
|
|
1790
|
+
borsh7.publicKey("admin"),
|
|
1791
|
+
borsh7.bool("clawedBack"),
|
|
1792
|
+
borsh7.bool("claimsClosableByAdmin"),
|
|
1793
|
+
borsh7.bool("canUpdateDuration"),
|
|
1794
|
+
borsh7.u64("totalAmountUnlocked"),
|
|
1795
|
+
borsh7.u64("totalAmountLocked"),
|
|
1796
|
+
borsh7.u64("lastDurationUpdateTs"),
|
|
1797
|
+
borsh7.u64("totalClaimablePreUpdate"),
|
|
1798
|
+
borsh7.u64("clawedBackTs"),
|
|
1799
|
+
borsh7.bool("claimsClosableByClaimant"),
|
|
1800
|
+
borsh7.u16("claimsLimit"),
|
|
1801
|
+
borsh7.array(borsh7.u8(), 20, "buffer2"),
|
|
1802
|
+
borsh7.array(borsh7.u8(), 32, "buffer3")
|
|
594
1803
|
]);
|
|
595
1804
|
var MerkleDistributor = _MerkleDistributor;
|
|
596
1805
|
|
|
@@ -1602,9 +2811,9 @@ function getEventAuthorityPda(programId) {
|
|
|
1602
2811
|
const seeds = [Buffer$1.from("__event_authority")];
|
|
1603
2812
|
return PublicKey.findProgramAddressSync(seeds, programId)[0];
|
|
1604
2813
|
}
|
|
1605
|
-
async function wrappedSignAndExecuteTransaction(
|
|
2814
|
+
async function wrappedSignAndExecuteTransaction(...args) {
|
|
1606
2815
|
try {
|
|
1607
|
-
return await signAndExecuteTransaction(
|
|
2816
|
+
return await signAndExecuteTransaction(...args);
|
|
1608
2817
|
} catch (err) {
|
|
1609
2818
|
if (err instanceof Error) {
|
|
1610
2819
|
const parsed = fromTxError(err);
|
|
@@ -1645,6 +2854,10 @@ var BaseDistributorClient = class {
|
|
|
1645
2854
|
this.connection = new Connection(clusterUrl, this.commitment);
|
|
1646
2855
|
this.programId = programId !== "" ? new PublicKey(programId) : new PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
|
|
1647
2856
|
this.sendThrottler = sendThrottler ?? buildSendThrottler(sendRate);
|
|
2857
|
+
const merkleDistributorProgram = {
|
|
2858
|
+
...merkle_distributor_default
|
|
2859
|
+
};
|
|
2860
|
+
this.merkleDistributorProgram = new Program(merkleDistributorProgram, { connection: this.connection });
|
|
1648
2861
|
}
|
|
1649
2862
|
getConnection() {
|
|
1650
2863
|
return this.connection;
|
|
@@ -1679,7 +2892,7 @@ var BaseDistributorClient = class {
|
|
|
1679
2892
|
};
|
|
1680
2893
|
if (extParams.isNative) {
|
|
1681
2894
|
ixs.push(
|
|
1682
|
-
...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new
|
|
2895
|
+
...await prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5(data.maxTotalClaim))
|
|
1683
2896
|
);
|
|
1684
2897
|
}
|
|
1685
2898
|
const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
|
|
@@ -1720,7 +2933,14 @@ var BaseDistributorClient = class {
|
|
|
1720
2933
|
return { distributorPublicKey, ixs };
|
|
1721
2934
|
}
|
|
1722
2935
|
async create(data, extParams) {
|
|
1723
|
-
const
|
|
2936
|
+
const invoker = extParams.invoker.publicKey;
|
|
2937
|
+
invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
2938
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
2939
|
+
const { ixs, distributorPublicKey } = await createAndEstimateTransaction(
|
|
2940
|
+
(params) => this.prepareCreateInstructions(data, params),
|
|
2941
|
+
executionParams,
|
|
2942
|
+
(q) => q.ixs
|
|
2943
|
+
);
|
|
1724
2944
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1725
2945
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1726
2946
|
this.connection,
|
|
@@ -1731,7 +2951,7 @@ var BaseDistributorClient = class {
|
|
|
1731
2951
|
context,
|
|
1732
2952
|
commitment: this.getCommitment()
|
|
1733
2953
|
},
|
|
1734
|
-
{ sendThrottler: this.sendThrottler }
|
|
2954
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1735
2955
|
);
|
|
1736
2956
|
return {
|
|
1737
2957
|
ixs,
|
|
@@ -1739,23 +2959,29 @@ var BaseDistributorClient = class {
|
|
|
1739
2959
|
metadataId: distributorPublicKey.toBase58()
|
|
1740
2960
|
};
|
|
1741
2961
|
}
|
|
1742
|
-
async claim(data, extParams) {
|
|
1743
|
-
const
|
|
1744
|
-
const
|
|
2962
|
+
async claim(data, extParams, _serviceTransfer) {
|
|
2963
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
2964
|
+
const invoker = executionParams.invoker.publicKey;
|
|
2965
|
+
invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
2966
|
+
const ixs = await createAndEstimateTransaction(
|
|
2967
|
+
(params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
|
|
2968
|
+
executionParams
|
|
2969
|
+
);
|
|
2970
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
|
|
1745
2971
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1746
2972
|
this.connection,
|
|
1747
|
-
|
|
2973
|
+
executionParams.invoker,
|
|
1748
2974
|
tx,
|
|
1749
2975
|
{
|
|
1750
2976
|
hash,
|
|
1751
2977
|
context,
|
|
1752
2978
|
commitment: this.getCommitment()
|
|
1753
2979
|
},
|
|
1754
|
-
{ sendThrottler: this.sendThrottler }
|
|
2980
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1755
2981
|
);
|
|
1756
2982
|
return { ixs, txId: signature };
|
|
1757
2983
|
}
|
|
1758
|
-
async prepareClaimInstructions(data, extParams) {
|
|
2984
|
+
async prepareClaimInstructions(data, extParams, _serviceTransfer) {
|
|
1759
2985
|
if (!extParams.invoker.publicKey) {
|
|
1760
2986
|
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
1761
2987
|
}
|
|
@@ -1782,7 +3008,7 @@ var BaseDistributorClient = class {
|
|
|
1782
3008
|
extParams.invoker.publicKey
|
|
1783
3009
|
);
|
|
1784
3010
|
const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
|
|
1785
|
-
const claimStatus = await
|
|
3011
|
+
const claimStatus = await this.getClaim(claimStatusPublicKey);
|
|
1786
3012
|
const accounts = {
|
|
1787
3013
|
distributor: distributorPublicKey,
|
|
1788
3014
|
claimStatus: claimStatusPublicKey,
|
|
@@ -1797,32 +3023,43 @@ var BaseDistributorClient = class {
|
|
|
1797
3023
|
};
|
|
1798
3024
|
if (!claimStatus) {
|
|
1799
3025
|
const args = {
|
|
1800
|
-
amountLocked: new
|
|
1801
|
-
amountUnlocked: new
|
|
3026
|
+
amountLocked: new BN5(data.amountLocked),
|
|
3027
|
+
amountUnlocked: new BN5(data.amountUnlocked),
|
|
1802
3028
|
proof: data.proof
|
|
1803
3029
|
};
|
|
1804
3030
|
ixs.push(newClaim(args, accounts, this.programId));
|
|
1805
3031
|
}
|
|
1806
|
-
const nowTs = new
|
|
1807
|
-
if (claimStatus || new
|
|
3032
|
+
const nowTs = new BN5(Math.floor(Date.now() / 1e3));
|
|
3033
|
+
if (claimStatus || new BN5(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
|
|
1808
3034
|
ixs.push(claimLocked(accounts, this.programId));
|
|
1809
3035
|
}
|
|
1810
|
-
ixs.push(
|
|
3036
|
+
ixs.push(
|
|
3037
|
+
this.prepareClaimFeeInstruction(
|
|
3038
|
+
extParams.invoker.publicKey,
|
|
3039
|
+
typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
|
|
3040
|
+
)
|
|
3041
|
+
);
|
|
1811
3042
|
return ixs;
|
|
1812
3043
|
}
|
|
1813
3044
|
async closeClaim(data, extParams) {
|
|
1814
|
-
const
|
|
1815
|
-
const
|
|
3045
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3046
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3047
|
+
invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3048
|
+
const ixs = await createAndEstimateTransaction(
|
|
3049
|
+
(params) => this.prepareCloseClaimInstructions(data, params),
|
|
3050
|
+
executionParams
|
|
3051
|
+
);
|
|
3052
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
|
|
1816
3053
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1817
3054
|
this.connection,
|
|
1818
|
-
|
|
3055
|
+
executionParams.invoker,
|
|
1819
3056
|
tx,
|
|
1820
3057
|
{
|
|
1821
3058
|
hash,
|
|
1822
3059
|
context,
|
|
1823
3060
|
commitment: this.getCommitment()
|
|
1824
3061
|
},
|
|
1825
|
-
{ sendThrottler: this.sendThrottler }
|
|
3062
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1826
3063
|
);
|
|
1827
3064
|
return { ixs, txId: signature };
|
|
1828
3065
|
}
|
|
@@ -1849,8 +3086,8 @@ var BaseDistributorClient = class {
|
|
|
1849
3086
|
program: this.programId
|
|
1850
3087
|
};
|
|
1851
3088
|
const closeClaimArgs = {
|
|
1852
|
-
amountLocked: data.amountLocked ? new
|
|
1853
|
-
amountUnlocked: data.amountUnlocked ? new
|
|
3089
|
+
amountLocked: data.amountLocked ? new BN5(data.amountLocked) : void 0,
|
|
3090
|
+
amountUnlocked: data.amountUnlocked ? new BN5(data.amountUnlocked) : void 0,
|
|
1854
3091
|
proof: data.proof
|
|
1855
3092
|
};
|
|
1856
3093
|
ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
|
|
@@ -1890,26 +3127,37 @@ var BaseDistributorClient = class {
|
|
|
1890
3127
|
return ixs;
|
|
1891
3128
|
}
|
|
1892
3129
|
async clawback(data, extParams) {
|
|
1893
|
-
const
|
|
1894
|
-
const
|
|
3130
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3131
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3132
|
+
invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3133
|
+
const ixs = await createAndEstimateTransaction(
|
|
3134
|
+
(params) => this.prepareClawbackInstructions(data, params),
|
|
3135
|
+
executionParams
|
|
3136
|
+
);
|
|
3137
|
+
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker);
|
|
1895
3138
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1896
3139
|
this.connection,
|
|
1897
|
-
|
|
3140
|
+
executionParams.invoker,
|
|
1898
3141
|
tx,
|
|
1899
3142
|
{
|
|
1900
3143
|
hash,
|
|
1901
3144
|
context,
|
|
1902
3145
|
commitment: this.getCommitment()
|
|
1903
3146
|
},
|
|
1904
|
-
{ sendThrottler: this.sendThrottler }
|
|
3147
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1905
3148
|
);
|
|
1906
3149
|
return { ixs, txId: signature };
|
|
1907
3150
|
}
|
|
3151
|
+
async getClaim(claimStatus) {
|
|
3152
|
+
return this.connection.getAccountInfo(pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
|
|
3153
|
+
}
|
|
1908
3154
|
async getClaims(data) {
|
|
1909
3155
|
const claimStatusPublicKeys = data.map(({ id, recipient }) => {
|
|
1910
3156
|
return getClaimantStatusPda(this.programId, new PublicKey(id), new PublicKey(recipient));
|
|
1911
3157
|
});
|
|
1912
|
-
return
|
|
3158
|
+
return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
|
|
3159
|
+
return accounts.map((account) => this.decodeClaimStatus(account));
|
|
3160
|
+
});
|
|
1913
3161
|
}
|
|
1914
3162
|
async getDistributors(data) {
|
|
1915
3163
|
const distributorPublicKeys = data.ids.map((distributorId) => new PublicKey(distributorId));
|
|
@@ -1939,28 +3187,28 @@ var BaseDistributorClient = class {
|
|
|
1939
3187
|
account: MerkleDistributor.decode(account.data)
|
|
1940
3188
|
}));
|
|
1941
3189
|
}
|
|
1942
|
-
prepareClaimFeeInstruction(payer) {
|
|
3190
|
+
prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
|
|
1943
3191
|
return SystemProgram.transfer({
|
|
1944
3192
|
fromPubkey: payer,
|
|
1945
3193
|
toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
|
|
1946
|
-
lamports:
|
|
3194
|
+
lamports: fee
|
|
1947
3195
|
});
|
|
1948
3196
|
}
|
|
1949
3197
|
getNewDistributorArgs(data) {
|
|
1950
3198
|
const args = {
|
|
1951
|
-
version: new
|
|
3199
|
+
version: new BN5(data.version),
|
|
1952
3200
|
root: data.root,
|
|
1953
|
-
maxTotalClaim: new
|
|
1954
|
-
maxNumNodes: new
|
|
1955
|
-
unlockPeriod: new
|
|
1956
|
-
startVestingTs: new
|
|
1957
|
-
endVestingTs: new
|
|
1958
|
-
clawbackStartTs: new
|
|
3201
|
+
maxTotalClaim: new BN5(data.maxTotalClaim),
|
|
3202
|
+
maxNumNodes: new BN5(data.maxNumNodes),
|
|
3203
|
+
unlockPeriod: new BN5(data.unlockPeriod),
|
|
3204
|
+
startVestingTs: new BN5(data.startVestingTs),
|
|
3205
|
+
endVestingTs: new BN5(data.endVestingTs),
|
|
3206
|
+
clawbackStartTs: new BN5(data.clawbackStartTs),
|
|
1959
3207
|
claimsClosableByAdmin: data.claimsClosableByAdmin,
|
|
1960
3208
|
claimsClosableByClaimant: data.claimsClosableByClaimant,
|
|
1961
3209
|
claimsLimit: data.claimsLimit
|
|
1962
3210
|
};
|
|
1963
|
-
const nowTs = new
|
|
3211
|
+
const nowTs = new BN5(Math.floor(Date.now() / 1e3));
|
|
1964
3212
|
const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
|
|
1965
3213
|
const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
|
|
1966
3214
|
if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
|
|
@@ -1968,7 +3216,34 @@ var BaseDistributorClient = class {
|
|
|
1968
3216
|
}
|
|
1969
3217
|
return args;
|
|
1970
3218
|
}
|
|
3219
|
+
unwrapExecutionParams(extParams) {
|
|
3220
|
+
return unwrapExecutionParams(extParams, this.connection);
|
|
3221
|
+
}
|
|
3222
|
+
decodeClaimStatus(account) {
|
|
3223
|
+
if (!account) {
|
|
3224
|
+
return account;
|
|
3225
|
+
}
|
|
3226
|
+
try {
|
|
3227
|
+
return decode(this.merkleDistributorProgram, "claimStatus", account.data);
|
|
3228
|
+
} catch (baseClaimStatusError) {
|
|
3229
|
+
try {
|
|
3230
|
+
return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
|
|
3231
|
+
} catch (compressedClaimStatusError) {
|
|
3232
|
+
throw new Error("Couldn't decode claim status");
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
}
|
|
1971
3236
|
};
|
|
3237
|
+
function decode(program, accountName, accInfo, programKey) {
|
|
3238
|
+
const programId = program.programId?.toBase58() ?? "N/A";
|
|
3239
|
+
invariant(program, `Decoding program with key ${programId} is not available`);
|
|
3240
|
+
const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
|
|
3241
|
+
invariant(
|
|
3242
|
+
!!accountEntity,
|
|
3243
|
+
`Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
|
|
3244
|
+
);
|
|
3245
|
+
return program.coder.accounts.decode(accountName, accInfo);
|
|
3246
|
+
}
|
|
1972
3247
|
|
|
1973
3248
|
// solana/clients/SolanaDistributorClient.ts
|
|
1974
3249
|
var SolanaDistributorClient = class extends BaseDistributorClient {
|
|
@@ -1986,7 +3261,7 @@ var aligned_distributor_default = {
|
|
|
1986
3261
|
address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
1987
3262
|
metadata: {
|
|
1988
3263
|
name: "aligned_distributor",
|
|
1989
|
-
version: "1.
|
|
3264
|
+
version: "1.5.0",
|
|
1990
3265
|
spec: "0.1.0",
|
|
1991
3266
|
description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
|
|
1992
3267
|
},
|
|
@@ -2130,6 +3405,48 @@ var aligned_distributor_default = {
|
|
|
2130
3405
|
}
|
|
2131
3406
|
]
|
|
2132
3407
|
},
|
|
3408
|
+
{
|
|
3409
|
+
name: "migrate_test_oracle",
|
|
3410
|
+
discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
|
|
3411
|
+
accounts: [
|
|
3412
|
+
{
|
|
3413
|
+
name: "payer",
|
|
3414
|
+
writable: true,
|
|
3415
|
+
signer: true
|
|
3416
|
+
},
|
|
3417
|
+
{
|
|
3418
|
+
name: "mint"
|
|
3419
|
+
},
|
|
3420
|
+
{
|
|
3421
|
+
name: "creator"
|
|
3422
|
+
},
|
|
3423
|
+
{
|
|
3424
|
+
name: "test_oracle",
|
|
3425
|
+
writable: true,
|
|
3426
|
+
pda: {
|
|
3427
|
+
seeds: [
|
|
3428
|
+
{
|
|
3429
|
+
kind: "const",
|
|
3430
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3431
|
+
},
|
|
3432
|
+
{
|
|
3433
|
+
kind: "account",
|
|
3434
|
+
path: "mint"
|
|
3435
|
+
},
|
|
3436
|
+
{
|
|
3437
|
+
kind: "account",
|
|
3438
|
+
path: "creator"
|
|
3439
|
+
}
|
|
3440
|
+
]
|
|
3441
|
+
}
|
|
3442
|
+
},
|
|
3443
|
+
{
|
|
3444
|
+
name: "system_program",
|
|
3445
|
+
address: "11111111111111111111111111111111"
|
|
3446
|
+
}
|
|
3447
|
+
],
|
|
3448
|
+
args: []
|
|
3449
|
+
},
|
|
2133
3450
|
{
|
|
2134
3451
|
name: "new_distributor",
|
|
2135
3452
|
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
@@ -2215,6 +3532,48 @@ var aligned_distributor_default = {
|
|
|
2215
3532
|
}
|
|
2216
3533
|
]
|
|
2217
3534
|
},
|
|
3535
|
+
{
|
|
3536
|
+
name: "realloc_test_oracle",
|
|
3537
|
+
discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
|
|
3538
|
+
accounts: [
|
|
3539
|
+
{
|
|
3540
|
+
name: "payer",
|
|
3541
|
+
writable: true,
|
|
3542
|
+
signer: true
|
|
3543
|
+
},
|
|
3544
|
+
{
|
|
3545
|
+
name: "mint"
|
|
3546
|
+
},
|
|
3547
|
+
{
|
|
3548
|
+
name: "creator"
|
|
3549
|
+
},
|
|
3550
|
+
{
|
|
3551
|
+
name: "test_oracle",
|
|
3552
|
+
writable: true,
|
|
3553
|
+
pda: {
|
|
3554
|
+
seeds: [
|
|
3555
|
+
{
|
|
3556
|
+
kind: "const",
|
|
3557
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3558
|
+
},
|
|
3559
|
+
{
|
|
3560
|
+
kind: "account",
|
|
3561
|
+
path: "mint"
|
|
3562
|
+
},
|
|
3563
|
+
{
|
|
3564
|
+
kind: "account",
|
|
3565
|
+
path: "creator"
|
|
3566
|
+
}
|
|
3567
|
+
]
|
|
3568
|
+
}
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
name: "system_program",
|
|
3572
|
+
address: "11111111111111111111111111111111"
|
|
3573
|
+
}
|
|
3574
|
+
],
|
|
3575
|
+
args: []
|
|
3576
|
+
},
|
|
2218
3577
|
{
|
|
2219
3578
|
name: "set_admin",
|
|
2220
3579
|
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
@@ -3000,20 +4359,20 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
|
|
|
3000
4359
|
unlockPeriod
|
|
3001
4360
|
} = data;
|
|
3002
4361
|
return {
|
|
3003
|
-
totalAmountLocked: new
|
|
3004
|
-
totalAmountUnlocked: new
|
|
4362
|
+
totalAmountLocked: new BN5(totalAmountLocked),
|
|
4363
|
+
totalAmountUnlocked: new BN5(totalAmountUnlocked),
|
|
3005
4364
|
oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
|
|
3006
4365
|
minPrice: getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3007
4366
|
maxPrice: getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3008
4367
|
minPercentage: getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3009
4368
|
maxPercentage: getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3010
|
-
tickSize: new
|
|
4369
|
+
tickSize: new BN5(tickSize || 1),
|
|
3011
4370
|
skipInitial: skipInitial ?? false,
|
|
3012
|
-
updatePeriod: unlockPeriod < 30 ? new
|
|
4371
|
+
updatePeriod: unlockPeriod < 30 ? new BN5(30) : new BN5(unlockPeriod)
|
|
3013
4372
|
};
|
|
3014
4373
|
}
|
|
3015
4374
|
};
|
|
3016
4375
|
|
|
3017
|
-
export { AnchorErrorCode,
|
|
4376
|
+
export { AnchorErrorCode, ContractErrorCode, MerkleDistributor, SolanaAlignedDistributorClient, SolanaDistributorClient, calculateAmountWithTransferFees, claimLocked, clawback, closeClaim, constants_exports as constants, fromCode3 as fromCode, fromTxError, getAlignedDistributorPda, getClaimantStatusPda, getDistributorPda, getEventAuthorityPda, getTestOraclePda, newClaim, newDistributor, setAdmin, setClawbackReceiver, wrappedSignAndExecuteTransaction };
|
|
3018
4377
|
//# sourceMappingURL=index.js.map
|
|
3019
4378
|
//# sourceMappingURL=index.js.map
|