@sats-connect/core 0.4.2-e55c4de → 0.4.3-c589f47

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.
package/dist/index.js CHANGED
@@ -181,10 +181,6 @@ __export(src_exports, {
181
181
  stxSignTransactionParamsSchema: () => stxSignTransactionParamsSchema,
182
182
  stxSignTransactionRequestMessageSchema: () => stxSignTransactionRequestMessageSchema,
183
183
  stxSignTransactionResultSchema: () => stxSignTransactionResultSchema,
184
- stxSignTransactionsMethodName: () => stxSignTransactionsMethodName,
185
- stxSignTransactionsParamsSchema: () => stxSignTransactionsParamsSchema,
186
- stxSignTransactionsRequestMessageSchema: () => stxSignTransactionsRequestMessageSchema,
187
- stxSignTransactionsResultSchema: () => stxSignTransactionsResultSchema,
188
184
  stxTransferStxMethodName: () => stxTransferStxMethodName,
189
185
  stxTransferStxParamsSchema: () => stxTransferStxParamsSchema,
190
186
  stxTransferStxRequestMessageSchema: () => stxTransferStxRequestMessageSchema,
@@ -262,6 +258,7 @@ var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
262
258
  BitcoinNetworkType2["Mainnet"] = "Mainnet";
263
259
  BitcoinNetworkType2["Testnet"] = "Testnet";
264
260
  BitcoinNetworkType2["Signet"] = "Signet";
261
+ BitcoinNetworkType2["Regtest"] = "Regtest";
265
262
  return BitcoinNetworkType2;
266
263
  })(BitcoinNetworkType || {});
267
264
  var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
@@ -308,7 +305,7 @@ var rpcResponseMessageSchema = v2.union([
308
305
  ]);
309
306
 
310
307
  // src/request/index.ts
311
- var v21 = __toESM(require("valibot"));
308
+ var v20 = __toESM(require("valibot"));
312
309
 
313
310
  // src/request/types/stxMethods/callContract.ts
314
311
  var v3 = __toESM(require("valibot"));
@@ -603,50 +600,10 @@ var stxSignTransactionRequestMessageSchema = v10.object({
603
600
  }).entries
604
601
  });
605
602
 
606
- // src/request/types/stxMethods/signTransactions.ts
607
- var v11 = __toESM(require("valibot"));
608
- var stxSignTransactionsMethodName = "stx_signTransactions";
609
- var stxSignTransactionsParamsSchema = v11.object({
610
- /**
611
- * The transactions to sign as hex-encoded strings.
612
- */
613
- transactions: v11.pipe(
614
- v11.array(
615
- v11.pipe(
616
- v11.string(),
617
- v11.check((hex) => {
618
- return true;
619
- }, "Invalid hex-encoded Stacks transaction.")
620
- )
621
- ),
622
- v11.minLength(1)
623
- ),
624
- /**
625
- * Whether the signed transactions should be broadcast after signing. Defaults
626
- * to `true`.
627
- */
628
- broadcast: v11.optional(v11.boolean())
629
- });
630
- var stxSignTransactionsResultSchema = v11.object({
631
- /**
632
- * The signed transactions as hex-encoded strings, in the same order as in the
633
- * sign request.
634
- */
635
- transactions: v11.array(v11.string())
636
- });
637
- var stxSignTransactionsRequestMessageSchema = v11.object({
638
- ...rpcRequestMessageSchema.entries,
639
- ...v11.object({
640
- method: v11.literal(stxSignTransactionsMethodName),
641
- params: stxSignTransactionsParamsSchema,
642
- id: v11.string()
643
- }).entries
644
- });
645
-
646
603
  // src/request/types/stxMethods/transferStx.ts
647
- var v12 = __toESM(require("valibot"));
604
+ var v11 = __toESM(require("valibot"));
648
605
  var stxTransferStxMethodName = "stx_transferStx";
