@sats-connect/core 0.17.6-78e54e2 → 0.17.6-bf97000
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 +16 -0
- package/dist/index.mjs +13 -6
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -946,6 +946,7 @@ declare const bitcoinSendTransferParamsSchema: v.ObjectSchema<{
|
|
|
946
946
|
readonly address: v.StringSchema<undefined>;
|
|
947
947
|
readonly amount: v.NumberSchema<undefined>;
|
|
948
948
|
}, undefined>, undefined>;
|
|
949
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
949
950
|
}, undefined>;
|
|
950
951
|
type BitcoinSendTransferParams = v.InferOutput<typeof bitcoinSendTransferParamsSchema>;
|
|
951
952
|
declare const bitcoinSendTransferRequestSchema: v.ObjectSchema<{
|
|
@@ -956,6 +957,7 @@ declare const bitcoinSendTransferRequestSchema: v.ObjectSchema<{
|
|
|
956
957
|
readonly address: v.StringSchema<undefined>;
|
|
957
958
|
readonly amount: v.NumberSchema<undefined>;
|
|
958
959
|
}, undefined>, undefined>;
|
|
960
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
959
961
|
}, undefined>;
|
|
960
962
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
961
963
|
}, undefined>;
|
|
@@ -964,12 +966,14 @@ type BitcoinSendTransferRequest = v.InferOutput<typeof bitcoinSendTransferReques
|
|
|
964
966
|
//#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransfer/response.d.ts
|
|
965
967
|
declare const bitcoinSendTransferResultSchema: v.ObjectSchema<{
|
|
966
968
|
readonly txid: v.StringSchema<undefined>;
|
|
969
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
967
970
|
}, undefined>;
|
|
968
971
|
type BitcoinSendTransferResult = v.InferOutput<typeof bitcoinSendTransferResultSchema>;
|
|
969
972
|
declare const bitcoinSendTransferSuccessResponseSchema: v.ObjectSchema<{
|
|
970
973
|
readonly id: v.StringSchema<undefined>;
|
|
971
974
|
readonly result: v.ObjectSchema<{
|
|
972
975
|
readonly txid: v.StringSchema<undefined>;
|
|
976
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
973
977
|
}, undefined>;
|
|
974
978
|
readonly '~sats-connect-method': v.LiteralSchema<"sendTransfer", undefined>;
|
|
975
979
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -989,6 +993,7 @@ declare const bitcoinSendTransferV2ParamsSchema: v.ObjectSchema<{
|
|
|
989
993
|
readonly address: v.StringSchema<undefined>;
|
|
990
994
|
readonly amount: v.NumberSchema<undefined>;
|
|
991
995
|
}, undefined>, undefined>;
|
|
996
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
992
997
|
}, undefined>;
|
|
993
998
|
type BitcoinSendTransferV2Params = v.InferOutput<typeof bitcoinSendTransferV2ParamsSchema>;
|
|
994
999
|
declare const bitcoinSendTransferV2RequestSchema: v.ObjectSchema<{
|
|
@@ -999,6 +1004,7 @@ declare const bitcoinSendTransferV2RequestSchema: v.ObjectSchema<{
|
|
|
999
1004
|
readonly address: v.StringSchema<undefined>;
|
|
1000
1005
|
readonly amount: v.NumberSchema<undefined>;
|
|
1001
1006
|
}, undefined>, undefined>;
|
|
1007
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1002
1008
|
}, undefined>;
|
|
1003
1009
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1004
1010
|
}, undefined>;
|
|
@@ -1007,12 +1013,14 @@ type BitcoinSendTransferV2Request = v.InferOutput<typeof bitcoinSendTransferV2Re
|
|
|
1007
1013
|
//#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransferV2/response.d.ts
|
|
1008
1014
|
declare const bitcoinSendTransferV2ResultSchema: v.ObjectSchema<{
|
|
1009
1015
|
readonly txid: v.StringSchema<undefined>;
|
|
1016
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1010
1017
|
}, undefined>;
|
|
1011
1018
|
type BitcoinSendTransferV2Result = v.InferOutput<typeof bitcoinSendTransferV2ResultSchema>;
|
|
1012
1019
|
declare const bitcoinSendTransferV2SuccessResponseSchema: v.ObjectSchema<{
|
|
1013
1020
|
readonly id: v.StringSchema<undefined>;
|
|
1014
1021
|
readonly result: v.ObjectSchema<{
|
|
1015
1022
|
readonly txid: v.StringSchema<undefined>;
|
|
1023
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1016
1024
|
}, undefined>;
|
|
1017
1025
|
readonly '~sats-connect-method': v.LiteralSchema<"bitcoin_sendTransferV2", undefined>;
|
|
1018
1026
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -1368,6 +1376,7 @@ declare const bitcoinRequestSchema: v.VariantSchema<"method", [v.ObjectSchema<{
|
|
|
1368
1376
|
readonly address: v.StringSchema<undefined>;
|
|
1369
1377
|
readonly amount: v.NumberSchema<undefined>;
|
|
1370
1378
|
}, undefined>, undefined>;
|
|
1379
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1371
1380
|
}, undefined>;
|
|
1372
1381
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1373
1382
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1378,6 +1387,7 @@ declare const bitcoinRequestSchema: v.VariantSchema<"method", [v.ObjectSchema<{
|
|
|
1378
1387
|
readonly address: v.StringSchema<undefined>;
|
|
1379
1388
|
readonly amount: v.NumberSchema<undefined>;
|
|
1380
1389
|
}, undefined>, undefined>;
|
|
1390
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
1381
1391
|
}, undefined>;
|
|
1382
1392
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
1383
1393
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -1710,6 +1720,7 @@ declare const bitcoinSuccessResponseSchema: v.VariantSchema<"~sats-connect-metho
|
|
|
1710
1720
|
readonly id: v.StringSchema<undefined>;
|
|
1711
1721
|
readonly result: v.ObjectSchema<{
|
|
1712
1722
|
readonly txid: v.StringSchema<undefined>;
|
|
1723
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1713
1724
|
}, undefined>;
|
|
1714
1725
|
readonly '~sats-connect-method': v.LiteralSchema<"sendTransfer", undefined>;
|
|
1715
1726
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -1724,6 +1735,7 @@ declare const bitcoinSuccessResponseSchema: v.VariantSchema<"~sats-connect-metho
|
|
|
1724
1735
|
readonly id: v.StringSchema<undefined>;
|
|
1725
1736
|
readonly result: v.ObjectSchema<{
|
|
1726
1737
|
readonly txid: v.StringSchema<undefined>;
|
|
1738
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
1727
1739
|
}, undefined>;
|
|
1728
1740
|
readonly '~sats-connect-method': v.LiteralSchema<"bitcoin_sendTransferV2", undefined>;
|
|
1729
1741
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -10626,6 +10638,7 @@ declare const rpcRequestSchema: v.VariantSchema<"method", [v.VariantSchema<"meth
|
|
|
10626
10638
|
readonly address: v.StringSchema<undefined>;
|
|
10627
10639
|
readonly amount: v.NumberSchema<undefined>;
|
|
10628
10640
|
}, undefined>, undefined>;
|
|
10641
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
10629
10642
|
}, undefined>;
|
|
10630
10643
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
10631
10644
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -10636,6 +10649,7 @@ declare const rpcRequestSchema: v.VariantSchema<"method", [v.VariantSchema<"meth
|
|
|
10636
10649
|
readonly address: v.StringSchema<undefined>;
|
|
10637
10650
|
readonly amount: v.NumberSchema<undefined>;
|
|
10638
10651
|
}, undefined>, undefined>;
|
|
10652
|
+
readonly broadcast: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
10639
10653
|
}, undefined>;
|
|
10640
10654
|
readonly jsonrpc: v.LiteralSchema<"2.0", undefined>;
|
|
10641
10655
|
}, undefined>, v.ObjectSchema<{
|
|
@@ -11922,6 +11936,7 @@ declare const rpcSuccessResponseSchema: v.VariantSchema<"~sats-connect-method",
|
|
|
11922
11936
|
readonly id: v.StringSchema<undefined>;
|
|
11923
11937
|
readonly result: v.ObjectSchema<{
|
|
11924
11938
|
readonly txid: v.StringSchema<undefined>;
|
|
11939
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11925
11940
|
}, undefined>;
|
|
11926
11941
|
readonly '~sats-connect-method': v.LiteralSchema<"sendTransfer", undefined>;
|
|
11927
11942
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
|
@@ -11936,6 +11951,7 @@ declare const rpcSuccessResponseSchema: v.VariantSchema<"~sats-connect-method",
|
|
|
11936
11951
|
readonly id: v.StringSchema<undefined>;
|
|
11937
11952
|
readonly result: v.ObjectSchema<{
|
|
11938
11953
|
readonly txid: v.StringSchema<undefined>;
|
|
11954
|
+
readonly transaction: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
|
|
11939
11955
|
}, undefined>;
|
|
11940
11956
|
readonly '~sats-connect-method': v.LiteralSchema<"bitcoin_sendTransferV2", undefined>;
|
|
11941
11957
|
readonly extensions: v.OptionalSchema<v.ObjectSchema<{
|
package/dist/index.mjs
CHANGED
|
@@ -741,8 +741,9 @@ var UnisatAdapter = class extends SatsConnectAdapter {
|
|
|
741
741
|
};
|
|
742
742
|
}
|
|
743
743
|
async sendTransfer(params) {
|
|
744
|
-
const { recipients } = params;
|
|
744
|
+
const { recipients, broadcast } = params;
|
|
745
745
|
if (recipients.length > 1) throw new Error("Only one recipient is supported by this wallet provider");
|
|
746
|
+
if (broadcast === false) throw new Error("Signing without broadcasting is not supported by this wallet provider");
|
|
746
747
|
return { txid: await window.unisat.sendBitcoin(recipients[0].address, recipients[0].amount) };
|
|
747
748
|
}
|
|
748
749
|
async signPsbt(params) {
|
|
@@ -1672,11 +1673,17 @@ const bitcoinGetInfoSuccessResponseSchema = createSuccessResponseSchema({
|
|
|
1672
1673
|
|
|
1673
1674
|
//#endregion
|
|
1674
1675
|
//#region src/request/rpc/objects/namespaces/bitcoin/shared/sendTransfer.ts
|
|
1675
|
-
const sendTransferParamsSchema = v.object({
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1676
|
+
const sendTransferParamsSchema = v.object({
|
|
1677
|
+
recipients: v.array(v.object({
|
|
1678
|
+
address: v.string(),
|
|
1679
|
+
amount: v.number()
|
|
1680
|
+
})),
|
|
1681
|
+
broadcast: v.optional(v.boolean())
|
|
1682
|
+
});
|
|
1683
|
+
const sendTransferResultSchema = v.object({
|
|
1684
|
+
txid: v.string(),
|
|
1685
|
+
transaction: v.optional(v.string())
|
|
1686
|
+
});
|
|
1680
1687
|
|
|
1681
1688
|
//#endregion
|
|
1682
1689
|
//#region src/request/rpc/objects/namespaces/bitcoin/methods/sendTransfer/request.ts
|