@ledgerhq/live-cli 24.29.0-nightly.20251127130943 → 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 +322 -283
- 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
|
|
|
@@ -536952,15 +536952,19 @@ var require_picomatch2 = __commonJS({
|
|
|
536952
536952
|
}
|
|
536953
536953
|
});
|
|
536954
536954
|
|
|
536955
|
-
// ../../node_modules/.pnpm/micromatch@4.0.
|
|
536955
|
+
// ../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js
|
|
536956
536956
|
var require_micromatch = __commonJS({
|
|
536957
|
-
"../../node_modules/.pnpm/micromatch@4.0.
|
|
536957
|
+
"../../node_modules/.pnpm/micromatch@4.0.8/node_modules/micromatch/index.js"(exports2, module2) {
|
|
536958
536958
|
"use strict";
|
|
536959
536959
|
var util10 = require("util");
|
|
536960
536960
|
var braces = require_braces();
|
|
536961
536961
|
var picomatch = require_picomatch2();
|
|
536962
536962
|
var utils6 = require_utils50();
|
|
536963
|
-
var isEmptyString = (
|
|
536963
|
+
var isEmptyString = (v64) => v64 === "" || v64 === "./";
|
|
536964
|
+
var hasBraces = (v64) => {
|
|
536965
|
+
const index = v64.indexOf("{");
|
|
536966
|
+
return index > -1 && v64.indexOf("}", index) > -1;
|
|
536967
|
+
};
|
|
536964
536968
|
var micromatch = (list2, patterns, options24) => {
|
|
536965
536969
|
patterns = [].concat(patterns);
|
|
536966
536970
|
list2 = [].concat(list2);
|
|
@@ -537100,7 +537104,7 @@ var require_micromatch = __commonJS({
|
|
|
537100
537104
|
micromatch.braces = (pattern, options24) => {
|
|
537101
537105
|
if (typeof pattern !== "string")
|
|
537102
537106
|
throw new TypeError("Expected a string");
|
|
537103
|
-
if (options24 && options24.nobrace === true ||
|
|
537107
|
+
if (options24 && options24.nobrace === true || !hasBraces(pattern)) {
|
|
537104
537108
|
return [pattern];
|
|
537105
537109
|
}
|
|
537106
537110
|
return braces(pattern, options24);
|
|
@@ -537110,6 +537114,7 @@ var require_micromatch = __commonJS({
|
|
|
537110
537114
|
throw new TypeError("Expected a string");
|
|
537111
537115
|
return micromatch.braces(pattern, { ...options24, expand: true });
|
|
537112
537116
|
};
|
|
537117
|
+
micromatch.hasBraces = hasBraces;
|
|
537113
537118
|
module2.exports = micromatch;
|
|
537114
537119
|
}
|
|
537115
537120
|
});
|
|
@@ -543581,7 +543586,7 @@ var require_package8 = __commonJS({
|
|
|
543581
543586
|
module2.exports = {
|
|
543582
543587
|
name: "@ledgerhq/live-common",
|
|
543583
543588
|
description: "Common ground for the Ledger Live apps",
|
|
543584
|
-
version: "34.54.0-nightly.
|
|
543589
|
+
version: "34.54.0-nightly.20251129023709",
|
|
543585
543590
|
repository: {
|
|
543586
543591
|
type: "git",
|
|
543587
543592
|
url: "https://github.com/LedgerHQ/ledger-live.git"
|
|
@@ -543934,7 +543939,7 @@ var require_package9 = __commonJS({
|
|
|
543934
543939
|
"package.json"(exports2, module2) {
|
|
543935
543940
|
module2.exports = {
|
|
543936
543941
|
name: "@ledgerhq/live-cli",
|
|
543937
|
-
version: "24.29.0-nightly.
|
|
543942
|
+
version: "24.29.0-nightly.20251129023709",
|
|
543938
543943
|
description: "ledger-live CLI version",
|
|
543939
543944
|
repository: {
|
|
543940
543945
|
type: "git",
|
|
@@ -567706,7 +567711,7 @@ var getDefaultAccountName = (account3) => {
|
|
|
567706
567711
|
};
|
|
567707
567712
|
|
|
567708
567713
|
// ../../libs/ledger-live-common/lib-es/account/formatters.js
|
|
567709
|
-
var
|
|
567714
|
+
var import_bignumber388 = require("bignumber.js");
|
|
567710
567715
|
var import_invariant73 = __toESM(require("invariant"));
|
|
567711
567716
|
|
|
567712
567717
|
// ../../libs/ledger-live-common/lib-es/account/serialization.js
|
|
@@ -568281,7 +568286,7 @@ var mergeNfts = (oldNfts, newNfts) => {
|
|
|
568281
568286
|
}
|
|
568282
568287
|
return Object.values(newNftsPerId).concat(nfts);
|
|
568283
568288
|
};
|
|
568284
|
-
var makeSync = ({ getAccountShape: getAccountShape21, postSync:
|
|
568289
|
+
var makeSync = ({ getAccountShape: getAccountShape21, postSync: postSync8 = (_24, a134) => a134, shouldMergeOps = true }) => (initial, syncConfig) => new import_rxjs6.Observable((o102) => {
|
|
568285
568290
|
async function main2() {
|
|
568286
568291
|
const accountId2 = encodeAccountId({
|
|
568287
568292
|
type: "js",
|
|
@@ -568307,7 +568312,7 @@ var makeSync = ({ getAccountShape: getAccountShape21, postSync: postSync7 = (_24
|
|
|
568307
568312
|
a134 = clearAccount(acc);
|
|
568308
568313
|
}
|
|
568309
568314
|
const operations4 = shouldMergeOps ? mergeOps(a134.operations, shape.operations || []) : shape.operations || [];
|
|
568310
|
-
a134 =
|
|
568315
|
+
a134 = postSync8(a134, {
|
|
568311
568316
|
...a134,
|
|
568312
568317
|
id: accountId2,
|
|
568313
568318
|
spendableBalance: shape.balance || a134.balance,
|
|
@@ -568347,7 +568352,7 @@ var defaultIterateResultBuilder = (getAddressFn) => () => Promise.resolve(async
|
|
|
568347
568352
|
}
|
|
568348
568353
|
return res;
|
|
568349
568354
|
});
|
|
568350
|
-
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) => {
|
|
568351
568356
|
if (buildIterateResult2 === void 0) {
|
|
568352
568357
|
buildIterateResult2 = defaultIterateResultBuilder(getAddressFn);
|
|
568353
568358
|
}
|
|
@@ -568414,7 +568419,7 @@ var makeScanAccounts = ({ getAccountShape: getAccountShape21, buildIterateResult
|
|
|
568414
568419
|
res.address = account3.freshAddress;
|
|
568415
568420
|
derivationsCache[account3.freshAddressPath] = res;
|
|
568416
568421
|
}
|
|
568417
|
-
account3 =
|
|
568422
|
+
account3 = postSync8(initialAccount, account3);
|
|
568418
568423
|
log2("scanAccounts", "derivationsCache", res);
|
|
568419
568424
|
log2("scanAccounts", `scanning ${currency24.id} at ${freshAddressPath}: ${res.address} resulted of ${account3 ? `Account with ${account3.operations.length} txs` : "no account"}`);
|
|
568420
568425
|
if (!account3)
|
|
@@ -847468,6 +847473,7 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
|
|
|
847468
847473
|
blockHeight: null,
|
|
847469
847474
|
senders: [account3.freshAddress],
|
|
847470
847475
|
recipients: [transaction.recipient],
|
|
847476
|
+
transactionSequenceNumber: new import_bignumber378.default(sequenceNumber?.toString() ?? 0),
|
|
847471
847477
|
accountId: subAccountId,
|
|
847472
847478
|
date: /* @__PURE__ */ new Date(),
|
|
847473
847479
|
transactionRaw: toGenericTransactionRaw({
|
|
@@ -848090,11 +848096,31 @@ var genericSignRawOperation = (network, kind) => (signerContext4) => ({ account:
|
|
|
848090
848096
|
main2().then(() => o102.complete(), (e101) => o102.error(e101));
|
|
848091
848097
|
});
|
|
848092
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
|
+
|
|
848093
848119
|
// ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/accountBridge.js
|
|
848094
848120
|
function getAlpacaAccountBridge(network, kind, customSigner) {
|
|
848095
848121
|
const signer2 = customSigner ?? getSigner(network);
|
|
848096
848122
|
return {
|
|
848097
|
-
sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind) }),
|
|
848123
|
+
sync: makeSync({ getAccountShape: genericGetAccountShape(network, kind), postSync: postSync7 }),
|
|
848098
848124
|
receive: makeAccountBridgeReceive(getAddressWrapper_default(signer2.getAddress)),
|
|
848099
848125
|
createTransaction: createTransaction41,
|
|
848100
848126
|
updateTransaction,
|
|
@@ -848119,7 +848145,8 @@ function getAlpacaCurrencyBridge(network, kind, customSigner) {
|
|
|
848119
848145
|
},
|
|
848120
848146
|
scanAccounts: makeScanAccounts({
|
|
848121
848147
|
getAccountShape: genericGetAccountShape(network, kind),
|
|
848122
|
-
getAddressFn: signer2.getAddress.bind(signer2)
|
|
848148
|
+
getAddressFn: signer2.getAddress.bind(signer2),
|
|
848149
|
+
postSync: postSync7
|
|
848123
848150
|
})
|
|
848124
848151
|
};
|
|
848125
848152
|
}
|
|
@@ -848313,7 +848340,7 @@ ${head2}${sub}`;
|
|
|
848313
848340
|
return (op) => format6(op, 0);
|
|
848314
848341
|
};
|
|
848315
848342
|
function maybeDisplaySumOfOpsIssue(ops, balance2, unit) {
|
|
848316
|
-
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));
|
|
848317
848344
|
if (sumOfOps.eq(balance2))
|
|
848318
848345
|
return "";
|
|
848319
848346
|
return " (! sum of ops " + formatCurrencyUnit(unit, sumOfOps, {
|
|
@@ -848361,7 +848388,7 @@ var cliFormat = (account3, level2) => {
|
|
|
848361
848388
|
};
|
|
848362
848389
|
var stats = (account3) => {
|
|
848363
848390
|
const { subAccounts, operations: operations4 } = account3;
|
|
848364
|
-
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));
|
|
848365
848392
|
const sumOfAllOps = formatCurrencyUnit(getAccountCurrency(account3).units[0], sumOfAllOpsNumber, {
|
|
848366
848393
|
showCode: true
|
|
848367
848394
|
});
|
|
@@ -848386,7 +848413,7 @@ var operationBalanceHistoryBackwards = (account3) => {
|
|
|
848386
848413
|
}).reverse());
|
|
848387
848414
|
};
|
|
848388
848415
|
var operationBalanceHistory = (account3) => {
|
|
848389
|
-
let acc = new
|
|
848416
|
+
let acc = new import_bignumber388.BigNumber(0);
|
|
848390
848417
|
return JSON.stringify(account3.operations.slice(0).reverse().map((op) => {
|
|
848391
848418
|
acc = acc.plus(getOperationAmountNumberWithInternals(op));
|
|
848392
848419
|
const { blockHeight } = op;
|
|
@@ -848493,37 +848520,37 @@ var toSignOperationEventRaw = (e101) => {
|
|
|
848493
848520
|
var displayTokenValue = (token) => `${token.name} (#${extractTokenId(token.id)})`;
|
|
848494
848521
|
|
|
848495
848522
|
// ../../libs/coin-modules/coin-cardano/lib-es/deviceTransactionConfig.js
|
|
848496
|
-
var
|
|
848523
|
+
var import_bignumber389 = __toESM(require("bignumber.js"));
|
|
848497
848524
|
var import_typhonjs12 = __toESM(require_dist6());
|
|
848498
848525
|
|
|
848499
848526
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/deviceTransactionConfig.js
|
|
848500
848527
|
init_lib_es2();
|
|
848501
848528
|
|
|
848502
848529
|
// ../../libs/coin-modules/coin-evm/lib-es/deviceTransactionConfig.js
|
|
848503
|
-
var
|
|
848530
|
+
var import_bignumber390 = __toESM(require("bignumber.js"));
|
|
848504
848531
|
|
|
848505
848532
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/deviceTransactionConfig.js
|
|
848506
848533
|
init_lib_es2();
|
|
848507
848534
|
var currency4 = getCryptoCurrencyById("internet_computer");
|
|
848508
848535
|
|
|
848509
848536
|
// ../../libs/coin-modules/coin-multiversx/lib-es/deviceTransactionConfig.js
|
|
848510
|
-
var
|
|
848537
|
+
var import_bignumber391 = __toESM(require("bignumber.js"));
|
|
848511
848538
|
|
|
848512
848539
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/deviceTransactionConfig.js
|
|
848513
848540
|
var currency5 = getCryptoCurrencyById("polkadot");
|
|
848514
848541
|
|
|
848515
848542
|
// ../../libs/coin-modules/coin-solana/lib-es/deviceTransactionConfig.js
|
|
848516
|
-
var
|
|
848543
|
+
var import_bignumber392 = __toESM(require("bignumber.js"));
|
|
848517
848544
|
|
|
848518
848545
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/deviceTransactionConfig.js
|
|
848519
|
-
var
|
|
848546
|
+
var import_bignumber393 = require("bignumber.js");
|
|
848520
848547
|
|
|
848521
848548
|
// ../../libs/coin-modules/coin-ton/lib-es/deviceTransactionConfig.js
|
|
848522
848549
|
var import_core22 = __toESM(require_dist2());
|
|
848523
|
-
var
|
|
848550
|
+
var import_bignumber394 = require("bignumber.js");
|
|
848524
848551
|
|
|
848525
848552
|
// ../../libs/coin-modules/coin-algorand/lib-es/transaction.js
|
|
848526
|
-
var
|
|
848553
|
+
var import_bignumber395 = require("bignumber.js");
|
|
848527
848554
|
var formatTransaction2 = ({ mode, subAccountId, amount, recipient, fees: fees2, useAllAmount }, mainAccount) => {
|
|
848528
848555
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
848529
848556
|
return `
|
|
@@ -848542,7 +848569,7 @@ var fromTransactionRaw2 = (tr3) => {
|
|
|
848542
848569
|
return {
|
|
848543
848570
|
...common,
|
|
848544
848571
|
family: tr3.family,
|
|
848545
|
-
fees: tr3.fees ? new
|
|
848572
|
+
fees: tr3.fees ? new import_bignumber395.BigNumber(tr3.fees) : null,
|
|
848546
848573
|
memo: tr3.memo,
|
|
848547
848574
|
mode: tr3.mode,
|
|
848548
848575
|
assetId: tr3.assetId
|
|
@@ -848569,7 +848596,7 @@ var transaction_default3 = {
|
|
|
848569
848596
|
};
|
|
848570
848597
|
|
|
848571
848598
|
// ../../libs/coin-modules/coin-aptos/lib-es/bridge/transaction.js
|
|
848572
|
-
var
|
|
848599
|
+
var import_bignumber396 = require("bignumber.js");
|
|
848573
848600
|
var formatTransaction3 = ({ mode, amount, fees: fees2, recipient, useAllAmount }, account3) => {
|
|
848574
848601
|
return `
|
|
848575
848602
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(account3.currency.units[0], amount)}
|
|
@@ -848583,7 +848610,7 @@ var fromTransactionRaw3 = (t110) => {
|
|
|
848583
848610
|
family: t110.family,
|
|
848584
848611
|
mode: t110.mode,
|
|
848585
848612
|
options: JSON.parse(t110.options),
|
|
848586
|
-
...t110.fees && { fees: new
|
|
848613
|
+
...t110.fees && { fees: new import_bignumber396.BigNumber(t110.fees) },
|
|
848587
848614
|
...t110.errors && { errors: JSON.parse(t110.errors) }
|
|
848588
848615
|
};
|
|
848589
848616
|
};
|
|
@@ -848608,14 +848635,14 @@ var transaction_default4 = {
|
|
|
848608
848635
|
};
|
|
848609
848636
|
|
|
848610
848637
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/transaction.js
|
|
848611
|
-
var
|
|
848638
|
+
var import_bignumber397 = require("bignumber.js");
|
|
848612
848639
|
var fromFeeItemsRaw = (fir) => ({
|
|
848613
848640
|
items: fir.items.map((fi) => ({
|
|
848614
848641
|
key: fi.key,
|
|
848615
848642
|
speed: fi.speed,
|
|
848616
|
-
feePerByte: new
|
|
848643
|
+
feePerByte: new import_bignumber397.BigNumber(fi.feePerByte)
|
|
848617
848644
|
})),
|
|
848618
|
-
defaultFeePerByte: new
|
|
848645
|
+
defaultFeePerByte: new import_bignumber397.BigNumber(fir.defaultFeePerByte)
|
|
848619
848646
|
});
|
|
848620
848647
|
var toFeeItemsRaw = (fir) => ({
|
|
848621
848648
|
items: fir.items.map((fi) => ({
|
|
@@ -848632,7 +848659,7 @@ var fromTransactionRaw4 = (tr3) => {
|
|
|
848632
848659
|
rbf: tr3.rbf,
|
|
848633
848660
|
utxoStrategy: tr3.utxoStrategy,
|
|
848634
848661
|
family: tr3.family,
|
|
848635
|
-
feePerByte: tr3.feePerByte ? new
|
|
848662
|
+
feePerByte: tr3.feePerByte ? new import_bignumber397.BigNumber(tr3.feePerByte) : null,
|
|
848636
848663
|
networkInfo: tr3.networkInfo && {
|
|
848637
848664
|
family: tr3.networkInfo.family,
|
|
848638
848665
|
feeItems: fromFeeItemsRaw(tr3.networkInfo.feeItems)
|
|
@@ -848726,7 +848753,7 @@ var transaction_default5 = {
|
|
|
848726
848753
|
};
|
|
848727
848754
|
|
|
848728
848755
|
// ../../libs/coin-modules/coin-cardano/lib-es/transaction.js
|
|
848729
|
-
var
|
|
848756
|
+
var import_bignumber398 = require("bignumber.js");
|
|
848730
848757
|
var formatTransaction5 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
848731
848758
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
848732
848759
|
return `
|
|
@@ -848742,7 +848769,7 @@ var fromTransactionRaw5 = (tr3) => {
|
|
|
848742
848769
|
...common,
|
|
848743
848770
|
family: tr3.family,
|
|
848744
848771
|
mode: tr3.mode,
|
|
848745
|
-
fees: tr3.fees ? new
|
|
848772
|
+
fees: tr3.fees ? new import_bignumber398.BigNumber(tr3.fees) : void 0,
|
|
848746
848773
|
memo: tr3.memo,
|
|
848747
848774
|
poolId: tr3.poolId,
|
|
848748
848775
|
protocolParams: tr3.protocolParams
|
|
@@ -848770,7 +848797,7 @@ var transaction_default6 = {
|
|
|
848770
848797
|
};
|
|
848771
848798
|
|
|
848772
848799
|
// ../../libs/coin-modules/coin-casper/lib-es/bridge/transaction.js
|
|
848773
|
-
var
|
|
848800
|
+
var import_bignumber399 = __toESM(require("bignumber.js"));
|
|
848774
848801
|
var formatTransaction6 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
848775
848802
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848776
848803
|
showCode: true,
|
|
@@ -848782,8 +848809,8 @@ var fromTransactionRaw6 = (tr3) => {
|
|
|
848782
848809
|
return {
|
|
848783
848810
|
...common,
|
|
848784
848811
|
family: tr3.family,
|
|
848785
|
-
fees: new
|
|
848786
|
-
amount: new
|
|
848812
|
+
fees: new import_bignumber399.default(tr3.fees),
|
|
848813
|
+
amount: new import_bignumber399.default(tr3.amount),
|
|
848787
848814
|
transferId: tr3.transferId
|
|
848788
848815
|
};
|
|
848789
848816
|
};
|
|
@@ -848807,7 +848834,7 @@ var transaction_default7 = {
|
|
|
848807
848834
|
};
|
|
848808
848835
|
|
|
848809
848836
|
// ../../libs/coin-modules/coin-canton/lib-es/bridge/transaction.js
|
|
848810
|
-
var
|
|
848837
|
+
var import_bignumber400 = require("bignumber.js");
|
|
848811
848838
|
var formatTransaction7 = ({ amount, recipient, fee, useAllAmount }, account3) => `
|
|
848812
848839
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848813
848840
|
showCode: true,
|
|
@@ -848823,7 +848850,7 @@ var fromTransactionRaw7 = (tr3) => {
|
|
|
848823
848850
|
return {
|
|
848824
848851
|
...common,
|
|
848825
848852
|
family: tr3.family,
|
|
848826
|
-
fee: tr3.fee ? new
|
|
848853
|
+
fee: tr3.fee ? new import_bignumber400.BigNumber(tr3.fee) : null,
|
|
848827
848854
|
tokenId: tr3.tokenId
|
|
848828
848855
|
};
|
|
848829
848856
|
};
|
|
@@ -848846,7 +848873,7 @@ var transaction_default8 = {
|
|
|
848846
848873
|
};
|
|
848847
848874
|
|
|
848848
848875
|
// ../../libs/coin-modules/coin-celo/lib-es/bridge/transaction.js
|
|
848849
|
-
var
|
|
848876
|
+
var import_bignumber401 = require("bignumber.js");
|
|
848850
848877
|
var formatTransaction8 = (t110, account3) => `
|
|
848851
848878
|
SEND ${t110.useAllAmount ? "MAX CELO" : formatCurrencyUnit(getAccountCurrency(account3).units[0], t110.amount, {
|
|
848852
848879
|
showCode: true,
|
|
@@ -848858,7 +848885,7 @@ var fromTransactionRaw8 = (tr3) => {
|
|
|
848858
848885
|
return {
|
|
848859
848886
|
...common,
|
|
848860
848887
|
family: tr3.family,
|
|
848861
|
-
fees: tr3.fees ? new
|
|
848888
|
+
fees: tr3.fees ? new import_bignumber401.BigNumber(tr3.fees) : null,
|
|
848862
848889
|
mode: tr3.mode,
|
|
848863
848890
|
index: tr3.index
|
|
848864
848891
|
};
|
|
@@ -848883,7 +848910,7 @@ var transaction_default9 = {
|
|
|
848883
848910
|
};
|
|
848884
848911
|
|
|
848885
848912
|
// ../../libs/coin-modules/coin-cosmos/lib-es/transaction.js
|
|
848886
|
-
var
|
|
848913
|
+
var import_bignumber402 = require("bignumber.js");
|
|
848887
848914
|
var formatTransaction9 = ({ mode, amount, fees: fees2, recipient, validators: validators7, memo: memo3, sourceValidator, useAllAmount }, account3) => `
|
|
848888
848915
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
848889
848916
|
showCode: true,
|
|
@@ -848904,13 +848931,13 @@ var fromTransactionRaw9 = (tr3) => {
|
|
|
848904
848931
|
mode: tr3.mode,
|
|
848905
848932
|
networkInfo: networkInfo && {
|
|
848906
848933
|
family: networkInfo.family,
|
|
848907
|
-
fees: new
|
|
848934
|
+
fees: new import_bignumber402.BigNumber(networkInfo.fees)
|
|
848908
848935
|
},
|
|
848909
|
-
fees: tr3.fees ? new
|
|
848910
|
-
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,
|
|
848911
848938
|
memo: tr3.memo,
|
|
848912
848939
|
sourceValidator: tr3.sourceValidator,
|
|
848913
|
-
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) })) : []
|
|
848914
848941
|
};
|
|
848915
848942
|
};
|
|
848916
848943
|
var toTransactionRaw9 = (t110) => {
|
|
@@ -848941,7 +848968,7 @@ var transaction_default10 = {
|
|
|
848941
848968
|
};
|
|
848942
848969
|
|
|
848943
848970
|
// ../../libs/coin-modules/coin-hedera/lib-es/transaction.js
|
|
848944
|
-
var
|
|
848971
|
+
var import_bignumber403 = __toESM(require("bignumber.js"));
|
|
848945
848972
|
function formatTransaction10(transaction, account3) {
|
|
848946
848973
|
const amount = formatCurrencyUnit(getAccountCurrency(account3).units[0], transaction.amount, {
|
|
848947
848974
|
showCode: true,
|
|
@@ -848955,7 +848982,7 @@ function fromTransactionRaw10(tr3) {
|
|
|
848955
848982
|
const commonHedera = {
|
|
848956
848983
|
family: tr3.family,
|
|
848957
848984
|
memo: tr3.memo,
|
|
848958
|
-
...tr3.maxFee && { maxFee: new
|
|
848985
|
+
...tr3.maxFee && { maxFee: new import_bignumber403.default(tr3.maxFee) }
|
|
848959
848986
|
};
|
|
848960
848987
|
if (tr3.mode === HEDERA_TRANSACTION_MODES.TokenAssociate) {
|
|
848961
848988
|
return {
|
|
@@ -848971,7 +848998,7 @@ function fromTransactionRaw10(tr3) {
|
|
|
848971
848998
|
...commonGeneric,
|
|
848972
848999
|
...commonHedera,
|
|
848973
849000
|
mode: tr3.mode,
|
|
848974
|
-
...tr3.gasLimit && { gasLimit: new
|
|
849001
|
+
...tr3.gasLimit && { gasLimit: new import_bignumber403.default(tr3.gasLimit) }
|
|
848975
849002
|
};
|
|
848976
849003
|
}
|
|
848977
849004
|
function toTransactionRaw10(t110) {
|
|
@@ -849008,7 +849035,7 @@ var transaction_default11 = {
|
|
|
849008
849035
|
};
|
|
849009
849036
|
|
|
849010
849037
|
// ../../libs/coin-modules/coin-filecoin/lib-es/bridge/transaction.js
|
|
849011
|
-
var
|
|
849038
|
+
var import_bignumber404 = __toESM(require("bignumber.js"));
|
|
849012
849039
|
var formatTransaction11 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849013
849040
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849014
849041
|
showCode: true,
|
|
@@ -849023,10 +849050,10 @@ var fromTransactionRaw11 = (tr3) => {
|
|
|
849023
849050
|
version: tr3.version,
|
|
849024
849051
|
method: tr3.method,
|
|
849025
849052
|
nonce: tr3.nonce,
|
|
849026
|
-
amount: new
|
|
849027
|
-
gasFeeCap: new
|
|
849028
|
-
gasLimit: new
|
|
849029
|
-
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)
|
|
849030
849057
|
};
|
|
849031
849058
|
};
|
|
849032
849059
|
var toTransactionRaw11 = (t110) => {
|
|
@@ -849053,7 +849080,7 @@ var transaction_default12 = {
|
|
|
849053
849080
|
};
|
|
849054
849081
|
|
|
849055
849082
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/transaction.js
|
|
849056
|
-
var
|
|
849083
|
+
var import_bignumber405 = __toESM(require("bignumber.js"));
|
|
849057
849084
|
var formatTransaction12 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849058
849085
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849059
849086
|
showCode: true,
|
|
@@ -849065,8 +849092,8 @@ var fromTransactionRaw12 = (tr3) => {
|
|
|
849065
849092
|
return {
|
|
849066
849093
|
...common,
|
|
849067
849094
|
family: tr3.family,
|
|
849068
|
-
fees: new
|
|
849069
|
-
amount: new
|
|
849095
|
+
fees: new import_bignumber405.default(tr3.fees),
|
|
849096
|
+
amount: new import_bignumber405.default(tr3.amount),
|
|
849070
849097
|
memo: tr3.memo
|
|
849071
849098
|
};
|
|
849072
849099
|
};
|
|
@@ -849090,7 +849117,7 @@ var transaction_default13 = {
|
|
|
849090
849117
|
};
|
|
849091
849118
|
|
|
849092
849119
|
// ../../libs/coin-modules/coin-icon/lib-es/transaction.js
|
|
849093
|
-
var
|
|
849120
|
+
var import_bignumber406 = require("bignumber.js");
|
|
849094
849121
|
var formatTransaction13 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849095
849122
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849096
849123
|
showCode: true,
|
|
@@ -849103,8 +849130,8 @@ var fromTransactionRaw13 = (tr3) => {
|
|
|
849103
849130
|
...common,
|
|
849104
849131
|
family: tr3.family,
|
|
849105
849132
|
mode: tr3.mode,
|
|
849106
|
-
fees: tr3.fees ? new
|
|
849107
|
-
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
|
|
849108
849135
|
};
|
|
849109
849136
|
};
|
|
849110
849137
|
var toTransactionRaw13 = (t110) => {
|
|
@@ -849127,7 +849154,7 @@ var transaction_default14 = {
|
|
|
849127
849154
|
};
|
|
849128
849155
|
|
|
849129
849156
|
// ../../libs/coin-modules/coin-kaspa/lib-es/transaction.js
|
|
849130
|
-
var
|
|
849157
|
+
var import_bignumber407 = require("bignumber.js");
|
|
849131
849158
|
var formatTransactionStatus3 = (t110, ts2, mainAccount) => {
|
|
849132
849159
|
let str = "";
|
|
849133
849160
|
str += formatTransactionStatus(t110, ts2, mainAccount);
|
|
@@ -849149,10 +849176,10 @@ var fromTransactionRaw14 = (tr3) => {
|
|
|
849149
849176
|
family: tr3.family,
|
|
849150
849177
|
networkInfo: tr3.networkInfo.map((x29) => ({
|
|
849151
849178
|
...x29,
|
|
849152
|
-
amount: (0,
|
|
849179
|
+
amount: (0, import_bignumber407.BigNumber)(x29.amount)
|
|
849153
849180
|
})),
|
|
849154
849181
|
feesStrategy: tr3.feesStrategy,
|
|
849155
|
-
customFeeRate: tr3.customFeeRate ? (0,
|
|
849182
|
+
customFeeRate: tr3.customFeeRate ? (0, import_bignumber407.BigNumber)(tr3.customFeeRate) : void 0
|
|
849156
849183
|
};
|
|
849157
849184
|
};
|
|
849158
849185
|
var toTransactionRaw14 = (t110) => {
|
|
@@ -849178,7 +849205,7 @@ var transaction_default15 = {
|
|
|
849178
849205
|
};
|
|
849179
849206
|
|
|
849180
849207
|
// ../../libs/coin-modules/coin-multiversx/lib-es/transaction.js
|
|
849181
|
-
var
|
|
849208
|
+
var import_bignumber408 = require("bignumber.js");
|
|
849182
849209
|
var formatTransaction15 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
|
|
849183
849210
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849184
849211
|
return `
|
|
@@ -849194,7 +849221,7 @@ var fromTransactionRaw15 = (tr3) => {
|
|
|
849194
849221
|
...common,
|
|
849195
849222
|
family: tr3.family,
|
|
849196
849223
|
mode: tr3.mode,
|
|
849197
|
-
fees: tr3.fees ? new
|
|
849224
|
+
fees: tr3.fees ? new import_bignumber408.BigNumber(tr3.fees) : null,
|
|
849198
849225
|
gasLimit: tr3.gasLimit
|
|
849199
849226
|
};
|
|
849200
849227
|
if (tr3.data) {
|
|
@@ -849226,7 +849253,7 @@ var transaction_default16 = {
|
|
|
849226
849253
|
};
|
|
849227
849254
|
|
|
849228
849255
|
// ../../libs/coin-modules/coin-near/lib-es/transaction.js
|
|
849229
|
-
var
|
|
849256
|
+
var import_bignumber409 = require("bignumber.js");
|
|
849230
849257
|
var formatTransaction16 = ({ mode, amount, recipient, useAllAmount }, account3) => `
|
|
849231
849258
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849232
849259
|
showCode: true,
|
|
@@ -849239,7 +849266,7 @@ var fromTransactionRaw16 = (transactionRaw) => {
|
|
|
849239
849266
|
...common,
|
|
849240
849267
|
family: transactionRaw.family,
|
|
849241
849268
|
mode: transactionRaw.mode,
|
|
849242
|
-
fees: new
|
|
849269
|
+
fees: new import_bignumber409.BigNumber(transactionRaw?.fees || 0)
|
|
849243
849270
|
};
|
|
849244
849271
|
};
|
|
849245
849272
|
var toTransactionRaw16 = (transaction) => {
|
|
@@ -849264,7 +849291,7 @@ var transaction_default17 = {
|
|
|
849264
849291
|
};
|
|
849265
849292
|
|
|
849266
849293
|
// ../../libs/coin-modules/coin-polkadot/lib-es/bridge/transaction.js
|
|
849267
|
-
var
|
|
849294
|
+
var import_bignumber410 = require("bignumber.js");
|
|
849268
849295
|
var formatTransaction17 = ({ mode, amount, recipient, validators: validators7, useAllAmount }, account3) => `
|
|
849269
849296
|
${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849270
849297
|
showCode: true,
|
|
@@ -849277,7 +849304,7 @@ var fromTransactionRaw17 = (tr3) => {
|
|
|
849277
849304
|
...common,
|
|
849278
849305
|
family: tr3.family,
|
|
849279
849306
|
mode: tr3.mode,
|
|
849280
|
-
fees: tr3.fees ? new
|
|
849307
|
+
fees: tr3.fees ? new import_bignumber410.BigNumber(tr3.fees) : null,
|
|
849281
849308
|
validators: tr3.validators,
|
|
849282
849309
|
era: tr3.era,
|
|
849283
849310
|
rewardDestination: tr3.rewardDestination,
|
|
@@ -849307,7 +849334,7 @@ var transaction_default18 = {
|
|
|
849307
849334
|
};
|
|
849308
849335
|
|
|
849309
849336
|
// ../../libs/coin-modules/coin-solana/lib-es/transaction.js
|
|
849310
|
-
var
|
|
849337
|
+
var import_bignumber411 = require("bignumber.js");
|
|
849311
849338
|
var fromTransactionRaw18 = (tr3) => {
|
|
849312
849339
|
const common = fromTransactionCommonRaw(tr3);
|
|
849313
849340
|
const { family, model } = tr3;
|
|
@@ -849327,7 +849354,7 @@ var toTransactionRaw18 = (t110) => {
|
|
|
849327
849354
|
};
|
|
849328
849355
|
};
|
|
849329
849356
|
var lamportsToSOL = (account3, amount) => {
|
|
849330
|
-
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new
|
|
849357
|
+
return formatCurrencyUnit(getAccountCurrency(account3).units[0], new import_bignumber411.BigNumber(amount), {
|
|
849331
849358
|
showCode: true,
|
|
849332
849359
|
disableRounding: true
|
|
849333
849360
|
});
|
|
@@ -849398,7 +849425,7 @@ function formatTokenTransfer(mainAccount, tx, command4) {
|
|
|
849398
849425
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
849399
849426
|
throw new Error("token subaccount expected");
|
|
849400
849427
|
}
|
|
849401
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
849428
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber411.BigNumber(command4.amount), {
|
|
849402
849429
|
showCode: true,
|
|
849403
849430
|
disableRounding: true
|
|
849404
849431
|
});
|
|
@@ -849426,7 +849453,7 @@ function formatCreateApprove(mainAccount, tx, command4) {
|
|
|
849426
849453
|
if (!subAccount || subAccount.type !== "TokenAccount") {
|
|
849427
849454
|
throw new Error("token subaccount expected");
|
|
849428
849455
|
}
|
|
849429
|
-
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new
|
|
849456
|
+
const amount = formatCurrencyUnit(getAccountCurrency(subAccount).units[0], new import_bignumber411.BigNumber(command4.amount), {
|
|
849430
849457
|
showCode: true,
|
|
849431
849458
|
disableRounding: true
|
|
849432
849459
|
});
|
|
@@ -849489,7 +849516,7 @@ var transaction_default19 = {
|
|
|
849489
849516
|
};
|
|
849490
849517
|
|
|
849491
849518
|
// ../../libs/coin-modules/coin-stacks/lib-es/bridge/transaction.js
|
|
849492
|
-
var
|
|
849519
|
+
var import_bignumber412 = __toESM(require("bignumber.js"));
|
|
849493
849520
|
var formatTransaction19 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849494
849521
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
849495
849522
|
showCode: true,
|
|
@@ -849504,9 +849531,9 @@ var fromTransactionRaw19 = (tr3) => {
|
|
|
849504
849531
|
return {
|
|
849505
849532
|
...common,
|
|
849506
849533
|
family: tr3.family,
|
|
849507
|
-
nonce: tr3.nonce !== void 0 ? new
|
|
849508
|
-
fee: tr3.fee !== void 0 ? new
|
|
849509
|
-
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),
|
|
849510
849537
|
network: tr3.network,
|
|
849511
849538
|
anchorMode: tr3.anchorMode,
|
|
849512
849539
|
memo: tr3.memo
|
|
@@ -849535,7 +849562,7 @@ var transaction_default20 = {
|
|
|
849535
849562
|
};
|
|
849536
849563
|
|
|
849537
849564
|
// ../../libs/coin-modules/coin-stellar/lib-es/transaction.js
|
|
849538
|
-
var
|
|
849565
|
+
var import_bignumber413 = require("bignumber.js");
|
|
849539
849566
|
function formatTransaction20({ amount, recipient, fees: fees2, memoValue, useAllAmount, subAccountId }, mainAccount) {
|
|
849540
849567
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849541
849568
|
return `
|
|
@@ -849556,14 +849583,14 @@ function fromTransactionRaw20(tr3) {
|
|
|
849556
849583
|
return {
|
|
849557
849584
|
...common,
|
|
849558
849585
|
family: tr3.family,
|
|
849559
|
-
fees: tr3.fees ? new
|
|
849586
|
+
fees: tr3.fees ? new import_bignumber413.BigNumber(tr3.fees) : null,
|
|
849560
849587
|
memoValue: tr3.memoValue ? tr3.memoValue : null,
|
|
849561
849588
|
memoType: tr3.memoType ? tr3.memoType : null,
|
|
849562
849589
|
networkInfo: networkInfo && {
|
|
849563
849590
|
family: networkInfo.family,
|
|
849564
|
-
fees: new
|
|
849565
|
-
baseFee: new
|
|
849566
|
-
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),
|
|
849567
849594
|
networkCongestionLevel: networkInfo.networkCongestionLevel
|
|
849568
849595
|
},
|
|
849569
849596
|
mode: tr3.mode,
|
|
@@ -849604,7 +849631,7 @@ var transaction_default21 = {
|
|
|
849604
849631
|
};
|
|
849605
849632
|
|
|
849606
849633
|
// ../../libs/coin-modules/coin-tezos/lib-es/transaction.js
|
|
849607
|
-
var
|
|
849634
|
+
var import_bignumber414 = require("bignumber.js");
|
|
849608
849635
|
var formatTransaction21 = ({ mode, subAccountId, amount, recipient, gasLimit, storageLimit, fees: fees2, useAllAmount, estimatedFees }, mainAccount) => {
|
|
849609
849636
|
const account3 = subAccountId && (mainAccount.subAccounts || []).find((a134) => a134.id === subAccountId) || mainAccount;
|
|
849610
849637
|
return `
|
|
@@ -849627,12 +849654,12 @@ var fromTransactionRaw21 = (tr3) => {
|
|
|
849627
849654
|
mode: tr3.mode,
|
|
849628
849655
|
networkInfo: networkInfo && {
|
|
849629
849656
|
family: networkInfo.family,
|
|
849630
|
-
fees: new
|
|
849657
|
+
fees: new import_bignumber414.BigNumber(networkInfo.fees)
|
|
849631
849658
|
},
|
|
849632
|
-
fees: tr3.fees ? new
|
|
849633
|
-
gasLimit: tr3.gasLimit ? new
|
|
849634
|
-
storageLimit: tr3.storageLimit ? new
|
|
849635
|
-
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,
|
|
849636
849663
|
taquitoError: tr3.taquitoError
|
|
849637
849664
|
};
|
|
849638
849665
|
};
|
|
@@ -849664,7 +849691,7 @@ var transaction_default22 = {
|
|
|
849664
849691
|
};
|
|
849665
849692
|
|
|
849666
849693
|
// ../../libs/coin-modules/coin-ton/lib-es/transaction.js
|
|
849667
|
-
var
|
|
849694
|
+
var import_bignumber415 = __toESM(require("bignumber.js"));
|
|
849668
849695
|
var import_core23 = __toESM(require_dist2());
|
|
849669
849696
|
var formatTransaction22 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
849670
849697
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
@@ -849815,7 +849842,7 @@ var fromTransactionRaw22 = (tr3) => {
|
|
|
849815
849842
|
return {
|
|
849816
849843
|
...common,
|
|
849817
849844
|
family: tr3.family,
|
|
849818
|
-
fees: new
|
|
849845
|
+
fees: new import_bignumber415.default(tr3.fees),
|
|
849819
849846
|
comment: tr3.comment,
|
|
849820
849847
|
payload: tr3.payload ? fromTransactionPayloadRaw(tr3.payload) : void 0
|
|
849821
849848
|
};
|
|
@@ -849976,7 +850003,7 @@ var transaction_default23 = {
|
|
|
849976
850003
|
};
|
|
849977
850004
|
|
|
849978
850005
|
// ../../libs/coin-modules/coin-tron/lib-es/bridge/transaction.js
|
|
849979
|
-
var
|
|
850006
|
+
var import_bignumber416 = require("bignumber.js");
|
|
849980
850007
|
var fromTransactionRaw23 = (tr3) => {
|
|
849981
850008
|
const common = fromTransactionCommonRaw(tr3);
|
|
849982
850009
|
const { networkInfo } = tr3;
|
|
@@ -849984,12 +850011,12 @@ var fromTransactionRaw23 = (tr3) => {
|
|
|
849984
850011
|
...common,
|
|
849985
850012
|
networkInfo: networkInfo && {
|
|
849986
850013
|
family: "tron",
|
|
849987
|
-
freeNetUsed: new
|
|
849988
|
-
freeNetLimit: new
|
|
849989
|
-
netUsed: new
|
|
849990
|
-
netLimit: new
|
|
849991
|
-
energyUsed: new
|
|
849992
|
-
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)
|
|
849993
850020
|
},
|
|
849994
850021
|
family: tr3.family,
|
|
849995
850022
|
mode: tr3.mode,
|
|
@@ -850091,7 +850118,7 @@ var transaction_default25 = {
|
|
|
850091
850118
|
};
|
|
850092
850119
|
|
|
850093
850120
|
// ../../libs/coin-modules/coin-xrp/lib-es/transaction.js
|
|
850094
|
-
var
|
|
850121
|
+
var import_bignumber417 = require("bignumber.js");
|
|
850095
850122
|
var formatTransaction25 = ({ amount, recipient, fees: fees2, tag, useAllAmount }, account3) => `
|
|
850096
850123
|
SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850097
850124
|
showCode: true,
|
|
@@ -850109,13 +850136,13 @@ var fromTransactionRaw25 = (tr3) => {
|
|
|
850109
850136
|
...common,
|
|
850110
850137
|
family: tr3.family,
|
|
850111
850138
|
tag: tr3.tag,
|
|
850112
|
-
fees: tr3.fees ? new
|
|
850139
|
+
fees: tr3.fees ? new import_bignumber417.BigNumber(tr3.fees) : null,
|
|
850113
850140
|
feeCustomUnit: tr3.feeCustomUnit,
|
|
850114
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)
|
|
850115
850142
|
networkInfo: networkInfo && {
|
|
850116
850143
|
family: networkInfo.family,
|
|
850117
|
-
serverFee: new
|
|
850118
|
-
baseReserve: new
|
|
850144
|
+
serverFee: new import_bignumber417.BigNumber(networkInfo.serverFee),
|
|
850145
|
+
baseReserve: new import_bignumber417.BigNumber(networkInfo.baseReserve)
|
|
850119
850146
|
}
|
|
850120
850147
|
};
|
|
850121
850148
|
};
|
|
@@ -850146,7 +850173,7 @@ var transaction_default26 = {
|
|
|
850146
850173
|
};
|
|
850147
850174
|
|
|
850148
850175
|
// ../../libs/coin-modules/coin-sui/lib-es/bridge/transaction.js
|
|
850149
|
-
var
|
|
850176
|
+
var import_bignumber418 = require("bignumber.js");
|
|
850150
850177
|
var formatTransaction26 = (transaction, account3) => {
|
|
850151
850178
|
const { mode, amount, recipient, useAllAmount } = transaction;
|
|
850152
850179
|
return `
|
|
@@ -850166,7 +850193,7 @@ var fromTransactionRaw26 = (transaction) => {
|
|
|
850166
850193
|
family: transaction.family,
|
|
850167
850194
|
mode: transaction.mode,
|
|
850168
850195
|
coinType: transaction.coinType,
|
|
850169
|
-
fees: transaction.fees ? (0,
|
|
850196
|
+
fees: transaction.fees ? (0, import_bignumber418.BigNumber)(transaction.fees) : null,
|
|
850170
850197
|
errors: {}
|
|
850171
850198
|
};
|
|
850172
850199
|
};
|
|
@@ -850190,7 +850217,7 @@ var transaction_default27 = {
|
|
|
850190
850217
|
};
|
|
850191
850218
|
|
|
850192
850219
|
// ../../libs/coin-modules/coin-mina/lib-es/bridge/transaction.js
|
|
850193
|
-
var
|
|
850220
|
+
var import_bignumber419 = __toESM(require("bignumber.js"));
|
|
850194
850221
|
var formatTransaction27 = ({ recipient, useAllAmount, amount }, account3) => `
|
|
850195
850222
|
SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
|
|
850196
850223
|
showCode: true,
|
|
@@ -850203,10 +850230,10 @@ var fromTransactionRaw27 = (tr3) => {
|
|
|
850203
850230
|
...common,
|
|
850204
850231
|
family: tr3.family,
|
|
850205
850232
|
fees: {
|
|
850206
|
-
fee: new
|
|
850207
|
-
accountCreationFee: new
|
|
850233
|
+
fee: new import_bignumber419.default(tr3.fees.fee),
|
|
850234
|
+
accountCreationFee: new import_bignumber419.default(tr3.fees.accountCreationFee)
|
|
850208
850235
|
},
|
|
850209
|
-
amount: new
|
|
850236
|
+
amount: new import_bignumber419.default(tr3.amount),
|
|
850210
850237
|
memo: tr3.memo,
|
|
850211
850238
|
nonce: tr3.nonce
|
|
850212
850239
|
};
|
|
@@ -853685,6 +853712,7 @@ function getMemorySpeculosDeviceInternal(id5) {
|
|
|
853685
853712
|
var modelMap = {
|
|
853686
853713
|
stax: DeviceModelId.stax,
|
|
853687
853714
|
flex: DeviceModelId.europa,
|
|
853715
|
+
apex_p: DeviceModelId.apex,
|
|
853688
853716
|
nanos: DeviceModelId.nanoS,
|
|
853689
853717
|
"nanos+": DeviceModelId.nanoSP,
|
|
853690
853718
|
nanox: DeviceModelId.nanoX,
|
|
@@ -853694,6 +853722,16 @@ var reverseModelMap = {};
|
|
|
853694
853722
|
for (const k26 in modelMap) {
|
|
853695
853723
|
reverseModelMap[modelMap[k26]] = k26;
|
|
853696
853724
|
}
|
|
853725
|
+
var getSpeculosModel = (model) => {
|
|
853726
|
+
switch (model) {
|
|
853727
|
+
case DeviceModelId.europa:
|
|
853728
|
+
return "flex";
|
|
853729
|
+
case DeviceModelId.apex:
|
|
853730
|
+
return "apex_p";
|
|
853731
|
+
default:
|
|
853732
|
+
return model.toLowerCase();
|
|
853733
|
+
}
|
|
853734
|
+
};
|
|
853697
853735
|
async function releaseSpeculosDevice(id5) {
|
|
853698
853736
|
log2("speculos", "release " + id5);
|
|
853699
853737
|
const obj2 = data5[id5];
|
|
@@ -853771,7 +853809,7 @@ async function createSpeculosDevice(arg, maxRetry = 3) {
|
|
|
853771
853809
|
`${speculosID}`,
|
|
853772
853810
|
process.env.SPECULOS_IMAGE_TAG ?? "ghcr.io/ledgerhq/speculos:sha-e262a0c",
|
|
853773
853811
|
"--model",
|
|
853774
|
-
|
|
853812
|
+
getSpeculosModel(model),
|
|
853775
853813
|
appPath,
|
|
853776
853814
|
...dependency ? [
|
|
853777
853815
|
"-l",
|
|
@@ -853906,6 +853944,7 @@ async function createSpeculosDevice(arg, maxRetry = 3) {
|
|
|
853906
853944
|
|
|
853907
853945
|
// ../../libs/ledger-live-common/lib-es/load/speculos.js
|
|
853908
853946
|
var modelMapPriority = {
|
|
853947
|
+
apex_p: 7,
|
|
853909
853948
|
flex: 6,
|
|
853910
853949
|
stax: 5,
|
|
853911
853950
|
nanos: 4,
|
|
@@ -862927,7 +862966,7 @@ var import_rxjs174 = require("rxjs");
|
|
|
862927
862966
|
// ../../libs/ledger-live-common/lib-es/bot/index.js
|
|
862928
862967
|
var import_fs3 = __toESM(require("fs"));
|
|
862929
862968
|
var import_path3 = __toESM(require("path"));
|
|
862930
|
-
var
|
|
862969
|
+
var import_bignumber444 = require("bignumber.js");
|
|
862931
862970
|
var import_uniq2 = __toESM(require("lodash/uniq"));
|
|
862932
862971
|
var import_groupBy6 = __toESM(require("lodash/groupBy"));
|
|
862933
862972
|
init_lib_es2();
|
|
@@ -862936,7 +862975,7 @@ var import_flatMap26 = __toESM(require("lodash/flatMap"));
|
|
|
862936
862975
|
|
|
862937
862976
|
// ../../libs/coin-framework/lib-es/bot/specs.js
|
|
862938
862977
|
init_lib_es2();
|
|
862939
|
-
var
|
|
862978
|
+
var import_bignumber420 = __toESM(require("bignumber.js"));
|
|
862940
862979
|
var import_expect = __toESM(require_build20());
|
|
862941
862980
|
var import_invariant76 = __toESM(require("invariant"));
|
|
862942
862981
|
var import_sample2 = __toESM(require("lodash/sample"));
|
|
@@ -863069,7 +863108,7 @@ function formatDeviceAmount(currency24, value2, options24 = defaultFormatOptions
|
|
|
863069
863108
|
if (deviceTicker)
|
|
863070
863109
|
code = deviceTicker;
|
|
863071
863110
|
}
|
|
863072
|
-
const fValue = value2.div(new
|
|
863111
|
+
const fValue = value2.div(new import_bignumber420.default(10).pow(unit.magnitude));
|
|
863073
863112
|
let v64 = options24.showAllDigits ? fValue.toFixed(unit.magnitude) : fValue.toString(10);
|
|
863074
863113
|
if (options24.forceFloating) {
|
|
863075
863114
|
if (!v64.includes(".")) {
|
|
@@ -863081,8 +863120,8 @@ function formatDeviceAmount(currency24, value2, options24 = defaultFormatOptions
|
|
|
863081
863120
|
return options24.postfixCode ? v64 + sep + code : code + sep + v64;
|
|
863082
863121
|
}
|
|
863083
863122
|
function expectSiblingsHaveSpendablePartGreaterThan(siblings, threshold) {
|
|
863084
|
-
const spendableTotal = siblings.reduce((acc, a134) => acc.plus(a134.spendableBalance), new
|
|
863085
|
-
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));
|
|
863086
863125
|
(0, import_invariant76.default)(spendableTotal.div(total).gt(threshold), "the spendable part of accounts is sufficient (threshold: %s)", threshold);
|
|
863087
863126
|
}
|
|
863088
863127
|
var genericTestDestination = ({ destination, operation, destinationBeforeTransaction, sendingOperation }) => {
|
|
@@ -863099,7 +863138,7 @@ var genericTestDestination = ({ destination, operation, destinationBeforeTransac
|
|
|
863099
863138
|
|
|
863100
863139
|
// ../../libs/coin-modules/coin-algorand/lib-es/specs.js
|
|
863101
863140
|
init_lib_es5();
|
|
863102
|
-
var
|
|
863141
|
+
var import_bignumber421 = require("bignumber.js");
|
|
863103
863142
|
var import_expect2 = __toESM(require_build20());
|
|
863104
863143
|
var import_invariant77 = __toESM(require("invariant"));
|
|
863105
863144
|
var import_sample3 = __toESM(require("lodash/sample"));
|
|
@@ -863334,7 +863373,7 @@ var algorand = {
|
|
|
863334
863373
|
feature: "tokens",
|
|
863335
863374
|
maxRun: 1,
|
|
863336
863375
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
863337
|
-
(0, import_invariant77.default)(maxSpendable.gt(new
|
|
863376
|
+
(0, import_invariant77.default)(maxSpendable.gt(new import_bignumber421.BigNumber(1e5)), "Spendable balance is too low");
|
|
863338
863377
|
const transaction = bridge27.createTransaction(account3);
|
|
863339
863378
|
const mode = "optIn";
|
|
863340
863379
|
const assetId = getRandomAssetId(account3);
|
|
@@ -863394,7 +863433,7 @@ var specs_default = {
|
|
|
863394
863433
|
var import_invariant78 = __toESM(require("invariant"));
|
|
863395
863434
|
var import_expect3 = __toESM(require_build20());
|
|
863396
863435
|
init_lib_es5();
|
|
863397
|
-
var
|
|
863436
|
+
var import_bignumber422 = __toESM(require("bignumber.js"));
|
|
863398
863437
|
|
|
863399
863438
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/speculos-deviceActions.js
|
|
863400
863439
|
var acceptTransaction2 = deviceActionFlow({
|
|
@@ -863471,7 +863510,7 @@ var acceptTokenTransaction = deviceActionFlow({
|
|
|
863471
863510
|
});
|
|
863472
863511
|
|
|
863473
863512
|
// ../../libs/coin-modules/coin-aptos/lib-es/test/bot-specs.js
|
|
863474
|
-
var MIN_SAFE = new
|
|
863513
|
+
var MIN_SAFE = new import_bignumber422.default(1e-4);
|
|
863475
863514
|
var maxAccount = 6;
|
|
863476
863515
|
var aptosSpecs = {
|
|
863477
863516
|
name: "Aptos",
|
|
@@ -863583,7 +863622,7 @@ var bot_specs_default = {
|
|
|
863583
863622
|
|
|
863584
863623
|
// ../../libs/coin-modules/coin-bitcoin/lib-es/specs.js
|
|
863585
863624
|
var import_expect4 = __toESM(require_build20());
|
|
863586
|
-
var
|
|
863625
|
+
var import_bignumber423 = require("bignumber.js");
|
|
863587
863626
|
var import_invariant79 = __toESM(require("invariant"));
|
|
863588
863627
|
var import_bchaddrjs2 = __toESM(require_bchaddr());
|
|
863589
863628
|
var import_sample4 = __toESM(require("lodash/sample"));
|
|
@@ -863679,7 +863718,7 @@ var genericTest = ({ operation, account: account3, transaction, status, accountB
|
|
|
863679
863718
|
botTest("picked utxo has been consumed", () => (0, import_expect4.default)(utxosPicked.filter((utxo) => utxo && utxo.blockHeight && getUTXOStatus(utxo, transaction.utxoStrategy).excluded)).toEqual([]));
|
|
863680
863719
|
};
|
|
863681
863720
|
var testDestination = genericTestDestination;
|
|
863682
|
-
var genericMinimalAmount = new
|
|
863721
|
+
var genericMinimalAmount = new import_bignumber423.BigNumber(15e3);
|
|
863683
863722
|
var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmount, targetAccountSize = 3, recipientVariation = (recipient) => recipient } = {}) => [
|
|
863684
863723
|
{
|
|
863685
863724
|
name: "move ~50%",
|
|
@@ -863692,7 +863731,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863692
863731
|
const amount = maxSpendable.div(1.9 + 0.2 * Math.random()).integerValue();
|
|
863693
863732
|
const transaction = {
|
|
863694
863733
|
...bridge27.createTransaction(account3),
|
|
863695
|
-
feePerByte: new
|
|
863734
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863696
863735
|
};
|
|
863697
863736
|
const updates7 = [
|
|
863698
863737
|
{
|
|
@@ -863724,7 +863763,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863724
863763
|
const sibling = pickSiblings(siblings, targetAccountSize);
|
|
863725
863764
|
const transaction = {
|
|
863726
863765
|
...bridge27.createTransaction(account3),
|
|
863727
|
-
feePerByte: new
|
|
863766
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863728
863767
|
};
|
|
863729
863768
|
const updates7 = [
|
|
863730
863769
|
{
|
|
@@ -863759,7 +863798,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863759
863798
|
(0, import_invariant79.default)(bitcoinResources, "bitcoin resources");
|
|
863760
863799
|
const transaction = {
|
|
863761
863800
|
...bridge27.createTransaction(account3),
|
|
863762
|
-
feePerByte: new
|
|
863801
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4)
|
|
863763
863802
|
};
|
|
863764
863803
|
const utxo = (0, import_sample4.default)(bitcoinResources.utxos.filter((u116) => u116.blockHeight && u116.value.gt(genericMinimalAmount)));
|
|
863765
863804
|
(0, import_invariant79.default)(utxo, "no confirmed utxo");
|
|
@@ -863812,7 +863851,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863812
863851
|
(0, import_invariant79.default)(bitcoinResources, "bitcoin resources");
|
|
863813
863852
|
const transaction = {
|
|
863814
863853
|
...bridge27.createTransaction(account3),
|
|
863815
|
-
feePerByte: new
|
|
863854
|
+
feePerByte: new import_bignumber423.BigNumber(1e-4),
|
|
863816
863855
|
opReturnData: Buffer.from("charley loves heidi", "utf-8")
|
|
863817
863856
|
};
|
|
863818
863857
|
return {
|
|
@@ -863843,7 +863882,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863843
863882
|
const recipient = recipientVariation(sibling.freshAddress);
|
|
863844
863883
|
const transaction = {
|
|
863845
863884
|
...bridge27.createTransaction(account3),
|
|
863846
|
-
feePerByte: new
|
|
863885
|
+
feePerByte: new import_bignumber423.BigNumber(0)
|
|
863847
863886
|
};
|
|
863848
863887
|
return {
|
|
863849
863888
|
transaction,
|
|
@@ -863865,7 +863904,7 @@ var bitcoinLikeMutations = ({ minimalAmount: minimalAmount11 = genericMinimalAmo
|
|
|
863865
863904
|
},
|
|
863866
863905
|
testDestination,
|
|
863867
863906
|
test: ({ account: account3 }) => {
|
|
863868
|
-
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"));
|
|
863869
863908
|
}
|
|
863870
863909
|
}
|
|
863871
863910
|
];
|
|
@@ -864122,7 +864161,7 @@ var specs_default2 = {
|
|
|
864122
864161
|
// ../../libs/coin-modules/coin-cardano/lib-es/specs.js
|
|
864123
864162
|
var import_expect5 = __toESM(require_build20());
|
|
864124
864163
|
init_lib_es5();
|
|
864125
|
-
var
|
|
864164
|
+
var import_bignumber424 = __toESM(require("bignumber.js"));
|
|
864126
864165
|
var import_invariant80 = __toESM(require("invariant"));
|
|
864127
864166
|
var import_typhonjs13 = __toESM(require_dist6());
|
|
864128
864167
|
|
|
@@ -864285,7 +864324,7 @@ var cardano = {
|
|
|
864285
864324
|
{ subAccountId: subAccount.id },
|
|
864286
864325
|
{ recipient },
|
|
864287
864326
|
{
|
|
864288
|
-
amount: new
|
|
864327
|
+
amount: new import_bignumber424.default(subAccount.balance.dividedBy(10)).dp(0, import_bignumber424.default.ROUND_CEIL)
|
|
864289
864328
|
}
|
|
864290
864329
|
];
|
|
864291
864330
|
return {
|
|
@@ -864313,7 +864352,7 @@ var cardano = {
|
|
|
864313
864352
|
const updates7 = [
|
|
864314
864353
|
{ recipient },
|
|
864315
864354
|
{
|
|
864316
|
-
amount: new
|
|
864355
|
+
amount: new import_bignumber424.default(account3.balance.dividedBy(2)).dp(0, import_bignumber424.default.ROUND_CEIL)
|
|
864317
864356
|
},
|
|
864318
864357
|
{ memo: "LedgerLiveBot" }
|
|
864319
864358
|
];
|
|
@@ -864328,7 +864367,7 @@ var cardano = {
|
|
|
864328
864367
|
memo: transaction.memo
|
|
864329
864368
|
};
|
|
864330
864369
|
if (cardanoResources.delegation?.rewards.gt(0)) {
|
|
864331
|
-
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new
|
|
864370
|
+
extra.rewards = formatCurrencyUnit(accountBeforeTransaction.currency.units[0], new import_bignumber424.default(cardanoResources.delegation.rewards), {
|
|
864332
864371
|
showCode: true,
|
|
864333
864372
|
disableRounding: true
|
|
864334
864373
|
});
|
|
@@ -864360,9 +864399,9 @@ var cardano = {
|
|
|
864360
864399
|
const changeAddress = import_typhonjs13.utils.getAddressFromString(account3.freshAddress);
|
|
864361
864400
|
const requiredAdaForChangeTokens = tokenBalance.length ? import_typhonjs13.utils.calculateMinUtxoAmountBabbage({
|
|
864362
864401
|
address: changeAddress,
|
|
864363
|
-
amount: new
|
|
864402
|
+
amount: new import_bignumber424.default(CARDANO_MAX_SUPPLY),
|
|
864364
864403
|
tokens: tokenBalance
|
|
864365
|
-
}, new
|
|
864404
|
+
}, new import_bignumber424.default(cardanoResources.protocolParams.utxoCostPerByte)) : new import_bignumber424.default(0);
|
|
864366
864405
|
botTest("remaining balance equals requiredAdaForTokens)", () => (0, import_expect5.default)(account3.balance).toEqual(requiredAdaForChangeTokens));
|
|
864367
864406
|
}
|
|
864368
864407
|
},
|
|
@@ -864458,7 +864497,7 @@ var specs_default3 = { cardano };
|
|
|
864458
864497
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
864459
864498
|
var import_invariant81 = __toESM(require("invariant"));
|
|
864460
864499
|
init_lib_es5();
|
|
864461
|
-
var
|
|
864500
|
+
var import_bignumber425 = __toESM(require("bignumber.js"));
|
|
864462
864501
|
var import_expect6 = __toESM(require_build20());
|
|
864463
864502
|
|
|
864464
864503
|
// ../../libs/coin-modules/coin-casper/lib-es/test/speculos-deviceActions.js
|
|
@@ -864511,7 +864550,7 @@ var acceptTransaction5 = deviceActionFlow({
|
|
|
864511
864550
|
});
|
|
864512
864551
|
|
|
864513
864552
|
// ../../libs/coin-modules/coin-casper/lib-es/test/bot-specs.js
|
|
864514
|
-
var MIN_SAFE2 = new
|
|
864553
|
+
var MIN_SAFE2 = new import_bignumber425.default(CASPER_MINIMUM_VALID_AMOUNT_MOTES * 2);
|
|
864515
864554
|
var maxAccount2 = 6;
|
|
864516
864555
|
var casperSpecs = {
|
|
864517
864556
|
name: "Casper",
|
|
@@ -864680,7 +864719,7 @@ var createLockMutation = () => ({
|
|
|
864680
864719
|
|
|
864681
864720
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createUnlockMutation.js
|
|
864682
864721
|
var import_invariant84 = __toESM(require("invariant"));
|
|
864683
|
-
var
|
|
864722
|
+
var import_bignumber426 = __toESM(require("bignumber.js"));
|
|
864684
864723
|
var currency10 = getCryptoCurrencyById("celo");
|
|
864685
864724
|
var minimalAmount3 = parseCurrencyUnit(currency10.units[0], "0.001");
|
|
864686
864725
|
var createUnlockMutation = () => ({
|
|
@@ -864691,7 +864730,7 @@ var createUnlockMutation = () => ({
|
|
|
864691
864730
|
(0, import_invariant84.default)(maxSpendable.gt(minimalAmount3), "Celo: Unlock | balance is too low");
|
|
864692
864731
|
const { celoResources } = account3;
|
|
864693
864732
|
(0, import_invariant84.default)(celoResources?.registrationStatus, "Celo: Unlock | Account is not registered");
|
|
864694
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
864733
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber426.default(0);
|
|
864695
864734
|
(0, import_invariant84.default)(nonvotingLockedBalance.gt(0), "Celo: Unlock | No non voting locked balance");
|
|
864696
864735
|
return {
|
|
864697
864736
|
transaction: bridge27.createTransaction(account3),
|
|
@@ -864732,7 +864771,7 @@ var createRegisterAccountMutation = () => ({
|
|
|
864732
864771
|
|
|
864733
864772
|
// ../../libs/coin-modules/coin-celo/lib-es/test/specs/createVoteMutation.js
|
|
864734
864773
|
var import_invariant86 = __toESM(require("invariant"));
|
|
864735
|
-
var
|
|
864774
|
+
var import_bignumber427 = __toESM(require("bignumber.js"));
|
|
864736
864775
|
var import_sampleSize = __toESM(require("lodash/sampleSize"));
|
|
864737
864776
|
var currency12 = getCryptoCurrencyById("celo");
|
|
864738
864777
|
var minimalAmount5 = parseCurrencyUnit(currency12.units[0], "0.001");
|
|
@@ -864744,7 +864783,7 @@ var createVoteMutation = () => ({
|
|
|
864744
864783
|
(0, import_invariant86.default)(maxSpendable.gt(minimalAmount5), "Celo: Vote | balance is too low");
|
|
864745
864784
|
const { celoResources } = account3;
|
|
864746
864785
|
(0, import_invariant86.default)(celoResources?.registrationStatus, "Celo: Vote | Account is not registered");
|
|
864747
|
-
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new
|
|
864786
|
+
const nonvotingLockedBalance = celoResources?.nonvotingLockedBalance || new import_bignumber427.default(0);
|
|
864748
864787
|
(0, import_invariant86.default)(nonvotingLockedBalance.gt(0), "Celo: Vote | No non voting locked balance");
|
|
864749
864788
|
const votes2 = celoResources.votes || [];
|
|
864750
864789
|
const { validatorGroups } = getCurrentCeloPreloadData();
|
|
@@ -864947,7 +864986,7 @@ var bot_specs_default3 = {
|
|
|
864947
864986
|
};
|
|
864948
864987
|
|
|
864949
864988
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
864950
|
-
var
|
|
864989
|
+
var import_bignumber428 = require("bignumber.js");
|
|
864951
864990
|
var import_expect7 = __toESM(require_build20());
|
|
864952
864991
|
var import_invariant90 = __toESM(require("invariant"));
|
|
864953
864992
|
var import_sample5 = __toESM(require("lodash/sample"));
|
|
@@ -865066,12 +865105,12 @@ var acceptTransaction7 = deviceActionFlow({
|
|
|
865066
865105
|
// ../../libs/coin-modules/coin-cosmos/lib-es/specs.js
|
|
865067
865106
|
var maxAccounts2 = 16;
|
|
865068
865107
|
function checkAmountsCloseEnough(amount1, amount2) {
|
|
865069
|
-
amount1 = new
|
|
865070
|
-
amount2 = new
|
|
865108
|
+
amount1 = new import_bignumber428.BigNumber(amount1);
|
|
865109
|
+
amount2 = new import_bignumber428.BigNumber(amount2);
|
|
865071
865110
|
(0, import_expect7.default)(amount1.isNegative()).toBe(false);
|
|
865072
865111
|
(0, import_expect7.default)(amount2.isNegative()).toBe(false);
|
|
865073
865112
|
const difference = amount1.minus(amount2).absoluteValue();
|
|
865074
|
-
const onePercentOfLargerNumber =
|
|
865113
|
+
const onePercentOfLargerNumber = import_bignumber428.BigNumber.max(amount1, amount2).multipliedBy(0.01);
|
|
865075
865114
|
const isCloseEnough = difference.isLessThan(onePercentOfLargerNumber);
|
|
865076
865115
|
if (!isCloseEnough) {
|
|
865077
865116
|
log2("bot", "delegation amounts do not match", `Amount1: ${amount1.toString()} , Amount2: ${amount2.toString()}`);
|
|
@@ -865381,14 +865420,14 @@ var generateGenericCosmosTest = (currencyId, isExpertModeRequired, config4) => {
|
|
|
865381
865420
|
...config4
|
|
865382
865421
|
};
|
|
865383
865422
|
};
|
|
865384
|
-
var cosmosMinimalTransactionAmount = new
|
|
865423
|
+
var cosmosMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865385
865424
|
var cosmos2 = {
|
|
865386
865425
|
...generateGenericCosmosTest("cosmos", false, {
|
|
865387
865426
|
minViableAmount: cosmosMinimalTransactionAmount,
|
|
865388
865427
|
mutations: cosmosLikeMutations(cosmosMinimalTransactionAmount)
|
|
865389
865428
|
})
|
|
865390
865429
|
};
|
|
865391
|
-
var osmosisMinimalTransactionAmount = new
|
|
865430
|
+
var osmosisMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865392
865431
|
var osmosis = {
|
|
865393
865432
|
...generateGenericCosmosTest("osmosis", false, {
|
|
865394
865433
|
minViableAmount: osmosisMinimalTransactionAmount,
|
|
@@ -865396,7 +865435,7 @@ var osmosis = {
|
|
|
865396
865435
|
testTimeout: 8 * 60 * 1e3
|
|
865397
865436
|
})
|
|
865398
865437
|
};
|
|
865399
|
-
var desmosMinimalTransactionAmount = new
|
|
865438
|
+
var desmosMinimalTransactionAmount = new import_bignumber428.BigNumber(500);
|
|
865400
865439
|
var desmos = {
|
|
865401
865440
|
...generateGenericCosmosTest("desmos", false, {
|
|
865402
865441
|
minViableAmount: desmosMinimalTransactionAmount,
|
|
@@ -865405,7 +865444,7 @@ var desmos = {
|
|
|
865405
865444
|
skipOperationHistory: true
|
|
865406
865445
|
})
|
|
865407
865446
|
};
|
|
865408
|
-
var dydxMinimalTransactionAmount = new
|
|
865447
|
+
var dydxMinimalTransactionAmount = new import_bignumber428.BigNumber(500);
|
|
865409
865448
|
var dydx = {
|
|
865410
865449
|
...generateGenericCosmosTest("dydx", false, {
|
|
865411
865450
|
minViableAmount: dydxMinimalTransactionAmount,
|
|
@@ -865414,7 +865453,7 @@ var dydx = {
|
|
|
865414
865453
|
skipOperationHistory: true
|
|
865415
865454
|
})
|
|
865416
865455
|
};
|
|
865417
|
-
var umeeMinimalTransactionAmount = new
|
|
865456
|
+
var umeeMinimalTransactionAmount = new import_bignumber428.BigNumber(15e3);
|
|
865418
865457
|
var umee = {
|
|
865419
865458
|
...generateGenericCosmosTest("umee", false, {
|
|
865420
865459
|
minViableAmount: umeeMinimalTransactionAmount,
|
|
@@ -865423,7 +865462,7 @@ var umee = {
|
|
|
865423
865462
|
skipOperationHistory: true
|
|
865424
865463
|
})
|
|
865425
865464
|
};
|
|
865426
|
-
var persistenceMinimalTransactionAmount = new
|
|
865465
|
+
var persistenceMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865427
865466
|
var persistence = {
|
|
865428
865467
|
...generateGenericCosmosTest("persistence", false, {
|
|
865429
865468
|
minViableAmount: persistenceMinimalTransactionAmount,
|
|
@@ -865432,7 +865471,7 @@ var persistence = {
|
|
|
865432
865471
|
skipOperationHistory: true
|
|
865433
865472
|
})
|
|
865434
865473
|
};
|
|
865435
|
-
var quicksilverMinimalTransactionAmount = new
|
|
865474
|
+
var quicksilverMinimalTransactionAmount = new import_bignumber428.BigNumber(600);
|
|
865436
865475
|
var quicksilver = {
|
|
865437
865476
|
...generateGenericCosmosTest("quicksilver", false, {
|
|
865438
865477
|
minViableAmount: quicksilverMinimalTransactionAmount,
|
|
@@ -865441,7 +865480,7 @@ var quicksilver = {
|
|
|
865441
865480
|
skipOperationHistory: true
|
|
865442
865481
|
})
|
|
865443
865482
|
};
|
|
865444
|
-
var onomyMinimalTransactionAmount = new
|
|
865483
|
+
var onomyMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865445
865484
|
var onomy = {
|
|
865446
865485
|
...generateGenericCosmosTest("onomy", false, {
|
|
865447
865486
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -865450,7 +865489,7 @@ var onomy = {
|
|
|
865450
865489
|
skipOperationHistory: true
|
|
865451
865490
|
})
|
|
865452
865491
|
};
|
|
865453
|
-
var seiMinimalTransactionAmount = new
|
|
865492
|
+
var seiMinimalTransactionAmount = new import_bignumber428.BigNumber(5e3);
|
|
865454
865493
|
var sei = {
|
|
865455
865494
|
...generateGenericCosmosTest("sei_network", false, {
|
|
865456
865495
|
minViableAmount: onomyMinimalTransactionAmount,
|
|
@@ -865459,7 +865498,7 @@ var sei = {
|
|
|
865459
865498
|
skipOperationHistory: true
|
|
865460
865499
|
})
|
|
865461
865500
|
};
|
|
865462
|
-
var axelarMinimalTransactionAmount = new
|
|
865501
|
+
var axelarMinimalTransactionAmount = new import_bignumber428.BigNumber(1e4);
|
|
865463
865502
|
var axelar = {
|
|
865464
865503
|
...generateGenericCosmosTest("axelar", false, {
|
|
865465
865504
|
minViableAmount: axelarMinimalTransactionAmount,
|
|
@@ -865467,7 +865506,7 @@ var axelar = {
|
|
|
865467
865506
|
skipOperationHistory: true
|
|
865468
865507
|
})
|
|
865469
865508
|
};
|
|
865470
|
-
var secretNetworkMinimalTransactionAmount = new
|
|
865509
|
+
var secretNetworkMinimalTransactionAmount = new import_bignumber428.BigNumber(6e4);
|
|
865471
865510
|
var secretNetwork = {
|
|
865472
865511
|
...generateGenericCosmosTest("secret_network", false, {
|
|
865473
865512
|
minViableAmount: secretNetworkMinimalTransactionAmount,
|
|
@@ -865475,7 +865514,7 @@ var secretNetwork = {
|
|
|
865475
865514
|
skipOperationHistory: true
|
|
865476
865515
|
})
|
|
865477
865516
|
};
|
|
865478
|
-
var stargazeMinimalTransactionAmount = new
|
|
865517
|
+
var stargazeMinimalTransactionAmount = new import_bignumber428.BigNumber(16e4);
|
|
865479
865518
|
var stargaze = {
|
|
865480
865519
|
...generateGenericCosmosTest("stargaze", false, {
|
|
865481
865520
|
minViableAmount: stargazeMinimalTransactionAmount,
|
|
@@ -865483,7 +865522,7 @@ var stargaze = {
|
|
|
865483
865522
|
skipOperationHistory: true
|
|
865484
865523
|
})
|
|
865485
865524
|
};
|
|
865486
|
-
var coreumMinimalTransactionAmount = new
|
|
865525
|
+
var coreumMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865487
865526
|
var coreum = {
|
|
865488
865527
|
...generateGenericCosmosTest("coreum", false, {
|
|
865489
865528
|
minViableAmount: coreumMinimalTransactionAmount,
|
|
@@ -865491,7 +865530,7 @@ var coreum = {
|
|
|
865491
865530
|
skipOperationHistory: true
|
|
865492
865531
|
})
|
|
865493
865532
|
};
|
|
865494
|
-
var injectiveMinimalTransactionAmount = new
|
|
865533
|
+
var injectiveMinimalTransactionAmount = new import_bignumber428.BigNumber(1e6);
|
|
865495
865534
|
var injective = {
|
|
865496
865535
|
...generateGenericCosmosTest("injective", true, {
|
|
865497
865536
|
minViableAmount: injectiveMinimalTransactionAmount,
|
|
@@ -865499,7 +865538,7 @@ var injective = {
|
|
|
865499
865538
|
skipOperationHistory: true
|
|
865500
865539
|
})
|
|
865501
865540
|
};
|
|
865502
|
-
var mantraMinimalTransactionAmount = new
|
|
865541
|
+
var mantraMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865503
865542
|
var mantra = {
|
|
865504
865543
|
...generateGenericCosmosTest("mantra", false, {
|
|
865505
865544
|
minViableAmount: mantraMinimalTransactionAmount,
|
|
@@ -865507,7 +865546,7 @@ var mantra = {
|
|
|
865507
865546
|
skipOperationHistory: true
|
|
865508
865547
|
})
|
|
865509
865548
|
};
|
|
865510
|
-
var cryptoOrgMinimalTransactionAmount = new
|
|
865549
|
+
var cryptoOrgMinimalTransactionAmount = new import_bignumber428.BigNumber(1e6);
|
|
865511
865550
|
var cryptoOrg = {
|
|
865512
865551
|
...generateGenericCosmosTest("crypto_org", false, {
|
|
865513
865552
|
minViableAmount: cryptoOrgMinimalTransactionAmount,
|
|
@@ -865516,7 +865555,7 @@ var cryptoOrg = {
|
|
|
865516
865555
|
skipOperationHistory: true
|
|
865517
865556
|
})
|
|
865518
865557
|
};
|
|
865519
|
-
var xionMinimalTransactionAmount = new
|
|
865558
|
+
var xionMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865520
865559
|
var xion = {
|
|
865521
865560
|
...generateGenericCosmosTest("xion", false, {
|
|
865522
865561
|
minViableAmount: xionMinimalTransactionAmount,
|
|
@@ -865524,7 +865563,7 @@ var xion = {
|
|
|
865524
865563
|
skipOperationHistory: true
|
|
865525
865564
|
})
|
|
865526
865565
|
};
|
|
865527
|
-
var zenrockMinimalTransactionAmount = new
|
|
865566
|
+
var zenrockMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865528
865567
|
var zenrock = {
|
|
865529
865568
|
...generateGenericCosmosTest("zenrock", false, {
|
|
865530
865569
|
minViableAmount: zenrockMinimalTransactionAmount,
|
|
@@ -865532,7 +865571,7 @@ var zenrock = {
|
|
|
865532
865571
|
skipOperationHistory: true
|
|
865533
865572
|
})
|
|
865534
865573
|
};
|
|
865535
|
-
var babylonMinimalTransactionAmount = new
|
|
865574
|
+
var babylonMinimalTransactionAmount = new import_bignumber428.BigNumber(2e4);
|
|
865536
865575
|
var babylon = {
|
|
865537
865576
|
...generateGenericCosmosTest("babylon", false, {
|
|
865538
865577
|
minViableAmount: babylonMinimalTransactionAmount,
|
|
@@ -865566,7 +865605,7 @@ var specs_default4 = {
|
|
|
865566
865605
|
var import_expect8 = __toESM(require_build20());
|
|
865567
865606
|
var import_invariant91 = __toESM(require("invariant"));
|
|
865568
865607
|
var import_sample6 = __toESM(require("lodash/sample"));
|
|
865569
|
-
var
|
|
865608
|
+
var import_bignumber429 = __toESM(require("bignumber.js"));
|
|
865570
865609
|
init_lib_es5();
|
|
865571
865610
|
|
|
865572
865611
|
// ../../libs/coin-modules/coin-evm/lib-es/speculos-deviceActions.js
|
|
@@ -865737,7 +865776,7 @@ var testTokenDestination = (args3) => {
|
|
|
865737
865776
|
(0, import_expect8.default)(destination).toBeDefined();
|
|
865738
865777
|
});
|
|
865739
865778
|
const destinationBeforeTransaction = findSubAccountById(coinDestinationBeforeTransaction, operation.accountId);
|
|
865740
|
-
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()));
|
|
865741
865780
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect8.default)({
|
|
865742
865781
|
type: operation.type,
|
|
865743
865782
|
amount: operation.value.toString()
|
|
@@ -866115,7 +866154,7 @@ var bot_specs_default4 = { hedera };
|
|
|
866115
866154
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
866116
866155
|
var import_invariant94 = __toESM(require("invariant"));
|
|
866117
866156
|
init_lib_es5();
|
|
866118
|
-
var
|
|
866157
|
+
var import_bignumber430 = __toESM(require("bignumber.js"));
|
|
866119
866158
|
|
|
866120
866159
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/speculos-deviceActions.js
|
|
866121
866160
|
var import_invariant93 = __toESM(require("invariant"));
|
|
@@ -866261,7 +866300,7 @@ var generateDeviceActionFlow = (scenario) => {
|
|
|
866261
866300
|
// ../../libs/coin-modules/coin-filecoin/lib-es/test/bot-specs.js
|
|
866262
866301
|
var F4_RECIPIENT = "f410fncojwmrseefktoco6rcnb3zv2eiqfli7muhvqma";
|
|
866263
866302
|
var ETH_RECIPIENT = "0x689c9b3232210aa9b84ef444d0ef35d11102ad1f";
|
|
866264
|
-
var MIN_SAFE3 = new
|
|
866303
|
+
var MIN_SAFE3 = new import_bignumber430.default(1e5);
|
|
866265
866304
|
var maxAccount4 = 6;
|
|
866266
866305
|
var filecoinSpecs = {
|
|
866267
866306
|
name: "Filecoin",
|
|
@@ -866286,7 +866325,7 @@ var filecoinSpecs = {
|
|
|
866286
866325
|
deviceAction: generateDeviceActionFlow(BotScenario.F4_RECIPIENT),
|
|
866287
866326
|
testDestination: genericTestDestination,
|
|
866288
866327
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
866289
|
-
const amount = new
|
|
866328
|
+
const amount = new import_bignumber430.default("100");
|
|
866290
866329
|
return {
|
|
866291
866330
|
transaction: bridge27.createTransaction(account3),
|
|
866292
866331
|
updates: [
|
|
@@ -866307,7 +866346,7 @@ var filecoinSpecs = {
|
|
|
866307
866346
|
deviceAction: generateDeviceActionFlow(BotScenario.ETH_RECIPIENT),
|
|
866308
866347
|
testDestination: genericTestDestination,
|
|
866309
866348
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
866310
|
-
const amount = new
|
|
866349
|
+
const amount = new import_bignumber430.default("100");
|
|
866311
866350
|
return {
|
|
866312
866351
|
transaction: bridge27.createTransaction(account3),
|
|
866313
866352
|
updates: [
|
|
@@ -866406,7 +866445,7 @@ var bot_specs_default5 = {
|
|
|
866406
866445
|
var import_invariant95 = __toESM(require("invariant"));
|
|
866407
866446
|
init_lib_es5();
|
|
866408
866447
|
var import_expect10 = __toESM(require_build20());
|
|
866409
|
-
var
|
|
866448
|
+
var import_bignumber431 = __toESM(require("bignumber.js"));
|
|
866410
866449
|
|
|
866411
866450
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/speculos-deviceActions.js
|
|
866412
866451
|
var ignoreSpaces = (s129) => s129.replace(/ /g, "");
|
|
@@ -866460,7 +866499,7 @@ var acceptTransaction10 = deviceActionFlow({
|
|
|
866460
866499
|
});
|
|
866461
866500
|
|
|
866462
866501
|
// ../../libs/coin-modules/coin-internet_computer/lib-es/test/bot-specs.js
|
|
866463
|
-
var MIN_SAFE4 = new
|
|
866502
|
+
var MIN_SAFE4 = new import_bignumber431.default(10);
|
|
866464
866503
|
var maxAccount5 = 6;
|
|
866465
866504
|
var internetComputerSpecs = {
|
|
866466
866505
|
name: "InternetComputer",
|
|
@@ -866555,7 +866594,7 @@ var bot_specs_default6 = {
|
|
|
866555
866594
|
// ../../libs/coin-modules/coin-icon/lib-es/specs.js
|
|
866556
866595
|
var import_invariant96 = __toESM(require("invariant"));
|
|
866557
866596
|
init_lib_es5();
|
|
866558
|
-
var
|
|
866597
|
+
var import_bignumber432 = __toESM(require("bignumber.js"));
|
|
866559
866598
|
var import_expect11 = __toESM(require_build20());
|
|
866560
866599
|
|
|
866561
866600
|
// ../../libs/coin-modules/coin-icon/lib-es/speculos-deviceActions.js
|
|
@@ -866678,7 +866717,7 @@ var icon = {
|
|
|
866678
866717
|
};
|
|
866679
866718
|
},
|
|
866680
866719
|
test: ({ account: account3 }) => {
|
|
866681
|
-
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)));
|
|
866682
866721
|
}
|
|
866683
866722
|
}
|
|
866684
866723
|
]
|
|
@@ -866693,7 +866732,7 @@ init_lib_es5();
|
|
|
866693
866732
|
var import_expect12 = __toESM(require_build20());
|
|
866694
866733
|
|
|
866695
866734
|
// ../../libs/coin-modules/coin-multiversx/lib-es/speculos-deviceActions.js
|
|
866696
|
-
var
|
|
866735
|
+
var import_bignumber433 = __toESM(require("bignumber.js"));
|
|
866697
866736
|
var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
866698
866737
|
steps: [
|
|
866699
866738
|
{
|
|
@@ -866713,7 +866752,7 @@ var acceptMoveBalanceTransaction = deviceActionFlow({
|
|
|
866713
866752
|
{
|
|
866714
866753
|
title: "Fee",
|
|
866715
866754
|
button: SpeculosButton2.RIGHT,
|
|
866716
|
-
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), {
|
|
866717
866756
|
showCode: true,
|
|
866718
866757
|
disableRounding: true,
|
|
866719
866758
|
joinFragmentsSeparator: " "
|
|
@@ -866754,7 +866793,7 @@ var acceptDelegateTransaction = deviceActionFlow({
|
|
|
866754
866793
|
{
|
|
866755
866794
|
title: "Fee",
|
|
866756
866795
|
button: SpeculosButton2.RIGHT,
|
|
866757
|
-
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), {
|
|
866758
866797
|
showCode: true,
|
|
866759
866798
|
disableRounding: true,
|
|
866760
866799
|
joinFragmentsSeparator: " "
|
|
@@ -866787,7 +866826,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
866787
866826
|
{
|
|
866788
866827
|
title: "Amount",
|
|
866789
866828
|
button: SpeculosButton2.RIGHT,
|
|
866790
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
866829
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber433.default(0), {
|
|
866791
866830
|
showCode: true,
|
|
866792
866831
|
disableRounding: true,
|
|
866793
866832
|
joinFragmentsSeparator: " "
|
|
@@ -866796,7 +866835,7 @@ var acceptUndelegateTransaction = deviceActionFlow({
|
|
|
866796
866835
|
{
|
|
866797
866836
|
title: "Fee",
|
|
866798
866837
|
button: SpeculosButton2.RIGHT,
|
|
866799
|
-
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), {
|
|
866800
866839
|
showCode: true,
|
|
866801
866840
|
disableRounding: true,
|
|
866802
866841
|
joinFragmentsSeparator: " "
|
|
@@ -866828,7 +866867,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
866828
866867
|
{
|
|
866829
866868
|
title: "Amount",
|
|
866830
866869
|
button: SpeculosButton2.RIGHT,
|
|
866831
|
-
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new
|
|
866870
|
+
expectedValue: ({ account: account3 }) => formatCurrencyUnit(account3.currency.units[0], new import_bignumber433.default(0), {
|
|
866832
866871
|
showCode: true,
|
|
866833
866872
|
disableRounding: true,
|
|
866834
866873
|
joinFragmentsSeparator: " "
|
|
@@ -866837,7 +866876,7 @@ var acceptWithdrawTransaction = deviceActionFlow({
|
|
|
866837
866876
|
{
|
|
866838
866877
|
title: "Fee",
|
|
866839
866878
|
button: SpeculosButton2.RIGHT,
|
|
866840
|
-
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), {
|
|
866841
866880
|
showCode: true,
|
|
866842
866881
|
disableRounding: true,
|
|
866843
866882
|
joinFragmentsSeparator: " "
|
|
@@ -866904,7 +866943,7 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
866904
866943
|
{
|
|
866905
866944
|
title: "Fee",
|
|
866906
866945
|
button: SpeculosButton2.RIGHT,
|
|
866907
|
-
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), {
|
|
866908
866947
|
showCode: true,
|
|
866909
866948
|
disableRounding: true,
|
|
866910
866949
|
joinFragmentsSeparator: " "
|
|
@@ -866924,12 +866963,12 @@ var acceptEsdtTransferTransaction = deviceActionFlow({
|
|
|
866924
866963
|
});
|
|
866925
866964
|
|
|
866926
866965
|
// ../../libs/coin-modules/coin-multiversx/lib-es/specs.js
|
|
866927
|
-
var
|
|
866966
|
+
var import_bignumber434 = __toESM(require("bignumber.js"));
|
|
866928
866967
|
var import_sample7 = __toESM(require("lodash/sample"));
|
|
866929
866968
|
var currency19 = getCryptoCurrencyById("elrond");
|
|
866930
866969
|
var minimalAmount9 = parseCurrencyUnit(currency19.units[0], "0.001");
|
|
866931
866970
|
var maxAccounts4 = 6;
|
|
866932
|
-
var MULTIVERSX_MIN_ACTIVATION_SAFE = new
|
|
866971
|
+
var MULTIVERSX_MIN_ACTIVATION_SAFE = new import_bignumber434.default(1e4);
|
|
866933
866972
|
var UNCAPPED_PROVIDER = "erd1qqqqqqqqqqqqqqqpqqqqqqqqqqqqqqqqqqqqqqqqqqqqqlhllllsr0pd0j";
|
|
866934
866973
|
function expectCorrectBalanceChange(input) {
|
|
866935
866974
|
const { account: account3, operation, accountBeforeTransaction } = input;
|
|
@@ -867137,7 +867176,7 @@ var multiversx = {
|
|
|
867137
867176
|
transaction: ({ account: account3, bridge: bridge27 }) => {
|
|
867138
867177
|
const delegations = account3?.multiversxResources?.delegations;
|
|
867139
867178
|
(0, import_invariant97.default)(delegations?.length, "account doesn't have any delegations");
|
|
867140
|
-
(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");
|
|
867141
867180
|
const amount = MIN_DELEGATION_AMOUNT;
|
|
867142
867181
|
return {
|
|
867143
867182
|
transaction: bridge27.createTransaction(account3),
|
|
@@ -867167,8 +867206,8 @@ var multiversx = {
|
|
|
867167
867206
|
// among all delegations
|
|
867168
867207
|
delegations.some((d132) => (
|
|
867169
867208
|
// among all undelegating amounts
|
|
867170
|
-
d132.userUndelegatedList?.some((u116) => new
|
|
867171
|
-
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))
|
|
867172
867211
|
)),
|
|
867173
867212
|
"no withdrawable stake for account"
|
|
867174
867213
|
);
|
|
@@ -867178,7 +867217,7 @@ var multiversx = {
|
|
|
867178
867217
|
{
|
|
867179
867218
|
recipient: UNCAPPED_PROVIDER,
|
|
867180
867219
|
mode: "withdraw",
|
|
867181
|
-
amount: new
|
|
867220
|
+
amount: new import_bignumber434.default(0)
|
|
867182
867221
|
}
|
|
867183
867222
|
]
|
|
867184
867223
|
};
|
|
@@ -867200,7 +867239,7 @@ var specs_default7 = {
|
|
|
867200
867239
|
// ../../libs/coin-modules/coin-near/lib-es/specs.js
|
|
867201
867240
|
var import_invariant98 = __toESM(require("invariant"));
|
|
867202
867241
|
var import_expect13 = __toESM(require_build20());
|
|
867203
|
-
var
|
|
867242
|
+
var import_bignumber435 = require("bignumber.js");
|
|
867204
867243
|
init_lib_es5();
|
|
867205
867244
|
|
|
867206
867245
|
// ../../libs/coin-modules/coin-near/lib-es/speculos-deviceActions.js
|
|
@@ -867348,7 +867387,7 @@ var near = {
|
|
|
867348
867387
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
867349
867388
|
(0, import_invariant98.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
867350
867389
|
const { nearResources } = account3;
|
|
867351
|
-
const staked = nearResources?.stakedBalance || new
|
|
867390
|
+
const staked = nearResources?.stakedBalance || new import_bignumber435.BigNumber(0);
|
|
867352
867391
|
(0, import_invariant98.default)(staked.gt(minimalAmount10), "staked balance is too low for unstaking");
|
|
867353
867392
|
const halfStaked = staked.div(2);
|
|
867354
867393
|
const amount = halfStaked.gt(minimalAmount10) ? halfStaked.integerValue() : staked.integerValue();
|
|
@@ -867370,7 +867409,7 @@ var near = {
|
|
|
867370
867409
|
transaction: ({ account: account3, bridge: bridge27, maxSpendable }) => {
|
|
867371
867410
|
(0, import_invariant98.default)(maxSpendable.gt(stakingFee), "balance is too low for fees");
|
|
867372
867411
|
const { nearResources } = account3;
|
|
867373
|
-
const available = nearResources?.availableBalance || new
|
|
867412
|
+
const available = nearResources?.availableBalance || new import_bignumber435.BigNumber(0);
|
|
867374
867413
|
(0, import_invariant98.default)(available.gt(minimalAmount10), "available balance is too low for withdrawing");
|
|
867375
867414
|
const halfAvailable = available.div(2);
|
|
867376
867415
|
const amount = halfAvailable.gt(minimalAmount10) ? halfAvailable.integerValue() : available.integerValue();
|
|
@@ -867395,7 +867434,7 @@ var specs_default8 = {
|
|
|
867395
867434
|
var import_expect14 = __toESM(require_build20());
|
|
867396
867435
|
var import_invariant99 = __toESM(require("invariant"));
|
|
867397
867436
|
var import_sampleSize3 = __toESM(require("lodash/sampleSize"));
|
|
867398
|
-
var
|
|
867437
|
+
var import_bignumber436 = require("bignumber.js");
|
|
867399
867438
|
init_lib_es5();
|
|
867400
867439
|
|
|
867401
867440
|
// ../../libs/coin-modules/coin-polkadot/lib-es/test/bot-deviceActions.js
|
|
@@ -867582,7 +867621,7 @@ var polkadot2 = {
|
|
|
867582
867621
|
} else {
|
|
867583
867622
|
(0, import_invariant99.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "cant cover fee + bonding amount");
|
|
867584
867623
|
options24.push({
|
|
867585
|
-
amount: new
|
|
867624
|
+
amount: new import_bignumber436.BigNumber(1e5)
|
|
867586
867625
|
});
|
|
867587
867626
|
}
|
|
867588
867627
|
return {
|
|
@@ -867628,7 +867667,7 @@ var polkadot2 = {
|
|
|
867628
867667
|
(0, import_invariant99.default)(polkadotResources, "polkadot");
|
|
867629
867668
|
(0, import_invariant99.default)(polkadotResources?.unlockingBalance.gt(MIN_LOCKED_BALANCE_REQ), "can't rebond");
|
|
867630
867669
|
(0, import_invariant99.default)(account3.spendableBalance.gt(POLKADOT_MIN_SAFE), "can't cover fee");
|
|
867631
|
-
const amount =
|
|
867670
|
+
const amount = import_bignumber436.BigNumber.maximum(polkadotResources.unlockingBalance.times(0.2), MIN_LOCKED_BALANCE_REQ);
|
|
867632
867671
|
return {
|
|
867633
867672
|
transaction: bridge27.createTransaction(account3),
|
|
867634
867673
|
updates: [
|
|
@@ -867696,7 +867735,7 @@ var import_expect15 = __toESM(require_build20());
|
|
|
867696
867735
|
init_lib_es5();
|
|
867697
867736
|
|
|
867698
867737
|
// ../../libs/coin-modules/coin-solana/lib-es/speculos-deviceActions.js
|
|
867699
|
-
var
|
|
867738
|
+
var import_bignumber437 = __toESM(require("bignumber.js"));
|
|
867700
867739
|
function getMainCurrency(currency24) {
|
|
867701
867740
|
if (currency24.isTestnetFor !== void 0) {
|
|
867702
867741
|
return getCryptoCurrencyById(currency24.isTestnetFor);
|
|
@@ -867708,7 +867747,7 @@ function ellipsis(str) {
|
|
|
867708
867747
|
}
|
|
867709
867748
|
function formatAmount(c118, amount) {
|
|
867710
867749
|
const currency24 = c118.type === "CryptoCurrency" ? getMainCurrency(c118) : c118;
|
|
867711
|
-
return formatDeviceAmount(currency24, new
|
|
867750
|
+
return formatDeviceAmount(currency24, new import_bignumber437.default(amount), {
|
|
867712
867751
|
postfixCode: true
|
|
867713
867752
|
});
|
|
867714
867753
|
}
|
|
@@ -868059,7 +868098,7 @@ function throwUnexpectedTransaction() {
|
|
|
868059
868098
|
|
|
868060
868099
|
// ../../libs/coin-modules/coin-solana/lib-es/specs.js
|
|
868061
868100
|
var import_fp6 = require("lodash/fp");
|
|
868062
|
-
var
|
|
868101
|
+
var import_bignumber438 = __toESM(require("bignumber.js"));
|
|
868063
868102
|
var maxAccount7 = 9;
|
|
868064
868103
|
var solana = {
|
|
868065
868104
|
name: "Solana",
|
|
@@ -868113,7 +868152,7 @@ var solana = {
|
|
|
868113
868152
|
},
|
|
868114
868153
|
test: (input) => {
|
|
868115
868154
|
const { accountBeforeTransaction, account: account3, operation } = input;
|
|
868116
|
-
const estimatedMaxSpendable =
|
|
868155
|
+
const estimatedMaxSpendable = import_bignumber438.default.max(accountBeforeTransaction.spendableBalance.minus(SYSTEM_ACCOUNT_RENT_EXEMPT), 0).toNumber();
|
|
868117
868156
|
botTest("operation value should be estimated max spendable", () => (0, import_expect15.default)(operation.value.toNumber()).toBe(estimatedMaxSpendable));
|
|
868118
868157
|
botTest("account spendableBalance should be zero", () => (0, import_expect15.default)(account3.spendableBalance.toNumber()).toBe(0));
|
|
868119
868158
|
expectCorrectBalanceChange2(input);
|
|
@@ -868152,7 +868191,7 @@ var solana = {
|
|
|
868152
868191
|
}
|
|
868153
868192
|
},
|
|
868154
868193
|
{
|
|
868155
|
-
amount: new
|
|
868194
|
+
amount: new import_bignumber438.default(1e5)
|
|
868156
868195
|
}
|
|
868157
868196
|
]
|
|
868158
868197
|
};
|
|
@@ -868653,7 +868692,7 @@ var specs_default9 = {
|
|
|
868653
868692
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
868654
868693
|
var import_invariant101 = __toESM(require("invariant"));
|
|
868655
868694
|
init_lib_es5();
|
|
868656
|
-
var
|
|
868695
|
+
var import_bignumber439 = __toESM(require("bignumber.js"));
|
|
868657
868696
|
var import_expect16 = __toESM(require_build20());
|
|
868658
868697
|
|
|
868659
868698
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-deviceActions.js
|
|
@@ -868702,7 +868741,7 @@ var acceptTransaction14 = deviceActionFlow({
|
|
|
868702
868741
|
});
|
|
868703
868742
|
|
|
868704
868743
|
// ../../libs/coin-modules/coin-stacks/lib-es/test/bot-specs.js
|
|
868705
|
-
var MIN_SAFE5 = new
|
|
868744
|
+
var MIN_SAFE5 = new import_bignumber439.default(1e4);
|
|
868706
868745
|
var stacksSpecs = {
|
|
868707
868746
|
name: "Stacks",
|
|
868708
868747
|
currency: getCryptoCurrencyById("stacks"),
|
|
@@ -868768,7 +868807,7 @@ var bot_specs_default8 = {
|
|
|
868768
868807
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-specs.js
|
|
868769
868808
|
var import_expect17 = __toESM(require_build20());
|
|
868770
868809
|
var import_invariant102 = __toESM(require("invariant"));
|
|
868771
|
-
var
|
|
868810
|
+
var import_bignumber440 = __toESM(require("bignumber.js"));
|
|
868772
868811
|
init_lib_es5();
|
|
868773
868812
|
|
|
868774
868813
|
// ../../libs/coin-modules/coin-stellar/lib-es/test/bot-deviceActions.js
|
|
@@ -868909,7 +868948,7 @@ var stellar = {
|
|
|
868909
868948
|
recipient,
|
|
868910
868949
|
// Setting higher max fee here to make sure transaction doesn't
|
|
868911
868950
|
// time out.
|
|
868912
|
-
fees: new
|
|
868951
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
868913
868952
|
},
|
|
868914
868953
|
{
|
|
868915
868954
|
amount
|
|
@@ -868960,7 +868999,7 @@ var stellar = {
|
|
|
868960
868999
|
recipient,
|
|
868961
869000
|
// Setting higher max fee here to make sure transaction doesn't
|
|
868962
869001
|
// time out.
|
|
868963
|
-
fees: new
|
|
869002
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
868964
869003
|
},
|
|
868965
869004
|
{
|
|
868966
869005
|
useAllAmount: true
|
|
@@ -869012,7 +869051,7 @@ var stellar = {
|
|
|
869012
869051
|
mode: "changeTrust",
|
|
869013
869052
|
// Setting higher max fee here to make sure transaction doesn't
|
|
869014
869053
|
// time out.
|
|
869015
|
-
fees: new
|
|
869054
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
869016
869055
|
},
|
|
869017
869056
|
{
|
|
869018
869057
|
assetReference: USDC_CODE,
|
|
@@ -869058,7 +869097,7 @@ var stellar = {
|
|
|
869058
869097
|
amount,
|
|
869059
869098
|
// Setting higher max fee here to make sure transaction doesn't
|
|
869060
869099
|
// time out.
|
|
869061
|
-
fees: new
|
|
869100
|
+
fees: new import_bignumber440.default(MAX_FEE)
|
|
869062
869101
|
}
|
|
869063
869102
|
];
|
|
869064
869103
|
if (Math.random() < 0.5) {
|
|
@@ -869341,7 +869380,7 @@ var bot_specs_default10 = {
|
|
|
869341
869380
|
|
|
869342
869381
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
869343
869382
|
init_lib_es5();
|
|
869344
|
-
var
|
|
869383
|
+
var import_bignumber441 = __toESM(require("bignumber.js"));
|
|
869345
869384
|
var import_expect18 = __toESM(require_build20());
|
|
869346
869385
|
var import_invariant104 = __toESM(require("invariant"));
|
|
869347
869386
|
|
|
@@ -869418,11 +869457,11 @@ var generateDeviceActionFlow2 = (scenario) => {
|
|
|
869418
869457
|
};
|
|
869419
869458
|
|
|
869420
869459
|
// ../../libs/coin-modules/coin-ton/lib-es/specs.js
|
|
869421
|
-
var MIN_SAFE6 = new
|
|
869460
|
+
var MIN_SAFE6 = new import_bignumber441.default(15e6);
|
|
869422
869461
|
var testDestination2 = ({ destination, destinationBeforeTransaction, sendingOperation }) => {
|
|
869423
869462
|
const amount = sendingOperation.value;
|
|
869424
869463
|
const inOp = destination.operations.find((op) => op.hash === sendingOperation.hash && op.type === "IN");
|
|
869425
|
-
const inFees = inOp?.fee ?? (0,
|
|
869464
|
+
const inFees = inOp?.fee ?? (0, import_bignumber441.default)(0);
|
|
869426
869465
|
botTest("account balance increased with transaction amount", () => (0, import_expect18.default)(destination.balance.toString()).toBe(destinationBeforeTransaction.balance.plus(amount).minus(inFees).toString()));
|
|
869427
869466
|
botTest("operation amount is consistent with sendingOperation", () => (0, import_expect18.default)({
|
|
869428
869467
|
type: inOp?.type,
|
|
@@ -869545,7 +869584,7 @@ var specs_default10 = {
|
|
|
869545
869584
|
};
|
|
869546
869585
|
|
|
869547
869586
|
// ../../libs/coin-modules/coin-vechain/lib-es/test/bot-specs.js
|
|
869548
|
-
var
|
|
869587
|
+
var import_bignumber442 = __toESM(require("bignumber.js"));
|
|
869549
869588
|
var import_invariant105 = __toESM(require("invariant"));
|
|
869550
869589
|
init_lib_es5();
|
|
869551
869590
|
|
|
@@ -869645,7 +869684,7 @@ var vet = {
|
|
|
869645
869684
|
};
|
|
869646
869685
|
},
|
|
869647
869686
|
test: ({ account: account3 }) => {
|
|
869648
|
-
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()));
|
|
869649
869688
|
}
|
|
869650
869689
|
}
|
|
869651
869690
|
]
|
|
@@ -869677,7 +869716,7 @@ var vtho = {
|
|
|
869677
869716
|
};
|
|
869678
869717
|
},
|
|
869679
869718
|
test: ({ account: account3, accountBeforeTransaction }) => {
|
|
869680
|
-
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()));
|
|
869681
869720
|
}
|
|
869682
869721
|
},
|
|
869683
869722
|
{
|
|
@@ -869704,7 +869743,7 @@ var vtho = {
|
|
|
869704
869743
|
};
|
|
869705
869744
|
},
|
|
869706
869745
|
test: ({ account: account3 }) => {
|
|
869707
|
-
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()));
|
|
869708
869747
|
}
|
|
869709
869748
|
}
|
|
869710
869749
|
]
|
|
@@ -869819,7 +869858,7 @@ var bot_specs_default12 = {
|
|
|
869819
869858
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
869820
869859
|
var import_invariant107 = __toESM(require("invariant"));
|
|
869821
869860
|
init_lib_es5();
|
|
869822
|
-
var
|
|
869861
|
+
var import_bignumber443 = __toESM(require("bignumber.js"));
|
|
869823
869862
|
var import_expect20 = __toESM(require_build20());
|
|
869824
869863
|
|
|
869825
869864
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-deviceActions.js
|
|
@@ -869893,7 +869932,7 @@ var getRandomTransferID3 = () => {
|
|
|
869893
869932
|
|
|
869894
869933
|
// ../../libs/coin-modules/coin-mina/lib-es/test/bot-specs.js
|
|
869895
869934
|
var maxAccount9 = 6;
|
|
869896
|
-
var MIN_SAFE7 = new
|
|
869935
|
+
var MIN_SAFE7 = new import_bignumber443.default(1 * 10 ** 8);
|
|
869897
869936
|
var minaSpecs = {
|
|
869898
869937
|
name: "Mina",
|
|
869899
869938
|
currency: getCryptoCurrencyById("mina"),
|
|
@@ -871348,7 +871387,7 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871348
871387
|
});
|
|
871349
871388
|
const period = "month";
|
|
871350
871389
|
const portfolio = countervaluesState ? getPortfolio(allAccountsAfter, period, countervaluesState, usd) : null;
|
|
871351
|
-
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), {
|
|
871352
871391
|
showCode: true
|
|
871353
871392
|
}) : "";
|
|
871354
871393
|
const allMutationReports = (0, import_flatMap26.default)(results2, (r95) => r95.mutations || []);
|
|
@@ -871564,7 +871603,7 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871564
871603
|
function sumAccounts(all7) {
|
|
871565
871604
|
if (!all7 || all7.length === 0)
|
|
871566
871605
|
return;
|
|
871567
|
-
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));
|
|
871568
871607
|
}
|
|
871569
871608
|
const { accountsBefore } = r95;
|
|
871570
871609
|
const accountsBeforeBalance = sumAccounts(accountsBefore);
|
|
@@ -871575,16 +871614,16 @@ async function bot({ disabled, filter: filter27 } = {}) {
|
|
|
871575
871614
|
let etaEmoji = "\u274C";
|
|
871576
871615
|
const accounts2 = r95.accountsAfter || r95.accountsBefore || [];
|
|
871577
871616
|
const operations4 = (0, import_flatMap26.default)(accounts2, (a134) => a134.operations).sort((a134, b27) => a134.fee.minus(b27.fee).toNumber());
|
|
871578
|
-
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);
|
|
871579
871618
|
const maxRuns = r95.spec.mutations.reduce((sum2, m118) => sum2 + m118.maxRun || 1, 0);
|
|
871580
871619
|
if (avgOperationFee.gt(0) && maxRuns > 0) {
|
|
871581
|
-
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));
|
|
871582
871621
|
eta = spendableBalanceSum.div(avgOperationFee).div(maxRuns).toNumber();
|
|
871583
871622
|
etaEmoji = eta < 50 ? "\u26A0\uFE0F" : eta < 500 ? "\u{1F44D}" : "\u{1F4AA}";
|
|
871584
871623
|
}
|
|
871585
871624
|
if (countervaluesState && r95.accountsAfter) {
|
|
871586
871625
|
const portfolio2 = getPortfolio(r95.accountsAfter, period, countervaluesState, usd);
|
|
871587
|
-
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), {
|
|
871588
871627
|
showCode: true
|
|
871589
871628
|
}) : "";
|
|
871590
871629
|
balance2 += " (" + totalUSD2 + ")";
|
|
@@ -871692,7 +871731,7 @@ ${slackBody}`;
|
|
|
871692
871731
|
}
|
|
871693
871732
|
|
|
871694
871733
|
// src/scan.ts
|
|
871695
|
-
var
|
|
871734
|
+
var import_bignumber445 = require("bignumber.js");
|
|
871696
871735
|
var import_rxjs173 = require("rxjs");
|
|
871697
871736
|
var import_operators17 = require("rxjs/operators");
|
|
871698
871737
|
|
|
@@ -872032,8 +872071,8 @@ function scan3(arg) {
|
|
|
872032
872071
|
creationDate: /* @__PURE__ */ new Date(),
|
|
872033
872072
|
lastSyncDate: /* @__PURE__ */ new Date(0),
|
|
872034
872073
|
blockHeight: 0,
|
|
872035
|
-
balance: new
|
|
872036
|
-
spendableBalance: new
|
|
872074
|
+
balance: new import_bignumber445.BigNumber(0),
|
|
872075
|
+
spendableBalance: new import_bignumber445.BigNumber(0),
|
|
872037
872076
|
operationsCount: 0,
|
|
872038
872077
|
operations: [],
|
|
872039
872078
|
pendingOperations: [],
|
|
@@ -872594,7 +872633,7 @@ testBridge(dataset);
|
|
|
872594
872633
|
};
|
|
872595
872634
|
|
|
872596
872635
|
// src/commands/blockchain/generateTestTransaction.ts
|
|
872597
|
-
var
|
|
872636
|
+
var import_bignumber447 = require("bignumber.js");
|
|
872598
872637
|
init_lib_es2();
|
|
872599
872638
|
var import_rxjs180 = require("rxjs");
|
|
872600
872639
|
var import_operators25 = require("rxjs/operators");
|
|
@@ -872603,7 +872642,7 @@ var import_operators25 = require("rxjs/operators");
|
|
|
872603
872642
|
var import_uniqBy3 = __toESM(require("lodash/uniqBy"));
|
|
872604
872643
|
var import_shuffle = __toESM(require("lodash/shuffle"));
|
|
872605
872644
|
var import_flatMap27 = __toESM(require("lodash/flatMap"));
|
|
872606
|
-
var
|
|
872645
|
+
var import_bignumber446 = require("bignumber.js");
|
|
872607
872646
|
|
|
872608
872647
|
// ../../libs/ledger-live-common/lib-es/generated/cli-transaction.js
|
|
872609
872648
|
var cli_transaction_default = {
|
|
@@ -872717,11 +872756,11 @@ async function inferTransactions26(mainAccount, opts) {
|
|
|
872717
872756
|
const transaction = bridge27.createTransaction(mainAccount);
|
|
872718
872757
|
transaction.recipient = recipient;
|
|
872719
872758
|
transaction.useAllAmount = !!opts["use-all-amount"];
|
|
872720
|
-
transaction.amount = transaction.useAllAmount ? new
|
|
872759
|
+
transaction.amount = transaction.useAllAmount ? new import_bignumber446.BigNumber(0) : inferAmount(account3, opts.amount || "0");
|
|
872721
872760
|
if (opts.tokenIds && opts.collection) {
|
|
872722
872761
|
transaction.tokenIds = opts.tokenIds.split(",");
|
|
872723
872762
|
transaction.collection = opts.collection;
|
|
872724
|
-
transaction.quantities = opts.quantities?.split(",")?.map((q13) => new
|
|
872763
|
+
transaction.quantities = opts.quantities?.split(",")?.map((q13) => new import_bignumber446.BigNumber(q13));
|
|
872725
872764
|
}
|
|
872726
872765
|
return {
|
|
872727
872766
|
account: account3,
|
|
@@ -872768,7 +872807,7 @@ var toJS = (obj2) => {
|
|
|
872768
872807
|
if (obj2 instanceof Error) {
|
|
872769
872808
|
return `new ${obj2.name || "Error"}()`;
|
|
872770
872809
|
}
|
|
872771
|
-
if (
|
|
872810
|
+
if (import_bignumber447.BigNumber.isBigNumber(obj2)) {
|
|
872772
872811
|
return `BigNumber("${obj2.toFixed()}")`;
|
|
872773
872812
|
}
|
|
872774
872813
|
const keys2 = Object.keys(obj2);
|
|
@@ -879939,13 +879978,13 @@ var speculosList_default = {
|
|
|
879939
879978
|
};
|
|
879940
879979
|
|
|
879941
879980
|
// src/commands/live/balanceHistory.ts
|
|
879942
|
-
var
|
|
879981
|
+
var import_bignumber448 = require("bignumber.js");
|
|
879943
879982
|
var import_asciichart = require("asciichart");
|
|
879944
879983
|
var import_invariant122 = __toESM(require("invariant"));
|
|
879945
879984
|
var import_operators86 = require("rxjs/operators");
|
|
879946
879985
|
var histoFormatters = {
|
|
879947
879986
|
default: (histo, account3) => histo.map(
|
|
879948
|
-
({ 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), {
|
|
879949
879988
|
showCode: true,
|
|
879950
879989
|
disableRounding: true
|
|
879951
879990
|
})
|
|
@@ -879956,13 +879995,13 @@ var histoFormatters = {
|
|
|
879956
879995
|
disableRounding: true
|
|
879957
879996
|
}) + "\n" + (0, import_asciichart.plot)(
|
|
879958
879997
|
history.map(
|
|
879959
|
-
(h67) => h67.value / new
|
|
879998
|
+
(h67) => h67.value / new import_bignumber448.BigNumber(10).pow(account3.currency.units[0].magnitude).toNumber()
|
|
879960
879999
|
),
|
|
879961
880000
|
{
|
|
879962
880001
|
height: 10,
|
|
879963
880002
|
format: (value2) => formatCurrencyUnit(
|
|
879964
880003
|
account3.currency.units[0],
|
|
879965
|
-
new
|
|
880004
|
+
new import_bignumber448.BigNumber(value2).times(new import_bignumber448.BigNumber(10).pow(account3.currency.units[0].magnitude)),
|
|
879966
880005
|
{
|
|
879967
880006
|
showCode: true,
|
|
879968
880007
|
disableRounding: true
|
|
@@ -880007,7 +880046,7 @@ var balanceHistory_default = {
|
|
|
880007
880046
|
|
|
880008
880047
|
// src/commands/live/countervalues.ts
|
|
880009
880048
|
var import_uniq3 = __toESM(require("lodash/uniq"));
|
|
880010
|
-
var
|
|
880049
|
+
var import_bignumber449 = require("bignumber.js");
|
|
880011
880050
|
var import_asciichart2 = require("asciichart");
|
|
880012
880051
|
var import_invariant123 = __toESM(require("invariant"));
|
|
880013
880052
|
var import_rxjs268 = require("rxjs");
|
|
@@ -880020,7 +880059,7 @@ var histoFormatters2 = {
|
|
|
880020
880059
|
return availability === "100" ? `"${countervalue.ticker}",` : void 0;
|
|
880021
880060
|
},
|
|
880022
880061
|
default: (histo, currency24, countervalue) => histo.map(
|
|
880023
|
-
({ 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), {
|
|
880024
880063
|
showCode: true,
|
|
880025
880064
|
disableRounding: true
|
|
880026
880065
|
})
|
|
@@ -880028,13 +880067,13 @@ var histoFormatters2 = {
|
|
|
880028
880067
|
json: (histo) => toBalanceHistoryRaw(histo),
|
|
880029
880068
|
asciichart: (history, currency24, countervalue) => "\n" + "".padStart(22) + currency24.name + " to " + countervalue.name + "\n" + (0, import_asciichart2.plot)(
|
|
880030
880069
|
history.map(
|
|
880031
|
-
(h67) => new
|
|
880070
|
+
(h67) => new import_bignumber449.BigNumber(h67.value || 0).div(new import_bignumber449.BigNumber(10).pow(countervalue.units[0].magnitude)).toNumber()
|
|
880032
880071
|
),
|
|
880033
880072
|
{
|
|
880034
880073
|
height: 10,
|
|
880035
880074
|
format: (value2) => formatCurrencyUnit(
|
|
880036
880075
|
countervalue.units[0],
|
|
880037
|
-
new
|
|
880076
|
+
new import_bignumber449.BigNumber(value2).times(new import_bignumber449.BigNumber(10).pow(countervalue.units[0].magnitude)),
|
|
880038
880077
|
{
|
|
880039
880078
|
showCode: true,
|
|
880040
880079
|
disableRounding: true
|
|
@@ -883789,7 +883828,7 @@ function mapValues4(obj2, fn4) {
|
|
|
883789
883828
|
}
|
|
883790
883829
|
|
|
883791
883830
|
// ../../libs/live-wallet/lib-es/liveqr/cross.js
|
|
883792
|
-
var
|
|
883831
|
+
var import_bignumber450 = require("bignumber.js");
|
|
883793
883832
|
var accountDataToAccount = ({ id: id5, currencyId, freshAddress: inputFreshAddress, name: name2, index, balance: balance2, derivationMode: derivationModeStr, seedIdentifier }) => {
|
|
883794
883833
|
const { xpubOrAddress } = decodeAccountId(id5);
|
|
883795
883834
|
const derivationMode = asDerivationMode(derivationModeStr);
|
|
@@ -883816,7 +883855,7 @@ var accountDataToAccount = ({ id: id5, currencyId, freshAddress: inputFreshAddre
|
|
|
883816
883855
|
account: index
|
|
883817
883856
|
});
|
|
883818
883857
|
}
|
|
883819
|
-
const balanceBN = new
|
|
883858
|
+
const balanceBN = new import_bignumber450.BigNumber(balance2);
|
|
883820
883859
|
const account3 = {
|
|
883821
883860
|
type: "Account",
|
|
883822
883861
|
id: id5,
|
|
@@ -884360,7 +884399,7 @@ var liveData_default = {
|
|
|
884360
884399
|
};
|
|
884361
884400
|
|
|
884362
884401
|
// src/commands/live/portfolio.ts
|
|
884363
|
-
var
|
|
884402
|
+
var import_bignumber451 = require("bignumber.js");
|
|
884364
884403
|
var import_asciichart3 = require("asciichart");
|
|
884365
884404
|
var import_invariant124 = __toESM(require("invariant"));
|
|
884366
884405
|
var import_rxjs274 = require("rxjs");
|
|
@@ -884419,24 +884458,24 @@ var portfolio_default = {
|
|
|
884419
884458
|
function render(title, accounts3) {
|
|
884420
884459
|
const portfolio = getPortfolio(accounts3, period, state, countervalue);
|
|
884421
884460
|
const balance2 = portfolio.balanceHistory[portfolio.balanceHistory.length - 1].value;
|
|
884422
|
-
return title + " " + formatCurrencyUnit(unit, new
|
|
884461
|
+
return title + " " + formatCurrencyUnit(unit, new import_bignumber451.BigNumber(balance2), {
|
|
884423
884462
|
showCode: true,
|
|
884424
884463
|
disableRounding: true
|
|
884425
884464
|
}) + (portfolio.countervalueChange.percentage ? " ::: on a " + period + " period: " + Math.round(portfolio.countervalueChange.percentage * 100).toString() + "% (" + formatCurrencyUnit(
|
|
884426
884465
|
unit,
|
|
884427
|
-
new
|
|
884466
|
+
new import_bignumber451.BigNumber(portfolio.countervalueChange.value),
|
|
884428
884467
|
{
|
|
884429
884468
|
showCode: true
|
|
884430
884469
|
}
|
|
884431
884470
|
) + ")" : "") + "\n" + (0, import_asciichart3.plot)(
|
|
884432
884471
|
portfolio.balanceHistory.map(
|
|
884433
|
-
(h67) => new
|
|
884472
|
+
(h67) => new import_bignumber451.BigNumber(h67.value).div(new import_bignumber451.BigNumber(10).pow(unit.magnitude)).toNumber()
|
|
884434
884473
|
),
|
|
884435
884474
|
{
|
|
884436
884475
|
height: 10,
|
|
884437
884476
|
format: (value2) => formatCurrencyUnit(
|
|
884438
884477
|
unit,
|
|
884439
|
-
new
|
|
884478
|
+
new import_bignumber451.BigNumber(value2).times(new import_bignumber451.BigNumber(10).pow(unit.magnitude)),
|
|
884440
884479
|
{
|
|
884441
884480
|
showCode: true,
|
|
884442
884481
|
disableRounding: true
|
|
@@ -884749,7 +884788,7 @@ var version_default3 = {
|
|
|
884749
884788
|
// src/commands/ptx/swap.ts
|
|
884750
884789
|
var import_operators91 = require("rxjs/operators");
|
|
884751
884790
|
var import_rxjs280 = require("rxjs");
|
|
884752
|
-
var
|
|
884791
|
+
var import_bignumber455 = require("bignumber.js");
|
|
884753
884792
|
var import_command_line_args = __toESM(require("command-line-args"));
|
|
884754
884793
|
|
|
884755
884794
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
@@ -885184,7 +885223,7 @@ var lib_es_default5 = Exchange;
|
|
|
885184
885223
|
|
|
885185
885224
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/initSwap.js
|
|
885186
885225
|
init_lib_es2();
|
|
885187
|
-
var
|
|
885226
|
+
var import_bignumber453 = require("bignumber.js");
|
|
885188
885227
|
var import_invariant126 = __toESM(require("invariant"));
|
|
885189
885228
|
var import_rxjs279 = require("rxjs");
|
|
885190
885229
|
|
|
@@ -885203,20 +885242,20 @@ var getCurrencyExchangeConfig = async (currency24) => {
|
|
|
885203
885242
|
};
|
|
885204
885243
|
|
|
885205
885244
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/mock.js
|
|
885206
|
-
var
|
|
885245
|
+
var import_bignumber452 = require("bignumber.js");
|
|
885207
885246
|
var import_rxjs278 = require("rxjs");
|
|
885208
885247
|
var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
885209
885248
|
const { fromAccount, toAccount } = exchange;
|
|
885210
885249
|
const amount = transaction.amount;
|
|
885211
885250
|
const unitFrom = getAccountCurrency(fromAccount).units[0];
|
|
885212
885251
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(toAccount).units[0];
|
|
885213
|
-
const tenPowMagnitude = new
|
|
885252
|
+
const tenPowMagnitude = new import_bignumber452.BigNumber(10).pow(unitFrom.magnitude);
|
|
885214
885253
|
const amountFrom = amount.div(tenPowMagnitude);
|
|
885215
|
-
const minAmountFrom = new
|
|
885216
|
-
const maxAmountFrom = new
|
|
885254
|
+
const minAmountFrom = new import_bignumber452.BigNumber(1e-4);
|
|
885255
|
+
const maxAmountFrom = new import_bignumber452.BigNumber(1e3);
|
|
885217
885256
|
if (amountFrom.lte(minAmountFrom)) {
|
|
885218
885257
|
throw new SwapExchangeRateAmountTooLow(void 0, {
|
|
885219
|
-
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
885258
|
+
minAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber452.BigNumber(minAmountFrom).times(tenPowMagnitude), {
|
|
885220
885259
|
alwaysShowSign: false,
|
|
885221
885260
|
disableRounding: true,
|
|
885222
885261
|
showCode: true
|
|
@@ -885225,7 +885264,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885225
885264
|
}
|
|
885226
885265
|
if (amountFrom.gte(maxAmountFrom)) {
|
|
885227
885266
|
throw new SwapExchangeRateAmountTooHigh(void 0, {
|
|
885228
|
-
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new
|
|
885267
|
+
maxAmountFromFormatted: formatCurrencyUnit(unitFrom, new import_bignumber452.BigNumber(maxAmountFrom).times(tenPowMagnitude), {
|
|
885229
885268
|
alwaysShowSign: false,
|
|
885230
885269
|
disableRounding: true,
|
|
885231
885270
|
showCode: true
|
|
@@ -885233,10 +885272,10 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885233
885272
|
});
|
|
885234
885273
|
}
|
|
885235
885274
|
await new Promise((r95) => setTimeout(r95, 800));
|
|
885236
|
-
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));
|
|
885237
885276
|
return [
|
|
885238
885277
|
{
|
|
885239
|
-
rate: new
|
|
885278
|
+
rate: new import_bignumber452.BigNumber("1"),
|
|
885240
885279
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885241
885280
|
magnitudeAwareRate,
|
|
885242
885281
|
rateId: "changellyRateId1",
|
|
@@ -885246,7 +885285,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885246
885285
|
tradeMethod: "fixed"
|
|
885247
885286
|
},
|
|
885248
885287
|
{
|
|
885249
|
-
rate: new
|
|
885288
|
+
rate: new import_bignumber452.BigNumber("1.1"),
|
|
885250
885289
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885251
885290
|
magnitudeAwareRate,
|
|
885252
885291
|
rateId: "changellyRateId2",
|
|
@@ -885256,7 +885295,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885256
885295
|
tradeMethod: "float"
|
|
885257
885296
|
},
|
|
885258
885297
|
{
|
|
885259
|
-
rate: new
|
|
885298
|
+
rate: new import_bignumber452.BigNumber("0.9"),
|
|
885260
885299
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885261
885300
|
magnitudeAwareRate,
|
|
885262
885301
|
rateId: "cicRateId1",
|
|
@@ -885266,7 +885305,7 @@ var mockGetExchangeRates = async (exchange, transaction, currencyTo) => {
|
|
|
885266
885305
|
tradeMethod: "float"
|
|
885267
885306
|
},
|
|
885268
885307
|
{
|
|
885269
|
-
rate: new
|
|
885308
|
+
rate: new import_bignumber452.BigNumber("0.95"),
|
|
885270
885309
|
toAmount: amount.times(magnitudeAwareRate),
|
|
885271
885310
|
magnitudeAwareRate,
|
|
885272
885311
|
rateId: "1inchRateId1",
|
|
@@ -885284,7 +885323,7 @@ var mockInitSwap = (exchange, exchangeRate, transaction) => {
|
|
|
885284
885323
|
initSwapResult: {
|
|
885285
885324
|
transaction,
|
|
885286
885325
|
swapId: "mockedSwapId",
|
|
885287
|
-
magnitudeAwareRate: new
|
|
885326
|
+
magnitudeAwareRate: new import_bignumber452.BigNumber(5e4)
|
|
885288
885327
|
}
|
|
885289
885328
|
});
|
|
885290
885329
|
};
|
|
@@ -885587,7 +885626,7 @@ var initSwap = (input) => {
|
|
|
885587
885626
|
const payoutCurrency = getAccountCurrency(toAccount);
|
|
885588
885627
|
const refundAccount = getMainAccount(fromAccount, fromParentAccount);
|
|
885589
885628
|
const payoutAccount = getMainAccount(toAccount, toParentAccount);
|
|
885590
|
-
const apiAmount = new
|
|
885629
|
+
const apiAmount = new import_bignumber453.BigNumber(amount).div(new import_bignumber453.BigNumber(10).pow(unitFrom.magnitude));
|
|
885591
885630
|
let res;
|
|
885592
885631
|
const swapProviderConfig = await getSwapProvider(provider);
|
|
885593
885632
|
const headers = {
|
|
@@ -885641,7 +885680,7 @@ var initSwap = (input) => {
|
|
|
885641
885680
|
});
|
|
885642
885681
|
if (refundCurrency.id === "ripple") {
|
|
885643
885682
|
transaction = accountBridge15.updateTransaction(transaction, {
|
|
885644
|
-
tag: new
|
|
885683
|
+
tag: new import_bignumber453.BigNumber(swapResult.payinExtraId).toNumber()
|
|
885645
885684
|
});
|
|
885646
885685
|
(0, import_invariant126.default)(transaction.tag, "Refusing to swap xrp without a destination tag");
|
|
885647
885686
|
} else if (refundCurrency.id === "stellar") {
|
|
@@ -885723,13 +885762,13 @@ var initSwap = (input) => {
|
|
|
885723
885762
|
let amountExpectedTo;
|
|
885724
885763
|
if (swapResult.binaryPayload) {
|
|
885725
885764
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
885726
|
-
amountExpectedTo = new
|
|
885765
|
+
amountExpectedTo = new import_bignumber453.BigNumber(decodePayload.amountToWallet.toString());
|
|
885727
885766
|
magnitudeAwareRate = transaction.amount && amountExpectedTo.dividedBy(transaction.amount);
|
|
885728
885767
|
}
|
|
885729
885768
|
let amountExpectedFrom;
|
|
885730
885769
|
if (swapResult.binaryPayload) {
|
|
885731
885770
|
const decodePayload = await decodePayloadProtobuf(swapResult.binaryPayload);
|
|
885732
|
-
amountExpectedFrom = new
|
|
885771
|
+
amountExpectedFrom = new import_bignumber453.BigNumber(decodePayload.amountToProvider.toString());
|
|
885733
885772
|
if (data6.amountFromInSmallestDenomination !== amountExpectedFrom.toNumber())
|
|
885734
885773
|
throw new Error("AmountFrom received from partner's payload mismatch user input");
|
|
885735
885774
|
}
|
|
@@ -885795,7 +885834,7 @@ var initSwap = (input) => {
|
|
|
885795
885834
|
var initSwap_default = initSwap;
|
|
885796
885835
|
|
|
885797
885836
|
// ../../libs/ledger-live-common/lib-es/exchange/swap/getExchangeRates.js
|
|
885798
|
-
var
|
|
885837
|
+
var import_bignumber454 = require("bignumber.js");
|
|
885799
885838
|
var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [], timeout: timeout10, timeoutErrorMessage }) => {
|
|
885800
885839
|
if (isIntegrationTestEnv())
|
|
885801
885840
|
return mockGetExchangeRates(exchange, transaction, currencyTo);
|
|
@@ -885804,8 +885843,8 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885804
885843
|
const to = (currencyTo ?? getAccountCurrency(exchange.toAccount)).id;
|
|
885805
885844
|
const unitTo = (currencyTo && currencyTo.units[0]) ?? getAccountCurrency(exchange.toAccount).units[0];
|
|
885806
885845
|
const amountFrom = transaction.amount;
|
|
885807
|
-
const tenPowMagnitude = new
|
|
885808
|
-
const apiAmount = new
|
|
885846
|
+
const tenPowMagnitude = new import_bignumber454.BigNumber(10).pow(unitFrom.magnitude);
|
|
885847
|
+
const apiAmount = new import_bignumber454.BigNumber(amountFrom).div(tenPowMagnitude);
|
|
885809
885848
|
const providerList = providers.filter((provider) => provider.pairs.some((pair) => pair.from === from91 && pair.to === to)).map((item) => item.provider);
|
|
885810
885849
|
const request2 = {
|
|
885811
885850
|
from: from91,
|
|
@@ -885832,12 +885871,12 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885832
885871
|
error
|
|
885833
885872
|
};
|
|
885834
885873
|
}
|
|
885835
|
-
const payoutNetworkFees = new
|
|
885836
|
-
const magnitudeAwarePayoutNetworkFees = payoutNetworkFees.times(new
|
|
885837
|
-
const rate2 = maybeRate ? new
|
|
885838
|
-
const magnitudeAwareRate = rate2.div(new
|
|
885839
|
-
const toAmount = new
|
|
885840
|
-
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));
|
|
885841
885880
|
const out = {
|
|
885842
885881
|
magnitudeAwareRate,
|
|
885843
885882
|
provider,
|
|
@@ -885865,7 +885904,7 @@ var getExchangeRates = async ({ exchange, transaction, currencyTo, providers = [
|
|
|
885865
885904
|
return rates;
|
|
885866
885905
|
};
|
|
885867
885906
|
var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
885868
|
-
const tenPowMagnitude = new
|
|
885907
|
+
const tenPowMagnitude = new import_bignumber454.BigNumber(10).pow(unitFrom.magnitude);
|
|
885869
885908
|
const { amountTo, minAmountFrom, maxAmountFrom, errorCode, errorMessage, provider, status } = responseData;
|
|
885870
885909
|
const isDex = (await getSwapProvider(provider)).type === "DEX";
|
|
885871
885910
|
if ((!minAmountFrom || !maxAmountFrom) && status === "error" && errorCode !== 300 && isDex) {
|
|
@@ -885879,17 +885918,17 @@ var inferError = async (apiAmount, unitFrom, responseData) => {
|
|
|
885879
885918
|
}
|
|
885880
885919
|
const hasAmountLimit = minAmountFrom || maxAmountFrom;
|
|
885881
885920
|
if (hasAmountLimit) {
|
|
885882
|
-
const isTooSmall = minAmountFrom ? new
|
|
885921
|
+
const isTooSmall = minAmountFrom ? new import_bignumber454.BigNumber(apiAmount).lte(minAmountFrom) : false;
|
|
885883
885922
|
const MinOrMaxError = isTooSmall ? SwapExchangeRateAmountTooLow : SwapExchangeRateAmountTooHigh;
|
|
885884
885923
|
const key2 = isTooSmall ? "minAmountFromFormatted" : "maxAmountFromFormatted";
|
|
885885
885924
|
const amount = isTooSmall ? minAmountFrom : maxAmountFrom;
|
|
885886
885925
|
return new MinOrMaxError(void 0, {
|
|
885887
|
-
[key2]: formatCurrencyUnit(unitFrom, new
|
|
885926
|
+
[key2]: formatCurrencyUnit(unitFrom, new import_bignumber454.BigNumber(amount).times(tenPowMagnitude), {
|
|
885888
885927
|
alwaysShowSign: false,
|
|
885889
885928
|
disableRounding: true,
|
|
885890
885929
|
showCode: true
|
|
885891
885930
|
}),
|
|
885892
|
-
amount: new
|
|
885931
|
+
amount: new import_bignumber454.BigNumber(amount)
|
|
885893
885932
|
});
|
|
885894
885933
|
}
|
|
885895
885934
|
}
|
|
@@ -885994,7 +886033,7 @@ var exec6 = async (opts) => {
|
|
|
885994
886033
|
}
|
|
885995
886034
|
);
|
|
885996
886035
|
console.log(" :balance: ", fromAccount.spendableBalance.toString(), ` [ ${formattedAmount} ]`);
|
|
885997
|
-
(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`);
|
|
885998
886037
|
console.log("\u2022 Open the destination currency app");
|
|
885999
886038
|
await delay(8e3);
|
|
886000
886039
|
let toParentAccount = null;
|
|
@@ -886036,7 +886075,7 @@ var exec6 = async (opts) => {
|
|
|
886036
886075
|
});
|
|
886037
886076
|
if (!useAllAmount) {
|
|
886038
886077
|
transaction = bridge27.updateTransaction(transaction, {
|
|
886039
|
-
amount: new
|
|
886078
|
+
amount: new import_bignumber455.BigNumber(amount)
|
|
886040
886079
|
});
|
|
886041
886080
|
} else {
|
|
886042
886081
|
const amount2 = await bridge27.estimateMaxSpendable({
|