@metadaoproject/futarchy 0.6.0-alpha.7 → 0.6.0-alpha.9

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.
Files changed (40) hide show
  1. package/dist/v0.6/FutarchyClient.d.ts +25 -1
  2. package/dist/v0.6/FutarchyClient.js +1 -1
  3. package/dist/v0.6/FutarchyClient.js.map +1 -1
  4. package/dist/v0.6/LaunchpadClient.d.ts +112 -20
  5. package/dist/v0.6/LaunchpadClient.js +76 -19
  6. package/dist/v0.6/LaunchpadClient.js.map +1 -1
  7. package/dist/v0.6/{PriceBasedUnlockClient.d.ts → PriceBasedPerformancePackageClient.d.ts} +59 -97
  8. package/dist/v0.6/PriceBasedPerformancePackageClient.js +116 -0
  9. package/dist/v0.6/PriceBasedPerformancePackageClient.js.map +1 -0
  10. package/dist/v0.6/constants.d.ts +2 -1
  11. package/dist/v0.6/constants.js +2 -1
  12. package/dist/v0.6/constants.js.map +1 -1
  13. package/dist/v0.6/index.d.ts +1 -1
  14. package/dist/v0.6/index.js +1 -1
  15. package/dist/v0.6/index.js.map +1 -1
  16. package/dist/v0.6/types/futarchy.d.ts +327 -1
  17. package/dist/v0.6/types/futarchy.js +327 -1
  18. package/dist/v0.6/types/futarchy.js.map +1 -1
  19. package/dist/v0.6/types/index.d.ts +7 -7
  20. package/dist/v0.6/types/index.js +12 -4
  21. package/dist/v0.6/types/index.js.map +1 -1
  22. package/dist/v0.6/types/launchpad.d.ts +233 -26
  23. package/dist/v0.6/types/launchpad.js +233 -26
  24. package/dist/v0.6/types/launchpad.js.map +1 -1
  25. package/dist/v0.6/types/{price_based_unlock.d.ts → price_based_performance_package.d.ts} +175 -166
  26. package/dist/v0.6/types/{price_based_unlock.js → price_based_performance_package.js} +173 -164
  27. package/dist/v0.6/types/price_based_performance_package.js.map +1 -0
  28. package/dist/v0.6/utils/pda.d.ts +4 -0
  29. package/dist/v0.6/utils/pda.js +4 -1
  30. package/dist/v0.6/utils/pda.js.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/v0.6/PriceBasedUnlockClient.js +0 -134
  33. package/dist/v0.6/PriceBasedUnlockClient.js.map +0 -1
  34. package/dist/v0.6/types/price_based_token_lock.d.ts +0 -444
  35. package/dist/v0.6/types/price_based_token_lock.js +0 -444
  36. package/dist/v0.6/types/price_based_token_lock.js.map +0 -1
  37. package/dist/v0.6/types/price_based_unlock.js.map +0 -1
  38. package/dist/v0.6/types/shared_liquidity_manager.d.ts +0 -89
  39. package/dist/v0.6/types/shared_liquidity_manager.js +0 -89
  40. package/dist/v0.6/types/shared_liquidity_manager.js.map +0 -1
