btc-wallet 0.5.7-beta → 0.5.9-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
@@ -3363,7 +3363,7 @@ function checkDepositDisabledAddress() {
3363
3363
  return;
3364
3364
  const addresses = JSON.parse(data);
3365
3365
  const address = addresses == null ? void 0 : addresses[0];
3366
- if (address.walletType === "ledger" && (address.addressType !== "p2wpkh" || address.addressType !== "p2sh")) {
3366
+ if (address.walletType === "ledger" && !["p2wpkh", "p2sh"].includes(address.addressType)) {
3367
3367
  throw new Error("Ledger is only supported for p2wpkh and p2sh address");
3368
3368
  }
3369
3369
  }
@@ -4171,7 +4171,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4171
4171
  const accountInfo = yield getAccountInfo(accountId, currentConfig.accountContractId);
4172
4172
  yield checkGasTokenDebt(accountInfo, env, true);
4173
4173
  const trans = [...params.transactions];
4174
- console.log("raw trans:", trans);
4174
+ console.log("signAndSendTransactions raw trans:", trans);
4175
4175
  const gasTokenBalance = (accountInfo == null ? void 0 : accountInfo.gas_token[currentConfig.token]) || "0";
4176
4176
  const { transferGasTransaction, useNearPayGas, gasLimit } = yield calculateGasStrategy(
4177
4177
  gasTokenBalance,
@@ -4380,11 +4380,14 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
4380
4380
  newActions,
4381
4381
  baseDecode(header.hash)
4382
4382
  );
4383
+ console.log("convertTransactionToTxHex transaction:", _transaction);
4383
4384
  const txBytes = encodeTransaction(_transaction);
4384
4385
  const txHex = Array.from(txBytes, (byte) => ("0" + (byte & 255).toString(16)).slice(-2)).join(
4385
4386
  ""
4386
4387
  );
4388
+ console.log("convertTransactionToTxHex txHex:", txHex);
4387
4389
  const hash = bs58.encode(new Uint8Array(sha256.array(txBytes)));
4390
+ console.log("convertTransactionToTxHex hash:", hash);
4388
4391
  return { txBytes, txHex, hash };
4389
4392
  });
4390
4393
  }
@@ -4436,7 +4439,7 @@ function setupBTCWallet({
4436
4439
 
4437
4440
  // src/index.ts
4438
4441
  var getVersion = () => {
4439
- return "0.5.7-beta";
4442
+ return "0.5.9-beta";
4440
4443
  };
4441
4444
  if (typeof window !== "undefined") {
4442
4445
  window.__BTC_WALLET_VERSION = getVersion();