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/esm/index.js CHANGED
@@ -2773,7 +2773,7 @@ function useBtcWalletSelector() {
2773
2773
  return account;
2774
2774
  }),
2775
2775
  autoConnect: () => __async(this, null, function* () {
2776
- requestDirectAccount(connectorRef.current).catch((e) => {
2776
+ return requestDirectAccount(connectorRef.current).catch((e) => {
2777
2777
  console.error("btcLoginError", e);
2778
2778
  context.emit("btcLoginError");
2779
2779
  });
@@ -4129,7 +4129,14 @@ function getWithdrawTransaction(_0) {
4129
4129
  env = "mainnet"
4130
4130
  }) {
4131
4131
  const config = getWalletConfig(env);
4132
- const _btcAddress = btcAddress || getBtcProvider().account;
4132
+ let _btcAddress = btcAddress || getBtcProvider().account;
4133
+ if (!_btcAddress) {
4134
+ yield getBtcProvider().autoConnect();
4135
+ _btcAddress = getBtcProvider().account;
4136
+ if (!_btcAddress) {
4137
+ throw new Error("BTC Account is not available.");
4138
+ }
4139
+ }
4133
4140
  const _csna = csna || (yield getCsnaAccountId(env));
4134
4141
  const { inputs, outputs, isError, errorMsg, fromAmount, gasFee } = yield calculateWithdraw({
4135
4142
  amount,
@@ -4852,7 +4859,7 @@ function getGroup(state) {
4852
4859
 
4853
4860
  // src/index.ts
4854
4861
  var getVersion = () => {
4855
- return "0.5.32-beta";
4862
+ return "0.5.33-beta";
4856
4863
  };
4857
4864
  if (typeof window !== "undefined") {
4858
4865
  window.__BTC_WALLET_VERSION = getVersion();