@sats-connect/core 0.4.0 → 0.4.1-06b81c7

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