@metadaoproject/futarchy 0.6.0-alpha.8 → 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 (36) hide show
  1. package/dist/v0.6/FutarchyClient.d.ts +1 -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 +79 -19
  5. package/dist/v0.6/LaunchpadClient.js +70 -19
  6. package/dist/v0.6/LaunchpadClient.js.map +1 -1
  7. package/dist/v0.6/{PriceBasedUnlockClient.d.ts → PriceBasedPerformancePackageClient.d.ts} +59 -81
  8. package/dist/v0.6/{PriceBasedUnlockClient.js → PriceBasedPerformancePackageClient.js} +41 -47
  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/index.d.ts +6 -5
  17. package/dist/v0.6/types/index.js +12 -4
  18. package/dist/v0.6/types/index.js.map +1 -1
  19. package/dist/v0.6/types/launchpad.d.ts +134 -23
  20. package/dist/v0.6/types/launchpad.js +134 -23
  21. package/dist/v0.6/types/launchpad.js.map +1 -1
  22. package/dist/v0.6/types/{price_based_unlock.d.ts → price_based_performance_package.d.ts} +175 -146
  23. package/dist/v0.6/types/{price_based_unlock.js → price_based_performance_package.js} +173 -144
  24. package/dist/v0.6/types/price_based_performance_package.js.map +1 -0
  25. package/dist/v0.6/utils/pda.d.ts +4 -0
  26. package/dist/v0.6/utils/pda.js +4 -1
  27. package/dist/v0.6/utils/pda.js.map +1 -1
  28. package/package.json +1 -1
  29. package/dist/v0.6/PriceBasedUnlockClient.js.map +0 -1
  30. package/dist/v0.6/types/price_based_token_lock.d.ts +0 -444
  31. package/dist/v0.6/types/price_based_token_lock.js +0 -444
  32. package/dist/v0.6/types/price_based_token_lock.js.map +0 -1
  33. package/dist/v0.6/types/price_based_unlock.js.map +0 -1
  34. package/dist/v0.6/types/shared_liquidity_manager.d.ts +0 -89
  35. package/dist/v0.6/types/shared_liquidity_manager.js +0 -89
  36. 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
  },
@@ -259,10 +264,10 @@ export type PriceBasedUnlock = {
259
264
  args: [];
260
265
  },
