@sats-connect/core 0.7.0 → 0.7.1-07f514f

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,11 +262,13 @@ 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({
249
270
  address: v2.string(),
250
- publicKey: v2.string(),
271
+ publicKey: v2.optional(v2.string()),
251
272
  purpose: v2.enum(AddressPurpose),
252
273
  addressType: v2.enum(AddressType),
253
274
  walletType: walletTypeSchema
@@ -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,760 @@ 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
+ tokenIdentifier: v13.string(),
1084
+ tokenPublicKey: v13.string(),
1085
+ tokenName: v13.string(),
1086
+ tokenTicker: v13.string(),
1087
+ decimals: v13.number(),
1088
+ maxSupply: v13.string()
1089
+ })
1090
+ })
1091
+ )
1092
+ });
1093
+ var sparkGetBalanceRequestMessageSchema = v13.object({
1094
+ ...rpcRequestMessageSchema.entries,
1095
+ ...v13.object({
1096
+ method: v13.literal(sparkGetBalanceMethodName),
1097
+ params: sparkGetBalanceParamsSchema,
1098
+ id: v13.string()
1099
+ }).entries
1100
+ });
1101
+
1102
+ // src/request/types/sparkMethods/transfer.ts
1103
+ var v14 = __toESM(require("valibot"));
1104
+ var sparkTransferMethodName = "spark_transfer";
1105
+ var sparkTransferParamsSchema = v14.object({
1106
+ /**
1107
+ * Amount of SATS to transfer as a string or number.
1108
+ */
1109
+ amountSats: v14.union([v14.number(), v14.string()]),
1110
+ /**
1111
+ * The recipient's spark address.
1112
+ */
1113
+ receiverSparkAddress: v14.string()
1114
+ });
1115
+ var sparkTransferResultSchema = v14.object({
1116
+ /**
1117
+ * The ID of the transaction.
1118
+ */
1119
+ id: v14.string()
1120
+ });
1121
+ var sparkTransferRequestMessageSchema = v14.object({
1122
+ ...rpcRequestMessageSchema.entries,
1123
+ ...v14.object({
1124
+ method: v14.literal(sparkTransferMethodName),
1125
+ params: sparkTransferParamsSchema,
1126
+ id: v14.string()
1127
+ }).entries
1128
+ });
1129
+
1130
+ // src/request/types/sparkMethods/transferToken.ts
1131
+ var v15 = __toESM(require("valibot"));
1132
+ var sparkTransferTokenMethodName = "spark_transferToken";
1133
+ var sparkTransferTokenParamsSchema = v15.object({
1134
+ /**
1135
+ * Amount of units of the token to transfer as a string or number.
1136
+ */
1137
+ tokenAmount: v15.union([v15.number(), v15.string()]),
1138
+ /**
1139
+ * The token identifier.
1140
+ */
1141
+ tokenIdentifier: v15.string(),
1142
+ /**
1143
+ * The recipient's spark address.
1144
+ */
1145
+ receiverSparkAddress: v15.string()
1146
+ });
1147
+ var sparkTransferTokenResultSchema = v15.object({
1148
+ /**
1149
+ * The ID of the transaction.
1150
+ */
1151
+ id: v15.string()
1152
+ });
1153
+ var sparkTransferTokenRequestMessageSchema = v15.object({
1154
+ ...rpcRequestMessageSchema.entries,
1155
+ ...v15.object({
1156
+ method: v15.literal(sparkTransferTokenMethodName),
1157
+ params: sparkTransferTokenParamsSchema,
1158
+ id: v15.string()
1159
+ }).entries
1160
+ });
404
1161
 
405
1162
  // src/request/types/stxMethods/callContract.ts
406
- var v5 = __toESM(require("valibot"));
1163
+ var v16 = __toESM(require("valibot"));
407
1164
  var stxCallContractMethodName = "stx_callContract";
