@metadaoproject/futarchy 0.6.0-alpha.6 → 0.6.0-alpha.8

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: [
@@ -212,6 +257,32 @@ export type PriceBasedUnlock = {
212
257
  }
213
258
  ];
214
259
  args: [];
260
+ },
261
+ {
262
+ name: "changeLockerAuthority";
263
+ accounts: [
264
+ {
265
+ name: "locker";
266
+ isMut: true;
267
+ isSigner: false;
268
+ },
269
+ {
270
+ name: "currentAuthority";
271
+ isMut: false;
272
+ isSigner: true;
273
+ docs: [
274
+ "Only the current locker authority can change the locker authority"
275
+ ];
276
+ }
277
+ ];
278
+ args: [
279
+ {
280
+ name: "params";
281
+ type: {
282
+ defined: "ChangeLockerAuthorityParams";
283
+ };
284
+ }
285
+ ];
215
286
  }
216
287
  ];
217
288
  accounts: [
@@ -278,6 +349,11 @@ export type PriceBasedUnlock = {
278
349
  name: "lockerAuthority";
279
350
  docs: ["The authorized locker authority that can execute changes"];
280
351
  type: "publicKey";
352
+ },
353
+ {
354
+ name: "tokenMint";
355
+ docs: ["The mint of the locked tokens"];
356
+ type: "publicKey";
281
357
  }
282
358
  ];
283
359
  };
@@ -319,9 +395,9 @@ export type PriceBasedUnlock = {
319
395
  type: "publicKey";
320
396
  },
321
397
  {
322
- name: "createKey";
323
- docs: ["Used to derive the PDA"];
324
- type: "publicKey";
398
+ name: "pdaNonce";
399
+ docs: ["Used to derive the PDA along with the proposer"];
400
+ type: "u32";
325
401
  },
326
402
  {
327
403
  name: "pdaBump";
@@ -333,6 +409,18 @@ export type PriceBasedUnlock = {
333
409
  }
334
410
  ];
335
411
  types: [
412
+ {
413
+ name: "ChangeLockerAuthorityParams";
414
+ type: {
415
+ kind: "struct";
416
+ fields: [
417
+ {
418
+ name: "newLockerAuthority";
419
+ type: "publicKey";
420
+ }
421
+ ];
422
+ };
423
+ },
336
424
  {
337
425
  name: "InitializeLockerParams";
338
426
  type: {
@@ -383,8 +471,8 @@ export type PriceBasedUnlock = {
383
471
  };
384
472
  },
385
473
  {
386
- name: "createKey";
387
- type: "publicKey";
474
+ name: "pdaNonce";
475
+ type: "u32";
388
476
  }
389
477
  ];
390
478
  };
@@ -447,16 +535,6 @@ export type PriceBasedUnlock = {
447
535
  },
448
536
  {
449
537
  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
538
  }
461
539
  ];
462
540
  };
@@ -617,6 +695,95 @@ export type PriceBasedUnlock = {
617
695
  index: false;
618
696
  }
619
697
  ];
698
+ },
699
+ {
700
+ name: "ChangeProposed";
701
+ fields: [
702
+ {
703
+ name: "locker";
704
+ type: "publicKey";
705
+ index: false;
706
+ },
707
+ {
708
+ name: "changeRequest";
709
+ type: "publicKey";
710
+ index: false;
711
+ },
712
+ {
713
+ name: "proposer";
714
+ type: "publicKey";
715
+ index: false;
716
+ },
717
+ {
718
+ name: "changeType";
719
+ type: {
720
+ defined: "ChangeType";
721
+ };
722
+ index: false;
723
+ },
724
+ {
725
+ name: "proposedAt";
726
+ type: "i64";
727
+ index: false;
728
+ }
729
+ ];
730
+ },
731
+ {
732
+ name: "ChangeExecuted";
733
+ fields: [
734
+ {
735
+ name: "locker";
736
+ type: "publicKey";
737
+ index: false;
738
+ },
739
+ {
740
+ name: "changeRequest";
741
+ type: "publicKey";
742
+ index: false;
743
+ },
744
+ {
745
+ name: "executor";
746
+ type: "publicKey";
747
+ index: false;
748
+ },
749
+ {
750
+ name: "changeType";
751
+ type: {
752
+ defined: "ChangeType";
753
+ };
754
+ index: false;
755
+ },
756
+ {
757
+ name: "executedAt";
758
+ type: "i64";
759
+ index: false;
760
+ }
761
+ ];
762
+ },
763
+ {
764
+ name: "LockerAuthorityChanged";
765
+ fields: [
766
+ {
767
+ name: "locker";
768
+ type: "publicKey";
769
+ index: false;
770
+ },
771
+ {
772
+ name: "oldAuthority";
773
+ type: "publicKey";
774
+ index: false;
775
+ },
776
+ {
777
+ name: "newAuthority";
778
+ type: "publicKey";
779
+ index: false;
780
+ },
781
+ {
782
+ name: "changedAt";
783
+ type: "i64";
784
+ index: false;
785
+ }
786
+ ];
620
787
  }
