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

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.
@@ -100,6 +100,12 @@ export type PriceBasedUnlock = {
100
100
  isMut: false;
101
101
  isSigner: false;
102
102
  },
103
+ {
104
+ name: "recipient";
105
+ isMut: false;
106
+ isSigner: true;
107
+ docs: ["Only the token recipient can start unlock"];
108
+ },
103
109
  {
104
110
  name: "eventAuthority";
105
111
  isMut: false;
@@ -132,17 +138,46 @@ export type PriceBasedUnlock = {
132
138
  isSigner: false;
133
139
  docs: ["The token account where locked tokens are stored"];
134
140
  },
141
+ {
142
+ name: "tokenMint";
143
+ isMut: false;
144
+ isSigner: false;
145
+ docs: ["The token mint - validated via has_one constraint on locker"];
146
+ },
135
147
  {
136
148
  name: "recipientTokenAccount";
137
149
  isMut: true;
138
150
  isSigner: false;
139
- docs: ["The recipient's token account where tokens will be sent"];
151
+ docs: [
152
+ "The recipient's ATA where tokens will be sent - created if needed"
153
+ ];
154
+ },
155
+ {
156
+ name: "tokenRecipient";
157
+ isMut: false;
158
+ isSigner: false;
159
+ },
160
+ {
161
+ name: "payer";
162
+ isMut: true;
163
+ isSigner: true;
164
+ docs: ["Payer for creating the ATA if needed"];
165
+ },
166
+ {
167
+ name: "systemProgram";
168
+ isMut: false;
169
+ isSigner: false;
140
170
  },
141
171
  {
142
172
  name: "tokenProgram";
143
173
  isMut: false;
144
174
  isSigner: false;
145
175
  },
176
+ {
177
+ name: "associatedTokenProgram";
178
+ isMut: false;
179
+ isSigner: false;
180
+ },
146
181
  {
147
182
  name: "eventAuthority";
148
183
  isMut: false;
@@ -178,6 +213,16 @@ export type PriceBasedUnlock = {
178
213
  name: "systemProgram";
179
214
  isMut: false;
180
215
  isSigner: false;
216
+ },
217
+ {
218
+ name: "eventAuthority";
219
+ isMut: false;
220
+ isSigner: false;
221
+ },
222
+ {
223
+ name: "program";
224
+ isMut: false;
225
+ isSigner: false;
181
226
  }
182
227
  ];
183
228
  args: [
@@ -209,9 +254,55 @@ export type PriceBasedUnlock = {
209
254
  docs: [
210
255
  "The party executing the change (must be opposite of proposer)"
211
256
  ];
257
+ },
258
+ {
259
+ name: "eventAuthority";
260
+ isMut: false;
261
+ isSigner: false;
262
+ },
263
+ {
264
+ name: "program";
265
+ isMut: false;
266
+ isSigner: false;
212
267
  }
213
268
  ];
214
269
  args: [];
270
+ },
271
+ {
272
+ name: "changeLockerAuthority";
273
+ accounts: [
274
+ {
275
+ name: "locker";
276
+ isMut: true;
277
+ isSigner: false;
278
+ },
279
+ {
280
+ name: "currentAuthority";
281
+ isMut: false;
282
+ 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
+ }
297
+ ];
298
+ args: [
299
+ {
300
+ name: "params";
301
+ type: {
302
+ defined: "ChangeLockerAuthorityParams";
303
+ };
304
+ }
305
+ ];
215
306
  }
216
307
  ];
217
308
  accounts: [
@@ -278,6 +369,11 @@ export type PriceBasedUnlock = {
278
369
  name: "lockerAuthority";
279
370
  docs: ["The authorized locker authority that can execute changes"];
280
371
  type: "publicKey";
372
+ },
373
+ {
374
+ name: "tokenMint";
375
+ docs: ["The mint of the locked tokens"];
376
+ type: "publicKey";
281
377
  }
282
378
  ];
283
379
  };
@@ -319,9 +415,9 @@ export type PriceBasedUnlock = {
319
415
  type: "publicKey";
320
416
  },
321
417
  {
322
- name: "createKey";
323
- docs: ["Used to derive the PDA"];
324
- type: "publicKey";
418
+ name: "pdaNonce";
419
+ docs: ["Used to derive the PDA along with the proposer"];
420
+ type: "u32";
325
421
  },
326
422
  {
327
423
  name: "pdaBump";
@@ -333,6 +429,18 @@ export type PriceBasedUnlock = {
333
429
  }
334
430
  ];
