@sats-connect/core 0.4.0 → 0.4.1-364d53c

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