@dynamic-labs-sdk/bitcoin 0.14.0 → 0.16.0
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/{addBitcoinInjectedWalletsExtension-B6eLwqAo.esm.js → addBitcoinInjectedWalletsExtension-IPiZlN_F.esm.js} +175 -17
- package/dist/addBitcoinInjectedWalletsExtension-IPiZlN_F.esm.js.map +1 -0
- package/dist/{addBitcoinInjectedWalletsExtension-TTGVO49N.cjs.js → addBitcoinInjectedWalletsExtension-oIg2EJkg.cjs.js} +210 -16
- package/dist/addBitcoinInjectedWalletsExtension-oIg2EJkg.cjs.js.map +1 -0
- package/dist/checkoutTransaction.types.d.ts +6 -0
- package/dist/checkoutTransaction.types.d.ts.map +1 -0
- package/dist/index.cjs.js +9 -94
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +3 -88
- package/dist/index.esm.js.map +1 -1
- package/dist/injected/utils/binance/createBinanceBitcoinWalletProvider/createBinanceBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/leather/createLeatherBitcoinWalletProvider/createLeatherBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/magicEden/createMagicEdenBitcoinWalletProvider/createMagicEdenBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/okx/createOkxBitcoinWalletProvider/createOkxBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/oneKey/createOneKeyBitcoinWalletProvider/createOneKeyBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/oyl/createOylBitcoinWalletProvider/createOylBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/phantom/createPhantomBitcoinWalletProvider/createPhantomBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/unisat/createUnisatWalletProvider/createUnisatWalletProvider.d.ts.map +1 -1
- package/dist/injected/utils/xverse/createXverseBitcoinWalletProvider/createXverseBitcoinWalletProvider.d.ts.map +1 -1
- package/dist/injected.cjs.js +1 -1
- package/dist/injected.esm.js +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/bitcoinExecuteCheckoutTransaction/bitcoinExecuteCheckoutTransaction.d.ts +4 -0
- package/dist/utils/bitcoinExecuteCheckoutTransaction/bitcoinExecuteCheckoutTransaction.d.ts.map +1 -0
- package/dist/utils/bitcoinExecuteCheckoutTransaction/index.d.ts +2 -0
- package/dist/utils/bitcoinExecuteCheckoutTransaction/index.d.ts.map +1 -0
- package/dist/utils/bitcoinTransferAmount/bitcoinTransferAmount.d.ts +18 -0
- package/dist/utils/bitcoinTransferAmount/bitcoinTransferAmount.d.ts.map +1 -0
- package/dist/utils/bitcoinTransferAmount/index.d.ts +2 -0
- package/dist/utils/bitcoinTransferAmount/index.d.ts.map +1 -0
- package/dist/waas/utils/createWalletProviderForWaasBitcoin/createWalletProviderForWaasBitcoin.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/addBitcoinInjectedWalletsExtension-B6eLwqAo.esm.js.map +0 -1
- package/dist/addBitcoinInjectedWalletsExtension-TTGVO49N.cjs.js.map +0 -1
|
@@ -8,7 +8,7 @@ let sats_connect = require("sats-connect");
|
|
|
8
8
|
|
|
9
9
|
//#region package.json
|
|
10
10
|
var name = "@dynamic-labs-sdk/bitcoin";
|
|
11
|
-
var version = "0.
|
|
11
|
+
var version = "0.16.0";
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
14
14
|
//#region src/constants.ts
|
|
@@ -56,6 +56,146 @@ const registerBitcoinNetworkProviderBuilder = (client) => {
|
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
+
//#endregion
|
|
60
|
+
//#region src/isBitcoinWalletAccount/isBitcoinWalletAccount.ts
|
|
61
|
+
/**
|
|
62
|
+
* Type guard function to check if a wallet account is a Bitcoin wallet account.
|
|
63
|
+
*
|
|
64
|
+
* @param walletAccount - The wallet account to check.
|
|
65
|
+
* @returns True if the wallet account is a Bitcoin wallet account, false otherwise.
|
|
66
|
+
*/
|
|
67
|
+
const isBitcoinWalletAccount = (walletAccount) => walletAccount.chain === "BTC";
|
|
68
|
+
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/isBitcoinWalletProvider/isBitcoinWalletProvider.ts
|
|
71
|
+
const isBitcoinWalletProvider = (provider) => {
|
|
72
|
+
return provider.chain === "BTC";
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/errors/SendBitcoinRawTransactionError.ts
|
|
77
|
+
var SendBitcoinRawTransactionError = class extends _dynamic_labs_sdk_client.BaseError {
|
|
78
|
+
constructor({ originalError }) {
|
|
79
|
+
const cause = originalError instanceof Error ? originalError : null;
|
|
80
|
+
super({
|
|
81
|
+
cause,
|
|
82
|
+
code: "send_bitcoin_raw_transaction_error",
|
|
83
|
+
docsUrl: null,
|
|
84
|
+
name: "SendBitcoinRawTransactionError",
|
|
85
|
+
shortMessage: "Failed to send Bitcoin raw transaction"
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/sendRawTransaction/sendRawTransaction.ts
|
|
92
|
+
/**
|
|
93
|
+
* Sends a raw transaction using the mempool.space API
|
|
94
|
+
* @param params.rawTransaction - The raw transaction to send
|
|
95
|
+
* @param params.walletAccount - The wallet account to send the transaction from
|
|
96
|
+
* @returns An object containing the transaction id
|
|
97
|
+
*/
|
|
98
|
+
const sendRawTransaction = async ({ rawTransaction, walletAccount }, client = (0, _dynamic_labs_sdk_client.getDefaultClient)()) => {
|
|
99
|
+
const fetchService = (0, _dynamic_labs_sdk_client_core.getCore)(client).fetch;
|
|
100
|
+
const response = await fetchService(`${getMempoolApiUrl(walletAccount.address)}/tx`, {
|
|
101
|
+
body: rawTransaction,
|
|
102
|
+
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
103
|
+
method: "POST"
|
|
104
|
+
});
|
|
105
|
+
if (!response.ok) throw new SendBitcoinRawTransactionError({ originalError: await response.text() });
|
|
106
|
+
return { transactionId: await response.text() };
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/utils/bitcoinExecuteCheckoutTransaction/bitcoinExecuteCheckoutTransaction.ts
|
|
111
|
+
const bitcoinExecuteCheckoutTransaction = async ({ onStepChange, signingPayload, walletAccount }, client) => {
|
|
112
|
+
const provider = (0, _dynamic_labs_sdk_client_core.getWalletProviderFromWalletAccount)({ walletAccount }, client);
|
|
113
|
+
if (!isBitcoinWalletAccount(walletAccount) || !isBitcoinWalletProvider(provider)) throw new _dynamic_labs_sdk_client.InvalidParamError("Wallet account is not a Bitcoin wallet account");
|
|
114
|
+
const bitcoinPayload = signingPayload;
|
|
115
|
+
if (!bitcoinPayload.psbtTransaction?.psbt) throw new _dynamic_labs_sdk_client.InvalidParamError("Signing payload is missing PSBT transaction data");
|
|
116
|
+
onStepChange?.("transaction");
|
|
117
|
+
const { signedPsbt } = await provider.signPsbt({
|
|
118
|
+
request: {
|
|
119
|
+
allowedSighash: [1],
|
|
120
|
+
unsignedPsbtBase64: bitcoinPayload.psbtTransaction.psbt
|
|
121
|
+
},
|
|
122
|
+
walletAccount
|
|
123
|
+
});
|
|
124
|
+
const psbt = bitcoinjs_lib.Psbt.fromBase64(signedPsbt);
|
|
125
|
+
psbt.finalizeAllInputs();
|
|
126
|
+
const { transactionId } = await sendRawTransaction({
|
|
127
|
+
rawTransaction: psbt.extractTransaction().toHex(),
|
|
128
|
+
walletAccount
|
|
129
|
+
}, client);
|
|
130
|
+
return { transactionHash: transactionId };
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/errors/NotBitcoinProviderError.ts
|
|
135
|
+
var NotBitcoinProviderError = class extends _dynamic_labs_sdk_client.BaseError {
|
|
136
|
+
providerKey;
|
|
137
|
+
constructor(params) {
|
|
138
|
+
super({
|
|
139
|
+
cause: null,
|
|
140
|
+
code: "not_bitcoin_provider_error",
|
|
141
|
+
docsUrl: null,
|
|
142
|
+
name: "NotBitcoinProviderError",
|
|
143
|
+
shortMessage: "Provider is not a Bitcoin wallet provider"
|
|
144
|
+
});
|
|
145
|
+
this.providerKey = params.providerKey;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/sendBitcoin/sendBitcoin.ts
|
|
151
|
+
/**
|
|
152
|
+
* Sends a Bitcoin transaction
|
|
153
|
+
* @param params.transaction - The transaction to send
|
|
154
|
+
* @param params.walletAccount - The wallet account to send the transaction from
|
|
155
|
+
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
156
|
+
* @returns An object containing the transaction id
|
|
157
|
+
* @throws {MethodNotImplementedError} If the wallet provider does not implement the sendBitcoin method
|
|
158
|
+
* @throws {NotBitcoinProviderError} If the wallet account is not a valid BitcoinWalletAccount
|
|
159
|
+
*/
|
|
160
|
+
const sendBitcoin = async ({ walletAccount, transaction }, client = (0, _dynamic_labs_sdk_client.getDefaultClient)()) => {
|
|
161
|
+
const provider = (0, _dynamic_labs_sdk_client_core.getWalletProviderFromWalletAccount)({ walletAccount }, client);
|
|
162
|
+
if (!isBitcoinWalletProvider(provider)) throw new NotBitcoinProviderError({ providerKey: provider.key });
|
|
163
|
+
if (!provider.sendBitcoin) throw new _dynamic_labs_sdk_client_core.MethodNotImplementedError("sendBitcoin");
|
|
164
|
+
return provider.sendBitcoin({
|
|
165
|
+
transaction,
|
|
166
|
+
walletAccount
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
//#endregion
|
|
171
|
+
//#region src/utils/bitcoinTransferAmount/bitcoinTransferAmount.ts
|
|
172
|
+
const BTC_DECIMALS = 8;
|
|
173
|
+
/**
|
|
174
|
+
* Transfers native BTC from one wallet to another.
|
|
175
|
+
*
|
|
176
|
+
* Converts the human-readable BTC amount string to satoshis (8 decimals)
|
|
177
|
+
* and delegates to `sendBitcoin`.
|
|
178
|
+
*
|
|
179
|
+
* @param params.amount - The amount in BTC as a decimal string (e.g. "0.001").
|
|
180
|
+
* @param params.recipient - The recipient Bitcoin address.
|
|
181
|
+
* @param params.walletAccount - The wallet account to send from.
|
|
182
|
+
* @param client - The Dynamic client instance.
|
|
183
|
+
* @returns An object containing the transaction hash.
|
|
184
|
+
*/
|
|
185
|
+
const bitcoinTransferAmount = async ({ amount, recipient, walletAccount }, client) => {
|
|
186
|
+
if (!isBitcoinWalletAccount(walletAccount)) throw new _dynamic_labs_sdk_client.InvalidParamError("Wallet account is not a Bitcoin wallet account");
|
|
187
|
+
return { transactionHash: (await sendBitcoin({
|
|
188
|
+
transaction: {
|
|
189
|
+
amount: (0, _dynamic_labs_sdk_client_core.parseAmountToSmallestUnit)({
|
|
190
|
+
amount,
|
|
191
|
+
decimals: BTC_DECIMALS
|
|
192
|
+
}),
|
|
193
|
+
recipientAddress: recipient
|
|
194
|
+
},
|
|
195
|
+
walletAccount
|
|
196
|
+
}, client)).transactionId };
|
|
197
|
+
};
|
|
198
|
+
|
|
59
199
|
//#endregion
|
|
60
200
|
//#region src/errors/InvalidPsbtError.ts
|
|
61
201
|
var InvalidPsbtError = class extends _dynamic_labs_sdk_client.BaseError {
|
|
@@ -271,6 +411,7 @@ const createBinanceBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
271
411
|
get events() {
|
|
272
412
|
return getEventEmitter();
|
|
273
413
|
},
|
|
414
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
274
415
|
getActiveNetworkId,
|
|
275
416
|
getConnectedAddresses,
|
|
276
417
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(BINANCE_METADATA.displayName),
|
|
@@ -280,6 +421,7 @@ const createBinanceBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
280
421
|
signPsbt,
|
|
281
422
|
signPsbts,
|
|
282
423
|
terminate,
|
|
424
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
283
425
|
walletProviderType
|
|
284
426
|
};
|
|
285
427
|
};
|
|
@@ -321,7 +463,7 @@ const createUnisatWalletProvider = ({ dynamicClient, injectedProvider }) => {
|
|
|
321
463
|
const getConnectedAddresses = async () => {
|
|
322
464
|
return { addresses: await injectedProvider.getAccounts() };
|
|
323
465
|
};
|
|
324
|
-
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
466
|
+
const sendBitcoin$1 = async ({ transaction, walletAccount }) => {
|
|
325
467
|
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
326
468
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount)) };
|
|
327
469
|
};
|
|
@@ -377,16 +519,18 @@ const createUnisatWalletProvider = ({ dynamicClient, injectedProvider }) => {
|
|
|
377
519
|
get events() {
|
|
378
520
|
return getEventEmitter();
|
|
379
521
|
},
|
|
522
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
380
523
|
getActiveNetworkId,
|
|
381
524
|
getConnectedAddresses,
|
|
382
525
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(UNISAT_METADATA.displayName),
|
|
383
526
|
key,
|
|
384
527
|
metadata: UNISAT_METADATA,
|
|
385
|
-
sendBitcoin,
|
|
528
|
+
sendBitcoin: sendBitcoin$1,
|
|
386
529
|
signMessage,
|
|
387
530
|
signPsbt,
|
|
388
531
|
signPsbts,
|
|
389
532
|
terminate,
|
|
533
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
390
534
|
walletProviderType
|
|
391
535
|
};
|
|
392
536
|
};
|
|
@@ -484,7 +628,7 @@ const createLeatherBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
484
628
|
const getConnectedAddresses = async () => {
|
|
485
629
|
return { addresses: (await connect()).addresses.map((address$1) => address$1.address) };
|
|
486
630
|
};
|
|
487
|
-
const sendBitcoin = async ({ transaction }) => {
|
|
631
|
+
const sendBitcoin$1 = async ({ transaction }) => {
|
|
488
632
|
const { networkName } = await getNetworkPayload();
|
|
489
633
|
return { transactionId: (await injectedProvider.request("sendTransfer", {
|
|
490
634
|
account: 0,
|
|
@@ -539,15 +683,17 @@ const createLeatherBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
539
683
|
return {
|
|
540
684
|
chain,
|
|
541
685
|
connect,
|
|
686
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
542
687
|
getActiveNetworkId,
|
|
543
688
|
getConnectedAddresses,
|
|
544
689
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(LEATHER_METADATA.displayName),
|
|
545
690
|
key,
|
|
546
691
|
metadata: LEATHER_METADATA,
|
|
547
|
-
sendBitcoin,
|
|
692
|
+
sendBitcoin: sendBitcoin$1,
|
|
548
693
|
signMessage,
|
|
549
694
|
signPsbt,
|
|
550
695
|
signPsbts,
|
|
696
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
551
697
|
walletProviderType
|
|
552
698
|
};
|
|
553
699
|
};
|
|
@@ -656,7 +802,7 @@ const createMagicEdenBitcoinWalletProvider = ({ dynamicClient, satsConnectProvid
|
|
|
656
802
|
const { addresses } = await connect();
|
|
657
803
|
return { addresses: addresses.map((address$1) => address$1.address) };
|
|
658
804
|
};
|
|
659
|
-
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
805
|
+
const sendBitcoin$1 = async ({ transaction, walletAccount }) => {
|
|
660
806
|
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
661
807
|
const senderAddress = (0, _dynamic_labs_sdk_client.getWalletAccountAddressByType)({
|
|
662
808
|
type: "payment",
|
|
@@ -784,16 +930,18 @@ const createMagicEdenBitcoinWalletProvider = ({ dynamicClient, satsConnectProvid
|
|
|
784
930
|
get events() {
|
|
785
931
|
return getEventEmitter();
|
|
786
932
|
},
|
|
933
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
787
934
|
getActiveNetworkId,
|
|
788
935
|
getConnectedAddresses,
|
|
789
936
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(MAGIC_EDEN_METADATA.displayName),
|
|
790
937
|
key,
|
|
791
938
|
metadata: MAGIC_EDEN_METADATA,
|
|
792
|
-
sendBitcoin,
|
|
939
|
+
sendBitcoin: sendBitcoin$1,
|
|
793
940
|
signMessage,
|
|
794
941
|
signPsbt,
|
|
795
942
|
signPsbts,
|
|
796
943
|
terminate,
|
|
944
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
797
945
|
walletProviderType
|
|
798
946
|
};
|
|
799
947
|
};
|
|
@@ -832,7 +980,7 @@ const createOkxBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
832
980
|
const getConnectedAddresses = async () => {
|
|
833
981
|
return { addresses: await injectedProvider.getAccounts() };
|
|
834
982
|
};
|
|
835
|
-
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
983
|
+
const sendBitcoin$1 = async ({ transaction, walletAccount }) => {
|
|
836
984
|
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
837
985
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString()) };
|
|
838
986
|
};
|
|
@@ -884,16 +1032,18 @@ const createOkxBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
884
1032
|
get events() {
|
|
885
1033
|
return getEventEmitter();
|
|
886
1034
|
},
|
|
1035
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
887
1036
|
getActiveNetworkId,
|
|
888
1037
|
getConnectedAddresses,
|
|
889
1038
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(OKX_METADATA.displayName),
|
|
890
1039
|
key,
|
|
891
1040
|
metadata: OKX_METADATA,
|
|
892
|
-
sendBitcoin,
|
|
1041
|
+
sendBitcoin: sendBitcoin$1,
|
|
893
1042
|
signMessage,
|
|
894
1043
|
signPsbt,
|
|
895
1044
|
signPsbts,
|
|
896
1045
|
terminate,
|
|
1046
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
897
1047
|
walletProviderType
|
|
898
1048
|
};
|
|
899
1049
|
};
|
|
@@ -931,7 +1081,7 @@ const createOneKeyBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
931
1081
|
const getConnectedAddresses = async () => {
|
|
932
1082
|
return { addresses: await injectedProvider.getAccounts() };
|
|
933
1083
|
};
|
|
934
|
-
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
1084
|
+
const sendBitcoin$1 = async ({ transaction, walletAccount }) => {
|
|
935
1085
|
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
936
1086
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString()) };
|
|
937
1087
|
};
|
|
@@ -978,16 +1128,18 @@ const createOneKeyBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
978
1128
|
get events() {
|
|
979
1129
|
return getEventEmitter();
|
|
980
1130
|
},
|
|
1131
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
981
1132
|
getActiveNetworkId,
|
|
982
1133
|
getConnectedAddresses,
|
|
983
1134
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(ONEKEY_METADATA.displayName),
|
|
984
1135
|
key,
|
|
985
1136
|
metadata: ONEKEY_METADATA,
|
|
986
|
-
sendBitcoin,
|
|
1137
|
+
sendBitcoin: sendBitcoin$1,
|
|
987
1138
|
signMessage,
|
|
988
1139
|
signPsbt,
|
|
989
1140
|
signPsbts,
|
|
990
1141
|
terminate,
|
|
1142
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
991
1143
|
walletProviderType
|
|
992
1144
|
};
|
|
993
1145
|
};
|
|
@@ -1077,6 +1229,7 @@ const createOylBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
1077
1229
|
return {
|
|
1078
1230
|
chain,
|
|
1079
1231
|
connect,
|
|
1232
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
1080
1233
|
getActiveNetworkId,
|
|
1081
1234
|
getConnectedAddresses,
|
|
1082
1235
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(OYL_METADATA.displayName),
|
|
@@ -1085,6 +1238,7 @@ const createOylBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
1085
1238
|
signMessage,
|
|
1086
1239
|
signPsbt,
|
|
1087
1240
|
signPsbts,
|
|
1241
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
1088
1242
|
walletProviderType
|
|
1089
1243
|
};
|
|
1090
1244
|
};
|
|
@@ -1182,6 +1336,7 @@ const createPhantomBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
1182
1336
|
get events() {
|
|
1183
1337
|
return getEventEmitter();
|
|
1184
1338
|
},
|
|
1339
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
1185
1340
|
getActiveNetworkId,
|
|
1186
1341
|
getConnectedAddresses,
|
|
1187
1342
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(PHANTOM_METADATA.displayName),
|
|
@@ -1191,6 +1346,7 @@ const createPhantomBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
1191
1346
|
signPsbt,
|
|
1192
1347
|
signPsbts,
|
|
1193
1348
|
terminate,
|
|
1349
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
1194
1350
|
walletProviderType
|
|
1195
1351
|
};
|
|
1196
1352
|
};
|
|
@@ -1273,7 +1429,7 @@ const createXverseBitcoinWalletProvider = ({ dynamicClient, satsConnectProvider
|
|
|
1273
1429
|
if (response.error.code !== sats_connect.RpcErrorCode.ACCESS_DENIED) throw response.error;
|
|
1274
1430
|
return { addresses: [] };
|
|
1275
1431
|
};
|
|
1276
|
-
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
1432
|
+
const sendBitcoin$1 = async ({ transaction, walletAccount }) => {
|
|
1277
1433
|
await (0, _dynamic_labs_sdk_client.assertWalletAccountSigningAvailability)({ walletAccount }, dynamicClient);
|
|
1278
1434
|
const response = await (0, sats_connect.request)("sendTransfer", { recipients: [{
|
|
1279
1435
|
address: transaction.recipientAddress,
|
|
@@ -1370,16 +1526,18 @@ const createXverseBitcoinWalletProvider = ({ dynamicClient, satsConnectProvider
|
|
|
1370
1526
|
get events() {
|
|
1371
1527
|
return getEventEmitter();
|
|
1372
1528
|
},
|
|
1529
|
+
executeCheckoutTransaction: (args) => bitcoinExecuteCheckoutTransaction(args, dynamicClient),
|
|
1373
1530
|
getActiveNetworkId,
|
|
1374
1531
|
getConnectedAddresses,
|
|
1375
1532
|
groupKey: (0, _dynamic_labs_sdk_client_core.formatWalletProviderGroupKey)(XVERSE_METADATA.displayName),
|
|
1376
1533
|
key,
|
|
1377
1534
|
metadata: XVERSE_METADATA,
|
|
1378
|
-
sendBitcoin,
|
|
1535
|
+
sendBitcoin: sendBitcoin$1,
|
|
1379
1536
|
signMessage,
|
|
1380
1537
|
signPsbt,
|
|
1381
1538
|
signPsbts,
|
|
1382
1539
|
terminate,
|
|
1540
|
+
transferAmount: (args) => bitcoinTransferAmount(args, dynamicClient),
|
|
1383
1541
|
walletProviderType
|
|
1384
1542
|
};
|
|
1385
1543
|
};
|
|
@@ -1502,16 +1660,40 @@ Object.defineProperty(exports, 'InvalidPsbtError', {
|
|
|
1502
1660
|
return InvalidPsbtError;
|
|
1503
1661
|
}
|
|
1504
1662
|
});
|
|
1663
|
+
Object.defineProperty(exports, 'NotBitcoinProviderError', {
|
|
1664
|
+
enumerable: true,
|
|
1665
|
+
get: function () {
|
|
1666
|
+
return NotBitcoinProviderError;
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1505
1669
|
Object.defineProperty(exports, 'addBitcoinInjectedWalletsExtension', {
|
|
1506
1670
|
enumerable: true,
|
|
1507
1671
|
get: function () {
|
|
1508
1672
|
return addBitcoinInjectedWalletsExtension;
|
|
1509
1673
|
}
|
|
1510
1674
|
});
|
|
1511
|
-
Object.defineProperty(exports, '
|
|
1675
|
+
Object.defineProperty(exports, 'bitcoinExecuteCheckoutTransaction', {
|
|
1676
|
+
enumerable: true,
|
|
1677
|
+
get: function () {
|
|
1678
|
+
return bitcoinExecuteCheckoutTransaction;
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
Object.defineProperty(exports, 'bitcoinTransferAmount', {
|
|
1682
|
+
enumerable: true,
|
|
1683
|
+
get: function () {
|
|
1684
|
+
return bitcoinTransferAmount;
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
Object.defineProperty(exports, 'isBitcoinWalletAccount', {
|
|
1688
|
+
enumerable: true,
|
|
1689
|
+
get: function () {
|
|
1690
|
+
return isBitcoinWalletAccount;
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
Object.defineProperty(exports, 'isBitcoinWalletProvider', {
|
|
1512
1694
|
enumerable: true,
|
|
1513
1695
|
get: function () {
|
|
1514
|
-
return
|
|
1696
|
+
return isBitcoinWalletProvider;
|
|
1515
1697
|
}
|
|
1516
1698
|
});
|
|
1517
1699
|
Object.defineProperty(exports, 'name', {
|
|
@@ -1526,10 +1708,22 @@ Object.defineProperty(exports, 'registerBitcoinNetworkProviderBuilder', {
|
|
|
1526
1708
|
return registerBitcoinNetworkProviderBuilder;
|
|
1527
1709
|
}
|
|
1528
1710
|
});
|
|
1711
|
+
Object.defineProperty(exports, 'sendBitcoin', {
|
|
1712
|
+
enumerable: true,
|
|
1713
|
+
get: function () {
|
|
1714
|
+
return sendBitcoin;
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
Object.defineProperty(exports, 'sendRawTransaction', {
|
|
1718
|
+
enumerable: true,
|
|
1719
|
+
get: function () {
|
|
1720
|
+
return sendRawTransaction;
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1529
1723
|
Object.defineProperty(exports, 'version', {
|
|
1530
1724
|
enumerable: true,
|
|
1531
1725
|
get: function () {
|
|
1532
1726
|
return version;
|
|
1533
1727
|
}
|
|
1534
1728
|
});
|
|
1535
|
-
//# sourceMappingURL=addBitcoinInjectedWalletsExtension-
|
|
1729
|
+
//# sourceMappingURL=addBitcoinInjectedWalletsExtension-oIg2EJkg.cjs.js.map
|