@dynamic-labs-sdk/bitcoin 0.23.2 → 0.23.4
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-Blf31mFB.esm.js → addBitcoinInjectedWalletsExtension-BIxPSyXV.esm.js} +17 -217
- package/dist/addBitcoinInjectedWalletsExtension-BIxPSyXV.esm.js.map +1 -0
- package/dist/{addBitcoinInjectedWalletsExtension-DoK6Bz_8.cjs.js → addBitcoinInjectedWalletsExtension-BcX1Ks1d.cjs.js} +36 -296
- package/dist/addBitcoinInjectedWalletsExtension-BcX1Ks1d.cjs.js.map +1 -0
- package/dist/addWaasBitcoinExtension-8da7zX1k.esm.js +707 -0
- package/dist/addWaasBitcoinExtension-8da7zX1k.esm.js.map +1 -0
- package/dist/addWaasBitcoinExtension-CXG18ahP.cjs.js +758 -0
- package/dist/addWaasBitcoinExtension-CXG18ahP.cjs.js.map +1 -0
- package/dist/bitcoinTransferAmount-B2rBAbvM.esm.js +222 -0
- package/dist/bitcoinTransferAmount-B2rBAbvM.esm.js.map +1 -0
- package/dist/bitcoinTransferAmount-q7TCsKtK.cjs.js +288 -0
- package/dist/bitcoinTransferAmount-q7TCsKtK.cjs.js.map +1 -0
- package/dist/index.cjs.js +13 -741
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -704
- package/dist/index.esm.js.map +1 -1
- package/dist/injected.cjs.js +4 -3
- package/dist/injected.cjs.js.map +1 -1
- package/dist/injected.esm.js +2 -1
- package/dist/injected.esm.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/utils/bitcoinExecuteSwapTransaction/bitcoinExecuteSwapTransaction.d.ts.map +1 -1
- package/dist/utils/convertPsbtToBase64/convertPsbtToBase64.d.ts +3 -0
- package/dist/utils/convertPsbtToBase64/convertPsbtToBase64.d.ts.map +1 -0
- package/dist/utils/convertPsbtToBase64/index.d.ts +2 -0
- package/dist/utils/convertPsbtToBase64/index.d.ts.map +1 -0
- package/dist/utils/isHexEncodedPsbt/index.d.ts +2 -0
- package/dist/utils/isHexEncodedPsbt/index.d.ts.map +1 -0
- package/dist/utils/isHexEncodedPsbt/isHexEncodedPsbt.d.ts +3 -0
- package/dist/utils/isHexEncodedPsbt/isHexEncodedPsbt.d.ts.map +1 -0
- package/dist/waas.cjs.js +41 -0
- package/dist/waas.cjs.js.map +1 -0
- package/dist/waas.esm.js +40 -0
- package/dist/waas.esm.js.map +1 -0
- package/package.json +4 -4
- package/dist/addBitcoinInjectedWalletsExtension-Blf31mFB.esm.js.map +0 -1
- package/dist/addBitcoinInjectedWalletsExtension-DoK6Bz_8.cjs.js.map +0 -1
|
@@ -1,77 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { c as registerBitcoinNetworkProviderBuilder, i as bitcoinExecuteSwapTransaction, l as getMempoolApiUrl, s as isBitcoinWalletAccount, t as bitcoinTransferAmount } from "./bitcoinTransferAmount-B2rBAbvM.esm.js";
|
|
2
|
+
import { DYNAMIC_ICONIC_SPRITE_URL, WalletProviderPriority, assertDefined, createWalletProviderEventEmitter, formatWalletProviderGroupKey, formatWalletProviderKey, getActiveNetworkIdFromLastKnownRegistry, getBuffer, getCore, getDefaultClient, getInjectedProviderFromWindow, getWalletProviderRegistry, hasExtension, registerExtension } from "@dynamic-labs-sdk/client/core";
|
|
3
|
+
import { BaseError, InvalidParamError, UserRejectedError, assertWalletAccountSigningAvailability, getNetworksData, getWalletAccountAddressByType } from "@dynamic-labs-sdk/client";
|
|
3
4
|
import { WalletProviderEnum } from "@dynamic-labs/sdk-api-core";
|
|
4
5
|
import { Psbt, Transaction, address, networks, payments } from "bitcoinjs-lib";
|
|
5
6
|
import { createUnsecuredToken } from "jsontokens";
|
|
6
7
|
import { AddressPurpose, BitcoinNetworkType, MessageSigningProtocols, RpcErrorCode, addListener, getAddress, request, sendBtcTransaction, signMessage, signMultipleTransactions, signTransaction } from "sats-connect";
|
|
7
8
|
|
|
8
|
-
//#region package.json
|
|
9
|
-
var name = "@dynamic-labs-sdk/bitcoin";
|
|
10
|
-
var version = "0.23.2";
|
|
11
|
-
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/constants.ts
|
|
14
|
-
const MEMPOOL_API_URL = "https://mempool.space/api";
|
|
15
|
-
const MEMPOOL_API_URL_TESTNET = "https://mempool.space/testnet/api";
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
//#region src/utils/getMempoolApiUrl/getMempoolApiUrl.ts
|
|
19
|
-
/** @not-instrumented */
|
|
20
|
-
const getMempoolApiUrl = (address$1) => address$1.startsWith("t") ? MEMPOOL_API_URL_TESTNET : MEMPOOL_API_URL;
|
|
21
|
-
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region src/utils/satoshisToBtc/satoshisToBtc.ts
|
|
24
|
-
/** @not-instrumented */
|
|
25
|
-
const satoshisToBtc = (satoshis) => satoshis / 1e8;
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
//#region src/utils/fetchBtcBalance/fetchBtcBalance.ts
|
|
29
|
-
/** @not-instrumented */
|
|
30
|
-
const fetchBtcBalance = async ({ address: address$1 }) => {
|
|
31
|
-
const API_URL = getMempoolApiUrl(address$1);
|
|
32
|
-
const response = await fetch(`${API_URL}/address/${address$1}`);
|
|
33
|
-
if (!response.ok) return null;
|
|
34
|
-
const addressInfo = await response.json();
|
|
35
|
-
if (!addressInfo?.chain_stats || !addressInfo?.mempool_stats) return null;
|
|
36
|
-
return satoshisToBtc(Number(addressInfo.chain_stats.funded_txo_sum) - Number(addressInfo.chain_stats.spent_txo_sum) + (Number(addressInfo.mempool_stats.funded_txo_sum) - Number(addressInfo.mempool_stats.spent_txo_sum))).toString();
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/utils/createBitcoinNetworkProvider/createBitcoinNetworkProvider.ts
|
|
41
|
-
/** @not-instrumented */
|
|
42
|
-
const createBitcoinNetworkProvider = (networkData) => ({
|
|
43
|
-
...createBaseNetworkProvider("BTC", networkData),
|
|
44
|
-
cluster: networkData.cluster,
|
|
45
|
-
getBalance: async ({ address: address$1 }) => ({ balance: await fetchBtcBalance({ address: address$1 }) })
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
//#endregion
|
|
49
|
-
//#region src/registerBitcoinNetworkProviderBuilder/registerBitcoinNetworkProviderBuilder.ts
|
|
50
|
-
/** @not-instrumented */
|
|
51
|
-
const registerBitcoinNetworkProviderBuilder = (client) => {
|
|
52
|
-
const networkProviderBuilderRegistry = getNetworkProviderBuilderRegistry(client);
|
|
53
|
-
/**
|
|
54
|
-
* If the Bitcoin network provider builder is already registered, return.
|
|
55
|
-
*/
|
|
56
|
-
if (networkProviderBuilderRegistry.get().get("BTC")) return;
|
|
57
|
-
networkProviderBuilderRegistry.register({
|
|
58
|
-
builder: createBitcoinNetworkProvider,
|
|
59
|
-
chain: "BTC"
|
|
60
|
-
});
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
//#endregion
|
|
64
|
-
//#region src/isBitcoinWalletAccount/isBitcoinWalletAccount.ts
|
|
65
|
-
/**
|
|
66
|
-
* Type guard function to check if a wallet account is a Bitcoin wallet account.
|
|
67
|
-
*
|
|
68
|
-
* @param walletAccount - The wallet account to check.
|
|
69
|
-
* @returns True if the wallet account is a Bitcoin wallet account, false otherwise.
|
|
70
|
-
* @not-instrumented
|
|
71
|
-
*/
|
|
72
|
-
const isBitcoinWalletAccount = (walletAccount) => walletAccount.chain === "BTC";
|
|
73
|
-
|
|
74
|
-
//#endregion
|
|
75
9
|
//#region src/utils/bitcoinConfirmTransaction/bitcoinConfirmTransaction.ts
|
|
76
10
|
const POLLING_INTERVAL_MS = 3e3;
|
|
77
11
|
const MAX_POLLING_ATTEMPTS = 300;
|
|
@@ -101,140 +35,6 @@ const bitcoinConfirmTransaction = async ({ transactionHash, walletAccount }, cli
|
|
|
101
35
|
throw new InvalidParamError(`Transaction ${transactionHash} was not confirmed after ${MAX_POLLING_ATTEMPTS} attempts`);
|
|
102
36
|
};
|
|
103
37
|
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/isBitcoinWalletProvider/isBitcoinWalletProvider.ts
|
|
106
|
-
/** @not-instrumented */
|
|
107
|
-
const isBitcoinWalletProvider = (provider) => {
|
|
108
|
-
return provider.chain === "BTC";
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
//#endregion
|
|
112
|
-
//#region src/errors/SendBitcoinRawTransactionError.ts
|
|
113
|
-
var SendBitcoinRawTransactionError = class extends BaseError {
|
|
114
|
-
constructor({ originalError }) {
|
|
115
|
-
const cause = originalError instanceof Error ? originalError : null;
|
|
116
|
-
super({
|
|
117
|
-
cause,
|
|
118
|
-
code: "send_bitcoin_raw_transaction_error",
|
|
119
|
-
docsUrl: null,
|
|
120
|
-
name: "SendBitcoinRawTransactionError",
|
|
121
|
-
shortMessage: "Failed to send Bitcoin raw transaction"
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region src/sendRawTransaction/sendRawTransaction.ts
|
|
128
|
-
/**
|
|
129
|
-
* Sends a raw transaction using the mempool.space API
|
|
130
|
-
* @param params.rawTransaction - The raw transaction to send
|
|
131
|
-
* @param params.walletAccount - The wallet account to send the transaction from
|
|
132
|
-
* @returns An object containing the transaction id
|
|
133
|
-
* @not-instrumented
|
|
134
|
-
*/
|
|
135
|
-
const sendRawTransaction = async ({ rawTransaction, walletAccount }, client = getDefaultClient$1()) => {
|
|
136
|
-
const fetchService = getCore(client).fetch;
|
|
137
|
-
const response = await fetchService(`${getMempoolApiUrl(walletAccount.address)}/tx`, {
|
|
138
|
-
body: rawTransaction,
|
|
139
|
-
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
|
140
|
-
method: "POST"
|
|
141
|
-
});
|
|
142
|
-
if (!response.ok) throw new SendBitcoinRawTransactionError({ originalError: await response.text() });
|
|
143
|
-
return { transactionId: await response.text() };
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
//#endregion
|
|
147
|
-
//#region src/utils/bitcoinExecuteSwapTransaction/bitcoinExecuteSwapTransaction.ts
|
|
148
|
-
/** @not-instrumented */
|
|
149
|
-
const bitcoinExecuteSwapTransaction = async ({ onStepChange, signingPayload, walletAccount }, client) => {
|
|
150
|
-
const provider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
151
|
-
if (!isBitcoinWalletAccount(walletAccount) || !isBitcoinWalletProvider(provider)) throw new InvalidParamError("Wallet account is not a Bitcoin wallet account");
|
|
152
|
-
if (!signingPayload.psbt) throw new InvalidParamError("Signing payload is missing PSBT transaction data");
|
|
153
|
-
onStepChange?.("transaction");
|
|
154
|
-
const { signedPsbt } = await provider.signPsbt({
|
|
155
|
-
request: {
|
|
156
|
-
allowedSighash: [1],
|
|
157
|
-
unsignedPsbtBase64: signingPayload.psbt
|
|
158
|
-
},
|
|
159
|
-
walletAccount
|
|
160
|
-
});
|
|
161
|
-
const psbt = Psbt.fromBase64(signedPsbt);
|
|
162
|
-
psbt.finalizeAllInputs();
|
|
163
|
-
const { transactionId } = await sendRawTransaction({
|
|
164
|
-
rawTransaction: psbt.extractTransaction().toHex(),
|
|
165
|
-
walletAccount
|
|
166
|
-
}, client);
|
|
167
|
-
return { transactionHash: transactionId };
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
//#endregion
|
|
171
|
-
//#region src/errors/NotBitcoinProviderError.ts
|
|
172
|
-
var NotBitcoinProviderError = class extends BaseError {
|
|
173
|
-
providerKey;
|
|
174
|
-
constructor(params) {
|
|
175
|
-
super({
|
|
176
|
-
cause: null,
|
|
177
|
-
code: "not_bitcoin_provider_error",
|
|
178
|
-
docsUrl: null,
|
|
179
|
-
name: "NotBitcoinProviderError",
|
|
180
|
-
shortMessage: "Provider is not a Bitcoin wallet provider"
|
|
181
|
-
});
|
|
182
|
-
this.providerKey = params.providerKey;
|
|
183
|
-
}
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
//#endregion
|
|
187
|
-
//#region src/sendBitcoin/sendBitcoin.ts
|
|
188
|
-
/**
|
|
189
|
-
* Sends a Bitcoin transaction
|
|
190
|
-
* @param params.transaction - The transaction to send
|
|
191
|
-
* @param params.walletAccount - The wallet account to send the transaction from
|
|
192
|
-
* @param [client] - The Dynamic client instance. Only required when using multiple Dynamic clients.
|
|
193
|
-
* @returns An object containing the transaction id
|
|
194
|
-
* @throws {MethodNotImplementedError} If the wallet provider does not implement the sendBitcoin method
|
|
195
|
-
* @throws {NotBitcoinProviderError} If the wallet account is not a valid BitcoinWalletAccount
|
|
196
|
-
* @not-instrumented
|
|
197
|
-
*/
|
|
198
|
-
const sendBitcoin = async ({ walletAccount, transaction }, client = getDefaultClient$1()) => {
|
|
199
|
-
const provider = getWalletProviderFromWalletAccount({ walletAccount }, client);
|
|
200
|
-
if (!isBitcoinWalletProvider(provider)) throw new NotBitcoinProviderError({ providerKey: provider.key });
|
|
201
|
-
if (!provider.sendBitcoin) throw new MethodNotImplementedError("sendBitcoin");
|
|
202
|
-
return provider.sendBitcoin({
|
|
203
|
-
transaction,
|
|
204
|
-
walletAccount
|
|
205
|
-
});
|
|
206
|
-
};
|
|
207
|
-
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/utils/bitcoinTransferAmount/bitcoinTransferAmount.ts
|
|
210
|
-
const BTC_DECIMALS = 8;
|
|
211
|
-
/**
|
|
212
|
-
* Transfers native BTC from one wallet to another.
|
|
213
|
-
*
|
|
214
|
-
* Converts the human-readable BTC amount string to satoshis (8 decimals)
|
|
215
|
-
* and delegates to `sendBitcoin`.
|
|
216
|
-
*
|
|
217
|
-
* @param params.amount - The amount in BTC as a decimal string (e.g. "0.001").
|
|
218
|
-
* @param params.recipient - The recipient Bitcoin address.
|
|
219
|
-
* @param params.walletAccount - The wallet account to send from.
|
|
220
|
-
* @param client - The Dynamic client instance.
|
|
221
|
-
* @returns An object containing the transaction hash.
|
|
222
|
-
* @not-instrumented
|
|
223
|
-
*/
|
|
224
|
-
const bitcoinTransferAmount = async ({ amount, recipient, walletAccount }, client) => {
|
|
225
|
-
if (!isBitcoinWalletAccount(walletAccount)) throw new InvalidParamError("Wallet account is not a Bitcoin wallet account");
|
|
226
|
-
return { transactionHash: (await sendBitcoin({
|
|
227
|
-
transaction: {
|
|
228
|
-
amount: parseAmountToSmallestUnit({
|
|
229
|
-
amount,
|
|
230
|
-
decimals: BTC_DECIMALS
|
|
231
|
-
}),
|
|
232
|
-
recipientAddress: recipient
|
|
233
|
-
},
|
|
234
|
-
walletAccount
|
|
235
|
-
}, client)).transactionId };
|
|
236
|
-
};
|
|
237
|
-
|
|
238
38
|
//#endregion
|
|
239
39
|
//#region src/errors/InvalidPsbtError.ts
|
|
240
40
|
var InvalidPsbtError = class extends BaseError {
|
|
@@ -513,7 +313,7 @@ const createUnisatWalletProvider = ({ dynamicClient, injectedProvider }) => {
|
|
|
513
313
|
const getConnectedAddresses = async () => {
|
|
514
314
|
return { addresses: await injectedProvider.getAccounts() };
|
|
515
315
|
};
|
|
516
|
-
const sendBitcoin
|
|
316
|
+
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
517
317
|
await assertWalletAccountSigningAvailability({ walletAccount }, dynamicClient);
|
|
518
318
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, Number(transaction.amount)) };
|
|
519
319
|
};
|
|
@@ -576,7 +376,7 @@ const createUnisatWalletProvider = ({ dynamicClient, injectedProvider }) => {
|
|
|
576
376
|
groupKey: formatWalletProviderGroupKey(UNISAT_METADATA.displayName),
|
|
577
377
|
key,
|
|
578
378
|
metadata: UNISAT_METADATA,
|
|
579
|
-
sendBitcoin
|
|
379
|
+
sendBitcoin,
|
|
580
380
|
signMessage: signMessage$1,
|
|
581
381
|
signPsbt,
|
|
582
382
|
signPsbts,
|
|
@@ -684,7 +484,7 @@ const createLeatherBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
684
484
|
const getConnectedAddresses = async () => {
|
|
685
485
|
return { addresses: (await connect()).addresses.map((address$1) => address$1.address) };
|
|
686
486
|
};
|
|
687
|
-
const sendBitcoin
|
|
487
|
+
const sendBitcoin = async ({ transaction }) => {
|
|
688
488
|
const { networkName } = await getNetworkPayload();
|
|
689
489
|
return { transactionId: (await injectedProvider.request("sendTransfer", {
|
|
690
490
|
account: 0,
|
|
@@ -746,7 +546,7 @@ const createLeatherBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
746
546
|
groupKey: formatWalletProviderGroupKey(LEATHER_METADATA.displayName),
|
|
747
547
|
key,
|
|
748
548
|
metadata: LEATHER_METADATA,
|
|
749
|
-
sendBitcoin
|
|
549
|
+
sendBitcoin,
|
|
750
550
|
signMessage: signMessage$1,
|
|
751
551
|
signPsbt,
|
|
752
552
|
signPsbts,
|
|
@@ -865,7 +665,7 @@ const createMagicEdenBitcoinWalletProvider = ({ dynamicClient, satsConnectProvid
|
|
|
865
665
|
const { addresses } = await connect();
|
|
866
666
|
return { addresses: addresses.map((address$1) => address$1.address) };
|
|
867
667
|
};
|
|
868
|
-
const sendBitcoin
|
|
668
|
+
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
869
669
|
await assertWalletAccountSigningAvailability({ walletAccount }, dynamicClient);
|
|
870
670
|
const senderAddress = getWalletAccountAddressByType({
|
|
871
671
|
type: "payment",
|
|
@@ -1000,7 +800,7 @@ const createMagicEdenBitcoinWalletProvider = ({ dynamicClient, satsConnectProvid
|
|
|
1000
800
|
groupKey: formatWalletProviderGroupKey(MAGIC_EDEN_METADATA.displayName),
|
|
1001
801
|
key,
|
|
1002
802
|
metadata: MAGIC_EDEN_METADATA,
|
|
1003
|
-
sendBitcoin
|
|
803
|
+
sendBitcoin,
|
|
1004
804
|
signMessage: signMessage$1,
|
|
1005
805
|
signPsbt,
|
|
1006
806
|
signPsbts,
|
|
@@ -1046,7 +846,7 @@ const createOkxBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
1046
846
|
const getConnectedAddresses = async () => {
|
|
1047
847
|
return { addresses: await injectedProvider.getAccounts() };
|
|
1048
848
|
};
|
|
1049
|
-
const sendBitcoin
|
|
849
|
+
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
1050
850
|
await assertWalletAccountSigningAvailability({ walletAccount }, dynamicClient);
|
|
1051
851
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString()) };
|
|
1052
852
|
};
|
|
@@ -1105,7 +905,7 @@ const createOkxBitcoinWalletProvider = ({ dynamicClient, injectedProvider }) =>
|
|
|
1105
905
|
groupKey: formatWalletProviderGroupKey(OKX_METADATA.displayName),
|
|
1106
906
|
key,
|
|
1107
907
|
metadata: OKX_METADATA,
|
|
1108
|
-
sendBitcoin
|
|
908
|
+
sendBitcoin,
|
|
1109
909
|
signMessage: signMessage$1,
|
|
1110
910
|
signPsbt,
|
|
1111
911
|
signPsbts,
|
|
@@ -1150,7 +950,7 @@ const createOneKeyBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
1150
950
|
const getConnectedAddresses = async () => {
|
|
1151
951
|
return { addresses: await injectedProvider.getAccounts() };
|
|
1152
952
|
};
|
|
1153
|
-
const sendBitcoin
|
|
953
|
+
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
1154
954
|
await assertWalletAccountSigningAvailability({ walletAccount }, dynamicClient);
|
|
1155
955
|
return { transactionId: await injectedProvider.sendBitcoin(transaction.recipientAddress, transaction.amount.toString()) };
|
|
1156
956
|
};
|
|
@@ -1204,7 +1004,7 @@ const createOneKeyBitcoinWalletProvider = ({ dynamicClient, injectedProvider })
|
|
|
1204
1004
|
groupKey: formatWalletProviderGroupKey(ONEKEY_METADATA.displayName),
|
|
1205
1005
|
key,
|
|
1206
1006
|
metadata: ONEKEY_METADATA,
|
|
1207
|
-
sendBitcoin
|
|
1007
|
+
sendBitcoin,
|
|
1208
1008
|
signMessage: signMessage$1,
|
|
1209
1009
|
signPsbt,
|
|
1210
1010
|
signPsbts,
|
|
@@ -1509,7 +1309,7 @@ const createXverseBitcoinWalletProvider = ({ dynamicClient, satsConnectProvider
|
|
|
1509
1309
|
if (response.error.code !== RpcErrorCode.ACCESS_DENIED) throw response.error;
|
|
1510
1310
|
return { addresses: [] };
|
|
1511
1311
|
};
|
|
1512
|
-
const sendBitcoin
|
|
1312
|
+
const sendBitcoin = async ({ transaction, walletAccount }) => {
|
|
1513
1313
|
await assertWalletAccountSigningAvailability({ walletAccount }, dynamicClient);
|
|
1514
1314
|
const response = await request("sendTransfer", { recipients: [{
|
|
1515
1315
|
address: transaction.recipientAddress,
|
|
@@ -1613,7 +1413,7 @@ const createXverseBitcoinWalletProvider = ({ dynamicClient, satsConnectProvider
|
|
|
1613
1413
|
groupKey: formatWalletProviderGroupKey(XVERSE_METADATA.displayName),
|
|
1614
1414
|
key,
|
|
1615
1415
|
metadata: XVERSE_METADATA,
|
|
1616
|
-
sendBitcoin
|
|
1416
|
+
sendBitcoin,
|
|
1617
1417
|
signMessage: signMessage$1,
|
|
1618
1418
|
signPsbt,
|
|
1619
1419
|
signPsbts,
|
|
@@ -1737,5 +1537,5 @@ const addBitcoinInjectedWalletsExtension = (client = getDefaultClient()) => {
|
|
|
1737
1537
|
};
|
|
1738
1538
|
|
|
1739
1539
|
//#endregion
|
|
1740
|
-
export {
|
|
1741
|
-
//# sourceMappingURL=addBitcoinInjectedWalletsExtension-
|
|
1540
|
+
export { InvalidPsbtError as n, addBitcoinInjectedWalletsExtension as t };
|
|
1541
|
+
//# sourceMappingURL=addBitcoinInjectedWalletsExtension-BIxPSyXV.esm.js.map
|