335
431
  types: [
432
+ {
433
+ name: "ChangeLockerAuthorityParams";
434
+ type: {
435
+ kind: "struct";
436
+ fields: [
437
+ {
438
+ name: "newLockerAuthority";
439
+ type: "publicKey";
440
+ }
441
+ ];
442
+ };
443
+ },
336
444
  {
337
445
  name: "InitializeLockerParams";
338
446
  type: {
@@ -383,8 +491,8 @@ export type PriceBasedUnlock = {
383
491
  };
384
492
  },
385
493
  {
386
- name: "createKey";
387
- type: "publicKey";
494
+ name: "pdaNonce";
495
+ type: "u32";
388
496
  }
389
497
  ];
390
498
  };
@@ -447,16 +555,6 @@ export type PriceBasedUnlock = {
447
555
  },
448
556
  {
449
557
  name: "Unlocked";
450
- },
451
- {
452
- name: "PendingChange";
453
- fields: [
454
- {
455
- name: "changeRequest";
456
- docs: ["The change request PDA address"];
457
- type: "publicKey";
458
- }
459
- ];
460
558
  }
461
559
  ];
462
560
  };
@@ -617,6 +715,95 @@ export type PriceBasedUnlock = {
617
715
  index: false;
618
716
  }
619
717
  ];
718
+ },
719
+ {
720
+ name: "ChangeProposed";
721
+ fields: [
722
+ {
723
+ name: "locker";
724
+ type: "publicKey";
725
+ index: false;
726
+ },
727
+ {
728
+ name: "changeRequest";
729
+ type: "publicKey";
730
+ index: false;
731
+ },
732
+ {
733
+ name: "proposer";
734
+ type: "publicKey";
735
+ index: false;
736
+ },
737
+ {
738
+ name: "changeType";
739
+ type: {
740
+ defined: "ChangeType";
741
+ };
742
+ index: false;
743
+ },
744
+ {
745
+ name: "proposedAt";
746
+ type: "i64";
747
+ index: false;
748
+ }
749
+ ];
750
+ },
751
+ {
752
+ name: "ChangeExecuted";
753
+ fields: [
754
+ {
755
+ name: "locker";
756
+ type: "publicKey";
757
+ index: false;
758
+ },
759
+ {
760
+ name: "changeRequest";
761
+ type: "publicKey";
762
+ index: false;
763
+ },
764
+ {
765
+ name: "executor";
766
+ type: "publicKey";
767
+ index: false;
768
+ },
769
+ {
770
+ name: "changeType";
771
+ type: {
772
+ defined: "ChangeType";
773
+ };
774
+ index: false;
775
+ },
776
+ {
777
+ name: "executedAt";
778
+ type: "i64";
779
+ index: false;
780
+ }
781
+ ];
782
+ },
783
+ {
784
+ name: "LockerAuthorityChanged";
785
+ fields: [
786
+ {
787
+ name: "locker";
788
+ type: "publicKey";
789
+ index: false;
790
+ },
791
+ {
792
+ name: "oldAuthority";
793
+ type: "publicKey";
794
+ index: false;
795
+ },
796
+ {
797
+ name: "newAuthority";
798
+ type: "publicKey";
799
+ index: false;
800
+ },
801
+ {
802
+ name: "changedAt";
803
+ type: "i64";
804
+ index: false;
805
+ }
806
+ ];
620
807
  }
621
808
  ];
622
809
  errors: [
@@ -627,38 +814,48 @@ export type PriceBasedUnlock = {
627
814
  },
628
815
  {
629
816
  code: 6001;
817
+ name: "UnlockTimestampInThePast";
818
+ msg: "Unlock timestamp must be in the future";
819
+ },
820
+ {
821
+ code: 6002;
630
822
  name: "InvalidLockerState";
631
823
  msg: "Locker is not in the expected state";
632
824
  },
633
825
  {
634
- code: 6002;
826
+ code: 6003;
635
827
  name: "TwapCalculationFailed";
636
828
  msg: "TWAP calculation failed";
637
829
  },
638
830
  {
639
- code: 6003;
831
+ code: 6004;
640
832
  name: "PriceThresholdNotMet";
641
833
  msg: "Price threshold not met";
642
834
  },
643
835
  {
644
- code: 6004;
836
+ code: 6005;
645
837
  name: "InvalidOracleData";
646
838
  msg: "Invalid oracle account data";
647
839
  },
648
840
  {
649
- code: 6005;
841
+ code: 6006;
650
842
  name: "UnauthorizedChangeRequest";
651
843
  msg: "Unauthorized to create or execute change request";
652
844
  },
653
845
  {
654
- code: 6006;
846
+ code: 6007;
655
847
  name: "InvalidChangeRequest";
656
848
  msg: "Change request does not match locker";
657
849
  },
658
850
  {
659
- code: 6007;
851
+ code: 6008;
660
852
  name: "UnauthorizedLockerAuthority";
661
853
  msg: "Unauthorized locker authority";
854
+ },
855
+ {
856
+ code: 6009;
857
+ name: "InvariantViolated";
858
+ msg: "An invariant was violated. You should get in contact with the MetaDAO team if you see this";
662
859
  }
663
860
  ];