261
266
  {
262
- name: "changeLockerAuthority";
267
+ name: "changePerformancePackageAuthority";
263
268
  accounts: [
264
269
  {
265
- name: "locker";
270
+ name: "performancePackage";
266
271
  isMut: true;
267
272
  isSigner: false;
268
273
  },
@@ -270,16 +275,13 @@ export type PriceBasedUnlock = {
270
275
  name: "currentAuthority";
271
276
  isMut: false;
272
277
  isSigner: true;
273
- docs: [
274
- "Only the current locker authority can change the locker authority"
275
- ];
276
278
  }
277
279
  ];
278
280
  args: [
279
281
  {
280
282
  name: "params";
281
283
  type: {
282
- defined: "ChangeLockerAuthorityParams";
284
+ defined: "ChangePerformancePackageAuthorityParams";
283
285
  };
284
286
  }
285
287
  ];
@@ -287,27 +289,31 @@ export type PriceBasedUnlock = {
287
289
  ];
288
290
  accounts: [
289
291
  {
290
- name: "locker";
292
+ name: "performancePackage";
291
293
  type: {
292
294
  kind: "struct";
293
295
  fields: [
294
296
  {
295
- name: "priceThreshold";
296
- docs: ["The price threshold for 100% unlocking (max price target)"];
297
- type: "u128";
297
+ name: "tranches";
298
+ docs: ["The tranches that make up the performance package"];
299
+ type: {
300
+ vec: {
301
+ defined: "StoredTranche";
302
+ };
303
+ };
298
304
  },
299
305
  {
300
- name: "tokenAmount";
301
- docs: ["The amount of tokens locked"];
306
+ name: "totalTokenAmount";
307
+ docs: ["Total amount of tokens in the performance package"];
302
308
  type: "u64";
303
309
  },
304
310
  {
305
- name: "tokensAlreadyUnlocked";
306
- docs: ["The amount of tokens already unlocked"];
311
+ name: "alreadyUnlockedAmount";
312
+ docs: ["Amount of tokens already unlocked"];
307
313
  type: "u64";
308
314
  },
309
315
  {
310
- name: "unlockTimestamp";
316
+ name: "minUnlockTimestamp";
311
317
  docs: ["The timestamp when unlocking can begin"];
312
318
  type: "i64";
313
319
  },
@@ -324,7 +330,7 @@ export type PriceBasedUnlock = {
324
330
  type: "u64";
325
331
  },
326
332
  {
327
- name: "tokenRecipient";
333
+ name: "recipient";
328
334
  docs: ["The recipient of the tokens when unlocked"];
329
335
  type: "publicKey";
330
336
  },
@@ -332,7 +338,7 @@ export type PriceBasedUnlock = {
332
338
  name: "state";
333
339
  docs: ["The current state of the locker"];
334
340
  type: {
335
- defined: "LockerState";
341
+ defined: "PerformancePackageState";
336
342
  };
337
343
  },
338
344
  {
@@ -346,14 +352,28 @@ export type PriceBasedUnlock = {
346
352
  type: "u8";
347
353
  },
348
354
  {
349
- name: "lockerAuthority";
350
- 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
+ ];
351
359
  type: "publicKey";
352
360
  },
353
361
  {
354
362
  name: "tokenMint";
355
363
  docs: ["The mint of the locked tokens"];
356
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";
357
377
  }
358
378
  ];
359
379
  };
@@ -364,8 +384,8 @@ export type PriceBasedUnlock = {
364
384
  kind: "struct";
365
385
  fields: [
366
386
  {
367
- name: "locker";
368
- docs: ["The locker this change applies to"];
387
+ name: "performancePackage";
388
+ docs: ["The performance package this change applies to"];
369
389
  type: "publicKey";
370
390
  },
371
391
  {
@@ -380,13 +400,6 @@ export type PriceBasedUnlock = {
380
400
  docs: ["When the change was proposed"];
381
401
  type: "i64";
382
402
  },
383
- {
384
- name: "previousState";
385
- docs: ["The locker state before the change was proposed"];
386
- type: {
387
- defined: "LockerState";
388
- };
389
- },
390
403
  {
391
404
  name: "proposer";
392
405
  docs: [
@@ -410,32 +423,52 @@ export type PriceBasedUnlock = {
410
423
  ];
411
424
  types: [
412
425
  {
413
- name: "ChangeLockerAuthorityParams";
426
+ name: "CommonFields";
414
427
  type: {
415
428
  kind: "struct";
416
429
  fields: [
417
430
  {
418
- name: "newLockerAuthority";
419
- type: "publicKey";
431
+ name: "slot";
432
+ type: "u64";
433
+ },
434
+ {
435
+ name: "unixTimestamp";
436
+ type: "i64";
437
+ },
438
+ {
439
+ name: "performancePackageSeqNum";
440
+ type: "u64";
420
441
  }
421
442
  ];
422
443
  };
423
444
  },
424
445
  {
425
- name: "InitializeLockerParams";
446
+ name: "ChangePerformancePackageAuthorityParams";
426
447
  type: {
427
448
  kind: "struct";
428
449
  fields: [
429
450
  {
430
- name: "priceThreshold";
431
- type: "u128";
432
- },
451
+ name: "newPerformancePackageAuthority";
452
+ type: "publicKey";
453
+ }
454
+ ];
455
+ };
456
+ },
457
+ {
458
+ name: "InitializePerformancePackageParams";
459
+ type: {
460
+ kind: "struct";
461
+ fields: [
433
462
  {
434
- name: "tokenAmount";
435
- type: "u64";
463
+ name: "tranches";
464
+ type: {
465
+ vec: {
466
+ defined: "Tranche";
467
+ };
468
+ };
436
469
  },
437
470
  {
438
- name: "unlockTimestamp";
471
+ name: "minUnlockTimestamp";
439
472
  type: "i64";
440
473
  },
441
474
  {
@@ -449,11 +482,11 @@ export type PriceBasedUnlock = {
449
482
  type: "u64";
450
483
  },
451
484
  {
452
- name: "beneficiary";
485
+ name: "grantee";
453
486
  type: "publicKey";
454
487
  },
455
488
  {
456
- name: "lockerAuthority";
489
+ name: "performancePackageAuthority";
457
490
  type: "publicKey";
458
491
  }
459
492
  ];
@@ -511,7 +544,45 @@ export type PriceBasedUnlock = {
511
544
  };
512
545
  },
513
546
  {
514
- 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";
515
586
  type: {
516
587
  kind: "enum";
517
588
  variants: [
@@ -570,37 +641,17 @@ export type PriceBasedUnlock = {
570
641
  ];
571
642
  events: [
572
643
  {
573
- name: "LockerInitialized";
644
+ name: "PerformancePackageInitialized";
574
645
  fields: [
575
646
  {
576
- name: "locker";
577
- type: "publicKey";
578
- index: false;
579
- },
580
- {
581
- name: "priceThreshold";
582
- type: "u128";
583
- index: false;
584
- },
585
- {
586
- name: "tokenAmount";
587
- type: "u64";
588
- index: false;
589
- },
590
- {
591
- name: "unlockTimestamp";
592
- type: "i64";
593
- index: false;
594
- },
595
- {
596
- name: "oracleConfig";
647
+ name: "common";
597
648
  type: {
598
- defined: "OracleConfig";
649
+ defined: "CommonFields";
599
650
  };
600
651
  index: false;
601
652
  },
602
653
  {
603
- name: "tokenRecipient";
654
+ name: "performancePackage";
604
655
  type: "publicKey";
605
656
  index: false;
606
657
  }
@@ -610,7 +661,14 @@ export type PriceBasedUnlock = {
610
661
  name: "UnlockStarted";
611
662
  fields: [
612
663
  {
613
- name: "locker";
664
+ name: "common";
665
+ type: {
666
+ defined: "CommonFields";
667
+ };
668
+ index: false;
669
+ },
670
+ {
671
+ name: "performancePackage";
614
672
  type: "publicKey";
615
673
  index: false;
616
674
  },
@@ -630,38 +688,20 @@ export type PriceBasedUnlock = {
630
688
  name: "UnlockCompleted";
631
689
  fields: [
632
690
  {
633
- name: "locker";
634
- type: "publicKey";
635
- index: false;
636
- },
637
- {
638
- name: "tokenAmount";
639
- type: "u64";
691
+ name: "common";
692
+ type: {
693
+ defined: "CommonFields";
694
+ };
640
695
  index: false;
641
696
  },
642
697
  {
643
- name: "recipient";
698
+ name: "performancePackage";
644
699
  type: "publicKey";
645
700
  index: false;
646
701
  },
647
702
  {
648
- name: "twapPrice";
649
- type: "u128";
650
- index: false;
651
- },
652
- {
653
- name: "priceThreshold";
654
- type: "u128";
655
- index: false;
656
- }
657
- ];
658
- },
659
- {
660
- name: "TokensClaimed";
661
- fields: [
662
- {
663
- name: "locker";
664
- type: "publicKey";
703
+ name: "tokenAmount";
704
+ type: "u64";
665
705
  index: false;
666
706
  },
667
707
  {
@@ -670,27 +710,7 @@ export type PriceBasedUnlock = {
670
710
  index: false;
671
711
  },
672
712
  {
673
- name: "tokensClaimed";
674
- type: "u64";
675
- index: false;
676
- },
677
- {
678
- name: "tokensAlreadyUnlocked";
679
- type: "u64";
680
- index: false;
681
- },
682
- {
683
- name: "totalTokenAmount";
684
- type: "u64";
685
- index: false;
686
- },
687
- {
688
- name: "currentPrice";
689
- type: "u128";
690
- index: false;
691
- },
692
- {
693
- name: "unlockPercentage";
713
+ name: "twapPrice";
694
714
  type: "u128";
695
715
  index: false;
696
716
  }
@@ -720,11 +740,6 @@ export type PriceBasedUnlock = {
720
740
  defined: "ChangeType";
721
741
  };
722
742
  index: false;
723
- },
724
- {
725
- name: "proposedAt";
726
- type: "i64";
727
- index: false;
728
743
  }
729
744
  ];
730
745
  },
@@ -732,7 +747,14 @@ export type PriceBasedUnlock = {
732
747
  name: "ChangeExecuted";
733
748
  fields: [
734
749
  {
735
- name: "locker";
750
+ name: "common";
751
+ type: {
752
+ defined: "CommonFields";
753
+ };
754
+ index: false;
755
+ },
756
+ {
757
+ name: "performancePackage";
736
758
  type: "publicKey";
737
759
  index: false;
738
760
  },
@@ -752,17 +774,19 @@ export type PriceBasedUnlock = {
752
774
  defined: "ChangeType";
753
775
  };
754
776
  index: false;
755
- },
756
- {
757
- name: "executedAt";
758
- type: "i64";
759
- index: false;
760
777
  }
761
778
  ];
762
779
  },
763
780
  {
764
- name: "LockerAuthorityChanged";
781
+ name: "PerformancePackageAuthorityChanged";
765
782
  fields: [
783
+ {
784
+ name: "common";
785
+ type: {
786
+ defined: "CommonFields";
787
+ };
788
+ index: false;
789
+ },
766
790
  {
767
791
  name: "locker";
768
792
  type: "publicKey";
@@ -777,11 +801,6 @@ export type PriceBasedUnlock = {
777
801
  name: "newAuthority";
778
802
  type: "publicKey";
779
803
  index: false;
780
- },
781
- {
782
- name: "changedAt";
783
- type: "i64";
784
- index: false;
785
804
  }
786
805
  ];
787
806
  }
@@ -799,12 +818,12 @@ export type PriceBasedUnlock = {
799
818
  },
800
819
  {
801
820
  code: 6002;
802
- name: "InvalidLockerState";
803
- msg: "Locker is not in the expected state";
821
+ name: "InvalidPerformancePackageState";
822
+ msg: "Performance package is not in the expected state";
804
823
  },
805
824
  {
806
825
  code: 6003;
807
- name: "TwapCalculationFailed";
826
+ name: "TwapPeriodNotElapsed";
808
827
  msg: "TWAP calculation failed";
809
828
  },
810
829
  {
@@ -836,7 +855,17 @@ export type PriceBasedUnlock = {
836
855
  code: 6009;
837
856
  name: "InvariantViolated";
838
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";
839
868
  }
840
869
  ];
841
870
  };
842
- export declare const IDL: PriceBasedUnlock;
871
+ export declare const IDL: PriceBasedPerformancePackage;