@ledgerhq/live-cli 24.25.0-nightly.1 → 24.25.0-nightly.2

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.
Files changed (2) hide show
  1. package/lib/cli.js +348 -305
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -96492,10 +96492,10 @@ var require_lib3 = __commonJS({
96492
96492
  function getExtendedPublicKeySync(key2) {
96493
96493
  return getKeyFromHash(sha512s(checkPrivateKey(key2)));
96494
96494
  }
96495
- async function getPublicKey4(privateKey) {
96495
+ async function getPublicKey5(privateKey) {
96496
96496
  return (await getExtendedPublicKey(privateKey)).pointBytes;
96497
96497
  }
96498
- exports2.getPublicKey = getPublicKey4;
96498
+ exports2.getPublicKey = getPublicKey5;
96499
96499
  function getPublicKeySync(privateKey) {
96500
96500
  return getExtendedPublicKeySync(privateKey).pointBytes;
96501
96501
  }
@@ -99332,10 +99332,10 @@ var require_lib4 = __commonJS({
99332
99332
  return Signature6.fromCompact(signature4);
99333
99333
  }
99334
99334
  }
99335
- function getPublicKey4(privateKey, isCompressed2 = false) {
99335
+ function getPublicKey5(privateKey, isCompressed2 = false) {
99336
99336
  return Point5.fromPrivateKey(privateKey).toRawBytes(isCompressed2);
99337
99337
  }
99338
- exports2.getPublicKey = getPublicKey4;
99338
+ exports2.getPublicKey = getPublicKey5;
99339
99339
  function recoverPublicKey2(msgHash, signature4, recovery, isCompressed2 = false) {
99340
99340
  return Point5.fromSignature(msgHash, signature4, recovery).toRawBytes(isCompressed2);
99341
99341
  }
@@ -139336,7 +139336,7 @@ var require_weierstrass = __commonJS({
139336
139336
  return point3;
139337
139337
  }
139338
139338
  };
139339
- function getPublicKey4(privateKey, isCompressed2 = true) {
139339
+ function getPublicKey5(privateKey, isCompressed2 = true) {
139340
139340
  return Point5.fromPrivateKey(privateKey).toRawBytes(isCompressed2);
139341
139341
  }
139342
139342
  function isProbPub(item) {
@@ -139472,7 +139472,7 @@ var require_weierstrass = __commonJS({
139472
139472
  }
139473
139473
  return {
139474
139474
  CURVE: CURVE2,
139475
- getPublicKey: getPublicKey4,
139475
+ getPublicKey: getPublicKey5,
139476
139476
  getSharedSecret,
139477
139477
  sign: sign7,
139478
139478
  verify: verify9,
@@ -213684,12 +213684,12 @@ var require_weierstrass2 = __commonJS({
213684
213684
  function randomSecretKey(seed = randomBytes_(lengths.seed)) {
213685
213685
  return (0, modular_ts_1.mapHashToField)((0, utils_ts_1._abytes2)(seed, lengths.seed, "seed"), Fn2.ORDER);
213686
213686
  }
213687
- function getPublicKey4(secretKey, isCompressed2 = true) {
213687
+ function getPublicKey5(secretKey, isCompressed2 = true) {
213688
213688
  return Point5.BASE.multiply(_normFnElement2(Fn2, secretKey)).toBytes(isCompressed2);
213689
213689
  }
213690
213690
  function keygen(seed) {
213691
213691
  const secretKey = randomSecretKey(seed);
213692
- return { secretKey, publicKey: getPublicKey4(secretKey) };
213692
+ return { secretKey, publicKey: getPublicKey5(secretKey) };
213693
213693
  }
213694
213694
  function isProbPub(item) {
213695
213695
  if (typeof item === "bigint")
@@ -213723,7 +213723,7 @@ var require_weierstrass2 = __commonJS({
213723
213723
  return point3.precompute(windowSize, false);
213724
213724
  }
213725
213725
  };
213726
- return Object.freeze({ getPublicKey: getPublicKey4, getSharedSecret, keygen, Point: Point5, utils: utils6, lengths });
213726
+ return Object.freeze({ getPublicKey: getPublicKey5, getSharedSecret, keygen, Point: Point5, utils: utils6, lengths });
213727
213727
  }
213728
213728
  function ecdsa2(Point5, hash10, ecdsaOpts = {}) {
213729
213729
  (0, utils_12.ahash)(hash10);
@@ -213738,7 +213738,7 @@ var require_weierstrass2 = __commonJS({
213738
213738
  const hmac6 = ecdsaOpts.hmac || ((key2, ...msgs) => (0, hmac_js_1.hmac)(hash10, key2, (0, utils_ts_1.concatBytes)(...msgs)));
213739
213739
  const { Fp: Fp5, Fn: Fn2 } = Point5;
213740
213740
  const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn2;
213741
- const { keygen, getPublicKey: getPublicKey4, getSharedSecret, utils: utils6, lengths } = ecdh2(Point5, ecdsaOpts);
213741
+ const { keygen, getPublicKey: getPublicKey5, getSharedSecret, utils: utils6, lengths } = ecdh2(Point5, ecdsaOpts);
213742
213742
  const defaultSigOpts = {
213743
213743
  prehash: false,
213744
213744
  lowS: typeof ecdsaOpts.lowS === "boolean" ? ecdsaOpts.lowS : false,
@@ -213984,7 +213984,7 @@ var require_weierstrass2 = __commonJS({
213984
213984
  }
213985
213985
  return Object.freeze({
213986
213986
  keygen,
213987
- getPublicKey: getPublicKey4,
213987
+ getPublicKey: getPublicKey5,
213988
213988
  getSharedSecret,
213989
213989
  utils: utils6,
213990
213990
  lengths,
@@ -362522,7 +362522,7 @@ var require_edwards2 = __commonJS({
362522
362522
  const pointBytes = point3.toRawBytes();
362523
362523
  return { head: head2, prefix: prefix3, scalar, point: point3, pointBytes };
362524
362524
  }
362525
- function getPublicKey4(privKey) {
362525
+ function getPublicKey5(privKey) {
362526
362526
  return getExtendedPublicKey(privKey).pointBytes;
362527
362527
  }
362528
362528
  function hashDomainToScalar(context = new Uint8Array(), ...msgs) {
@@ -362584,7 +362584,7 @@ var require_edwards2 = __commonJS({
362584
362584
  };
362585
362585
  return {
362586
362586
  CURVE: CURVE2,
362587
- getPublicKey: getPublicKey4,
362587
+ getPublicKey: getPublicKey5,
362588
362588
  sign: sign7,
362589
362589
  verify: verify9,
362590
362590
  ExtendedPoint: Point5,
@@ -399685,10 +399685,10 @@ var require_keys3 = __commonJS({
399685
399685
  return { ...messageSignature, data: (0, common_1.signatureVrsToRsv)(messageSignature.data) };
399686
399686
  }
399687
399687
  exports2.signMessageHashRsv = signMessageHashRsv;
399688
- function getPublicKey4(privateKey) {
399688
+ function getPublicKey5(privateKey) {
399689
399689
  return pubKeyfromPrivKey2(privateKey.data);
399690
399690
  }
399691
- exports2.getPublicKey = getPublicKey4;
399691
+ exports2.getPublicKey = getPublicKey5;
399692
399692
  function privateKeyToString(privateKey) {
399693
399693
  return (0, common_1.bytesToHex)(privateKey.data);
399694
399694
  }
@@ -460400,7 +460400,7 @@ var require_edwards3 = __commonJS({
460400
460400
  const pointBytes = point3.toBytes();
460401
460401
  return { head: head2, prefix: prefix3, scalar, point: point3, pointBytes };
460402
460402
  }
460403
- function getPublicKey4(secretKey) {
460403
+ function getPublicKey5(secretKey) {
460404
460404
  return getExtendedPublicKey(secretKey).pointBytes;
460405
460405
  }
460406
460406
  function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
@@ -460461,7 +460461,7 @@ var require_edwards3 = __commonJS({
460461
460461
  }
460462
460462
  function keygen(seed) {
460463
460463
  const secretKey = utils6.randomSecretKey(seed);
460464
- return { secretKey, publicKey: getPublicKey4(secretKey) };
460464
+ return { secretKey, publicKey: getPublicKey5(secretKey) };
460465
460465
  }
460466
460466
  function isValidSecretKey(key2) {
460467
460467
  return (0, utils_ts_1.isBytes)(key2) && key2.length === Fn2.BYTES;
@@ -460511,7 +460511,7 @@ var require_edwards3 = __commonJS({
460511
460511
  };
460512
460512
  return Object.freeze({
460513
460513
  keygen,
460514
- getPublicKey: getPublicKey4,
460514
+ getPublicKey: getPublicKey5,
460515
460515
  sign: sign7,
460516
460516
  verify: verify9,
460517
460517
  utils: utils6,
@@ -513744,7 +513744,7 @@ var require_package7 = __commonJS({
513744
513744
  module2.exports = {
513745
513745
  name: "@ledgerhq/live-common",
513746
513746
  description: "Common ground for the Ledger Live apps",
513747
- version: "34.50.0-nightly.1",
513747
+ version: "34.50.0-nightly.2",
513748
513748
  repository: {
513749
513749
  type: "git",
513750
513750
  url: "https://github.com/LedgerHQ/ledger-live.git"
@@ -513924,9 +513924,11 @@ var require_package7 = __commonJS({
513924
513924
  "@ledgerhq/hw-app-trx": "workspace:^",
513925
513925
  "@ledgerhq/hw-app-vet": "workspace:^",
513926
513926
  "@ledgerhq/hw-app-xrp": "workspace:^",
513927
+ "@ledgerhq/hw-bolos": "workspace:^",
513927
513928
  "@ledgerhq/hw-transport": "workspace:^",
513928
513929
  "@ledgerhq/hw-transport-mocker": "workspace:^",
513929
513930
  "@ledgerhq/ledger-cal-service": "workspace:^",
513931
+ "@ledgerhq/ledger-trust-service": "workspace:^",
513930
513932
  "@ledgerhq/live-app-sdk": "^0.8.1",
513931
513933
  "@ledgerhq/live-config": "workspace:^",
513932
513934
  "@ledgerhq/live-countervalues": "workspace:^",
@@ -514079,7 +514081,7 @@ var require_package8 = __commonJS({
514079
514081
  "package.json"(exports2, module2) {
514080
514082
  module2.exports = {
514081
514083
  name: "@ledgerhq/live-cli",
514082
- version: "24.25.0-nightly.1",
514084
+ version: "24.25.0-nightly.2",
514083
514085
  description: "ledger-live CLI version",
514084
514086
  repository: {
514085
514087
  type: "git",
@@ -537866,7 +537868,7 @@ var getDefaultAccountName = (account3) => {
537866
537868
  };
537867
537869
 
537868
537870
  // ../../libs/ledger-live-common/lib-es/account/formatters.js
537869
- var import_bignumber363 = require("bignumber.js");
537871
+ var import_bignumber362 = require("bignumber.js");
537870
537872
  var import_invariant69 = __toESM(require("invariant"));
537871
537873
 
537872
537874
  // ../../libs/ledger-live-common/lib-es/account/serialization.js
@@ -549593,12 +549595,12 @@ function ecdh(Point5, ecdhOpts = {}) {
549593
549595
  function randomSecretKey(seed = randomBytes_(lengths.seed)) {
549594
549596
  return mapHashToField(_abytes2(seed, lengths.seed, "seed"), Fn2.ORDER);
549595
549597
  }
549596
- function getPublicKey4(secretKey, isCompressed2 = true) {
549598
+ function getPublicKey5(secretKey, isCompressed2 = true) {
549597
549599
  return Point5.BASE.multiply(_normFnElement(Fn2, secretKey)).toBytes(isCompressed2);
549598
549600
  }
549599
549601
  function keygen(seed) {
549600
549602
  const secretKey = randomSecretKey(seed);
549601
- return { secretKey, publicKey: getPublicKey4(secretKey) };
549603
+ return { secretKey, publicKey: getPublicKey5(secretKey) };
549602
549604
  }
549603
549605
  function isProbPub(item) {
549604
549606
  if (typeof item === "bigint")
@@ -549632,7 +549634,7 @@ function ecdh(Point5, ecdhOpts = {}) {
549632
549634
  return point3.precompute(windowSize, false);
549633
549635
  }
549634
549636
  };
549635
- return Object.freeze({ getPublicKey: getPublicKey4, getSharedSecret, keygen, Point: Point5, utils: utils6, lengths });
549637
+ return Object.freeze({ getPublicKey: getPublicKey5, getSharedSecret, keygen, Point: Point5, utils: utils6, lengths });
549636
549638
  }
549637
549639
  function ecdsa(Point5, hash10, ecdsaOpts = {}) {
549638
549640
  ahash(hash10);
@@ -549647,7 +549649,7 @@ function ecdsa(Point5, hash10, ecdsaOpts = {}) {
549647
549649
  const hmac6 = ecdsaOpts.hmac || ((key2, ...msgs) => hmac(hash10, key2, concatBytes(...msgs)));
549648
549650
  const { Fp: Fp5, Fn: Fn2 } = Point5;
549649
549651
  const { ORDER: CURVE_ORDER, BITS: fnBits } = Fn2;
549650
- const { keygen, getPublicKey: getPublicKey4, getSharedSecret, utils: utils6, lengths } = ecdh(Point5, ecdsaOpts);
549652
+ const { keygen, getPublicKey: getPublicKey5, getSharedSecret, utils: utils6, lengths } = ecdh(Point5, ecdsaOpts);
549651
549653
  const defaultSigOpts = {
549652
549654
  prehash: false,
549653
549655
  lowS: typeof ecdsaOpts.lowS === "boolean" ? ecdsaOpts.lowS : false,
@@ -549893,7 +549895,7 @@ function ecdsa(Point5, hash10, ecdsaOpts = {}) {
549893
549895
  }
549894
549896
  return Object.freeze({
549895
549897
  keygen,
549896
- getPublicKey: getPublicKey4,
549898
+ getPublicKey: getPublicKey5,
549897
549899
  getSharedSecret,
549898
549900
  utils: utils6,
549899
549901
  lengths,
@@ -551262,7 +551264,7 @@ function eddsa(Point5, cHash, eddsaOpts = {}) {
551262
551264
  const pointBytes = point3.toBytes();
551263
551265
  return { head: head2, prefix: prefix3, scalar, point: point3, pointBytes };
551264
551266
  }
551265
- function getPublicKey4(secretKey) {
551267
+ function getPublicKey5(secretKey) {
551266
551268
  return getExtendedPublicKey(secretKey).pointBytes;
551267
551269
  }
551268
551270
  function hashDomainToScalar(context = Uint8Array.of(), ...msgs) {
@@ -551323,7 +551325,7 @@ function eddsa(Point5, cHash, eddsaOpts = {}) {
551323
551325
  }
551324
551326
  function keygen(seed) {
551325
551327
  const secretKey = utils6.randomSecretKey(seed);
551326
- return { secretKey, publicKey: getPublicKey4(secretKey) };
551328
+ return { secretKey, publicKey: getPublicKey5(secretKey) };
551327
551329
  }
551328
551330
  function isValidSecretKey(key2) {
551329
551331
  return isBytes(key2) && key2.length === Fn2.BYTES;
@@ -551373,7 +551375,7 @@ function eddsa(Point5, cHash, eddsaOpts = {}) {
551373
551375
  };
551374
551376
  return Object.freeze({
551375
551377
  keygen,
551376
- getPublicKey: getPublicKey4,
551378
+ getPublicKey: getPublicKey5,
551377
551379
  sign: sign7,
551378
551380
  verify: verify9,
551379
551381
  utils: utils6,
@@ -553660,7 +553662,7 @@ function bls(CURVE2) {
553660
553662
  function normP2Hash(point3, htfOpts) {
553661
553663
  return point3 instanceof G22.Point ? point3 : longSignatures.hash(ensureBytes("point", point3), htfOpts?.DST);
553662
553664
  }
553663
- function getPublicKey4(privateKey) {
553665
+ function getPublicKey5(privateKey) {
553664
553666
  return longSignatures.getPublicKey(privateKey).toBytes(true);
553665
553667
  }
553666
553668
  function getPublicKeyForShortSignatures(privateKey) {
@@ -553725,7 +553727,7 @@ function bls(CURVE2) {
553725
553727
  },
553726
553728
  utils: utils6,
553727
553729
  // deprecated
553728
- getPublicKey: getPublicKey4,
553730
+ getPublicKey: getPublicKey5,
553729
553731
  getPublicKeyForShortSignatures,
553730
553732
  sign: sign7,
553731
553733
  signShortSignature,
@@ -585961,21 +585963,6 @@ var transactionToEthersTransaction = (tx) => {
585961
585963
  // ../../libs/coin-modules/coin-evm/lib-es/adapters/ledger.js
585962
585964
  var import_eip554 = __toESM(require_eip55());
585963
585965
  var import_bignumber135 = __toESM(require("bignumber.js"));
585964
-
585965
- // ../../libs/coin-modules/coin-evm/lib-es/cryptoAssetsStore.js
585966
- var CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE = "CryptoAssetsStore is not set. Please call setCryptoAssetsStoreGetter first on coin EVM";
585967
- var getStore;
585968
- function setCryptoAssetsStoreGetter(cryptoAssetsStoreGetter) {
585969
- getStore = cryptoAssetsStoreGetter;
585970
- }
585971
- function getCryptoAssetsStore2() {
585972
- if (!getStore) {
585973
- throw new Error(CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE);
585974
- }
585975
- return getStore();
585976
- }
585977
-
585978
- // ../../libs/coin-modules/coin-evm/lib-es/adapters/ledger.js
585979
585966
  var ledgerOperationToOperations = (accountId2, ledgerOp) => {
585980
585967
  const { xpubOrAddress: address3 } = decodeAccountId(accountId2);
585981
585968
  const checksummedAddress = import_eip554.default.encode(address3);
@@ -586017,11 +586004,7 @@ var ledgerOperationToOperations = (accountId2, ledgerOp) => {
586017
586004
  };
586018
586005
  var ledgerERC20EventToOperations = (coinOperation, event, index = 0) => {
586019
586006
  const { accountId: accountId2, hash: hash10, fee, blockHeight, blockHash, transactionSequenceNumber, date } = coinOperation;
586020
- const { currencyId, xpubOrAddress: address3 } = decodeAccountId(accountId2);
586021
- const tokenCurrency = getCryptoAssetsStore2().findTokenByAddressInCurrency(event.contract, currencyId);
586022
- if (!tokenCurrency)
586023
- return [];
586024
- const tokenAccountId = encodeTokenAccountId(accountId2, tokenCurrency);
586007
+ const { xpubOrAddress: address3 } = decodeAccountId(accountId2);
586025
586008
  const from91 = safeEncodeEIP55(event.from);
586026
586009
  const to = safeEncodeEIP55(event.to);
586027
586010
  const checksummedAddress = import_eip554.default.encode(address3);
@@ -586034,18 +586017,21 @@ var ledgerERC20EventToOperations = (coinOperation, event, index = 0) => {
586034
586017
  types4.push("OUT");
586035
586018
  }
586036
586019
  return types4.map((type4) => ({
586037
- id: encodeSubOperationId(tokenAccountId, hash10, type4, index),
586020
+ // NOTE Bridge implementations replace property `id`
586021
+ id: encodeSubOperationId(accountId2, hash10, type4, index),
586038
586022
  hash: hash10,
586039
586023
  type: type4,
586040
586024
  value: value5,
586041
586025
  fee,
586042
586026
  senders: [from91],
586043
586027
  recipients: [to],
586044
- contract: tokenCurrency.contractAddress,
586028
+ contract: import_eip554.default.encode(event.contract),
586045
586029
  blockHeight,
586046
586030
  blockHash,
586047
586031
  transactionSequenceNumber,
586048
- accountId: tokenAccountId,
586032
+ // NOTE Bridge implementations replace property `accountId`
586033
+ // TODO Remove property once the legacy bridge is deleted
586034
+ accountId: accountId2,
586049
586035
  date,
586050
586036
  extra: {}
586051
586037
  }));
@@ -591434,7 +591420,7 @@ function weierstrass2(curveDef) {
591434
591420
  return point3;
591435
591421
  }
591436
591422
  };
591437
- function getPublicKey4(privateKey, isCompressed2 = true) {
591423
+ function getPublicKey5(privateKey, isCompressed2 = true) {
591438
591424
  return Point5.fromPrivateKey(privateKey).toRawBytes(isCompressed2);
591439
591425
  }
591440
591426
  function isProbPub(item) {
@@ -591570,7 +591556,7 @@ function weierstrass2(curveDef) {
591570
591556
  }
591571
591557
  return {
591572
591558
  CURVE: CURVE2,
591573
- getPublicKey: getPublicKey4,
591559
+ getPublicKey: getPublicKey5,
591574
591560
  getSharedSecret,
591575
591561
  sign: sign7,
591576
591562
  verify: verify9,
@@ -609608,11 +609594,7 @@ var etherscanOperationToOperations = (accountId2, etherscanOp) => {
609608
609594
  });
609609
609595
  };
609610
609596
  var etherscanERC20EventToOperations = (accountId2, event, index = 0) => {
609611
- const { currencyId, xpubOrAddress: address3 } = decodeAccountId(accountId2);
609612
- const tokenCurrency = getCryptoAssetsStore2().findTokenByAddressInCurrency(event.contractAddress, currencyId);
609613
- if (!tokenCurrency)
609614
- return [];
609615
- const tokenAccountId = encodeTokenAccountId(accountId2, tokenCurrency);
609597
+ const { xpubOrAddress: address3 } = decodeAccountId(accountId2);
609616
609598
  const checksummedAddress = import_eip555.default.encode(address3);
609617
609599
  const from91 = safeEncodeEIP55(event.from);
609618
609600
  const to = safeEncodeEIP55(event.to);
@@ -609626,18 +609608,21 @@ var etherscanERC20EventToOperations = (accountId2, event, index = 0) => {
609626
609608
  types4.push("OUT");
609627
609609
  }
609628
609610
  return types4.map((type4) => ({
609629
- id: encodeSubOperationId(tokenAccountId, event.hash, type4, index),
609611
+ // NOTE Bridge implementations replace property `id`
609612
+ id: encodeSubOperationId(accountId2, event.hash, type4, index),
609630
609613
  hash: event.hash,
609631
609614
  type: type4,
609632
609615
  value: value5,
609633
609616
  fee,
609634
609617
  senders: [from91],
609635
609618
  recipients: [to],
609636
- contract: tokenCurrency.contractAddress,
609619
+ contract: import_eip555.default.encode(event.contractAddress),
609637
609620
  blockHeight: parseInt(event.blockNumber, 10),
609638
609621
  blockHash: event.blockHash,
609639
609622
  transactionSequenceNumber: parseInt(event.nonce, 10),
609640
- accountId: tokenAccountId,
609623
+ // NOTE Bridge implementations replace property `accountId`
609624
+ // TODO Remove property once the legacy bridge is deleted
609625
+ accountId: accountId2,
609641
609626
  date: new Date(parseInt(event.timeStamp, 10) * 1e3),
609642
609627
  extra: {}
609643
609628
  }));
@@ -612540,16 +612525,16 @@ var getSyncHash = (currency24, blacklistedTokenIds = []) => {
612540
612525
  const stringToHash = getCALHash(currency24) + blacklistedTokenIds.join("") + isNftSupported + JSON.stringify(node3) + JSON.stringify(explorer);
612541
612526
  return `0x${(0, import_imurmurhash.default)(stringToHash).result().toString(16)}`;
612542
612527
  };
612543
- var attachOperations = (_coinOperations, _tokenOperations, _nftOperations, _internalOperations, filters = { blacklistedTokenIds: [] }) => {
612544
- const { blacklistedTokenIds } = filters;
612528
+ var attachOperations = async (accountId2, _coinOperations, _tokenOperations, _nftOperations, _internalOperations, filters) => {
612529
+ const { blacklistedTokenIds, findToken: findToken2 } = filters;
612545
612530
  const coinOperations = _coinOperations.map((op) => ({ ...op }));
612546
612531
  const tokenOperations = _tokenOperations.map((op) => ({ ...op }));
612547
612532
  const nftOperations = _nftOperations.map((op) => ({ ...op }));
612548
612533
  const internalOperations = _internalOperations.map((op) => ({ ...op }));
612549
612534
  const makeCoinOpForOrphanChildOp = (childOp) => {
612550
612535
  const type4 = "NONE";
612551
- const { accountId: accountId2 } = decodeTokenAccountId(childOp.accountId);
612552
- const id7 = encodeOperationId(accountId2, childOp.hash, type4);
612536
+ const { accountId: accountId3 } = decodeTokenAccountId(childOp.accountId);
612537
+ const id7 = encodeOperationId(accountId3, childOp.hash, type4);
612553
612538
  return {
612554
612539
  id: id7,
612555
612540
  hash: childOp.hash,
@@ -612580,9 +612565,13 @@ var attachOperations = (_coinOperations, _tokenOperations, _nftOperations, _inte
612580
612565
  coinOperationsByHash[op.hash].push(op);
612581
612566
  });
612582
612567
  for (const tokenOperation of tokenOperations) {
612583
- const { token } = decodeTokenAccountId(tokenOperation.accountId);
612568
+ const token = tokenOperation.contract && await findToken2(tokenOperation.contract);
612584
612569
  if (!token || blacklistedTokenIds?.includes(token.id))
612585
612570
  continue;
612571
+ const tokenAccountId = encodeTokenAccountId(accountId2, token);
612572
+ const operationId = encodeOperationId(tokenAccountId, tokenOperation.hash, tokenOperation.type);
612573
+ tokenOperation.id = operationId;
612574
+ tokenOperation.accountId = tokenAccountId;
612586
612575
  let mainOperations = coinOperationsByHash[tokenOperation.hash];
612587
612576
  if (!mainOperations?.length) {
612588
612577
  const noneOperation = makeCoinOpForOrphanChildOp(tokenOperation);
@@ -612639,6 +612628,19 @@ async function lastBlock2(currency24) {
612639
612628
  };
612640
612629
  }
612641
612630
 
612631
+ // ../../libs/coin-modules/coin-evm/lib-es/cryptoAssetsStore.js
612632
+ var CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE = "CryptoAssetsStore is not set. Please call setCryptoAssetsStoreGetter first on coin EVM";
612633
+ var getStore;
612634
+ function setCryptoAssetsStoreGetter(cryptoAssetsStoreGetter) {
612635
+ getStore = cryptoAssetsStoreGetter;
612636
+ }
612637
+ function getCryptoAssetsStore2() {
612638
+ if (!getStore) {
612639
+ throw new Error(CRYPTO_ASSETS_STORE_NO_SET_ERROR_MESSAGE);
612640
+ }
612641
+ return getStore();
612642
+ }
612643
+
612642
612644
  // ../../libs/coin-modules/coin-evm/lib-es/bridge/synchronization.js
612643
612645
  var SAFE_REORG_THRESHOLD = 80;
612644
612646
  var getAccountShape5 = async (infos, { blacklistedTokenIds }) => {
@@ -612656,6 +612658,7 @@ var getAccountShape5 = async (infos, { blacklistedTokenIds }) => {
612656
612658
  xpubOrAddress: address3,
612657
612659
  derivationMode
612658
612660
  });
612661
+ const findToken2 = async (contractAddress) => getCryptoAssetsStore2().findTokenByAddressInCurrency(contractAddress, currency24.id);
612659
612662
  const syncHash = getSyncHash(currency24, blacklistedTokenIds);
612660
612663
  const shouldSyncFromScratch = syncHash !== initialAccount?.syncHash || initialAccount === void 0;
612661
612664
  const latestSyncedHeight = shouldSyncFromScratch ? 0 : initialAccount.blockHeight;
@@ -612673,11 +612676,11 @@ var getAccountShape5 = async (infos, { blacklistedTokenIds }) => {
612673
612676
  }
612674
612677
  })();
612675
612678
  const swapHistoryMap = createSwapHistoryMap(initialAccount);
612676
- const newSubAccounts = await getSubAccounts2(infos, accountId2, lastTokenOperations, blacklistedTokenIds, swapHistoryMap);
612679
+ const newSubAccounts = await getSubAccounts2(infos, accountId2, lastTokenOperations, blacklistedTokenIds, swapHistoryMap, findToken2);
612677
612680
  const subAccounts = shouldSyncFromScratch ? newSubAccounts : mergeSubAccounts2(initialAccount, newSubAccounts);
612678
612681
  const confirmPendingOperations = initialAccount?.pendingOperations?.map((op) => getOperationStatus(currency24, op)) || [];
612679
612682
  const confirmedOperations = await Promise.all(confirmPendingOperations).then((ops) => ops.filter((op) => !!op));
612680
- const lastCoinOperationsWithAttachements = attachOperations(lastCoinOperations, lastTokenOperations, lastNftOperations, lastInternalOperations, { blacklistedTokenIds });
612683
+ const lastCoinOperationsWithAttachements = await attachOperations(accountId2, lastCoinOperations, lastTokenOperations, lastNftOperations, lastInternalOperations, { blacklistedTokenIds, findToken: findToken2 });
612681
612684
  const newOperations = [...confirmedOperations, ...lastCoinOperationsWithAttachements];
612682
612685
  const operations4 = shouldSyncFromScratch || !initialAccount?.operations ? newOperations : mergeOps(initialAccount?.operations, newOperations);
612683
612686
  const operationsWithPendings = mergeOps(operations4, initialAccount?.pendingOperations || []);
@@ -612700,21 +612703,23 @@ var getAccountShape5 = async (infos, { blacklistedTokenIds }) => {
612700
612703
  lastSyncDate: /* @__PURE__ */ new Date()
612701
612704
  };
612702
612705
  };
612703
- var getSubAccounts2 = async (infos, accountId2, lastTokenOperations, blacklistedTokenIds = [], swapHistoryMap) => {
612706
+ var getSubAccounts2 = async (infos, accountId2, lastTokenOperations, blacklistedTokenIds = [], swapHistoryMap, findToken2) => {
612704
612707
  const { currency: currency24 } = infos;
612705
612708
  const config4 = getCoinConfig3(currency24).info;
612706
612709
  const isLedgerNode = config4?.node?.type === "ledger";
612707
- const erc20OperationsByToken = lastTokenOperations.reduce((acc, operation) => {
612708
- const { accountId: accountId3 } = decodeOperationId(operation.id);
612709
- const { token } = decodeTokenAccountId(accountId3);
612710
+ const erc20OperationsByToken = await lastTokenOperations.reduce(async (accPromise, operation) => {
612711
+ const acc = await accPromise;
612712
+ const token = operation.contract && await findToken2(operation.contract);
612710
612713
  if (!token || blacklistedTokenIds.includes(token.id))
612711
612714
  return acc;
612715
+ const tokenAccountId = encodeTokenAccountId(accountId2, token);
612716
+ const operationId = encodeOperationId(tokenAccountId, operation.hash, operation.type);
612712
612717
  if (!acc.has(token)) {
612713
612718
  acc.set(token, []);
612714
612719
  }
612715
- acc.get(token)?.push(operation);
612720
+ acc.get(token)?.push({ ...operation, id: operationId, accountId: tokenAccountId });
612716
612721
  return acc;
612717
- }, /* @__PURE__ */ new Map());
612722
+ }, Promise.resolve(/* @__PURE__ */ new Map()));
612718
612723
  const tokenEntries = Array.from(erc20OperationsByToken.entries());
612719
612724
  if (isLedgerNode) {
612720
612725
  return Promise.all(tokenEntries.map(([token, ops]) => getSubAccountShape2(currency24, accountId2, token, ops, swapHistoryMap.get(token) || [])));
@@ -619781,8 +619786,8 @@ async function validateIntent(currency24, intent, customFees) {
619781
619786
  }
619782
619787
 
619783
619788
  // ../../libs/coin-modules/coin-evm/lib-es/logic/getTokenFromAsset.js
619784
- function getTokenFromAsset(currency24, asset) {
619785
- return "assetReference" in asset ? findTokenByAddressInCurrency(asset.assetReference, currency24.id) : void 0;
619789
+ async function getTokenFromAsset(currency24, asset) {
619790
+ return "assetReference" in asset ? getCryptoAssetsStore2().findTokenByAddressInCurrency(asset.assetReference, currency24.id) : void 0;
619786
619791
  }
619787
619792
  function getAssetFromToken(currency24, token, owner) {
619788
619793
  if (token.parentCurrency.id !== currency24.id) {
@@ -692407,17 +692412,29 @@ var nodeAccountIds = [new AccountId(3)];
692407
692412
  async function buildUnsignedCoinTransaction({ account: account3, transaction }) {
692408
692413
  const accountId2 = account3.freshAddress;
692409
692414
  const hbarAmount = Hbar.fromTinybars(transaction.amount);
692410
- return new TransferTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").addHbarTransfer(accountId2, hbarAmount.negated()).addHbarTransfer(transaction.recipient, hbarAmount).freeze();
692415
+ const tx = new TransferTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").addHbarTransfer(accountId2, hbarAmount.negated()).addHbarTransfer(transaction.recipient, hbarAmount);
692416
+ if (transaction.maxFee) {
692417
+ tx.setMaxTransactionFee(Hbar.fromTinybars(transaction.maxFee.toNumber()));
692418
+ }
692419
+ return tx.freeze();
692411
692420
  }
692412
692421
  async function buildUnsignedTokenTransaction({ account: account3, tokenAccount, transaction }) {
692413
692422
  const accountId2 = account3.freshAddress;
692414
692423
  const tokenId = tokenAccount.token.contractAddress;
692415
- return new TransferTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").addTokenTransfer(tokenId, accountId2, transaction.amount.negated().toNumber()).addTokenTransfer(tokenId, transaction.recipient, transaction.amount.toNumber()).freeze();
692424
+ const tx = new TransferTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").addTokenTransfer(tokenId, accountId2, transaction.amount.negated().toNumber()).addTokenTransfer(tokenId, transaction.recipient, transaction.amount.toNumber());
692425
+ if (transaction.maxFee) {
692426
+ tx.setMaxTransactionFee(Hbar.fromTinybars(transaction.maxFee.toNumber()));
692427
+ }
692428
+ return tx.freeze();
692416
692429
  }
692417
692430
  async function buildTokenAssociateTransaction({ account: account3, transaction }) {
692418
692431
  (0, import_invariant30.default)(isTokenAssociateTransaction(transaction), "invalid transaction properties");
692419
692432
  const accountId2 = account3.freshAddress;
692420
- return new TokenAssociateTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").setAccountId(accountId2).setTokenIds([transaction.properties.token.contractAddress]).freeze();
692433
+ const tx = new TokenAssociateTransaction().setNodeAccountIds(nodeAccountIds).setTransactionId(TransactionId.generate(accountId2)).setTransactionMemo(transaction.memo ?? "").setAccountId(accountId2).setTokenIds([transaction.properties.token.contractAddress]);
692434
+ if (transaction.maxFee) {
692435
+ tx.setMaxTransactionFee(Hbar.fromTinybars(transaction.maxFee.toNumber()));
692436
+ }
692437
+ return tx.freeze();
692421
692438
  }
692422
692439
  async function buildUnsignedTransaction({ account: account3, transaction }) {
692423
692440
  const subAccount = findSubAccountById(account3, transaction?.subAccountId || "");
@@ -692586,7 +692603,21 @@ var getTransactionStatus10 = async (account3, transaction) => {
692586
692603
 
692587
692604
  // ../../libs/coin-modules/coin-hedera/lib-es/bridge/prepareTransaction.js
692588
692605
  var prepareTransaction11 = async (account3, transaction) => {
692589
- const { amount } = await calculateAmount2({ account: account3, transaction });
692606
+ const subAccount = findSubAccountById(account3, transaction?.subAccountId || "");
692607
+ const isTokenTransaction = isTokenAccount(subAccount);
692608
+ let operationType;
692609
+ if (isTokenAssociateTransaction(transaction)) {
692610
+ operationType = HEDERA_OPERATION_TYPES.TokenAssociate;
692611
+ } else if (isTokenTransaction) {
692612
+ operationType = HEDERA_OPERATION_TYPES.TokenTransfer;
692613
+ } else {
692614
+ operationType = HEDERA_OPERATION_TYPES.CryptoTransfer;
692615
+ }
692616
+ const [{ amount }, estimatedFees] = await Promise.all([
692617
+ calculateAmount2({ account: account3, transaction }),
692618
+ getEstimatedFees5(account3, operationType)
692619
+ ]);
692620
+ transaction.maxFee = estimatedFees;
692590
692621
  transaction.amount = amount;
692591
692622
  return transaction;
692592
692623
  };
@@ -692884,6 +692915,7 @@ var getAccountShape8 = async (info6, { blacklistedTokenIds }) => {
692884
692915
  getAccount4(address3),
692885
692916
  getAccountTokens(address3)
692886
692917
  ]);
692918
+ const accountBalance = new import_bignumber177.BigNumber(mirrorAccount.balance.balance);
692887
692919
  const syncHash = getSyncHash2(currency24, blacklistedTokenIds);
692888
692920
  const shouldSyncFromScratch = !initialAccount || syncHash !== initialAccount?.syncHash;
692889
692921
  const oldOperations = initialAccount?.operations ?? [];
@@ -692900,8 +692932,8 @@ var getAccountShape8 = async (info6, { blacklistedTokenIds }) => {
692900
692932
  freshAddress: address3,
692901
692933
  syncHash,
692902
692934
  lastSyncDate: /* @__PURE__ */ new Date(),
692903
- balance: new import_bignumber177.BigNumber(mirrorAccount.balance.balance),
692904
- spendableBalance: new import_bignumber177.BigNumber(mirrorAccount.balance.balance),
692935
+ balance: accountBalance,
692936
+ spendableBalance: accountBalance,
692905
692937
  operations: operations4,
692906
692938
  operationsCount: operations4.length,
692907
692939
  // NOTE: there are no "blocks" in hedera
@@ -772189,6 +772221,19 @@ function getTrustedDomain(env3) {
772189
772221
  return env3 === "prod" ? getEnv("NFT_METADATA_SERVICE") : "https://nft.api.live.ledger-test.com";
772190
772222
  }
772191
772223
 
772224
+ // ../../libs/ledger-services/trust/lib-es/hedera.js
772225
+ async function getPublicKey2(accountId2, challenge, env3 = "prod") {
772226
+ const { data: data12 } = await lib_es_default({
772227
+ method: "GET",
772228
+ url: `${getTrustedDomain(env3)}/v2/hedera/pubkey/${accountId2}?challenge=${challenge}`
772229
+ });
772230
+ return {
772231
+ accountId: data12.account,
772232
+ publicKey: data12.key,
772233
+ signedDescriptor: data12.signedDescriptor
772234
+ };
772235
+ }
772236
+
772192
772237
  // ../../libs/ledger-services/trust/lib-es/solana.js
772193
772238
  async function getOwnerAddress(tokenAddress, challenge, env3 = "prod") {
772194
772239
  const { data: data12 } = await lib_es_default({
@@ -772218,7 +772263,10 @@ async function computedTokenAddress(address3, mintAddress, challenge, env3 = "pr
772218
772263
  // ../../libs/ledger-services/trust/lib-es/index.js
772219
772264
  var lib_es_default4 = {
772220
772265
  computedTokenAddress,
772221
- getOwnerAddress
772266
+ getOwnerAddress,
772267
+ hedera: {
772268
+ getPublicKey: getPublicKey2
772269
+ }
772222
772270
  };
772223
772271
 
772224
772272
  // ../../libs/ledgerjs/packages/hw-bolos/lib-es/loadPKI.js
@@ -774306,7 +774354,7 @@ function normalizeSignature(signature4) {
774306
774354
  return Signature4.fromCompact(signature4);
774307
774355
  }
774308
774356
  }
774309
- function getPublicKey2(privateKey, isCompressed2 = false) {
774357
+ function getPublicKey3(privateKey, isCompressed2 = false) {
774310
774358
  return Point4.fromPrivateKey(privateKey).toRawBytes(isCompressed2);
774311
774359
  }
774312
774360
  function bits2int(bytes5) {
@@ -774882,7 +774930,7 @@ function serializePublicKey(key2) {
774882
774930
  }
774883
774931
  function pubKeyfromPrivKey(privateKey) {
774884
774932
  const privKey = createStacksPrivateKey(privateKey);
774885
- const publicKey3 = getPublicKey2(privKey.data.slice(0, 32), privKey.compressed);
774933
+ const publicKey3 = getPublicKey3(privKey.data.slice(0, 32), privKey.compressed);
774886
774934
  return createStacksPublicKey(bytesToHex4(publicKey3));
774887
774935
  }
774888
774936
  function compressPublicKey2(publicKey3) {
@@ -774907,7 +774955,7 @@ function signWithKey(privateKey, messageHash) {
774907
774955
  const recoverableSignatureString = recoveryIdHex + Signature4.fromHex(rawSignature).toCompactHex();
774908
774956
  return createMessageSignature(recoverableSignatureString);
774909
774957
  }
774910
- function getPublicKey3(privateKey) {
774958
+ function getPublicKey4(privateKey) {
774911
774959
  return pubKeyfromPrivKey(privateKey.data);
774912
774960
  }
774913
774961
 
@@ -775629,7 +775677,7 @@ function makeSigHashPostSign(curSigHash, pubKey, signature4) {
775629
775677
  function nextSignature(curSigHash, authType, fee, nonce, privateKey) {
775630
775678
  const sigHashPreSign = makeSigHashPreSign(curSigHash, authType, fee, nonce);
775631
775679
  const signature4 = signWithKey(privateKey, sigHashPreSign);
775632
- const publicKey3 = getPublicKey3(privateKey);
775680
+ const publicKey3 = getPublicKey4(privateKey);
775633
775681
  const nextSigHash = makeSigHashPostSign(sigHashPreSign, publicKey3, signature4);
775634
775682
  return {
775635
775683
  nextSig: signature4,
@@ -825749,7 +825797,7 @@ var dispatch3 = (transport, opts) => {
825749
825797
  var getAddress_default15 = dispatch3;
825750
825798
 
825751
825799
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getAccountShape.js
825752
- var import_bignumber357 = __toESM(require("bignumber.js"));
825800
+ var import_bignumber356 = __toESM(require("bignumber.js"));
825753
825801
 
825754
825802
  // ../../libs/coin-modules/coin-xrp/lib-es/api/index.js
825755
825803
  init_lib_es2();
@@ -826856,57 +826904,7 @@ async function estimateFees7() {
826856
826904
  return BigInt(baseFee.recommendedFee);
826857
826905
  }
826858
826906
 
826859
- // ../../libs/coin-modules/coin-stellar/lib-es/logic/utils.js
826860
- var import_bignumber348 = require("bignumber.js");
826861
- var import_stellar_sdk6 = __toESM(require_lib62());
826862
- var STELLAR_BURN_ADDRESS = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
826863
- var getAssetIdFromAsset = (asset) => `${asset.asset_code}:${asset.asset_issuer}`;
826864
- function getAssetCodeIssuer(tr3) {
826865
- if (tr3.subAccountId) {
826866
- const assetString = tr3.subAccountId.split("+")[1];
826867
- return assetString.split(":");
826868
- }
826869
- return [tr3.assetReference || "", tr3.assetOwner || ""];
826870
- }
826871
- function isMemoValid2(memoType, memoValue) {
826872
- switch (memoType) {
826873
- case "MEMO_TEXT":
826874
- if (memoValue.length > 28) {
826875
- return false;
826876
- }
826877
- break;
826878
- case "MEMO_ID":
826879
- if (new import_bignumber348.BigNumber(memoValue.toString()).isNaN()) {
826880
- return false;
826881
- }
826882
- break;
826883
- case "MEMO_HASH":
826884
- case "MEMO_RETURN":
826885
- if (!memoValue.length || memoValue.length !== 64) {
826886
- return false;
826887
- }
826888
- break;
826889
- }
826890
- return true;
826891
- }
826892
- async function isAccountMultiSign(account3) {
826893
- const signers = await fetchSigners(account3);
826894
- return signers.length > 1;
826895
- }
826896
- function isAddressValid3(address3) {
826897
- if (!address3)
826898
- return false;
826899
- if (address3 === STELLAR_BURN_ADDRESS)
826900
- return false;
826901
- try {
826902
- return import_stellar_sdk6.StrKey.isValidEd25519PublicKey(address3) || import_stellar_sdk6.StrKey.isValidMed25519PublicKey(address3);
826903
- } catch (err) {
826904
- return false;
826905
- }
826906
- }
826907
-
826908
826907
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/getBalance.js
826909
- var import_bignumber349 = __toESM(require("bignumber.js"));
826910
826908
  async function getBalance9(addr) {
826911
826909
  const { balance: balance2, assets, spendableBalance } = await fetchAccount(addr);
826912
826910
  const locked19 = BigInt(balance2.toString()) - BigInt(spendableBalance.toString());
@@ -826921,22 +826919,14 @@ async function getBalance9(addr) {
826921
826919
  if (!assets || assets.length === 0) {
826922
826920
  return nativeRes;
826923
826921
  }
826924
- const assetBalances = assets.map((asset) => {
826925
- const token = findTokenById(`stellar/asset/${getAssetIdFromAsset(asset)}`);
826926
- let parsedBalance = new import_bignumber349.default(0);
826927
- if (token) {
826928
- parsedBalance = parseCurrencyUnit(token.units[0], asset.balance);
826922
+ const assetBalances = assets.map((asset) => ({
826923
+ value: BigInt(Math.floor(Number.parseFloat(asset.balance) * 10 ** 7)),
826924
+ asset: {
826925
+ type: asset.asset_type,
826926
+ assetReference: asset.asset_code,
826927
+ assetOwner: asset.asset_issuer
826929
826928
  }
826930
- const intBalance = BigInt(Math.floor(parseFloat(parsedBalance.toString())));
826931
- return {
826932
- value: intBalance,
826933
- asset: {
826934
- type: asset.asset_type,
826935
- assetReference: asset.asset_code,
826936
- assetOwner: asset.asset_issuer
826937
- }
826938
- };
826939
- });
826929
+ }));
826940
826930
  return [...nativeRes, ...assetBalances];
826941
826931
  }
826942
826932
 
@@ -826992,7 +826982,57 @@ var convertToCoreOperation2 = (operation) => {
826992
826982
 
826993
826983
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/validateIntent.js
826994
826984
  init_lib_es();
826995
- var import_bignumber350 = __toESM(require("bignumber.js"));
826985
+
826986
+ // ../../libs/coin-modules/coin-stellar/lib-es/logic/utils.js
826987
+ var import_bignumber348 = require("bignumber.js");
826988
+ var import_stellar_sdk6 = __toESM(require_lib62());
826989
+ var STELLAR_BURN_ADDRESS = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
826990
+ function getAssetCodeIssuer(tr3) {
826991
+ if (tr3.subAccountId) {
826992
+ const assetString = tr3.subAccountId.split("+")[1];
826993
+ return assetString.split(":");
826994
+ }
826995
+ return [tr3.assetReference || "", tr3.assetOwner || ""];
826996
+ }
826997
+ function isMemoValid2(memoType, memoValue) {
826998
+ switch (memoType) {
826999
+ case "MEMO_TEXT":
827000
+ if (memoValue.length > 28) {
827001
+ return false;
827002
+ }
827003
+ break;
827004
+ case "MEMO_ID":
827005
+ if (new import_bignumber348.BigNumber(memoValue.toString()).isNaN()) {
827006
+ return false;
827007
+ }
827008
+ break;
827009
+ case "MEMO_HASH":
827010
+ case "MEMO_RETURN":
827011
+ if (!memoValue.length || memoValue.length !== 64) {
827012
+ return false;
827013
+ }
827014
+ break;
827015
+ }
827016
+ return true;
827017
+ }
827018
+ async function isAccountMultiSign(account3) {
827019
+ const signers = await fetchSigners(account3);
827020
+ return signers.length > 1;
827021
+ }
827022
+ function isAddressValid3(address3) {
827023
+ if (!address3)
827024
+ return false;
827025
+ if (address3 === STELLAR_BURN_ADDRESS)
827026
+ return false;
827027
+ try {
827028
+ return import_stellar_sdk6.StrKey.isValidEd25519PublicKey(address3) || import_stellar_sdk6.StrKey.isValidMed25519PublicKey(address3);
827029
+ } catch (err) {
827030
+ return false;
827031
+ }
827032
+ }
827033
+
827034
+ // ../../libs/coin-modules/coin-stellar/lib-es/logic/validateIntent.js
827035
+ var import_bignumber349 = __toESM(require("bignumber.js"));
826996
827036
  var validateIntent3 = async (transactionIntent, customFees) => {
826997
827037
  const errors = {};
826998
827038
  const warnings3 = {};
@@ -827089,7 +827129,7 @@ var validateIntent3 = async (transactionIntent, customFees) => {
827089
827129
  }
827090
827130
  if (totalSpent > nativeBalance - baseReserve) {
827091
827131
  errors.amount = new NotEnoughSpendableBalance(void 0, {
827092
- minimumAmount: transactionIntent.asset.unit ? formatCurrencyUnit(transactionIntent.asset.unit, new import_bignumber350.default(baseReserve.toString()), {
827132
+ minimumAmount: transactionIntent.asset.unit ? formatCurrencyUnit(transactionIntent.asset.unit, new import_bignumber349.default(baseReserve.toString()), {
827093
827133
  disableRounding: true,
827094
827134
  showCode: true
827095
827135
  }) : "Unknown unit"
@@ -827121,7 +827161,7 @@ var validateIntent3 = async (transactionIntent, customFees) => {
827121
827161
  };
827122
827162
 
827123
827163
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/getTokenFromAsset.js
827124
- function getTokenFromAsset2(asset) {
827164
+ async function getTokenFromAsset2(asset) {
827125
827165
  const assetId = asset.type !== "native" && "assetReference" in asset && "assetOwner" in asset ? `${asset.assetReference}:${asset.assetOwner}` : "";
827126
827166
  return findTokenById(`stellar/asset/${assetId}`);
827127
827167
  }
@@ -827564,7 +827604,7 @@ var HttpBackend = class {
827564
827604
  };
827565
827605
 
827566
827606
  // ../../node_modules/.pnpm/@taquito+rpc@23.0.0-beta.1/node_modules/@taquito/rpc/dist/taquito-rpc.es6.js
827567
- var import_bignumber351 = __toESM(require("bignumber.js"));
827607
+ var import_bignumber350 = __toESM(require("bignumber.js"));
827568
827608
  function __rest2(s48, e36) {
827569
827609
  var t46 = {};
827570
827610
  for (var p63 in s48)
@@ -827675,7 +827715,7 @@ function castToBigNumber(data12, keys2) {
827675
827715
  response[key2] = res;
827676
827716
  return;
827677
827717
  }
827678
- res = new import_bignumber351.default(item);
827718
+ res = new import_bignumber350.default(item);
827679
827719
  response[key2] = res;
827680
827720
  });
827681
827721
  return response;
@@ -827912,7 +827952,7 @@ var RpcClient3 = class {
827912
827952
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/balance`),
827913
827953
  method: "GET"
827914
827954
  });
827915
- return new import_bignumber351.default(balance2);
827955
+ return new import_bignumber350.default(balance2);
827916
827956
  });
827917
827957
  }
827918
827958
  /**
@@ -827927,7 +827967,7 @@ var RpcClient3 = class {
827927
827967
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/spendable`),
827928
827968
  method: "GET"
827929
827969
  });
827930
- return new import_bignumber351.default(balance2);
827970
+ return new import_bignumber350.default(balance2);
827931
827971
  });
827932
827972
  }
827933
827973
  /**
@@ -827943,7 +827983,7 @@ var RpcClient3 = class {
827943
827983
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/balance_and_frozen_bonds`),
827944
827984
  method: "GET"
827945
827985
  });
827946
- return new import_bignumber351.default(balance2);
827986
+ return new import_bignumber350.default(balance2);
827947
827987
  });
827948
827988
  }
827949
827989
  /**
@@ -827959,7 +827999,7 @@ var RpcClient3 = class {
827959
827999
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/spendable_and_frozen_bonds`),
827960
828000
  method: "GET"
827961
828001
  });
827962
- return new import_bignumber351.default(balance2);
828002
+ return new import_bignumber350.default(balance2);
827963
828003
  });
827964
828004
  }
827965
828005
  /**
@@ -827975,7 +828015,7 @@ var RpcClient3 = class {
827975
828015
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/full_balance`),
827976
828016
  method: "GET"
827977
828017
  });
827978
- return new import_bignumber351.default(balance2);
828018
+ return new import_bignumber350.default(balance2);
827979
828019
  });
827980
828020
  }
827981
828021
  /**
@@ -827991,7 +828031,7 @@ var RpcClient3 = class {
827991
828031
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/staked_balance`),
827992
828032
  method: "GET"
827993
828033
  });
827994
- return new import_bignumber351.default(balance2);
828034
+ return new import_bignumber350.default(balance2);
827995
828035
  });
827996
828036
  }
827997
828037
  /**
@@ -828007,7 +828047,7 @@ var RpcClient3 = class {
828007
828047
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/unstaked_finalizable_balance`),
828008
828048
  method: "GET"
828009
828049
  });
828010
- return new import_bignumber351.default(balance2);
828050
+ return new import_bignumber350.default(balance2);
828011
828051
  });
828012
828052
  }
828013
828053
  /**
@@ -828023,7 +828063,7 @@ var RpcClient3 = class {
828023
828063
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/unstaked_frozen_balance`),
828024
828064
  method: "GET"
828025
828065
  });
828026
- return new import_bignumber351.default(balance2);
828066
+ return new import_bignumber350.default(balance2);
828027
828067
  });
828028
828068
  }
828029
828069
  /**
@@ -828116,7 +828156,7 @@ var RpcClient3 = class {
828116
828156
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}`),
828117
828157
  method: "GET"
828118
828158
  });
828119
- return Object.assign(Object.assign({}, contractResponse), { balance: new import_bignumber351.default(contractResponse.balance) });
828159
+ return Object.assign(Object.assign({}, contractResponse), { balance: new import_bignumber350.default(contractResponse.balance) });
828120
828160
  });
828121
828161
  }
828122
828162
  /**
@@ -828458,7 +828498,7 @@ var RpcClient3 = class {
828458
828498
  });
828459
828499
  response.map((item) => {
828460
828500
  if (item.voting_power) {
828461
- item.voting_power = new import_bignumber351.default(item.voting_power);
828501
+ item.voting_power = new import_bignumber350.default(item.voting_power);
828462
828502
  }
828463
828503
  return item;
828464
828504
  });
@@ -828477,7 +828517,7 @@ var RpcClient3 = class {
828477
828517
  method: "GET"
828478
828518
  });
828479
828519
  response.map((item) => {
828480
- return item[1] = new import_bignumber351.default(item[1]);
828520
+ return item[1] = new import_bignumber350.default(item[1]);
828481
828521
  });
828482
828522
  return response;
828483
828523
  });
@@ -828654,7 +828694,7 @@ var RpcClient3 = class {
828654
828694
  method: "POST"
828655
828695
  }, data12), { gas } = _a6, rest = __rest2(_a6, ["gas"]);
828656
828696
  let formattedGas = gas;
828657
- const tryBigNumber = new import_bignumber351.default(gas || "");
828697
+ const tryBigNumber = new import_bignumber350.default(gas || "");
828658
828698
  if (!tryBigNumber.isNaN()) {
828659
828699
  formattedGas = tryBigNumber;
828660
828700
  }
@@ -828851,7 +828891,7 @@ var import_operators10 = require("rxjs/operators");
828851
828891
 
828852
828892
  // ../../node_modules/.pnpm/@taquito+michelson-encoder@23.0.0-beta.1/node_modules/@taquito/michelson-encoder/dist/taquito-michelson-encoder.es6.js
828853
828893
  var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify());
828854
- var import_bignumber352 = __toESM(require("bignumber.js"));
828894
+ var import_bignumber351 = __toESM(require("bignumber.js"));
828855
828895
  var import_elliptic4 = __toESM(require_elliptic());
828856
828896
  var _a$1;
828857
828897
  var InvalidMapTypeError = class extends TaquitoError {
@@ -829702,7 +829742,7 @@ var NatToken = class _NatToken extends ComparableToken {
829702
829742
  this.fac = fac;
829703
829743
  }
829704
829744
  Execute(val) {
829705
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
829745
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
829706
829746
  }
829707
829747
  /**
829708
829748
  * @throws {@link NatValidationError}
@@ -829710,13 +829750,13 @@ var NatToken = class _NatToken extends ComparableToken {
829710
829750
  Encode(args3) {
829711
829751
  const val = args3.pop();
829712
829752
  this.validate(val);
829713
- return { int: new import_bignumber352.default(val).toFixed() };
829753
+ return { int: new import_bignumber351.default(val).toFixed() };
829714
829754
  }
829715
829755
  /**
829716
829756
  * @throws {@link NatValidationError}
829717
829757
  */
829718
829758
  validate(val) {
829719
- const bigNumber = new import_bignumber352.default(val);
829759
+ const bigNumber = new import_bignumber351.default(val);
829720
829760
  if (bigNumber.isNaN()) {
829721
829761
  throw new NatValidationError(val, this, `Value is not a number: ${JSON.stringify(val)}`);
829722
829762
  }
@@ -829732,7 +829772,7 @@ var NatToken = class _NatToken extends ComparableToken {
829732
829772
  if (semantic && semantic[_NatToken.prim]) {
829733
829773
  return semantic[_NatToken.prim](val);
829734
829774
  }
829735
- return { int: new import_bignumber352.default(val).toFixed() };
829775
+ return { int: new import_bignumber351.default(val).toFixed() };
829736
829776
  }
829737
829777
  /**
829738
829778
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -829754,7 +829794,7 @@ var NatToken = class _NatToken extends ComparableToken {
829754
829794
  };
829755
829795
  }
829756
829796
  ToKey({ int }) {
829757
- return new import_bignumber352.default(int);
829797
+ return new import_bignumber351.default(int);
829758
829798
  }
829759
829799
  compare(nat1, nat2) {
829760
829800
  const o1 = Number(nat1);
@@ -830280,7 +830320,7 @@ var MutezToken = class _MutezToken extends ComparableToken {
830280
830320
  this.fac = fac;
830281
830321
  }
830282
830322
  Execute(val) {
830283
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
830323
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
830284
830324
  }
830285
830325
  /**
830286
830326
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -830299,7 +830339,7 @@ var MutezToken = class _MutezToken extends ComparableToken {
830299
830339
  * @throws {@link MutezValidationError}
830300
830340
  */
830301
830341
  validate(val) {
830302
- const bigNumber = new import_bignumber352.default(val);
830342
+ const bigNumber = new import_bignumber351.default(val);
830303
830343
  if (bigNumber.isNaN()) {
830304
830344
  throw new MutezValidationError(val, this, `Value is not a number: ${val}`);
830305
830345
  }
@@ -830598,7 +830638,7 @@ var IntToken = class _IntToken extends ComparableToken {
830598
830638
  this.fac = fac;
830599
830639
  }
830600
830640
  Execute(val) {
830601
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
830641
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
830602
830642
  }
830603
830643
  /**
830604
830644
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -830617,7 +830657,7 @@ var IntToken = class _IntToken extends ComparableToken {
830617
830657
  * @throws {@link IntValidationError}
830618
830658
  */
830619
830659
  validate(val) {
830620
- const bigNumber = new import_bignumber352.default(val);
830660
+ const bigNumber = new import_bignumber351.default(val);
830621
830661
  if (bigNumber.isNaN()) {
830622
830662
  throw new IntValidationError(val, this, `Value is not a number: ${JSON.stringify(val)}`);
830623
830663
  }
@@ -830628,7 +830668,7 @@ var IntToken = class _IntToken extends ComparableToken {
830628
830668
  Encode(args3) {
830629
830669
  const val = args3.pop();
830630
830670
  this.validate(val);
830631
- return { int: new import_bignumber352.default(val).toFixed() };
830671
+ return { int: new import_bignumber351.default(val).toFixed() };
830632
830672
  }
830633
830673
  /**
830634
830674
  * @throws {@link IntValidationError}
@@ -830638,7 +830678,7 @@ var IntToken = class _IntToken extends ComparableToken {
830638
830678
  if (semantic && semantic[_IntToken.prim]) {
830639
830679
  return semantic[_IntToken.prim](val);
830640
830680
  }
830641
- return { int: new import_bignumber352.default(val).toFixed() };
830681
+ return { int: new import_bignumber351.default(val).toFixed() };
830642
830682
  }
830643
830683
  ToBigMapKey(val) {
830644
830684
  return {
@@ -832743,7 +832783,7 @@ var EventSchema = class _EventSchema {
832743
832783
  var UnitValue = Symbol();
832744
832784
 
832745
832785
  // ../../node_modules/.pnpm/@taquito+taquito@23.0.0-beta.1/node_modules/@taquito/taquito/dist/taquito.es6.js
832746
- var import_bignumber354 = __toESM(require("bignumber.js"));
832786
+ var import_bignumber353 = __toESM(require("bignumber.js"));
832747
832787
 
832748
832788
  // ../../node_modules/.pnpm/@taquito+michel-codec@23.0.0-beta.1/node_modules/@taquito/michel-codec/dist/taquito-michel-codec.es6.js
832749
832789
  var sourceReference = Symbol("source_reference");
@@ -836945,7 +836985,7 @@ var dummyContract = new Contract5([
836945
836985
  ]);
836946
836986
 
836947
836987
  // ../../node_modules/.pnpm/@taquito+local-forging@23.0.0-beta.1/node_modules/@taquito/local-forging/dist/taquito-local-forging.es6.js
836948
- var import_bignumber353 = __toESM(require("bignumber.js"));
836988
+ var import_bignumber352 = __toESM(require("bignumber.js"));
836949
836989
  var toHexString2 = (bytes5) => bytes5.reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
836950
836990
  var pad2 = (num, paddingLen = 8) => {
836951
836991
  return num.toString(16).padStart(paddingLen, "0");
@@ -837472,7 +837512,7 @@ var stringDecoder$1 = (value5) => {
837472
837512
  };
837473
837513
  };
837474
837514
  var intEncoder$1 = ({ int }) => {
837475
- const num = new import_bignumber353.BigNumber(int, 10);
837515
+ const num = new import_bignumber352.BigNumber(int, 10);
837476
837516
  const positiveMark = num.toString(2)[0] === "-" ? "1" : "0";
837477
837517
  const binary = num.toString(2).replace(/-/g, "");
837478
837518
  const pad3 = binary.length <= 6 ? 6 : (binary.length - 6) % 7 ? binary.length + 7 - (binary.length - 6) % 7 : binary.length;
@@ -837497,7 +837537,7 @@ var intDecoder$1 = (value5) => {
837497
837537
  const isNegative = !!(1 << 6 & hexNumber[0]);
837498
837538
  hexNumber[0] = hexNumber[0] & 127;
837499
837539
  const numBin = hexNumber.map((x23, i54) => x23.toString(2).slice(i54 === 0 ? -6 : -7).padStart(i54 === 0 ? 6 : 7, "0")).reverse();
837500
- let num = new import_bignumber353.BigNumber(numBin.join(""), 2);
837540
+ let num = new import_bignumber352.BigNumber(numBin.join(""), 2);
837501
837541
  if (isNegative) {
837502
837542
  num = num.times(-1);
837503
837543
  }
@@ -837843,7 +837883,7 @@ var smartRollupCommitmentHashDecoder$1 = (val) => {
837843
837883
  };
837844
837884
  var zarithEncoder$1 = (n143) => {
837845
837885
  const fn4 = [];
837846
- let nn2 = new import_bignumber353.default(n143, 10);
837886
+ let nn2 = new import_bignumber352.default(n143, 10);
837847
837887
  if (nn2.isNaN()) {
837848
837888
  throw new TypeError(`Invalid zarith number ${n143}`);
837849
837889
  }
@@ -837868,14 +837908,14 @@ var zarithDecoder$1 = (n143) => {
837868
837908
  while (mostSignificantByte < n143.length() && (n143.get(mostSignificantByte) & 128) !== 0) {
837869
837909
  mostSignificantByte += 1;
837870
837910
  }
837871
- let num = new import_bignumber353.default(0);
837911
+ let num = new import_bignumber352.default(0);
837872
837912
  for (let i54 = mostSignificantByte; i54 >= 0; i54 -= 1) {
837873
837913
  const tmp = n143.get(i54) & 127;
837874
837914
  num = num.multipliedBy(128);
837875
837915
  num = num.plus(tmp);
837876
837916
  }
837877
837917
  n143.consume(mostSignificantByte + 1);
837878
- return new import_bignumber353.default(num).toString();
837918
+ return new import_bignumber352.default(num).toString();
837879
837919
  };
837880
837920
  var entrypointDecoder$1 = (value5) => {
837881
837921
  const preamble = pad2(value5.consume(1)[0], 2);
@@ -838712,7 +838752,7 @@ var stringDecoder = (value5) => {
838712
838752
  };
838713
838753
  };
838714
838754
  var intEncoder = ({ int }) => {
838715
- const num = new import_bignumber353.BigNumber(int, 10);
838755
+ const num = new import_bignumber352.BigNumber(int, 10);
838716
838756
  const positiveMark = num.toString(2)[0] === "-" ? "1" : "0";
838717
838757
  const binary = num.toString(2).replace(/-/g, "");
838718
838758
  const pad3 = binary.length <= 6 ? 6 : (binary.length - 6) % 7 ? binary.length + 7 - (binary.length - 6) % 7 : binary.length;
@@ -838737,7 +838777,7 @@ var intDecoder = (value5) => {
838737
838777
  const isNegative = !!(1 << 6 & hexNumber[0]);
838738
838778
  hexNumber[0] = hexNumber[0] & 127;
838739
838779
  const numBin = hexNumber.map((x23, i54) => x23.toString(2).slice(i54 === 0 ? -6 : -7).padStart(i54 === 0 ? 6 : 7, "0")).reverse();
838740
- let num = new import_bignumber353.BigNumber(numBin.join(""), 2);
838780
+ let num = new import_bignumber352.BigNumber(numBin.join(""), 2);
838741
838781
  if (isNegative) {
838742
838782
  num = num.times(-1);
838743
838783
  }
@@ -839114,7 +839154,7 @@ var smartRollupCommitmentHashDecoder = (val) => {
839114
839154
  };
839115
839155
  var zarithEncoder = (n143) => {
839116
839156
  const fn4 = [];
839117
- let nn2 = new import_bignumber353.default(n143, 10);
839157
+ let nn2 = new import_bignumber352.default(n143, 10);
839118
839158
  if (nn2.isNaN()) {
839119
839159
  throw new TypeError(`Invalid zarith number ${n143}`);
839120
839160
  }
@@ -839139,14 +839179,14 @@ var zarithDecoder = (n143) => {
839139
839179
  while (mostSignificantByte < n143.length() && (n143.get(mostSignificantByte) & 128) !== 0) {
839140
839180
  mostSignificantByte += 1;
839141
839181
  }
839142
- let num = new import_bignumber353.default(0);
839182
+ let num = new import_bignumber352.default(0);
839143
839183
  for (let i54 = mostSignificantByte; i54 >= 0; i54 -= 1) {
839144
839184
  const tmp = n143.get(i54) & 127;
839145
839185
  num = num.multipliedBy(128);
839146
839186
  num = num.plus(tmp);
839147
839187
  }
839148
839188
  n143.consume(mostSignificantByte + 1);
839149
- return new import_bignumber353.default(num).toString();
839189
+ return new import_bignumber352.default(num).toString();
839150
839190
  };
839151
839191
  var entrypointDecoder = (value5) => {
839152
839192
  const preamble = pad2(value5.consume(1)[0], 2);
@@ -840729,8 +840769,8 @@ var BatchOperation = class extends Operation {
840729
840769
  return this.sumProp(this.params, "storage_limit");
840730
840770
  }
840731
840771
  get consumedGas() {
840732
- import_bignumber354.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.default.ROUND_UP });
840733
- return new import_bignumber354.default(this.consumedMilliGas).dividedBy(1e3).toString();
840772
+ import_bignumber353.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.default.ROUND_UP });
840773
+ return new import_bignumber353.default(this.consumedMilliGas).dividedBy(1e3).toString();
840734
840774
  }
840735
840775
  get consumedMilliGas() {
840736
840776
  return String(this.sumProp(flattenOperationResult({ contents: this.results }), "consumed_milligas"));
@@ -841310,14 +841350,14 @@ var receiptFromOperation = (op, { ALLOCATION_BURN, ORIGINATION_BURN } = {
841310
841350
  ALLOCATION_BURN: 257,
841311
841351
  ORIGINATION_BURN: 257
841312
841352
  }) => {
841313
- import_bignumber354.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.default.ROUND_UP });
841353
+ import_bignumber353.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.default.ROUND_UP });
841314
841354
  const operationResults = flattenOperationResult({ contents: op });
841315
- let totalMilliGas = new import_bignumber354.default(0);
841316
- let totalStorage = new import_bignumber354.default(0);
841317
- let totalFee = new import_bignumber354.default(0);
841318
- let totalOriginationBurn = new import_bignumber354.default(0);
841319
- let totalAllocationBurn = new import_bignumber354.default(0);
841320
- let totalPaidStorageDiff = new import_bignumber354.default(0);
841355
+ let totalMilliGas = new import_bignumber353.default(0);
841356
+ let totalStorage = new import_bignumber353.default(0);
841357
+ let totalFee = new import_bignumber353.default(0);
841358
+ let totalOriginationBurn = new import_bignumber353.default(0);
841359
+ let totalAllocationBurn = new import_bignumber353.default(0);
841360
+ let totalPaidStorageDiff = new import_bignumber353.default(0);
841321
841361
  operationResults.forEach((result2) => {
841322
841362
  totalFee = totalFee.plus(result2.fee || 0);
841323
841363
  totalOriginationBurn = totalOriginationBurn.plus(Array.isArray(result2.originated_contracts) ? result2.originated_contracts.length * ORIGINATION_BURN : 0);
@@ -841334,7 +841374,7 @@ var receiptFromOperation = (op, { ALLOCATION_BURN, ORIGINATION_BURN } = {
841334
841374
  totalAllocationBurn,
841335
841375
  totalOriginationBurn,
841336
841376
  totalPaidStorageDiff,
841337
- totalStorageBurn: new import_bignumber354.default(totalStorage.multipliedBy(COST_PER_BYTE))
841377
+ totalStorageBurn: new import_bignumber353.default(totalStorage.multipliedBy(COST_PER_BYTE))
841338
841378
  };
841339
841379
  };
841340
841380
  var ConfirmationUndefinedError = class extends TezosToolkitConfigError {
@@ -842165,14 +842205,14 @@ var smartContractAbstractionSemantic = (provider) => ({
842165
842205
  return {};
842166
842206
  } else {
842167
842207
  const schema3 = new Schema(code);
842168
- return new BigMapAbstraction(new import_bignumber354.default(val.int), schema3, provider);
842208
+ return new BigMapAbstraction(new import_bignumber353.default(val.int), schema3, provider);
842169
842209
  }
842170
842210
  },
842171
842211
  sapling_state: (val) => {
842172
842212
  if (!val || !("int" in val) || val.int === void 0) {
842173
842213
  return {};
842174
842214
  } else {
842175
- return new SaplingStateAbstraction(new import_bignumber354.default(val.int), provider);
842215
+ return new SaplingStateAbstraction(new import_bignumber353.default(val.int), provider);
842176
842216
  }
842177
842217
  }
842178
842218
  /*
@@ -842214,7 +842254,7 @@ var PrepareProvider = class extends Provider {
842214
842254
  });
842215
842255
  }
842216
842256
  adjustGasForBatchOperation(gasLimitBlock, gaslimitOp, numberOfOps) {
842217
- return import_bignumber354.default.min(gaslimitOp, gasLimitBlock.div(numberOfOps + 1));
842257
+ return import_bignumber353.default.min(gaslimitOp, gasLimitBlock.div(numberOfOps + 1));
842218
842258
  }
842219
842259
  getOperationLimits(constants2, numberOfOps) {
842220
842260
  return __awaiter11(this, void 0, void 0, function* () {
@@ -844372,8 +844412,8 @@ var DelegateOperation = class extends Operation {
844372
844412
  return Number(this.params.storage_limit);
844373
844413
  }
844374
844414
  get consumedGas() {
844375
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844376
- return this.consumedMilliGas ? new import_bignumber354.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844415
+ import_bignumber353.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.BigNumber.ROUND_UP });
844416
+ return this.consumedMilliGas ? new import_bignumber353.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844377
844417
  }
844378
844418
  get consumedMilliGas() {
844379
844419
  var _a6;
@@ -844413,8 +844453,8 @@ var OriginationOperation = class extends Operation {
844413
844453
  return Number(this.params.storage_limit);
844414
844454
  }
844415
844455
  get consumedGas() {
844416
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844417
- return this.consumedMilliGas ? new import_bignumber354.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844456
+ import_bignumber353.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.BigNumber.ROUND_UP });
844457
+ return this.consumedMilliGas ? new import_bignumber353.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844418
844458
  }
844419
844459
  get consumedMilliGas() {
844420
844460
  var _a6;
@@ -844479,8 +844519,8 @@ var RegisterGlobalConstantOperation = class extends Operation {
844479
844519
  return (_a6 = this.operationResults) === null || _a6 === void 0 ? void 0 : _a6.errors;
844480
844520
  }
844481
844521
  get consumedGas() {
844482
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844483
- return this.consumedMilliGas ? new import_bignumber354.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844522
+ import_bignumber353.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.BigNumber.ROUND_UP });
844523
+ return this.consumedMilliGas ? new import_bignumber353.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844484
844524
  }
844485
844525
  get consumedMilliGas() {
844486
844526
  var _a6;
@@ -844531,8 +844571,8 @@ var RevealOperation = class extends Operation {
844531
844571
  }, 0);
844532
844572
  }
844533
844573
  get consumedGas() {
844534
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844535
- return new import_bignumber354.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString();
844574
+ import_bignumber353.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.BigNumber.ROUND_UP });
844575
+ return new import_bignumber353.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString();
844536
844576
  }
844537
844577
  get consumedMilliGas() {
844538
844578
  return String(this.sumProp(flattenOperationResult({ contents: this.operationResults }), "consumed_milligas"));
@@ -844567,7 +844607,7 @@ var TransactionOperation = class extends Operation {
844567
844607
  }
844568
844608
  }
844569
844609
  get amount() {
844570
- return new import_bignumber354.default(this.params.amount);
844610
+ return new import_bignumber353.default(this.params.amount);
844571
844611
  }
844572
844612
  get destination() {
844573
844613
  return this.params.destination;
@@ -844587,8 +844627,8 @@ var TransactionOperation = class extends Operation {
844587
844627
  }, 0);
844588
844628
  }
844589
844629
  get consumedGas() {
844590
- import_bignumber354.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.default.ROUND_UP });
844591
- return new import_bignumber354.default(this.consumedMilliGas).dividedBy(1e3).toString();
844630
+ import_bignumber353.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.default.ROUND_UP });
844631
+ return new import_bignumber353.default(this.consumedMilliGas).dividedBy(1e3).toString();
844592
844632
  }
844593
844633
  get consumedMilliGas() {
844594
844634
  return String(this.sumProp(flattenOperationResult({ contents: this.operationResults }), "consumed_milligas"));
@@ -844889,8 +844929,8 @@ var TransferTicketOperation = class extends Operation {
844889
844929
  return Number(this.params.storage_limit);
844890
844930
  }
844891
844931
  get consumedGas() {
844892
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844893
- return this.consumedMilliGas ? new import_bignumber354.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844932
+ import_bignumber353.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber353.BigNumber.ROUND_UP });
844933
+ return this.consumedMilliGas ? new import_bignumber353.BigNumber(this.consumedMilliGas).dividedBy(1e3).toString() : void 0;
844894
844934
  }
844895
844935
  get consumedMilliGas() {
844896
844936
  var _a6;
@@ -846220,7 +846260,7 @@ var PollingSubscribeProvider = class {
846220
846260
  const defaultIntervalSandbox = 1e3;
846221
846261
  try {
846222
846262
  const constants2 = yield this.context.readProvider.getProtocolConstants("head");
846223
- const blockTime = constants2.minimal_block_delay ? constants2.minimal_block_delay.multipliedBy(1e3) : new import_bignumber354.default(defaultIntervalTestnetsMainnet);
846263
+ const blockTime = constants2.minimal_block_delay ? constants2.minimal_block_delay.multipliedBy(1e3) : new import_bignumber353.default(defaultIntervalTestnetsMainnet);
846224
846264
  const confirmationPollingInterval = blockTime.dividedBy(3);
846225
846265
  this.config.pollingIntervalMilliseconds = confirmationPollingInterval.toNumber() === 0 ? defaultIntervalSandbox : confirmationPollingInterval.toNumber();
846226
846266
  } catch (exception) {
@@ -846747,7 +846787,7 @@ var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddre
846747
846787
  var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
846748
846788
 
846749
846789
  // ../../libs/coin-modules/coin-tezos/lib-es/utils.js
846750
- var import_utils505 = __toESM(require_utils48());
846790
+ var import_utils504 = __toESM(require_utils48());
846751
846791
  var DEFAULT_LIMITS = {
846752
846792
  GAS: 2169n,
846753
846793
  STORAGE: 277n,
@@ -846795,7 +846835,7 @@ function normalizePublicKeyForAddress(maybeKey, address3) {
846795
846835
  derivationType = DerivationType.P256;
846796
846836
  prefix3 = PrefixV2.P256PublicKey;
846797
846837
  }
846798
- return b58Encode((0, import_utils505.compressPublicKey)(keyBuf, derivationType), prefix3);
846838
+ return b58Encode((0, import_utils504.compressPublicKey)(keyBuf, derivationType), prefix3);
846799
846839
  } catch {
846800
846840
  return void 0;
846801
846841
  }
@@ -847725,7 +847765,7 @@ var getNetworkAlpacaApi = (networkFamily) => ({
847725
847765
  });
847726
847766
 
847727
847767
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/utils.js
847728
- var import_bignumber355 = __toESM(require("bignumber.js"));
847768
+ var import_bignumber354 = __toESM(require("bignumber.js"));
847729
847769
  function findCryptoCurrencyByNetwork(network) {
847730
847770
  const networksRemap = {
847731
847771
  xrp: "ripple"
@@ -847754,13 +847794,13 @@ function adaptCoreOperationToLiveOperation(accountId2, op) {
847754
847794
  if (op.details?.memo) {
847755
847795
  extra.memo = op.details.memo;
847756
847796
  }
847757
- const bnFees = new import_bignumber355.default(op.tx.fees.toString());
847797
+ const bnFees = new import_bignumber354.default(op.tx.fees.toString());
847758
847798
  const res = {
847759
847799
  id: encodeOperationId(accountId2, op.tx.hash, op.type),
847760
847800
  hash: op.tx.hash,
847761
847801
  accountId: accountId2,
847762
847802
  type: opType,
847763
- value: op.asset.type === "native" && ["OUT", "FEES"].includes(opType) ? new import_bignumber355.default(op.value.toString()).plus(bnFees) : new import_bignumber355.default(op.value.toString()),
847803
+ value: op.asset.type === "native" && ["OUT", "FEES"].includes(opType) ? new import_bignumber354.default(op.value.toString()).plus(bnFees) : new import_bignumber354.default(op.value.toString()),
847764
847804
  fee: bnFees,
847765
847805
  blockHash: op.tx.block.hash,
847766
847806
  blockHeight: op.tx.block.height,
@@ -847831,8 +847871,8 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
847831
847871
  id: encodeOperationId(account3.id, "", type4),
847832
847872
  hash: "",
847833
847873
  type: type4,
847834
- value: subAccountId ? new import_bignumber355.default(fees2.toString()) : transaction.amount,
847835
- fee: new import_bignumber355.default(fees2.toString()),
847874
+ value: subAccountId ? new import_bignumber354.default(fees2.toString()) : transaction.amount,
847875
+ fee: new import_bignumber354.default(fees2.toString()),
847836
847876
  blockHash: null,
847837
847877
  blockHeight: null,
847838
847878
  senders: [account3.freshAddress.toString()],
@@ -847854,7 +847894,7 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
847854
847894
  hash: "",
847855
847895
  type: "OUT",
847856
847896
  value: transaction.useAllAmount ? tokenAccount.balance : transaction.amount,
847857
- fee: new import_bignumber355.default(0),
847897
+ fee: new import_bignumber354.default(0),
847858
847898
  blockHash: null,
847859
847899
  blockHeight: null,
847860
847900
  senders: [account3.freshAddress],
@@ -847893,17 +847933,17 @@ function getAlpacaApi(network, kind) {
847893
847933
  }
847894
847934
 
847895
847935
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/buildSubAccounts.js
847896
- var import_bignumber356 = __toESM(require("bignumber.js"));
847936
+ var import_bignumber355 = __toESM(require("bignumber.js"));
847897
847937
  function buildTokenAccount({ parentAccountId, assetBalance, token, operations: operations4 }) {
847898
847938
  const id7 = encodeTokenAccountId(parentAccountId, token);
847899
- const balance2 = new import_bignumber356.default(assetBalance.value.toString() || "0");
847900
- const spendableBalance = new import_bignumber356.default(assetBalance.value.toString()).minus(new import_bignumber356.default(assetBalance.locked?.toString() || "0"));
847939
+ const balance2 = new import_bignumber355.default(assetBalance.value.toString() || "0");
847940
+ const spendableBalance = new import_bignumber355.default(assetBalance.value.toString()).minus(new import_bignumber355.default(assetBalance.locked?.toString() || "0"));
847901
847941
  const tokenOperations = operations4.map((op) => ({
847902
847942
  ...op,
847903
847943
  id: encodeOperationId(id7, op.hash, op.extra?.ledgerOpType),
847904
847944
  accountId: id7,
847905
847945
  type: op.extra?.ledgerOpType,
847906
- value: op.extra?.assetAmount ? new import_bignumber356.default(op.extra?.assetAmount) : op.value
847946
+ value: op.extra?.assetAmount ? new import_bignumber355.default(op.extra?.assetAmount) : op.value
847907
847947
  }));
847908
847948
  return {
847909
847949
  type: "TokenAccount",
@@ -847921,15 +847961,15 @@ function buildTokenAccount({ parentAccountId, assetBalance, token, operations: o
847921
847961
  // calculated in the jsHelpers
847922
847962
  };
847923
847963
  }
847924
- function buildSubAccounts4({ currency: currency24, accountId: accountId2, assetsBalance, syncConfig, operations: operations4, getTokenFromAsset: getTokenFromAsset3 }) {
847964
+ async function buildSubAccounts4({ currency: currency24, accountId: accountId2, allTokenAssetsBalances, syncConfig, operations: operations4, getTokenFromAsset: getTokenFromAsset3 }) {
847925
847965
  const { blacklistedTokenIds = [] } = syncConfig;
847926
847966
  const allTokens = listTokensForCryptoCurrency(currency24);
847927
- if (allTokens.length === 0 || assetsBalance.length === 0) {
847928
- return void 0;
847929
- }
847930
847967
  const tokenAccounts = [];
847931
- assetsBalance.filter((b20) => b20.asset.type !== "native").map((balance2) => {
847932
- const token = getTokenFromAsset3 && getTokenFromAsset3(balance2.asset);
847968
+ if (allTokens.length === 0 || allTokenAssetsBalances.length === 0) {
847969
+ return tokenAccounts;
847970
+ }
847971
+ for (const balance2 of allTokenAssetsBalances) {
847972
+ const token = getTokenFromAsset3 && await getTokenFromAsset3(balance2.asset);
847933
847973
  if (token && !blacklistedTokenIds.includes(token.id)) {
847934
847974
  tokenAccounts.push(buildTokenAccount({
847935
847975
  parentAccountId: accountId2,
@@ -847938,7 +847978,7 @@ function buildSubAccounts4({ currency: currency24, accountId: accountId2, assets
847938
847978
  operations: operations4.filter((op) => op.extra.assetReference === balance2.asset?.["assetReference"] && op.extra.assetOwner === balance2.asset?.["assetOwner"])
847939
847979
  }));
847940
847980
  }
847941
- });
847981
+ }
847942
847982
  return tokenAccounts;
847943
847983
  }
847944
847984
 
@@ -847963,7 +848003,7 @@ function genericGetAccountShape(network, kind) {
847963
848003
  const blockInfo = await alpacaApi.lastBlock();
847964
848004
  const balanceRes = await alpacaApi.getBalance(address3);
847965
848005
  const nativeAsset = extractBalance(balanceRes, "native");
847966
- const assetsBalance = balanceRes.filter((b20) => b20.asset.type !== "native").filter((b20) => alpacaApi.getTokenFromAsset && alpacaApi.getTokenFromAsset(b20.asset));
848006
+ const allTokenAssetsBalances = balanceRes.filter((b20) => b20.asset.type !== "native");
847967
848007
  const nativeBalance = BigInt(nativeAsset?.value ?? "0");
847968
848008
  const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
847969
848009
  const oldOps = (initialAccount?.operations || []).map((op) => op.accountId === accountId2 ? op : { ...op, accountId: accountId2, id: encodeOperationId(accountId2, op.hash, op.type) });
@@ -847985,14 +848025,14 @@ function genericGetAccountShape(network, kind) {
847985
848025
  assetOperations.push(operation);
847986
848026
  }
847987
848027
  });
847988
- const subAccounts = buildSubAccounts4({
848028
+ const subAccounts = await buildSubAccounts4({
847989
848029
  currency: currency24,
847990
848030
  accountId: accountId2,
847991
- assetsBalance,
848031
+ allTokenAssetsBalances,
847992
848032
  syncConfig,
847993
848033
  operations: assetOperations,
847994
848034
  getTokenFromAsset: alpacaApi.getTokenFromAsset
847995
- }) || [];
848035
+ });
847996
848036
  const operations4 = mergedOps.map((op) => {
847997
848037
  const subOperations = inferSubOperations(op.hash, subAccounts);
847998
848038
  return {
@@ -848004,8 +848044,8 @@ function genericGetAccountShape(network, kind) {
848004
848044
  id: accountId2,
848005
848045
  xpub: address3,
848006
848046
  blockHeight: operations4.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
848007
- balance: new import_bignumber357.default(nativeBalance.toString()),
848008
- spendableBalance: new import_bignumber357.default(spendableBalance.toString()),
848047
+ balance: new import_bignumber356.default(nativeBalance.toString()),
848048
+ spendableBalance: new import_bignumber356.default(spendableBalance.toString()),
848009
848049
  operations: operations4,
848010
848050
  subAccounts,
848011
848051
  operationsCount: operations4.length
@@ -848114,7 +848154,7 @@ function getSigner(network) {
848114
848154
  }
848115
848155
 
848116
848156
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/prepareTransaction.js
848117
- var import_bignumber358 = __toESM(require("bignumber.js"));
848157
+ var import_bignumber357 = __toESM(require("bignumber.js"));
848118
848158
  function bnEq(a65, b20) {
848119
848159
  return !a65 && !b20 ? true : !a65 || !b20 ? false : a65.eq(b20);
848120
848160
  }
@@ -848134,15 +848174,15 @@ function genericPrepareTransaction(network, kind) {
848134
848174
  ...transaction
848135
848175
  }, computeIntentType2))).value;
848136
848176
  }
848137
- if (!bnEq(transaction.fees, new import_bignumber358.default(fees2.toString()))) {
848177
+ if (!bnEq(transaction.fees, new import_bignumber357.default(fees2.toString()))) {
848138
848178
  const next = {
848139
848179
  ...transaction,
848140
- fees: new import_bignumber358.default(fees2.toString()),
848180
+ fees: new import_bignumber357.default(fees2.toString()),
848141
848181
  assetReference,
848142
848182
  assetOwner,
848143
848183
  customFees: {
848144
848184
  parameters: {
848145
- fees: new import_bignumber358.default(fees2.toString())
848185
+ fees: new import_bignumber357.default(fees2.toString())
848146
848186
  }
848147
848187
  }
848148
848188
  };
@@ -848153,9 +848193,9 @@ function genericPrepareTransaction(network, kind) {
848153
848193
  if (params) {
848154
848194
  const storageLimit = params["storageLimit"];
848155
848195
  if (storageLimit !== void 0 && (typeof storageLimit === "bigint" || typeof storageLimit === "number" || typeof storageLimit === "string")) {
848156
- next.storageLimit = new import_bignumber358.default(storageLimit.toString());
848196
+ next.storageLimit = new import_bignumber357.default(storageLimit.toString());
848157
848197
  if (next.customFees?.parameters) {
848158
- next.customFees.parameters.storageLimit = new import_bignumber358.default(storageLimit.toString());
848198
+ next.customFees.parameters.storageLimit = new import_bignumber357.default(storageLimit.toString());
848159
848199
  }
848160
848200
  }
848161
848201
  }
@@ -848163,7 +848203,7 @@ function genericPrepareTransaction(network, kind) {
848163
848203
  const { amount } = await validateIntent5(transactionToIntent(account3, {
848164
848204
  ...transaction
848165
848205
  }, computeIntentType2));
848166
- next.amount = new import_bignumber358.default(amount.toString());
848206
+ next.amount = new import_bignumber357.default(amount.toString());
848167
848207
  }
848168
848208
  return next;
848169
848209
  }
@@ -848186,14 +848226,14 @@ function getAssetInfos(tr3, owner, getAssetFromToken3) {
848186
848226
 
848187
848227
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getTransactionStatus.js
848188
848228
  init_lib_es();
848189
- var import_bignumber359 = __toESM(require("bignumber.js"));
848229
+ var import_bignumber358 = __toESM(require("bignumber.js"));
848190
848230
  function genericGetTransactionStatus(network, kind) {
848191
848231
  return async (account3, transaction) => {
848192
848232
  const alpacaApi = getAlpacaApi(account3.currency.id, kind);
848193
848233
  const draftTransaction = {
848194
848234
  mode: transaction?.mode ?? "send",
848195
848235
  recipient: transaction.recipient,
848196
- amount: transaction.amount ?? new import_bignumber359.default(0),
848236
+ amount: transaction.amount ?? new import_bignumber358.default(0),
848197
848237
  useAllAmount: !!transaction.useAllAmount,
848198
848238
  assetReference: transaction.assetReference || "",
848199
848239
  assetOwner: transaction.assetOwner || "",
@@ -848216,15 +848256,15 @@ function genericGetTransactionStatus(network, kind) {
848216
848256
  return {
848217
848257
  errors,
848218
848258
  warnings: warnings3,
848219
- estimatedFees: !transaction.fees || transaction.fees.isZero() ? new import_bignumber359.default(estimatedFees.toString()) : transaction.fees,
848220
- amount: transaction.amount.eq(0) ? new import_bignumber359.default(amount.toString()) : transaction.amount,
848221
- totalSpent: new import_bignumber359.default(totalSpent.toString())
848259
+ estimatedFees: !transaction.fees || transaction.fees.isZero() ? new import_bignumber358.default(estimatedFees.toString()) : transaction.fees,
848260
+ amount: transaction.amount.eq(0) ? new import_bignumber358.default(amount.toString()) : transaction.amount,
848261
+ totalSpent: new import_bignumber358.default(totalSpent.toString())
848222
848262
  };
848223
848263
  };
848224
848264
  }
848225
848265
 
848226
848266
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/createTransaction.js
848227
- var import_bignumber360 = __toESM(require("bignumber.js"));
848267
+ var import_bignumber359 = __toESM(require("bignumber.js"));
848228
848268
  function createTransaction41(account3) {
848229
848269
  const currency24 = account3.type === "TokenAccount" ? account3.token.parentCurrency : account3.currency;
848230
848270
  switch (currency24.family) {
@@ -848232,7 +848272,7 @@ function createTransaction41(account3) {
848232
848272
  case "ripple":
848233
848273
  return {
848234
848274
  family: currency24.family,
848235
- amount: (0, import_bignumber360.default)(0),
848275
+ amount: (0, import_bignumber359.default)(0),
848236
848276
  recipient: "",
848237
848277
  fees: null,
848238
848278
  tag: void 0,
@@ -848242,7 +848282,7 @@ function createTransaction41(account3) {
848242
848282
  case "stellar":
848243
848283
  return {
848244
848284
  family: currency24.family,
848245
- amount: new import_bignumber360.default(0),
848285
+ amount: new import_bignumber359.default(0),
848246
848286
  fees: null,
848247
848287
  recipient: "",
848248
848288
  memoValue: null,
@@ -848256,7 +848296,7 @@ function createTransaction41(account3) {
848256
848296
  case "tezos":
848257
848297
  return {
848258
848298
  family: currency24.family,
848259
- amount: new import_bignumber360.default(0),
848299
+ amount: new import_bignumber359.default(0),
848260
848300
  fees: null,
848261
848301
  recipient: "",
848262
848302
  useAllAmount: false,
@@ -848267,7 +848307,7 @@ function createTransaction41(account3) {
848267
848307
  return {
848268
848308
  mode: "send-eip1559",
848269
848309
  family: currency24.family,
848270
- amount: new import_bignumber360.default(0),
848310
+ amount: new import_bignumber359.default(0),
848271
848311
  recipient: "",
848272
848312
  useAllAmount: false,
848273
848313
  feesStrategy: "medium"
@@ -848279,7 +848319,7 @@ function createTransaction41(account3) {
848279
848319
  }
848280
848320
 
848281
848321
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js
848282
- var import_bignumber361 = __toESM(require("bignumber.js"));
848322
+ var import_bignumber360 = __toESM(require("bignumber.js"));
848283
848323
  function genericEstimateMaxSpendable(network, kind) {
848284
848324
  return async ({ account: account3, parentAccount, transaction }) => {
848285
848325
  if (account3.type === "TokenAccount") {
@@ -848299,10 +848339,10 @@ function genericEstimateMaxSpendable(network, kind) {
848299
848339
  }
848300
848340
  const { amount } = await alpacaApi.validateIntent(transactionToIntent(account3, { ...draftTransaction }, alpacaApi.computeIntentType), { value: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n });
848301
848341
  if (network === "stellar") {
848302
- return amount > 0 ? new import_bignumber361.default(amount.toString()) : new import_bignumber361.default(0);
848342
+ return amount > 0 ? new import_bignumber360.default(amount.toString()) : new import_bignumber360.default(0);
848303
848343
  }
848304
- const bnFee = (0, import_bignumber361.default)(fees2.toString());
848305
- return import_bignumber361.default.max(0, account3.spendableBalance.minus(bnFee));
848344
+ const bnFee = (0, import_bignumber360.default)(fees2.toString());
848345
+ return import_bignumber360.default.max(0, account3.spendableBalance.minus(bnFee));
848306
848346
  };
848307
848347
  }
848308
848348
 
@@ -848316,7 +848356,7 @@ var genericBroadcast = (network, kind) => async ({ signedOperation: { signature:
848316
848356
  var import_rxjs154 = require("rxjs");
848317
848357
  init_lib_es();
848318
848358
  init_lib_es2();
848319
- var import_bignumber362 = __toESM(require("bignumber.js"));
848359
+ var import_bignumber361 = __toESM(require("bignumber.js"));
848320
848360
  function applyMemoToIntent(transactionIntent, transaction) {
848321
848361
  if (transaction.tag) {
848322
848362
  const txWithMemoTag = transactionIntent;
@@ -848365,7 +848405,7 @@ var genericSignOperation = (network, kind) => (signerContext4) => ({ account: ac
848365
848405
  data: transaction.data
848366
848406
  };
848367
848407
  const { amount } = await alpacaApi.validateIntent(transactionToIntent(account3, draftTransaction, alpacaApi.computeIntentType), { value: fees2 });
848368
- transaction.amount = new import_bignumber362.default(amount.toString());
848408
+ transaction.amount = new import_bignumber361.default(amount.toString());
848369
848409
  }
848370
848410
  const signedInfo = await signerContext4(deviceId, async (signer2) => {
848371
848411
  const derivationPath = account3.freshAddressPath;
@@ -848623,7 +848663,7 @@ ${head2}${sub}`;
848623
848663
  return (op) => format6(op, 0);
848624
848664
  };
848625
848665
  function maybeDisplaySumOfOpsIssue(ops, balance2, unit) {
848626
- const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new import_bignumber363.BigNumber(0));
848666
+ const sumOfOps = ops.reduce((sum2, op) => sum2.plus(getOperationAmountNumber(op)), new import_bignumber362.BigNumber(0));
848627
848667
  if (sumOfOps.eq(balance2))
848628
848668
  return "";
848629
848669
  return " (! sum of ops " + formatCurrencyUnit(unit, sumOfOps, {
@@ -848671,7 +848711,7 @@ var cliFormat = (account3, level2) => {
848671
848711
  };
848672
848712
  var stats = (account3) => {
848673
848713
  const { subAccounts, operations: operations4 } = account3;
848674
- const sumOfAllOpsNumber = operations4.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new import_bignumber363.BigNumber(0));
848714
+ const sumOfAllOpsNumber = operations4.reduce((sum2, op) => sum2.plus(getOperationAmountNumberWithInternals(op)), new import_bignumber362.BigNumber(0));
848675
848715
  const sumOfAllOps = formatCurrencyUnit(getAccountCurrency(account3).units[0], sumOfAllOpsNumber, {
848676
848716
  showCode: true
848677
848717
  });
@@ -848696,7 +848736,7 @@ var operationBalanceHistoryBackwards = (account3) => {
848696
848736
  }).reverse());
848697
848737
  };
848698
848738
  var operationBalanceHistory = (account3) => {
848699
- let acc = new import_bignumber363.BigNumber(0);
848739
+ let acc = new import_bignumber362.BigNumber(0);
848700
848740
  return JSON.stringify(account3.operations.slice(0).reverse().map((op) => {
848701
848741
  acc = acc.plus(getOperationAmountNumberWithInternals(op));
848702
848742
  const { blockHeight } = op;
@@ -848800,37 +848840,37 @@ var toSignOperationEventRaw = (e36) => {
848800
848840
  var displayTokenValue = (token) => `${token.name} (#${extractTokenId(token.id)})`;
848801
848841
 
848802
848842
  // ../../libs/coin-modules/coin-cardano/lib-es/deviceTransactionConfig.js
848803
- var import_bignumber364 = __toESM(require("bignumber.js"));
848843
+ var import_bignumber363 = __toESM(require("bignumber.js"));
848804
848844
  var import_typhonjs12 = __toESM(require_dist6());
848805
848845
 
848806
848846
  // ../../libs/coin-modules/coin-casper/lib-es/bridge/deviceTransactionConfig.js
848807
848847
  init_lib_es2();
848808
848848
 
848809
848849
  // ../../libs/coin-modules/coin-evm/lib-es/deviceTransactionConfig.js
848810
- var import_bignumber365 = __toESM(require("bignumber.js"));
848850
+ var import_bignumber364 = __toESM(require("bignumber.js"));
848811
848851
 
848812
848852
  // ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/deviceTransactionConfig.js
848813
848853
  init_lib_es2();
848814
848854
  var currency4 = getCryptoCurrencyById("internet_computer");
848815
848855
 
848816
848856
  // ../../libs/coin-modules/coin-multiversx/lib-es/deviceTransactionConfig.js
848817
- var import_bignumber366 = __toESM(require("bignumber.js"));
848857
+ var import_bignumber365 = __toESM(require("bignumber.js"));
848818
848858
 
848819
848859
  // ../../libs/coin-modules/coin-polkadot/lib-es/bridge/deviceTransactionConfig.js
848820
848860
  var currency5 = getCryptoCurrencyById("polkadot");
848821
848861
 
848822
848862
  // ../../libs/coin-modules/coin-solana/lib-es/deviceTransactionConfig.js
848823
- var import_bignumber367 = __toESM(require("bignumber.js"));
848863
+ var import_bignumber366 = __toESM(require("bignumber.js"));
848824
848864
 
848825
848865
  // ../../libs/coin-modules/coin-stacks/lib-es/bridge/deviceTransactionConfig.js
848826
- var import_bignumber368 = require("bignumber.js");
848866
+ var import_bignumber367 = require("bignumber.js");
848827
848867
 
848828
848868
  // ../../libs/coin-modules/coin-ton/lib-es/deviceTransactionConfig.js
848829
848869
  var import_core22 = __toESM(require_dist2());
848830
- var import_bignumber369 = require("bignumber.js");
848870
+ var import_bignumber368 = require("bignumber.js");
848831
848871
 
848832
848872
  // ../../libs/coin-modules/coin-algorand/lib-es/transaction.js
848833
- var import_bignumber370 = require("bignumber.js");
848873
+ var import_bignumber369 = require("bignumber.js");
848834
848874
  var formatTransaction2 = ({ mode, subAccountId, amount, recipient, fees: fees2, useAllAmount }, mainAccount) => {
848835
848875
  const account3 = subAccountId && (mainAccount.subAccounts || []).find((a65) => a65.id === subAccountId) || mainAccount;
848836
848876
  return `
@@ -848849,7 +848889,7 @@ var fromTransactionRaw2 = (tr3) => {
848849
848889
  return {
848850
848890
  ...common,
848851
848891
  family: tr3.family,
848852
- fees: tr3.fees ? new import_bignumber370.BigNumber(tr3.fees) : null,
848892
+ fees: tr3.fees ? new import_bignumber369.BigNumber(tr3.fees) : null,
848853
848893
  memo: tr3.memo,
848854
848894
  mode: tr3.mode,
848855
848895
  assetId: tr3.assetId
@@ -848876,7 +848916,7 @@ var transaction_default3 = {
848876
848916
  };
848877
848917
 
848878
848918
  // ../../libs/coin-modules/coin-aptos/lib-es/bridge/transaction.js
848879
- var import_bignumber371 = require("bignumber.js");
848919
+ var import_bignumber370 = require("bignumber.js");
848880
848920
  var formatTransaction3 = ({ mode, amount, fees: fees2, recipient, useAllAmount }, account3) => {
848881
848921
  return `
848882
848922
  ${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(account3.currency.units[0], amount)}
@@ -848890,7 +848930,7 @@ var fromTransactionRaw3 = (t46) => {
848890
848930
  family: t46.family,
848891
848931
  mode: t46.mode,
848892
848932
  options: JSON.parse(t46.options),
848893
- ...t46.fees && { fees: new import_bignumber371.BigNumber(t46.fees) },
848933
+ ...t46.fees && { fees: new import_bignumber370.BigNumber(t46.fees) },
848894
848934
  ...t46.errors && { errors: JSON.parse(t46.errors) }
848895
848935
  };
848896
848936
  };
@@ -848915,14 +848955,14 @@ var transaction_default4 = {
848915
848955
  };
848916
848956
 
848917
848957
  // ../../libs/coin-modules/coin-bitcoin/lib-es/transaction.js
848918
- var import_bignumber372 = require("bignumber.js");
848958
+ var import_bignumber371 = require("bignumber.js");
848919
848959
  var fromFeeItemsRaw = (fir) => ({
848920
848960
  items: fir.items.map((fi) => ({
848921
848961
  key: fi.key,
848922
848962
  speed: fi.speed,
848923
- feePerByte: new import_bignumber372.BigNumber(fi.feePerByte)
848963
+ feePerByte: new import_bignumber371.BigNumber(fi.feePerByte)
848924
848964
  })),
848925
- defaultFeePerByte: new import_bignumber372.BigNumber(fir.defaultFeePerByte)
848965
+ defaultFeePerByte: new import_bignumber371.BigNumber(fir.defaultFeePerByte)
848926
848966
  });
848927
848967
  var toFeeItemsRaw = (fir) => ({
848928
848968
  items: fir.items.map((fi) => ({
@@ -848939,7 +848979,7 @@ var fromTransactionRaw4 = (tr3) => {
848939
848979
  rbf: tr3.rbf,
848940
848980
  utxoStrategy: tr3.utxoStrategy,
848941
848981
  family: tr3.family,
848942
- feePerByte: tr3.feePerByte ? new import_bignumber372.BigNumber(tr3.feePerByte) : null,
848982
+ feePerByte: tr3.feePerByte ? new import_bignumber371.BigNumber(tr3.feePerByte) : null,
848943
848983
  networkInfo: tr3.networkInfo && {
848944
848984
  family: tr3.networkInfo.family,
848945
848985
  feeItems: fromFeeItemsRaw(tr3.networkInfo.feeItems)
@@ -849033,7 +849073,7 @@ var transaction_default5 = {
849033
849073
  };
849034
849074
 
849035
849075
  // ../../libs/coin-modules/coin-cardano/lib-es/transaction.js
849036
- var import_bignumber373 = require("bignumber.js");
849076
+ var import_bignumber372 = require("bignumber.js");
849037
849077
  var formatTransaction5 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
849038
849078
  const account3 = subAccountId && (mainAccount.subAccounts || []).find((a65) => a65.id === subAccountId) || mainAccount;
849039
849079
  return `
@@ -849049,7 +849089,7 @@ var fromTransactionRaw5 = (tr3) => {
849049
849089
  ...common,
849050
849090
  family: tr3.family,
849051
849091
  mode: tr3.mode,
849052
- fees: tr3.fees ? new import_bignumber373.BigNumber(tr3.fees) : void 0,
849092
+ fees: tr3.fees ? new import_bignumber372.BigNumber(tr3.fees) : void 0,
849053
849093
  memo: tr3.memo,
849054
849094
  poolId: tr3.poolId,
849055
849095
  protocolParams: tr3.protocolParams
@@ -849077,7 +849117,7 @@ var transaction_default6 = {
849077
849117
  };
849078
849118
 
849079
849119
  // ../../libs/coin-modules/coin-casper/lib-es/bridge/transaction.js
849080
- var import_bignumber374 = __toESM(require("bignumber.js"));
849120
+ var import_bignumber373 = __toESM(require("bignumber.js"));
849081
849121
  var formatTransaction6 = ({ recipient, useAllAmount, amount }, account3) => `
849082
849122
  SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849083
849123
  showCode: true,
@@ -849089,8 +849129,8 @@ var fromTransactionRaw6 = (tr3) => {
849089
849129
  return {
849090
849130
  ...common,
849091
849131
  family: tr3.family,
849092
- fees: new import_bignumber374.default(tr3.fees),
849093
- amount: new import_bignumber374.default(tr3.amount),
849132
+ fees: new import_bignumber373.default(tr3.fees),
849133
+ amount: new import_bignumber373.default(tr3.amount),
849094
849134
  transferId: tr3.transferId
849095
849135
  };
849096
849136
  };
@@ -849114,7 +849154,7 @@ var transaction_default7 = {
849114
849154
  };
849115
849155
 
849116
849156
  // ../../libs/coin-modules/coin-canton/lib-es/bridge/transaction.js
849117
- var import_bignumber375 = require("bignumber.js");
849157
+ var import_bignumber374 = require("bignumber.js");
849118
849158
  var formatTransaction7 = ({ amount, recipient, fee, useAllAmount }, account3) => `
849119
849159
  SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849120
849160
  showCode: true,
@@ -849130,7 +849170,7 @@ var fromTransactionRaw7 = (tr3) => {
849130
849170
  return {
849131
849171
  ...common,
849132
849172
  family: tr3.family,
849133
- fee: tr3.fee ? new import_bignumber375.BigNumber(tr3.fee) : null,
849173
+ fee: tr3.fee ? new import_bignumber374.BigNumber(tr3.fee) : null,
849134
849174
  tokenId: tr3.tokenId
849135
849175
  };
849136
849176
  };
@@ -849153,7 +849193,7 @@ var transaction_default8 = {
849153
849193
  };
849154
849194
 
849155
849195
  // ../../libs/coin-modules/coin-celo/lib-es/bridge/transaction.js
849156
- var import_bignumber376 = require("bignumber.js");
849196
+ var import_bignumber375 = require("bignumber.js");
849157
849197
  var formatTransaction8 = (t46, account3) => `
849158
849198
  SEND ${t46.useAllAmount ? "MAX CELO" : formatCurrencyUnit(getAccountCurrency(account3).units[0], t46.amount, {
849159
849199
  showCode: true,
@@ -849165,7 +849205,7 @@ var fromTransactionRaw8 = (tr3) => {
849165
849205
  return {
849166
849206
  ...common,
849167
849207
  family: tr3.family,
849168
- fees: tr3.fees ? new import_bignumber376.BigNumber(tr3.fees) : null,
849208
+ fees: tr3.fees ? new import_bignumber375.BigNumber(tr3.fees) : null,
849169
849209
  mode: tr3.mode,
849170
849210
  index: tr3.index
849171
849211
  };
@@ -849190,7 +849230,7 @@ var transaction_default9 = {
849190
849230
  };
849191
849231
 
849192
849232
  // ../../libs/coin-modules/coin-cosmos/lib-es/transaction.js
849193
- var import_bignumber377 = require("bignumber.js");
849233
+ var import_bignumber376 = require("bignumber.js");
849194
849234
  var formatTransaction9 = ({ mode, amount, fees: fees2, recipient, validators: validators7, memo: memo3, sourceValidator, useAllAmount }, account3) => `
849195
849235
  ${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849196
849236
  showCode: true,
@@ -849211,13 +849251,13 @@ var fromTransactionRaw9 = (tr3) => {
849211
849251
  mode: tr3.mode,
849212
849252
  networkInfo: networkInfo && {
849213
849253
  family: networkInfo.family,
849214
- fees: new import_bignumber377.BigNumber(networkInfo.fees)
849254
+ fees: new import_bignumber376.BigNumber(networkInfo.fees)
849215
849255
  },
849216
- fees: tr3.fees ? new import_bignumber377.BigNumber(tr3.fees) : null,
849217
- gas: tr3.gas ? new import_bignumber377.BigNumber(tr3.gas) : null,
849256
+ fees: tr3.fees ? new import_bignumber376.BigNumber(tr3.fees) : null,
849257
+ gas: tr3.gas ? new import_bignumber376.BigNumber(tr3.gas) : null,
849218
849258
  memo: tr3.memo,
849219
849259
  sourceValidator: tr3.sourceValidator,
849220
- validators: tr3.validators ? tr3.validators.map((v34) => ({ ...v34, amount: new import_bignumber377.BigNumber(v34.amount) })) : []
849260
+ validators: tr3.validators ? tr3.validators.map((v34) => ({ ...v34, amount: new import_bignumber376.BigNumber(v34.amount) })) : []
849221
849261
  };
849222
849262
  };
849223
849263
  var toTransactionRaw9 = (t46) => {
@@ -849248,6 +849288,7 @@ var transaction_default10 = {
849248
849288
  };
849249
849289
 
849250
849290
  // ../../libs/coin-modules/coin-hedera/lib-es/transaction.js
849291
+ var import_bignumber377 = __toESM(require("bignumber.js"));
849251
849292
  function formatTransaction10(transaction, account3) {
849252
849293
  const amount = formatCurrencyUnit(getAccountCurrency(account3).units[0], transaction.amount, {
849253
849294
  showCode: true,
@@ -849261,7 +849302,8 @@ function fromTransactionRaw10(tr3) {
849261
849302
  return {
849262
849303
  ...common,
849263
849304
  family: tr3.family,
849264
- memo: tr3.memo
849305
+ memo: tr3.memo,
849306
+ ...tr3.maxFee && { maxFee: new import_bignumber377.default(tr3.maxFee) }
849265
849307
  };
849266
849308
  }
849267
849309
  function toTransactionRaw10(t46) {
@@ -849269,7 +849311,8 @@ function toTransactionRaw10(t46) {
849269
849311
  return {
849270
849312
  ...common,
849271
849313
  family: t46.family,
849272
- memo: t46.memo
849314
+ memo: t46.memo,
849315
+ ...t46.maxFee && { maxFee: t46.maxFee.toString() }
849273
849316
  };
849274
849317
  }
849275
849318
  var transaction_default11 = {