@sats-connect/core 0.14.1 → 0.16.0-2dd02aa
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.d.mts +196 -128
- package/dist/index.d.ts +196 -128
- package/dist/index.js +845 -765
- package/dist/index.mjs +841 -765
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167,6 +167,10 @@ __export(index_exports, {
|
|
|
167
167
|
signMessageParamsSchema: () => signMessageParamsSchema,
|
|
168
168
|
signMessageRequestMessageSchema: () => signMessageRequestMessageSchema,
|
|
169
169
|
signMessageResultSchema: () => signMessageResultSchema,
|
|
170
|
+
signMultipleMessagesMethodName: () => signMultipleMessagesMethodName,
|
|
171
|
+
signMultipleMessagesParamsSchema: () => signMultipleMessagesParamsSchema,
|
|
172
|
+
signMultipleMessagesRequestMessageSchema: () => signMultipleMessagesRequestMessageSchema,
|
|
173
|
+
signMultipleMessagesResultSchema: () => signMultipleMessagesResultSchema,
|
|
170
174
|
signMultipleTransactions: () => signMultipleTransactions,
|
|
171
175
|
signPsbtMethodName: () => signPsbtMethodName,
|
|
172
176
|
signPsbtParamsSchema: () => signPsbtParamsSchema,
|
|
@@ -274,7 +278,7 @@ __export(index_exports, {
|
|
|
274
278
|
module.exports = __toCommonJS(index_exports);
|
|
275
279
|
|
|
276
280
|
// src/request/index.ts
|
|
277
|
-
var
|
|
281
|
+
var v48 = __toESM(require("valibot"));
|
|
278
282
|
|
|
279
283
|
// src/provider/types.ts
|
|
280
284
|
var v4 = __toESM(require("valibot"));
|
|
@@ -517,889 +521,961 @@ var sanitizeAddressPurposeRequest = (method, params) => {
|
|
|
517
521
|
return { method, params };
|
|
518
522
|
};
|
|
519
523
|
|
|
520
|
-
// src/request/types/btcMethods.ts
|
|
521
|
-
var
|
|
524
|
+
// src/request/types/btcMethods/common.ts
|
|
525
|
+
var MessageSigningProtocols = /* @__PURE__ */ ((MessageSigningProtocols2) => {
|
|
526
|
+
MessageSigningProtocols2["ECDSA"] = "ECDSA";
|
|
527
|
+
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
528
|
+
return MessageSigningProtocols2;
|
|
529
|
+
})(MessageSigningProtocols || {});
|
|
522
530
|
|
|
523
|
-
// src/request/types/
|
|
531
|
+
// src/request/types/btcMethods/getAccounts.ts
|
|
524
532
|
var v5 = __toESM(require("valibot"));
|
|
525
|
-
var
|
|
526
|
-
|
|
533
|
+
var getAccountsMethodName = "getAccounts";
|
|
534
|
+
var getAccountsParamsSchema = v5.object({
|
|
535
|
+
/**
|
|
536
|
+
* The purposes for which to generate addresses. See
|
|
537
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
538
|
+
*/
|
|
539
|
+
purposes: v5.array(v5.enum(AddressPurpose)),
|
|
540
|
+
/**
|
|
541
|
+
* A message to be displayed to the user in the request prompt.
|
|
542
|
+
*/
|
|
543
|
+
message: v5.optional(v5.string())
|
|
527
544
|
});
|
|
528
|
-
var
|
|
529
|
-
|
|
545
|
+
var getAccountsResultSchema = v5.array(
|
|
546
|
+
v5.object({
|
|
547
|
+
...addressSchema.entries,
|
|
548
|
+
...v5.object({
|
|
549
|
+
walletType: walletTypeSchema
|
|
550
|
+
}).entries
|
|
551
|
+
})
|
|
552
|
+
);
|
|
553
|
+
var getAccountsRequestMessageSchema = v5.object({
|
|
554
|
+
...rpcRequestMessageSchema.entries,
|
|
555
|
+
...v5.object({
|
|
556
|
+
method: v5.literal(getAccountsMethodName),
|
|
557
|
+
params: getAccountsParamsSchema,
|
|
558
|
+
id: v5.string()
|
|
559
|
+
}).entries
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
// src/request/types/btcMethods/getAddresses.ts
|
|
563
|
+
var v7 = __toESM(require("valibot"));
|
|
564
|
+
|
|
565
|
+
// src/request/types/walletMethods.ts
|
|
566
|
+
var v6 = __toESM(require("valibot"));
|
|
567
|
+
var accountActionsSchema = v6.object({
|
|
568
|
+
read: v6.optional(v6.boolean())
|
|
530
569
|
});
|
|
531
|
-
var
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
570
|
+
var walletActionsSchema = v6.object({
|
|
571
|
+
readNetwork: v6.optional(v6.boolean())
|
|
572
|
+
});
|
|
573
|
+
var accountPermissionSchema = v6.object({
|
|
574
|
+
type: v6.literal("account"),
|
|
575
|
+
resourceId: v6.string(),
|
|
576
|
+
clientId: v6.string(),
|
|
535
577
|
actions: accountActionsSchema
|
|
536
578
|
});
|
|
537
|
-
var walletPermissionSchema =
|
|
538
|
-
type:
|
|
539
|
-
resourceId:
|
|
540
|
-
clientId:
|
|
579
|
+
var walletPermissionSchema = v6.object({
|
|
580
|
+
type: v6.literal("wallet"),
|
|
581
|
+
resourceId: v6.string(),
|
|
582
|
+
clientId: v6.string(),
|
|
541
583
|
actions: walletActionsSchema
|
|
542
584
|
});
|
|
543
|
-
var PermissionRequestParams =
|
|
544
|
-
|
|
545
|
-
...
|
|
585
|
+
var PermissionRequestParams = v6.variant("type", [
|
|
586
|
+
v6.object({
|
|
587
|
+
...v6.omit(accountPermissionSchema, ["clientId"]).entries
|
|
546
588
|
}),
|
|
547
|
-
|
|
548
|
-
...
|
|
589
|
+
v6.object({
|
|
590
|
+
...v6.omit(walletPermissionSchema, ["clientId"]).entries
|
|
549
591
|
})
|
|
550
592
|
]);
|
|
551
|
-
var permission =
|
|
593
|
+
var permission = v6.variant("type", [accountPermissionSchema, walletPermissionSchema]);
|
|
552
594
|
var requestPermissionsMethodName = "wallet_requestPermissions";
|
|
553
|
-
var requestPermissionsParamsSchema =
|
|
554
|
-
var requestPermissionsResultSchema =
|
|
555
|
-
var requestPermissionsRequestMessageSchema =
|
|
595
|
+
var requestPermissionsParamsSchema = v6.nullish(v6.array(PermissionRequestParams));
|
|
596
|
+
var requestPermissionsResultSchema = v6.literal(true);
|
|
597
|
+
var requestPermissionsRequestMessageSchema = v6.object({
|
|
556
598
|
...rpcRequestMessageSchema.entries,
|
|
557
|
-
...
|
|
558
|
-
method:
|
|
599
|
+
...v6.object({
|
|
600
|
+
method: v6.literal(requestPermissionsMethodName),
|
|
559
601
|
params: requestPermissionsParamsSchema,
|
|
560
|
-
id:
|
|
602
|
+
id: v6.string()
|
|
561
603
|
}).entries
|
|
562
604
|
});
|
|
563
605
|
var renouncePermissionsMethodName = "wallet_renouncePermissions";
|
|
564
|
-
var renouncePermissionsParamsSchema =
|
|
565
|
-
var renouncePermissionsResultSchema =
|
|
566
|
-
var renouncePermissionsRequestMessageSchema =
|
|
606
|
+
var renouncePermissionsParamsSchema = v6.nullish(v6.null());
|
|
607
|
+
var renouncePermissionsResultSchema = v6.nullish(v6.null());
|
|
608
|
+
var renouncePermissionsRequestMessageSchema = v6.object({
|
|
567
609
|
...rpcRequestMessageSchema.entries,
|
|
568
|
-
...
|
|
569
|
-
method:
|
|
610
|
+
...v6.object({
|
|
611
|
+
method: v6.literal(renouncePermissionsMethodName),
|
|
570
612
|
params: renouncePermissionsParamsSchema,
|
|
571
|
-
id:
|
|
613
|
+
id: v6.string()
|
|
572
614
|
}).entries
|
|
573
615
|
});
|
|
574
616
|
var disconnectMethodName = "wallet_disconnect";
|
|
575
|
-
var disconnectParamsSchema =
|
|
576
|
-
var disconnectResultSchema =
|
|
577
|
-
var disconnectRequestMessageSchema =
|
|
617
|
+
var disconnectParamsSchema = v6.nullish(v6.null());
|
|
618
|
+
var disconnectResultSchema = v6.nullish(v6.null());
|
|
619
|
+
var disconnectRequestMessageSchema = v6.object({
|
|
578
620
|
...rpcRequestMessageSchema.entries,
|
|
579
|
-
...
|
|
580
|
-
method:
|
|
621
|
+
...v6.object({
|
|
622
|
+
method: v6.literal(disconnectMethodName),
|
|
581
623
|
params: disconnectParamsSchema,
|
|
582
|
-
id:
|
|
624
|
+
id: v6.string()
|
|
583
625
|
}).entries
|
|
584
626
|
});
|
|
585
627
|
var getWalletTypeMethodName = "wallet_getWalletType";
|
|
586
|
-
var getWalletTypeParamsSchema =
|
|
628
|
+
var getWalletTypeParamsSchema = v6.nullish(v6.null());
|
|
587
629
|
var getWalletTypeResultSchema = walletTypeSchema;
|
|
588
|
-
var getWalletTypeRequestMessageSchema =
|
|
630
|
+
var getWalletTypeRequestMessageSchema = v6.object({
|
|
589
631
|
...rpcRequestMessageSchema.entries,
|
|
590
|
-
...
|
|
591
|
-
method:
|
|
632
|
+
...v6.object({
|
|
633
|
+
method: v6.literal(getWalletTypeMethodName),
|
|
592
634
|
params: getWalletTypeParamsSchema,
|
|
593
|
-
id:
|
|
635
|
+
id: v6.string()
|
|
594
636
|
}).entries
|
|
595
637
|
});
|
|
596
638
|
var getCurrentPermissionsMethodName = "wallet_getCurrentPermissions";
|
|
597
|
-
var getCurrentPermissionsParamsSchema =
|
|
598
|
-
var getCurrentPermissionsResultSchema =
|
|
599
|
-
var getCurrentPermissionsRequestMessageSchema =
|
|
639
|
+
var getCurrentPermissionsParamsSchema = v6.nullish(v6.null());
|
|
640
|
+
var getCurrentPermissionsResultSchema = v6.array(permission);
|
|
641
|
+
var getCurrentPermissionsRequestMessageSchema = v6.object({
|
|
600
642
|
...rpcRequestMessageSchema.entries,
|
|
601
|
-
...
|
|
602
|
-
method:
|
|
643
|
+
...v6.object({
|
|
644
|
+
method: v6.literal(getCurrentPermissionsMethodName),
|
|
603
645
|
params: getCurrentPermissionsParamsSchema,
|
|
604
|
-
id:
|
|
646
|
+
id: v6.string()
|
|
605
647
|
}).entries
|
|
606
648
|
});
|
|
607
649
|
var getNetworkMethodName = "wallet_getNetwork";
|
|
608
|
-
var getNetworkParamsSchema =
|
|
609
|
-
var getNetworkResultSchema =
|
|
610
|
-
bitcoin:
|
|
611
|
-
name:
|
|
650
|
+
var getNetworkParamsSchema = v6.nullish(v6.null());
|
|
651
|
+
var getNetworkResultSchema = v6.object({
|
|
652
|
+
bitcoin: v6.object({
|
|
653
|
+
name: v6.enum(BitcoinNetworkType)
|
|
612
654
|
}),
|
|
613
|
-
stacks:
|
|
614
|
-
name:
|
|
655
|
+
stacks: v6.object({
|
|
656
|
+
name: v6.enum(StacksNetworkType)
|
|
615
657
|
}),
|
|
616
|
-
spark:
|
|
617
|
-
name:
|
|
658
|
+
spark: v6.object({
|
|
659
|
+
name: v6.enum(SparkNetworkType)
|
|
618
660
|
})
|
|
619
661
|
});
|
|
620
|
-
var getNetworkRequestMessageSchema =
|
|
662
|
+
var getNetworkRequestMessageSchema = v6.object({
|
|
621
663
|
...rpcRequestMessageSchema.entries,
|
|
622
|
-
...
|
|
623
|
-
method:
|
|
664
|
+
...v6.object({
|
|
665
|
+
method: v6.literal(getNetworkMethodName),
|
|
624
666
|
params: getNetworkParamsSchema,
|
|
625
|
-
id:
|
|
667
|
+
id: v6.string()
|
|
626
668
|
}).entries
|
|
627
669
|
});
|
|
628
670
|
var changeNetworkMethodName = "wallet_changeNetwork";
|
|
629
|
-
var changeNetworkParamsSchema =
|
|
630
|
-
name:
|
|
671
|
+
var changeNetworkParamsSchema = v6.object({
|
|
672
|
+
name: v6.enum(BitcoinNetworkType)
|
|
631
673
|
});
|
|
632
|
-
var changeNetworkResultSchema =
|
|
633
|
-
var changeNetworkRequestMessageSchema =
|
|
674
|
+
var changeNetworkResultSchema = v6.nullish(v6.null());
|
|
675
|
+
var changeNetworkRequestMessageSchema = v6.object({
|
|
634
676
|
...rpcRequestMessageSchema.entries,
|
|
635
|
-
...
|
|
636
|
-
method:
|
|
677
|
+
...v6.object({
|
|
678
|
+
method: v6.literal(changeNetworkMethodName),
|
|
637
679
|
params: changeNetworkParamsSchema,
|
|
638
|
-
id:
|
|
680
|
+
id: v6.string()
|
|
639
681
|
}).entries
|
|
640
682
|
});
|
|
641
683
|
var changeNetworkByIdMethodName = "wallet_changeNetworkById";
|
|
642
|
-
var changeNetworkByIdParamsSchema =
|
|
643
|
-
id:
|
|
684
|
+
var changeNetworkByIdParamsSchema = v6.object({
|
|
685
|
+
id: v6.string()
|
|
644
686
|
});
|
|
645
|
-
var changeNetworkByIdResultSchema =
|
|
646
|
-
var changeNetworkByIdRequestMessageSchema =
|
|
687
|
+
var changeNetworkByIdResultSchema = v6.nullish(v6.null());
|
|
688
|
+
var changeNetworkByIdRequestMessageSchema = v6.object({
|
|
647
689
|
...rpcRequestMessageSchema.entries,
|
|
648
|
-
...
|
|
649
|
-
method:
|
|
690
|
+
...v6.object({
|
|
691
|
+
method: v6.literal(changeNetworkByIdMethodName),
|
|
650
692
|
params: changeNetworkByIdParamsSchema,
|
|
651
|
-
id:
|
|
693
|
+
id: v6.string()
|
|
652
694
|
}).entries
|
|
653
695
|
});
|
|
654
696
|
var getAccountMethodName = "wallet_getAccount";
|
|
655
|
-
var getAccountParamsSchema =
|
|
656
|
-
var getAccountResultSchema =
|
|
657
|
-
id:
|
|
658
|
-
addresses:
|
|
697
|
+
var getAccountParamsSchema = v6.nullish(v6.null());
|
|
698
|
+
var getAccountResultSchema = v6.object({
|
|
699
|
+
id: v6.string(),
|
|
700
|
+
addresses: v6.array(addressSchema),
|
|
659
701
|
walletType: walletTypeSchema,
|
|
660
702
|
network: getNetworkResultSchema
|
|
661
703
|
});
|
|
662
|
-
var getAccountRequestMessageSchema =
|
|
704
|
+
var getAccountRequestMessageSchema = v6.object({
|
|
663
705
|
...rpcRequestMessageSchema.entries,
|
|
664
|
-
...
|
|
665
|
-
method:
|
|
706
|
+
...v6.object({
|
|
707
|
+
method: v6.literal(getAccountMethodName),
|
|
666
708
|
params: getAccountParamsSchema,
|
|
667
|
-
id:
|
|
709
|
+
id: v6.string()
|
|
668
710
|
}).entries
|
|
669
711
|
});
|
|
670
712
|
var connectMethodName = "wallet_connect";
|
|
671
|
-
var connectParamsSchema =
|
|
672
|
-
|
|
673
|
-
permissions:
|
|
674
|
-
addresses:
|
|
675
|
-
message:
|
|
676
|
-
|
|
713
|
+
var connectParamsSchema = v6.nullish(
|
|
714
|
+
v6.object({
|
|
715
|
+
permissions: v6.optional(v6.array(PermissionRequestParams)),
|
|
716
|
+
addresses: v6.optional(v6.array(v6.enum(AddressPurpose))),
|
|
717
|
+
message: v6.optional(
|
|
718
|
+
v6.pipe(v6.string(), v6.maxLength(80, "The message must not exceed 80 characters."))
|
|
677
719
|
),
|
|
678
|
-
network:
|
|
720
|
+
network: v6.optional(v6.enum(BitcoinNetworkType))
|
|
679
721
|
})
|
|
680
722
|
);
|
|
681
|
-
var connectResultSchema =
|
|
682
|
-
id:
|
|
683
|
-
addresses:
|
|
723
|
+
var connectResultSchema = v6.object({
|
|
724
|
+
id: v6.string(),
|
|
725
|
+
addresses: v6.array(addressSchema),
|
|
684
726
|
walletType: walletTypeSchema,
|
|
685
727
|
network: getNetworkResultSchema
|
|
686
728
|
});
|
|
687
|
-
var connectRequestMessageSchema =
|
|
729
|
+
var connectRequestMessageSchema = v6.object({
|
|
688
730
|
...rpcRequestMessageSchema.entries,
|
|
689
|
-
...
|
|
690
|
-
method:
|
|
731
|
+
...v6.object({
|
|
732
|
+
method: v6.literal(connectMethodName),
|
|
691
733
|
params: connectParamsSchema,
|
|
692
|
-
id:
|
|
734
|
+
id: v6.string()
|
|
693
735
|
}).entries
|
|
694
736
|
});
|
|
695
737
|
var addNetworkMethodName = "wallet_addNetwork";
|
|
696
|
-
var addNetworkParamsSchema =
|
|
697
|
-
|
|
698
|
-
chain:
|
|
699
|
-
type:
|
|
700
|
-
name:
|
|
701
|
-
rpcUrl:
|
|
702
|
-
rpcFallbackUrl:
|
|
703
|
-
indexerUrl:
|
|
704
|
-
blockExplorerUrl:
|
|
705
|
-
switch:
|
|
738
|
+
var addNetworkParamsSchema = v6.variant("chain", [
|
|
739
|
+
v6.object({
|
|
740
|
+
chain: v6.literal("bitcoin"),
|
|
741
|
+
type: v6.enum(BitcoinNetworkType),
|
|
742
|
+
name: v6.string(),
|
|
743
|
+
rpcUrl: v6.string(),
|
|
744
|
+
rpcFallbackUrl: v6.optional(v6.string()),
|
|
745
|
+
indexerUrl: v6.optional(v6.string()),
|
|
746
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
747
|
+
switch: v6.optional(v6.boolean())
|
|
706
748
|
}),
|
|
707
|
-
|
|
708
|
-
chain:
|
|
709
|
-
name:
|
|
710
|
-
type:
|
|
711
|
-
rpcUrl:
|
|
712
|
-
blockExplorerUrl:
|
|
713
|
-
switch:
|
|
749
|
+
v6.object({
|
|
750
|
+
chain: v6.literal("stacks"),
|
|
751
|
+
name: v6.string(),
|
|
752
|
+
type: v6.enum(StacksNetworkType),
|
|
753
|
+
rpcUrl: v6.string(),
|
|
754
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
755
|
+
switch: v6.optional(v6.boolean())
|
|
714
756
|
}),
|
|
715
|
-
|
|
716
|
-
chain:
|
|
717
|
-
name:
|
|
718
|
-
type:
|
|
719
|
-
rpcUrl:
|
|
720
|
-
blockExplorerUrl:
|
|
721
|
-
switch:
|
|
757
|
+
v6.object({
|
|
758
|
+
chain: v6.literal("starknet"),
|
|
759
|
+
name: v6.string(),
|
|
760
|
+
type: v6.enum(StarknetNetworkType),
|
|
761
|
+
rpcUrl: v6.string(),
|
|
762
|
+
blockExplorerUrl: v6.optional(v6.string()),
|
|
763
|
+
switch: v6.optional(v6.boolean())
|
|
722
764
|
})
|
|
723
765
|
]);
|
|
724
|
-
var addNetworkRequestMessageSchema =
|
|
766
|
+
var addNetworkRequestMessageSchema = v6.object({
|
|
725
767
|
...rpcRequestMessageSchema.entries,
|
|
726
|
-
...
|
|
727
|
-
method:
|
|
768
|
+
...v6.object({
|
|
769
|
+
method: v6.literal(addNetworkMethodName),
|
|
728
770
|
params: addNetworkParamsSchema,
|
|
729
|
-
id:
|
|
771
|
+
id: v6.string()
|
|
730
772
|
}).entries
|
|
731
773
|
});
|
|
732
|
-
var addNetworkResultSchema =
|
|
733
|
-
id:
|
|
774
|
+
var addNetworkResultSchema = v6.object({
|
|
775
|
+
id: v6.string()
|
|
734
776
|
});
|
|
735
777
|
|
|
736
|
-
// src/request/types/btcMethods.ts
|
|
778
|
+
// src/request/types/btcMethods/getAddresses.ts
|
|
779
|
+
var getAddressesMethodName = "getAddresses";
|
|
780
|
+
var getAddressesParamsSchema = v7.object({
|
|
781
|
+
/**
|
|
782
|
+
* The purposes for which to generate addresses. See
|
|
783
|
+
* {@linkcode AddressPurpose} for available purposes.
|
|
784
|
+
*/
|
|
785
|
+
purposes: v7.array(v7.enum(AddressPurpose)),
|
|
786
|
+
/**
|
|
787
|
+
* A message to be displayed to the user in the request prompt.
|
|
788
|
+
*/
|
|
789
|
+
message: v7.optional(v7.string())
|
|
790
|
+
});
|
|
791
|
+
var getAddressesResultSchema = v7.object({
|
|
792
|
+
/**
|
|
793
|
+
* The addresses generated for the given purposes.
|
|
794
|
+
*/
|
|
795
|
+
addresses: v7.array(addressSchema),
|
|
796
|
+
network: getNetworkResultSchema
|
|
797
|
+
});
|
|
798
|
+
var getAddressesRequestMessageSchema = v7.object({
|
|
799
|
+
...rpcRequestMessageSchema.entries,
|
|
800
|
+
...v7.object({
|
|
801
|
+
method: v7.literal(getAddressesMethodName),
|
|
802
|
+
params: getAddressesParamsSchema,
|
|
803
|
+
id: v7.string()
|
|
804
|
+
}).entries
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
// src/request/types/btcMethods/getBalance.ts
|
|
808
|
+
var v8 = __toESM(require("valibot"));
|
|
809
|
+
var getBalanceMethodName = "getBalance";
|
|
810
|
+
var getBalanceParamsSchema = v8.nullish(v8.null());
|
|
811
|
+
var getBalanceResultSchema = v8.object({
|
|
812
|
+
/**
|
|
813
|
+
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
814
|
+
* messages not supporting bigint
|
|
815
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
816
|
+
*/
|
|
817
|
+
confirmed: v8.string(),
|
|
818
|
+
/**
|
|
819
|
+
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
820
|
+
* messages not supporting bigint
|
|
821
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
822
|
+
*/
|
|
823
|
+
unconfirmed: v8.string(),
|
|
824
|
+
/**
|
|
825
|
+
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
826
|
+
* sats. Using a string due to chrome messages not supporting bigint
|
|
827
|
+
* (https://issues.chromium.org/issues/40116184).
|
|
828
|
+
*/
|
|
829
|
+
total: v8.string()
|
|
830
|
+
});
|
|
831
|
+
var getBalanceRequestMessageSchema = v8.object({
|
|
832
|
+
...rpcRequestMessageSchema.entries,
|
|
833
|
+
...v8.object({
|
|
834
|
+
method: v8.literal(getBalanceMethodName),
|
|
835
|
+
id: v8.string()
|
|
836
|
+
}).entries
|
|
837
|
+
});
|
|
838
|
+
|
|
839
|
+
// src/request/types/btcMethods/getInfo.ts
|
|
840
|
+
var v9 = __toESM(require("valibot"));
|
|
737
841
|
var ProviderPlatform = /* @__PURE__ */ ((ProviderPlatform2) => {
|
|
738
842
|
ProviderPlatform2["Web"] = "web";
|
|
739
843
|
ProviderPlatform2["Mobile"] = "mobile";
|
|
740
844
|
return ProviderPlatform2;
|
|
741
845
|
})(ProviderPlatform || {});
|
|
742
846
|
var getInfoMethodName = "getInfo";
|
|
743
|
-
var getInfoParamsSchema =
|
|
744
|
-
var getInfoResultSchema =
|
|
847
|
+
var getInfoParamsSchema = v9.nullish(v9.null());
|
|
848
|
+
var getInfoResultSchema = v9.object({
|
|
745
849
|
/**
|
|
746
850
|
* Version of the wallet.
|
|
747
851
|
*/
|
|
748
|
-
version:
|
|
852
|
+
version: v9.string(),
|
|
749
853
|
/**
|
|
750
854
|
* The platform the wallet is running on (web or mobile).
|
|
751
855
|
*/
|
|
752
|
-
platform:
|
|
856
|
+
platform: v9.optional(v9.enum(ProviderPlatform)),
|
|
753
857
|
/**
|
|
754
858
|
* [WBIP](https://wbips.netlify.app/wbips/WBIP002) methods supported by the wallet.
|
|
755
859
|
*/
|
|
756
|
-
methods:
|
|
860
|
+
methods: v9.optional(v9.array(v9.string())),
|
|
757
861
|
/**
|
|
758
862
|
* List of WBIP standards supported by the wallet. Not currently used.
|
|
759
863
|
*/
|
|
760
|
-
supports:
|
|
864
|
+
supports: v9.array(v9.string())
|
|
761
865
|
});
|
|
762
|
-
var getInfoRequestMessageSchema =
|
|
866
|
+
var getInfoRequestMessageSchema = v9.object({
|
|
763
867
|
...rpcRequestMessageSchema.entries,
|
|
764
|
-
...
|
|
765
|
-
method:
|
|
868
|
+
...v9.object({
|
|
869
|
+
method: v9.literal(getInfoMethodName),
|
|
766
870
|
params: getInfoParamsSchema,
|
|
767
|
-
id:
|
|
871
|
+
id: v9.string()
|
|
768
872
|
}).entries
|
|
769
873
|
});
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
*/
|
|
776
|
-
purposes: v6.array(v6.enum(AddressPurpose)),
|
|
874
|
+
|
|
875
|
+
// src/request/types/btcMethods/sendTransfer.ts
|
|
876
|
+
var v10 = __toESM(require("valibot"));
|
|
877
|
+
var sendTransferMethodName = "sendTransfer";
|
|
878
|
+
var sendTransferParamsSchema = v10.object({
|
|
777
879
|
/**
|
|
778
|
-
*
|
|
880
|
+
* Array of recipients to send to.
|
|
881
|
+
* The amount to send to each recipient is in satoshis.
|
|
779
882
|
*/
|
|
780
|
-
|
|
883
|
+
recipients: v10.array(
|
|
884
|
+
v10.object({
|
|
885
|
+
address: v10.string(),
|
|
886
|
+
amount: v10.number()
|
|
887
|
+
})
|
|
888
|
+
)
|
|
781
889
|
});
|
|
782
|
-
var
|
|
890
|
+
var sendTransferResultSchema = v10.object({
|
|
783
891
|
/**
|
|
784
|
-
* The
|
|
892
|
+
* The transaction id as a hex-encoded string.
|
|
785
893
|
*/
|
|
786
|
-
|
|
787
|
-
network: getNetworkResultSchema
|
|
894
|
+
txid: v10.string()
|
|
788
895
|
});
|
|
789
|
-
var
|
|
896
|
+
var sendTransferRequestMessageSchema = v10.object({
|
|
790
897
|
...rpcRequestMessageSchema.entries,
|
|
791
|
-
...
|
|
792
|
-
method:
|
|
793
|
-
params:
|
|
794
|
-
id:
|
|
898
|
+
...v10.object({
|
|
899
|
+
method: v10.literal(sendTransferMethodName),
|
|
900
|
+
params: sendTransferParamsSchema,
|
|
901
|
+
id: v10.string()
|
|
795
902
|
}).entries
|
|
796
903
|
});
|
|
904
|
+
|
|
905
|
+
// src/request/types/btcMethods/signMessage.ts
|
|
906
|
+
var v11 = __toESM(require("valibot"));
|
|
797
907
|
var signMessageMethodName = "signMessage";
|
|
798
|
-
var
|
|
799
|
-
MessageSigningProtocols2["ECDSA"] = "ECDSA";
|
|
800
|
-
MessageSigningProtocols2["BIP322"] = "BIP322";
|
|
801
|
-
return MessageSigningProtocols2;
|
|
802
|
-
})(MessageSigningProtocols || {});
|
|
803
|
-
var signMessageParamsSchema = v6.object({
|
|
908
|
+
var signMessageParamsSchema = v11.object({
|
|
804
909
|
/**
|
|
805
910
|
* The address used for signing.
|
|
806
911
|
**/
|
|
807
|
-
address:
|
|
912
|
+
address: v11.string(),
|
|
808
913
|
/**
|
|
809
914
|
* The message to sign.
|
|
810
915
|
**/
|
|
811
|
-
message:
|
|
916
|
+
message: v11.string(),
|
|
812
917
|
/**
|
|
813
918
|
* The protocol to use for signing the message.
|
|
814
919
|
*/
|
|
815
|
-
protocol:
|
|
920
|
+
protocol: v11.optional(v11.enum(MessageSigningProtocols))
|
|
816
921
|
});
|
|
817
|
-
var signMessageResultSchema =
|
|
922
|
+
var signMessageResultSchema = v11.object({
|
|
818
923
|
/**
|
|
819
924
|
* The signature of the message.
|
|
820
925
|
*/
|
|
821
|
-
signature:
|
|
926
|
+
signature: v11.string(),
|
|
822
927
|
/**
|
|
823
928
|
* hash of the message.
|
|
824
929
|
*/
|
|
825
|
-
messageHash:
|
|
930
|
+
messageHash: v11.string(),
|
|
826
931
|
/**
|
|
827
932
|
* The address used for signing.
|
|
828
933
|
*/
|
|
829
|
-
address:
|
|
934
|
+
address: v11.string(),
|
|
830
935
|
/**
|
|
831
936
|
* The protocol to use for signing the message.
|
|
832
937
|
*/
|
|
833
|
-
protocol:
|
|
938
|
+
protocol: v11.enum(MessageSigningProtocols)
|
|
834
939
|
});
|
|
835
|
-
var signMessageRequestMessageSchema =
|
|
940
|
+
var signMessageRequestMessageSchema = v11.object({
|
|
836
941
|
...rpcRequestMessageSchema.entries,
|
|
837
|
-
...
|
|
838
|
-
method:
|
|
942
|
+
...v11.object({
|
|
943
|
+
method: v11.literal(signMessageMethodName),
|
|
839
944
|
params: signMessageParamsSchema,
|
|
840
|
-
id:
|
|
945
|
+
id: v11.string()
|
|
841
946
|
}).entries
|
|
842
947
|
});
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
})
|
|
862
|
-
|
|
948
|
+
|
|
949
|
+
// src/request/types/btcMethods/signMultipleMessages.ts
|
|
950
|
+
var v12 = __toESM(require("valibot"));
|
|
951
|
+
var signMultipleMessagesMethodName = "signMultipleMessages";
|
|
952
|
+
var signMultipleMessagesParamsSchema = v12.array(
|
|
953
|
+
v12.object({
|
|
954
|
+
/**
|
|
955
|
+
* The address used for signing.
|
|
956
|
+
**/
|
|
957
|
+
address: v12.string(),
|
|
958
|
+
/**
|
|
959
|
+
* The message to sign.
|
|
960
|
+
**/
|
|
961
|
+
message: v12.string(),
|
|
962
|
+
/**
|
|
963
|
+
* The protocol to use for signing the message.
|
|
964
|
+
*/
|
|
965
|
+
protocol: v12.optional(v12.enum(MessageSigningProtocols))
|
|
966
|
+
})
|
|
967
|
+
);
|
|
968
|
+
var signMultipleMessagesResultSchema = v12.array(
|
|
969
|
+
v12.object({
|
|
970
|
+
/**
|
|
971
|
+
* The signature of the message.
|
|
972
|
+
*/
|
|
973
|
+
signature: v12.string(),
|
|
974
|
+
/**
|
|
975
|
+
* The original message which was signed.
|
|
976
|
+
*/
|
|
977
|
+
message: v12.string(),
|
|
978
|
+
/**
|
|
979
|
+
* Hash of the message.
|
|
980
|
+
*/
|
|
981
|
+
messageHash: v12.string(),
|
|
982
|
+
/**
|
|
983
|
+
* The address used for signing.
|
|
984
|
+
*/
|
|
985
|
+
address: v12.string(),
|
|
986
|
+
/**
|
|
987
|
+
* The protocol to use for signing the message.
|
|
988
|
+
*/
|
|
989
|
+
protocol: v12.enum(MessageSigningProtocols)
|
|
990
|
+
})
|
|
991
|
+
);
|
|
992
|
+
var signMultipleMessagesRequestMessageSchema = v12.object({
|
|
863
993
|
...rpcRequestMessageSchema.entries,
|
|
864
|
-
...
|
|
865
|
-
method:
|
|
866
|
-
params:
|
|
867
|
-
id:
|
|
994
|
+
...v12.object({
|
|
995
|
+
method: v12.literal(signMultipleMessagesMethodName),
|
|
996
|
+
params: signMultipleMessagesParamsSchema,
|
|
997
|
+
id: v12.string()
|
|
868
998
|
}).entries
|
|
869
999
|
});
|
|
1000
|
+
|
|
1001
|
+
// src/request/types/btcMethods/signPSBT.ts
|
|
1002
|
+
var v13 = __toESM(require("valibot"));
|
|
870
1003
|
var signPsbtMethodName = "signPsbt";
|
|
871
|
-
var signPsbtParamsSchema =
|
|
1004
|
+
var signPsbtParamsSchema = v13.object({
|
|
872
1005
|
/**
|
|
873
1006
|
* The base64 encoded PSBT to sign.
|
|
874
1007
|
*/
|
|
875
|
-
psbt:
|
|
1008
|
+
psbt: v13.string(),
|
|
876
1009
|
/**
|
|
877
1010
|
* The inputs to sign.
|
|
878
1011
|
* The key is the address and the value is an array of indexes of the inputs to sign.
|
|
879
1012
|
*/
|
|
880
|
-
signInputs:
|
|
1013
|
+
signInputs: v13.optional(v13.record(v13.string(), v13.array(v13.number()))),
|
|
881
1014
|
/**
|
|
882
1015
|
* Whether to broadcast the transaction after signing.
|
|
883
1016
|
**/
|
|
884
|
-
broadcast:
|
|
1017
|
+
broadcast: v13.optional(v13.boolean())
|
|
885
1018
|
});
|
|
886
|
-
var signPsbtResultSchema =
|
|
1019
|
+
var signPsbtResultSchema = v13.object({
|
|
887
1020
|
/**
|
|
888
1021
|
* The base64 encoded PSBT after signing.
|
|
889
1022
|
*/
|
|
890
|
-
psbt:
|
|
1023
|
+
psbt: v13.string(),
|
|
891
1024
|
/**
|
|
892
1025
|
* The transaction id as a hex-encoded string.
|
|
893
1026
|
* This is only returned if the transaction was broadcast.
|
|
894
1027
|
**/
|
|
895
|
-
txid:
|
|
1028
|
+
txid: v13.optional(v13.string())
|
|
896
1029
|
});
|
|
897
|
-
var signPsbtRequestMessageSchema =
|
|
1030
|
+
var signPsbtRequestMessageSchema = v13.object({
|
|
898
1031
|
...rpcRequestMessageSchema.entries,
|
|
899
|
-
...
|
|
900
|
-
method:
|
|
1032
|
+
...v13.object({
|
|
1033
|
+
method: v13.literal(signPsbtMethodName),
|
|
901
1034
|
params: signPsbtParamsSchema,
|
|
902
|
-
id:
|
|
903
|
-
}).entries
|
|
904
|
-
});
|
|
905
|
-
var getAccountsMethodName = "getAccounts";
|
|
906
|
-
var getAccountsParamsSchema = v6.object({
|
|
907
|
-
/**
|
|
908
|
-
* The purposes for which to generate addresses. See
|
|
909
|
-
* {@linkcode AddressPurpose} for available purposes.
|
|
910
|
-
*/
|
|
911
|
-
purposes: v6.array(v6.enum(AddressPurpose)),
|
|
912
|
-
/**
|
|
913
|
-
* A message to be displayed to the user in the request prompt.
|
|
914
|
-
*/
|
|
915
|
-
message: v6.optional(v6.string())
|
|
916
|
-
});
|
|
917
|
-
var getAccountsResultSchema = v6.array(
|
|
918
|
-
v6.object({
|
|
919
|
-
...addressSchema.entries,
|
|
920
|
-
...v6.object({
|
|
921
|
-
walletType: walletTypeSchema
|
|
922
|
-
}).entries
|
|
923
|
-
})
|
|
924
|
-
);
|
|
925
|
-
var getAccountsRequestMessageSchema = v6.object({
|
|
926
|
-
...rpcRequestMessageSchema.entries,
|
|
927
|
-
...v6.object({
|
|
928
|
-
method: v6.literal(getAccountsMethodName),
|
|
929
|
-
params: getAccountsParamsSchema,
|
|
930
|
-
id: v6.string()
|
|
931
|
-
}).entries
|
|
932
|
-
});
|
|
933
|
-
var getBalanceMethodName = "getBalance";
|
|
934
|
-
var getBalanceParamsSchema = v6.nullish(v6.null());
|
|
935
|
-
var getBalanceResultSchema = v6.object({
|
|
936
|
-
/**
|
|
937
|
-
* The confirmed balance of the wallet in sats. Using a string due to chrome
|
|
938
|
-
* messages not supporting bigint
|
|
939
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
940
|
-
*/
|
|
941
|
-
confirmed: v6.string(),
|
|
942
|
-
/**
|
|
943
|
-
* The unconfirmed balance of the wallet in sats. Using a string due to chrome
|
|
944
|
-
* messages not supporting bigint
|
|
945
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
946
|
-
*/
|
|
947
|
-
unconfirmed: v6.string(),
|
|
948
|
-
/**
|
|
949
|
-
* The total balance (both confirmed and unconfrimed UTXOs) of the wallet in
|
|
950
|
-
* sats. Using a string due to chrome messages not supporting bigint
|
|
951
|
-
* (https://issues.chromium.org/issues/40116184).
|
|
952
|
-
*/
|
|
953
|
-
total: v6.string()
|
|
954
|
-
});
|
|
955
|
-
var getBalanceRequestMessageSchema = v6.object({
|
|
956
|
-
...rpcRequestMessageSchema.entries,
|
|
957
|
-
...v6.object({
|
|
958
|
-
method: v6.literal(getBalanceMethodName),
|
|
959
|
-
id: v6.string()
|
|
1035
|
+
id: v13.string()
|
|
960
1036
|
}).entries
|
|
961
1037
|
});
|
|
962
1038
|
|
|
963
1039
|
// src/request/types/ordinalsMethods.ts
|
|
964
|
-
var
|
|
1040
|
+
var v14 = __toESM(require("valibot"));
|
|
965
1041
|
var getInscriptionsMethodName = "ord_getInscriptions";
|
|
966
|
-
var getInscriptionsParamsSchema =
|
|
967
|
-
offset:
|
|
968
|
-
limit:
|
|
969
|
-
});
|
|
970
|
-
var getInscriptionsResultSchema =
|
|
971
|
-
total:
|
|
972
|
-
limit:
|
|
973
|
-
offset:
|
|
974
|
-
inscriptions:
|
|
975
|
-
|
|
976
|
-
inscriptionId:
|
|
977
|
-
inscriptionNumber:
|
|
978
|
-
address:
|
|
979
|
-
collectionName:
|
|
980
|
-
postage:
|
|
981
|
-
contentLength:
|
|
982
|
-
contentType:
|
|
983
|
-
timestamp:
|
|
984
|
-
offset:
|
|
985
|
-
genesisTransaction:
|
|
986
|
-
output:
|
|
1042
|
+
var getInscriptionsParamsSchema = v14.object({
|
|
1043
|
+
offset: v14.number(),
|
|
1044
|
+
limit: v14.number()
|
|
1045
|
+
});
|
|
1046
|
+
var getInscriptionsResultSchema = v14.object({
|
|
1047
|
+
total: v14.number(),
|
|
1048
|
+
limit: v14.number(),
|
|
1049
|
+
offset: v14.number(),
|
|
1050
|
+
inscriptions: v14.array(
|
|
1051
|
+
v14.object({
|
|
1052
|
+
inscriptionId: v14.string(),
|
|
1053
|
+
inscriptionNumber: v14.string(),
|
|
1054
|
+
address: v14.string(),
|
|
1055
|
+
collectionName: v14.optional(v14.string()),
|
|
1056
|
+
postage: v14.string(),
|
|
1057
|
+
contentLength: v14.string(),
|
|
1058
|
+
contentType: v14.string(),
|
|
1059
|
+
timestamp: v14.number(),
|
|
1060
|
+
offset: v14.number(),
|
|
1061
|
+
genesisTransaction: v14.string(),
|
|
1062
|
+
output: v14.string()
|
|
987
1063
|
})
|
|
988
1064
|
)
|
|
989
1065
|
});
|
|
990
|
-
var getInscriptionsRequestMessageSchema =
|
|
1066
|
+
var getInscriptionsRequestMessageSchema = v14.object({
|
|
991
1067
|
...rpcRequestMessageSchema.entries,
|
|
992
|
-
...
|
|
993
|
-
method:
|
|
1068
|
+
...v14.object({
|
|
1069
|
+
method: v14.literal(getInscriptionsMethodName),
|
|
994
1070
|
params: getInscriptionsParamsSchema,
|
|
995
|
-
id:
|
|
1071
|
+
id: v14.string()
|
|
996
1072
|
}).entries
|
|
997
1073
|
});
|
|
998
1074
|
var sendInscriptionsMethodName = "ord_sendInscriptions";
|
|
999
|
-
var sendInscriptionsParamsSchema =
|
|
1000
|
-
transfers:
|
|
1001
|
-
|
|
1002
|
-
address:
|
|
1003
|
-
inscriptionId:
|
|
1075
|
+
var sendInscriptionsParamsSchema = v14.object({
|
|
1076
|
+
transfers: v14.array(
|
|
1077
|
+
v14.object({
|
|
1078
|
+
address: v14.string(),
|
|
1079
|
+
inscriptionId: v14.string()
|
|
1004
1080
|
})
|
|
1005
1081
|
)
|
|
1006
1082
|
});
|
|
1007
|
-
var sendInscriptionsResultSchema =
|
|
1008
|
-
txid:
|
|
1083
|
+
var sendInscriptionsResultSchema = v14.object({
|
|
1084
|
+
txid: v14.string()
|
|
1009
1085
|
});
|
|
1010
|
-
var sendInscriptionsRequestMessageSchema =
|
|
1086
|
+
var sendInscriptionsRequestMessageSchema = v14.object({
|
|
1011
1087
|
...rpcRequestMessageSchema.entries,
|
|
1012
|
-
...
|
|
1013
|
-
method:
|
|
1088
|
+
...v14.object({
|
|
1089
|
+
method: v14.literal(sendInscriptionsMethodName),
|
|
1014
1090
|
params: sendInscriptionsParamsSchema,
|
|
1015
|
-
id:
|
|
1091
|
+
id: v14.string()
|
|
1016
1092
|
}).entries
|
|
1017
1093
|
});
|
|
1018
1094
|
|
|
1019
1095
|
// src/request/types/runesMethods/etch.ts
|
|
1020
|
-
var
|
|
1096
|
+
var v15 = __toESM(require("valibot"));
|
|
1021
1097
|
var runesEtchMethodName = "runes_etch";
|
|
1022
|
-
var etchTermsSchema =
|
|
1023
|
-
amount:
|
|
1024
|
-
cap:
|
|
1025
|
-
heightStart:
|
|
1026
|
-
heightEnd:
|
|
1027
|
-
offsetStart:
|
|
1028
|
-
offsetEnd:
|
|
1029
|
-
});
|
|
1030
|
-
var inscriptionDetailsSchema =
|
|
1031
|
-
contentType:
|
|
1032
|
-
contentBase64:
|
|
1033
|
-
});
|
|
1034
|
-
var runesEtchParamsSchema =
|
|
1035
|
-
runeName:
|
|
1036
|
-
divisibility:
|
|
1037
|
-
symbol:
|
|
1038
|
-
premine:
|
|
1039
|
-
isMintable:
|
|
1040
|
-
delegateInscriptionId:
|
|
1041
|
-
destinationAddress:
|
|
1042
|
-
refundAddress:
|
|
1043
|
-
feeRate:
|
|
1044
|
-
appServiceFee:
|
|
1045
|
-
appServiceFeeAddress:
|
|
1046
|
-
terms:
|
|
1047
|
-
inscriptionDetails:
|
|
1048
|
-
network:
|
|
1049
|
-
});
|
|
1050
|
-
var runesEtchResultSchema =
|
|
1051
|
-
orderId:
|
|
1052
|
-
fundTransactionId:
|
|
1053
|
-
fundingAddress:
|
|
1054
|
-
});
|
|
1055
|
-
var runesEtchRequestMessageSchema =
|
|
1098
|
+
var etchTermsSchema = v15.object({
|
|
1099
|
+
amount: v15.string(),
|
|
1100
|
+
cap: v15.string(),
|
|
1101
|
+
heightStart: v15.optional(v15.string()),
|
|
1102
|
+
heightEnd: v15.optional(v15.string()),
|
|
1103
|
+
offsetStart: v15.optional(v15.string()),
|
|
1104
|
+
offsetEnd: v15.optional(v15.string())
|
|
1105
|
+
});
|
|
1106
|
+
var inscriptionDetailsSchema = v15.object({
|
|
1107
|
+
contentType: v15.string(),
|
|
1108
|
+
contentBase64: v15.string()
|
|
1109
|
+
});
|
|
1110
|
+
var runesEtchParamsSchema = v15.object({
|
|
1111
|
+
runeName: v15.string(),
|
|
1112
|
+
divisibility: v15.optional(v15.number()),
|
|
1113
|
+
symbol: v15.optional(v15.string()),
|
|
1114
|
+
premine: v15.optional(v15.string()),
|
|
1115
|
+
isMintable: v15.boolean(),
|
|
1116
|
+
delegateInscriptionId: v15.optional(v15.string()),
|
|
1117
|
+
destinationAddress: v15.string(),
|
|
1118
|
+
refundAddress: v15.string(),
|
|
1119
|
+
feeRate: v15.number(),
|
|
1120
|
+
appServiceFee: v15.optional(v15.number()),
|
|
1121
|
+
appServiceFeeAddress: v15.optional(v15.string()),
|
|
1122
|
+
terms: v15.optional(etchTermsSchema),
|
|
1123
|
+
inscriptionDetails: v15.optional(inscriptionDetailsSchema),
|
|
1124
|
+
network: v15.optional(v15.enum(BitcoinNetworkType))
|
|
1125
|
+
});
|
|
1126
|
+
var runesEtchResultSchema = v15.object({
|
|
1127
|
+
orderId: v15.string(),
|
|
1128
|
+
fundTransactionId: v15.string(),
|
|
1129
|
+
fundingAddress: v15.string()
|
|
1130
|
+
});
|
|
1131
|
+
var runesEtchRequestMessageSchema = v15.object({
|
|
1056
1132
|
...rpcRequestMessageSchema.entries,
|
|
1057
|
-
...
|
|
1058
|
-
method:
|
|
1133
|
+
...v15.object({
|
|
1134
|
+
method: v15.literal(runesEtchMethodName),
|
|
1059
1135
|
params: runesEtchParamsSchema,
|
|
1060
|
-
id:
|
|
1136
|
+
id: v15.string()
|
|
1061
1137
|
}).entries
|
|
1062
1138
|
});
|
|
1063
1139
|
|
|
1064
1140
|
// src/request/types/runesMethods/getBalance.ts
|
|
1065
|
-
var
|
|
1141
|
+
var v16 = __toESM(require("valibot"));
|
|
1066
1142
|
var runesGetBalanceMethodName = "runes_getBalance";
|
|
1067
|
-
var runesGetBalanceParamsSchema =
|
|
1068
|
-
var runesGetBalanceResultSchema =
|
|
1069
|
-
balances:
|
|
1070
|
-
|
|
1071
|
-
runeName:
|
|
1072
|
-
amount:
|
|
1073
|
-
divisibility:
|
|
1074
|
-
symbol:
|
|
1075
|
-
inscriptionId:
|
|
1076
|
-
spendableBalance:
|
|
1143
|
+
var runesGetBalanceParamsSchema = v16.nullish(v16.null());
|
|
1144
|
+
var runesGetBalanceResultSchema = v16.object({
|
|
1145
|
+
balances: v16.array(
|
|
1146
|
+
v16.object({
|
|
1147
|
+
runeName: v16.string(),
|
|
1148
|
+
amount: v16.string(),
|
|
1149
|
+
divisibility: v16.number(),
|
|
1150
|
+
symbol: v16.string(),
|
|
1151
|
+
inscriptionId: v16.nullish(v16.string()),
|
|
1152
|
+
spendableBalance: v16.string()
|
|
1077
1153
|
})
|
|
1078
1154
|
)
|
|
1079
1155
|
});
|
|
1080
|
-
var runesGetBalanceRequestMessageSchema =
|
|
1156
|
+
var runesGetBalanceRequestMessageSchema = v16.object({
|
|
1081
1157
|
...rpcRequestMessageSchema.entries,
|
|
1082
|
-
...
|
|
1083
|
-
method:
|
|
1158
|
+
...v16.object({
|
|
1159
|
+
method: v16.literal(runesGetBalanceMethodName),
|
|
1084
1160
|
params: runesGetBalanceParamsSchema,
|
|
1085
|
-
id:
|
|
1161
|
+
id: v16.string()
|
|
1086
1162
|
}).entries
|
|
1087
1163
|
});
|
|
1088
1164
|
|
|
1089
1165
|
// src/request/types/runesMethods/mint.ts
|
|
1090
|
-
var
|
|
1166
|
+
var v17 = __toESM(require("valibot"));
|
|
1091
1167
|
var runesMintMethodName = "runes_mint";
|
|
1092
|
-
var runesMintParamsSchema =
|
|
1093
|
-
appServiceFee:
|
|
1094
|
-
appServiceFeeAddress:
|
|
1095
|
-
destinationAddress:
|
|
1096
|
-
feeRate:
|
|
1097
|
-
refundAddress:
|
|
1098
|
-
repeats:
|
|
1099
|
-
runeName:
|
|
1100
|
-
network:
|
|
1101
|
-
});
|
|
1102
|
-
var runesMintResultSchema =
|
|
1103
|
-
orderId:
|
|
1104
|
-
fundTransactionId:
|
|
1105
|
-
fundingAddress:
|
|
1106
|
-
});
|
|
1107
|
-
var runesMintRequestMessageSchema =
|
|
1168
|
+
var runesMintParamsSchema = v17.object({
|
|
1169
|
+
appServiceFee: v17.optional(v17.number()),
|
|
1170
|
+
appServiceFeeAddress: v17.optional(v17.string()),
|
|
1171
|
+
destinationAddress: v17.string(),
|
|
1172
|
+
feeRate: v17.number(),
|
|
1173
|
+
refundAddress: v17.string(),
|
|
1174
|
+
repeats: v17.number(),
|
|
1175
|
+
runeName: v17.string(),
|
|
1176
|
+
network: v17.optional(v17.enum(BitcoinNetworkType))
|
|
1177
|
+
});
|
|
1178
|
+
var runesMintResultSchema = v17.object({
|
|
1179
|
+
orderId: v17.string(),
|
|
1180
|
+
fundTransactionId: v17.string(),
|
|
1181
|
+
fundingAddress: v17.string()
|
|
1182
|
+
});
|
|
1183
|
+
var runesMintRequestMessageSchema = v17.object({
|
|
1108
1184
|
...rpcRequestMessageSchema.entries,
|
|
1109
|
-
...
|
|
1110
|
-
method:
|
|
1185
|
+
...v17.object({
|
|
1186
|
+
method: v17.literal(runesMintMethodName),
|
|
1111
1187
|
params: runesMintParamsSchema,
|
|
1112
|
-
id:
|
|
1188
|
+
id: v17.string()
|
|
1113
1189
|
}).entries
|
|
1114
1190
|
});
|
|
1115
1191
|
|
|
1116
1192
|
// src/request/types/runesMethods/transfer.ts
|
|
1117
|
-
var
|
|
1193
|
+
var v18 = __toESM(require("valibot"));
|
|
1118
1194
|
var runesTransferMethodName = "runes_transfer";
|
|
1119
|
-
var runesTransferParamsSchema =
|
|
1120
|
-
recipients:
|
|
1121
|
-
|
|
1122
|
-
runeName:
|
|
1123
|
-
amount:
|
|
1124
|
-
address:
|
|
1195
|
+
var runesTransferParamsSchema = v18.object({
|
|
1196
|
+
recipients: v18.array(
|
|
1197
|
+
v18.object({
|
|
1198
|
+
runeName: v18.string(),
|
|
1199
|
+
amount: v18.string(),
|
|
1200
|
+
address: v18.string()
|
|
1125
1201
|
})
|
|
1126
1202
|
)
|
|
1127
1203
|
});
|
|
1128
|
-
var runesTransferResultSchema =
|
|
1129
|
-
txid:
|
|
1204
|
+
var runesTransferResultSchema = v18.object({
|
|
1205
|
+
txid: v18.string()
|
|
1130
1206
|
});
|
|
1131
|
-
var runesTransferRequestMessageSchema =
|
|
1207
|
+
var runesTransferRequestMessageSchema = v18.object({
|
|
1132
1208
|
...rpcRequestMessageSchema.entries,
|
|
1133
|
-
...
|
|
1134
|
-
method:
|
|
1209
|
+
...v18.object({
|
|
1210
|
+
method: v18.literal(runesTransferMethodName),
|
|
1135
1211
|
params: runesTransferParamsSchema,
|
|
1136
|
-
id:
|
|
1212
|
+
id: v18.string()
|
|
1137
1213
|
}).entries
|
|
1138
1214
|
});
|
|
1139
1215
|
|
|
1140
1216
|
// src/request/types/sparkMethods/flashnetMethods/clawbackFunds.ts
|
|
1141
|
-
var
|
|
1217
|
+
var v19 = __toESM(require("valibot"));
|
|
1142
1218
|
var sparkFlashnetClawbackFundsMethodName = "spark_flashnet_clawbackFunds";
|
|
1143
|
-
var sparkFlashnetClawbackFundsParamsSchema =
|
|
1144
|
-
sparkTransferId:
|
|
1145
|
-
lpIdentityPublicKey:
|
|
1146
|
-
});
|
|
1147
|
-
var sparkFlashnetClawbackFundsResultSchema =
|
|
1148
|
-
requestId:
|
|
1149
|
-
accepted:
|
|
1150
|
-
internalRequestId:
|
|
1151
|
-
sparkStatusTrackingId:
|
|
1152
|
-
error:
|
|
1153
|
-
});
|
|
1154
|
-
var sparkFlashnetClawbackFundsRequestMessageSchema =
|
|
1219
|
+
var sparkFlashnetClawbackFundsParamsSchema = v19.object({
|
|
1220
|
+
sparkTransferId: v19.string(),
|
|
1221
|
+
lpIdentityPublicKey: v19.string()
|
|
1222
|
+
});
|
|
1223
|
+
var sparkFlashnetClawbackFundsResultSchema = v19.object({
|
|
1224
|
+
requestId: v19.string(),
|
|
1225
|
+
accepted: v19.boolean(),
|
|
1226
|
+
internalRequestId: v19.optional(v19.string()),
|
|
1227
|
+
sparkStatusTrackingId: v19.optional(v19.string()),
|
|
1228
|
+
error: v19.optional(v19.string())
|
|
1229
|
+
});
|
|
1230
|
+
var sparkFlashnetClawbackFundsRequestMessageSchema = v19.object({
|
|
1155
1231
|
...rpcRequestMessageSchema.entries,
|
|
1156
|
-
...
|
|
1157
|
-
method:
|
|
1232
|
+
...v19.object({
|
|
1233
|
+
method: v19.literal(sparkFlashnetClawbackFundsMethodName),
|
|
1158
1234
|
params: sparkFlashnetClawbackFundsParamsSchema,
|
|
1159
|
-
id:
|
|
1235
|
+
id: v19.string()
|
|
1160
1236
|
}).entries
|
|
1161
1237
|
});
|
|
1162
1238
|
|
|
1163
1239
|
// src/request/types/sparkMethods/flashnetMethods/executeRouteSwap.ts
|
|
1164
|
-
var
|
|
1240
|
+
var v20 = __toESM(require("valibot"));
|
|
1165
1241
|
var sparkFlashnetExecuteRouteSwapMethodName = "spark_flashnet_executeRouteSwap";
|
|
1166
|
-
var sparkFlashnetExecuteRouteSwapParamsSchema =
|
|
1167
|
-
hops:
|
|
1168
|
-
|
|
1169
|
-
poolId:
|
|
1170
|
-
assetInAddress:
|
|
1171
|
-
assetOutAddress:
|
|
1172
|
-
hopIntegratorFeeRateBps:
|
|
1242
|
+
var sparkFlashnetExecuteRouteSwapParamsSchema = v20.object({
|
|
1243
|
+
hops: v20.array(
|
|
1244
|
+
v20.object({
|
|
1245
|
+
poolId: v20.string(),
|
|
1246
|
+
assetInAddress: v20.string(),
|
|
1247
|
+
assetOutAddress: v20.string(),
|
|
1248
|
+
hopIntegratorFeeRateBps: v20.optional(v20.number())
|
|
1173
1249
|
})
|
|
1174
1250
|
),
|
|
1175
|
-
initialAssetAddress:
|
|
1176
|
-
inputAmount:
|
|
1177
|
-
maxRouteSlippageBps:
|
|
1178
|
-
minAmountOut:
|
|
1179
|
-
integratorFeeRateBps:
|
|
1180
|
-
integratorPublicKey:
|
|
1181
|
-
});
|
|
1182
|
-
var sparkFlashnetExecuteRouteSwapResultSchema =
|
|
1183
|
-
requestId:
|
|
1184
|
-
accepted:
|
|
1185
|
-
outputAmount:
|
|
1186
|
-
executionPrice:
|
|
1187
|
-
finalOutboundTransferId:
|
|
1188
|
-
error:
|
|
1189
|
-
});
|
|
1190
|
-
var sparkFlashnetExecuteRouteSwapRequestMessageSchema =
|
|
1251
|
+
initialAssetAddress: v20.string(),
|
|
1252
|
+
inputAmount: v20.string(),
|
|
1253
|
+
maxRouteSlippageBps: v20.string(),
|
|
1254
|
+
minAmountOut: v20.optional(v20.string()),
|
|
1255
|
+
integratorFeeRateBps: v20.optional(v20.number()),
|
|
1256
|
+
integratorPublicKey: v20.optional(v20.string())
|
|
1257
|
+
});
|
|
1258
|
+
var sparkFlashnetExecuteRouteSwapResultSchema = v20.object({
|
|
1259
|
+
requestId: v20.string(),
|
|
1260
|
+
accepted: v20.boolean(),
|
|
1261
|
+
outputAmount: v20.string(),
|
|
1262
|
+
executionPrice: v20.string(),
|
|
1263
|
+
finalOutboundTransferId: v20.string(),
|
|
1264
|
+
error: v20.optional(v20.string())
|
|
1265
|
+
});
|
|
1266
|
+
var sparkFlashnetExecuteRouteSwapRequestMessageSchema = v20.object({
|
|
1191
1267
|
...rpcRequestMessageSchema.entries,
|
|
1192
|
-
...
|
|
1193
|
-
method:
|
|
1268
|
+
...v20.object({
|
|
1269
|
+
method: v20.literal(sparkFlashnetExecuteRouteSwapMethodName),
|
|
1194
1270
|
params: sparkFlashnetExecuteRouteSwapParamsSchema,
|
|
1195
|
-
id:
|
|
1271
|
+
id: v20.string()
|
|
1196
1272
|
}).entries
|
|
1197
1273
|
});
|
|
1198
1274
|
|
|
1199
1275
|
// src/request/types/sparkMethods/flashnetMethods/executeSwap.ts
|
|
1200
|
-
var
|
|
1276
|
+
var v21 = __toESM(require("valibot"));
|
|
1201
1277
|
var sparkFlashnetExecuteSwapMethodName = "spark_flashnet_executeSwap";
|
|
1202
|
-
var sparkFlashnetExecuteSwapParamsSchema =
|
|
1203
|
-
poolId:
|
|
1204
|
-
assetInAddress:
|
|
1205
|
-
assetOutAddress:
|
|
1206
|
-
amountIn:
|
|
1207
|
-
maxSlippageBps:
|
|
1208
|
-
minAmountOut:
|
|
1209
|
-
integratorFeeRateBps:
|
|
1210
|
-
integratorPublicKey:
|
|
1211
|
-
});
|
|
1212
|
-
var sparkFlashnetExecuteSwapResultSchema =
|
|
1213
|
-
requestId:
|
|
1214
|
-
accepted:
|
|
1215
|
-
amountOut:
|
|
1216
|
-
feeAmount:
|
|
1217
|
-
executionPrice:
|
|
1218
|
-
assetOutAddress:
|
|
1219
|
-
assetInAddress:
|
|
1220
|
-
outboundTransferId:
|
|
1221
|
-
error:
|
|
1222
|
-
});
|
|
1223
|
-
var sparkFlashnetExecuteSwapRequestMessageSchema =
|
|
1278
|
+
var sparkFlashnetExecuteSwapParamsSchema = v21.object({
|
|
1279
|
+
poolId: v21.string(),
|
|
1280
|
+
assetInAddress: v21.string(),
|
|
1281
|
+
assetOutAddress: v21.string(),
|
|
1282
|
+
amountIn: v21.string(),
|
|
1283
|
+
maxSlippageBps: v21.number(),
|
|
1284
|
+
minAmountOut: v21.optional(v21.string()),
|
|
1285
|
+
integratorFeeRateBps: v21.optional(v21.number()),
|
|
1286
|
+
integratorPublicKey: v21.optional(v21.string())
|
|
1287
|
+
});
|
|
1288
|
+
var sparkFlashnetExecuteSwapResultSchema = v21.object({
|
|
1289
|
+
requestId: v21.string(),
|
|
1290
|
+
accepted: v21.boolean(),
|
|
1291
|
+
amountOut: v21.optional(v21.string()),
|
|
1292
|
+
feeAmount: v21.optional(v21.string()),
|
|
1293
|
+
executionPrice: v21.optional(v21.string()),
|
|
1294
|
+
assetOutAddress: v21.optional(v21.string()),
|
|
1295
|
+
assetInAddress: v21.optional(v21.string()),
|
|
1296
|
+
outboundTransferId: v21.optional(v21.string()),
|
|
1297
|
+
error: v21.optional(v21.string())
|
|
1298
|
+
});
|
|
1299
|
+
var sparkFlashnetExecuteSwapRequestMessageSchema = v21.object({
|
|
1224
1300
|
...rpcRequestMessageSchema.entries,
|
|
1225
|
-
...
|
|
1226
|
-
method:
|
|
1301
|
+
...v21.object({
|
|
1302
|
+
method: v21.literal(sparkFlashnetExecuteSwapMethodName),
|
|
1227
1303
|
params: sparkFlashnetExecuteSwapParamsSchema,
|
|
1228
|
-
id:
|
|
1304
|
+
id: v21.string()
|
|
1229
1305
|
}).entries
|
|
1230
1306
|
});
|
|
1231
1307
|
|
|
1232
1308
|
// src/request/types/sparkMethods/flashnetMethods/getClawbackEligibleTransfers.ts
|
|
1233
|
-
var
|
|
1309
|
+
var v22 = __toESM(require("valibot"));
|
|
1234
1310
|
var sparkGetClawbackEligibleTransfersMethodName = "spark_flashnet_getClawbackEligibleTransfers";
|
|
1235
|
-
var sparkGetClawbackEligibleTransfersParamsSchema =
|
|
1236
|
-
var sparkGetClawbackEligibleTransfersResultSchema =
|
|
1237
|
-
eligibleTransfers:
|
|
1238
|
-
|
|
1239
|
-
txId:
|
|
1240
|
-
createdAt:
|
|
1241
|
-
lpIdentityPublicKey:
|
|
1311
|
+
var sparkGetClawbackEligibleTransfersParamsSchema = v22.nullish(v22.null());
|
|
1312
|
+
var sparkGetClawbackEligibleTransfersResultSchema = v22.object({
|
|
1313
|
+
eligibleTransfers: v22.array(
|
|
1314
|
+
v22.object({
|
|
1315
|
+
txId: v22.string(),
|
|
1316
|
+
createdAt: v22.string(),
|
|
1317
|
+
lpIdentityPublicKey: v22.string()
|
|
1242
1318
|
})
|
|
1243
1319
|
)
|
|
1244
1320
|
});
|
|
1245
|
-
var sparkGetClawbackEligibleTransfersRequestMessageSchema =
|
|
1321
|
+
var sparkGetClawbackEligibleTransfersRequestMessageSchema = v22.object({
|
|
1246
1322
|
...rpcRequestMessageSchema.entries,
|
|
1247
|
-
...
|
|
1248
|
-
method:
|
|
1323
|
+
...v22.object({
|
|
1324
|
+
method: v22.literal(sparkGetClawbackEligibleTransfersMethodName),
|
|
1249
1325
|
params: sparkGetClawbackEligibleTransfersParamsSchema,
|
|
1250
|
-
id:
|
|
1326
|
+
id: v22.string()
|
|
1251
1327
|
}).entries
|
|
1252
1328
|
});
|
|
1253
1329
|
|
|
1254
1330
|
// src/request/types/sparkMethods/flashnetMethods/getJwt.ts
|
|
1255
|
-
var
|
|
1331
|
+
var v23 = __toESM(require("valibot"));
|
|
1256
1332
|
var sparkFlashnetGetJwtMethodName = "spark_flashnet_getJwt";
|
|
1257
|
-
var sparkFlashnetGetJwtParamsSchema =
|
|
1258
|
-
var sparkFlashnetGetJwtResultSchema =
|
|
1333
|
+
var sparkFlashnetGetJwtParamsSchema = v23.null();
|
|
1334
|
+
var sparkFlashnetGetJwtResultSchema = v23.object({
|
|
1259
1335
|
/**
|
|
1260
1336
|
* The JWT token for authenticated requests to the Flashnet API.
|
|
1261
1337
|
*/
|
|
1262
|
-
jwt:
|
|
1338
|
+
jwt: v23.string()
|
|
1263
1339
|
});
|
|
1264
|
-
var sparkFlashnetGetJwtRequestMessageSchema =
|
|
1340
|
+
var sparkFlashnetGetJwtRequestMessageSchema = v23.object({
|
|
1265
1341
|
...rpcRequestMessageSchema.entries,
|
|
1266
|
-
...
|
|
1267
|
-
method:
|
|
1342
|
+
...v23.object({
|
|
1343
|
+
method: v23.literal(sparkFlashnetGetJwtMethodName),
|
|
1268
1344
|
params: sparkFlashnetGetJwtParamsSchema,
|
|
1269
|
-
id:
|
|
1345
|
+
id: v23.string()
|
|
1270
1346
|
}).entries
|
|
1271
1347
|
});
|
|
1272
1348
|
|
|
1273
1349
|
// src/request/types/sparkMethods/flashnetMethods/intents/addLiquidity.ts
|
|
1274
|
-
var
|
|
1275
|
-
var sparkFlashnetAddLiquidityIntentSchema =
|
|
1276
|
-
type:
|
|
1277
|
-
data:
|
|
1278
|
-
userPublicKey:
|
|
1279
|
-
poolId:
|
|
1280
|
-
assetAAmount:
|
|
1281
|
-
assetBAmount:
|
|
1282
|
-
assetAMinAmountIn:
|
|
1283
|
-
assetBMinAmountIn:
|
|
1284
|
-
assetATransferId:
|
|
1285
|
-
assetBTransferId:
|
|
1286
|
-
nonce:
|
|
1350
|
+
var v24 = __toESM(require("valibot"));
|
|
1351
|
+
var sparkFlashnetAddLiquidityIntentSchema = v24.object({
|
|
1352
|
+
type: v24.literal("addLiquidity"),
|
|
1353
|
+
data: v24.object({
|
|
1354
|
+
userPublicKey: v24.string(),
|
|
1355
|
+
poolId: v24.string(),
|
|
1356
|
+
assetAAmount: v24.string(),
|
|
1357
|
+
assetBAmount: v24.string(),
|
|
1358
|
+
assetAMinAmountIn: v24.string(),
|
|
1359
|
+
assetBMinAmountIn: v24.string(),
|
|
1360
|
+
assetATransferId: v24.string(),
|
|
1361
|
+
assetBTransferId: v24.string(),
|
|
1362
|
+
nonce: v24.string()
|
|
1287
1363
|
})
|
|
1288
1364
|
});
|
|
1289
1365
|
|
|
1290
1366
|
// src/request/types/sparkMethods/flashnetMethods/intents/clawback.ts
|
|
1291
|
-
var
|
|
1292
|
-
var sparkFlashnetClawbackIntentSchema =
|
|
1293
|
-
type:
|
|
1294
|
-
data:
|
|
1295
|
-
senderPublicKey:
|
|
1296
|
-
sparkTransferId:
|
|
1297
|
-
lpIdentityPublicKey:
|
|
1298
|
-
nonce:
|
|
1367
|
+
var v25 = __toESM(require("valibot"));
|
|
1368
|
+
var sparkFlashnetClawbackIntentSchema = v25.object({
|
|
1369
|
+
type: v25.literal("clawback"),
|
|
1370
|
+
data: v25.object({
|
|
1371
|
+
senderPublicKey: v25.string(),
|
|
1372
|
+
sparkTransferId: v25.string(),
|
|
1373
|
+
lpIdentityPublicKey: v25.string(),
|
|
1374
|
+
nonce: v25.string()
|
|
1299
1375
|
})
|
|
1300
1376
|
});
|
|
1301
1377
|
|
|
1302
1378
|
// src/request/types/sparkMethods/flashnetMethods/intents/confirmInitialDeposit.ts
|
|
1303
|
-
var
|
|
1304
|
-
var sparkFlashnetConfirmInitialDepositIntentSchema =
|
|
1305
|
-
type:
|
|
1306
|
-
data:
|
|
1307
|
-
poolId:
|
|
1308
|
-
assetASparkTransferId:
|
|
1309
|
-
poolOwnerPublicKey:
|
|
1310
|
-
nonce:
|
|
1379
|
+
var v26 = __toESM(require("valibot"));
|
|
1380
|
+
var sparkFlashnetConfirmInitialDepositIntentSchema = v26.object({
|
|
1381
|
+
type: v26.literal("confirmInitialDeposit"),
|
|
1382
|
+
data: v26.object({
|
|
1383
|
+
poolId: v26.string(),
|
|
1384
|
+
assetASparkTransferId: v26.string(),
|
|
1385
|
+
poolOwnerPublicKey: v26.string(),
|
|
1386
|
+
nonce: v26.string()
|
|
1311
1387
|
})
|
|
1312
1388
|
});
|
|
1313
1389
|
|
|
1314
1390
|
// src/request/types/sparkMethods/flashnetMethods/intents/createConstantProductPool.ts
|
|
1315
|
-
var
|
|
1316
|
-
var sparkFlashnetCreateConstantProductPoolIntentSchema =
|
|
1317
|
-
type:
|
|
1318
|
-
data:
|
|
1319
|
-
poolOwnerPublicKey:
|
|
1320
|
-
assetAAddress:
|
|
1321
|
-
assetBAddress:
|
|
1322
|
-
lpFeeRateBps:
|
|
1323
|
-
totalHostFeeRateBps:
|
|
1324
|
-
nonce:
|
|
1391
|
+
var v27 = __toESM(require("valibot"));
|
|
1392
|
+
var sparkFlashnetCreateConstantProductPoolIntentSchema = v27.object({
|
|
1393
|
+
type: v27.literal("createConstantProductPool"),
|
|
1394
|
+
data: v27.object({
|
|
1395
|
+
poolOwnerPublicKey: v27.string(),
|
|
1396
|
+
assetAAddress: v27.string(),
|
|
1397
|
+
assetBAddress: v27.string(),
|
|
1398
|
+
lpFeeRateBps: v27.union([v27.number(), v27.string()]),
|
|
1399
|
+
totalHostFeeRateBps: v27.union([v27.number(), v27.string()]),
|
|
1400
|
+
nonce: v27.string()
|
|
1325
1401
|
})
|
|
1326
1402
|
});
|
|
1327
1403
|
|
|
1328
1404
|
// src/request/types/sparkMethods/flashnetMethods/intents/createSingleSidedPool.ts
|
|
1329
|
-
var
|
|
1330
|
-
var sparkFlashnetCreateSingleSidedPoolIntentSchema =
|
|
1331
|
-
type:
|
|
1332
|
-
data:
|
|
1333
|
-
assetAAddress:
|
|
1334
|
-
assetBAddress:
|
|
1335
|
-
assetAInitialReserve:
|
|
1336
|
-
virtualReserveA:
|
|
1337
|
-
virtualReserveB:
|
|
1338
|
-
threshold:
|
|
1339
|
-
lpFeeRateBps:
|
|
1340
|
-
totalHostFeeRateBps:
|
|
1341
|
-
poolOwnerPublicKey:
|
|
1342
|
-
nonce:
|
|
1405
|
+
var v28 = __toESM(require("valibot"));
|
|
1406
|
+
var sparkFlashnetCreateSingleSidedPoolIntentSchema = v28.object({
|
|
1407
|
+
type: v28.literal("createSingleSidedPool"),
|
|
1408
|
+
data: v28.object({
|
|
1409
|
+
assetAAddress: v28.string(),
|
|
1410
|
+
assetBAddress: v28.string(),
|
|
1411
|
+
assetAInitialReserve: v28.string(),
|
|
1412
|
+
virtualReserveA: v28.union([v28.number(), v28.string()]),
|
|
1413
|
+
virtualReserveB: v28.union([v28.number(), v28.string()]),
|
|
1414
|
+
threshold: v28.union([v28.number(), v28.string()]),
|
|
1415
|
+
lpFeeRateBps: v28.union([v28.number(), v28.string()]),
|
|
1416
|
+
totalHostFeeRateBps: v28.union([v28.number(), v28.string()]),
|
|
1417
|
+
poolOwnerPublicKey: v28.string(),
|
|
1418
|
+
nonce: v28.string()
|
|
1343
1419
|
})
|
|
1344
1420
|
});
|
|
1345
1421
|
|
|
1346
1422
|
// src/request/types/sparkMethods/flashnetMethods/intents/removeLiquidity.ts
|
|
1347
|
-
var
|
|
1348
|
-
var sparkFlashnetRemoveLiquidityIntentSchema =
|
|
1349
|
-
type:
|
|
1350
|
-
data:
|
|
1351
|
-
userPublicKey:
|
|
1352
|
-
poolId:
|
|
1353
|
-
lpTokensToRemove:
|
|
1354
|
-
nonce:
|
|
1423
|
+
var v29 = __toESM(require("valibot"));
|
|
1424
|
+
var sparkFlashnetRemoveLiquidityIntentSchema = v29.object({
|
|
1425
|
+
type: v29.literal("removeLiquidity"),
|
|
1426
|
+
data: v29.object({
|
|
1427
|
+
userPublicKey: v29.string(),
|
|
1428
|
+
poolId: v29.string(),
|
|
1429
|
+
lpTokensToRemove: v29.string(),
|
|
1430
|
+
nonce: v29.string()
|
|
1355
1431
|
})
|
|
1356
1432
|
});
|
|
1357
1433
|
|
|
1358
1434
|
// src/request/types/sparkMethods/flashnetMethods/intents/routeSwap.ts
|
|
1359
|
-
var
|
|
1360
|
-
var sparkFlashnetRouteSwapIntentSchema =
|
|
1361
|
-
type:
|
|
1362
|
-
data:
|
|
1363
|
-
userPublicKey:
|
|
1364
|
-
initialSparkTransferId:
|
|
1365
|
-
hops:
|
|
1366
|
-
|
|
1367
|
-
poolId:
|
|
1368
|
-
inputAssetAddress:
|
|
1369
|
-
outputAssetAddress:
|
|
1370
|
-
hopIntegratorFeeRateBps:
|
|
1435
|
+
var v30 = __toESM(require("valibot"));
|
|
1436
|
+
var sparkFlashnetRouteSwapIntentSchema = v30.object({
|
|
1437
|
+
type: v30.literal("executeRouteSwap"),
|
|
1438
|
+
data: v30.object({
|
|
1439
|
+
userPublicKey: v30.string(),
|
|
1440
|
+
initialSparkTransferId: v30.string(),
|
|
1441
|
+
hops: v30.array(
|
|
1442
|
+
v30.object({
|
|
1443
|
+
poolId: v30.string(),
|
|
1444
|
+
inputAssetAddress: v30.string(),
|
|
1445
|
+
outputAssetAddress: v30.string(),
|
|
1446
|
+
hopIntegratorFeeRateBps: v30.optional(v30.union([v30.number(), v30.string()]))
|
|
1371
1447
|
})
|
|
1372
1448
|
),
|
|
1373
|
-
inputAmount:
|
|
1374
|
-
maxRouteSlippageBps:
|
|
1375
|
-
minAmountOut:
|
|
1376
|
-
defaultIntegratorFeeRateBps:
|
|
1377
|
-
nonce:
|
|
1449
|
+
inputAmount: v30.string(),
|
|
1450
|
+
maxRouteSlippageBps: v30.union([v30.number(), v30.string()]),
|
|
1451
|
+
minAmountOut: v30.string(),
|
|
1452
|
+
defaultIntegratorFeeRateBps: v30.optional(v30.union([v30.number(), v30.string()])),
|
|
1453
|
+
nonce: v30.string()
|
|
1378
1454
|
})
|
|
1379
1455
|
});
|
|
1380
1456
|
|
|
1381
1457
|
// src/request/types/sparkMethods/flashnetMethods/intents/swap.ts
|
|
1382
|
-
var
|
|
1383
|
-
var sparkFlashnetSwapIntentSchema =
|
|
1384
|
-
type:
|
|
1385
|
-
data:
|
|
1386
|
-
userPublicKey:
|
|
1387
|
-
poolId:
|
|
1388
|
-
transferId:
|
|
1389
|
-
assetInAddress:
|
|
1390
|
-
assetOutAddress:
|
|
1391
|
-
amountIn:
|
|
1392
|
-
maxSlippageBps:
|
|
1393
|
-
minAmountOut:
|
|
1394
|
-
totalIntegratorFeeRateBps:
|
|
1395
|
-
nonce:
|
|
1458
|
+
var v31 = __toESM(require("valibot"));
|
|
1459
|
+
var sparkFlashnetSwapIntentSchema = v31.object({
|
|
1460
|
+
type: v31.literal("executeSwap"),
|
|
1461
|
+
data: v31.object({
|
|
1462
|
+
userPublicKey: v31.string(),
|
|
1463
|
+
poolId: v31.string(),
|
|
1464
|
+
transferId: v31.string(),
|
|
1465
|
+
assetInAddress: v31.string(),
|
|
1466
|
+
assetOutAddress: v31.string(),
|
|
1467
|
+
amountIn: v31.string(),
|
|
1468
|
+
maxSlippageBps: v31.union([v31.number(), v31.string()]),
|
|
1469
|
+
minAmountOut: v31.string(),
|
|
1470
|
+
totalIntegratorFeeRateBps: v31.optional(v31.union([v31.number(), v31.string()])),
|
|
1471
|
+
nonce: v31.string()
|
|
1396
1472
|
})
|
|
1397
1473
|
});
|
|
1398
1474
|
|
|
1399
1475
|
// src/request/types/sparkMethods/flashnetMethods/signIntent.ts
|
|
1400
|
-
var
|
|
1476
|
+
var v32 = __toESM(require("valibot"));
|
|
1401
1477
|
var sparkFlashnetSignIntentMethodName = "spark_flashnet_signIntent";
|
|
1402
|
-
var sparkFlashnetSignIntentParamsSchema =
|
|
1478
|
+
var sparkFlashnetSignIntentParamsSchema = v32.union([
|
|
1403
1479
|
sparkFlashnetSwapIntentSchema,
|
|
1404
1480
|
sparkFlashnetRouteSwapIntentSchema,
|
|
1405
1481
|
sparkFlashnetAddLiquidityIntentSchema,
|
|
@@ -1409,109 +1485,109 @@ var sparkFlashnetSignIntentParamsSchema = v25.union([
|
|
|
1409
1485
|
sparkFlashnetCreateSingleSidedPoolIntentSchema,
|
|
1410
1486
|
sparkFlashnetRemoveLiquidityIntentSchema
|
|
1411
1487
|
]);
|
|
1412
|
-
var sparkFlashnetSignIntentResultSchema =
|
|
1488
|
+
var sparkFlashnetSignIntentResultSchema = v32.object({
|
|
1413
1489
|
/**
|
|
1414
1490
|
* The signed intent as a hex string.
|
|
1415
1491
|
*/
|
|
1416
|
-
signature:
|
|
1492
|
+
signature: v32.string()
|
|
1417
1493
|
});
|
|
1418
|
-
var sparkFlashnetSignIntentRequestMessageSchema =
|
|
1494
|
+
var sparkFlashnetSignIntentRequestMessageSchema = v32.object({
|
|
1419
1495
|
...rpcRequestMessageSchema.entries,
|
|
1420
|
-
...
|
|
1421
|
-
method:
|
|
1496
|
+
...v32.object({
|
|
1497
|
+
method: v32.literal(sparkFlashnetSignIntentMethodName),
|
|
1422
1498
|
params: sparkFlashnetSignIntentParamsSchema,
|
|
1423
|
-
id:
|
|
1499
|
+
id: v32.string()
|
|
1424
1500
|
}).entries
|
|
1425
1501
|
});
|
|
1426
1502
|
|
|
1427
1503
|
// src/request/types/sparkMethods/flashnetMethods/signStructuredMessage.ts
|
|
1428
|
-
var
|
|
1504
|
+
var v33 = __toESM(require("valibot"));
|
|
1429
1505
|
var sparkFlashnetSignStructuredMessageMethodName = "spark_flashnet_signStructuredMessage";
|
|
1430
|
-
var sparkFlashnetSignStructuredMessageParamsSchema =
|
|
1431
|
-
message:
|
|
1506
|
+
var sparkFlashnetSignStructuredMessageParamsSchema = v33.object({
|
|
1507
|
+
message: v33.string()
|
|
1432
1508
|
});
|
|
1433
|
-
var sparkFlashnetSignStructuredMessageResultSchema =
|
|
1434
|
-
message:
|
|
1435
|
-
signature:
|
|
1509
|
+
var sparkFlashnetSignStructuredMessageResultSchema = v33.object({
|
|
1510
|
+
message: v33.string(),
|
|
1511
|
+
signature: v33.string()
|
|
1436
1512
|
});
|
|
1437
|
-
var sparkFlashnetSignStructuredMessageRequestMessageSchema =
|
|
1513
|
+
var sparkFlashnetSignStructuredMessageRequestMessageSchema = v33.object({
|
|
1438
1514
|
...rpcRequestMessageSchema.entries,
|
|
1439
|
-
...
|
|
1440
|
-
method:
|
|
1515
|
+
...v33.object({
|
|
1516
|
+
method: v33.literal(sparkFlashnetSignStructuredMessageMethodName),
|
|
1441
1517
|
params: sparkFlashnetSignStructuredMessageParamsSchema,
|
|
1442
|
-
id:
|
|
1518
|
+
id: v33.string()
|
|
1443
1519
|
}).entries
|
|
1444
1520
|
});
|
|
1445
1521
|
|
|
1446
1522
|
// src/request/types/sparkMethods/getAddresses.ts
|
|
1447
|
-
var
|
|
1523
|
+
var v34 = __toESM(require("valibot"));
|
|
1448
1524
|
var sparkGetAddressesMethodName = "spark_getAddresses";
|
|
1449
|
-
var sparkGetAddressesParamsSchema =
|
|
1450
|
-
|
|
1525
|
+
var sparkGetAddressesParamsSchema = v34.nullish(
|
|
1526
|
+
v34.object({
|
|
1451
1527
|
/**
|
|
1452
1528
|
* A message to be displayed to the user in the request prompt.
|
|
1453
1529
|
*/
|
|
1454
|
-
message:
|
|
1530
|
+
message: v34.optional(v34.string())
|
|
1455
1531
|
})
|
|
1456
1532
|
);
|
|
1457
|
-
var sparkGetAddressesResultSchema =
|
|
1533
|
+
var sparkGetAddressesResultSchema = v34.object({
|
|
1458
1534
|
/**
|
|
1459
1535
|
* The addresses generated for the given purposes.
|
|
1460
1536
|
*/
|
|
1461
|
-
addresses:
|
|
1537
|
+
addresses: v34.array(addressSchema),
|
|
1462
1538
|
network: getNetworkResultSchema
|
|
1463
1539
|
});
|
|
1464
|
-
var sparkGetAddressesRequestMessageSchema =
|
|
1540
|
+
var sparkGetAddressesRequestMessageSchema = v34.object({
|
|
1465
1541
|
...rpcRequestMessageSchema.entries,
|
|
1466
|
-
...
|
|
1467
|
-
method:
|
|
1542
|
+
...v34.object({
|
|
1543
|
+
method: v34.literal(sparkGetAddressesMethodName),
|
|
1468
1544
|
params: sparkGetAddressesParamsSchema,
|
|
1469
|
-
id:
|
|
1545
|
+
id: v34.string()
|
|
1470
1546
|
}).entries
|
|
1471
1547
|
});
|
|
1472
1548
|
|
|
1473
1549
|
// src/request/types/sparkMethods/getBalance.ts
|
|
1474
|
-
var
|
|
1550
|
+
var v35 = __toESM(require("valibot"));
|
|
1475
1551
|
var sparkGetBalanceMethodName = "spark_getBalance";
|
|
1476
|
-
var sparkGetBalanceParamsSchema =
|
|
1477
|
-
var sparkGetBalanceResultSchema =
|
|
1552
|
+
var sparkGetBalanceParamsSchema = v35.nullish(v35.null());
|
|
1553
|
+
var sparkGetBalanceResultSchema = v35.object({
|
|
1478
1554
|
/**
|
|
1479
1555
|
* The Spark Bitcoin address balance in sats in string form.
|
|
1480
1556
|
*/
|
|
1481
|
-
balance:
|
|
1482
|
-
tokenBalances:
|
|
1483
|
-
|
|
1557
|
+
balance: v35.string(),
|
|
1558
|
+
tokenBalances: v35.array(
|
|
1559
|
+
v35.object({
|
|
1484
1560
|
/* The address balance of the token in string form as it can overflow a js number */
|
|
1485
|
-
balance:
|
|
1486
|
-
tokenMetadata:
|
|
1487
|
-
tokenIdentifier:
|
|
1488
|
-
tokenName:
|
|
1489
|
-
tokenTicker:
|
|
1490
|
-
decimals:
|
|
1491
|
-
maxSupply:
|
|
1561
|
+
balance: v35.string(),
|
|
1562
|
+
tokenMetadata: v35.object({
|
|
1563
|
+
tokenIdentifier: v35.string(),
|
|
1564
|
+
tokenName: v35.string(),
|
|
1565
|
+
tokenTicker: v35.string(),
|
|
1566
|
+
decimals: v35.number(),
|
|
1567
|
+
maxSupply: v35.string()
|
|
1492
1568
|
})
|
|
1493
1569
|
})
|
|
1494
1570
|
)
|
|
1495
1571
|
});
|
|
1496
|
-
var sparkGetBalanceRequestMessageSchema =
|
|
1572
|
+
var sparkGetBalanceRequestMessageSchema = v35.object({
|
|
1497
1573
|
...rpcRequestMessageSchema.entries,
|
|
1498
|
-
...
|
|
1499
|
-
method:
|
|
1574
|
+
...v35.object({
|
|
1575
|
+
method: v35.literal(sparkGetBalanceMethodName),
|
|
1500
1576
|
params: sparkGetBalanceParamsSchema,
|
|
1501
|
-
id:
|
|
1577
|
+
id: v35.string()
|
|
1502
1578
|
}).entries
|
|
1503
1579
|
});
|
|
1504
1580
|
|
|
1505
1581
|
// src/request/types/sparkMethods/signMessage.ts
|
|
1506
|
-
var
|
|
1582
|
+
var v36 = __toESM(require("valibot"));
|
|
1507
1583
|
var sparkSignMessageMethodName = "spark_signMessage";
|
|
1508
|
-
var sparkSignMessageParamsSchema =
|
|
1584
|
+
var sparkSignMessageParamsSchema = v36.object({
|
|
1509
1585
|
/**
|
|
1510
1586
|
* The message to sign. The message should only consist of valid UTF-8 characters.
|
|
1511
1587
|
*/
|
|
1512
|
-
message:
|
|
1588
|
+
message: v36.string()
|
|
1513
1589
|
});
|
|
1514
|
-
var sparkSignMessageResultSchema =
|
|
1590
|
+
var sparkSignMessageResultSchema = v36.object({
|
|
1515
1591
|
/**
|
|
1516
1592
|
* The signature, encoded in base64, of the message hash.
|
|
1517
1593
|
*
|
|
@@ -1519,98 +1595,98 @@ var sparkSignMessageResultSchema = v29.object({
|
|
|
1519
1595
|
* and the resulting byte array is hashed with SHA256 before signing
|
|
1520
1596
|
* with the private key.
|
|
1521
1597
|
*/
|
|
1522
|
-
signature:
|
|
1598
|
+
signature: v36.string()
|
|
1523
1599
|
});
|
|
1524
|
-
var sparkSignMessageRequestMessageSchema =
|
|
1600
|
+
var sparkSignMessageRequestMessageSchema = v36.object({
|
|
1525
1601
|
...rpcRequestMessageSchema.entries,
|
|
1526
|
-
...
|
|
1527
|
-
method:
|
|
1602
|
+
...v36.object({
|
|
1603
|
+
method: v36.literal(sparkSignMessageMethodName),
|
|
1528
1604
|
params: sparkSignMessageParamsSchema,
|
|
1529
|
-
id:
|
|
1605
|
+
id: v36.string()
|
|
1530
1606
|
}).entries
|
|
1531
1607
|
});
|
|
1532
1608
|
|
|
1533
1609
|
// src/request/types/sparkMethods/transfer.ts
|
|
1534
|
-
var
|
|
1610
|
+
var v37 = __toESM(require("valibot"));
|
|
1535
1611
|
var sparkTransferMethodName = "spark_transfer";
|
|
1536
|
-
var sparkTransferParamsSchema =
|
|
1612
|
+
var sparkTransferParamsSchema = v37.object({
|
|
1537
1613
|
/**
|
|
1538
1614
|
* Amount of SATS to transfer as a string or number.
|
|
1539
1615
|
*/
|
|
1540
|
-
amountSats:
|
|
1616
|
+
amountSats: v37.union([v37.number(), v37.string()]),
|
|
1541
1617
|
/**
|
|
1542
1618
|
* The recipient's spark address.
|
|
1543
1619
|
*/
|
|
1544
|
-
receiverSparkAddress:
|
|
1620
|
+
receiverSparkAddress: v37.string()
|
|
1545
1621
|
});
|
|
1546
|
-
var sparkTransferResultSchema =
|
|
1622
|
+
var sparkTransferResultSchema = v37.object({
|
|
1547
1623
|
/**
|
|
1548
1624
|
* The ID of the transaction.
|
|
1549
1625
|
*/
|
|
1550
|
-
id:
|
|
1626
|
+
id: v37.string()
|
|
1551
1627
|
});
|
|
1552
|
-
var sparkTransferRequestMessageSchema =
|
|
1628
|
+
var sparkTransferRequestMessageSchema = v37.object({
|
|
1553
1629
|
...rpcRequestMessageSchema.entries,
|
|
1554
|
-
...
|
|
1555
|
-
method:
|
|
1630
|
+
...v37.object({
|
|
1631
|
+
method: v37.literal(sparkTransferMethodName),
|
|
1556
1632
|
params: sparkTransferParamsSchema,
|
|
1557
|
-
id:
|
|
1633
|
+
id: v37.string()
|
|
1558
1634
|
}).entries
|
|
1559
1635
|
});
|
|
1560
1636
|
|
|
1561
1637
|
// src/request/types/sparkMethods/transferToken.ts
|
|
1562
|
-
var
|
|
1638
|
+
var v38 = __toESM(require("valibot"));
|
|
1563
1639
|
var sparkTransferTokenMethodName = "spark_transferToken";
|
|
1564
|
-
var sparkTransferTokenParamsSchema =
|
|
1640
|
+
var sparkTransferTokenParamsSchema = v38.object({
|
|
1565
1641
|
/**
|
|
1566
1642
|
* Amount of units of the token to transfer as a string or number.
|
|
1567
1643
|
*/
|
|
1568
|
-
tokenAmount:
|
|
1644
|
+
tokenAmount: v38.union([v38.number(), v38.string()]),
|
|
1569
1645
|
/**
|
|
1570
1646
|
* The Bech32m token identifier.
|
|
1571
1647
|
*/
|
|
1572
|
-
tokenIdentifier:
|
|
1648
|
+
tokenIdentifier: v38.string(),
|
|
1573
1649
|
/**
|
|
1574
1650
|
* The recipient's spark address.
|
|
1575
1651
|
*/
|
|
1576
|
-
receiverSparkAddress:
|
|
1652
|
+
receiverSparkAddress: v38.string()
|
|
1577
1653
|
});
|
|
1578
|
-
var sparkTransferTokenResultSchema =
|
|
1654
|
+
var sparkTransferTokenResultSchema = v38.object({
|
|
1579
1655
|
/**
|
|
1580
1656
|
* The ID of the transaction.
|
|
1581
1657
|
*/
|
|
1582
|
-
id:
|
|
1658
|
+
id: v38.string()
|
|
1583
1659
|
});
|
|
1584
|
-
var sparkTransferTokenRequestMessageSchema =
|
|
1660
|
+
var sparkTransferTokenRequestMessageSchema = v38.object({
|
|
1585
1661
|
...rpcRequestMessageSchema.entries,
|
|
1586
|
-
...
|
|
1587
|
-
method:
|
|
1662
|
+
...v38.object({
|
|
1663
|
+
method: v38.literal(sparkTransferTokenMethodName),
|
|
1588
1664
|
params: sparkTransferTokenParamsSchema,
|
|
1589
|
-
id:
|
|
1665
|
+
id: v38.string()
|
|
1590
1666
|
}).entries
|
|
1591
1667
|
});
|
|
1592
1668
|
|
|
1593
1669
|
// src/request/types/stxMethods/callContract.ts
|
|
1594
|
-
var
|
|
1670
|
+
var v39 = __toESM(require("valibot"));
|
|
1595
1671
|
var stxCallContractMethodName = "stx_callContract";
|
|
1596
|
-
var stxCallContractParamsSchema =
|
|
1672
|
+
var stxCallContractParamsSchema = v39.object({
|
|
1597
1673
|
/**
|
|
1598
1674
|
* The contract principal.
|
|
1599
1675
|
*
|
|
1600
1676
|
* E.g. `"SPKE...GD5C.my-contract"`
|
|
1601
1677
|
*/
|
|
1602
|
-
contract:
|
|
1678
|
+
contract: v39.string(),
|
|
1603
1679
|
/**
|
|
1604
1680
|
* The name of the function to call.
|
|
1605
1681
|
*
|
|
1606
1682
|
* Note: spec changes ongoing,
|
|
1607
1683
|
* https://github.com/stacksgov/sips/pull/166#pullrequestreview-1914236999
|
|
1608
1684
|
*/
|
|
1609
|
-
functionName:
|
|
1685
|
+
functionName: v39.string(),
|
|
1610
1686
|
/**
|
|
1611
1687
|
* @deprecated in favor of `functionArgs` for @stacks/connect compatibility
|
|
1612
1688
|
*/
|
|
1613
|
-
arguments:
|
|
1689
|
+
arguments: v39.optional(v39.array(v39.string())),
|
|
1614
1690
|
/**
|
|
1615
1691
|
* The function's arguments. The arguments are expected to be hex-encoded
|
|
1616
1692
|
* strings of Clarity values.
|
|
@@ -1625,274 +1701,274 @@ var stxCallContractParamsSchema = v32.object({
|
|
|
1625
1701
|
* const hexArgs = functionArgs.map(cvToHex);
|
|
1626
1702
|
* ```
|
|
1627
1703
|
*/
|
|
1628
|
-
functionArgs:
|
|
1704
|
+
functionArgs: v39.optional(v39.array(v39.string())),
|
|
1629
1705
|
/**
|
|
1630
1706
|
* The post conditions to apply to the contract call.
|
|
1631
1707
|
*/
|
|
1632
|
-
postConditions:
|
|
1708
|
+
postConditions: v39.optional(v39.array(v39.string())),
|
|
1633
1709
|
/**
|
|
1634
1710
|
* The mode to apply to the post conditions.
|
|
1635
1711
|
*/
|
|
1636
|
-
postConditionMode:
|
|
1712
|
+
postConditionMode: v39.optional(v39.union([v39.literal("allow"), v39.literal("deny")]))
|
|
1637
1713
|
});
|
|
1638
|
-
var stxCallContractResultSchema =
|
|
1714
|
+
var stxCallContractResultSchema = v39.object({
|
|
1639
1715
|
/**
|
|
1640
1716
|
* The ID of the transaction.
|
|
1641
1717
|
*/
|
|
1642
|
-
txid:
|
|
1718
|
+
txid: v39.string(),
|
|
1643
1719
|
/**
|
|
1644
1720
|
* A Stacks transaction as a hex-encoded string.
|
|
1645
1721
|
*/
|
|
1646
|
-
transaction:
|
|
1722
|
+
transaction: v39.string()
|
|
1647
1723
|
});
|
|
1648
|
-
var stxCallContractRequestMessageSchema =
|
|
1724
|
+
var stxCallContractRequestMessageSchema = v39.object({
|
|
1649
1725
|
...rpcRequestMessageSchema.entries,
|
|
1650
|
-
...
|
|
1651
|
-
method:
|
|
1726
|
+
...v39.object({
|
|
1727
|
+
method: v39.literal(stxCallContractMethodName),
|
|
1652
1728
|
params: stxCallContractParamsSchema,
|
|
1653
|
-
id:
|
|
1729
|
+
id: v39.string()
|
|
1654
1730
|
}).entries
|
|
1655
1731
|
});
|
|
1656
1732
|
|
|
1657
1733
|
// src/request/types/stxMethods/deployContract.ts
|
|
1658
|
-
var
|
|
1734
|
+
var v40 = __toESM(require("valibot"));
|
|
1659
1735
|
var stxDeployContractMethodName = "stx_deployContract";
|
|
1660
|
-
var stxDeployContractParamsSchema =
|
|
1736
|
+
var stxDeployContractParamsSchema = v40.object({
|
|
1661
1737
|
/**
|
|
1662
1738
|
* Name of the contract.
|
|
1663
1739
|
*/
|
|
1664
|
-
name:
|
|
1740
|
+
name: v40.string(),
|
|
1665
1741
|
/**
|
|
1666
1742
|
* The source code of the Clarity contract.
|
|
1667
1743
|
*/
|
|
1668
|
-
clarityCode:
|
|
1744
|
+
clarityCode: v40.string(),
|
|
1669
1745
|
/**
|
|
1670
1746
|
* The version of the Clarity contract.
|
|
1671
1747
|
*/
|
|
1672
|
-
clarityVersion:
|
|
1748
|
+
clarityVersion: v40.optional(v40.number()),
|
|
1673
1749
|
/**
|
|
1674
1750
|
* The post conditions to apply to the contract call.
|
|
1675
1751
|
*/
|
|
1676
|
-
postConditions:
|
|
1752
|
+
postConditions: v40.optional(v40.array(v40.string())),
|
|
1677
1753
|
/**
|
|
1678
1754
|
* The mode to apply to the post conditions.
|
|
1679
1755
|
*/
|
|
1680
|
-
postConditionMode:
|
|
1756
|
+
postConditionMode: v40.optional(v40.union([v40.literal("allow"), v40.literal("deny")]))
|
|
1681
1757
|
});
|
|
1682
|
-
var stxDeployContractResultSchema =
|
|
1758
|
+
var stxDeployContractResultSchema = v40.object({
|
|
1683
1759
|
/**
|
|
1684
1760
|
* The ID of the transaction.
|
|
1685
1761
|
*/
|
|
1686
|
-
txid:
|
|
1762
|
+
txid: v40.string(),
|
|
1687
1763
|
/**
|
|
1688
1764
|
* A Stacks transaction as a hex-encoded string.
|
|
1689
1765
|
*/
|
|
1690
|
-
transaction:
|
|
1766
|
+
transaction: v40.string()
|
|
1691
1767
|
});
|
|
1692
|
-
var stxDeployContractRequestMessageSchema =
|
|
1768
|
+
var stxDeployContractRequestMessageSchema = v40.object({
|
|
1693
1769
|
...rpcRequestMessageSchema.entries,
|
|
1694
|
-
...
|
|
1695
|
-
method:
|
|
1770
|
+
...v40.object({
|
|
1771
|
+
method: v40.literal(stxDeployContractMethodName),
|
|
1696
1772
|
params: stxDeployContractParamsSchema,
|
|
1697
|
-
id:
|
|
1773
|
+
id: v40.string()
|
|
1698
1774
|
}).entries
|
|
1699
1775
|
});
|
|
1700
1776
|
|
|
1701
1777
|
// src/request/types/stxMethods/getAccounts.ts
|
|
1702
|
-
var
|
|
1778
|
+
var v41 = __toESM(require("valibot"));
|
|
1703
1779
|
var stxGetAccountsMethodName = "stx_getAccounts";
|
|
1704
|
-
var stxGetAccountsParamsSchema =
|
|
1705
|
-
var stxGetAccountsResultSchema =
|
|
1780
|
+
var stxGetAccountsParamsSchema = v41.nullish(v41.null());
|
|
1781
|
+
var stxGetAccountsResultSchema = v41.object({
|
|
1706
1782
|
/**
|
|
1707
1783
|
* The addresses generated for the given purposes.
|
|
1708
1784
|
*/
|
|
1709
|
-
addresses:
|
|
1710
|
-
|
|
1711
|
-
address:
|
|
1712
|
-
publicKey:
|
|
1713
|
-
gaiaHubUrl:
|
|
1714
|
-
gaiaAppKey:
|
|
1785
|
+
addresses: v41.array(
|
|
1786
|
+
v41.object({
|
|
1787
|
+
address: v41.string(),
|
|
1788
|
+
publicKey: v41.string(),
|
|
1789
|
+
gaiaHubUrl: v41.string(),
|
|
1790
|
+
gaiaAppKey: v41.string()
|
|
1715
1791
|
})
|
|
1716
1792
|
),
|
|
1717
1793
|
network: getNetworkResultSchema
|
|
1718
1794
|
});
|
|
1719
|
-
var stxGetAccountsRequestMessageSchema =
|
|
1795
|
+
var stxGetAccountsRequestMessageSchema = v41.object({
|
|
1720
1796
|
...rpcRequestMessageSchema.entries,
|
|
1721
|
-
...
|
|
1722
|
-
method:
|
|
1797
|
+
...v41.object({
|
|
1798
|
+
method: v41.literal(stxGetAccountsMethodName),
|
|
1723
1799
|
params: stxGetAccountsParamsSchema,
|
|
1724
|
-
id:
|
|
1800
|
+
id: v41.string()
|
|
1725
1801
|
}).entries
|
|
1726
1802
|
});
|
|
1727
1803
|
|
|
1728
1804
|
// src/request/types/stxMethods/getAddresses.ts
|
|
1729
|
-
var
|
|
1805
|
+
var v42 = __toESM(require("valibot"));
|
|
1730
1806
|
var stxGetAddressesMethodName = "stx_getAddresses";
|
|
1731
|
-
var stxGetAddressesParamsSchema =
|
|
1732
|
-
|
|
1807
|
+
var stxGetAddressesParamsSchema = v42.nullish(
|
|
1808
|
+
v42.object({
|
|
1733
1809
|
/**
|
|
1734
1810
|
* A message to be displayed to the user in the request prompt.
|
|
1735
1811
|
*/
|
|
1736
|
-
message:
|
|
1812
|
+
message: v42.optional(v42.string())
|
|
1737
1813
|
})
|
|
1738
1814
|
);
|
|
1739
|
-
var stxGetAddressesResultSchema =
|
|
1815
|
+
var stxGetAddressesResultSchema = v42.object({
|
|
1740
1816
|
/**
|
|
1741
1817
|
* The addresses generated for the given purposes.
|
|
1742
1818
|
*/
|
|
1743
|
-
addresses:
|
|
1819
|
+
addresses: v42.array(addressSchema),
|
|
1744
1820
|
network: getNetworkResultSchema
|
|
1745
1821
|
});
|
|
1746
|
-
var stxGetAddressesRequestMessageSchema =
|
|
1822
|
+
var stxGetAddressesRequestMessageSchema = v42.object({
|
|
1747
1823
|
...rpcRequestMessageSchema.entries,
|
|
1748
|
-
...
|
|
1749
|
-
method:
|
|
1824
|
+
...v42.object({
|
|
1825
|
+
method: v42.literal(stxGetAddressesMethodName),
|
|
1750
1826
|
params: stxGetAddressesParamsSchema,
|
|
1751
|
-
id:
|
|
1827
|
+
id: v42.string()
|
|
1752
1828
|
}).entries
|
|
1753
1829
|
});
|
|
1754
1830
|
|
|
1755
1831
|
// src/request/types/stxMethods/signMessage.ts
|
|
1756
|
-
var
|
|
1832
|
+
var v43 = __toESM(require("valibot"));
|
|
1757
1833
|
var stxSignMessageMethodName = "stx_signMessage";
|
|
1758
|
-
var stxSignMessageParamsSchema =
|
|
1834
|
+
var stxSignMessageParamsSchema = v43.object({
|
|
1759
1835
|
/**
|
|
1760
1836
|
* The message to sign.
|
|
1761
1837
|
*/
|
|
1762
|
-
message:
|
|
1838
|
+
message: v43.string()
|
|
1763
1839
|
});
|
|
1764
|
-
var stxSignMessageResultSchema =
|
|
1840
|
+
var stxSignMessageResultSchema = v43.object({
|
|
1765
1841
|
/**
|
|
1766
1842
|
* The signature of the message.
|
|
1767
1843
|
*/
|
|
1768
|
-
signature:
|
|
1844
|
+
signature: v43.string(),
|
|
1769
1845
|
/**
|
|
1770
1846
|
* The public key used to sign the message.
|
|
1771
1847
|
*/
|
|
1772
|
-
publicKey:
|
|
1848
|
+
publicKey: v43.string()
|
|
1773
1849
|
});
|
|
1774
|
-
var stxSignMessageRequestMessageSchema =
|
|
1850
|
+
var stxSignMessageRequestMessageSchema = v43.object({
|
|
1775
1851
|
...rpcRequestMessageSchema.entries,
|
|
1776
|
-
...
|
|
1777
|
-
method:
|
|
1852
|
+
...v43.object({
|
|
1853
|
+
method: v43.literal(stxSignMessageMethodName),
|
|
1778
1854
|
params: stxSignMessageParamsSchema,
|
|
1779
|
-
id:
|
|
1855
|
+
id: v43.string()
|
|
1780
1856
|
}).entries
|
|
1781
1857
|
});
|
|
1782
1858
|
|
|
1783
1859
|
// src/request/types/stxMethods/signStructuredMessage.ts
|
|
1784
|
-
var
|
|
1860
|
+
var v44 = __toESM(require("valibot"));
|
|
1785
1861
|
var stxSignStructuredMessageMethodName = "stx_signStructuredMessage";
|
|
1786
|
-
var stxSignStructuredMessageParamsSchema =
|
|
1862
|
+
var stxSignStructuredMessageParamsSchema = v44.object({
|
|
1787
1863
|
/**
|
|
1788
1864
|
* The domain to be signed.
|
|
1789
1865
|
*/
|
|
1790
|
-
domain:
|
|
1866
|
+
domain: v44.string(),
|
|
1791
1867
|
/**
|
|
1792
1868
|
* Message payload to be signed.
|
|
1793
1869
|
*/
|
|
1794
|
-
message:
|
|
1870
|
+
message: v44.string(),
|
|
1795
1871
|
/**
|
|
1796
1872
|
* The public key to sign the message with.
|
|
1797
1873
|
*/
|
|
1798
|
-
publicKey:
|
|
1874
|
+
publicKey: v44.optional(v44.string())
|
|
1799
1875
|
});
|
|
1800
|
-
var stxSignStructuredMessageResultSchema =
|
|
1876
|
+
var stxSignStructuredMessageResultSchema = v44.object({
|
|
1801
1877
|
/**
|
|
1802
1878
|
* Signature of the message.
|
|
1803
1879
|
*/
|
|
1804
|
-
signature:
|
|
1880
|
+
signature: v44.string(),
|
|
1805
1881
|
/**
|
|
1806
1882
|
* Public key as hex-encoded string.
|
|
1807
1883
|
*/
|
|
1808
|
-
publicKey:
|
|
1884
|
+
publicKey: v44.string()
|
|
1809
1885
|
});
|
|
1810
|
-
var stxSignStructuredMessageRequestMessageSchema =
|
|
1886
|
+
var stxSignStructuredMessageRequestMessageSchema = v44.object({
|
|
1811
1887
|
...rpcRequestMessageSchema.entries,
|
|
1812
|
-
...
|
|
1813
|
-
method:
|
|
1888
|
+
...v44.object({
|
|
1889
|
+
method: v44.literal(stxSignStructuredMessageMethodName),
|
|
1814
1890
|
params: stxSignStructuredMessageParamsSchema,
|
|
1815
|
-
id:
|
|
1891
|
+
id: v44.string()
|
|
1816
1892
|
}).entries
|
|
1817
1893
|
});
|
|
1818
1894
|
|
|
1819
1895
|
// src/request/types/stxMethods/signTransaction.ts
|
|
1820
|
-
var
|
|
1896
|
+
var v45 = __toESM(require("valibot"));
|
|
1821
1897
|
var stxSignTransactionMethodName = "stx_signTransaction";
|
|
1822
|
-
var stxSignTransactionParamsSchema =
|
|
1898
|
+
var stxSignTransactionParamsSchema = v45.object({
|
|
1823
1899
|
/**
|
|
1824
1900
|
* The transaction to sign as a hex-encoded string.
|
|
1825
1901
|
*/
|
|
1826
|
-
transaction:
|
|
1902
|
+
transaction: v45.string(),
|
|
1827
1903
|
/**
|
|
1828
1904
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1829
1905
|
* when not provided.
|
|
1830
1906
|
*/
|
|
1831
|
-
pubkey:
|
|
1907
|
+
pubkey: v45.optional(v45.string()),
|
|
1832
1908
|
/**
|
|
1833
1909
|
* Whether to broadcast the transaction after signing. Defaults to `true`.
|
|
1834
1910
|
*/
|
|
1835
|
-
broadcast:
|
|
1911
|
+
broadcast: v45.optional(v45.boolean())
|
|
1836
1912
|
});
|
|
1837
|
-
var stxSignTransactionResultSchema =
|
|
1913
|
+
var stxSignTransactionResultSchema = v45.object({
|
|
1838
1914
|
/**
|
|
1839
1915
|
* The signed transaction as a hex-encoded string.
|
|
1840
1916
|
*/
|
|
1841
|
-
transaction:
|
|
1917
|
+
transaction: v45.string()
|
|
1842
1918
|
});
|
|
1843
|
-
var stxSignTransactionRequestMessageSchema =
|
|
1919
|
+
var stxSignTransactionRequestMessageSchema = v45.object({
|
|
1844
1920
|
...rpcRequestMessageSchema.entries,
|
|
1845
|
-
...
|
|
1846
|
-
method:
|
|
1921
|
+
...v45.object({
|
|
1922
|
+
method: v45.literal(stxSignTransactionMethodName),
|
|
1847
1923
|
params: stxSignTransactionParamsSchema,
|
|
1848
|
-
id:
|
|
1924
|
+
id: v45.string()
|
|
1849
1925
|
}).entries
|
|
1850
1926
|
});
|
|
1851
1927
|
|
|
1852
1928
|
// src/request/types/stxMethods/signTransactions.ts
|
|
1853
|
-
var
|
|
1929
|
+
var v46 = __toESM(require("valibot"));
|
|
1854
1930
|
var stxSignTransactionsMethodName = "stx_signTransactions";
|
|
1855
|
-
var stxSignTransactionsParamsSchema =
|
|
1931
|
+
var stxSignTransactionsParamsSchema = v46.object({
|
|
1856
1932
|
/**
|
|
1857
1933
|
* The transactions to sign as hex-encoded strings.
|
|
1858
1934
|
*/
|
|
1859
|
-
transactions:
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1935
|
+
transactions: v46.pipe(
|
|
1936
|
+
v46.array(
|
|
1937
|
+
v46.pipe(
|
|
1938
|
+
v46.string(),
|
|
1939
|
+
v46.check((hex) => {
|
|
1864
1940
|
return true;
|
|
1865
1941
|
}, "Invalid hex-encoded Stacks transaction.")
|
|
1866
1942
|
)
|
|
1867
1943
|
),
|
|
1868
|
-
|
|
1944
|
+
v46.minLength(1)
|
|
1869
1945
|
),
|
|
1870
1946
|
/**
|
|
1871
1947
|
* Whether the signed transactions should be broadcast after signing. Defaults
|
|
1872
1948
|
* to `true`.
|
|
1873
1949
|
*/
|
|
1874
|
-
broadcast:
|
|
1950
|
+
broadcast: v46.optional(v46.boolean())
|
|
1875
1951
|
});
|
|
1876
|
-
var stxSignTransactionsResultSchema =
|
|
1952
|
+
var stxSignTransactionsResultSchema = v46.object({
|
|
1877
1953
|
/**
|
|
1878
1954
|
* The signed transactions as hex-encoded strings, in the same order as in the
|
|
1879
1955
|
* sign request.
|
|
1880
1956
|
*/
|
|
1881
|
-
transactions:
|
|
1957
|
+
transactions: v46.array(v46.string())
|
|
1882
1958
|
});
|
|
1883
|
-
var stxSignTransactionsRequestMessageSchema =
|
|
1959
|
+
var stxSignTransactionsRequestMessageSchema = v46.object({
|
|
1884
1960
|
...rpcRequestMessageSchema.entries,
|
|
1885
|
-
...
|
|
1886
|
-
method:
|
|
1961
|
+
...v46.object({
|
|
1962
|
+
method: v46.literal(stxSignTransactionsMethodName),
|
|
1887
1963
|
params: stxSignTransactionsParamsSchema,
|
|
1888
|
-
id:
|
|
1964
|
+
id: v46.string()
|
|
1889
1965
|
}).entries
|
|
1890
1966
|
});
|
|
1891
1967
|
|
|
1892
1968
|
// src/request/types/stxMethods/transferStx.ts
|
|
1893
|
-
var
|
|
1969
|
+
var v47 = __toESM(require("valibot"));
|
|
1894
1970
|
var stxTransferStxMethodName = "stx_transferStx";
|
|
1895
|
-
var stxTransferStxParamsSchema =
|
|
1971
|
+
var stxTransferStxParamsSchema = v47.object({
|
|
1896
1972
|
/**
|
|
1897
1973
|
* Amount of STX tokens to transfer in microstacks as a string. Anything
|
|
1898
1974
|
* parseable by `BigInt` is acceptable.
|
|
@@ -1905,23 +1981,23 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1905
1981
|
* const amount3 = '1234';
|
|
1906
1982
|
* ```
|
|
1907
1983
|
*/
|
|
1908
|
-
amount:
|
|
1984
|
+
amount: v47.union([v47.number(), v47.string()]),
|
|
1909
1985
|
/**
|
|
1910
1986
|
* The recipient's principal.
|
|
1911
1987
|
*/
|
|
1912
|
-
recipient:
|
|
1988
|
+
recipient: v47.string(),
|
|
1913
1989
|
/**
|
|
1914
1990
|
* A string representing the memo.
|
|
1915
1991
|
*/
|
|
1916
|
-
memo:
|
|
1992
|
+
memo: v47.optional(v47.string()),
|
|
1917
1993
|
/**
|
|
1918
1994
|
* Version of parameter format.
|
|
1919
1995
|
*/
|
|
1920
|
-
version:
|
|
1996
|
+
version: v47.optional(v47.string()),
|
|
1921
1997
|
/**
|
|
1922
1998
|
* The mode of the post conditions.
|
|
1923
1999
|
*/
|
|
1924
|
-
postConditionMode:
|
|
2000
|
+
postConditionMode: v47.optional(v47.number()),
|
|
1925
2001
|
/**
|
|
1926
2002
|
* A hex-encoded string representing the post conditions.
|
|
1927
2003
|
*
|
|
@@ -1934,29 +2010,29 @@ var stxTransferStxParamsSchema = v40.object({
|
|
|
1934
2010
|
* const hexPostCondition = serializePostCondition(postCondition).toString('hex');
|
|
1935
2011
|
* ```
|
|
1936
2012
|
*/
|
|
1937
|
-
postConditions:
|
|
2013
|
+
postConditions: v47.optional(v47.array(v47.string())),
|
|
1938
2014
|
/**
|
|
1939
2015
|
* The public key to sign the transaction with. The wallet may use any key
|
|
1940
2016
|
* when not provided.
|
|
1941
2017
|
*/
|
|
1942
|
-
pubkey:
|
|
2018
|
+
pubkey: v47.optional(v47.string())
|
|
1943
2019
|
});
|
|
1944
|
-
var stxTransferStxResultSchema =
|
|
2020
|
+
var stxTransferStxResultSchema = v47.object({
|
|
1945
2021
|
/**
|
|
1946
2022
|
* The ID of the transaction.
|
|
1947
2023
|
*/
|
|
1948
|
-
txid:
|
|
2024
|
+
txid: v47.string(),
|
|
1949
2025
|
/**
|
|
1950
2026
|
* A Stacks transaction as a hex-encoded string.
|
|
1951
2027
|
*/
|
|
1952
|
-
transaction:
|
|
2028
|
+
transaction: v47.string()
|
|
1953
2029
|
});
|
|
1954
|
-
var stxTransferStxRequestMessageSchema =
|
|
2030
|
+
var stxTransferStxRequestMessageSchema = v47.object({
|
|
1955
2031
|
...rpcRequestMessageSchema.entries,
|
|
1956
|
-
...
|
|
1957
|
-
method:
|
|
2032
|
+
...v47.object({
|
|
2033
|
+
method: v47.literal(stxTransferStxMethodName),
|
|
1958
2034
|
params: stxTransferStxParamsSchema,
|
|
1959
|
-
id:
|
|
2035
|
+
id: v47.string()
|
|
1960
2036
|
}).entries
|
|
1961
2037
|
});
|
|
1962
2038
|
|
|
@@ -1964,13 +2040,13 @@ var stxTransferStxRequestMessageSchema = v40.object({
|
|
|
1964
2040
|
var cache = {};
|
|
1965
2041
|
var requestInternal = async (provider, method, params) => {
|
|
1966
2042
|
const response = await provider.request(method, params);
|
|
1967
|
-
if (
|
|
2043
|
+
if (v48.is(rpcErrorResponseMessageSchema, response)) {
|
|
1968
2044
|
return {
|
|
1969
2045
|
status: "error",
|
|
1970
2046
|
error: response.error
|
|
1971
2047
|
};
|
|
1972
2048
|
}
|
|
1973
|
-
if (
|
|
2049
|
+
if (v48.is(rpcSuccessResponseMessageSchema, response)) {
|
|
1974
2050
|
return {
|
|
1975
2051
|
status: "success",
|
|
1976
2052
|
result: response.result
|
|
@@ -3153,6 +3229,10 @@ var signMultipleTransactions = async (options) => {
|
|
|
3153
3229
|
signMessageParamsSchema,
|
|
3154
3230
|
signMessageRequestMessageSchema,
|
|
3155
3231
|
signMessageResultSchema,
|
|
3232
|
+
signMultipleMessagesMethodName,
|
|
3233
|
+
signMultipleMessagesParamsSchema,
|
|
3234
|
+
signMultipleMessagesRequestMessageSchema,
|
|
3235
|
+
signMultipleMessagesResultSchema,
|
|
3156
3236
|
signMultipleTransactions,
|
|
3157
3237
|
signPsbtMethodName,
|
|
3158
3238
|
signPsbtParamsSchema,
|