@sats-connect/core 0.4.0 → 0.4.1-06b81c7

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