408
- var stxCallContractParamsSchema = v5.object({
1165
+ var stxCallContractParamsSchema = v16.object({
409
1166
  /**
410
1167
  * The contract principal.
411
1168
  *
412
1169
  * E.g. `"SPKE...GD5C.my-contract"`
413
1170
  */
414
- contract: v5.string(),
1171
+ contract: v16.string(),
415
1172
  /**
416
1173
  * The name of the function to call.
417
1174
  *
418
1175
  * Note: spec changes ongoing,
419
1176
  * https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
420
1177
  */
421
- functionName: v5.string(),
1178
+ functionName: v16.string(),
422
1179
  /**
423
1180
  * @deprecated in favor of `functionArgs` for @stacks/connect compatibility
424
1181
  */
425
- arguments: v5.optional(v5.array(v5.string())),
1182
+ arguments: v16.optional(v16.array(v16.string())),
426
1183
  /**
427
1184
  * The function's arguments. The arguments are expected to be hex-encoded
428
1185
  * strings of Clarity values.
@@ -437,486 +1194,274 @@ var stxCallContractParamsSchema = v5.object({
437
1194
  * const hexArgs = functionArgs.map(cvToHex);
438
1195
  * ```
439
1196
  */
440
- functionArgs: v5.optional(v5.array(v5.string())),
1197
+ functionArgs: v16.optional(v16.array(v16.string())),
441
1198
  /**
442
1199
  * The post conditions to apply to the contract call.
443
1200
  */
444
- postConditions: v5.optional(v5.array(v5.string())),
1201
+ postConditions: v16.optional(v16.array(v16.string())),
445
1202
  /**
446
1203
  * The mode to apply to the post conditions.
447
1204
  */
448
- postConditionMode: v5.optional(v5.union([v5.literal("allow"), v5.literal("deny")]))
1205
+ postConditionMode: v16.optional(v16.union([v16.literal("allow"), v16.literal("deny")]))
449
1206
  });
450
- var stxCallContractResultSchema = v5.object({
1207
+ var stxCallContractResultSchema = v16.object({
451
1208
  /**
452
1209
  * The ID of the transaction.
453
1210
  */
454
- txid: v5.string(),
1211
+ txid: v16.string(),
455
1212
  /**
456
1213
  * A Stacks transaction as a hex-encoded string.
457
1214
  */
458
- transaction: v5.string()
1215
+ transaction: v16.string()
459
1216
  });
460
- var stxCallContractRequestMessageSchema = v5.object({
1217
+ var stxCallContractRequestMessageSchema = v16.object({
461
1218
  ...rpcRequestMessageSchema.entries,
462
- ...v5.object({
463
- method: v5.literal(stxCallContractMethodName),
1219
+ ...v16.object({
1220
+ method: v16.literal(stxCallContractMethodName),
464
1221
  params: stxCallContractParamsSchema,
465
- id: v5.string()
1222
+ id: v16.string()
466
1223
  }).entries
467
1224
  });
468
1225
 
469
1226
  // src/request/types/stxMethods/deployContract.ts
470
- var v6 = __toESM(require("valibot"));
1227
+ var v17 = __toESM(require("valibot"));
471
1228
  var stxDeployContractMethodName = "stx_deployContract";
472
- var stxDeployContractParamsSchema = v6.object({
1229
+ var stxDeployContractParamsSchema = v17.object({
473
1230
  /**
474
1231
  * Name of the contract.
475
1232
  */
476
- name: v6.string(),
1233
+ name: v17.string(),
477
1234
  /**
478
1235
  * The source code of the Clarity contract.
479
1236
  */
480
- clarityCode: v6.string(),
1237
+ clarityCode: v17.string(),
481
1238
  /**
482
1239
  * The version of the Clarity contract.
483
1240
  */
484
- clarityVersion: v6.optional(v6.number()),
1241
+ clarityVersion: v17.optional(v17.number()),
485
1242
  /**
486
1243
  * The post conditions to apply to the contract call.
487
1244
  */
488
- postConditions: v6.optional(v6.array(v6.string())),
1245
+ postConditions: v17.optional(v17.array(v17.string())),
489
1246
  /**
490
1247
  * The mode to apply to the post conditions.
491
1248
  */
492
- postConditionMode: v6.optional(v6.union([v6.literal("allow"), v6.literal("deny")]))
1249
+ postConditionMode: v17.optional(v17.union([v17.literal("allow"), v17.literal("deny")]))
493
1250
  });
494
- var stxDeployContractResultSchema = v6.object({
1251
+ var stxDeployContractResultSchema = v17.object({
495
1252
  /**
496
1253
  * The ID of the transaction.
497
1254
  */
498
- txid: v6.string(),
1255
+ txid: v17.string(),
499
1256
  /**
500
1257
  * A Stacks transaction as a hex-encoded string.
501
1258
  */
502
- transaction: v6.string()
1259
+ transaction: v17.string()
503
1260
  });
504
- var stxDeployContractRequestMessageSchema = v6.object({
1261
+ var stxDeployContractRequestMessageSchema = v17.object({
505
1262
  ...rpcRequestMessageSchema.entries,
506
- ...v6.object({
507
- method: v6.literal(stxDeployContractMethodName),
1263
+ ...v17.object({
1264
+ method: v17.literal(stxDeployContractMethodName),
508
1265
  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()
1266
+ id: v17.string()
720
1267
  }).entries
721
1268
  });
722
- var addNetworkResultSchema = v7.object({
723
- id: v7.string()
724
- });
725
1269
 
726
1270
  // src/request/types/stxMethods/getAccounts.ts
1271
+ var v18 = __toESM(require("valibot"));
727
1272
  var stxGetAccountsMethodName = "stx_getAccounts";
728
- var stxGetAccountsParamsSchema = v8.nullish(v8.null());
729
- var stxGetAccountsResultSchema = v8.object({
1273
+ var stxGetAccountsParamsSchema = v18.nullish(v18.null());
1274
+ var stxGetAccountsResultSchema = v18.object({
730
1275
  /**
731
1276
  * The addresses generated for the given purposes.
732
1277
  */
733
- addresses: v8.array(
734
- v8.object({
735
- address: v8.string(),
736
- publicKey: v8.string(),
737
- gaiaHubUrl: v8.string(),
738
- gaiaAppKey: v8.string()
1278
+ addresses: v18.array(
1279
+ v18.object({
1280
+ address: v18.string(),
1281
+ publicKey: v18.string(),
1282
+ gaiaHubUrl: v18.string(),
1283
+ gaiaAppKey: v18.string()
739
1284
  })
740
1285
  ),
741
1286
  network: getNetworkResultSchema
742
1287
  });
743
- var stxGetAccountsRequestMessageSchema = v8.object({
1288
+ var stxGetAccountsRequestMessageSchema = v18.object({
744
1289
  ...rpcRequestMessageSchema.entries,
745
- ...v8.object({
746
- method: v8.literal(stxGetAccountsMethodName),
1290
+ ...v18.object({
1291
+ method: v18.literal(stxGetAccountsMethodName),
747
1292
  params: stxGetAccountsParamsSchema,
748
- id: v8.string()
1293
+ id: v18.string()
749
1294
  }).entries
750
1295
  });
751
1296
 
752
1297
  // src/request/types/stxMethods/getAddresses.ts
753
- var v9 = __toESM(require("valibot"));
1298
+ var v19 = __toESM(require("valibot"));
754
1299
  var stxGetAddressesMethodName = "stx_getAddresses";
755
- var stxGetAddressesParamsSchema = v9.nullish(
756
- v9.object({
1300
+ var stxGetAddressesParamsSchema = v19.nullish(
1301
+ v19.object({
757
1302
  /**
758
1303
  * A message to be displayed to the user in the request prompt.
759
1304
  */
760
- message: v9.optional(v9.string())
1305
+ message: v19.optional(v19.string())
761
1306
  })
762
1307
  );
763
- var stxGetAddressesResultSchema = v9.object({
1308
+ var stxGetAddressesResultSchema = v19.object({
764
1309
  /**
765
1310
  * The addresses generated for the given purposes.
766
1311
  */
767
- addresses: v9.array(addressSchema),
1312
+ addresses: v19.array(addressSchema),
768
1313
  network: getNetworkResultSchema
769
1314
  });
770
- var stxGetAddressesRequestMessageSchema = v9.object({
1315
+ var stxGetAddressesRequestMessageSchema = v19.object({
771
1316
  ...rpcRequestMessageSchema.entries,
772
- ...v9.object({
773
- method: v9.literal(stxGetAddressesMethodName),
1317
+ ...v19.object({
1318
+ method: v19.literal(stxGetAddressesMethodName),
774
1319
  params: stxGetAddressesParamsSchema,
775
- id: v9.string()
1320
+ id: v19.string()
776
1321
  }).entries
777
1322
  });
778
1323
 
779
1324
  // src/request/types/stxMethods/signMessage.ts
780
- var v10 = __toESM(require("valibot"));
1325
+ var v20 = __toESM(require("valibot"));
781
1326
  var stxSignMessageMethodName = "stx_signMessage";
782
- var stxSignMessageParamsSchema = v10.object({
1327
+ var stxSignMessageParamsSchema = v20.object({
783
1328
  /**
784
1329
  * The message to sign.
785
1330
  */
786
- message: v10.string()
1331
+ message: v20.string()
787
1332
  });
788
- var stxSignMessageResultSchema = v10.object({
1333
+ var stxSignMessageResultSchema = v20.object({
789
1334
  /**
790
1335
  * The signature of the message.
791
1336
  */
792
- signature: v10.string(),
1337
+ signature: v20.string(),
793
1338
  /**
794
1339
  * The public key used to sign the message.
795
1340
  */
796
- publicKey: v10.string()
1341
+ publicKey: v20.string()
797
1342
  });
798
- var stxSignMessageRequestMessageSchema = v10.object({
1343
+ var stxSignMessageRequestMessageSchema = v20.object({
799
1344
  ...rpcRequestMessageSchema.entries,
800
- ...v10.object({
801
- method: v10.literal(stxSignMessageMethodName),
1345
+ ...v20.object({
1346
+ method: v20.literal(stxSignMessageMethodName),
802
1347
  params: stxSignMessageParamsSchema,
803
- id: v10.string()
1348
+ id: v20.string()
804
1349
  }).entries
805
1350
  });
806
1351
 
807
1352
  // src/request/types/stxMethods/signStructuredMessage.ts
808
- var v11 = __toESM(require("valibot"));
1353
+ var v21 = __toESM(require("valibot"));
809
1354
  var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
810
- var stxSignStructuredMessageParamsSchema = v11.object({
1355
+ var stxSignStructuredMessageParamsSchema = v21.object({
811
1356
  /**
812
1357
  * The domain to be signed.
813
1358
  */
814
- domain: v11.string(),
1359
+ domain: v21.string(),
815
1360
  /**
816
1361
  * Message payload to be signed.
817
1362
  */
818
- message: v11.string(),
1363
+ message: v21.string(),
819
1364
  /**
820
1365
  * The public key to sign the message with.
821
1366
  */
822
- publicKey: v11.optional(v11.string())
1367
+ publicKey: v21.optional(v21.string())
823
1368
  });
824
- var stxSignStructuredMessageResultSchema = v11.object({
1369
+ var stxSignStructuredMessageResultSchema = v21.object({
825
1370
  /**
826
1371
  * Signature of the message.
827
1372
  */
828
- signature: v11.string(),
1373
+ signature: v21.string(),
829
1374
  /**
830
1375
  * Public key as hex-encoded string.
831
1376
  */
832
- publicKey: v11.string()
1377
+ publicKey: v21.string()
833
1378
  });
834
- var stxSignStructuredMessageRequestMessageSchema = v11.object({
1379
+ var stxSignStructuredMessageRequestMessageSchema = v21.object({
835
1380
  ...rpcRequestMessageSchema.entries,
836
- ...v11.object({
837
- method: v11.literal(stxSignStructuredMessageMethodName),
1381
+ ...v21.object({
1382
+ method: v21.literal(stxSignStructuredMessageMethodName),
838
1383
  params: stxSignStructuredMessageParamsSchema,
839
- id: v11.string()
1384
+ id: v21.string()
840
1385
  }).entries
841
1386
  });
842
1387
 
843
1388
  // src/request/types/stxMethods/signTransaction.ts
844
- var v12 = __toESM(require("valibot"));
1389
+ var v22 = __toESM(require("valibot"));
845
1390
  var stxSignTransactionMethodName = "stx_signTransaction";
846
- var stxSignTransactionParamsSchema = v12.object({
1391
+ var stxSignTransactionParamsSchema = v22.object({
847
1392
  /**
848
1393
  * The transaction to sign as a hex-encoded string.
849
1394
  */
850
- transaction: v12.string(),
1395
+ transaction: v22.string(),
851
1396
  /**
852
1397
  * The public key to sign the transaction with. The wallet may use any key
853
1398
  * when not provided.
854
1399
  */
855
- pubkey: v12.optional(v12.string()),
1400
+ pubkey: v22.optional(v22.string()),
856
1401
  /**
857
1402
  * Whether to broadcast the transaction after signing. Defaults to `true`.
858
1403
  */
859
- broadcast: v12.optional(v12.boolean())
1404
+ broadcast: v22.optional(v22.boolean())
860
1405
  });
861
- var stxSignTransactionResultSchema = v12.object({
1406
+ var stxSignTransactionResultSchema = v22.object({
862
1407
  /**
863
1408
  * The signed transaction as a hex-encoded string.
864
1409
  */
865
- transaction: v12.string()
1410
+ transaction: v22.string()
866
1411
  });
867
- var stxSignTransactionRequestMessageSchema = v12.object({
1412
+ var stxSignTransactionRequestMessageSchema = v22.object({
868
1413
  ...rpcRequestMessageSchema.entries,
869
- ...v12.object({
870
- method: v12.literal(stxSignTransactionMethodName),
1414
+ ...v22.object({
1415
+ method: v22.literal(stxSignTransactionMethodName),
871
1416
  params: stxSignTransactionParamsSchema,
872
- id: v12.string()
1417
+ id: v22.string()
873
1418
  }).entries
874
1419
  });
875
1420
 
876
1421
  // src/request/types/stxMethods/signTransactions.ts
877
- var v13 = __toESM(require("valibot"));
1422
+ var v23 = __toESM(require("valibot"));
878
1423
  var stxSignTransactionsMethodName = "stx_signTransactions";
879
- var stxSignTransactionsParamsSchema = v13.object({
1424
+ var stxSignTransactionsParamsSchema = v23.object({
880
1425
  /**
881
1426
  * The transactions to sign as hex-encoded strings.
882
1427
  */
883
- transactions: v13.pipe(
884
- v13.array(
885
- v13.pipe(
886
- v13.string(),
887
- v13.check((hex) => {
1428
+ transactions: v23.pipe(
1429
+ v23.array(
1430
+ v23.pipe(
1431
+ v23.string(),
1432
+ v23.check((hex) => {
888
1433
  return true;
889
1434
  }, "Invalid hex-encoded Stacks transaction.")
890
1435
  )
891
1436
  ),
892
- v13.minLength(1)
1437
+ v23.minLength(1)
893
1438
  ),
894
1439
  /**
895
1440
  * Whether the signed transactions should be broadcast after signing. Defaults
896
1441
  * to `true`.
897
1442
  */
898
- broadcast: v13.optional(v13.boolean())
1443
+ broadcast: v23.optional(v23.boolean())
899
1444
  });
900
- var stxSignTransactionsResultSchema = v13.object({
1445
+ var stxSignTransactionsResultSchema = v23.object({
901
1446
  /**
902
1447
  * The signed transactions as hex-encoded strings, in the same order as in the
903
1448
  * sign request.
904
1449
  */
905
- transactions: v13.array(v13.string())
1450
+ transactions: v23.array(v23.string())
906
1451
  });
907
- var stxSignTransactionsRequestMessageSchema = v13.object({
1452
+ var stxSignTransactionsRequestMessageSchema = v23.object({
908
1453
  ...rpcRequestMessageSchema.entries,
909
- ...v13.object({
910
- method: v13.literal(stxSignTransactionsMethodName),
1454
+ ...v23.object({
1455
+ method: v23.literal(stxSignTransactionsMethodName),
911
1456
  params: stxSignTransactionsParamsSchema,
912
- id: v13.string()
1457
+ id: v23.string()
913
1458
  }).entries
914
1459
  });
915
1460
 
916
1461
  // src/request/types/stxMethods/transferStx.ts
917
- var v14 = __toESM(require("valibot"));
1462
+ var v24 = __toESM(require("valibot"));
918
1463
  var stxTransferStxMethodName = "stx_transferStx";
919
- var stxTransferStxParamsSchema = v14.object({
1464
+ var stxTransferStxParamsSchema = v24.object({
920
1465
  /**
921
1466
  * Amount of STX tokens to transfer in microstacks as a string. Anything
922
1467
  * parseable by `BigInt` is acceptable.
@@ -929,23 +1474,23 @@ var stxTransferStxParamsSchema = v14.object({
929
1474
  * const amount3 = '1234';
930
1475
  * ```
931
1476
  */
932
- amount: v14.union([v14.number(), v14.string()]),
1477
+ amount: v24.union([v24.number(), v24.string()]),
933
1478
  /**
934
- * The recipeint's principal.
1479
+ * The recipient's principal.
935
1480
  */
936
- recipient: v14.string(),
1481
+ recipient: v24.string(),
937
1482
  /**
938
1483
  * A string representing the memo.
939
1484
  */
940
- memo: v14.optional(v14.string()),
1485
+ memo: v24.optional(v24.string()),
941
1486
  /**
942
1487
  * Version of parameter format.
943
1488
  */
944
- version: v14.optional(v14.string()),
1489
+ version: v24.optional(v24.string()),
945
1490
  /**
946
1491
  * The mode of the post conditions.
947
1492
  */
948
- postConditionMode: v14.optional(v14.number()),
1493
+ postConditionMode: v24.optional(v24.number()),
949
1494
  /**
950
1495
  * A hex-encoded string representing the post conditions.
951
1496
  *
@@ -958,425 +1503,29 @@ var stxTransferStxParamsSchema = v14.object({
958
1503
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
959
1504
  * ```
960
1505
  */
961
- postConditions: v14.optional(v14.array(v14.string())),
1506
+ postConditions: v24.optional(v24.array(v24.string())),
962
1507
  /**
963
1508
  * The public key to sign the transaction with. The wallet may use any key
964
1509
  * when not provided.
965
1510
  */
966
- pubkey: v14.optional(v14.string())
1511
+ pubkey: v24.optional(v24.string())
967
1512
  });
968
- var stxTransferStxResultSchema = v14.object({
1513
+ var stxTransferStxResultSchema = v24.object({
969
1514
  /**
970
1515
  * The ID of the transaction.
971
1516
  */
972
- txid: v14.string(),
1517
+ txid: v24.string(),
973
1518
  /**
974
1519
  * A Stacks transaction as a hex-encoded string.
975
1520
  */
976
- transaction: v14.string()
1521
+ transaction: v24.string()
977
1522
  });
978
- var stxTransferStxRequestMessageSchema = v14.object({
1523
+ var stxTransferStxRequestMessageSchema = v24.object({
979
1524
  ...rpcRequestMessageSchema.entries,
980
- ...v14.object({
981
- method: v14.literal(stxTransferStxMethodName),
1525
+ ...v24.object({
1526
+ method: v24.literal(stxTransferStxMethodName),
982
1527
  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()
1528
+ id: v24.string()
1380
1529
  }).entries
1381
1530
  });
1382
1531
 
@@ -1393,13 +1542,13 @@ var request = async (method, params, providerId) => {
1393
1542
  throw new Error("A wallet method is required");
1394
1543
  }
1395
1544
  const response = await provider.request(method, params);
1396
- if (v21.is(rpcErrorResponseMessageSchema, response)) {
1545
+ if (v25.is(rpcErrorResponseMessageSchema, response)) {
1397
1546
  return {
1398
1547
  status: "error",
1399
1548
  error: response.error
1400
1549
  };
1401
1550
  }
1402
- if (v21.is(rpcSuccessResponseMessageSchema, response)) {
1551
+ if (v25.is(rpcSuccessResponseMessageSchema, response)) {
1403
1552
  return {
1404
1553
  status: "success",
1405
1554
  result: response.result
@@ -1414,7 +1563,37 @@ var request = async (method, params, providerId) => {
1414
1563
  }
1415
1564
  };
1416
1565
  };
1417
- var addListener = (listenerInfo, providerId) => {
1566
+ var addListener = (...rawArgs) => {
1567
+ const [listenerInfo, providerId] = (() => {
1568
+ if (rawArgs.length === 1) {
1569
+ return [rawArgs[0], void 0];
1570
+ }
1571
+ if (rawArgs.length === 2) {
1572
+ if (typeof rawArgs[1] === "function") {
1573
+ return [
1574
+ {
1575
+ eventName: rawArgs[0],
1576
+ cb: rawArgs[1]
1577
+ },
1578
+ void 0
1579
+ ];
1580
+ } else {
1581
+ return rawArgs;
1582
+ }
1583
+ }
1584
+ if (rawArgs.length === 3) {
1585
+ return [
1586
+ {
1587
+ eventName: rawArgs[0],
1588
+ cb: rawArgs[1]
1589
+ },
1590
+ rawArgs[2]
1591
+ ];
1592
+ }
1593
+ throw new Error("Unexpected number of arguments. Expecting 2 (or 3 for legacy requests).", {
1594
+ cause: rawArgs
1595
+ });
1596
+ })();
1418
1597
  let provider = window.XverseProviders?.BitcoinProvider || window.BitcoinProvider;
1419
1598
  if (providerId) {
1420
1599
  provider = getProviderById(providerId);
@@ -1932,7 +2111,7 @@ var UnisatAdapter = class extends SatsConnectAdapter {
1932
2111
  id = DefaultAdaptersInfo.unisat.id;
1933
2112
  async getAccounts(params) {
1934
2113
  const { purposes } = params;
1935
- if (purposes.includes("stacks" /* Stacks */)) {
2114
+ if (purposes.includes("stacks" /* Stacks */) || purposes.includes("starknet" /* Starknet */) || purposes.includes("spark" /* Spark */)) {
1936
2115
  throw new Error("Only bitcoin addresses are supported");
1937
2116
  }
1938
2117
  const accounts = await window.unisat.requestAccounts();
@@ -2392,6 +2571,7 @@ var signMultipleTransactions = async (options) => {
2392
2571
  RpcErrorCode,
2393
2572
  RpcIdSchema,
2394
2573
  SatsConnectAdapter,
2574
+ SparkNetworkType,
2395
2575
  StacksNetworkType,
2396
2576
  StarknetNetworkType,
2397
2577
  accountActionsSchema,
@@ -2523,6 +2703,22 @@ var signMultipleTransactions = async (options) => {
2523
2703
  signPsbtRequestMessageSchema,
2524
2704
  signPsbtResultSchema,
2525
2705
  signTransaction,
2706
+ sparkGetAddressesMethodName,
2707
+ sparkGetAddressesParamsSchema,
2708
+ sparkGetAddressesRequestMessageSchema,
2709
+ sparkGetAddressesResultSchema,
2710
+ sparkGetBalanceMethodName,
2711
+ sparkGetBalanceParamsSchema,
2712
+ sparkGetBalanceRequestMessageSchema,
2713
+ sparkGetBalanceResultSchema,
2714
+ sparkTransferMethodName,
2715
+ sparkTransferParamsSchema,
2716
+ sparkTransferRequestMessageSchema,
2717
+ sparkTransferResultSchema,
2718
+ sparkTransferTokenMethodName,
2719
+ sparkTransferTokenParamsSchema,
2720
+ sparkTransferTokenRequestMessageSchema,
2721
+ sparkTransferTokenResultSchema,
2526
2722
  stxCallContractMethodName,
2527
2723
  stxCallContractParamsSchema,
2528
2724
  stxCallContractRequestMessageSchema,