@pythnetwork/pyth-solana-receiver 0.11.0 → 0.13.0

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.
@@ -1,5 +1,5 @@
1
1
  export type PythSolanaReceiver = {
2
- version: "0.2.0";
2
+ version: "0.2.1";
3
3
  name: "pyth_solana_receiver";
4
4
  instructions: [
5
5
  {
@@ -51,6 +51,22 @@ export type PythSolanaReceiver = {
51
51
  }
52
52
  ];
53
53
  },
54
+ {
55
+ name: "cancelGovernanceAuthorityTransfer";
56
+ accounts: [
57
+ {
58
+ name: "payer";
59
+ isMut: false;
60
+ isSigner: true;
61
+ },
62
+ {
63
+ name: "config";
64
+ isMut: true;
65
+ isSigner: false;
66
+ }
67
+ ];
68
+ args: [];
69
+ },
54
70
  {
55
71
  name: "acceptGovernanceAuthorityTransfer";
56
72
  accounts: [
@@ -160,8 +176,14 @@ export type PythSolanaReceiver = {
160
176
  docs: [
161
177
  "Post a price update using a VAA and a MerklePriceUpdate.",
162
178
  "This function allows you to post a price update in a single transaction.",
163
- "Compared to post_update, it is less secure since you won't be able to verify all guardian signatures if you use this function because of transaction size limitations.",
164
- "Typically, you can fit 5 guardian signatures in a transaction that uses this."
179
+ "Compared to `post_update`, it only checks whatever signatures are present in the provided VAA and doesn't fail if the number of signatures is lower than the Wormhole quorum of two thirds of the guardians.",
180
+ "The number of signatures that were in the VAA is stored in the `VerificationLevel` of the `PriceUpdateV2` account.",
181
+ "",
182
+ "We recommend using `post_update_atomic` with 5 signatures. This is close to the maximum signatures you can verify in one transaction without exceeding the transaction size limit.",
183
+ "",
184
+ "# Warning",
185
+ "",
186
+ "Using partially verified price updates is dangerous, as it lowers the threshold of guardians that need to collude to produce a malicious price update."
165
187
  ];
166
188
  accounts: [
167
189
  {
@@ -192,7 +214,7 @@ export type PythSolanaReceiver = {
192
214
  isMut: true;
193
215
  isSigner: true;
194
216
  docs: [
195
- "The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.",
217
+ "The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
196
218
  "Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
197
219
  ];
198
220
  },
@@ -249,7 +271,7 @@ export type PythSolanaReceiver = {
249
271
  isMut: true;
250
272
  isSigner: true;
251
273
  docs: [
252
- "The contraint is such that either the price_update_account is uninitialized or the payer is the write_authority.",
274
+ "The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
253
275
  "Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
254
276
  ];
255
277
  },
@@ -311,8 +333,8 @@ export type PythSolanaReceiver = {
311
333
  isMut: true;
312
334
  isSigner: true;
313
335
  docs: [
314
- "The contraint is such that either the twap_update_account is uninitialized or the write_authority is the write_authority.",
315
- "Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that twap_update_account.write_authority == Pubkey::default() once the account is initialized"
336
+ "The constraint is such that either the price_update_account is uninitialized or the write_authority is the write_authority.",
337
+ "Pubkey::default() is the SystemProgram on Solana and it can't sign so it's impossible that price_update_account.write_authority == Pubkey::default() once the account is initialized"
316
338
  ];
317
339
  },
318
340
  {
@@ -700,85 +722,119 @@ export type PythSolanaReceiver = {
700
722
  },
701
723
  {
702
724
  code: 6006;
725
+ name: "FeedIdMismatch";
726
+ msg: "Cannot calculate TWAP, end slot must be greater than start slot";
727
+ },
728
+ {
729
+ code: 6007;
730
+ name: "ExponentMismatch";
731
+ msg: "The start and end messages must have the same feed ID";
732
+ },
733
+ {
734
+ code: 6008;
735
+ name: "InvalidTwapSlots";
736
+ msg: "The start and end messages must have the same exponent";
737
+ },
738
+ {
739
+ code: 6009;
740
+ name: "InvalidTwapStartMessage";
741
+ msg: "Start message is not the first update for its timestamp";
742
+ },
743
+ {
744
+ code: 6010;
745
+ name: "InvalidTwapEndMessage";
746
+ msg: "End message is not the first update for its timestamp";
747
+ },
748
+ {
749
+ code: 6011;
750
+ name: "TwapCalculationOverflow";
751
+ msg: "Overflow in TWAP calculation";
752
+ },
753
+ {
754
+ code: 6012;
703
755
  name: "WrongWriteAuthority";
704
756
  msg: "This signer can't write to price update account";
705
757
  },
706
758
  {
707
- code: 6007;
759
+ code: 6013;
708
760
  name: "WrongVaaOwner";
709
761
  msg: "The posted VAA account has the wrong owner.";
710
762
  },
711
763
  {
712
- code: 6008;
764
+ code: 6014;
713
765
  name: "DeserializeVaaFailed";
714
766
  msg: "An error occurred when deserializing the VAA.";
715
767
  },
716
768
  {
717
- code: 6009;
769
+ code: 6015;
718
770
  name: "InsufficientGuardianSignatures";
719
771
  msg: "The number of guardian signatures is below the minimum";
720
772
  },
721
773
  {
722
- code: 6010;
774
+ code: 6016;
723
775
  name: "InvalidVaaVersion";
724
776
  msg: "Invalid VAA version";
725
777
  },
726
778
  {
727
- code: 6011;
779
+ code: 6017;
728
780
  name: "GuardianSetMismatch";
729
781
  msg: "Guardian set version in the VAA doesn't match the guardian set passed";
730
782
  },
731
783
  {
732
- code: 6012;
784
+ code: 6018;
733
785
  name: "InvalidGuardianOrder";
734
786
  msg: "Guardian signature indices must be increasing";
735
787
  },
736
788
  {
737
- code: 6013;
789
+ code: 6019;
738
790
  name: "InvalidGuardianIndex";
739
791
  msg: "Guardian index exceeds the number of guardians in the set";
740
792
  },
741
793
  {
742
- code: 6014;
794
+ code: 6020;
743
795
  name: "InvalidSignature";
744
796
  msg: "A VAA signature is invalid";
745
797
  },
746
798
  {
747
- code: 6015;
799
+ code: 6021;
748
800
  name: "InvalidGuardianKeyRecovery";
749
801
  msg: "The recovered guardian public key doesn't match the guardian set";
750
802
  },
751
803
  {
752
- code: 6016;
804
+ code: 6022;
753
805
  name: "WrongGuardianSetOwner";
754
806
  msg: "The guardian set account is owned by the wrong program";
755
807
  },
756
808
  {
757
- code: 6017;
809
+ code: 6023;
758
810
  name: "InvalidGuardianSetPda";
759
811
  msg: "The Guardian Set account doesn't match the PDA derivation";
760
812
  },
761
813
  {
762
- code: 6018;
814
+ code: 6024;
763
815
  name: "GuardianSetExpired";
764
816
  msg: "The Guardian Set is expired";
765
817
  },
766
818
  {
767
- code: 6019;
819
+ code: 6025;
768
820
  name: "GovernanceAuthorityMismatch";
769
821
  msg: "The signer is not authorized to perform this governance action";
770
822
  },
771
823
  {
772
- code: 6020;
824
+ code: 6026;
773
825
  name: "TargetGovernanceAuthorityMismatch";
774
826
  msg: "The signer is not authorized to accept the governance authority";
775
827
  },
776
828
  {
777
- code: 6021;
829
+ code: 6027;
778
830
  name: "NonexistentGovernanceAuthorityTransferRequest";
779
831
  msg: "The governance authority needs to request a transfer first";
832
+ },
833
+ {
834
+ code: 6028;
835
+ name: "ZeroMinimumSignatures";
836
+ msg: "The minimum number of signatures should be at least 1";
780
837
  }
781
838
  ];
782
839
  };
783
840
  export declare const IDL: PythSolanaReceiver;
784
- //# sourceMappingURL=pyth_solana_receiver.d.ts.map