@@ -1,6 +1,6 @@
1
- export type PriceBasedUnlock = {
1
+ export type PriceBasedPerformancePackage = {
2
2
  version: "0.1.0";
3
- name: "price_based_unlock";
3
+ name: "price_based_performance_package";
4
4
  constants: [
5
5
  {
6
6
  name: "SEED";
@@ -10,10 +10,10 @@ export type PriceBasedUnlock = {
10
10
  ];
11
11
  instructions: [
12
12
  {
13
- name: "initializeLocker";
13
+ name: "initializePerformancePackage";
14
14
  accounts: [
15
15
  {
16
- name: "locker";
16
+ name: "performancePackage";
17
17
  isMut: true;
18
18
  isSigner: false;
19
19
  },
@@ -30,19 +30,19 @@ export type PriceBasedUnlock = {
30
30
  docs: ["The mint of the tokens to be locked"];
31
31
  },
32
32
  {
33
- name: "fromTokenAccount";
33
+ name: "grantorTokenAccount";
34
34
  isMut: true;
35
35
  isSigner: false;
36
36
  docs: ["The token account containing the tokens to be locked"];
37
37
  },
38
38
  {
39
- name: "tokenAuthority";
39
+ name: "grantor";
40
40
  isMut: false;
41
41
  isSigner: true;
42
42
  docs: ["The authority of the token account"];
43
43
  },
44
44
  {
45
- name: "lockerTokenAccount";
45
+ name: "performancePackageTokenVault";
46
46
  isMut: true;
47
47
  isSigner: false;
48
48
  docs: ["The locker's token account where tokens will be stored"];
@@ -82,7 +82,7 @@ export type PriceBasedUnlock = {
82
82
  {
83
83
  name: "params";
84
84
  type: {
85
- defined: "InitializeLockerParams";
85
+ defined: "InitializePerformancePackageParams";
86
86
  };
87
87
  }
88
88
  ];
@@ -91,7 +91,7 @@ export type PriceBasedUnlock = {
91
91
  name: "startUnlock";
92
92
  accounts: [
93
93
  {
94
- name: "locker";
94
+ name: "performancePackage";
95
95
  isMut: true;
96
96
  isSigner: false;
97
97
  },
@@ -123,7 +123,7 @@ export type PriceBasedUnlock = {
123
123
  name: "completeUnlock";
124
124
  accounts: [
125
125
  {
126
- name: "locker";
126
+ name: "performancePackage";
127
127
  isMut: true;
128
128
  isSigner: false;
129
129
  },
@@ -133,7 +133,7 @@ export type PriceBasedUnlock = {
133
133
  isSigner: false;
134
134
  },
135
135
  {
136
- name: "lockerTokenAccount";
136
+ name: "performancePackageTokenVault";
137
137
  isMut: true;
138
138
  isSigner: false;
139
139
  docs: ["The token account where locked tokens are stored"];
@@ -200,12 +200,17 @@ export type PriceBasedUnlock = {
200
200
  isSigner: false;
201
201
  },
202
202
  {
203
- name: "locker";
203
+ name: "performancePackage";
204
204
  isMut: true;
205
205
  isSigner: false;
206
206
  },
207
207
  {
208
208
  name: "proposer";
209
+ isMut: false;
210
+ isSigner: true;
211
+ },
212
+ {
213
+ name: "payer";
209
214
  isMut: true;
210
215
  isSigner: true;
211
216
  },
@@ -243,7 +248,7 @@ export type PriceBasedUnlock = {
243
248
  isSigner: false;
244
249
  },
245
250
  {
246
- name: "locker";
251
+ name: "performancePackage";
247
252
  isMut: true;
248
253
  isSigner: false;
249
254
  },
@@ -254,25 +259,15 @@ export type PriceBasedUnlock = {
254
259
  docs: [
255
260
  "The party executing the change (must be opposite of proposer)"
256
261
  ];
257
- },
258
- {
259
- name: "eventAuthority";
260
- isMut: false;
261
- isSigner: false;
262
- },
263
- {
264
- name: "program";
265
- isMut: false;
266
- isSigner: false;
267
262
  }
268
263
  ];
269
264
  args: [];
270
265
  },
271
266
  {
272
- name: "changeLockerAuthority";
267
+ name: "changePerformancePackageAuthority";
273
268
  accounts: [
274
269
  {
275
- name: "locker";
270
+ name: "performancePackage";
276
271
  isMut: true;
277
272
  isSigner: false;
278
273
  },
@@ -280,26 +275,13 @@ export type PriceBasedUnlock = {
280
275
  name: "currentAuthority";
281
276
  isMut: false;
282
277
  isSigner: true;
283
- docs: [
284
- "Only the current locker authority can change the locker authority"
285
- ];
286
- },
287
- {
288
- name: "eventAuthority";
289
- isMut: false;
290
- isSigner: false;
291
- },
292
- {
293
- name: "program";
294
- isMut: false;
295
- isSigner: false;
296
278
  }
297
279
  ];
298
280
  args: [
299
281
  {
300
282
  name: "params";
301
283
  type: {
302
- defined: "ChangeLockerAuthorityParams";
284
+ defined: "ChangePerformancePackageAuthorityParams";
303
285
  };
304
286
  }
305
287
  ];
@@ -307,27 +289,31 @@ export type PriceBasedUnlock = {
307
289
  ];
308
290
  accounts: [
309
291
  {
310
- name: "locker";
292
+ name: "performancePackage";
311
293
  type: {
312
294
  kind: "struct";
313
295
  fields: [
314
296
  {
315
- name: "priceThreshold";
316
- docs: ["The price threshold for 100% unlocking (max price target)"];
317
- type: "u128";
297
+ name: "tranches";
298
+ docs: ["The tranches that make up the performance package"];
299
+ type: {
300
+ vec: {
301
+ defined: "StoredTranche";
302
+ };
303
+ };
318
304
  },
319
305
  {
320
- name: "tokenAmount";
321
- docs: ["The amount of tokens locked"];
306
+ name: "totalTokenAmount";
307
+ docs: ["Total amount of tokens in the performance package"];
322
308
  type: "u64";
323
309
  },
324
310
  {
325
- name: "tokensAlreadyUnlocked";
326
- docs: ["The amount of tokens already unlocked"];
311
+ name: "alreadyUnlockedAmount";
312
+ docs: ["Amount of tokens already unlocked"];
327
313
  type: "u64";
328
314
  },
329
315
  {
330
- name: "unlockTimestamp";
316
+ name: "minUnlockTimestamp";
331
317
  docs: ["The timestamp when unlocking can begin"];
332
318
  type: "i64";
333
319
  },
@@ -344,7 +330,7 @@ export type PriceBasedUnlock = {
344
330
  type: "u64";
345
331
  },
346
332
  {
347
- name: "tokenRecipient";
333
+ name: "recipient";
348
334
  docs: ["The recipient of the tokens when unlocked"];
349
335
  type: "publicKey";
350
336
  },
@@ -352,7 +338,7 @@ export type PriceBasedUnlock = {
352
338
  name: "state";
353
339
  docs: ["The current state of the locker"];
354
340
  type: {
355
- defined: "LockerState";
341
+ defined: "PerformancePackageState";
356
342
  };
357
343
  },
358
344
  {
@@ -366,14 +352,28 @@ export type PriceBasedUnlock = {
366
352
  type: "u8";
367
353
  },
368
354
  {
369
- name: "lockerAuthority";
370
- docs: ["The authorized locker authority that can execute changes"];
355
+ name: "performancePackageAuthority";
356
+ docs: [
357
+ "The authorized locker authority that can execute changes, usually the organization"
358
+ ];
371
359
  type: "publicKey";
372
360
  },
373
361
  {
374
362
  name: "tokenMint";
375
363
  docs: ["The mint of the locked tokens"];
376
364
  type: "publicKey";
365
+ },
366
+ {
367
+ name: "seqNum";
368
+ docs: [
369
+ "The sequence number of the performance package, used for indexing events"
370
+ ];
371
+ type: "u64";
372
+ },
373
+ {
374
+ name: "performancePackageTokenVault";
375
+ docs: ["The vault that stores the tokens"];
376
+ type: "publicKey";
377
377
  }
378
378
  ];
379
379
  };
@@ -384,8 +384,8 @@ export type PriceBasedUnlock = {
384
384
  kind: "struct";
385
385
  fields: [
386
386
  {
387
- name: "locker";
388
- docs: ["The locker this change applies to"];
387
+ name: "performancePackage";
388
+ docs: ["The performance package this change applies to"];
389
389
  type: "publicKey";
390
390
  },
391
391
  {
@@ -400,13 +400,6 @@ export type PriceBasedUnlock = {
400
400
  docs: ["When the change was proposed"];
401
401
  type: "i64";
402
402
  },
403
- {
404
- name: "previousState";
405
- docs: ["The locker state before the change was proposed"];
406
- type: {
407
- defined: "LockerState";
408
- };
409
- },
410
403
  {
411
404
  name: "proposer";
412
405
  docs: [
@@ -430,32 +423,52 @@ export type PriceBasedUnlock = {
430
423
  ];
431
424
  types: [
432
425
  {
433
- name: "ChangeLockerAuthorityParams";
426
+ name: "CommonFields";
434
427
  type: {
435
428
  kind: "struct";
436
429
  fields: [
437
430
  {
438
- name: "newLockerAuthority";
439
- type: "publicKey";
431
+ name: "slot";
432
+ type: "u64";
433
+ },
434
+ {
435
+ name: "unixTimestamp";
436
+ type: "i64";
437
+ },
438
+ {
439
+ name: "performancePackageSeqNum";
440
+ type: "u64";
440
441
  }
441
442
  ];
442
443
  };
443
444
  },
444
445
  {
445
- name: "InitializeLockerParams";
446
+ name: "ChangePerformancePackageAuthorityParams";
446
447
  type: {
447
448
  kind: "struct";
448
449
  fields: [
449
450
  {
450
- name: "priceThreshold";
451
- type: "u128";
452
- },
451
+ name: "newPerformancePackageAuthority";
452
+ type: "publicKey";
453
+ }
454
+ ];
455
+ };
456
+ },
457
+ {
458
+ name: "InitializePerformancePackageParams";
459
+ type: {
460
+ kind: "struct";
461
+ fields: [
453
462
  {
454
- name: "tokenAmount";
455
- type: "u64";
463
+ name: "tranches";
464
+ type: {
465
+ vec: {
466
+ defined: "Tranche";
467
+ };
468
+ };
456
469
  },
457
470
  {
458
- name: "unlockTimestamp";
471
+ name: "minUnlockTimestamp";
459
472
  type: "i64";
460
473
  },
461
474
  {
@@ -469,11 +482,11 @@ export type PriceBasedUnlock = {
469
482
  type: "u64";
470
483
  },
471
484
  {
472
- name: "beneficiary";
485
+ name: "grantee";
473
486
  type: "publicKey";
474
487
  },
475
488
  {
476
- name: "lockerAuthority";
489
+ name: "performancePackageAuthority";
477
490
  type: "publicKey";
478
491
  }
479
492
  ];
@@ -531,7 +544,45 @@ export type PriceBasedUnlock = {
531
544
  };
532
545
  },
533
546
  {
534
- name: "LockerState";
547
+ name: "Tranche";
548
+ type: {
549
+ kind: "struct";
550
+ fields: [
551
+ {
552
+ name: "priceThreshold";
553
+ docs: ["The price at which this tranch unlocks"];
554
+ type: "u128";
555
+ },
556
+ {
557
+ name: "tokenAmount";
558
+ docs: ["The amount of tokens in this tranch"];
559
+ type: "u64";
560
+ }
561
+ ];
562
+ };
563
+ },
564
+ {
565
+ name: "StoredTranche";
566
+ type: {
567
+ kind: "struct";
568
+ fields: [
569
+ {
570
+ name: "priceThreshold";
571
+ type: "u128";
572
+ },
573
+ {
574
+ name: "tokenAmount";
575
+ type: "u64";
576
+ },
577
+ {
578
+ name: "isUnlocked";
579
+ type: "bool";
580
+ }
581
+ ];
582
+ };
583
+ },
584
+ {
585
+ name: "PerformancePackageState";
535
586
  type: {
536
587
  kind: "enum";
537
588
  variants: [
@@ -590,37 +641,17 @@ export type PriceBasedUnlock = {
590
641
  ];
591
642
  events: [
592
643
  {
593
- name: "LockerInitialized";
644
+ name: "PerformancePackageInitialized";
594
645
  fields: [
595
646
  {
596
- name: "locker";
597
- type: "publicKey";
598
- index: false;
599
- },
600
- {
601
- name: "priceThreshold";
602
- type: "u128";
603
- index: false;
604
- },
605
- {
606
- name: "tokenAmount";
607
- type: "u64";
608
- index: false;
609
- },
610
- {
611
- name: "unlockTimestamp";
612
- type: "i64";
613
- index: false;
614
- },
615
- {
616
- name: "oracleConfig";
647
+ name: "common";
617
648
  type: {
618
- defined: "OracleConfig";
649
+ defined: "CommonFields";
619
650
  };
620
651
  index: false;
621
652
  },
622
653
  {
623
- name: "tokenRecipient";
654
+ name: "performancePackage";
624
655
  type: "publicKey";
625
656
  index: false;
626
657
  }
@@ -630,7 +661,14 @@ export type PriceBasedUnlock = {
630
661
  name: "UnlockStarted";
631
662
  fields: [
632
663
  {
633
- name: "locker";
664
+ name: "common";
665
+ type: {
666
+ defined: "CommonFields";
667
+ };
668
+ index: false;
669
+ },
670
+ {
671
+ name: "performancePackage";
634
672
  type: "publicKey";
635
673
  index: false;
636
674
  },
@@ -650,38 +688,20 @@ export type PriceBasedUnlock = {
650
688
  name: "UnlockCompleted";
651
689
  fields: [
652
690
  {
653
- name: "locker";
654
- type: "publicKey";
655
- index: false;
656
- },
657
- {
658
- name: "tokenAmount";
659
- type: "u64";
691
+ name: "common";
692
+ type: {
693
+ defined: "CommonFields";
694
+ };
660
695
  index: false;
661
696
  },
662
697
  {
663
- name: "recipient";
698
+ name: "performancePackage";
664
699
  type: "publicKey";
665
700
  index: false;
666
701
  },
667
702
  {
668
- name: "twapPrice";
669
- type: "u128";
670
- index: false;
671
- },
672
- {
673
- name: "priceThreshold";
674
- type: "u128";
675
- index: false;
676
- }
677
- ];
678
- },
679
- {
680
- name: "TokensClaimed";
681
- fields: [
682
- {
683
- name: "locker";
684
- type: "publicKey";
703
+ name: "tokenAmount";
704
+ type: "u64";
685
705
  index: false;
686
706
  },
687
707
  {
@@ -690,27 +710,7 @@ export type PriceBasedUnlock = {
690
710
  index: false;
691
711
  },
692
712
  {
693
- name: "tokensClaimed";
694
- type: "u64";
695
- index: false;
696
- },
697
- {
698
- name: "tokensAlreadyUnlocked";
699
- type: "u64";
700
- index: false;
701
- },
702
- {
703
- name: "totalTokenAmount";
704
- type: "u64";
705
- index: false;
706
- },
707
- {
708
- name: "currentPrice";
709
- type: "u128";
710
- index: false;
711
- },
712
- {
713
- name: "unlockPercentage";
713
+ name: "twapPrice";
714
714
  type: "u128";
715
715
  index: false;
716
716
  }
@@ -740,11 +740,6 @@ export type PriceBasedUnlock = {
740
740
  defined: "ChangeType";
741
741
  };
742
742
  index: false;
743
- },
744
- {
745
- name: "proposedAt";
746
- type: "i64";
747
- index: false;
748
743
  }
749
744
  ];
750
745
  },
@@ -752,7 +747,14 @@ export type PriceBasedUnlock = {
752
747
  name: "ChangeExecuted";
753
748
  fields: [
754
749
  {
755
- name: "locker";
750
+ name: "common";
751
+ type: {
752
+ defined: "CommonFields";
753
+ };
754
+ index: false;
755
+ },
756
+ {
757
+ name: "performancePackage";
756
758
  type: "publicKey";
757
759
  index: false;
758
760
  },
@@ -772,17 +774,19 @@ export type PriceBasedUnlock = {
772
774
  defined: "ChangeType";
773
775
  };
774
776
  index: false;
775
- },
776
- {
777
- name: "executedAt";
778
- type: "i64";
779
- index: false;
780
777
  }
781
778
  ];
782
779
  },
783
780
  {
784
- name: "LockerAuthorityChanged";
781
+ name: "PerformancePackageAuthorityChanged";
785
782
  fields: [
783
+ {
784
+ name: "common";
785
+ type: {
786
+ defined: "CommonFields";
787
+ };
788
+ index: false;
789
+ },
786
790
  {
787
791
  name: "locker";
788
792
  type: "publicKey";
@@ -797,11 +801,6 @@ export type PriceBasedUnlock = {
797
801
  name: "newAuthority";
798
802
  type: "publicKey";
799
803
  index: false;
800
- },
801
- {
802
- name: "changedAt";
803
- type: "i64";
804
- index: false;
805
804
  }
806
805
  ];
807
806
  }
@@ -819,12 +818,12 @@ export type PriceBasedUnlock = {
819
818
  },
820
819
  {
821
820
  code: 6002;
822
- name: "InvalidLockerState";
823
- msg: "Locker is not in the expected state";
821
+ name: "InvalidPerformancePackageState";
822
+ msg: "Performance package is not in the expected state";
824
823
  },
825
824
  {
826
825
  code: 6003;
827
- name: "TwapCalculationFailed";
826
+ name: "TwapPeriodNotElapsed";
828
827
  msg: "TWAP calculation failed";
829
828
  },
830
829
  {
@@ -856,7 +855,17 @@ export type PriceBasedUnlock = {
856
855
  code: 6009;
857
856
  name: "InvariantViolated";
858
857
  msg: "An invariant was violated. You should get in contact with the MetaDAO team if you see this";
858
+ },
859
+ {
860
+ code: 6010;
861
+ name: "TranchePriceThresholdsNotMonotonic";
862
+ msg: "Tranche price thresholds must be monotonically increasing";
863
+ },
864
+ {
865
+ code: 6011;
866
+ name: "TrancheTokenAmountZero";
867
+ msg: "Tranche token amount must be greater than 0";
859
868
  }
860
869
  ];
861
870
  };
862
- export declare const IDL: PriceBasedUnlock;
871
+ export declare const IDL: PriceBasedPerformancePackage;