@ledgerhq/live-cli 24.25.0-nightly.0 → 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 +1110 -1019
  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.0",
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.0",
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,
@@ -807486,11 +807534,11 @@ var signer_default11 = getAddress_default10;
807486
807534
  // ../../libs/coin-modules/coin-sui/lib-es/logic/craftTransaction.js
807487
807535
  var import_bignumber302 = __toESM(require("bignumber.js"));
807488
807536
 
807489
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/version.js
807490
- var PACKAGE_VERSION = "1.37.1";
807491
- var TARGETED_RPC_VERSION = "1.54.0";
807537
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/version.js
807538
+ var PACKAGE_VERSION = "1.38.0";
807539
+ var TARGETED_RPC_VERSION = "1.57.0";
807492
807540
 
807493
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/errors.js
807541
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/errors.js
807494
807542
  var CODE_TO_ERROR_TYPE = {
807495
807543
  "-32700": "ParseError",
807496
807544
  "-32701": "OversizedRequest",
@@ -807526,7 +807574,7 @@ var SuiHTTPStatusError = class extends SuiHTTPTransportError {
807526
807574
  }
807527
807575
  };
807528
807576
 
807529
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/rpc-websocket-client.js
807577
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/rpc-websocket-client.js
807530
807578
  var __typeError = (msg) => {
807531
807579
  throw TypeError(msg);
807532
807580
  };
@@ -807705,7 +807753,7 @@ var RpcSubscription = class {
807705
807753
  }
807706
807754
  };
807707
807755
 
807708
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/http-transport.js
807756
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/http-transport.js
807709
807757
  var __typeError2 = (msg) => {
807710
807758
  throw TypeError(msg);
807711
807759
  };
@@ -807803,11 +807851,11 @@ getWebsocketClient_fn = function() {
807803
807851
  return __privateGet2(this, _websocketClient);
807804
807852
  };
807805
807853
 
807806
- // ../../node_modules/.pnpm/@mysten+utils@0.1.1/node_modules/@mysten/utils/dist/esm/b58.js
807854
+ // ../../node_modules/.pnpm/@mysten+utils@0.2.0/node_modules/@mysten/utils/dist/esm/b58.js
807807
807855
  var toBase58 = (buffer2) => base583.encode(buffer2);
807808
807856
  var fromBase58 = (str) => base583.decode(str);
807809
807857
 
807810
- // ../../node_modules/.pnpm/@mysten+utils@0.1.1/node_modules/@mysten/utils/dist/esm/b64.js
807858
+ // ../../node_modules/.pnpm/@mysten+utils@0.2.0/node_modules/@mysten/utils/dist/esm/b64.js
807811
807859
  function fromBase64(base64String2) {
807812
807860
  return Uint8Array.from(atob(base64String2), (char) => char.charCodeAt(0));
807813
807861
  }
@@ -807824,7 +807872,7 @@ function toBase64(bytes5) {
807824
807872
  return btoa(output3);
807825
807873
  }
807826
807874
 