649
- var stxTransferStxParamsSchema = v12.object({
606
+ var stxTransferStxParamsSchema = v11.object({
650
607
  /**
651
608
  * Amount of STX tokens to transfer in microstacks as a string. Anything
652
609
  * parseable by `BigInt` is acceptable.
@@ -659,23 +616,23 @@ var stxTransferStxParamsSchema = v12.object({
659
616
  * const amount3 = '1234';
660
617
  * ```
661
618
  */
662
- amount: v12.union([v12.number(), v12.string()]),
619
+ amount: v11.union([v11.number(), v11.string()]),
663
620
  /**
664
621
  * The recipeint's principal.
665
622
  */
666
- recipient: v12.string(),
623
+ recipient: v11.string(),
667
624
  /**
668
625
  * A string representing the memo.
669
626
  */
670
- memo: v12.optional(v12.string()),
627
+ memo: v11.optional(v11.string()),
671
628
  /**
672
629
  * Version of parameter format.
673
630
  */
674
- version: v12.optional(v12.string()),
631
+ version: v11.optional(v11.string()),
675
632
  /**
676
633
  * The mode of the post conditions.
677
634
  */
678
- postConditionMode: v12.optional(v12.number()),
635
+ postConditionMode: v11.optional(v11.number()),
679
636
  /**
680
637
  * A hex-encoded string representing the post conditions.
681
638
  *
@@ -688,89 +645,89 @@ var stxTransferStxParamsSchema = v12.object({
688
645
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
689
646
  * ```
690
647
  */
691
- postConditions: v12.optional(v12.array(v12.string())),
648
+ postConditions: v11.optional(v11.array(v11.string())),
692
649
  /**
693
650
  * The public key to sign the transaction with. The wallet may use any key
694
651
  * when not provided.
695
652
  */
696
- pubkey: v12.optional(v12.string())
653
+ pubkey: v11.optional(v11.string())
697
654
  });
698
- var stxTransferStxResultSchema = v12.object({
655
+ var stxTransferStxResultSchema = v11.object({
699
656
  /**
700
657
  * The ID of the transaction.
701
658
  */
702
- txid: v12.string(),
659
+ txid: v11.string(),
703
660
  /**
704
661
  * A Stacks transaction as a hex-encoded string.
705
662
  */
706
- transaction: v12.string()
663
+ transaction: v11.string()
707
664
  });
708
- var stxTransferStxRequestMessageSchema = v12.object({
665
+ var stxTransferStxRequestMessageSchema = v11.object({
709
666
  ...rpcRequestMessageSchema.entries,
710
- ...v12.object({
711
- method: v12.literal(stxTransferStxMethodName),
667
+ ...v11.object({
668
+ method: v11.literal(stxTransferStxMethodName),
712
669
  params: stxTransferStxParamsSchema,
713
- id: v12.string()
670
+ id: v11.string()
714
671
  }).entries
715
672
  });
716
673
 
717
674
  // src/request/types/btcMethods.ts
718
- var v14 = __toESM(require("valibot"));
675
+ var v13 = __toESM(require("valibot"));
719
676
 
720
677
  // src/request/types/common.ts
721
- var v13 = __toESM(require("valibot"));
678
+ var v12 = __toESM(require("valibot"));
722
679
  var walletTypes = ["software", "ledger"];
723
- var walletTypeSchema = v13.picklist(walletTypes);
680
+ var walletTypeSchema = v12.picklist(walletTypes);
724
681
 
725
682
  // src/request/types/btcMethods.ts
726
683
  var getInfoMethodName = "getInfo";
727
- var getInfoParamsSchema = v14.nullish(v14.null());
728
- var getInfoResultSchema = v14.object({
684
+ var getInfoParamsSchema = v13.nullish(v13.null());
685
+ var getInfoResultSchema = v13.object({
729
686
  /**
730
687
  * Version of the wallet.
731
688
  */
732
- version: v14.string(),
689
+ version: v13.string(),
733
690
  /**
734
691
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
735
692
  */
736
- methods: v14.optional(v14.array(v14.string())),
693
+ methods: v13.optional(v13.array(v13.string())),
737
694
  /**
738
695
  * List of WBIP standards supported by the wallet. Not currently used.
739
696
  */
740
- supports: v14.array(v14.string())
697
+ supports: v13.array(v13.string())
741
698
  });
742
- var getInfoRequestMessageSchema = v14.object({
699
+ var getInfoRequestMessageSchema = v13.object({
743
700
  ...rpcRequestMessageSchema.entries,
744
- ...v14.object({
745
- method: v14.literal(getInfoMethodName),
701
+ ...v13.object({
702
+ method: v13.literal(getInfoMethodName),
746
703
  params: getInfoParamsSchema,
747
- id: v14.string()
704
+ id: v13.string()
748
705
  }).entries
749
706
  });
750
707
  var getAddressesMethodName = "getAddresses";
751
- var getAddressesParamsSchema = v14.object({
708
+ var getAddressesParamsSchema = v13.object({
752
709
  /**
753
710
  * The purposes for which to generate addresses. See
754
711
  * {@linkcode AddressPurpose} for available purposes.
755
712
  */
756
- purposes: v14.array(v14.enum(AddressPurpose)),
713
+ purposes: v13.array(v13.enum(AddressPurpose)),
757
714
  /**
758
715
  * A message to be displayed to the user in the request prompt.
759
716
  */
760
- message: v14.optional(v14.string())
717
+ message: v13.optional(v13.string())
761
718
  });
762
- var getAddressesResultSchema = v14.object({
719
+ var getAddressesResultSchema = v13.object({
763
720
  /**
764
721
  * The addresses generated for the given purposes.
765
722
  */
766
- addresses: v14.array(addressSchema)
723
+ addresses: v13.array(addressSchema)
767
724
  });
768
- var getAddressesRequestMessageSchema = v14.object({
725
+ var getAddressesRequestMessageSchema = v13.object({
769
726
  ...rpcRequestMessageSchema.entries,
770
- ...v14.object({
771
- method: v14.literal(getAddressesMethodName),
727
+ ...v13.object({
728
+ method: v13.literal(getAddressesMethodName),
772
729
  params: getAddressesParamsSchema,
773
- id: v14.string()
730
+ id: v13.string()
774
731
  }).entries
775
732
  });
776
733
  var signMessageMethodName = "signMessage";
@@ -779,456 +736,456 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
779
736
  MessageSigningProtocols2["BIP322"] = "BIP322";
780
737
  return MessageSigningProtocols2;
781
738
  })(MessageSigningProtocols || {});
782
- var signMessageParamsSchema = v14.object({
739
+ var signMessageParamsSchema = v13.object({
783
740
  /**
784
741
  * The address used for signing.
785
742
  **/
786
- address: v14.string(),
743
+ address: v13.string(),
787
744
  /**
788
745
  * The message to sign.
789
746
  **/
790
- message: v14.string(),
747
+ message: v13.string(),
791
748
  /**
792
749
  * The protocol to use for signing the message.
793
750
  */
794
- protocol: v14.optional(v14.enum(MessageSigningProtocols))
751
+ protocol: v13.optional(v13.enum(MessageSigningProtocols))
795
752
  });
796
- var signMessageResultSchema = v14.object({
753
+ var signMessageResultSchema = v13.object({
797
754
  /**
798
755
  * The signature of the message.
799
756
  */
800
- signature: v14.string(),
757
+ signature: v13.string(),
801
758
  /**
802
759
  * hash of the message.
803
760
  */
804
- messageHash: v14.string(),
761
+ messageHash: v13.string(),
805
762
  /**
806
763
  * The address used for signing.
807
764
  */
808
- address: v14.string(),
765
+ address: v13.string(),
809
766
  /**
810
767
  * The protocol to use for signing the message.
811
768
  */
812
- protocol: v14.enum(MessageSigningProtocols)
769
+ protocol: v13.enum(MessageSigningProtocols)
813
770
  });
814
- var signMessageRequestMessageSchema = v14.object({
771
+ var signMessageRequestMessageSchema = v13.object({
815
772
  ...rpcRequestMessageSchema.entries,
816
- ...v14.object({
817
- method: v14.literal(signMessageMethodName),
773
+ ...v13.object({
774
+ method: v13.literal(signMessageMethodName),
818
775
  params: signMessageParamsSchema,
819
- id: v14.string()
776
+ id: v13.string()
820
777
  }).entries
821
778
  });
822
779
  var sendTransferMethodName = "sendTransfer";
823
- var sendTransferParamsSchema = v14.object({
780
+ var sendTransferParamsSchema = v13.object({
824
781
  /**
825
782
  * Array of recipients to send to.
826
783
  * The amount to send to each recipient is in satoshis.
827
784
  */
828
- recipients: v14.array(
829
- v14.object({
830
- address: v14.string(),
831
- amount: v14.number()
785
+ recipients: v13.array(
786
+ v13.object({
787
+ address: v13.string(),
788
+ amount: v13.number()
832
789
  })
833
790
  )
834
791
  });
835
- var sendTransferResultSchema = v14.object({
792
+ var sendTransferResultSchema = v13.object({
836
793
  /**
837
794
  * The transaction id as a hex-encoded string.
838
795
  */
839
- txid: v14.string()
796
+ txid: v13.string()
840
797
  });
841
- var sendTransferRequestMessageSchema = v14.object({
798
+ var sendTransferRequestMessageSchema = v13.object({
842
799
  ...rpcRequestMessageSchema.entries,
843
- ...v14.object({
844
- method: v14.literal(sendTransferMethodName),
800
+ ...v13.object({
801
+ method: v13.literal(sendTransferMethodName),
845
802
  params: sendTransferParamsSchema,
846
- id: v14.string()
803
+ id: v13.string()
847
804
  }).entries
848
805
  });
849
806
  var signPsbtMethodName = "signPsbt";
850
- var signPsbtParamsSchema = v14.object({
807
+ var signPsbtParamsSchema = v13.object({
851
808
  /**
852
809
  * The base64 encoded PSBT to sign.
853
810
  */
854
- psbt: v14.string(),
811
+ psbt: v13.string(),
855
812
  /**
856
813
  * The inputs to sign.
857
814
  * The key is the address and the value is an array of indexes of the inputs to sign.
858
815
  */
859
- signInputs: v14.record(v14.string(), v14.array(v14.number())),
816
+ signInputs: v13.record(v13.string(), v13.array(v13.number())),
860
817
  /**
861
818
  * Whether to broadcast the transaction after signing.
862
819
  **/
863
- broadcast: v14.optional(v14.boolean())
820
+ broadcast: v13.optional(v13.boolean())
864
821
  });
865
- var signPsbtResultSchema = v14.object({
822
+ var signPsbtResultSchema = v13.object({
866
823
  /**
867
824
  * The base64 encoded PSBT after signing.
868
825
  */
869
- psbt: v14.string(),
826
+ psbt: v13.string(),
870
827
  /**
871
828
  * The transaction id as a hex-encoded string.
872
829
  * This is only returned if the transaction was broadcast.
873
830
  **/
874
- txid: v14.optional(v14.string())
831
+ txid: v13.optional(v13.string())
875
832
  });
876
- var signPsbtRequestMessageSchema = v14.object({
833
+ var signPsbtRequestMessageSchema = v13.object({
877
834
  ...rpcRequestMessageSchema.entries,
878
- ...v14.object({
879
- method: v14.literal(signPsbtMethodName),
835
+ ...v13.object({
836
+ method: v13.literal(signPsbtMethodName),
880
837
  params: signPsbtParamsSchema,
881
- id: v14.string()
838
+ id: v13.string()
882
839
  }).entries
883
840
  });
884
841
  var getAccountsMethodName = "getAccounts";
885
- var getAccountsParamsSchema = v14.object({
842
+ var getAccountsParamsSchema = v13.object({
886
843
  /**
887
844
  * The purposes for which to generate addresses. See
888
845
  * {@linkcode AddressPurpose} for available purposes.
889
846
  */
890
- purposes: v14.array(v14.enum(AddressPurpose)),
847
+ purposes: v13.array(v13.enum(AddressPurpose)),
891
848
  /**
892
849
  * A message to be displayed to the user in the request prompt.
893
850
  */
894
- message: v14.optional(v14.string())
851
+ message: v13.optional(v13.string())
895
852
  });
896
- var getAccountsResultSchema = v14.array(
897
- v14.object({
853
+ var getAccountsResultSchema = v13.array(
854
+ v13.object({
898
855
  ...addressSchema.entries,
899
- ...v14.object({
856
+ ...v13.object({
900
857
  walletType: walletTypeSchema
901
858
  }).entries
902
859
  })
903
860
  );
904
- var getAccountsRequestMessageSchema = v14.object({
861
+ var getAccountsRequestMessageSchema = v13.object({
905
862
  ...rpcRequestMessageSchema.entries,
906
- ...v14.object({
907
- method: v14.literal(getAccountsMethodName),
863
+ ...v13.object({
864
+ method: v13.literal(getAccountsMethodName),
908
865
  params: getAccountsParamsSchema,
909
- id: v14.string()
866
+ id: v13.string()
910
867
  }).entries
911
868
  });
912
869
  var getBalanceMethodName = "getBalance";
913
- var getBalanceParamsSchema = v14.nullish(v14.null());
914
- var getBalanceResultSchema = v14.object({
870
+ var getBalanceParamsSchema = v13.nullish(v13.null());
871
+ var getBalanceResultSchema = v13.object({
915
872
  /**
916
873
  * The confirmed balance of the wallet in sats. Using a string due to chrome
917
874
  * messages not supporting bigint
918
875
  * (https://issues.chromium.org/issues/40116184).
919
876
  */
920
- confirmed: v14.string(),
877
+ confirmed: v13.string(),
921
878
  /**
922
879
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
923
880
  * messages not supporting bigint
924
881
  * (https://issues.chromium.org/issues/40116184).
925
882
  */
926
- unconfirmed: v14.string(),
883
+ unconfirmed: v13.string(),
927
884
  /**
928
885
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
929
886
  * sats. Using a string due to chrome messages not supporting bigint
930
887
  * (https://issues.chromium.org/issues/40116184).
931
888
  */
932
- total: v14.string()
889
+ total: v13.string()
933
890
  });
934
- var getBalanceRequestMessageSchema = v14.object({
891
+ var getBalanceRequestMessageSchema = v13.object({
935
892
  ...rpcRequestMessageSchema.entries,
936
- ...v14.object({
937
- method: v14.literal(getBalanceMethodName),
938
- id: v14.string()
893
+ ...v13.object({
894
+ method: v13.literal(getBalanceMethodName),
895
+ id: v13.string()
939
896
  }).entries
940
897
  });
941
898
 
942
899
  // src/request/types/walletMethods.ts
943
- var v15 = __toESM(require("valibot"));
944
- var accountActionsSchema = v15.object({
945
- read: v15.optional(v15.boolean())
946
- });
947
- var walletActionsSchema = v15.object({});
948
- var accountPermissionSchema = v15.object({
949
- type: v15.literal("account"),
950
- resourceId: v15.string(),
951
- clientId: v15.string(),
900
+ var v14 = __toESM(require("valibot"));
901
+ var accountActionsSchema = v14.object({
902
+ read: v14.optional(v14.boolean())
903
+ });
904
+ var walletActionsSchema = v14.object({});
905
+ var accountPermissionSchema = v14.object({
906
+ type: v14.literal("account"),
907
+ resourceId: v14.string(),
908
+ clientId: v14.string(),
952
909
  actions: accountActionsSchema
953
910
  });
954
- var walletPermissionSchema = v15.object({
955
- type: v15.literal("wallet"),
956
- resourceId: v15.string(),
957
- clientId: v15.string(),
911
+ var walletPermissionSchema = v14.object({
912
+ type: v14.literal("wallet"),
913
+ resourceId: v14.string(),
914
+ clientId: v14.string(),
958
915
  actions: walletActionsSchema
959
916
  });
960
- var PermissionRequestParams = v15.variant("type", [
961
- v15.object({
962
- ...v15.omit(accountPermissionSchema, ["clientId"]).entries
917
+ var PermissionRequestParams = v14.variant("type", [
918
+ v14.object({
919
+ ...v14.omit(accountPermissionSchema, ["clientId"]).entries
963
920
  }),
964
- v15.object({
965
- ...v15.omit(walletPermissionSchema, ["clientId"]).entries
921
+ v14.object({
922
+ ...v14.omit(walletPermissionSchema, ["clientId"]).entries
966
923
  })
967
924
  ]);
968
- var permission = v15.variant("type", [accountPermissionSchema, walletPermissionSchema]);
925
+ var permission = v14.variant("type", [accountPermissionSchema, walletPermissionSchema]);
969
926
  var requestPermissionsMethodName = "wallet_requestPermissions";
970
- var requestPermissionsParamsSchema = v15.nullish(v15.array(PermissionRequestParams));
971
- var requestPermissionsResultSchema = v15.literal(true);
972
- var requestPermissionsRequestMessageSchema = v15.object({
927
+ var requestPermissionsParamsSchema = v14.nullish(v14.array(PermissionRequestParams));
928
+ var requestPermissionsResultSchema = v14.literal(true);
929
+ var requestPermissionsRequestMessageSchema = v14.object({
973
930
  ...rpcRequestMessageSchema.entries,
974
- ...v15.object({
975
- method: v15.literal(requestPermissionsMethodName),
931
+ ...v14.object({
932
+ method: v14.literal(requestPermissionsMethodName),
976
933
  params: requestPermissionsParamsSchema,
977
- id: v15.string()
934
+ id: v14.string()
978
935
  }).entries
979
936
  });
980
937
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
981
- var renouncePermissionsParamsSchema = v15.nullish(v15.null());
982
- var renouncePermissionsResultSchema = v15.nullish(v15.null());
983
- var renouncePermissionsRequestMessageSchema = v15.object({
938
+ var renouncePermissionsParamsSchema = v14.nullish(v14.null());
939
+ var renouncePermissionsResultSchema = v14.nullish(v14.null());
940
+ var renouncePermissionsRequestMessageSchema = v14.object({
984
941
  ...rpcRequestMessageSchema.entries,
985
- ...v15.object({
986
- method: v15.literal(renouncePermissionsMethodName),
942
+ ...v14.object({
943
+ method: v14.literal(renouncePermissionsMethodName),
987
944
  params: renouncePermissionsParamsSchema,
988
- id: v15.string()
945
+ id: v14.string()
989
946
  }).entries
990
947
  });
991
948
  var disconnectMethodName = "wallet_disconnect";
992
- var disconnectParamsSchema = v15.nullish(v15.null());
993
- var disconnectResultSchema = v15.nullish(v15.null());
994
- var disconnectRequestMessageSchema = v15.object({
949
+ var disconnectParamsSchema = v14.nullish(v14.null());
950
+ var disconnectResultSchema = v14.nullish(v14.null());
951
+ var disconnectRequestMessageSchema = v14.object({
995
952
  ...rpcRequestMessageSchema.entries,
996
- ...v15.object({
997
- method: v15.literal(disconnectMethodName),
953
+ ...v14.object({
954
+ method: v14.literal(disconnectMethodName),
998
955
  params: disconnectParamsSchema,
999
- id: v15.string()
956
+ id: v14.string()
1000
957
  }).entries
1001
958
  });
1002
959
  var getWalletTypeMethodName = "wallet_getWalletType";
1003
- var getWalletTypeParamsSchema = v15.nullish(v15.null());
960
+ var getWalletTypeParamsSchema = v14.nullish(v14.null());
1004
961
  var getWalletTypeResultSchema = walletTypeSchema;
1005
- var getWalletTypeRequestMessageSchema = v15.object({
962
+ var getWalletTypeRequestMessageSchema = v14.object({
1006
963
  ...rpcRequestMessageSchema.entries,
1007
- ...v15.object({
1008
- method: v15.literal(getWalletTypeMethodName),
964
+ ...v14.object({
965
+ method: v14.literal(getWalletTypeMethodName),
1009
966
  params: getWalletTypeParamsSchema,
1010
- id: v15.string()
967
+ id: v14.string()
1011
968
  }).entries
1012
969
  });
1013
970
  var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
1014
- var getCurrentPermissionsParamsSchema = v15.nullish(v15.null());
1015
- var getCurrentPermissionsResultSchema = v15.array(permission);
1016
- var getCurrentPermissionsRequestMessageSchema = v15.object({
971
+ var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
972
+ var getCurrentPermissionsResultSchema = v14.array(permission);
973
+ var getCurrentPermissionsRequestMessageSchema = v14.object({
1017
974
  ...rpcRequestMessageSchema.entries,
1018
- ...v15.object({
1019
- method: v15.literal(getCurrentPermissionsMethodName),
975
+ ...v14.object({
976
+ method: v14.literal(getCurrentPermissionsMethodName),
1020
977
  params: getCurrentPermissionsParamsSchema,
1021
- id: v15.string()
978
+ id: v14.string()
1022
979
  }).entries
1023
980
  });
1024
981
  var getAccountMethodName = "wallet_getAccount";
1025
- var getAccountParamsSchema = v15.nullish(v15.null());
1026
- var getAccountResultSchema = v15.object({
1027
- id: v15.string(),
1028
- addresses: v15.array(addressSchema),
982
+ var getAccountParamsSchema = v14.nullish(v14.null());
983
+ var getAccountResultSchema = v14.object({
984
+ id: v14.string(),
985
+ addresses: v14.array(addressSchema),
1029
986
  walletType: walletTypeSchema
1030
987
  });
1031
- var getAccountRequestMessageSchema = v15.object({
988
+ var getAccountRequestMessageSchema = v14.object({
1032
989
  ...rpcRequestMessageSchema.entries,
1033
- ...v15.object({
1034
- method: v15.literal(getAccountMethodName),
990
+ ...v14.object({
991
+ method: v14.literal(getAccountMethodName),
1035
992
  params: getAccountParamsSchema,
1036
- id: v15.string()
993
+ id: v14.string()
1037
994
  }).entries
1038
995
  });
1039
996
  var connectMethodName = "wallet_connect";
1040
- var connectParamsSchema = v15.nullish(
1041
- v15.object({
1042
- permissions: v15.optional(v15.array(PermissionRequestParams)),
1043
- addresses: v15.optional(v15.array(v15.enum(AddressPurpose))),
1044
- message: v15.optional(
1045
- v15.pipe(v15.string(), v15.maxLength(80, "The message must not exceed 80 characters."))
997
+ var connectParamsSchema = v14.nullish(
998
+ v14.object({
999
+ permissions: v14.optional(v14.array(PermissionRequestParams)),
1000
+ addresses: v14.optional(v14.array(v14.enum(AddressPurpose))),
1001
+ message: v14.optional(
1002
+ v14.pipe(v14.string(), v14.maxLength(80, "The message must not exceed 80 characters."))
1046
1003
  )
1047
1004
  })
1048
1005
  );
1049
1006
  var connectResultSchema = getAccountResultSchema;
1050
- var connectRequestMessageSchema = v15.object({
1007
+ var connectRequestMessageSchema = v14.object({
1051
1008
  ...rpcRequestMessageSchema.entries,
1052
- ...v15.object({
1053
- method: v15.literal(connectMethodName),
1009
+ ...v14.object({
1010
+ method: v14.literal(connectMethodName),
1054
1011
  params: connectParamsSchema,
1055
- id: v15.string()
1012
+ id: v14.string()
1056
1013
  }).entries
1057
1014
  });
1058
1015
 
1059
1016
  // src/request/types/runesMethods/etch.ts
1060
- var v16 = __toESM(require("valibot"));
1017
+ var v15 = __toESM(require("valibot"));
1061
1018
  var runesEtchMethodName = "runes_etch";
1062
- var etchTermsSchema = v16.object({
1063
- amount: v16.string(),
1064
- cap: v16.string(),
1065
- heightStart: v16.optional(v16.string()),
1066
- heightEnd: v16.optional(v16.string()),
1067
- offsetStart: v16.optional(v16.string()),
1068
- offsetEnd: v16.optional(v16.string())
1069
- });
1070
- var inscriptionDetailsSchema = v16.object({
1071
- contentType: v16.string(),
1072
- contentBase64: v16.string()
1073
- });
1074
- var runesEtchParamsSchema = v16.object({
1075
- runeName: v16.string(),
1076
- divisibility: v16.optional(v16.number()),
1077
- symbol: v16.optional(v16.string()),
1078
- premine: v16.optional(v16.string()),
1079
- isMintable: v16.boolean(),
1080
- delegateInscriptionId: v16.optional(v16.string()),
1081
- destinationAddress: v16.string(),
1082
- refundAddress: v16.string(),
1083
- feeRate: v16.number(),
1084
- appServiceFee: v16.optional(v16.number()),
1085
- appServiceFeeAddress: v16.optional(v16.string()),
1086
- terms: v16.optional(etchTermsSchema),
1087
- inscriptionDetails: v16.optional(inscriptionDetailsSchema),
1088
- network: v16.optional(v16.enum(BitcoinNetworkType))
1089
- });
1090
- var runesEtchResultSchema = v16.object({
1091
- orderId: v16.string(),
1092
- fundTransactionId: v16.string(),
1093
- fundingAddress: v16.string()
1094
- });
1095
- var runesEtchRequestMessageSchema = v16.object({
1019
+ var etchTermsSchema = v15.object({
1020
+ amount: v15.string(),
1021
+ cap: v15.string(),
1022
+ heightStart: v15.optional(v15.string()),
1023
+ heightEnd: v15.optional(v15.string()),
1024
+ offsetStart: v15.optional(v15.string()),
1025
+ offsetEnd: v15.optional(v15.string())
1026
+ });
1027
+ var inscriptionDetailsSchema = v15.object({
1028
+ contentType: v15.string(),
1029
+ contentBase64: v15.string()
1030
+ });
1031
+ var runesEtchParamsSchema = v15.object({
1032
+ runeName: v15.string(),
1033
+ divisibility: v15.optional(v15.number()),
1034
+ symbol: v15.optional(v15.string()),
1035
+ premine: v15.optional(v15.string()),
1036
+ isMintable: v15.boolean(),
1037
+ delegateInscriptionId: v15.optional(v15.string()),
1038
+ destinationAddress: v15.string(),
1039
+ refundAddress: v15.string(),
1040
+ feeRate: v15.number(),
1041
+ appServiceFee: v15.optional(v15.number()),
1042
+ appServiceFeeAddress: v15.optional(v15.string()),
1043
+ terms: v15.optional(etchTermsSchema),
1044
+ inscriptionDetails: v15.optional(inscriptionDetailsSchema),
1045
+ network: v15.optional(v15.enum(BitcoinNetworkType))
1046
+ });
1047
+ var runesEtchResultSchema = v15.object({
1048
+ orderId: v15.string(),
1049
+ fundTransactionId: v15.string(),
1050
+ fundingAddress: v15.string()
1051
+ });
1052
+ var runesEtchRequestMessageSchema = v15.object({
1096
1053
  ...rpcRequestMessageSchema.entries,
1097
- ...v16.object({
1098
- method: v16.literal(runesEtchMethodName),
1054
+ ...v15.object({
1055
+ method: v15.literal(runesEtchMethodName),
1099
1056
  params: runesEtchParamsSchema,
1100
- id: v16.string()
1057
+ id: v15.string()
1101
1058
  }).entries
1102
1059
  });
1103
1060
 
1104
1061
  // src/request/types/runesMethods/getBalance.ts
1105
- var v17 = __toESM(require("valibot"));
1062
+ var v16 = __toESM(require("valibot"));
1106
1063
  var runesGetBalanceMethodName = "runes_getBalance";
1107
- var runesGetBalanceParamsSchema = v17.nullish(v17.null());
1108
- var runesGetBalanceResultSchema = v17.object({
1109
- balances: v17.array(
1110
- v17.object({
1111
- runeName: v17.string(),
1112
- amount: v17.string(),
1113
- divisibility: v17.number(),
1114
- symbol: v17.string(),
1115
- inscriptionId: v17.nullish(v17.string())
1064
+ var runesGetBalanceParamsSchema = v16.nullish(v16.null());
1065
+ var runesGetBalanceResultSchema = v16.object({
1066
+ balances: v16.array(
1067
+ v16.object({
1068
+ runeName: v16.string(),
1069
+ amount: v16.string(),
1070
+ divisibility: v16.number(),
1071
+ symbol: v16.string(),
1072
+ inscriptionId: v16.nullish(v16.string())
1116
1073
  })
1117
1074
  )
1118
1075
  });
1119
- var runesGetBalanceRequestMessageSchema = v17.object({
1076
+ var runesGetBalanceRequestMessageSchema = v16.object({
1120
1077
  ...rpcRequestMessageSchema.entries,
1121
- ...v17.object({
1122
- method: v17.literal(runesGetBalanceMethodName),
1078
+ ...v16.object({
1079
+ method: v16.literal(runesGetBalanceMethodName),
1123
1080
  params: runesGetBalanceParamsSchema,
1124
- id: v17.string()
1081
+ id: v16.string()
1125
1082
  }).entries
1126
1083
  });
1127
1084
 
1128
1085
  // src/request/types/runesMethods/mint.ts
1129
- var v18 = __toESM(require("valibot"));
1086
+ var v17 = __toESM(require("valibot"));
1130
1087
  var runesMintMethodName = "runes_mint";
1131
- var runesMintParamsSchema = v18.object({
1132
- appServiceFee: v18.optional(v18.number()),
1133
- appServiceFeeAddress: v18.optional(v18.string()),
1134
- destinationAddress: v18.string(),
1135
- feeRate: v18.number(),
1136
- refundAddress: v18.string(),
1137
- repeats: v18.number(),
1138
- runeName: v18.string(),
1139
- network: v18.optional(v18.enum(BitcoinNetworkType))
1140
- });
1141
- var runesMintResultSchema = v18.object({
1142
- orderId: v18.string(),
1143
- fundTransactionId: v18.string(),
1144
- fundingAddress: v18.string()
1145
- });
1146
- var runesMintRequestMessageSchema = v18.object({
1088
+ var runesMintParamsSchema = v17.object({
1089
+ appServiceFee: v17.optional(v17.number()),
1090
+ appServiceFeeAddress: v17.optional(v17.string()),
1091
+ destinationAddress: v17.string(),
1092
+ feeRate: v17.number(),
1093
+ refundAddress: v17.string(),
1094
+ repeats: v17.number(),
1095
+ runeName: v17.string(),
1096
+ network: v17.optional(v17.enum(BitcoinNetworkType))
1097
+ });
1098
+ var runesMintResultSchema = v17.object({
1099
+ orderId: v17.string(),
1100
+ fundTransactionId: v17.string(),
1101
+ fundingAddress: v17.string()
1102
+ });
1103
+ var runesMintRequestMessageSchema = v17.object({
1147
1104
  ...rpcRequestMessageSchema.entries,
1148
- ...v18.object({
1149
- method: v18.literal(runesMintMethodName),
1105
+ ...v17.object({
1106
+ method: v17.literal(runesMintMethodName),
1150
1107
  params: runesMintParamsSchema,
1151
- id: v18.string()
1108
+ id: v17.string()
1152
1109
  }).entries
1153
1110
  });
1154
1111
 
1155
1112
  // src/request/types/runesMethods/transfer.ts
1156
- var v19 = __toESM(require("valibot"));
1113
+ var v18 = __toESM(require("valibot"));
1157
1114
  var runesTransferMethodName = "runes_transfer";
1158
- var runesTransferParamsSchema = v19.object({
1159
- recipients: v19.array(
1160
- v19.object({
1161
- runeName: v19.string(),
1162
- amount: v19.string(),
1163
- address: v19.string()
1115
+ var runesTransferParamsSchema = v18.object({
1116
+ recipients: v18.array(
1117
+ v18.object({
1118
+ runeName: v18.string(),
1119
+ amount: v18.string(),
1120
+ address: v18.string()
1164
1121
  })
1165
1122
  )
1166
1123
  });
1167
- var runesTransferResultSchema = v19.object({
1168
- txid: v19.string()
1124
+ var runesTransferResultSchema = v18.object({
1125
+ txid: v18.string()
1169
1126
  });
1170
- var runesTransferRequestMessageSchema = v19.object({
1127
+ var runesTransferRequestMessageSchema = v18.object({
1171
1128
  ...rpcRequestMessageSchema.entries,
1172
- ...v19.object({
1173
- method: v19.literal(runesTransferMethodName),
1129
+ ...v18.object({
1130
+ method: v18.literal(runesTransferMethodName),
1174
1131
  params: runesTransferParamsSchema,
1175
- id: v19.string()
1132
+ id: v18.string()
1176
1133
  }).entries
1177
1134
  });
1178
1135
 
1179
1136
  // src/request/types/ordinalsMethods.ts
1180
- var v20 = __toESM(require("valibot"));
1137
+ var v19 = __toESM(require("valibot"));
1181
1138
  var getInscriptionsMethodName = "ord_getInscriptions";
1182
- var getInscriptionsParamsSchema = v20.object({
1183
- offset: v20.number(),
1184
- limit: v20.number()
1185
- });
1186
- var getInscriptionsResultSchema = v20.object({
1187
- total: v20.number(),
1188
- limit: v20.number(),
1189
- offset: v20.number(),
1190
- inscriptions: v20.array(
1191
- v20.object({
1192
- inscriptionId: v20.string(),
1193
- inscriptionNumber: v20.string(),
1194
- address: v20.string(),
1195
- collectionName: v20.optional(v20.string()),
1196
- postage: v20.string(),
1197
- contentLength: v20.string(),
1198
- contentType: v20.string(),
1199
- timestamp: v20.number(),
1200
- offset: v20.number(),
1201
- genesisTransaction: v20.string(),
1202
- output: v20.string()
1139
+ var getInscriptionsParamsSchema = v19.object({
1140
+ offset: v19.number(),
1141
+ limit: v19.number()
1142
+ });
1143
+ var getInscriptionsResultSchema = v19.object({
1144
+ total: v19.number(),
1145
+ limit: v19.number(),
1146
+ offset: v19.number(),
1147
+ inscriptions: v19.array(
1148
+ v19.object({
1149
+ inscriptionId: v19.string(),
1150
+ inscriptionNumber: v19.string(),
1151
+ address: v19.string(),
1152
+ collectionName: v19.optional(v19.string()),
1153
+ postage: v19.string(),
1154
+ contentLength: v19.string(),
1155
+ contentType: v19.string(),
1156
+ timestamp: v19.number(),
1157
+ offset: v19.number(),
1158
+ genesisTransaction: v19.string(),
1159
+ output: v19.string()
1203
1160
  })
1204
1161
  )
1205
1162
  });
1206
- var getInscriptionsRequestMessageSchema = v20.object({
1163
+ var getInscriptionsRequestMessageSchema = v19.object({
1207
1164
  ...rpcRequestMessageSchema.entries,
1208
- ...v20.object({
1209
- method: v20.literal(getInscriptionsMethodName),
1165
+ ...v19.object({
1166
+ method: v19.literal(getInscriptionsMethodName),
1210
1167
  params: getInscriptionsParamsSchema,
1211
- id: v20.string()
1168
+ id: v19.string()
1212
1169
  }).entries
1213
1170
  });
1214
1171
  var sendInscriptionsMethodName = "ord_sendInscriptions";
1215
- var sendInscriptionsParamsSchema = v20.object({
1216
- transfers: v20.array(
1217
- v20.object({
1218
- address: v20.string(),
1219
- inscriptionId: v20.string()
1172
+ var sendInscriptionsParamsSchema = v19.object({
1173
+ transfers: v19.array(
1174
+ v19.object({
1175
+ address: v19.string(),
1176
+ inscriptionId: v19.string()
1220
1177
  })
1221
1178
  )
1222
1179
  });
1223
- var sendInscriptionsResultSchema = v20.object({
1224
- txid: v20.string()
1180
+ var sendInscriptionsResultSchema = v19.object({
1181
+ txid: v19.string()
1225
1182
  });
1226
- var sendInscriptionsRequestMessageSchema = v20.object({
1183
+ var sendInscriptionsRequestMessageSchema = v19.object({
1227
1184
  ...rpcRequestMessageSchema.entries,
1228
- ...v20.object({
1229
- method: v20.literal(sendInscriptionsMethodName),
1185
+ ...v19.object({
1186
+ method: v19.literal(sendInscriptionsMethodName),
1230
1187
  params: sendInscriptionsParamsSchema,
1231
- id: v20.string()
1188
+ id: v19.string()
1232
1189
  }).entries
1233
1190
  });
1234
1191
 
@@ -1245,13 +1202,13 @@ var request = async (method, params, providerId) => {
1245
1202
  throw new Error("A wallet method is required");
1246
1203
  }
1247
1204
  const response = await provider.request(method, params);
1248
- if (v21.is(rpcErrorResponseMessageSchema, response)) {
1205
+ if (v20.is(rpcErrorResponseMessageSchema, response)) {
1249
1206
  return {
1250
1207
  status: "error",
1251
1208
  error: response.error
1252
1209
  };
1253
1210
  }
1254
- if (v21.is(rpcSuccessResponseMessageSchema, response)) {
1211
+ if (v20.is(rpcSuccessResponseMessageSchema, response)) {
1255
1212
  return {
1256
1213
  status: "success",
1257
1214
  result: response.result
@@ -1291,7 +1248,12 @@ var urlNetworkSuffix = {
1291
1248
  ["Testnet" /* Testnet */]: "-testnet",
1292
1249
  ["Signet" /* Signet */]: "-signet"
1293
1250
  };
1294
- var ORDINALS_API_BASE_URL = (network = "Mainnet" /* Mainnet */) => `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
1251
+ var ORDINALS_API_BASE_URL = (network = "Mainnet" /* Mainnet */) => {
1252
+ if (network === "Regtest" /* Regtest */) {
1253
+ throw new Error("Ordinals API does not support regtest network");
1254
+ }
1255
+ return `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
1256
+ };
1295
1257
  var RunesApi = class {
1296
1258
  client;
1297
1259
  constructor(network) {
@@ -2343,10 +2305,6 @@ var signMultipleTransactions = async (options) => {
2343
2305
  stxSignTransactionParamsSchema,
2344
2306
  stxSignTransactionRequestMessageSchema,
2345
2307
  stxSignTransactionResultSchema,
2346
- stxSignTransactionsMethodName,
2347
- stxSignTransactionsParamsSchema,
2348
- stxSignTransactionsRequestMessageSchema,
2349
- stxSignTransactionsResultSchema,
2350
2308
  stxTransferStxMethodName,
2351
2309
  stxTransferStxParamsSchema,
2352
2310
  stxTransferStxRequestMessageSchema,