621
788
  ];
622
789
  errors: [
@@ -627,38 +794,48 @@ export type PriceBasedUnlock = {
627
794
  },
628
795
  {
629
796
  code: 6001;
797
+ name: "UnlockTimestampInThePast";
798
+ msg: "Unlock timestamp must be in the future";
799
+ },
800
+ {
801
+ code: 6002;
630
802
  name: "InvalidLockerState";
631
803
  msg: "Locker is not in the expected state";
632
804
  },
633
805
  {
634
- code: 6002;
806
+ code: 6003;
635
807
  name: "TwapCalculationFailed";
636
808
  msg: "TWAP calculation failed";
637
809
  },
638
810
  {
639
- code: 6003;
811
+ code: 6004;
640
812
  name: "PriceThresholdNotMet";
641
813
  msg: "Price threshold not met";
642
814
  },
643
815
  {
644
- code: 6004;
816
+ code: 6005;
645
817
  name: "InvalidOracleData";
646
818
  msg: "Invalid oracle account data";
647
819
  },
648
820
  {
649
- code: 6005;
821
+ code: 6006;
650
822
  name: "UnauthorizedChangeRequest";
651
823
  msg: "Unauthorized to create or execute change request";
652
824
  },
653
825
  {
654
- code: 6006;
826
+ code: 6007;
655
827
  name: "InvalidChangeRequest";
656
828
  msg: "Change request does not match locker";
657
829
  },
658
830
  {
659
- code: 6007;
831
+ code: 6008;
660
832
  name: "UnauthorizedLockerAuthority";
661
833
  msg: "Unauthorized locker authority";
834
+ },
835
+ {
836
+ code: 6009;
837
+ name: "InvariantViolated";
838
+ msg: "An invariant was violated. You should get in contact with the MetaDAO team if you see this";
662
839
  }
663
840
  ];
664
841
  };
@@ -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
  {
@@ -213,6 +258,32 @@ export const IDL = {
213
258
  ],
214
259
  args: [],
215
260
  },
261
+ {
262
+ name: "changeLockerAuthority",
263
+ accounts: [
264
+ {
265
+ name: "locker",
266
+ isMut: true,
267
+ isSigner: false,
268
+ },
269
+ {
270
+ name: "currentAuthority",
271
+ isMut: false,
272
+ isSigner: true,
273
+ docs: [
274
+ "Only the current locker authority can change the locker authority",
275
+ ],
276
+ },
277
+ ],
278
+ args: [
279
+ {
280
+ name: "params",
281
+ type: {
282
+ defined: "ChangeLockerAuthorityParams",
283
+ },
284
+ },
285
+ ],
286
+ },
216
287
  ],
217
288
  accounts: [
218
289
  {
@@ -279,6 +350,11 @@ export const IDL = {
279
350
  docs: ["The authorized locker authority that can execute changes"],
280
351
  type: "publicKey",
281
352
  },
353
+ {
354
+ name: "tokenMint",
355
+ docs: ["The mint of the locked tokens"],
356
+ type: "publicKey",
357
+ },
282
358
  ],
283
359
  },
284
360
  },
@@ -319,9 +395,9 @@ export const IDL = {
319
395
  type: "publicKey",
320
396
  },
321
397
  {
322
- name: "createKey",
323
- docs: ["Used to derive the PDA"],
324
- type: "publicKey",
398
+ name: "pdaNonce",
399
+ docs: ["Used to derive the PDA along with the proposer"],
400
+ type: "u32",
325
401
  },
326
402
  {
327
403
  name: "pdaBump",
@@ -333,6 +409,18 @@ export const IDL = {
333
409
  },
334
410
  ],
335
411
  types: [
412
+ {
413
+ name: "ChangeLockerAuthorityParams",
414
+ type: {
415
+ kind: "struct",
416
+ fields: [
417
+ {
418
+ name: "newLockerAuthority",
419
+ type: "publicKey",
420
+ },
421
+ ],
422
+ },
423
+ },
336
424
  {
337
425
  name: "InitializeLockerParams",
338
426
  type: {
@@ -383,8 +471,8 @@ export const IDL = {
383
471
  },
384
472
  },
385
473
  {
386
- name: "createKey",
387
- type: "publicKey",
474
+ name: "pdaNonce",
475
+ type: "u32",
388
476
  },
389
477
  ],
390
478
  },
