btc-wallet 0.5.13-beta → 0.5.14-beta
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +1 -11
- package/dist/index.js.map +2 -2
- package/esm/index.js +1 -11
- package/esm/index.js.map +2 -2
- package/package.json +1 -1
package/esm/index.js
CHANGED
@@ -4357,11 +4357,6 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4357
4357
|
tokenId: currentConfig.nearToken,
|
4358
4358
|
env
|
4359
4359
|
});
|
4360
|
-
const { balance: btcBalance } = yield getTokenBalance({
|
4361
|
-
csna: accountId,
|
4362
|
-
tokenId: currentConfig.btcToken,
|
4363
|
-
env
|
4364
|
-
});
|
4365
4360
|
const transferAmount = transactions2.reduce(
|
4366
4361
|
(acc, tx) => {
|
4367
4362
|
tx.actions.forEach((action) => {
|
@@ -4381,12 +4376,7 @@ var BTCWallet = (_0) => __async(void 0, [_0], function* ({
|
|
4381
4376
|
{ near: new Big2(0), btc: new Big2(0) }
|
4382
4377
|
);
|
4383
4378
|
const nearAvailableBalance = new Big2(nearBalance).minus(transferAmount.near).toNumber();
|
4384
|
-
const btcAvailableBalance = new Big2(btcBalance).minus(transferAmount.btc).toNumber();
|
4385
|
-
if (btcAvailableBalance < 8e-6) {
|
4386
|
-
throw new Error("BTC balance is not enough, please deposit more BTC.");
|
4387
|
-
}
|
4388
4379
|
console.log("available near balance:", nearAvailableBalance);
|
4389
|
-
console.log("available btc balance:", btcAvailableBalance);
|
4390
4380
|
console.log("available gas token balance:", gasTokenBalance);
|
4391
4381
|
const convertTx = yield Promise.all(
|
4392
4382
|
transactions2.map((transaction, index) => convertTransactionToTxHex(transaction, index))
|
@@ -4534,7 +4524,7 @@ function setupBTCWallet({
|
|
4534
4524
|
|
4535
4525
|
// src/index.ts
|
4536
4526
|
var getVersion = () => {
|
4537
|
-
return "0.5.
|
4527
|
+
return "0.5.14-beta";
|
4538
4528
|
};
|
4539
4529
|
if (typeof window !== "undefined") {
|
4540
4530
|
window.__BTC_WALLET_VERSION = getVersion();
|