@sats-connect/core 0.7.0 → 0.7.1-3ab7f7d

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
@@ -28,8 +28,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
29
 
30
30
  // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
33
  AddressPurpose: () => AddressPurpose,
34
34
  AddressType: () => AddressType,
35
35
  BaseAdapter: () => BaseAdapter,
@@ -40,6 +40,7 @@ __export(src_exports, {
40
40
  RpcErrorCode: () => RpcErrorCode,
41
41
  RpcIdSchema: () => RpcIdSchema,
42
42
  SatsConnectAdapter: () => SatsConnectAdapter,
43
+ SparkNetworkType: () => SparkNetworkType,
43
44
  StacksNetworkType: () => StacksNetworkType,
44
45
  StarknetNetworkType: () => StarknetNetworkType,
45
46
  accountActionsSchema: () => accountActionsSchema,
@@ -171,6 +172,22 @@ __export(src_exports, {
171
172
  signPsbtRequestMessageSchema: () => signPsbtRequestMessageSchema,
172
173
  signPsbtResultSchema: () => signPsbtResultSchema,
173
174
  signTransaction: () => signTransaction,
175
+ sparkGetAddressesMethodName: () => sparkGetAddressesMethodName,
176
+ sparkGetAddressesParamsSchema: () => sparkGetAddressesParamsSchema,
177
+ sparkGetAddressesRequestMessageSchema: () => sparkGetAddressesRequestMessageSchema,
178
+ sparkGetAddressesResultSchema: () => sparkGetAddressesResultSchema,
179
+ sparkGetBalanceMethodName: () => sparkGetBalanceMethodName,
180
+ sparkGetBalanceParamsSchema: () => sparkGetBalanceParamsSchema,
181
+ sparkGetBalanceRequestMessageSchema: () => sparkGetBalanceRequestMessageSchema,
182
+ sparkGetBalanceResultSchema: () => sparkGetBalanceResultSchema,
183
+ sparkTransferMethodName: () => sparkTransferMethodName,
184
+ sparkTransferParamsSchema: () => sparkTransferParamsSchema,
185
+ sparkTransferRequestMessageSchema: () => sparkTransferRequestMessageSchema,
186
+ sparkTransferResultSchema: () => sparkTransferResultSchema,
187
+ sparkTransferTokenMethodName: () => sparkTransferTokenMethodName,
188
+ sparkTransferTokenParamsSchema: () => sparkTransferTokenParamsSchema,
189
+ sparkTransferTokenRequestMessageSchema: () => sparkTransferTokenRequestMessageSchema,
190
+ sparkTransferTokenResultSchema: () => sparkTransferTokenResultSchema,
174
191
  stxCallContractMethodName: () => stxCallContractMethodName,
175
192
  stxCallContractParamsSchema: () => stxCallContractParamsSchema,
176
193
  stxCallContractRequestMessageSchema: () => stxCallContractRequestMessageSchema,
@@ -213,7 +230,7 @@ __export(src_exports, {
213
230
  walletTypeSchema: () => walletTypeSchema,
214
231
  walletTypes: () => walletTypes
215
232
  });
216
- module.exports = __toCommonJS(src_exports);
233
+ module.exports = __toCommonJS(index_exports);
217
234
 
218
235
  // src/provider/types.ts
219
236
  var v4 = __toESM(require("valibot"));
@@ -234,6 +251,8 @@ var AddressPurpose = /* @__PURE__ */ ((AddressPurpose2) => {
234
251
  AddressPurpose2["Ordinals"] = "ordinals";
235
252
  AddressPurpose2["Payment"] = "payment";
236
253
  AddressPurpose2["Stacks"] = "stacks";
254
+ AddressPurpose2["Starknet"] = "starknet";
255
+ AddressPurpose2["Spark"] = "spark";
237
256
  return AddressPurpose2;
238
257
  })(AddressPurpose || {});
239
258
  var AddressType = /* @__PURE__ */ ((AddressType3) => {
@@ -243,6 +262,8 @@ var AddressType = /* @__PURE__ */ ((AddressType3) => {
243
262
  AddressType3["p2wsh"] = "p2wsh";
244
263
  AddressType3["p2tr"] = "p2tr";
245
264
  AddressType3["stacks"] = "stacks";
265
+ AddressType3["starknet"] = "starknet";
266
+ AddressType3["spark"] = "spark";
246
267
  return AddressType3;
247
268
  })(AddressType || {});
248
269
  var addressSchema = v2.object({
@@ -290,6 +311,11 @@ var StarknetNetworkType = /* @__PURE__ */ ((StarknetNetworkType2) => {
290
311
  StarknetNetworkType2["Sepolia"] = "sepolia";
291
312
  return StarknetNetworkType2;
292
313
  })(StarknetNetworkType || {});
314
+ var SparkNetworkType = /* @__PURE__ */ ((SparkNetworkType2) => {
315
+ SparkNetworkType2["Mainnet"] = "mainnet";
316
+ SparkNetworkType2["Regtest"] = "regtest";
317
+ return SparkNetworkType2;
318
+ })(SparkNetworkType || {});
293
319
  var RpcIdSchema = v3.optional(v3.union([v3.string(), v3.number(), v3.null()]));
294
320
  var rpcRequestMessageSchema = v3.object({
295
321
  jsonrpc: v3.literal("2.0"),
@@ -400,29 +426,759 @@ function getSupportedWallets() {
400
426
  }
401
427
 
402
428
  // src/request/index.ts
403
- var v21 = __toESM(require("valibot"));
429
+ var v25 = __toESM(require("valibot"));
430
+
431
+ // src/request/types/btcMethods.ts
432
+ var v6 = __toESM(require("valibot"));
433
+
434
+ // src/request/types/walletMethods.ts
435
+ var v5 = __toESM(require("valibot"));
436
+ var accountActionsSchema = v5.object({
437
+ read: v5.optional(v5.boolean())
438
+ });
439
+ var walletActionsSchema = v5.object({
440
+ readNetwork: v5.optional(v5.boolean())
441
+ });
442
+ var accountPermissionSchema = v5.object({
443
+ type: v5.literal("account"),
444
+ resourceId: v5.string(),
445
+ clientId: v5.string(),
446
+ actions: accountActionsSchema
447
+ });
448
+ var walletPermissionSchema = v5.object({
449
+ type: v5.literal("wallet"),
450
+ resourceId: v5.string(),
451
+ clientId: v5.string(),
452
+ actions: walletActionsSchema
453
+ });
454
+ var PermissionRequestParams = v5.variant("type", [
455
+ v5.object({
456
+ ...v5.omit(accountPermissionSchema, ["clientId"]).entries
457
+ }),
458
+ v5.object({
459
+ ...v5.omit(walletPermissionSchema, ["clientId"]).entries
460
+ })
461
+ ]);
462
+ var permission = v5.variant("type", [accountPermissionSchema, walletPermissionSchema]);
463
+ var requestPermissionsMethodName = "wallet_requestPermissions";
464
+ var requestPermissionsParamsSchema = v5.nullish(v5.array(PermissionRequestParams));
465
+ var requestPermissionsResultSchema = v5.literal(true);
466
+ var requestPermissionsRequestMessageSchema = v5.object({
467
+ ...rpcRequestMessageSchema.entries,
468
+ ...v5.object({
469
+ method: v5.literal(requestPermissionsMethodName),
470
+ params: requestPermissionsParamsSchema,
471
+ id: v5.string()
472
+ }).entries
473
+ });
474
+ var renouncePermissionsMethodName = "wallet_renouncePermissions";
475
+ var renouncePermissionsParamsSchema = v5.nullish(v5.null());
476
+ var renouncePermissionsResultSchema = v5.nullish(v5.null());
477
+ var renouncePermissionsRequestMessageSchema = v5.object({
478
+ ...rpcRequestMessageSchema.entries,
479
+ ...v5.object({
480
+ method: v5.literal(renouncePermissionsMethodName),
481
+ params: renouncePermissionsParamsSchema,
482
+ id: v5.string()
483
+ }).entries
484
+ });
485
+ var disconnectMethodName = "wallet_disconnect";
486
+ var disconnectParamsSchema = v5.nullish(v5.null());
487
+ var disconnectResultSchema = v5.nullish(v5.null());
488
+ var disconnectRequestMessageSchema = v5.object({
489
+ ...rpcRequestMessageSchema.entries,
490
+ ...v5.object({
491
+ method: v5.literal(disconnectMethodName),
492
+ params: disconnectParamsSchema,
493
+ id: v5.string()
494
+ }).entries
495
+ });
496
+ var getWalletTypeMethodName = "wallet_getWalletType";
497
+ var getWalletTypeParamsSchema = v5.nullish(v5.null());
498
+ var getWalletTypeResultSchema = walletTypeSchema;
499
+ var getWalletTypeRequestMessageSchema = v5.object({
500
+ ...rpcRequestMessageSchema.entries,
501
+ ...v5.object({
502
+ method: v5.literal(getWalletTypeMethodName),
503
+ params: getWalletTypeParamsSchema,
504
+ id: v5.string()
505
+ }).entries
506
+ });
507
+ var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
508
+ var getCurrentPermissionsParamsSchema = v5.nullish(v5.null());
509
+ var getCurrentPermissionsResultSchema = v5.array(permission);
510
+ var getCurrentPermissionsRequestMessageSchema = v5.object({
511
+ ...rpcRequestMessageSchema.entries,
512
+ ...v5.object({
513
+ method: v5.literal(getCurrentPermissionsMethodName),
514
+ params: getCurrentPermissionsParamsSchema,
515
+ id: v5.string()
516
+ }).entries
517
+ });
518
+ var getNetworkMethodName = "wallet_getNetwork";
519
+ var getNetworkParamsSchema = v5.nullish(v5.null());
520
+ var getNetworkResultSchema = v5.object({
521
+ bitcoin: v5.object({
522
+ name: v5.enum(BitcoinNetworkType)
523
+ }),
524
+ stacks: v5.object({
525
+ name: v5.enum(StacksNetworkType)
526
+ }),
527
+ spark: v5.object({
528
+ name: v5.enum(SparkNetworkType)
529
+ })
530
+ });
531
+ var getNetworkRequestMessageSchema = v5.object({
532
+ ...rpcRequestMessageSchema.entries,
533
+ ...v5.object({
534
+ method: v5.literal(getNetworkMethodName),
535
+ params: getNetworkParamsSchema,
536
+ id: v5.string()
537
+ }).entries
538
+ });
539
+ var changeNetworkMethodName = "wallet_changeNetwork";
540
+ var changeNetworkParamsSchema = v5.object({
541
+ name: v5.enum(BitcoinNetworkType)
542
+ });
543
+ var changeNetworkResultSchema = v5.nullish(v5.null());
544
+ var changeNetworkRequestMessageSchema = v5.object({
545
+ ...rpcRequestMessageSchema.entries,
546
+ ...v5.object({
547
+ method: v5.literal(changeNetworkMethodName),
548
+ params: changeNetworkParamsSchema,
549
+ id: v5.string()
550
+ }).entries
551
+ });
552
+ var changeNetworkByIdMethodName = "wallet_changeNetworkById";
553
+ var changeNetworkByIdParamsSchema = v5.object({
554
+ id: v5.string()
555
+ });
556
+ var changeNetworkByIdResultSchema = v5.nullish(v5.null());
557
+ var changeNetworkByIdRequestMessageSchema = v5.object({
558
+ ...rpcRequestMessageSchema.entries,
559
+ ...v5.object({
560
+ method: v5.literal(changeNetworkByIdMethodName),
561
+ params: changeNetworkByIdParamsSchema,
562
+ id: v5.string()
563
+ }).entries
564
+ });
565
+ var getAccountMethodName = "wallet_getAccount";
566
+ var getAccountParamsSchema = v5.nullish(v5.null());
567
+ var getAccountResultSchema = v5.object({
568
+ id: v5.string(),
569
+ addresses: v5.array(addressSchema),
570
+ walletType: walletTypeSchema,
571
+ network: getNetworkResultSchema
572
+ });
573
+ var getAccountRequestMessageSchema = v5.object({
574
+ ...rpcRequestMessageSchema.entries,
575
+ ...v5.object({
576
+ method: v5.literal(getAccountMethodName),
577
+ params: getAccountParamsSchema,
578
+ id: v5.string()
579
+ }).entries
580
+ });
581
+ var connectMethodName = "wallet_connect";
582
+ var connectParamsSchema = v5.nullish(
583
+ v5.object({
584
+ permissions: v5.optional(v5.array(PermissionRequestParams)),
585
+ addresses: v5.optional(v5.array(v5.enum(AddressPurpose))),
586
+ message: v5.optional(
587
+ v5.pipe(v5.string(), v5.maxLength(80, "The message must not exceed 80 characters."))
588
+ ),
589
+ network: v5.optional(v5.enum(BitcoinNetworkType))
590
+ })
591
+ );
592
+ var connectResultSchema = v5.object({
593
+ id: v5.string(),
594
+ addresses: v5.array(addressSchema),
595
+ walletType: walletTypeSchema,
596
+ network: getNetworkResultSchema
597
+ });
598
+ var connectRequestMessageSchema = v5.object({
599
+ ...rpcRequestMessageSchema.entries,
600
+ ...v5.object({
601
+ method: v5.literal(connectMethodName),
602
+ params: connectParamsSchema,
603
+ id: v5.string()
604
+ }).entries
605
+ });
606
+ var addNetworkMethodName = "wallet_addNetwork";
607
+ var addNetworkParamsSchema = v5.variant("chain", [
608
+ v5.object({
609
+ chain: v5.literal("bitcoin"),
610
+ type: v5.enum(BitcoinNetworkType),
611
+ name: v5.string(),
612
+ rpcUrl: v5.string(),
613
+ rpcFallbackUrl: v5.optional(v5.string()),
614
+ indexerUrl: v5.optional(v5.string()),
615
+ blockExplorerUrl: v5.optional(v5.string()),
616
+ switch: v5.optional(v5.boolean())
617
+ }),
618
+ v5.object({
619
+ chain: v5.literal("stacks"),
620
+ name: v5.string(),
621
+ type: v5.enum(StacksNetworkType),
622
+ rpcUrl: v5.string(),
623
+ blockExplorerUrl: v5.optional(v5.string()),
624
+ switch: v5.optional(v5.boolean())
625
+ }),
626
+ v5.object({
627
+ chain: v5.literal("starknet"),
628
+ name: v5.string(),
629
+ type: v5.enum(StarknetNetworkType),
630
+ rpcUrl: v5.string(),
631
+ blockExplorerUrl: v5.optional(v5.string()),
632
+ switch: v5.optional(v5.boolean())
633
+ })
634
+ ]);
635
+ var addNetworkRequestMessageSchema = v5.object({
636
+ ...rpcRequestMessageSchema.entries,
637
+ ...v5.object({
638
+ method: v5.literal(addNetworkMethodName),
639
+ params: addNetworkParamsSchema,
640
+ id: v5.string()
641
+ }).entries
642
+ });
643
+ var addNetworkResultSchema = v5.object({
644
+ id: v5.string()
645
+ });
646
+
647
+ // src/request/types/btcMethods.ts
648
+ var getInfoMethodName = "getInfo";
649
+ var getInfoParamsSchema = v6.nullish(v6.null());
650
+ var getInfoResultSchema = v6.object({
651
+ /**
652
+ * Version of the wallet.
653
+ */
654
+ version: v6.string(),
655
+ /**
656
+ * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
657
+ */
658
+ methods: v6.optional(v6.array(v6.string())),
659
+ /**
660
+ * List of WBIP standards supported by the wallet. Not currently used.
661
+ */
662
+ supports: v6.array(v6.string())
663
+ });
664
+ var getInfoRequestMessageSchema = v6.object({
665
+ ...rpcRequestMessageSchema.entries,
666
+ ...v6.object({
667
+ method: v6.literal(getInfoMethodName),
668
+ params: getInfoParamsSchema,
669
+ id: v6.string()
670
+ }).entries
671
+ });
672
+ var getAddressesMethodName = "getAddresses";
673
+ var getAddressesParamsSchema = v6.object({
674
+ /**
675
+ * The purposes for which to generate addresses. See
676
+ * {@linkcode AddressPurpose} for available purposes.
677
+ */
678
+ purposes: v6.array(v6.enum(AddressPurpose)),
679
+ /**
680
+ * A message to be displayed to the user in the request prompt.
681
+ */
682
+ message: v6.optional(v6.string())
683
+ });
684
+ var getAddressesResultSchema = v6.object({
685
+ /**
686
+ * The addresses generated for the given purposes.
687
+ */
688
+ addresses: v6.array(addressSchema),
689
+ network: getNetworkResultSchema
690
+ });
691
+ var getAddressesRequestMessageSchema = v6.object({
692
+ ...rpcRequestMessageSchema.entries,
693
+ ...v6.object({
694
+ method: v6.literal(getAddressesMethodName),
695
+ params: getAddressesParamsSchema,
696
+ id: v6.string()
697
+ }).entries
698
+ });
699
+ var signMessageMethodName = "signMessage";
700
+ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
701
+ MessageSigningProtocols2["ECDSA"] = "ECDSA";
702
+ MessageSigningProtocols2["BIP322"] = "BIP322";
703
+ return MessageSigningProtocols2;
704
+ })(MessageSigningProtocols || {});
705
+ var signMessageParamsSchema = v6.object({
706
+ /**
707
+ * The address used for signing.
708
+ **/
709
+ address: v6.string(),
710
+ /**
711
+ * The message to sign.
712
+ **/
713
+ message: v6.string(),
714
+ /**
715
+ * The protocol to use for signing the message.
716
+ */
717
+ protocol: v6.optional(v6.enum(MessageSigningProtocols))
718
+ });
719
+ var signMessageResultSchema = v6.object({
720
+ /**
721
+ * The signature of the message.
722
+ */
723
+ signature: v6.string(),
724
+ /**
725
+ * hash of the message.
726
+ */
727
+ messageHash: v6.string(),
728
+ /**
729
+ * The address used for signing.
730
+ */
731
+ address: v6.string(),
732
+ /**
733
+ * The protocol to use for signing the message.
734
+ */
735
+ protocol: v6.enum(MessageSigningProtocols)
736
+ });
737
+ var signMessageRequestMessageSchema = v6.object({
738
+ ...rpcRequestMessageSchema.entries,
739
+ ...v6.object({
740
+ method: v6.literal(signMessageMethodName),
741
+ params: signMessageParamsSchema,
742
+ id: v6.string()
743
+ }).entries
744
+ });
745
+ var sendTransferMethodName = "sendTransfer";
746
+ var sendTransferParamsSchema = v6.object({
747
+ /**
748
+ * Array of recipients to send to.
749
+ * The amount to send to each recipient is in satoshis.
750
+ */
751
+ recipients: v6.array(
752
+ v6.object({
753
+ address: v6.string(),
754
+ amount: v6.number()
755
+ })
756
+ )
757
+ });
758
+ var sendTransferResultSchema = v6.object({
759
+ /**
760
+ * The transaction id as a hex-encoded string.
761
+ */
762
+ txid: v6.string()
763
+ });
764
+ var sendTransferRequestMessageSchema = v6.object({
765
+ ...rpcRequestMessageSchema.entries,
766
+ ...v6.object({
767
+ method: v6.literal(sendTransferMethodName),
768
+ params: sendTransferParamsSchema,
769
+ id: v6.string()
770
+ }).entries
771
+ });
772
+ var signPsbtMethodName = "signPsbt";
773
+ var signPsbtParamsSchema = v6.object({
774
+ /**
775
+ * The base64 encoded PSBT to sign.
776
+ */
777
+ psbt: v6.string(),
778
+ /**
779
+ * The inputs to sign.
780
+ * The key is the address and the value is an array of indexes of the inputs to sign.
781
+ */
782
+ signInputs: v6.optional(v6.record(v6.string(), v6.array(v6.number()))),
783
+ /**
784
+ * Whether to broadcast the transaction after signing.
785
+ **/
786
+ broadcast: v6.optional(v6.boolean())
787
+ });
788
+ var signPsbtResultSchema = v6.object({
789
+ /**
790
+ * The base64 encoded PSBT after signing.
791
+ */
792
+ psbt: v6.string(),
793
+ /**
794
+ * The transaction id as a hex-encoded string.
795
+ * This is only returned if the transaction was broadcast.
796
+ **/
797
+ txid: v6.optional(v6.string())
798
+ });
799
+ var signPsbtRequestMessageSchema = v6.object({
800
+ ...rpcRequestMessageSchema.entries,
801
+ ...v6.object({
802
+ method: v6.literal(signPsbtMethodName),
803
+ params: signPsbtParamsSchema,
804
+ id: v6.string()
805
+ }).entries
806
+ });
807
+ var getAccountsMethodName = "getAccounts";
808
+ var getAccountsParamsSchema = v6.object({
809
+ /**
810
+ * The purposes for which to generate addresses. See
811
+ * {@linkcode AddressPurpose} for available purposes.
812
+ */
813
+ purposes: v6.array(v6.enum(AddressPurpose)),
814
+ /**
815
+ * A message to be displayed to the user in the request prompt.
816
+ */
817
+ message: v6.optional(v6.string())
818
+ });
819
+ var getAccountsResultSchema = v6.array(
820
+ v6.object({
821
+ ...addressSchema.entries,
822
+ ...v6.object({
823
+ walletType: walletTypeSchema
824
+ }).entries
825
+ })
826
+ );
827
+ var getAccountsRequestMessageSchema = v6.object({
828
+ ...rpcRequestMessageSchema.entries,
829
+ ...v6.object({
830
+ method: v6.literal(getAccountsMethodName),
831
+ params: getAccountsParamsSchema,
832
+ id: v6.string()
833
+ }).entries
834
+ });
835
+ var getBalanceMethodName = "getBalance";
836
+ var getBalanceParamsSchema = v6.nullish(v6.null());
837
+ var getBalanceResultSchema = v6.object({
838
+ /**
839
+ * The confirmed balance of the wallet in sats. Using a string due to chrome
840
+ * messages not supporting bigint
841
+ * (https://issues.chromium.org/issues/40116184).
842
+ */
843
+ confirmed: v6.string(),
844
+ /**
845
+ * The unconfirmed balance of the wallet in sats. Using a string due to chrome
846
+ * messages not supporting bigint
847
+ * (https://issues.chromium.org/issues/40116184).
848
+ */
849
+ unconfirmed: v6.string(),
850
+ /**
851
+ * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
852
+ * sats. Using a string due to chrome messages not supporting bigint
853
+ * (https://issues.chromium.org/issues/40116184).
854
+ */
855
+ total: v6.string()
856
+ });
857
+ var getBalanceRequestMessageSchema = v6.object({
858
+ ...rpcRequestMessageSchema.entries,
859
+ ...v6.object({
860
+ method: v6.literal(getBalanceMethodName),
861
+ id: v6.string()
862
+ }).entries
863
+ });
864
+
865
+ // src/request/types/ordinalsMethods.ts
866
+ var v7 = __toESM(require("valibot"));
867
+ var getInscriptionsMethodName = "ord_getInscriptions";
868
+ var getInscriptionsParamsSchema = v7.object({
869
+ offset: v7.number(),
870
+ limit: v7.number()
871
+ });
872
+ var getInscriptionsResultSchema = v7.object({
873
+ total: v7.number(),
874
+ limit: v7.number(),
875
+ offset: v7.number(),
876
+ inscriptions: v7.array(
877
+ v7.object({
878
+ inscriptionId: v7.string(),
879
+ inscriptionNumber: v7.string(),
880
+ address: v7.string(),
881
+ collectionName: v7.optional(v7.string()),
882
+ postage: v7.string(),
883
+ contentLength: v7.string(),
884
+ contentType: v7.string(),
885
+ timestamp: v7.number(),
886
+ offset: v7.number(),
887
+ genesisTransaction: v7.string(),
888
+ output: v7.string()
889
+ })
890
+ )
891
+ });
892
+ var getInscriptionsRequestMessageSchema = v7.object({
893
+ ...rpcRequestMessageSchema.entries,
894
+ ...v7.object({
895
+ method: v7.literal(getInscriptionsMethodName),
896
+ params: getInscriptionsParamsSchema,
897
+ id: v7.string()
898
+ }).entries
899
+ });
900
+ var sendInscriptionsMethodName = "ord_sendInscriptions";
901
+ var sendInscriptionsParamsSchema = v7.object({
902
+ transfers: v7.array(
903
+ v7.object({
904
+ address: v7.string(),
905
+ inscriptionId: v7.string()
906
+ })
907
+ )
908
+ });
909
+ var sendInscriptionsResultSchema = v7.object({
910
+ txid: v7.string()
911
+ });
912
+ var sendInscriptionsRequestMessageSchema = v7.object({
913
+ ...rpcRequestMessageSchema.entries,
914
+ ...v7.object({
915
+ method: v7.literal(sendInscriptionsMethodName),
916
+ params: sendInscriptionsParamsSchema,
917
+ id: v7.string()
918
+ }).entries
919
+ });
920
+
921
+ // src/request/types/runesMethods/etch.ts
922
+ var v8 = __toESM(require("valibot"));
923
+ var runesEtchMethodName = "runes_etch";
924
+ var etchTermsSchema = v8.object({
925
+ amount: v8.string(),
926
+ cap: v8.string(),
927
+ heightStart: v8.optional(v8.string()),
928
+ heightEnd: v8.optional(v8.string()),
929
+ offsetStart: v8.optional(v8.string()),
930
+ offsetEnd: v8.optional(v8.string())
931
+ });
932
+ var inscriptionDetailsSchema = v8.object({
933
+ contentType: v8.string(),
934
+ contentBase64: v8.string()
935
+ });
936
+ var runesEtchParamsSchema = v8.object({
937
+ runeName: v8.string(),
938
+ divisibility: v8.optional(v8.number()),
939
+ symbol: v8.optional(v8.string()),
940
+ premine: v8.optional(v8.string()),
941
+ isMintable: v8.boolean(),
942
+ delegateInscriptionId: v8.optional(v8.string()),
943
+ destinationAddress: v8.string(),
944
+ refundAddress: v8.string(),
945
+ feeRate: v8.number(),
946
+ appServiceFee: v8.optional(v8.number()),
947
+ appServiceFeeAddress: v8.optional(v8.string()),
948
+ terms: v8.optional(etchTermsSchema),
949
+ inscriptionDetails: v8.optional(inscriptionDetailsSchema),
950
+ network: v8.optional(v8.enum(BitcoinNetworkType))
951
+ });
952
+ var runesEtchResultSchema = v8.object({
953
+ orderId: v8.string(),
954
+ fundTransactionId: v8.string(),
955
+ fundingAddress: v8.string()
956
+ });
957
+ var runesEtchRequestMessageSchema = v8.object({
958
+ ...rpcRequestMessageSchema.entries,
959
+ ...v8.object({
960
+ method: v8.literal(runesEtchMethodName),
961
+ params: runesEtchParamsSchema,
962
+ id: v8.string()
963
+ }).entries
964
+ });
965
+
966
+ // src/request/types/runesMethods/getBalance.ts
967
+ var v9 = __toESM(require("valibot"));
968
+ var runesGetBalanceMethodName = "runes_getBalance";
969
+ var runesGetBalanceParamsSchema = v9.nullish(v9.null());
970
+ var runesGetBalanceResultSchema = v9.object({
971
+ balances: v9.array(
972
+ v9.object({
973
+ runeName: v9.string(),
974
+ amount: v9.string(),
975
+ divisibility: v9.number(),
976
+ symbol: v9.string(),
977
+ inscriptionId: v9.nullish(v9.string()),
978
+ spendableBalance: v9.string()
979
+ })
980
+ )
981
+ });
982
+ var runesGetBalanceRequestMessageSchema = v9.object({
983
+ ...rpcRequestMessageSchema.entries,
984
+ ...v9.object({
985
+ method: v9.literal(runesGetBalanceMethodName),
986
+ params: runesGetBalanceParamsSchema,
987
+ id: v9.string()
988
+ }).entries
989
+ });
990
+
991
+ // src/request/types/runesMethods/mint.ts
992
+ var v10 = __toESM(require("valibot"));
993
+ var runesMintMethodName = "runes_mint";
994
+ var runesMintParamsSchema = v10.object({
995
+ appServiceFee: v10.optional(v10.number()),
996
+ appServiceFeeAddress: v10.optional(v10.string()),
997
+ destinationAddress: v10.string(),
998
+ feeRate: v10.number(),
999
+ refundAddress: v10.string(),
1000
+ repeats: v10.number(),
1001
+ runeName: v10.string(),
1002
+ network: v10.optional(v10.enum(BitcoinNetworkType))
1003
+ });
1004
+ var runesMintResultSchema = v10.object({
1005
+ orderId: v10.string(),
1006
+ fundTransactionId: v10.string(),
1007
+ fundingAddress: v10.string()
1008
+ });
1009
+ var runesMintRequestMessageSchema = v10.object({
1010
+ ...rpcRequestMessageSchema.entries,
1011
+ ...v10.object({
1012
+ method: v10.literal(runesMintMethodName),
1013
+ params: runesMintParamsSchema,
1014
+ id: v10.string()
1015
+ }).entries
1016
+ });
1017
+
1018
+ // src/request/types/runesMethods/transfer.ts
1019
+ var v11 = __toESM(require("valibot"));
1020
+ var runesTransferMethodName = "runes_transfer";
1021
+ var runesTransferParamsSchema = v11.object({
1022
+ recipients: v11.array(
1023
+ v11.object({
1024
+ runeName: v11.string(),
1025
+ amount: v11.string(),
1026
+ address: v11.string()
1027
+ })
1028
+ )
1029
+ });
1030
+ var runesTransferResultSchema = v11.object({
1031
+ txid: v11.string()
1032
+ });
1033
+ var runesTransferRequestMessageSchema = v11.object({
1034
+ ...rpcRequestMessageSchema.entries,
1035
+ ...v11.object({
1036
+ method: v11.literal(runesTransferMethodName),
1037
+ params: runesTransferParamsSchema,
1038
+ id: v11.string()
1039
+ }).entries
1040
+ });
1041
+
1042
+ // src/request/types/sparkMethods/getAddresses.ts
1043
+ var v12 = __toESM(require("valibot"));
1044
+ var sparkGetAddressesMethodName = "spark_getAddresses";
1045
+ var sparkGetAddressesParamsSchema = v12.nullish(
1046
+ v12.object({
1047
+ /**
1048
+ * A message to be displayed to the user in the request prompt.
1049
+ */
1050
+ message: v12.optional(v12.string())
1051
+ })
1052
+ );
1053
+ var sparkGetAddressesResultSchema = v12.object({
1054
+ /**
1055
+ * The addresses generated for the given purposes.
1056
+ */
1057
+ addresses: v12.array(addressSchema),
1058
+ network: getNetworkResultSchema
1059
+ });
1060
+ var sparkGetAddressesRequestMessageSchema = v12.object({
1061
+ ...rpcRequestMessageSchema.entries,
1062
+ ...v12.object({
1063
+ method: v12.literal(sparkGetAddressesMethodName),
1064
+ params: sparkGetAddressesParamsSchema,
1065
+ id: v12.string()
1066
+ }).entries
1067
+ });
1068
+
1069
+ // src/request/types/sparkMethods/getBalance.ts
1070
+ var v13 = __toESM(require("valibot"));
1071
+ var sparkGetBalanceMethodName = "spark_getBalance";
1072
+ var sparkGetBalanceParamsSchema = v13.nullish(v13.null());
1073
+ var sparkGetBalanceResultSchema = v13.object({
1074
+ /**
1075
+ * The Spark Bitcoin address balance in sats in string form.
1076
+ */
1077
+ balance: v13.string(),
1078
+ tokenBalances: v13.array(
1079
+ v13.object({
1080
+ /* The address balance of the token in string form as it can overflow a js number */
1081
+ balance: v13.string(),
1082
+ tokenMetadata: v13.object({
1083
+ tokenPublicKey: v13.string(),
1084
+ tokenName: v13.string(),
1085
+ tokenTicker: v13.string(),
1086
+ decimals: v13.number(),
1087
+ maxSupply: v13.string()
1088
+ })
1089
+ })
1090
+ )
1091
+ });
1092
+ var sparkGetBalanceRequestMessageSchema = v13.object({
1093
+ ...rpcRequestMessageSchema.entries,
1094
+ ...v13.object({
1095
+ method: v13.literal(sparkGetBalanceMethodName),
1096
+ params: sparkGetBalanceParamsSchema,
1097
+ id: v13.string()
1098
+ }).entries
1099
+ });
1100
+
1101
+ // src/request/types/sparkMethods/transfer.ts
1102
+ var v14 = __toESM(require("valibot"));
1103
+ var sparkTransferMethodName = "spark_transfer";
1104
+ var sparkTransferParamsSchema = v14.object({
1105
+ /**
1106
+ * Amount of SATS to transfer as a string or number.
1107
+ */
1108
+ amountSats: v14.union([v14.number(), v14.string()]),
1109
+ /**
1110
+ * The recipient's spark address.
1111
+ */
1112
+ receiverSparkAddress: v14.string()
1113
+ });
1114
+ var sparkTransferResultSchema = v14.object({
1115
+ /**
1116
+ * The ID of the transaction.
1117
+ */
1118
+ id: v14.string()
1119
+ });
1120
+ var sparkTransferRequestMessageSchema = v14.object({
1121
+ ...rpcRequestMessageSchema.entries,
1122
+ ...v14.object({
1123
+ method: v14.literal(sparkTransferMethodName),
1124
+ params: sparkTransferParamsSchema,
1125
+ id: v14.string()
1126
+ }).entries
1127
+ });
1128
+
1129
+ // src/request/types/sparkMethods/transferToken.ts
1130
+ var v15 = __toESM(require("valibot"));
1131
+ var sparkTransferTokenMethodName = "spark_transferToken";
1132
+ var sparkTransferTokenParamsSchema = v15.object({
1133
+ /**
1134
+ * Amount of units of the token to transfer as a string or number.
1135
+ */
1136
+ tokenAmount: v15.union([v15.number(), v15.string()]),
1137
+ /**
1138
+ * The token identifier.
1139
+ */
1140
+ tokenIdentifier: v15.string(),
1141
+ /**
1142
+ * The recipient's spark address.
1143
+ */
1144
+ receiverSparkAddress: v15.string()
1145
+ });
1146
+ var sparkTransferTokenResultSchema = v15.object({
1147
+ /**
1148
+ * The ID of the transaction.
1149
+ */
1150
+ id: v15.string()
1151
+ });
1152
+ var sparkTransferTokenRequestMessageSchema = v15.object({
1153
+ ...rpcRequestMessageSchema.entries,
1154
+ ...v15.object({
1155
+ method: v15.literal(sparkTransferTokenMethodName),
1156
+ params: sparkTransferTokenParamsSchema,
1157
+ id: v15.string()
1158
+ }).entries
1159
+ });
404
1160
 
405
1161
  // src/request/types/stxMethods/callContract.ts
406
- var v5 = __toESM(require("valibot"));
1162
+ var v16 = __toESM(require("valibot"));
407
1163
  var stxCallContractMethodName = "stx_callContract";
408
- var stxCallContractParamsSchema = v5.object({
1164
+ var stxCallContractParamsSchema = v16.object({
409
1165
  /**
410
1166
  * The contract principal.
411
1167
  *
412
1168
  * E.g. `"SPKE...GD5C.my-contract"`
413
1169
  */
414
- contract: v5.string(),
1170
+ contract: v16.string(),
415
1171
  /**
416
1172
  * The name of the function to call.
417
1173
  *
418
1174
  * Note: spec changes ongoing,
419
1175
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
420
1176
  */
421
- functionName: v5.string(),
1177
+ functionName: v16.string(),
422
1178
  /**
423
1179
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
424
1180
  */
425
- arguments: v5.optional(v5.array(v5.string())),
1181
+ arguments: v16.optional(v16.array(v16.string())),
426
1182
  /**
427
1183
  * The function's arguments. The arguments are expected to be hex-encoded
428
1184
  * strings of Clarity values.
@@ -437,486 +1193,274 @@ var stxCallContractParamsSchema = v5.object({
437
1193
  * const hexArgs = functionArgs.map(cvToHex);
438
1194
  * ```
439
1195
  */
440
- functionArgs: v5.optional(v5.array(v5.string())),
1196
+ functionArgs: v16.optional(v16.array(v16.string())),
441
1197
  /**
442
1198
  * The post conditions to apply to the contract call.
443
1199
  */
444
- postConditions: v5.optional(v5.array(v5.string())),
1200
+ postConditions: v16.optional(v16.array(v16.string())),
445
1201
  /**
446
1202
  * The mode to apply to the post conditions.
447
1203
  */
448
- postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
1204
+ postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
449
1205
  });
450
- var stxCallContractResultSchema = v5.object({
1206
+ var stxCallContractResultSchema = v16.object({
451
1207
  /**
452
1208
  * The ID of the transaction.
453
1209
  */
454
- txid: v5.string(),
1210
+ txid: v16.string(),
455
1211
  /**
456
1212
  * A Stacks transaction as a hex-encoded string.
457
1213
  */
458
- transaction: v5.string()
1214
+ transaction: v16.string()
459
1215
  });
460
- var stxCallContractRequestMessageSchema = v5.object({
1216
+ var stxCallContractRequestMessageSchema = v16.object({
461
1217
  ...rpcRequestMessageSchema.entries,
462
- ...v5.object({
463
- method: v5.literal(stxCallContractMethodName),
1218
+ ...v16.object({
1219
+ method: v16.literal(stxCallContractMethodName),
464
1220
  params: stxCallContractParamsSchema,
465
- id: v5.string()
1221
+ id: v16.string()
466
1222
  }).entries
467
1223
  });
468
1224
 
469
1225
  // src/request/types/stxMethods/deployContract.ts
470
- var v6 = __toESM(require("valibot"));
1226
+ var v17 = __toESM(require("valibot"));
471
1227
  var stxDeployContractMethodName = "stx_deployContract";
472
- var stxDeployContractParamsSchema = v6.object({
1228
+ var stxDeployContractParamsSchema = v17.object({
473
1229
  /**
474
1230
  * Name of the contract.
475
1231
  */
476
- name: v6.string(),
1232
+ name: v17.string(),
477
1233
  /**
478
1234
  * The source code of the Clarity contract.
479
1235
  */
480
- clarityCode: v6.string(),
1236
+ clarityCode: v17.string(),
481
1237
  /**
482
1238
  * The version of the Clarity contract.
483
1239
  */
484
- clarityVersion: v6.optional(v6.number()),
1240
+ clarityVersion: v17.optional(v17.number()),
485
1241
  /**
486
1242
  * The post conditions to apply to the contract call.
487
1243
  */
488
- postConditions: v6.optional(v6.array(v6.string())),
1244
+ postConditions: v17.optional(v17.array(v17.string())),
489
1245
  /**
490
1246
  * The mode to apply to the post conditions.
491
1247
  */
492
- postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
1248
+ postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
493
1249
  });
494
- var stxDeployContractResultSchema = v6.object({
1250
+ var stxDeployContractResultSchema = v17.object({
495
1251
  /**
496
1252
  * The ID of the transaction.
497
1253
  */
498
- txid: v6.string(),
1254
+ txid: v17.string(),
499
1255
  /**
500
1256
  * A Stacks transaction as a hex-encoded string.
501
1257
  */
502
- transaction: v6.string()
1258
+ transaction: v17.string()
503
1259
  });
504
- var stxDeployContractRequestMessageSchema = v6.object({
1260
+ var stxDeployContractRequestMessageSchema = v17.object({
505
1261
  ...rpcRequestMessageSchema.entries,
506
- ...v6.object({
507
- method: v6.literal(stxDeployContractMethodName),
1262
+ ...v17.object({
1263
+ method: v17.literal(stxDeployContractMethodName),
508
1264
  params: stxDeployContractParamsSchema,
509
- id: v6.string()
510
- }).entries
511
- });
512
-
513
- // src/request/types/stxMethods/getAccounts.ts
514
- var v8 = __toESM(require("valibot"));
515
-
516
- // src/request/types/walletMethods.ts
517
- var v7 = __toESM(require("valibot"));
518
- var accountActionsSchema = v7.object({
519
- read: v7.optional(v7.boolean())
520
- });
521
- var walletActionsSchema = v7.object({
522
- readNetwork: v7.optional(v7.boolean())
523
- });
524
- var accountPermissionSchema = v7.object({
525
- type: v7.literal("account"),
526
- resourceId: v7.string(),
527
- clientId: v7.string(),
528
- actions: accountActionsSchema
529
- });
530
- var walletPermissionSchema = v7.object({
531
- type: v7.literal("wallet"),
532
- resourceId: v7.string(),
533
- clientId: v7.string(),
534
- actions: walletActionsSchema
535
- });
536
- var PermissionRequestParams = v7.variant("type", [
537
- v7.object({
538
- ...v7.omit(accountPermissionSchema, ["clientId"]).entries
539
- }),
540
- v7.object({
541
- ...v7.omit(walletPermissionSchema, ["clientId"]).entries
542
- })
543
- ]);
544
- var permission = v7.variant("type", [accountPermissionSchema, walletPermissionSchema]);
545
- var requestPermissionsMethodName = "wallet_requestPermissions";
546
- var requestPermissionsParamsSchema = v7.nullish(v7.array(PermissionRequestParams));
547
- var requestPermissionsResultSchema = v7.literal(true);
548
- var requestPermissionsRequestMessageSchema = v7.object({
549
- ...rpcRequestMessageSchema.entries,
550
- ...v7.object({
551
- method: v7.literal(requestPermissionsMethodName),
552
- params: requestPermissionsParamsSchema,
553
- id: v7.string()
554
- }).entries
555
- });
556
- var renouncePermissionsMethodName = "wallet_renouncePermissions";
557
- var renouncePermissionsParamsSchema = v7.nullish(v7.null());
558
- var renouncePermissionsResultSchema = v7.nullish(v7.null());
559
- var renouncePermissionsRequestMessageSchema = v7.object({
560
- ...rpcRequestMessageSchema.entries,
561
- ...v7.object({
562
- method: v7.literal(renouncePermissionsMethodName),
563
- params: renouncePermissionsParamsSchema,
564
- id: v7.string()
565
- }).entries
566
- });
567
- var disconnectMethodName = "wallet_disconnect";
568
- var disconnectParamsSchema = v7.nullish(v7.null());
569
- var disconnectResultSchema = v7.nullish(v7.null());
570
- var disconnectRequestMessageSchema = v7.object({
571
- ...rpcRequestMessageSchema.entries,
572
- ...v7.object({
573
- method: v7.literal(disconnectMethodName),
574
- params: disconnectParamsSchema,
575
- id: v7.string()
576
- }).entries
577
- });
578
- var getWalletTypeMethodName = "wallet_getWalletType";
579
- var getWalletTypeParamsSchema = v7.nullish(v7.null());
580
- var getWalletTypeResultSchema = walletTypeSchema;
581
- var getWalletTypeRequestMessageSchema = v7.object({
582
- ...rpcRequestMessageSchema.entries,
583
- ...v7.object({
584
- method: v7.literal(getWalletTypeMethodName),
585
- params: getWalletTypeParamsSchema,
586
- id: v7.string()
587
- }).entries
588
- });
589
- var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
590
- var getCurrentPermissionsParamsSchema = v7.nullish(v7.null());
591
- var getCurrentPermissionsResultSchema = v7.array(permission);
592
- var getCurrentPermissionsRequestMessageSchema = v7.object({
593
- ...rpcRequestMessageSchema.entries,
594
- ...v7.object({
595
- method: v7.literal(getCurrentPermissionsMethodName),
596
- params: getCurrentPermissionsParamsSchema,
597
- id: v7.string()
598
- }).entries
599
- });
600
- var getNetworkMethodName = "wallet_getNetwork";
601
- var getNetworkParamsSchema = v7.nullish(v7.null());
602
- var getNetworkResultSchema = v7.object({
603
- bitcoin: v7.object({
604
- name: v7.enum(BitcoinNetworkType)
605
- }),
606
- stacks: v7.object({
607
- name: v7.string()
608
- })
609
- });
610
- var getNetworkRequestMessageSchema = v7.object({
611
- ...rpcRequestMessageSchema.entries,
612
- ...v7.object({
613
- method: v7.literal(getNetworkMethodName),
614
- params: getNetworkParamsSchema,
615
- id: v7.string()
616
- }).entries
617
- });
618
- var changeNetworkMethodName = "wallet_changeNetwork";
619
- var changeNetworkParamsSchema = v7.object({
620
- name: v7.enum(BitcoinNetworkType)
621
- });
622
- var changeNetworkResultSchema = v7.nullish(v7.null());
623
- var changeNetworkRequestMessageSchema = v7.object({
624
- ...rpcRequestMessageSchema.entries,
625
- ...v7.object({
626
- method: v7.literal(changeNetworkMethodName),
627
- params: changeNetworkParamsSchema,
628
- id: v7.string()
629
- }).entries
630
- });
631
- var changeNetworkByIdMethodName = "wallet_changeNetworkById";
632
- var changeNetworkByIdParamsSchema = v7.object({
633
- id: v7.string()
634
- });
635
- var changeNetworkByIdResultSchema = v7.nullish(v7.null());
636
- var changeNetworkByIdRequestMessageSchema = v7.object({
637
- ...rpcRequestMessageSchema.entries,
638
- ...v7.object({
639
- method: v7.literal(changeNetworkByIdMethodName),
640
- params: changeNetworkByIdParamsSchema,
641
- id: v7.string()
642
- }).entries
643
- });
644
- var getAccountMethodName = "wallet_getAccount";
645
- var getAccountParamsSchema = v7.nullish(v7.null());
646
- var getAccountResultSchema = v7.object({
647
- id: v7.string(),
648
- addresses: v7.array(addressSchema),
649
- walletType: walletTypeSchema,
650
- network: getNetworkResultSchema
651
- });
652
- var getAccountRequestMessageSchema = v7.object({
653
- ...rpcRequestMessageSchema.entries,
654
- ...v7.object({
655
- method: v7.literal(getAccountMethodName),
656
- params: getAccountParamsSchema,
657
- id: v7.string()
658
- }).entries
659
- });
660
- var connectMethodName = "wallet_connect";
661
- var connectParamsSchema = v7.nullish(
662
- v7.object({
663
- permissions: v7.optional(v7.array(PermissionRequestParams)),
664
- addresses: v7.optional(v7.array(v7.enum(AddressPurpose))),
665
- message: v7.optional(
666
- v7.pipe(v7.string(), v7.maxLength(80, "The message must not exceed 80 characters."))
667
- ),
668
- network: v7.optional(v7.enum(BitcoinNetworkType))
669
- })
670
- );
671
- var connectResultSchema = v7.object({
672
- id: v7.string(),
673
- addresses: v7.array(addressSchema),
674
- walletType: walletTypeSchema,
675
- network: getNetworkResultSchema
676
- });
677
- var connectRequestMessageSchema = v7.object({
678
- ...rpcRequestMessageSchema.entries,
679
- ...v7.object({
680
- method: v7.literal(connectMethodName),
681
- params: connectParamsSchema,
682
- id: v7.string()
683
- }).entries
684
- });
685
- var addNetworkMethodName = "wallet_addNetwork";
686
- var addNetworkParamsSchema = v7.variant("chain", [
687
- v7.object({
688
- chain: v7.literal("bitcoin"),
689
- type: v7.enum(BitcoinNetworkType),
690
- name: v7.string(),
691
- rpcUrl: v7.string(),
692
- rpcFallbackUrl: v7.optional(v7.string()),
693
- indexerUrl: v7.optional(v7.string()),
694
- blockExplorerUrl: v7.optional(v7.string()),
695
- switch: v7.optional(v7.boolean())
696
- }),
697
- v7.object({
698
- chain: v7.literal("stacks"),
699
- name: v7.string(),
700
- type: v7.enum(StacksNetworkType),
701
- rpcUrl: v7.string(),
702
- blockExplorerUrl: v7.optional(v7.string()),
703
- switch: v7.optional(v7.boolean())
704
- }),
705
- v7.object({
706
- chain: v7.literal("starknet"),
707
- name: v7.string(),
708
- type: v7.enum(StarknetNetworkType),
709
- rpcUrl: v7.string(),
710
- blockExplorerUrl: v7.optional(v7.string()),
711
- switch: v7.optional(v7.boolean())
712
- })
713
- ]);
714
- var addNetworkRequestMessageSchema = v7.object({
715
- ...rpcRequestMessageSchema.entries,
716
- ...v7.object({
717
- method: v7.literal(addNetworkMethodName),
718
- params: addNetworkParamsSchema,
719
- id: v7.string()
1265
+ id: v17.string()
720
1266
  }).entries
721
1267
  });
722
- var addNetworkResultSchema = v7.object({
723
- id: v7.string()
724
- });
725
1268
 
726
1269
  // src/request/types/stxMethods/getAccounts.ts
1270
+ var v18 = __toESM(require("valibot"));
727
1271
  var stxGetAccountsMethodName = "stx_getAccounts";
728
- var stxGetAccountsParamsSchema = v8.nullish(v8.null());
729
- var stxGetAccountsResultSchema = v8.object({
1272
+ var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1273
+ var stxGetAccountsResultSchema = v18.object({
730
1274
  /**
731
1275
  * The addresses generated for the given purposes.
732
1276
  */
733
- addresses: v8.array(
734
- v8.object({
735
- address: v8.string(),
736
- publicKey: v8.string(),
737
- gaiaHubUrl: v8.string(),
738
- gaiaAppKey: v8.string()
1277
+ addresses: v18.array(
1278
+ v18.object({
1279
+ address: v18.string(),
1280
+ publicKey: v18.string(),
1281
+ gaiaHubUrl: v18.string(),
1282
+ gaiaAppKey: v18.string()
739
1283
  })
740
1284
  ),
741
1285
  network: getNetworkResultSchema
742
1286
  });
743
- var stxGetAccountsRequestMessageSchema = v8.object({
1287
+ var stxGetAccountsRequestMessageSchema = v18.object({
744
1288
  ...rpcRequestMessageSchema.entries,
745
- ...v8.object({
746
- method: v8.literal(stxGetAccountsMethodName),
1289
+ ...v18.object({
1290
+ method: v18.literal(stxGetAccountsMethodName),
747
1291
  params: stxGetAccountsParamsSchema,
748
- id: v8.string()
1292
+ id: v18.string()
749
1293
  }).entries
750
1294
  });
751
1295
 
752
1296
  // src/request/types/stxMethods/getAddresses.ts
753
- var v9 = __toESM(require("valibot"));
1297
+ var v19 = __toESM(require("valibot"));
754
1298
  var stxGetAddressesMethodName = "stx_getAddresses";
755
- var stxGetAddressesParamsSchema = v9.nullish(
756
- v9.object({
1299
+ var stxGetAddressesParamsSchema = v19.nullish(
1300
+ v19.object({
757
1301
  /**
758
1302
  * A message to be displayed to the user in the request prompt.
759
1303
  */
760
- message: v9.optional(v9.string())
1304
+ message: v19.optional(v19.string())
761
1305
  })
762
1306
  );
763
- var stxGetAddressesResultSchema = v9.object({
1307
+ var stxGetAddressesResultSchema = v19.object({
764
1308
  /**
765
1309
  * The addresses generated for the given purposes.
766
1310
  */
767
- addresses: v9.array(addressSchema),
1311
+ addresses: v19.array(addressSchema),
768
1312
  network: getNetworkResultSchema
769
1313
  });
770
- var stxGetAddressesRequestMessageSchema = v9.object({
1314
+ var stxGetAddressesRequestMessageSchema = v19.object({
771
1315
  ...rpcRequestMessageSchema.entries,
772
- ...v9.object({
773
- method: v9.literal(stxGetAddressesMethodName),
1316
+ ...v19.object({
1317
+ method: v19.literal(stxGetAddressesMethodName),
774
1318
  params: stxGetAddressesParamsSchema,
775
- id: v9.string()
1319
+ id: v19.string()
776
1320
  }).entries
777
1321
  });
778
1322
 
779
1323
  // src/request/types/stxMethods/signMessage.ts
780
- var v10 = __toESM(require("valibot"));
1324
+ var v20 = __toESM(require("valibot"));
781
1325
  var stxSignMessageMethodName = "stx_signMessage";
782
- var stxSignMessageParamsSchema = v10.object({
1326
+ var stxSignMessageParamsSchema = v20.object({
783
1327
  /**
784
1328
  * The message to sign.
785
1329
  */
786
- message: v10.string()
1330
+ message: v20.string()
787
1331
  });
788
- var stxSignMessageResultSchema = v10.object({
1332
+ var stxSignMessageResultSchema = v20.object({
789
1333
  /**
790
1334
  * The signature of the message.
791
1335
  */
792
- signature: v10.string(),
1336
+ signature: v20.string(),
793
1337
  /**
794
1338
  * The public key used to sign the message.
795
1339
  */
796
- publicKey: v10.string()
1340
+ publicKey: v20.string()
797
1341
  });
798
- var stxSignMessageRequestMessageSchema = v10.object({
1342
+ var stxSignMessageRequestMessageSchema = v20.object({
799
1343
  ...rpcRequestMessageSchema.entries,
800
- ...v10.object({
801
- method: v10.literal(stxSignMessageMethodName),
1344
+ ...v20.object({
1345
+ method: v20.literal(stxSignMessageMethodName),
802
1346
  params: stxSignMessageParamsSchema,
803
- id: v10.string()
1347
+ id: v20.string()
804
1348
  }).entries
805
1349
  });
806
1350
 
807
1351
  // src/request/types/stxMethods/signStructuredMessage.ts
808
- var v11 = __toESM(require("valibot"));
1352
+ var v21 = __toESM(require("valibot"));
809
1353
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
810
- var stxSignStructuredMessageParamsSchema = v11.object({
1354
+ var stxSignStructuredMessageParamsSchema = v21.object({
811
1355
  /**
812
1356
  * The domain to be signed.
813
1357
  */
814
- domain: v11.string(),
1358
+ domain: v21.string(),
815
1359
  /**
816
1360
  * Message payload to be signed.
817
1361
  */
818
- message: v11.string(),
1362
+ message: v21.string(),
819
1363
  /**
820
1364
  * The public key to sign the message with.
821
1365
  */
822
- publicKey: v11.optional(v11.string())
1366
+ publicKey: v21.optional(v21.string())
823
1367
  });
824
- var stxSignStructuredMessageResultSchema = v11.object({
1368
+ var stxSignStructuredMessageResultSchema = v21.object({
825
1369
  /**
826
1370
  * Signature of the message.
827
1371
  */
828
- signature: v11.string(),
1372
+ signature: v21.string(),
829
1373
  /**
830
1374
  * Public key as hex-encoded string.
831
1375
  */
832
- publicKey: v11.string()
1376
+ publicKey: v21.string()
833
1377
  });
834
- var stxSignStructuredMessageRequestMessageSchema = v11.object({
1378
+ var stxSignStructuredMessageRequestMessageSchema = v21.object({
835
1379
  ...rpcRequestMessageSchema.entries,
836
- ...v11.object({
837
- method: v11.literal(stxSignStructuredMessageMethodName),
1380
+ ...v21.object({
1381
+ method: v21.literal(stxSignStructuredMessageMethodName),
838
1382
  params: stxSignStructuredMessageParamsSchema,
839
- id: v11.string()
1383
+ id: v21.string()
840
1384
  }).entries
841
1385
  });
842
1386
 
843
1387
  // src/request/types/stxMethods/signTransaction.ts
844
- var v12 = __toESM(require("valibot"));
1388
+ var v22 = __toESM(require("valibot"));
845
1389
  var stxSignTransactionMethodName = "stx_signTransaction";
846
- var stxSignTransactionParamsSchema = v12.object({
1390
+ var stxSignTransactionParamsSchema = v22.object({
847
1391
  /**
848
1392
  * The transaction to sign as a hex-encoded string.
849
1393
  */
850
- transaction: v12.string(),
1394
+ transaction: v22.string(),
851
1395
  /**
852
1396
  * The public key to sign the transaction with. The wallet may use any key
853
1397
  * when not provided.
854
1398
  */
855
- pubkey: v12.optional(v12.string()),
1399
+ pubkey: v22.optional(v22.string()),
856
1400
  /**
857
1401
  * Whether to broadcast the transaction after signing. Defaults to `true`.
858
1402
  */
859
- broadcast: v12.optional(v12.boolean())
1403
+ broadcast: v22.optional(v22.boolean())
860
1404
  });
861
- var stxSignTransactionResultSchema = v12.object({
1405
+ var stxSignTransactionResultSchema = v22.object({
862
1406
  /**
863
1407
  * The signed transaction as a hex-encoded string.
864
1408
  */
865
- transaction: v12.string()
1409
+ transaction: v22.string()
866
1410
  });
867
- var stxSignTransactionRequestMessageSchema = v12.object({
1411
+ var stxSignTransactionRequestMessageSchema = v22.object({
868
1412
  ...rpcRequestMessageSchema.entries,
869
- ...v12.object({
870
- method: v12.literal(stxSignTransactionMethodName),
1413
+ ...v22.object({
1414
+ method: v22.literal(stxSignTransactionMethodName),
871
1415
  params: stxSignTransactionParamsSchema,
872
- id: v12.string()
1416
+ id: v22.string()
873
1417
  }).entries
874
1418
  });
875
1419
 
876
1420
  // src/request/types/stxMethods/signTransactions.ts
877
- var v13 = __toESM(require("valibot"));
1421
+ var v23 = __toESM(require("valibot"));
878
1422
  var stxSignTransactionsMethodName = "stx_signTransactions";
879
- var stxSignTransactionsParamsSchema = v13.object({
1423
+ var stxSignTransactionsParamsSchema = v23.object({
880
1424
  /**
881
1425
  * The transactions to sign as hex-encoded strings.
882
1426
  */
883
- transactions: v13.pipe(
884
- v13.array(
885
- v13.pipe(
886
- v13.string(),
887
- v13.check((hex) => {
1427
+ transactions: v23.pipe(
1428
+ v23.array(
1429
+ v23.pipe(
1430
+ v23.string(),
1431
+ v23.check((hex) => {
888
1432
  return true;
889
1433
  }, "Invalid hex-encoded Stacks transaction.")
890
1434
  )
891
1435
  ),
892
- v13.minLength(1)
1436
+ v23.minLength(1)
893
1437
  ),
894
1438
  /**
895
1439
  * Whether the signed transactions should be broadcast after signing. Defaults
896
1440
  * to `true`.
897
1441
  */
898
- broadcast: v13.optional(v13.boolean())
1442
+ broadcast: v23.optional(v23.boolean())
899
1443
  });
900
- var stxSignTransactionsResultSchema = v13.object({
1444
+ var stxSignTransactionsResultSchema = v23.object({
901
1445
  /**
902
1446
  * The signed transactions as hex-encoded strings, in the same order as in the
903
1447
  * sign request.
904
1448
  */
905
- transactions: v13.array(v13.string())
1449
+ transactions: v23.array(v23.string())
906
1450
  });
907
- var stxSignTransactionsRequestMessageSchema = v13.object({
1451
+ var stxSignTransactionsRequestMessageSchema = v23.object({
908
1452
  ...rpcRequestMessageSchema.entries,
909
- ...v13.object({
910
- method: v13.literal(stxSignTransactionsMethodName),
1453
+ ...v23.object({
1454
+ method: v23.literal(stxSignTransactionsMethodName),
911
1455
  params: stxSignTransactionsParamsSchema,
912
- id: v13.string()
1456
+ id: v23.string()
913
1457
  }).entries
914
1458
  });
915
1459
 
916
1460
  // src/request/types/stxMethods/transferStx.ts
917
- var v14 = __toESM(require("valibot"));
1461
+ var v24 = __toESM(require("valibot"));
918
1462
  var stxTransferStxMethodName = "stx_transferStx";
919
- var stxTransferStxParamsSchema = v14.object({
1463
+ var stxTransferStxParamsSchema = v24.object({
920
1464
  /**
921
1465
  * Amount of STX tokens to transfer in microstacks as a string. Anything
922
1466
  * parseable by `BigInt` is acceptable.
@@ -929,23 +1473,23 @@ var stxTransferStxParamsSchema = v14.object({
929
1473
  * const amount3 = '1234';
930
1474
  * ```
931
1475
  */
932
- amount: v14.union([v14.number(), v14.string()]),
1476
+ amount: v24.union([v24.number(), v24.string()]),
933
1477
  /**
934
- * The recipeint's principal.
1478
+ * The recipient's principal.
935
1479
  */
936
- recipient: v14.string(),
1480
+ recipient: v24.string(),
937
1481
  /**
938
1482
  * A string representing the memo.
939
1483
  */
940
- memo: v14.optional(v14.string()),
1484
+ memo: v24.optional(v24.string()),
941
1485
  /**
942
1486
  * Version of parameter format.
943
1487
  */
944
- version: v14.optional(v14.string()),
1488
+ version: v24.optional(v24.string()),
945
1489
  /**
946
1490
  * The mode of the post conditions.
947
1491
  */
948
- postConditionMode: v14.optional(v14.number()),
1492
+ postConditionMode: v24.optional(v24.number()),
949
1493
  /**
950
1494
  * A hex-encoded string representing the post conditions.
951
1495
  *
@@ -958,425 +1502,29 @@ var stxTransferStxParamsSchema = v14.object({
958
1502
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
959
1503
  * ```
960
1504
  */
961
- postConditions: v14.optional(v14.array(v14.string())),
1505
+ postConditions: v24.optional(v24.array(v24.string())),
962
1506
  /**
963
1507
  * The public key to sign the transaction with. The wallet may use any key
964
1508
  * when not provided.
965
1509
  */
966
- pubkey: v14.optional(v14.string())
1510
+ pubkey: v24.optional(v24.string())
967
1511
  });
968
- var stxTransferStxResultSchema = v14.object({
1512
+ var stxTransferStxResultSchema = v24.object({
969
1513
  /**
970
1514
  * The ID of the transaction.
971
1515
  */
972
- txid: v14.string(),
1516
+ txid: v24.string(),
973
1517
  /**
974
1518
  * A Stacks transaction as a hex-encoded string.
975
1519
  */
976
- transaction: v14.string()
1520
+ transaction: v24.string()
977
1521
  });
978
- var stxTransferStxRequestMessageSchema = v14.object({
1522
+ var stxTransferStxRequestMessageSchema = v24.object({
979
1523
  ...rpcRequestMessageSchema.entries,
980
- ...v14.object({
981
- method: v14.literal(stxTransferStxMethodName),
1524
+ ...v24.object({
1525
+ method: v24.literal(stxTransferStxMethodName),
982
1526
  params: stxTransferStxParamsSchema,
983
- id: v14.string()
984
- }).entries
985
- });
986
-
987
- // src/request/types/btcMethods.ts
988
- var v15 = __toESM(require("valibot"));
989
- var getInfoMethodName = "getInfo";
990
- var getInfoParamsSchema = v15.nullish(v15.null());
991
- var getInfoResultSchema = v15.object({
992
- /**
993
- * Version of the wallet.
994
- */
995
- version: v15.string(),
996
- /**
997
- * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
998
- */
999
- methods: v15.optional(v15.array(v15.string())),
1000
- /**
1001
- * List of WBIP standards supported by the wallet. Not currently used.
1002
- */
1003
- supports: v15.array(v15.string())
1004
- });
1005
- var getInfoRequestMessageSchema = v15.object({
1006
- ...rpcRequestMessageSchema.entries,
1007
- ...v15.object({
1008
- method: v15.literal(getInfoMethodName),
1009
- params: getInfoParamsSchema,
1010
- id: v15.string()
1011
- }).entries
1012
- });
1013
- var getAddressesMethodName = "getAddresses";
1014
- var getAddressesParamsSchema = v15.object({
1015
- /**
1016
- * The purposes for which to generate addresses. See
1017
- * {@linkcode AddressPurpose} for available purposes.
1018
- */
1019
- purposes: v15.array(v15.enum(AddressPurpose)),
1020
- /**
1021
- * A message to be displayed to the user in the request prompt.
1022
- */
1023
- message: v15.optional(v15.string())
1024
- });
1025
- var getAddressesResultSchema = v15.object({
1026
- /**
1027
- * The addresses generated for the given purposes.
1028
- */
1029
- addresses: v15.array(addressSchema),
1030
- network: getNetworkResultSchema
1031
- });
1032
- var getAddressesRequestMessageSchema = v15.object({
1033
- ...rpcRequestMessageSchema.entries,
1034
- ...v15.object({
1035
- method: v15.literal(getAddressesMethodName),
1036
- params: getAddressesParamsSchema,
1037
- id: v15.string()
1038
- }).entries
1039
- });
1040
- var signMessageMethodName = "signMessage";
1041
- var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
1042
- MessageSigningProtocols2["ECDSA"] = "ECDSA";
1043
- MessageSigningProtocols2["BIP322"] = "BIP322";
1044
- return MessageSigningProtocols2;
1045
- })(MessageSigningProtocols || {});
1046
- var signMessageParamsSchema = v15.object({
1047
- /**
1048
- * The address used for signing.
1049
- **/
1050
- address: v15.string(),
1051
- /**
1052
- * The message to sign.
1053
- **/
1054
- message: v15.string(),
1055
- /**
1056
- * The protocol to use for signing the message.
1057
- */
1058
- protocol: v15.optional(v15.enum(MessageSigningProtocols))
1059
- });
1060
- var signMessageResultSchema = v15.object({
1061
- /**
1062
- * The signature of the message.
1063
- */
1064
- signature: v15.string(),
1065
- /**
1066
- * hash of the message.
1067
- */
1068
- messageHash: v15.string(),
1069
- /**
1070
- * The address used for signing.
1071
- */
1072
- address: v15.string(),
1073
- /**
1074
- * The protocol to use for signing the message.
1075
- */
1076
- protocol: v15.enum(MessageSigningProtocols)
1077
- });
1078
- var signMessageRequestMessageSchema = v15.object({
1079
- ...rpcRequestMessageSchema.entries,
1080
- ...v15.object({
1081
- method: v15.literal(signMessageMethodName),
1082
- params: signMessageParamsSchema,
1083
- id: v15.string()
1084
- }).entries
1085
- });
1086
- var sendTransferMethodName = "sendTransfer";
1087
- var sendTransferParamsSchema = v15.object({
1088
- /**
1089
- * Array of recipients to send to.
1090
- * The amount to send to each recipient is in satoshis.
1091
- */
1092
- recipients: v15.array(
1093
- v15.object({
1094
- address: v15.string(),
1095
- amount: v15.number()
1096
- })
1097
- )
1098
- });
1099
- var sendTransferResultSchema = v15.object({
1100
- /**
1101
- * The transaction id as a hex-encoded string.
1102
- */
1103
- txid: v15.string()
1104
- });
1105
- var sendTransferRequestMessageSchema = v15.object({
1106
- ...rpcRequestMessageSchema.entries,
1107
- ...v15.object({
1108
- method: v15.literal(sendTransferMethodName),
1109
- params: sendTransferParamsSchema,
1110
- id: v15.string()
1111
- }).entries
1112
- });
1113
- var signPsbtMethodName = "signPsbt";
1114
- var signPsbtParamsSchema = v15.object({
1115
- /**
1116
- * The base64 encoded PSBT to sign.
1117
- */
1118
- psbt: v15.string(),
1119
- /**
1120
- * The inputs to sign.
1121
- * The key is the address and the value is an array of indexes of the inputs to sign.
1122
- */
1123
- signInputs: v15.optional(v15.record(v15.string(), v15.array(v15.number()))),
1124
- /**
1125
- * Whether to broadcast the transaction after signing.
1126
- **/
1127
- broadcast: v15.optional(v15.boolean())
1128
- });
1129
- var signPsbtResultSchema = v15.object({
1130
- /**
1131
- * The base64 encoded PSBT after signing.
1132
- */
1133
- psbt: v15.string(),
1134
- /**
1135
- * The transaction id as a hex-encoded string.
1136
- * This is only returned if the transaction was broadcast.
1137
- **/
1138
- txid: v15.optional(v15.string())
1139
- });
1140
- var signPsbtRequestMessageSchema = v15.object({
1141
- ...rpcRequestMessageSchema.entries,
1142
- ...v15.object({
1143
- method: v15.literal(signPsbtMethodName),
1144
- params: signPsbtParamsSchema,
1145
- id: v15.string()
1146
- }).entries
1147
- });
1148
- var getAccountsMethodName = "getAccounts";
1149
- var getAccountsParamsSchema = v15.object({
1150
- /**
1151
- * The purposes for which to generate addresses. See
1152
- * {@linkcode AddressPurpose} for available purposes.
1153
- */
1154
- purposes: v15.array(v15.enum(AddressPurpose)),
1155
- /**
1156
- * A message to be displayed to the user in the request prompt.
1157
- */
1158
- message: v15.optional(v15.string())
1159
- });
1160
- var getAccountsResultSchema = v15.array(
1161
- v15.object({
1162
- ...addressSchema.entries,
1163
- ...v15.object({
1164
- walletType: walletTypeSchema
1165
- }).entries
1166
- })
1167
- );
1168
- var getAccountsRequestMessageSchema = v15.object({
1169
- ...rpcRequestMessageSchema.entries,
1170
- ...v15.object({
1171
- method: v15.literal(getAccountsMethodName),
1172
- params: getAccountsParamsSchema,
1173
- id: v15.string()
1174
- }).entries
1175
- });
1176
- var getBalanceMethodName = "getBalance";
1177
- var getBalanceParamsSchema = v15.nullish(v15.null());
1178
- var getBalanceResultSchema = v15.object({
1179
- /**
1180
- * The confirmed balance of the wallet in sats. Using a string due to chrome
1181
- * messages not supporting bigint
1182
- * (https://issues.chromium.org/issues/40116184).
1183
- */
1184
- confirmed: v15.string(),
1185
- /**
1186
- * The unconfirmed balance of the wallet in sats. Using a string due to chrome
1187
- * messages not supporting bigint
1188
- * (https://issues.chromium.org/issues/40116184).
1189
- */
1190
- unconfirmed: v15.string(),
1191
- /**
1192
- * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
1193
- * sats. Using a string due to chrome messages not supporting bigint
1194
- * (https://issues.chromium.org/issues/40116184).
1195
- */
1196
- total: v15.string()
1197
- });
1198
- var getBalanceRequestMessageSchema = v15.object({
1199
- ...rpcRequestMessageSchema.entries,
1200
- ...v15.object({
1201
- method: v15.literal(getBalanceMethodName),
1202
- id: v15.string()
1203
- }).entries
1204
- });
1205
-
1206
- // src/request/types/runesMethods/etch.ts
1207
- var v16 = __toESM(require("valibot"));
1208
- var runesEtchMethodName = "runes_etch";
1209
- var etchTermsSchema = v16.object({
1210
- amount: v16.string(),
1211
- cap: v16.string(),
1212
- heightStart: v16.optional(v16.string()),
1213
- heightEnd: v16.optional(v16.string()),
1214
- offsetStart: v16.optional(v16.string()),
1215
- offsetEnd: v16.optional(v16.string())
1216
- });
1217
- var inscriptionDetailsSchema = v16.object({
1218
- contentType: v16.string(),
1219
- contentBase64: v16.string()
1220
- });
1221
- var runesEtchParamsSchema = v16.object({
1222
- runeName: v16.string(),
1223
- divisibility: v16.optional(v16.number()),
1224
- symbol: v16.optional(v16.string()),
1225
- premine: v16.optional(v16.string()),
1226
- isMintable: v16.boolean(),
1227
- delegateInscriptionId: v16.optional(v16.string()),
1228
- destinationAddress: v16.string(),
1229
- refundAddress: v16.string(),
1230
- feeRate: v16.number(),
1231
- appServiceFee: v16.optional(v16.number()),
1232
- appServiceFeeAddress: v16.optional(v16.string()),
1233
- terms: v16.optional(etchTermsSchema),
1234
- inscriptionDetails: v16.optional(inscriptionDetailsSchema),
1235
- network: v16.optional(v16.enum(BitcoinNetworkType))
1236
- });
1237
- var runesEtchResultSchema = v16.object({
1238
- orderId: v16.string(),
1239
- fundTransactionId: v16.string(),
1240
- fundingAddress: v16.string()
1241
- });
1242
- var runesEtchRequestMessageSchema = v16.object({
1243
- ...rpcRequestMessageSchema.entries,
1244
- ...v16.object({
1245
- method: v16.literal(runesEtchMethodName),
1246
- params: runesEtchParamsSchema,
1247
- id: v16.string()
1248
- }).entries
1249
- });
1250
-
1251
- // src/request/types/runesMethods/getBalance.ts
1252
- var v17 = __toESM(require("valibot"));
1253
- var runesGetBalanceMethodName = "runes_getBalance";
1254
- var runesGetBalanceParamsSchema = v17.nullish(v17.null());
1255
- var runesGetBalanceResultSchema = v17.object({
1256
- balances: v17.array(
1257
- v17.object({
1258
- runeName: v17.string(),
1259
- amount: v17.string(),
1260
- divisibility: v17.number(),
1261
- symbol: v17.string(),
1262
- inscriptionId: v17.nullish(v17.string()),
1263
- spendableBalance: v17.string()
1264
- })
1265
- )
1266
- });
1267
- var runesGetBalanceRequestMessageSchema = v17.object({
1268
- ...rpcRequestMessageSchema.entries,
1269
- ...v17.object({
1270
- method: v17.literal(runesGetBalanceMethodName),
1271
- params: runesGetBalanceParamsSchema,
1272
- id: v17.string()
1273
- }).entries
1274
- });
1275
-
1276
- // src/request/types/runesMethods/mint.ts
1277
- var v18 = __toESM(require("valibot"));
1278
- var runesMintMethodName = "runes_mint";
1279
- var runesMintParamsSchema = v18.object({
1280
- appServiceFee: v18.optional(v18.number()),
1281
- appServiceFeeAddress: v18.optional(v18.string()),
1282
- destinationAddress: v18.string(),
1283
- feeRate: v18.number(),
1284
- refundAddress: v18.string(),
1285
- repeats: v18.number(),
1286
- runeName: v18.string(),
1287
- network: v18.optional(v18.enum(BitcoinNetworkType))
1288
- });
1289
- var runesMintResultSchema = v18.object({
1290
- orderId: v18.string(),
1291
- fundTransactionId: v18.string(),
1292
- fundingAddress: v18.string()
1293
- });
1294
- var runesMintRequestMessageSchema = v18.object({
1295
- ...rpcRequestMessageSchema.entries,
1296
- ...v18.object({
1297
- method: v18.literal(runesMintMethodName),
1298
- params: runesMintParamsSchema,
1299
- id: v18.string()
1300
- }).entries
1301
- });
1302
-
1303
- // src/request/types/runesMethods/transfer.ts
1304
- var v19 = __toESM(require("valibot"));
1305
- var runesTransferMethodName = "runes_transfer";
1306
- var runesTransferParamsSchema = v19.object({
1307
- recipients: v19.array(
1308
- v19.object({
1309
- runeName: v19.string(),
1310
- amount: v19.string(),
1311
- address: v19.string()
1312
- })
1313
- )
1314
- });
1315
- var runesTransferResultSchema = v19.object({
1316
- txid: v19.string()
1317
- });
1318
- var runesTransferRequestMessageSchema = v19.object({
1319
- ...rpcRequestMessageSchema.entries,
1320
- ...v19.object({
1321
- method: v19.literal(runesTransferMethodName),
1322
- params: runesTransferParamsSchema,
1323
- id: v19.string()
1324
- }).entries
1325
- });
1326
-
1327
- // src/request/types/ordinalsMethods.ts
1328
- var v20 = __toESM(require("valibot"));
1329
- var getInscriptionsMethodName = "ord_getInscriptions";
1330
- var getInscriptionsParamsSchema = v20.object({
1331
- offset: v20.number(),
1332
- limit: v20.number()
1333
- });
1334
- var getInscriptionsResultSchema = v20.object({
1335
- total: v20.number(),
1336
- limit: v20.number(),
1337
- offset: v20.number(),
1338
- inscriptions: v20.array(
1339
- v20.object({
1340
- inscriptionId: v20.string(),
1341
- inscriptionNumber: v20.string(),
1342
- address: v20.string(),
1343
- collectionName: v20.optional(v20.string()),
1344
- postage: v20.string(),
1345
- contentLength: v20.string(),
1346
- contentType: v20.string(),
1347
- timestamp: v20.number(),
1348
- offset: v20.number(),
1349
- genesisTransaction: v20.string(),
1350
- output: v20.string()
1351
- })
1352
- )
1353
- });
1354
- var getInscriptionsRequestMessageSchema = v20.object({
1355
- ...rpcRequestMessageSchema.entries,
1356
- ...v20.object({
1357
- method: v20.literal(getInscriptionsMethodName),
1358
- params: getInscriptionsParamsSchema,
1359
- id: v20.string()
1360
- }).entries
1361
- });
1362
- var sendInscriptionsMethodName = "ord_sendInscriptions";
1363
- var sendInscriptionsParamsSchema = v20.object({
1364
- transfers: v20.array(
1365
- v20.object({
1366
- address: v20.string(),
1367
- inscriptionId: v20.string()
1368
- })
1369
- )
1370
- });
1371
- var sendInscriptionsResultSchema = v20.object({
1372
- txid: v20.string()
1373
- });
1374
- var sendInscriptionsRequestMessageSchema = v20.object({
1375
- ...rpcRequestMessageSchema.entries,
1376
- ...v20.object({
1377
- method: v20.literal(sendInscriptionsMethodName),
1378
- params: sendInscriptionsParamsSchema,
1379
- id: v20.string()
1527
+ id: v24.string()
1380
1528
  }).entries
1381
1529
  });
1382
1530
 
@@ -1393,13 +1541,13 @@ var request = async (method, params, providerId) => {
1393
1541
  throw new Error("A wallet method is required");
1394
1542
  }
1395
1543
  const response = await provider.request(method, params);
1396
- if (v21.is(rpcErrorResponseMessageSchema, response)) {
1544
+ if (v25.is(rpcErrorResponseMessageSchema, response)) {
1397
1545
  return {
1398
1546
  status: "error",
1399
1547
  error: response.error
1400
1548
  };
1401
1549
  }
1402
- if (v21.is(rpcSuccessResponseMessageSchema, response)) {
1550
+ if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1403
1551
  return {
1404
1552
  status: "success",
1405
1553
  result: response.result
@@ -1414,7 +1562,37 @@ var request = async (method, params, providerId) => {
1414
1562
  }
1415
1563
  };
1416
1564
  };
1417
- var addListener = (listenerInfo, providerId) => {
1565
+ var addListener = (...rawArgs) => {
1566
+ const [listenerInfo, providerId] = (() => {
1567
+ if (rawArgs.length === 1) {
1568
+ return [rawArgs[0], void 0];
1569
+ }
1570
+ if (rawArgs.length === 2) {
1571
+ if (typeof rawArgs[1] === "function") {
1572
+ return [
1573
+ {
1574
+ eventName: rawArgs[0],
1575
+ cb: rawArgs[1]
1576
+ },
1577
+ void 0
1578
+ ];
1579
+ } else {
1580
+ return rawArgs;
1581
+ }
1582
+ }
1583
+ if (rawArgs.length === 3) {
1584
+ return [
1585
+ {
1586
+ eventName: rawArgs[0],
1587
+ cb: rawArgs[1]
1588
+ },
1589
+ rawArgs[2]
1590
+ ];
1591
+ }
1592
+ throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).", {
1593
+ cause: rawArgs
1594
+ });
1595
+ })();
1418
1596
  let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1419
1597
  if (providerId) {
1420
1598
  provider = getProviderById(providerId);
@@ -1932,7 +2110,7 @@ var UnisatAdapter = class extends SatsConnectAdapter {
1932
2110
  id = DefaultAdaptersInfo.unisat.id;
1933
2111
  async getAccounts(params) {
1934
2112
  const { purposes } = params;
1935
- if (purposes.includes("stacks" /* Stacks */)) {
2113
+ if (purposes.includes("stacks" /* Stacks */) || purposes.includes("starknet" /* Starknet */) || purposes.includes("spark" /* Spark */)) {
1936
2114
  throw new Error("Only bitcoin addresses are supported");
1937
2115
  }
1938
2116
  const accounts = await window.unisat.requestAccounts();
@@ -2392,6 +2570,7 @@ var signMultipleTransactions = async (options) => {
2392
2570
  RpcErrorCode,
2393
2571
  RpcIdSchema,
2394
2572
  SatsConnectAdapter,
2573
+ SparkNetworkType,
2395
2574
  StacksNetworkType,
2396
2575
  StarknetNetworkType,
2397
2576
  accountActionsSchema,
@@ -2523,6 +2702,22 @@ var signMultipleTransactions = async (options) => {
2523
2702
  signPsbtRequestMessageSchema,
2524
2703
  signPsbtResultSchema,
2525
2704
  signTransaction,
2705
+ sparkGetAddressesMethodName,
2706
+ sparkGetAddressesParamsSchema,
2707
+ sparkGetAddressesRequestMessageSchema,
2708
+ sparkGetAddressesResultSchema,
2709
+ sparkGetBalanceMethodName,
2710
+ sparkGetBalanceParamsSchema,
2711
+ sparkGetBalanceRequestMessageSchema,
2712
+ sparkGetBalanceResultSchema,
2713
+ sparkTransferMethodName,
2714
+ sparkTransferParamsSchema,
2715
+ sparkTransferRequestMessageSchema,
2716
+ sparkTransferResultSchema,
2717
+ sparkTransferTokenMethodName,
2718
+ sparkTransferTokenParamsSchema,
2719
+ sparkTransferTokenRequestMessageSchema,
2720
+ sparkTransferTokenResultSchema,
2526
2721
  stxCallContractMethodName,
2527
2722
  stxCallContractParamsSchema,
2528
2723
  stxCallContractRequestMessageSchema,