@@ -448,16 +536,6 @@ export const IDL = {
448
536
  {
449
537
  name: "Unlocked",
450
538
  },
451
- {
452
- name: "PendingChange",
453
- fields: [
454
- {
455
- name: "changeRequest",
456
- docs: ["The change request PDA address"],
457
- type: "publicKey",
458
- },
459
- ],
460
- },
461
539
  ],
462
540
  },
463
541
  },
@@ -618,6 +696,95 @@ export const IDL = {
618
696
  },
619
697
  ],
620
698
  },
699
+ {
700
+ name: "ChangeProposed",
701
+ fields: [
702
+ {
703
+ name: "locker",
704
+ type: "publicKey",
705
+ index: false,
706
+ },
707
+ {
708
+ name: "changeRequest",
709
+ type: "publicKey",
710
+ index: false,
711
+ },
712
+ {
713
+ name: "proposer",
714
+ type: "publicKey",
715
+ index: false,
716
+ },
717
+ {
718
+ name: "changeType",
719
+ type: {
720
+ defined: "ChangeType",
721
+ },
722
+ index: false,
723
+ },
724
+ {
725
+ name: "proposedAt",
726
+ type: "i64",
727
+ index: false,
728
+ },
729
+ ],
730
+ },
731
+ {
732
+ name: "ChangeExecuted",
733
+ fields: [
734
+ {
735
+ name: "locker",
736
+ type: "publicKey",
737
+ index: false,
738
+ },
739
+ {
740
+ name: "changeRequest",
741
+ type: "publicKey",
742
+ index: false,
743
+ },
744
+ {
745
+ name: "executor",
746
+ type: "publicKey",
747
+ index: false,
748
+ },
749
+ {
750
+ name: "changeType",
751
+ type: {
752
+ defined: "ChangeType",
753
+ },
754
+ index: false,
755
+ },
756
+ {
757
+ name: "executedAt",
758
+ type: "i64",
759
+ index: false,
760
+ },
761
+ ],
762
+ },
763
+ {
764
+ name: "LockerAuthorityChanged",
765
+ fields: [
766
+ {
767
+ name: "locker",
768
+ type: "publicKey",
769
+ index: false,
770
+ },
771
+ {
772
+ name: "oldAuthority",
773
+ type: "publicKey",
774
+ index: false,
775
+ },
776
+ {
777
+ name: "newAuthority",
778
+ type: "publicKey",
779
+ index: false,
780
+ },
781
+ {
782
+ name: "changedAt",
783
+ type: "i64",
784
+ index: false,
785
+ },
786
+ ],
787
+ },
621
788
  ],
622
789
  errors: [
623
790
  {
@@ -627,39 +794,49 @@ export const IDL = {
627
794
  },
628
795
  {
629
796
  code: 6001,
797
+ name: "UnlockTimestampInThePast",
798
+ msg: "Unlock timestamp must be in the future",
799
+ },
800
+ {
801
+ code: 6002,
630
802
  name: "InvalidLockerState",
631
803
  msg: "Locker is not in the expected state",
632
804
  },
633
805
  {
634
- code: 6002,
806
+ code: 6003,
635
807
  name: "TwapCalculationFailed",
636
808
  msg: "TWAP calculation failed",
637
809
  },
638
810
  {
639
- code: 6003,
811
+ code: 6004,
640
812
  name: "PriceThresholdNotMet",
641
813
  msg: "Price threshold not met",
642
814
  },
643
815
  {
644
- code: 6004,
816
+ code: 6005,
645
817
  name: "InvalidOracleData",
646
818
  msg: "Invalid oracle account data",
647
819
  },
648
820
  {
649
- code: 6005,
821
+ code: 6006,
650
822
  name: "UnauthorizedChangeRequest",
651
823
  msg: "Unauthorized to create or execute change request",
652
824
  },
653
825
  {
654
- code: 6006,
826
+ code: 6007,
655
827
  name: "InvalidChangeRequest",
656
828
  msg: "Change request does not match locker",
657
829
  },
658
830
  {
659
- code: 6007,
831
+ code: 6008,
660
832
  name: "UnauthorizedLockerAuthority",
661
833
  msg: "Unauthorized locker authority",
662
834
  },
835
+ {
836
+ code: 6009,
837
+ name: "InvariantViolated",
838
+ msg: "An invariant was violated. You should get in contact with the MetaDAO team if you see this",
839
+ },
663
840
  ],
664
841
  };
665
842
  //# sourceMappingURL=price_based_unlock.js.map