@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
|
@@ -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;
|
|
@@ -125,21 +125,21 @@ var PROGRAM_ID_CLI = new web3_js.PublicKey("MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHma
|
|
|
125
125
|
var PROGRAM_ID = PROGRAM_ID_CLI;
|
|
126
126
|
|
|
127
127
|
// solana/generated/instructions/newDistributor.ts
|
|
128
|
-
var layout =
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
128
|
+
var layout = borsh7__namespace.struct([
|
|
129
|
+
borsh7__namespace.u64("version"),
|
|
130
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
|
|
131
|
+
borsh7__namespace.u64("maxTotalClaim"),
|
|
132
|
+
borsh7__namespace.u64("maxNumNodes"),
|
|
133
|
+
borsh7__namespace.u64("unlockPeriod"),
|
|
134
|
+
borsh7__namespace.u64("startVestingTs"),
|
|
135
|
+
borsh7__namespace.u64("endVestingTs"),
|
|
136
|
+
borsh7__namespace.u64("clawbackStartTs"),
|
|
137
|
+
borsh7__namespace.bool("claimsClosableByAdmin"),
|
|
138
|
+
borsh7__namespace.option(borsh7__namespace.bool(), "canUpdateDuration"),
|
|
139
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountUnlocked"),
|
|
140
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "totalAmountLocked"),
|
|
141
|
+
borsh7__namespace.option(borsh7__namespace.bool(), "claimsClosableByClaimant"),
|
|
142
|
+
borsh7__namespace.option(borsh7__namespace.u16(), "claimsLimit")
|
|
143
143
|
]);
|
|
144
144
|
function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
145
145
|
const keys = [
|
|
@@ -181,10 +181,10 @@ function newDistributor(args, accounts, programId = PROGRAM_ID) {
|
|
|
181
181
|
const ix = new web3_js.TransactionInstruction({ keys, programId, data });
|
|
182
182
|
return ix;
|
|
183
183
|
}
|
|
184
|
-
var layout2 =
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
184
|
+
var layout2 = borsh7__namespace.struct([
|
|
185
|
+
borsh7__namespace.u64("amountUnlocked"),
|
|
186
|
+
borsh7__namespace.u64("amountLocked"),
|
|
187
|
+
borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32), "proof")
|
|
188
188
|
]);
|
|
189
189
|
function newClaim(args, accounts, programId = PROGRAM_ID) {
|
|
190
190
|
const keys = [
|
|
@@ -245,10 +245,10 @@ function clawback(accounts, programId = PROGRAM_ID) {
|
|
|
245
245
|
const ix = new web3_js.TransactionInstruction({ keys, programId, data });
|
|
246
246
|
return ix;
|
|
247
247
|
}
|
|
248
|
-
var layout3 =
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
248
|
+
var layout3 = borsh7__namespace.struct([
|
|
249
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "amountUnlocked"),
|
|
250
|
+
borsh7__namespace.option(borsh7__namespace.u64(), "amountLocked"),
|
|
251
|
+
borsh7__namespace.option(borsh7__namespace.vec(borsh7__namespace.array(borsh7__namespace.u8(), 32)), "proof")
|
|
252
252
|
]);
|
|
253
253
|
function closeClaim(args, accounts, programId = PROGRAM_ID) {
|
|
254
254
|
const keys = [
|
|
@@ -297,6 +297,1316 @@ function setAdmin(accounts, programId = PROGRAM_ID) {
|
|
|
297
297
|
return ix;
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
+
// solana/descriptor/idl/merkle_distributor.json
|
|
301
|
+
var merkle_distributor_default = {
|
|
302
|
+
address: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
303
|
+
metadata: {
|
|
304
|
+
name: "merkle_distributor",
|
|
305
|
+
version: "1.5.0",
|
|
306
|
+
spec: "0.1.0",
|
|
307
|
+
description: "A Solana program for distributing tokens according to a Merkle root.",
|
|
308
|
+
repository: "https://github.com/streamflow-finance/distributor"
|
|
309
|
+
},
|
|
310
|
+
instructions: [
|
|
311
|
+
{
|
|
312
|
+
name: "_expose_claim",
|
|
313
|
+
discriminator: [103, 233, 83, 69, 115, 199, 128, 249],
|
|
314
|
+
accounts: [
|
|
315
|
+
{
|
|
316
|
+
name: "distributor",
|
|
317
|
+
docs: ["The [MerkleDistributor]."]
|
|
318
|
+
},
|
|
319
|
+
{
|
|
320
|
+
name: "claim_status",
|
|
321
|
+
docs: ["Claim Status PDA"],
|
|
322
|
+
optional: true,
|
|
323
|
+
pda: {
|
|
324
|
+
seeds: [
|
|
325
|
+
{
|
|
326
|
+
kind: "const",
|
|
327
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
kind: "account",
|
|
331
|
+
path: "claimant"
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
kind: "account",
|
|
335
|
+
path: "distributor"
|
|
336
|
+
}
|
|
337
|
+
]
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
name: "compressed_claim_status",
|
|
342
|
+
docs: ["Compress Claim Status PDA"],
|
|
343
|
+
optional: true,
|
|
344
|
+
pda: {
|
|
345
|
+
seeds: [
|
|
346
|
+
{
|
|
347
|
+
kind: "const",
|
|
348
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
kind: "account",
|
|
352
|
+
path: "claimant"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
kind: "account",
|
|
356
|
+
path: "distributor"
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
name: "claimant",
|
|
363
|
+
docs: ["Who is claiming the tokens."],
|
|
364
|
+
signer: true
|
|
365
|
+
}
|
|
366
|
+
],
|
|
367
|
+
args: []
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
name: "claim_locked",
|
|
371
|
+
discriminator: [34, 206, 181, 23, 11, 207, 147, 90],
|
|
372
|
+
accounts: [
|
|
373
|
+
{
|
|
374
|
+
name: "distributor",
|
|
375
|
+
docs: ["The [MerkleDistributor]."],
|
|
376
|
+
writable: true
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
name: "claim_status",
|
|
380
|
+
writable: true,
|
|
381
|
+
pda: {
|
|
382
|
+
seeds: [
|
|
383
|
+
{
|
|
384
|
+
kind: "const",
|
|
385
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
kind: "account",
|
|
389
|
+
path: "claimant"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
kind: "account",
|
|
393
|
+
path: "distributor"
|
|
394
|
+
}
|
|
395
|
+
]
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
name: "from",
|
|
400
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
401
|
+
writable: true,
|
|
402
|
+
pda: {
|
|
403
|
+
seeds: [
|
|
404
|
+
{
|
|
405
|
+
kind: "account",
|
|
406
|
+
path: "distributor"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
kind: "account",
|
|
410
|
+
path: "token_program"
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
kind: "account",
|
|
414
|
+
path: "distributor.mint",
|
|
415
|
+
account: "MerkleDistributor"
|
|
416
|
+
}
|
|
417
|
+
],
|
|
418
|
+
program: {
|
|
419
|
+
kind: "const",
|
|
420
|
+
value: [
|
|
421
|
+
140,
|
|
422
|
+
151,
|
|
423
|
+
37,
|
|
424
|
+
143,
|
|
425
|
+
78,
|
|
426
|
+
36,
|
|
427
|
+
137,
|
|
428
|
+
241,
|
|
429
|
+
187,
|
|
430
|
+
61,
|
|
431
|
+
16,
|
|
432
|
+
41,
|
|
433
|
+
20,
|
|
434
|
+
142,
|
|
435
|
+
13,
|
|
436
|
+
131,
|
|
437
|
+
11,
|
|
438
|
+
90,
|
|
439
|
+
19,
|
|
440
|
+
153,
|
|
441
|
+
218,
|
|
442
|
+
255,
|
|
443
|
+
16,
|
|
444
|
+
132,
|
|
445
|
+
4,
|
|
446
|
+
142,
|
|
447
|
+
123,
|
|
448
|
+
216,
|
|
449
|
+
219,
|
|
450
|
+
233,
|
|
451
|
+
248,
|
|
452
|
+
89
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
name: "to",
|
|
459
|
+
docs: [
|
|
460
|
+
"Account to send the claimed tokens to.",
|
|
461
|
+
"Claimant must sign the transaction and can only claim on behalf of themself"
|
|
462
|
+
],
|
|
463
|
+
writable: true
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
name: "claimant",
|
|
467
|
+
docs: ["Who is claiming the tokens."],
|
|
468
|
+
writable: true,
|
|
469
|
+
signer: true
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "mint",
|
|
473
|
+
docs: ["The mint to claim."],
|
|
474
|
+
relations: ["distributor"]
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
name: "token_program",
|
|
478
|
+
docs: ["SPL [Token] program."]
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
name: "event_authority",
|
|
482
|
+
pda: {
|
|
483
|
+
seeds: [
|
|
484
|
+
{
|
|
485
|
+
kind: "const",
|
|
486
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
487
|
+
}
|
|
488
|
+
]
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
{
|
|
492
|
+
name: "program"
|
|
493
|
+
}
|
|
494
|
+
],
|
|
495
|
+
args: []
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
name: "clawback",
|
|
499
|
+
discriminator: [111, 92, 142, 79, 33, 234, 82, 27],
|
|
500
|
+
accounts: [
|
|
501
|
+
{
|
|
502
|
+
name: "distributor",
|
|
503
|
+
docs: ["The [MerkleDistributor]."],
|
|
504
|
+
writable: true
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
name: "from",
|
|
508
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
509
|
+
writable: true
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
name: "to",
|
|
513
|
+
docs: ["The Clawback token account."],
|
|
514
|
+
writable: true
|
|
515
|
+
},
|
|
516
|
+
{
|
|
517
|
+
name: "admin",
|
|
518
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
519
|
+
writable: true,
|
|
520
|
+
signer: true
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
name: "mint"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
name: "system_program",
|
|
527
|
+
docs: ["The [System] program."],
|
|
528
|
+
address: "11111111111111111111111111111111"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
name: "token_program",
|
|
532
|
+
docs: ["SPL [Token] program."]
|
|
533
|
+
}
|
|
534
|
+
],
|
|
535
|
+
args: []
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
name: "close_claim",
|
|
539
|
+
discriminator: [42, 177, 165, 35, 213, 179, 211, 19],
|
|
540
|
+
accounts: [
|
|
541
|
+
{
|
|
542
|
+
name: "distributor",
|
|
543
|
+
docs: ["The [MerkleDistributor]."],
|
|
544
|
+
writable: true
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: "admin_or_claimant",
|
|
548
|
+
docs: ["Admin signer"],
|
|
549
|
+
writable: true,
|
|
550
|
+
signer: true
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
name: "claimant",
|
|
554
|
+
writable: true
|
|
555
|
+
},
|
|
556
|
+
{
|
|
557
|
+
name: "claim_status",
|
|
558
|
+
writable: true,
|
|
559
|
+
pda: {
|
|
560
|
+
seeds: [
|
|
561
|
+
{
|
|
562
|
+
kind: "const",
|
|
563
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
kind: "account",
|
|
567
|
+
path: "claimant"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
kind: "account",
|
|
571
|
+
path: "distributor"
|
|
572
|
+
}
|
|
573
|
+
]
|
|
574
|
+
}
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
name: "system_program",
|
|
578
|
+
docs: ["The [System] program."],
|
|
579
|
+
address: "11111111111111111111111111111111"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: "event_authority",
|
|
583
|
+
pda: {
|
|
584
|
+
seeds: [
|
|
585
|
+
{
|
|
586
|
+
kind: "const",
|
|
587
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
588
|
+
}
|
|
589
|
+
]
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
name: "program"
|
|
594
|
+
}
|
|
595
|
+
],
|
|
596
|
+
args: [
|
|
597
|
+
{
|
|
598
|
+
name: "amount_unlocked",
|
|
599
|
+
type: {
|
|
600
|
+
option: "u64"
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
name: "amount_locked",
|
|
605
|
+
type: {
|
|
606
|
+
option: "u64"
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
name: "proof",
|
|
611
|
+
type: {
|
|
612
|
+
option: {
|
|
613
|
+
vec: {
|
|
614
|
+
array: ["u8", 32]
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
name: "compress_claim",
|
|
623
|
+
discriminator: [219, 45, 247, 134, 71, 119, 125, 89],
|
|
624
|
+
accounts: [
|
|
625
|
+
{
|
|
626
|
+
name: "distributor",
|
|
627
|
+
docs: ["The [MerkleDistributor]."],
|
|
628
|
+
writable: true
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
name: "claim_status",
|
|
632
|
+
writable: true,
|
|
633
|
+
pda: {
|
|
634
|
+
seeds: [
|
|
635
|
+
{
|
|
636
|
+
kind: "const",
|
|
637
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
kind: "account",
|
|
641
|
+
path: "claimant"
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
kind: "account",
|
|
645
|
+
path: "distributor"
|
|
646
|
+
}
|
|
647
|
+
]
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
name: "signer",
|
|
652
|
+
docs: ["Signer account"],
|
|
653
|
+
writable: true,
|
|
654
|
+
signer: true
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
name: "claimant"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "system_program",
|
|
661
|
+
docs: ["The [System] program."],
|
|
662
|
+
address: "11111111111111111111111111111111"
|
|
663
|
+
}
|
|
664
|
+
],
|
|
665
|
+
args: []
|
|
666
|
+
},
|
|
667
|
+
{
|
|
668
|
+
name: "new_claim",
|
|
669
|
+
discriminator: [78, 177, 98, 123, 210, 21, 187, 83],
|
|
670
|
+
accounts: [
|
|
671
|
+
{
|
|
672
|
+
name: "distributor",
|
|
673
|
+
docs: ["The [MerkleDistributor]."],
|
|
674
|
+
writable: true
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
name: "claim_status",
|
|
678
|
+
writable: true,
|
|
679
|
+
pda: {
|
|
680
|
+
seeds: [
|
|
681
|
+
{
|
|
682
|
+
kind: "const",
|
|
683
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
kind: "account",
|
|
687
|
+
path: "claimant"
|
|
688
|
+
},
|
|
689
|
+
{
|
|
690
|
+
kind: "account",
|
|
691
|
+
path: "distributor"
|
|
692
|
+
}
|
|
693
|
+
]
|
|
694
|
+
}
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
name: "from",
|
|
698
|
+
docs: ["Distributor ATA containing the tokens to distribute."],
|
|
699
|
+
writable: true,
|
|
700
|
+
pda: {
|
|
701
|
+
seeds: [
|
|
702
|
+
{
|
|
703
|
+
kind: "account",
|
|
704
|
+
path: "distributor"
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
kind: "account",
|
|
708
|
+
path: "token_program"
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
kind: "account",
|
|
712
|
+
path: "distributor.mint",
|
|
713
|
+
account: "MerkleDistributor"
|
|
714
|
+
}
|
|
715
|
+
],
|
|
716
|
+
program: {
|
|
717
|
+
kind: "const",
|
|
718
|
+
value: [
|
|
719
|
+
140,
|
|
720
|
+
151,
|
|
721
|
+
37,
|
|
722
|
+
143,
|
|
723
|
+
78,
|
|
724
|
+
36,
|
|
725
|
+
137,
|
|
726
|
+
241,
|
|
727
|
+
187,
|
|
728
|
+
61,
|
|
729
|
+
16,
|
|
730
|
+
41,
|
|
731
|
+
20,
|
|
732
|
+
142,
|
|
733
|
+
13,
|
|
734
|
+
131,
|
|
735
|
+
11,
|
|
736
|
+
90,
|
|
737
|
+
19,
|
|
738
|
+
153,
|
|
739
|
+
218,
|
|
740
|
+
255,
|
|
741
|
+
16,
|
|
742
|
+
132,
|
|
743
|
+
4,
|
|
744
|
+
142,
|
|
745
|
+
123,
|
|
746
|
+
216,
|
|
747
|
+
219,
|
|
748
|
+
233,
|
|
749
|
+
248,
|
|
750
|
+
89
|
|
751
|
+
]
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
},
|
|
755
|
+
{
|
|
756
|
+
name: "to",
|
|
757
|
+
docs: ["Account to send the claimed tokens to."],
|
|
758
|
+
writable: true
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
name: "claimant",
|
|
762
|
+
docs: ["Who is claiming the tokens."],
|
|
763
|
+
writable: true,
|
|
764
|
+
signer: true
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
name: "mint",
|
|
768
|
+
docs: ["The mint to claim."],
|
|
769
|
+
relations: ["distributor"]
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
name: "token_program",
|
|
773
|
+
docs: ["SPL [Token] program."]
|
|
774
|
+
},
|
|
775
|
+
{
|
|
776
|
+
name: "system_program",
|
|
777
|
+
docs: ["The [System] program."],
|
|
778
|
+
address: "11111111111111111111111111111111"
|
|
779
|
+
},
|
|
780
|
+
{
|
|
781
|
+
name: "event_authority",
|
|
782
|
+
pda: {
|
|
783
|
+
seeds: [
|
|
784
|
+
{
|
|
785
|
+
kind: "const",
|
|
786
|
+
value: [95, 95, 101, 118, 101, 110, 116, 95, 97, 117, 116, 104, 111, 114, 105, 116, 121]
|
|
787
|
+
}
|
|
788
|
+
]
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
{
|
|
792
|
+
name: "program"
|
|
793
|
+
}
|
|
794
|
+
],
|
|
795
|
+
args: [
|
|
796
|
+
{
|
|
797
|
+
name: "amount_unlocked",
|
|
798
|
+
type: "u64"
|
|
799
|
+
},
|
|
800
|
+
{
|
|
801
|
+
name: "amount_locked",
|
|
802
|
+
type: "u64"
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
name: "proof",
|
|
806
|
+
type: {
|
|
807
|
+
vec: {
|
|
808
|
+
array: ["u8", 32]
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
]
|
|
813
|
+
},
|
|
814
|
+
{
|
|
815
|
+
name: "new_distributor",
|
|
816
|
+
docs: [
|
|
817
|
+
"READ THE FOLLOWING:",
|
|
818
|
+
"",
|
|
819
|
+
"This instruction is susceptible to frontrunning that could result in loss of funds if not handled properly.",
|
|
820
|
+
"",
|
|
821
|
+
"An attack could look like:",
|
|
822
|
+
"- A legitimate user opens a new distributor.",
|
|
823
|
+
"- Someone observes the call to this instruction.",
|
|
824
|
+
"- They replace the clawback_receiver, admin, or time parameters with their own.",
|
|
825
|
+
"",
|
|
826
|
+
"One situation that could happen here is the attacker replaces the admin and clawback_receiver with their own",
|
|
827
|
+
"and sets the clawback_start_ts with the minimal time allowed. After clawback_start_ts has elapsed,",
|
|
828
|
+
"the attacker can steal all funds from the distributor to their own clawback_receiver account.",
|
|
829
|
+
"",
|
|
830
|
+
"HOW TO AVOID:",
|
|
831
|
+
"- When you call into this instruction, ensure your transaction succeeds.",
|
|
832
|
+
"- To be extra safe, after your transaction succeeds, read back the state of the created MerkleDistributor account and",
|
|
833
|
+
"assert the parameters are what you expect, most importantly the clawback_receiver and admin.",
|
|
834
|
+
"- If your transaction fails, double check the value on-chain matches what you expect."
|
|
835
|
+
],
|
|
836
|
+
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
837
|
+
accounts: [
|
|
838
|
+
{
|
|
839
|
+
name: "distributor",
|
|
840
|
+
docs: ["[MerkleDistributor]."],
|
|
841
|
+
writable: true,
|
|
842
|
+
pda: {
|
|
843
|
+
seeds: [
|
|
844
|
+
{
|
|
845
|
+
kind: "const",
|
|
846
|
+
value: [77, 101, 114, 107, 108, 101, 68, 105, 115, 116, 114, 105, 98, 117, 116, 111, 114]
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
kind: "account",
|
|
850
|
+
path: "mint"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
kind: "arg",
|
|
854
|
+
path: "version"
|
|
855
|
+
}
|
|
856
|
+
]
|
|
857
|
+
}
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
name: "clawback_receiver",
|
|
861
|
+
docs: ["Clawback receiver token account"],
|
|
862
|
+
writable: true
|
|
863
|
+
},
|
|
864
|
+
{
|
|
865
|
+
name: "mint",
|
|
866
|
+
docs: ["The mint to distribute."]
|
|
867
|
+
},
|
|
868
|
+
{
|
|
869
|
+
name: "token_vault",
|
|
870
|
+
docs: ["Token vault"],
|
|
871
|
+
writable: true,
|
|
872
|
+
pda: {
|
|
873
|
+
seeds: [
|
|
874
|
+
{
|
|
875
|
+
kind: "account",
|
|
876
|
+
path: "distributor"
|
|
877
|
+
},
|
|
878
|
+
{
|
|
879
|
+
kind: "account",
|
|
880
|
+
path: "token_program"
|
|
881
|
+
},
|
|
882
|
+
{
|
|
883
|
+
kind: "account",
|
|
884
|
+
path: "mint"
|
|
885
|
+
}
|
|
886
|
+
],
|
|
887
|
+
program: {
|
|
888
|
+
kind: "const",
|
|
889
|
+
value: [
|
|
890
|
+
140,
|
|
891
|
+
151,
|
|
892
|
+
37,
|
|
893
|
+
143,
|
|
894
|
+
78,
|
|
895
|
+
36,
|
|
896
|
+
137,
|
|
897
|
+
241,
|
|
898
|
+
187,
|
|
899
|
+
61,
|
|
900
|
+
16,
|
|
901
|
+
41,
|
|
902
|
+
20,
|
|
903
|
+
142,
|
|
904
|
+
13,
|
|
905
|
+
131,
|
|
906
|
+
11,
|
|
907
|
+
90,
|
|
908
|
+
19,
|
|
909
|
+
153,
|
|
910
|
+
218,
|
|
911
|
+
255,
|
|
912
|
+
16,
|
|
913
|
+
132,
|
|
914
|
+
4,
|
|
915
|
+
142,
|
|
916
|
+
123,
|
|
917
|
+
216,
|
|
918
|
+
219,
|
|
919
|
+
233,
|
|
920
|
+
248,
|
|
921
|
+
89
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
},
|
|
926
|
+
{
|
|
927
|
+
name: "admin",
|
|
928
|
+
docs: [
|
|
929
|
+
"Admin wallet, responsible for creating the distributor and paying for the transaction.",
|
|
930
|
+
"Also has the authority to set the clawback receiver and change itself."
|
|
931
|
+
],
|
|
932
|
+
writable: true,
|
|
933
|
+
signer: true
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
name: "system_program",
|
|
937
|
+
docs: ["The [System] program."],
|
|
938
|
+
address: "11111111111111111111111111111111"
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
name: "associated_token_program",
|
|
942
|
+
docs: ["The [Associated Token] program."],
|
|
943
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
name: "token_program",
|
|
947
|
+
docs: ["The [Token] program."]
|
|
948
|
+
}
|
|
949
|
+
],
|
|
950
|
+
args: [
|
|
951
|
+
{
|
|
952
|
+
name: "version",
|
|
953
|
+
type: "u64"
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
name: "root",
|
|
957
|
+
type: {
|
|
958
|
+
array: ["u8", 32]
|
|
959
|
+
}
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
name: "max_total_claim",
|
|
963
|
+
type: "u64"
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
name: "max_num_nodes",
|
|
967
|
+
type: "u64"
|
|
968
|
+
},
|
|
969
|
+
{
|
|
970
|
+
name: "unlock_period",
|
|
971
|
+
type: "u64"
|
|
972
|
+
},
|
|
973
|
+
{
|
|
974
|
+
name: "start_vesting_ts",
|
|
975
|
+
type: "u64"
|
|
976
|
+
},
|
|
977
|
+
{
|
|
978
|
+
name: "end_vesting_ts",
|
|
979
|
+
type: "u64"
|
|
980
|
+
},
|
|
981
|
+
{
|
|
982
|
+
name: "clawback_start_ts",
|
|
983
|
+
type: "u64"
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
name: "claims_closable_by_admin",
|
|
987
|
+
type: "bool"
|
|
988
|
+
},
|
|
989
|
+
{
|
|
990
|
+
name: "can_update_duration",
|
|
991
|
+
type: {
|
|
992
|
+
option: "bool"
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
{
|
|
996
|
+
name: "total_amount_unlocked",
|
|
997
|
+
type: {
|
|
998
|
+
option: "u64"
|
|
999
|
+
}
|
|
1000
|
+
},
|
|
1001
|
+
{
|
|
1002
|
+
name: "total_amount_locked",
|
|
1003
|
+
type: {
|
|
1004
|
+
option: "u64"
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
{
|
|
1008
|
+
name: "claims_closable_by_claimant",
|
|
1009
|
+
type: {
|
|
1010
|
+
option: "bool"
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
name: "claims_limit",
|
|
1015
|
+
type: {
|
|
1016
|
+
option: "u16"
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
]
|
|
1020
|
+
},
|
|
1021
|
+
{
|
|
1022
|
+
name: "refund_claim",
|
|
1023
|
+
discriminator: [157, 23, 164, 146, 176, 53, 147, 143],
|
|
1024
|
+
accounts: [
|
|
1025
|
+
{
|
|
1026
|
+
name: "distributor",
|
|
1027
|
+
docs: ["The [MerkleDistributor]."],
|
|
1028
|
+
writable: true
|
|
1029
|
+
},
|
|
1030
|
+
{
|
|
1031
|
+
name: "claim_status",
|
|
1032
|
+
writable: true,
|
|
1033
|
+
pda: {
|
|
1034
|
+
seeds: [
|
|
1035
|
+
{
|
|
1036
|
+
kind: "const",
|
|
1037
|
+
value: [67, 108, 97, 105, 109, 83, 116, 97, 116, 117, 115]
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
kind: "account",
|
|
1041
|
+
path: "claimant"
|
|
1042
|
+
},
|
|
1043
|
+
{
|
|
1044
|
+
kind: "account",
|
|
1045
|
+
path: "distributor"
|
|
1046
|
+
}
|
|
1047
|
+
]
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
{
|
|
1051
|
+
name: "signer",
|
|
1052
|
+
docs: ["Signer account"],
|
|
1053
|
+
writable: true,
|
|
1054
|
+
signer: true
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
name: "claimant"
|
|
1058
|
+
},
|
|
1059
|
+
{
|
|
1060
|
+
name: "streamflow_treasury",
|
|
1061
|
+
writable: true,
|
|
1062
|
+
address: "5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw"
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
name: "system_program",
|
|
1066
|
+
docs: ["The [System] program."],
|
|
1067
|
+
address: "11111111111111111111111111111111"
|
|
1068
|
+
}
|
|
1069
|
+
],
|
|
1070
|
+
args: []
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
name: "set_admin",
|
|
1074
|
+
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
1075
|
+
accounts: [
|
|
1076
|
+
{
|
|
1077
|
+
name: "distributor",
|
|
1078
|
+
docs: ["The [MerkleDistributor]."],
|
|
1079
|
+
writable: true
|
|
1080
|
+
},
|
|
1081
|
+
{
|
|
1082
|
+
name: "admin",
|
|
1083
|
+
docs: ["Admin signer"],
|
|
1084
|
+
writable: true,
|
|
1085
|
+
signer: true
|
|
1086
|
+
},
|
|
1087
|
+
{
|
|
1088
|
+
name: "new_admin",
|
|
1089
|
+
docs: ["New admin account"],
|
|
1090
|
+
writable: true
|
|
1091
|
+
}
|
|
1092
|
+
],
|
|
1093
|
+
args: []
|
|
1094
|
+
},
|
|
1095
|
+
{
|
|
1096
|
+
name: "set_clawback_receiver",
|
|
1097
|
+
discriminator: [153, 217, 34, 20, 19, 29, 229, 75],
|
|
1098
|
+
accounts: [
|
|
1099
|
+
{
|
|
1100
|
+
name: "distributor",
|
|
1101
|
+
docs: ["The [MerkleDistributor]."],
|
|
1102
|
+
writable: true
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
name: "new_clawback_account",
|
|
1106
|
+
docs: ["New clawback account"]
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
name: "admin",
|
|
1110
|
+
docs: ["Admin signer"],
|
|
1111
|
+
writable: true,
|
|
1112
|
+
signer: true
|
|
1113
|
+
}
|
|
1114
|
+
],
|
|
1115
|
+
args: []
|
|
1116
|
+
},
|
|
1117
|
+
{
|
|
1118
|
+
name: "update",
|
|
1119
|
+
discriminator: [219, 200, 88, 176, 158, 63, 253, 127],
|
|
1120
|
+
accounts: [
|
|
1121
|
+
{
|
|
1122
|
+
name: "distributor",
|
|
1123
|
+
docs: ["The [MerkleDistributor]."],
|
|
1124
|
+
writable: true
|
|
1125
|
+
},
|
|
1126
|
+
{
|
|
1127
|
+
name: "admin",
|
|
1128
|
+
docs: ["Only Admin can trigger the clawback of funds"],
|
|
1129
|
+
writable: true,
|
|
1130
|
+
signer: true
|
|
1131
|
+
},
|
|
1132
|
+
{
|
|
1133
|
+
name: "system_program",
|
|
1134
|
+
docs: ["The [System] program."],
|
|
1135
|
+
address: "11111111111111111111111111111111"
|
|
1136
|
+
}
|
|
1137
|
+
],
|
|
1138
|
+
args: [
|
|
1139
|
+
{
|
|
1140
|
+
name: "end_ts",
|
|
1141
|
+
type: {
|
|
1142
|
+
option: "u64"
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
]
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
accounts: [
|
|
1149
|
+
{
|
|
1150
|
+
name: "ClaimStatus",
|
|
1151
|
+
discriminator: [22, 183, 249, 157, 247, 95, 150, 96]
|
|
1152
|
+
},
|
|
1153
|
+
{
|
|
1154
|
+
name: "CompressedClaimStatus",
|
|
1155
|
+
discriminator: [53, 68, 161, 131, 212, 106, 98, 48]
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
name: "MerkleDistributor",
|
|
1159
|
+
discriminator: [77, 119, 139, 70, 84, 247, 12, 26]
|
|
1160
|
+
}
|
|
1161
|
+
],
|
|
1162
|
+
events: [
|
|
1163
|
+
{
|
|
1164
|
+
name: "ClaimClosedEvent",
|
|
1165
|
+
discriminator: [139, 166, 215, 195, 184, 233, 26, 217]
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
name: "ClaimedEvent",
|
|
1169
|
+
discriminator: [144, 172, 209, 86, 144, 87, 84, 115]
|
|
1170
|
+
},
|
|
1171
|
+
{
|
|
1172
|
+
name: "NewClaimEvent",
|
|
1173
|
+
discriminator: [244, 3, 231, 151, 60, 101, 55, 55]
|
|
1174
|
+
}
|
|
1175
|
+
],
|
|
1176
|
+
errors: [
|
|
1177
|
+
{
|
|
1178
|
+
code: 6e3,
|
|
1179
|
+
name: "InsufficientUnlockedTokens",
|
|
1180
|
+
msg: "Insufficient unlocked tokens"
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
code: 6001,
|
|
1184
|
+
name: "InvalidProof",
|
|
1185
|
+
msg: "Invalid Merkle proof"
|
|
1186
|
+
},
|
|
1187
|
+
{
|
|
1188
|
+
code: 6002,
|
|
1189
|
+
name: "ExceededMaxClaim",
|
|
1190
|
+
msg: "Exceeded maximum claim amount"
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
code: 6003,
|
|
1194
|
+
name: "MaxNodesExceeded",
|
|
1195
|
+
msg: "Exceeded maximum node count"
|
|
1196
|
+
},
|
|
1197
|
+
{
|
|
1198
|
+
code: 6004,
|
|
1199
|
+
name: "Unauthorized",
|
|
1200
|
+
msg: "Account is not authorized to execute this instruction"
|
|
1201
|
+
},
|
|
1202
|
+
{
|
|
1203
|
+
code: 6005,
|
|
1204
|
+
name: "OwnerMismatch",
|
|
1205
|
+
msg: "Token account owner did not match intended owner"
|
|
1206
|
+
},
|
|
1207
|
+
{
|
|
1208
|
+
code: 6006,
|
|
1209
|
+
name: "ClawbackBeforeStart",
|
|
1210
|
+
msg: "Attempted clawback before start"
|
|
1211
|
+
},
|
|
1212
|
+
{
|
|
1213
|
+
code: 6007,
|
|
1214
|
+
name: "ClawbackAlreadyClaimed",
|
|
1215
|
+
msg: "Clawback already claimed"
|
|
1216
|
+
},
|
|
1217
|
+
{
|
|
1218
|
+
code: 6008,
|
|
1219
|
+
name: "SameClawbackReceiver",
|
|
1220
|
+
msg: "New and old Clawback receivers are identical"
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
code: 6009,
|
|
1224
|
+
name: "ClawbackReceiverIsTokenVault",
|
|
1225
|
+
msg: "Clawback receiver can not be the Token Vault"
|
|
1226
|
+
},
|
|
1227
|
+
{
|
|
1228
|
+
code: 6010,
|
|
1229
|
+
name: "SameAdmin",
|
|
1230
|
+
msg: "New and old admin are identical"
|
|
1231
|
+
},
|
|
1232
|
+
{
|
|
1233
|
+
code: 6011,
|
|
1234
|
+
name: "ClaimExpired",
|
|
1235
|
+
msg: "Claim window expired"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
code: 6012,
|
|
1239
|
+
name: "ArithmeticError",
|
|
1240
|
+
msg: "Arithmetic Error (overflow/underflow)"
|
|
1241
|
+
},
|
|
1242
|
+
{
|
|
1243
|
+
code: 6013,
|
|
1244
|
+
name: "StartTimestampAfterEnd",
|
|
1245
|
+
msg: "Start Timestamp cannot be after end Timestamp"
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
code: 6014,
|
|
1249
|
+
name: "TimestampsNotInFuture",
|
|
1250
|
+
msg: "Timestamps cannot be in the past"
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
code: 6015,
|
|
1254
|
+
name: "InvalidMint",
|
|
1255
|
+
msg: "Invalid Mint"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
code: 6016,
|
|
1259
|
+
name: "ClaimIsClosed",
|
|
1260
|
+
msg: "Claim is closed"
|
|
1261
|
+
},
|
|
1262
|
+
{
|
|
1263
|
+
code: 6017,
|
|
1264
|
+
name: "ClaimsAreNotClosable",
|
|
1265
|
+
msg: "Claims are not closable"
|
|
1266
|
+
},
|
|
1267
|
+
{
|
|
1268
|
+
code: 6018,
|
|
1269
|
+
name: "InvalidUnlockPeriod",
|
|
1270
|
+
msg: "Invalid unlock period"
|
|
1271
|
+
},
|
|
1272
|
+
{
|
|
1273
|
+
code: 6019,
|
|
1274
|
+
name: "DurationUpdateNotAllowed",
|
|
1275
|
+
msg: "Duration update is not allowed"
|
|
1276
|
+
},
|
|
1277
|
+
{
|
|
1278
|
+
code: 6020,
|
|
1279
|
+
name: "NoVestingAmount",
|
|
1280
|
+
msg: "Vesting amounts are not set"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
code: 6021,
|
|
1284
|
+
name: "VestingAlreadyFinished",
|
|
1285
|
+
msg: "Vesting already finished"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
code: 6022,
|
|
1289
|
+
name: "InvalidAmounts",
|
|
1290
|
+
msg: "Provided amounts are invalid"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
code: 6023,
|
|
1294
|
+
name: "ClaimsLimitReached",
|
|
1295
|
+
msg: "Claims limit has been reached"
|
|
1296
|
+
}
|
|
1297
|
+
],
|
|
1298
|
+
types: [
|
|
1299
|
+
{
|
|
1300
|
+
name: "ClaimClosedEvent",
|
|
1301
|
+
docs: ["Emitted when a new claim is created."],
|
|
1302
|
+
type: {
|
|
1303
|
+
kind: "struct",
|
|
1304
|
+
fields: [
|
|
1305
|
+
{
|
|
1306
|
+
name: "claimant",
|
|
1307
|
+
docs: ["User that claimed."],
|
|
1308
|
+
type: "pubkey"
|
|
1309
|
+
},
|
|
1310
|
+
{
|
|
1311
|
+
name: "timestamp",
|
|
1312
|
+
docs: ["Timestamp."],
|
|
1313
|
+
type: "u64"
|
|
1314
|
+
}
|
|
1315
|
+
]
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
{
|
|
1319
|
+
name: "ClaimStatus",
|
|
1320
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1321
|
+
type: {
|
|
1322
|
+
kind: "struct",
|
|
1323
|
+
fields: [
|
|
1324
|
+
{
|
|
1325
|
+
name: "claimant",
|
|
1326
|
+
docs: ["Authority that claimed the tokens."],
|
|
1327
|
+
type: "pubkey"
|
|
1328
|
+
},
|
|
1329
|
+
{
|
|
1330
|
+
name: "locked_amount",
|
|
1331
|
+
docs: ["Locked amount"],
|
|
1332
|
+
type: "u64"
|
|
1333
|
+
},
|
|
1334
|
+
{
|
|
1335
|
+
name: "locked_amount_withdrawn",
|
|
1336
|
+
docs: ["Locked amount withdrawn"],
|
|
1337
|
+
type: "u64"
|
|
1338
|
+
},
|
|
1339
|
+
{
|
|
1340
|
+
name: "unlocked_amount",
|
|
1341
|
+
docs: ["Unlocked amount"],
|
|
1342
|
+
type: "u64"
|
|
1343
|
+
},
|
|
1344
|
+
{
|
|
1345
|
+
name: "last_claim_ts",
|
|
1346
|
+
docs: ["Last claim time"],
|
|
1347
|
+
type: "u64"
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
name: "last_amount_per_unlock",
|
|
1351
|
+
docs: ["Track amount per unlock, can be useful for non-linear vesting"],
|
|
1352
|
+
type: "u64"
|
|
1353
|
+
},
|
|
1354
|
+
{
|
|
1355
|
+
name: "closed",
|
|
1356
|
+
docs: ["Whether claim is closed"],
|
|
1357
|
+
type: "bool"
|
|
1358
|
+
},
|
|
1359
|
+
{
|
|
1360
|
+
name: "distributor",
|
|
1361
|
+
docs: [
|
|
1362
|
+
"Distributor account for which ClaimStatus was created, useful to filter by in get_program_accounts"
|
|
1363
|
+
],
|
|
1364
|
+
type: "pubkey"
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
name: "claims_count",
|
|
1368
|
+
docs: ["Number of time amount has been claimed"],
|
|
1369
|
+
type: "u16"
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
name: "closed_ts",
|
|
1373
|
+
docs: ["Time when claim has been closed"],
|
|
1374
|
+
type: "u64"
|
|
1375
|
+
},
|
|
1376
|
+
{
|
|
1377
|
+
name: "buffer_2",
|
|
1378
|
+
docs: ["Buffer for additional fields"],
|
|
1379
|
+
type: {
|
|
1380
|
+
array: ["u8", 22]
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
]
|
|
1384
|
+
}
|
|
1385
|
+
},
|
|
1386
|
+
{
|
|
1387
|
+
name: "ClaimedEvent",
|
|
1388
|
+
docs: ["Emitted when tokens are claimed."],
|
|
1389
|
+
type: {
|
|
1390
|
+
kind: "struct",
|
|
1391
|
+
fields: [
|
|
1392
|
+
{
|
|
1393
|
+
name: "claimant",
|
|
1394
|
+
docs: ["User that claimed."],
|
|
1395
|
+
type: "pubkey"
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
name: "amount",
|
|
1399
|
+
docs: ["Amount of tokens to distribute."],
|
|
1400
|
+
type: "u64"
|
|
1401
|
+
}
|
|
1402
|
+
]
|
|
1403
|
+
}
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
name: "CompressedClaimStatus",
|
|
1407
|
+
docs: ["Holds whether or not a claimant has claimed tokens."],
|
|
1408
|
+
type: {
|
|
1409
|
+
kind: "struct",
|
|
1410
|
+
fields: [
|
|
1411
|
+
{
|
|
1412
|
+
name: "state",
|
|
1413
|
+
type: {
|
|
1414
|
+
defined: {
|
|
1415
|
+
name: "State"
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
]
|
|
1420
|
+
}
|
|
1421
|
+
},
|
|
1422
|
+
{
|
|
1423
|
+
name: "MerkleDistributor",
|
|
1424
|
+
docs: ["State for the account which distributes tokens."],
|
|
1425
|
+
type: {
|
|
1426
|
+
kind: "struct",
|
|
1427
|
+
fields: [
|
|
1428
|
+
{
|
|
1429
|
+
name: "bump",
|
|
1430
|
+
docs: ["Bump seed."],
|
|
1431
|
+
type: "u8"
|
|
1432
|
+
},
|
|
1433
|
+
{
|
|
1434
|
+
name: "version",
|
|
1435
|
+
docs: ["Version of the airdrop"],
|
|
1436
|
+
type: "u64"
|
|
1437
|
+
},
|
|
1438
|
+
{
|
|
1439
|
+
name: "root",
|
|
1440
|
+
docs: ["The 256-bit merkle root."],
|
|
1441
|
+
type: {
|
|
1442
|
+
array: ["u8", 32]
|
|
1443
|
+
}
|
|
1444
|
+
},
|
|
1445
|
+
{
|
|
1446
|
+
name: "mint",
|
|
1447
|
+
docs: ["[Mint] of the token to be distributed."],
|
|
1448
|
+
type: "pubkey"
|
|
1449
|
+
},
|
|
1450
|
+
{
|
|
1451
|
+
name: "token_vault",
|
|
1452
|
+
docs: ["Token Address of the vault"],
|
|
1453
|
+
type: "pubkey"
|
|
1454
|
+
},
|
|
1455
|
+
{
|
|
1456
|
+
name: "max_total_claim",
|
|
1457
|
+
docs: ["Maximum number of tokens that can ever be claimed from this [MerkleDistributor]."],
|
|
1458
|
+
type: "u64"
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
name: "max_num_nodes",
|
|
1462
|
+
docs: ["Maximum number of nodes in [MerkleDistributor]."],
|
|
1463
|
+
type: "u64"
|
|
1464
|
+
},
|
|
1465
|
+
{
|
|
1466
|
+
name: "unlock_period",
|
|
1467
|
+
docs: ["Time step (period) in seconds per which the unlock occurs"],
|
|
1468
|
+
type: "u64"
|
|
1469
|
+
},
|
|
1470
|
+
{
|
|
1471
|
+
name: "total_amount_claimed",
|
|
1472
|
+
docs: ["Total amount of tokens that have been claimed."],
|
|
1473
|
+
type: "u64"
|
|
1474
|
+
},
|
|
1475
|
+
{
|
|
1476
|
+
name: "num_nodes_claimed",
|
|
1477
|
+
docs: ["Number of nodes that have been claimed."],
|
|
1478
|
+
type: "u64"
|
|
1479
|
+
},
|
|
1480
|
+
{
|
|
1481
|
+
name: "start_ts",
|
|
1482
|
+
docs: ["Lockup time start (Unix Timestamp)"],
|
|
1483
|
+
type: "u64"
|
|
1484
|
+
},
|
|
1485
|
+
{
|
|
1486
|
+
name: "end_ts",
|
|
1487
|
+
docs: ["Lockup time end (Unix Timestamp)"],
|
|
1488
|
+
type: "u64"
|
|
1489
|
+
},
|
|
1490
|
+
{
|
|
1491
|
+
name: "clawback_start_ts",
|
|
1492
|
+
docs: ["Clawback start (Unix Timestamp)"],
|
|
1493
|
+
type: "u64"
|
|
1494
|
+
},
|
|
1495
|
+
{
|
|
1496
|
+
name: "clawback_receiver",
|
|
1497
|
+
docs: ["Clawback receiver"],
|
|
1498
|
+
type: "pubkey"
|
|
1499
|
+
},
|
|
1500
|
+
{
|
|
1501
|
+
name: "admin",
|
|
1502
|
+
docs: ["Admin wallet"],
|
|
1503
|
+
type: "pubkey"
|
|
1504
|
+
},
|
|
1505
|
+
{
|
|
1506
|
+
name: "clawed_back",
|
|
1507
|
+
docs: ["Whether or not the distributor has been clawed back"],
|
|
1508
|
+
type: "bool"
|
|
1509
|
+
},
|
|
1510
|
+
{
|
|
1511
|
+
name: "claims_closable_by_admin",
|
|
1512
|
+
docs: ["Whether claims are closable by the admin or not"],
|
|
1513
|
+
type: "bool"
|
|
1514
|
+
},
|
|
1515
|
+
{
|
|
1516
|
+
name: "can_update_duration",
|
|
1517
|
+
docs: ["Whether admin can update vesting duration"],
|
|
1518
|
+
type: "bool"
|
|
1519
|
+
},
|
|
1520
|
+
{
|
|
1521
|
+
name: "total_amount_unlocked",
|
|
1522
|
+
docs: ["Total amount of funds unlocked (cliff/instant)"],
|
|
1523
|
+
type: "u64"
|
|
1524
|
+
},
|
|
1525
|
+
{
|
|
1526
|
+
name: "total_amount_locked",
|
|
1527
|
+
docs: ["Total amount of funds locked (vested)"],
|
|
1528
|
+
type: "u64"
|
|
1529
|
+
},
|
|
1530
|
+
{
|
|
1531
|
+
name: "last_duration_update_ts",
|
|
1532
|
+
docs: ["Timestamp when update was last called"],
|
|
1533
|
+
type: "u64"
|
|
1534
|
+
},
|
|
1535
|
+
{
|
|
1536
|
+
name: "total_claimable_pre_update",
|
|
1537
|
+
docs: [
|
|
1538
|
+
"Total amount of locked amount claimable as of last duration update, ever increasing total, accumulates with each update"
|
|
1539
|
+
],
|
|
1540
|
+
type: "u64"
|
|
1541
|
+
},
|
|
1542
|
+
{
|
|
1543
|
+
name: "clawed_back_ts",
|
|
1544
|
+
docs: ["Timestamp when funds were clawed back"],
|
|
1545
|
+
type: "u64"
|
|
1546
|
+
},
|
|
1547
|
+
{
|
|
1548
|
+
name: "claims_closable_by_claimant",
|
|
1549
|
+
docs: ["Whether claims are closable by claimant or not"],
|
|
1550
|
+
type: "bool"
|
|
1551
|
+
},
|
|
1552
|
+
{
|
|
1553
|
+
name: "claims_limit",
|
|
1554
|
+
docs: ["Limit number of claims"],
|
|
1555
|
+
type: "u16"
|
|
1556
|
+
},
|
|
1557
|
+
{
|
|
1558
|
+
name: "buffer_2",
|
|
1559
|
+
docs: ["Buffer for additional fields"],
|
|
1560
|
+
type: {
|
|
1561
|
+
array: ["u8", 20]
|
|
1562
|
+
}
|
|
1563
|
+
},
|
|
1564
|
+
{
|
|
1565
|
+
name: "buffer_3",
|
|
1566
|
+
docs: ["Buffer for additional fields"],
|
|
1567
|
+
type: {
|
|
1568
|
+
array: ["u8", 32]
|
|
1569
|
+
}
|
|
1570
|
+
}
|
|
1571
|
+
]
|
|
1572
|
+
}
|
|
1573
|
+
},
|
|
1574
|
+
{
|
|
1575
|
+
name: "NewClaimEvent",
|
|
1576
|
+
docs: ["Emitted when a new claim is created."],
|
|
1577
|
+
type: {
|
|
1578
|
+
kind: "struct",
|
|
1579
|
+
fields: [
|
|
1580
|
+
{
|
|
1581
|
+
name: "claimant",
|
|
1582
|
+
docs: ["User that claimed."],
|
|
1583
|
+
type: "pubkey"
|
|
1584
|
+
},
|
|
1585
|
+
{
|
|
1586
|
+
name: "timestamp",
|
|
1587
|
+
docs: ["Timestamp."],
|
|
1588
|
+
type: "u64"
|
|
1589
|
+
}
|
|
1590
|
+
]
|
|
1591
|
+
}
|
|
1592
|
+
},
|
|
1593
|
+
{
|
|
1594
|
+
name: "State",
|
|
1595
|
+
type: {
|
|
1596
|
+
kind: "enum",
|
|
1597
|
+
variants: [
|
|
1598
|
+
{
|
|
1599
|
+
name: "Claimed"
|
|
1600
|
+
},
|
|
1601
|
+
{
|
|
1602
|
+
name: "Closed"
|
|
1603
|
+
}
|
|
1604
|
+
]
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
]
|
|
1608
|
+
};
|
|
1609
|
+
|
|
300
1610
|
// solana/constants.ts
|
|
301
1611
|
var constants_exports = {};
|
|
302
1612
|
__export(constants_exports, {
|
|
@@ -322,7 +1632,7 @@ var ALIGNED_DISTRIBUTOR_PREFIX = Buffer.from("aligned-distributor", "utf-8");
|
|
|
322
1632
|
var TEST_ORACLE_PREFIX = Buffer.from("test-oracle", "utf-8");
|
|
323
1633
|
var CLAIM_STATUS_PREFIX = Buffer.from("ClaimStatus", "utf-8");
|
|
324
1634
|
var ALIGNED_PRECISION_FACTOR_POW = 9;
|
|
325
|
-
var AIRDROP_CLAIM_FEE = BigInt(
|
|
1635
|
+
var AIRDROP_CLAIM_FEE = BigInt(1e7);
|
|
326
1636
|
var STREAMFLOW_TREASURY_PUBLIC_KEY = new web3_js.PublicKey("5SEpbdjFK5FxwTvfsGMXVQTD2v4M2c5tyRTxhdsPkgDw");
|
|
327
1637
|
var ONE_IN_BASIS_POINTS = BigInt(1e4);
|
|
328
1638
|
var ALIGNED_DISTRIBUTOR_PROGRAM_ID = {
|
|
@@ -337,107 +1647,6 @@ var DISTRIBUTOR_PROGRAM_ID = {
|
|
|
337
1647
|
[common.ICluster.Testnet]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N",
|
|
338
1648
|
[common.ICluster.Local]: "MErKy6nZVoVAkryxAejJz2juifQ4ArgLgHmaJCQkU7N"
|
|
339
1649
|
};
|
|
340
|
-
var _ClaimStatus = class _ClaimStatus {
|
|
341
|
-
constructor(fields) {
|
|
342
|
-
this.claimant = fields.claimant;
|
|
343
|
-
this.lockedAmount = fields.lockedAmount;
|
|
344
|
-
this.lockedAmountWithdrawn = fields.lockedAmountWithdrawn;
|
|
345
|
-
this.unlockedAmount = fields.unlockedAmount;
|
|
346
|
-
this.lastClaimTs = fields.lastClaimTs;
|
|
347
|
-
this.lastAmountPerUnlock = fields.lastAmountPerUnlock;
|
|
348
|
-
this.closed = fields.closed;
|
|
349
|
-
this.distributor = fields.distributor;
|
|
350
|
-
this.claimsCount = fields.claimsCount;
|
|
351
|
-
this.closedTs = fields.closedTs;
|
|
352
|
-
this.buffer2 = fields.buffer2;
|
|
353
|
-
}
|
|
354
|
-
static async fetch(c, address, programId = PROGRAM_ID) {
|
|
355
|
-
const info = await c.getAccountInfo(address);
|
|
356
|
-
if (info === null) {
|
|
357
|
-
return null;
|
|
358
|
-
}
|
|
359
|
-
if (!info.owner.equals(programId)) {
|
|
360
|
-
throw new Error("account doesn't belong to this program");
|
|
361
|
-
}
|
|
362
|
-
return this.decode(info.data);
|
|
363
|
-
}
|
|
364
|
-
static async fetchMultiple(c, addresses, programId = PROGRAM_ID) {
|
|
365
|
-
const infos = await c.getMultipleAccountsInfo(addresses);
|
|
366
|
-
return infos.map((info) => {
|
|
367
|
-
if (info === null) {
|
|
368
|
-
return null;
|
|
369
|
-
}
|
|
370
|
-
if (!info.owner.equals(programId)) {
|
|
371
|
-
throw new Error("account doesn't belong to this program");
|
|
372
|
-
}
|
|
373
|
-
return this.decode(info.data);
|
|
374
|
-
});
|
|
375
|
-
}
|
|
376
|
-
static decode(data) {
|
|
377
|
-
if (!data.slice(0, 8).equals(_ClaimStatus.discriminator)) {
|
|
378
|
-
throw new Error("invalid account discriminator");
|
|
379
|
-
}
|
|
380
|
-
const dec = _ClaimStatus.layout.decode(data.slice(8));
|
|
381
|
-
return new _ClaimStatus({
|
|
382
|
-
claimant: dec.claimant,
|
|
383
|
-
lockedAmount: dec.lockedAmount,
|
|
384
|
-
lockedAmountWithdrawn: dec.lockedAmountWithdrawn,
|
|
385
|
-
unlockedAmount: dec.unlockedAmount,
|
|
386
|
-
lastClaimTs: dec.lastClaimTs,
|
|
387
|
-
lastAmountPerUnlock: dec.lastAmountPerUnlock,
|
|
388
|
-
closed: dec.closed,
|
|
389
|
-
distributor: dec.distributor,
|
|
390
|
-
claimsCount: dec.claimsCount,
|
|
391
|
-
closedTs: dec.closedTs,
|
|
392
|
-
buffer2: dec.buffer2
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
toJSON() {
|
|
396
|
-
return {
|
|
397
|
-
claimant: this.claimant.toString(),
|
|
398
|
-
lockedAmount: this.lockedAmount.toString(),
|
|
399
|
-
lockedAmountWithdrawn: this.lockedAmountWithdrawn.toString(),
|
|
400
|
-
unlockedAmount: this.unlockedAmount.toString(),
|
|
401
|
-
lastClaimTs: this.lastClaimTs.toString(),
|
|
402
|
-
lastAmountPerUnlock: this.lastAmountPerUnlock.toString(),
|
|
403
|
-
closed: this.closed,
|
|
404
|
-
distributor: this.distributor.toString(),
|
|
405
|
-
claimsCount: this.claimsCount,
|
|
406
|
-
closedTs: this.closedTs.toString(),
|
|
407
|
-
buffer2: this.buffer2
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
static fromJSON(obj) {
|
|
411
|
-
return new _ClaimStatus({
|
|
412
|
-
claimant: new web3_js.PublicKey(obj.claimant),
|
|
413
|
-
lockedAmount: new BN6__default.default(obj.lockedAmount),
|
|
414
|
-
lockedAmountWithdrawn: new BN6__default.default(obj.lockedAmountWithdrawn),
|
|
415
|
-
unlockedAmount: new BN6__default.default(obj.unlockedAmount),
|
|
416
|
-
lastClaimTs: new BN6__default.default(obj.lastClaimTs),
|
|
417
|
-
lastAmountPerUnlock: new BN6__default.default(obj.lastAmountPerUnlock),
|
|
418
|
-
closed: obj.closed,
|
|
419
|
-
distributor: new web3_js.PublicKey(obj.distributor),
|
|
420
|
-
claimsCount: obj.claimsCount,
|
|
421
|
-
closedTs: new BN6__default.default(obj.closedTs),
|
|
422
|
-
buffer2: obj.buffer2
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
};
|
|
426
|
-
_ClaimStatus.discriminator = Buffer.from([22, 183, 249, 157, 247, 95, 150, 96]);
|
|
427
|
-
_ClaimStatus.layout = borsh8__namespace.struct([
|
|
428
|
-
borsh8__namespace.publicKey("claimant"),
|
|
429
|
-
borsh8__namespace.u64("lockedAmount"),
|
|
430
|
-
borsh8__namespace.u64("lockedAmountWithdrawn"),
|
|
431
|
-
borsh8__namespace.u64("unlockedAmount"),
|
|
432
|
-
borsh8__namespace.u64("lastClaimTs"),
|
|
433
|
-
borsh8__namespace.u64("lastAmountPerUnlock"),
|
|
434
|
-
borsh8__namespace.bool("closed"),
|
|
435
|
-
borsh8__namespace.publicKey("distributor"),
|
|
436
|
-
borsh8__namespace.u16("claimsCount"),
|
|
437
|
-
borsh8__namespace.u64("closedTs"),
|
|
438
|
-
borsh8__namespace.array(borsh8__namespace.u8(), 22, "buffer2")
|
|
439
|
-
]);
|
|
440
|
-
var ClaimStatus = _ClaimStatus;
|
|
441
1650
|
var _MerkleDistributor = class _MerkleDistributor {
|
|
442
1651
|
constructor(fields) {
|
|
443
1652
|
this.bump = fields.bump;
|
|
@@ -559,28 +1768,28 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
559
1768
|
static fromJSON(obj) {
|
|
560
1769
|
return new _MerkleDistributor({
|
|
561
1770
|
bump: obj.bump,
|
|
562
|
-
version: new
|
|
1771
|
+
version: new BN5__default.default(obj.version),
|
|
563
1772
|
root: obj.root,
|
|
564
1773
|
mint: new web3_js.PublicKey(obj.mint),
|
|
565
1774
|
tokenVault: new web3_js.PublicKey(obj.tokenVault),
|
|
566
|
-
maxTotalClaim: new
|
|
567
|
-
maxNumNodes: new
|
|
568
|
-
unlockPeriod: new
|
|
569
|
-
totalAmountClaimed: new
|
|
570
|
-
numNodesClaimed: new
|
|
571
|
-
startTs: new
|
|
572
|
-
endTs: new
|
|
573
|
-
clawbackStartTs: new
|
|
1775
|
+
maxTotalClaim: new BN5__default.default(obj.maxTotalClaim),
|
|
1776
|
+
maxNumNodes: new BN5__default.default(obj.maxNumNodes),
|
|
1777
|
+
unlockPeriod: new BN5__default.default(obj.unlockPeriod),
|
|
1778
|
+
totalAmountClaimed: new BN5__default.default(obj.totalAmountClaimed),
|
|
1779
|
+
numNodesClaimed: new BN5__default.default(obj.numNodesClaimed),
|
|
1780
|
+
startTs: new BN5__default.default(obj.startTs),
|
|
1781
|
+
endTs: new BN5__default.default(obj.endTs),
|
|
1782
|
+
clawbackStartTs: new BN5__default.default(obj.clawbackStartTs),
|
|
574
1783
|
clawbackReceiver: new web3_js.PublicKey(obj.clawbackReceiver),
|
|
575
1784
|
admin: new web3_js.PublicKey(obj.admin),
|
|
576
1785
|
clawedBack: obj.clawedBack,
|
|
577
1786
|
claimsClosableByAdmin: obj.claimsClosableByAdmin,
|
|
578
1787
|
canUpdateDuration: obj.canUpdateDuration,
|
|
579
|
-
totalAmountUnlocked: new
|
|
580
|
-
totalAmountLocked: new
|
|
581
|
-
lastDurationUpdateTs: new
|
|
582
|
-
totalClaimablePreUpdate: new
|
|
583
|
-
clawedBackTs: new
|
|
1788
|
+
totalAmountUnlocked: new BN5__default.default(obj.totalAmountUnlocked),
|
|
1789
|
+
totalAmountLocked: new BN5__default.default(obj.totalAmountLocked),
|
|
1790
|
+
lastDurationUpdateTs: new BN5__default.default(obj.lastDurationUpdateTs),
|
|
1791
|
+
totalClaimablePreUpdate: new BN5__default.default(obj.totalClaimablePreUpdate),
|
|
1792
|
+
clawedBackTs: new BN5__default.default(obj.clawedBackTs),
|
|
584
1793
|
claimsClosableByClaimant: obj.claimsClosableByClaimant,
|
|
585
1794
|
claimsLimit: obj.claimsLimit,
|
|
586
1795
|
buffer2: obj.buffer2,
|
|
@@ -589,34 +1798,34 @@ var _MerkleDistributor = class _MerkleDistributor {
|
|
|
589
1798
|
}
|
|
590
1799
|
};
|
|
591
1800
|
_MerkleDistributor.discriminator = Buffer.from([77, 119, 139, 70, 84, 247, 12, 26]);
|
|
592
|
-
_MerkleDistributor.layout =
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
1801
|
+
_MerkleDistributor.layout = borsh7__namespace.struct([
|
|
1802
|
+
borsh7__namespace.u8("bump"),
|
|
1803
|
+
borsh7__namespace.u64("version"),
|
|
1804
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "root"),
|
|
1805
|
+
borsh7__namespace.publicKey("mint"),
|
|
1806
|
+
borsh7__namespace.publicKey("tokenVault"),
|
|
1807
|
+
borsh7__namespace.u64("maxTotalClaim"),
|
|
1808
|
+
borsh7__namespace.u64("maxNumNodes"),
|
|
1809
|
+
borsh7__namespace.u64("unlockPeriod"),
|
|
1810
|
+
borsh7__namespace.u64("totalAmountClaimed"),
|
|
1811
|
+
borsh7__namespace.u64("numNodesClaimed"),
|
|
1812
|
+
borsh7__namespace.u64("startTs"),
|
|
1813
|
+
borsh7__namespace.u64("endTs"),
|
|
1814
|
+
borsh7__namespace.u64("clawbackStartTs"),
|
|
1815
|
+
borsh7__namespace.publicKey("clawbackReceiver"),
|
|
1816
|
+
borsh7__namespace.publicKey("admin"),
|
|
1817
|
+
borsh7__namespace.bool("clawedBack"),
|
|
1818
|
+
borsh7__namespace.bool("claimsClosableByAdmin"),
|
|
1819
|
+
borsh7__namespace.bool("canUpdateDuration"),
|
|
1820
|
+
borsh7__namespace.u64("totalAmountUnlocked"),
|
|
1821
|
+
borsh7__namespace.u64("totalAmountLocked"),
|
|
1822
|
+
borsh7__namespace.u64("lastDurationUpdateTs"),
|
|
1823
|
+
borsh7__namespace.u64("totalClaimablePreUpdate"),
|
|
1824
|
+
borsh7__namespace.u64("clawedBackTs"),
|
|
1825
|
+
borsh7__namespace.bool("claimsClosableByClaimant"),
|
|
1826
|
+
borsh7__namespace.u16("claimsLimit"),
|
|
1827
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 20, "buffer2"),
|
|
1828
|
+
borsh7__namespace.array(borsh7__namespace.u8(), 32, "buffer3")
|
|
620
1829
|
]);
|
|
621
1830
|
var MerkleDistributor = _MerkleDistributor;
|
|
622
1831
|
|
|
@@ -1628,9 +2837,9 @@ function getEventAuthorityPda(programId) {
|
|
|
1628
2837
|
const seeds = [buffer.Buffer.from("__event_authority")];
|
|
1629
2838
|
return web3_js.PublicKey.findProgramAddressSync(seeds, programId)[0];
|
|
1630
2839
|
}
|
|
1631
|
-
async function wrappedSignAndExecuteTransaction(
|
|
2840
|
+
async function wrappedSignAndExecuteTransaction(...args) {
|
|
1632
2841
|
try {
|
|
1633
|
-
return await solana.signAndExecuteTransaction(
|
|
2842
|
+
return await solana.signAndExecuteTransaction(...args);
|
|
1634
2843
|
} catch (err) {
|
|
1635
2844
|
if (err instanceof Error) {
|
|
1636
2845
|
const parsed = fromTxError(err);
|
|
@@ -1671,6 +2880,10 @@ var BaseDistributorClient = class {
|
|
|
1671
2880
|
this.connection = new web3_js.Connection(clusterUrl, this.commitment);
|
|
1672
2881
|
this.programId = programId !== "" ? new web3_js.PublicKey(programId) : new web3_js.PublicKey(DISTRIBUTOR_PROGRAM_ID[cluster]);
|
|
1673
2882
|
this.sendThrottler = sendThrottler ?? solana.buildSendThrottler(sendRate);
|
|
2883
|
+
const merkleDistributorProgram = {
|
|
2884
|
+
...merkle_distributor_default
|
|
2885
|
+
};
|
|
2886
|
+
this.merkleDistributorProgram = new anchor.Program(merkleDistributorProgram, { connection: this.connection });
|
|
1674
2887
|
}
|
|
1675
2888
|
getConnection() {
|
|
1676
2889
|
return this.connection;
|
|
@@ -1705,7 +2918,7 @@ var BaseDistributorClient = class {
|
|
|
1705
2918
|
};
|
|
1706
2919
|
if (extParams.isNative) {
|
|
1707
2920
|
ixs.push(
|
|
1708
|
-
...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new
|
|
2921
|
+
...await solana.prepareWrappedAccount(this.connection, extParams.invoker.publicKey, new BN5__default.default(data.maxTotalClaim))
|
|
1709
2922
|
);
|
|
1710
2923
|
}
|
|
1711
2924
|
const newDistributorInstruction = await this.getNewDistributorInstruction(data, accounts);
|
|
@@ -1746,7 +2959,14 @@ var BaseDistributorClient = class {
|
|
|
1746
2959
|
return { distributorPublicKey, ixs };
|
|
1747
2960
|
}
|
|
1748
2961
|
async create(data, extParams) {
|
|
1749
|
-
const
|
|
2962
|
+
const invoker = extParams.invoker.publicKey;
|
|
2963
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
2964
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
2965
|
+
const { ixs, distributorPublicKey } = await solana.createAndEstimateTransaction(
|
|
2966
|
+
(params) => this.prepareCreateInstructions(data, params),
|
|
2967
|
+
executionParams,
|
|
2968
|
+
(q) => q.ixs
|
|
2969
|
+
);
|
|
1750
2970
|
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, extParams.invoker.publicKey);
|
|
1751
2971
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1752
2972
|
this.connection,
|
|
@@ -1757,7 +2977,7 @@ var BaseDistributorClient = class {
|
|
|
1757
2977
|
context,
|
|
1758
2978
|
commitment: this.getCommitment()
|
|
1759
2979
|
},
|
|
1760
|
-
{ sendThrottler: this.sendThrottler }
|
|
2980
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1761
2981
|
);
|
|
1762
2982
|
return {
|
|
1763
2983
|
ixs,
|
|
@@ -1765,23 +2985,29 @@ var BaseDistributorClient = class {
|
|
|
1765
2985
|
metadataId: distributorPublicKey.toBase58()
|
|
1766
2986
|
};
|
|
1767
2987
|
}
|
|
1768
|
-
async claim(data, extParams) {
|
|
1769
|
-
const
|
|
1770
|
-
const
|
|
2988
|
+
async claim(data, extParams, _serviceTransfer) {
|
|
2989
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
2990
|
+
const invoker = executionParams.invoker.publicKey;
|
|
2991
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
2992
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
2993
|
+
(params) => this.prepareClaimInstructions(data, params, _serviceTransfer),
|
|
2994
|
+
executionParams
|
|
2995
|
+
);
|
|
2996
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1771
2997
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1772
2998
|
this.connection,
|
|
1773
|
-
|
|
2999
|
+
executionParams.invoker,
|
|
1774
3000
|
tx,
|
|
1775
3001
|
{
|
|
1776
3002
|
hash,
|
|
1777
3003
|
context,
|
|
1778
3004
|
commitment: this.getCommitment()
|
|
1779
3005
|
},
|
|
1780
|
-
{ sendThrottler: this.sendThrottler }
|
|
3006
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1781
3007
|
);
|
|
1782
3008
|
return { ixs, txId: signature };
|
|
1783
3009
|
}
|
|
1784
|
-
async prepareClaimInstructions(data, extParams) {
|
|
3010
|
+
async prepareClaimInstructions(data, extParams, _serviceTransfer) {
|
|
1785
3011
|
if (!extParams.invoker.publicKey) {
|
|
1786
3012
|
throw new Error("Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
1787
3013
|
}
|
|
@@ -1808,7 +3034,7 @@ var BaseDistributorClient = class {
|
|
|
1808
3034
|
extParams.invoker.publicKey
|
|
1809
3035
|
);
|
|
1810
3036
|
const eventAuthorityPublicKey = getEventAuthorityPda(this.programId);
|
|
1811
|
-
const claimStatus = await
|
|
3037
|
+
const claimStatus = await this.getClaim(claimStatusPublicKey);
|
|
1812
3038
|
const accounts = {
|
|
1813
3039
|
distributor: distributorPublicKey,
|
|
1814
3040
|
claimStatus: claimStatusPublicKey,
|
|
@@ -1823,32 +3049,43 @@ var BaseDistributorClient = class {
|
|
|
1823
3049
|
};
|
|
1824
3050
|
if (!claimStatus) {
|
|
1825
3051
|
const args = {
|
|
1826
|
-
amountLocked: new
|
|
1827
|
-
amountUnlocked: new
|
|
3052
|
+
amountLocked: new BN5__default.default(data.amountLocked),
|
|
3053
|
+
amountUnlocked: new BN5__default.default(data.amountUnlocked),
|
|
1828
3054
|
proof: data.proof
|
|
1829
3055
|
};
|
|
1830
3056
|
ixs.push(newClaim(args, accounts, this.programId));
|
|
1831
3057
|
}
|
|
1832
|
-
const nowTs = new
|
|
1833
|
-
if (claimStatus || new
|
|
3058
|
+
const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
|
|
3059
|
+
if (claimStatus || new BN5__default.default(data.amountLocked).gtn(0) && nowTs.sub(distributor.startTs).gte(distributor.unlockPeriod)) {
|
|
1834
3060
|
ixs.push(claimLocked(accounts, this.programId));
|
|
1835
3061
|
}
|
|
1836
|
-
ixs.push(
|
|
3062
|
+
ixs.push(
|
|
3063
|
+
this.prepareClaimFeeInstruction(
|
|
3064
|
+
extParams.invoker.publicKey,
|
|
3065
|
+
typeof _serviceTransfer === "bigint" ? _serviceTransfer : void 0
|
|
3066
|
+
)
|
|
3067
|
+
);
|
|
1837
3068
|
return ixs;
|
|
1838
3069
|
}
|
|
1839
3070
|
async closeClaim(data, extParams) {
|
|
1840
|
-
const
|
|
1841
|
-
const
|
|
3071
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3072
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3073
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3074
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
3075
|
+
(params) => this.prepareCloseClaimInstructions(data, params),
|
|
3076
|
+
executionParams
|
|
3077
|
+
);
|
|
3078
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1842
3079
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1843
3080
|
this.connection,
|
|
1844
|
-
|
|
3081
|
+
executionParams.invoker,
|
|
1845
3082
|
tx,
|
|
1846
3083
|
{
|
|
1847
3084
|
hash,
|
|
1848
3085
|
context,
|
|
1849
3086
|
commitment: this.getCommitment()
|
|
1850
3087
|
},
|
|
1851
|
-
{ sendThrottler: this.sendThrottler }
|
|
3088
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1852
3089
|
);
|
|
1853
3090
|
return { ixs, txId: signature };
|
|
1854
3091
|
}
|
|
@@ -1875,8 +3112,8 @@ var BaseDistributorClient = class {
|
|
|
1875
3112
|
program: this.programId
|
|
1876
3113
|
};
|
|
1877
3114
|
const closeClaimArgs = {
|
|
1878
|
-
amountLocked: data.amountLocked ? new
|
|
1879
|
-
amountUnlocked: data.amountUnlocked ? new
|
|
3115
|
+
amountLocked: data.amountLocked ? new BN5__default.default(data.amountLocked) : void 0,
|
|
3116
|
+
amountUnlocked: data.amountUnlocked ? new BN5__default.default(data.amountUnlocked) : void 0,
|
|
1880
3117
|
proof: data.proof
|
|
1881
3118
|
};
|
|
1882
3119
|
ixs.push(closeClaim(closeClaimArgs, closeClaimAccounts, this.programId));
|
|
@@ -1916,26 +3153,37 @@ var BaseDistributorClient = class {
|
|
|
1916
3153
|
return ixs;
|
|
1917
3154
|
}
|
|
1918
3155
|
async clawback(data, extParams) {
|
|
1919
|
-
const
|
|
1920
|
-
const
|
|
3156
|
+
const executionParams = this.unwrapExecutionParams(extParams);
|
|
3157
|
+
const invoker = executionParams.invoker.publicKey;
|
|
3158
|
+
common.invariant(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3159
|
+
const ixs = await solana.createAndEstimateTransaction(
|
|
3160
|
+
(params) => this.prepareClawbackInstructions(data, params),
|
|
3161
|
+
executionParams
|
|
3162
|
+
);
|
|
3163
|
+
const { tx, hash, context } = await solana.prepareTransaction(this.connection, ixs, invoker);
|
|
1921
3164
|
const signature = await wrappedSignAndExecuteTransaction(
|
|
1922
3165
|
this.connection,
|
|
1923
|
-
|
|
3166
|
+
executionParams.invoker,
|
|
1924
3167
|
tx,
|
|
1925
3168
|
{
|
|
1926
3169
|
hash,
|
|
1927
3170
|
context,
|
|
1928
3171
|
commitment: this.getCommitment()
|
|
1929
3172
|
},
|
|
1930
|
-
{ sendThrottler: this.sendThrottler }
|
|
3173
|
+
{ sendThrottler: this.sendThrottler, skipSimulation: executionParams.skipSimulation }
|
|
1931
3174
|
);
|
|
1932
3175
|
return { ixs, txId: signature };
|
|
1933
3176
|
}
|
|
3177
|
+
async getClaim(claimStatus) {
|
|
3178
|
+
return this.connection.getAccountInfo(solana.pk(claimStatus)).then((account) => this.decodeClaimStatus(account));
|
|
3179
|
+
}
|
|
1934
3180
|
async getClaims(data) {
|
|
1935
3181
|
const claimStatusPublicKeys = data.map(({ id, recipient }) => {
|
|
1936
3182
|
return getClaimantStatusPda(this.programId, new web3_js.PublicKey(id), new web3_js.PublicKey(recipient));
|
|
1937
3183
|
});
|
|
1938
|
-
return
|
|
3184
|
+
return this.connection.getMultipleAccountsInfo(claimStatusPublicKeys).then((accounts) => {
|
|
3185
|
+
return accounts.map((account) => this.decodeClaimStatus(account));
|
|
3186
|
+
});
|
|
1939
3187
|
}
|
|
1940
3188
|
async getDistributors(data) {
|
|
1941
3189
|
const distributorPublicKeys = data.ids.map((distributorId) => new web3_js.PublicKey(distributorId));
|
|
@@ -1965,28 +3213,28 @@ var BaseDistributorClient = class {
|
|
|
1965
3213
|
account: MerkleDistributor.decode(account.data)
|
|
1966
3214
|
}));
|
|
1967
3215
|
}
|
|
1968
|
-
prepareClaimFeeInstruction(payer) {
|
|
3216
|
+
prepareClaimFeeInstruction(payer, fee = AIRDROP_CLAIM_FEE) {
|
|
1969
3217
|
return web3_js.SystemProgram.transfer({
|
|
1970
3218
|
fromPubkey: payer,
|
|
1971
3219
|
toPubkey: STREAMFLOW_TREASURY_PUBLIC_KEY,
|
|
1972
|
-
lamports:
|
|
3220
|
+
lamports: fee
|
|
1973
3221
|
});
|
|
1974
3222
|
}
|
|
1975
3223
|
getNewDistributorArgs(data) {
|
|
1976
3224
|
const args = {
|
|
1977
|
-
version: new
|
|
3225
|
+
version: new BN5__default.default(data.version),
|
|
1978
3226
|
root: data.root,
|
|
1979
|
-
maxTotalClaim: new
|
|
1980
|
-
maxNumNodes: new
|
|
1981
|
-
unlockPeriod: new
|
|
1982
|
-
startVestingTs: new
|
|
1983
|
-
endVestingTs: new
|
|
1984
|
-
clawbackStartTs: new
|
|
3227
|
+
maxTotalClaim: new BN5__default.default(data.maxTotalClaim),
|
|
3228
|
+
maxNumNodes: new BN5__default.default(data.maxNumNodes),
|
|
3229
|
+
unlockPeriod: new BN5__default.default(data.unlockPeriod),
|
|
3230
|
+
startVestingTs: new BN5__default.default(data.startVestingTs),
|
|
3231
|
+
endVestingTs: new BN5__default.default(data.endVestingTs),
|
|
3232
|
+
clawbackStartTs: new BN5__default.default(data.clawbackStartTs),
|
|
1985
3233
|
claimsClosableByAdmin: data.claimsClosableByAdmin,
|
|
1986
3234
|
claimsClosableByClaimant: data.claimsClosableByClaimant,
|
|
1987
3235
|
claimsLimit: data.claimsLimit
|
|
1988
3236
|
};
|
|
1989
|
-
const nowTs = new
|
|
3237
|
+
const nowTs = new BN5__default.default(Math.floor(Date.now() / 1e3));
|
|
1990
3238
|
const endVestingTs = args.endVestingTs.isZero() ? nowTs : args.endVestingTs;
|
|
1991
3239
|
const startVestingTs = args.startVestingTs.isZero() ? nowTs : args.startVestingTs;
|
|
1992
3240
|
if (endVestingTs.gt(startVestingTs) && endVestingTs.sub(startVestingTs).lt(args.unlockPeriod)) {
|
|
@@ -1994,7 +3242,34 @@ var BaseDistributorClient = class {
|
|
|
1994
3242
|
}
|
|
1995
3243
|
return args;
|
|
1996
3244
|
}
|
|
3245
|
+
unwrapExecutionParams(extParams) {
|
|
3246
|
+
return solana.unwrapExecutionParams(extParams, this.connection);
|
|
3247
|
+
}
|
|
3248
|
+
decodeClaimStatus(account) {
|
|
3249
|
+
if (!account) {
|
|
3250
|
+
return account;
|
|
3251
|
+
}
|
|
3252
|
+
try {
|
|
3253
|
+
return decode(this.merkleDistributorProgram, "claimStatus", account.data);
|
|
3254
|
+
} catch (baseClaimStatusError) {
|
|
3255
|
+
try {
|
|
3256
|
+
return decode(this.merkleDistributorProgram, "compressedClaimStatus", account.data);
|
|
3257
|
+
} catch (compressedClaimStatusError) {
|
|
3258
|
+
throw new Error("Couldn't decode claim status");
|
|
3259
|
+
}
|
|
3260
|
+
}
|
|
3261
|
+
}
|
|
1997
3262
|
};
|
|
3263
|
+
function decode(program, accountName, accInfo, programKey) {
|
|
3264
|
+
const programId = program.programId?.toBase58() ?? "N/A";
|
|
3265
|
+
common.invariant(program, `Decoding program with key ${programId} is not available`);
|
|
3266
|
+
const accountEntity = program.idl.accounts?.find((acc) => acc.name === accountName);
|
|
3267
|
+
common.invariant(
|
|
3268
|
+
!!accountEntity,
|
|
3269
|
+
`Decoding program with key ${programId} doesn't specify account with name ${String(accountName)}`
|
|
3270
|
+
);
|
|
3271
|
+
return program.coder.accounts.decode(accountName, accInfo);
|
|
3272
|
+
}
|
|
1998
3273
|
|
|
1999
3274
|
// solana/clients/SolanaDistributorClient.ts
|
|
2000
3275
|
var SolanaDistributorClient = class extends BaseDistributorClient {
|
|
@@ -2012,7 +3287,7 @@ var aligned_distributor_default = {
|
|
|
2012
3287
|
address: "aMERKpFAWoChCi5oZwPvgsSCoGpZKBiU7fi76bdZjt2",
|
|
2013
3288
|
metadata: {
|
|
2014
3289
|
name: "aligned_distributor",
|
|
2015
|
-
version: "1.
|
|
3290
|
+
version: "1.5.0",
|
|
2016
3291
|
spec: "0.1.0",
|
|
2017
3292
|
description: "Proxy for merkle distributor that updates Vesting duration according to token market performance."
|
|
2018
3293
|
},
|
|
@@ -2156,6 +3431,48 @@ var aligned_distributor_default = {
|
|
|
2156
3431
|
}
|
|
2157
3432
|
]
|
|
2158
3433
|
},
|
|
3434
|
+
{
|
|
3435
|
+
name: "migrate_test_oracle",
|
|
3436
|
+
discriminator: [203, 254, 19, 3, 172, 185, 85, 190],
|
|
3437
|
+
accounts: [
|
|
3438
|
+
{
|
|
3439
|
+
name: "payer",
|
|
3440
|
+
writable: true,
|
|
3441
|
+
signer: true
|
|
3442
|
+
},
|
|
3443
|
+
{
|
|
3444
|
+
name: "mint"
|
|
3445
|
+
},
|
|
3446
|
+
{
|
|
3447
|
+
name: "creator"
|
|
3448
|
+
},
|
|
3449
|
+
{
|
|
3450
|
+
name: "test_oracle",
|
|
3451
|
+
writable: true,
|
|
3452
|
+
pda: {
|
|
3453
|
+
seeds: [
|
|
3454
|
+
{
|
|
3455
|
+
kind: "const",
|
|
3456
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3457
|
+
},
|
|
3458
|
+
{
|
|
3459
|
+
kind: "account",
|
|
3460
|
+
path: "mint"
|
|
3461
|
+
},
|
|
3462
|
+
{
|
|
3463
|
+
kind: "account",
|
|
3464
|
+
path: "creator"
|
|
3465
|
+
}
|
|
3466
|
+
]
|
|
3467
|
+
}
|
|
3468
|
+
},
|
|
3469
|
+
{
|
|
3470
|
+
name: "system_program",
|
|
3471
|
+
address: "11111111111111111111111111111111"
|
|
3472
|
+
}
|
|
3473
|
+
],
|
|
3474
|
+
args: []
|
|
3475
|
+
},
|
|
2159
3476
|
{
|
|
2160
3477
|
name: "new_distributor",
|
|
2161
3478
|
discriminator: [32, 139, 112, 171, 0, 2, 225, 155],
|
|
@@ -2241,6 +3558,48 @@ var aligned_distributor_default = {
|
|
|
2241
3558
|
}
|
|
2242
3559
|
]
|
|
2243
3560
|
},
|
|
3561
|
+
{
|
|
3562
|
+
name: "realloc_test_oracle",
|
|
3563
|
+
discriminator: [234, 221, 116, 4, 198, 251, 244, 206],
|
|
3564
|
+
accounts: [
|
|
3565
|
+
{
|
|
3566
|
+
name: "payer",
|
|
3567
|
+
writable: true,
|
|
3568
|
+
signer: true
|
|
3569
|
+
},
|
|
3570
|
+
{
|
|
3571
|
+
name: "mint"
|
|
3572
|
+
},
|
|
3573
|
+
{
|
|
3574
|
+
name: "creator"
|
|
3575
|
+
},
|
|
3576
|
+
{
|
|
3577
|
+
name: "test_oracle",
|
|
3578
|
+
writable: true,
|
|
3579
|
+
pda: {
|
|
3580
|
+
seeds: [
|
|
3581
|
+
{
|
|
3582
|
+
kind: "const",
|
|
3583
|
+
value: [116, 101, 115, 116, 45, 111, 114, 97, 99, 108, 101]
|
|
3584
|
+
},
|
|
3585
|
+
{
|
|
3586
|
+
kind: "account",
|
|
3587
|
+
path: "mint"
|
|
3588
|
+
},
|
|
3589
|
+
{
|
|
3590
|
+
kind: "account",
|
|
3591
|
+
path: "creator"
|
|
3592
|
+
}
|
|
3593
|
+
]
|
|
3594
|
+
}
|
|
3595
|
+
},
|
|
3596
|
+
{
|
|
3597
|
+
name: "system_program",
|
|
3598
|
+
address: "11111111111111111111111111111111"
|
|
3599
|
+
}
|
|
3600
|
+
],
|
|
3601
|
+
args: []
|
|
3602
|
+
},
|
|
2244
3603
|
{
|
|
2245
3604
|
name: "set_admin",
|
|
2246
3605
|
discriminator: [251, 163, 0, 52, 91, 194, 187, 92],
|
|
@@ -3026,22 +4385,21 @@ var SolanaAlignedDistributorClient = class extends BaseDistributorClient {
|
|
|
3026
4385
|
unlockPeriod
|
|
3027
4386
|
} = data;
|
|
3028
4387
|
return {
|
|
3029
|
-
totalAmountLocked: new
|
|
3030
|
-
totalAmountUnlocked: new
|
|
4388
|
+
totalAmountLocked: new BN5__default.default(totalAmountLocked),
|
|
4389
|
+
totalAmountUnlocked: new BN5__default.default(totalAmountUnlocked),
|
|
3031
4390
|
oracleType: !!oracleType ? { [oracleType]: {} } : { none: {} },
|
|
3032
4391
|
minPrice: common.getBN(minPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3033
4392
|
maxPrice: common.getBN(maxPrice, ALIGNED_PRECISION_FACTOR_POW),
|
|
3034
4393
|
minPercentage: common.getBN(minPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3035
4394
|
maxPercentage: common.getBN(maxPercentage, ALIGNED_PRECISION_FACTOR_POW),
|
|
3036
|
-
tickSize: new
|
|
4395
|
+
tickSize: new BN5__default.default(tickSize || 1),
|
|
3037
4396
|
skipInitial: skipInitial ?? false,
|
|
3038
|
-
updatePeriod: unlockPeriod < 30 ? new
|
|
4397
|
+
updatePeriod: unlockPeriod < 30 ? new BN5__default.default(30) : new BN5__default.default(unlockPeriod)
|
|
3039
4398
|
};
|
|
3040
4399
|
}
|
|
3041
4400
|
};
|
|
3042
4401
|
|
|
3043
4402
|
exports.AnchorErrorCode = AnchorErrorCode;
|
|
3044
|
-
exports.ClaimStatus = ClaimStatus;
|
|
3045
4403
|
exports.ContractErrorCode = ContractErrorCode;
|
|
3046
4404
|
exports.MerkleDistributor = MerkleDistributor;
|
|
3047
4405
|
exports.SolanaAlignedDistributorClient = SolanaAlignedDistributorClient;
|