@ledgerhq/live-cli 24.29.0-nightly.20251128023740 → 24.29.0-nightly.20251129023709
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 +300 -278
- package/package.json +2 -2
package/lib/cli.js
CHANGED
|
@@ -39866,7 +39866,7 @@ var require_base322 = __commonJS({
|
|
|
39866
39866
|
var require_stringify = __commonJS({
|
|
39867
39867
|
"../../node_modules/.pnpm/json-bigint@1.0.0/node_modules/json-bigint/lib/stringify.js"(exports2, module2) {
|
|
39868
39868
|
"use strict";
|
|
39869
|
-
var
|
|
39869
|
+
var BigNumber428 = require("bignumber.js");
|
|
39870
39870
|
var JSON2 = module2.exports;
|
|
39871
39871
|
(function() {
|
|
39872
39872
|
"use strict";
|
|
@@ -39891,7 +39891,7 @@ var require_stringify = __commonJS({
|
|
|
39891
39891
|
}) + '"' : '"' + string5 + '"';
|
|
39892
39892
|
}
|
|
39893
39893
|
function str(key2, holder) {
|
|
39894
|
-
var i109, k26, v64, length2, mind = gap, partial2, value2 = holder[key2], isBigNumber = value2 != null && (value2 instanceof
|
|
39894
|
+
var i109, k26, v64, length2, mind = gap, partial2, value2 = holder[key2], isBigNumber = value2 != null && (value2 instanceof BigNumber428 || BigNumber428.isBigNumber(value2));
|
|
39895
39895
|
if (value2 && typeof value2 === "object" && typeof value2.toJSON === "function") {
|
|
39896
39896
|
value2 = value2.toJSON(key2);
|
|
39897
39897
|
}
|
|
@@ -39977,7 +39977,7 @@ var require_stringify = __commonJS({
|
|
|
39977
39977
|
var require_parse2 = __commonJS({
|
|
39978
39978
|
"../../node_modules/.pnpm/json-bigint@1.0.0/node_modules/json-bigint/lib/parse.js"(exports2, module2) {
|
|
39979
39979
|
"use strict";
|
|
39980
|
-
var
|
|
39980
|
+
var BigNumber428 = null;
|
|
39981
39981
|
var suspectProtoRx = /(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])/;
|
|
39982
39982
|
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)/;
|
|
39983
39983
|
var json_parse = function(options24) {
|
|
@@ -40077,12 +40077,12 @@ var require_parse2 = __commonJS({
|
|
|
40077
40077
|
if (!isFinite(number8)) {
|
|
40078
40078
|
error("Bad number");
|
|
40079
40079
|
} else {
|
|
40080
|
-
if (
|
|
40081
|
-
|
|
40080
|
+
if (BigNumber428 == null)
|
|
40081
|
+
BigNumber428 = require("bignumber.js");
|
|
40082
40082
|
if (string6.length > 15)
|
|
40083
|
-
return _options2.storeAsString ? string6 : _options2.useNativeBigInt ? BigInt(string6) : new
|
|
40083
|
+
return _options2.storeAsString ? string6 : _options2.useNativeBigInt ? BigInt(string6) : new BigNumber428(string6);
|
|
40084
40084
|
else
|
|
40085
|
-
return !_options2.alwaysParseAsBig ? number8 : _options2.useNativeBigInt ? BigInt(number8) : new
|
|
40085
|
+
return !_options2.alwaysParseAsBig ? number8 : _options2.useNativeBigInt ? BigInt(number8) : new BigNumber428(number8);
|
|
40086
40086
|
}
|
|
40087
40087
|
}, string5 = function() {
|
|
40088
40088
|
var hex4, i109, string6 = "", uffff;
|
|
@@ -153941,7 +153941,7 @@ var require_lib12 = __commonJS({
|
|
|
153941
153941
|
"../../node_modules/.pnpm/web3-eth-iban@1.10.4/node_modules/web3-eth-iban/lib/index.js"(exports2, module2) {
|
|
153942
153942
|
"use strict";
|
|
153943
153943
|
var utils6 = require_lib10();
|
|
153944
|
-
var
|
|
153944
|
+
var BigNumber428 = require_bn4();
|
|
153945
153945
|
var leftPad = function(string5, bytes5) {
|
|
153946
153946
|
let result2 = string5;
|
|
153947
153947
|
while (result2.length < bytes5 * 2) {
|
|
@@ -154012,7 +154012,7 @@ var require_lib12 = __commonJS({
|
|
|
154012
154012
|
throw new Error("Provided address is not a valid address: " + address3);
|
|
154013
154013
|
}
|
|
154014
154014
|
address3 = address3.replace("0x", "").replace("0X", "");
|
|
154015
|
-
const asBn = new
|
|
154015
|
+
const asBn = new BigNumber428(address3, 16);
|
|
154016
154016
|
const base36 = asBn.toString(36);
|
|
154017
154017
|
const padded = leftPad(base36, 15);
|
|
154018
154018
|
return _Iban.fromBban(padded.toUpperCase());
|
|
@@ -154119,7 +154119,7 @@ var require_lib12 = __commonJS({
|
|
|
154119
154119
|
toAddress() {
|
|
154120
154120
|
if (this.isDirect()) {
|
|
154121
154121
|
const base36 = this._iban.slice(4);
|
|
154122
|
-
const asBn = new
|
|
154122
|
+
const asBn = new BigNumber428(base36, 36);
|
|
154123
154123
|
return utils6.toChecksumAddress(asBn.toString(16, 20));
|
|
154124
154124
|
}
|
|
154125
154125
|
return "";
|
|
@@ -490756,9 +490756,9 @@ var require_bignumber = __commonJS({
|
|
|
490756
490756
|
function _interopRequireDefault(e101) {
|
|
490757
490757
|
return e101 && e101.__esModule ? e101 : { "default": e101 };
|
|
490758
490758
|
}
|
|
490759
|
-
var
|
|
490760
|
-
|
|
490761
|
-
var _default = exports2["default"] =
|
|
490759
|
+
var BigNumber428 = _bignumber["default"].clone();
|
|
490760
|
+
BigNumber428.DEBUG = true;
|
|
490761
|
+
var _default = exports2["default"] = BigNumber428;
|
|
490762
490762
|
}
|
|
490763
490763
|
});
|
|
490764
490764
|
|
|
@@ -543586,7 +543586,7 @@ var require_package8 = __commonJS({
|
|
|
543586
543586
|
module2.exports = {
|
|
543587
543587
|
name: "@ledgerhq/live-common",
|
|
543588
543588
|
description: "Common ground for the Ledger Live apps",
|
|
543589
|
-
version: "34.54.0-nightly.
|
|
543589
|
+
version: "34.54.0-nightly.20251129023709",
|
|
543590
543590
|
repository: {
|
|
543591
543591
|
type: "git",
|
|
543592
543592
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -543939,7 +543939,7 @@ var require_package9 = __commonJS({
|
|
|
543939
543939
|
"package.json"(exports2, module2) {
|
|
543940
543940
|
module2.exports = {
|
|
543941
543941
|
name: "@ledgerhq/live-cli",
|
|
543942
|
-
version: "24.29.0-nightly.
|
|
543942
|
+
version: "24.29.0-nightly.20251129023709",
|
|
543943
543943
|
description: "ledger-live CLI version",
|
|
543944
543944
|
repository: {
|
|
543945
543945
|
type: "git",
|
|
@@ -567711,7 +567711,7 @@ var getDefaultAccountName = (account3) => {
|
|
|
567711
567711
|
};
|
|
567712
567712
|
|
|
567713
567713
|
// ../../libs/ledger-live-common/lib-es/account/formatters.js
|
|
567714
|
-
var
|
|
567714
|
+
var import_bignumber388 = require("bignumber.js");
|
|
567715
567715
|
var import_invariant73 = __toESM(require("invariant"));
|
|
567716
567716
|
|
|
567717
567717
|
// ../../libs/ledger-live-common/lib-es/account/serialization.js
|
|
@@ -568286,7 +568286,7 @@ var mergeNfts = (oldNfts, newNfts) => {
|
|
|
568286
568286
|
}
|
|
568287
568287
|
return Object.values(newNftsPerId).concat(nfts);
|
|
568288
568288
|
};
|
|
568289
|
-
var makeSync = ({ getAccountShape: getAccountShape21, postSync:
|
|
568289
|
+
var makeSync = ({ getAccountShape: getAccountShape21, postSync: postSync8 = (_24, a134) => a134, shouldMergeOps = true }) => (initial, syncConfig) => new import_rxjs6.Observable((o102) => {
|
|
568290
568290
|
async function main2() {
|
|
568291
568291
|
const accountId2 = encodeAccountId({
|
|
568292
568292
|
type: "js",
|
|
@@ -568312,7 +568312,7 @@ var makeSync = ({ getAccountShape: getAccountShape21, postSync: postSync7 = (_24
|
|
|
568312
568312
|
a134 = clearAccount(acc);
|
|
568313
568313
|
}
|
|
568314
568314
|
const operations4 = shouldMergeOps ? mergeOps(a134.operations, shape.operations || []) : shape.operations || [];
|
|
568315
|
-
a134 =
|
|
568315
|
+
a134 = postSync8(a134, {
|
|
568316
568316
|
...a134,
|
|
568317
568317
|
id: accountId2,
|
|
568318
568318
|
spendableBalance: shape.balance || a134.balance,
|
|
@@ -568352,7 +568352,7 @@ var defaultIterateResultBuilder = (getAddressFn) => () => Promise.resolve(async
|
|
|
568352
568352
|
}
|
|
568353
568353
|
return res;
|
|
568354
568354
|
});
|
|
568355
|
-
var makeScanAccounts = ({ getAccountShape: getAccountShape21, buildIterateResult: buildIterateResult2, getAddressFn, postSync:
|
|
568355
|
+
var makeScanAccounts = ({ getAccountShape: getAccountShape21, buildIterateResult: buildIterateResult2, getAddressFn, postSync: postSync8 = (_24, a134) => a134 }) => ({ currency: currency24, deviceId, syncConfig, scheme }) => new import_rxjs6.Observable((o102) => {
|
|
568356
568356
|
if (buildIterateResult2 === void 0) {
|
|
568357
568357
|
buildIterateResult2 = defaultIterateResultBuilder(getAddressFn);
|
|
568358
568358
|
}
|
|
@@ -568419,7 +568419,7 @@ var makeScanAccounts = ({ getAccountShape: getAccountShape21, buildIterateResult
|
|
|
568419
568419
|
res.address = account3.freshAddress;
|
|
568420
568420
|
derivationsCache[account3.freshAddressPath] = res;
|
|
568421
568421
|
}
|
|
568422
|
-
account3 =
|
|
568422
|
+
account3 = postSync8(initialAccount, account3);
|
|
568423
568423
|
log2("scanAccounts", "derivationsCache", res);
|
|
568424
568424
|
log2("scanAccounts", `scanning ${currency24.id} at ${freshAddressPath}: ${res.address} resulted of ${account3 ? `Account with ${account3.operations.length} txs` : "no account"}`);
|
|
568425
568425
|
if (!account3)
|
|
@@ -847473,6 +847473,7 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
|
|
|
847473
847473
|
blockHeight: null,
|
|
847474
847474
|
senders: [account3.freshAddress],
|
|
847475
847475
|
recipients: [transaction.recipient],
|
|
847476
|
+
transactionSequenceNumber: new import_bignumber378.default(sequenceNumber?.toString() ?? 0),
|
|
847476
847477
|
accountId: subAccountId,
|
|
847477
847478
|
date: /* @__PURE__ */ new Date(),
|
|
847478
847479
|
transactionRaw: toGenericTransactionRaw({
|
|
@@ -848095,11 +848096,31 @@ var genericSignRawOperation = (network, kind) => (signerContext4) => ({ account:
|
|
|
848095
848096
|
main2().then(() => o102.complete(), (e101) => o102.error(e101));
|
|
848096
848097
|
});
|
|
848097
848098
|
|
|
848099
|
+
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/postSync.js
|
|
848100
|
+
var import_bignumber387 = __toESM(require("bignumber.js"));
|
|
848101
|
+
function postSync7(initial, synced) {
|
|
848102
|
+
const lastOperation = synced.operations.find((op) => ["OUT", "FEES"].includes(op.type));
|
|
848103
|
+
const latestSequence = lastOperation?.transactionSequenceNumber || new import_bignumber387.default(-1);
|
|
848104
|
+
function isPending2(account3, op) {
|
|
848105
|
+
return (
|
|
848106
|
+
// Operation is not confirmed
|
|
848107
|
+
!account3.operations.some((o102) => o102.hash === op.hash) && // Operation is not outdated
|
|
848108
|
+
op.transactionSequenceNumber !== void 0 && op.transactionSequenceNumber.gt(latestSequence)
|
|
848109
|
+
);
|
|
848110
|
+
}
|
|
848111
|
+
const pendingOperations = initial.pendingOperations.length ? initial.pendingOperations.filter((op) => isPending2(synced, op)) : [];
|
|
848112
|
+
const subAccounts = synced.subAccounts?.length ? synced.subAccounts.map((subAccount) => ({
|
|
848113
|
+
...subAccount,
|
|
848114
|
+
pendingOperations: subAccount.pendingOperations.filter((op) => isPending2(subAccount, op))
|
|
848115
|
+
})) : [];
|
|
848116
|
+
return { ...synced, pendingOperations, subAccounts };
|
|
848117
|
+
}
|
|
848118
|
+
|
|
848098
848119
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/accountBridge.js
|
|
848099
848120
|
function getAlpacaAccountBridge(network, kind, customSigner) {
|
|
848100
848121
|
const signer2 = customSigner ?? getSigner(network);
|
|
848101
848122
|
return {
|
|
848102
|
-
sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind) }),
|
|
848123
|
+
sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind), postSync: postSync7 }),
|
|
848103
848124
|
receive: makeAccountBridgeReceive(getAddressWrapper_default(signer2.getAddress)),
|
|
848104
848125
|
createTransaction: createTransaction41,
|
|
848105
848126
|
updateTransaction,
|
|
@@ -848124,7 +848145,8 @@ function getAlpacaCurrencyBridge(network, kind, customSigner) {
|
|
|
848124
848145
|
},
|
|
848125
848146
|
scanAccounts: makeScanAccounts({
|
|
848126
848147
|
getAccountShape: genericGetAccountShape(network, kind),
|
|
848127
|
-
getAddressFn: signer2.getAddress.bind(signer2)
|
|
848148
|
+
getAddressFn: signer2.getAddress.bind(signer2),
|
|
848149
|
+
postSync: postSync7
|
|
848128
848150
|
})
|
|
848129
848151
|
};
|
|
848130
848152
|
}
|
|
@@ -848318,7 +848340,7 @@ ${head2}${sub}`;
|
|
|
848318
848340
|
return (op) => format6(op, 0);
|
|
848319
848341
|
};
|
|
848320
848342
|
function maybeDisplaySumOfOpsIssue(ops, balance2, unit) {
|
|
848321
|
-
const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new
|
|
848343
|
+
const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new import_bignumber388.BigNumber(0));
|
|
848322
848344
|
if (sumOfOps.eq(balance2))
|
|
848323
848345
|
return "";
|
|
848324
848346
|
return " (! sum of ops " + formatCurrencyUnit(unit, sumOfOps, {
|
|
@@ -848366,7 +848388,7 @@ var cliFormat = (account3, level2) => {
|
|
|
848366
848388
|
};
|
|
848367
848389
|
var stats = (account3) => {
|
|
848368
848390
|
const { subAccounts, operations: operations4 } = account3;
|
|
848369
|
-
const sumOfAllOpsNumber = operations4.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new
|
|
848391
|
+
const sumOfAllOpsNumber = operations4.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new import_bignumber388.BigNumber(0));
|
|
848370
848392
|
const sumOfAllOps = formatCurrencyUnit(getAccountCurrency(account3).units[0], sumOfAllOpsNumber, {
|
|
848371
848393
|
showCode: true
|
|
848372
848394
|
});
|
|
@@ -848391,7 +848413,7 @@ var operationBalanceHistoryBackwards = (account3) => {
|
|
|
848391
848413
|
}).reverse());
|
|
848392
848414
|
};
|
|
848393
848415
|
var operationBalanceHistory = (account3) => {
|
|
848394
|
-
let acc = new
|
|
848416
|
+
let acc = new import_bignumber388.BigNumber(0);
|
|
848395
848417
|
return JSON.stringify(account3.operations.slice(0).reverse().map((op) => {
|
|
848396
848418
|
acc = acc.plus(getOperationAmountNumberWithInternals(op));
|
|
848397
848419
|
const { blockHeight } = op;
|
|
@@ -848498,37 +848520,37 @@ var toSignOperationEventRaw = (e101) => {
|
|
|
848498
848520
|
var displayTokenValue = (token) => `${token.name} (#${extractTokenId(token.id)})`;
|
|
848499
848521
|
|
|
848500
848522
|
// ../../libs/coin-modules/coin-cardano/lib-es/deviceTransactionConfig.js
|
|
848501
|
-
var
|
|
848523
|
+
var import_bignumber389 = __toESM(require("bignumber.js"));
|
|
848502
848524
|
var import_typhonjs12 = __toESM(require_dist6());
|
|
848503
848525
|
|
|
848504
848526
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/deviceTransactionConfig.js
|
|
848505
848527
|
init_lib_es2();
|
|
848506
848528
|
|
|
848507
848529
|
// ../../libs/coin-modules/coin-evm/lib-es/deviceTransactionConfig.js
|
|
848508
|
-
var
|
|
848530
|
+
var import_bignumber390 = __toESM(require("bignumber.js"));
|
|
848509
848531
|
|
|
848510
848532
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/deviceTransactionConfig.js
|
|
848511
848533
|
init_lib_es2();
|
|
848512
848534
|
var currency4 = getCryptoCurrencyById("internet_computer");
|
|
848513
848535
|
|
|
848514
848536
|
// ../../libs/coin-modules/coin-multiversx/lib-es/deviceTransactionConfig.js
|
|
848515
|
-
var
|
|
848537
|
+
var import_bignumber391 = __toESM(require("bignumber.js"));
|
|
848516
848538
|
|
|
848517
848539
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/deviceTransactionConfig.js
|
|
848518
848540
|
var currency5 = getCryptoCurrencyById("polkadot");
|
|
848519
848541
|
|
|
848520
848542
|
// ../../libs/coin-modules/coin-solana/lib-es/deviceTransactionConfig.js
|
|
848521
|
-
var
|
|
848543
|
+
var import_bignumber392 = __toESM(require("bignumber.js"));
|
|
848522
848544
|
|
|
848523
848545
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/deviceTransactionConfig.js
|
|
848524
|
-
var
|
|
848546
|
+
var import_bignumber393 = require("bignumber.js");
|
|
848525
848547
|
|
|
848526
848548
|
// ../../libs/coin-modules/coin-ton/lib-es/deviceTransactionConfig.js
|
|
848527
848549
|
var import_core22 = __toESM(require_dist2());
|
|
848528
|
-
var
|
|
848550
|
+
var import_bignumber394 = require("bignumber.js");
|
|
848529
848551
|
|
|
848530
848552
|
// ../../libs/coin-modules/coin-algorand/lib-es/transaction.js
|
|
848531
|
-
var
|
|
848553
|
+
var import_bignumber395 = require("bignumber.js");
|
|
848532
848554
|
var formatTransaction2 = ({ mode, subAccountId, amount, recipient, fees: fees2, useAllAmount }, mainAccount) => {
|
|
848533
848555
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
848534
848556
|
return `
|
|
@@ -848547,7 +848569,7 @@ var fromTransactionRaw2 = (tr3) => {
|
|
|
848547
848569
|
return {
|
|
848548
848570
|
...common,
|
|
848549
848571
|
family: tr3.family,
|
|
848550
|
-
fees: tr3.fees ? new
|
|
848572
|
+
fees: tr3.fees ? new import_bignumber395.BigNumber(tr3.fees) : null,
|
|
848551
848573
|
memo: tr3.memo,
|
|
848552
848574
|
mode: tr3.mode,
|
|
848553
848575
|
assetId: tr3.assetId
|
|
@@ -848574,7 +848596,7 @@ var transaction_default3 = {
|
|
|
848574
848596
|
};
|
|
848575
848597
|
|
|
848576
848598
|
// ../../libs/coin-modules/coin-aptos/lib-es/bridge/transaction.js
|
|
848577
|
-
var
|
|
848599
|
+
var import_bignumber396 = require("bignumber.js");
|
|
848578
848600
|
var formatTransaction3 = ({ mode, amount, fees: fees2, recipient, useAllAmount }, account3) => {
|
|
848579
848601
|
return `
|
|
848580
848602
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(account3.currency.units[0], amount)}
|
|
@@ -848588,7 +848610,7 @@ var fromTransactionRaw3 = (t110) => {
|
|
|
848588
848610
|
family: t110.family,
|
|
848589
848611
|
mode: t110.mode,
|
|
848590
848612
|
options: JSON.parse(t110.options),
|
|
848591
|
-
...t110.fees && { fees: new
|
|
848613
|
+
...t110.fees && { fees: new import_bignumber396.BigNumber(t110.fees) },
|
|
848592
848614
|
...t110.errors && { errors: JSON.parse(t110.errors) }
|
|
848593
848615
|
};
|
|
848594
848616
|
};
|
|
@@ -848613,14 +848635,14 @@ var transaction_default4 = {
|
|
|
848613
848635
|
};
|
|
848614
848636
|
|
|
848615
848637
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/transaction.js
|
|
848616
|
-
var
|
|
848638
|
+
var import_bignumber397 = require("bignumber.js");
|
|
848617
848639
|
var fromFeeItemsRaw = (fir) => ({
|
|
848618
848640
|
items: fir.items.map((fi) => ({
|
|
848619
848641
|
key: fi.key,
|
|
848620
848642
|
speed: fi.speed,
|
|
848621
|
-
feePerByte: new
|
|
848643
|
+
feePerByte: new import_bignumber397.BigNumber(fi.feePerByte)
|
|
848622
848644
|
})),
|
|
848623
|
-
defaultFeePerByte: new
|
|
848645
|
+
defaultFeePerByte: new import_bignumber397.BigNumber(fir.defaultFeePerByte)
|
|
848624
848646
|
});
|
|
848625
848647
|
var toFeeItemsRaw = (fir) => ({
|
|
848626
848648
|
items: fir.items.map((fi) => ({
|
|
@@ -848637,7 +848659,7 @@ var fromTransactionRaw4 = (tr3) => {
|
|
|
848637
848659
|
rbf: tr3.rbf,
|
|
848638
848660
|
utxoStrategy: tr3.utxoStrategy,
|
|
848639
848661
|
family: tr3.family,
|
|
848640
|
-
feePerByte: tr3.feePerByte ? new
|
|
848662
|
+
feePerByte: tr3.feePerByte ? new import_bignumber397.BigNumber(tr3.feePerByte) : null,
|
|
848641
848663
|
networkInfo: tr3.networkInfo && {
|
|
848642
848664
|
family: tr3.networkInfo.family,
|
|
848643
848665
|
feeItems: fromFeeItemsRaw(tr3.networkInfo.feeItems)
|
|
@@ -848731,7 +848753,7 @@ var transaction_default5 = {
|
|
|
848731
848753
|
};
|
|
848732
848754
|
|
|
848733
848755
|
// ../../libs/coin-modules/coin-cardano/lib-es/transaction.js
|
|
848734
|
-
var
|
|
848756
|
+
var import_bignumber398 = require("bignumber.js");
|
|
848735
848757
|
var formatTransaction5 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
848736
848758
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
848737
848759
|
return `
|
|
@@ -848747,7 +848769,7 @@ var fromTransactionRaw5 = (tr3) => {
|
|
|
848747
848769
|
...common,
|
|
848748
848770
|
family: tr3.family,
|
|
848749
848771
|
mode: tr3.mode,
|
|
848750
|
-
fees: tr3.fees ? new
|
|
848772
|
+
fees: tr3.fees ? new import_bignumber398.BigNumber(tr3.fees) : void 0,
|
|
848751
848773
|
memo: tr3.memo,
|
|
848752
848774
|
poolId: tr3.poolId,
|
|
848753
848775
|
protocolParams: tr3.protocolParams
|
|
@@ -848775,7 +848797,7 @@ var transaction_default6 = {
|
|
|
848775
848797
|
};
|
|
848776
848798
|
|
|
848777
848799
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/transaction.js
|
|
848778
|
-
var
|
|
848800
|
+
var import_bignumber399 = __toESM(require("bignumber.js"));
|
|
848779
848801
|
var formatTransaction6 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
848780
848802
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848781
848803
|
showCode: true,
|
|
@@ -848787,8 +848809,8 @@ var fromTransactionRaw6 = (tr3) => {
|
|
|
848787
848809
|
return {
|
|
848788
848810
|
...common,
|
|
848789
848811
|
family: tr3.family,
|
|
848790
|
-
fees: new
|
|
848791
|
-
amount: new
|
|
848812
|
+
fees: new import_bignumber399.default(tr3.fees),
|
|
848813
|
+
amount: new import_bignumber399.default(tr3.amount),
|
|
848792
848814
|
transferId: tr3.transferId
|
|
848793
848815
|
};
|
|
848794
848816
|
};
|
|
@@ -848812,7 +848834,7 @@ var transaction_default7 = {
|
|
|
848812
848834
|
};
|
|
848813
848835
|
|
|
848814
848836
|
// ../../libs/coin-modules/coin-canton/lib-es/bridge/transaction.js
|
|
848815
|
-
var
|
|
848837
|
+
var import_bignumber400 = require("bignumber.js");
|
|
848816
848838
|
var formatTransaction7 = ({ amount, recipient, fee, useAllAmount }, account3) => `
|
|
848817
848839
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848818
848840
|
showCode: true,
|
|
@@ -848828,7 +848850,7 @@ var fromTransactionRaw7 = (tr3) => {
|
|
|
848828
848850
|
return {
|
|
848829
848851
|
...common,
|
|
848830
848852
|
family: tr3.family,
|
|
848831
|
-
fee: tr3.fee ? new
|
|
848853
|
+
fee: tr3.fee ? new import_bignumber400.BigNumber(tr3.fee) : null,
|
|
848832
848854
|
tokenId: tr3.tokenId
|
|
848833
848855
|
};
|
|
848834
848856
|
};
|
|
@@ -848851,7 +848873,7 @@ var transaction_default8 = {
|
|
|
848851
848873
|
};
|
|
848852
848874
|
|
|
848853
848875
|
// ../../libs/coin-modules/coin-celo/lib-es/bridge/transaction.js
|
|
848854
|
-
var
|
|
848876
|
+
var import_bignumber401 = require("bignumber.js");
|
|
848855
848877
|
var formatTransaction8 = (t110, account3) => `
|
|
848856
848878
|
SEND ${t110.useAllAmount ? "MAX CELO" : formatCurrencyUnit(getAccountCurrency(account3).units[0], t110.amount, {
|
|
848857
848879
|
showCode: true,
|
|
@@ -848863,7 +848885,7 @@ var fromTransactionRaw8 = (tr3) => {
|
|
|
848863
848885
|
return {
|
|
848864
848886
|
...common,
|
|
848865
848887
|
family: tr3.family,
|
|
848866
|
-
fees: tr3.fees ? new
|
|
848888
|
+
fees: tr3.fees ? new import_bignumber401.BigNumber(tr3.fees) : null,
|
|
848867
848889
|
mode: tr3.mode,
|
|
848868
848890
|
index: tr3.index
|
|
848869
848891
|
};
|
|
@@ -848888,7 +848910,7 @@ var transaction_default9 = {
|
|
|
848888
848910
|
};
|
|
848889
848911
|
|
|
848890
848912
|
// ../../libs/coin-modules/coin-cosmos/lib-es/transaction.js
|
|
848891
|
-
var
|
|
848913
|
+
var import_bignumber402 = require("bignumber.js");
|
|
848892
848914
|
var formatTransaction9 = ({ mode, amount, fees: fees2, recipient, validators: validators7, memo: memo3, sourceValidator, useAllAmount }, account3) => `
|
|
848893
848915
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848894
848916
|
showCode: true,
|
|
@@ -848909,13 +848931,13 @@ var fromTransactionRaw9 = (tr3) => {
|
|
|
848909
848931
|
mode: tr3.mode,
|
|
848910
848932
|
networkInfo: networkInfo && {
|
|
848911
848933
|
family: networkInfo.family,
|
|
848912
|
-
fees: new
|
|
848934
|
+
fees: new import_bignumber402.BigNumber(networkInfo.fees)
|
|
848913
848935
|
},
|
|
848914
|
-
fees: tr3.fees ? new
|
|
848915
|
-
gas: tr3.gas ? new
|
|
848936
|
+
fees: tr3.fees ? new import_bignumber402.BigNumber(tr3.fees) : null,
|
|
848937
|
+
gas: tr3.gas ? new import_bignumber402.BigNumber(tr3.gas) : null,
|
|
848916
848938
|
memo: tr3.memo,
|
|
848917
848939
|
sourceValidator: tr3.sourceValidator,
|
|
848918
|
-
validators: tr3.validators ? tr3.validators.map((v64) => ({ ...v64, amount: new
|
|
848940
|
+
validators: tr3.validators ? tr3.validators.map((v64) => ({ ...v64, amount: new import_bignumber402.BigNumber(v64.amount) })) : []
|
|
848919
848941
|
};
|
|
848920
848942
|
};
|
|
848921
848943
|
var toTransactionRaw9 = (t110) => {
|
|
@@ -848946,7 +848968,7 @@ var transaction_default10 = {
|
|
|
848946
848968
|
};
|
|
848947
848969
|
|
|
848948
848970
|
// ../../libs/coin-modules/coin-hedera/lib-es/transaction.js
|
|
848949
|
-
var
|
|
848971
|
+
var import_bignumber403 = __toESM(require("bignumber.js"));
|
|
848950
848972
|
function formatTransaction10(transaction, account3) {
|
|
848951
848973
|
const amount = formatCurrencyUnit(getAccountCurrency(account3).units[0], transaction.amount, {
|
|
848952
848974
|
showCode: true,
|
|
@@ -848960,7 +848982,7 @@ function fromTransactionRaw10(tr3) {
|
|
|
848960
848982
|
const commonHedera = {
|
|
848961
848983
|
family: tr3.family,
|
|
848962
848984
|
memo: tr3.memo,
|
|
848963
|
-
...tr3.maxFee && { maxFee: new
|
|
848985
|
+
...tr3.maxFee && { maxFee: new import_bignumber403.default(tr3.maxFee) }
|
|
848964
848986
|
};
|
|
848965
848987
|
if (tr3.mode === HEDERA_TRANSACTION_MODES.TokenAssociate) {
|
|
848966
848988
|
return {
|
|
@@ -848976,7 +848998,7 @@ function fromTransactionRaw10(tr3) {
|
|
|
848976
848998
|
...commonGeneric,
|
|
848977
848999
|
...commonHedera,
|
|
848978
849000
|
mode: tr3.mode,
|
|
848979
|
-
...tr3.gasLimit && { gasLimit: new
|
|
849001
|
+
...tr3.gasLimit && { gasLimit: new import_bignumber403.default(tr3.gasLimit) }
|
|
848980
849002
|
};
|
|
848981
849003
|
}
|
|
848982
849004
|
function toTransactionRaw10(t110) {
|
|
@@ -849013,7 +849035,7 @@ var transaction_default11 = {
|
|
|
849013
849035
|
};
|
|
849014
849036
|
|
|
849015
849037
|
// ../../libs/coin-modules/coin-filecoin/lib-es/bridge/transaction.js
|
|
849016
|
-
var
|
|
849038
|
+
var import_bignumber404 = __toESM(require("bignumber.js"));
|
|
849017
849039
|
var formatTransaction11 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849018
849040
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849019
849041
|
showCode: true,
|
|
@@ -849028,10 +849050,10 @@ var fromTransactionRaw11 = (tr3) => {
|
|
|
849028
849050
|
version: tr3.version,
|
|
849029
849051
|
method: tr3.method,
|
|
849030
849052
|
nonce: tr3.nonce,
|
|
849031
|
-
amount: new
|
|
849032
|
-
gasFeeCap: new
|
|
849033
|
-
gasLimit: new
|
|
849034
|
-
gasPremium: new
|
|
849053
|
+
amount: new import_bignumber404.default(tr3.amount),
|
|
849054
|
+
gasFeeCap: new import_bignumber404.default(tr3.gasFeeCap),
|
|
849055
|
+
gasLimit: new import_bignumber404.default(tr3.gasLimit),
|
|
849056
|
+
gasPremium: new import_bignumber404.default(tr3.gasPremium)
|
|
849035
849057
|
};
|
|
849036
849058
|
};
|
|
849037
849059
|
var toTransactionRaw11 = (t110) => {
|
|
@@ -849058,7 +849080,7 @@ var transaction_default12 = {
|
|
|
849058
849080
|
};
|
|
849059
849081
|
|
|
849060
849082
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/transaction.js
|
|
849061
|
-
var
|
|
849083
|
+
var import_bignumber405 = __toESM(require("bignumber.js"));
|
|
849062
849084
|
var formatTransaction12 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849063
849085
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849064
849086
|
showCode: true,
|
|
@@ -849070,8 +849092,8 @@ var fromTransactionRaw12 = (tr3) => {
|
|
|
849070
849092
|
return {
|
|
849071
849093
|
...common,
|
|
849072
849094
|
family: tr3.family,
|
|
849073
|
-
fees: new
|
|
849074
|
-
amount: new
|
|
849095
|
+
fees: new import_bignumber405.default(tr3.fees),
|
|
849096
|
+
amount: new import_bignumber405.default(tr3.amount),
|
|
849075
849097
|
memo: tr3.memo
|
|
849076
849098
|
};
|
|
849077
849099
|
};
|
|
@@ -849095,7 +849117,7 @@ var transaction_default13 = {
|
|
|
849095
849117
|
};
|
|
849096
849118
|
|
|
849097
849119
|
// ../../libs/coin-modules/coin-icon/lib-es/transaction.js
|
|
849098
|
-
var
|
|
849120
|
+
var import_bignumber406 = require("bignumber.js");
|
|
849099
849121
|
var formatTransaction13 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849100
849122
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849101
849123
|
showCode: true,
|
|
@@ -849108,8 +849130,8 @@ var fromTransactionRaw13 = (tr3) => {
|
|
|
849108
849130
|
...common,
|
|
849109
849131
|
family: tr3.family,
|
|
849110
849132
|
mode: tr3.mode,
|
|
849111
|
-
fees: tr3.fees ? new
|
|
849112
|
-
stepLimit: tr3.stepLimit ? new
|
|
849133
|
+
fees: tr3.fees ? new import_bignumber406.BigNumber(tr3.fees) : null,
|
|
849134
|
+
stepLimit: tr3.stepLimit ? new import_bignumber406.BigNumber(tr3.stepLimit) : void 0
|
|
849113
849135
|
};
|
|
849114
849136
|
};
|
|
849115
849137
|
var toTransactionRaw13 = (t110) => {
|
|
@@ -849132,7 +849154,7 @@ var transaction_default14 = {
|
|
|
849132
849154
|
};
|
|
849133
849155
|
|
|
849134
849156
|
// ../../libs/coin-modules/coin-kaspa/lib-es/transaction.js
|
|
849135
|
-
var
|
|
849157
|
+
var import_bignumber407 = require("bignumber.js");
|
|
849136
849158
|
var formatTransactionStatus3 = (t110, ts2, mainAccount) => {
|
|
849137
849159
|
let str = "";
|
|
849138
849160
|
str += formatTransactionStatus(t110, ts2, mainAccount);
|
|
@@ -849154,10 +849176,10 @@ var fromTransactionRaw14 = (tr3) => {
|
|
|
849154
849176
|
family: tr3.family,
|
|
849155
849177
|
networkInfo: tr3.networkInfo.map((x29) => ({
|
|
849156
849178
|
...x29,
|
|
849157
|
-
amount: (0,
|
|
849179
|
+
amount: (0, import_bignumber407.BigNumber)(x29.amount)
|
|
849158
849180
|
})),
|
|
849159
849181
|
feesStrategy: tr3.feesStrategy,
|
|
849160
|
-
customFeeRate: tr3.customFeeRate ? (0,
|
|
849182
|
+
customFeeRate: tr3.customFeeRate ? (0, import_bignumber407.BigNumber)(tr3.customFeeRate) : void 0
|
|
849161
849183
|
};
|
|
849162
849184
|
};
|
|
849163
849185
|
var toTransactionRaw14 = (t110) => {
|
|
@@ -849183,7 +849205,7 @@ var transaction_default15 = {
|
|
|
849183
849205
|
};
|
|
849184
849206
|
|
|
849185
849207
|
// ../../libs/coin-modules/coin-multiversx/lib-es/transaction.js
|
|
849186
|
-
var
|
|
849208
|
+
var import_bignumber408 = require("bignumber.js");
|
|
849187
849209
|
var formatTransaction15 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
849188
849210
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849189
849211
|
return `
|
|
@@ -849199,7 +849221,7 @@ var fromTransactionRaw15 = (tr3) => {
|
|
|
849199
849221
|
...common,
|
|
849200
849222
|
family: tr3.family,
|
|
849201
849223
|
mode: tr3.mode,
|
|
849202
|
-
fees: tr3.fees ? new
|
|
849224
|
+
fees: tr3.fees ? new import_bignumber408.BigNumber(tr3.fees) : null,
|
|
849203
849225
|
gasLimit: tr3.gasLimit
|
|
849204
849226
|
};
|
|
849205
849227
|
if (tr3.data) {
|
|
@@ -849231,7 +849253,7 @@ var transaction_default16 = {
|
|
|
849231
849253
|
};
|
|
849232
849254
|
|
|
849233
849255
|
// ../../libs/coin-modules/coin-near/lib-es/transaction.js
|
|
849234
|
-
var
|
|
849256
|
+
var import_bignumber409 = require("bignumber.js");
|
|
849235
849257
|
var formatTransaction16 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849236
849258
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849237
849259
|
showCode: true,
|
|
@@ -849244,7 +849266,7 @@ var fromTransactionRaw16 = (transactionRaw) => {
|
|
|
849244
849266
|
...common,
|
|
849245
849267
|
family: transactionRaw.family,
|
|
849246
849268
|
mode: transactionRaw.mode,
|
|
849247
|
-
fees: new
|
|
849269
|
+
fees: new import_bignumber409.BigNumber(transactionRaw?.fees || 0)
|
|
849248
849270
|
};
|
|
849249
849271
|
};
|
|
849250
849272
|
var toTransactionRaw16 = (transaction) => {
|
|
@@ -849269,7 +849291,7 @@ var transaction_default17 = {
|
|
|
849269
849291
|
};
|
|
849270
849292
|
|
|
849271
849293
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/transaction.js
|
|
849272
|
-
var
|
|
849294
|
+
var import_bignumber410 = require("bignumber.js");
|
|
849273
849295
|
var formatTransaction17 = ({ mode, amount, recipient, validators: validators7, useAllAmount }, account3) => `
|
|
849274
849296
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849275
849297
|
showCode: true,
|
|
@@ -849282,7 +849304,7 @@ var fromTransactionRaw17 = (tr3) => {
|
|
|
849282
849304
|
...common,
|
|
849283
849305
|
family: tr3.family,
|
|
849284
849306
|
mode: tr3.mode,
|
|
849285
|
-
fees: tr3.fees ? new
|
|
849307
|
+
fees: tr3.fees ? new import_bignumber410.BigNumber(tr3.fees) : null,
|
|
849286
849308
|
validators: tr3.validators,
|
|
849287
849309
|
era: tr3.era,
|
|
849288
849310
|
rewardDestination: tr3.rewardDestination,
|
|
@@ -849312,7 +849334,7 @@ var transaction_default18 = {
|
|
|
849312
849334
|
};
|
|
849313
849335
|
|
|
849314
849336
|
// ../../libs/coin-modules/coin-solana/lib-es/transaction.js
|
|
849315
|
-
var
|
|
849337
|
+
var import_bignumber411 = require("bignumber.js");
|
|
849316
849338
|
var fromTransactionRaw18 = (tr3) => {
|
|
849317
849339
|
const common = fromTransactionCommonRaw(tr3);
|
|
849318
849340
|
const { family, model } = tr3;
|
|
@@ -849332,7 +849354,7 @@ var toTransactionRaw18 = (t110) => {
|
|
|
849332
849354
|
};
|
|
849333
849355
|
};
|
|
849334
849356
|
var lamportsToSOL = (account3, amount) => {
|
|
849335
|
-
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new
|
|
849357
|
+
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new import_bignumber411.BigNumber(amount), {
|
|
849336
849358
|
showCode: true,
|
|
849337
849359
|
disableRounding: true
|
|
849338
849360
|
});
|
|
@@ -849403,7 +849425,7 @@ function formatTokenTransfer(mainAccount, tx, command4) {
|
|
|
849403
849425
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
849404
849426
|
throw new Error("token subaccount expected");
|
|
849405
849427
|
}
|
|
849406
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
849428
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber411.BigNumber(command4.amount), {
|
|
849407
849429
|
showCode: true,
|
|
849408
849430
|
disableRounding: true
|
|
849409
849431
|
});
|
|
@@ -849431,7 +849453,7 @@ function formatCreateApprove(mainAccount, tx, command4) {
|
|
|
849431
849453
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
849432
849454
|
throw new Error("token subaccount expected");
|
|
849433
849455
|
}
|
|
849434
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
849456
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber411.BigNumber(command4.amount), {
|
|
849435
849457
|
showCode: true,
|
|
849436
849458
|
disableRounding: true
|
|
849437
849459
|
});
|
|
@@ -849494,7 +849516,7 @@ var transaction_default19 = {
|
|
|
849494
849516
|
};
|
|
849495
849517
|
|
|
849496
849518
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/transaction.js
|
|
849497
|
-
var
|
|
849519
|
+
var import_bignumber412 = __toESM(require("bignumber.js"));
|
|
849498
849520
|
var formatTransaction19 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849499
849521
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849500
849522
|
showCode: true,
|
|
@@ -849509,9 +849531,9 @@ var fromTransactionRaw19 = (tr3) => {
|
|
|
849509
849531
|
return {
|
|
849510
849532
|
...common,
|
|
849511
849533
|
family: tr3.family,
|
|
849512
|
-
nonce: tr3.nonce !== void 0 ? new
|
|
849513
|
-
fee: tr3.fee !== void 0 ? new
|
|
849514
|
-
amount: new
|
|
849534
|
+
nonce: tr3.nonce !== void 0 ? new import_bignumber412.default(tr3.nonce) : void 0,
|
|
849535
|
+
fee: tr3.fee !== void 0 ? new import_bignumber412.default(tr3.fee) : void 0,
|
|
849536
|
+
amount: new import_bignumber412.default(tr3.amount),
|
|
849515
849537
|
network: tr3.network,
|
|
849516
849538
|
anchorMode: tr3.anchorMode,
|
|
849517
849539
|
memo: tr3.memo
|
|
@@ -849540,7 +849562,7 @@ var transaction_default20 = {
|
|
|
849540
849562
|
};
|
|
849541
849563
|
|
|
849542
849564
|
// ../../libs/coin-modules/coin-stellar/lib-es/transaction.js
|
|
849543
|
-
var
|
|
849565
|
+
var import_bignumber413 = require("bignumber.js");
|
|
849544
849566
|
function formatTransaction20({ amount, recipient, fees: fees2, memoValue, useAllAmount, subAccountId }, mainAccount) {
|
|
849545
849567
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849546
849568
|
return `
|
|
@@ -849561,14 +849583,14 @@ function fromTransactionRaw20(tr3) {
|
|
|
849561
849583
|
return {
|
|
849562
849584
|
...common,
|
|
849563
849585
|
family: tr3.family,
|
|
849564
|
-
fees: tr3.fees ? new
|
|
849586
|
+
fees: tr3.fees ? new import_bignumber413.BigNumber(tr3.fees) : null,
|
|
849565
849587
|
memoValue: tr3.memoValue ? tr3.memoValue : null,
|
|
849566
849588
|
memoType: tr3.memoType ? tr3.memoType : null,
|
|
849567
849589
|
networkInfo: networkInfo && {
|
|
849568
849590
|
family: networkInfo.family,
|
|
849569
|
-
fees: new
|
|
849570
|
-
baseFee: new
|
|
849571
|
-
baseReserve: new
|
|
849591
|
+
fees: new import_bignumber413.BigNumber(networkInfo.fees),
|
|
849592
|
+
baseFee: new import_bignumber413.BigNumber(networkInfo.baseFee),
|
|
849593
|
+
baseReserve: new import_bignumber413.BigNumber(networkInfo.baseReserve),
|
|
849572
849594
|
networkCongestionLevel: networkInfo.networkCongestionLevel
|
|
849573
849595
|
},
|
|
849574
849596
|
mode: tr3.mode,
|
|
@@ -849609,7 +849631,7 @@ var transaction_default21 = {
|
|
|
849609
849631
|
};
|
|
849610
849632
|
|
|
849611
849633
|
// ../../libs/coin-modules/coin-tezos/lib-es/transaction.js
|
|
849612
|
-
var
|
|
849634
|
+
var import_bignumber414 = require("bignumber.js");
|
|
849613
849635
|
var formatTransaction21 = ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees: fees2, useAllAmount, estimatedFees }, mainAccount) => {
|
|
849614
849636
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849615
849637
|
return `
|
|
@@ -849632,12 +849654,12 @@ var fromTransactionRaw21 = (tr3) => {
|
|
|
849632
849654
|
mode: tr3.mode,
|
|
849633
849655
|
networkInfo: networkInfo && {
|
|
849634
849656
|
family: networkInfo.family,
|
|
849635
|
-
fees: new
|
|
849657
|
+
fees: new import_bignumber414.BigNumber(networkInfo.fees)
|
|
849636
849658
|
},
|
|
849637
|
-
fees: tr3.fees ? new
|
|
849638
|
-
gasLimit: tr3.gasLimit ? new
|
|
849639
|
-
storageLimit: tr3.storageLimit ? new
|
|
849640
|
-
estimatedFees: tr3.estimatedFees ? new
|
|
849659
|
+
fees: tr3.fees ? new import_bignumber414.BigNumber(tr3.fees) : null,
|
|
849660
|
+
gasLimit: tr3.gasLimit ? new import_bignumber414.BigNumber(tr3.gasLimit) : void 0,
|
|
849661
|
+
storageLimit: tr3.storageLimit ? new import_bignumber414.BigNumber(tr3.storageLimit) : void 0,
|
|
849662
|
+
estimatedFees: tr3.estimatedFees ? new import_bignumber414.BigNumber(tr3.estimatedFees) : void 0,
|
|
849641
849663
|
taquitoError: tr3.taquitoError
|
|
849642
849664
|
};
|
|
849643
849665
|
};
|
|
@@ -849669,7 +849691,7 @@ var transaction_default22 = {
|
|
|
849669
849691
|
};
|
|
849670
849692
|
|
|
849671
849693
|
// ../../libs/coin-modules/coin-ton/lib-es/transaction.js
|
|
849672
|
-
var
|
|
849694
|
+
var import_bignumber415 = __toESM(require("bignumber.js"));
|
|
849673
849695
|
var import_core23 = __toESM(require_dist2());
|
|
849674
849696
|
var formatTransaction22 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849675
849697
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
@@ -849820,7 +849842,7 @@ var fromTransactionRaw22 = (tr3) => {
|
|
|
849820
849842
|
return {
|
|
849821
849843
|
...common,
|
|
849822
849844
|
family: tr3.family,
|
|
849823
|
-
fees: new
|
|
849845
|
+
fees: new import_bignumber415.default(tr3.fees),
|
|
849824
849846
|
comment: tr3.comment,
|
|
849825
849847
|
payload: tr3.payload ? fromTransactionPayloadRaw(tr3.payload) : void 0
|
|
849826
849848
|
};
|
|
@@ -849981,7 +850003,7 @@ var transaction_default23 = {
|
|
|
849981
850003
|
};
|
|
849982
850004
|
|
|
849983
850005
|
// ../../libs/coin-modules/coin-tron/lib-es/bridge/transaction.js
|
|
849984
|
-
var
|
|
850006
|
+
var import_bignumber416 = require("bignumber.js");
|
|
849985
850007
|
var fromTransactionRaw23 = (tr3) => {
|
|
849986
850008
|
const common = fromTransactionCommonRaw(tr3);
|
|
849987
850009
|
const { networkInfo } = tr3;
|
|
@@ -849989,12 +850011,12 @@ var fromTransactionRaw23 = (tr3) => {
|
|
|
849989
850011
|
...common,
|
|
849990
850012
|
networkInfo: networkInfo && {
|
|
849991
850013
|
family: "tron",
|
|
849992
|
-
freeNetUsed: new
|
|
849993
|
-
freeNetLimit: new
|
|
849994
|
-
netUsed: new
|
|
849995
|
-
netLimit: new
|
|
849996
|
-
energyUsed: new
|
|
849997
|
-
energyLimit: new
|
|
850014
|
+
freeNetUsed: new import_bignumber416.BigNumber(networkInfo.freeNetUsed),
|
|
850015
|
+
freeNetLimit: new import_bignumber416.BigNumber(networkInfo.freeNetLimit),
|
|
850016
|
+
netUsed: new import_bignumber416.BigNumber(networkInfo.netUsed),
|
|
850017
|
+
netLimit: new import_bignumber416.BigNumber(networkInfo.netLimit),
|
|
850018
|
+
energyUsed: new import_bignumber416.BigNumber(networkInfo.energyUsed),
|
|
850019
|
+
energyLimit: new import_bignumber416.BigNumber(networkInfo.energyLimit)
|
|
849998
850020
|
},
|
|
849999
850021
|
family: tr3.family,
|
|
850000
850022
|
mode: tr3.mode,
|
|
@@ -850096,7 +850118,7 @@ var transaction_default25 = {
|
|
|
850096
850118
|
};
|
|
850097
850119
|
|
|
850098
850120
|
// ../../libs/coin-modules/coin-xrp/lib-es/transaction.js
|
|
850099
|
-
var
|
|
850121
|
+
var import_bignumber417 = require("bignumber.js");
|
|
850100
850122
|
var formatTransaction25 = ({ amount, recipient, fees: fees2, tag, useAllAmount }, account3) => `
|
|
850101
850123
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850102
850124
|
showCode: true,
|
|
@@ -850114,13 +850136,13 @@ var fromTransactionRaw25 = (tr3) => {
|
|
|
850114
850136
|
...common,
|
|
850115
850137
|
family: tr3.family,
|
|
850116
850138
|
tag: tr3.tag,
|
|
850117
|
-
fees: tr3.fees ? new
|
|
850139
|
+
fees: tr3.fees ? new import_bignumber417.BigNumber(tr3.fees) : null,
|
|
850118
850140
|
feeCustomUnit: tr3.feeCustomUnit,
|
|
850119
850141
|
// 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)
|
|
850120
850142
|
networkInfo: networkInfo && {
|
|
850121
850143
|
family: networkInfo.family,
|
|
850122
|
-
serverFee: new
|
|
850123
|
-
baseReserve: new
|
|
850144
|
+
serverFee: new import_bignumber417.BigNumber(networkInfo.serverFee),
|
|
850145
|
+
baseReserve: new import_bignumber417.BigNumber(networkInfo.baseReserve)
|
|
850124
850146
|
}
|
|
850125
850147
|
};
|
|
850126
850148
|
};
|
|
@@ -850151,7 +850173,7 @@ var transaction_default26 = {
|
|
|
850151
850173
|
};
|
|
850152
850174
|
|
|
850153
850175
|
// ../../libs/coin-modules/coin-sui/lib-es/bridge/transaction.js
|
|
850154
|
-
var
|
|
850176
|
+
var import_bignumber418 = require("bignumber.js");
|
|
850155
850177
|
var formatTransaction26 = (transaction, account3) => {
|
|
850156
850178
|
const { mode, amount, recipient, useAllAmount } = transaction;
|
|
850157
850179
|
return `
|
|
@@ -850171,7 +850193,7 @@ var fromTransactionRaw26 = (transaction) => {
|
|
|
850171
850193
|
family: transaction.family,
|
|
850172
850194
|
mode: transaction.mode,
|
|
850173
850195
|
coinType: transaction.coinType,
|
|
850174
|
-
fees: transaction.fees ? (0,
|
|
850196
|
+
fees: transaction.fees ? (0, import_bignumber418.BigNumber)(transaction.fees) : null,
|
|
850175
850197
|
errors: {}
|
|
850176
850198
|
};
|
|
850177
850199
|
};
|
|
@@ -850195,7 +850217,7 @@ var transaction_default27 = {
|
|
|
850195
850217
|
};
|
|
850196
850218
|
|
|
850197
850219
|
// ../../libs/coin-modules/coin-mina/lib-es/bridge/transaction.js
|
|
850198
|
-
var
|
|
850220
|
+
var import_bignumber419 = __toESM(require("bignumber.js"));
|
|
850199
850221
|
var formatTransaction27 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
850200
850222
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850201
850223
|
showCode: true,
|
|
@@ -850208,10 +850230,10 @@ var fromTransactionRaw27 = (tr3) => {
|
|
|
850208
850230
|
...common,
|
|
850209
850231
|
family: tr3.family,
|
|
850210
850232
|
fees: {
|
|
850211
|
-
fee: new
|
|
850212
|
-
accountCreationFee: new
|
|
850233
|
+
fee: new import_bignumber419.default(tr3.fees.fee),
|
|
850234
|
+
accountCreationFee: new import_bignumber419.default(tr3.fees.accountCreationFee)
|
|
850213
850235
|
},
|
|
850214
|
-
amount: new
|
|
850236
|
+
amount: new import_bignumber419.default(tr3.amount),
|
|
850215
850237
|
memo: tr3.memo,
|
|
850216
850238
|
nonce: tr3.nonce
|
|
850217
850239
|
};
|
|
@@ -862944,7 +862966,7 @@ var import_rxjs174 = require("rxjs");
|
|
|
862944
862966
|
// ../../libs/ledger-live-common/lib-es/bot/index.js
|
|
862945
862967
|
var import_fs3 = __toESM(require("fs"));
|
|
862946
862968
|
var import_path3 = __toESM(require("path"));
|
|
862947
|
-
var
|
|
862969
|
+
var import_bignumber444 = require("bignumber.js");
|
|
862948
862970
|
var import_uniq2 = __toESM(require("lodash/uniq"));
|
|
862949
862971
|
var import_groupBy6 = __toESM(require("lodash/groupBy"));
|
|
862950
862972
|
init_lib_es2();
|
|
@@ -862953,7 +862975,7 @@ var import_flatMap26 = __toESM(require("lodash/flatMap"));
|
|
|
862953
862975
|
|
|
862954
862976
|
// ../../libs/coin-framework/lib-es/bot/specs.js
|
|
862955
862977
|
init_lib_es2();
|
|
862956
|
-
var
|
|
862978
|
+
var import_bignumber420 = __toESM(require("bignumber.js"));
|
|
862957
862979
|
var import_expect = __toESM(require_build20());
|
|
862958
862980
|
var import_invariant76 = __toESM(require("invariant"));
|
|
862959
862981
|
var import_sample2 = __toESM(require("lodash/sample"));
|
|
@@ -863086,7 +863108,7 @@ function formatDeviceAmount(currency24, value2, options24 = defaultFormatOptions
|
|
|
863086
863108
|
if (deviceTicker)
|
|
863087
863109
|
code = deviceTicker;
|
|
863088
863110
|
}
|
|
863089
|
-
const fValue = value2.div(new
|
|
863111
|
+
const fValue = value2.div(new import_bignumber420.default(10).pow(unit.magnitude));
|
|
863090
863112
|
let v64 = options24.showAllDigits ? fValue.toFixed(unit.magnitude) : fValue.toString(10);
|
|
863091
863113
|
if (options24.forceFloating) {
|
|
863092
863114
|
if (!v64.includes(".")) {
|
|
@@ -863098,8 +863120,8 @@ function formatDeviceAmount(currency24, value2, options24 = defaultFormatOptions
|
|
|
863098
863120
|
return options24.postfixCode ? v64 + sep + code : code + sep + v64;
|
|
863099
863121
|
}
|
|
863100
863122
|
function expectSiblingsHaveSpendablePartGreaterThan(siblings, threshold) {
|
|
863101
|
-
const spendableTotal = siblings.reduce((acc, a134) => acc.plus(a134.spendableBalance), new
|
|
863102
|
-
const total = siblings.reduce((acc, a134) => acc.plus(a134.balance), new
|
|
863123
|
+
const spendableTotal = siblings.reduce((acc, a134) => acc.plus(a134.spendableBalance), new import_bignumber420.default(0));
|
|
863124
|
+
const total = siblings.reduce((acc, a134) => acc.plus(a134.balance), new import_bignumber420.default(0));
|
|
863103
863125
|
(0, import_invariant76.default)(spendableTotal.div(total).gt(threshold), "the spendable part of accounts is sufficient (threshold: %s)", threshold);
|
|
863104
863126
|
}
|
|
863105
863127
|
var genericTestDestination = ({ destination, operation, destinationBeforeTransaction, sendingOperation }) => {
|
|
@@ -863116,7 +863138,7 @@ var genericTestDestination = ({ destination, operation, destinationBeforeTransac
|
|
|
863116
863138
|
|
|
863117
863139
|
// ../../libs/coin-modules/coin-algorand/lib-es/specs.js
|
|
863118
863140
|
init_lib_es5();
|
|
863119
|
-
var
|
|
863141
|
+
var import_bignumber421 = require("bignumber.js");
|
|
863120
863142
|
var import_expect2 = __toESM(require_build20());
|
|
863121
863143
|
var import_invariant77 = __toESM(require("invariant"));
|
|
863122
863144
|
var import_sample3 = __toESM(require("lodash/sample"));
|
|
@@ -863351,7 +863373,7 @@ var algorand = {
|
|
|
863351
863373
|
feature: "tokens",
|
|
863352
863374
|
maxRun: 1,
|
|
863353
863375
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
863354
|
-
(0, import_invariant77.default)(maxSpendable.gt(new
|
|
863376
|
+
(0, import_invariant77.default)(maxSpendable.gt(new import_bignumber421.BigNumber(1e5)), "Spendable balance is too low");
|
|
863355
863377
|
const transaction = bridge27.createTransaction(account3);
|
|
863356
863378
|
const mode = "optIn";
|
|
863357
863379
|
const assetId = getRandomAssetId(account3);
|
|
@@ -863411,7 +863433,7 @@ var specs_default = {
|
|
|
863411
863433
|
var import_invariant78 = __toESM(require("invariant"));
|
|
863412
863434
|
var import_expect3 = __toESM(require_build20());
|
|
863413
863435
|
init_lib_es5();
|
|
863414
|
-
var
|
|
863436
|
+
var import_bignumber422 = __toESM(require("bignumber.js"));
|
|
863415
863437
|
|
|
863416
863438
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/speculos-deviceActions.js
|
|
863417
863439
|
var acceptTransaction2 = deviceActionFlow({
|
|
@@ -863488,7 +863510,7 @@ var acceptTokenTransaction = deviceActionFlow({
|
|
|
863488
863510
|
});
|
|
863489
863511
|
|
|
863490
863512
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/bot-specs.js
|
|
863491
|
-
var MIN_SAFE = new
|
|
863513
|
+
var MIN_SAFE = new import_bignumber422.default(1e-4);
|
|
863492
863514
|
var maxAccount = 6;
|
|
863493
863515
|
var aptosSpecs = {
|
|
863494
863516
|
name: "Aptos",
|
|
@@ -863600,7 +863622,7 @@ var bot_specs_default = {
|
|
|
863600
863622
|
|
|
863601
863623
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/specs.js
|
|
863602
863624
|
var import_expect4 = __toESM(require_build20());
|
|
863603
|
-
var
|
|
863625
|
+
var import_bignumber423 = require("bignumber.js");
|
|
863604
863626
|
var import_invariant79 = __toESM(require("invariant"));
|
|
863605
863627
|
var import_bchaddrjs2 = __toESM(require_bchaddr());
|
|
863606
863628
|
var import_sample4 = __toESM(require("lodash/sample"));
|
|
@@ -863696,7 +863718,7 @@ var genericTest = ({ operation, account: account3, transaction, status, accountB
|
|
|
863696
863718
|
botTest("picked utxo has been consumed", () => (0, import_expect4.default)(utxosPicked.filter((utxo) => utxo && utxo.blockHeight && getUTXOStatus(utxo, transaction.utxoStrategy).excluded)).toEqual([]));
|
|
863697
863719
|
};
|
|
863698
863720
|
var testDestination = genericTestDestination;
|
|
863699
|
-
var genericMinimalAmount = new
|
|
863721
|
+
var genericMinimalAmount = new import_bignumber423.BigNumber(15e3);
|
|
863700
863722
|
var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmount, targetAccountSize = 3, recipientVariation = (recipient) => recipient } = {}) => [
|
|
863701
863723
|
{
|
|
863702
863724
|
name: "move ~50%",
|
|
@@ -863709,7 +863731,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863709
863731
|
const amount = maxSpendable.div(1.9 + 0.2 * Math.random()).integerValue();
|
|
863710
863732
|
const transaction = {
|
|
863711
863733
|
...bridge27.createTransaction(account3),
|
|
863712
|
-
feePerByte: new
|
|
863734
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863713
863735
|
};
|
|
863714
863736
|
const updates7 = [
|
|
863715
863737
|
{
|
|
@@ -863741,7 +863763,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863741
863763
|
const sibling = pickSiblings(siblings, targetAccountSize);
|
|
863742
863764
|
const transaction = {
|
|
863743
863765
|
...bridge27.createTransaction(account3),
|
|
863744
|
-
feePerByte: new
|
|
863766
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863745
863767
|
};
|
|
863746
863768
|
const updates7 = [
|
|
863747
863769
|
{
|
|
@@ -863776,7 +863798,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863776
863798
|
(0, import_invariant79.default)(bitcoinResources, "bitcoin resources");
|
|
863777
863799
|
const transaction = {
|
|
863778
863800
|
...bridge27.createTransaction(account3),
|
|
863779
|
-
feePerByte: new
|
|
863801
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863780
863802
|
};
|
|
863781
863803
|
const utxo = (0, import_sample4.default)(bitcoinResources.utxos.filter((u116) => u116.blockHeight && u116.value.gt(genericMinimalAmount)));
|
|
863782
863804
|
(0, import_invariant79.default)(utxo, "no confirmed utxo");
|
|
@@ -863829,7 +863851,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863829
863851
|
(0, import_invariant79.default)(bitcoinResources, "bitcoin resources");
|
|
863830
863852
|
const transaction = {
|
|
863831
863853
|
...bridge27.createTransaction(account3),
|
|
863832
|
-
feePerByte: new
|
|
863854
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4),
|
|
863833
863855
|
opReturnData: Buffer.from("charley loves heidi", "utf-8")
|
|
863834
863856
|
};
|
|
863835
863857
|
return {
|
|
@@ -863860,7 +863882,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863860
863882
|
const recipient = recipientVariation(sibling.freshAddress);
|
|
863861
863883
|
const transaction = {
|
|
863862
863884
|
...bridge27.createTransaction(account3),
|
|
863863
|
-
feePerByte: new
|
|
863885
|
+
feePerByte: new import_bignumber423.BigNumber(0)
|
|
863864
863886
|
};
|
|
863865
863887
|
return {
|
|
863866
863888
|
transaction,
|
|
@@ -863882,7 +863904,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863882
863904
|
},
|
|
863883
863905
|
testDestination,
|
|
863884
863906
|
test: ({ account: account3 }) => {
|
|
863885
|
-
botTest("total of utxos is zero", () => (0, import_expect4.default)(account3.bitcoinResources?.utxos.filter((u116) => u116.blockHeight && u116.blockHeight < account3.blockHeight - 10).reduce((p136, c118) => p136.plus(c118.value), new
|
|
863907
|
+
botTest("total of utxos is zero", () => (0, import_expect4.default)(account3.bitcoinResources?.utxos.filter((u116) => u116.blockHeight && u116.blockHeight < account3.blockHeight - 10).reduce((p136, c118) => p136.plus(c118.value), new import_bignumber423.BigNumber(0)).toString()).toBe("0"));
|
|
863886
863908
|
}
|
|
863887
863909
|
}
|
|
863888
863910
|
];
|
|
@@ -864139,7 +864161,7 @@ var specs_default2 = {
|
|
|
864139
864161
|
// ../../libs/coin-modules/coin-cardano/lib-es/specs.js
|
|
864140
864162
|
var import_expect5 = __toESM(require_build20());
|
|
864141
864163
|
init_lib_es5();
|
|
864142
|
-
var
|
|
864164
|
+
var import_bignumber424 = __toESM(require("bignumber.js"));
|
|
864143
864165
|
var import_invariant80 = __toESM(require("invariant"));
|
|
864144
864166
|
var import_typhonjs13 = __toESM(require_dist6());
|
|
864145
864167
|
|
|
@@ -864302,7 +864324,7 @@ var cardano = {
|
|
|
864302
864324
|
{ subAccountId: subAccount.id },
|
|
864303
864325
|
{ recipient },
|
|
864304
864326
|
{
|
|
864305
|
-
amount: new
|
|
864327
|
+
amount: new import_bignumber424.default(subAccount.balance.dividedBy(10)).dp(0, import_bignumber424.default.ROUND_CEIL)
|
|
864306
864328
|
}
|
|
864307
864329
|
];
|
|
864308
864330
|
return {
|
|
@@ -864330,7 +864352,7 @@ var cardano = {
|
|
|
864330
864352
|
const updates7 = [
|
|
864331
864353
|
{ recipient },
|
|
864332
864354
|
{
|
|
864333
|
-
amount: new
|
|
864355
|
+
amount: new import_bignumber424.default(account3.balance.dividedBy(2)).dp(0, import_bignumber424.default.ROUND_CEIL)
|
|
864334
864356
|
},
|
|
864335
864357
|
{ memo: "LedgerLiveBot" }
|
|
864336
864358
|
];
|
|
@@ -864345,7 +864367,7 @@ var cardano = {
|
|
|
864345
864367
|
memo: transaction.memo
|
|
864346
864368
|
};
|
|
864347
864369
|
if (cardanoResources.delegation?.rewards.gt(0)) {
|
|
864348
|
-
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new
|
|
864370
|
+
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new import_bignumber424.default(cardanoResources.delegation.rewards), {
|
|
864349
864371
|
showCode: true,
|
|
864350
864372
|
disableRounding: true
|
|
864351
864373
|
});
|
|
@@ -864377,9 +864399,9 @@ var cardano = {
|
|
|
864377
864399
|
const changeAddress = import_typhonjs13.utils.getAddressFromString(account3.freshAddress);
|
|
864378
864400
|
const requiredAdaForChangeTokens = tokenBalance.length ? import_typhonjs13.utils.calculateMinUtxoAmountBabbage({
|
|
864379
864401
|
address: changeAddress,
|
|
864380
|
-
amount: new
|
|
864402
|
+
amount: new import_bignumber424.default(CARDANO_MAX_SUPPLY),
|
|
864381
864403
|
tokens: tokenBalance
|
|
864382
|
-
}, new
|
|
864404
|
+
}, new import_bignumber424.default(cardanoResources.protocolParams.utxoCostPerByte)) : new import_bignumber424.default(0);
|
|
864383
864405
|
botTest("remaining balance equals requiredAdaForTokens)", () => (0, import_expect5.default)(account3.balance).toEqual(requiredAdaForChangeTokens));
|
|
864384
864406
|
}
|
|
864385
864407
|
},
|
|
@@ -864475,7 +864497,7 @@ var specs_default3 = { cardano };
|
|
|
864475
864497
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
864476
864498
|
var import_invariant81 = __toESM(require("invariant"));
|
|
864477
864499
|
init_lib_es5();
|
|
864478
|
-
var
|
|
864500
|
+
var import_bignumber425 = __toESM(require("bignumber.js"));
|
|
864479
864501
|
var import_expect6 = __toESM(require_build20());
|
|
864480
864502
|
|
|
864481
864503
|
// ../../libs/coin-modules/coin-casper/lib-es/test/speculos-deviceActions.js
|
|
@@ -864528,7 +864550,7 @@ var acceptTransaction5 = deviceActionFlow({
|
|
|
864528
864550
|
});
|
|
864529
864551
|
|
|
864530
864552
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
864531
|
-
var MIN_SAFE2 = new
|
|
864553
|
+
var MIN_SAFE2 = new import_bignumber425.default(CASPER_MINIMUM_VALID_AMOUNT_MOTES * 2);
|
|
864532
864554
|
var maxAccount2 = 6;
|
|
864533
864555
|
var casperSpecs = {
|
|
864534
864556
|
name: "Casper",
|
|
@@ -864697,7 +864719,7 @@ var createLockMutation = () => ({
|
|
|
864697
864719
|
|
|
864698
864720
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createUnlockMutation.js
|
|
864699
864721
|
var import_invariant84 = __toESM(require("invariant"));
|
|
864700
|
-
var
|
|
864722
|
+
var import_bignumber426 = __toESM(require("bignumber.js"));
|
|
864701
864723
|
var currency10 = getCryptoCurrencyById("celo");
|
|
864702
864724
|
var minimalAmount3 = parseCurrencyUnit(currency10.units[0], "0.001");
|
|
864703
864725
|
var createUnlockMutation = () => ({
|
|
@@ -864708,7 +864730,7 @@ var createUnlockMutation = () => ({
|
|
|
864708
864730
|
(0, import_invariant84.default)(maxSpendable.gt(minimalAmount3), "Celo: Unlock | balance is too low");
|
|
864709
864731
|
const { celoResources } = account3;
|
|
864710
864732
|
(0, import_invariant84.default)(celoResources?.registrationStatus, "Celo: Unlock | Account is not registered");
|
|
864711
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
864733
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber426.default(0);
|
|
864712
864734
|
(0, import_invariant84.default)(nonvotingLockedBalance.gt(0), "Celo: Unlock | No non voting locked balance");
|
|
864713
864735
|
return {
|
|
864714
864736
|
transaction: bridge27.createTransaction(account3),
|
|
@@ -864749,7 +864771,7 @@ var createRegisterAccountMutation = () => ({
|
|
|
864749
864771
|
|
|
864750
864772
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createVoteMutation.js
|
|
864751
864773
|
var import_invariant86 = __toESM(require("invariant"));
|
|
864752
|
-
var
|
|
864774
|
+
var import_bignumber427 = __toESM(require("bignumber.js"));
|
|
864753
864775
|
var import_sampleSize = __toESM(require("lodash/sampleSize"));
|
|
864754
864776
|
var currency12 = getCryptoCurrencyById("celo");
|
|
864755
864777
|
var minimalAmount5 = parseCurrencyUnit(currency12.units[0], "0.001");
|
|
@@ -864761,7 +864783,7 @@ var createVoteMutation = () => ({
|
|
|
864761
864783
|
(0, import_invariant86.default)(maxSpendable.gt(minimalAmount5), "Celo: Vote | balance is too low");
|
|
864762
864784
|
const { celoResources } = account3;
|
|
864763
864785
|
(0, import_invariant86.default)(celoResources?.registrationStatus, "Celo: Vote | Account is not registered");
|
|
864764
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
864786
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber427.default(0);
|
|
864765
864787
|
(0, import_invariant86.default)(nonvotingLockedBalance.gt(0), "Celo: Vote | No non voting locked balance");
|
|
864766
864788
|
const votes2 = celoResources.votes || [];
|
|
864767
864789
|
const { validatorGroups } = getCurrentCeloPreloadData();
|
|
@@ -864964,7 +864986,7 @@ var bot_specs_default3 = {
|
|
|
864964
864986
|
};
|
|
864965
864987
|
|
|
864966
864988
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
864967
|
-
var
|
|
864989
|
+
var import_bignumber428 = require("bignumber.js");
|
|
864968
864990
|
var import_expect7 = __toESM(require_build20());
|
|
864969
864991
|
var import_invariant90 = __toESM(require("invariant"));
|
|
864970
864992
|
var import_sample5 = __toESM(require("lodash/sample"));
|
|
@@ -865083,12 +865105,12 @@ var acceptTransaction7 = deviceActionFlow({
|
|
|
865083
865105
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
865084
865106
|
var maxAccounts2 = 16;
|
|
865085
865107
|
function checkAmountsCloseEnough(amount1, amount2) {
|
|
865086
|
-
amount1 = new
|
|
865087
|
-
amount2 = new
|
|
865108
|
+
amount1 = new import_bignumber428.BigNumber(amount1);
|
|
865109
|
+
amount2 = new import_bignumber428.BigNumber(amount2);
|
|
865088
865110
|
(0, import_expect7.default)(amount1.isNegative()).toBe(false);
|
|
865089
865111
|
(0, import_expect7.default)(amount2.isNegative()).toBe(false);
|
|
865090
865112
|
const difference = amount1.minus(amount2).absoluteValue();
|
|
865091
|
-
const onePercentOfLargerNumber =
|
|
865113
|
+
const onePercentOfLargerNumber = import_bignumber428.BigNumber.max(amount1, amount2).multipliedBy(0.01);
|
|
865092
865114
|
const isCloseEnough = difference.isLessThan(onePercentOfLargerNumber);
|
|
865093
865115
|
if (!isCloseEnough) {
|
|
865094
865116
|
log2("bot", "delegation amounts do not match", `Amount1: ${amount1.toString()} , Amount2: ${amount2.toString()}`);
|
|
@@ -865398,14 +865420,14 @@ var generateGenericCosmosTest = (currencyId, isExpertModeRequired, config4) => {
|
|
|
865398
865420
|
...config4
|
|
865399
865421
|
};
|
|
865400
865422
|
};
|
|
865401
|
-
var cosmosMinimalTransactionAmount = new
|
|
865423
|
+
var cosmosMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865402
865424
|
var cosmos2 = {
|
|
865403
865425
|
...generateGenericCosmosTest("cosmos", false, {
|
|
865404
865426
|
minViableAmount: cosmosMinimalTransactionAmount,
|
|
865405
865427
|
mutations: cosmosLikeMutations(cosmosMinimalTransactionAmount)
|
|
865406
865428
|
})
|
|
865407
865429
|
};
|
|
865408
|
-
var osmosisMinimalTransactionAmount = new
|
|
865430
|
+
var osmosisMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865409
865431
|
var osmosis = {
|
|
865410
865432
|
...generateGenericCosmosTest("osmosis", false, {
|
|
865411
865433
|
minViableAmount: osmosisMinimalTransactionAmount,
|
|
@@ -865413,7 +865435,7 @@ var osmosis = {
|
|
|
865413
865435
|
testTimeout: 8 * 60 * 1e3
|
|
865414
865436
|
})
|
|
865415
865437
|
};
|
|
865416
|
-
var desmosMinimalTransactionAmount = new
|
|
865438
|
+
var desmosMinimalTransactionAmount = new import_bignumber428.BigNumber(500);
|
|
865417
865439
|
var desmos = {
|
|
865418
865440
|
...generateGenericCosmosTest("desmos", false, {
|
|
865419
865441
|
minViableAmount: desmosMinimalTransactionAmount,
|
|
@@ -865422,7 +865444,7 @@ var desmos = {
|
|
|
865422
865444
|
skipOperationHistory: true
|
|
865423
865445
|
})
|
|
865424
865446
|
};
|
|
865425
|
-
var dydxMinimalTransactionAmount = new
|
|
865447
|
+
var dydxMinimalTransactionAmount = new import_bignumber428.BigNumber(500);
|
|
865426
865448
|
var dydx = {
|
|
865427
865449
|
...generateGenericCosmosTest("dydx", false, {
|
|
865428
865450
|
minViableAmount: dydxMinimalTransactionAmount,
|
|
@@ -865431,7 +865453,7 @@ var dydx = {
|
|
|
865431
865453
|
skipOperationHistory: true
|
|
865432
865454
|
})
|
|
865433
865455
|
};
|
|
865434
|
-
var umeeMinimalTransactionAmount = new
|
|
865456
|
+
var umeeMinimalTransactionAmount = new import_bignumber428.BigNumber(15e3);
|
|
865435
865457
|
var umee = {
|
|
865436
865458
|
...generateGenericCosmosTest("umee", false, {
|
|
865437
865459
|
minViableAmount: umeeMinimalTransactionAmount,
|
|
@@ -865440,7 +865462,7 @@ var umee = {
|
|
|
865440
865462
|
skipOperationHistory: true
|
|
865441
865463
|
})
|
|
865442
865464
|
};
|
|
865443
|
-
var persistenceMinimalTransactionAmount = new
|
|
865465
|
+
var persistenceMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865444
865466
|
var persistence = {
|
|
865445
865467
|
...generateGenericCosmosTest("persistence", false, {
|
|
865446
865468
|
minViableAmount: persistenceMinimalTransactionAmount,
|
|
@@ -865449,7 +865471,7 @@ var persistence = {
|
|
|
865449
865471
|
skipOperationHistory: true
|
|
865450
865472
|
})
|
|
865451
865473
|
};
|
|
865452
|
-
var quicksilverMinimalTransactionAmount = new
|
|
865474
|
+
var quicksilverMinimalTransactionAmount = new import_bignumber428.BigNumber(600);
|
|
865453
865475
|
var quicksilver = {
|
|
865454
865476
|
...generateGenericCosmosTest("quicksilver", false, {
|
|
865455
865477
|
minViableAmount: quicksilverMinimalTransactionAmount,
|
|
@@ -865458,7 +865480,7 @@ var quicksilver = {
|
|
|
865458
865480
|
skipOperationHistory: true
|
|
865459
865481
|
})
|
|
865460
865482
|
};
|
|
865461
|
-
var onomyMinimalTransactionAmount = new
|
|
865483
|
+
var onomyMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865462
865484
|
var onomy = {
|
|
865463
865485
|
...generateGenericCosmosTest("onomy", false, {
|
|
865464
865486
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -865467,7 +865489,7 @@ var onomy = {
|
|
|
865467
865489
|
skipOperationHistory: true
|
|
865468
865490
|
})
|
|
865469
865491
|
};
|
|
865470
|
-
var seiMinimalTransactionAmount = new
|
|
865492
|
+
var seiMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865471
865493
|
var sei = {
|
|
865472
865494
|
...generateGenericCosmosTest("sei_network", false, {
|
|
865473
865495
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -865476,7 +865498,7 @@ var sei = {
|
|
|
865476
865498
|
skipOperationHistory: true
|
|
865477
865499
|
})
|
|
865478
865500
|
};
|
|
865479
|
-
var axelarMinimalTransactionAmount = new
|
|
865501
|
+
var axelarMinimalTransactionAmount = new import_bignumber428.BigNumber(1e4);
|
|
865480
865502
|
var axelar = {
|
|
865481
865503
|
...generateGenericCosmosTest("axelar", false, {
|
|
865482
865504
|
minViableAmount: axelarMinimalTransactionAmount,
|
|
@@ -865484,7 +865506,7 @@ var axelar = {
|
|
|
865484
865506
|
skipOperationHistory: true
|
|
865485
865507
|
})
|
|
865486
865508
|
};
|
|
865487
|
-
var secretNetworkMinimalTransactionAmount = new
|
|
865509
|
+
var secretNetworkMinimalTransactionAmount = new import_bignumber428.BigNumber(6e4);
|
|
865488
865510
|
var secretNetwork = {
|
|
865489
865511
|
...generateGenericCosmosTest("secret_network", false, {
|
|
865490
865512
|
minViableAmount: secretNetworkMinimalTransactionAmount,
|
|
@@ -865492,7 +865514,7 @@ var secretNetwork = {
|
|
|
865492
865514
|
skipOperationHistory: true
|
|
865493
865515
|
})
|
|
865494
865516
|
};
|
|
865495
|
-
var stargazeMinimalTransactionAmount = new
|
|
865517
|
+
var stargazeMinimalTransactionAmount = new import_bignumber428.BigNumber(16e4);
|
|
865496
865518
|
var stargaze = {
|
|
865497
865519
|
...generateGenericCosmosTest("stargaze", false, {
|
|
865498
865520
|
minViableAmount: stargazeMinimalTransactionAmount,
|
|
@@ -865500,7 +865522,7 @@ var stargaze = {
|
|
|
865500
865522
|
skipOperationHistory: true
|
|
865501
865523
|
})
|
|
865502
865524
|
};
|
|
865503
|
-
var coreumMinimalTransactionAmount = new
|
|
865525
|
+
var coreumMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865504
865526
|
var coreum = {
|
|
865505
865527
|
...generateGenericCosmosTest("coreum", false, {
|
|
865506
865528
|
minViableAmount: coreumMinimalTransactionAmount,
|
|
@@ -865508,7 +865530,7 @@ var coreum = {
|
|
|
865508
865530
|
skipOperationHistory: true
|
|
865509
865531
|
})
|
|
865510
865532
|
};
|
|
865511
|
-
var injectiveMinimalTransactionAmount = new
|
|
865533
|
+
var injectiveMinimalTransactionAmount = new import_bignumber428.BigNumber(1e6);
|
|
865512
865534
|
var injective = {
|
|
865513
865535
|
...generateGenericCosmosTest("injective", true, {
|
|
865514
865536
|
minViableAmount: injectiveMinimalTransactionAmount,
|
|
@@ -865516,7 +865538,7 @@ var injective = {
|
|
|
865516
865538
|
skipOperationHistory: true
|
|
865517
865539
|
})
|
|
865518
865540
|
};
|
|
865519
|
-
var mantraMinimalTransactionAmount = new
|
|
865541
|
+
var mantraMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865520
865542
|
var mantra = {
|
|
865521
865543
|
...generateGenericCosmosTest("mantra", false, {
|
|
865522
865544
|
minViableAmount: mantraMinimalTransactionAmount,
|
|
@@ -865524,7 +865546,7 @@ var mantra = {
|
|
|
865524
865546
|
skipOperationHistory: true
|
|
865525
865547
|
})
|
|
865526
865548
|
};
|
|
865527
|
-
var cryptoOrgMinimalTransactionAmount = new
|
|
865549
|
+
var cryptoOrgMinimalTransactionAmount = new import_bignumber428.BigNumber(1e6);
|
|
865528
865550
|
var cryptoOrg = {
|
|
865529
865551
|
...generateGenericCosmosTest("crypto_org", false, {
|
|
865530
865552
|
minViableAmount: cryptoOrgMinimalTransactionAmount,
|
|
@@ -865533,7 +865555,7 @@ var cryptoOrg = {
|
|
|
865533
865555
|
skipOperationHistory: true
|
|
865534
865556
|
})
|
|
865535
865557
|
};
|
|
865536
|
-
var xionMinimalTransactionAmount = new
|
|
865558
|
+
var xionMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865537
865559
|
var xion = {
|
|
865538
865560
|
...generateGenericCosmosTest("xion", false, {
|
|
865539
865561
|
minViableAmount: xionMinimalTransactionAmount,
|
|
@@ -865541,7 +865563,7 @@ var xion = {
|
|
|
865541
865563
|
skipOperationHistory: true
|
|
865542
865564
|
})
|
|
865543
865565
|
};
|
|
865544
|
-
var zenrockMinimalTransactionAmount = new
|
|
865566
|
+
var zenrockMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865545
865567
|
var zenrock = {
|
|
865546
865568
|
...generateGenericCosmosTest("zenrock", false, {
|
|
865547
865569
|
minViableAmount: zenrockMinimalTransactionAmount,
|
|
@@ -865549,7 +865571,7 @@ var zenrock = {
|
|
|
865549
865571
|
skipOperationHistory: true
|
|
865550
865572
|
})
|
|
865551
865573
|
};
|
|
865552
|
-
var babylonMinimalTransactionAmount = new
|
|
865574
|
+
var babylonMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865553
865575
|
var babylon = {
|
|
865554
865576
|
...generateGenericCosmosTest("babylon", false, {
|
|
865555
865577
|
minViableAmount: babylonMinimalTransactionAmount,
|
|
@@ -865583,7 +865605,7 @@ var specs_default4 = {
|
|
|
865583
865605
|
var import_expect8 = __toESM(require_build20());
|
|
865584
865606
|
var import_invariant91 = __toESM(require("invariant"));
|
|
865585
865607
|
var import_sample6 = __toESM(require("lodash/sample"));
|
|
865586
|
-
var
|
|
865608
|
+
var import_bignumber429 = __toESM(require("bignumber.js"));
|
|
865587
865609
|
init_lib_es5();
|
|
865588
865610
|
|
|
865589
865611
|
// ../../libs/coin-modules/coin-evm/lib-es/speculos-deviceActions.js
|
|
@@ -865754,7 +865776,7 @@ var testTokenDestination = (args3) => {
|
|
|
865754
865776
|
(0, import_expect8.default)(destination).toBeDefined();
|
|
865755
865777
|
});
|
|
865756
865778
|
const destinationBeforeTransaction = findSubAccountById(coinDestinationBeforeTransaction, operation.accountId);
|
|
865757
|
-
botTest("account balance increased with transaction amount", () => (0, import_expect8.default)(destination.balance.toString()).toBe((destinationBeforeTransaction?.balance || new
|
|
865779
|
+
botTest("account balance increased with transaction amount", () => (0, import_expect8.default)(destination.balance.toString()).toBe((destinationBeforeTransaction?.balance || new import_bignumber429.default(0)).plus(amount).toString()));
|
|
865758
865780
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect8.default)({
|
|
865759
865781
|
type: operation.type,
|
|
865760
865782
|
amount: operation.value.toString()
|
|
@@ -866132,7 +866154,7 @@ var bot_specs_default4 = { hedera };
|
|
|
866132
866154
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
866133
866155
|
var import_invariant94 = __toESM(require("invariant"));
|
|
866134
866156
|
init_lib_es5();
|
|
866135
|
-
var
|
|
866157
|
+
var import_bignumber430 = __toESM(require("bignumber.js"));
|
|
866136
866158
|
|
|
866137
866159
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/speculos-deviceActions.js
|
|
866138
866160
|
var import_invariant93 = __toESM(require("invariant"));
|
|
@@ -866278,7 +866300,7 @@ var generateDeviceActionFlow = (scenario) => {
|
|
|
866278
866300
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
866279
866301
|
var F4_RECIPIENT = "f410fncojwmrseefktoco6rcnb3zv2eiqfli7muhvqma";
|
|
866280
866302
|
var ETH_RECIPIENT = "0x689c9b3232210aa9b84ef444d0ef35d11102ad1f";
|
|
866281
|
-
var MIN_SAFE3 = new
|
|
866303
|
+
var MIN_SAFE3 = new import_bignumber430.default(1e5);
|
|
866282
866304
|
var maxAccount4 = 6;
|
|
866283
866305
|
var filecoinSpecs = {
|
|
866284
866306
|
name: "Filecoin",
|
|
@@ -866303,7 +866325,7 @@ var filecoinSpecs = {
|
|
|
866303
866325
|
deviceAction: generateDeviceActionFlow(BotScenario.F4_RECIPIENT),
|
|
866304
866326
|
testDestination: genericTestDestination,
|
|
866305
866327
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
866306
|
-
const amount = new
|
|
866328
|
+
const amount = new import_bignumber430.default("100");
|
|
866307
866329
|
return {
|
|
866308
866330
|
transaction: bridge27.createTransaction(account3),
|
|
866309
866331
|
updates: [
|
|
@@ -866324,7 +866346,7 @@ var filecoinSpecs = {
|
|
|
866324
866346
|
deviceAction: generateDeviceActionFlow(BotScenario.ETH_RECIPIENT),
|
|
866325
866347
|
testDestination: genericTestDestination,
|
|
866326
866348
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
866327
|
-
const amount = new
|
|
866349
|
+
const amount = new import_bignumber430.default("100");
|
|
866328
866350
|
return {
|
|
866329
866351
|
transaction: bridge27.createTransaction(account3),
|
|
866330
866352
|
updates: [
|
|
@@ -866423,7 +866445,7 @@ var bot_specs_default5 = {
|
|
|
866423
866445
|
var import_invariant95 = __toESM(require("invariant"));
|
|
866424
866446
|
init_lib_es5();
|
|
866425
866447
|
var import_expect10 = __toESM(require_build20());
|
|
866426
|
-
var
|
|
866448
|
+
var import_bignumber431 = __toESM(require("bignumber.js"));
|
|
866427
866449
|
|
|
866428
866450
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/speculos-deviceActions.js
|
|
866429
866451
|
var ignoreSpaces = (s129) => s129.replace(/ /g, "");
|
|
@@ -866477,7 +866499,7 @@ var acceptTransaction10 = deviceActionFlow({
|
|
|
866477
866499
|
});
|
|
866478
866500
|
|
|
866479
866501
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/bot-specs.js
|
|
866480
|
-
var MIN_SAFE4 = new
|
|
866502
|
+
var MIN_SAFE4 = new import_bignumber431.default(10);
|
|
866481
866503
|
var maxAccount5 = 6;
|
|
866482
866504
|
var internetComputerSpecs = {
|
|
866483
866505
|
name: "InternetComputer",
|
|
@@ -866572,7 +866594,7 @@ var bot_specs_default6 = {
|
|
|
866572
866594
|
// ../../libs/coin-modules/coin-icon/lib-es/specs.js
|
|
866573
866595
|
var import_invariant96 = __toESM(require("invariant"));
|
|
866574
866596
|
init_lib_es5();
|
|
866575
|
-
var
|
|
866597
|
+
var import_bignumber432 = __toESM(require("bignumber.js"));
|
|
866576
866598
|
var import_expect11 = __toESM(require_build20());
|
|
866577
866599
|
|
|
866578
866600
|
// ../../libs/coin-modules/coin-icon/lib-es/speculos-deviceActions.js
|
|
@@ -866695,7 +866717,7 @@ var icon = {
|
|
|
866695
866717
|
};
|
|
866696
866718
|
},
|
|
866697
866719
|
test: ({ account: account3 }) => {
|
|
866698
|
-
botTest("account spendable balance is zero", () => expectedApproximate(account3.spendableBalance, new
|
|
866720
|
+
botTest("account spendable balance is zero", () => expectedApproximate(account3.spendableBalance, new import_bignumber432.default(0)));
|
|
866699
866721
|
}
|
|
866700
866722
|
}
|
|
866701
866723
|
]
|
|
@@ -866710,7 +866732,7 @@ init_lib_es5();
|
|
|
866710
866732
|
var import_expect12 = __toESM(require_build20());
|
|
866711
866733
|
|
|
866712
866734
|
// ../../libs/coin-modules/coin-multiversx/lib-es/speculos-deviceActions.js
|
|
866713
|
-
var
|
|
866735
|
+
var import_bignumber433 = __toESM(require("bignumber.js"));
|
|
866714
866736
|
var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
866715
866737
|
steps: [
|
|
866716
866738
|
{
|
|
@@ -866730,7 +866752,7 @@ var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
|
866730
866752
|
{
|
|
866731
866753
|
title: "Fee",
|
|
866732
866754
|
button: SpeculosButton2.RIGHT,
|
|
866733
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
866755
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber433.default(5e4), {
|
|
866734
866756
|
showCode: true,
|
|
866735
866757
|
disableRounding: true,
|
|
866736
866758
|
joinFragmentsSeparator: " "
|
|
@@ -866771,7 +866793,7 @@ var acceptDelegateTransaction = deviceActionFlow({
|
|
|
866771
866793
|
{
|
|
866772
866794
|
title: "Fee",
|
|
866773
866795
|
button: SpeculosButton2.RIGHT,
|
|
866774
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
866796
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber433.default(5e4), {
|
|
866775
866797
|
showCode: true,
|
|
866776
866798
|
disableRounding: true,
|
|
866777
866799
|
joinFragmentsSeparator: " "
|
|
@@ -866804,7 +866826,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
866804
866826
|
{
|
|
866805
866827
|
title: "Amount",
|
|
866806
866828
|
button: SpeculosButton2.RIGHT,
|
|
866807
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
866829
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber433.default(0), {
|
|
866808
866830
|
showCode: true,
|
|
866809
866831
|
disableRounding: true,
|
|
866810
866832
|
joinFragmentsSeparator: " "
|
|
@@ -866813,7 +866835,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
866813
866835
|
{
|
|
866814
866836
|
title: "Fee",
|
|
866815
866837
|
button: SpeculosButton2.RIGHT,
|
|
866816
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
866838
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber433.default(5e4), {
|
|
866817
866839
|
showCode: true,
|
|
866818
866840
|
disableRounding: true,
|
|
866819
866841
|
joinFragmentsSeparator: " "
|
|
@@ -866845,7 +866867,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
866845
866867
|
{
|
|
866846
866868
|
title: "Amount",
|
|
866847
866869
|
button: SpeculosButton2.RIGHT,
|
|
866848
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
866870
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber433.default(0), {
|
|
866849
866871
|
showCode: true,
|
|
866850
866872
|
disableRounding: true,
|
|
866851
866873
|
joinFragmentsSeparator: " "
|
|
@@ -866854,7 +866876,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
866854
866876
|
{
|
|
866855
866877
|
title: "Fee",
|
|
866856
866878
|
button: SpeculosButton2.RIGHT,
|
|
866857
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
866879
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber433.default(5e4), {
|
|
866858
866880
|
showCode: true,
|
|
866859
866881
|
disableRounding: true,
|
|
866860
866882
|
joinFragmentsSeparator: " "
|
|
@@ -866921,7 +866943,7 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
866921
866943
|
{
|
|
866922
866944
|
title: "Fee",
|
|
866923
866945
|
button: SpeculosButton2.RIGHT,
|
|
866924
|
-
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new
|
|
866946
|
+
expectedValue: ({ account: account3, transaction }) => formatCurrencyUnit(account3.currency.units[0], transaction.fees || new import_bignumber433.default(5e4), {
|
|
866925
866947
|
showCode: true,
|
|
866926
866948
|
disableRounding: true,
|
|
866927
866949
|
joinFragmentsSeparator: " "
|
|
@@ -866941,12 +866963,12 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
866941
866963
|
});
|
|
866942
866964
|
|
|
866943
866965
|
// ../../libs/coin-modules/coin-multiversx/lib-es/specs.js
|
|
866944
|
-
var
|
|
866966
|
+
var import_bignumber434 = __toESM(require("bignumber.js"));
|
|
866945
866967
|
var import_sample7 = __toESM(require("lodash/sample"));
|
|
866946
866968
|
var currency19 = getCryptoCurrencyById("elrond");
|
|
866947
866969
|
var minimalAmount9 = parseCurrencyUnit(currency19.units[0], "0.001");
|
|
866948
866970
|
var maxAccounts4 = 6;
|
|
866949
|
-
var MULTIVERSX_MIN_ACTIVATION_SAFE = new
|
|
866971
|
+
var MULTIVERSX_MIN_ACTIVATION_SAFE = new import_bignumber434.default(1e4);
|
|
866950
866972
|
var UNCAPPED_PROVIDER = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqlhllllsr0pd0j";
|
|
866951
866973
|
function expectCorrectBalanceChange(input) {
|
|
866952
866974
|
const { account: account3, operation, accountBeforeTransaction } = input;
|
|
@@ -867154,7 +867176,7 @@ var multiversx = {
|
|
|
867154
867176
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
867155
867177
|
const delegations = account3?.multiversxResources?.delegations;
|
|
867156
867178
|
(0, import_invariant97.default)(delegations?.length, "account doesn't have any delegations");
|
|
867157
|
-
(0, import_invariant97.default)(delegations.some((d132) => new
|
|
867179
|
+
(0, import_invariant97.default)(delegations.some((d132) => new import_bignumber434.default(d132.userActiveStake).gt(0)), "no active stake for account");
|
|
867158
867180
|
const amount = MIN_DELEGATION_AMOUNT;
|
|
867159
867181
|
return {
|
|
867160
867182
|
transaction: bridge27.createTransaction(account3),
|
|
@@ -867184,8 +867206,8 @@ var multiversx = {
|
|
|
867184
867206
|
// among all delegations
|
|
867185
867207
|
delegations.some((d132) => (
|
|
867186
867208
|
// among all undelegating amounts
|
|
867187
|
-
d132.userUndelegatedList?.some((u116) => new
|
|
867188
|
-
new
|
|
867209
|
+
d132.userUndelegatedList?.some((u116) => new import_bignumber434.default(u116.amount).gt(0) && // the undelegation has a positive amount
|
|
867210
|
+
new import_bignumber434.default(u116.seconds).eq(0))
|
|
867189
867211
|
)),
|
|
867190
867212
|
"no withdrawable stake for account"
|
|
867191
867213
|
);
|
|
@@ -867195,7 +867217,7 @@ var multiversx = {
|
|
|
867195
867217
|
{
|
|
867196
867218
|
recipient: UNCAPPED_PROVIDER,
|
|
867197
867219
|
mode: "withdraw",
|
|
867198
|
-
amount: new
|
|
867220
|
+
amount: new import_bignumber434.default(0)
|
|
867199
867221
|
}
|
|
867200
867222
|
]
|
|
867201
867223
|
};
|
|
@@ -867217,7 +867239,7 @@ var specs_default7 = {
|
|
|
867217
867239
|
// ../../libs/coin-modules/coin-near/lib-es/specs.js
|
|
867218
867240
|
var import_invariant98 = __toESM(require("invariant"));
|
|
867219
867241
|
var import_expect13 = __toESM(require_build20());
|
|
867220
|
-
var
|
|
867242
|
+
var import_bignumber435 = require("bignumber.js");
|
|
867221
867243
|
init_lib_es5();
|
|
867222
867244
|
|
|
867223
867245
|
// ../../libs/coin-modules/coin-near/lib-es/speculos-deviceActions.js
|
|
@@ -867365,7 +867387,7 @@ var near = {
|
|
|
867365
867387
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
867366
867388
|
(0, import_invariant98.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
867367
867389
|
const { nearResources } = account3;
|
|
867368
|
-
const staked = nearResources?.stakedBalance || new
|
|
867390
|
+
const staked = nearResources?.stakedBalance || new import_bignumber435.BigNumber(0);
|
|
867369
867391
|
(0, import_invariant98.default)(staked.gt(minimalAmount10), "staked balance is too low for unstaking");
|
|
867370
867392
|
const halfStaked = staked.div(2);
|
|
867371
867393
|
const amount = halfStaked.gt(minimalAmount10) ? halfStaked.integerValue() : staked.integerValue();
|
|
@@ -867387,7 +867409,7 @@ var near = {
|
|
|
867387
867409
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
867388
867410
|
(0, import_invariant98.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
867389
867411
|
const { nearResources } = account3;
|
|
867390
|
-
const available = nearResources?.availableBalance || new
|
|
867412
|
+
const available = nearResources?.availableBalance || new import_bignumber435.BigNumber(0);
|
|
867391
867413
|
(0, import_invariant98.default)(available.gt(minimalAmount10), "available balance is too low for withdrawing");
|
|
867392
867414
|
const halfAvailable = available.div(2);
|
|
867393
867415
|
const amount = halfAvailable.gt(minimalAmount10) ? halfAvailable.integerValue() : available.integerValue();
|
|
@@ -867412,7 +867434,7 @@ var specs_default8 = {
|
|
|
867412
867434
|
var import_expect14 = __toESM(require_build20());
|
|
867413
867435
|
var import_invariant99 = __toESM(require("invariant"));
|
|
867414
867436
|
var import_sampleSize3 = __toESM(require("lodash/sampleSize"));
|
|
867415
|
-
var
|
|
867437
|
+
var import_bignumber436 = require("bignumber.js");
|
|
867416
867438
|
init_lib_es5();
|
|
867417
867439
|
|
|
867418
867440
|
// ../../libs/coin-modules/coin-polkadot/lib-es/test/bot-deviceActions.js
|
|
@@ -867599,7 +867621,7 @@ var polkadot2 = {
|
|
|
867599
867621
|
} else {
|
|
867600
867622
|
(0, import_invariant99.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "cant cover fee + bonding amount");
|
|
867601
867623
|
options24.push({
|
|
867602
|
-
amount: new
|
|
867624
|
+
amount: new import_bignumber436.BigNumber(1e5)
|
|
867603
867625
|
});
|
|
867604
867626
|
}
|
|
867605
867627
|
return {
|
|
@@ -867645,7 +867667,7 @@ var polkadot2 = {
|
|
|
867645
867667
|
(0, import_invariant99.default)(polkadotResources, "polkadot");
|
|
867646
867668
|
(0, import_invariant99.default)(polkadotResources?.unlockingBalance.gt(MIN_LOCKED_BALANCE_REQ), "can't rebond");
|
|
867647
867669
|
(0, import_invariant99.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "can't cover fee");
|
|
867648
|
-
const amount =
|
|
867670
|
+
const amount = import_bignumber436.BigNumber.maximum(polkadotResources.unlockingBalance.times(0.2), MIN_LOCKED_BALANCE_REQ);
|
|
867649
867671
|
return {
|
|
867650
867672
|
transaction: bridge27.createTransaction(account3),
|
|
867651
867673
|
updates: [
|
|
@@ -867713,7 +867735,7 @@ var import_expect15 = __toESM(require_build20());
|
|
|
867713
867735
|
init_lib_es5();
|
|
867714
867736
|
|
|
867715
867737
|
// ../../libs/coin-modules/coin-solana/lib-es/speculos-deviceActions.js
|
|
867716
|
-
var
|
|
867738
|
+
var import_bignumber437 = __toESM(require("bignumber.js"));
|
|
867717
867739
|
function getMainCurrency(currency24) {
|
|
867718
867740
|
if (currency24.isTestnetFor !== void 0) {
|
|
867719
867741
|
return getCryptoCurrencyById(currency24.isTestnetFor);
|
|
@@ -867725,7 +867747,7 @@ function ellipsis(str) {
|
|
|
867725
867747
|
}
|
|
867726
867748
|
function formatAmount(c118, amount) {
|
|
867727
867749
|
const currency24 = c118.type === "CryptoCurrency" ? getMainCurrency(c118) : c118;
|
|
867728
|
-
return formatDeviceAmount(currency24, new
|
|
867750
|
+
return formatDeviceAmount(currency24, new import_bignumber437.default(amount), {
|
|
867729
867751
|
postfixCode: true
|
|
867730
867752
|
});
|
|
867731
867753
|
}
|
|
@@ -868076,7 +868098,7 @@ function throwUnexpectedTransaction() {
|
|
|
868076
868098
|
|
|
868077
868099
|
// ../../libs/coin-modules/coin-solana/lib-es/specs.js
|
|
868078
868100
|
var import_fp6 = require("lodash/fp");
|
|
868079
|
-
var
|
|
868101
|
+
var import_bignumber438 = __toESM(require("bignumber.js"));
|
|
868080
868102
|
var maxAccount7 = 9;
|
|
868081
868103
|
var solana = {
|
|
868082
868104
|
name: "Solana",
|
|
@@ -868130,7 +868152,7 @@ var solana = {
|
|
|
868130
868152
|
},
|
|
868131
868153
|
test: (input) => {
|
|
868132
868154
|
const { accountBeforeTransaction, account: account3, operation } = input;
|
|
868133
|
-
const estimatedMaxSpendable =
|
|
868155
|
+
const estimatedMaxSpendable = import_bignumber438.default.max(accountBeforeTransaction.spendableBalance.minus(SYSTEM_ACCOUNT_RENT_EXEMPT), 0).toNumber();
|
|
868134
868156
|
botTest("operation value should be estimated max spendable", () => (0, import_expect15.default)(operation.value.toNumber()).toBe(estimatedMaxSpendable));
|
|
868135
868157
|
botTest("account spendableBalance should be zero", () => (0, import_expect15.default)(account3.spendableBalance.toNumber()).toBe(0));
|
|
868136
868158
|
expectCorrectBalanceChange2(input);
|
|
@@ -868169,7 +868191,7 @@ var solana = {
|
|
|
868169
868191
|
}
|
|
868170
868192
|
},
|
|
868171
868193
|
{
|
|
868172
|
-
amount: new
|
|
868194
|
+
amount: new import_bignumber438.default(1e5)
|
|
868173
868195
|
}
|
|
868174
868196
|
]
|
|
868175
868197
|
};
|
|
@@ -868670,7 +868692,7 @@ var specs_default9 = {
|
|
|
868670
868692
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
868671
868693
|
var import_invariant101 = __toESM(require("invariant"));
|
|
868672
868694
|
init_lib_es5();
|
|
868673
|
-
var
|
|
868695
|
+
var import_bignumber439 = __toESM(require("bignumber.js"));
|
|
868674
868696
|
var import_expect16 = __toESM(require_build20());
|
|
868675
868697
|
|
|
868676
868698
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-deviceActions.js
|
|
@@ -868719,7 +868741,7 @@ var acceptTransaction14 = deviceActionFlow({
|
|
|
868719
868741
|
});
|
|
868720
868742
|
|
|
868721
868743
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
868722
|
-
var MIN_SAFE5 = new
|
|
868744
|
+
var MIN_SAFE5 = new import_bignumber439.default(1e4);
|
|
868723
868745
|
var stacksSpecs = {
|
|
868724
868746
|
name: "Stacks",
|
|
868725
868747
|
currency: getCryptoCurrencyById("stacks"),
|
|
@@ -868785,7 +868807,7 @@ var bot_specs_default8 = {
|
|
|
868785
868807
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-specs.js
|
|
868786
868808
|
var import_expect17 = __toESM(require_build20());
|
|
868787
868809
|
var import_invariant102 = __toESM(require("invariant"));
|
|
868788
|
-
var
|
|
868810
|
+
var import_bignumber440 = __toESM(require("bignumber.js"));
|
|
868789
868811
|
init_lib_es5();
|
|
868790
868812
|
|
|
868791
868813
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-deviceActions.js
|
|
@@ -868926,7 +868948,7 @@ var stellar = {
|
|
|
868926
868948
|
recipient,
|
|
868927
868949
|
// Setting higher max fee here to make sure transaction doesn't
|
|
868928
868950
|
// time out.
|
|
868929
|
-
fees: new
|
|
868951
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
868930
868952
|
},
|
|
868931
868953
|
{
|
|
868932
868954
|
amount
|
|
@@ -868977,7 +868999,7 @@ var stellar = {
|
|
|
868977
868999
|
recipient,
|
|
868978
869000
|
// Setting higher max fee here to make sure transaction doesn't
|
|
868979
869001
|
// time out.
|
|
868980
|
-
fees: new
|
|
869002
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
868981
869003
|
},
|
|
868982
869004
|
{
|
|
868983
869005
|
useAllAmount: true
|
|
@@ -869029,7 +869051,7 @@ var stellar = {
|
|
|
869029
869051
|
mode: "changeTrust",
|
|
869030
869052
|
// Setting higher max fee here to make sure transaction doesn't
|
|
869031
869053
|
// time out.
|
|
869032
|
-
fees: new
|
|
869054
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
869033
869055
|
},
|
|
869034
869056
|
{
|
|
869035
869057
|
assetReference: USDC_CODE,
|
|
@@ -869075,7 +869097,7 @@ var stellar = {
|
|
|
869075
869097
|
amount,
|
|
869076
869098
|
// Setting higher max fee here to make sure transaction doesn't
|
|
869077
869099
|
// time out.
|
|
869078
|
-
fees: new
|
|
869100
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
869079
869101
|
}
|
|
869080
869102
|
];
|
|
869081
869103
|
if (Math.random() < 0.5) {
|
|
@@ -869358,7 +869380,7 @@ var bot_specs_default10 = {
|
|
|
869358
869380
|
|
|
869359
869381
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
869360
869382
|
init_lib_es5();
|
|
869361
|
-
var
|
|
869383
|
+
var import_bignumber441 = __toESM(require("bignumber.js"));
|
|
869362
869384
|
var import_expect18 = __toESM(require_build20());
|
|
869363
869385
|
var import_invariant104 = __toESM(require("invariant"));
|
|
869364
869386
|
|
|
@@ -869435,11 +869457,11 @@ var generateDeviceActionFlow2 = (scenario) => {
|
|
|
869435
869457
|
};
|
|
869436
869458
|
|
|
869437
869459
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
869438
|
-
var MIN_SAFE6 = new
|
|
869460
|
+
var MIN_SAFE6 = new import_bignumber441.default(15e6);
|
|
869439
869461
|
var testDestination2 = ({ destination, destinationBeforeTransaction, sendingOperation }) => {
|
|
869440
869462
|
const amount = sendingOperation.value;
|
|
869441
869463
|
const inOp = destination.operations.find((op) => op.hash === sendingOperation.hash && op.type === "IN");
|
|
869442
|
-
const inFees = inOp?.fee ?? (0,
|
|
869464
|
+
const inFees = inOp?.fee ?? (0, import_bignumber441.default)(0);
|
|
869443
869465
|
botTest("account balance increased with transaction amount", () => (0, import_expect18.default)(destination.balance.toString()).toBe(destinationBeforeTransaction.balance.plus(amount).minus(inFees).toString()));
|
|
869444
869466
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect18.default)({
|
|
869445
869467
|
type: inOp?.type,
|
|
@@ -869562,7 +869584,7 @@ var specs_default10 = {
|
|
|
869562
869584
|
};
|
|
869563
869585
|
|
|
869564
869586
|
// ../../libs/coin-modules/coin-vechain/lib-es/test/bot-specs.js
|
|
869565
|
-
var
|
|
869587
|
+
var import_bignumber442 = __toESM(require("bignumber.js"));
|
|
869566
869588
|
var import_invariant105 = __toESM(require("invariant"));
|
|
869567
869589
|
init_lib_es5();
|
|
869568
869590
|
|
|
@@ -869662,7 +869684,7 @@ var vet = {
|
|
|
869662
869684
|
};
|
|
869663
869685
|
},
|
|
869664
869686
|
test: ({ account: account3 }) => {
|
|
869665
|
-
botTest("account balance decreased with operation value", () => expect(account3.balance.toString()).toBe(new
|
|
869687
|
+
botTest("account balance decreased with operation value", () => expect(account3.balance.toString()).toBe(new import_bignumber442.default(0).toString()));
|
|
869666
869688
|
}
|
|
869667
869689
|
}
|
|
869668
869690
|
]
|
|
@@ -869694,7 +869716,7 @@ var vtho = {
|
|
|
869694
869716
|
};
|
|
869695
869717
|
},
|
|
869696
869718
|
test: ({ account: account3, accountBeforeTransaction }) => {
|
|
869697
|
-
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new
|
|
869719
|
+
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new import_bignumber442.default(accountBeforeTransaction?.subAccounts?.[0].balance || 0).div(2).toString()));
|
|
869698
869720
|
}
|
|
869699
869721
|
},
|
|
869700
869722
|
{
|
|
@@ -869721,7 +869743,7 @@ var vtho = {
|
|
|
869721
869743
|
};
|
|
869722
869744
|
},
|
|
869723
869745
|
test: ({ account: account3 }) => {
|
|
869724
|
-
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new
|
|
869746
|
+
botTest("account balance decreased with operation value", () => expect(account3?.subAccounts?.[0].balance.toString()).toBe(new import_bignumber442.default(0).toString()));
|
|
869725
869747
|
}
|
|
869726
869748
|
}
|
|
869727
869749
|
]
|
|
@@ -869836,7 +869858,7 @@ var bot_specs_default12 = {
|
|
|
869836
869858
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
869837
869859
|
var import_invariant107 = __toESM(require("invariant"));
|
|
869838
869860
|
init_lib_es5();
|
|
869839
|
-
var
|
|
869861
|
+
var import_bignumber443 = __toESM(require("bignumber.js"));
|
|
869840
869862
|
var import_expect20 = __toESM(require_build20());
|
|
869841
869863
|
|
|
869842
869864
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-deviceActions.js
|
|
@@ -869910,7 +869932,7 @@ var getRandomTransferID3 = () => {
|
|
|
869910
869932
|
|
|
869911
869933
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
869912
869934
|
var maxAccount9 = 6;
|
|
869913
|
-
var MIN_SAFE7 = new
|
|
869935
|
+
var MIN_SAFE7 = new import_bignumber443.default(1 * 10 ** 8);
|
|
869914
869936
|
var minaSpecs = {
|
|
869915
869937
|
name: "Mina",
|
|
869916
869938
|
currency: getCryptoCurrencyById("mina"),
|
|
@@ -871365,7 +871387,7 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871365
871387
|
});
|
|
871366
871388
|
const period = "month";
|
|
871367
871389
|
const portfolio = countervaluesState ? getPortfolio(allAccountsAfter, period, countervaluesState, usd) : null;
|
|
871368
|
-
const totalUSD = portfolio ? formatCurrencyUnit(usd.units[0], new
|
|
871390
|
+
const totalUSD = portfolio ? formatCurrencyUnit(usd.units[0], new import_bignumber444.BigNumber(portfolio.balanceHistory[portfolio.balanceHistory.length - 1].value), {
|
|
871369
871391
|
showCode: true
|
|
871370
871392
|
}) : "";
|
|
871371
871393
|
const allMutationReports = (0, import_flatMap26.default)(results2, (r95) => r95.mutations || []);
|
|
@@ -871581,7 +871603,7 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871581
871603
|
function sumAccounts(all7) {
|
|
871582
871604
|
if (!all7 || all7.length === 0)
|
|
871583
871605
|
return;
|
|
871584
|
-
return all7.reduce((sum2, a134) => sum2.plus(a134.spendableBalance), new
|
|
871606
|
+
return all7.reduce((sum2, a134) => sum2.plus(a134.spendableBalance), new import_bignumber444.BigNumber(0));
|
|
871585
871607
|
}
|
|
871586
871608
|
const { accountsBefore } = r95;
|
|
871587
871609
|
const accountsBeforeBalance = sumAccounts(accountsBefore);
|
|
@@ -871592,16 +871614,16 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871592
871614
|
let etaEmoji = "\u274C";
|
|
871593
871615
|
const accounts2 = r95.accountsAfter || r95.accountsBefore || [];
|
|
871594
871616
|
const operations4 = (0, import_flatMap26.default)(accounts2, (a134) => a134.operations).sort((a134, b27) => a134.fee.minus(b27.fee).toNumber());
|
|
871595
|
-
const avgOperationFee = operations4.reduce((sum2, o102) => sum2.plus(o102.fee || 0), new
|
|
871617
|
+
const avgOperationFee = operations4.reduce((sum2, o102) => sum2.plus(o102.fee || 0), new import_bignumber444.BigNumber(0)).div(operations4.length);
|
|
871596
871618
|
const maxRuns = r95.spec.mutations.reduce((sum2, m118) => sum2 + m118.maxRun || 1, 0);
|
|
871597
871619
|
if (avgOperationFee.gt(0) && maxRuns > 0) {
|
|
871598
|
-
const spendableBalanceSum = accounts2.reduce((sum2, a134) => sum2.plus(
|
|
871620
|
+
const spendableBalanceSum = accounts2.reduce((sum2, a134) => sum2.plus(import_bignumber444.BigNumber.max(a134.spendableBalance.minus(r95.spec.minViableAmount || 0), 0)), new import_bignumber444.BigNumber(0));
|
|
871599
871621
|
eta = spendableBalanceSum.div(avgOperationFee).div(maxRuns).toNumber();
|
|
871600
871622
|
etaEmoji = eta < 50 ? "\u26A0\uFE0F" : eta < 500 ? "\u{1F44D}" : "\u{1F4AA}";
|
|
871601
871623
|
}
|
|
871602
871624
|
if (countervaluesState && r95.accountsAfter) {
|
|
871603
871625
|
const portfolio2 = getPortfolio(r95.accountsAfter, period, countervaluesState, usd);
|
|
871604
|
-
const totalUSD2 = portfolio2 ? formatCurrencyUnit(usd.units[0], new
|
|
871626
|
+
const totalUSD2 = portfolio2 ? formatCurrencyUnit(usd.units[0], new import_bignumber444.BigNumber(portfolio2.balanceHistory[portfolio2.balanceHistory.length - 1].value), {
|
|
871605
871627
|
showCode: true
|
|
871606
871628
|
}) : "";
|
|
871607
871629
|
balance2 += " (" + totalUSD2 + ")";
|
|
@@ -871709,7 +871731,7 @@ ${slackBody}`;
|
|
|
871709
871731
|
}
|
|
871710
871732
|
|
|
871711
871733
|
// src/scan.ts
|
|
871712
|
-
var
|
|
871734
|
+
var import_bignumber445 = require("bignumber.js");
|
|
871713
871735
|
var import_rxjs173 = require("rxjs");
|
|
871714
871736
|
var import_operators17 = require("rxjs/operators");
|
|
871715
871737
|
|
|
@@ -872049,8 +872071,8 @@ function scan3(arg) {
|
|
|
872049
872071
|
creationDate: /* @__PURE__ */ new Date(),
|
|
872050
872072
|
lastSyncDate: /* @__PURE__ */ new Date(0),
|
|
872051
872073
|
blockHeight: 0,
|
|
872052
|
-
balance: new
|
|
872053
|
-
spendableBalance: new
|
|
872074
|
+
balance: new import_bignumber445.BigNumber(0),
|
|
872075
|
+
spendableBalance: new import_bignumber445.BigNumber(0),
|
|
872054
872076
|
operationsCount: 0,
|
|
872055
872077
|
operations: [],
|
|
872056
872078
|
pendingOperations: [],
|
|
@@ -872611,7 +872633,7 @@ testBridge(dataset);
|
|
|
872611
872633
|
};
|
|
872612
872634
|
|
|
872613
872635
|
// src/commands/blockchain/generateTestTransaction.ts
|
|
872614
|
-
var
|
|
872636
|
+
var import_bignumber447 = require("bignumber.js");
|
|
872615
872637
|
init_lib_es2();
|
|
872616
872638
|
var import_rxjs180 = require("rxjs");
|
|
872617
872639
|
var import_operators25 = require("rxjs/operators");
|
|
@@ -872620,7 +872642,7 @@ var import_operators25 = require("rxjs/operators");
|
|
|
872620
872642
|
var import_uniqBy3 = __toESM(require("lodash/uniqBy"));
|
|
872621
872643
|
var import_shuffle = __toESM(require("lodash/shuffle"));
|
|
872622
872644
|
var import_flatMap27 = __toESM(require("lodash/flatMap"));
|
|
872623
|
-
var
|
|
872645
|
+
var import_bignumber446 = require("bignumber.js");
|
|
872624
872646
|
|
|
872625
872647
|
// ../../libs/ledger-live-common/lib-es/generated/cli-transaction.js
|
|
872626
872648
|
var cli_transaction_default = {
|
|
@@ -872734,11 +872756,11 @@ async function inferTransactions26(mainAccount, opts) {
|
|
|
872734
872756
|
const transaction = bridge27.createTransaction(mainAccount);
|
|
872735
872757
|
transaction.recipient = recipient;
|
|
872736
872758
|
transaction.useAllAmount = !!opts["use-all-amount"];
|
|
872737
|
-
transaction.amount = transaction.useAllAmount ? new
|
|
872759
|
+
transaction.amount = transaction.useAllAmount ? new import_bignumber446.BigNumber(0) : inferAmount(account3, opts.amount || "0");
|
|
872738
872760
|
if (opts.tokenIds && opts.collection) {
|
|
872739
872761
|
transaction.tokenIds = opts.tokenIds.split(",");
|
|
872740
872762
|
transaction.collection = opts.collection;
|
|
872741
|
-
transaction.quantities = opts.quantities?.split(",")?.map((q13) => new
|
|
872763
|
+
transaction.quantities = opts.quantities?.split(",")?.map((q13) => new import_bignumber446.BigNumber(q13));
|
|
872742
872764
|
}
|
|
872743
872765
|
return {
|
|
872744
872766
|
account: account3,
|
|
@@ -872785,7 +872807,7 @@ var toJS = (obj2) => {
|
|
|
872785
872807
|
if (obj2 instanceof Error) {
|
|
872786
872808
|
return `new ${obj2.name || "Error"}()`;
|
|
872787
872809
|
}
|
|
872788
|
-
if (
|
|
872810
|
+
if (import_bignumber447.BigNumber.isBigNumber(obj2)) {
|
|
872789
872811
|
return `BigNumber("${obj2.toFixed()}")`;
|
|
872790
872812
|
}
|
|
872791
872813
|
const keys2 = Object.keys(obj2);
|
|
@@ -879956,13 +879978,13 @@ var speculosList_default = {
|
|
|
879956
879978
|
};
|
|
879957
879979
|
|
|
879958
879980
|
// src/commands/live/balanceHistory.ts
|
|
879959
|
-
var
|
|
879981
|
+
var import_bignumber448 = require("bignumber.js");
|
|
879960
879982
|
var import_asciichart = require("asciichart");
|
|
879961
879983
|
var import_invariant122 = __toESM(require("invariant"));
|
|
879962
879984
|
var import_operators86 = require("rxjs/operators");
|
|
879963
879985
|
var histoFormatters = {
|
|
879964
879986
|
default: (histo, account3) => histo.map(
|
|
879965
|
-
({ date, value: value2 }) => date.toISOString() + " " + formatCurrencyUnit(account3.currency.units[0], new
|
|
879987
|
+
({ date, value: value2 }) => date.toISOString() + " " + formatCurrencyUnit(account3.currency.units[0], new import_bignumber448.BigNumber(value2), {
|
|
879966
879988
|
showCode: true,
|
|
879967
879989
|
disableRounding: true
|
|
879968
879990
|
})
|
|
@@ -879973,13 +879995,13 @@ var histoFormatters = {
|
|
|
879973
879995
|
disableRounding: true
|
|
879974
879996
|
}) + "\n" + (0, import_asciichart.plot)(
|
|
879975
879997
|
history.map(
|
|
879976
|
-
(h67) => h67.value / new
|
|
879998
|
+
(h67) => h67.value / new import_bignumber448.BigNumber(10).pow(account3.currency.units[0].magnitude).toNumber()
|
|
879977
879999
|
),
|
|
879978
880000
|
{
|
|
879979
880001
|
height: 10,
|
|
879980
880002
|
format: (value2) => formatCurrencyUnit(
|
|
879981
880003
|
account3.currency.units[0],
|
|
879982
|
-
new
|
|
880004
|
+
new import_bignumber448.BigNumber(value2).times(new import_bignumber448.BigNumber(10).pow(account3.currency.units[0].magnitude)),
|
|
879983
880005
|
{
|
|
879984
880006
|
showCode: true,
|
|
879985
880007
|
disableRounding: true
|
|
@@ -880024,7 +880046,7 @@ var balanceHistory_default = {
|
|
|
880024
880046
|
|
|
880025
880047
|
// src/commands/live/countervalues.ts
|
|
880026
880048
|
var import_uniq3 = __toESM(require("lodash/uniq"));
|
|
880027
|
-
var
|
|
880049
|
+
var import_bignumber449 = require("bignumber.js");
|
|
880028
880050
|
var import_asciichart2 = require("asciichart");
|
|
880029
880051
|
var import_invariant123 = __toESM(require("invariant"));
|
|
880030
880052
|
var import_rxjs268 = require("rxjs");
|
|
@@ -880037,7 +880059,7 @@ var histoFormatters2 = {
|
|
|
880037
880059
|
return availability === "100" ? `"${countervalue.ticker}",` : void 0;
|
|
880038
880060
|
},
|
|
880039
880061
|
default: (histo, currency24, countervalue) => histo.map(
|
|
880040
|
-
({ date, value: value2 }) => (currency24.ticker + "\u27A1" + countervalue.ticker).padEnd(10) + " " + date.toISOString() + " " + formatCurrencyUnit(countervalue.units[0], new
|
|
880062
|
+
({ date, value: value2 }) => (currency24.ticker + "\u27A1" + countervalue.ticker).padEnd(10) + " " + date.toISOString() + " " + formatCurrencyUnit(countervalue.units[0], new import_bignumber449.BigNumber(value2 || 0), {
|
|
880041
880063
|
showCode: true,
|
|
880042
880064
|
disableRounding: true
|
|
880043
880065
|
})
|
|
@@ -880045,13 +880067,13 @@ var histoFormatters2 = {
|
|
|
880045
880067
|
json: (histo) => toBalanceHistoryRaw(histo),
|
|
880046
880068
|
asciichart: (history, currency24, countervalue) => "\n" + "".padStart(22) + currency24.name + " to " + countervalue.name + "\n" + (0, import_asciichart2.plot)(
|
|
880047
880069
|
history.map(
|
|
880048
|
-
(h67) => new
|
|
880070
|
+
(h67) => new import_bignumber449.BigNumber(h67.value || 0).div(new import_bignumber449.BigNumber(10).pow(countervalue.units[0].magnitude)).toNumber()
|
|
880049
880071
|
),
|
|
880050
880072
|
{
|
|
880051
880073
|
height: 10,
|
|
880052
880074
|
format: (value2) => formatCurrencyUnit(
|
|
880053
880075
|
countervalue.units[0],
|
|
880054
|
-
new
|
|
880076
|
+
new import_bignumber449.BigNumber(value2).times(new import_bignumber449.BigNumber(10).pow(countervalue.units[0].magnitude)),
|
|
880055
880077
|
{
|
|
880056
880078
|
showCode: true,
|
|
880057
880079
|
disableRounding: true
|
|
@@ -883806,7 +883828,7 @@ function mapValues4(obj2, fn4) {
|
|
|
883806
883828
|
}
|
|
883807
883829
|
|
|
883808
883830
|
// ../../libs/live-wallet/lib-es/liveqr/cross.js
|
|
883809
|
-
var
|
|
883831
|
+
var import_bignumber450 = require("bignumber.js");
|
|
883810
883832
|
var accountDataToAccount = ({ id: id5, currencyId, freshAddress: inputFreshAddress, name: name2, index, balance: balance2, derivationMode: derivationModeStr, seedIdentifier }) => {
|
|
883811
883833
|
const { xpubOrAddress } = decodeAccountId(id5);
|
|
883812
883834
|
const derivationMode = asDerivationMode(derivationModeStr);
|
|
@@ -883833,7 +883855,7 @@ var accountDataToAccount = ({ id: id5, currencyId, freshAddress: inputFreshAddre
|
|
|
883833
883855
|
account: index
|
|
883834
883856
|
});
|
|
883835
883857
|
}
|
|
883836
|
-
const balanceBN = new
|
|
883858
|
+
const balanceBN = new import_bignumber450.BigNumber(balance2);
|
|
883837
883859
|
const account3 = {
|
|
883838
883860
|
type: "Account",
|
|
883839
883861
|
id: id5,
|
|
@@ -884377,7 +884399,7 @@ var liveData_default = {
|
|
|
884377
884399
|
};
|
|
884378
884400
|
|
|
884379
884401
|
// src/commands/live/portfolio.ts
|
|
884380
|
-
var
|
|
884402
|
+
var import_bignumber451 = require("bignumber.js");
|
|
884381
884403
|
var import_asciichart3 = require("asciichart");
|
|
884382
884404
|
var import_invariant124 = __toESM(require("invariant"));
|
|
884383
884405
|
var import_rxjs274 = require("rxjs");
|
|
@@ -884436,24 +884458,24 @@ var portfolio_default = {
|
|
|
884436
884458
|
function render(title, accounts3) {
|
|
884437
884459
|
const portfolio = getPortfolio(accounts3, period, state, countervalue);
|
|
884438
884460
|
const balance2 = portfolio.balanceHistory[portfolio.balanceHistory.length - 1].value;
|
|
884439
|
-
return title + " " + formatCurrencyUnit(unit, new
|
|
884461
|
+
return title + " " + formatCurrencyUnit(unit, new import_bignumber451.BigNumber(balance2), {
|
|
884440
884462
|
showCode: true,
|
|
884441
884463
|
disableRounding: true
|
|
884442
884464
|
}) + (portfolio.countervalueChange.percentage ? " ::: on a " + period + " period: " + Math.round(portfolio.countervalueChange.percentage * 100).toString() + "% (" + formatCurrencyUnit(
|
|
884443
884465
|
unit,
|
|
884444
|
-
new
|
|
884466
|
+
new import_bignumber451.BigNumber(portfolio.countervalueChange.value),
|
|
884445
884467
|
{
|
|
884446
884468
|
showCode: true
|
|
884447
884469
|
}
|
|
884448
884470
|
) + ")" : "") + "\n" + (0, import_asciichart3.plot)(
|
|
884449
884471
|
portfolio.balanceHistory.map(
|
|
884450
|
-
(h67) => new
|
|
884472
|
+
(h67) => new import_bignumber451.BigNumber(h67.value).div(new import_bignumber451.BigNumber(10).pow(unit.magnitude)).toNumber()
|
|
884451
884473
|
),
|
|
884452
884474
|
{
|
|
884453
884475
|
height: 10,
|
|
884454
884476
|
format: (value2) => formatCurrencyUnit(
|
|
884455
884477
|
unit,
|
|
884456
|
-
new
|
|
884478
|
+
new import_bignumber451.BigNumber(value2).times(new import_bignumber451.BigNumber(10).pow(unit.magnitude)),
|
|
884457
884479
|
{
|
|
884458
884480
|
showCode: true,
|
|
884459
884481
|
disableRounding: true
|
|
@@ -884766,7 +884788,7 @@ var version_default3 = {
|
|
|
884766
884788
|
// src/commands/ptx/swap.ts
|
|
884767
884789
|
var import_operators91 = require("rxjs/operators");
|
|
884768
884790
|
var import_rxjs280 = require("rxjs");
|
|
884769
|
-
var
|
|
884791
|
+
var import_bignumber455 = require("bignumber.js");
|
|
884770
884792
|
var import_command_line_args = __toESM(require("command-line-args"));
|
|
884771
884793
|
|
|
884772
884794
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
@@ -885201,7 +885223,7 @@ var lib_es_default5 = Exchange;
|
|
|
885201
885223
|
|
|
885202
885224
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
885203
885225
|
init_lib_es2();
|
|
885204
|
-
var
|
|
885226
|
+
var import_bignumber453 = require("bignumber.js");
|
|
885205
885227
|
var import_invariant126 = __toESM(require("invariant"));
|
|
885206
885228
|
var import_rxjs279 = require("rxjs");
|
|
885207
885229
|
|
|
@@ -885220,20 +885242,20 @@ var getCurrencyExchangeConfig = async (currency24) => {
|
|
|
885220
885242
|
};
|
|
885221
885243
|
|
|
885222
885244
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/mock.js
|
|
885223
|
-
var
|
|
885245
|
+
var import_bignumber452 = require("bignumber.js");
|
|
885224
885246
|
var import_rxjs278 = require("rxjs");
|
|
885225
885247
|
var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
885226
885248
|
const { fromAccount, toAccount } = exchange;
|
|
885227
885249
|
const amount = transaction.amount;
|
|
885228
885250
|
const unitFrom = getAccountCurrency(fromAccount).units[0];
|
|
885229
885251
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(toAccount).units[0];
|
|
885230
|
-
const tenPowMagnitude = new
|
|
885252
|
+
const tenPowMagnitude = new import_bignumber452.BigNumber(10).pow(unitFrom.magnitude);
|
|
885231
885253
|
const amountFrom = amount.div(tenPowMagnitude);
|
|
885232
|
-
const minAmountFrom = new
|
|
885233
|
-
const maxAmountFrom = new
|
|
885254
|
+
const minAmountFrom = new import_bignumber452.BigNumber(1e-4);
|
|
885255
|
+
const maxAmountFrom = new import_bignumber452.BigNumber(1e3);
|
|
885234
885256
|
if (amountFrom.lte(minAmountFrom)) {
|
|
885235
885257
|
throw new SwapExchangeRateAmountTooLow(void 0, {
|
|
885236
|
-
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
885258
|
+
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber452.BigNumber(minAmountFrom).times(tenPowMagnitude), {
|
|
885237
885259
|
alwaysShowSign: false,
|
|
885238
885260
|
disableRounding: true,
|
|
885239
885261
|
showCode: true
|
|
@@ -885242,7 +885264,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885242
885264
|
}
|
|
885243
885265
|
if (amountFrom.gte(maxAmountFrom)) {
|
|
885244
885266
|
throw new SwapExchangeRateAmountTooHigh(void 0, {
|
|
885245
|
-
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
885267
|
+
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber452.BigNumber(maxAmountFrom).times(tenPowMagnitude), {
|
|
885246
885268
|
alwaysShowSign: false,
|
|
885247
885269
|
disableRounding: true,
|
|
885248
885270
|
showCode: true
|
|
@@ -885250,10 +885272,10 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885250
885272
|
});
|
|
885251
885273
|
}
|
|
885252
885274
|
await new Promise((r95) => setTimeout(r95, 800));
|
|
885253
|
-
const magnitudeAwareRate = new
|
|
885275
|
+
const magnitudeAwareRate = new import_bignumber452.BigNumber(1).div(new import_bignumber452.BigNumber(10).pow(unitFrom.magnitude)).times(new import_bignumber452.BigNumber(10).pow(unitTo.magnitude));
|
|
885254
885276
|
return [
|
|
885255
885277
|
{
|
|
885256
|
-
rate: new
|
|
885278
|
+
rate: new import_bignumber452.BigNumber("1"),
|
|
885257
885279
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885258
885280
|
magnitudeAwareRate,
|
|
885259
885281
|
rateId: "changellyRateId1",
|
|
@@ -885263,7 +885285,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885263
885285
|
tradeMethod: "fixed"
|
|
885264
885286
|
},
|
|
885265
885287
|
{
|
|
885266
|
-
rate: new
|
|
885288
|
+
rate: new import_bignumber452.BigNumber("1.1"),
|
|
885267
885289
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885268
885290
|
magnitudeAwareRate,
|
|
885269
885291
|
rateId: "changellyRateId2",
|
|
@@ -885273,7 +885295,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885273
885295
|
tradeMethod: "float"
|
|
885274
885296
|
},
|
|
885275
885297
|
{
|
|
885276
|
-
rate: new
|
|
885298
|
+
rate: new import_bignumber452.BigNumber("0.9"),
|
|
885277
885299
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885278
885300
|
magnitudeAwareRate,
|
|
885279
885301
|
rateId: "cicRateId1",
|
|
@@ -885283,7 +885305,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885283
885305
|
tradeMethod: "float"
|
|
885284
885306
|
},
|
|
885285
885307
|
{
|
|
885286
|
-
rate: new
|
|
885308
|
+
rate: new import_bignumber452.BigNumber("0.95"),
|
|
885287
885309
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885288
885310
|
magnitudeAwareRate,
|
|
885289
885311
|
rateId: "1inchRateId1",
|
|
@@ -885301,7 +885323,7 @@ var mockInitSwap = (exchange, exchangeRate, transaction) => {
|
|
|
885301
885323
|
initSwapResult: {
|
|
885302
885324
|
transaction,
|
|
885303
885325
|
swapId: "mockedSwapId",
|
|
885304
|
-
magnitudeAwareRate: new
|
|
885326
|
+
magnitudeAwareRate: new import_bignumber452.BigNumber(5e4)
|
|
885305
885327
|
}
|
|
885306
885328
|
});
|
|
885307
885329
|
};
|
|
@@ -885604,7 +885626,7 @@ var initSwap = (input) => {
|
|
|
885604
885626
|
const payoutCurrency = getAccountCurrency(toAccount);
|
|
885605
885627
|
const refundAccount = getMainAccount(fromAccount, fromParentAccount);
|
|
885606
885628
|
const payoutAccount = getMainAccount(toAccount, toParentAccount);
|
|
885607
|
-
const apiAmount = new
|
|
885629
|
+
const apiAmount = new import_bignumber453.BigNumber(amount).div(new import_bignumber453.BigNumber(10).pow(unitFrom.magnitude));
|
|
885608
885630
|
let res;
|
|
885609
885631
|
const swapProviderConfig = await getSwapProvider(provider);
|
|
885610
885632
|
const headers = {
|
|
@@ -885658,7 +885680,7 @@ var initSwap = (input) => {
|
|
|
885658
885680
|
});
|
|
885659
885681
|
if (refundCurrency.id === "ripple") {
|
|
885660
885682
|
transaction = accountBridge15.updateTransaction(transaction, {
|
|
885661
|
-
tag: new
|
|
885683
|
+
tag: new import_bignumber453.BigNumber(swapResult.payinExtraId).toNumber()
|
|
885662
885684
|
});
|
|
885663
885685
|
(0, import_invariant126.default)(transaction.tag, "Refusing to swap xrp without a destination tag");
|
|
885664
885686
|
} else if (refundCurrency.id === "stellar") {
|
|
@@ -885740,13 +885762,13 @@ var initSwap = (input) => {
|
|
|
885740
885762
|
let amountExpectedTo;
|
|
885741
885763
|
if (swapResult.binaryPayload) {
|
|
885742
885764
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
885743
|
-
amountExpectedTo = new
|
|
885765
|
+
amountExpectedTo = new import_bignumber453.BigNumber(decodePayload.amountToWallet.toString());
|
|
885744
885766
|
magnitudeAwareRate = transaction.amount && amountExpectedTo.dividedBy(transaction.amount);
|
|
885745
885767
|
}
|
|
885746
885768
|
let amountExpectedFrom;
|
|
885747
885769
|
if (swapResult.binaryPayload) {
|
|
885748
885770
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
885749
|
-
amountExpectedFrom = new
|
|
885771
|
+
amountExpectedFrom = new import_bignumber453.BigNumber(decodePayload.amountToProvider.toString());
|
|
885750
885772
|
if (data6.amountFromInSmallestDenomination !== amountExpectedFrom.toNumber())
|
|
885751
885773
|
throw new Error("AmountFrom received from partner's payload mismatch user input");
|
|
885752
885774
|
}
|
|
@@ -885812,7 +885834,7 @@ var initSwap = (input) => {
|
|
|
885812
885834
|
var initSwap_default = initSwap;
|
|
885813
885835
|
|
|
885814
885836
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/getExchangeRates.js
|
|
885815
|
-
var
|
|
885837
|
+
var import_bignumber454 = require("bignumber.js");
|
|
885816
885838
|
var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [], timeout: timeout10, timeoutErrorMessage }) => {
|
|
885817
885839
|
if (isIntegrationTestEnv())
|
|
885818
885840
|
return mockGetExchangeRates(exchange, transaction, currencyTo);
|
|
@@ -885821,8 +885843,8 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885821
885843
|
const to = (currencyTo ?? getAccountCurrency(exchange.toAccount)).id;
|
|
885822
885844
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(exchange.toAccount).units[0];
|
|
885823
885845
|
const amountFrom = transaction.amount;
|
|
885824
|
-
const tenPowMagnitude = new
|
|
885825
|
-
const apiAmount = new
|
|
885846
|
+
const tenPowMagnitude = new import_bignumber454.BigNumber(10).pow(unitFrom.magnitude);
|
|
885847
|
+
const apiAmount = new import_bignumber454.BigNumber(amountFrom).div(tenPowMagnitude);
|
|
885826
885848
|
const providerList = providers.filter((provider) => provider.pairs.some((pair) => pair.from === from91 && pair.to === to)).map((item) => item.provider);
|
|
885827
885849
|
const request2 = {
|
|
885828
885850
|
from: from91,
|
|
@@ -885849,12 +885871,12 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885849
885871
|
error
|
|
885850
885872
|
};
|
|
885851
885873
|
}
|
|
885852
|
-
const payoutNetworkFees = new
|
|
885853
|
-
const magnitudeAwarePayoutNetworkFees = payoutNetworkFees.times(new
|
|
885854
|
-
const rate2 = maybeRate ? new
|
|
885855
|
-
const magnitudeAwareRate = rate2.div(new
|
|
885856
|
-
const toAmount = new
|
|
885857
|
-
const magnitudeAwareToAmount = toAmount.times(new
|
|
885874
|
+
const payoutNetworkFees = new import_bignumber454.BigNumber(maybePayoutNetworkFees || 0);
|
|
885875
|
+
const magnitudeAwarePayoutNetworkFees = payoutNetworkFees.times(new import_bignumber454.BigNumber(10).pow(unitTo.magnitude));
|
|
885876
|
+
const rate2 = maybeRate ? new import_bignumber454.BigNumber(maybeRate) : new import_bignumber454.BigNumber(amountTo).minus(payoutNetworkFees).div(amountFrom2);
|
|
885877
|
+
const magnitudeAwareRate = rate2.div(new import_bignumber454.BigNumber(10).pow(unitFrom.magnitude - unitTo.magnitude));
|
|
885878
|
+
const toAmount = new import_bignumber454.BigNumber(amountTo).minus(payoutNetworkFees);
|
|
885879
|
+
const magnitudeAwareToAmount = toAmount.times(new import_bignumber454.BigNumber(10).pow(unitTo.magnitude));
|
|
885858
885880
|
const out = {
|
|
885859
885881
|
magnitudeAwareRate,
|
|
885860
885882
|
provider,
|
|
@@ -885882,7 +885904,7 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885882
885904
|
return rates;
|
|
885883
885905
|
};
|
|
885884
885906
|
var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
885885
|
-
const tenPowMagnitude = new
|
|
885907
|
+
const tenPowMagnitude = new import_bignumber454.BigNumber(10).pow(unitFrom.magnitude);
|
|
885886
885908
|
const { amountTo, minAmountFrom, maxAmountFrom, errorCode, errorMessage, provider, status } = responseData;
|
|
885887
885909
|
const isDex = (await getSwapProvider(provider)).type === "DEX";
|
|
885888
885910
|
if ((!minAmountFrom || !maxAmountFrom) && status === "error" && errorCode !== 300 && isDex) {
|
|
@@ -885896,17 +885918,17 @@ var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
|
885896
885918
|
}
|
|
885897
885919
|
const hasAmountLimit = minAmountFrom || maxAmountFrom;
|
|
885898
885920
|
if (hasAmountLimit) {
|
|
885899
|
-
const isTooSmall = minAmountFrom ? new
|
|
885921
|
+
const isTooSmall = minAmountFrom ? new import_bignumber454.BigNumber(apiAmount).lte(minAmountFrom) : false;
|
|
885900
885922
|
const MinOrMaxError = isTooSmall ? SwapExchangeRateAmountTooLow : SwapExchangeRateAmountTooHigh;
|
|
885901
885923
|
const key2 = isTooSmall ? "minAmountFromFormatted" : "maxAmountFromFormatted";
|
|
885902
885924
|
const amount = isTooSmall ? minAmountFrom : maxAmountFrom;
|
|
885903
885925
|
return new MinOrMaxError(void 0, {
|
|
885904
|
-
[key2]: formatCurrencyUnit(unitFrom, new
|
|
885926
|
+
[key2]: formatCurrencyUnit(unitFrom, new import_bignumber454.BigNumber(amount).times(tenPowMagnitude), {
|
|
885905
885927
|
alwaysShowSign: false,
|
|
885906
885928
|
disableRounding: true,
|
|
885907
885929
|
showCode: true
|
|
885908
885930
|
}),
|
|
885909
|
-
amount: new
|
|
885931
|
+
amount: new import_bignumber454.BigNumber(amount)
|
|
885910
885932
|
});
|
|
885911
885933
|
}
|
|
885912
885934
|
}
|
|
@@ -886011,7 +886033,7 @@ var exec6 = async (opts) => {
|
|
|
886011
886033
|
}
|
|
886012
886034
|
);
|
|
886013
886035
|
console.log(" :balance: ", fromAccount.spendableBalance.toString(), ` [ ${formattedAmount} ]`);
|
|
886014
|
-
(0, import_invariant127.default)(fromAccount.balance.gte(new
|
|
886036
|
+
(0, import_invariant127.default)(fromAccount.balance.gte(new import_bignumber455.BigNumber(amount)), `\u2716 Not enough balance`);
|
|
886015
886037
|
console.log("\u2022 Open the destination currency app");
|
|
886016
886038
|
await delay(8e3);
|
|
886017
886039
|
let toParentAccount = null;
|
|
@@ -886053,7 +886075,7 @@ var exec6 = async (opts) => {
|
|
|
886053
886075
|
});
|
|
886054
886076
|
if (!useAllAmount) {
|
|
886055
886077
|
transaction = bridge27.updateTransaction(transaction, {
|
|
886056
|
-
amount: new
|
|
886078
|
+
amount: new import_bignumber455.BigNumber(amount)
|
|
886057
886079
|
});
|
|
886058
886080
|
} else {
|
|
886059
886081
|
const amount2 = await bridge27.estimateMaxSpendable({
|