btc-wallet 0.5.32-beta → 0.5.33-beta
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/core/btcWalletSelectorContext.d.ts +1 -1
- package/dist/index.js +10 -3
- package/dist/index.js.map +2 -2
- package/esm/index.js +10 -3
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
@@ -5,7 +5,7 @@ export declare function BtcWalletSelectorContextProvider({ children, }: {
|
|
5
5
|
}): import("react/jsx-runtime").JSX.Element;
|
6
6
|
export declare function useBtcWalletSelector(): {
|
7
7
|
login: () => Promise<string | null>;
|
8
|
-
autoConnect: () => Promise<
|
8
|
+
autoConnect: () => Promise<any>;
|
9
9
|
logout: () => void;
|
10
10
|
account: string;
|
11
11
|
getPublicKey: () => Promise<string | undefined>;
|
package/dist/index.js
CHANGED
@@ -2842,7 +2842,7 @@ function useBtcWalletSelector() {
|
|
2842
2842
|
return account;
|
2843
2843
|
}),
|
2844
2844
|
autoConnect: () => __async(this, null, function* () {
|
2845
|
-
requestDirectAccount(connectorRef.current).catch((e) => {
|
2845
|
+
return requestDirectAccount(connectorRef.current).catch((e) => {
|
2846
2846
|
console.error("btcLoginError", e);
|
2847
2847
|
context.emit("btcLoginError");
|
2848
2848
|
});
|
@@ -4198,7 +4198,14 @@ function getWithdrawTransaction(_0) {
|
|
4198
4198
|
env = "mainnet"
|
4199
4199
|
}) {
|
4200
4200
|
const config = getWalletConfig(env);
|
4201
|
-
|
4201
|
+
let _btcAddress = btcAddress || getBtcProvider().account;
|
4202
|
+
if (!_btcAddress) {
|
4203
|
+
yield getBtcProvider().autoConnect();
|
4204
|
+
_btcAddress = getBtcProvider().account;
|
4205
|
+
if (!_btcAddress) {
|
4206
|
+
throw new Error("BTC Account is not available.");
|
4207
|
+
}
|
4208
|
+
}
|
4202
4209
|
const _csna = csna || (yield getCsnaAccountId(env));
|
4203
4210
|
const { inputs, outputs, isError, errorMsg, fromAmount, gasFee } = yield calculateWithdraw({
|
4204
4211
|
amount,
|
@@ -4919,7 +4926,7 @@ function getGroup(state) {
|
|
4919
4926
|
|
4920
4927
|
// src/index.ts
|
4921
4928
|
var getVersion = () => {
|
4922
|
-
return "0.5.
|
4929
|
+
return "0.5.33-beta";
|
4923
4930
|
};
|
4924
4931
|
if (typeof window !== "undefined") {
|
4925
4932
|
window.__BTC_WALLET_VERSION = getVersion();
|