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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -63,6 +63,7 @@ var BitcoinNetworkType = /* @__PURE__ */ ((BitcoinNetworkType2) => {
63
63
  BitcoinNetworkType2["Mainnet"] = "Mainnet";
64
64
  BitcoinNetworkType2["Testnet"] = "Testnet";
65
65
  BitcoinNetworkType2["Signet"] = "Signet";
66
+ BitcoinNetworkType2["Regtest"] = "Regtest";
66
67
  return BitcoinNetworkType2;
67
68
  })(BitcoinNetworkType || {});
68
69
  var RpcIdSchema = v2.optional(v2.union([v2.string(), v2.number(), v2.null()]));
@@ -109,7 +110,7 @@ var rpcResponseMessageSchema = v2.union([
109
110
  ]);
110
111
 
111
112
  // src/request/index.ts
112
- import * as v21 from "valibot";
113
+ import * as v20 from "valibot";
113
114
 
114
115
  // src/request/types/stxMethods/callContract.ts
115
116
  import * as v3 from "valibot";
@@ -404,50 +405,10 @@ var stxSignTransactionRequestMessageSchema = v10.object({
404
405
  }).entries
405
406
  });
406
407
 
407
- // src/request/types/stxMethods/signTransactions.ts
408
- import * as v11 from "valibot";
409
- var stxSignTransactionsMethodName = "stx_signTransactions";
410
- var stxSignTransactionsParamsSchema = v11.object({
411
- /**
412
- * The transactions to sign as hex-encoded strings.
413
- */
414
- transactions: v11.pipe(
415
- v11.array(
416
- v11.pipe(
417
- v11.string(),
418
- v11.check((hex) => {
419
- return true;
420
- }, "Invalid hex-encoded Stacks transaction.")
421
- )
422
- ),
423
- v11.minLength(1)
424
- ),
425
- /**
426
- * Whether the signed transactions should be broadcast after signing. Defaults
427
- * to `true`.
428
- */
429
- broadcast: v11.optional(v11.boolean())
430
- });
431
- var stxSignTransactionsResultSchema = v11.object({
432
- /**
433
- * The signed transactions as hex-encoded strings, in the same order as in the
434
- * sign request.
435
- */
436
- transactions: v11.array(v11.string())
437
- });
438
- var stxSignTransactionsRequestMessageSchema = v11.object({
439
- ...rpcRequestMessageSchema.entries,
440
- ...v11.object({
441
- method: v11.literal(stxSignTransactionsMethodName),
442
- params: stxSignTransactionsParamsSchema,
443
- id: v11.string()
444
- }).entries
445
- });
446
-
447
408
  // src/request/types/stxMethods/transferStx.ts
448
- import * as v12 from "valibot";
409
+ import * as v11 from "valibot";
449
410
  var stxTransferStxMethodName = "stx_transferStx";