664
861
  };
@@ -100,6 +100,12 @@ export const IDL = {
100
100
  isMut: false,
101
101
  isSigner: false,
102
102
  },
103
+ {
104
+ name: "recipient",
105
+ isMut: false,
106
+ isSigner: true,
107
+ docs: ["Only the token recipient can start unlock"],
108
+ },
103
109
  {
104
110
  name: "eventAuthority",
105
111
  isMut: false,
@@ -132,17 +138,46 @@ export const IDL = {
132
138
  isSigner: false,
133
139
  docs: ["The token account where locked tokens are stored"],
134
140
  },
141
+ {
142
+ name: "tokenMint",
143
+ isMut: false,
144
+ isSigner: false,
145
+ docs: ["The token mint - validated via has_one constraint on locker"],
146
+ },
135
147
  {
136
148
  name: "recipientTokenAccount",
137
149
  isMut: true,
138
150
  isSigner: false,
139
- docs: ["The recipient's token account where tokens will be sent"],
151
+ docs: [
152
+ "The recipient's ATA where tokens will be sent - created if needed",
153
+ ],
154
+ },
155
+ {
156
+ name: "tokenRecipient",
157
+ isMut: false,
158
+ isSigner: false,
159
+ },
160
+ {
161
+ name: "payer",
162
+ isMut: true,
163
+ isSigner: true,
164
+ docs: ["Payer for creating the ATA if needed"],
165
+ },
166
+ {
167
+ name: "systemProgram",
168
+ isMut: false,
169
+ isSigner: false,
140
170
  },
141
171
  {
142
172
  name: "tokenProgram",
143
173
  isMut: false,
144
174
  isSigner: false,
145
175
  },
176
+ {
177
+ name: "associatedTokenProgram",
178
+ isMut: false,
179
+ isSigner: false,
180
+ },
146
181
  {
147
182
  name: "eventAuthority",
148
183
  isMut: false,
@@ -179,6 +214,16 @@ export const IDL = {
179
214
  isMut: false,
180
215
  isSigner: false,
181
216
  },
217
+ {
218
+ name: "eventAuthority",
219
+ isMut: false,
220
+ isSigner: false,
221
+ },
222
+ {
223
+ name: "program",
224
+ isMut: false,
225
+ isSigner: false,
226
+ },
182
227
  ],
183
228
  args: [
184
229
  {
@@ -210,9 +255,55 @@ export const IDL = {
210
255
  "The party executing the change (must be opposite of proposer)",
211
256
  ],
212
257
  },
258
+ {
259
+ name: "eventAuthority",
260
+ isMut: false,
261
+ isSigner: false,
262
+ },
263
+ {
264
+ name: "program",
265
+ isMut: false,
266
+ isSigner: false,
267
+ },
213
268
  ],
214
269
  args: [],
215
270
  },
271
+ {
272
+ name: "changeLockerAuthority",
273
+ accounts: [
274
+ {
275
+ name: "locker",
276
+ isMut: true,
277
+ isSigner: false,
278
+ },
279
+ {
280
+ name: "currentAuthority",
281
+ isMut: false,
282
+ 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
+ },
297
+ ],
298
+ args: [
299
+ {
300
+ name: "params",
301
+ type: {
302
+ defined: "ChangeLockerAuthorityParams",
303
+ },
304
+ },
305
+ ],
306
+ },
216
307
  ],
217
308
  accounts: [
218
309
  {
@@ -279,6 +370,11 @@ export const IDL = {
279
370
  docs: ["The authorized locker authority that can execute changes"],
280
371
  type: "publicKey",
281
372
  },
373
+ {
374
+ name: "tokenMint",
375
+ docs: ["The mint of the locked tokens"],
376
+ type: "publicKey",
377
+ },
282
378
  ],
283
379
  },
284
380
  },
@@ -319,9 +415,9 @@ export const IDL = {
319
415
  type: "publicKey",
320
416
  },
321
417
  {
322
- name: "createKey",
323
- docs: ["Used to derive the PDA"],
324
- type: "publicKey",
418
+ name: "pdaNonce",
419
+ docs: ["Used to derive the PDA along with the proposer"],
420
+ type: "u32",
325
421
  },
326
422
  {
327
423
  name: "pdaBump",
@@ -333,6 +429,18 @@ export const IDL = {
333
429
  },
334
430
  ],
335
431
  types: [
432
+ {
433
+ name: "ChangeLockerAuthorityParams",
434
+ type: {
435
+ kind: "struct",
436
+ fields: [
437
+ {
438
+ name: "newLockerAuthority",
439
+ type: "publicKey",
440
+ },
441
+ ],
442
+ },
443
+ },
336
444
  {
337
445
  name: "InitializeLockerParams",
338
446
  type: {
@@ -383,8 +491,8 @@ export const IDL = {
383
491
  },
384
492
  },
385
493
  {
386
- name: "createKey",
387
- type: "publicKey",
494
+ name: "pdaNonce",
495
+ type: "u32",
388
496
  },
389
497
  ],
390
498
  },
