@sats-connect/core 0.4.1-977f9b7 → 0.4.2-bfaec4d

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