@star-factory/sdk-vault 1.0.1 → 1.0.2
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/core/idl/vault.json +400 -3
- package/dist/core/types/index.d.ts +297 -4
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/index.js +112 -1
- package/dist/core/types/index.js.map +1 -1
- package/dist/features/index.d.ts +1 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +1 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/relay/index.d.ts +141 -0
- package/dist/features/relay/index.d.ts.map +1 -0
- package/dist/features/relay/index.js +270 -0
- package/dist/features/relay/index.js.map +1 -0
- package/dist/features/vault/StarVault.d.ts +41 -19
- package/dist/features/vault/StarVault.d.ts.map +1 -1
- package/dist/features/vault/StarVault.js +98 -16
- package/dist/features/vault/StarVault.js.map +1 -1
- package/dist/features/vault/make/presets.d.ts +10 -0
- package/dist/features/vault/make/presets.d.ts.map +1 -1
- package/dist/features/vault/make/presets.js +18 -0
- package/dist/features/vault/make/presets.js.map +1 -1
- package/dist/idl/vault.json +400 -3
- package/package.json +1 -1
package/dist/idl/vault.json
CHANGED
|
@@ -316,7 +316,7 @@
|
|
|
316
316
|
},
|
|
317
317
|
{
|
|
318
318
|
"name": "platform_admin",
|
|
319
|
-
"address": "
|
|
319
|
+
"address": "381onZFBYxD8vmVV8BUjRKU8R236vDRych4Mu7PqdPXd"
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
322
|
"name": "quote_token_program"
|
|
@@ -341,6 +341,64 @@
|
|
|
341
341
|
}
|
|
342
342
|
]
|
|
343
343
|
},
|
|
344
|
+
{
|
|
345
|
+
"name": "calculate_allocations",
|
|
346
|
+
"docs": [
|
|
347
|
+
"Calculate tier allocations after TGE acceptance.",
|
|
348
|
+
"Uses priority-fill algorithm: tier 3 (6mo) fills first, then 2, 1, 0.",
|
|
349
|
+
"Can only be called once."
|
|
350
|
+
],
|
|
351
|
+
"discriminator": [
|
|
352
|
+
240,
|
|
353
|
+
205,
|
|
354
|
+
171,
|
|
355
|
+
45,
|
|
356
|
+
96,
|
|
357
|
+
41,
|
|
358
|
+
104,
|
|
359
|
+
89
|
|
360
|
+
],
|
|
361
|
+
"accounts": [
|
|
362
|
+
{
|
|
363
|
+
"name": "admin",
|
|
364
|
+
"writable": true,
|
|
365
|
+
"signer": true
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"name": "vault",
|
|
369
|
+
"writable": true,
|
|
370
|
+
"pda": {
|
|
371
|
+
"seeds": [
|
|
372
|
+
{
|
|
373
|
+
"kind": "const",
|
|
374
|
+
"value": [
|
|
375
|
+
118,
|
|
376
|
+
97,
|
|
377
|
+
117,
|
|
378
|
+
108,
|
|
379
|
+
116
|
|
380
|
+
]
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"kind": "account",
|
|
384
|
+
"path": "vault.authority",
|
|
385
|
+
"account": "StarVault"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"kind": "arg",
|
|
389
|
+
"path": "seed"
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
],
|
|
395
|
+
"args": [
|
|
396
|
+
{
|
|
397
|
+
"name": "seed",
|
|
398
|
+
"type": "u64"
|
|
399
|
+
}
|
|
400
|
+
]
|
|
401
|
+
},
|
|
344
402
|
{
|
|
345
403
|
"name": "claim_dust",
|
|
346
404
|
"docs": [
|
|
@@ -1184,6 +1242,11 @@
|
|
|
1184
1242
|
},
|
|
1185
1243
|
{
|
|
1186
1244
|
"name": "deposit",
|
|
1245
|
+
"docs": [
|
|
1246
|
+
"Deposit funds with vesting tier commitment.",
|
|
1247
|
+
"tier: 0 = no lockup, 1 = 1 month, 2 = 3 months, 3 = 6 months",
|
|
1248
|
+
"First deposit sets the tier; subsequent deposits must match or use upgrade_tier."
|
|
1249
|
+
],
|
|
1187
1250
|
"discriminator": [
|
|
1188
1251
|
242,
|
|
1189
1252
|
35,
|
|
@@ -1407,7 +1470,7 @@
|
|
|
1407
1470
|
},
|
|
1408
1471
|
{
|
|
1409
1472
|
"name": "platform_admin",
|
|
1410
|
-
"address": "
|
|
1473
|
+
"address": "381onZFBYxD8vmVV8BUjRKU8R236vDRych4Mu7PqdPXd"
|
|
1411
1474
|
},
|
|
1412
1475
|
{
|
|
1413
1476
|
"name": "referrer",
|
|
@@ -1552,6 +1615,10 @@
|
|
|
1552
1615
|
{
|
|
1553
1616
|
"name": "amount",
|
|
1554
1617
|
"type": "u64"
|
|
1618
|
+
},
|
|
1619
|
+
{
|
|
1620
|
+
"name": "tier",
|
|
1621
|
+
"type": "u8"
|
|
1555
1622
|
}
|
|
1556
1623
|
]
|
|
1557
1624
|
},
|
|
@@ -2296,7 +2363,7 @@
|
|
|
2296
2363
|
},
|
|
2297
2364
|
{
|
|
2298
2365
|
"name": "platform_admin",
|
|
2299
|
-
"address": "
|
|
2366
|
+
"address": "381onZFBYxD8vmVV8BUjRKU8R236vDRych4Mu7PqdPXd"
|
|
2300
2367
|
},
|
|
2301
2368
|
{
|
|
2302
2369
|
"name": "quote_token_program"
|
|
@@ -2538,6 +2605,123 @@
|
|
|
2538
2605
|
"type": "u64"
|
|
2539
2606
|
}
|
|
2540
2607
|
]
|
|
2608
|
+
},
|
|
2609
|
+
{
|
|
2610
|
+
"name": "upgrade_tier",
|
|
2611
|
+
"docs": [
|
|
2612
|
+
"Upgrade vesting tier to a higher commitment (cannot downgrade).",
|
|
2613
|
+
"Can only be done while vault is active."
|
|
2614
|
+
],
|
|
2615
|
+
"discriminator": [
|
|
2616
|
+
122,
|
|
2617
|
+
56,
|
|
2618
|
+
170,
|
|
2619
|
+
60,
|
|
2620
|
+
252,
|
|
2621
|
+
234,
|
|
2622
|
+
190,
|
|
2623
|
+
51
|
|
2624
|
+
],
|
|
2625
|
+
"accounts": [
|
|
2626
|
+
{
|
|
2627
|
+
"name": "user",
|
|
2628
|
+
"writable": true,
|
|
2629
|
+
"signer": true
|
|
2630
|
+
},
|
|
2631
|
+
{
|
|
2632
|
+
"name": "vault",
|
|
2633
|
+
"writable": true,
|
|
2634
|
+
"pda": {
|
|
2635
|
+
"seeds": [
|
|
2636
|
+
{
|
|
2637
|
+
"kind": "const",
|
|
2638
|
+
"value": [
|
|
2639
|
+
118,
|
|
2640
|
+
97,
|
|
2641
|
+
117,
|
|
2642
|
+
108,
|
|
2643
|
+
116
|
|
2644
|
+
]
|
|
2645
|
+
},
|
|
2646
|
+
{
|
|
2647
|
+
"kind": "account",
|
|
2648
|
+
"path": "vault.authority",
|
|
2649
|
+
"account": "StarVault"
|
|
2650
|
+
},
|
|
2651
|
+
{
|
|
2652
|
+
"kind": "account",
|
|
2653
|
+
"path": "vault.seed",
|
|
2654
|
+
"account": "StarVault"
|
|
2655
|
+
}
|
|
2656
|
+
]
|
|
2657
|
+
}
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
"name": "depositor_record",
|
|
2661
|
+
"writable": true,
|
|
2662
|
+
"pda": {
|
|
2663
|
+
"seeds": [
|
|
2664
|
+
{
|
|
2665
|
+
"kind": "const",
|
|
2666
|
+
"value": [
|
|
2667
|
+
100,
|
|
2668
|
+
101,
|
|
2669
|
+
112,
|
|
2670
|
+
111,
|
|
2671
|
+
115,
|
|
2672
|
+
105,
|
|
2673
|
+
116,
|
|
2674
|
+
111,
|
|
2675
|
+
114
|
|
2676
|
+
]
|
|
2677
|
+
},
|
|
2678
|
+
{
|
|
2679
|
+
"kind": "account",
|
|
2680
|
+
"path": "vault"
|
|
2681
|
+
},
|
|
2682
|
+
{
|
|
2683
|
+
"kind": "account",
|
|
2684
|
+
"path": "user"
|
|
2685
|
+
}
|
|
2686
|
+
]
|
|
2687
|
+
}
|
|
2688
|
+
},
|
|
2689
|
+
{
|
|
2690
|
+
"name": "blacklist_entry",
|
|
2691
|
+
"pda": {
|
|
2692
|
+
"seeds": [
|
|
2693
|
+
{
|
|
2694
|
+
"kind": "const",
|
|
2695
|
+
"value": [
|
|
2696
|
+
98,
|
|
2697
|
+
108,
|
|
2698
|
+
97,
|
|
2699
|
+
99,
|
|
2700
|
+
107,
|
|
2701
|
+
108,
|
|
2702
|
+
105,
|
|
2703
|
+
115,
|
|
2704
|
+
116
|
|
2705
|
+
]
|
|
2706
|
+
},
|
|
2707
|
+
{
|
|
2708
|
+
"kind": "account",
|
|
2709
|
+
"path": "vault"
|
|
2710
|
+
},
|
|
2711
|
+
{
|
|
2712
|
+
"kind": "account",
|
|
2713
|
+
"path": "user"
|
|
2714
|
+
}
|
|
2715
|
+
]
|
|
2716
|
+
}
|
|
2717
|
+
}
|
|
2718
|
+
],
|
|
2719
|
+
"args": [
|
|
2720
|
+
{
|
|
2721
|
+
"name": "new_tier",
|
|
2722
|
+
"type": "u8"
|
|
2723
|
+
}
|
|
2724
|
+
]
|
|
2541
2725
|
}
|
|
2542
2726
|
],
|
|
2543
2727
|
"accounts": [
|
|
@@ -2607,6 +2791,19 @@
|
|
|
2607
2791
|
}
|
|
2608
2792
|
],
|
|
2609
2793
|
"events": [
|
|
2794
|
+
{
|
|
2795
|
+
"name": "AllocationsCalculatedEvent",
|
|
2796
|
+
"discriminator": [
|
|
2797
|
+
215,
|
|
2798
|
+
191,
|
|
2799
|
+
219,
|
|
2800
|
+
120,
|
|
2801
|
+
248,
|
|
2802
|
+
220,
|
|
2803
|
+
45,
|
|
2804
|
+
224
|
|
2805
|
+
]
|
|
2806
|
+
},
|
|
2610
2807
|
{
|
|
2611
2808
|
"name": "BlacklistEvent",
|
|
2612
2809
|
"discriminator": [
|
|
@@ -2853,6 +3050,19 @@
|
|
|
2853
3050
|
241,
|
|
2854
3051
|
67
|
|
2855
3052
|
]
|
|
3053
|
+
},
|
|
3054
|
+
{
|
|
3055
|
+
"name": "TierUpgradedEvent",
|
|
3056
|
+
"discriminator": [
|
|
3057
|
+
110,
|
|
3058
|
+
162,
|
|
3059
|
+
186,
|
|
3060
|
+
192,
|
|
3061
|
+
67,
|
|
3062
|
+
172,
|
|
3063
|
+
70,
|
|
3064
|
+
140
|
|
3065
|
+
]
|
|
2856
3066
|
}
|
|
2857
3067
|
],
|
|
2858
3068
|
"errors": [
|
|
@@ -3100,9 +3310,86 @@
|
|
|
3100
3310
|
"code": 6048,
|
|
3101
3311
|
"name": "NoUnclaimedDust",
|
|
3102
3312
|
"msg": "No unclaimed dust available to sweep"
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
"code": 6049,
|
|
3316
|
+
"name": "InvalidTier",
|
|
3317
|
+
"msg": "Invalid tier: must be 0-3"
|
|
3318
|
+
},
|
|
3319
|
+
{
|
|
3320
|
+
"code": 6050,
|
|
3321
|
+
"name": "TierMismatch",
|
|
3322
|
+
"msg": "Tier mismatch: already deposited to a different tier"
|
|
3323
|
+
},
|
|
3324
|
+
{
|
|
3325
|
+
"code": 6051,
|
|
3326
|
+
"name": "CannotDowngradeTier",
|
|
3327
|
+
"msg": "Cannot downgrade tier: only upgrades allowed"
|
|
3328
|
+
},
|
|
3329
|
+
{
|
|
3330
|
+
"code": 6052,
|
|
3331
|
+
"name": "AllocationsAlreadyCalculated",
|
|
3332
|
+
"msg": "Allocations already calculated"
|
|
3333
|
+
},
|
|
3334
|
+
{
|
|
3335
|
+
"code": 6053,
|
|
3336
|
+
"name": "AllocationsNotCalculated",
|
|
3337
|
+
"msg": "Allocations not yet calculated"
|
|
3338
|
+
},
|
|
3339
|
+
{
|
|
3340
|
+
"code": 6054,
|
|
3341
|
+
"name": "NoDepositToUpgrade",
|
|
3342
|
+
"msg": "No deposit to upgrade"
|
|
3103
3343
|
}
|
|
3104
3344
|
],
|
|
3105
3345
|
"types": [
|
|
3346
|
+
{
|
|
3347
|
+
"name": "AllocationsCalculatedEvent",
|
|
3348
|
+
"docs": [
|
|
3349
|
+
"Emitted when admin calculates tier allocations after TGE"
|
|
3350
|
+
],
|
|
3351
|
+
"type": {
|
|
3352
|
+
"kind": "struct",
|
|
3353
|
+
"fields": [
|
|
3354
|
+
{
|
|
3355
|
+
"name": "vault",
|
|
3356
|
+
"type": "pubkey"
|
|
3357
|
+
},
|
|
3358
|
+
{
|
|
3359
|
+
"name": "tier_totals",
|
|
3360
|
+
"docs": [
|
|
3361
|
+
"Snapshot of tier totals at allocation time (used for pro-rata refunds)"
|
|
3362
|
+
],
|
|
3363
|
+
"type": {
|
|
3364
|
+
"array": [
|
|
3365
|
+
"u64",
|
|
3366
|
+
7
|
|
3367
|
+
]
|
|
3368
|
+
}
|
|
3369
|
+
},
|
|
3370
|
+
{
|
|
3371
|
+
"name": "tier_allocated",
|
|
3372
|
+
"docs": [
|
|
3373
|
+
"Allocated amount per tier (priority-fill from tier 6 down)"
|
|
3374
|
+
],
|
|
3375
|
+
"type": {
|
|
3376
|
+
"array": [
|
|
3377
|
+
"u64",
|
|
3378
|
+
7
|
|
3379
|
+
]
|
|
3380
|
+
}
|
|
3381
|
+
},
|
|
3382
|
+
{
|
|
3383
|
+
"name": "target_raise_amount",
|
|
3384
|
+
"type": "u64"
|
|
3385
|
+
},
|
|
3386
|
+
{
|
|
3387
|
+
"name": "timestamp",
|
|
3388
|
+
"type": "i64"
|
|
3389
|
+
}
|
|
3390
|
+
]
|
|
3391
|
+
}
|
|
3392
|
+
},
|
|
3106
3393
|
{
|
|
3107
3394
|
"name": "BlacklistEntry",
|
|
3108
3395
|
"type": {
|
|
@@ -3200,6 +3487,10 @@
|
|
|
3200
3487
|
"name": "amount",
|
|
3201
3488
|
"type": "u64"
|
|
3202
3489
|
},
|
|
3490
|
+
{
|
|
3491
|
+
"name": "tier",
|
|
3492
|
+
"type": "u8"
|
|
3493
|
+
},
|
|
3203
3494
|
{
|
|
3204
3495
|
"name": "user_total",
|
|
3205
3496
|
"type": "u64"
|
|
@@ -3232,6 +3523,14 @@
|
|
|
3232
3523
|
"name": "vault",
|
|
3233
3524
|
"type": "pubkey"
|
|
3234
3525
|
},
|
|
3526
|
+
{
|
|
3527
|
+
"name": "tier",
|
|
3528
|
+
"docs": [
|
|
3529
|
+
"Vesting tier (0-6): 0=immediate, 1=2wk, 2=4wk, 3=6wk, 4=8wk, 5=10wk, 6=12wk",
|
|
3530
|
+
"Set on first deposit, can only be upgraded (not downgraded)"
|
|
3531
|
+
],
|
|
3532
|
+
"type": "u8"
|
|
3533
|
+
},
|
|
3235
3534
|
{
|
|
3236
3535
|
"name": "amount",
|
|
3237
3536
|
"type": "u64"
|
|
@@ -3509,6 +3808,10 @@
|
|
|
3509
3808
|
"name": "depositor",
|
|
3510
3809
|
"type": "pubkey"
|
|
3511
3810
|
},
|
|
3811
|
+
{
|
|
3812
|
+
"name": "tier",
|
|
3813
|
+
"type": "u8"
|
|
3814
|
+
},
|
|
3512
3815
|
{
|
|
3513
3816
|
"name": "original_amount",
|
|
3514
3817
|
"type": "u64"
|
|
@@ -3910,6 +4213,65 @@
|
|
|
3910
4213
|
{
|
|
3911
4214
|
"name": "bump",
|
|
3912
4215
|
"type": "u8"
|
|
4216
|
+
},
|
|
4217
|
+
{
|
|
4218
|
+
"name": "tier_totals",
|
|
4219
|
+
"docs": [
|
|
4220
|
+
"Total deposits per tier: [tier0..tier6]",
|
|
4221
|
+
"tier0 = immediate (0 weeks), tier1 = 2 weeks, tier2 = 4 weeks,",
|
|
4222
|
+
"tier3 = 6 weeks, tier4 = 8 weeks, tier5 = 10 weeks, tier6 = 12 weeks"
|
|
4223
|
+
],
|
|
4224
|
+
"type": {
|
|
4225
|
+
"array": [
|
|
4226
|
+
"u64",
|
|
4227
|
+
7
|
|
4228
|
+
]
|
|
4229
|
+
}
|
|
4230
|
+
},
|
|
4231
|
+
{
|
|
4232
|
+
"name": "tier_depositor_counts",
|
|
4233
|
+
"docs": [
|
|
4234
|
+
"Number of unique depositors per tier"
|
|
4235
|
+
],
|
|
4236
|
+
"type": {
|
|
4237
|
+
"array": [
|
|
4238
|
+
"u32",
|
|
4239
|
+
7
|
|
4240
|
+
]
|
|
4241
|
+
}
|
|
4242
|
+
},
|
|
4243
|
+
{
|
|
4244
|
+
"name": "tier_allocated",
|
|
4245
|
+
"docs": [
|
|
4246
|
+
"Allocated amount per tier after calculate_allocations (0 until calculated)",
|
|
4247
|
+
"Higher tiers get priority in allocation"
|
|
4248
|
+
],
|
|
4249
|
+
"type": {
|
|
4250
|
+
"array": [
|
|
4251
|
+
"u64",
|
|
4252
|
+
7
|
|
4253
|
+
]
|
|
4254
|
+
}
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
"name": "tier_totals_at_allocation",
|
|
4258
|
+
"docs": [
|
|
4259
|
+
"Snapshot of tier_totals at allocation time (for consistent pro-rata refund calculation)",
|
|
4260
|
+
"Using live tier_totals would cause inconsistent refunds as users claim sequentially"
|
|
4261
|
+
],
|
|
4262
|
+
"type": {
|
|
4263
|
+
"array": [
|
|
4264
|
+
"u64",
|
|
4265
|
+
7
|
|
4266
|
+
]
|
|
4267
|
+
}
|
|
4268
|
+
},
|
|
4269
|
+
{
|
|
4270
|
+
"name": "allocations_calculated",
|
|
4271
|
+
"docs": [
|
|
4272
|
+
"True once calculate_allocations has been called (prevents re-calculation)"
|
|
4273
|
+
],
|
|
4274
|
+
"type": "bool"
|
|
3913
4275
|
}
|
|
3914
4276
|
]
|
|
3915
4277
|
}
|
|
@@ -3982,6 +4344,41 @@
|
|
|
3982
4344
|
]
|
|
3983
4345
|
}
|
|
3984
4346
|
},
|
|
4347
|
+
{
|
|
4348
|
+
"name": "TierUpgradedEvent",
|
|
4349
|
+
"docs": [
|
|
4350
|
+
"Emitted when a user upgrades their vesting tier commitment"
|
|
4351
|
+
],
|
|
4352
|
+
"type": {
|
|
4353
|
+
"kind": "struct",
|
|
4354
|
+
"fields": [
|
|
4355
|
+
{
|
|
4356
|
+
"name": "vault",
|
|
4357
|
+
"type": "pubkey"
|
|
4358
|
+
},
|
|
4359
|
+
{
|
|
4360
|
+
"name": "user",
|
|
4361
|
+
"type": "pubkey"
|
|
4362
|
+
},
|
|
4363
|
+
{
|
|
4364
|
+
"name": "old_tier",
|
|
4365
|
+
"type": "u8"
|
|
4366
|
+
},
|
|
4367
|
+
{
|
|
4368
|
+
"name": "new_tier",
|
|
4369
|
+
"type": "u8"
|
|
4370
|
+
},
|
|
4371
|
+
{
|
|
4372
|
+
"name": "amount",
|
|
4373
|
+
"type": "u64"
|
|
4374
|
+
},
|
|
4375
|
+
{
|
|
4376
|
+
"name": "timestamp",
|
|
4377
|
+
"type": "i64"
|
|
4378
|
+
}
|
|
4379
|
+
]
|
|
4380
|
+
}
|
|
4381
|
+
},
|
|
3985
4382
|
{
|
|
3986
4383
|
"name": "VaultStatus",
|
|
3987
4384
|
"type": {
|