btc-wallet 0.5.32-beta → 0.5.34-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 +12 -4
- package/dist/index.js.map +2 -2
- package/esm/index.js +12 -4
- 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,
|
@@ -4783,7 +4790,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4783
4790
|
gas_token: currentConfig.btcToken,
|
4784
4791
|
gas_limit: gasLimit,
|
4785
4792
|
use_near_pay_gas: useNearPayGas,
|
4786
|
-
nonce
|
4793
|
+
nonce,
|
4794
|
+
replace: true
|
4787
4795
|
};
|
4788
4796
|
const strIntention = JSON.stringify(intention);
|
4789
4797
|
const signature = yield btcContext.signMessage(strIntention);
|
@@ -4919,7 +4927,7 @@ function getGroup(state) {
|
|
4919
4927
|
|
4920
4928
|
// src/index.ts
|
4921
4929
|
var getVersion = () => {
|
4922
|
-
return "0.5.
|
4930
|
+
return "0.5.34-beta";
|
4923
4931
|
};
|
4924
4932
|
if (typeof window !== "undefined") {
|
4925
4933
|
window.__BTC_WALLET_VERSION = getVersion();
|