450
- var stxTransferStxParamsSchema = v12.object({
411
+ var stxTransferStxParamsSchema = v11.object({
451
412
  /**
452
413
  * Amount of STX tokens to transfer in microstacks as a string. Anything
453
414
  * parseable by `BigInt` is acceptable.
@@ -460,23 +421,23 @@ var stxTransferStxParamsSchema = v12.object({
460
421
  * const amount3 = '1234';
461
422
  * ```
462
423
  */
463
- amount: v12.union([v12.number(), v12.string()]),
424
+ amount: v11.union([v11.number(), v11.string()]),
464
425
  /**
465
426
  * The recipeint's principal.
466
427
  */
467
- recipient: v12.string(),
428
+ recipient: v11.string(),
468
429
  /**
469
430
  * A string representing the memo.
470
431
  */
471
- memo: v12.optional(v12.string()),
432
+ memo: v11.optional(v11.string()),
472
433
  /**
473
434
  * Version of parameter format.
474
435
  */
475
- version: v12.optional(v12.string()),
436
+ version: v11.optional(v11.string()),
476
437
  /**
477
438
  * The mode of the post conditions.
478
439
  */
479
- postConditionMode: v12.optional(v12.number()),
440
+ postConditionMode: v11.optional(v11.number()),
480
441
  /**
481
442
  * A hex-encoded string representing the post conditions.
482
443
  *
@@ -489,89 +450,89 @@ var stxTransferStxParamsSchema = v12.object({
489
450
  * const hexPostCondition = serializePostCondition(postCondition).toString('hex');
490
451
  * ```
491
452
  */
492
- postConditions: v12.optional(v12.array(v12.string())),
453
+ postConditions: v11.optional(v11.array(v11.string())),
493
454
  /**
494
455
  * The public key to sign the transaction with. The wallet may use any key
495
456
  * when not provided.
496
457
  */
497
- pubkey: v12.optional(v12.string())
458
+ pubkey: v11.optional(v11.string())
498
459
  });
499
- var stxTransferStxResultSchema = v12.object({
460
+ var stxTransferStxResultSchema = v11.object({
500
461
  /**
501
462
  * The ID of the transaction.
502
463
  */
503
- txid: v12.string(),
464
+ txid: v11.string(),
504
465
  /**
505
466
  * A Stacks transaction as a hex-encoded string.
506
467
  */
507
- transaction: v12.string()
468
+ transaction: v11.string()
508
469
  });
509
- var stxTransferStxRequestMessageSchema = v12.object({
470
+ var stxTransferStxRequestMessageSchema = v11.object({
510
471
  ...rpcRequestMessageSchema.entries,
511
- ...v12.object({
512
- method: v12.literal(stxTransferStxMethodName),
472
+ ...v11.object({
473
+ method: v11.literal(stxTransferStxMethodName),
513
474
  params: stxTransferStxParamsSchema,
514
- id: v12.string()
475
+ id: v11.string()
515
476
  }).entries
516
477
  });
517
478
 
518
479
  // src/request/types/btcMethods.ts
519
- import * as v14 from "valibot";
480
+ import * as v13 from "valibot";
520
481
 
521
482
  // src/request/types/common.ts
522
- import * as v13 from "valibot";
483
+ import * as v12 from "valibot";
523
484
  var walletTypes = ["software", "ledger"];
524
- var walletTypeSchema = v13.picklist(walletTypes);
485
+ var walletTypeSchema = v12.picklist(walletTypes);
525
486
 
526
487
  // src/request/types/btcMethods.ts
527
488
  var getInfoMethodName = "getInfo";
528
- var getInfoParamsSchema = v14.nullish(v14.null());
529
- var getInfoResultSchema = v14.object({
489
+ var getInfoParamsSchema = v13.nullish(v13.null());
490
+ var getInfoResultSchema = v13.object({
530
491
  /**
531
492
  * Version of the wallet.
532
493
  */
533
- version: v14.string(),
494
+ version: v13.string(),
534
495
  /**
535
496
  * [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
536
497
  */
537
- methods: v14.optional(v14.array(v14.string())),
498
+ methods: v13.optional(v13.array(v13.string())),
538
499
  /**
539
500
  * List of WBIP standards supported by the wallet. Not currently used.
540
501
  */
541
- supports: v14.array(v14.string())
502
+ supports: v13.array(v13.string())
542
503
  });
543
- var getInfoRequestMessageSchema = v14.object({
504
+ var getInfoRequestMessageSchema = v13.object({
544
505
  ...rpcRequestMessageSchema.entries,
545
- ...v14.object({
546
- method: v14.literal(getInfoMethodName),
506
+ ...v13.object({
507
+ method: v13.literal(getInfoMethodName),
547
508
  params: getInfoParamsSchema,
548
- id: v14.string()
509
+ id: v13.string()
549
510
  }).entries
550
511
  });
551
512
  var getAddressesMethodName = "getAddresses";
552
- var getAddressesParamsSchema = v14.object({
513
+ var getAddressesParamsSchema = v13.object({
553
514
  /**
554
515
  * The purposes for which to generate addresses. See
555
516
  * {@linkcode AddressPurpose} for available purposes.
556
517
  */
557
- purposes: v14.array(v14.enum(AddressPurpose)),
518
+ purposes: v13.array(v13.enum(AddressPurpose)),
558
519
  /**
559
520
  * A message to be displayed to the user in the request prompt.
560
521
  */
561
- message: v14.optional(v14.string())
522
+ message: v13.optional(v13.string())
562
523
  });
563
- var getAddressesResultSchema = v14.object({
524
+ var getAddressesResultSchema = v13.object({
564
525
  /**
565
526
  * The addresses generated for the given purposes.
566
527
  */
567
- addresses: v14.array(addressSchema)
528
+ addresses: v13.array(addressSchema)
568
529
  });
569
- var getAddressesRequestMessageSchema = v14.object({
530
+ var getAddressesRequestMessageSchema = v13.object({
570
531
  ...rpcRequestMessageSchema.entries,
571
- ...v14.object({
572
- method: v14.literal(getAddressesMethodName),
532
+ ...v13.object({
533
+ method: v13.literal(getAddressesMethodName),
573
534
  params: getAddressesParamsSchema,
574
- id: v14.string()
535
+ id: v13.string()
575
536
  }).entries
576
537
  });
577
538
  var signMessageMethodName = "signMessage";
@@ -580,456 +541,456 @@ var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
580
541
  MessageSigningProtocols2["BIP322"] = "BIP322";
581
542
  return MessageSigningProtocols2;
582
543
  })(MessageSigningProtocols || {});
583
- var signMessageParamsSchema = v14.object({
544
+ var signMessageParamsSchema = v13.object({
584
545
  /**
585
546
  * The address used for signing.
586
547
  **/
587
- address: v14.string(),
548
+ address: v13.string(),
588
549
  /**
589
550
  * The message to sign.
590
551
  **/
591
- message: v14.string(),
552
+ message: v13.string(),
592
553
  /**
593
554
  * The protocol to use for signing the message.
594
555
  */
595
- protocol: v14.optional(v14.enum(MessageSigningProtocols))
556
+ protocol: v13.optional(v13.enum(MessageSigningProtocols))
596
557
  });
597
- var signMessageResultSchema = v14.object({
558
+ var signMessageResultSchema = v13.object({
598
559
  /**
599
560
  * The signature of the message.
600
561
  */
601
- signature: v14.string(),
562
+ signature: v13.string(),
602
563
  /**
603
564
  * hash of the message.
604
565
  */
605
- messageHash: v14.string(),
566
+ messageHash: v13.string(),
606
567
  /**
607
568
  * The address used for signing.
608
569
  */
609
- address: v14.string(),
570
+ address: v13.string(),
610
571
  /**
611
572
  * The protocol to use for signing the message.
612
573
  */
613
- protocol: v14.enum(MessageSigningProtocols)
574
+ protocol: v13.enum(MessageSigningProtocols)
614
575
  });
615
- var signMessageRequestMessageSchema = v14.object({
576
+ var signMessageRequestMessageSchema = v13.object({
616
577
  ...rpcRequestMessageSchema.entries,
617
- ...v14.object({
618
- method: v14.literal(signMessageMethodName),
578
+ ...v13.object({
579
+ method: v13.literal(signMessageMethodName),
619
580
  params: signMessageParamsSchema,
620
- id: v14.string()
581
+ id: v13.string()
621
582
  }).entries
622
583
  });
623
584
  var sendTransferMethodName = "sendTransfer";
624
- var sendTransferParamsSchema = v14.object({
585
+ var sendTransferParamsSchema = v13.object({
625
586
  /**
626
587
  * Array of recipients to send to.
627
588
  * The amount to send to each recipient is in satoshis.
628
589
  */
629
- recipients: v14.array(
630
- v14.object({
631
- address: v14.string(),
632
- amount: v14.number()
590
+ recipients: v13.array(
591
+ v13.object({
592
+ address: v13.string(),
593
+ amount: v13.number()
633
594
  })
634
595
  )
635
596
  });
636
- var sendTransferResultSchema = v14.object({
597
+ var sendTransferResultSchema = v13.object({
637
598
  /**
638
599
  * The transaction id as a hex-encoded string.
639
600
  */
640
- txid: v14.string()
601
+ txid: v13.string()
641
602
  });
642
- var sendTransferRequestMessageSchema = v14.object({
603
+ var sendTransferRequestMessageSchema = v13.object({
643
604
  ...rpcRequestMessageSchema.entries,
644
- ...v14.object({
645
- method: v14.literal(sendTransferMethodName),
605
+ ...v13.object({
606
+ method: v13.literal(sendTransferMethodName),
646
607
  params: sendTransferParamsSchema,
647
- id: v14.string()
608
+ id: v13.string()
648
609
  }).entries
649
610
  });
650
611
  var signPsbtMethodName = "signPsbt";
651
- var signPsbtParamsSchema = v14.object({
612
+ var signPsbtParamsSchema = v13.object({
652
613
  /**
653
614
  * The base64 encoded PSBT to sign.
654
615
  */
655
- psbt: v14.string(),
616
+ psbt: v13.string(),
656
617
  /**
657
618
  * The inputs to sign.
658
619
  * The key is the address and the value is an array of indexes of the inputs to sign.
659
620
  */
660
- signInputs: v14.record(v14.string(), v14.array(v14.number())),
621
+ signInputs: v13.record(v13.string(), v13.array(v13.number())),
661
622
  /**
662
623
  * Whether to broadcast the transaction after signing.
663
624
  **/
664
- broadcast: v14.optional(v14.boolean())
625
+ broadcast: v13.optional(v13.boolean())
665
626
  });
666
- var signPsbtResultSchema = v14.object({
627
+ var signPsbtResultSchema = v13.object({
667
628
  /**
668
629
  * The base64 encoded PSBT after signing.
669
630
  */
670
- psbt: v14.string(),
631
+ psbt: v13.string(),
671
632
  /**
672
633
  * The transaction id as a hex-encoded string.
673
634
  * This is only returned if the transaction was broadcast.
674
635
  **/
675
- txid: v14.optional(v14.string())
636
+ txid: v13.optional(v13.string())
676
637
  });
677
- var signPsbtRequestMessageSchema = v14.object({
638
+ var signPsbtRequestMessageSchema = v13.object({
678
639
  ...rpcRequestMessageSchema.entries,
679
- ...v14.object({
680
- method: v14.literal(signPsbtMethodName),
640
+ ...v13.object({
641
+ method: v13.literal(signPsbtMethodName),
681
642
  params: signPsbtParamsSchema,
682
- id: v14.string()
643
+ id: v13.string()
683
644
  }).entries
684
645
  });
685
646
  var getAccountsMethodName = "getAccounts";
686
- var getAccountsParamsSchema = v14.object({
647
+ var getAccountsParamsSchema = v13.object({
687
648
  /**
688
649
  * The purposes for which to generate addresses. See
689
650
  * {@linkcode AddressPurpose} for available purposes.
690
651
  */
691
- purposes: v14.array(v14.enum(AddressPurpose)),
652
+ purposes: v13.array(v13.enum(AddressPurpose)),
692
653
  /**
693
654
  * A message to be displayed to the user in the request prompt.
694
655
  */
695
- message: v14.optional(v14.string())
656
+ message: v13.optional(v13.string())
696
657
  });
697
- var getAccountsResultSchema = v14.array(
698
- v14.object({
658
+ var getAccountsResultSchema = v13.array(
659
+ v13.object({
699
660
  ...addressSchema.entries,
700
- ...v14.object({
661
+ ...v13.object({
701
662
  walletType: walletTypeSchema
702
663
  }).entries
703
664
  })
704
665
  );
705
- var getAccountsRequestMessageSchema = v14.object({
666
+ var getAccountsRequestMessageSchema = v13.object({
706
667
  ...rpcRequestMessageSchema.entries,
707
- ...v14.object({
708
- method: v14.literal(getAccountsMethodName),
668
+ ...v13.object({
669
+ method: v13.literal(getAccountsMethodName),
709
670
  params: getAccountsParamsSchema,
710
- id: v14.string()
671
+ id: v13.string()
711
672
  }).entries
712
673
  });
713
674
  var getBalanceMethodName = "getBalance";
714
- var getBalanceParamsSchema = v14.nullish(v14.null());
715
- var getBalanceResultSchema = v14.object({
675
+ var getBalanceParamsSchema = v13.nullish(v13.null());
676
+ var getBalanceResultSchema = v13.object({
716
677
  /**
717
678
  * The confirmed balance of the wallet in sats. Using a string due to chrome
718
679
  * messages not supporting bigint
719
680
  * (https://issues.chromium.org/issues/40116184).
720
681
  */
721
- confirmed: v14.string(),
682
+ confirmed: v13.string(),
722
683
  /**
723
684
  * The unconfirmed balance of the wallet in sats. Using a string due to chrome
724
685
  * messages not supporting bigint
725
686
  * (https://issues.chromium.org/issues/40116184).
726
687
  */
727
- unconfirmed: v14.string(),
688
+ unconfirmed: v13.string(),
728
689
  /**
729
690
  * The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
730
691
  * sats. Using a string due to chrome messages not supporting bigint
731
692
  * (https://issues.chromium.org/issues/40116184).
732
693
  */
733
- total: v14.string()
694
+ total: v13.string()
734
695
  });
735
- var getBalanceRequestMessageSchema = v14.object({
696
+ var getBalanceRequestMessageSchema = v13.object({
736
697
  ...rpcRequestMessageSchema.entries,
737
- ...v14.object({
738
- method: v14.literal(getBalanceMethodName),
739
- id: v14.string()
698
+ ...v13.object({
699
+ method: v13.literal(getBalanceMethodName),
700
+ id: v13.string()
740
701
  }).entries
741
702
  });
742
703
 
743
704
  // src/request/types/walletMethods.ts
744
- import * as v15 from "valibot";
745
- var accountActionsSchema = v15.object({
746
- read: v15.optional(v15.boolean())
747
- });
748
- var walletActionsSchema = v15.object({});
749
- var accountPermissionSchema = v15.object({
750
- type: v15.literal("account"),
751
- resourceId: v15.string(),
752
- clientId: v15.string(),
705
+ import * as v14 from "valibot";
706
+ var accountActionsSchema = v14.object({
707
+ read: v14.optional(v14.boolean())
708
+ });
709
+ var walletActionsSchema = v14.object({});
710
+ var accountPermissionSchema = v14.object({
711
+ type: v14.literal("account"),
712
+ resourceId: v14.string(),
713
+ clientId: v14.string(),
753
714
  actions: accountActionsSchema
754
715
  });
755
- var walletPermissionSchema = v15.object({
756
- type: v15.literal("wallet"),
757
- resourceId: v15.string(),
758
- clientId: v15.string(),
716
+ var walletPermissionSchema = v14.object({
717
+ type: v14.literal("wallet"),
718
+ resourceId: v14.string(),
719
+ clientId: v14.string(),
759
720
  actions: walletActionsSchema
760
721
  });
761
- var PermissionRequestParams = v15.variant("type", [
762
- v15.object({
763
- ...v15.omit(accountPermissionSchema, ["clientId"]).entries
722
+ var PermissionRequestParams = v14.variant("type", [
723
+ v14.object({
724
+ ...v14.omit(accountPermissionSchema, ["clientId"]).entries
764
725
  }),
765
- v15.object({
766
- ...v15.omit(walletPermissionSchema, ["clientId"]).entries
726
+ v14.object({
727
+ ...v14.omit(walletPermissionSchema, ["clientId"]).entries
767
728
  })
768
729
  ]);
769
- var permission = v15.variant("type", [accountPermissionSchema, walletPermissionSchema]);
730
+ var permission = v14.variant("type", [accountPermissionSchema, walletPermissionSchema]);
770
731
  var requestPermissionsMethodName = "wallet_requestPermissions";
771
- var requestPermissionsParamsSchema = v15.nullish(v15.array(PermissionRequestParams));
772
- var requestPermissionsResultSchema = v15.literal(true);
773
- var requestPermissionsRequestMessageSchema = v15.object({
732
+ var requestPermissionsParamsSchema = v14.nullish(v14.array(PermissionRequestParams));
733
+ var requestPermissionsResultSchema = v14.literal(true);
734
+ var requestPermissionsRequestMessageSchema = v14.object({
774
735
  ...rpcRequestMessageSchema.entries,
775
- ...v15.object({
776
- method: v15.literal(requestPermissionsMethodName),
736
+ ...v14.object({
737
+ method: v14.literal(requestPermissionsMethodName),
777
738
  params: requestPermissionsParamsSchema,
778
- id: v15.string()
739
+ id: v14.string()
779
740
  }).entries
780
741
  });
781
742
  var renouncePermissionsMethodName = "wallet_renouncePermissions";
782
- var renouncePermissionsParamsSchema = v15.nullish(v15.null());
783
- var renouncePermissionsResultSchema = v15.nullish(v15.null());
784
- var renouncePermissionsRequestMessageSchema = v15.object({
743
+ var renouncePermissionsParamsSchema = v14.nullish(v14.null());
744
+ var renouncePermissionsResultSchema = v14.nullish(v14.null());
745
+ var renouncePermissionsRequestMessageSchema = v14.object({
785
746
  ...rpcRequestMessageSchema.entries,
786
- ...v15.object({
787
- method: v15.literal(renouncePermissionsMethodName),
747
+ ...v14.object({
748
+ method: v14.literal(renouncePermissionsMethodName),
788
749
  params: renouncePermissionsParamsSchema,
789
- id: v15.string()
750
+ id: v14.string()
790
751
  }).entries
791
752
  });
792
753
  var disconnectMethodName = "wallet_disconnect";
793
- var disconnectParamsSchema = v15.nullish(v15.null());
794
- var disconnectResultSchema = v15.nullish(v15.null());
795
- var disconnectRequestMessageSchema = v15.object({
754
+ var disconnectParamsSchema = v14.nullish(v14.null());
755
+ var disconnectResultSchema = v14.nullish(v14.null());
756
+ var disconnectRequestMessageSchema = v14.object({
796
757
  ...rpcRequestMessageSchema.entries,
797
- ...v15.object({
798
- method: v15.literal(disconnectMethodName),
758
+ ...v14.object({
759
+ method: v14.literal(disconnectMethodName),
799
760
  params: disconnectParamsSchema,
800
- id: v15.string()
761
+ id: v14.string()
801
762
  }).entries
802
763
  });
803
764
  var getWalletTypeMethodName = "wallet_getWalletType";
804
- var getWalletTypeParamsSchema = v15.nullish(v15.null());
765
+ var getWalletTypeParamsSchema = v14.nullish(v14.null());
805
766
  var getWalletTypeResultSchema = walletTypeSchema;
806
- var getWalletTypeRequestMessageSchema = v15.object({
767
+ var getWalletTypeRequestMessageSchema = v14.object({
807
768
  ...rpcRequestMessageSchema.entries,
808
- ...v15.object({
809
- method: v15.literal(getWalletTypeMethodName),
769
+ ...v14.object({
770
+ method: v14.literal(getWalletTypeMethodName),
810
771
  params: getWalletTypeParamsSchema,
811
- id: v15.string()
772
+ id: v14.string()
812
773
  }).entries
813
774
  });
814
775
  var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
815
- var getCurrentPermissionsParamsSchema = v15.nullish(v15.null());
816
- var getCurrentPermissionsResultSchema = v15.array(permission);
817
- var getCurrentPermissionsRequestMessageSchema = v15.object({
776
+ var getCurrentPermissionsParamsSchema = v14.nullish(v14.null());
777
+ var getCurrentPermissionsResultSchema = v14.array(permission);
778
+ var getCurrentPermissionsRequestMessageSchema = v14.object({
818
779
  ...rpcRequestMessageSchema.entries,
819
- ...v15.object({
820
- method: v15.literal(getCurrentPermissionsMethodName),
780
+ ...v14.object({
781
+ method: v14.literal(getCurrentPermissionsMethodName),
821
782
  params: getCurrentPermissionsParamsSchema,
822
- id: v15.string()
783
+ id: v14.string()
823
784
  }).entries
824
785
  });
825
786
  var getAccountMethodName = "wallet_getAccount";
826
- var getAccountParamsSchema = v15.nullish(v15.null());
827
- var getAccountResultSchema = v15.object({
828
- id: v15.string(),
829
- addresses: v15.array(addressSchema),
787
+ var getAccountParamsSchema = v14.nullish(v14.null());
788
+ var getAccountResultSchema = v14.object({
789
+ id: v14.string(),
790
+ addresses: v14.array(addressSchema),
830
791
  walletType: walletTypeSchema
831
792
  });
832
- var getAccountRequestMessageSchema = v15.object({
793
+ var getAccountRequestMessageSchema = v14.object({
833
794
  ...rpcRequestMessageSchema.entries,
834
- ...v15.object({
835
- method: v15.literal(getAccountMethodName),
795
+ ...v14.object({
796
+ method: v14.literal(getAccountMethodName),
836
797
  params: getAccountParamsSchema,
837
- id: v15.string()
798
+ id: v14.string()
838
799
  }).entries
839
800
  });
840
801
  var connectMethodName = "wallet_connect";
841
- var connectParamsSchema = v15.nullish(
842
- v15.object({
843
- permissions: v15.optional(v15.array(PermissionRequestParams)),
844
- addresses: v15.optional(v15.array(v15.enum(AddressPurpose))),
845
- message: v15.optional(
846
- v15.pipe(v15.string(), v15.maxLength(80, "The message must not exceed 80 characters."))
802
+ var connectParamsSchema = v14.nullish(
803
+ v14.object({
804
+ permissions: v14.optional(v14.array(PermissionRequestParams)),
805
+ addresses: v14.optional(v14.array(v14.enum(AddressPurpose))),
806
+ message: v14.optional(
807
+ v14.pipe(v14.string(), v14.maxLength(80, "The message must not exceed 80 characters."))
847
808
  )
848
809
  })
849
810
  );
850
811
  var connectResultSchema = getAccountResultSchema;
851
- var connectRequestMessageSchema = v15.object({
812
+ var connectRequestMessageSchema = v14.object({
852
813
  ...rpcRequestMessageSchema.entries,
853
- ...v15.object({
854
- method: v15.literal(connectMethodName),
814
+ ...v14.object({
815
+ method: v14.literal(connectMethodName),
855
816
  params: connectParamsSchema,
856
- id: v15.string()
817
+ id: v14.string()
857
818
  }).entries
858
819
  });
859
820
 
860
821
  // src/request/types/runesMethods/etch.ts
861
- import * as v16 from "valibot";
822
+ import * as v15 from "valibot";
862
823
  var runesEtchMethodName = "runes_etch";
863
- var etchTermsSchema = v16.object({
864
- amount: v16.string(),
865
- cap: v16.string(),
866
- heightStart: v16.optional(v16.string()),
867
- heightEnd: v16.optional(v16.string()),
868
- offsetStart: v16.optional(v16.string()),
869
- offsetEnd: v16.optional(v16.string())
870
- });
871
- var inscriptionDetailsSchema = v16.object({
872
- contentType: v16.string(),
873
- contentBase64: v16.string()
874
- });
875
- var runesEtchParamsSchema = v16.object({
876
- runeName: v16.string(),
877
- divisibility: v16.optional(v16.number()),
878
- symbol: v16.optional(v16.string()),
879
- premine: v16.optional(v16.string()),
880
- isMintable: v16.boolean(),
881
- delegateInscriptionId: v16.optional(v16.string()),
882
- destinationAddress: v16.string(),
883
- refundAddress: v16.string(),
884
- feeRate: v16.number(),
885
- appServiceFee: v16.optional(v16.number()),
886
- appServiceFeeAddress: v16.optional(v16.string()),
887
- terms: v16.optional(etchTermsSchema),
888
- inscriptionDetails: v16.optional(inscriptionDetailsSchema),
889
- network: v16.optional(v16.enum(BitcoinNetworkType))
890
- });
891
- var runesEtchResultSchema = v16.object({
892
- orderId: v16.string(),
893
- fundTransactionId: v16.string(),
894
- fundingAddress: v16.string()
895
- });
896
- var runesEtchRequestMessageSchema = v16.object({
824
+ var etchTermsSchema = v15.object({
825
+ amount: v15.string(),
826
+ cap: v15.string(),
827
+ heightStart: v15.optional(v15.string()),
828
+ heightEnd: v15.optional(v15.string()),
829
+ offsetStart: v15.optional(v15.string()),
830
+ offsetEnd: v15.optional(v15.string())
831
+ });
832
+ var inscriptionDetailsSchema = v15.object({
833
+ contentType: v15.string(),
834
+ contentBase64: v15.string()
835
+ });
836
+ var runesEtchParamsSchema = v15.object({
837
+ runeName: v15.string(),
838
+ divisibility: v15.optional(v15.number()),
839
+ symbol: v15.optional(v15.string()),
840
+ premine: v15.optional(v15.string()),
841
+ isMintable: v15.boolean(),
842
+ delegateInscriptionId: v15.optional(v15.string()),
843
+ destinationAddress: v15.string(),
844
+ refundAddress: v15.string(),
845
+ feeRate: v15.number(),
846
+ appServiceFee: v15.optional(v15.number()),
847
+ appServiceFeeAddress: v15.optional(v15.string()),
848
+ terms: v15.optional(etchTermsSchema),
849
+ inscriptionDetails: v15.optional(inscriptionDetailsSchema),
850
+ network: v15.optional(v15.enum(BitcoinNetworkType))
851
+ });
852
+ var runesEtchResultSchema = v15.object({
853
+ orderId: v15.string(),
854
+ fundTransactionId: v15.string(),
855
+ fundingAddress: v15.string()
856
+ });
857
+ var runesEtchRequestMessageSchema = v15.object({
897
858
  ...rpcRequestMessageSchema.entries,
898
- ...v16.object({
899
- method: v16.literal(runesEtchMethodName),
859
+ ...v15.object({
860
+ method: v15.literal(runesEtchMethodName),
900
861
  params: runesEtchParamsSchema,
901
- id: v16.string()
862
+ id: v15.string()
902
863
  }).entries
903
864
  });
904
865
 
905
866
  // src/request/types/runesMethods/getBalance.ts
906
- import * as v17 from "valibot";
867
+ import * as v16 from "valibot";
907
868
  var runesGetBalanceMethodName = "runes_getBalance";
908
- var runesGetBalanceParamsSchema = v17.nullish(v17.null());
909
- var runesGetBalanceResultSchema = v17.object({
910
- balances: v17.array(
911
- v17.object({
912
- runeName: v17.string(),
913
- amount: v17.string(),
914
- divisibility: v17.number(),
915
- symbol: v17.string(),
916
- inscriptionId: v17.nullish(v17.string())
869
+ var runesGetBalanceParamsSchema = v16.nullish(v16.null());
870
+ var runesGetBalanceResultSchema = v16.object({
871
+ balances: v16.array(
872
+ v16.object({
873
+ runeName: v16.string(),
874
+ amount: v16.string(),
875
+ divisibility: v16.number(),
876
+ symbol: v16.string(),
877
+ inscriptionId: v16.nullish(v16.string())
917
878
  })
918
879
  )
919
880
  });
920
- var runesGetBalanceRequestMessageSchema = v17.object({
881
+ var runesGetBalanceRequestMessageSchema = v16.object({
921
882
  ...rpcRequestMessageSchema.entries,
922
- ...v17.object({
923
- method: v17.literal(runesGetBalanceMethodName),
883
+ ...v16.object({
884
+ method: v16.literal(runesGetBalanceMethodName),
924
885
  params: runesGetBalanceParamsSchema,
925
- id: v17.string()
886
+ id: v16.string()
926
887
  }).entries
927
888
  });
928
889
 
929
890
  // src/request/types/runesMethods/mint.ts
930
- import * as v18 from "valibot";
891
+ import * as v17 from "valibot";
931
892
  var runesMintMethodName = "runes_mint";
932
- var runesMintParamsSchema = v18.object({
933
- appServiceFee: v18.optional(v18.number()),
934
- appServiceFeeAddress: v18.optional(v18.string()),
935
- destinationAddress: v18.string(),
936
- feeRate: v18.number(),
937
- refundAddress: v18.string(),
938
- repeats: v18.number(),
939
- runeName: v18.string(),
940
- network: v18.optional(v18.enum(BitcoinNetworkType))
941
- });
942
- var runesMintResultSchema = v18.object({
943
- orderId: v18.string(),
944
- fundTransactionId: v18.string(),
945
- fundingAddress: v18.string()
946
- });
947
- var runesMintRequestMessageSchema = v18.object({
893
+ var runesMintParamsSchema = v17.object({
894
+ appServiceFee: v17.optional(v17.number()),
895
+ appServiceFeeAddress: v17.optional(v17.string()),
896
+ destinationAddress: v17.string(),
897
+ feeRate: v17.number(),
898
+ refundAddress: v17.string(),
899
+ repeats: v17.number(),
900
+ runeName: v17.string(),
901
+ network: v17.optional(v17.enum(BitcoinNetworkType))
902
+ });
903
+ var runesMintResultSchema = v17.object({
904
+ orderId: v17.string(),
905
+ fundTransactionId: v17.string(),
906
+ fundingAddress: v17.string()
907
+ });
908
+ var runesMintRequestMessageSchema = v17.object({
948
909
  ...rpcRequestMessageSchema.entries,
949
- ...v18.object({
950
- method: v18.literal(runesMintMethodName),
910
+ ...v17.object({
911
+ method: v17.literal(runesMintMethodName),
951
912
  params: runesMintParamsSchema,
952
- id: v18.string()
913
+ id: v17.string()
953
914
  }).entries
954
915
  });
955
916
 
956
917
  // src/request/types/runesMethods/transfer.ts
957
- import * as v19 from "valibot";
918
+ import * as v18 from "valibot";
958
919
  var runesTransferMethodName = "runes_transfer";
959
- var runesTransferParamsSchema = v19.object({
960
- recipients: v19.array(
961
- v19.object({
962
- runeName: v19.string(),
963
- amount: v19.string(),
964
- address: v19.string()
920
+ var runesTransferParamsSchema = v18.object({
921
+ recipients: v18.array(
922
+ v18.object({
923
+ runeName: v18.string(),
924
+ amount: v18.string(),
925
+ address: v18.string()
965
926
  })
966
927
  )
967
928
  });
968
- var runesTransferResultSchema = v19.object({
969
- txid: v19.string()
929
+ var runesTransferResultSchema = v18.object({
930
+ txid: v18.string()
970
931
  });
971
- var runesTransferRequestMessageSchema = v19.object({
932
+ var runesTransferRequestMessageSchema = v18.object({
972
933
  ...rpcRequestMessageSchema.entries,
973
- ...v19.object({
974
- method: v19.literal(runesTransferMethodName),
934
+ ...v18.object({
935
+ method: v18.literal(runesTransferMethodName),
975
936
  params: runesTransferParamsSchema,
976
- id: v19.string()
937
+ id: v18.string()
977
938
  }).entries
978
939
  });
979
940
 
980
941
  // src/request/types/ordinalsMethods.ts
981
- import * as v20 from "valibot";
942
+ import * as v19 from "valibot";
982
943
  var getInscriptionsMethodName = "ord_getInscriptions";
983
- var getInscriptionsParamsSchema = v20.object({
984
- offset: v20.number(),
985
- limit: v20.number()
986
- });
987
- var getInscriptionsResultSchema = v20.object({
988
- total: v20.number(),
989
- limit: v20.number(),
990
- offset: v20.number(),
991
- inscriptions: v20.array(
992
- v20.object({
993
- inscriptionId: v20.string(),
994
- inscriptionNumber: v20.string(),
995
- address: v20.string(),
996
- collectionName: v20.optional(v20.string()),
997
- postage: v20.string(),
998
- contentLength: v20.string(),
999
- contentType: v20.string(),
1000
- timestamp: v20.number(),
1001
- offset: v20.number(),
1002
- genesisTransaction: v20.string(),
1003
- output: v20.string()
944
+ var getInscriptionsParamsSchema = v19.object({
945
+ offset: v19.number(),
946
+ limit: v19.number()
947
+ });
948
+ var getInscriptionsResultSchema = v19.object({
949
+ total: v19.number(),
950
+ limit: v19.number(),
951
+ offset: v19.number(),
952
+ inscriptions: v19.array(
953
+ v19.object({
954
+ inscriptionId: v19.string(),
955
+ inscriptionNumber: v19.string(),
956
+ address: v19.string(),
957
+ collectionName: v19.optional(v19.string()),
958
+ postage: v19.string(),
959
+ contentLength: v19.string(),
960
+ contentType: v19.string(),
961
+ timestamp: v19.number(),
962
+ offset: v19.number(),
963
+ genesisTransaction: v19.string(),
964
+ output: v19.string()
1004
965
  })
1005
966
  )
1006
967
  });
1007
- var getInscriptionsRequestMessageSchema = v20.object({
968
+ var getInscriptionsRequestMessageSchema = v19.object({
1008
969
  ...rpcRequestMessageSchema.entries,
1009
- ...v20.object({
1010
- method: v20.literal(getInscriptionsMethodName),
970
+ ...v19.object({
971
+ method: v19.literal(getInscriptionsMethodName),
1011
972
  params: getInscriptionsParamsSchema,
1012
- id: v20.string()
973
+ id: v19.string()
1013
974
  }).entries
1014
975
  });
1015
976
  var sendInscriptionsMethodName = "ord_sendInscriptions";
1016
- var sendInscriptionsParamsSchema = v20.object({
1017
- transfers: v20.array(
1018
- v20.object({
1019
- address: v20.string(),
1020
- inscriptionId: v20.string()
977
+ var sendInscriptionsParamsSchema = v19.object({
978
+ transfers: v19.array(
979
+ v19.object({
980
+ address: v19.string(),
981
+ inscriptionId: v19.string()
1021
982
  })
1022
983
  )
1023
984
  });
1024
- var sendInscriptionsResultSchema = v20.object({
1025
- txid: v20.string()
985
+ var sendInscriptionsResultSchema = v19.object({
986
+ txid: v19.string()
1026
987
  });
1027
- var sendInscriptionsRequestMessageSchema = v20.object({
988
+ var sendInscriptionsRequestMessageSchema = v19.object({
1028
989
  ...rpcRequestMessageSchema.entries,
1029
- ...v20.object({
1030
- method: v20.literal(sendInscriptionsMethodName),
990
+ ...v19.object({
991
+ method: v19.literal(sendInscriptionsMethodName),
1031
992
  params: sendInscriptionsParamsSchema,
1032
- id: v20.string()
993
+ id: v19.string()
1033
994
  }).entries
1034
995
  });
1035
996
 
@@ -1046,13 +1007,13 @@ var request = async (method, params, providerId) => {
1046
1007
  throw new Error("A wallet method is required");
1047
1008
  }
1048
1009
  const response = await provider.request(method, params);
1049
- if (v21.is(rpcErrorResponseMessageSchema, response)) {
1010
+ if (v20.is(rpcErrorResponseMessageSchema, response)) {
1050
1011
  return {
1051
1012
  status: "error",
1052
1013
  error: response.error
1053
1014
  };
1054
1015
  }
1055
- if (v21.is(rpcSuccessResponseMessageSchema, response)) {
1016
+ if (v20.is(rpcSuccessResponseMessageSchema, response)) {
1056
1017
  return {
1057
1018
  status: "success",
1058
1019
  result: response.result
@@ -1092,7 +1053,12 @@ var urlNetworkSuffix = {
1092
1053
  ["Testnet" /* Testnet */]: "-testnet",
1093
1054
  ["Signet" /* Signet */]: "-signet"
1094
1055
  };
1095
- var ORDINALS_API_BASE_URL = (network = "Mainnet" /* Mainnet */) => `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
1056
+ var ORDINALS_API_BASE_URL = (network = "Mainnet" /* Mainnet */) => {
1057
+ if (network === "Regtest" /* Regtest */) {
1058
+ throw new Error("Ordinals API does not support regtest network");
1059
+ }
1060
+ return `https://ordinals${urlNetworkSuffix[network]}.xverse.app/v1`;
1061
+ };
1096
1062
  var RunesApi = class {
1097
1063
  client;
1098
1064
  constructor(network) {
@@ -2143,10 +2109,6 @@ export {
2143
2109
  stxSignTransactionParamsSchema,
2144
2110
  stxSignTransactionRequestMessageSchema,
2145
2111
  stxSignTransactionResultSchema,
2146
- stxSignTransactionsMethodName,
2147
- stxSignTransactionsParamsSchema,
2148
- stxSignTransactionsRequestMessageSchema,
2149
- stxSignTransactionsResultSchema,
2150
2112
  stxTransferStxMethodName,
2151
2113
  stxTransferStxParamsSchema,
2152
2114
  stxTransferStxRequestMessageSchema,