@ledgerhq/live-cli 24.22.1-nightly.5 → 24.22.1-nightly.6
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/lib/cli.js +332 -331
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -40518,7 +40518,7 @@ var require_base322 = __commonJS({
|
|
|
40518
40518
|
var require_stringify = __commonJS({
|
|
40519
40519
|
"../../node_modules/.pnpm/json-bigint@1.0.0/node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
40520
40520
|
"use strict";
|
|
40521
|
-
var
|
|
40521
|
+
var BigNumber429 = require("bignumber.js");
|
|
40522
40522
|
var JSON2 = module2.exports;
|
|
40523
40523
|
(function() {
|
|
40524
40524
|
"use strict";
|
|
@@ -40543,7 +40543,7 @@ var require_stringify = __commonJS({
|
|
|
40543
40543
|
}) + '"' : '"' + string5 + '"';
|
|
40544
40544
|
}
|
|
40545
40545
|
function str(key2, holder) {
|
|
40546
|
-
var i55, k17, v34, length2, mind = gap, partial2, value5 = holder[key2], isBigNumber2 = value5 != null && (value5 instanceof
|
|
40546
|
+
var i55, k17, v34, length2, mind = gap, partial2, value5 = holder[key2], isBigNumber2 = value5 != null && (value5 instanceof BigNumber429 || BigNumber429.isBigNumber(value5));
|
|
40547
40547
|
if (value5 && typeof value5 === "object" && typeof value5.toJSON === "function") {
|
|
40548
40548
|
value5 = value5.toJSON(key2);
|
|
40549
40549
|
}
|
|
@@ -40629,7 +40629,7 @@ var require_stringify = __commonJS({
|
|
|
40629
40629
|
var require_parse2 = __commonJS({
|
|
40630
40630
|
"../../node_modules/.pnpm/json-bigint@1.0.0/node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
40631
40631
|
"use strict";
|
|
40632
|
-
var
|
|
40632
|
+
var BigNumber429 = null;
|
|
40633
40633
|
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
40634
40634
|
var suspectConstructorRx = /(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)/;
|
|
40635
40635
|
var json_parse = function(options24) {
|
|
@@ -40729,12 +40729,12 @@ var require_parse2 = __commonJS({
|
|
|
40729
40729
|
if (!isFinite(number8)) {
|
|
40730
40730
|
error("Bad number");
|
|
40731
40731
|
} else {
|
|
40732
|
-
if (
|
|
40733
|
-
|
|
40732
|
+
if (BigNumber429 == null)
|
|
40733
|
+
BigNumber429 = require("bignumber.js");
|
|
40734
40734
|
if (string6.length > 15)
|
|
40735
|
-
return _options2.storeAsString ? string6 : _options2.useNativeBigInt ? BigInt(string6) : new
|
|
40735
|
+
return _options2.storeAsString ? string6 : _options2.useNativeBigInt ? BigInt(string6) : new BigNumber429(string6);
|
|
40736
40736
|
else
|
|
40737
|
-
return !_options2.alwaysParseAsBig ? number8 : _options2.useNativeBigInt ? BigInt(number8) : new
|
|
40737
|
+
return !_options2.alwaysParseAsBig ? number8 : _options2.useNativeBigInt ? BigInt(number8) : new BigNumber429(number8);
|
|
40738
40738
|
}
|
|
40739
40739
|
}, string5 = function() {
|
|
40740
40740
|
var hex6, i55, string6 = "", uffff;
|
|
@@ -151272,7 +151272,7 @@ var require_lib13 = __commonJS({
|
|
|
151272
151272
|
"../../node_modules/.pnpm/web3-eth-iban@1.10.4/node_modules/web3-eth-iban/lib/index.js"(exports2, module2) {
|
|
151273
151273
|
"use strict";
|
|
151274
151274
|
var utils6 = require_lib11();
|
|
151275
|
-
var
|
|
151275
|
+
var BigNumber429 = require_bn2();
|
|
151276
151276
|
var leftPad = function(string5, bytes5) {
|
|
151277
151277
|
let result2 = string5;
|
|
151278
151278
|
while (result2.length < bytes5 * 2) {
|
|
@@ -151343,7 +151343,7 @@ var require_lib13 = __commonJS({
|
|
|
151343
151343
|
throw new Error("Provided address is not a valid address: " + address3);
|
|
151344
151344
|
}
|
|
151345
151345
|
address3 = address3.replace("0x", "").replace("0X", "");
|
|
151346
|
-
const asBn = new
|
|
151346
|
+
const asBn = new BigNumber429(address3, 16);
|
|
151347
151347
|
const base36 = asBn.toString(36);
|
|
151348
151348
|
const padded = leftPad(base36, 15);
|
|
151349
151349
|
return _Iban.fromBban(padded.toUpperCase());
|
|
@@ -151450,7 +151450,7 @@ var require_lib13 = __commonJS({
|
|
|
151450
151450
|
toAddress() {
|
|
151451
151451
|
if (this.isDirect()) {
|
|
151452
151452
|
const base36 = this._iban.slice(4);
|
|
151453
|
-
const asBn = new
|
|
151453
|
+
const asBn = new BigNumber429(base36, 36);
|
|
151454
151454
|
return utils6.toChecksumAddress(asBn.toString(16, 20));
|
|
151455
151455
|
}
|
|
151456
151456
|
return "";
|
|
@@ -467014,9 +467014,9 @@ var require_bignumber = __commonJS({
|
|
|
467014
467014
|
function _interopRequireDefault(e36) {
|
|
467015
467015
|
return e36 && e36.__esModule ? e36 : { "default": e36 };
|
|
467016
467016
|
}
|
|
467017
|
-
var
|
|
467018
|
-
|
|
467019
|
-
var _default = exports2["default"] =
|
|
467017
|
+
var BigNumber429 = _bignumber["default"].clone();
|
|
467018
|
+
BigNumber429.DEBUG = true;
|
|
467019
|
+
var _default = exports2["default"] = BigNumber429;
|
|
467020
467020
|
}
|
|
467021
467021
|
});
|
|
467022
467022
|
|
|
@@ -515330,7 +515330,7 @@ var require_package7 = __commonJS({
|
|
|
515330
515330
|
module2.exports = {
|
|
515331
515331
|
name: "@ledgerhq/live-common",
|
|
515332
515332
|
description: "Common ground for the Ledger Live apps",
|
|
515333
|
-
version: "34.48.0-nightly.
|
|
515333
|
+
version: "34.48.0-nightly.6",
|
|
515334
515334
|
repository: {
|
|
515335
515335
|
type: "git",
|
|
515336
515336
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -515666,7 +515666,7 @@ var require_package8 = __commonJS({
|
|
|
515666
515666
|
"package.json"(exports2, module2) {
|
|
515667
515667
|
module2.exports = {
|
|
515668
515668
|
name: "@ledgerhq/live-cli",
|
|
515669
|
-
version: "24.22.1-nightly.
|
|
515669
|
+
version: "24.22.1-nightly.6",
|
|
515670
515670
|
description: "ledger-live CLI version",
|
|
515671
515671
|
repository: {
|
|
515672
515672
|
type: "git",
|
|
@@ -539430,7 +539430,7 @@ var getDefaultAccountName = (account3) => {
|
|
|
539430
539430
|
};
|
|
539431
539431
|
|
|
539432
539432
|
// ../../libs/ledger-live-common/lib-es/account/formatters.js
|
|
539433
|
-
var
|
|
539433
|
+
var import_bignumber371 = require("bignumber.js");
|
|
539434
539434
|
var import_invariant70 = __toESM(require("invariant"));
|
|
539435
539435
|
|
|
539436
539436
|
// ../../libs/ledger-live-common/lib-es/account/serialization.js
|
|
@@ -846397,7 +846397,7 @@ var dispatch3 = (transport, opts) => {
|
|
|
846397
846397
|
var getAddress_default15 = dispatch3;
|
|
846398
846398
|
|
|
846399
846399
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getAccountShape.js
|
|
846400
|
-
var
|
|
846400
|
+
var import_bignumber365 = __toESM(require("bignumber.js"));
|
|
846401
846401
|
|
|
846402
846402
|
// ../../libs/coin-modules/coin-xrp/lib-es/api/index.js
|
|
846403
846403
|
init_lib_es2();
|
|
@@ -846642,13 +846642,14 @@ async function estimateFees7(networkInfo) {
|
|
|
846642
846642
|
}
|
|
846643
846643
|
|
|
846644
846644
|
// ../../libs/coin-modules/coin-xrp/lib-es/logic/getBalance.js
|
|
846645
|
+
var import_bignumber357 = __toESM(require("bignumber.js"));
|
|
846645
846646
|
async function getBalance9(address3) {
|
|
846646
846647
|
const accountInfo = await getAccountInfo(address3);
|
|
846647
846648
|
const serverInfo = await getServerInfos();
|
|
846648
846649
|
const reserveMinXRP = parseAPIValue2(serverInfo.info.validated_ledger.reserve_base_xrp.toString());
|
|
846649
846650
|
const reservePerTrustline = parseAPIValue2(serverInfo.info.validated_ledger.reserve_inc_xrp.toString());
|
|
846650
846651
|
const trustlines = accountInfo.ownerCount;
|
|
846651
|
-
const locked19 = reserveMinXRP.plus(reservePerTrustline.times(trustlines));
|
|
846652
|
+
const locked19 = accountInfo.balance === "0" ? new import_bignumber357.default(0) : reserveMinXRP.plus(reservePerTrustline.times(trustlines));
|
|
846652
846653
|
return [
|
|
846653
846654
|
{
|
|
846654
846655
|
value: BigInt(accountInfo.balance),
|
|
@@ -846931,7 +846932,7 @@ var config_default11 = coinConfig18;
|
|
|
846931
846932
|
init_lib_es();
|
|
846932
846933
|
init_lib_es2();
|
|
846933
846934
|
var import_stellar_sdk2 = __toESM(require_lib63());
|
|
846934
|
-
var
|
|
846935
|
+
var import_bignumber359 = require("bignumber.js");
|
|
846935
846936
|
|
|
846936
846937
|
// ../../libs/coin-modules/coin-stellar/lib-es/types/bridge.js
|
|
846937
846938
|
var NetworkCongestionLevel;
|
|
@@ -846942,7 +846943,7 @@ var NetworkCongestionLevel;
|
|
|
846942
846943
|
})(NetworkCongestionLevel || (NetworkCongestionLevel = {}));
|
|
846943
846944
|
|
|
846944
846945
|
// ../../libs/coin-modules/coin-stellar/lib-es/network/serialization.js
|
|
846945
|
-
var
|
|
846946
|
+
var import_bignumber358 = __toESM(require("bignumber.js"));
|
|
846946
846947
|
var currency2 = getCryptoCurrencyById("stellar");
|
|
846947
846948
|
var BASE_RESERVE_MIN_COUNT = 2;
|
|
846948
846949
|
var BASE_RESERVE = 0.5;
|
|
@@ -846951,9 +846952,9 @@ function getReservedBalance(account3) {
|
|
|
846951
846952
|
const numOfSponsoringEntries = Number(account3.num_sponsoring);
|
|
846952
846953
|
const numOfSponsoredEntries = Number(account3.num_sponsored);
|
|
846953
846954
|
const nativeAsset = account3.balances?.find((b20) => b20.asset_type === "native");
|
|
846954
|
-
const amountInOffers = new
|
|
846955
|
-
const numOfEntries = new
|
|
846956
|
-
return new
|
|
846955
|
+
const amountInOffers = new import_bignumber358.default(nativeAsset?.selling_liabilities || 0);
|
|
846956
|
+
const numOfEntries = new import_bignumber358.default(account3.subentry_count || 0);
|
|
846957
|
+
return new import_bignumber358.default(BASE_RESERVE_MIN_COUNT).plus(numOfEntries).plus(numOfSponsoringEntries).minus(numOfSponsoredEntries).times(BASE_RESERVE).plus(amountInOffers);
|
|
846957
846958
|
}
|
|
846958
846959
|
async function rawOperationsToOperations(operations3, addr, accountId2, minHeight) {
|
|
846959
846960
|
const supportedOperationTypes = [
|
|
@@ -847011,8 +847012,8 @@ async function formatOperation(rawOperation, accountId2, addr, minHeight) {
|
|
|
847011
847012
|
const operation = {
|
|
847012
847013
|
id: encodeOperationId(accountId2, rawOperation.transaction_hash, type4),
|
|
847013
847014
|
accountId: accountId2,
|
|
847014
|
-
fee: new
|
|
847015
|
-
value: rawOperation?.asset_code ? new
|
|
847015
|
+
fee: new import_bignumber358.default(transaction.fee_charged),
|
|
847016
|
+
value: rawOperation?.asset_code ? new import_bignumber358.default(transaction.fee_charged) : value5,
|
|
847016
847017
|
// TODO: doc
|
|
847017
847018
|
// Using type NONE to hide asset operations from the main account (show them
|
|
847018
847019
|
// only on sub-account)
|
|
@@ -847059,9 +847060,9 @@ function getRecipients(operation) {
|
|
|
847059
847060
|
}
|
|
847060
847061
|
}
|
|
847061
847062
|
function getValue10(operation, transaction, type4) {
|
|
847062
|
-
let value5 = new
|
|
847063
|
+
let value5 = new import_bignumber358.default(0);
|
|
847063
847064
|
if (!operation.transaction_successful) {
|
|
847064
|
-
return type4 === "IN" ? value5 : new
|
|
847065
|
+
return type4 === "IN" ? value5 : new import_bignumber358.default(transaction.fee_charged || 0);
|
|
847065
847066
|
}
|
|
847066
847067
|
switch (operation.type) {
|
|
847067
847068
|
case "create_account":
|
|
@@ -847075,7 +847076,7 @@ function getValue10(operation, transaction, type4) {
|
|
|
847075
847076
|
case "path_payment_strict_receive":
|
|
847076
847077
|
return parseCurrencyUnit(currency2.units[0], operation.amount);
|
|
847077
847078
|
default:
|
|
847078
|
-
return type4 !== "IN" ? new
|
|
847079
|
+
return type4 !== "IN" ? new import_bignumber358.default(transaction.fee_charged) : value5;
|
|
847079
847080
|
}
|
|
847080
847081
|
}
|
|
847081
847082
|
function getOperationType10(operation, addr) {
|
|
@@ -847094,7 +847095,7 @@ function getOperationType10(operation, addr) {
|
|
|
847094
847095
|
case "path_payment_strict_receive":
|
|
847095
847096
|
return "IN";
|
|
847096
847097
|
case "change_trust":
|
|
847097
|
-
if (new
|
|
847098
|
+
if (new import_bignumber358.default(operation.limit).eq(0)) {
|
|
847098
847099
|
return "OPT_OUT";
|
|
847099
847100
|
}
|
|
847100
847101
|
return "OPT_IN";
|
|
@@ -847174,7 +847175,7 @@ var getMinimumBalance2 = (account3) => {
|
|
|
847174
847175
|
async function getAccountSpendableBalance2(balance, account3) {
|
|
847175
847176
|
const minimumBalance = getMinimumBalance2(account3);
|
|
847176
847177
|
const { recommendedFee } = await fetchBaseFee();
|
|
847177
|
-
return
|
|
847178
|
+
return import_bignumber359.BigNumber.max(balance.minus(minimumBalance).minus(recommendedFee), 0);
|
|
847178
847179
|
}
|
|
847179
847180
|
import_stellar_sdk2.Horizon.AxiosClient.interceptors.response.use((response) => {
|
|
847180
847181
|
if (config_default11.getCoinConfig().enableNetworkLogs) {
|
|
@@ -847200,16 +847201,16 @@ async function fetchBaseFee() {
|
|
|
847200
847201
|
networkCongestionLevel: NetworkCongestionLevel.LOW
|
|
847201
847202
|
};
|
|
847202
847203
|
}
|
|
847203
|
-
const baseFee = new
|
|
847204
|
+
const baseFee = new import_bignumber359.BigNumber(import_stellar_sdk2.BASE_FEE).toNumber() || FALLBACK_BASE_FEE;
|
|
847204
847205
|
let recommendedFee = baseFee;
|
|
847205
847206
|
let networkCongestionLevel = NetworkCongestionLevel.MEDIUM;
|
|
847206
847207
|
try {
|
|
847207
847208
|
const feeStats = await getServer().feeStats();
|
|
847208
847209
|
const ledgerCapacityUsage = feeStats.ledger_capacity_usage;
|
|
847209
|
-
recommendedFee = new
|
|
847210
|
-
if (new
|
|
847210
|
+
recommendedFee = new import_bignumber359.BigNumber(feeStats.fee_charged.mode).toNumber();
|
|
847211
|
+
if (new import_bignumber359.BigNumber(ledgerCapacityUsage).toNumber() > TRESHOLD_LOW && new import_bignumber359.BigNumber(ledgerCapacityUsage).toNumber() <= TRESHOLD_MEDIUM) {
|
|
847211
847212
|
networkCongestionLevel = NetworkCongestionLevel.MEDIUM;
|
|
847212
|
-
} else if (new
|
|
847213
|
+
} else if (new import_bignumber359.BigNumber(ledgerCapacityUsage).toNumber() > TRESHOLD_MEDIUM) {
|
|
847213
847214
|
networkCongestionLevel = NetworkCongestionLevel.HIGH;
|
|
847214
847215
|
} else {
|
|
847215
847216
|
networkCongestionLevel = NetworkCongestionLevel.LOW;
|
|
@@ -847240,7 +847241,7 @@ async function fetchAccount(addr) {
|
|
|
847240
847241
|
const formattedBalance = parseCurrencyUnit(currency3.units[0], balance);
|
|
847241
847242
|
const spendableBalance = await getAccountSpendableBalance2(formattedBalance, account3);
|
|
847242
847243
|
return {
|
|
847243
|
-
blockHeight: account3.sequence ? new
|
|
847244
|
+
blockHeight: account3.sequence ? new import_bignumber359.BigNumber(account3.sequence).toNumber() : 0,
|
|
847244
847245
|
balance: formattedBalance,
|
|
847245
847246
|
spendableBalance,
|
|
847246
847247
|
assets
|
|
@@ -847288,23 +847289,23 @@ async function fetchAccountNetworkInfo(account3) {
|
|
|
847288
847289
|
const { recommendedFee, networkCongestionLevel, baseFee } = await fetchBaseFee();
|
|
847289
847290
|
return {
|
|
847290
847291
|
family: "stellar",
|
|
847291
|
-
fees: new
|
|
847292
|
-
baseFee: new
|
|
847292
|
+
fees: new import_bignumber359.BigNumber(recommendedFee.toString()),
|
|
847293
|
+
baseFee: new import_bignumber359.BigNumber(baseFee.toString()),
|
|
847293
847294
|
baseReserve,
|
|
847294
847295
|
networkCongestionLevel
|
|
847295
847296
|
};
|
|
847296
847297
|
} catch (error) {
|
|
847297
847298
|
return {
|
|
847298
847299
|
family: "stellar",
|
|
847299
|
-
fees: new
|
|
847300
|
-
baseFee: new
|
|
847301
|
-
baseReserve: new
|
|
847300
|
+
fees: new import_bignumber359.BigNumber(0),
|
|
847301
|
+
baseFee: new import_bignumber359.BigNumber(100),
|
|
847302
|
+
baseReserve: new import_bignumber359.BigNumber(0)
|
|
847302
847303
|
};
|
|
847303
847304
|
}
|
|
847304
847305
|
}
|
|
847305
847306
|
async function fetchSequence(address3) {
|
|
847306
847307
|
const extendedAccount = await loadAccount(address3);
|
|
847307
|
-
return extendedAccount ? new
|
|
847308
|
+
return extendedAccount ? new import_bignumber359.BigNumber(extendedAccount.sequence) : new import_bignumber359.BigNumber(0);
|
|
847308
847309
|
}
|
|
847309
847310
|
async function fetchSigners(account3) {
|
|
847310
847311
|
try {
|
|
@@ -847504,7 +847505,7 @@ async function estimateFees8() {
|
|
|
847504
847505
|
}
|
|
847505
847506
|
|
|
847506
847507
|
// ../../libs/coin-modules/coin-stellar/lib-es/logic/utils.js
|
|
847507
|
-
var
|
|
847508
|
+
var import_bignumber360 = require("bignumber.js");
|
|
847508
847509
|
var import_stellar_sdk6 = __toESM(require_lib63());
|
|
847509
847510
|
var STELLAR_BURN_ADDRESS = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
|
|
847510
847511
|
var getAssetIdFromAsset = (asset) => `${asset.asset_code}:${asset.asset_issuer}`;
|
|
@@ -847523,7 +847524,7 @@ function isMemoValid2(memoType, memoValue) {
|
|
|
847523
847524
|
}
|
|
847524
847525
|
break;
|
|
847525
847526
|
case "MEMO_ID":
|
|
847526
|
-
if (new
|
|
847527
|
+
if (new import_bignumber360.BigNumber(memoValue.toString()).isNaN()) {
|
|
847527
847528
|
return false;
|
|
847528
847529
|
}
|
|
847529
847530
|
break;
|
|
@@ -847553,7 +847554,7 @@ function isAddressValid3(address3) {
|
|
|
847553
847554
|
}
|
|
847554
847555
|
|
|
847555
847556
|
// ../../libs/coin-modules/coin-stellar/lib-es/logic/getBalance.js
|
|
847556
|
-
var
|
|
847557
|
+
var import_bignumber361 = __toESM(require("bignumber.js"));
|
|
847557
847558
|
async function getBalance10(addr) {
|
|
847558
847559
|
const { balance, assets, spendableBalance } = await fetchAccount(addr);
|
|
847559
847560
|
const locked19 = BigInt(balance.toString()) - BigInt(spendableBalance.toString());
|
|
@@ -847570,7 +847571,7 @@ async function getBalance10(addr) {
|
|
|
847570
847571
|
}
|
|
847571
847572
|
const assetBalances = assets.map((asset) => {
|
|
847572
847573
|
const token = findTokenById(`stellar/asset/${getAssetIdFromAsset(asset)}`);
|
|
847573
|
-
let parsedBalance = new
|
|
847574
|
+
let parsedBalance = new import_bignumber361.default(0);
|
|
847574
847575
|
if (token) {
|
|
847575
847576
|
parsedBalance = parseCurrencyUnit(token.units[0], asset.balance);
|
|
847576
847577
|
}
|
|
@@ -847639,7 +847640,7 @@ var convertToCoreOperation2 = (operation) => {
|
|
|
847639
847640
|
|
|
847640
847641
|
// ../../libs/coin-modules/coin-stellar/lib-es/logic/validateIntent.js
|
|
847641
847642
|
init_lib_es();
|
|
847642
|
-
var
|
|
847643
|
+
var import_bignumber362 = __toESM(require("bignumber.js"));
|
|
847643
847644
|
var validateIntent3 = async (transactionIntent, customFees) => {
|
|
847644
847645
|
const errors = {};
|
|
847645
847646
|
const warnings3 = {};
|
|
@@ -847736,7 +847737,7 @@ var validateIntent3 = async (transactionIntent, customFees) => {
|
|
|
847736
847737
|
}
|
|
847737
847738
|
if (totalSpent > nativeBalance - baseReserve) {
|
|
847738
847739
|
errors.amount = new NotEnoughSpendableBalance(void 0, {
|
|
847739
|
-
minimumAmount: transactionIntent.asset.unit ? formatCurrencyUnit(transactionIntent.asset.unit, new
|
|
847740
|
+
minimumAmount: transactionIntent.asset.unit ? formatCurrencyUnit(transactionIntent.asset.unit, new import_bignumber362.default(baseReserve.toString()), {
|
|
847740
847741
|
disableRounding: true,
|
|
847741
847742
|
showCode: true
|
|
847742
847743
|
}) : "Unknown unit"
|
|
@@ -848119,7 +848120,7 @@ var getNetworkAlpacaApi = (networkFamily) => ({
|
|
|
848119
848120
|
});
|
|
848120
848121
|
|
|
848121
848122
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/utils.js
|
|
848122
|
-
var
|
|
848123
|
+
var import_bignumber363 = __toESM(require("bignumber.js"));
|
|
848123
848124
|
function findCryptoCurrencyByNetwork(network) {
|
|
848124
848125
|
const networksRemap = {
|
|
848125
848126
|
xrp: "ripple"
|
|
@@ -848148,13 +848149,13 @@ function adaptCoreOperationToLiveOperation(accountId2, op) {
|
|
|
848148
848149
|
if (op.details?.memo) {
|
|
848149
848150
|
extra.memo = op.details.memo;
|
|
848150
848151
|
}
|
|
848151
|
-
const bnFees = new
|
|
848152
|
+
const bnFees = new import_bignumber363.default(op.tx.fees.toString());
|
|
848152
848153
|
const res = {
|
|
848153
848154
|
id: encodeOperationId(accountId2, op.tx.hash, op.type),
|
|
848154
848155
|
hash: op.tx.hash,
|
|
848155
848156
|
accountId: accountId2,
|
|
848156
848157
|
type: opType,
|
|
848157
|
-
value: op.asset.type === "native" && ["OUT", "FEES"].includes(opType) ? new
|
|
848158
|
+
value: op.asset.type === "native" && ["OUT", "FEES"].includes(opType) ? new import_bignumber363.default(op.value.toString()).plus(bnFees) : new import_bignumber363.default(op.value.toString()),
|
|
848158
848159
|
fee: bnFees,
|
|
848159
848160
|
blockHash: op.tx.block.hash,
|
|
848160
848161
|
blockHeight: op.tx.block.height,
|
|
@@ -848226,8 +848227,8 @@ var buildOptimisticOperation21 = (account3, transaction, sequenceNumber) => {
|
|
|
848226
848227
|
id: encodeOperationId(account3.id, "", type4),
|
|
848227
848228
|
hash: "",
|
|
848228
848229
|
type: type4,
|
|
848229
|
-
value: subAccountId ? new
|
|
848230
|
-
fee: new
|
|
848230
|
+
value: subAccountId ? new import_bignumber363.default(fees2.toString()) : transaction.amount,
|
|
848231
|
+
fee: new import_bignumber363.default(fees2.toString()),
|
|
848231
848232
|
blockHash: null,
|
|
848232
848233
|
blockHeight: null,
|
|
848233
848234
|
senders: [account3.freshAddress.toString()],
|
|
@@ -848249,7 +848250,7 @@ var buildOptimisticOperation21 = (account3, transaction, sequenceNumber) => {
|
|
|
848249
848250
|
hash: "",
|
|
848250
848251
|
type: "OUT",
|
|
848251
848252
|
value: transaction.useAllAmount ? tokenAccount.balance : transaction.amount,
|
|
848252
|
-
fee: new
|
|
848253
|
+
fee: new import_bignumber363.default(0),
|
|
848253
848254
|
blockHash: null,
|
|
848254
848255
|
blockHeight: null,
|
|
848255
848256
|
senders: [account3.freshAddress],
|
|
@@ -848286,17 +848287,17 @@ function getAlpacaApi(network, kind) {
|
|
|
848286
848287
|
}
|
|
848287
848288
|
|
|
848288
848289
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/buildSubAccounts.js
|
|
848289
|
-
var
|
|
848290
|
+
var import_bignumber364 = __toESM(require("bignumber.js"));
|
|
848290
848291
|
function buildTokenAccount({ parentAccountId, assetBalance, token, operations: operations3 }) {
|
|
848291
848292
|
const id7 = encodeTokenAccountId(parentAccountId, token);
|
|
848292
|
-
const balance = new
|
|
848293
|
-
const spendableBalance = new
|
|
848293
|
+
const balance = new import_bignumber364.default(assetBalance.value.toString() || "0");
|
|
848294
|
+
const spendableBalance = new import_bignumber364.default(assetBalance.value.toString()).minus(new import_bignumber364.default(assetBalance.locked?.toString() || "0"));
|
|
848294
848295
|
const tokenOperations = operations3.map((op) => ({
|
|
848295
848296
|
...op,
|
|
848296
848297
|
id: encodeOperationId(id7, op.hash, op.extra?.ledgerOpType),
|
|
848297
848298
|
accountId: id7,
|
|
848298
848299
|
type: op.extra?.ledgerOpType,
|
|
848299
|
-
value: op.extra?.assetAmount ? new
|
|
848300
|
+
value: op.extra?.assetAmount ? new import_bignumber364.default(op.extra?.assetAmount) : op.value
|
|
848300
848301
|
}));
|
|
848301
848302
|
return {
|
|
848302
848303
|
type: "TokenAccount",
|
|
@@ -848394,8 +848395,8 @@ function genericGetAccountShape(network, kind) {
|
|
|
848394
848395
|
id: accountId2,
|
|
848395
848396
|
xpub: address3,
|
|
848396
848397
|
blockHeight: operations3.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
|
|
848397
|
-
balance: new
|
|
848398
|
-
spendableBalance: new
|
|
848398
|
+
balance: new import_bignumber365.default(nativeBalance.toString()),
|
|
848399
|
+
spendableBalance: new import_bignumber365.default(spendableBalance.toString()),
|
|
848399
848400
|
operations: operations3,
|
|
848400
848401
|
subAccounts,
|
|
848401
848402
|
operationsCount: operations3.length
|
|
@@ -848467,7 +848468,7 @@ function getSigner(network) {
|
|
|
848467
848468
|
}
|
|
848468
848469
|
|
|
848469
848470
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/prepareTransaction.js
|
|
848470
|
-
var
|
|
848471
|
+
var import_bignumber366 = __toESM(require("bignumber.js"));
|
|
848471
848472
|
function bnEq2(a64, b20) {
|
|
848472
848473
|
return !a64 && !b20 ? true : !a64 || !b20 ? false : a64.eq(b20);
|
|
848473
848474
|
}
|
|
@@ -848487,15 +848488,15 @@ function genericPrepareTransaction(network, kind) {
|
|
|
848487
848488
|
...transaction
|
|
848488
848489
|
}))).value;
|
|
848489
848490
|
}
|
|
848490
|
-
if (!bnEq2(transaction.fees, new
|
|
848491
|
+
if (!bnEq2(transaction.fees, new import_bignumber366.default(fees2.toString()))) {
|
|
848491
848492
|
return {
|
|
848492
848493
|
...transaction,
|
|
848493
|
-
fees: new
|
|
848494
|
+
fees: new import_bignumber366.default(fees2.toString()),
|
|
848494
848495
|
assetReference,
|
|
848495
848496
|
assetOwner,
|
|
848496
848497
|
customFees: {
|
|
848497
848498
|
parameters: {
|
|
848498
|
-
fees: new
|
|
848499
|
+
fees: new import_bignumber366.default(fees2.toString())
|
|
848499
848500
|
}
|
|
848500
848501
|
}
|
|
848501
848502
|
};
|
|
@@ -848519,14 +848520,14 @@ function getAssetInfos(tr3, owner, getAssetFromToken3) {
|
|
|
848519
848520
|
|
|
848520
848521
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getTransactionStatus.js
|
|
848521
848522
|
init_lib_es();
|
|
848522
|
-
var
|
|
848523
|
+
var import_bignumber367 = __toESM(require("bignumber.js"));
|
|
848523
848524
|
function genericGetTransactionStatus(network, kind) {
|
|
848524
848525
|
return async (account3, transaction) => {
|
|
848525
848526
|
const alpacaApi = getAlpacaApi(network, kind);
|
|
848526
848527
|
const draftTransaction = {
|
|
848527
848528
|
mode: transaction?.mode,
|
|
848528
848529
|
recipient: transaction.recipient,
|
|
848529
|
-
amount: transaction.amount ?? new
|
|
848530
|
+
amount: transaction.amount ?? new import_bignumber367.default(0),
|
|
848530
848531
|
useAllAmount: !!transaction.useAllAmount,
|
|
848531
848532
|
assetReference: transaction.assetReference || "",
|
|
848532
848533
|
assetOwner: transaction.assetOwner || "",
|
|
@@ -848546,15 +848547,15 @@ function genericGetTransactionStatus(network, kind) {
|
|
|
848546
848547
|
return Promise.resolve({
|
|
848547
848548
|
errors,
|
|
848548
848549
|
warnings: warnings3,
|
|
848549
|
-
estimatedFees: !transaction.fees || transaction.fees.isZero() ? new
|
|
848550
|
-
amount: transaction.amount.eq(0) ? new
|
|
848551
|
-
totalSpent: new
|
|
848550
|
+
estimatedFees: !transaction.fees || transaction.fees.isZero() ? new import_bignumber367.default(estimatedFees.toString()) : transaction.fees,
|
|
848551
|
+
amount: transaction.amount.eq(0) ? new import_bignumber367.default(amount.toString()) : transaction.amount,
|
|
848552
|
+
totalSpent: new import_bignumber367.default(totalSpent.toString())
|
|
848552
848553
|
});
|
|
848553
848554
|
};
|
|
848554
848555
|
}
|
|
848555
848556
|
|
|
848556
848557
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/createTransaction.js
|
|
848557
|
-
var
|
|
848558
|
+
var import_bignumber368 = __toESM(require("bignumber.js"));
|
|
848558
848559
|
var NetworkCongestionLevel2;
|
|
848559
848560
|
(function(NetworkCongestionLevel3) {
|
|
848560
848561
|
NetworkCongestionLevel3["LOW"] = "LOW";
|
|
@@ -848568,7 +848569,7 @@ function createTransaction42(account3) {
|
|
|
848568
848569
|
case "ripple":
|
|
848569
848570
|
return {
|
|
848570
848571
|
family: currency25.family,
|
|
848571
|
-
amount: (0,
|
|
848572
|
+
amount: (0, import_bignumber368.default)(0),
|
|
848572
848573
|
recipient: "",
|
|
848573
848574
|
fees: null,
|
|
848574
848575
|
tag: void 0,
|
|
@@ -848578,7 +848579,7 @@ function createTransaction42(account3) {
|
|
|
848578
848579
|
case "stellar":
|
|
848579
848580
|
return {
|
|
848580
848581
|
family: currency25.family,
|
|
848581
|
-
amount: new
|
|
848582
|
+
amount: new import_bignumber368.default(0),
|
|
848582
848583
|
fees: null,
|
|
848583
848584
|
recipient: "",
|
|
848584
848585
|
memoValue: null,
|
|
@@ -848593,7 +848594,7 @@ function createTransaction42(account3) {
|
|
|
848593
848594
|
return {
|
|
848594
848595
|
mode: "send-eip1559",
|
|
848595
848596
|
family: currency25.family,
|
|
848596
|
-
amount: new
|
|
848597
|
+
amount: new import_bignumber368.default(0),
|
|
848597
848598
|
recipient: ""
|
|
848598
848599
|
};
|
|
848599
848600
|
}
|
|
@@ -848603,7 +848604,7 @@ function createTransaction42(account3) {
|
|
|
848603
848604
|
}
|
|
848604
848605
|
|
|
848605
848606
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js
|
|
848606
|
-
var
|
|
848607
|
+
var import_bignumber369 = __toESM(require("bignumber.js"));
|
|
848607
848608
|
function genericEstimateMaxSpendable(network, kind) {
|
|
848608
848609
|
return async ({ account: account3, parentAccount, transaction }) => {
|
|
848609
848610
|
if (account3.type === "TokenAccount") {
|
|
@@ -848622,10 +848623,10 @@ function genericEstimateMaxSpendable(network, kind) {
|
|
|
848622
848623
|
}
|
|
848623
848624
|
const { amount } = await getAlpacaApi(network, kind).validateIntent(transactionToIntent(account3, { ...draftTransaction }), { value: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n });
|
|
848624
848625
|
if (network === "stellar") {
|
|
848625
|
-
return amount > 0 ? new
|
|
848626
|
+
return amount > 0 ? new import_bignumber369.default(amount.toString()) : new import_bignumber369.default(0);
|
|
848626
848627
|
}
|
|
848627
|
-
const bnFee = (0,
|
|
848628
|
-
return
|
|
848628
|
+
const bnFee = (0, import_bignumber369.default)(fees2.toString());
|
|
848629
|
+
return import_bignumber369.default.max(0, account3.spendableBalance.minus(bnFee));
|
|
848629
848630
|
};
|
|
848630
848631
|
}
|
|
848631
848632
|
|
|
@@ -848639,7 +848640,7 @@ var genericBroadcast = (network, kind) => async ({ signedOperation: { signature:
|
|
|
848639
848640
|
var import_rxjs155 = require("rxjs");
|
|
848640
848641
|
init_lib_es();
|
|
848641
848642
|
init_lib_es2();
|
|
848642
|
-
var
|
|
848643
|
+
var import_bignumber370 = __toESM(require("bignumber.js"));
|
|
848643
848644
|
function applyMemoToIntent(transactionIntent, transaction) {
|
|
848644
848645
|
if (transaction["tag"]) {
|
|
848645
848646
|
const txWithMemoTag = transactionIntent;
|
|
@@ -848683,7 +848684,7 @@ var genericSignOperation = (network, kind) => (signerContext4) => ({ account: ac
|
|
|
848683
848684
|
subAccountId: transaction.subAccountId || ""
|
|
848684
848685
|
};
|
|
848685
848686
|
const { amount } = await getAlpacaApi(network, kind).validateIntent(transactionToIntent(account3, draftTransaction), { value: fees2 });
|
|
848686
|
-
transaction.amount = new
|
|
848687
|
+
transaction.amount = new import_bignumber370.default(amount.toString());
|
|
848687
848688
|
}
|
|
848688
848689
|
const signedInfo = await signerContext4(deviceId, async (signer2) => {
|
|
848689
848690
|
const derivationPath = account3.freshAddressPath;
|
|
@@ -848945,7 +848946,7 @@ ${head2}${sub}`;
|
|
|
848945
848946
|
return (op) => format6(op, 0);
|
|
848946
848947
|
};
|
|
848947
848948
|
function maybeDisplaySumOfOpsIssue(ops, balance, unit) {
|
|
848948
|
-
const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new
|
|
848949
|
+
const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new import_bignumber371.BigNumber(0));
|
|
848949
848950
|
if (sumOfOps.eq(balance))
|
|
848950
848951
|
return "";
|
|
848951
848952
|
return " (! sum of ops " + formatCurrencyUnit(unit, sumOfOps, {
|
|
@@ -849006,7 +849007,7 @@ var cliFormat = (account3, level2) => {
|
|
|
849006
849007
|
};
|
|
849007
849008
|
var stats = (account3) => {
|
|
849008
849009
|
const { subAccounts, operations: operations3 } = account3;
|
|
849009
|
-
const sumOfAllOpsNumber = operations3.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new
|
|
849010
|
+
const sumOfAllOpsNumber = operations3.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new import_bignumber371.BigNumber(0));
|
|
849010
849011
|
const sumOfAllOps = formatCurrencyUnit(getAccountCurrency(account3).units[0], sumOfAllOpsNumber, {
|
|
849011
849012
|
showCode: true
|
|
849012
849013
|
});
|
|
@@ -849031,7 +849032,7 @@ var operationBalanceHistoryBackwards = (account3) => {
|
|
|
849031
849032
|
}).reverse());
|
|
849032
849033
|
};
|
|
849033
849034
|
var operationBalanceHistory = (account3) => {
|
|
849034
|
-
let acc = new
|
|
849035
|
+
let acc = new import_bignumber371.BigNumber(0);
|
|
849035
849036
|
return JSON.stringify(account3.operations.slice(0).reverse().map((op) => {
|
|
849036
849037
|
acc = acc.plus(getOperationAmountNumberWithInternals(op));
|
|
849037
849038
|
const { blockHeight } = op;
|
|
@@ -849135,37 +849136,37 @@ var toSignOperationEventRaw = (e36) => {
|
|
|
849135
849136
|
var displayTokenValue = (token) => `${token.name} (#${extractTokenId(token.id)})`;
|
|
849136
849137
|
|
|
849137
849138
|
// ../../libs/coin-modules/coin-cardano/lib-es/deviceTransactionConfig.js
|
|
849138
|
-
var
|
|
849139
|
+
var import_bignumber372 = __toESM(require("bignumber.js"));
|
|
849139
849140
|
var import_typhonjs12 = __toESM(require_dist6());
|
|
849140
849141
|
|
|
849141
849142
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/deviceTransactionConfig.js
|
|
849142
849143
|
init_lib_es2();
|
|
849143
849144
|
|
|
849144
849145
|
// ../../libs/coin-modules/coin-evm/lib-es/deviceTransactionConfig.js
|
|
849145
|
-
var
|
|
849146
|
+
var import_bignumber373 = __toESM(require("bignumber.js"));
|
|
849146
849147
|
|
|
849147
849148
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/deviceTransactionConfig.js
|
|
849148
849149
|
init_lib_es2();
|
|
849149
849150
|
var currency5 = getCryptoCurrencyById("internet_computer");
|
|
849150
849151
|
|
|
849151
849152
|
// ../../libs/coin-modules/coin-multiversx/lib-es/deviceTransactionConfig.js
|
|
849152
|
-
var
|
|
849153
|
+
var import_bignumber374 = __toESM(require("bignumber.js"));
|
|
849153
849154
|
|
|
849154
849155
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/deviceTransactionConfig.js
|
|
849155
849156
|
var currency6 = getCryptoCurrencyById("polkadot");
|
|
849156
849157
|
|
|
849157
849158
|
// ../../libs/coin-modules/coin-solana/lib-es/deviceTransactionConfig.js
|
|
849158
|
-
var
|
|
849159
|
+
var import_bignumber375 = __toESM(require("bignumber.js"));
|
|
849159
849160
|
|
|
849160
849161
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/deviceTransactionConfig.js
|
|
849161
|
-
var
|
|
849162
|
+
var import_bignumber376 = require("bignumber.js");
|
|
849162
849163
|
|
|
849163
849164
|
// ../../libs/coin-modules/coin-ton/lib-es/deviceTransactionConfig.js
|
|
849164
849165
|
var import_core22 = __toESM(require_dist2());
|
|
849165
|
-
var
|
|
849166
|
+
var import_bignumber377 = require("bignumber.js");
|
|
849166
849167
|
|
|
849167
849168
|
// ../../libs/coin-modules/coin-algorand/lib-es/transaction.js
|
|
849168
|
-
var
|
|
849169
|
+
var import_bignumber378 = require("bignumber.js");
|
|
849169
849170
|
var formatTransaction2 = ({ mode, subAccountId, amount, recipient, fees: fees2, useAllAmount }, mainAccount) => {
|
|
849170
849171
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a64) => a64.id === subAccountId) || mainAccount;
|
|
849171
849172
|
return `
|
|
@@ -849184,7 +849185,7 @@ var fromTransactionRaw2 = (tr3) => {
|
|
|
849184
849185
|
return {
|
|
849185
849186
|
...common,
|
|
849186
849187
|
family: tr3.family,
|
|
849187
|
-
fees: tr3.fees ? new
|
|
849188
|
+
fees: tr3.fees ? new import_bignumber378.BigNumber(tr3.fees) : null,
|
|
849188
849189
|
memo: tr3.memo,
|
|
849189
849190
|
mode: tr3.mode,
|
|
849190
849191
|
assetId: tr3.assetId
|
|
@@ -849211,7 +849212,7 @@ var transaction_default3 = {
|
|
|
849211
849212
|
};
|
|
849212
849213
|
|
|
849213
849214
|
// ../../libs/coin-modules/coin-aptos/lib-es/bridge/transaction.js
|
|
849214
|
-
var
|
|
849215
|
+
var import_bignumber379 = require("bignumber.js");
|
|
849215
849216
|
var formatTransaction3 = ({ mode, amount, fees: fees2, recipient, useAllAmount }, account3) => {
|
|
849216
849217
|
return `
|
|
849217
849218
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(account3.currency.units[0], amount)}
|
|
@@ -849225,7 +849226,7 @@ var fromTransactionRaw3 = (t46) => {
|
|
|
849225
849226
|
family: t46.family,
|
|
849226
849227
|
mode: t46.mode,
|
|
849227
849228
|
options: JSON.parse(t46.options),
|
|
849228
|
-
...t46.fees && { fees: new
|
|
849229
|
+
...t46.fees && { fees: new import_bignumber379.BigNumber(t46.fees) },
|
|
849229
849230
|
...t46.errors && { errors: JSON.parse(t46.errors) }
|
|
849230
849231
|
};
|
|
849231
849232
|
};
|
|
@@ -849250,14 +849251,14 @@ var transaction_default4 = {
|
|
|
849250
849251
|
};
|
|
849251
849252
|
|
|
849252
849253
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/transaction.js
|
|
849253
|
-
var
|
|
849254
|
+
var import_bignumber380 = require("bignumber.js");
|
|
849254
849255
|
var fromFeeItemsRaw = (fir) => ({
|
|
849255
849256
|
items: fir.items.map((fi) => ({
|
|
849256
849257
|
key: fi.key,
|
|
849257
849258
|
speed: fi.speed,
|
|
849258
|
-
feePerByte: new
|
|
849259
|
+
feePerByte: new import_bignumber380.BigNumber(fi.feePerByte)
|
|
849259
849260
|
})),
|
|
849260
|
-
defaultFeePerByte: new
|
|
849261
|
+
defaultFeePerByte: new import_bignumber380.BigNumber(fir.defaultFeePerByte)
|
|
849261
849262
|
});
|
|
849262
849263
|
var toFeeItemsRaw = (fir) => ({
|
|
849263
849264
|
items: fir.items.map((fi) => ({
|
|
@@ -849274,7 +849275,7 @@ var fromTransactionRaw4 = (tr3) => {
|
|
|
849274
849275
|
rbf: tr3.rbf,
|
|
849275
849276
|
utxoStrategy: tr3.utxoStrategy,
|
|
849276
849277
|
family: tr3.family,
|
|
849277
|
-
feePerByte: tr3.feePerByte ? new
|
|
849278
|
+
feePerByte: tr3.feePerByte ? new import_bignumber380.BigNumber(tr3.feePerByte) : null,
|
|
849278
849279
|
networkInfo: tr3.networkInfo && {
|
|
849279
849280
|
family: tr3.networkInfo.family,
|
|
849280
849281
|
feeItems: fromFeeItemsRaw(tr3.networkInfo.feeItems)
|
|
@@ -849368,7 +849369,7 @@ var transaction_default5 = {
|
|
|
849368
849369
|
};
|
|
849369
849370
|
|
|
849370
849371
|
// ../../libs/coin-modules/coin-cardano/lib-es/transaction.js
|
|
849371
|
-
var
|
|
849372
|
+
var import_bignumber381 = require("bignumber.js");
|
|
849372
849373
|
var formatTransaction5 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
849373
849374
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a64) => a64.id === subAccountId) || mainAccount;
|
|
849374
849375
|
return `
|
|
@@ -849384,7 +849385,7 @@ var fromTransactionRaw5 = (tr3) => {
|
|
|
849384
849385
|
...common,
|
|
849385
849386
|
family: tr3.family,
|
|
849386
849387
|
mode: tr3.mode,
|
|
849387
|
-
fees: tr3.fees ? new
|
|
849388
|
+
fees: tr3.fees ? new import_bignumber381.BigNumber(tr3.fees) : void 0,
|
|
849388
849389
|
memo: tr3.memo,
|
|
849389
849390
|
poolId: tr3.poolId,
|
|
849390
849391
|
protocolParams: tr3.protocolParams
|
|
@@ -849412,7 +849413,7 @@ var transaction_default6 = {
|
|
|
849412
849413
|
};
|
|
849413
849414
|
|
|
849414
849415
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/transaction.js
|
|
849415
|
-
var
|
|
849416
|
+
var import_bignumber382 = __toESM(require("bignumber.js"));
|
|
849416
849417
|
var formatTransaction6 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849417
849418
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849418
849419
|
showCode: true,
|
|
@@ -849424,8 +849425,8 @@ var fromTransactionRaw6 = (tr3) => {
|
|
|
849424
849425
|
return {
|
|
849425
849426
|
...common,
|
|
849426
849427
|
family: tr3.family,
|
|
849427
|
-
fees: new
|
|
849428
|
-
amount: new
|
|
849428
|
+
fees: new import_bignumber382.default(tr3.fees),
|
|
849429
|
+
amount: new import_bignumber382.default(tr3.amount),
|
|
849429
849430
|
transferId: tr3.transferId
|
|
849430
849431
|
};
|
|
849431
849432
|
};
|
|
@@ -849449,7 +849450,7 @@ var transaction_default7 = {
|
|
|
849449
849450
|
};
|
|
849450
849451
|
|
|
849451
849452
|
// ../../libs/coin-modules/coin-canton/lib-es/bridge/transaction.js
|
|
849452
|
-
var
|
|
849453
|
+
var import_bignumber383 = require("bignumber.js");
|
|
849453
849454
|
var formatTransaction7 = ({ amount, recipient, fee, useAllAmount }, account3) => `
|
|
849454
849455
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849455
849456
|
showCode: true,
|
|
@@ -849465,7 +849466,7 @@ var fromTransactionRaw7 = (tr3) => {
|
|
|
849465
849466
|
return {
|
|
849466
849467
|
...common,
|
|
849467
849468
|
family: tr3.family,
|
|
849468
|
-
fee: tr3.fee ? new
|
|
849469
|
+
fee: tr3.fee ? new import_bignumber383.BigNumber(tr3.fee) : null
|
|
849469
849470
|
};
|
|
849470
849471
|
};
|
|
849471
849472
|
var toTransactionRaw7 = (t46) => {
|
|
@@ -849486,7 +849487,7 @@ var transaction_default8 = {
|
|
|
849486
849487
|
};
|
|
849487
849488
|
|
|
849488
849489
|
// ../../libs/coin-modules/coin-celo/lib-es/bridge/transaction.js
|
|
849489
|
-
var
|
|
849490
|
+
var import_bignumber384 = require("bignumber.js");
|
|
849490
849491
|
var formatTransaction8 = (t46, account3) => `
|
|
849491
849492
|
SEND ${t46.useAllAmount ? "MAX CELO" : formatCurrencyUnit(getAccountCurrency(account3).units[0], t46.amount, {
|
|
849492
849493
|
showCode: true,
|
|
@@ -849498,7 +849499,7 @@ var fromTransactionRaw8 = (tr3) => {
|
|
|
849498
849499
|
return {
|
|
849499
849500
|
...common,
|
|
849500
849501
|
family: tr3.family,
|
|
849501
|
-
fees: tr3.fees ? new
|
|
849502
|
+
fees: tr3.fees ? new import_bignumber384.BigNumber(tr3.fees) : null,
|
|
849502
849503
|
mode: tr3.mode,
|
|
849503
849504
|
index: tr3.index
|
|
849504
849505
|
};
|
|
@@ -849523,7 +849524,7 @@ var transaction_default9 = {
|
|
|
849523
849524
|
};
|
|
849524
849525
|
|
|
849525
849526
|
// ../../libs/coin-modules/coin-cosmos/lib-es/transaction.js
|
|
849526
|
-
var
|
|
849527
|
+
var import_bignumber385 = require("bignumber.js");
|
|
849527
849528
|
var formatTransaction9 = ({ mode, amount, fees: fees2, recipient, validators: validators7, memo: memo3, sourceValidator, useAllAmount }, account3) => `
|
|
849528
849529
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849529
849530
|
showCode: true,
|
|
@@ -849544,13 +849545,13 @@ var fromTransactionRaw9 = (tr3) => {
|
|
|
849544
849545
|
mode: tr3.mode,
|
|
849545
849546
|
networkInfo: networkInfo && {
|
|
849546
849547
|
family: networkInfo.family,
|
|
849547
|
-
fees: new
|
|
849548
|
+
fees: new import_bignumber385.BigNumber(networkInfo.fees)
|
|
849548
849549
|
},
|
|
849549
|
-
fees: tr3.fees ? new
|
|
849550
|
-
gas: tr3.gas ? new
|
|
849550
|
+
fees: tr3.fees ? new import_bignumber385.BigNumber(tr3.fees) : null,
|
|
849551
|
+
gas: tr3.gas ? new import_bignumber385.BigNumber(tr3.gas) : null,
|
|
849551
849552
|
memo: tr3.memo,
|
|
849552
849553
|
sourceValidator: tr3.sourceValidator,
|
|
849553
|
-
validators: tr3.validators ? tr3.validators.map((v34) => ({ ...v34, amount: new
|
|
849554
|
+
validators: tr3.validators ? tr3.validators.map((v34) => ({ ...v34, amount: new import_bignumber385.BigNumber(v34.amount) })) : []
|
|
849554
849555
|
};
|
|
849555
849556
|
};
|
|
849556
849557
|
var toTransactionRaw9 = (t46) => {
|
|
@@ -849615,7 +849616,7 @@ var transaction_default11 = {
|
|
|
849615
849616
|
};
|
|
849616
849617
|
|
|
849617
849618
|
// ../../libs/coin-modules/coin-filecoin/lib-es/bridge/transaction.js
|
|
849618
|
-
var
|
|
849619
|
+
var import_bignumber386 = __toESM(require("bignumber.js"));
|
|
849619
849620
|
var formatTransaction11 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849620
849621
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849621
849622
|
showCode: true,
|
|
@@ -849630,10 +849631,10 @@ var fromTransactionRaw11 = (tr3) => {
|
|
|
849630
849631
|
version: tr3.version,
|
|
849631
849632
|
method: tr3.method,
|
|
849632
849633
|
nonce: tr3.nonce,
|
|
849633
|
-
amount: new
|
|
849634
|
-
gasFeeCap: new
|
|
849635
|
-
gasLimit: new
|
|
849636
|
-
gasPremium: new
|
|
849634
|
+
amount: new import_bignumber386.default(tr3.amount),
|
|
849635
|
+
gasFeeCap: new import_bignumber386.default(tr3.gasFeeCap),
|
|
849636
|
+
gasLimit: new import_bignumber386.default(tr3.gasLimit),
|
|
849637
|
+
gasPremium: new import_bignumber386.default(tr3.gasPremium)
|
|
849637
849638
|
};
|
|
849638
849639
|
};
|
|
849639
849640
|
var toTransactionRaw11 = (t46) => {
|
|
@@ -849660,7 +849661,7 @@ var transaction_default12 = {
|
|
|
849660
849661
|
};
|
|
849661
849662
|
|
|
849662
849663
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/transaction.js
|
|
849663
|
-
var
|
|
849664
|
+
var import_bignumber387 = __toESM(require("bignumber.js"));
|
|
849664
849665
|
var formatTransaction12 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849665
849666
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849666
849667
|
showCode: true,
|
|
@@ -849672,8 +849673,8 @@ var fromTransactionRaw12 = (tr3) => {
|
|
|
849672
849673
|
return {
|
|
849673
849674
|
...common,
|
|
849674
849675
|
family: tr3.family,
|
|
849675
|
-
fees: new
|
|
849676
|
-
amount: new
|
|
849676
|
+
fees: new import_bignumber387.default(tr3.fees),
|
|
849677
|
+
amount: new import_bignumber387.default(tr3.amount),
|
|
849677
849678
|
memo: tr3.memo
|
|
849678
849679
|
};
|
|
849679
849680
|
};
|
|
@@ -849697,7 +849698,7 @@ var transaction_default13 = {
|
|
|
849697
849698
|
};
|
|
849698
849699
|
|
|
849699
849700
|
// ../../libs/coin-modules/coin-icon/lib-es/transaction.js
|
|
849700
|
-
var
|
|
849701
|
+
var import_bignumber388 = require("bignumber.js");
|
|
849701
849702
|
var formatTransaction13 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849702
849703
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849703
849704
|
showCode: true,
|
|
@@ -849710,8 +849711,8 @@ var fromTransactionRaw13 = (tr3) => {
|
|
|
849710
849711
|
...common,
|
|
849711
849712
|
family: tr3.family,
|
|
849712
849713
|
mode: tr3.mode,
|
|
849713
|
-
fees: tr3.fees ? new
|
|
849714
|
-
stepLimit: tr3.stepLimit ? new
|
|
849714
|
+
fees: tr3.fees ? new import_bignumber388.BigNumber(tr3.fees) : null,
|
|
849715
|
+
stepLimit: tr3.stepLimit ? new import_bignumber388.BigNumber(tr3.stepLimit) : void 0
|
|
849715
849716
|
};
|
|
849716
849717
|
};
|
|
849717
849718
|
var toTransactionRaw13 = (t46) => {
|
|
@@ -849734,7 +849735,7 @@ var transaction_default14 = {
|
|
|
849734
849735
|
};
|
|
849735
849736
|
|
|
849736
849737
|
// ../../libs/coin-modules/coin-kaspa/lib-es/transaction.js
|
|
849737
|
-
var
|
|
849738
|
+
var import_bignumber389 = require("bignumber.js");
|
|
849738
849739
|
var formatTransactionStatus3 = (t46, ts2, mainAccount) => {
|
|
849739
849740
|
let str = "";
|
|
849740
849741
|
str += formatTransactionStatus(t46, ts2, mainAccount);
|
|
@@ -849756,10 +849757,10 @@ var fromTransactionRaw14 = (tr3) => {
|
|
|
849756
849757
|
family: tr3.family,
|
|
849757
849758
|
networkInfo: tr3.networkInfo.map((x21) => ({
|
|
849758
849759
|
...x21,
|
|
849759
|
-
amount: (0,
|
|
849760
|
+
amount: (0, import_bignumber389.BigNumber)(x21.amount)
|
|
849760
849761
|
})),
|
|
849761
849762
|
feesStrategy: tr3.feesStrategy,
|
|
849762
|
-
customFeeRate: tr3.customFeeRate ? (0,
|
|
849763
|
+
customFeeRate: tr3.customFeeRate ? (0, import_bignumber389.BigNumber)(tr3.customFeeRate) : void 0
|
|
849763
849764
|
};
|
|
849764
849765
|
};
|
|
849765
849766
|
var toTransactionRaw14 = (t46) => {
|
|
@@ -849785,7 +849786,7 @@ var transaction_default15 = {
|
|
|
849785
849786
|
};
|
|
849786
849787
|
|
|
849787
849788
|
// ../../libs/coin-modules/coin-multiversx/lib-es/transaction.js
|
|
849788
|
-
var
|
|
849789
|
+
var import_bignumber390 = require("bignumber.js");
|
|
849789
849790
|
var formatTransaction15 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
849790
849791
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a64) => a64.id === subAccountId) || mainAccount;
|
|
849791
849792
|
return `
|
|
@@ -849801,7 +849802,7 @@ var fromTransactionRaw15 = (tr3) => {
|
|
|
849801
849802
|
...common,
|
|
849802
849803
|
family: tr3.family,
|
|
849803
849804
|
mode: tr3.mode,
|
|
849804
|
-
fees: tr3.fees ? new
|
|
849805
|
+
fees: tr3.fees ? new import_bignumber390.BigNumber(tr3.fees) : null,
|
|
849805
849806
|
gasLimit: tr3.gasLimit
|
|
849806
849807
|
};
|
|
849807
849808
|
if (tr3.data) {
|
|
@@ -849833,7 +849834,7 @@ var transaction_default16 = {
|
|
|
849833
849834
|
};
|
|
849834
849835
|
|
|
849835
849836
|
// ../../libs/coin-modules/coin-near/lib-es/transaction.js
|
|
849836
|
-
var
|
|
849837
|
+
var import_bignumber391 = require("bignumber.js");
|
|
849837
849838
|
var formatTransaction16 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849838
849839
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849839
849840
|
showCode: true,
|
|
@@ -849846,7 +849847,7 @@ var fromTransactionRaw16 = (transactionRaw) => {
|
|
|
849846
849847
|
...common,
|
|
849847
849848
|
family: transactionRaw.family,
|
|
849848
849849
|
mode: transactionRaw.mode,
|
|
849849
|
-
fees: new
|
|
849850
|
+
fees: new import_bignumber391.BigNumber(transactionRaw?.fees || 0)
|
|
849850
849851
|
};
|
|
849851
849852
|
};
|
|
849852
849853
|
var toTransactionRaw16 = (transaction) => {
|
|
@@ -849871,7 +849872,7 @@ var transaction_default17 = {
|
|
|
849871
849872
|
};
|
|
849872
849873
|
|
|
849873
849874
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/transaction.js
|
|
849874
|
-
var
|
|
849875
|
+
var import_bignumber392 = require("bignumber.js");
|
|
849875
849876
|
var formatTransaction17 = ({ mode, amount, recipient, validators: validators7, useAllAmount }, account3) => `
|
|
849876
849877
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849877
849878
|
showCode: true,
|
|
@@ -849884,7 +849885,7 @@ var fromTransactionRaw17 = (tr3) => {
|
|
|
849884
849885
|
...common,
|
|
849885
849886
|
family: tr3.family,
|
|
849886
849887
|
mode: tr3.mode,
|
|
849887
|
-
fees: tr3.fees ? new
|
|
849888
|
+
fees: tr3.fees ? new import_bignumber392.BigNumber(tr3.fees) : null,
|
|
849888
849889
|
validators: tr3.validators,
|
|
849889
849890
|
era: tr3.era,
|
|
849890
849891
|
rewardDestination: tr3.rewardDestination,
|
|
@@ -849914,7 +849915,7 @@ var transaction_default18 = {
|
|
|
849914
849915
|
};
|
|
849915
849916
|
|
|
849916
849917
|
// ../../libs/coin-modules/coin-solana/lib-es/transaction.js
|
|
849917
|
-
var
|
|
849918
|
+
var import_bignumber393 = require("bignumber.js");
|
|
849918
849919
|
var fromTransactionRaw18 = (tr3) => {
|
|
849919
849920
|
const common = fromTransactionCommonRaw(tr3);
|
|
849920
849921
|
const { family, model } = tr3;
|
|
@@ -849934,7 +849935,7 @@ var toTransactionRaw18 = (t46) => {
|
|
|
849934
849935
|
};
|
|
849935
849936
|
};
|
|
849936
849937
|
var lamportsToSOL = (account3, amount) => {
|
|
849937
|
-
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new
|
|
849938
|
+
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new import_bignumber393.BigNumber(amount), {
|
|
849938
849939
|
showCode: true,
|
|
849939
849940
|
disableRounding: true
|
|
849940
849941
|
});
|
|
@@ -850005,7 +850006,7 @@ function formatTokenTransfer(mainAccount, tx, command4) {
|
|
|
850005
850006
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
850006
850007
|
throw new Error("token subaccount expected");
|
|
850007
850008
|
}
|
|
850008
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
850009
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber393.BigNumber(command4.amount), {
|
|
850009
850010
|
showCode: true,
|
|
850010
850011
|
disableRounding: true
|
|
850011
850012
|
});
|
|
@@ -850033,7 +850034,7 @@ function formatCreateApprove(mainAccount, tx, command4) {
|
|
|
850033
850034
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
850034
850035
|
throw new Error("token subaccount expected");
|
|
850035
850036
|
}
|
|
850036
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
850037
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber393.BigNumber(command4.amount), {
|
|
850037
850038
|
showCode: true,
|
|
850038
850039
|
disableRounding: true
|
|
850039
850040
|
});
|
|
@@ -850096,7 +850097,7 @@ var transaction_default19 = {
|
|
|
850096
850097
|
};
|
|
850097
850098
|
|
|
850098
850099
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/transaction.js
|
|
850099
|
-
var
|
|
850100
|
+
var import_bignumber394 = __toESM(require("bignumber.js"));
|
|
850100
850101
|
var formatTransaction19 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
850101
850102
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850102
850103
|
showCode: true,
|
|
@@ -850111,9 +850112,9 @@ var fromTransactionRaw19 = (tr3) => {
|
|
|
850111
850112
|
return {
|
|
850112
850113
|
...common,
|
|
850113
850114
|
family: tr3.family,
|
|
850114
|
-
nonce: tr3.nonce !== void 0 ? new
|
|
850115
|
-
fee: tr3.fee !== void 0 ? new
|
|
850116
|
-
amount: new
|
|
850115
|
+
nonce: tr3.nonce !== void 0 ? new import_bignumber394.default(tr3.nonce) : void 0,
|
|
850116
|
+
fee: tr3.fee !== void 0 ? new import_bignumber394.default(tr3.fee) : void 0,
|
|
850117
|
+
amount: new import_bignumber394.default(tr3.amount),
|
|
850117
850118
|
network: tr3.network,
|
|
850118
850119
|
anchorMode: tr3.anchorMode,
|
|
850119
850120
|
memo: tr3.memo
|
|
@@ -850142,7 +850143,7 @@ var transaction_default20 = {
|
|
|
850142
850143
|
};
|
|
850143
850144
|
|
|
850144
850145
|
// ../../libs/coin-modules/coin-stellar/lib-es/transaction.js
|
|
850145
|
-
var
|
|
850146
|
+
var import_bignumber395 = require("bignumber.js");
|
|
850146
850147
|
function formatTransaction20({ amount, recipient, fees: fees2, memoValue, useAllAmount, subAccountId }, mainAccount) {
|
|
850147
850148
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a64) => a64.id === subAccountId) || mainAccount;
|
|
850148
850149
|
return `
|
|
@@ -850163,14 +850164,14 @@ function fromTransactionRaw20(tr3) {
|
|
|
850163
850164
|
return {
|
|
850164
850165
|
...common,
|
|
850165
850166
|
family: tr3.family,
|
|
850166
|
-
fees: tr3.fees ? new
|
|
850167
|
+
fees: tr3.fees ? new import_bignumber395.BigNumber(tr3.fees) : null,
|
|
850167
850168
|
memoValue: tr3.memoValue ? tr3.memoValue : null,
|
|
850168
850169
|
memoType: tr3.memoType ? tr3.memoType : null,
|
|
850169
850170
|
networkInfo: networkInfo && {
|
|
850170
850171
|
family: networkInfo.family,
|
|
850171
|
-
fees: new
|
|
850172
|
-
baseFee: new
|
|
850173
|
-
baseReserve: new
|
|
850172
|
+
fees: new import_bignumber395.BigNumber(networkInfo.fees),
|
|
850173
|
+
baseFee: new import_bignumber395.BigNumber(networkInfo.baseFee),
|
|
850174
|
+
baseReserve: new import_bignumber395.BigNumber(networkInfo.baseReserve),
|
|
850174
850175
|
networkCongestionLevel: networkInfo.networkCongestionLevel
|
|
850175
850176
|
},
|
|
850176
850177
|
mode: tr3.mode,
|
|
@@ -850211,7 +850212,7 @@ var transaction_default21 = {
|
|
|
850211
850212
|
};
|
|
850212
850213
|
|
|
850213
850214
|
// ../../libs/coin-modules/coin-tezos/lib-es/bridge/transaction.js
|
|
850214
|
-
var
|
|
850215
|
+
var import_bignumber396 = require("bignumber.js");
|
|
850215
850216
|
var formatTransaction21 = ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees: fees2, useAllAmount, estimatedFees }, mainAccount) => {
|
|
850216
850217
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a64) => a64.id === subAccountId) || mainAccount;
|
|
850217
850218
|
return `
|
|
@@ -850234,12 +850235,12 @@ var fromTransactionRaw21 = (tr3) => {
|
|
|
850234
850235
|
mode: tr3.mode,
|
|
850235
850236
|
networkInfo: networkInfo && {
|
|
850236
850237
|
family: networkInfo.family,
|
|
850237
|
-
fees: new
|
|
850238
|
+
fees: new import_bignumber396.BigNumber(networkInfo.fees)
|
|
850238
850239
|
},
|
|
850239
|
-
fees: tr3.fees ? new
|
|
850240
|
-
gasLimit: tr3.gasLimit ? new
|
|
850241
|
-
storageLimit: tr3.storageLimit ? new
|
|
850242
|
-
estimatedFees: tr3.estimatedFees ? new
|
|
850240
|
+
fees: tr3.fees ? new import_bignumber396.BigNumber(tr3.fees) : null,
|
|
850241
|
+
gasLimit: tr3.gasLimit ? new import_bignumber396.BigNumber(tr3.gasLimit) : null,
|
|
850242
|
+
storageLimit: tr3.storageLimit ? new import_bignumber396.BigNumber(tr3.storageLimit) : null,
|
|
850243
|
+
estimatedFees: tr3.estimatedFees ? new import_bignumber396.BigNumber(tr3.estimatedFees) : null,
|
|
850243
850244
|
taquitoError: tr3.taquitoError
|
|
850244
850245
|
};
|
|
850245
850246
|
};
|
|
@@ -850271,7 +850272,7 @@ var transaction_default22 = {
|
|
|
850271
850272
|
};
|
|
850272
850273
|
|
|
850273
850274
|
// ../../libs/coin-modules/coin-ton/lib-es/transaction.js
|
|
850274
|
-
var
|
|
850275
|
+
var import_bignumber397 = __toESM(require("bignumber.js"));
|
|
850275
850276
|
var import_core23 = __toESM(require_dist2());
|
|
850276
850277
|
var formatTransaction22 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
850277
850278
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
@@ -850400,7 +850401,7 @@ var fromTransactionRaw22 = (tr3) => {
|
|
|
850400
850401
|
return {
|
|
850401
850402
|
...common,
|
|
850402
850403
|
family: tr3.family,
|
|
850403
|
-
fees: new
|
|
850404
|
+
fees: new import_bignumber397.default(tr3.fees),
|
|
850404
850405
|
comment: tr3.comment,
|
|
850405
850406
|
payload: tr3.payload ? fromTransactionPayloadRaw(tr3.payload) : void 0
|
|
850406
850407
|
};
|
|
@@ -850539,7 +850540,7 @@ var transaction_default23 = {
|
|
|
850539
850540
|
};
|
|
850540
850541
|
|
|
850541
850542
|
// ../../libs/coin-modules/coin-tron/lib-es/bridge/transaction.js
|
|
850542
|
-
var
|
|
850543
|
+
var import_bignumber398 = require("bignumber.js");
|
|
850543
850544
|
var fromTransactionRaw23 = (tr3) => {
|
|
850544
850545
|
const common = fromTransactionCommonRaw(tr3);
|
|
850545
850546
|
const { networkInfo } = tr3;
|
|
@@ -850547,12 +850548,12 @@ var fromTransactionRaw23 = (tr3) => {
|
|
|
850547
850548
|
...common,
|
|
850548
850549
|
networkInfo: networkInfo && {
|
|
850549
850550
|
family: "tron",
|
|
850550
|
-
freeNetUsed: new
|
|
850551
|
-
freeNetLimit: new
|
|
850552
|
-
netUsed: new
|
|
850553
|
-
netLimit: new
|
|
850554
|
-
energyUsed: new
|
|
850555
|
-
energyLimit: new
|
|
850551
|
+
freeNetUsed: new import_bignumber398.BigNumber(networkInfo.freeNetUsed),
|
|
850552
|
+
freeNetLimit: new import_bignumber398.BigNumber(networkInfo.freeNetLimit),
|
|
850553
|
+
netUsed: new import_bignumber398.BigNumber(networkInfo.netUsed),
|
|
850554
|
+
netLimit: new import_bignumber398.BigNumber(networkInfo.netLimit),
|
|
850555
|
+
energyUsed: new import_bignumber398.BigNumber(networkInfo.energyUsed),
|
|
850556
|
+
energyLimit: new import_bignumber398.BigNumber(networkInfo.energyLimit)
|
|
850556
850557
|
},
|
|
850557
850558
|
family: tr3.family,
|
|
850558
850559
|
mode: tr3.mode,
|
|
@@ -850654,7 +850655,7 @@ var transaction_default25 = {
|
|
|
850654
850655
|
};
|
|
850655
850656
|
|
|
850656
850657
|
// ../../libs/coin-modules/coin-xrp/lib-es/transaction.js
|
|
850657
|
-
var
|
|
850658
|
+
var import_bignumber399 = require("bignumber.js");
|
|
850658
850659
|
var formatTransaction25 = ({ amount, recipient, fees: fees2, tag, useAllAmount }, account3) => `
|
|
850659
850660
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850660
850661
|
showCode: true,
|
|
@@ -850672,13 +850673,13 @@ var fromTransactionRaw25 = (tr3) => {
|
|
|
850672
850673
|
...common,
|
|
850673
850674
|
family: tr3.family,
|
|
850674
850675
|
tag: tr3.tag,
|
|
850675
|
-
fees: tr3.fees ? new
|
|
850676
|
+
fees: tr3.fees ? new import_bignumber399.BigNumber(tr3.fees) : null,
|
|
850676
850677
|
feeCustomUnit: tr3.feeCustomUnit,
|
|
850677
850678
|
// FIXME remove this field. this is not good.. we're dereferencing here. we should instead store an index (to lookup in currency.units on UI)
|
|
850678
850679
|
networkInfo: networkInfo && {
|
|
850679
850680
|
family: networkInfo.family,
|
|
850680
|
-
serverFee: new
|
|
850681
|
-
baseReserve: new
|
|
850681
|
+
serverFee: new import_bignumber399.BigNumber(networkInfo.serverFee),
|
|
850682
|
+
baseReserve: new import_bignumber399.BigNumber(networkInfo.baseReserve)
|
|
850682
850683
|
}
|
|
850683
850684
|
};
|
|
850684
850685
|
};
|
|
@@ -850709,7 +850710,7 @@ var transaction_default26 = {
|
|
|
850709
850710
|
};
|
|
850710
850711
|
|
|
850711
850712
|
// ../../libs/coin-modules/coin-sui/lib-es/bridge/transaction.js
|
|
850712
|
-
var
|
|
850713
|
+
var import_bignumber400 = require("bignumber.js");
|
|
850713
850714
|
var formatTransaction26 = (transaction, account3) => {
|
|
850714
850715
|
const { mode, amount, recipient, useAllAmount } = transaction;
|
|
850715
850716
|
return `
|
|
@@ -850729,7 +850730,7 @@ var fromTransactionRaw26 = (transaction) => {
|
|
|
850729
850730
|
family: transaction.family,
|
|
850730
850731
|
mode: transaction.mode,
|
|
850731
850732
|
coinType: transaction.coinType,
|
|
850732
|
-
fees: transaction.fees ? (0,
|
|
850733
|
+
fees: transaction.fees ? (0, import_bignumber400.BigNumber)(transaction.fees) : null,
|
|
850733
850734
|
errors: {}
|
|
850734
850735
|
};
|
|
850735
850736
|
};
|
|
@@ -850753,7 +850754,7 @@ var transaction_default27 = {
|
|
|
850753
850754
|
};
|
|
850754
850755
|
|
|
850755
850756
|
// ../../libs/coin-modules/coin-mina/lib-es/bridge/transaction.js
|
|
850756
|
-
var
|
|
850757
|
+
var import_bignumber401 = __toESM(require("bignumber.js"));
|
|
850757
850758
|
var formatTransaction27 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
850758
850759
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850759
850760
|
showCode: true,
|
|
@@ -850766,10 +850767,10 @@ var fromTransactionRaw27 = (tr3) => {
|
|
|
850766
850767
|
...common,
|
|
850767
850768
|
family: tr3.family,
|
|
850768
850769
|
fees: {
|
|
850769
|
-
fee: new
|
|
850770
|
-
accountCreationFee: new
|
|
850770
|
+
fee: new import_bignumber401.default(tr3.fees.fee),
|
|
850771
|
+
accountCreationFee: new import_bignumber401.default(tr3.fees.accountCreationFee)
|
|
850771
850772
|
},
|
|
850772
|
-
amount: new
|
|
850773
|
+
amount: new import_bignumber401.default(tr3.amount),
|
|
850773
850774
|
memo: tr3.memo,
|
|
850774
850775
|
nonce: tr3.nonce
|
|
850775
850776
|
};
|
|
@@ -853639,7 +853640,7 @@ var import_rxjs163 = require("rxjs");
|
|
|
853639
853640
|
// ../../libs/ledger-live-common/lib-es/bot/index.js
|
|
853640
853641
|
var import_fs3 = __toESM(require("fs"));
|
|
853641
853642
|
var import_path3 = __toESM(require("path"));
|
|
853642
|
-
var
|
|
853643
|
+
var import_bignumber426 = require("bignumber.js");
|
|
853643
853644
|
var import_uniq2 = __toESM(require("lodash/uniq"));
|
|
853644
853645
|
var import_groupBy6 = __toESM(require("lodash/groupBy"));
|
|
853645
853646
|
init_lib_es2();
|
|
@@ -853648,7 +853649,7 @@ var import_flatMap26 = __toESM(require("lodash/flatMap"));
|
|
|
853648
853649
|
|
|
853649
853650
|
// ../../libs/coin-framework/lib-es/bot/specs.js
|
|
853650
853651
|
init_lib_es2();
|
|
853651
|
-
var
|
|
853652
|
+
var import_bignumber402 = __toESM(require("bignumber.js"));
|
|
853652
853653
|
var import_expect = __toESM(require_build20());
|
|
853653
853654
|
var import_invariant73 = __toESM(require("invariant"));
|
|
853654
853655
|
var import_sample2 = __toESM(require("lodash/sample"));
|
|
@@ -853764,7 +853765,7 @@ function formatDeviceAmount(currency25, value5, options24 = defaultFormatOptions
|
|
|
853764
853765
|
if (deviceTicker)
|
|
853765
853766
|
code = deviceTicker;
|
|
853766
853767
|
}
|
|
853767
|
-
const fValue = value5.div(new
|
|
853768
|
+
const fValue = value5.div(new import_bignumber402.default(10).pow(unit.magnitude));
|
|
853768
853769
|
let v34 = options24.showAllDigits ? fValue.toFixed(unit.magnitude) : fValue.toString(10);
|
|
853769
853770
|
if (options24.forceFloating) {
|
|
853770
853771
|
if (!v34.includes(".")) {
|
|
@@ -853776,8 +853777,8 @@ function formatDeviceAmount(currency25, value5, options24 = defaultFormatOptions
|
|
|
853776
853777
|
return options24.postfixCode ? v34 + sep + code : code + sep + v34;
|
|
853777
853778
|
}
|
|
853778
853779
|
function expectSiblingsHaveSpendablePartGreaterThan(siblings, threshold) {
|
|
853779
|
-
const spendableTotal = siblings.reduce((acc, a64) => acc.plus(a64.spendableBalance), new
|
|
853780
|
-
const total = siblings.reduce((acc, a64) => acc.plus(a64.balance), new
|
|
853780
|
+
const spendableTotal = siblings.reduce((acc, a64) => acc.plus(a64.spendableBalance), new import_bignumber402.default(0));
|
|
853781
|
+
const total = siblings.reduce((acc, a64) => acc.plus(a64.balance), new import_bignumber402.default(0));
|
|
853781
853782
|
(0, import_invariant73.default)(spendableTotal.div(total).gt(threshold), "the spendable part of accounts is sufficient (threshold: %s)", threshold);
|
|
853782
853783
|
}
|
|
853783
853784
|
var genericTestDestination = ({ destination, operation, destinationBeforeTransaction, sendingOperation }) => {
|
|
@@ -853794,7 +853795,7 @@ var genericTestDestination = ({ destination, operation, destinationBeforeTransac
|
|
|
853794
853795
|
|
|
853795
853796
|
// ../../libs/coin-modules/coin-algorand/lib-es/specs.js
|
|
853796
853797
|
init_lib_es4();
|
|
853797
|
-
var
|
|
853798
|
+
var import_bignumber403 = require("bignumber.js");
|
|
853798
853799
|
var import_expect2 = __toESM(require_build20());
|
|
853799
853800
|
var import_invariant74 = __toESM(require("invariant"));
|
|
853800
853801
|
var import_sample3 = __toESM(require("lodash/sample"));
|
|
@@ -854029,7 +854030,7 @@ var algorand = {
|
|
|
854029
854030
|
feature: "tokens",
|
|
854030
854031
|
maxRun: 1,
|
|
854031
854032
|
transaction: ({ account: account3, bridge: bridge28, maxSpendable }) => {
|
|
854032
|
-
(0, import_invariant74.default)(maxSpendable.gt(new
|
|
854033
|
+
(0, import_invariant74.default)(maxSpendable.gt(new import_bignumber403.BigNumber(1e5)), "Spendable balance is too low");
|
|
854033
854034
|
const transaction = bridge28.createTransaction(account3);
|
|
854034
854035
|
const mode = "optIn";
|
|
854035
854036
|
const assetId = getRandomAssetId(account3);
|
|
@@ -854089,7 +854090,7 @@ var specs_default = {
|
|
|
854089
854090
|
var import_invariant75 = __toESM(require("invariant"));
|
|
854090
854091
|
var import_expect3 = __toESM(require_build20());
|
|
854091
854092
|
init_lib_es4();
|
|
854092
|
-
var
|
|
854093
|
+
var import_bignumber404 = __toESM(require("bignumber.js"));
|
|
854093
854094
|
|
|
854094
854095
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/speculos-deviceActions.js
|
|
854095
854096
|
var acceptTransaction2 = deviceActionFlow({
|
|
@@ -854166,7 +854167,7 @@ var acceptTokenTransaction = deviceActionFlow({
|
|
|
854166
854167
|
});
|
|
854167
854168
|
|
|
854168
854169
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/bot-specs.js
|
|
854169
|
-
var MIN_SAFE = new
|
|
854170
|
+
var MIN_SAFE = new import_bignumber404.default(1e-4);
|
|
854170
854171
|
var maxAccount = 6;
|
|
854171
854172
|
var aptosSpecs = {
|
|
854172
854173
|
name: "Aptos",
|
|
@@ -854278,7 +854279,7 @@ var bot_specs_default = {
|
|
|
854278
854279
|
|
|
854279
854280
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/specs.js
|
|
854280
854281
|
var import_expect4 = __toESM(require_build20());
|
|
854281
|
-
var
|
|
854282
|
+
var import_bignumber405 = require("bignumber.js");
|
|
854282
854283
|
var import_invariant76 = __toESM(require("invariant"));
|
|
854283
854284
|
var import_bchaddrjs2 = __toESM(require_bchaddr());
|
|
854284
854285
|
var import_sample4 = __toESM(require("lodash/sample"));
|
|
@@ -854374,7 +854375,7 @@ var genericTest = ({ operation, account: account3, transaction, status, accountB
|
|
|
854374
854375
|
botTest("picked utxo has been consumed", () => (0, import_expect4.default)(utxosPicked.filter((utxo) => utxo && utxo.blockHeight && getUTXOStatus(utxo, transaction.utxoStrategy).excluded)).toEqual([]));
|
|
854375
854376
|
};
|
|
854376
854377
|
var testDestination = genericTestDestination;
|
|
854377
|
-
var genericMinimalAmount = new
|
|
854378
|
+
var genericMinimalAmount = new import_bignumber405.BigNumber(15e3);
|
|
854378
854379
|
var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmount, targetAccountSize = 3, recipientVariation = (recipient) => recipient } = {}) => [
|
|
854379
854380
|
{
|
|
854380
854381
|
name: "move ~50%",
|
|
@@ -854387,7 +854388,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854387
854388
|
const amount = maxSpendable.div(1.9 + 0.2 * Math.random()).integerValue();
|
|
854388
854389
|
const transaction = {
|
|
854389
854390
|
...bridge28.createTransaction(account3),
|
|
854390
|
-
feePerByte: new
|
|
854391
|
+
feePerByte: new import_bignumber405.BigNumber(1e-4)
|
|
854391
854392
|
};
|
|
854392
854393
|
const updates7 = [
|
|
854393
854394
|
{
|
|
@@ -854419,7 +854420,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854419
854420
|
const sibling = pickSiblings(siblings, targetAccountSize);
|
|
854420
854421
|
const transaction = {
|
|
854421
854422
|
...bridge28.createTransaction(account3),
|
|
854422
|
-
feePerByte: new
|
|
854423
|
+
feePerByte: new import_bignumber405.BigNumber(1e-4)
|
|
854423
854424
|
};
|
|
854424
854425
|
const updates7 = [
|
|
854425
854426
|
{
|
|
@@ -854454,7 +854455,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854454
854455
|
(0, import_invariant76.default)(bitcoinResources, "bitcoin resources");
|
|
854455
854456
|
const transaction = {
|
|
854456
854457
|
...bridge28.createTransaction(account3),
|
|
854457
|
-
feePerByte: new
|
|
854458
|
+
feePerByte: new import_bignumber405.BigNumber(1e-4)
|
|
854458
854459
|
};
|
|
854459
854460
|
const utxo = (0, import_sample4.default)(bitcoinResources.utxos.filter((u51) => u51.blockHeight && u51.value.gt(genericMinimalAmount)));
|
|
854460
854461
|
(0, import_invariant76.default)(utxo, "no confirmed utxo");
|
|
@@ -854507,7 +854508,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854507
854508
|
(0, import_invariant76.default)(bitcoinResources, "bitcoin resources");
|
|
854508
854509
|
const transaction = {
|
|
854509
854510
|
...bridge28.createTransaction(account3),
|
|
854510
|
-
feePerByte: new
|
|
854511
|
+
feePerByte: new import_bignumber405.BigNumber(1e-4),
|
|
854511
854512
|
opReturnData: Buffer.from("charley loves heidi", "utf-8")
|
|
854512
854513
|
};
|
|
854513
854514
|
return {
|
|
@@ -854538,7 +854539,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854538
854539
|
const recipient = recipientVariation(sibling.freshAddress);
|
|
854539
854540
|
const transaction = {
|
|
854540
854541
|
...bridge28.createTransaction(account3),
|
|
854541
|
-
feePerByte: new
|
|
854542
|
+
feePerByte: new import_bignumber405.BigNumber(0)
|
|
854542
854543
|
};
|
|
854543
854544
|
return {
|
|
854544
854545
|
transaction,
|
|
@@ -854560,7 +854561,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
854560
854561
|
},
|
|
854561
854562
|
testDestination,
|
|
854562
854563
|
test: ({ account: account3 }) => {
|
|
854563
|
-
botTest("total of utxos is zero", () => (0, import_expect4.default)(account3.bitcoinResources?.utxos.filter((u51) => u51.blockHeight && u51.blockHeight < account3.blockHeight - 10).reduce((p62, c58) => p62.plus(c58.value), new
|
|
854564
|
+
botTest("total of utxos is zero", () => (0, import_expect4.default)(account3.bitcoinResources?.utxos.filter((u51) => u51.blockHeight && u51.blockHeight < account3.blockHeight - 10).reduce((p62, c58) => p62.plus(c58.value), new import_bignumber405.BigNumber(0)).toString()).toBe("0"));
|
|
854564
854565
|
}
|
|
854565
854566
|
}
|
|
854566
854567
|
];
|
|
@@ -854803,7 +854804,7 @@ var specs_default2 = {
|
|
|
854803
854804
|
// ../../libs/coin-modules/coin-cardano/lib-es/specs.js
|
|
854804
854805
|
var import_expect5 = __toESM(require_build20());
|
|
854805
854806
|
init_lib_es4();
|
|
854806
|
-
var
|
|
854807
|
+
var import_bignumber406 = __toESM(require("bignumber.js"));
|
|
854807
854808
|
var import_invariant77 = __toESM(require("invariant"));
|
|
854808
854809
|
var import_typhonjs13 = __toESM(require_dist6());
|
|
854809
854810
|
|
|
@@ -854966,7 +854967,7 @@ var cardano = {
|
|
|
854966
854967
|
{ subAccountId: subAccount.id },
|
|
854967
854968
|
{ recipient },
|
|
854968
854969
|
{
|
|
854969
|
-
amount: new
|
|
854970
|
+
amount: new import_bignumber406.default(subAccount.balance.dividedBy(10)).dp(0, import_bignumber406.default.ROUND_CEIL)
|
|
854970
854971
|
}
|
|
854971
854972
|
];
|
|
854972
854973
|
return {
|
|
@@ -854994,7 +854995,7 @@ var cardano = {
|
|
|
854994
854995
|
const updates7 = [
|
|
854995
854996
|
{ recipient },
|
|
854996
854997
|
{
|
|
854997
|
-
amount: new
|
|
854998
|
+
amount: new import_bignumber406.default(account3.balance.dividedBy(2)).dp(0, import_bignumber406.default.ROUND_CEIL)
|
|
854998
854999
|
},
|
|
854999
855000
|
{ memo: "LedgerLiveBot" }
|
|
855000
855001
|
];
|
|
@@ -855009,7 +855010,7 @@ var cardano = {
|
|
|
855009
855010
|
memo: transaction.memo
|
|
855010
855011
|
};
|
|
855011
855012
|
if (cardanoResources.delegation?.rewards.gt(0)) {
|
|
855012
|
-
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new
|
|
855013
|
+
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new import_bignumber406.default(cardanoResources.delegation.rewards), {
|
|
855013
855014
|
showCode: true,
|
|
855014
855015
|
disableRounding: true
|
|
855015
855016
|
});
|
|
@@ -855041,9 +855042,9 @@ var cardano = {
|
|
|
855041
855042
|
const changeAddress = import_typhonjs13.utils.getAddressFromString(account3.freshAddress);
|
|
855042
855043
|
const requiredAdaForChangeTokens = tokenBalance.length ? import_typhonjs13.utils.calculateMinUtxoAmountBabbage({
|
|
855043
855044
|
address: changeAddress,
|
|
855044
|
-
amount: new
|
|
855045
|
+
amount: new import_bignumber406.default(CARDANO_MAX_SUPPLY),
|
|
855045
855046
|
tokens: tokenBalance
|
|
855046
|
-
}, new
|
|
855047
|
+
}, new import_bignumber406.default(cardanoResources.protocolParams.utxoCostPerByte)) : new import_bignumber406.default(0);
|
|
855047
855048
|
botTest("remaining balance equals requiredAdaForTokens)", () => (0, import_expect5.default)(account3.balance).toEqual(requiredAdaForChangeTokens));
|
|
855048
855049
|
}
|
|
855049
855050
|
},
|
|
@@ -855139,7 +855140,7 @@ var specs_default3 = { cardano };
|
|
|
855139
855140
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
855140
855141
|
var import_invariant78 = __toESM(require("invariant"));
|
|
855141
855142
|
init_lib_es4();
|
|
855142
|
-
var
|
|
855143
|
+
var import_bignumber407 = __toESM(require("bignumber.js"));
|
|
855143
855144
|
var import_expect6 = __toESM(require_build20());
|
|
855144
855145
|
|
|
855145
855146
|
// ../../libs/coin-modules/coin-casper/lib-es/test/speculos-deviceActions.js
|
|
@@ -855192,7 +855193,7 @@ var acceptTransaction5 = deviceActionFlow({
|
|
|
855192
855193
|
});
|
|
855193
855194
|
|
|
855194
855195
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
855195
|
-
var MIN_SAFE2 = new
|
|
855196
|
+
var MIN_SAFE2 = new import_bignumber407.default(CASPER_MINIMUM_VALID_AMOUNT_MOTES * 2);
|
|
855196
855197
|
var maxAccount2 = 6;
|
|
855197
855198
|
var casperSpecs = {
|
|
855198
855199
|
name: "Casper",
|
|
@@ -855361,7 +855362,7 @@ var createLockMutation = () => ({
|
|
|
855361
855362
|
|
|
855362
855363
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createUnlockMutation.js
|
|
855363
855364
|
var import_invariant81 = __toESM(require("invariant"));
|
|
855364
|
-
var
|
|
855365
|
+
var import_bignumber408 = __toESM(require("bignumber.js"));
|
|
855365
855366
|
var currency11 = getCryptoCurrencyById("celo");
|
|
855366
855367
|
var minimalAmount3 = parseCurrencyUnit(currency11.units[0], "0.001");
|
|
855367
855368
|
var createUnlockMutation = () => ({
|
|
@@ -855372,7 +855373,7 @@ var createUnlockMutation = () => ({
|
|
|
855372
855373
|
(0, import_invariant81.default)(maxSpendable.gt(minimalAmount3), "Celo: Unlock | balance is too low");
|
|
855373
855374
|
const { celoResources } = account3;
|
|
855374
855375
|
(0, import_invariant81.default)(celoResources?.registrationStatus, "Celo: Unlock | Account is not registered");
|
|
855375
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
855376
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber408.default(0);
|
|
855376
855377
|
(0, import_invariant81.default)(nonvotingLockedBalance.gt(0), "Celo: Unlock | No non voting locked balance");
|
|
855377
855378
|
return {
|
|
855378
855379
|
transaction: bridge28.createTransaction(account3),
|
|
@@ -855413,7 +855414,7 @@ var createRegisterAccountMutation = () => ({
|
|
|
855413
855414
|
|
|
855414
855415
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createVoteMutation.js
|
|
855415
855416
|
var import_invariant83 = __toESM(require("invariant"));
|
|
855416
|
-
var
|
|
855417
|
+
var import_bignumber409 = __toESM(require("bignumber.js"));
|
|
855417
855418
|
var import_sampleSize = __toESM(require("lodash/sampleSize"));
|
|
855418
855419
|
var currency13 = getCryptoCurrencyById("celo");
|
|
855419
855420
|
var minimalAmount5 = parseCurrencyUnit(currency13.units[0], "0.001");
|
|
@@ -855425,7 +855426,7 @@ var createVoteMutation = () => ({
|
|
|
855425
855426
|
(0, import_invariant83.default)(maxSpendable.gt(minimalAmount5), "Celo: Vote | balance is too low");
|
|
855426
855427
|
const { celoResources } = account3;
|
|
855427
855428
|
(0, import_invariant83.default)(celoResources?.registrationStatus, "Celo: Vote | Account is not registered");
|
|
855428
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
855429
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber409.default(0);
|
|
855429
855430
|
(0, import_invariant83.default)(nonvotingLockedBalance.gt(0), "Celo: Vote | No non voting locked balance");
|
|
855430
855431
|
const votes2 = celoResources.votes || [];
|
|
855431
855432
|
const { validatorGroups } = getCurrentCeloPreloadData();
|
|
@@ -855628,7 +855629,7 @@ var bot_specs_default3 = {
|
|
|
855628
855629
|
};
|
|
855629
855630
|
|
|
855630
855631
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
855631
|
-
var
|
|
855632
|
+
var import_bignumber410 = require("bignumber.js");
|
|
855632
855633
|
var import_expect7 = __toESM(require_build20());
|
|
855633
855634
|
var import_invariant87 = __toESM(require("invariant"));
|
|
855634
855635
|
var import_sample5 = __toESM(require("lodash/sample"));
|
|
@@ -855747,12 +855748,12 @@ var acceptTransaction7 = deviceActionFlow({
|
|
|
855747
855748
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
855748
855749
|
var maxAccounts2 = 16;
|
|
855749
855750
|
function checkAmountsCloseEnough(amount1, amount2) {
|
|
855750
|
-
amount1 = new
|
|
855751
|
-
amount2 = new
|
|
855751
|
+
amount1 = new import_bignumber410.BigNumber(amount1);
|
|
855752
|
+
amount2 = new import_bignumber410.BigNumber(amount2);
|
|
855752
855753
|
(0, import_expect7.default)(amount1.isNegative()).toBe(false);
|
|
855753
855754
|
(0, import_expect7.default)(amount2.isNegative()).toBe(false);
|
|
855754
855755
|
const difference = amount1.minus(amount2).absoluteValue();
|
|
855755
|
-
const onePercentOfLargerNumber =
|
|
855756
|
+
const onePercentOfLargerNumber = import_bignumber410.BigNumber.max(amount1, amount2).multipliedBy(0.01);
|
|
855756
855757
|
const isCloseEnough = difference.isLessThan(onePercentOfLargerNumber);
|
|
855757
855758
|
if (!isCloseEnough) {
|
|
855758
855759
|
log2("bot", "delegation amounts do not match", `Amount1: ${amount1.toString()} , Amount2: ${amount2.toString()}`);
|
|
@@ -856062,14 +856063,14 @@ var generateGenericCosmosTest = (currencyId, isExpertModeRequired, config4) => {
|
|
|
856062
856063
|
...config4
|
|
856063
856064
|
};
|
|
856064
856065
|
};
|
|
856065
|
-
var cosmosMinimalTransactionAmount = new
|
|
856066
|
+
var cosmosMinimalTransactionAmount = new import_bignumber410.BigNumber(5e3);
|
|
856066
856067
|
var cosmos2 = {
|
|
856067
856068
|
...generateGenericCosmosTest("cosmos", false, {
|
|
856068
856069
|
minViableAmount: cosmosMinimalTransactionAmount,
|
|
856069
856070
|
mutations: cosmosLikeMutations(cosmosMinimalTransactionAmount)
|
|
856070
856071
|
})
|
|
856071
856072
|
};
|
|
856072
|
-
var osmosisMinimalTransactionAmount = new
|
|
856073
|
+
var osmosisMinimalTransactionAmount = new import_bignumber410.BigNumber(5e3);
|
|
856073
856074
|
var osmosis = {
|
|
856074
856075
|
...generateGenericCosmosTest("osmosis", false, {
|
|
856075
856076
|
minViableAmount: osmosisMinimalTransactionAmount,
|
|
@@ -856077,7 +856078,7 @@ var osmosis = {
|
|
|
856077
856078
|
testTimeout: 8 * 60 * 1e3
|
|
856078
856079
|
})
|
|
856079
856080
|
};
|
|
856080
|
-
var desmosMinimalTransactionAmount = new
|
|
856081
|
+
var desmosMinimalTransactionAmount = new import_bignumber410.BigNumber(500);
|
|
856081
856082
|
var desmos = {
|
|
856082
856083
|
...generateGenericCosmosTest("desmos", false, {
|
|
856083
856084
|
minViableAmount: desmosMinimalTransactionAmount,
|
|
@@ -856086,7 +856087,7 @@ var desmos = {
|
|
|
856086
856087
|
skipOperationHistory: true
|
|
856087
856088
|
})
|
|
856088
856089
|
};
|
|
856089
|
-
var dydxMinimalTransactionAmount = new
|
|
856090
|
+
var dydxMinimalTransactionAmount = new import_bignumber410.BigNumber(500);
|
|
856090
856091
|
var dydx = {
|
|
856091
856092
|
...generateGenericCosmosTest("dydx", false, {
|
|
856092
856093
|
minViableAmount: dydxMinimalTransactionAmount,
|
|
@@ -856095,7 +856096,7 @@ var dydx = {
|
|
|
856095
856096
|
skipOperationHistory: true
|
|
856096
856097
|
})
|
|
856097
856098
|
};
|
|
856098
|
-
var umeeMinimalTransactionAmount = new
|
|
856099
|
+
var umeeMinimalTransactionAmount = new import_bignumber410.BigNumber(15e3);
|
|
856099
856100
|
var umee = {
|
|
856100
856101
|
...generateGenericCosmosTest("umee", false, {
|
|
856101
856102
|
minViableAmount: umeeMinimalTransactionAmount,
|
|
@@ -856104,7 +856105,7 @@ var umee = {
|
|
|
856104
856105
|
skipOperationHistory: true
|
|
856105
856106
|
})
|
|
856106
856107
|
};
|
|
856107
|
-
var persistenceMinimalTransactionAmount = new
|
|
856108
|
+
var persistenceMinimalTransactionAmount = new import_bignumber410.BigNumber(5e3);
|
|
856108
856109
|
var persistence = {
|
|
856109
856110
|
...generateGenericCosmosTest("persistence", false, {
|
|
856110
856111
|
minViableAmount: persistenceMinimalTransactionAmount,
|
|
@@ -856113,7 +856114,7 @@ var persistence = {
|
|
|
856113
856114
|
skipOperationHistory: true
|
|
856114
856115
|
})
|
|
856115
856116
|
};
|
|
856116
|
-
var quicksilverMinimalTransactionAmount = new
|
|
856117
|
+
var quicksilverMinimalTransactionAmount = new import_bignumber410.BigNumber(600);
|
|
856117
856118
|
var quicksilver = {
|
|
856118
856119
|
...generateGenericCosmosTest("quicksilver", false, {
|
|
856119
856120
|
minViableAmount: quicksilverMinimalTransactionAmount,
|
|
@@ -856122,7 +856123,7 @@ var quicksilver = {
|
|
|
856122
856123
|
skipOperationHistory: true
|
|
856123
856124
|
})
|
|
856124
856125
|
};
|
|
856125
|
-
var onomyMinimalTransactionAmount = new
|
|
856126
|
+
var onomyMinimalTransactionAmount = new import_bignumber410.BigNumber(5e3);
|
|
856126
856127
|
var onomy = {
|
|
856127
856128
|
...generateGenericCosmosTest("onomy", false, {
|
|
856128
856129
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -856131,7 +856132,7 @@ var onomy = {
|
|
|
856131
856132
|
skipOperationHistory: true
|
|
856132
856133
|
})
|
|
856133
856134
|
};
|
|
856134
|
-
var seiMinimalTransactionAmount = new
|
|
856135
|
+
var seiMinimalTransactionAmount = new import_bignumber410.BigNumber(5e3);
|
|
856135
856136
|
var sei = {
|
|
856136
856137
|
...generateGenericCosmosTest("sei_network", false, {
|
|
856137
856138
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -856140,7 +856141,7 @@ var sei = {
|
|
|
856140
856141
|
skipOperationHistory: true
|
|
856141
856142
|
})
|
|
856142
856143
|
};
|
|
856143
|
-
var axelarMinimalTransactionAmount = new
|
|
856144
|
+
var axelarMinimalTransactionAmount = new import_bignumber410.BigNumber(1e4);
|
|
856144
856145
|
var axelar = {
|
|
856145
856146
|
...generateGenericCosmosTest("axelar", false, {
|
|
856146
856147
|
minViableAmount: axelarMinimalTransactionAmount,
|
|
@@ -856148,7 +856149,7 @@ var axelar = {
|
|
|
856148
856149
|
skipOperationHistory: true
|
|
856149
856150
|
})
|
|
856150
856151
|
};
|
|
856151
|
-
var secretNetworkMinimalTransactionAmount = new
|
|
856152
|
+
var secretNetworkMinimalTransactionAmount = new import_bignumber410.BigNumber(6e4);
|
|
856152
856153
|
var secretNetwork = {
|
|
856153
856154
|
...generateGenericCosmosTest("secret_network", false, {
|
|
856154
856155
|
minViableAmount: secretNetworkMinimalTransactionAmount,
|
|
@@ -856156,7 +856157,7 @@ var secretNetwork = {
|
|
|
856156
856157
|
skipOperationHistory: true
|
|
856157
856158
|
})
|
|
856158
856159
|
};
|
|
856159
|
-
var stargazeMinimalTransactionAmount = new
|
|
856160
|
+
var stargazeMinimalTransactionAmount = new import_bignumber410.BigNumber(16e4);
|
|
856160
856161
|
var stargaze = {
|
|
856161
856162
|
...generateGenericCosmosTest("stargaze", false, {
|
|
856162
856163
|
minViableAmount: stargazeMinimalTransactionAmount,
|
|
@@ -856164,7 +856165,7 @@ var stargaze = {
|
|
|
856164
856165
|
skipOperationHistory: true
|
|
856165
856166
|
})
|
|
856166
856167
|
};
|
|
856167
|
-
var coreumMinimalTransactionAmount = new
|
|
856168
|
+
var coreumMinimalTransactionAmount = new import_bignumber410.BigNumber(2e4);
|
|
856168
856169
|
var coreum = {
|
|
856169
856170
|
...generateGenericCosmosTest("coreum", false, {
|
|
856170
856171
|
minViableAmount: coreumMinimalTransactionAmount,
|
|
@@ -856172,7 +856173,7 @@ var coreum = {
|
|
|
856172
856173
|
skipOperationHistory: true
|
|
856173
856174
|
})
|
|
856174
856175
|
};
|
|
856175
|
-
var injectiveMinimalTransactionAmount = new
|
|
856176
|
+
var injectiveMinimalTransactionAmount = new import_bignumber410.BigNumber(1e6);
|
|
856176
856177
|
var injective = {
|
|
856177
856178
|
...generateGenericCosmosTest("injective", true, {
|
|
856178
856179
|
minViableAmount: injectiveMinimalTransactionAmount,
|
|
@@ -856180,7 +856181,7 @@ var injective = {
|
|
|
856180
856181
|
skipOperationHistory: true
|
|
856181
856182
|
})
|
|
856182
856183
|
};
|
|
856183
|
-
var mantraMinimalTransactionAmount = new
|
|
856184
|
+
var mantraMinimalTransactionAmount = new import_bignumber410.BigNumber(2e4);
|
|
856184
856185
|
var mantra = {
|
|
856185
856186
|
...generateGenericCosmosTest("mantra", false, {
|
|
856186
856187
|
minViableAmount: mantraMinimalTransactionAmount,
|
|
@@ -856188,7 +856189,7 @@ var mantra = {
|
|
|
856188
856189
|
skipOperationHistory: true
|
|
856189
856190
|
})
|
|
856190
856191
|
};
|
|
856191
|
-
var cryptoOrgMinimalTransactionAmount = new
|
|
856192
|
+
var cryptoOrgMinimalTransactionAmount = new import_bignumber410.BigNumber(1e6);
|
|
856192
856193
|
var cryptoOrg = {
|
|
856193
856194
|
...generateGenericCosmosTest("crypto_org", false, {
|
|
856194
856195
|
minViableAmount: cryptoOrgMinimalTransactionAmount,
|
|
@@ -856197,7 +856198,7 @@ var cryptoOrg = {
|
|
|
856197
856198
|
skipOperationHistory: true
|
|
856198
856199
|
})
|
|
856199
856200
|
};
|
|
856200
|
-
var xionMinimalTransactionAmount = new
|
|
856201
|
+
var xionMinimalTransactionAmount = new import_bignumber410.BigNumber(2e4);
|
|
856201
856202
|
var xion = {
|
|
856202
856203
|
...generateGenericCosmosTest("xion", false, {
|
|
856203
856204
|
minViableAmount: xionMinimalTransactionAmount,
|
|
@@ -856205,7 +856206,7 @@ var xion = {
|
|
|
856205
856206
|
skipOperationHistory: true
|
|
856206
856207
|
})
|
|
856207
856208
|
};
|
|
856208
|
-
var zenrockMinimalTransactionAmount = new
|
|
856209
|
+
var zenrockMinimalTransactionAmount = new import_bignumber410.BigNumber(2e4);
|
|
856209
856210
|
var zenrock = {
|
|
856210
856211
|
...generateGenericCosmosTest("zenrock", false, {
|
|
856211
856212
|
minViableAmount: zenrockMinimalTransactionAmount,
|
|
@@ -856213,7 +856214,7 @@ var zenrock = {
|
|
|
856213
856214
|
skipOperationHistory: true
|
|
856214
856215
|
})
|
|
856215
856216
|
};
|
|
856216
|
-
var babylonMinimalTransactionAmount = new
|
|
856217
|
+
var babylonMinimalTransactionAmount = new import_bignumber410.BigNumber(2e4);
|
|
856217
856218
|
var babylon = {
|
|
856218
856219
|
...generateGenericCosmosTest("babylon", false, {
|
|
856219
856220
|
minViableAmount: babylonMinimalTransactionAmount,
|
|
@@ -856247,7 +856248,7 @@ var specs_default4 = {
|
|
|
856247
856248
|
var import_expect8 = __toESM(require_build20());
|
|
856248
856249
|
var import_invariant88 = __toESM(require("invariant"));
|
|
856249
856250
|
var import_sample6 = __toESM(require("lodash/sample"));
|
|
856250
|
-
var
|
|
856251
|
+
var import_bignumber411 = __toESM(require("bignumber.js"));
|
|
856251
856252
|
init_lib_es4();
|
|
856252
856253
|
|
|
856253
856254
|
// ../../libs/coin-modules/coin-evm/lib-es/speculos-deviceActions.js
|
|
@@ -856413,7 +856414,7 @@ var testTokenDestination = (args3) => {
|
|
|
856413
856414
|
(0, import_expect8.default)(destination).toBeDefined();
|
|
856414
856415
|
});
|
|
856415
856416
|
const destinationBeforeTransaction = findSubAccountById(coinDestinationBeforeTransaction, operation.accountId);
|
|
856416
|
-
botTest("account balance increased with transaction amount", () => (0, import_expect8.default)(destination.balance.toString()).toBe((destinationBeforeTransaction?.balance || new
|
|
856417
|
+
botTest("account balance increased with transaction amount", () => (0, import_expect8.default)(destination.balance.toString()).toBe((destinationBeforeTransaction?.balance || new import_bignumber411.default(0)).plus(amount).toString()));
|
|
856417
856418
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect8.default)({
|
|
856418
856419
|
type: operation.type,
|
|
856419
856420
|
amount: operation.value.toString()
|
|
@@ -856790,7 +856791,7 @@ var bot_specs_default4 = { hedera };
|
|
|
856790
856791
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
856791
856792
|
var import_invariant91 = __toESM(require("invariant"));
|
|
856792
856793
|
init_lib_es4();
|
|
856793
|
-
var
|
|
856794
|
+
var import_bignumber412 = __toESM(require("bignumber.js"));
|
|
856794
856795
|
|
|
856795
856796
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/speculos-deviceActions.js
|
|
856796
856797
|
var import_invariant90 = __toESM(require("invariant"));
|
|
@@ -856936,7 +856937,7 @@ var generateDeviceActionFlow = (scenario) => {
|
|
|
856936
856937
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
856937
856938
|
var F4_RECIPIENT = "f410fncojwmrseefktoco6rcnb3zv2eiqfli7muhvqma";
|
|
856938
856939
|
var ETH_RECIPIENT = "0x689c9b3232210aa9b84ef444d0ef35d11102ad1f";
|
|
856939
|
-
var MIN_SAFE3 = new
|
|
856940
|
+
var MIN_SAFE3 = new import_bignumber412.default(1e5);
|
|
856940
856941
|
var maxAccount4 = 6;
|
|
856941
856942
|
var filecoinSpecs = {
|
|
856942
856943
|
name: "Filecoin",
|
|
@@ -856961,7 +856962,7 @@ var filecoinSpecs = {
|
|
|
856961
856962
|
deviceAction: generateDeviceActionFlow(BotScenario.F4_RECIPIENT),
|
|
856962
856963
|
testDestination: genericTestDestination,
|
|
856963
856964
|
transaction: ({ account: account3, bridge: bridge28 }) => {
|
|
856964
|
-
const amount = new
|
|
856965
|
+
const amount = new import_bignumber412.default("100");
|
|
856965
856966
|
return {
|
|
856966
856967
|
transaction: bridge28.createTransaction(account3),
|
|
856967
856968
|
updates: [
|
|
@@ -856982,7 +856983,7 @@ var filecoinSpecs = {
|
|
|
856982
856983
|
deviceAction: generateDeviceActionFlow(BotScenario.ETH_RECIPIENT),
|
|
856983
856984
|
testDestination: genericTestDestination,
|
|
856984
856985
|
transaction: ({ account: account3, bridge: bridge28 }) => {
|
|
856985
|
-
const amount = new
|
|
856986
|
+
const amount = new import_bignumber412.default("100");
|
|
856986
856987
|
return {
|
|
856987
856988
|
transaction: bridge28.createTransaction(account3),
|
|
856988
856989
|
updates: [
|
|
@@ -857081,7 +857082,7 @@ var bot_specs_default5 = {
|
|
|
857081
857082
|
var import_invariant92 = __toESM(require("invariant"));
|
|
857082
857083
|
init_lib_es4();
|
|
857083
857084
|
var import_expect10 = __toESM(require_build20());
|
|
857084
|
-
var
|
|
857085
|
+
var import_bignumber413 = __toESM(require("bignumber.js"));
|
|
857085
857086
|
|
|
857086
857087
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/speculos-deviceActions.js
|
|
857087
857088
|
var ignoreSpaces = (s46) => s46.replace(/ /g, "");
|
|
@@ -857135,7 +857136,7 @@ var acceptTransaction10 = deviceActionFlow({
|
|
|
857135
857136
|
});
|
|
857136
857137
|
|
|
857137
857138
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/bot-specs.js
|
|
857138
|
-
var MIN_SAFE4 = new
|
|
857139
|
+
var MIN_SAFE4 = new import_bignumber413.default(10);
|
|
857139
857140
|
var maxAccount5 = 6;
|
|
857140
857141
|
var internetComputerSpecs = {
|
|
857141
857142
|
name: "InternetComputer",
|
|
@@ -857230,7 +857231,7 @@ var bot_specs_default6 = {
|
|
|
857230
857231
|
// ../../libs/coin-modules/coin-icon/lib-es/specs.js
|
|
857231
857232
|
var import_invariant93 = __toESM(require("invariant"));
|
|
857232
857233
|
init_lib_es4();
|
|
857233
|
-
var
|
|
857234
|
+
var import_bignumber414 = __toESM(require("bignumber.js"));
|
|
857234
857235
|
var import_expect11 = __toESM(require_build20());
|
|
857235
857236
|
|
|
857236
857237
|
// ../../libs/coin-modules/coin-icon/lib-es/speculos-deviceActions.js
|
|
@@ -857353,7 +857354,7 @@ var icon = {
|
|
|
857353
857354
|
};
|
|
857354
857355
|
},
|
|
857355
857356
|
test: ({ account: account3 }) => {
|
|
857356
|
-
botTest("account spendable balance is zero", () => expectedApproximate(account3.spendableBalance, new
|
|
857357
|
+
botTest("account spendable balance is zero", () => expectedApproximate(account3.spendableBalance, new import_bignumber414.default(0)));
|
|
857357
857358
|
}
|
|
857358
857359
|
}
|
|
857359
857360
|
]
|
|
@@ -857368,7 +857369,7 @@ init_lib_es4();
|
|
|
857368
857369
|
var import_expect12 = __toESM(require_build20());
|
|
857369
857370
|
|
|
857370
857371
|
// ../../libs/coin-modules/coin-multiversx/lib-es/speculos-deviceActions.js
|
|
857371
|
-
var
|
|
857372
|
+
var import_bignumber415 = __toESM(require("bignumber.js"));
|
|
857372
857373
|
var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
857373
857374
|
steps: [
|
|
857374
857375
|
{
|
|
@@ -857388,7 +857389,7 @@ var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
|
857388
857389
|
{
|
|
857389
857390
|
title: "Fee",
|
|
857390
857391
|
button: SpeculosButton2.RIGHT,
|
|
857391
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
857392
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber415.default(5e4), {
|
|
857392
857393
|
showCode: true,
|
|
857393
857394
|
disableRounding: true,
|
|
857394
857395
|
joinFragmentsSeparator: " "
|
|
@@ -857429,7 +857430,7 @@ var acceptDelegateTransaction = deviceActionFlow({
|
|
|
857429
857430
|
{
|
|
857430
857431
|
title: "Fee",
|
|
857431
857432
|
button: SpeculosButton2.RIGHT,
|
|
857432
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
857433
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber415.default(5e4), {
|
|
857433
857434
|
showCode: true,
|
|
857434
857435
|
disableRounding: true,
|
|
857435
857436
|
joinFragmentsSeparator: " "
|
|
@@ -857462,7 +857463,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
857462
857463
|
{
|
|
857463
857464
|
title: "Amount",
|
|
857464
857465
|
button: SpeculosButton2.RIGHT,
|
|
857465
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
857466
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber415.default(0), {
|
|
857466
857467
|
showCode: true,
|
|
857467
857468
|
disableRounding: true,
|
|
857468
857469
|
joinFragmentsSeparator: " "
|
|
@@ -857471,7 +857472,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
857471
857472
|
{
|
|
857472
857473
|
title: "Fee",
|
|
857473
857474
|
button: SpeculosButton2.RIGHT,
|
|
857474
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
857475
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber415.default(5e4), {
|
|
857475
857476
|
showCode: true,
|
|
857476
857477
|
disableRounding: true,
|
|
857477
857478
|
joinFragmentsSeparator: " "
|
|
@@ -857503,7 +857504,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
857503
857504
|
{
|
|
857504
857505
|
title: "Amount",
|
|
857505
857506
|
button: SpeculosButton2.RIGHT,
|
|
857506
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
857507
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber415.default(0), {
|
|
857507
857508
|
showCode: true,
|
|
857508
857509
|
disableRounding: true,
|
|
857509
857510
|
joinFragmentsSeparator: " "
|
|
@@ -857512,7 +857513,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
857512
857513
|
{
|
|
857513
857514
|
title: "Fee",
|
|
857514
857515
|
button: SpeculosButton2.RIGHT,
|
|
857515
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
857516
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber415.default(5e4), {
|
|
857516
857517
|
showCode: true,
|
|
857517
857518
|
disableRounding: true,
|
|
857518
857519
|
joinFragmentsSeparator: " "
|
|
@@ -857579,7 +857580,7 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
857579
857580
|
{
|
|
857580
857581
|
title: "Fee",
|
|
857581
857582
|
button: SpeculosButton2.RIGHT,
|
|
857582
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
857583
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber415.default(5e4), {
|
|
857583
857584
|
showCode: true,
|
|
857584
857585
|
disableRounding: true,
|
|
857585
857586
|
joinFragmentsSeparator: " "
|
|
@@ -857599,12 +857600,12 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
857599
857600
|
});
|
|
857600
857601
|
|
|
857601
857602
|
// ../../libs/coin-modules/coin-multiversx/lib-es/specs.js
|
|
857602
|
-
var
|
|
857603
|
+
var import_bignumber416 = __toESM(require("bignumber.js"));
|
|
857603
857604
|
var import_sample7 = __toESM(require("lodash/sample"));
|
|
857604
857605
|
var currency20 = getCryptoCurrencyById("elrond");
|
|
857605
857606
|
var minimalAmount9 = parseCurrencyUnit(currency20.units[0], "0.001");
|
|
857606
857607
|
var maxAccounts4 = 6;
|
|
857607
|
-
var MULTIVERSX_MIN_ACTIVATION_SAFE = new
|
|
857608
|
+
var MULTIVERSX_MIN_ACTIVATION_SAFE = new import_bignumber416.default(1e4);
|
|
857608
857609
|
var UNCAPPED_PROVIDER = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqlhllllsr0pd0j";
|
|
857609
857610
|
function expectCorrectBalanceChange(input) {
|
|
857610
857611
|
const { account: account3, operation, accountBeforeTransaction } = input;
|
|
@@ -857812,7 +857813,7 @@ var multiversx = {
|
|
|
857812
857813
|
transaction: ({ account: account3, bridge: bridge28 }) => {
|
|
857813
857814
|
const delegations = account3?.multiversxResources?.delegations;
|
|
857814
857815
|
(0, import_invariant94.default)(delegations?.length, "account doesn't have any delegations");
|
|
857815
|
-
(0, import_invariant94.default)(delegations.some((d56) => new
|
|
857816
|
+
(0, import_invariant94.default)(delegations.some((d56) => new import_bignumber416.default(d56.userActiveStake).gt(0)), "no active stake for account");
|
|
857816
857817
|
const amount = MIN_DELEGATION_AMOUNT;
|
|
857817
857818
|
return {
|
|
857818
857819
|
transaction: bridge28.createTransaction(account3),
|
|
@@ -857842,8 +857843,8 @@ var multiversx = {
|
|
|
857842
857843
|
// among all delegations
|
|
857843
857844
|
delegations.some((d56) => (
|
|
857844
857845
|
// among all undelegating amounts
|
|
857845
|
-
d56.userUndelegatedList?.some((u51) => new
|
|
857846
|
-
new
|
|
857846
|
+
d56.userUndelegatedList?.some((u51) => new import_bignumber416.default(u51.amount).gt(0) && // the undelegation has a positive amount
|
|
857847
|
+
new import_bignumber416.default(u51.seconds).eq(0))
|
|
857847
857848
|
)),
|
|
857848
857849
|
"no withdrawable stake for account"
|
|
857849
857850
|
);
|
|
@@ -857853,7 +857854,7 @@ var multiversx = {
|
|
|
857853
857854
|
{
|
|
857854
857855
|
recipient: UNCAPPED_PROVIDER,
|
|
857855
857856
|
mode: "withdraw",
|
|
857856
|
-
amount: new
|
|
857857
|
+
amount: new import_bignumber416.default(0)
|
|
857857
857858
|
}
|
|
857858
857859
|
]
|
|
857859
857860
|
};
|
|
@@ -857875,7 +857876,7 @@ var specs_default7 = {
|
|
|
857875
857876
|
// ../../libs/coin-modules/coin-near/lib-es/specs.js
|
|
857876
857877
|
var import_invariant95 = __toESM(require("invariant"));
|
|
857877
857878
|
var import_expect13 = __toESM(require_build20());
|
|
857878
|
-
var
|
|
857879
|
+
var import_bignumber417 = require("bignumber.js");
|
|
857879
857880
|
init_lib_es4();
|
|
857880
857881
|
|
|
857881
857882
|
// ../../libs/coin-modules/coin-near/lib-es/speculos-deviceActions.js
|
|
@@ -858023,7 +858024,7 @@ var near = {
|
|
|
858023
858024
|
transaction: ({ account: account3, bridge: bridge28, maxSpendable }) => {
|
|
858024
858025
|
(0, import_invariant95.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
858025
858026
|
const { nearResources } = account3;
|
|
858026
|
-
const staked = nearResources?.stakedBalance || new
|
|
858027
|
+
const staked = nearResources?.stakedBalance || new import_bignumber417.BigNumber(0);
|
|
858027
858028
|
(0, import_invariant95.default)(staked.gt(minimalAmount10), "staked balance is too low for unstaking");
|
|
858028
858029
|
const halfStaked = staked.div(2);
|
|
858029
858030
|
const amount = halfStaked.gt(minimalAmount10) ? halfStaked.integerValue() : staked.integerValue();
|
|
@@ -858045,7 +858046,7 @@ var near = {
|
|
|
858045
858046
|
transaction: ({ account: account3, bridge: bridge28, maxSpendable }) => {
|
|
858046
858047
|
(0, import_invariant95.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
858047
858048
|
const { nearResources } = account3;
|
|
858048
|
-
const available = nearResources?.availableBalance || new
|
|
858049
|
+
const available = nearResources?.availableBalance || new import_bignumber417.BigNumber(0);
|
|
858049
858050
|
(0, import_invariant95.default)(available.gt(minimalAmount10), "available balance is too low for withdrawing");
|
|
858050
858051
|
const halfAvailable = available.div(2);
|
|
858051
858052
|
const amount = halfAvailable.gt(minimalAmount10) ? halfAvailable.integerValue() : available.integerValue();
|
|
@@ -858070,7 +858071,7 @@ var specs_default8 = {
|
|
|
858070
858071
|
var import_expect14 = __toESM(require_build20());
|
|
858071
858072
|
var import_invariant96 = __toESM(require("invariant"));
|
|
858072
858073
|
var import_sampleSize3 = __toESM(require("lodash/sampleSize"));
|
|
858073
|
-
var
|
|
858074
|
+
var import_bignumber418 = require("bignumber.js");
|
|
858074
858075
|
init_lib_es4();
|
|
858075
858076
|
|
|
858076
858077
|
// ../../libs/coin-modules/coin-polkadot/lib-es/test/bot-deviceActions.js
|
|
@@ -858257,7 +858258,7 @@ var polkadot3 = {
|
|
|
858257
858258
|
} else {
|
|
858258
858259
|
(0, import_invariant96.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "cant cover fee + bonding amount");
|
|
858259
858260
|
options24.push({
|
|
858260
|
-
amount: new
|
|
858261
|
+
amount: new import_bignumber418.BigNumber(1e5)
|
|
858261
858262
|
});
|
|
858262
858263
|
}
|
|
858263
858264
|
return {
|
|
@@ -858303,7 +858304,7 @@ var polkadot3 = {
|
|
|
858303
858304
|
(0, import_invariant96.default)(polkadotResources, "polkadot");
|
|
858304
858305
|
(0, import_invariant96.default)(polkadotResources?.unlockingBalance.gt(MIN_LOCKED_BALANCE_REQ), "can't rebond");
|
|
858305
858306
|
(0, import_invariant96.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "can't cover fee");
|
|
858306
|
-
const amount =
|
|
858307
|
+
const amount = import_bignumber418.BigNumber.maximum(polkadotResources.unlockingBalance.times(0.2), MIN_LOCKED_BALANCE_REQ);
|
|
858307
858308
|
return {
|
|
858308
858309
|
transaction: bridge28.createTransaction(account3),
|
|
858309
858310
|
updates: [
|
|
@@ -858371,7 +858372,7 @@ var import_expect15 = __toESM(require_build20());
|
|
|
858371
858372
|
init_lib_es4();
|
|
858372
858373
|
|
|
858373
858374
|
// ../../libs/coin-modules/coin-solana/lib-es/speculos-deviceActions.js
|
|
858374
|
-
var
|
|
858375
|
+
var import_bignumber419 = __toESM(require("bignumber.js"));
|
|
858375
858376
|
function getMainCurrency(currency25) {
|
|
858376
858377
|
if (currency25.isTestnetFor !== void 0) {
|
|
858377
858378
|
return getCryptoCurrencyById(currency25.isTestnetFor);
|
|
@@ -858383,7 +858384,7 @@ function ellipsis(str) {
|
|
|
858383
858384
|
}
|
|
858384
858385
|
function formatAmount(c58, amount) {
|
|
858385
858386
|
const currency25 = c58.type === "CryptoCurrency" ? getMainCurrency(c58) : c58;
|
|
858386
|
-
return formatDeviceAmount(currency25, new
|
|
858387
|
+
return formatDeviceAmount(currency25, new import_bignumber419.default(amount), {
|
|
858387
858388
|
postfixCode: true
|
|
858388
858389
|
});
|
|
858389
858390
|
}
|
|
@@ -858734,7 +858735,7 @@ function throwUnexpectedTransaction() {
|
|
|
858734
858735
|
|
|
858735
858736
|
// ../../libs/coin-modules/coin-solana/lib-es/specs.js
|
|
858736
858737
|
var import_fp6 = require("lodash/fp");
|
|
858737
|
-
var
|
|
858738
|
+
var import_bignumber420 = __toESM(require("bignumber.js"));
|
|
858738
858739
|
var maxAccount7 = 9;
|
|
858739
858740
|
var solana = {
|
|
858740
858741
|
name: "Solana",
|
|
@@ -858788,7 +858789,7 @@ var solana = {
|
|
|
858788
858789
|
},
|
|
858789
858790
|
test: (input) => {
|
|
858790
858791
|
const { accountBeforeTransaction, account: account3, operation } = input;
|
|
858791
|
-
const estimatedMaxSpendable =
|
|
858792
|
+
const estimatedMaxSpendable = import_bignumber420.default.max(accountBeforeTransaction.spendableBalance.minus(SYSTEM_ACCOUNT_RENT_EXEMPT), 0).toNumber();
|
|
858792
858793
|
botTest("operation value should be estimated max spendable", () => (0, import_expect15.default)(operation.value.toNumber()).toBe(estimatedMaxSpendable));
|
|
858793
858794
|
botTest("account spendableBalance should be zero", () => (0, import_expect15.default)(account3.spendableBalance.toNumber()).toBe(0));
|
|
858794
858795
|
expectCorrectBalanceChange2(input);
|
|
@@ -858827,7 +858828,7 @@ var solana = {
|
|
|
858827
858828
|
}
|
|
858828
858829
|
},
|
|
858829
858830
|
{
|
|
858830
|
-
amount: new
|
|
858831
|
+
amount: new import_bignumber420.default(1e5)
|
|
858831
858832
|
}
|
|
858832
858833
|
]
|
|
858833
858834
|
};
|
|
@@ -859328,7 +859329,7 @@ var specs_default9 = {
|
|
|
859328
859329
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
859329
859330
|
var import_invariant98 = __toESM(require("invariant"));
|
|
859330
859331
|
init_lib_es4();
|
|
859331
|
-
var
|
|
859332
|
+
var import_bignumber421 = __toESM(require("bignumber.js"));
|
|
859332
859333
|
var import_expect16 = __toESM(require_build20());
|
|
859333
859334
|
|
|
859334
859335
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-deviceActions.js
|
|
@@ -859377,7 +859378,7 @@ var acceptTransaction14 = deviceActionFlow({
|
|
|
859377
859378
|
});
|
|
859378
859379
|
|
|
859379
859380
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
859380
|
-
var MIN_SAFE5 = new
|
|
859381
|
+
var MIN_SAFE5 = new import_bignumber421.default(1e4);
|
|
859381
859382
|
var stacksSpecs = {
|
|
859382
859383
|
name: "Stacks",
|
|
859383
859384
|
currency: getCryptoCurrencyById("stacks"),
|
|
@@ -859443,7 +859444,7 @@ var bot_specs_default8 = {
|
|
|
859443
859444
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-specs.js
|
|
859444
859445
|
var import_expect17 = __toESM(require_build20());
|
|
859445
859446
|
var import_invariant99 = __toESM(require("invariant"));
|
|
859446
|
-
var
|
|
859447
|
+
var import_bignumber422 = __toESM(require("bignumber.js"));
|
|
859447
859448
|
init_lib_es4();
|
|
859448
859449
|
|
|
859449
859450
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-deviceActions.js
|
|
@@ -859584,7 +859585,7 @@ var stellar = {
|
|
|
859584
859585
|
recipient,
|
|
859585
859586
|
// Setting higher max fee here to make sure transaction doesn't
|
|
859586
859587
|
// time out.
|
|
859587
|
-
fees: new
|
|
859588
|
+
fees: new import_bignumber422.default(MAX_FEE)
|
|
859588
859589
|
},
|
|
859589
859590
|
{
|
|
859590
859591
|
amount
|
|
@@ -859635,7 +859636,7 @@ var stellar = {
|
|
|
859635
859636
|
recipient,
|
|
859636
859637
|
// Setting higher max fee here to make sure transaction doesn't
|
|
859637
859638
|
// time out.
|
|
859638
|
-
fees: new
|
|
859639
|
+
fees: new import_bignumber422.default(MAX_FEE)
|
|
859639
859640
|
},
|
|
859640
859641
|
{
|
|
859641
859642
|
useAllAmount: true
|
|
@@ -859687,7 +859688,7 @@ var stellar = {
|
|
|
859687
859688
|
mode: "changeTrust",
|
|
859688
859689
|
// Setting higher max fee here to make sure transaction doesn't
|
|
859689
859690
|
// time out.
|
|
859690
|
-
fees: new
|
|
859691
|
+
fees: new import_bignumber422.default(MAX_FEE)
|
|
859691
859692
|
},
|
|
859692
859693
|
{
|
|
859693
859694
|
assetReference: USDC_CODE,
|
|
@@ -859733,7 +859734,7 @@ var stellar = {
|
|
|
859733
859734
|
amount,
|
|
859734
859735
|
// Setting higher max fee here to make sure transaction doesn't
|
|
859735
859736
|
// time out.
|
|
859736
|
-
fees: new
|
|
859737
|
+
fees: new import_bignumber422.default(MAX_FEE)
|
|
859737
859738
|
}
|
|
859738
859739
|
];
|
|
859739
859740
|
if (Math.random() < 0.5) {
|
|
@@ -860016,7 +860017,7 @@ var bot_specs_default10 = {
|
|
|
860016
860017
|
|
|
860017
860018
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
860018
860019
|
init_lib_es4();
|
|
860019
|
-
var
|
|
860020
|
+
var import_bignumber423 = __toESM(require("bignumber.js"));
|
|
860020
860021
|
var import_expect18 = __toESM(require_build20());
|
|
860021
860022
|
var import_invariant101 = __toESM(require("invariant"));
|
|
860022
860023
|
|
|
@@ -860093,11 +860094,11 @@ var generateDeviceActionFlow2 = (scenario) => {
|
|
|
860093
860094
|
};
|
|
860094
860095
|
|
|
860095
860096
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
860096
|
-
var MIN_SAFE6 = new
|
|
860097
|
+
var MIN_SAFE6 = new import_bignumber423.default(15e6);
|
|
860097
860098
|
var testDestination2 = ({ destination, destinationBeforeTransaction, sendingOperation }) => {
|
|
860098
860099
|
const amount = sendingOperation.value;
|
|
860099
860100
|
const inOp = destination.operations.find((op) => op.hash === sendingOperation.hash && op.type === "IN");
|
|
860100
|
-
const inFees = inOp?.fee ?? (0,
|
|
860101
|
+
const inFees = inOp?.fee ?? (0, import_bignumber423.default)(0);
|
|
860101
860102
|
botTest("account balance increased with transaction amount", () => (0, import_expect18.default)(destination.balance.toString()).toBe(destinationBeforeTransaction.balance.plus(amount).minus(inFees).toString()));
|
|
860102
860103
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect18.default)({
|
|
860103
860104
|
type: inOp?.type,
|
|
@@ -860220,7 +860221,7 @@ var specs_default10 = {
|
|
|
860220
860221
|
};
|
|
860221
860222
|
|
|
860222
860223
|
// ../../libs/coin-modules/coin-vechain/lib-es/test/bot-specs.js
|
|
860223
|
-
var
|
|
860224
|
+
var import_bignumber424 = __toESM(require("bignumber.js"));
|
|
860224
860225
|
var import_invariant102 = __toESM(require("invariant"));
|
|
860225
860226
|
init_lib_es4();
|
|
860226
860227
|
|
|
@@ -860320,7 +860321,7 @@ var vet = {
|
|
|
860320
860321
|
};
|
|
860321
860322
|
},
|
|
860322
860323
|
test: ({ account: account3 }) => {
|
|
860323
|
-
botTest("account balance decreased with operation value", () => expect(account3.balance.toString()).toBe(new
|
|
860324
|
+
botTest("account balance decreased with operation value", () => expect(account3.balance.toString()).toBe(new import_bignumber424.default(0).toString()));
|
|
860324
860325
|
}
|
|
860325
860326
|
}
|
|
860326
860327
|
]
|
|
@@ -860352,7 +860353,7 @@ var vtho = {
|
|
|
860352
860353
|
};
|
|
860353
860354
|
},
|
|
860354
860355
|
test: ({ account: account3, accountBeforeTransaction }) => {
|
|
860355
|
-
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new
|
|
860356
|
+
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new import_bignumber424.default(accountBeforeTransaction?.subAccounts?.[0].balance || 0).div(2).toString()));
|
|
860356
860357
|
}
|
|
860357
860358
|
},
|
|
860358
860359
|
{
|
|
@@ -860379,7 +860380,7 @@ var vtho = {
|
|
|
860379
860380
|
};
|
|
860380
860381
|
},
|
|
860381
860382
|
test: ({ account: account3 }) => {
|
|
860382
|
-
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new
|
|
860383
|
+
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new import_bignumber424.default(0).toString()));
|
|
860383
860384
|
}
|
|
860384
860385
|
}
|
|
860385
860386
|
]
|
|
@@ -860494,7 +860495,7 @@ var bot_specs_default12 = {
|
|
|
860494
860495
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
860495
860496
|
var import_invariant104 = __toESM(require("invariant"));
|
|
860496
860497
|
init_lib_es4();
|
|
860497
|
-
var
|
|
860498
|
+
var import_bignumber425 = __toESM(require("bignumber.js"));
|
|
860498
860499
|
var import_expect20 = __toESM(require_build20());
|
|
860499
860500
|
|
|
860500
860501
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-deviceActions.js
|
|
@@ -860568,7 +860569,7 @@ var getRandomTransferID3 = () => {
|
|
|
860568
860569
|
|
|
860569
860570
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
860570
860571
|
var maxAccount9 = 6;
|
|
860571
|
-
var MIN_SAFE7 = new
|
|
860572
|
+
var MIN_SAFE7 = new import_bignumber425.default(1 * 10 ** 8);
|
|
860572
860573
|
var minaSpecs = {
|
|
860573
860574
|
name: "Mina",
|
|
860574
860575
|
currency: getCryptoCurrencyById("mina"),
|
|
@@ -862024,7 +862025,7 @@ async function bot({ disabled, filter: filter26 } = {}) {
|
|
|
862024
862025
|
});
|
|
862025
862026
|
const period = "month";
|
|
862026
862027
|
const portfolio = countervaluesState ? getPortfolio(allAccountsAfter, period, countervaluesState, usd) : null;
|
|
862027
|
-
const totalUSD = portfolio ? formatCurrencyUnit(usd.units[0], new
|
|
862028
|
+
const totalUSD = portfolio ? formatCurrencyUnit(usd.units[0], new import_bignumber426.BigNumber(portfolio.balanceHistory[portfolio.balanceHistory.length - 1].value), {
|
|
862028
862029
|
showCode: true
|
|
862029
862030
|
}) : "";
|
|
862030
862031
|
const allMutationReports = (0, import_flatMap26.default)(results2, (r27) => r27.mutations || []);
|
|
@@ -862240,7 +862241,7 @@ async function bot({ disabled, filter: filter26 } = {}) {
|
|
|
862240
862241
|
function sumAccounts(all8) {
|
|
862241
862242
|
if (!all8 || all8.length === 0)
|
|
862242
862243
|
return;
|
|
862243
|
-
return all8.reduce((sum2, a64) => sum2.plus(a64.spendableBalance), new
|
|
862244
|
+
return all8.reduce((sum2, a64) => sum2.plus(a64.spendableBalance), new import_bignumber426.BigNumber(0));
|
|
862244
862245
|
}
|
|
862245
862246
|
const { accountsBefore } = r27;
|
|
862246
862247
|
const accountsBeforeBalance = sumAccounts(accountsBefore);
|
|
@@ -862251,16 +862252,16 @@ async function bot({ disabled, filter: filter26 } = {}) {
|
|
|
862251
862252
|
let etaEmoji = "\u274C";
|
|
862252
862253
|
const accounts2 = r27.accountsAfter || r27.accountsBefore || [];
|
|
862253
862254
|
const operations3 = (0, import_flatMap26.default)(accounts2, (a64) => a64.operations).sort((a64, b20) => a64.fee.minus(b20.fee).toNumber());
|
|
862254
|
-
const avgOperationFee = operations3.reduce((sum2, o40) => sum2.plus(o40.fee || 0), new
|
|
862255
|
+
const avgOperationFee = operations3.reduce((sum2, o40) => sum2.plus(o40.fee || 0), new import_bignumber426.BigNumber(0)).div(operations3.length);
|
|
862255
862256
|
const maxRuns = r27.spec.mutations.reduce((sum2, m60) => sum2 + m60.maxRun || 1, 0);
|
|
862256
862257
|
if (avgOperationFee.gt(0) && maxRuns > 0) {
|
|
862257
|
-
const spendableBalanceSum = accounts2.reduce((sum2, a64) => sum2.plus(
|
|
862258
|
+
const spendableBalanceSum = accounts2.reduce((sum2, a64) => sum2.plus(import_bignumber426.BigNumber.max(a64.spendableBalance.minus(r27.spec.minViableAmount || 0), 0)), new import_bignumber426.BigNumber(0));
|
|
862258
862259
|
eta = spendableBalanceSum.div(avgOperationFee).div(maxRuns).toNumber();
|
|
862259
862260
|
etaEmoji = eta < 50 ? "\u26A0\uFE0F" : eta < 500 ? "\u{1F44D}" : "\u{1F4AA}";
|
|
862260
862261
|
}
|
|
862261
862262
|
if (countervaluesState && r27.accountsAfter) {
|
|
862262
862263
|
const portfolio2 = getPortfolio(r27.accountsAfter, period, countervaluesState, usd);
|
|
862263
|
-
const totalUSD2 = portfolio2 ? formatCurrencyUnit(usd.units[0], new
|
|
862264
|
+
const totalUSD2 = portfolio2 ? formatCurrencyUnit(usd.units[0], new import_bignumber426.BigNumber(portfolio2.balanceHistory[portfolio2.balanceHistory.length - 1].value), {
|
|
862264
862265
|
showCode: true
|
|
862265
862266
|
}) : "";
|
|
862266
862267
|
balance += " (" + totalUSD2 + ")";
|
|
@@ -862368,7 +862369,7 @@ ${slackBody}`;
|
|
|
862368
862369
|
}
|
|
862369
862370
|
|
|
862370
862371
|
// src/scan.ts
|
|
862371
|
-
var
|
|
862372
|
+
var import_bignumber427 = require("bignumber.js");
|
|
862372
862373
|
var import_rxjs162 = require("rxjs");
|
|
862373
862374
|
var import_operators15 = require("rxjs/operators");
|
|
862374
862375
|
|
|
@@ -862708,8 +862709,8 @@ function scan3(arg) {
|
|
|
862708
862709
|
creationDate: /* @__PURE__ */ new Date(),
|
|
862709
862710
|
lastSyncDate: /* @__PURE__ */ new Date(0),
|
|
862710
862711
|
blockHeight: 0,
|
|
862711
|
-
balance: new
|
|
862712
|
-
spendableBalance: new
|
|
862712
|
+
balance: new import_bignumber427.BigNumber(0),
|
|
862713
|
+
spendableBalance: new import_bignumber427.BigNumber(0),
|
|
862713
862714
|
operationsCount: 0,
|
|
862714
862715
|
operations: [],
|
|
862715
862716
|
pendingOperations: [],
|
|
@@ -863270,7 +863271,7 @@ testBridge(dataset);
|
|
|
863270
863271
|
};
|
|
863271
863272
|
|
|
863272
863273
|
// src/commands/blockchain/generateTestTransaction.ts
|
|
863273
|
-
var
|
|
863274
|
+
var import_bignumber429 = require("bignumber.js");
|
|
863274
863275
|
init_lib_es2();
|
|
863275
863276
|
var import_rxjs169 = require("rxjs");
|
|
863276
863277
|
var import_operators23 = require("rxjs/operators");
|
|
@@ -863279,7 +863280,7 @@ var import_operators23 = require("rxjs/operators");
|
|
|
863279
863280
|
var import_uniqBy3 = __toESM(require("lodash/uniqBy"));
|
|
863280
863281
|
var import_shuffle = __toESM(require("lodash/shuffle"));
|
|
863281
863282
|
var import_flatMap27 = __toESM(require("lodash/flatMap"));
|
|
863282
|
-
var
|
|
863283
|
+
var import_bignumber428 = require("bignumber.js");
|
|
863283
863284
|
|
|
863284
863285
|
// ../../libs/ledger-live-common/lib-es/generated/cli-transaction.js
|
|
863285
863286
|
var cli_transaction_default = {
|
|
@@ -863388,11 +863389,11 @@ async function inferTransactions26(mainAccount, opts) {
|
|
|
863388
863389
|
const transaction = bridge28.createTransaction(mainAccount);
|
|
863389
863390
|
transaction.recipient = recipient;
|
|
863390
863391
|
transaction.useAllAmount = !!opts["use-all-amount"];
|
|
863391
|
-
transaction.amount = transaction.useAllAmount ? new
|
|
863392
|
+
transaction.amount = transaction.useAllAmount ? new import_bignumber428.BigNumber(0) : inferAmount(account3, opts.amount || "0");
|
|
863392
863393
|
if (opts.tokenIds && opts.collection) {
|
|
863393
863394
|
transaction.tokenIds = opts.tokenIds.split(",");
|
|
863394
863395
|
transaction.collection = opts.collection;
|
|
863395
|
-
transaction.quantities = opts.quantities?.split(",")?.map((q12) => new
|
|
863396
|
+
transaction.quantities = opts.quantities?.split(",")?.map((q12) => new import_bignumber428.BigNumber(q12));
|
|
863396
863397
|
}
|
|
863397
863398
|
return {
|
|
863398
863399
|
account: account3,
|
|
@@ -863438,7 +863439,7 @@ var toJS = (obj2) => {
|
|
|
863438
863439
|
if (obj2 instanceof Error) {
|
|
863439
863440
|
return `new ${obj2.name || "Error"}()`;
|
|
863440
863441
|
}
|
|
863441
|
-
if (
|
|
863442
|
+
if (import_bignumber429.BigNumber.isBigNumber(obj2)) {
|
|
863442
863443
|
return `BigNumber("${obj2.toFixed()}")`;
|
|
863443
863444
|
}
|
|
863444
863445
|
const keys2 = Object.keys(obj2);
|
|
@@ -870595,13 +870596,13 @@ var speculosList_default = {
|
|
|
870595
870596
|
};
|
|
870596
870597
|
|
|
870597
870598
|
// src/commands/live/balanceHistory.ts
|
|
870598
|
-
var
|
|
870599
|
+
var import_bignumber430 = require("bignumber.js");
|
|
870599
870600
|
var import_asciichart = require("asciichart");
|
|
870600
870601
|
var import_invariant119 = __toESM(require("invariant"));
|
|
870601
870602
|
var import_operators84 = require("rxjs/operators");
|
|
870602
870603
|
var histoFormatters = {
|
|
870603
870604
|
default: (histo, account3) => histo.map(
|
|
870604
|
-
({ date, value: value5 }) => date.toISOString() + " " + formatCurrencyUnit(account3.currency.units[0], new
|
|
870605
|
+
({ date, value: value5 }) => date.toISOString() + " " + formatCurrencyUnit(account3.currency.units[0], new import_bignumber430.BigNumber(value5), {
|
|
870605
870606
|
showCode: true,
|
|
870606
870607
|
disableRounding: true
|
|
870607
870608
|
})
|
|
@@ -870612,13 +870613,13 @@ var histoFormatters = {
|
|
|
870612
870613
|
disableRounding: true
|
|
870613
870614
|
}) + "\n" + (0, import_asciichart.plot)(
|
|
870614
870615
|
history.map(
|
|
870615
|
-
(h34) => h34.value / new
|
|
870616
|
+
(h34) => h34.value / new import_bignumber430.BigNumber(10).pow(account3.currency.units[0].magnitude).toNumber()
|
|
870616
870617
|
),
|
|
870617
870618
|
{
|
|
870618
870619
|
height: 10,
|
|
870619
870620
|
format: (value5) => formatCurrencyUnit(
|
|
870620
870621
|
account3.currency.units[0],
|
|
870621
|
-
new
|
|
870622
|
+
new import_bignumber430.BigNumber(value5).times(new import_bignumber430.BigNumber(10).pow(account3.currency.units[0].magnitude)),
|
|
870622
870623
|
{
|
|
870623
870624
|
showCode: true,
|
|
870624
870625
|
disableRounding: true
|
|
@@ -870663,7 +870664,7 @@ var balanceHistory_default = {
|
|
|
870663
870664
|
|
|
870664
870665
|
// src/commands/live/countervalues.ts
|
|
870665
870666
|
var import_uniq3 = __toESM(require("lodash/uniq"));
|
|
870666
|
-
var
|
|
870667
|
+
var import_bignumber431 = require("bignumber.js");
|
|
870667
870668
|
var import_asciichart2 = require("asciichart");
|
|
870668
870669
|
var import_invariant120 = __toESM(require("invariant"));
|
|
870669
870670
|
var import_rxjs257 = require("rxjs");
|
|
@@ -870676,7 +870677,7 @@ var histoFormatters2 = {
|
|
|
870676
870677
|
return availability === "100" ? `"${countervalue.ticker}",` : void 0;
|
|
870677
870678
|
},
|
|
870678
870679
|
default: (histo, currency25, countervalue) => histo.map(
|
|
870679
|
-
({ date, value: value5 }) => (currency25.ticker + "\u27A1" + countervalue.ticker).padEnd(10) + " " + date.toISOString() + " " + formatCurrencyUnit(countervalue.units[0], new
|
|
870680
|
+
({ date, value: value5 }) => (currency25.ticker + "\u27A1" + countervalue.ticker).padEnd(10) + " " + date.toISOString() + " " + formatCurrencyUnit(countervalue.units[0], new import_bignumber431.BigNumber(value5 || 0), {
|
|
870680
870681
|
showCode: true,
|
|
870681
870682
|
disableRounding: true
|
|
870682
870683
|
})
|
|
@@ -870684,13 +870685,13 @@ var histoFormatters2 = {
|
|
|
870684
870685
|
json: (histo) => toBalanceHistoryRaw(histo),
|
|
870685
870686
|
asciichart: (history, currency25, countervalue) => "\n" + "".padStart(22) + currency25.name + " to " + countervalue.name + "\n" + (0, import_asciichart2.plot)(
|
|
870686
870687
|
history.map(
|
|
870687
|
-
(h34) => new
|
|
870688
|
+
(h34) => new import_bignumber431.BigNumber(h34.value || 0).div(new import_bignumber431.BigNumber(10).pow(countervalue.units[0].magnitude)).toNumber()
|
|
870688
870689
|
),
|
|
870689
870690
|
{
|
|
870690
870691
|
height: 10,
|
|
870691
870692
|
format: (value5) => formatCurrencyUnit(
|
|
870692
870693
|
countervalue.units[0],
|
|
870693
|
-
new
|
|
870694
|
+
new import_bignumber431.BigNumber(value5).times(new import_bignumber431.BigNumber(10).pow(countervalue.units[0].magnitude)),
|
|
870694
870695
|
{
|
|
870695
870696
|
showCode: true,
|
|
870696
870697
|
disableRounding: true
|
|
@@ -874420,7 +874421,7 @@ function mapValues4(obj2, fn4) {
|
|
|
874420
874421
|
}
|
|
874421
874422
|
|
|
874422
874423
|
// ../../libs/live-wallet/lib-es/liveqr/cross.js
|
|
874423
|
-
var
|
|
874424
|
+
var import_bignumber432 = require("bignumber.js");
|
|
874424
874425
|
var accountDataToAccount = ({ id: id7, currencyId, freshAddress: inputFreshAddress, name: name2, index, balance, derivationMode: derivationModeStr, seedIdentifier }) => {
|
|
874425
874426
|
const { xpubOrAddress } = decodeAccountId(id7);
|
|
874426
874427
|
const derivationMode2 = asDerivationMode(derivationModeStr);
|
|
@@ -874447,7 +874448,7 @@ var accountDataToAccount = ({ id: id7, currencyId, freshAddress: inputFreshAddre
|
|
|
874447
874448
|
account: index
|
|
874448
874449
|
});
|
|
874449
874450
|
}
|
|
874450
|
-
const balanceBN = new
|
|
874451
|
+
const balanceBN = new import_bignumber432.BigNumber(balance);
|
|
874451
874452
|
const account3 = {
|
|
874452
874453
|
type: "Account",
|
|
874453
874454
|
id: id7,
|
|
@@ -874941,7 +874942,7 @@ var liveData_default = {
|
|
|
874941
874942
|
};
|
|
874942
874943
|
|
|
874943
874944
|
// src/commands/live/portfolio.ts
|
|
874944
|
-
var
|
|
874945
|
+
var import_bignumber433 = require("bignumber.js");
|
|
874945
874946
|
var import_asciichart3 = require("asciichart");
|
|
874946
874947
|
var import_invariant121 = __toESM(require("invariant"));
|
|
874947
874948
|
var import_rxjs263 = require("rxjs");
|
|
@@ -874994,20 +874995,20 @@ var portfolio_default = {
|
|
|
874994
874995
|
function render(title, accounts3) {
|
|
874995
874996
|
const portfolio = getPortfolio(accounts3, period, state, countervalue);
|
|
874996
874997
|
const balance = portfolio.balanceHistory[portfolio.balanceHistory.length - 1].value;
|
|
874997
|
-
return title + " " + formatCurrencyUnit(unit, new
|
|
874998
|
+
return title + " " + formatCurrencyUnit(unit, new import_bignumber433.BigNumber(balance), {
|
|
874998
874999
|
showCode: true,
|
|
874999
875000
|
disableRounding: true
|
|
875000
|
-
}) + (portfolio.countervalueChange.percentage ? " ::: on a " + period + " period: " + Math.round(portfolio.countervalueChange.percentage * 100).toString() + "% (" + formatCurrencyUnit(unit, new
|
|
875001
|
+
}) + (portfolio.countervalueChange.percentage ? " ::: on a " + period + " period: " + Math.round(portfolio.countervalueChange.percentage * 100).toString() + "% (" + formatCurrencyUnit(unit, new import_bignumber433.BigNumber(portfolio.countervalueChange.value), {
|
|
875001
875002
|
showCode: true
|
|
875002
875003
|
}) + ")" : "") + "\n" + (0, import_asciichart3.plot)(
|
|
875003
875004
|
portfolio.balanceHistory.map(
|
|
875004
|
-
(h34) => new
|
|
875005
|
+
(h34) => new import_bignumber433.BigNumber(h34.value).div(new import_bignumber433.BigNumber(10).pow(unit.magnitude)).toNumber()
|
|
875005
875006
|
),
|
|
875006
875007
|
{
|
|
875007
875008
|
height: 10,
|
|
875008
875009
|
format: (value5) => formatCurrencyUnit(
|
|
875009
875010
|
unit,
|
|
875010
|
-
new
|
|
875011
|
+
new import_bignumber433.BigNumber(value5).times(new import_bignumber433.BigNumber(10).pow(unit.magnitude)),
|
|
875011
875012
|
{
|
|
875012
875013
|
showCode: true,
|
|
875013
875014
|
disableRounding: true
|
|
@@ -875307,7 +875308,7 @@ var version_default3 = {
|
|
|
875307
875308
|
// src/commands/ptx/swap.ts
|
|
875308
875309
|
var import_operators89 = require("rxjs/operators");
|
|
875309
875310
|
var import_rxjs269 = require("rxjs");
|
|
875310
|
-
var
|
|
875311
|
+
var import_bignumber437 = require("bignumber.js");
|
|
875311
875312
|
var import_command_line_args = __toESM(require("command-line-args"));
|
|
875312
875313
|
|
|
875313
875314
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
@@ -875738,7 +875739,7 @@ var lib_es_default5 = Exchange;
|
|
|
875738
875739
|
|
|
875739
875740
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
875740
875741
|
init_lib_es2();
|
|
875741
|
-
var
|
|
875742
|
+
var import_bignumber435 = require("bignumber.js");
|
|
875742
875743
|
var import_invariant123 = __toESM(require("invariant"));
|
|
875743
875744
|
var import_rxjs268 = require("rxjs");
|
|
875744
875745
|
|
|
@@ -875765,20 +875766,20 @@ var getCurrencyExchangeConfig = async (currency25) => {
|
|
|
875765
875766
|
};
|
|
875766
875767
|
|
|
875767
875768
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/mock.js
|
|
875768
|
-
var
|
|
875769
|
+
var import_bignumber434 = require("bignumber.js");
|
|
875769
875770
|
var import_rxjs267 = require("rxjs");
|
|
875770
875771
|
var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
875771
875772
|
const { fromAccount, toAccount } = exchange;
|
|
875772
875773
|
const amount = transaction.amount;
|
|
875773
875774
|
const unitFrom = getAccountCurrency(fromAccount).units[0];
|
|
875774
875775
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(toAccount).units[0];
|
|
875775
|
-
const tenPowMagnitude = new
|
|
875776
|
+
const tenPowMagnitude = new import_bignumber434.BigNumber(10).pow(unitFrom.magnitude);
|
|
875776
875777
|
const amountFrom = amount.div(tenPowMagnitude);
|
|
875777
|
-
const minAmountFrom = new
|
|
875778
|
-
const maxAmountFrom = new
|
|
875778
|
+
const minAmountFrom = new import_bignumber434.BigNumber(1e-4);
|
|
875779
|
+
const maxAmountFrom = new import_bignumber434.BigNumber(1e3);
|
|
875779
875780
|
if (amountFrom.lte(minAmountFrom)) {
|
|
875780
875781
|
throw new SwapExchangeRateAmountTooLow(void 0, {
|
|
875781
|
-
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
875782
|
+
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber434.BigNumber(minAmountFrom).times(tenPowMagnitude), {
|
|
875782
875783
|
alwaysShowSign: false,
|
|
875783
875784
|
disableRounding: true,
|
|
875784
875785
|
showCode: true
|
|
@@ -875787,7 +875788,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
875787
875788
|
}
|
|
875788
875789
|
if (amountFrom.gte(maxAmountFrom)) {
|
|
875789
875790
|
throw new SwapExchangeRateAmountTooHigh(void 0, {
|
|
875790
|
-
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
875791
|
+
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber434.BigNumber(maxAmountFrom).times(tenPowMagnitude), {
|
|
875791
875792
|
alwaysShowSign: false,
|
|
875792
875793
|
disableRounding: true,
|
|
875793
875794
|
showCode: true
|
|
@@ -875795,10 +875796,10 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
875795
875796
|
});
|
|
875796
875797
|
}
|
|
875797
875798
|
await new Promise((r27) => setTimeout(r27, 800));
|
|
875798
|
-
const magnitudeAwareRate = new
|
|
875799
|
+
const magnitudeAwareRate = new import_bignumber434.BigNumber(1).div(new import_bignumber434.BigNumber(10).pow(unitFrom.magnitude)).times(new import_bignumber434.BigNumber(10).pow(unitTo.magnitude));
|
|
875799
875800
|
return [
|
|
875800
875801
|
{
|
|
875801
|
-
rate: new
|
|
875802
|
+
rate: new import_bignumber434.BigNumber("1"),
|
|
875802
875803
|
toAmount: amount.times(magnitudeAwareRate),
|
|
875803
875804
|
magnitudeAwareRate,
|
|
875804
875805
|
rateId: "changellyRateId1",
|
|
@@ -875808,7 +875809,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
875808
875809
|
tradeMethod: "fixed"
|
|
875809
875810
|
},
|
|
875810
875811
|
{
|
|
875811
|
-
rate: new
|
|
875812
|
+
rate: new import_bignumber434.BigNumber("1.1"),
|
|
875812
875813
|
toAmount: amount.times(magnitudeAwareRate),
|
|
875813
875814
|
magnitudeAwareRate,
|
|
875814
875815
|
rateId: "changellyRateId2",
|
|
@@ -875818,7 +875819,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
875818
875819
|
tradeMethod: "float"
|
|
875819
875820
|
},
|
|
875820
875821
|
{
|
|
875821
|
-
rate: new
|
|
875822
|
+
rate: new import_bignumber434.BigNumber("0.9"),
|
|
875822
875823
|
toAmount: amount.times(magnitudeAwareRate),
|
|
875823
875824
|
magnitudeAwareRate,
|
|
875824
875825
|
rateId: "cicRateId1",
|
|
@@ -875828,7 +875829,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
875828
875829
|
tradeMethod: "float"
|
|
875829
875830
|
},
|
|
875830
875831
|
{
|
|
875831
|
-
rate: new
|
|
875832
|
+
rate: new import_bignumber434.BigNumber("0.95"),
|
|
875832
875833
|
toAmount: amount.times(magnitudeAwareRate),
|
|
875833
875834
|
magnitudeAwareRate,
|
|
875834
875835
|
rateId: "1inchRateId1",
|
|
@@ -875846,7 +875847,7 @@ var mockInitSwap = (exchange, exchangeRate, transaction) => {
|
|
|
875846
875847
|
initSwapResult: {
|
|
875847
875848
|
transaction,
|
|
875848
875849
|
swapId: "mockedSwapId",
|
|
875849
|
-
magnitudeAwareRate: new
|
|
875850
|
+
magnitudeAwareRate: new import_bignumber434.BigNumber(5e4)
|
|
875850
875851
|
}
|
|
875851
875852
|
});
|
|
875852
875853
|
};
|
|
@@ -876134,7 +876135,7 @@ var initSwap = (input) => {
|
|
|
876134
876135
|
const payoutCurrency = getAccountCurrency(toAccount);
|
|
876135
876136
|
const refundAccount = getMainAccount(fromAccount, fromParentAccount);
|
|
876136
876137
|
const payoutAccount = getMainAccount(toAccount, toParentAccount);
|
|
876137
|
-
const apiAmount = new
|
|
876138
|
+
const apiAmount = new import_bignumber435.BigNumber(amount).div(new import_bignumber435.BigNumber(10).pow(unitFrom.magnitude));
|
|
876138
876139
|
let res;
|
|
876139
876140
|
const swapProviderConfig = await getSwapProvider(provider);
|
|
876140
876141
|
const headers = {
|
|
@@ -876188,7 +876189,7 @@ var initSwap = (input) => {
|
|
|
876188
876189
|
});
|
|
876189
876190
|
if (refundCurrency.id === "ripple") {
|
|
876190
876191
|
transaction = accountBridge15.updateTransaction(transaction, {
|
|
876191
|
-
tag: new
|
|
876192
|
+
tag: new import_bignumber435.BigNumber(swapResult.payinExtraId).toNumber()
|
|
876192
876193
|
});
|
|
876193
876194
|
(0, import_invariant123.default)(transaction.tag, "Refusing to swap xrp without a destination tag");
|
|
876194
876195
|
} else if (refundCurrency.id === "stellar") {
|
|
@@ -876270,13 +876271,13 @@ var initSwap = (input) => {
|
|
|
876270
876271
|
let amountExpectedTo;
|
|
876271
876272
|
if (swapResult.binaryPayload) {
|
|
876272
876273
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
876273
|
-
amountExpectedTo = new
|
|
876274
|
+
amountExpectedTo = new import_bignumber435.BigNumber(decodePayload.amountToWallet.toString());
|
|
876274
876275
|
magnitudeAwareRate = transaction.amount && amountExpectedTo.dividedBy(transaction.amount);
|
|
876275
876276
|
}
|
|
876276
876277
|
let amountExpectedFrom;
|
|
876277
876278
|
if (swapResult.binaryPayload) {
|
|
876278
876279
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
876279
|
-
amountExpectedFrom = new
|
|
876280
|
+
amountExpectedFrom = new import_bignumber435.BigNumber(decodePayload.amountToProvider.toString());
|
|
876280
876281
|
if (data12.amountFromInSmallestDenomination !== amountExpectedFrom.toNumber())
|
|
876281
876282
|
throw new Error("AmountFrom received from partner's payload mismatch user input");
|
|
876282
876283
|
}
|
|
@@ -876342,7 +876343,7 @@ var initSwap = (input) => {
|
|
|
876342
876343
|
var initSwap_default = initSwap;
|
|
876343
876344
|
|
|
876344
876345
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/getExchangeRates.js
|
|
876345
|
-
var
|
|
876346
|
+
var import_bignumber436 = require("bignumber.js");
|
|
876346
876347
|
var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [], timeout: timeout11, timeoutErrorMessage }) => {
|
|
876347
876348
|
if (isIntegrationTestEnv())
|
|
876348
876349
|
return mockGetExchangeRates(exchange, transaction, currencyTo);
|
|
@@ -876351,8 +876352,8 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
876351
876352
|
const to = (currencyTo ?? getAccountCurrency(exchange.toAccount)).id;
|
|
876352
876353
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(exchange.toAccount).units[0];
|
|
876353
876354
|
const amountFrom = transaction.amount;
|
|
876354
|
-
const tenPowMagnitude = new
|
|
876355
|
-
const apiAmount = new
|
|
876355
|
+
const tenPowMagnitude = new import_bignumber436.BigNumber(10).pow(unitFrom.magnitude);
|
|
876356
|
+
const apiAmount = new import_bignumber436.BigNumber(amountFrom).div(tenPowMagnitude);
|
|
876356
876357
|
const providerList = providers.filter((provider) => provider.pairs.some((pair) => pair.from === from91 && pair.to === to)).map((item) => item.provider);
|
|
876357
876358
|
const request3 = {
|
|
876358
876359
|
from: from91,
|
|
@@ -876379,12 +876380,12 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
876379
876380
|
error
|
|
876380
876381
|
};
|
|
876381
876382
|
}
|
|
876382
|
-
const payoutNetworkFees = new
|
|
876383
|
-
const magnitudeAwarePayoutNetworkFees = payoutNetworkFees.times(new
|
|
876384
|
-
const rate2 = maybeRate ? new
|
|
876385
|
-
const magnitudeAwareRate = rate2.div(new
|
|
876386
|
-
const toAmount = new
|
|
876387
|
-
const magnitudeAwareToAmount = toAmount.times(new
|
|
876383
|
+
const payoutNetworkFees = new import_bignumber436.BigNumber(maybePayoutNetworkFees || 0);
|
|
876384
|
+
const magnitudeAwarePayoutNetworkFees = payoutNetworkFees.times(new import_bignumber436.BigNumber(10).pow(unitTo.magnitude));
|
|
876385
|
+
const rate2 = maybeRate ? new import_bignumber436.BigNumber(maybeRate) : new import_bignumber436.BigNumber(amountTo).minus(payoutNetworkFees).div(amountFrom2);
|
|
876386
|
+
const magnitudeAwareRate = rate2.div(new import_bignumber436.BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude));
|
|
876387
|
+
const toAmount = new import_bignumber436.BigNumber(amountTo).minus(payoutNetworkFees);
|
|
876388
|
+
const magnitudeAwareToAmount = toAmount.times(new import_bignumber436.BigNumber(10).pow(unitTo.magnitude));
|
|
876388
876389
|
const out = {
|
|
876389
876390
|
magnitudeAwareRate,
|
|
876390
876391
|
provider,
|
|
@@ -876412,7 +876413,7 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
876412
876413
|
return rates;
|
|
876413
876414
|
};
|
|
876414
876415
|
var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
876415
|
-
const tenPowMagnitude = new
|
|
876416
|
+
const tenPowMagnitude = new import_bignumber436.BigNumber(10).pow(unitFrom.magnitude);
|
|
876416
876417
|
const { amountTo, minAmountFrom, maxAmountFrom, errorCode, errorMessage, provider, status } = responseData;
|
|
876417
876418
|
const isDex = (await getSwapProvider(provider)).type === "DEX";
|
|
876418
876419
|
if ((!minAmountFrom || !maxAmountFrom) && status === "error" && errorCode !== 300 && isDex) {
|
|
@@ -876426,17 +876427,17 @@ var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
|
876426
876427
|
}
|
|
876427
876428
|
const hasAmountLimit = minAmountFrom || maxAmountFrom;
|
|
876428
876429
|
if (hasAmountLimit) {
|
|
876429
|
-
const isTooSmall = minAmountFrom ? new
|
|
876430
|
+
const isTooSmall = minAmountFrom ? new import_bignumber436.BigNumber(apiAmount).lte(minAmountFrom) : false;
|
|
876430
876431
|
const MinOrMaxError = isTooSmall ? SwapExchangeRateAmountTooLow : SwapExchangeRateAmountTooHigh;
|
|
876431
876432
|
const key2 = isTooSmall ? "minAmountFromFormatted" : "maxAmountFromFormatted";
|
|
876432
876433
|
const amount = isTooSmall ? minAmountFrom : maxAmountFrom;
|
|
876433
876434
|
return new MinOrMaxError(void 0, {
|
|
876434
|
-
[key2]: formatCurrencyUnit(unitFrom, new
|
|
876435
|
+
[key2]: formatCurrencyUnit(unitFrom, new import_bignumber436.BigNumber(amount).times(tenPowMagnitude), {
|
|
876435
876436
|
alwaysShowSign: false,
|
|
876436
876437
|
disableRounding: true,
|
|
876437
876438
|
showCode: true
|
|
876438
876439
|
}),
|
|
876439
|
-
amount: new
|
|
876440
|
+
amount: new import_bignumber436.BigNumber(amount)
|
|
876440
876441
|
});
|
|
876441
876442
|
}
|
|
876442
876443
|
}
|
|
@@ -876541,7 +876542,7 @@ var exec6 = async (opts) => {
|
|
|
876541
876542
|
}
|
|
876542
876543
|
);
|
|
876543
876544
|
console.log(" :balance: ", fromAccount.spendableBalance.toString(), ` [ ${formattedAmount} ]`);
|
|
876544
|
-
(0, import_invariant124.default)(fromAccount.balance.gte(new
|
|
876545
|
+
(0, import_invariant124.default)(fromAccount.balance.gte(new import_bignumber437.BigNumber(amount)), `\u2716 Not enough balance`);
|
|
876545
876546
|
console.log("\u2022 Open the destination currency app");
|
|
876546
876547
|
await delay(8e3);
|
|
876547
876548
|
let toParentAccount = null;
|
|
@@ -876583,7 +876584,7 @@ var exec6 = async (opts) => {
|
|
|
876583
876584
|
});
|
|
876584
876585
|
if (!useAllAmount) {
|
|
876585
876586
|
transaction = bridge28.updateTransaction(transaction, {
|
|
876586
|
-
amount: new
|
|
876587
|
+
amount: new import_bignumber437.BigNumber(amount)
|
|
876587
876588
|
});
|
|
876588
876589
|
} else {
|
|
876589
876590
|
const amount2 = await bridge28.estimateMaxSpendable({
|