807827
- // ../../node_modules/.pnpm/@mysten+utils@0.1.1/node_modules/@mysten/utils/dist/esm/hex.js
807875
+ // ../../node_modules/.pnpm/@mysten+utils@0.2.0/node_modules/@mysten/utils/dist/esm/hex.js
807828
807876
  function fromHex2(hexStr) {
807829
807877
  const normalized = hexStr.startsWith("0x") ? hexStr.slice(2) : hexStr;
807830
807878
  const padded = normalized.length % 2 === 0 ? normalized : `0${normalized}`;
@@ -807838,14 +807886,14 @@ function toHex4(bytes5) {
807838
807886
  return bytes5.reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
807839
807887
  }
807840
807888
 
807841
- // ../../node_modules/.pnpm/@mysten+utils@0.1.1/node_modules/@mysten/utils/dist/esm/chunk.js
807889
+ // ../../node_modules/.pnpm/@mysten+utils@0.2.0/node_modules/@mysten/utils/dist/esm/chunk.js
807842
807890
  function chunk3(array5, size3) {
807843
807891
  return Array.from({ length: Math.ceil(array5.length / size3) }, (_15, i54) => {
807844
807892
  return array5.slice(i54 * size3, (i54 + 1) * size3);
807845
807893
  });
807846
807894
  }
807847
807895
 
807848
- // ../../node_modules/.pnpm/@mysten+utils@0.1.1/node_modules/@mysten/utils/dist/esm/dataloader.js
807896
+ // ../../node_modules/.pnpm/@mysten+utils@0.2.0/node_modules/@mysten/utils/dist/esm/dataloader.js
807849
807897
  var DataLoader = class {
807850
807898
  constructor(batchLoadFn, options24) {
807851
807899
  if (typeof batchLoadFn !== "function") {
@@ -808141,7 +808189,7 @@ function isArrayLike2(x23) {
808141
808189
  return typeof x23 === "object" && x23 !== null && "length" in x23 && typeof x23.length === "number" && (x23.length === 0 || x23.length > 0 && Object.prototype.hasOwnProperty.call(x23, x23.length - 1));
808142
808190
  }
808143
808191
 
808144
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/uleb.js
808192
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/uleb.js
808145
808193
  function ulebEncode(num) {
808146
808194
  const arr = [];
808147
808195
  let len = 0;
@@ -808176,7 +808224,7 @@ function ulebDecode(arr) {
808176
808224
  };
808177
808225
  }
808178
808226
 
808179
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/reader.js
808227
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/reader.js
808180
808228
  var BcsReader = class {
808181
808229
  /**
808182
808230
  * @param {Uint8Array} data Data to use as a buffer.
@@ -808289,7 +808337,7 @@ var BcsReader = class {
808289
808337
  }
808290
808338
  };
808291
808339
 
808292
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/utils.js
808340
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/utils.js
808293
808341
  function encodeStr(data12, encoding) {
808294
808342
  switch (encoding) {
808295
808343
  case "base58":
@@ -808326,7 +808374,7 @@ function splitGenericParameters(str, genericSeparators = ["<", ">"]) {
808326
808374
  return tok;
808327
808375
  }
808328
808376
 
808329
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/writer.js
808377
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/writer.js
808330
808378
  var BcsWriter = class {
808331
808379
  constructor({
808332
808380
  initialSize = 1024,
@@ -808482,7 +808530,7 @@ function toLittleEndian(bigint2, size3) {
808482
808530
  return result2;
808483
808531
  }
808484
808532
 
808485
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/bcs-type.js
808533
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/bcs-type.js
808486
808534
  var __typeError3 = (msg) => {
808487
808535
  throw TypeError(msg);
808488
808536
  };
@@ -808561,11 +808609,11 @@ function isSerializedBcs(obj2) {
808561
808609
  return !!obj2 && typeof obj2 === "object" && obj2[SERIALIZED_BCS_BRAND] === true;
808562
808610
  }
808563
808611
  var SerializedBcs = class {
808564
- constructor(type4, schema3) {
808612
+ constructor(schema3, bytes5) {
808565
808613
  __privateAdd3(this, _schema);
808566
808614
  __privateAdd3(this, _bytes);
808567
- __privateSet3(this, _schema, type4);
808568
- __privateSet3(this, _bytes, schema3);
808615
+ __privateSet3(this, _schema, schema3);
808616
+ __privateSet3(this, _bytes, bytes5);
808569
808617
  }
808570
808618
  // Used to brand SerializedBcs so that they can be identified, even between multiple copies
808571
808619
  // of the @mysten/bcs package are installed
@@ -808834,7 +808882,7 @@ var BcsTuple = class extends BcsType {
808834
808882
  }
808835
808883
  };
808836
808884
 
808837
- // ../../node_modules/.pnpm/@mysten+bcs@1.7.0/node_modules/@mysten/bcs/dist/esm/bcs.js
808885
+ // ../../node_modules/.pnpm/@mysten+bcs@1.8.0/node_modules/@mysten/bcs/dist/esm/bcs.js
808838
808886
  function fixedArray(size3, type4, options24) {
808839
808887
  return new BcsType({
808840
808888
  read: (reader) => {
@@ -809221,7 +809269,7 @@ var bcs = {
809221
809269
  }
809222
809270
  };
809223
809271
 
809224
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/cache.js
809272
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/cache.js
809225
809273
  var __typeError4 = (msg) => {
809226
809274
  throw TypeError(msg);
809227
809275
  };
@@ -809288,7 +809336,7 @@ _prefix = /* @__PURE__ */ new WeakMap();
809288
809336
  _cache = /* @__PURE__ */ new WeakMap();
809289
809337
  var ClientCache = _ClientCache;
809290
809338
 
809291
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/client.js
809339
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/client.js
809292
809340
  var Experimental_BaseClient = class {
809293
809341
  constructor({
809294
809342
  network,
@@ -809315,7 +809363,7 @@ var Experimental_BaseClient = class {
809315
809363
  }
809316
809364
  };
809317
809365
 
809318
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/suins.js
809366
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/suins.js
809319
809367
  var SUI_NS_NAME_REGEX = /^(?!.*(^(?!@)|[-.@])($|[-.@]))(?:[a-z0-9-]{0,63}(?:\.[a-z0-9-]{0,63})*)?@[a-z0-9-]{0,63}$/i;
809320
809368
  var SUI_NS_DOMAIN_REGEX = /^(?!.*(^|[-.])($|[-.]))(?:[a-z0-9-]{0,63}\.)+sui$/i;
809321
809369
  var MAX_SUI_NS_NAME_LENGTH = 235;
@@ -809349,7 +809397,7 @@ function normalizeSuiNSName(name2, format6 = "at") {
809349
809397
  return `${parts.slice(0, -1).join(".")}@${parts[parts.length - 1]}`;
809350
809398
  }
809351
809399
 
809352
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/move-registry.js
809400
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/move-registry.js
809353
809401
  var NAME_PATTERN = /^([a-z0-9]+(?:-[a-z0-9]+)*)$/;
809354
809402
  var VERSION_REGEX = /^\d+$/;
809355
809403
  var MAX_APP_SIZE = 64;
@@ -809374,7 +809422,7 @@ var isValidNamedType = (type4) => {
809374
809422
  return true;
809375
809423
  };
809376
809424
 
809377
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/sui-types.js
809425
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/sui-types.js
809378
809426
  var TX_DIGEST_LENGTH = 32;
809379
809427
  function isValidTransactionDigest(value5) {
809380
809428
  try {
@@ -809435,7 +809483,7 @@ function getHexByteLength(value5) {
809435
809483
  return /^(0x|0X)/.test(value5) ? (value5.length - 2) / 2 : value5.length / 2;
809436
809484
  }
809437
809485
 
809438
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/type-tag-serializer.js
809486
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/type-tag-serializer.js
809439
809487
  var VECTOR_REGEX = /^vector<(.+)>$/;
809440
809488
  var STRUCT_REGEX = /^([^:]+)::([^:]+)::([^<]+)(<(.+)>)?/;
809441
809489
  var TypeTagSerializer = class _TypeTagSerializer {
@@ -809524,7 +809572,7 @@ var TypeTagSerializer = class _TypeTagSerializer {
809524
809572
  }
809525
809573
  };
809526
809574
 
809527
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/bcs.js
809575
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/bcs.js
809528
809576
  function unsafe_u64(options24) {
809529
809577
  return bcs.u64({
809530
809578
  name: "unsafe_u64",
@@ -809796,7 +809844,7 @@ var PasskeyAuthenticator = bcs.struct("PasskeyAuthenticator", {
809796
809844
  userSignature: bcs.vector(bcs.u8())
809797
809845
  });
809798
809846
 
809799
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/effects.js
809847
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/effects.js
809800
809848
  var PackageUpgradeError = bcs.enum("PackageUpgradeError", {
809801
809849
  UnableToFetchPackage: bcs.struct("UnableToFetchPackage", { packageId: Address9 }),
809802
809850
  NotAPackage: bcs.struct("NotAPackage", { objectId: Address9 }),
@@ -809982,7 +810030,7 @@ var TransactionEffects = bcs.enum("TransactionEffects", {
809982
810030
  V2: TransactionEffectsV2
809983
810031
  });
809984
810032
 
809985
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/pure.js
810033
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/pure.js
809986
810034
  function pureBcsSchemaFromTypeName(name2) {
809987
810035
  switch (name2) {
809988
810036
  case "u8":
@@ -810017,7 +810065,7 @@ function pureBcsSchemaFromTypeName(name2) {
810017
810065
  throw new Error(`Invalid Pure type name: ${name2}`);
810018
810066
  }
810019
810067
 
810020
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/index.js
810068
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/bcs/index.js
810021
810069
  var suiBcs = {
810022
810070
  ...bcs,
810023
810071
  U8: bcs.u8(),
@@ -810770,7 +810818,7 @@ function pipe2(...pipe22) {
810770
810818
  };
810771
810819
  }
810772
810820
 
810773
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/internal.js
810821
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/internal.js
810774
810822
  function safeEnum(options24) {
810775
810823
  const unionOptions = Object.entries(options24).map(([key2, value5]) => object6({ [key2]: value5 }));
810776
810824
  return pipe2(
@@ -810799,12 +810847,12 @@ var JsonU64 = pipe2(
810799
810847
  }
810800
810848
  }, "Invalid u64")
810801
810849
  );
810802
- var ObjectRef = object6({
810850
+ var ObjectRefSchema = object6({
810803
810851
  objectId: SuiAddress,
810804
810852
  version: JsonU64,
810805
810853
  digest: string4()
810806
810854
  });
810807
- var Argument2 = pipe2(
810855
+ var ArgumentSchema = pipe2(
810808
810856
  union4([
810809
810857
  object6({ GasCoin: literal4(true) }),
810810
810858
  object6({ Input: pipe2(number6(), integer()), type: optional3(literal4("pure")) }),
@@ -810818,20 +810866,20 @@ var Argument2 = pipe2(
810818
810866
  }))
810819
810867
  // Defined manually to add `type?: 'pure' | 'object'` to Input
810820
810868
  );
810821
- var GasData2 = object6({
810869
+ var GasDataSchema = object6({
810822
810870
  budget: nullable3(JsonU64),
810823
810871
  price: nullable3(JsonU64),
810824
810872
  owner: nullable3(SuiAddress),
810825
- payment: nullable3(array4(ObjectRef))
810873
+ payment: nullable3(array4(ObjectRefSchema))
810826
810874
  });
810827
- var StructTag2 = object6({
810875
+ var StructTagSchema = object6({
810828
810876
  address: string4(),
810829
810877
  module: string4(),
810830
810878
  name: string4(),
810831
810879
  // type_params in rust, should be updated to use camelCase
810832
810880
  typeParams: array4(string4())
810833
810881
  });
810834
- var OpenMoveTypeSignatureBody = union4([
810882
+ var OpenMoveTypeSignatureBodySchema = union4([
810835
810883
  literal4("address"),
810836
810884
  literal4("bool"),
810837
810885
  literal4("u8"),
@@ -810840,48 +810888,48 @@ var OpenMoveTypeSignatureBody = union4([
810840
810888
  literal4("u64"),
810841
810889
  literal4("u128"),
810842
810890
  literal4("u256"),
810843
- object6({ vector: lazy(() => OpenMoveTypeSignatureBody) }),
810891
+ object6({ vector: lazy(() => OpenMoveTypeSignatureBodySchema) }),
810844
810892
  object6({
810845
810893
  datatype: object6({
810846
810894
  package: string4(),
810847
810895
  module: string4(),
810848
810896
  type: string4(),
810849
- typeParameters: array4(lazy(() => OpenMoveTypeSignatureBody))
810897
+ typeParameters: array4(lazy(() => OpenMoveTypeSignatureBodySchema))
810850
810898
  })
810851
810899
  }),
810852
810900
  object6({ typeParameter: pipe2(number6(), integer()) })
810853
810901
  ]);
810854
- var OpenMoveTypeSignature = object6({
810902
+ var OpenMoveTypeSignatureSchema = object6({
810855
810903
  ref: nullable3(union4([literal4("&"), literal4("&mut")])),
810856
- body: OpenMoveTypeSignatureBody
810904
+ body: OpenMoveTypeSignatureBodySchema
810857
810905
  });
810858
- var ProgrammableMoveCall2 = object6({
810906
+ var ProgrammableMoveCallSchema = object6({
810859
810907
  package: ObjectID,
810860
810908
  module: string4(),
810861
810909
  function: string4(),
810862
810910
  // snake case in rust
810863
810911
  typeArguments: array4(string4()),
810864
- arguments: array4(Argument2),
810865
- _argumentTypes: optional3(nullable3(array4(OpenMoveTypeSignature)))
810912
+ arguments: array4(ArgumentSchema),
810913
+ _argumentTypes: optional3(nullable3(array4(OpenMoveTypeSignatureSchema)))
810866
810914
  });
810867
810915
  var $Intent = object6({
810868
810916
  name: string4(),
810869
- inputs: record3(string4(), union4([Argument2, array4(Argument2)])),
810917
+ inputs: record3(string4(), union4([ArgumentSchema, array4(ArgumentSchema)])),
810870
810918
  data: record3(string4(), unknown5())
810871
810919
  });
810872
- var Command2 = safeEnum({
810873
- MoveCall: ProgrammableMoveCall2,
810920
+ var CommandSchema = safeEnum({
810921
+ MoveCall: ProgrammableMoveCallSchema,
810874
810922
  TransferObjects: object6({
810875
- objects: array4(Argument2),
810876
- address: Argument2
810923
+ objects: array4(ArgumentSchema),
810924
+ address: ArgumentSchema
810877
810925
  }),
810878
810926
  SplitCoins: object6({
810879
- coin: Argument2,
810880
- amounts: array4(Argument2)
810927
+ coin: ArgumentSchema,
810928
+ amounts: array4(ArgumentSchema)
810881
810929
  }),
810882
810930
  MergeCoins: object6({
810883
- destination: Argument2,
810884
- sources: array4(Argument2)
810931
+ destination: ArgumentSchema,
810932
+ sources: array4(ArgumentSchema)
810885
810933
  }),
810886
810934
  Publish: object6({
810887
810935
  modules: array4(BCSBytes),
@@ -810889,28 +810937,28 @@ var Command2 = safeEnum({
810889
810937
  }),
810890
810938
  MakeMoveVec: object6({
810891
810939
  type: nullable3(string4()),
810892
- elements: array4(Argument2)
810940
+ elements: array4(ArgumentSchema)
810893
810941
  }),
810894
810942
  Upgrade: object6({
810895
810943
  modules: array4(BCSBytes),
810896
810944
  dependencies: array4(ObjectID),
810897
810945
  package: ObjectID,
810898
- ticket: Argument2
810946
+ ticket: ArgumentSchema
810899
810947
  }),
810900
810948
  $Intent
810901
810949
  });
810902
- var ObjectArg2 = safeEnum({
810903
- ImmOrOwnedObject: ObjectRef,
810950
+ var ObjectArgSchema = safeEnum({
810951
+ ImmOrOwnedObject: ObjectRefSchema,
810904
810952
  SharedObject: object6({
810905
810953
  objectId: ObjectID,
810906
810954
  // snake case in rust
810907
810955
  initialSharedVersion: JsonU64,
810908
810956
  mutable: boolean4()
810909
810957
  }),
810910
- Receiving: ObjectRef
810958
+ Receiving: ObjectRefSchema
810911
810959
  });
810912
- var CallArg2 = safeEnum({
810913
- Object: ObjectArg2,
810960
+ var CallArgSchema = safeEnum({
810961
+ Object: ObjectArgSchema,
810914
810962
  Pure: object6({
810915
810963
  bytes: BCSBytes
810916
810964
  }),
@@ -810921,11 +810969,12 @@ var CallArg2 = safeEnum({
810921
810969
  objectId: ObjectID,
810922
810970
  version: optional3(nullable3(JsonU64)),
810923
810971
  digest: optional3(nullable3(string4())),
810924
- initialSharedVersion: optional3(nullable3(JsonU64))
810972
+ initialSharedVersion: optional3(nullable3(JsonU64)),
810973
+ mutable: optional3(nullable3(boolean4()))
810925
810974
  })
810926
810975
  });
810927
810976
  var NormalizedCallArg = safeEnum({
810928
- Object: ObjectArg2,
810977
+ Object: ObjectArgSchema,
810929
810978
  Pure: object6({
810930
810979
  bytes: BCSBytes
810931
810980
  })
@@ -810934,16 +810983,16 @@ var TransactionExpiration2 = safeEnum({
810934
810983
  None: literal4(true),
810935
810984
  Epoch: JsonU64
810936
810985
  });
810937
- var TransactionData2 = object6({
810986
+ var TransactionDataSchema = object6({
810938
810987
  version: literal4(2),
810939
810988
  sender: nullish(SuiAddress),
810940
810989
  expiration: nullish(TransactionExpiration2),
810941
- gasData: GasData2,
810942
- inputs: array4(CallArg2),
810943
- commands: array4(Command2)
810990
+ gasData: GasDataSchema,
810991
+ inputs: array4(CallArgSchema),
810992
+ commands: array4(CommandSchema)
810944
810993
  });
810945
810994
 
810946
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Commands.js
810995
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Commands.js
810947
810996
  var Commands = {
810948
810997
  MoveCall(input) {
810949
810998
  const [pkg, mod5 = "", fn4 = ""] = "target" in input ? input.target.split("::") : [input.package, input.module, input.function];
@@ -810962,8 +811011,8 @@ var Commands = {
810962
811011
  return {
810963
811012
  $kind: "TransferObjects",
810964
811013
  TransferObjects: {
810965
- objects: objects.map((o41) => parse12(Argument2, o41)),
810966
- address: parse12(Argument2, address3)
811014
+ objects: objects.map((o41) => parse12(ArgumentSchema, o41)),
811015
+ address: parse12(ArgumentSchema, address3)
810967
811016
  }
810968
811017
  };
810969
811018
  },
@@ -810971,8 +811020,8 @@ var Commands = {
810971
811020
  return {
810972
811021
  $kind: "SplitCoins",
810973
811022
  SplitCoins: {
810974
- coin: parse12(Argument2, coin),
810975
- amounts: amounts.map((o41) => parse12(Argument2, o41))
811023
+ coin: parse12(ArgumentSchema, coin),
811024
+ amounts: amounts.map((o41) => parse12(ArgumentSchema, o41))
810976
811025
  }
810977
811026
  };
810978
811027
  },
@@ -810980,8 +811029,8 @@ var Commands = {
810980
811029
  return {
810981
811030
  $kind: "MergeCoins",
810982
811031
  MergeCoins: {
810983
- destination: parse12(Argument2, destination),
810984
- sources: sources.map((o41) => parse12(Argument2, o41))
811032
+ destination: parse12(ArgumentSchema, destination),
811033
+ sources: sources.map((o41) => parse12(ArgumentSchema, o41))
810985
811034
  }
810986
811035
  };
810987
811036
  },
@@ -811013,7 +811062,7 @@ var Commands = {
811013
811062
  ),
811014
811063
  dependencies: dependencies.map((dep2) => normalizeSuiObjectId(dep2)),
811015
811064
  package: packageId,
811016
- ticket: parse12(Argument2, ticket)
811065
+ ticket: parse12(ArgumentSchema, ticket)
811017
811066
  }
811018
811067
  };
811019
811068
  },
@@ -811025,7 +811074,7 @@ var Commands = {
811025
811074
  $kind: "MakeMoveVec",
811026
811075
  MakeMoveVec: {
811027
811076
  type: type4 ?? null,
811028
- elements: elements.map((o41) => parse12(Argument2, o41))
811077
+ elements: elements.map((o41) => parse12(ArgumentSchema, o41))
811029
811078
  }
811030
811079
  };
811031
811080
  },
@@ -811041,7 +811090,7 @@ var Commands = {
811041
811090
  inputs: Object.fromEntries(
811042
811091
  Object.entries(inputs).map(([key2, value5]) => [
811043
811092
  key2,
811044
- Array.isArray(value5) ? value5.map((o41) => parse12(Argument2, o41)) : parse12(Argument2, value5)
811093
+ Array.isArray(value5) ? value5.map((o41) => parse12(ArgumentSchema, o41)) : parse12(ArgumentSchema, value5)
811045
811094
  ])
811046
811095
  ),
811047
811096
  data: data12
@@ -811050,23 +811099,23 @@ var Commands = {
811050
811099
  }
811051
811100
  };
811052
811101
 
811053
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/v1.js
811054
- var ObjectRef2 = object6({
811102
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/v1.js
811103
+ var ObjectRef = object6({
811055
811104
  digest: string4(),
811056
811105
  objectId: string4(),
811057
811106
  version: union4([pipe2(number6(), integer()), string4(), bigint()])
811058
811107
  });
811059
- var ObjectArg3 = safeEnum({
811060
- ImmOrOwned: ObjectRef2,
811108
+ var ObjectArg2 = safeEnum({
811109
+ ImmOrOwned: ObjectRef,
811061
811110
  Shared: object6({
811062
811111
  objectId: ObjectID,
811063
811112
  initialSharedVersion: JsonU64,
811064
811113
  mutable: boolean4()
811065
811114
  }),
811066
- Receiving: ObjectRef2
811115
+ Receiving: ObjectRef
811067
811116
  });
811068
811117
  var NormalizedCallArg2 = safeEnum({
811069
- Object: ObjectArg3,
811118
+ Object: ObjectArg2,
811070
811119
  Pure: array4(pipe2(number6(), integer()))
811071
811120
  });
811072
811121
  var TransactionInput2 = union4([
@@ -811108,12 +811157,12 @@ var TypeTag2 = union4([
811108
811157
  object6({ address: nullable3(literal4(true)) }),
811109
811158
  object6({ signer: nullable3(literal4(true)) }),
811110
811159
  object6({ vector: lazy(() => TypeTag2) }),
811111
- object6({ struct: lazy(() => StructTag3) }),
811160
+ object6({ struct: lazy(() => StructTag2) }),
811112
811161
  object6({ u16: nullable3(literal4(true)) }),
811113
811162
  object6({ u32: nullable3(literal4(true)) }),
811114
811163
  object6({ u256: nullable3(literal4(true)) })
811115
811164
  ]);
811116
- var StructTag3 = object6({
811165
+ var StructTag2 = object6({
811117
811166
  address: string4(),
811118
811167
  module: string4(),
811119
811168
  name: string4(),
@@ -811122,7 +811171,7 @@ var StructTag3 = object6({
811122
811171
  var GasConfig = object6({
811123
811172
  budget: optional3(StringEncodedBigint),
811124
811173
  price: optional3(StringEncodedBigint),
811125
- payment: optional3(array4(ObjectRef2)),
811174
+ payment: optional3(array4(ObjectRef)),
811126
811175
  owner: optional3(string4())
811127
811176
  });
811128
811177
  var TransactionArgumentTypes = [
@@ -811341,7 +811390,7 @@ function convertTransactionArgument(arg, inputs) {
811341
811390
  throw new Error(`Invalid argument ${Object.keys(arg)}`);
811342
811391
  }
811343
811392
  function transactionDataFromV1(data12) {
811344
- return parse12(TransactionData2, {
811393
+ return parse12(TransactionDataSchema, {
811345
811394
  version: 2,
811346
811395
  sender: data12.sender ?? null,
811347
811396
  expiration: data12.expiration ? "Epoch" in data12.expiration ? { Epoch: data12.expiration.Epoch } : { None: true } : null,
@@ -811500,50 +811549,50 @@ function parseV1TransactionArgument(arg) {
811500
811549
  }
811501
811550
  }
811502
811551
 
811503
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/v2.js
811552
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/data/v2.js
811504
811553
  function enumUnion(options24) {
811505
811554
  return union4(
811506
811555
  Object.entries(options24).map(([key2, value5]) => object6({ [key2]: value5 }))
811507
811556
  );
811508
811557
  }
811509
- var Argument3 = enumUnion({
811558
+ var Argument2 = enumUnion({
811510
811559
  GasCoin: literal4(true),
811511
811560
  Input: pipe2(number6(), integer()),
811512
811561
  Result: pipe2(number6(), integer()),
811513
811562
  NestedResult: tuple3([pipe2(number6(), integer()), pipe2(number6(), integer())])
811514
811563
  });
811515
- var GasData3 = object6({
811564
+ var GasData2 = object6({
811516
811565
  budget: nullable3(JsonU64),
811517
811566
  price: nullable3(JsonU64),
811518
811567
  owner: nullable3(SuiAddress),
811519
- payment: nullable3(array4(ObjectRef))
811568
+ payment: nullable3(array4(ObjectRefSchema))
811520
811569
  });
811521
- var ProgrammableMoveCall3 = object6({
811570
+ var ProgrammableMoveCall2 = object6({
811522
811571
  package: ObjectID,
811523
811572
  module: string4(),
811524
811573
  function: string4(),
811525
811574
  // snake case in rust
811526
811575
  typeArguments: array4(string4()),
811527
- arguments: array4(Argument3)
811576
+ arguments: array4(Argument2)
811528
811577
  });
811529
811578
  var $Intent2 = object6({
811530
811579
  name: string4(),
811531
- inputs: record3(string4(), union4([Argument3, array4(Argument3)])),
811580
+ inputs: record3(string4(), union4([Argument2, array4(Argument2)])),
811532
811581
  data: record3(string4(), unknown5())
811533
811582
  });
811534
- var Command3 = enumUnion({
811535
- MoveCall: ProgrammableMoveCall3,
811583
+ var Command2 = enumUnion({
811584
+ MoveCall: ProgrammableMoveCall2,
811536
811585
  TransferObjects: object6({
811537
- objects: array4(Argument3),
811538
- address: Argument3
811586
+ objects: array4(Argument2),
811587
+ address: Argument2
811539
811588
  }),
811540
811589
  SplitCoins: object6({
811541
- coin: Argument3,
811542
- amounts: array4(Argument3)
811590
+ coin: Argument2,
811591
+ amounts: array4(Argument2)
811543
811592
  }),
811544
811593
  MergeCoins: object6({
811545
- destination: Argument3,
811546
- sources: array4(Argument3)
811594
+ destination: Argument2,
811595
+ sources: array4(Argument2)
811547
811596
  }),
811548
811597
  Publish: object6({
811549
811598
  modules: array4(BCSBytes),
@@ -811551,28 +811600,28 @@ var Command3 = enumUnion({
811551
811600
  }),
811552
811601
  MakeMoveVec: object6({
811553
811602
  type: nullable3(string4()),
811554
- elements: array4(Argument3)
811603
+ elements: array4(Argument2)
811555
811604
  }),
811556
811605
  Upgrade: object6({
811557
811606
  modules: array4(BCSBytes),
811558
811607
  dependencies: array4(ObjectID),
811559
811608
  package: ObjectID,
811560
- ticket: Argument3
811609
+ ticket: Argument2
811561
811610
  }),
811562
811611
  $Intent: $Intent2
811563
811612
  });
811564
- var ObjectArg4 = enumUnion({
811565
- ImmOrOwnedObject: ObjectRef,
811613
+ var ObjectArg3 = enumUnion({
811614
+ ImmOrOwnedObject: ObjectRefSchema,
811566
811615
  SharedObject: object6({
811567
811616
  objectId: ObjectID,
811568
811617
  // snake case in rust
811569
811618
  initialSharedVersion: JsonU64,
811570
811619
  mutable: boolean4()
811571
811620
  }),
811572
- Receiving: ObjectRef
811621
+ Receiving: ObjectRefSchema
811573
811622
  });
811574
- var CallArg3 = enumUnion({
811575
- Object: ObjectArg4,
811623
+ var CallArg2 = enumUnion({
811624
+ Object: ObjectArg3,
811576
811625
  Pure: object6({
811577
811626
  bytes: BCSBytes
811578
811627
  }),
@@ -811583,24 +811632,25 @@ var CallArg3 = enumUnion({
811583
811632
  objectId: ObjectID,
811584
811633
  version: optional3(nullable3(JsonU64)),
811585
811634
  digest: optional3(nullable3(string4())),
811586
- initialSharedVersion: optional3(nullable3(JsonU64))
811635
+ initialSharedVersion: optional3(nullable3(JsonU64)),
811636
+ mutable: optional3(nullable3(boolean4()))
811587
811637
  })
811588
811638
  });
811589
811639
  var TransactionExpiration4 = enumUnion({
811590
811640
  None: literal4(true),
811591
811641
  Epoch: JsonU64
811592
811642
  });
811593
- var SerializedTransactionDataV2 = object6({
811643
+ var SerializedTransactionDataV2Schema = object6({
811594
811644
  version: literal4(2),
811595
811645
  sender: nullish(SuiAddress),
811596
811646
  expiration: nullish(TransactionExpiration4),
811597
- gasData: GasData3,
811598
- inputs: array4(CallArg3),
811599
- commands: array4(Command3),
811647
+ gasData: GasData2,
811648
+ inputs: array4(CallArg2),
811649
+ commands: array4(Command2),
811600
811650
  digest: optional3(nullable3(string4()))
811601
811651
  });
811602
811652
 
811603
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Inputs.js
811653
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Inputs.js
811604
811654
  function Pure(data12) {
811605
811655
  return {
811606
811656
  $kind: "Pure",
@@ -811656,7 +811706,7 @@ var Inputs = {
811656
811706
  }
811657
811707
  };
811658
811708
 
811659
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/constants.js
811709
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/constants.js
811660
811710
  var MIST_PER_SUI = BigInt(1e9);
811661
811711
  var MOVE_STDLIB_ADDRESS = "0x1";
811662
811712
  var SUI_FRAMEWORK_ADDRESS = "0x2";
@@ -811664,7 +811714,7 @@ var SUI_CLOCK_OBJECT_ID = normalizeSuiObjectId("0x6");
811664
811714
  var SUI_TYPE_ARG = `${SUI_FRAMEWORK_ADDRESS}::sui::SUI`;
811665
811715
  var SUI_SYSTEM_STATE_OBJECT_ID = normalizeSuiObjectId("0x5");
811666
811716
 
811667
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/dynamic-fields.js
811717
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/utils/dynamic-fields.js
811668
811718
  function deriveDynamicFieldID(parentId, typeTag, key2) {
811669
811719
  const address3 = suiBcs.Address.serialize(parentId).toBytes();
811670
811720
  const tag = suiBcs.TypeTag.serialize(typeTag).toBytes();
@@ -811680,7 +811730,7 @@ function deriveDynamicFieldID(parentId, typeTag, key2) {
811680
811730
  return `0x${toHex4(hash10.digest().slice(0, 32))}`;
811681
811731
  }
811682
811732
 
811683
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/serializer.js
811733
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/serializer.js
811684
811734
  var OBJECT_MODULE_NAME = "object";
811685
811735
  var ID_STRUCT_NAME = "ID";
811686
811736
  var STD_ASCII_MODULE_NAME = "ascii";
@@ -811806,7 +811856,7 @@ function normalizedTypeToMoveTypeSignatureBody(type4) {
811806
811856
  throw new Error(`Unexpected type ${JSON.stringify(type4)}`);
811807
811857
  }
811808
811858
 
811809
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/json-rpc-resolver.js
811859
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/json-rpc-resolver.js
811810
811860
  var MAX_OBJECTS_PER_FETCH = 50;
811811
811861
  var GAS_SAFE_OVERHEAD = 1000n;
811812
811862
  var MAX_GAS = 5e10;
@@ -811876,7 +811926,9 @@ async function setGasPayment(transactionData, client) {
811876
811926
  if (!paymentCoins.length) {
811877
811927
  throw new Error("No valid gas coins found for the transaction.");
811878
811928
  }
811879
- transactionData.gasConfig.payment = paymentCoins.map((payment) => parse12(ObjectRef, payment));
811929
+ transactionData.gasConfig.payment = paymentCoins.map(
811930
+ (payment) => parse12(ObjectRefSchema, payment)
811931
+ );
811880
811932
  }
811881
811933
  }
811882
811934
  async function resolveObjectReferences(transactionData, client) {
@@ -811935,7 +811987,7 @@ async function resolveObjectReferences(transactionData, client) {
811935
811987
  updated = Inputs.SharedObjectRef({
811936
811988
  objectId: id7,
811937
811989
  initialSharedVersion: input.UnresolvedObject.initialSharedVersion || object7?.initialSharedVersion,
811938
- mutable: isUsedAsMutable(transactionData, index)
811990
+ mutable: input.UnresolvedObject.mutable || isUsedAsMutable(transactionData, index)
811939
811991
  });
811940
811992
  } else if (isUsedAsReceiving(transactionData, index)) {
811941
811993
  updated = Inputs.ReceivingRef(
@@ -811969,7 +812021,7 @@ async function normalizeInputs(transactionData, client) {
811969
812021
  return null;
811970
812022
  });
811971
812023
  const needsResolution = inputs2.some(
811972
- (input) => input?.UnresolvedPure || input?.UnresolvedObject
812024
+ (input) => input?.UnresolvedPure || input?.UnresolvedObject && typeof input?.UnresolvedObject.mutable !== "boolean"
811973
812025
  );
811974
812026
  if (needsResolution) {
811975
812027
  const functionName = `${command4.MoveCall.package}::${command4.MoveCall.module}::${command4.MoveCall.function}`;
@@ -812088,7 +812140,7 @@ function isReceivingType(type4) {
812088
812140
  return type4.body.datatype.package === "0x2" && type4.body.datatype.module === "transfer" && type4.body.datatype.type === "Receiving";
812089
812141
  }
812090
812142
 
812091
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/resolve.js
812143
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/resolve.js
812092
812144
  function needsTransactionResolution(data12, options24) {
812093
812145
  if (data12.inputs.some((input) => {
812094
812146
  return input.UnresolvedObject || input.UnresolvedPure;
@@ -812159,15 +812211,53 @@ function normalizeRawArgument(arg, schema3, transactionData) {
812159
812211
  transactionData.inputs[arg.Input] = Inputs.Pure(schema3.serialize(input.UnresolvedPure.value));
812160
812212
  }
812161
812213
 
812162
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/object.js
812214
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/object.js
812163
812215
  function createObjectMethods(makeObject) {
812164
812216
  function object7(value5) {
812165
812217
  return makeObject(value5);
812166
812218
  }
812167
- object7.system = () => object7("0x5");
812168
- object7.clock = () => object7("0x6");
812169
- object7.random = () => object7("0x8");
812170
- object7.denyList = () => object7("0x403");
812219
+ object7.system = (options24) => {
812220
+ const mutable = options24?.mutable;
812221
+ if (mutable !== void 0) {
812222
+ return object7(
812223
+ Inputs.SharedObjectRef({
812224
+ objectId: "0x5",
812225
+ initialSharedVersion: 1,
812226
+ mutable
812227
+ })
812228
+ );
812229
+ }
812230
+ return object7({
812231
+ $kind: "UnresolvedObject",
812232
+ UnresolvedObject: {
812233
+ objectId: "0x5",
812234
+ initialSharedVersion: 1
812235
+ }
812236
+ });
812237
+ };
812238
+ object7.clock = () => object7(
812239
+ Inputs.SharedObjectRef({
812240
+ objectId: "0x6",
812241
+ initialSharedVersion: 1,
812242
+ mutable: false
812243
+ })
812244
+ );
812245
+ object7.random = () => object7({
812246
+ $kind: "UnresolvedObject",
812247
+ UnresolvedObject: {
812248
+ objectId: "0x8",
812249
+ mutable: false
812250
+ }
812251
+ });
812252
+ object7.denyList = (options24) => {
812253
+ return object7({
812254
+ $kind: "UnresolvedObject",
812255
+ UnresolvedObject: {
812256
+ objectId: "0x403",
812257
+ mutable: options24?.mutable
812258
+ }
812259
+ });
812260
+ };
812171
812261
  object7.option = ({ type: type4, value: value5 }) => (tx) => tx.moveCall({
812172
812262
  typeArguments: [type4],
812173
812263
  target: `0x1::option::${value5 === null ? "none" : "some"}`,
@@ -812176,7 +812266,7 @@ function createObjectMethods(makeObject) {
812176
812266
  return object7;
812177
812267
  }
812178
812268
 
812179
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/pure.js
812269
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/pure.js
812180
812270
  function createPure(makePure) {
812181
812271
  function pure(typeOrSerializedValue, value5) {
812182
812272
  if (typeof typeOrSerializedValue === "string") {
@@ -812208,7 +812298,7 @@ function createPure(makePure) {
812208
812298
  return pure;
812209
812299
  }
812210
812300
 
812211
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/hash.js
812301
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/hash.js
812212
812302
  function hashTypedData2(typeTag, data12) {
812213
812303
  const typeTagBytes = Array.from(`${typeTag}::`).map((e36) => e36.charCodeAt(0));
812214
812304
  const dataWithTag = new Uint8Array(typeTagBytes.length + data12.length);
@@ -812217,7 +812307,7 @@ function hashTypedData2(typeTag, data12) {
812217
812307
  return blake2b2(dataWithTag, { dkLen: 32 });
812218
812308
  }
812219
812309
 
812220
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/TransactionData.js
812310
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/TransactionData.js
812221
812311
  function prepareSuiAddress(address3) {
812222
812312
  return normalizeSuiAddress(address3).replace("0x", "");
812223
812313
  }
@@ -812273,9 +812363,9 @@ var TransactionDataBuilder = class _TransactionDataBuilder {
812273
812363
  }
812274
812364
  static restore(data12) {
812275
812365
  if (data12.version === 2) {
812276
- return new _TransactionDataBuilder(parse12(TransactionData2, data12));
812366
+ return new _TransactionDataBuilder(parse12(TransactionDataSchema, data12));
812277
812367
  } else {
812278
- return new _TransactionDataBuilder(parse12(TransactionData2, transactionDataFromV1(data12)));
812368
+ return new _TransactionDataBuilder(parse12(TransactionDataSchema, transactionDataFromV1(data12)));
812279
812369
  }
812280
812370
  }
812281
812371
  /**
@@ -812452,7 +812542,7 @@ var TransactionDataBuilder = class _TransactionDataBuilder {
812452
812542
  return _TransactionDataBuilder.getDigestFromBytes(bytes5);
812453
812543
  }
812454
812544
  snapshot() {
812455
- return parse12(TransactionData2, this);
812545
+ return parse12(TransactionDataSchema, this);
812456
812546
  }
812457
812547
  shallowClone() {
812458
812548
  return new _TransactionDataBuilder({
@@ -812468,7 +812558,7 @@ var TransactionDataBuilder = class _TransactionDataBuilder {
812468
812558
  }
812469
812559
  };
812470
812560
 
812471
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/utils.js
812561
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/utils.js
812472
812562
  function getIdFromCallArg(arg) {
812473
812563
  if (typeof arg === "string") {
812474
812564
  return normalizeSuiAddress(arg);
@@ -812488,7 +812578,7 @@ function getIdFromCallArg(arg) {
812488
812578
  return void 0;
812489
812579
  }
812490
812580
 
812491
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/mvr.js
812581
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/mvr.js
812492
812582
  var __typeError5 = (msg) => {
812493
812583
  throw TypeError(msg);
812494
812584
  };
@@ -812837,7 +812927,7 @@ function getNamesFromTypeList(types4) {
812837
812927
  return names4;
812838
812928
  }
812839
812929
 
812840
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/plugins/NamedPackagesPlugin.js
812930
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/plugins/NamedPackagesPlugin.js
812841
812931
  var cacheMap = /* @__PURE__ */ new WeakMap();
812842
812932
  var namedPackagesPlugin = (options24) => {
812843
812933
  let mvrClient;
@@ -812878,7 +812968,7 @@ function getClient3(options24) {
812878
812968
  return options24.client;
812879
812969
  }
812880
812970
 
812881
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Transaction.js
812971
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/transactions/Transaction.js
812882
812972
  var __typeError6 = (msg) => {
812883
812973
  throw TypeError(msg);
812884
812974
  };
@@ -812988,7 +813078,7 @@ var _Transaction = class _Transaction2 {
812988
813078
  if (typeof value5 === "function") {
812989
813079
  return this.object(this.add(value5));
812990
813080
  }
812991
- if (typeof value5 === "object" && is5(Argument2, value5)) {
813081
+ if (typeof value5 === "object" && is5(ArgumentSchema, value5)) {
812992
813082
  return value5;
812993
813083
  }
812994
813084
  const id7 = getIdFromCallArg(value5);
@@ -813103,7 +813193,7 @@ var _Transaction = class _Transaction2 {
813103
813193
  __privateGet6(this, _data).gasConfig.owner = owner;
813104
813194
  }
813105
813195
  setGasPayment(payments6) {
813106
- __privateGet6(this, _data).gasConfig.payment = payments6.map((payment) => parse12(ObjectRef, payment));
813196
+ __privateGet6(this, _data).gasConfig.payment = payments6.map((payment) => parse12(ObjectRefSchema, payment));
813107
813197
  }
813108
813198
  /** @deprecated Use `getData()` instead. */
813109
813199
  get blockData() {
@@ -813281,7 +813371,7 @@ var _Transaction = class _Transaction2 {
813281
813371
  const fullyResolved = this.isFullyResolved();
813282
813372
  return JSON.stringify(
813283
813373
  parse12(
813284
- SerializedTransactionDataV2,
813374
+ SerializedTransactionDataV2Schema,
813285
813375
  fullyResolved ? {
813286
813376
  ...__privateGet6(this, _data).snapshot(),
813287
813377
  digest: __privateGet6(this, _data).getDigest()
@@ -813424,9 +813514,9 @@ resolveArgument_fn = function(arg) {
813424
813514
  if (typeof resolved === "function") {
813425
813515
  return __privateMethod4(this, _Transaction_instances, resolveArgument_fn).call(this, resolved);
813426
813516
  }
813427
- return parse12(Argument2, resolved);
813517
+ return parse12(ArgumentSchema, resolved);
813428
813518
  }
813429
- return parse12(Argument2, arg);
813519
+ return parse12(ArgumentSchema, arg);
813430
813520
  };
813431
813521
  prepareBuild_fn = async function(options24) {
813432
813522
  if (!options24.onlyTransactionKind && !__privateGet6(this, _data).sender) {
@@ -813435,35 +813525,38 @@ prepareBuild_fn = async function(options24) {
813435
813525
  await __privateMethod4(this, _Transaction_instances, runPlugins_fn).call(this, [...__privateGet6(this, _buildPlugins), resolveTransactionPlugin], options24);
813436
813526
  };
813437
813527
  runPlugins_fn = async function(plugins, options24) {
813438
- const createNext = (i54) => {
813439
- if (i54 >= plugins.length) {
813440
- return () => {
813441
- };
813442
- }
813443
- const plugin = plugins[i54];
813444
- return async () => {
813445
- const next = createNext(i54 + 1);
813446
- let calledNext = false;
813447
- let nextResolved = false;
813448
- await plugin(__privateGet6(this, _data), options24, async () => {
813449
- if (calledNext) {
813450
- throw new Error(`next() was call multiple times in TransactionPlugin ${i54}`);
813451
- }
813452
- calledNext = true;
813453
- await next();
813454
- nextResolved = true;
813455
- });
813456
- if (!calledNext) {
813457
- throw new Error(`next() was not called in TransactionPlugin ${i54}`);
813458
- }
813459
- if (!nextResolved) {
813460
- throw new Error(`next() was not awaited in TransactionPlugin ${i54}`);
813528
+ try {
813529
+ const createNext = (i54) => {
813530
+ if (i54 >= plugins.length) {
813531
+ return () => {
813532
+ };
813461
813533
  }
813534
+ const plugin = plugins[i54];
813535
+ return async () => {
813536
+ const next = createNext(i54 + 1);
813537
+ let calledNext = false;
813538
+ let nextResolved = false;
813539
+ await plugin(__privateGet6(this, _data), options24, async () => {
813540
+ if (calledNext) {
813541
+ throw new Error(`next() was call multiple times in TransactionPlugin ${i54}`);
813542
+ }
813543
+ calledNext = true;
813544
+ await next();
813545
+ nextResolved = true;
813546
+ });
813547
+ if (!calledNext) {
813548
+ throw new Error(`next() was not called in TransactionPlugin ${i54}`);
813549
+ }
813550
+ if (!nextResolved) {
813551
+ throw new Error(`next() was not awaited in TransactionPlugin ${i54}`);
813552
+ }
813553
+ };
813462
813554
  };
813463
- };
813464
- await createNext(0)();
813465
- __privateSet6(this, _inputSection, __privateGet6(this, _data).inputs.slice());
813466
- __privateSet6(this, _commandSection, __privateGet6(this, _data).commands.slice());
813555
+ await createNext(0)();
813556
+ } finally {
813557
+ __privateSet6(this, _inputSection, __privateGet6(this, _data).inputs.slice());
813558
+ __privateSet6(this, _commandSection, __privateGet6(this, _data).commands.slice());
813559
+ }
813467
813560
  };
813468
813561
  waitForPendingTasks_fn = async function() {
813469
813562
  while (__privateGet6(this, _pendingPromises).size > 0) {
@@ -813535,7 +813628,7 @@ sortCommandsAndInputs_fn = function() {
813535
813628
  };
813536
813629
  var Transaction7 = _Transaction;
813537
813630
 
813538
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/core.js
813631
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/core.js
813539
813632
  var DEFAULT_MVR_URLS = {
813540
813633
  mainnet: "https://mainnet.mvr.mystenlabs.com",
813541
813634
  testnet: "https://testnet.mvr.mystenlabs.com"
@@ -813620,7 +813713,7 @@ var Experimental_CoreClient = class extends Experimental_BaseClient {
813620
813713
  }
813621
813714
  };
813622
813715
 
813623
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/errors.js
813716
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/errors.js
813624
813717
  var SuiClientError = class extends Error {
813625
813718
  };
813626
813719
  var ObjectError = class _ObjectError extends SuiClientError {
@@ -813651,7 +813744,7 @@ var ObjectError = class _ObjectError extends SuiClientError {
813651
813744
  }
813652
813745
  };
813653
813746
 
813654
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/utils.js
813747
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/utils.js
813655
813748
  function parseTransactionBcs(bytes5) {
813656
813749
  return {
813657
813750
  ...TransactionDataBuilder.fromBytes(bytes5).snapshot(),
@@ -813727,7 +813820,7 @@ function parseTransactionEffectsV2({
813727
813820
  };
813728
813821
  }
813729
813822
 
813730
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/jsonRPC.js
813823
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/experimental/transports/jsonRPC.js
813731
813824
  var __typeError7 = (msg) => {
813732
813825
  throw TypeError(msg);
813733
813826
  };
@@ -814185,7 +814278,7 @@ var Coin = suiBcs.struct("Coin", {
814185
814278
  balance: Balance
814186
814279
  });
814187
814280
 
814188
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/client.js
814281
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/client/client.js
814189
814282
  var SUI_CLIENT_BRAND = Symbol.for("@mysten/SuiClient");
814190
814283
  var SuiClient = class extends Experimental_BaseClient {
814191
814284
  /**
@@ -815026,6 +815119,518 @@ var hydrate10 = (data12) => {
815026
815119
  // ../../libs/coin-modules/coin-sui/lib-es/constants.js
815027
815120
  var ONE_SUI = 1e9;
815028
815121
 
815122
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/publickey.js
815123
+ init_utils2();
815124
+
815125
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/intent.js
815126
+ function messageWithIntent(scope, message2) {
815127
+ return suiBcs.IntentMessage(suiBcs.fixedArray(message2.length, suiBcs.u8())).serialize({
815128
+ intent: {
815129
+ scope: { [scope]: true },
815130
+ version: { V0: true },
815131
+ appId: { Sui: true }
815132
+ },
815133
+ value: message2
815134
+ }).toBytes();
815135
+ }
815136
+
815137
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/signature-scheme.js
815138
+ var SIGNATURE_SCHEME_TO_FLAG = {
815139
+ ED25519: 0,
815140
+ Secp256k1: 1,
815141
+ Secp256r1: 2,
815142
+ MultiSig: 3,
815143
+ ZkLogin: 5,
815144
+ Passkey: 6
815145
+ };
815146
+ var SIGNATURE_SCHEME_TO_SIZE = {
815147
+ ED25519: 32,
815148
+ Secp256k1: 33,
815149
+ Secp256r1: 33,
815150
+ Passkey: 33
815151
+ };
815152
+ var SIGNATURE_FLAG_TO_SCHEME = {
815153
+ 0: "ED25519",
815154
+ 1: "Secp256k1",
815155
+ 2: "Secp256r1",
815156
+ 3: "MultiSig",
815157
+ 5: "ZkLogin",
815158
+ 6: "Passkey"
815159
+ };
815160
+
815161
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/publickey.js
815162
+ function bytesEqual2(a65, b20) {
815163
+ if (a65 === b20)
815164
+ return true;
815165
+ if (a65.length !== b20.length) {
815166
+ return false;
815167
+ }
815168
+ for (let i54 = 0; i54 < a65.length; i54++) {
815169
+ if (a65[i54] !== b20[i54]) {
815170
+ return false;
815171
+ }
815172
+ }
815173
+ return true;
815174
+ }
815175
+ var PublicKey10 = class {
815176
+ /**
815177
+ * Checks if two public keys are equal
815178
+ */
815179
+ equals(publicKey3) {
815180
+ return bytesEqual2(this.toRawBytes(), publicKey3.toRawBytes());
815181
+ }
815182
+ /**
815183
+ * Return the base-64 representation of the public key
815184
+ */
815185
+ toBase64() {
815186
+ return toBase64(this.toRawBytes());
815187
+ }
815188
+ toString() {
815189
+ throw new Error(
815190
+ "`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead."
815191
+ );
815192
+ }
815193
+ /**
815194
+ * Return the Sui representation of the public key encoded in
815195
+ * base-64. A Sui public key is formed by the concatenation
815196
+ * of the scheme flag with the raw bytes of the public key
815197
+ */
815198
+ toSuiPublicKey() {
815199
+ const bytes5 = this.toSuiBytes();
815200
+ return toBase64(bytes5);
815201
+ }
815202
+ verifyWithIntent(bytes5, signature4, intent) {
815203
+ const intentMessage = messageWithIntent(intent, bytes5);
815204
+ const digest3 = blake2b2(intentMessage, { dkLen: 32 });
815205
+ return this.verify(digest3, signature4);
815206
+ }
815207
+ /**
815208
+ * Verifies that the signature is valid for for the provided PersonalMessage
815209
+ */
815210
+ verifyPersonalMessage(message2, signature4) {
815211
+ return this.verifyWithIntent(
815212
+ suiBcs.vector(suiBcs.u8()).serialize(message2).toBytes(),
815213
+ signature4,
815214
+ "PersonalMessage"
815215
+ );
815216
+ }
815217
+ /**
815218
+ * Verifies that the signature is valid for for the provided Transaction
815219
+ */
815220
+ verifyTransaction(transaction, signature4) {
815221
+ return this.verifyWithIntent(transaction, signature4, "TransactionData");
815222
+ }
815223
+ /**
815224
+ * Verifies that the public key is associated with the provided address
815225
+ */
815226
+ verifyAddress(address3) {
815227
+ return this.toSuiAddress() === address3;
815228
+ }
815229
+ /**
815230
+ * Returns the bytes representation of the public key
815231
+ * prefixed with the signature scheme flag
815232
+ */
815233
+ toSuiBytes() {
815234
+ const rawBytes = this.toRawBytes();
815235
+ const suiBytes = new Uint8Array(rawBytes.length + 1);
815236
+ suiBytes.set([this.flag()]);
815237
+ suiBytes.set(rawBytes, 1);
815238
+ return suiBytes;
815239
+ }
815240
+ /**
815241
+ * Return the Sui address associated with this Ed25519 public key
815242
+ */
815243
+ toSuiAddress() {
815244
+ return normalizeSuiAddress(
815245
+ bytesToHex(blake2b2(this.toSuiBytes(), { dkLen: 32 })).slice(0, SUI_ADDRESS_LENGTH * 2)
815246
+ );
815247
+ }
815248
+ };
815249
+ function parseSerializedKeypairSignature(serializedSignature) {
815250
+ const bytes5 = fromBase64(serializedSignature);
815251
+ const signatureScheme = SIGNATURE_FLAG_TO_SCHEME[bytes5[0]];
815252
+ switch (signatureScheme) {
815253
+ case "ED25519":
815254
+ case "Secp256k1":
815255
+ case "Secp256r1":
815256
+ const size3 = SIGNATURE_SCHEME_TO_SIZE[signatureScheme];
815257
+ const signature4 = bytes5.slice(1, bytes5.length - size3);
815258
+ const publicKey3 = bytes5.slice(1 + signature4.length);
815259
+ return {
815260
+ serializedSignature,
815261
+ signatureScheme,
815262
+ signature: signature4,
815263
+ publicKey: publicKey3,
815264
+ bytes: bytes5
815265
+ };
815266
+ default:
815267
+ throw new Error("Unsupported signature scheme");
815268
+ }
815269
+ }
815270
+
815271
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/signature.js
815272
+ function toSerializedSignature({
815273
+ signature: signature4,
815274
+ signatureScheme,
815275
+ publicKey: publicKey3
815276
+ }) {
815277
+ if (!publicKey3) {
815278
+ throw new Error("`publicKey` is required");
815279
+ }
815280
+ const pubKeyBytes = publicKey3.toRawBytes();
815281
+ const serializedSignature = new Uint8Array(1 + signature4.length + pubKeyBytes.length);
815282
+ serializedSignature.set([SIGNATURE_SCHEME_TO_FLAG[signatureScheme]]);
815283
+ serializedSignature.set(signature4, 1);
815284
+ serializedSignature.set(pubKeyBytes, 1 + signature4.length);
815285
+ return toBase64(serializedSignature);
815286
+ }
815287
+
815288
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/keypair.js
815289
+ var Signer = class {
815290
+ /**
815291
+ * Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing,
815292
+ * it ensures that a signed message is tied to a specific purpose and domain separator is provided
815293
+ */
815294
+ async signWithIntent(bytes5, intent) {
815295
+ const intentMessage = messageWithIntent(intent, bytes5);
815296
+ const digest3 = blake2b2(intentMessage, { dkLen: 32 });
815297
+ const signature4 = toSerializedSignature({
815298
+ signature: await this.sign(digest3),
815299
+ signatureScheme: this.getKeyScheme(),
815300
+ publicKey: this.getPublicKey()
815301
+ });
815302
+ return {
815303
+ signature: signature4,
815304
+ bytes: toBase64(bytes5)
815305
+ };
815306
+ }
815307
+ /**
815308
+ * Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope
815309
+ */
815310
+ async signTransaction(bytes5) {
815311
+ return this.signWithIntent(bytes5, "TransactionData");
815312
+ }
815313
+ /**
815314
+ * Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope
815315
+ */
815316
+ async signPersonalMessage(bytes5) {
815317
+ const { signature: signature4 } = await this.signWithIntent(
815318
+ bcs.vector(bcs.u8()).serialize(bytes5).toBytes(),
815319
+ "PersonalMessage"
815320
+ );
815321
+ return {
815322
+ bytes: toBase64(bytes5),
815323
+ signature: signature4
815324
+ };
815325
+ }
815326
+ async signAndExecuteTransaction({
815327
+ transaction,
815328
+ client
815329
+ }) {
815330
+ const bytes5 = await transaction.build({ client });
815331
+ const { signature: signature4 } = await this.signTransaction(bytes5);
815332
+ const response = await client.core.executeTransaction({
815333
+ transaction: bytes5,
815334
+ signatures: [signature4]
815335
+ });
815336
+ return response.transaction;
815337
+ }
815338
+ toSuiAddress() {
815339
+ return this.getPublicKey().toSuiAddress();
815340
+ }
815341
+ };
815342
+
815343
+ // ../../node_modules/.pnpm/@mysten+sui@1.38.0_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/keypairs/ed25519/publickey.js
815344
+ var PUBLIC_KEY_SIZE = 32;
815345
+ var Ed25519PublicKey3 = class extends PublicKey10 {
815346
+ /**
815347
+ * Create a new Ed25519PublicKey object
815348
+ * @param value ed25519 public key as buffer or base-64 encoded string
815349
+ */
815350
+ constructor(value5) {
815351
+ super();
815352
+ if (typeof value5 === "string") {
815353
+ this.data = fromBase64(value5);
815354
+ } else if (value5 instanceof Uint8Array) {
815355
+ this.data = value5;
815356
+ } else {
815357
+ this.data = Uint8Array.from(value5);
815358
+ }
815359
+ if (this.data.length !== PUBLIC_KEY_SIZE) {
815360
+ throw new Error(
815361
+ `Invalid public key input. Expected ${PUBLIC_KEY_SIZE} bytes, got ${this.data.length}`
815362
+ );
815363
+ }
815364
+ }
815365
+ /**
815366
+ * Checks if two Ed25519 public keys are equal
815367
+ */
815368
+ equals(publicKey3) {
815369
+ return super.equals(publicKey3);
815370
+ }
815371
+ /**
815372
+ * Return the byte array representation of the Ed25519 public key
815373
+ */
815374
+ toRawBytes() {
815375
+ return this.data;
815376
+ }
815377
+ /**
815378
+ * Return the Sui address associated with this Ed25519 public key
815379
+ */
815380
+ flag() {
815381
+ return SIGNATURE_SCHEME_TO_FLAG["ED25519"];
815382
+ }
815383
+ /**
815384
+ * Verifies that the signature is valid for for the provided message
815385
+ */
815386
+ async verify(message2, signature4) {
815387
+ let bytes5;
815388
+ if (typeof signature4 === "string") {
815389
+ const parsed2 = parseSerializedKeypairSignature(signature4);
815390
+ if (parsed2.signatureScheme !== "ED25519") {
815391
+ throw new Error("Invalid signature scheme");
815392
+ }
815393
+ if (!bytesEqual2(this.toRawBytes(), parsed2.publicKey)) {
815394
+ throw new Error("Signature does not match public key");
815395
+ }
815396
+ bytes5 = parsed2.signature;
815397
+ } else {
815398
+ bytes5 = signature4;
815399
+ }
815400
+ return ed25519.verify(bytes5, message2, this.toRawBytes());
815401
+ }
815402
+ };
815403
+ Ed25519PublicKey3.SIZE = PUBLIC_KEY_SIZE;
815404
+
815405
+ // ../../node_modules/.pnpm/@mysten+signers@0.5.0_typescript@5.4.3/node_modules/@mysten/signers/dist/esm/ledger/bcs.js
815406
+ var SUI_FRAMEWORK_ADDRESS2 = normalizeSuiAddress("0x2");
815407
+ var SUI_SYSTEM_ADDRESS2 = normalizeSuiAddress("0x3");
815408
+ var MoveObjectType = suiBcs.enum("MoveObjectType", {
815409
+ Other: suiBcs.StructTag,
815410
+ GasCoin: null,
815411
+ StakedSui: null,
815412
+ Coin: suiBcs.TypeTag
815413
+ });
815414
+ var SuiMoveObject = suiBcs.struct("SuiMoveObject", {
815415
+ data: suiBcs.enum("Data", {
815416
+ MoveObject: suiBcs.struct("MoveObject", {
815417
+ type: MoveObjectType.transform({
815418
+ input: (objectType3) => {
815419
+ const structTag = parseStructTag(objectType3);
815420
+ if (structTag.address === SUI_FRAMEWORK_ADDRESS2 && structTag.module === "coin" && structTag.name === "Coin" && typeof structTag.typeParams[0] === "object") {
815421
+ const innerStructTag = structTag.typeParams[0];
815422
+ if (innerStructTag.address === SUI_FRAMEWORK_ADDRESS2 && innerStructTag.module === "sui" && innerStructTag.name === "SUI") {
815423
+ return { GasCoin: true, $kind: "GasCoin" };
815424
+ }
815425
+ return { Coin: normalizeStructTag(innerStructTag), $kind: "Coin" };
815426
+ } else if (structTag.address === SUI_SYSTEM_ADDRESS2 && structTag.module === "staking_pool" && structTag.name === "StakedSui") {
815427
+ return { StakedSui: true, $kind: "StakedSui" };
815428
+ }
815429
+ return {
815430
+ Other: {
815431
+ ...structTag,
815432
+ typeParams: structTag.typeParams.map((typeParam) => {
815433
+ return TypeTagSerializer.parseFromStr(normalizeStructTag(typeParam));
815434
+ })
815435
+ },
815436
+ $kind: "Other"
815437
+ };
815438
+ }
815439
+ }),
815440
+ hasPublicTransfer: suiBcs.bool(),
815441
+ version: suiBcs.u64(),
815442
+ contents: suiBcs.byteVector().transform({ input: fromBase64 })
815443
+ })
815444
+ }),
815445
+ owner: suiBcs.Owner.transform({
815446
+ input: (objectOwner) => {
815447
+ if (objectOwner === "Immutable") {
815448
+ return { Immutable: null };
815449
+ } else if ("Shared" in objectOwner) {
815450
+ return { Shared: { initialSharedVersion: objectOwner.Shared.initial_shared_version } };
815451
+ } else if ("ConsensusAddressOwner" in objectOwner) {
815452
+ return {
815453
+ ConsensusAddressOwner: {
815454
+ owner: objectOwner.ConsensusAddressOwner.owner,
815455
+ startVersion: objectOwner.ConsensusAddressOwner.start_version
815456
+ }
815457
+ };
815458
+ }
815459
+ return objectOwner;
815460
+ }
815461
+ }),
815462
+ previousTransaction: suiBcs.ObjectDigest,
815463
+ storageRebate: suiBcs.u64()
815464
+ });
815465
+
815466
+ // ../../node_modules/.pnpm/@mysten+signers@0.5.0_typescript@5.4.3/node_modules/@mysten/signers/dist/esm/ledger/objects.js
815467
+ var getInputObjects = async (transaction, client) => {
815468
+ const data12 = transaction.getData();
815469
+ const gasObjectIds = data12.gasData.payment?.map((object7) => object7.objectId) ?? [];
815470
+ const inputObjectIds = data12.inputs.map((input) => {
815471
+ return input.$kind === "Object" && input.Object.$kind === "ImmOrOwnedObject" ? input.Object.ImmOrOwnedObject.objectId : null;
815472
+ }).filter((objectId) => !!objectId);
815473
+ const objects = await client.multiGetObjects({
815474
+ ids: [...gasObjectIds, ...inputObjectIds],
815475
+ options: {
815476
+ showBcs: true,
815477
+ showPreviousTransaction: true,
815478
+ showStorageRebate: true,
815479
+ showOwner: true
815480
+ }
815481
+ });
815482
+ const bcsObjects = objects.map((object7) => {
815483
+ if (object7.error || !object7.data || object7.data.bcs?.dataType !== "moveObject") {
815484
+ return null;
815485
+ }
815486
+ return SuiMoveObject.serialize({
815487
+ data: {
815488
+ MoveObject: {
815489
+ type: object7.data.bcs.type,
815490
+ hasPublicTransfer: object7.data.bcs.hasPublicTransfer,
815491
+ version: object7.data.bcs.version,
815492
+ contents: object7.data.bcs.bcsBytes
815493
+ }
815494
+ },
815495
+ owner: object7.data.owner,
815496
+ previousTransaction: object7.data.previousTransaction,
815497
+ storageRebate: object7.data.storageRebate
815498
+ }).toBytes();
815499
+ }).filter((bcsBytes) => !!bcsBytes);
815500
+ return { bcsObjects };
815501
+ };
815502
+
815503
+ // ../../node_modules/.pnpm/@mysten+signers@0.5.0_typescript@5.4.3/node_modules/@mysten/signers/dist/esm/ledger/index.js
815504
+ var __typeError8 = (msg) => {
815505
+ throw TypeError(msg);
815506
+ };
815507
+ var __accessCheck8 = (obj2, member2, msg) => member2.has(obj2) || __typeError8("Cannot " + msg);
815508
+ var __privateGet8 = (obj2, member2, getter) => (__accessCheck8(obj2, member2, "read from private field"), getter ? getter.call(obj2) : member2.get(obj2));
815509
+ var __privateAdd8 = (obj2, member2, value5) => member2.has(obj2) ? __typeError8("Cannot add the same private member more than once") : member2 instanceof WeakSet ? member2.add(obj2) : member2.set(obj2, value5);
815510
+ var __privateSet8 = (obj2, member2, value5, setter) => (__accessCheck8(obj2, member2, "write to private field"), setter ? setter.call(obj2, value5) : member2.set(obj2, value5), value5);
815511
+ var _derivationPath;
815512
+ var _publicKey;
815513
+ var _ledgerClient;
815514
+ var _suiClient;
815515
+ var _LedgerSigner = class _LedgerSigner2 extends Signer {
815516
+ /**
815517
+ * Creates an instance of LedgerSigner. It's expected to call the static `fromDerivationPath` method to create an instance.
815518
+ * @example
815519
+ * ```
815520
+ * const signer = await LedgerSigner.fromDerivationPath(derivationPath, options);
815521
+ * ```
815522
+ */
815523
+ constructor({ publicKey: publicKey3, derivationPath, ledgerClient, suiClient }) {
815524
+ super();
815525
+ __privateAdd8(this, _derivationPath);
815526
+ __privateAdd8(this, _publicKey);
815527
+ __privateAdd8(this, _ledgerClient);
815528
+ __privateAdd8(this, _suiClient);
815529
+ __privateSet8(this, _publicKey, publicKey3);
815530
+ __privateSet8(this, _derivationPath, derivationPath);
815531
+ __privateSet8(this, _ledgerClient, ledgerClient);
815532
+ __privateSet8(this, _suiClient, suiClient);
815533
+ }
815534
+ /**
815535
+ * Retrieves the key scheme used by this signer.
815536
+ */
815537
+ getKeyScheme() {
815538
+ return "ED25519";
815539
+ }
815540
+ /**
815541
+ * Retrieves the public key associated with this signer.
815542
+ * @returns The Ed25519PublicKey instance.
815543
+ */
815544
+ getPublicKey() {
815545
+ return __privateGet8(this, _publicKey);
815546
+ }
815547
+ /**
815548
+ * Signs the provided transaction bytes.
815549
+ * @returns The signed transaction bytes and signature.
815550
+ */
815551
+ async signTransaction(bytes5) {
815552
+ const transactionOptions = await getInputObjects(
815553
+ Transaction7.from(bytes5),
815554
+ __privateGet8(this, _suiClient)
815555
+ ).catch(() => ({
815556
+ // Fail gracefully so network errors or serialization issues don't break transaction signing:
815557
+ bcsObjects: []
815558
+ }));
815559
+ const intentMessage = messageWithIntent("TransactionData", bytes5);
815560
+ const { signature: signature4 } = await __privateGet8(this, _ledgerClient).signTransaction(
815561
+ __privateGet8(this, _derivationPath),
815562
+ intentMessage,
815563
+ transactionOptions
815564
+ );
815565
+ return {
815566
+ bytes: toBase64(bytes5),
815567
+ signature: toSerializedSignature({
815568
+ signature: signature4,
815569
+ signatureScheme: this.getKeyScheme(),
815570
+ publicKey: __privateGet8(this, _publicKey)
815571
+ })
815572
+ };
815573
+ }
815574
+ /**
815575
+ * Signs the provided personal message.
815576
+ * @returns The signed message bytes and signature.
815577
+ */
815578
+ async signPersonalMessage(bytes5) {
815579
+ const intentMessage = messageWithIntent(
815580
+ "PersonalMessage",
815581
+ suiBcs.byteVector().serialize(bytes5).toBytes()
815582
+ );
815583
+ const { signature: signature4 } = await __privateGet8(this, _ledgerClient).signTransaction(
815584
+ __privateGet8(this, _derivationPath),
815585
+ intentMessage
815586
+ );
815587
+ return {
815588
+ bytes: toBase64(bytes5),
815589
+ signature: toSerializedSignature({
815590
+ signature: signature4,
815591
+ signatureScheme: this.getKeyScheme(),
815592
+ publicKey: __privateGet8(this, _publicKey)
815593
+ })
815594
+ };
815595
+ }
815596
+ /**
815597
+ * Prepares the signer by fetching and setting the public key from a Ledger device.
815598
+ * It is recommended to initialize an `LedgerSigner` instance using this function.
815599
+ * @returns A promise that resolves once a `LedgerSigner` instance is prepared (public key is set).
815600
+ */
815601
+ static async fromDerivationPath(derivationPath, ledgerClient, suiClient) {
815602
+ const { publicKey: publicKey3 } = await ledgerClient.getPublicKey(derivationPath);
815603
+ if (!publicKey3) {
815604
+ throw new Error("Failed to get public key from Ledger.");
815605
+ }
815606
+ return new _LedgerSigner2({
815607
+ derivationPath,
815608
+ publicKey: new Ed25519PublicKey3(publicKey3),
815609
+ ledgerClient,
815610
+ suiClient
815611
+ });
815612
+ }
815613
+ /**
815614
+ * Generic signing is not supported by Ledger.
815615
+ * @throws Always throws an error indicating generic signing is unsupported.
815616
+ */
815617
+ sign() {
815618
+ throw new Error("Ledger Signer does not support generic signing.");
815619
+ }
815620
+ /**
815621
+ * Generic signing is not supported by Ledger.
815622
+ * @throws Always throws an error indicating generic signing is unsupported.
815623
+ */
815624
+ signWithIntent() {
815625
+ throw new Error("Ledger Signer does not support generic signing.");
815626
+ }
815627
+ };
815628
+ _derivationPath = /* @__PURE__ */ new WeakMap();
815629
+ _publicKey = /* @__PURE__ */ new WeakMap();
815630
+ _ledgerClient = /* @__PURE__ */ new WeakMap();
815631
+ _suiClient = /* @__PURE__ */ new WeakMap();
815632
+ var LedgerSigner = _LedgerSigner;
815633
+
815029
815634
  // ../../libs/coin-modules/coin-sui/lib-es/network/sdk.js
815030
815635
  var apiMap = {};
815031
815636
  var TRANSACTIONS_LIMIT_PER_QUERY = 50;
@@ -815324,7 +815929,7 @@ var getCoinsForAmount = async (api7, address3, coinType, requiredAmount) => {
815324
815929
  }
815325
815930
  return coins;
815326
815931
  };
815327
- var createTransaction25 = async (address3, transaction) => withApi2(async (api7) => {
815932
+ var createTransaction25 = async (address3, transaction, withObjects = false) => withApi2(async (api7) => {
815328
815933
  const tx = new Transaction7();
815329
815934
  tx.setSender(ensureAddressFormat(address3));
815330
815935
  const { mode, amount } = transaction;
@@ -815380,10 +815985,15 @@ var createTransaction25 = async (address3, transaction) => withApi2(async (api7)
815380
815985
  }
815381
815986
  }
815382
815987
  }
815383
- return tx.build({ client: api7 });
815988
+ const serialized = await tx.build({ client: api7 });
815989
+ if (withObjects) {
815990
+ const { bcsObjects } = await getInputObjects(tx, api7);
815991
+ return { unsigned: serialized, objects: bcsObjects };
815992
+ }
815993
+ return { unsigned: serialized };
815384
815994
  });
815385
815995
  var paymentInfo3 = async (sender, fakeTransaction) => withApi2(async (api7) => {
815386
- const txb = await createTransaction25(sender, fakeTransaction);
815996
+ const { unsigned: txb } = await createTransaction25(sender, fakeTransaction);
815387
815997
  const dryRunTxResponse = await api7.dryRunTransactionBlock({ transactionBlock: txb });
815388
815998
  const fees2 = getTotalGasUsed(dryRunTxResponse.effects);
815389
815999
  return {
@@ -815511,19 +816121,18 @@ var network_default3 = {
815511
816121
  };
815512
816122
 
815513
816123
  // ../../libs/coin-modules/coin-sui/lib-es/logic/craftTransaction.js
815514
- async function craftTransaction5({ amount, asset, recipient, sender, type: type4, ...extra }) {
816124
+ async function craftTransaction5({ amount, asset, recipient, sender, type: type4, ...extra }, withObjects = false) {
815515
816125
  let coinType = DEFAULT_COIN_TYPE;
815516
816126
  if (asset.type === "token" && asset.assetReference) {
815517
816127
  coinType = asset.assetReference;
815518
816128
  }
815519
- const unsigned2 = await network_default3.createTransaction(sender, {
816129
+ return network_default3.createTransaction(sender, {
815520
816130
  amount: (0, import_bignumber302.default)(amount.toString()),
815521
816131
  coinType,
815522
816132
  mode: type4,
815523
816133
  recipient,
815524
816134
  ...extra
815525
- });
815526
- return { unsigned: unsigned2 };
816135
+ }, withObjects);
815527
816136
  }
815528
816137
 
815529
816138
  // ../../libs/coin-modules/coin-sui/lib-es/logic/estimateFees.js
@@ -815908,519 +816517,6 @@ var import_bignumber311 = require("bignumber.js");
815908
816517
  var import_rxjs148 = require("rxjs");
815909
816518
  init_lib_es();
815910
816519
 
815911
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/publickey.js
815912
- init_utils2();
815913
-
815914
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/intent.js
815915
- function messageWithIntent(scope, message2) {
815916
- return suiBcs.IntentMessage(suiBcs.fixedArray(message2.length, suiBcs.u8())).serialize({
815917
- intent: {
815918
- scope: { [scope]: true },
815919
- version: { V0: true },
815920
- appId: { Sui: true }
815921
- },
815922
- value: message2
815923
- }).toBytes();
815924
- }
815925
-
815926
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/signature-scheme.js
815927
- var SIGNATURE_SCHEME_TO_FLAG = {
815928
- ED25519: 0,
815929
- Secp256k1: 1,
815930
- Secp256r1: 2,
815931
- MultiSig: 3,
815932
- ZkLogin: 5,
815933
- Passkey: 6
815934
- };
815935
- var SIGNATURE_SCHEME_TO_SIZE = {
815936
- ED25519: 32,
815937
- Secp256k1: 33,
815938
- Secp256r1: 33,
815939
- Passkey: 33
815940
- };
815941
- var SIGNATURE_FLAG_TO_SCHEME = {
815942
- 0: "ED25519",
815943
- 1: "Secp256k1",
815944
- 2: "Secp256r1",
815945
- 3: "MultiSig",
815946
- 5: "ZkLogin",
815947
- 6: "Passkey"
815948
- };
815949
-
815950
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/publickey.js
815951
- function bytesEqual2(a65, b20) {
815952
- if (a65 === b20)
815953
- return true;
815954
- if (a65.length !== b20.length) {
815955
- return false;
815956
- }
815957
- for (let i54 = 0; i54 < a65.length; i54++) {
815958
- if (a65[i54] !== b20[i54]) {
815959
- return false;
815960
- }
815961
- }
815962
- return true;
815963
- }
815964
- var PublicKey10 = class {
815965
- /**
815966
- * Checks if two public keys are equal
815967
- */
815968
- equals(publicKey3) {
815969
- return bytesEqual2(this.toRawBytes(), publicKey3.toRawBytes());
815970
- }
815971
- /**
815972
- * Return the base-64 representation of the public key
815973
- */
815974
- toBase64() {
815975
- return toBase64(this.toRawBytes());
815976
- }
815977
- toString() {
815978
- throw new Error(
815979
- "`toString` is not implemented on public keys. Use `toBase64()` or `toRawBytes()` instead."
815980
- );
815981
- }
815982
- /**
815983
- * Return the Sui representation of the public key encoded in
815984
- * base-64. A Sui public key is formed by the concatenation
815985
- * of the scheme flag with the raw bytes of the public key
815986
- */
815987
- toSuiPublicKey() {
815988
- const bytes5 = this.toSuiBytes();
815989
- return toBase64(bytes5);
815990
- }
815991
- verifyWithIntent(bytes5, signature4, intent) {
815992
- const intentMessage = messageWithIntent(intent, bytes5);
815993
- const digest3 = blake2b2(intentMessage, { dkLen: 32 });
815994
- return this.verify(digest3, signature4);
815995
- }
815996
- /**
815997
- * Verifies that the signature is valid for for the provided PersonalMessage
815998
- */
815999
- verifyPersonalMessage(message2, signature4) {
816000
- return this.verifyWithIntent(
816001
- suiBcs.vector(suiBcs.u8()).serialize(message2).toBytes(),
816002
- signature4,
816003
- "PersonalMessage"
816004
- );
816005
- }
816006
- /**
816007
- * Verifies that the signature is valid for for the provided Transaction
816008
- */
816009
- verifyTransaction(transaction, signature4) {
816010
- return this.verifyWithIntent(transaction, signature4, "TransactionData");
816011
- }
816012
- /**
816013
- * Verifies that the public key is associated with the provided address
816014
- */
816015
- verifyAddress(address3) {
816016
- return this.toSuiAddress() === address3;
816017
- }
816018
- /**
816019
- * Returns the bytes representation of the public key
816020
- * prefixed with the signature scheme flag
816021
- */
816022
- toSuiBytes() {
816023
- const rawBytes = this.toRawBytes();
816024
- const suiBytes = new Uint8Array(rawBytes.length + 1);
816025
- suiBytes.set([this.flag()]);
816026
- suiBytes.set(rawBytes, 1);
816027
- return suiBytes;
816028
- }
816029
- /**
816030
- * Return the Sui address associated with this Ed25519 public key
816031
- */
816032
- toSuiAddress() {
816033
- return normalizeSuiAddress(
816034
- bytesToHex(blake2b2(this.toSuiBytes(), { dkLen: 32 })).slice(0, SUI_ADDRESS_LENGTH * 2)
816035
- );
816036
- }
816037
- };
816038
- function parseSerializedKeypairSignature(serializedSignature) {
816039
- const bytes5 = fromBase64(serializedSignature);
816040
- const signatureScheme = SIGNATURE_FLAG_TO_SCHEME[bytes5[0]];
816041
- switch (signatureScheme) {
816042
- case "ED25519":
816043
- case "Secp256k1":
816044
- case "Secp256r1":
816045
- const size3 = SIGNATURE_SCHEME_TO_SIZE[signatureScheme];
816046
- const signature4 = bytes5.slice(1, bytes5.length - size3);
816047
- const publicKey3 = bytes5.slice(1 + signature4.length);
816048
- return {
816049
- serializedSignature,
816050
- signatureScheme,
816051
- signature: signature4,
816052
- publicKey: publicKey3,
816053
- bytes: bytes5
816054
- };
816055
- default:
816056
- throw new Error("Unsupported signature scheme");
816057
- }
816058
- }
816059
-
816060
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/signature.js
816061
- function toSerializedSignature({
816062
- signature: signature4,
816063
- signatureScheme,
816064
- publicKey: publicKey3
816065
- }) {
816066
- if (!publicKey3) {
816067
- throw new Error("`publicKey` is required");
816068
- }
816069
- const pubKeyBytes = publicKey3.toRawBytes();
816070
- const serializedSignature = new Uint8Array(1 + signature4.length + pubKeyBytes.length);
816071
- serializedSignature.set([SIGNATURE_SCHEME_TO_FLAG[signatureScheme]]);
816072
- serializedSignature.set(signature4, 1);
816073
- serializedSignature.set(pubKeyBytes, 1 + signature4.length);
816074
- return toBase64(serializedSignature);
816075
- }
816076
-
816077
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/cryptography/keypair.js
816078
- var Signer = class {
816079
- /**
816080
- * Sign messages with a specific intent. By combining the message bytes with the intent before hashing and signing,
816081
- * it ensures that a signed message is tied to a specific purpose and domain separator is provided
816082
- */
816083
- async signWithIntent(bytes5, intent) {
816084
- const intentMessage = messageWithIntent(intent, bytes5);
816085
- const digest3 = blake2b2(intentMessage, { dkLen: 32 });
816086
- const signature4 = toSerializedSignature({
816087
- signature: await this.sign(digest3),
816088
- signatureScheme: this.getKeyScheme(),
816089
- publicKey: this.getPublicKey()
816090
- });
816091
- return {
816092
- signature: signature4,
816093
- bytes: toBase64(bytes5)
816094
- };
816095
- }
816096
- /**
816097
- * Signs provided transaction by calling `signWithIntent()` with a `TransactionData` provided as intent scope
816098
- */
816099
- async signTransaction(bytes5) {
816100
- return this.signWithIntent(bytes5, "TransactionData");
816101
- }
816102
- /**
816103
- * Signs provided personal message by calling `signWithIntent()` with a `PersonalMessage` provided as intent scope
816104
- */
816105
- async signPersonalMessage(bytes5) {
816106
- const { signature: signature4 } = await this.signWithIntent(
816107
- bcs.vector(bcs.u8()).serialize(bytes5).toBytes(),
816108
- "PersonalMessage"
816109
- );
816110
- return {
816111
- bytes: toBase64(bytes5),
816112
- signature: signature4
816113
- };
816114
- }
816115
- async signAndExecuteTransaction({
816116
- transaction,
816117
- client
816118
- }) {
816119
- const bytes5 = await transaction.build({ client });
816120
- const { signature: signature4 } = await this.signTransaction(bytes5);
816121
- const response = await client.core.executeTransaction({
816122
- transaction: bytes5,
816123
- signatures: [signature4]
816124
- });
816125
- return response.transaction;
816126
- }
816127
- toSuiAddress() {
816128
- return this.getPublicKey().toSuiAddress();
816129
- }
816130
- };
816131
-
816132
- // ../../node_modules/.pnpm/@mysten+sui@1.37.1_typescript@5.4.3/node_modules/@mysten/sui/dist/esm/keypairs/ed25519/publickey.js
816133
- var PUBLIC_KEY_SIZE = 32;
816134
- var Ed25519PublicKey3 = class extends PublicKey10 {
816135
- /**
816136
- * Create a new Ed25519PublicKey object
816137
- * @param value ed25519 public key as buffer or base-64 encoded string
816138
- */
816139
- constructor(value5) {
816140
- super();
816141
- if (typeof value5 === "string") {
816142
- this.data = fromBase64(value5);
816143
- } else if (value5 instanceof Uint8Array) {
816144
- this.data = value5;
816145
- } else {
816146
- this.data = Uint8Array.from(value5);
816147
- }
816148
- if (this.data.length !== PUBLIC_KEY_SIZE) {
816149
- throw new Error(
816150
- `Invalid public key input. Expected ${PUBLIC_KEY_SIZE} bytes, got ${this.data.length}`
816151
- );
816152
- }
816153
- }
816154
- /**
816155
- * Checks if two Ed25519 public keys are equal
816156
- */
816157
- equals(publicKey3) {
816158
- return super.equals(publicKey3);
816159
- }
816160
- /**
816161
- * Return the byte array representation of the Ed25519 public key
816162
- */
816163
- toRawBytes() {
816164
- return this.data;
816165
- }
816166
- /**
816167
- * Return the Sui address associated with this Ed25519 public key
816168
- */
816169
- flag() {
816170
- return SIGNATURE_SCHEME_TO_FLAG["ED25519"];
816171
- }
816172
- /**
816173
- * Verifies that the signature is valid for for the provided message
816174
- */
816175
- async verify(message2, signature4) {
816176
- let bytes5;
816177
- if (typeof signature4 === "string") {
816178
- const parsed2 = parseSerializedKeypairSignature(signature4);
816179
- if (parsed2.signatureScheme !== "ED25519") {
816180
- throw new Error("Invalid signature scheme");
816181
- }
816182
- if (!bytesEqual2(this.toRawBytes(), parsed2.publicKey)) {
816183
- throw new Error("Signature does not match public key");
816184
- }
816185
- bytes5 = parsed2.signature;
816186
- } else {
816187
- bytes5 = signature4;
816188
- }
816189
- return ed25519.verify(bytes5, message2, this.toRawBytes());
816190
- }
816191
- };
816192
- Ed25519PublicKey3.SIZE = PUBLIC_KEY_SIZE;
816193
-
816194
- // ../../node_modules/.pnpm/@mysten+signers@0.3.4_typescript@5.4.3/node_modules/@mysten/signers/dist/esm/ledger/bcs.js
816195
- var SUI_FRAMEWORK_ADDRESS2 = normalizeSuiAddress("0x2");
816196
- var SUI_SYSTEM_ADDRESS2 = normalizeSuiAddress("0x3");
816197
- var MoveObjectType = suiBcs.enum("MoveObjectType", {
816198
- Other: suiBcs.StructTag,
816199
- GasCoin: null,
816200
- StakedSui: null,
816201
- Coin: suiBcs.TypeTag
816202
- });
816203
- var SuiMoveObject = suiBcs.struct("SuiMoveObject", {
816204
- data: suiBcs.enum("Data", {
816205
- MoveObject: suiBcs.struct("MoveObject", {
816206
- type: MoveObjectType.transform({
816207
- input: (objectType3) => {
816208
- const structTag = parseStructTag(objectType3);
816209
- if (structTag.address === SUI_FRAMEWORK_ADDRESS2 && structTag.module === "coin" && structTag.name === "Coin" && typeof structTag.typeParams[0] === "object") {
816210
- const innerStructTag = structTag.typeParams[0];
816211
- if (innerStructTag.address === SUI_FRAMEWORK_ADDRESS2 && innerStructTag.module === "sui" && innerStructTag.name === "SUI") {
816212
- return { GasCoin: true, $kind: "GasCoin" };
816213
- }
816214
- return { Coin: normalizeStructTag(innerStructTag), $kind: "Coin" };
816215
- } else if (structTag.address === SUI_SYSTEM_ADDRESS2 && structTag.module === "staking_pool" && structTag.name === "StakedSui") {
816216
- return { StakedSui: true, $kind: "StakedSui" };
816217
- }
816218
- return {
816219
- Other: {
816220
- ...structTag,
816221
- typeParams: structTag.typeParams.map((typeParam) => {
816222
- return TypeTagSerializer.parseFromStr(normalizeStructTag(typeParam));
816223
- })
816224
- },
816225
- $kind: "Other"
816226
- };
816227
- }
816228
- }),
816229
- hasPublicTransfer: suiBcs.bool(),
816230
- version: suiBcs.u64(),
816231
- contents: suiBcs.byteVector().transform({ input: fromBase64 })
816232
- })
816233
- }),
816234
- owner: suiBcs.Owner.transform({
816235
- input: (objectOwner) => {
816236
- if (objectOwner === "Immutable") {
816237
- return { Immutable: null };
816238
- } else if ("Shared" in objectOwner) {
816239
- return { Shared: { initialSharedVersion: objectOwner.Shared.initial_shared_version } };
816240
- } else if ("ConsensusAddressOwner" in objectOwner) {
816241
- return {
816242
- ConsensusAddressOwner: {
816243
- owner: objectOwner.ConsensusAddressOwner.owner,
816244
- startVersion: objectOwner.ConsensusAddressOwner.start_version
816245
- }
816246
- };
816247
- }
816248
- return objectOwner;
816249
- }
816250
- }),
816251
- previousTransaction: suiBcs.ObjectDigest,
816252
- storageRebate: suiBcs.u64()
816253
- });
816254
-
816255
- // ../../node_modules/.pnpm/@mysten+signers@0.3.4_typescript@5.4.3/node_modules/@mysten/signers/dist/esm/ledger/index.js
816256
- var __typeError8 = (msg) => {
816257
- throw TypeError(msg);
816258
- };
816259
- var __accessCheck8 = (obj2, member2, msg) => member2.has(obj2) || __typeError8("Cannot " + msg);
816260
- var __privateGet8 = (obj2, member2, getter) => (__accessCheck8(obj2, member2, "read from private field"), getter ? getter.call(obj2) : member2.get(obj2));
816261
- var __privateAdd8 = (obj2, member2, value5) => member2.has(obj2) ? __typeError8("Cannot add the same private member more than once") : member2 instanceof WeakSet ? member2.add(obj2) : member2.set(obj2, value5);
816262
- var __privateSet8 = (obj2, member2, value5, setter) => (__accessCheck8(obj2, member2, "write to private field"), setter ? setter.call(obj2, value5) : member2.set(obj2, value5), value5);
816263
- var __privateMethod5 = (obj2, member2, method2) => (__accessCheck8(obj2, member2, "access private method"), method2);
816264
- var _derivationPath;
816265
- var _publicKey;
816266
- var _ledgerClient;
816267
- var _suiClient;
816268
- var _LedgerSigner_instances;
816269
- var getClearSigningOptions_fn;
816270
- var _LedgerSigner = class _LedgerSigner2 extends Signer {
816271
- /**
816272
- * Creates an instance of LedgerSigner. It's expected to call the static `fromDerivationPath` method to create an instance.
816273
- * @example
816274
- * ```
816275
- * const signer = await LedgerSigner.fromDerivationPath(derivationPath, options);
816276
- * ```
816277
- */
816278
- constructor({ publicKey: publicKey3, derivationPath, ledgerClient, suiClient }) {
816279
- super();
816280
- __privateAdd8(this, _LedgerSigner_instances);
816281
- __privateAdd8(this, _derivationPath);
816282
- __privateAdd8(this, _publicKey);
816283
- __privateAdd8(this, _ledgerClient);
816284
- __privateAdd8(this, _suiClient);
816285
- __privateSet8(this, _publicKey, publicKey3);
816286
- __privateSet8(this, _derivationPath, derivationPath);
816287
- __privateSet8(this, _ledgerClient, ledgerClient);
816288
- __privateSet8(this, _suiClient, suiClient);
816289
- }
816290
- /**
816291
- * Retrieves the key scheme used by this signer.
816292
- */
816293
- getKeyScheme() {
816294
- return "ED25519";
816295
- }
816296
- /**
816297
- * Retrieves the public key associated with this signer.
816298
- * @returns The Ed25519PublicKey instance.
816299
- */
816300
- getPublicKey() {
816301
- return __privateGet8(this, _publicKey);
816302
- }
816303
- /**
816304
- * Signs the provided transaction bytes.
816305
- * @returns The signed transaction bytes and signature.
816306
- */
816307
- async signTransaction(bytes5) {
816308
- const transactionOptions = await __privateMethod5(this, _LedgerSigner_instances, getClearSigningOptions_fn).call(this, bytes5).catch(() => ({
816309
- // Fail gracefully so network errors or serialization issues don't break transaction signing:
816310
- bcsObjects: []
816311
- }));
816312
- const intentMessage = messageWithIntent("TransactionData", bytes5);
816313
- const { signature: signature4 } = await __privateGet8(this, _ledgerClient).signTransaction(
816314
- __privateGet8(this, _derivationPath),
816315
- intentMessage,
816316
- transactionOptions
816317
- );
816318
- return {
816319
- bytes: toBase64(bytes5),
816320
- signature: toSerializedSignature({
816321
- signature: signature4,
816322
- signatureScheme: this.getKeyScheme(),
816323
- publicKey: __privateGet8(this, _publicKey)
816324
- })
816325
- };
816326
- }
816327
- /**
816328
- * Signs the provided personal message.
816329
- * @returns The signed message bytes and signature.
816330
- */
816331
- async signPersonalMessage(bytes5) {
816332
- const intentMessage = messageWithIntent(
816333
- "PersonalMessage",
816334
- suiBcs.byteVector().serialize(bytes5).toBytes()
816335
- );
816336
- const { signature: signature4 } = await __privateGet8(this, _ledgerClient).signTransaction(
816337
- __privateGet8(this, _derivationPath),
816338
- intentMessage
816339
- );
816340
- return {
816341
- bytes: toBase64(bytes5),
816342
- signature: toSerializedSignature({
816343
- signature: signature4,
816344
- signatureScheme: this.getKeyScheme(),
816345
- publicKey: __privateGet8(this, _publicKey)
816346
- })
816347
- };
816348
- }
816349
- /**
816350
- * Prepares the signer by fetching and setting the public key from a Ledger device.
816351
- * It is recommended to initialize an `LedgerSigner` instance using this function.
816352
- * @returns A promise that resolves once a `LedgerSigner` instance is prepared (public key is set).
816353
- */
816354
- static async fromDerivationPath(derivationPath, ledgerClient, suiClient) {
816355
- const { publicKey: publicKey3 } = await ledgerClient.getPublicKey(derivationPath);
816356
- if (!publicKey3) {
816357
- throw new Error("Failed to get public key from Ledger.");
816358
- }
816359
- return new _LedgerSigner2({
816360
- derivationPath,
816361
- publicKey: new Ed25519PublicKey3(publicKey3),
816362
- ledgerClient,
816363
- suiClient
816364
- });
816365
- }
816366
- /**
816367
- * Generic signing is not supported by Ledger.
816368
- * @throws Always throws an error indicating generic signing is unsupported.
816369
- */
816370
- sign() {
816371
- throw new Error("Ledger Signer does not support generic signing.");
816372
- }
816373
- /**
816374
- * Generic signing is not supported by Ledger.
816375
- * @throws Always throws an error indicating generic signing is unsupported.
816376
- */
816377
- signWithIntent() {
816378
- throw new Error("Ledger Signer does not support generic signing.");
816379
- }
816380
- };
816381
- _derivationPath = /* @__PURE__ */ new WeakMap();
816382
- _publicKey = /* @__PURE__ */ new WeakMap();
816383
- _ledgerClient = /* @__PURE__ */ new WeakMap();
816384
- _suiClient = /* @__PURE__ */ new WeakMap();
816385
- _LedgerSigner_instances = /* @__PURE__ */ new WeakSet();
816386
- getClearSigningOptions_fn = async function(transactionBytes) {
816387
- const transaction = Transaction7.from(transactionBytes);
816388
- const data12 = transaction.getData();
816389
- const gasObjectIds = data12.gasData.payment?.map((object7) => object7.objectId) ?? [];
816390
- const inputObjectIds = data12.inputs.map((input) => {
816391
- return input.$kind === "Object" && input.Object.$kind === "ImmOrOwnedObject" ? input.Object.ImmOrOwnedObject.objectId : null;
816392
- }).filter((objectId) => !!objectId);
816393
- const objects = await __privateGet8(this, _suiClient).multiGetObjects({
816394
- ids: [...gasObjectIds, ...inputObjectIds],
816395
- options: {
816396
- showBcs: true,
816397
- showPreviousTransaction: true,
816398
- showStorageRebate: true,
816399
- showOwner: true
816400
- }
816401
- });
816402
- const bcsObjects = objects.map((object7) => {
816403
- if (object7.error || !object7.data || object7.data.bcs?.dataType !== "moveObject") {
816404
- return null;
816405
- }
816406
- return SuiMoveObject.serialize({
816407
- data: {
816408
- MoveObject: {
816409
- type: object7.data.bcs.type,
816410
- hasPublicTransfer: object7.data.bcs.hasPublicTransfer,
816411
- version: object7.data.bcs.version,
816412
- contents: object7.data.bcs.bcsBytes
816413
- }
816414
- },
816415
- owner: object7.data.owner,
816416
- previousTransaction: object7.data.previousTransaction,
816417
- storageRebate: object7.data.storageRebate
816418
- }).toBytes();
816419
- }).filter((bcsBytes) => !!bcsBytes);
816420
- return { bcsObjects };
816421
- };
816422
- var LedgerSigner = _LedgerSigner;
816423
-
816424
816520
  // ../../libs/coin-modules/coin-sui/lib-es/bridge/buildOptimisticOperation.js
816425
816521
  var import_bignumber310 = __toESM(require("bignumber.js"));
816426
816522
  var MODE_TO_TYPE3 = {
@@ -816764,7 +816860,7 @@ function createBridges23(signerContext4, coinConfig19) {
816764
816860
  };
816765
816861
  }
816766
816862
 
816767
- // ../../node_modules/.pnpm/@mysten+ledgerjs-hw-app-sui@0.5.2/node_modules/@mysten/ledgerjs-hw-app-sui/dist/esm/Sui.js
816863
+ // ../../node_modules/.pnpm/@mysten+ledgerjs-hw-app-sui@0.6.0/node_modules/@mysten/ledgerjs-hw-app-sui/dist/esm/Sui.js
816768
816864
  var import_fast_sha256 = __toESM(require_sha25611(), 1);
816769
816865
  var __typeError9 = (msg) => {
816770
816866
  throw TypeError(msg);
@@ -816773,7 +816869,7 @@ var __accessCheck9 = (obj2, member2, msg) => member2.has(obj2) || __typeError9("
816773
816869
  var __privateGet9 = (obj2, member2, getter) => (__accessCheck9(obj2, member2, "read from private field"), getter ? getter.call(obj2) : member2.get(obj2));
816774
816870
  var __privateAdd9 = (obj2, member2, value5) => member2.has(obj2) ? __typeError9("Cannot add the same private member more than once") : member2 instanceof WeakSet ? member2.add(obj2) : member2.set(obj2, value5);
816775
816871
  var __privateSet9 = (obj2, member2, value5, setter) => (__accessCheck9(obj2, member2, "write to private field"), setter ? setter.call(obj2, value5) : member2.set(obj2, value5), value5);
816776
- var __privateMethod6 = (obj2, member2, method2) => (__accessCheck9(obj2, member2, "access private method"), method2);
816872
+ var __privateMethod5 = (obj2, member2, method2) => (__accessCheck9(obj2, member2, "access private method"), method2);
816777
816873
  var _verbose;
816778
816874
  var _Sui_instances;
816779
816875
  var internalGetVersion_fn;
@@ -816812,7 +816908,7 @@ var Sui = class {
816812
816908
  const p1 = 0;
816813
816909
  const p210 = 0;
816814
816910
  const payload = buildBip32KeyPayload(path4);
816815
- const response = await __privateMethod6(this, _Sui_instances, sendChunks_fn).call(this, cla, ins, p1, p210, payload);
816911
+ const response = await __privateMethod5(this, _Sui_instances, sendChunks_fn).call(this, cla, ins, p1, p210, payload);
816816
816912
  const keySize = response[0];
816817
816913
  const publicKey3 = response.slice(1, keySize + 1);
816818
816914
  let address3 = null;
@@ -816839,18 +816935,18 @@ var Sui = class {
816839
816935
  const p1 = 0;
816840
816936
  const p210 = 0;
816841
816937
  if (__privateGet9(this, _verbose))
816842
- __privateMethod6(this, _Sui_instances, log_fn).call(this, txn);
816938
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, txn);
816843
816939
  const rawTxn = Buffer.from(txn);
816844
816940
  const hashSize = Buffer.alloc(4);
816845
816941
  hashSize.writeUInt32LE(rawTxn.length, 0);
816846
816942
  const payloadTxn = Buffer.concat([hashSize, rawTxn]);
816847
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Payload Txn", payloadTxn);
816943
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Payload Txn", payloadTxn);
816848
816944
  const bip32KeyPayload = buildBip32KeyPayload(path4);
816849
816945
  const payloads = [payloadTxn, bip32KeyPayload];
816850
- const { major } = await __privateMethod6(this, _Sui_instances, internalGetVersion_fn).call(this);
816946
+ const { major } = await __privateMethod5(this, _Sui_instances, internalGetVersion_fn).call(this);
816851
816947
  const bcsObjects = options24?.bcsObjects ?? [];
816852
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Objects list length", bcsObjects.length);
816853
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "App version", major);
816948
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Objects list length", bcsObjects.length);
816949
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "App version", major);
816854
816950
  if (major > 0 && bcsObjects.length > 0) {
816855
816951
  const numItems = Buffer.alloc(4);
816856
816952
  numItems.writeUInt32LE(bcsObjects.length, 0);
@@ -816863,20 +816959,20 @@ var Sui = class {
816863
816959
  }
816864
816960
  payloads.push(listData);
816865
816961
  }
816866
- const signature4 = await __privateMethod6(this, _Sui_instances, sendChunks_fn).call(this, cla, ins, p1, p210, payloads);
816962
+ const signature4 = await __privateMethod5(this, _Sui_instances, sendChunks_fn).call(this, cla, ins, p1, p210, payloads);
816867
816963
  return { signature: signature4 };
816868
816964
  }
816869
816965
  /**
816870
816966
  * Retrieve the app version on the attached Ledger device.
816871
816967
  */
816872
816968
  async getVersion() {
816873
- return await __privateMethod6(this, _Sui_instances, internalGetVersion_fn).call(this);
816969
+ return await __privateMethod5(this, _Sui_instances, internalGetVersion_fn).call(this);
816874
816970
  }
816875
816971
  };
816876
816972
  _verbose = /* @__PURE__ */ new WeakMap();
816877
816973
  _Sui_instances = /* @__PURE__ */ new WeakSet();
816878
816974
  internalGetVersion_fn = async function() {
816879
- const [major, minor, patch] = await __privateMethod6(this, _Sui_instances, sendChunks_fn).call(this, 0, 0, 0, 0, Buffer.alloc(1));
816975
+ const [major, minor, patch] = await __privateMethod5(this, _Sui_instances, sendChunks_fn).call(this, 0, 0, 0, 0, Buffer.alloc(1));
816880
816976
  return {
816881
816977
  major,
816882
816978
  minor,
@@ -816897,11 +816993,11 @@ sendChunks_fn = async function(cla, ins, p1, p210, payload, extraData = /* @__PU
816897
816993
  chunkList.push(cur);
816898
816994
  }
816899
816995
  let lastHash = Buffer.alloc(32);
816900
- __privateMethod6(this, _Sui_instances, log_fn).call(this, lastHash);
816996
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, lastHash);
816901
816997
  data12 = chunkList.reduceRight((blocks2, chunk5) => {
816902
816998
  const linkedChunk = Buffer.concat([lastHash, chunk5]);
816903
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Chunk: ", chunk5);
816904
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "linkedChunk: ", linkedChunk);
816999
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Chunk: ", chunk5);
817000
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "linkedChunk: ", linkedChunk);
816905
817001
  lastHash = Buffer.from((0, import_fast_sha256.default)(linkedChunk));
816906
817002
  blocks2.set(lastHash.toString("hex"), linkedChunk);
816907
817003
  return blocks2;
@@ -816909,8 +817005,8 @@ sendChunks_fn = async function(cla, ins, p1, p210, payload, extraData = /* @__PU
816909
817005
  parameterList.push(lastHash);
816910
817006
  lastHash = Buffer.alloc(32);
816911
817007
  }
816912
- __privateMethod6(this, _Sui_instances, log_fn).call(this, data12);
816913
- return await __privateMethod6(this, _Sui_instances, handleBlocksProtocol_fn).call(this, cla, ins, p1, p210, Buffer.concat([Buffer.from([
817008
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, data12);
817009
+ return await __privateMethod5(this, _Sui_instances, handleBlocksProtocol_fn).call(this, cla, ins, p1, p210, Buffer.concat([Buffer.from([
816914
817010
  0
816915
817011
  /* START */
816916
817012
  ])].concat(parameterList)), data12);
@@ -816919,9 +817015,9 @@ handleBlocksProtocol_fn = async function(cla, ins, p1, p210, initialPayload, dat
816919
817015
  let payload = initialPayload;
816920
817016
  let result2 = Buffer.alloc(0);
816921
817017
  do {
816922
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Sending payload to ledger: ", payload.toString("hex"));
817018
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Sending payload to ledger: ", payload.toString("hex"));
816923
817019
  const rv = await this.transport.send(cla, ins, p1, p210, payload);
816924
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Received response: ", rv);
817020
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Received response: ", rv);
816925
817021
  var rv_instruction = rv[0];
816926
817022
  const rv_payload = rv.slice(1, rv.length - 2);
816927
817023
  if (!(rv_instruction in LedgerToHost)) {
@@ -816938,8 +817034,8 @@ handleBlocksProtocol_fn = async function(cla, ins, p1, p210, initialPayload, dat
816938
817034
  break;
816939
817035
  case 2:
816940
817036
  const chunk5 = data12.get(rv_payload.toString("hex"));
816941
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Getting block ", rv_payload);
816942
- __privateMethod6(this, _Sui_instances, log_fn).call(this, "Found block ", chunk5);
817037
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Getting block ", rv_payload);
817038
+ __privateMethod5(this, _Sui_instances, log_fn).call(this, "Found block ", chunk5);
816943
817039
  if (chunk5) {
816944
817040
  payload = Buffer.concat([
816945
817041
  Buffer.from([
@@ -825701,7 +825797,7 @@ var dispatch3 = (transport, opts) => {
825701
825797
  var getAddress_default15 = dispatch3;
825702
825798
 
825703
825799
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getAccountShape.js
825704
- var import_bignumber357 = __toESM(require("bignumber.js"));
825800
+ var import_bignumber356 = __toESM(require("bignumber.js"));
825705
825801
 
825706
825802
  // ../../libs/coin-modules/coin-xrp/lib-es/api/index.js
825707
825803
  init_lib_es2();
@@ -826808,57 +826904,7 @@ async function estimateFees7() {
826808
826904
  return BigInt(baseFee.recommendedFee);
826809
826905
  }
826810
826906
 
826811
- // ../../libs/coin-modules/coin-stellar/lib-es/logic/utils.js
826812
- var import_bignumber348 = require("bignumber.js");
826813
- var import_stellar_sdk6 = __toESM(require_lib62());
826814
- var STELLAR_BURN_ADDRESS = "GAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF";
826815
- var getAssetIdFromAsset = (asset) => `${asset.asset_code}:${asset.asset_issuer}`;
826816
- function getAssetCodeIssuer(tr3) {
826817
- if (tr3.subAccountId) {
826818
- const assetString = tr3.subAccountId.split("+")[1];
826819
- return assetString.split(":");
826820
- }
826821
- return [tr3.assetReference || "", tr3.assetOwner || ""];
826822
- }
826823
- function isMemoValid2(memoType, memoValue) {
826824
- switch (memoType) {
826825
- case "MEMO_TEXT":
826826
- if (memoValue.length > 28) {
826827
- return false;
826828
- }
826829
- break;
826830
- case "MEMO_ID":
826831
- if (new import_bignumber348.BigNumber(memoValue.toString()).isNaN()) {
826832
- return false;
826833
- }
826834
- break;
826835
- case "MEMO_HASH":
826836
- case "MEMO_RETURN":
826837
- if (!memoValue.length || memoValue.length !== 64) {
826838
- return false;
826839
- }
826840
- break;
826841
- }
826842
- return true;
826843
- }
826844
- async function isAccountMultiSign(account3) {
826845
- const signers = await fetchSigners(account3);
826846
- return signers.length > 1;
826847
- }
826848
- function isAddressValid3(address3) {
826849
- if (!address3)
826850
- return false;
826851
- if (address3 === STELLAR_BURN_ADDRESS)
826852
- return false;
826853
- try {
826854
- return import_stellar_sdk6.StrKey.isValidEd25519PublicKey(address3) || import_stellar_sdk6.StrKey.isValidMed25519PublicKey(address3);
826855
- } catch (err) {
826856
- return false;
826857
- }
826858
- }
826859
-
826860
826907
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/getBalance.js
826861
- var import_bignumber349 = __toESM(require("bignumber.js"));
826862
826908
  async function getBalance9(addr) {
826863
826909
  const { balance: balance2, assets, spendableBalance } = await fetchAccount(addr);
826864
826910
  const locked19 = BigInt(balance2.toString()) - BigInt(spendableBalance.toString());
@@ -826873,22 +826919,14 @@ async function getBalance9(addr) {
826873
826919
  if (!assets || assets.length === 0) {
826874
826920
  return nativeRes;
826875
826921
  }
826876
- const assetBalances = assets.map((asset) => {
826877
- const token = findTokenById(`stellar/asset/${getAssetIdFromAsset(asset)}`);
826878
- let parsedBalance = new import_bignumber349.default(0);
826879
- if (token) {
826880
- 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
826881
826928
  }
826882
- const intBalance = BigInt(Math.floor(parseFloat(parsedBalance.toString())));
826883
- return {
826884
- value: intBalance,
826885
- asset: {
826886
- type: asset.asset_type,
826887
- assetReference: asset.asset_code,
826888
- assetOwner: asset.asset_issuer
826889
- }
826890
- };
826891
- });
826929
+ }));
826892
826930
  return [...nativeRes, ...assetBalances];
826893
826931
  }
826894
826932
 
@@ -826944,7 +826982,57 @@ var convertToCoreOperation2 = (operation) => {
826944
826982
 
826945
826983
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/validateIntent.js
826946
826984
  init_lib_es();
826947
- 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"));
826948
827036
  var validateIntent3 = async (transactionIntent, customFees) => {
826949
827037
  const errors = {};
826950
827038
  const warnings3 = {};
@@ -827041,7 +827129,7 @@ var validateIntent3 = async (transactionIntent, customFees) => {
827041
827129
  }
827042
827130
  if (totalSpent > nativeBalance - baseReserve) {
827043
827131
  errors.amount = new NotEnoughSpendableBalance(void 0, {
827044
- 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()), {
827045
827133
  disableRounding: true,
827046
827134
  showCode: true
827047
827135
  }) : "Unknown unit"
@@ -827073,7 +827161,7 @@ var validateIntent3 = async (transactionIntent, customFees) => {
827073
827161
  };
827074
827162
 
827075
827163
  // ../../libs/coin-modules/coin-stellar/lib-es/logic/getTokenFromAsset.js
827076
- function getTokenFromAsset2(asset) {
827164
+ async function getTokenFromAsset2(asset) {
827077
827165
  const assetId = asset.type !== "native" && "assetReference" in asset && "assetOwner" in asset ? `${asset.assetReference}:${asset.assetOwner}` : "";
827078
827166
  return findTokenById(`stellar/asset/${assetId}`);
827079
827167
  }
@@ -827516,7 +827604,7 @@ var HttpBackend = class {
827516
827604
  };
827517
827605
 
827518
827606
  // ../../node_modules/.pnpm/@taquito+rpc@23.0.0-beta.1/node_modules/@taquito/rpc/dist/taquito-rpc.es6.js
827519
- var import_bignumber351 = __toESM(require("bignumber.js"));
827607
+ var import_bignumber350 = __toESM(require("bignumber.js"));
827520
827608
  function __rest2(s48, e36) {
827521
827609
  var t46 = {};
827522
827610
  for (var p63 in s48)
@@ -827627,7 +827715,7 @@ function castToBigNumber(data12, keys2) {
827627
827715
  response[key2] = res;
827628
827716
  return;
827629
827717
  }
827630
- res = new import_bignumber351.default(item);
827718
+ res = new import_bignumber350.default(item);
827631
827719
  response[key2] = res;
827632
827720
  });
827633
827721
  return response;
@@ -827864,7 +827952,7 @@ var RpcClient3 = class {
827864
827952
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/balance`),
827865
827953
  method: "GET"
827866
827954
  });
827867
- return new import_bignumber351.default(balance2);
827955
+ return new import_bignumber350.default(balance2);
827868
827956
  });
827869
827957
  }
827870
827958
  /**
@@ -827879,7 +827967,7 @@ var RpcClient3 = class {
827879
827967
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/spendable`),
827880
827968
  method: "GET"
827881
827969
  });
827882
- return new import_bignumber351.default(balance2);
827970
+ return new import_bignumber350.default(balance2);
827883
827971
  });
827884
827972
  }
827885
827973
  /**
@@ -827895,7 +827983,7 @@ var RpcClient3 = class {
827895
827983
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/balance_and_frozen_bonds`),
827896
827984
  method: "GET"
827897
827985
  });
827898
- return new import_bignumber351.default(balance2);
827986
+ return new import_bignumber350.default(balance2);
827899
827987
  });
827900
827988
  }
827901
827989
  /**
@@ -827911,7 +827999,7 @@ var RpcClient3 = class {
827911
827999
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/spendable_and_frozen_bonds`),
827912
828000
  method: "GET"
827913
828001
  });
827914
- return new import_bignumber351.default(balance2);
828002
+ return new import_bignumber350.default(balance2);
827915
828003
  });
827916
828004
  }
827917
828005
  /**
@@ -827927,7 +828015,7 @@ var RpcClient3 = class {
827927
828015
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/full_balance`),
827928
828016
  method: "GET"
827929
828017
  });
827930
- return new import_bignumber351.default(balance2);
828018
+ return new import_bignumber350.default(balance2);
827931
828019
  });
827932
828020
  }
827933
828021
  /**
@@ -827943,7 +828031,7 @@ var RpcClient3 = class {
827943
828031
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/staked_balance`),
827944
828032
  method: "GET"
827945
828033
  });
827946
- return new import_bignumber351.default(balance2);
828034
+ return new import_bignumber350.default(balance2);
827947
828035
  });
827948
828036
  }
827949
828037
  /**
@@ -827959,7 +828047,7 @@ var RpcClient3 = class {
827959
828047
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/unstaked_finalizable_balance`),
827960
828048
  method: "GET"
827961
828049
  });
827962
- return new import_bignumber351.default(balance2);
828050
+ return new import_bignumber350.default(balance2);
827963
828051
  });
827964
828052
  }
827965
828053
  /**
@@ -827975,7 +828063,7 @@ var RpcClient3 = class {
827975
828063
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}/unstaked_frozen_balance`),
827976
828064
  method: "GET"
827977
828065
  });
827978
- return new import_bignumber351.default(balance2);
828066
+ return new import_bignumber350.default(balance2);
827979
828067
  });
827980
828068
  }
827981
828069
  /**
@@ -828068,7 +828156,7 @@ var RpcClient3 = class {
828068
828156
  url: this.createURL(`/chains/${this.chain}/blocks/${block2}/context/contracts/${address3}`),
828069
828157
  method: "GET"
828070
828158
  });
828071
- 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) });
828072
828160
  });
828073
828161
  }
828074
828162
  /**
@@ -828410,7 +828498,7 @@ var RpcClient3 = class {
828410
828498
  });
828411
828499
  response.map((item) => {
828412
828500
  if (item.voting_power) {
828413
- item.voting_power = new import_bignumber351.default(item.voting_power);
828501
+ item.voting_power = new import_bignumber350.default(item.voting_power);
828414
828502
  }
828415
828503
  return item;
828416
828504
  });
@@ -828429,7 +828517,7 @@ var RpcClient3 = class {
828429
828517
  method: "GET"
828430
828518
  });
828431
828519
  response.map((item) => {
828432
- return item[1] = new import_bignumber351.default(item[1]);
828520
+ return item[1] = new import_bignumber350.default(item[1]);
828433
828521
  });
828434
828522
  return response;
828435
828523
  });
@@ -828606,7 +828694,7 @@ var RpcClient3 = class {
828606
828694
  method: "POST"
828607
828695
  }, data12), { gas } = _a6, rest = __rest2(_a6, ["gas"]);
828608
828696
  let formattedGas = gas;
828609
- const tryBigNumber = new import_bignumber351.default(gas || "");
828697
+ const tryBigNumber = new import_bignumber350.default(gas || "");
828610
828698
  if (!tryBigNumber.isNaN()) {
828611
828699
  formattedGas = tryBigNumber;
828612
828700
  }
@@ -828803,7 +828891,7 @@ var import_operators10 = require("rxjs/operators");
828803
828891
 
828804
828892
  // ../../node_modules/.pnpm/@taquito+michelson-encoder@23.0.0-beta.1/node_modules/@taquito/michelson-encoder/dist/taquito-michelson-encoder.es6.js
828805
828893
  var import_fast_json_stable_stringify2 = __toESM(require_fast_json_stable_stringify());
828806
- var import_bignumber352 = __toESM(require("bignumber.js"));
828894
+ var import_bignumber351 = __toESM(require("bignumber.js"));
828807
828895
  var import_elliptic4 = __toESM(require_elliptic());
828808
828896
  var _a$1;
828809
828897
  var InvalidMapTypeError = class extends TaquitoError {
@@ -829654,7 +829742,7 @@ var NatToken = class _NatToken extends ComparableToken {
829654
829742
  this.fac = fac;
829655
829743
  }
829656
829744
  Execute(val) {
829657
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
829745
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
829658
829746
  }
829659
829747
  /**
829660
829748
  * @throws {@link NatValidationError}
@@ -829662,13 +829750,13 @@ var NatToken = class _NatToken extends ComparableToken {
829662
829750
  Encode(args3) {
829663
829751
  const val = args3.pop();
829664
829752
  this.validate(val);
829665
- return { int: new import_bignumber352.default(val).toFixed() };
829753
+ return { int: new import_bignumber351.default(val).toFixed() };
829666
829754
  }
829667
829755
  /**
829668
829756
  * @throws {@link NatValidationError}
829669
829757
  */
829670
829758
  validate(val) {
829671
- const bigNumber = new import_bignumber352.default(val);
829759
+ const bigNumber = new import_bignumber351.default(val);
829672
829760
  if (bigNumber.isNaN()) {
829673
829761
  throw new NatValidationError(val, this, `Value is not a number: ${JSON.stringify(val)}`);
829674
829762
  }
@@ -829684,7 +829772,7 @@ var NatToken = class _NatToken extends ComparableToken {
829684
829772
  if (semantic && semantic[_NatToken.prim]) {
829685
829773
  return semantic[_NatToken.prim](val);
829686
829774
  }
829687
- return { int: new import_bignumber352.default(val).toFixed() };
829775
+ return { int: new import_bignumber351.default(val).toFixed() };
829688
829776
  }
829689
829777
  /**
829690
829778
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -829706,7 +829794,7 @@ var NatToken = class _NatToken extends ComparableToken {
829706
829794
  };
829707
829795
  }
829708
829796
  ToKey({ int }) {
829709
- return new import_bignumber352.default(int);
829797
+ return new import_bignumber351.default(int);
829710
829798
  }
829711
829799
  compare(nat1, nat2) {
829712
829800
  const o1 = Number(nat1);
@@ -830232,7 +830320,7 @@ var MutezToken = class _MutezToken extends ComparableToken {
830232
830320
  this.fac = fac;
830233
830321
  }
830234
830322
  Execute(val) {
830235
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
830323
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
830236
830324
  }
830237
830325
  /**
830238
830326
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -830251,7 +830339,7 @@ var MutezToken = class _MutezToken extends ComparableToken {
830251
830339
  * @throws {@link MutezValidationError}
830252
830340
  */
830253
830341
  validate(val) {
830254
- const bigNumber = new import_bignumber352.default(val);
830342
+ const bigNumber = new import_bignumber351.default(val);
830255
830343
  if (bigNumber.isNaN()) {
830256
830344
  throw new MutezValidationError(val, this, `Value is not a number: ${val}`);
830257
830345
  }
@@ -830550,7 +830638,7 @@ var IntToken = class _IntToken extends ComparableToken {
830550
830638
  this.fac = fac;
830551
830639
  }
830552
830640
  Execute(val) {
830553
- return new import_bignumber352.default(val[Object.keys(val)[0]]);
830641
+ return new import_bignumber351.default(val[Object.keys(val)[0]]);
830554
830642
  }
830555
830643
  /**
830556
830644
  * @deprecated ExtractSchema has been deprecated in favor of generateSchema
@@ -830569,7 +830657,7 @@ var IntToken = class _IntToken extends ComparableToken {
830569
830657
  * @throws {@link IntValidationError}
830570
830658
  */
830571
830659
  validate(val) {
830572
- const bigNumber = new import_bignumber352.default(val);
830660
+ const bigNumber = new import_bignumber351.default(val);
830573
830661
  if (bigNumber.isNaN()) {
830574
830662
  throw new IntValidationError(val, this, `Value is not a number: ${JSON.stringify(val)}`);
830575
830663
  }
@@ -830580,7 +830668,7 @@ var IntToken = class _IntToken extends ComparableToken {
830580
830668
  Encode(args3) {
830581
830669
  const val = args3.pop();
830582
830670
  this.validate(val);
830583
- return { int: new import_bignumber352.default(val).toFixed() };
830671
+ return { int: new import_bignumber351.default(val).toFixed() };
830584
830672
  }
830585
830673
  /**
830586
830674
  * @throws {@link IntValidationError}
@@ -830590,7 +830678,7 @@ var IntToken = class _IntToken extends ComparableToken {
830590
830678
  if (semantic && semantic[_IntToken.prim]) {
830591
830679
  return semantic[_IntToken.prim](val);
830592
830680
  }
830593
- return { int: new import_bignumber352.default(val).toFixed() };
830681
+ return { int: new import_bignumber351.default(val).toFixed() };
830594
830682
  }
830595
830683
  ToBigMapKey(val) {
830596
830684
  return {
@@ -832695,7 +832783,7 @@ var EventSchema = class _EventSchema {
832695
832783
  var UnitValue = Symbol();
832696
832784
 
832697
832785
  // ../../node_modules/.pnpm/@taquito+taquito@23.0.0-beta.1/node_modules/@taquito/taquito/dist/taquito.es6.js
832698
- var import_bignumber354 = __toESM(require("bignumber.js"));
832786
+ var import_bignumber353 = __toESM(require("bignumber.js"));
832699
832787
 
832700
832788
  // ../../node_modules/.pnpm/@taquito+michel-codec@23.0.0-beta.1/node_modules/@taquito/michel-codec/dist/taquito-michel-codec.es6.js
832701
832789
  var sourceReference = Symbol("source_reference");
@@ -836897,7 +836985,7 @@ var dummyContract = new Contract5([
836897
836985
  ]);
836898
836986
 
836899
836987
  // ../../node_modules/.pnpm/@taquito+local-forging@23.0.0-beta.1/node_modules/@taquito/local-forging/dist/taquito-local-forging.es6.js
836900
- var import_bignumber353 = __toESM(require("bignumber.js"));
836988
+ var import_bignumber352 = __toESM(require("bignumber.js"));
836901
836989
  var toHexString2 = (bytes5) => bytes5.reduce((str, byte) => str + byte.toString(16).padStart(2, "0"), "");
836902
836990
  var pad2 = (num, paddingLen = 8) => {
836903
836991
  return num.toString(16).padStart(paddingLen, "0");
@@ -837424,7 +837512,7 @@ var stringDecoder$1 = (value5) => {
837424
837512
  };
837425
837513
  };
837426
837514
  var intEncoder$1 = ({ int }) => {
837427
- const num = new import_bignumber353.BigNumber(int, 10);
837515
+ const num = new import_bignumber352.BigNumber(int, 10);
837428
837516
  const positiveMark = num.toString(2)[0] === "-" ? "1" : "0";
837429
837517
  const binary = num.toString(2).replace(/-/g, "");
837430
837518
  const pad3 = binary.length <= 6 ? 6 : (binary.length - 6) % 7 ? binary.length + 7 - (binary.length - 6) % 7 : binary.length;
@@ -837449,7 +837537,7 @@ var intDecoder$1 = (value5) => {
837449
837537
  const isNegative = !!(1 << 6 & hexNumber[0]);
837450
837538
  hexNumber[0] = hexNumber[0] & 127;
837451
837539
  const numBin = hexNumber.map((x23, i54) => x23.toString(2).slice(i54 === 0 ? -6 : -7).padStart(i54 === 0 ? 6 : 7, "0")).reverse();
837452
- let num = new import_bignumber353.BigNumber(numBin.join(""), 2);
837540
+ let num = new import_bignumber352.BigNumber(numBin.join(""), 2);
837453
837541
  if (isNegative) {
837454
837542
  num = num.times(-1);
837455
837543
  }
@@ -837795,7 +837883,7 @@ var smartRollupCommitmentHashDecoder$1 = (val) => {
837795
837883
  };
837796
837884
  var zarithEncoder$1 = (n143) => {
837797
837885
  const fn4 = [];
837798
- let nn2 = new import_bignumber353.default(n143, 10);
837886
+ let nn2 = new import_bignumber352.default(n143, 10);
837799
837887
  if (nn2.isNaN()) {
837800
837888
  throw new TypeError(`Invalid zarith number ${n143}`);
837801
837889
  }
@@ -837820,14 +837908,14 @@ var zarithDecoder$1 = (n143) => {
837820
837908
  while (mostSignificantByte < n143.length() && (n143.get(mostSignificantByte) & 128) !== 0) {
837821
837909
  mostSignificantByte += 1;
837822
837910
  }
837823
- let num = new import_bignumber353.default(0);
837911
+ let num = new import_bignumber352.default(0);
837824
837912
  for (let i54 = mostSignificantByte; i54 >= 0; i54 -= 1) {
837825
837913
  const tmp = n143.get(i54) & 127;
837826
837914
  num = num.multipliedBy(128);
837827
837915
  num = num.plus(tmp);
837828
837916
  }
837829
837917
  n143.consume(mostSignificantByte + 1);
837830
- return new import_bignumber353.default(num).toString();
837918
+ return new import_bignumber352.default(num).toString();
837831
837919
  };
837832
837920
  var entrypointDecoder$1 = (value5) => {
837833
837921
  const preamble = pad2(value5.consume(1)[0], 2);
@@ -838664,7 +838752,7 @@ var stringDecoder = (value5) => {
838664
838752
  };
838665
838753
  };
838666
838754
  var intEncoder = ({ int }) => {
838667
- const num = new import_bignumber353.BigNumber(int, 10);
838755
+ const num = new import_bignumber352.BigNumber(int, 10);
838668
838756
  const positiveMark = num.toString(2)[0] === "-" ? "1" : "0";
838669
838757
  const binary = num.toString(2).replace(/-/g, "");
838670
838758
  const pad3 = binary.length <= 6 ? 6 : (binary.length - 6) % 7 ? binary.length + 7 - (binary.length - 6) % 7 : binary.length;
@@ -838689,7 +838777,7 @@ var intDecoder = (value5) => {
838689
838777
  const isNegative = !!(1 << 6 & hexNumber[0]);
838690
838778
  hexNumber[0] = hexNumber[0] & 127;
838691
838779
  const numBin = hexNumber.map((x23, i54) => x23.toString(2).slice(i54 === 0 ? -6 : -7).padStart(i54 === 0 ? 6 : 7, "0")).reverse();
838692
- let num = new import_bignumber353.BigNumber(numBin.join(""), 2);
838780
+ let num = new import_bignumber352.BigNumber(numBin.join(""), 2);
838693
838781
  if (isNegative) {
838694
838782
  num = num.times(-1);
838695
838783
  }
@@ -839066,7 +839154,7 @@ var smartRollupCommitmentHashDecoder = (val) => {
839066
839154
  };
839067
839155
  var zarithEncoder = (n143) => {
839068
839156
  const fn4 = [];
839069
- let nn2 = new import_bignumber353.default(n143, 10);
839157
+ let nn2 = new import_bignumber352.default(n143, 10);
839070
839158
  if (nn2.isNaN()) {
839071
839159
  throw new TypeError(`Invalid zarith number ${n143}`);
839072
839160
  }
@@ -839091,14 +839179,14 @@ var zarithDecoder = (n143) => {
839091
839179
  while (mostSignificantByte < n143.length() && (n143.get(mostSignificantByte) & 128) !== 0) {
839092
839180
  mostSignificantByte += 1;
839093
839181
  }
839094
- let num = new import_bignumber353.default(0);
839182
+ let num = new import_bignumber352.default(0);
839095
839183
  for (let i54 = mostSignificantByte; i54 >= 0; i54 -= 1) {
839096
839184
  const tmp = n143.get(i54) & 127;
839097
839185
  num = num.multipliedBy(128);
839098
839186
  num = num.plus(tmp);
839099
839187
  }
839100
839188
  n143.consume(mostSignificantByte + 1);
839101
- return new import_bignumber353.default(num).toString();
839189
+ return new import_bignumber352.default(num).toString();
839102
839190
  };
839103
839191
  var entrypointDecoder = (value5) => {
839104
839192
  const preamble = pad2(value5.consume(1)[0], 2);
@@ -840681,8 +840769,8 @@ var BatchOperation = class extends Operation {
840681
840769
  return this.sumProp(this.params, "storage_limit");
840682
840770
  }
840683
840771
  get consumedGas() {
840684
- import_bignumber354.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.default.ROUND_UP });
840685
- 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();
840686
840774
  }
840687
840775
  get consumedMilliGas() {
840688
840776
  return String(this.sumProp(flattenOperationResult({ contents: this.results }), "consumed_milligas"));
@@ -841262,14 +841350,14 @@ var receiptFromOperation = (op, { ALLOCATION_BURN, ORIGINATION_BURN } = {
841262
841350
  ALLOCATION_BURN: 257,
841263
841351
  ORIGINATION_BURN: 257
841264
841352
  }) => {
841265
- 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 });
841266
841354
  const operationResults = flattenOperationResult({ contents: op });
841267
- let totalMilliGas = new import_bignumber354.default(0);
841268
- let totalStorage = new import_bignumber354.default(0);
841269
- let totalFee = new import_bignumber354.default(0);
841270
- let totalOriginationBurn = new import_bignumber354.default(0);
841271
- let totalAllocationBurn = new import_bignumber354.default(0);
841272
- 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);
841273
841361
  operationResults.forEach((result2) => {
841274
841362
  totalFee = totalFee.plus(result2.fee || 0);
841275
841363
  totalOriginationBurn = totalOriginationBurn.plus(Array.isArray(result2.originated_contracts) ? result2.originated_contracts.length * ORIGINATION_BURN : 0);
@@ -841286,7 +841374,7 @@ var receiptFromOperation = (op, { ALLOCATION_BURN, ORIGINATION_BURN } = {
841286
841374
  totalAllocationBurn,
841287
841375
  totalOriginationBurn,
841288
841376
  totalPaidStorageDiff,
841289
- totalStorageBurn: new import_bignumber354.default(totalStorage.multipliedBy(COST_PER_BYTE))
841377
+ totalStorageBurn: new import_bignumber353.default(totalStorage.multipliedBy(COST_PER_BYTE))
841290
841378
  };
841291
841379
  };
841292
841380
  var ConfirmationUndefinedError = class extends TezosToolkitConfigError {
@@ -842117,14 +842205,14 @@ var smartContractAbstractionSemantic = (provider) => ({
842117
842205
  return {};
842118
842206
  } else {
842119
842207
  const schema3 = new Schema(code);
842120
- return new BigMapAbstraction(new import_bignumber354.default(val.int), schema3, provider);
842208
+ return new BigMapAbstraction(new import_bignumber353.default(val.int), schema3, provider);
842121
842209
  }
842122
842210
  },
842123
842211
  sapling_state: (val) => {
842124
842212
  if (!val || !("int" in val) || val.int === void 0) {
842125
842213
  return {};
842126
842214
  } else {
842127
- return new SaplingStateAbstraction(new import_bignumber354.default(val.int), provider);
842215
+ return new SaplingStateAbstraction(new import_bignumber353.default(val.int), provider);
842128
842216
  }
842129
842217
  }
842130
842218
  /*
@@ -842166,7 +842254,7 @@ var PrepareProvider = class extends Provider {
842166
842254
  });
842167
842255
  }
842168
842256
  adjustGasForBatchOperation(gasLimitBlock, gaslimitOp, numberOfOps) {
842169
- return import_bignumber354.default.min(gaslimitOp, gasLimitBlock.div(numberOfOps + 1));
842257
+ return import_bignumber353.default.min(gaslimitOp, gasLimitBlock.div(numberOfOps + 1));
842170
842258
  }
842171
842259
  getOperationLimits(constants2, numberOfOps) {
842172
842260
  return __awaiter11(this, void 0, void 0, function* () {
@@ -844324,8 +844412,8 @@ var DelegateOperation = class extends Operation {
844324
844412
  return Number(this.params.storage_limit);
844325
844413
  }
844326
844414
  get consumedGas() {
844327
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844328
- 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;
844329
844417
  }
844330
844418
  get consumedMilliGas() {
844331
844419
  var _a6;
@@ -844365,8 +844453,8 @@ var OriginationOperation = class extends Operation {
844365
844453
  return Number(this.params.storage_limit);
844366
844454
  }
844367
844455
  get consumedGas() {
844368
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844369
- 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;
844370
844458
  }
844371
844459
  get consumedMilliGas() {
844372
844460
  var _a6;
@@ -844431,8 +844519,8 @@ var RegisterGlobalConstantOperation = class extends Operation {
844431
844519
  return (_a6 = this.operationResults) === null || _a6 === void 0 ? void 0 : _a6.errors;
844432
844520
  }
844433
844521
  get consumedGas() {
844434
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844435
- 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;
844436
844524
  }
844437
844525
  get consumedMilliGas() {
844438
844526
  var _a6;
@@ -844483,8 +844571,8 @@ var RevealOperation = class extends Operation {
844483
844571
  }, 0);
844484
844572
  }
844485
844573
  get consumedGas() {
844486
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844487
- 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();
844488
844576
  }
844489
844577
  get consumedMilliGas() {
844490
844578
  return String(this.sumProp(flattenOperationResult({ contents: this.operationResults }), "consumed_milligas"));
@@ -844519,7 +844607,7 @@ var TransactionOperation = class extends Operation {
844519
844607
  }
844520
844608
  }
844521
844609
  get amount() {
844522
- return new import_bignumber354.default(this.params.amount);
844610
+ return new import_bignumber353.default(this.params.amount);
844523
844611
  }
844524
844612
  get destination() {
844525
844613
  return this.params.destination;
@@ -844539,8 +844627,8 @@ var TransactionOperation = class extends Operation {
844539
844627
  }, 0);
844540
844628
  }
844541
844629
  get consumedGas() {
844542
- import_bignumber354.default.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.default.ROUND_UP });
844543
- 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();
844544
844632
  }
844545
844633
  get consumedMilliGas() {
844546
844634
  return String(this.sumProp(flattenOperationResult({ contents: this.operationResults }), "consumed_milligas"));
@@ -844841,8 +844929,8 @@ var TransferTicketOperation = class extends Operation {
844841
844929
  return Number(this.params.storage_limit);
844842
844930
  }
844843
844931
  get consumedGas() {
844844
- import_bignumber354.BigNumber.config({ DECIMAL_PLACES: 0, ROUNDING_MODE: import_bignumber354.BigNumber.ROUND_UP });
844845
- 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;
844846
844934
  }
844847
844935
  get consumedMilliGas() {
844848
844936
  var _a6;
@@ -846172,7 +846260,7 @@ var PollingSubscribeProvider = class {
846172
846260
  const defaultIntervalSandbox = 1e3;
846173
846261
  try {
846174
846262
  const constants2 = yield this.context.readProvider.getProtocolConstants("head");
846175
- 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);
846176
846264
  const confirmationPollingInterval = blockTime.dividedBy(3);
846177
846265
  this.config.pollingIntervalMilliseconds = confirmationPollingInterval.toNumber() === 0 ? defaultIntervalSandbox : confirmationPollingInterval.toNumber();
846178
846266
  } catch (exception) {
@@ -846699,7 +846787,7 @@ var InvalidAddressBecauseAlreadyDelegated = createCustomErrorClass("InvalidAddre
846699
846787
  var UnsupportedTransactionMode = createCustomErrorClass("UnsupportedTransactionMode");
846700
846788
 
846701
846789
  // ../../libs/coin-modules/coin-tezos/lib-es/utils.js
846702
- var import_utils505 = __toESM(require_utils48());
846790
+ var import_utils504 = __toESM(require_utils48());
846703
846791
  var DEFAULT_LIMITS = {
846704
846792
  GAS: 2169n,
846705
846793
  STORAGE: 277n,
@@ -846747,7 +846835,7 @@ function normalizePublicKeyForAddress(maybeKey, address3) {
846747
846835
  derivationType = DerivationType.P256;
846748
846836
  prefix3 = PrefixV2.P256PublicKey;
846749
846837
  }
846750
- return b58Encode((0, import_utils505.compressPublicKey)(keyBuf, derivationType), prefix3);
846838
+ return b58Encode((0, import_utils504.compressPublicKey)(keyBuf, derivationType), prefix3);
846751
846839
  } catch {
846752
846840
  return void 0;
846753
846841
  }
@@ -847677,7 +847765,7 @@ var getNetworkAlpacaApi = (networkFamily) => ({
847677
847765
  });
847678
847766
 
847679
847767
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/utils.js
847680
- var import_bignumber355 = __toESM(require("bignumber.js"));
847768
+ var import_bignumber354 = __toESM(require("bignumber.js"));
847681
847769
  function findCryptoCurrencyByNetwork(network) {
847682
847770
  const networksRemap = {
847683
847771
  xrp: "ripple"
@@ -847706,13 +847794,13 @@ function adaptCoreOperationToLiveOperation(accountId2, op) {
847706
847794
  if (op.details?.memo) {
847707
847795
  extra.memo = op.details.memo;
847708
847796
  }
847709
- const bnFees = new import_bignumber355.default(op.tx.fees.toString());
847797
+ const bnFees = new import_bignumber354.default(op.tx.fees.toString());
847710
847798
  const res = {
847711
847799
  id: encodeOperationId(accountId2, op.tx.hash, op.type),
847712
847800
  hash: op.tx.hash,
847713
847801
  accountId: accountId2,
847714
847802
  type: opType,
847715
- 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()),
847716
847804
  fee: bnFees,
847717
847805
  blockHash: op.tx.block.hash,
847718
847806
  blockHeight: op.tx.block.height,
@@ -847783,8 +847871,8 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
847783
847871
  id: encodeOperationId(account3.id, "", type4),
847784
847872
  hash: "",
847785
847873
  type: type4,
847786
- value: subAccountId ? new import_bignumber355.default(fees2.toString()) : transaction.amount,
847787
- 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()),
847788
847876
  blockHash: null,
847789
847877
  blockHeight: null,
847790
847878
  senders: [account3.freshAddress.toString()],
@@ -847806,7 +847894,7 @@ var buildOptimisticOperation20 = (account3, transaction, sequenceNumber) => {
847806
847894
  hash: "",
847807
847895
  type: "OUT",
847808
847896
  value: transaction.useAllAmount ? tokenAccount.balance : transaction.amount,
847809
- fee: new import_bignumber355.default(0),
847897
+ fee: new import_bignumber354.default(0),
847810
847898
  blockHash: null,
847811
847899
  blockHeight: null,
847812
847900
  senders: [account3.freshAddress],
@@ -847845,17 +847933,17 @@ function getAlpacaApi(network, kind) {
847845
847933
  }
847846
847934
 
847847
847935
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/buildSubAccounts.js
847848
- var import_bignumber356 = __toESM(require("bignumber.js"));
847936
+ var import_bignumber355 = __toESM(require("bignumber.js"));
847849
847937
  function buildTokenAccount({ parentAccountId, assetBalance, token, operations: operations4 }) {
847850
847938
  const id7 = encodeTokenAccountId(parentAccountId, token);
847851
- const balance2 = new import_bignumber356.default(assetBalance.value.toString() || "0");
847852
- 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"));
847853
847941
  const tokenOperations = operations4.map((op) => ({
847854
847942
  ...op,
847855
847943
  id: encodeOperationId(id7, op.hash, op.extra?.ledgerOpType),
847856
847944
  accountId: id7,
847857
847945
  type: op.extra?.ledgerOpType,
847858
- 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
847859
847947
  }));
847860
847948
  return {
847861
847949
  type: "TokenAccount",
@@ -847873,15 +847961,15 @@ function buildTokenAccount({ parentAccountId, assetBalance, token, operations: o
847873
847961
  // calculated in the jsHelpers
847874
847962
  };
847875
847963
  }
847876
- 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 }) {
847877
847965
  const { blacklistedTokenIds = [] } = syncConfig;
847878
847966
  const allTokens = listTokensForCryptoCurrency(currency24);
847879
- if (allTokens.length === 0 || assetsBalance.length === 0) {
847880
- return void 0;
847881
- }
847882
847967
  const tokenAccounts = [];
847883
- assetsBalance.filter((b20) => b20.asset.type !== "native").map((balance2) => {
847884
- 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);
847885
847973
  if (token && !blacklistedTokenIds.includes(token.id)) {
847886
847974
  tokenAccounts.push(buildTokenAccount({
847887
847975
  parentAccountId: accountId2,
@@ -847890,7 +847978,7 @@ function buildSubAccounts4({ currency: currency24, accountId: accountId2, assets
847890
847978
  operations: operations4.filter((op) => op.extra.assetReference === balance2.asset?.["assetReference"] && op.extra.assetOwner === balance2.asset?.["assetOwner"])
847891
847979
  }));
847892
847980
  }
847893
- });
847981
+ }
847894
847982
  return tokenAccounts;
847895
847983
  }
847896
847984
 
@@ -847915,7 +848003,7 @@ function genericGetAccountShape(network, kind) {
847915
848003
  const blockInfo = await alpacaApi.lastBlock();
847916
848004
  const balanceRes = await alpacaApi.getBalance(address3);
847917
848005
  const nativeAsset = extractBalance(balanceRes, "native");
847918
- 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");
847919
848007
  const nativeBalance = BigInt(nativeAsset?.value ?? "0");
847920
848008
  const spendableBalance = BigInt(nativeBalance - BigInt(nativeAsset?.locked ?? "0"));
847921
848009
  const oldOps = (initialAccount?.operations || []).map((op) => op.accountId === accountId2 ? op : { ...op, accountId: accountId2, id: encodeOperationId(accountId2, op.hash, op.type) });
@@ -847937,14 +848025,14 @@ function genericGetAccountShape(network, kind) {
847937
848025
  assetOperations.push(operation);
847938
848026
  }
847939
848027
  });
847940
- const subAccounts = buildSubAccounts4({
848028
+ const subAccounts = await buildSubAccounts4({
847941
848029
  currency: currency24,
847942
848030
  accountId: accountId2,
847943
- assetsBalance,
848031
+ allTokenAssetsBalances,
847944
848032
  syncConfig,
847945
848033
  operations: assetOperations,
847946
848034
  getTokenFromAsset: alpacaApi.getTokenFromAsset
847947
- }) || [];
848035
+ });
847948
848036
  const operations4 = mergedOps.map((op) => {
847949
848037
  const subOperations = inferSubOperations(op.hash, subAccounts);
847950
848038
  return {
@@ -847956,8 +848044,8 @@ function genericGetAccountShape(network, kind) {
847956
848044
  id: accountId2,
847957
848045
  xpub: address3,
847958
848046
  blockHeight: operations4.length === 0 ? 0 : blockInfo.height || initialAccount?.blockHeight,
847959
- balance: new import_bignumber357.default(nativeBalance.toString()),
847960
- spendableBalance: new import_bignumber357.default(spendableBalance.toString()),
848047
+ balance: new import_bignumber356.default(nativeBalance.toString()),
848048
+ spendableBalance: new import_bignumber356.default(spendableBalance.toString()),
847961
848049
  operations: operations4,
847962
848050
  subAccounts,
847963
848051
  operationsCount: operations4.length
@@ -848066,7 +848154,7 @@ function getSigner(network) {
848066
848154
  }
848067
848155
 
848068
848156
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/prepareTransaction.js
848069
- var import_bignumber358 = __toESM(require("bignumber.js"));
848157
+ var import_bignumber357 = __toESM(require("bignumber.js"));
848070
848158
  function bnEq(a65, b20) {
848071
848159
  return !a65 && !b20 ? true : !a65 || !b20 ? false : a65.eq(b20);
848072
848160
  }
@@ -848086,15 +848174,15 @@ function genericPrepareTransaction(network, kind) {
848086
848174
  ...transaction
848087
848175
  }, computeIntentType2))).value;
848088
848176
  }
848089
- if (!bnEq(transaction.fees, new import_bignumber358.default(fees2.toString()))) {
848177
+ if (!bnEq(transaction.fees, new import_bignumber357.default(fees2.toString()))) {
848090
848178
  const next = {
848091
848179
  ...transaction,
848092
- fees: new import_bignumber358.default(fees2.toString()),
848180
+ fees: new import_bignumber357.default(fees2.toString()),
848093
848181
  assetReference,
848094
848182
  assetOwner,
848095
848183
  customFees: {
848096
848184
  parameters: {
848097
- fees: new import_bignumber358.default(fees2.toString())
848185
+ fees: new import_bignumber357.default(fees2.toString())
848098
848186
  }
848099
848187
  }
848100
848188
  };
@@ -848105,9 +848193,9 @@ function genericPrepareTransaction(network, kind) {
848105
848193
  if (params) {
848106
848194
  const storageLimit = params["storageLimit"];
848107
848195
  if (storageLimit !== void 0 && (typeof storageLimit === "bigint" || typeof storageLimit === "number" || typeof storageLimit === "string")) {
848108
- next.storageLimit = new import_bignumber358.default(storageLimit.toString());
848196
+ next.storageLimit = new import_bignumber357.default(storageLimit.toString());
848109
848197
  if (next.customFees?.parameters) {
848110
- next.customFees.parameters.storageLimit = new import_bignumber358.default(storageLimit.toString());
848198
+ next.customFees.parameters.storageLimit = new import_bignumber357.default(storageLimit.toString());
848111
848199
  }
848112
848200
  }
848113
848201
  }
@@ -848115,7 +848203,7 @@ function genericPrepareTransaction(network, kind) {
848115
848203
  const { amount } = await validateIntent5(transactionToIntent(account3, {
848116
848204
  ...transaction
848117
848205
  }, computeIntentType2));
848118
- next.amount = new import_bignumber358.default(amount.toString());
848206
+ next.amount = new import_bignumber357.default(amount.toString());
848119
848207
  }
848120
848208
  return next;
848121
848209
  }
@@ -848138,14 +848226,14 @@ function getAssetInfos(tr3, owner, getAssetFromToken3) {
848138
848226
 
848139
848227
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/getTransactionStatus.js
848140
848228
  init_lib_es();
848141
- var import_bignumber359 = __toESM(require("bignumber.js"));
848229
+ var import_bignumber358 = __toESM(require("bignumber.js"));
848142
848230
  function genericGetTransactionStatus(network, kind) {
848143
848231
  return async (account3, transaction) => {
848144
848232
  const alpacaApi = getAlpacaApi(account3.currency.id, kind);
848145
848233
  const draftTransaction = {
848146
848234
  mode: transaction?.mode ?? "send",
848147
848235
  recipient: transaction.recipient,
848148
- amount: transaction.amount ?? new import_bignumber359.default(0),
848236
+ amount: transaction.amount ?? new import_bignumber358.default(0),
848149
848237
  useAllAmount: !!transaction.useAllAmount,
848150
848238
  assetReference: transaction.assetReference || "",
848151
848239
  assetOwner: transaction.assetOwner || "",
@@ -848168,15 +848256,15 @@ function genericGetTransactionStatus(network, kind) {
848168
848256
  return {
848169
848257
  errors,
848170
848258
  warnings: warnings3,
848171
- estimatedFees: !transaction.fees || transaction.fees.isZero() ? new import_bignumber359.default(estimatedFees.toString()) : transaction.fees,
848172
- amount: transaction.amount.eq(0) ? new import_bignumber359.default(amount.toString()) : transaction.amount,
848173
- 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())
848174
848262
  };
848175
848263
  };
848176
848264
  }
848177
848265
 
848178
848266
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/createTransaction.js
848179
- var import_bignumber360 = __toESM(require("bignumber.js"));
848267
+ var import_bignumber359 = __toESM(require("bignumber.js"));
848180
848268
  function createTransaction41(account3) {
848181
848269
  const currency24 = account3.type === "TokenAccount" ? account3.token.parentCurrency : account3.currency;
848182
848270
  switch (currency24.family) {
@@ -848184,7 +848272,7 @@ function createTransaction41(account3) {
848184
848272
  case "ripple":
848185
848273
  return {
848186
848274
  family: currency24.family,
848187
- amount: (0, import_bignumber360.default)(0),
848275
+ amount: (0, import_bignumber359.default)(0),
848188
848276
  recipient: "",
848189
848277
  fees: null,
848190
848278
  tag: void 0,
@@ -848194,7 +848282,7 @@ function createTransaction41(account3) {
848194
848282
  case "stellar":
848195
848283
  return {
848196
848284
  family: currency24.family,
848197
- amount: new import_bignumber360.default(0),
848285
+ amount: new import_bignumber359.default(0),
848198
848286
  fees: null,
848199
848287
  recipient: "",
848200
848288
  memoValue: null,
@@ -848208,7 +848296,7 @@ function createTransaction41(account3) {
848208
848296
  case "tezos":
848209
848297
  return {
848210
848298
  family: currency24.family,
848211
- amount: new import_bignumber360.default(0),
848299
+ amount: new import_bignumber359.default(0),
848212
848300
  fees: null,
848213
848301
  recipient: "",
848214
848302
  useAllAmount: false,
@@ -848219,7 +848307,7 @@ function createTransaction41(account3) {
848219
848307
  return {
848220
848308
  mode: "send-eip1559",
848221
848309
  family: currency24.family,
848222
- amount: new import_bignumber360.default(0),
848310
+ amount: new import_bignumber359.default(0),
848223
848311
  recipient: "",
848224
848312
  useAllAmount: false,
848225
848313
  feesStrategy: "medium"
@@ -848231,7 +848319,7 @@ function createTransaction41(account3) {
848231
848319
  }
848232
848320
 
848233
848321
  // ../../libs/ledger-live-common/lib-es/bridge/generic-alpaca/estimateMaxSpendable.js
848234
- var import_bignumber361 = __toESM(require("bignumber.js"));
848322
+ var import_bignumber360 = __toESM(require("bignumber.js"));
848235
848323
  function genericEstimateMaxSpendable(network, kind) {
848236
848324
  return async ({ account: account3, parentAccount, transaction }) => {
848237
848325
  if (account3.type === "TokenAccount") {
@@ -848251,10 +848339,10 @@ function genericEstimateMaxSpendable(network, kind) {
848251
848339
  }
848252
848340
  const { amount } = await alpacaApi.validateIntent(transactionToIntent(account3, { ...draftTransaction }, alpacaApi.computeIntentType), { value: transaction?.fees ? BigInt(transaction.fees.toString()) : 0n });
848253
848341
  if (network === "stellar") {
848254
- 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);
848255
848343
  }
848256
- const bnFee = (0, import_bignumber361.default)(fees2.toString());
848257
- 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));
848258
848346
  };
848259
848347
  }
848260
848348
 
@@ -848268,7 +848356,7 @@ var genericBroadcast = (network, kind) => async ({ signedOperation: { signature:
848268
848356
  var import_rxjs154 = require("rxjs");
848269
848357
  init_lib_es();
848270
848358
  init_lib_es2();
848271
- var import_bignumber362 = __toESM(require("bignumber.js"));
848359
+ var import_bignumber361 = __toESM(require("bignumber.js"));
848272
848360
  function applyMemoToIntent(transactionIntent, transaction) {
848273
848361
  if (transaction.tag) {
848274
848362
  const txWithMemoTag = transactionIntent;
@@ -848317,7 +848405,7 @@ var genericSignOperation = (network, kind) => (signerContext4) => ({ account: ac
848317
848405
  data: transaction.data
848318
848406
  };
848319
848407
  const { amount } = await alpacaApi.validateIntent(transactionToIntent(account3, draftTransaction, alpacaApi.computeIntentType), { value: fees2 });
848320
- transaction.amount = new import_bignumber362.default(amount.toString());
848408
+ transaction.amount = new import_bignumber361.default(amount.toString());
848321
848409
  }
848322
848410
  const signedInfo = await signerContext4(deviceId, async (signer2) => {
848323
848411
  const derivationPath = account3.freshAddressPath;
@@ -848575,7 +848663,7 @@ ${head2}${sub}`;
848575
848663
  return (op) => format6(op, 0);
848576
848664
  };
848577
848665
  function maybeDisplaySumOfOpsIssue(ops, balance2, unit) {
848578
- 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));
848579
848667
  if (sumOfOps.eq(balance2))
848580
848668
  return "";
848581
848669
  return " (! sum of ops " + formatCurrencyUnit(unit, sumOfOps, {
@@ -848623,7 +848711,7 @@ var cliFormat = (account3, level2) => {
848623
848711
  };
848624
848712
  var stats = (account3) => {
848625
848713
  const { subAccounts, operations: operations4 } = account3;
848626
- 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));
848627
848715
  const sumOfAllOps = formatCurrencyUnit(getAccountCurrency(account3).units[0], sumOfAllOpsNumber, {
848628
848716
  showCode: true
848629
848717
  });
@@ -848648,7 +848736,7 @@ var operationBalanceHistoryBackwards = (account3) => {
848648
848736
  }).reverse());
848649
848737
  };
848650
848738
  var operationBalanceHistory = (account3) => {
848651
- let acc = new import_bignumber363.BigNumber(0);
848739
+ let acc = new import_bignumber362.BigNumber(0);
848652
848740
  return JSON.stringify(account3.operations.slice(0).reverse().map((op) => {
848653
848741
  acc = acc.plus(getOperationAmountNumberWithInternals(op));
848654
848742
  const { blockHeight } = op;
@@ -848752,37 +848840,37 @@ var toSignOperationEventRaw = (e36) => {
848752
848840
  var displayTokenValue = (token) => `${token.name} (#${extractTokenId(token.id)})`;
848753
848841
 
848754
848842
  // ../../libs/coin-modules/coin-cardano/lib-es/deviceTransactionConfig.js
848755
- var import_bignumber364 = __toESM(require("bignumber.js"));
848843
+ var import_bignumber363 = __toESM(require("bignumber.js"));
848756
848844
  var import_typhonjs12 = __toESM(require_dist6());
848757
848845
 
848758
848846
  // ../../libs/coin-modules/coin-casper/lib-es/bridge/deviceTransactionConfig.js
848759
848847
  init_lib_es2();
848760
848848
 
848761
848849
  // ../../libs/coin-modules/coin-evm/lib-es/deviceTransactionConfig.js
848762
- var import_bignumber365 = __toESM(require("bignumber.js"));
848850
+ var import_bignumber364 = __toESM(require("bignumber.js"));
848763
848851
 
848764
848852
  // ../../libs/coin-modules/coin-internet_computer/lib-es/bridge/deviceTransactionConfig.js
848765
848853
  init_lib_es2();
848766
848854
  var currency4 = getCryptoCurrencyById("internet_computer");
848767
848855
 
848768
848856
  // ../../libs/coin-modules/coin-multiversx/lib-es/deviceTransactionConfig.js
848769
- var import_bignumber366 = __toESM(require("bignumber.js"));
848857
+ var import_bignumber365 = __toESM(require("bignumber.js"));
848770
848858
 
848771
848859
  // ../../libs/coin-modules/coin-polkadot/lib-es/bridge/deviceTransactionConfig.js
848772
848860
  var currency5 = getCryptoCurrencyById("polkadot");
848773
848861
 
848774
848862
  // ../../libs/coin-modules/coin-solana/lib-es/deviceTransactionConfig.js
848775
- var import_bignumber367 = __toESM(require("bignumber.js"));
848863
+ var import_bignumber366 = __toESM(require("bignumber.js"));
848776
848864
 
848777
848865
  // ../../libs/coin-modules/coin-stacks/lib-es/bridge/deviceTransactionConfig.js
848778
- var import_bignumber368 = require("bignumber.js");
848866
+ var import_bignumber367 = require("bignumber.js");
848779
848867
 
848780
848868
  // ../../libs/coin-modules/coin-ton/lib-es/deviceTransactionConfig.js
848781
848869
  var import_core22 = __toESM(require_dist2());
848782
- var import_bignumber369 = require("bignumber.js");
848870
+ var import_bignumber368 = require("bignumber.js");
848783
848871
 
848784
848872
  // ../../libs/coin-modules/coin-algorand/lib-es/transaction.js
848785
- var import_bignumber370 = require("bignumber.js");
848873
+ var import_bignumber369 = require("bignumber.js");
848786
848874
  var formatTransaction2 = ({ mode, subAccountId, amount, recipient, fees: fees2, useAllAmount }, mainAccount) => {
848787
848875
  const account3 = subAccountId && (mainAccount.subAccounts || []).find((a65) => a65.id === subAccountId) || mainAccount;
848788
848876
  return `
@@ -848801,7 +848889,7 @@ var fromTransactionRaw2 = (tr3) => {
848801
848889
  return {
848802
848890
  ...common,
848803
848891
  family: tr3.family,
848804
- fees: tr3.fees ? new import_bignumber370.BigNumber(tr3.fees) : null,
848892
+ fees: tr3.fees ? new import_bignumber369.BigNumber(tr3.fees) : null,
848805
848893
  memo: tr3.memo,
848806
848894
  mode: tr3.mode,
848807
848895
  assetId: tr3.assetId
@@ -848828,7 +848916,7 @@ var transaction_default3 = {
848828
848916
  };
848829
848917
 
848830
848918
  // ../../libs/coin-modules/coin-aptos/lib-es/bridge/transaction.js
848831
- var import_bignumber371 = require("bignumber.js");
848919
+ var import_bignumber370 = require("bignumber.js");
848832
848920
  var formatTransaction3 = ({ mode, amount, fees: fees2, recipient, useAllAmount }, account3) => {
848833
848921
  return `
848834
848922
  ${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(account3.currency.units[0], amount)}
@@ -848842,7 +848930,7 @@ var fromTransactionRaw3 = (t46) => {
848842
848930
  family: t46.family,
848843
848931
  mode: t46.mode,
848844
848932
  options: JSON.parse(t46.options),
848845
- ...t46.fees && { fees: new import_bignumber371.BigNumber(t46.fees) },
848933
+ ...t46.fees && { fees: new import_bignumber370.BigNumber(t46.fees) },
848846
848934
  ...t46.errors && { errors: JSON.parse(t46.errors) }
848847
848935
  };
848848
848936
  };
@@ -848867,14 +848955,14 @@ var transaction_default4 = {
848867
848955
  };
848868
848956
 
848869
848957
  // ../../libs/coin-modules/coin-bitcoin/lib-es/transaction.js
848870
- var import_bignumber372 = require("bignumber.js");
848958
+ var import_bignumber371 = require("bignumber.js");
848871
848959
  var fromFeeItemsRaw = (fir) => ({
848872
848960
  items: fir.items.map((fi) => ({
848873
848961
  key: fi.key,
848874
848962
  speed: fi.speed,
848875
- feePerByte: new import_bignumber372.BigNumber(fi.feePerByte)
848963
+ feePerByte: new import_bignumber371.BigNumber(fi.feePerByte)
848876
848964
  })),
848877
- defaultFeePerByte: new import_bignumber372.BigNumber(fir.defaultFeePerByte)
848965
+ defaultFeePerByte: new import_bignumber371.BigNumber(fir.defaultFeePerByte)
848878
848966
  });
848879
848967
  var toFeeItemsRaw = (fir) => ({
848880
848968
  items: fir.items.map((fi) => ({
@@ -848891,7 +848979,7 @@ var fromTransactionRaw4 = (tr3) => {
848891
848979
  rbf: tr3.rbf,
848892
848980
  utxoStrategy: tr3.utxoStrategy,
848893
848981
  family: tr3.family,
848894
- feePerByte: tr3.feePerByte ? new import_bignumber372.BigNumber(tr3.feePerByte) : null,
848982
+ feePerByte: tr3.feePerByte ? new import_bignumber371.BigNumber(tr3.feePerByte) : null,
848895
848983
  networkInfo: tr3.networkInfo && {
848896
848984
  family: tr3.networkInfo.family,
848897
848985
  feeItems: fromFeeItemsRaw(tr3.networkInfo.feeItems)
@@ -848985,7 +849073,7 @@ var transaction_default5 = {
848985
849073
  };
848986
849074
 
848987
849075
  // ../../libs/coin-modules/coin-cardano/lib-es/transaction.js
848988
- var import_bignumber373 = require("bignumber.js");
849076
+ var import_bignumber372 = require("bignumber.js");
848989
849077
  var formatTransaction5 = ({ mode, amount, recipient, useAllAmount, subAccountId }, mainAccount) => {
848990
849078
  const account3 = subAccountId && (mainAccount.subAccounts || []).find((a65) => a65.id === subAccountId) || mainAccount;
848991
849079
  return `
@@ -849001,7 +849089,7 @@ var fromTransactionRaw5 = (tr3) => {
849001
849089
  ...common,
849002
849090
  family: tr3.family,
849003
849091
  mode: tr3.mode,
849004
- fees: tr3.fees ? new import_bignumber373.BigNumber(tr3.fees) : void 0,
849092
+ fees: tr3.fees ? new import_bignumber372.BigNumber(tr3.fees) : void 0,
849005
849093
  memo: tr3.memo,
849006
849094
  poolId: tr3.poolId,
849007
849095
  protocolParams: tr3.protocolParams
@@ -849029,7 +849117,7 @@ var transaction_default6 = {
849029
849117
  };
849030
849118
 
849031
849119
  // ../../libs/coin-modules/coin-casper/lib-es/bridge/transaction.js
849032
- var import_bignumber374 = __toESM(require("bignumber.js"));
849120
+ var import_bignumber373 = __toESM(require("bignumber.js"));
849033
849121
  var formatTransaction6 = ({ recipient, useAllAmount, amount }, account3) => `
849034
849122
  SEND ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849035
849123
  showCode: true,
@@ -849041,8 +849129,8 @@ var fromTransactionRaw6 = (tr3) => {
849041
849129
  return {
849042
849130
  ...common,
849043
849131
  family: tr3.family,
849044
- fees: new import_bignumber374.default(tr3.fees),
849045
- amount: new import_bignumber374.default(tr3.amount),
849132
+ fees: new import_bignumber373.default(tr3.fees),
849133
+ amount: new import_bignumber373.default(tr3.amount),
849046
849134
  transferId: tr3.transferId
849047
849135
  };
849048
849136
  };
@@ -849066,7 +849154,7 @@ var transaction_default7 = {
849066
849154
  };
849067
849155
 
849068
849156
  // ../../libs/coin-modules/coin-canton/lib-es/bridge/transaction.js
849069
- var import_bignumber375 = require("bignumber.js");
849157
+ var import_bignumber374 = require("bignumber.js");
849070
849158
  var formatTransaction7 = ({ amount, recipient, fee, useAllAmount }, account3) => `
849071
849159
  SEND ${useAllAmount ? "MAX" : formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849072
849160
  showCode: true,
@@ -849082,7 +849170,7 @@ var fromTransactionRaw7 = (tr3) => {
849082
849170
  return {
849083
849171
  ...common,
849084
849172
  family: tr3.family,
849085
- fee: tr3.fee ? new import_bignumber375.BigNumber(tr3.fee) : null,
849173
+ fee: tr3.fee ? new import_bignumber374.BigNumber(tr3.fee) : null,
849086
849174
  tokenId: tr3.tokenId
849087
849175
  };
849088
849176
  };
@@ -849105,7 +849193,7 @@ var transaction_default8 = {
849105
849193
  };
849106
849194
 
849107
849195
  // ../../libs/coin-modules/coin-celo/lib-es/bridge/transaction.js
849108
- var import_bignumber376 = require("bignumber.js");
849196
+ var import_bignumber375 = require("bignumber.js");
849109
849197
  var formatTransaction8 = (t46, account3) => `
849110
849198
  SEND ${t46.useAllAmount ? "MAX CELO" : formatCurrencyUnit(getAccountCurrency(account3).units[0], t46.amount, {
849111
849199
  showCode: true,
@@ -849117,7 +849205,7 @@ var fromTransactionRaw8 = (tr3) => {
849117
849205
  return {
849118
849206
  ...common,
849119
849207
  family: tr3.family,
849120
- fees: tr3.fees ? new import_bignumber376.BigNumber(tr3.fees) : null,
849208
+ fees: tr3.fees ? new import_bignumber375.BigNumber(tr3.fees) : null,
849121
849209
  mode: tr3.mode,
849122
849210
  index: tr3.index
849123
849211
  };
@@ -849142,7 +849230,7 @@ var transaction_default9 = {
849142
849230
  };
849143
849231
 
849144
849232
  // ../../libs/coin-modules/coin-cosmos/lib-es/transaction.js
849145
- var import_bignumber377 = require("bignumber.js");
849233
+ var import_bignumber376 = require("bignumber.js");
849146
849234
  var formatTransaction9 = ({ mode, amount, fees: fees2, recipient, validators: validators7, memo: memo3, sourceValidator, useAllAmount }, account3) => `
849147
849235
  ${mode.toUpperCase()} ${useAllAmount ? "MAX" : amount.isZero() ? "" : " " + formatCurrencyUnit(getAccountCurrency(account3).units[0], amount, {
849148
849236
  showCode: true,
@@ -849163,13 +849251,13 @@ var fromTransactionRaw9 = (tr3) => {
849163
849251
  mode: tr3.mode,
849164
849252
  networkInfo: networkInfo && {
849165
849253
  family: networkInfo.family,
849166
- fees: new import_bignumber377.BigNumber(networkInfo.fees)
849254
+ fees: new import_bignumber376.BigNumber(networkInfo.fees)
849167
849255
  },
849168
- fees: tr3.fees ? new import_bignumber377.BigNumber(tr3.fees) : null,
849169
- 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,
849170
849258
  memo: tr3.memo,
849171
849259
  sourceValidator: tr3.sourceValidator,
849172
- 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) })) : []
849173
849261
  };
849174
849262
  };
849175
849263
  var toTransactionRaw9 = (t46) => {
@@ -849200,6 +849288,7 @@ var transaction_default10 = {
849200
849288
  };
849201
849289
 
849202
849290
  // ../../libs/coin-modules/coin-hedera/lib-es/transaction.js
849291
+ var import_bignumber377 = __toESM(require("bignumber.js"));
849203
849292
  function formatTransaction10(transaction, account3) {
849204
849293
  const amount = formatCurrencyUnit(getAccountCurrency(account3).units[0], transaction.amount, {
849205
849294
  showCode: true,
@@ -849213,7 +849302,8 @@ function fromTransactionRaw10(tr3) {
849213
849302
  return {
849214
849303
  ...common,
849215
849304
  family: tr3.family,
849216
- memo: tr3.memo
849305
+ memo: tr3.memo,
849306
+ ...tr3.maxFee && { maxFee: new import_bignumber377.default(tr3.maxFee) }
849217
849307
  };
849218
849308
  }
849219
849309
  function toTransactionRaw10(t46) {
@@ -849221,7 +849311,8 @@ function toTransactionRaw10(t46) {
849221
849311
  return {
849222
849312
  ...common,
849223
849313
  family: t46.family,
849224
- memo: t46.memo
849314
+ memo: t46.memo,
849315
+ ...t46.maxFee && { maxFee: t46.maxFee.toString() }
849225
849316
  };
849226
849317
  }
849227
849318
  var transaction_default11 = {