@streamflow/distributor 8.0.0 → 8.0.1-alpha.p287.54fe41f
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 +1573 -215
- 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 +1573 -215
- 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 +1572 -214
- 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 +1573 -214
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,9 +5,9 @@ require('@solana/wallet-adapter-base');
|
|
|
5
5
|
var common = require('@streamflow/common');
|
|
6
6
|
var solana = require('@streamflow/common/solana');
|
|
7
7
|
var anchor = require('@coral-xyz/anchor');
|
|
8
|
-
var
|
|
8
|
+
var borsh7 = require('@coral-xyz/borsh');
|
|
9
9
|
var buffer = require('buffer');
|
|
10
|
-
var
|
|
10
|
+
var BN5 = require('bn.js');
|
|
11
11
|
var splToken = require('@solana/spl-token');
|
|
12
12
|
var bs58 = require('bs58');
|
|
13
13
|
|
|
@@ -31,8 +31,8 @@ function _interopNamespace(e) {
|
|
|
31
31
|
return Object.freeze(n);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
var
|
|
34
|
+
var borsh7__namespace = /*#__PURE__*/_interopNamespace(borsh7);
|
|
35
|
+
var BN5__default = /*#__PURE__*/_interopDefault(BN5);
|
|
36
36
|
var bs58__default = /*#__PURE__*/_interopDefault(bs58);
|
|
37
37
|
|
|
38
38
|
var __defProp = Object.defineProperty;
|
|
@@ -45,7 +45,6 @@ var __export = (target, all) => {
|
|
|
45
45
|
var solana_exports = {};
|
|
46
46
|
__export(solana_exports, {
|
|
47
47
|
AnchorErrorCode: () => AnchorErrorCode,
|
|
48
|
-
ClaimStatus: () => ClaimStatus,
|
|
49
48
|
ContractErrorCode: () => ContractErrorCode,
|
|
50
49
|
MerkleDistributor: () => MerkleDistributor,
|
|
51
50
|
SolanaAlignedDistributorClient: () => SolanaAlignedDistributorClient,
|
|
@@ -153,21 +152,21 @@ var PROGRAM_ID_CLI = new web3_js.PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHma
|
|
|
153
152
|
var PROGRAM_ID = PROGRAM_ID_CLI;
|
|
154
153
|
|
|
155
154
|
// solana/generated/instructions/newDistributor.ts
|
|
156
|
-
var layout =
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
155
|
+
var layout = borsh7__namespace.struct([
|
|
156
|
+
borsh7__namespace.u64("version"),
|
|
157
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
|
|
158
|
+
borsh7__namespace.u64("maxTotalClaim"),
|
|
159
|
+
borsh7__namespace.u64("maxNumNodes"),
|
|
160
|
+
borsh7__namespace.u64("unlockPeriod"),
|
|
161
|
+
borsh7__namespace.u64("startVestingTs"),
|
|
162
|
+
borsh7__namespace.u64("endVestingTs"),
|
|
163
|
+
borsh7__namespace.u64("clawbackStartTs"),
|
|
164
|
+
borsh7__namespace.bool("claimsClosableByAdmin"),
|
|
165
|
+
borsh7__namespace.option(borsh7__namespace.bool(), "canUpdateDuration"),
|
|
166
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountUnlocked"),
|
|
167
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountLocked"),
|
|
168
|
+
borsh7__namespace.option(borsh7__namespace.bool(), "claimsClosableByClaimant"),
|
|
169
|
+
borsh7__namespace.option(borsh7__namespace.u16(), "claimsLimit")
|
|
171
170
|
]);
|
|
172
171
|
function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
173
172
|
const keys = [
|
|
@@ -209,10 +208,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
|
209
208
|
const ix = new web3_js.TransactionInstruction({ keys, programId, data });
|
|
210
209
|
return ix;
|
|
211
210
|
}
|
|
212
|
-
var layout2 =
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
var layout2 = borsh7__namespace.struct([
|
|
212
|
+
borsh7__namespace.u64("amountUnlocked"),
|
|
213
|
+
borsh7__namespace.u64("amountLocked"),
|
|
214
|
+
borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32), "proof")
|
|
216
215
|
]);
|
|
217
216
|
function newClaim(args, accounts, programId = PROGRAM_ID) {
|
|
218
217
|
const keys = [
|
|
@@ -273,10 +272,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
|
|
|
273
272
|
const ix = new web3_js.TransactionInstruction({ keys, programId, data });
|
|
274
273
|
return ix;
|
|
275
274
|
}
|
|
276
|
-
var layout3 =
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
275
|
+
var layout3 = borsh7__namespace.struct([
|
|
276
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "amountUnlocked"),
|
|
277
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "amountLocked"),
|
|
278
|
+
borsh7__namespace.option(borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32)), "proof")
|
|
280
279
|
]);
|
|
281
280
|
function closeClaim(args, accounts, programId = PROGRAM_ID) {
|
|
282
281
|
const keys = [
|
|
@@ -325,6 +324,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
|
|
|
325
324
|
return ix;
|
|
326
325
|
}
|
|
327
326
|
|
|
327
|
+
// solana/descriptor/idl/merkle_distributor.json
|
|
328
|
+
var merkle_distributor_default = {
|
|
329
|
+
address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
330
|
+
metadata: {
|
|
331
|
+
name: "merkle_distributor",
|
|
332
|
+
version: "1.5.0",
|
|
333
|
+
spec: "0.1.0",
|
|
334
|
+
description: "A Solana program for distributing tokens according to a Merkle root.",
|
|
335
|
+
repository: "https://github.com/streamflow-finance/distributor"
|
|
336
|
+
},
|
|
337
|
+
instructions: [
|
|
338
|
+
{
|
|
339
|
+
name: "_expose_claim",
|
|
340
|
+
discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
|
|
341
|
+
accounts: [
|
|
342
|
+
{
|
|
343
|
+
name: "distributor",
|
|
344
|
+
docs: ["The [MerkleDistributor]."]
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
name: "claim_status",
|
|
348
|
+
docs: ["Claim Status PDA"],
|
|
349
|
+
optional: true,
|
|
350
|
+
pda: {
|
|
351
|
+
seeds: [
|
|
352
|
+
{
|
|
353
|
+
kind: "const",
|
|
354
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
kind: "account",
|
|
358
|
+
path: "claimant"
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
kind: "account",
|
|
362
|
+
path: "distributor"
|
|
363
|
+
}
|
|
364
|
+
]
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
name: "compressed_claim_status",
|
|
369
|
+
docs: ["Compress Claim Status PDA"],
|
|
370
|
+
optional: true,
|
|
371
|
+
pda: {
|
|
372
|
+
seeds: [
|
|
373
|
+
{
|
|
374
|
+
kind: "const",
|
|
375
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
kind: "account",
|
|
379
|
+
path: "claimant"
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
kind: "account",
|
|
383
|
+
path: "distributor"
|
|
384
|
+
}
|
|
385
|
+
]
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
name: "claimant",
|
|
390
|
+
docs: ["Who is claiming the tokens."],
|
|
391
|
+
signer: true
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
args: []
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
name: "claim_locked",
|
|
398
|
+
discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
|
|
399
|
+
accounts: [
|
|
400
|
+
{
|
|
401
|
+
name: "distributor",
|
|
402
|
+
docs: ["The [MerkleDistributor]."],
|
|
403
|
+
writable: true
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
name: "claim_status",
|
|
407
|
+
writable: true,
|
|
408
|
+
pda: {
|
|
409
|
+
seeds: [
|
|
410
|
+
{
|
|
411
|
+
kind: "const",
|
|
412
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
kind: "account",
|
|
416
|
+
path: "claimant"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
kind: "account",
|
|
420
|
+
path: "distributor"
|
|
421
|
+
}
|
|
422
|
+
]
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
name: "from",
|
|
427
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
428
|
+
writable: true,
|
|
429
|
+
pda: {
|
|
430
|
+
seeds: [
|
|
431
|
+
{
|
|
432
|
+
kind: "account",
|
|
433
|
+
path: "distributor"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
kind: "account",
|
|
437
|
+
path: "token_program"
|
|
438
|
+
},
|
|
439
|
+
{
|
|
440
|
+
kind: "account",
|
|
441
|
+
path: "distributor.mint",
|
|
442
|
+
account: "MerkleDistributor"
|
|
443
|
+
}
|
|
444
|
+
],
|
|
445
|
+
program: {
|
|
446
|
+
kind: "const",
|
|
447
|
+
value: [
|
|
448
|
+
140,
|
|
449
|
+
151,
|
|
450
|
+
37,
|
|
451
|
+
143,
|
|
452
|
+
78,
|
|
453
|
+
36,
|
|
454
|
+
137,
|
|
455
|
+
241,
|
|
456
|
+
187,
|
|
457
|
+
61,
|
|
458
|
+
16,
|
|
459
|
+
41,
|
|
460
|
+
20,
|
|
461
|
+
142,
|
|
462
|
+
13,
|
|
463
|
+
131,
|
|
464
|
+
11,
|
|
465
|
+
90,
|
|
466
|
+
19,
|
|
467
|
+
153,
|
|
468
|
+
218,
|
|
469
|
+
255,
|
|
470
|
+
16,
|
|
471
|
+
132,
|
|
472
|
+
4,
|
|
473
|
+
142,
|
|
474
|
+
123,
|
|
475
|
+
216,
|
|
476
|
+
219,
|
|
477
|
+
233,
|
|
478
|
+
248,
|
|
479
|
+
89
|
|
480
|
+
]
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
},
|
|
484
|
+
{
|
|
485
|
+
name: "to",
|
|
486
|
+
docs: [
|
|
487
|
+
"Account to send the claimed tokens to.",
|
|
488
|
+
"Claimant must sign the transaction and can only claim on behalf of themself"
|
|
489
|
+
],
|
|
490
|
+
writable: true
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
name: "claimant",
|
|
494
|
+
docs: ["Who is claiming the tokens."],
|
|
495
|
+
writable: true,
|
|
496
|
+
signer: true
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
name: "mint",
|
|
500
|
+
docs: ["The mint to claim."],
|
|
501
|
+
relations: ["distributor"]
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
name: "token_program",
|
|
505
|
+
docs: ["SPL [Token] program."]
|
|
506
|
+
},
|
|
507
|
+
{
|
|
508
|
+
name: "event_authority",
|
|
509
|
+
pda: {
|
|
510
|
+
seeds: [
|
|
511
|
+
{
|
|
512
|
+
kind: "const",
|
|
513
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
514
|
+
}
|
|
515
|
+
]
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
name: "program"
|
|
520
|
+
}
|
|
521
|
+
],
|
|
522
|
+
args: []
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
name: "clawback",
|
|
526
|
+
discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
|
|
527
|
+
accounts: [
|
|
528
|
+
{
|
|
529
|
+
name: "distributor",
|
|
530
|
+
docs: ["The [MerkleDistributor]."],
|
|
531
|
+
writable: true
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
name: "from",
|
|
535
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
536
|
+
writable: true
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: "to",
|
|
540
|
+
docs: ["The Clawback token account."],
|
|
541
|
+
writable: true
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
name: "admin",
|
|
545
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
546
|
+
writable: true,
|
|
547
|
+
signer: true
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
name: "mint"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "system_program",
|
|
554
|
+
docs: ["The [System] program."],
|
|
555
|
+
address: "11111111111111111111111111111111"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
name: "token_program",
|
|
559
|
+
docs: ["SPL [Token] program."]
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
args: []
|
|
563
|
+
},
|
|
564
|
+
{
|
|
565
|
+
name: "close_claim",
|
|
566
|
+
discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
|
|
567
|
+
accounts: [
|
|
568
|
+
{
|
|
569
|
+
name: "distributor",
|
|
570
|
+
docs: ["The [MerkleDistributor]."],
|
|
571
|
+
writable: true
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
name: "admin_or_claimant",
|
|
575
|
+
docs: ["Admin signer"],
|
|
576
|
+
writable: true,
|
|
577
|
+
signer: true
|
|
578
|
+
},
|
|
579
|
+
{
|
|
580
|
+
name: "claimant",
|
|
581
|
+
writable: true
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
name: "claim_status",
|
|
585
|
+
writable: true,
|
|
586
|
+
pda: {
|
|
587
|
+
seeds: [
|
|
588
|
+
{
|
|
589
|
+
kind: "const",
|
|
590
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
kind: "account",
|
|
594
|
+
path: "claimant"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
kind: "account",
|
|
598
|
+
path: "distributor"
|
|
599
|
+
}
|
|
600
|
+
]
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "system_program",
|
|
605
|
+
docs: ["The [System] program."],
|
|
606
|
+
address: "11111111111111111111111111111111"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
name: "event_authority",
|
|
610
|
+
pda: {
|
|
611
|
+
seeds: [
|
|
612
|
+
{
|
|
613
|
+
kind: "const",
|
|
614
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
615
|
+
}
|
|
616
|
+
]
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
name: "program"
|
|
621
|
+
}
|
|
622
|
+
],
|
|
623
|
+
args: [
|
|
624
|
+
{
|
|
625
|
+
name: "amount_unlocked",
|
|
626
|
+
type: {
|
|
627
|
+
option: "u64"
|
|
628
|
+
}
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
name: "amount_locked",
|
|
632
|
+
type: {
|
|
633
|
+
option: "u64"
|
|
634
|
+
}
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
name: "proof",
|
|
638
|
+
type: {
|
|
639
|
+
option: {
|
|
640
|
+
vec: {
|
|
641
|
+
array: ["u8", 32]
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
}
|
|
646
|
+
]
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
name: "compress_claim",
|
|
650
|
+
discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
|
|
651
|
+
accounts: [
|
|
652
|
+
{
|
|
653
|
+
name: "distributor",
|
|
654
|
+
docs: ["The [MerkleDistributor]."],
|
|
655
|
+
writable: true
|
|
656
|
+
},
|
|
657
|
+
{
|
|
658
|
+
name: "claim_status",
|
|
659
|
+
writable: true,
|
|
660
|
+
pda: {
|
|
661
|
+
seeds: [
|
|
662
|
+
{
|
|
663
|
+
kind: "const",
|
|
664
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
665
|
+
},
|
|
666
|
+
{
|
|
667
|
+
kind: "account",
|
|
668
|
+
path: "claimant"
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
kind: "account",
|
|
672
|
+
path: "distributor"
|
|
673
|
+
}
|
|
674
|
+
]
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "signer",
|
|
679
|
+
docs: ["Signer account"],
|
|
680
|
+
writable: true,
|
|
681
|
+
signer: true
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
name: "claimant"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: "system_program",
|
|
688
|
+
docs: ["The [System] program."],
|
|
689
|
+
address: "11111111111111111111111111111111"
|
|
690
|
+
}
|
|
691
|
+
],
|
|
692
|
+
args: []
|
|
693
|
+
},
|
|
694
|
+
{
|
|
695
|
+
name: "new_claim",
|
|
696
|
+
discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
|
|
697
|
+
accounts: [
|
|
698
|
+
{
|
|
699
|
+
name: "distributor",
|
|
700
|
+
docs: ["The [MerkleDistributor]."],
|
|
701
|
+
writable: true
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
name: "claim_status",
|
|
705
|
+
writable: true,
|
|
706
|
+
pda: {
|
|
707
|
+
seeds: [
|
|
708
|
+
{
|
|
709
|
+
kind: "const",
|
|
710
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
711
|
+
},
|
|
712
|
+
{
|
|
713
|
+
kind: "account",
|
|
714
|
+
path: "claimant"
|
|
715
|
+
},
|
|
716
|
+
{
|
|
717
|
+
kind: "account",
|
|
718
|
+
path: "distributor"
|
|
719
|
+
}
|
|
720
|
+
]
|
|
721
|
+
}
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
name: "from",
|
|
725
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
726
|
+
writable: true,
|
|
727
|
+
pda: {
|
|
728
|
+
seeds: [
|
|
729
|
+
{
|
|
730
|
+
kind: "account",
|
|
731
|
+
path: "distributor"
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
kind: "account",
|
|
735
|
+
path: "token_program"
|
|
736
|
+
},
|
|
737
|
+
{
|
|
738
|
+
kind: "account",
|
|
739
|
+
path: "distributor.mint",
|
|
740
|
+
account: "MerkleDistributor"
|
|
741
|
+
}
|
|
742
|
+
],
|
|
743
|
+
program: {
|
|
744
|
+
kind: "const",
|
|
745
|
+
value: [
|
|
746
|
+
140,
|
|
747
|
+
151,
|
|
748
|
+
37,
|
|
749
|
+
143,
|
|
750
|
+
78,
|
|
751
|
+
36,
|
|
752
|
+
137,
|
|
753
|
+
241,
|
|
754
|
+
187,
|
|
755
|
+
61,
|
|
756
|
+
16,
|
|
757
|
+
41,
|
|
758
|
+
20,
|
|
759
|
+
142,
|
|
760
|
+
13,
|
|
761
|
+
131,
|
|
762
|
+
11,
|
|
763
|
+
90,
|
|
764
|
+
19,
|
|
765
|
+
153,
|
|
766
|
+
218,
|
|
767
|
+
255,
|
|
768
|
+
16,
|
|
769
|
+
132,
|
|
770
|
+
4,
|
|
771
|
+
142,
|
|
772
|
+
123,
|
|
773
|
+
216,
|
|
774
|
+
219,
|
|
775
|
+
233,
|
|
776
|
+
248,
|
|
777
|
+
89
|
|
778
|
+
]
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
name: "to",
|
|
784
|
+
docs: ["Account to send the claimed tokens to."],
|
|
785
|
+
writable: true
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
name: "claimant",
|
|
789
|
+
docs: ["Who is claiming the tokens."],
|
|
790
|
+
writable: true,
|
|
791
|
+
signer: true
|
|
792
|
+
},
|
|
793
|
+
{
|
|
794
|
+
name: "mint",
|
|
795
|
+
docs: ["The mint to claim."],
|
|
796
|
+
relations: ["distributor"]
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
name: "token_program",
|
|
800
|
+
docs: ["SPL [Token] program."]
|
|
801
|
+
},
|
|
802
|
+
{
|
|
803
|
+
name: "system_program",
|
|
804
|
+
docs: ["The [System] program."],
|
|
805
|
+
address: "11111111111111111111111111111111"
|
|
806
|
+
},
|
|
807
|
+
{
|
|
808
|
+
name: "event_authority",
|
|
809
|
+
pda: {
|
|
810
|
+
seeds: [
|
|
811
|
+
{
|
|
812
|
+
kind: "const",
|
|
813
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
814
|
+
}
|
|
815
|
+
]
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
name: "program"
|
|
820
|
+
}
|
|
821
|
+
],
|
|
822
|
+
args: [
|
|
823
|
+
{
|
|
824
|
+
name: "amount_unlocked",
|
|
825
|
+
type: "u64"
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
name: "amount_locked",
|
|
829
|
+
type: "u64"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
name: "proof",
|
|
833
|
+
type: {
|
|
834
|
+
vec: {
|
|
835
|
+
array: ["u8", 32]
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
]
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
name: "new_distributor",
|
|
843
|
+
docs: [
|
|
844
|
+
"READ THE FOLLOWING:",
|
|
845
|
+
"",
|
|
846
|
+
"This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
|
|
847
|
+
"",
|
|
848
|
+
"An attack could look like:",
|
|
849
|
+
"- A legitimate user opens a new distributor.",
|
|
850
|
+
"- Someone observes the call to this instruction.",
|
|
851
|
+
"- They replace the clawback_receiver, admin, or time parameters with their own.",
|
|
852
|
+
"",
|
|
853
|
+
"One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
|
|
854
|
+
"and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
|
|
855
|
+
"the attacker can steal all funds from the distributor to their own clawback_receiver account.",
|
|
856
|
+
"",
|
|
857
|
+
"HOW TO AVOID:",
|
|
858
|
+
"- When you call into this instruction, ensure your transaction succeeds.",
|
|
859
|
+
"- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
|
|
860
|
+
"assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
|
|
861
|
+
"- If your transaction fails, double check the value on-chain matches what you expect."
|
|
862
|
+
],
|
|
863
|
+
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
864
|
+
accounts: [
|
|
865
|
+
{
|
|
866
|
+
name: "distributor",
|
|
867
|
+
docs: ["[MerkleDistributor]."],
|
|
868
|
+
writable: true,
|
|
869
|
+
pda: {
|
|
870
|
+
seeds: [
|
|
871
|
+
{
|
|
872
|
+
kind: "const",
|
|
873
|
+
value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
kind: "account",
|
|
877
|
+
path: "mint"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
kind: "arg",
|
|
881
|
+
path: "version"
|
|
882
|
+
}
|
|
883
|
+
]
|
|
884
|
+
}
|
|
885
|
+
},
|
|
886
|
+
{
|
|
887
|
+
name: "clawback_receiver",
|
|
888
|
+
docs: ["Clawback receiver token account"],
|
|
889
|
+
writable: true
|
|
890
|
+
},
|
|
891
|
+
{
|
|
892
|
+
name: "mint",
|
|
893
|
+
docs: ["The mint to distribute."]
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
name: "token_vault",
|
|
897
|
+
docs: ["Token vault"],
|
|
898
|
+
writable: true,
|
|
899
|
+
pda: {
|
|
900
|
+
seeds: [
|
|
901
|
+
{
|
|
902
|
+
kind: "account",
|
|
903
|
+
path: "distributor"
|
|
904
|
+
},
|
|
905
|
+
{
|
|
906
|
+
kind: "account",
|
|
907
|
+
path: "token_program"
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
kind: "account",
|
|
911
|
+
path: "mint"
|
|
912
|
+
}
|
|
913
|
+
],
|
|
914
|
+
program: {
|
|
915
|
+
kind: "const",
|
|
916
|
+
value: [
|
|
917
|
+
140,
|
|
918
|
+
151,
|
|
919
|
+
37,
|
|
920
|
+
143,
|
|
921
|
+
78,
|
|
922
|
+
36,
|
|
923
|
+
137,
|
|
924
|
+
241,
|
|
925
|
+
187,
|
|
926
|
+
61,
|
|
927
|
+
16,
|
|
928
|
+
41,
|
|
929
|
+
20,
|
|
930
|
+
142,
|
|
931
|
+
13,
|
|
932
|
+
131,
|
|
933
|
+
11,
|
|
934
|
+
90,
|
|
935
|
+
19,
|
|
936
|
+
153,
|
|
937
|
+
218,
|
|
938
|
+
255,
|
|
939
|
+
16,
|
|
940
|
+
132,
|
|
941
|
+
4,
|
|
942
|
+
142,
|
|
943
|
+
123,
|
|
944
|
+
216,
|
|
945
|
+
219,
|
|
946
|
+
233,
|
|
947
|
+
248,
|
|
948
|
+
89
|
|
949
|
+
]
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
name: "admin",
|
|
955
|
+
docs: [
|
|
956
|
+
"Admin wallet, responsible for creating the distributor and paying for the transaction.",
|
|
957
|
+
"Also has the authority to set the clawback receiver and change itself."
|
|
958
|
+
],
|
|
959
|
+
writable: true,
|
|
960
|
+
signer: true
|
|
961
|
+
},
|
|
962
|
+
{
|
|
963
|
+
name: "system_program",
|
|
964
|
+
docs: ["The [System] program."],
|
|
965
|
+
address: "11111111111111111111111111111111"
|
|
966
|
+
},
|
|
967
|
+
{
|
|
968
|
+
name: "associated_token_program",
|
|
969
|
+
docs: ["The [Associated Token] program."],
|
|
970
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
name: "token_program",
|
|
974
|
+
docs: ["The [Token] program."]
|
|
975
|
+
}
|
|
976
|
+
],
|
|
977
|
+
args: [
|
|
978
|
+
{
|
|
979
|
+
name: "version",
|
|
980
|
+
type: "u64"
|
|
981
|
+
},
|
|
982
|
+
{
|
|
983
|
+
name: "root",
|
|
984
|
+
type: {
|
|
985
|
+
array: ["u8", 32]
|
|
986
|
+
}
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
name: "max_total_claim",
|
|
990
|
+
type: "u64"
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
name: "max_num_nodes",
|
|
994
|
+
type: "u64"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
name: "unlock_period",
|
|
998
|
+
type: "u64"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: "start_vesting_ts",
|
|
1002
|
+
type: "u64"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
name: "end_vesting_ts",
|
|
1006
|
+
type: "u64"
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
name: "clawback_start_ts",
|
|
1010
|
+
type: "u64"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
name: "claims_closable_by_admin",
|
|
1014
|
+
type: "bool"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
name: "can_update_duration",
|
|
1018
|
+
type: {
|
|
1019
|
+
option: "bool"
|
|
1020
|
+
}
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
name: "total_amount_unlocked",
|
|
1024
|
+
type: {
|
|
1025
|
+
option: "u64"
|
|
1026
|
+
}
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
name: "total_amount_locked",
|
|
1030
|
+
type: {
|
|
1031
|
+
option: "u64"
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
1034
|
+
{
|
|
1035
|
+
name: "claims_closable_by_claimant",
|
|
1036
|
+
type: {
|
|
1037
|
+
option: "bool"
|
|
1038
|
+
}
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
name: "claims_limit",
|
|
1042
|
+
type: {
|
|
1043
|
+
option: "u16"
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
]
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
name: "refund_claim",
|
|
1050
|
+
discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
|
|
1051
|
+
accounts: [
|
|
1052
|
+
{
|
|
1053
|
+
name: "distributor",
|
|
1054
|
+
docs: ["The [MerkleDistributor]."],
|
|
1055
|
+
writable: true
|
|
1056
|
+
},
|
|
1057
|
+
{
|
|
1058
|
+
name: "claim_status",
|
|
1059
|
+
writable: true,
|
|
1060
|
+
pda: {
|
|
1061
|
+
seeds: [
|
|
1062
|
+
{
|
|
1063
|
+
kind: "const",
|
|
1064
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
1065
|
+
},
|
|
1066
|
+
{
|
|
1067
|
+
kind: "account",
|
|
1068
|
+
path: "claimant"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
kind: "account",
|
|
1072
|
+
path: "distributor"
|
|
1073
|
+
}
|
|
1074
|
+
]
|
|
1075
|
+
}
|
|
1076
|
+
},
|
|
1077
|
+
{
|
|
1078
|
+
name: "signer",
|
|
1079
|
+
docs: ["Signer account"],
|
|
1080
|
+
writable: true,
|
|
1081
|
+
signer: true
|
|
1082
|
+
},
|
|
1083
|
+
{
|
|
1084
|
+
name: "claimant"
|
|
1085
|
+
},
|
|
1086
|
+
{
|
|
1087
|
+
name: "streamflow_treasury",
|
|
1088
|
+
writable: true,
|
|
1089
|
+
address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
|
|
1090
|
+
},
|
|
1091
|
+
{
|
|
1092
|
+
name: "system_program",
|
|
1093
|
+
docs: ["The [System] program."],
|
|
1094
|
+
address: "11111111111111111111111111111111"
|
|
1095
|
+
}
|
|
1096
|
+
],
|
|
1097
|
+
args: []
|
|
1098
|
+
},
|
|
1099
|
+
{
|
|
1100
|
+
name: "set_admin",
|
|
1101
|
+
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
1102
|
+
accounts: [
|
|
1103
|
+
{
|
|
1104
|
+
name: "distributor",
|
|
1105
|
+
docs: ["The [MerkleDistributor]."],
|
|
1106
|
+
writable: true
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
name: "admin",
|
|
1110
|
+
docs: ["Admin signer"],
|
|
1111
|
+
writable: true,
|
|
1112
|
+
signer: true
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
name: "new_admin",
|
|
1116
|
+
docs: ["New admin account"],
|
|
1117
|
+
writable: true
|
|
1118
|
+
}
|
|
1119
|
+
],
|
|
1120
|
+
args: []
|
|
1121
|
+
},
|
|
1122
|
+
{
|
|
1123
|
+
name: "set_clawback_receiver",
|
|
1124
|
+
discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
|
|
1125
|
+
accounts: [
|
|
1126
|
+
{
|
|
1127
|
+
name: "distributor",
|
|
1128
|
+
docs: ["The [MerkleDistributor]."],
|
|
1129
|
+
writable: true
|
|
1130
|
+
},
|
|
1131
|
+
{
|
|
1132
|
+
name: "new_clawback_account",
|
|
1133
|
+
docs: ["New clawback account"]
|
|
1134
|
+
},
|
|
1135
|
+
{
|
|
1136
|
+
name: "admin",
|
|
1137
|
+
docs: ["Admin signer"],
|
|
1138
|
+
writable: true,
|
|
1139
|
+
signer: true
|
|
1140
|
+
}
|
|
1141
|
+
],
|
|
1142
|
+
args: []
|
|
1143
|
+
},
|
|
1144
|
+
{
|
|
1145
|
+
name: "update",
|
|
1146
|
+
discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
|
|
1147
|
+
accounts: [
|
|
1148
|
+
{
|
|
1149
|
+
name: "distributor",
|
|
1150
|
+
docs: ["The [MerkleDistributor]."],
|
|
1151
|
+
writable: true
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
name: "admin",
|
|
1155
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
1156
|
+
writable: true,
|
|
1157
|
+
signer: true
|
|
1158
|
+
},
|
|
1159
|
+
{
|
|
1160
|
+
name: "system_program",
|
|
1161
|
+
docs: ["The [System] program."],
|
|
1162
|
+
address: "11111111111111111111111111111111"
|
|
1163
|
+
}
|
|
1164
|
+
],
|
|
1165
|
+
args: [
|
|
1166
|
+
{
|
|
1167
|
+
name: "end_ts",
|
|
1168
|
+
type: {
|
|
1169
|
+
option: "u64"
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
]
|
|
1173
|
+
}
|
|
1174
|
+
],
|
|
1175
|
+
accounts: [
|
|
1176
|
+
{
|
|
1177
|
+
name: "ClaimStatus",
|
|
1178
|
+
discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
|
|
1179
|
+
},
|
|
1180
|
+
{
|
|
1181
|
+
name: "CompressedClaimStatus",
|
|
1182
|
+
discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
|
|
1183
|
+
},
|
|
1184
|
+
{
|
|
1185
|
+
name: "MerkleDistributor",
|
|
1186
|
+
discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
|
|
1187
|
+
}
|
|
1188
|
+
],
|
|
1189
|
+
events: [
|
|
1190
|
+
{
|
|
1191
|
+
name: "ClaimClosedEvent",
|
|
1192
|
+
discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
name: "ClaimedEvent",
|
|
1196
|
+
discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
name: "NewClaimEvent",
|
|
1200
|
+
discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
|
|
1201
|
+
}
|
|
1202
|
+
],
|
|
1203
|
+
errors: [
|
|
1204
|
+
{
|
|
1205
|
+
code: 6e3,
|
|
1206
|
+
name: "InsufficientUnlockedTokens",
|
|
1207
|
+
msg: "Insufficient unlocked tokens"
|
|
1208
|
+
},
|
|
1209
|
+
{
|
|
1210
|
+
code: 6001,
|
|
1211
|
+
name: "InvalidProof",
|
|
1212
|
+
msg: "Invalid Merkle proof"
|
|
1213
|
+
},
|
|
1214
|
+
{
|
|
1215
|
+
code: 6002,
|
|
1216
|
+
name: "ExceededMaxClaim",
|
|
1217
|
+
msg: "Exceeded maximum claim amount"
|
|
1218
|
+
},
|
|
1219
|
+
{
|
|
1220
|
+
code: 6003,
|
|
1221
|
+
name: "MaxNodesExceeded",
|
|
1222
|
+
msg: "Exceeded maximum node count"
|
|
1223
|
+
},
|
|
1224
|
+
{
|
|
1225
|
+
code: 6004,
|
|
1226
|
+
name: "Unauthorized",
|
|
1227
|
+
msg: "Account is not authorized to execute this instruction"
|
|
1228
|
+
},
|
|
1229
|
+
{
|
|
1230
|
+
code: 6005,
|
|
1231
|
+
name: "OwnerMismatch",
|
|
1232
|
+
msg: "Token account owner did not match intended owner"
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
code: 6006,
|
|
1236
|
+
name: "ClawbackBeforeStart",
|
|
1237
|
+
msg: "Attempted clawback before start"
|
|
1238
|
+
},
|
|
1239
|
+
{
|
|
1240
|
+
code: 6007,
|
|
1241
|
+
name: "ClawbackAlreadyClaimed",
|
|
1242
|
+
msg: "Clawback already claimed"
|
|
1243
|
+
},
|
|
1244
|
+
{
|
|
1245
|
+
code: 6008,
|
|
1246
|
+
name: "SameClawbackReceiver",
|
|
1247
|
+
msg: "New and old Clawback receivers are identical"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
code: 6009,
|
|
1251
|
+
name: "ClawbackReceiverIsTokenVault",
|
|
1252
|
+
msg: "Clawback receiver can not be the Token Vault"
|
|
1253
|
+
},
|
|
1254
|
+
{
|
|
1255
|
+
code: 6010,
|
|
1256
|
+
name: "SameAdmin",
|
|
1257
|
+
msg: "New and old admin are identical"
|
|
1258
|
+
},
|
|
1259
|
+
{
|
|
1260
|
+
code: 6011,
|
|
1261
|
+
name: "ClaimExpired",
|
|
1262
|
+
msg: "Claim window expired"
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
code: 6012,
|
|
1266
|
+
name: "ArithmeticError",
|
|
1267
|
+
msg: "Arithmetic Error (overflow/underflow)"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
code: 6013,
|
|
1271
|
+
name: "StartTimestampAfterEnd",
|
|
1272
|
+
msg: "Start Timestamp cannot be after end Timestamp"
|
|
1273
|
+
},
|
|
1274
|
+
{
|
|
1275
|
+
code: 6014,
|
|
1276
|
+
name: "TimestampsNotInFuture",
|
|
1277
|
+
msg: "Timestamps cannot be in the past"
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
code: 6015,
|
|
1281
|
+
name: "InvalidMint",
|
|
1282
|
+
msg: "Invalid Mint"
|
|
1283
|
+
},
|
|
1284
|
+
{
|
|
1285
|
+
code: 6016,
|
|
1286
|
+
name: "ClaimIsClosed",
|
|
1287
|
+
msg: "Claim is closed"
|
|
1288
|
+
},
|
|
1289
|
+
{
|
|
1290
|
+
code: 6017,
|
|
1291
|
+
name: "ClaimsAreNotClosable",
|
|
1292
|
+
msg: "Claims are not closable"
|
|
1293
|
+
},
|
|
1294
|
+
{
|
|
1295
|
+
code: 6018,
|
|
1296
|
+
name: "InvalidUnlockPeriod",
|
|
1297
|
+
msg: "Invalid unlock period"
|
|
1298
|
+
},
|
|
1299
|
+
{
|
|
1300
|
+
code: 6019,
|
|
1301
|
+
name: "DurationUpdateNotAllowed",
|
|
1302
|
+
msg: "Duration update is not allowed"
|
|
1303
|
+
},
|
|
1304
|
+
{
|
|
1305
|
+
code: 6020,
|
|
1306
|
+
name: "NoVestingAmount",
|
|
1307
|
+
msg: "Vesting amounts are not set"
|
|
1308
|
+
},
|
|
1309
|
+
{
|
|
1310
|
+
code: 6021,
|
|
1311
|
+
name: "VestingAlreadyFinished",
|
|
1312
|
+
msg: "Vesting already finished"
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
code: 6022,
|
|
1316
|
+
name: "InvalidAmounts",
|
|
1317
|
+
msg: "Provided amounts are invalid"
|
|
1318
|
+
},
|
|
1319
|
+
{
|
|
1320
|
+
code: 6023,
|
|
1321
|
+
name: "ClaimsLimitReached",
|
|
1322
|
+
msg: "Claims limit has been reached"
|
|
1323
|
+
}
|
|
1324
|
+
],
|
|
1325
|
+
types: [
|
|
1326
|
+
{
|
|
1327
|
+
name: "ClaimClosedEvent",
|
|
1328
|
+
docs: ["Emitted when a new claim is created."],
|
|
1329
|
+
type: {
|
|
1330
|
+
kind: "struct",
|
|
1331
|
+
fields: [
|
|
1332
|
+
{
|
|
1333
|
+
name: "claimant",
|
|
1334
|
+
docs: ["User that claimed."],
|
|
1335
|
+
type: "pubkey"
|
|
1336
|
+
},
|
|
1337
|
+
{
|
|
1338
|
+
name: "timestamp",
|
|
1339
|
+
docs: ["Timestamp."],
|
|
1340
|
+
type: "u64"
|
|
1341
|
+
}
|
|
1342
|
+
]
|
|
1343
|
+
}
|
|
1344
|
+
},
|
|
1345
|
+
{
|
|
1346
|
+
name: "ClaimStatus",
|
|
1347
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1348
|
+
type: {
|
|
1349
|
+
kind: "struct",
|
|
1350
|
+
fields: [
|
|
1351
|
+
{
|
|
1352
|
+
name: "claimant",
|
|
1353
|
+
docs: ["Authority that claimed the tokens."],
|
|
1354
|
+
type: "pubkey"
|
|
1355
|
+
},
|
|
1356
|
+
{
|
|
1357
|
+
name: "locked_amount",
|
|
1358
|
+
docs: ["Locked amount"],
|
|
1359
|
+
type: "u64"
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
name: "locked_amount_withdrawn",
|
|
1363
|
+
docs: ["Locked amount withdrawn"],
|
|
1364
|
+
type: "u64"
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
name: "unlocked_amount",
|
|
1368
|
+
docs: ["Unlocked amount"],
|
|
1369
|
+
type: "u64"
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
name: "last_claim_ts",
|
|
1373
|
+
docs: ["Last claim time"],
|
|
1374
|
+
type: "u64"
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
name: "last_amount_per_unlock",
|
|
1378
|
+
docs: ["Track amount per unlock, can be useful for non-linear vesting"],
|
|
1379
|
+
type: "u64"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
name: "closed",
|
|
1383
|
+
docs: ["Whether claim is closed"],
|
|
1384
|
+
type: "bool"
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
name: "distributor",
|
|
1388
|
+
docs: [
|
|
1389
|
+
"Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
|
|
1390
|
+
],
|
|
1391
|
+
type: "pubkey"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
name: "claims_count",
|
|
1395
|
+
docs: ["Number of time amount has been claimed"],
|
|
1396
|
+
type: "u16"
|
|
1397
|
+
},
|
|
1398
|
+
{
|
|
1399
|
+
name: "closed_ts",
|
|
1400
|
+
docs: ["Time when claim has been closed"],
|
|
1401
|
+
type: "u64"
|
|
1402
|
+
},
|
|
1403
|
+
{
|
|
1404
|
+
name: "buffer_2",
|
|
1405
|
+
docs: ["Buffer for additional fields"],
|
|
1406
|
+
type: {
|
|
1407
|
+
array: ["u8", 22]
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
]
|
|
1411
|
+
}
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
name: "ClaimedEvent",
|
|
1415
|
+
docs: ["Emitted when tokens are claimed."],
|
|
1416
|
+
type: {
|
|
1417
|
+
kind: "struct",
|
|
1418
|
+
fields: [
|
|
1419
|
+
{
|
|
1420
|
+
name: "claimant",
|
|
1421
|
+
docs: ["User that claimed."],
|
|
1422
|
+
type: "pubkey"
|
|
1423
|
+
},
|
|
1424
|
+
{
|
|
1425
|
+
name: "amount",
|
|
1426
|
+
docs: ["Amount of tokens to distribute."],
|
|
1427
|
+
type: "u64"
|
|
1428
|
+
}
|
|
1429
|
+
]
|
|
1430
|
+
}
|
|
1431
|
+
},
|
|
1432
|
+
{
|
|
1433
|
+
name: "CompressedClaimStatus",
|
|
1434
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1435
|
+
type: {
|
|
1436
|
+
kind: "struct",
|
|
1437
|
+
fields: [
|
|
1438
|
+
{
|
|
1439
|
+
name: "state",
|
|
1440
|
+
type: {
|
|
1441
|
+
defined: {
|
|
1442
|
+
name: "State"
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
}
|
|
1446
|
+
]
|
|
1447
|
+
}
|
|
1448
|
+
},
|
|
1449
|
+
{
|
|
1450
|
+
name: "MerkleDistributor",
|
|
1451
|
+
docs: ["State for the account which distributes tokens."],
|
|
1452
|
+
type: {
|
|
1453
|
+
kind: "struct",
|
|
1454
|
+
fields: [
|
|
1455
|
+
{
|
|
1456
|
+
name: "bump",
|
|
1457
|
+
docs: ["Bump seed."],
|
|
1458
|
+
type: "u8"
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
name: "version",
|
|
1462
|
+
docs: ["Version of the airdrop"],
|
|
1463
|
+
type: "u64"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
name: "root",
|
|
1467
|
+
docs: ["The 256-bit merkle root."],
|
|
1468
|
+
type: {
|
|
1469
|
+
array: ["u8", 32]
|
|
1470
|
+
}
|
|
1471
|
+
},
|
|
1472
|
+
{
|
|
1473
|
+
name: "mint",
|
|
1474
|
+
docs: ["[Mint] of the token to be distributed."],
|
|
1475
|
+
type: "pubkey"
|
|
1476
|
+
},
|
|
1477
|
+
{
|
|
1478
|
+
name: "token_vault",
|
|
1479
|
+
docs: ["Token Address of the vault"],
|
|
1480
|
+
type: "pubkey"
|
|
1481
|
+
},
|
|
1482
|
+
{
|
|
1483
|
+
name: "max_total_claim",
|
|
1484
|
+
docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
|
|
1485
|
+
type: "u64"
|
|
1486
|
+
},
|
|
1487
|
+
{
|
|
1488
|
+
name: "max_num_nodes",
|
|
1489
|
+
docs: ["Maximum number of nodes in [MerkleDistributor]."],
|
|
1490
|
+
type: "u64"
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
name: "unlock_period",
|
|
1494
|
+
docs: ["Time step (period) in seconds per which the unlock occurs"],
|
|
1495
|
+
type: "u64"
|
|
1496
|
+
},
|
|
1497
|
+
{
|
|
1498
|
+
name: "total_amount_claimed",
|
|
1499
|
+
docs: ["Total amount of tokens that have been claimed."],
|
|
1500
|
+
type: "u64"
|
|
1501
|
+
},
|
|
1502
|
+
{
|
|
1503
|
+
name: "num_nodes_claimed",
|
|
1504
|
+
docs: ["Number of nodes that have been claimed."],
|
|
1505
|
+
type: "u64"
|
|
1506
|
+
},
|
|
1507
|
+
{
|
|
1508
|
+
name: "start_ts",
|
|
1509
|
+
docs: ["Lockup time start (Unix Timestamp)"],
|
|
1510
|
+
type: "u64"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
name: "end_ts",
|
|
1514
|
+
docs: ["Lockup time end (Unix Timestamp)"],
|
|
1515
|
+
type: "u64"
|
|
1516
|
+
},
|
|
1517
|
+
{
|
|
1518
|
+
name: "clawback_start_ts",
|
|
1519
|
+
docs: ["Clawback start (Unix Timestamp)"],
|
|
1520
|
+
type: "u64"
|
|
1521
|
+
},
|
|
1522
|
+
{
|
|
1523
|
+
name: "clawback_receiver",
|
|
1524
|
+
docs: ["Clawback receiver"],
|
|
1525
|
+
type: "pubkey"
|
|
1526
|
+
},
|
|
1527
|
+
{
|
|
1528
|
+
name: "admin",
|
|
1529
|
+
docs: ["Admin wallet"],
|
|
1530
|
+
type: "pubkey"
|
|
1531
|
+
},
|
|
1532
|
+
{
|
|
1533
|
+
name: "clawed_back",
|
|
1534
|
+
docs: ["Whether or not the distributor has been clawed back"],
|
|
1535
|
+
type: "bool"
|
|
1536
|
+
},
|
|
1537
|
+
{
|
|
1538
|
+
name: "claims_closable_by_admin",
|
|
1539
|
+
docs: ["Whether claims are closable by the admin or not"],
|
|
1540
|
+
type: "bool"
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
name: "can_update_duration",
|
|
1544
|
+
docs: ["Whether admin can update vesting duration"],
|
|
1545
|
+
type: "bool"
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: "total_amount_unlocked",
|
|
1549
|
+
docs: ["Total amount of funds unlocked (cliff/instant)"],
|
|
1550
|
+
type: "u64"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
name: "total_amount_locked",
|
|
1554
|
+
docs: ["Total amount of funds locked (vested)"],
|
|
1555
|
+
type: "u64"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
name: "last_duration_update_ts",
|
|
1559
|
+
docs: ["Timestamp when update was last called"],
|
|
1560
|
+
type: "u64"
|
|
1561
|
+
},
|
|
1562
|
+
{
|
|
1563
|
+
name: "total_claimable_pre_update",
|
|
1564
|
+
docs: [
|
|
1565
|
+
"Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
|
|
1566
|
+
],
|
|
1567
|
+
type: "u64"
|
|
1568
|
+
},
|
|
1569
|
+
{
|
|
1570
|
+
name: "clawed_back_ts",
|
|
1571
|
+
docs: ["Timestamp when funds were clawed back"],
|
|
1572
|
+
type: "u64"
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
name: "claims_closable_by_claimant",
|
|
1576
|
+
docs: ["Whether claims are closable by claimant or not"],
|
|
1577
|
+
type: "bool"
|
|
1578
|
+
},
|
|
1579
|
+
{
|
|
1580
|
+
name: "claims_limit",
|
|
1581
|
+
docs: ["Limit number of claims"],
|
|
1582
|
+
type: "u16"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
name: "buffer_2",
|
|
1586
|
+
docs: ["Buffer for additional fields"],
|
|
1587
|
+
type: {
|
|
1588
|
+
array: ["u8", 20]
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
{
|
|
1592
|
+
name: "buffer_3",
|
|
1593
|
+
docs: ["Buffer for additional fields"],
|
|
1594
|
+
type: {
|
|
1595
|
+
array: ["u8", 32]
|
|
1596
|
+
}
|
|
1597
|
+
}
|
|
1598
|
+
]
|
|
1599
|
+
}
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
name: "NewClaimEvent",
|
|
1603
|
+
docs: ["Emitted when a new claim is created."],
|
|
1604
|
+
type: {
|
|
1605
|
+
kind: "struct",
|
|
1606
|
+
fields: [
|
|
1607
|
+
{
|
|
1608
|
+
name: "claimant",
|
|
1609
|
+
docs: ["User that claimed."],
|
|
1610
|
+
type: "pubkey"
|
|
1611
|
+
},
|
|
1612
|
+
{
|
|
1613
|
+
name: "timestamp",
|
|
1614
|
+
docs: ["Timestamp."],
|
|
1615
|
+
type: "u64"
|
|
1616
|
+
}
|
|
1617
|
+
]
|
|
1618
|
+
}
|
|
1619
|
+
},
|
|
1620
|
+
{
|
|
1621
|
+
name: "State",
|
|
1622
|
+
type: {
|
|
1623
|
+
kind: "enum",
|
|
1624
|
+
variants: [
|
|
1625
|
+
{
|
|
1626
|
+
name: "Claimed"
|
|
1627
|
+
},
|
|
1628
|
+
{
|
|
1629
|
+
name: "Closed"
|
|
1630
|
+
}
|
|
1631
|
+
]
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
]
|
|
1635
|
+
};
|
|
1636
|
+
|
|
328
1637
|
// solana/constants.ts
|
|
329
1638
|
var constants_exports = {};
|
|
330
1639
|
__export(constants_exports, {
|
|
@@ -350,7 +1659,7 @@ var ALIGNED_DISTRIBUTOR_PREFIX = Buffer.from("aligned-distributor", "utf-8");
|
|
|
350
1659
|
var TEST_ORACLE_PREFIX = Buffer.from("test-oracle", "utf-8");
|
|
351
1660
|
var CLAIM_STATUS_PREFIX = Buffer.from("ClaimStatus", "utf-8");
|
|
352
1661
|
var ALIGNED_PRECISION_FACTOR_POW = 9;
|
|
353
|
-
var AIRDROP_CLAIM_FEE = BigInt(
|
|
1662
|
+
var AIRDROP_CLAIM_FEE = BigInt(1e7);
|
|
354
1663
|
var STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
355
1664
|
var ONE_IN_BASIS_POINTS = BigInt(1e4);
|
|
356
1665
|
var ALIGNED_DISTRIBUTOR_PROGRAM_ID = {
|
|
@@ -365,107 +1674,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
|
|
|
365
1674
|
[common.ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
366
1675
|
[common.ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
|
|
367
1676
|
};
|
|
368
|
-
var _ClaimStatus = class _ClaimStatus {
|
|
369
|
-
constructor(fields) {
|
|
370
|
-
this.claimant = fields.claimant;
|
|
371
|
-
this.lockedAmount = fields.lockedAmount;
|
|
372
|
-
this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
|
|
373
|
-
this.unlockedAmount = fields.unlockedAmount;
|
|
374
|
-
this.lastClaimTs = fields.lastClaimTs;
|
|
375
|
-
this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
|
|
376
|
-
this.closed = fields.closed;
|
|
377
|
-
this.distributor = fields.distributor;
|
|
378
|
-
this.claimsCount = fields.claimsCount;
|
|
379
|
-
this.closedTs = fields.closedTs;
|
|
380
|
-
this.buffer2 = fields.buffer2;
|
|
381
|
-
}
|
|
382
|
-
static async fetch(c, address, programId = PROGRAM_ID) {
|
|
383
|
-
const info = await c.getAccountInfo(address);
|
|
384
|
-
if (info === null) {
|
|
385
|
-
return null;
|
|
386
|
-
}
|
|
387
|
-
if (!info.owner.equals(programId)) {
|
|
388
|
-
throw new Error("account doesn't belong to this program");
|
|
389
|
-
}
|
|
390
|
-
return this.decode(info.data);
|
|
391
|
-
}
|
|
392
|
-
static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
|
|
393
|
-
const infos = await c.getMultipleAccountsInfo(addresses);
|
|
394
|
-
return infos.map((info) => {
|
|
395
|
-
if (info === null) {
|
|
396
|
-
return null;
|
|
397
|
-
}
|
|
398
|
-
if (!info.owner.equals(programId)) {
|
|
399
|
-
throw new Error("account doesn't belong to this program");
|
|
400
|
-
}
|
|
401
|
-
return this.decode(info.data);
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
static decode(data) {
|
|
405
|
-
if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
|
|
406
|
-
throw new Error("invalid account discriminator");
|
|
407
|
-
}
|
|
408
|
-
const dec = _ClaimStatus.layout.decode(data.slice(8));
|
|
409
|
-
return new _ClaimStatus({
|
|
410
|
-
claimant: dec.claimant,
|
|
411
|
-
lockedAmount: dec.lockedAmount,
|
|
412
|
-
lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
|
|
413
|
-
unlockedAmount: dec.unlockedAmount,
|
|
414
|
-
lastClaimTs: dec.lastClaimTs,
|
|
415
|
-
lastAmountPerUnlock: dec.lastAmountPerUnlock,
|
|
416
|
-
closed: dec.closed,
|
|
417
|
-
distributor: dec.distributor,
|
|
418
|
-
claimsCount: dec.claimsCount,
|
|
419
|
-
closedTs: dec.closedTs,
|
|
420
|
-
buffer2: dec.buffer2
|
|
421
|
-
});
|
|
422
|
-
}
|
|
423
|
-
toJSON() {
|
|
424
|
-
return {
|
|
425
|
-
claimant: this.claimant.toString(),
|
|
426
|
-
lockedAmount: this.lockedAmount.toString(),
|
|
427
|
-
lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
|
|
428
|
-
unlockedAmount: this.unlockedAmount.toString(),
|
|
429
|
-
lastClaimTs: this.lastClaimTs.toString(),
|
|
430
|
-
lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
|
|
431
|
-
closed: this.closed,
|
|
432
|
-
distributor: this.distributor.toString(),
|
|
433
|
-
claimsCount: this.claimsCount,
|
|
434
|
-
closedTs: this.closedTs.toString(),
|
|
435
|
-
buffer2: this.buffer2
|
|
436
|
-
};
|
|
437
|
-
}
|
|
438
|
-
static fromJSON(obj) {
|
|
439
|
-
return new _ClaimStatus({
|
|
440
|
-
claimant: new web3_js.PublicKey(obj.claimant),
|
|
441
|
-
lockedAmount: new BN6__default.default(obj.lockedAmount),
|
|
442
|
-
lockedAmountWithdrawn: new BN6__default.default(obj.lockedAmountWithdrawn),
|
|
443
|
-
unlockedAmount: new BN6__default.default(obj.unlockedAmount),
|
|
444
|
-
lastClaimTs: new BN6__default.default(obj.lastClaimTs),
|
|
445
|
-
lastAmountPerUnlock: new BN6__default.default(obj.lastAmountPerUnlock),
|
|
446
|
-
closed: obj.closed,
|
|
447
|
-
distributor: new web3_js.PublicKey(obj.distributor),
|
|
448
|
-
claimsCount: obj.claimsCount,
|
|
449
|
-
closedTs: new BN6__default.default(obj.closedTs),
|
|
450
|
-
buffer2: obj.buffer2
|
|
451
|
-
});
|
|
452
|
-
}
|
|
453
|
-
};
|
|
454
|
-
_ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
|
|
455
|
-
_ClaimStatus.layout = borsh8__namespace.struct([
|
|
456
|
-
borsh8__namespace.publicKey("claimant"),
|
|
457
|
-
borsh8__namespace.u64("lockedAmount"),
|
|
458
|
-
borsh8__namespace.u64("lockedAmountWithdrawn"),
|
|
459
|
-
borsh8__namespace.u64("unlockedAmount"),
|
|
460
|
-
borsh8__namespace.u64("lastClaimTs"),
|
|
461
|
-
borsh8__namespace.u64("lastAmountPerUnlock"),
|
|
462
|
-
borsh8__namespace.bool("closed"),
|
|
463
|
-
borsh8__namespace.publicKey("distributor"),
|
|
464
|
-
borsh8__namespace.u16("claimsCount"),
|
|
465
|
-
borsh8__namespace.u64("closedTs"),
|
|
466
|
-
borsh8__namespace.array(borsh8__namespace.u8(), 22, "buffer2")
|
|
467
|
-
]);
|
|
468
|
-
var ClaimStatus = _ClaimStatus;
|
|
469
1677
|
var _MerkleDistributor = class _MerkleDistributor {
|
|
470
1678
|
constructor(fields) {
|
|
471
1679
|
this.bump = fields.bump;
|
|
@@ -587,28 +1795,28 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
587
1795
|
static fromJSON(obj) {
|
|
588
1796
|
return new _MerkleDistributor({
|
|
589
1797
|
bump: obj.bump,
|
|
590
|
-
version: new
|
|
1798
|
+
version: new BN5__default.default(obj.version),
|
|
591
1799
|
root: obj.root,
|
|
592
1800
|
mint: new web3_js.PublicKey(obj.mint),
|
|
593
1801
|
tokenVault: new web3_js.PublicKey(obj.tokenVault),
|
|
594
|
-
maxTotalClaim: new
|
|
595
|
-
maxNumNodes: new
|
|
596
|
-
unlockPeriod: new
|
|
597
|
-
totalAmountClaimed: new
|
|
598
|
-
numNodesClaimed: new
|
|
599
|
-
startTs: new
|
|
600
|
-
endTs: new
|
|
601
|
-
clawbackStartTs: new
|
|
1802
|
+
maxTotalClaim: new BN5__default.default(obj.maxTotalClaim),
|
|
1803
|
+
maxNumNodes: new BN5__default.default(obj.maxNumNodes),
|
|
1804
|
+
unlockPeriod: new BN5__default.default(obj.unlockPeriod),
|
|
1805
|
+
totalAmountClaimed: new BN5__default.default(obj.totalAmountClaimed),
|
|
1806
|
+
numNodesClaimed: new BN5__default.default(obj.numNodesClaimed),
|
|
1807
|
+
startTs: new BN5__default.default(obj.startTs),
|
|
1808
|
+
endTs: new BN5__default.default(obj.endTs),
|
|
1809
|
+
clawbackStartTs: new BN5__default.default(obj.clawbackStartTs),
|
|
602
1810
|
clawbackReceiver: new web3_js.PublicKey(obj.clawbackReceiver),
|
|
603
1811
|
admin: new web3_js.PublicKey(obj.admin),
|
|
604
1812
|
clawedBack: obj.clawedBack,
|
|
605
1813
|
claimsClosableByAdmin: obj.claimsClosableByAdmin,
|
|
606
1814
|
canUpdateDuration: obj.canUpdateDuration,
|
|
607
|
-
totalAmountUnlocked: new
|
|
608
|
-
totalAmountLocked: new
|
|
609
|
-
lastDurationUpdateTs: new
|
|
610
|
-
totalClaimablePreUpdate: new
|
|
611
|
-
clawedBackTs: new
|
|
1815
|
+
totalAmountUnlocked: new BN5__default.default(obj.totalAmountUnlocked),
|
|
1816
|
+
totalAmountLocked: new BN5__default.default(obj.totalAmountLocked),
|
|
1817
|
+
lastDurationUpdateTs: new BN5__default.default(obj.lastDurationUpdateTs),
|
|
1818
|
+
totalClaimablePreUpdate: new BN5__default.default(obj.totalClaimablePreUpdate),
|
|
1819
|
+
clawedBackTs: new BN5__default.default(obj.clawedBackTs),
|
|
612
1820
|
claimsClosableByClaimant: obj.claimsClosableByClaimant,
|
|
613
1821
|
claimsLimit: obj.claimsLimit,
|
|
614
1822
|
buffer2: obj.buffer2,
|
|
@@ -617,34 +1825,34 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
617
1825
|
}
|
|
618
1826
|
};
|
|
619
1827
|
_MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
|
|
620
|
-
_MerkleDistributor.layout =
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
1828
|
+
_MerkleDistributor.layout = borsh7__namespace.struct([
|
|
1829
|
+
borsh7__namespace.u8("bump"),
|
|
1830
|
+
borsh7__namespace.u64("version"),
|
|
1831
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
|
|
1832
|
+
borsh7__namespace.publicKey("mint"),
|
|
1833
|
+
borsh7__namespace.publicKey("tokenVault"),
|
|
1834
|
+
borsh7__namespace.u64("maxTotalClaim"),
|
|
1835
|
+
borsh7__namespace.u64("maxNumNodes"),
|
|
1836
|
+
borsh7__namespace.u64("unlockPeriod"),
|
|
1837
|
+
borsh7__namespace.u64("totalAmountClaimed"),
|
|
1838
|
+
borsh7__namespace.u64("numNodesClaimed"),
|
|
1839
|
+
borsh7__namespace.u64("startTs"),
|
|
1840
|
+
borsh7__namespace.u64("endTs"),
|
|
1841
|
+
borsh7__namespace.u64("clawbackStartTs"),
|
|
1842
|
+
borsh7__namespace.publicKey("clawbackReceiver"),
|
|
1843
|
+
borsh7__namespace.publicKey("admin"),
|
|
1844
|
+
borsh7__namespace.bool("clawedBack"),
|
|
1845
|
+
borsh7__namespace.bool("claimsClosableByAdmin"),
|
|
1846
|
+
borsh7__namespace.bool("canUpdateDuration"),
|
|
1847
|
+
borsh7__namespace.u64("totalAmountUnlocked"),
|
|
1848
|
+
borsh7__namespace.u64("totalAmountLocked"),
|
|
1849
|
+
borsh7__namespace.u64("lastDurationUpdateTs"),
|
|
1850
|
+
borsh7__namespace.u64("totalClaimablePreUpdate"),
|
|
1851
|
+
borsh7__namespace.u64("clawedBackTs"),
|
|
1852
|
+
borsh7__namespace.bool("claimsClosableByClaimant"),
|
|
1853
|
+
borsh7__namespace.u16("claimsLimit"),
|
|
1854
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 20, "buffer2"),
|
|
1855
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "buffer3")
|
|
648
1856
|
]);
|
|
649
1857
|
var MerkleDistributor = _MerkleDistributor;
|
|
650
1858
|
|
|
@@ -1656,9 +2864,9 @@ function getEventAuthorityPda(programId) {
|
|
|
1656
2864
|
const seeds = [buffer.Buffer.from("__event_authority")];
|
|
1657
2865
|
return web3_js.PublicKey.findProgramAddressSync(seeds, programId)[0];
|
|
1658
2866
|
}
|
|
1659
|
-
async function wrappedSignAndExecuteTransaction(
|
|
2867
|
+
async function wrappedSignAndExecuteTransaction(...args) {
|
|
1660
2868
|
try {
|
|
1661
|
-
return await solana.signAndExecuteTransaction(
|
|
2869
|
+
return await solana.signAndExecuteTransaction(...args);
|
|
1662
2870
|
} catch (err) {
|
|
1663
2871
|
if (err instanceof Error) {
|
|
1664
2872
|
const parsed = fromTxError(err);
|
|
@@ -1699,6 +2907,10 @@ var BaseDistributorClient = class {
|
|
|
1699
2907
|
this.connection = new web3_js.Connection(clusterUrl, this.commitment);
|
|
1700
2908
|
this.programId = programId !== "" ? new web3_js.PublicKey(programId) : new web3_js.PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
|
|
1701
2909
|
this.sendThrottler = sendThrottler ?? solana.buildSendThrottler(sendRate);
|
|
2910
|
+
const merkleDistributorProgram = {
|
|
2911
|
+
...merkle_distributor_default
|
|
2912
|
+
};
|
|
2913
|
+
this.merkleDistributorProgram = new anchor.Program(merkleDistributorProgram, { connection: this.connection });
|
|
1702
2914
|
}
|
|
1703
2915
|
getConnection() {
|
|
1704
2916
|
return this.connection;
|
|
@@ -1733,7 +2945,7 @@ var BaseDistributorClient = class {
|
|
|
1733
2945
|
};
|
|
1734
2946
|
if (extParams.isNative) {
|
|
1735
2947
|
ixs.push(
|
|
1736
|
-
...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new
|
|
2948
|
+
...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5__default.default(data.maxTotalClaim))
|
|
1737
2949
|
);
|
|
1738
2950
|
}
|
|
1739
2951
|
const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
|
|
@@ -1774,7 +2986,14 @@ var BaseDistributorClient = class {
|
|
|
1774
2986
|
return { distributorPublicKey, ixs };
|
|
1775
2987
|
}
|
|
1776
2988
|
async create(data, extParams) {
|
|
1777
|
-
const
|
|
2989
|
+
const invoker = extParams.invoker.publicKey;
|
|
2990
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
2991
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
2992
|
+
const { ixs, distributorPublicKey } = await solana.createAndEstimateTransaction(
|
|
2993
|
+
(params) => this.prepareCreateInstructions(data, params),
|
|
2994
|
+
executionParams,
|
|
2995
|
+
(q) => q.ixs
|
|
2996
|
+
);
|
|
1778
2997
|
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1779
2998
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1780
2999
|
this.connection,
|
|
@@ -1785,7 +3004,7 @@ var BaseDistributorClient = class {
|
|
|
1785
3004
|
context,
|
|
1786
3005
|
commitment: this.getCommitment()
|
|
1787
3006
|
},
|
|
1788
|
-
{ sendThrottler: this.sendThrottler }
|
|
3007
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1789
3008
|
);
|
|
1790
3009
|
return {
|
|
1791
3010
|
ixs,
|
|
@@ -1793,23 +3012,29 @@ var BaseDistributorClient = class {
|
|
|
1793
3012
|
metadataId: distributorPublicKey.toBase58()
|
|
1794
3013
|
};
|
|
1795
3014
|
}
|
|
1796
|
-
async claim(data, extParams) {
|
|
1797
|
-
const
|
|
1798
|
-
const
|
|
3015
|
+
async claim(data, extParams, _serviceTransfer) {
|
|
3016
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3017
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3018
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3019
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
3020
|
+
(params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
|
|
3021
|
+
executionParams
|
|
3022
|
+
);
|
|
3023
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1799
3024
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1800
3025
|
this.connection,
|
|
1801
|
-
|
|
3026
|
+
executionParams.invoker,
|
|
1802
3027
|
tx,
|
|
1803
3028
|
{
|
|
1804
3029
|
hash,
|
|
1805
3030
|
context,
|
|
1806
3031
|
commitment: this.getCommitment()
|
|
1807
3032
|
},
|
|
1808
|
-
{ sendThrottler: this.sendThrottler }
|
|
3033
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1809
3034
|
);
|
|
1810
3035
|
return { ixs, txId: signature };
|
|
1811
3036
|
}
|
|
1812
|
-
async prepareClaimInstructions(data, extParams) {
|
|
3037
|
+
async prepareClaimInstructions(data, extParams, _serviceTransfer) {
|
|
1813
3038
|
if (!extParams.invoker.publicKey) {
|
|
1814
3039
|
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
1815
3040
|
}
|
|
@@ -1836,7 +3061,7 @@ var BaseDistributorClient = class {
|
|
|
1836
3061
|
extParams.invoker.publicKey
|
|
1837
3062
|
);
|
|
1838
3063
|
const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
|
|
1839
|
-
const claimStatus = await
|
|
3064
|
+
const claimStatus = await this.getClaim(claimStatusPublicKey);
|
|
1840
3065
|
const accounts = {
|
|
1841
3066
|
distributor: distributorPublicKey,
|
|
1842
3067
|
claimStatus: claimStatusPublicKey,
|
|
@@ -1851,32 +3076,43 @@ var BaseDistributorClient = class {
|
|
|
1851
3076
|
};
|
|
1852
3077
|
if (!claimStatus) {
|
|
1853
3078
|
const args = {
|
|
1854
|
-
amountLocked: new
|
|
1855
|
-
amountUnlocked: new
|
|
3079
|
+
amountLocked: new BN5__default.default(data.amountLocked),
|
|
3080
|
+
amountUnlocked: new BN5__default.default(data.amountUnlocked),
|
|
1856
3081
|
proof: data.proof
|
|
1857
3082
|
};
|
|
1858
3083
|
ixs.push(newClaim(args, accounts, this.programId));
|
|
1859
3084
|
}
|
|
1860
|
-
const nowTs = new
|
|
1861
|
-
if (claimStatus || new
|
|
3085
|
+
const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
|
|
3086
|
+
if (claimStatus || new BN5__default.default(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
|
|
1862
3087
|
ixs.push(claimLocked(accounts, this.programId));
|
|
1863
3088
|
}
|
|
1864
|
-
ixs.push(
|
|
3089
|
+
ixs.push(
|
|
3090
|
+
this.prepareClaimFeeInstruction(
|
|
3091
|
+
extParams.invoker.publicKey,
|
|
3092
|
+
typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
|
|
3093
|
+
)
|
|
3094
|
+
);
|
|
1865
3095
|
return ixs;
|
|
1866
3096
|
}
|
|
1867
3097
|
async closeClaim(data, extParams) {
|
|
1868
|
-
const
|
|
1869
|
-
const
|
|
3098
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3099
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3100
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3101
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
3102
|
+
(params) => this.prepareCloseClaimInstructions(data, params),
|
|
3103
|
+
executionParams
|
|
3104
|
+
);
|
|
3105
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1870
3106
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1871
3107
|
this.connection,
|
|
1872
|
-
|
|
3108
|
+
executionParams.invoker,
|
|
1873
3109
|
tx,
|
|
1874
3110
|
{
|
|
1875
3111
|
hash,
|
|
1876
3112
|
context,
|
|
1877
3113
|
commitment: this.getCommitment()
|
|
1878
3114
|
},
|
|
1879
|
-
{ sendThrottler: this.sendThrottler }
|
|
3115
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1880
3116
|
);
|
|
1881
3117
|
return { ixs, txId: signature };
|
|
1882
3118
|
}
|
|
@@ -1903,8 +3139,8 @@ var BaseDistributorClient = class {
|
|
|
1903
3139
|
program: this.programId
|
|
1904
3140
|
};
|
|
1905
3141
|
const closeClaimArgs = {
|
|
1906
|
-
amountLocked: data.amountLocked ? new
|
|
1907
|
-
amountUnlocked: data.amountUnlocked ? new
|
|
3142
|
+
amountLocked: data.amountLocked ? new BN5__default.default(data.amountLocked) : void 0,
|
|
3143
|
+
amountUnlocked: data.amountUnlocked ? new BN5__default.default(data.amountUnlocked) : void 0,
|
|
1908
3144
|
proof: data.proof
|
|
1909
3145
|
};
|
|
1910
3146
|
ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
|
|
@@ -1944,26 +3180,37 @@ var BaseDistributorClient = class {
|
|
|
1944
3180
|
return ixs;
|
|
1945
3181
|
}
|
|
1946
3182
|
async clawback(data, extParams) {
|
|
1947
|
-
const
|
|
1948
|
-
const
|
|
3183
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3184
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3185
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3186
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
3187
|
+
(params) => this.prepareClawbackInstructions(data, params),
|
|
3188
|
+
executionParams
|
|
3189
|
+
);
|
|
3190
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1949
3191
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1950
3192
|
this.connection,
|
|
1951
|
-
|
|
3193
|
+
executionParams.invoker,
|
|
1952
3194
|
tx,
|
|
1953
3195
|
{
|
|
1954
3196
|
hash,
|
|
1955
3197
|
context,
|
|
1956
3198
|
commitment: this.getCommitment()
|
|
1957
3199
|
},
|
|
1958
|
-
{ sendThrottler: this.sendThrottler }
|
|
3200
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1959
3201
|
);
|
|
1960
3202
|
return { ixs, txId: signature };
|
|
1961
3203
|
}
|
|
3204
|
+
async getClaim(claimStatus) {
|
|
3205
|
+
return this.connection.getAccountInfo(solana.pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
|
|
3206
|
+
}
|
|
1962
3207
|
async getClaims(data) {
|
|
1963
3208
|
const claimStatusPublicKeys = data.map(({ id, recipient }) => {
|
|
1964
3209
|
return getClaimantStatusPda(this.programId, new web3_js.PublicKey(id), new web3_js.PublicKey(recipient));
|
|
1965
3210
|
});
|
|
1966
|
-
return
|
|
3211
|
+
return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
|
|
3212
|
+
return accounts.map((account) => this.decodeClaimStatus(account));
|
|
3213
|
+
});
|
|
1967
3214
|
}
|
|
1968
3215
|
async getDistributors(data) {
|
|
1969
3216
|
const distributorPublicKeys = data.ids.map((distributorId) => new web3_js.PublicKey(distributorId));
|
|
@@ -1993,28 +3240,28 @@ var BaseDistributorClient = class {
|
|
|
1993
3240
|
account: MerkleDistributor.decode(account.data)
|
|
1994
3241
|
}));
|
|
1995
3242
|
}
|
|
1996
|
-
prepareClaimFeeInstruction(payer) {
|
|
3243
|
+
prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
|
|
1997
3244
|
return web3_js.SystemProgram.transfer({
|
|
1998
3245
|
fromPubkey: payer,
|
|
1999
3246
|
toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
|
|
2000
|
-
lamports:
|
|
3247
|
+
lamports: fee
|
|
2001
3248
|
});
|
|
2002
3249
|
}
|
|
2003
3250
|
getNewDistributorArgs(data) {
|
|
2004
3251
|
const args = {
|
|
2005
|
-
version: new
|
|
3252
|
+
version: new BN5__default.default(data.version),
|
|
2006
3253
|
root: data.root,
|
|
2007
|
-
maxTotalClaim: new
|
|
2008
|
-
maxNumNodes: new
|
|
2009
|
-
unlockPeriod: new
|
|
2010
|
-
startVestingTs: new
|
|
2011
|
-
endVestingTs: new
|
|
2012
|
-
clawbackStartTs: new
|
|
3254
|
+
maxTotalClaim: new BN5__default.default(data.maxTotalClaim),
|
|
3255
|
+
maxNumNodes: new BN5__default.default(data.maxNumNodes),
|
|
3256
|
+
unlockPeriod: new BN5__default.default(data.unlockPeriod),
|
|
3257
|
+
startVestingTs: new BN5__default.default(data.startVestingTs),
|
|
3258
|
+
endVestingTs: new BN5__default.default(data.endVestingTs),
|
|
3259
|
+
clawbackStartTs: new BN5__default.default(data.clawbackStartTs),
|
|
2013
3260
|
claimsClosableByAdmin: data.claimsClosableByAdmin,
|
|
2014
3261
|
claimsClosableByClaimant: data.claimsClosableByClaimant,
|
|
2015
3262
|
claimsLimit: data.claimsLimit
|
|
2016
3263
|
};
|
|
2017
|
-
const nowTs = new
|
|
3264
|
+
const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
|
|
2018
3265
|
const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
|
|
2019
3266
|
const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
|
|
2020
3267
|
if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
|
|
@@ -2022,7 +3269,34 @@ var BaseDistributorClient = class {
|
|
|
2022
3269
|
}
|
|
2023
3270
|
return args;
|
|
2024
3271
|
}
|
|
3272
|
+
unwrapExecutionParams(extParams) {
|
|
3273
|
+
return solana.unwrapExecutionParams(extParams, this.connection);
|
|
3274
|
+
}
|
|
3275
|
+
decodeClaimStatus(account) {
|
|
3276
|
+
if (!account) {
|
|
3277
|
+
return account;
|
|
3278
|
+
}
|
|
3279
|
+
try {
|
|
3280
|
+
return decode(this.merkleDistributorProgram, "claimStatus", account.data);
|
|
3281
|
+
} catch (baseClaimStatusError) {
|
|
3282
|
+
try {
|
|
3283
|
+
return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
|
|
3284
|
+
} catch (compressedClaimStatusError) {
|
|
3285
|
+
throw new Error("Couldn't decode claim status");
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
2025
3289
|
};
|
|
3290
|
+
function decode(program, accountName, accInfo, programKey) {
|
|
3291
|
+
const programId = program.programId?.toBase58() ?? "N/A";
|
|
3292
|
+
common.invariant(program, `Decoding program with key ${programId} is not available`);
|
|
3293
|
+
const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
|
|
3294
|
+
common.invariant(
|
|
3295
|
+
!!accountEntity,
|
|
3296
|
+
`Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
|
|
3297
|
+
);
|
|
3298
|
+
return program.coder.accounts.decode(accountName, accInfo);
|
|
3299
|
+
}
|
|
2026
3300
|
|
|
2027
3301
|
// solana/clients/SolanaDistributorClient.ts
|
|
2028
3302
|
var SolanaDistributorClient = class extends BaseDistributorClient {
|
|
@@ -2040,7 +3314,7 @@ var aligned_distributor_default = {
|
|
|
2040
3314
|
address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
2041
3315
|
metadata: {
|
|
2042
3316
|
name: "aligned_distributor",
|
|
2043
|
-
version: "1.
|
|
3317
|
+
version: "1.5.0",
|
|
2044
3318
|
spec: "0.1.0",
|
|
2045
3319
|
description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
|
|
2046
3320
|
},
|
|
@@ -2184,6 +3458,48 @@ var aligned_distributor_default = {
|
|
|
2184
3458
|
}
|
|
2185
3459
|
]
|
|
2186
3460
|
},
|
|
3461
|
+
{
|
|
3462
|
+
name: "migrate_test_oracle",
|
|
3463
|
+
discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
|
|
3464
|
+
accounts: [
|
|
3465
|
+
{
|
|
3466
|
+
name: "payer",
|
|
3467
|
+
writable: true,
|
|
3468
|
+
signer: true
|
|
3469
|
+
},
|
|
3470
|
+
{
|
|
3471
|
+
name: "mint"
|
|
3472
|
+
},
|
|
3473
|
+
{
|
|
3474
|
+
name: "creator"
|
|
3475
|
+
},
|
|
3476
|
+
{
|
|
3477
|
+
name: "test_oracle",
|
|
3478
|
+
writable: true,
|
|
3479
|
+
pda: {
|
|
3480
|
+
seeds: [
|
|
3481
|
+
{
|
|
3482
|
+
kind: "const",
|
|
3483
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3484
|
+
},
|
|
3485
|
+
{
|
|
3486
|
+
kind: "account",
|
|
3487
|
+
path: "mint"
|
|
3488
|
+
},
|
|
3489
|
+
{
|
|
3490
|
+
kind: "account",
|
|
3491
|
+
path: "creator"
|
|
3492
|
+
}
|
|
3493
|
+
]
|
|
3494
|
+
}
|
|
3495
|
+
},
|
|
3496
|
+
{
|
|
3497
|
+
name: "system_program",
|
|
3498
|
+
address: "11111111111111111111111111111111"
|
|
3499
|
+
}
|
|
3500
|
+
],
|
|
3501
|
+
args: []
|
|
3502
|
+
},
|
|
2187
3503
|
{
|
|
2188
3504
|
name: "new_distributor",
|
|
2189
3505
|
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
@@ -2269,6 +3585,48 @@ var aligned_distributor_default = {
|
|
|
2269
3585
|
}
|
|
2270
3586
|
]
|
|
2271
3587
|
},
|
|
3588
|
+
{
|
|
3589
|
+
name: "realloc_test_oracle",
|
|
3590
|
+
discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
|
|
3591
|
+
accounts: [
|
|
3592
|
+
{
|
|
3593
|
+
name: "payer",
|
|
3594
|
+
writable: true,
|
|
3595
|
+
signer: true
|
|
3596
|
+
},
|
|
3597
|
+
{
|
|
3598
|
+
name: "mint"
|
|
3599
|
+
},
|
|
3600
|
+
{
|
|
3601
|
+
name: "creator"
|
|
3602
|
+
},
|
|
3603
|
+
{
|
|
3604
|
+
name: "test_oracle",
|
|
3605
|
+
writable: true,
|
|
3606
|
+
pda: {
|
|
3607
|
+
seeds: [
|
|
3608
|
+
{
|
|
3609
|
+
kind: "const",
|
|
3610
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3611
|
+
},
|
|
3612
|
+
{
|
|
3613
|
+
kind: "account",
|
|
3614
|
+
path: "mint"
|
|
3615
|
+
},
|
|
3616
|
+
{
|
|
3617
|
+
kind: "account",
|
|
3618
|
+
path: "creator"
|
|
3619
|
+
}
|
|
3620
|
+
]
|
|
3621
|
+
}
|
|
3622
|
+
},
|
|
3623
|
+
{
|
|
3624
|
+
name: "system_program",
|
|
3625
|
+
address: "11111111111111111111111111111111"
|
|
3626
|
+
}
|
|
3627
|
+
],
|
|
3628
|
+
args: []
|
|
3629
|
+
},
|
|
2272
3630
|
{
|
|
2273
3631
|
name: "set_admin",
|
|
2274
3632
|
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
@@ -3054,16 +4412,16 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
|
|
|
3054
4412
|
unlockPeriod
|
|
3055
4413
|
} = data;
|
|
3056
4414
|
return {
|
|
3057
|
-
totalAmountLocked: new
|
|
3058
|
-
totalAmountUnlocked: new
|
|
4415
|
+
totalAmountLocked: new BN5__default.default(totalAmountLocked),
|
|
4416
|
+
totalAmountUnlocked: new BN5__default.default(totalAmountUnlocked),
|
|
3059
4417
|
oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
|
|
3060
4418
|
minPrice: common.getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3061
4419
|
maxPrice: common.getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3062
4420
|
minPercentage: common.getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3063
4421
|
maxPercentage: common.getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3064
|
-
tickSize: new
|
|
4422
|
+
tickSize: new BN5__default.default(tickSize || 1),
|
|
3065
4423
|
skipInitial: skipInitial ?? false,
|
|
3066
|
-
updatePeriod: unlockPeriod < 30 ? new
|
|
4424
|
+
updatePeriod: unlockPeriod < 30 ? new BN5__default.default(30) : new BN5__default.default(unlockPeriod)
|
|
3067
4425
|
};
|
|
3068
4426
|
}
|
|
3069
4427
|
};
|