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/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,
@@ -4714,7 +4721,8 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4714
4721
  gas_token: currentConfig.btcToken,
4715
4722
  gas_limit: gasLimit,
4716
4723
  use_near_pay_gas: useNearPayGas,
4717
- nonce
4724
+ nonce,
4725
+ replace: true
4718
4726
  };
4719
4727
  const strIntention = JSON.stringify(intention);
4720
4728
  const signature = yield btcContext.signMessage(strIntention);
@@ -4852,7 +4860,7 @@ function getGroup(state) {
4852
4860
 
4853
4861
  // src/index.ts
4854
4862
  var getVersion = () => {
4855
- return "0.5.32-beta";
4863
+ return "0.5.34-beta";
4856
4864
  };
4857
4865
  if (typeof window !== "undefined") {
4858
4866
  window.__BTC_WALLET_VERSION = getVersion();