@@ -448,16 +556,6 @@ export const IDL = {
448
556
  {
449
557
  name: "Unlocked",
450
558
  },
451
- {
452
- name: "PendingChange",
453
- fields: [
454
- {
455
- name: "changeRequest",
456
- docs: ["The change request PDA address"],
457
- type: "publicKey",
458
- },
459
- ],
460
- },
461
559
  ],
462
560
  },
463
561
  },
@@ -618,6 +716,95 @@ export const IDL = {
618
716
  },
619
717
  ],
620
718
  },
719
+ {
720
+ name: "ChangeProposed",
721
+ fields: [
722
+ {
723
+ name: "locker",
724
+ type: "publicKey",
725
+ index: false,
726
+ },
727
+ {
728
+ name: "changeRequest",
729
+ type: "publicKey",
730
+ index: false,
731
+ },
732
+ {
733
+ name: "proposer",
734
+ type: "publicKey",
735
+ index: false,
736
+ },
737
+ {
738
+ name: "changeType",
739
+ type: {
740
+ defined: "ChangeType",
741
+ },
742
+ index: false,
743
+ },
744
+ {
745
+ name: "proposedAt",
746
+ type: "i64",
747
+ index: false,
748
+ },
749
+ ],
750
+ },
751
+ {
752
+ name: "ChangeExecuted",
753
+ fields: [
754
+ {
755
+ name: "locker",
756
+ type: "publicKey",
757
+ index: false,
758
+ },
759
+ {
760
+ name: "changeRequest",
761
+ type: "publicKey",
762
+ index: false,
763
+ },
764
+ {
765
+ name: "executor",
766
+ type: "publicKey",
767
+ index: false,
768
+ },
769
+ {
770
+ name: "changeType",
771
+ type: {
772
+ defined: "ChangeType",
773
+ },
774
+ index: false,
775
+ },
776
+ {
777
+ name: "executedAt",
778
+ type: "i64",
779
+ index: false,
780
+ },
781
+ ],
782
+ },
783
+ {
784
+ name: "LockerAuthorityChanged",
785
+ fields: [
786
+ {
787
+ name: "locker",
788
+ type: "publicKey",
789
+ index: false,
790
+ },
791
+ {
792
+ name: "oldAuthority",
793
+ type: "publicKey",
794
+ index: false,
795
+ },
796
+ {
797
+ name: "newAuthority",
798
+ type: "publicKey",
799
+ index: false,
800
+ },
801
+ {
802
+ name: "changedAt",
803
+ type: "i64",
804
+ index: false,
805
+ },
806
+ ],
807
+ },
621
808
  ],
622
809
  errors: [
623
810
  {
@@ -627,39 +814,49 @@ export const IDL = {
627
814
  },
628
815
  {
629
816
  code: 6001,
817
+ name: "UnlockTimestampInThePast",
818
+ msg: "Unlock timestamp must be in the future",
819
+ },
820
+ {
821
+ code: 6002,
630
822
  name: "InvalidLockerState",
631
823
  msg: "Locker is not in the expected state",
632
824
  },
633
825
  {
634
- code: 6002,
826
+ code: 6003,
635
827
  name: "TwapCalculationFailed",
636
828
  msg: "TWAP calculation failed",
637
829
  },
638
830
  {
639
- code: 6003,
831
+ code: 6004,
640
832
  name: "PriceThresholdNotMet",
641
833
  msg: "Price threshold not met",
642
834
  },
643
835
  {
644
- code: 6004,
836
+ code: 6005,
645
837
  name: "InvalidOracleData",
646
838
  msg: "Invalid oracle account data",
647
839
  },
648
840
  {
649
- code: 6005,
841
+ code: 6006,
650
842
  name: "UnauthorizedChangeRequest",
651
843
  msg: "Unauthorized to create or execute change request",
652
844
  },
653
845
  {
654
- code: 6006,
846
+ code: 6007,
655
847
  name: "InvalidChangeRequest",
656
848
  msg: "Change request does not match locker",
657
849
  },
658
850
  {
659
- code: 6007,
851
+ code: 6008,
660
852
  name: "UnauthorizedLockerAuthority",
661
853
  msg: "Unauthorized locker authority",
662
854
  },
855
+ {
856
+ code: 6009,
857
+ name: "InvariantViolated",
858
+ msg: "An invariant was violated. You should get in contact with the MetaDAO team if you see this",
859
+ },
663
860
  ],
664
861
  };
665
862
  //# sourceMappingURL=price_based_unlock.js.map