@gearbox-protocol/deploy-tools 5.24.19 → 5.24.21

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/dist/index.mjs +860 -613
  2. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -4276,7 +4276,7 @@ var init_size = __esm({
4276
4276
  var version2;
4277
4277
  var init_version2 = __esm({
4278
4278
  "../../node_modules/viem/_esm/errors/version.js"() {
4279
- version2 = "2.23.15";
4279
+ version2 = "2.24.1";
4280
4280
  }
4281
4281
  });
4282
4282
 
@@ -10364,7 +10364,7 @@ function formatTransactionRequest(request) {
10364
10364
  }
10365
10365
  function formatAuthorizationList(authorizationList) {
10366
10366
  return authorizationList.map((authorization) => ({
10367
- address: authorization.contractAddress,
10367
+ address: authorization.address,
10368
10368
  r: authorization.r ? numberToHex(BigInt(authorization.r)) : authorization.r,
10369
10369
  s: authorization.s ? numberToHex(BigInt(authorization.s)) : authorization.s,
10370
10370
  chainId: numberToHex(authorization.chainId),
@@ -160907,7 +160907,7 @@ var require_version28 = __commonJS({
160907
160907
  "use strict";
160908
160908
  Object.defineProperty(exports2, "__esModule", { value: true });
160909
160909
  exports2.version = void 0;
160910
- exports2.version = "2.23.15";
160910
+ exports2.version = "2.24.1";
160911
160911
  }
160912
160912
  });
160913
160913
 
@@ -167697,9 +167697,9 @@ var require_toRlp = __commonJS({
167697
167697
  }
167698
167698
  });
167699
167699
 
167700
- // ../../node_modules/viem/_cjs/experimental/eip7702/utils/hashAuthorization.js
167700
+ // ../../node_modules/viem/_cjs/utils/authorization/hashAuthorization.js
167701
167701
  var require_hashAuthorization = __commonJS({
167702
- "../../node_modules/viem/_cjs/experimental/eip7702/utils/hashAuthorization.js"(exports2) {
167702
+ "../../node_modules/viem/_cjs/utils/authorization/hashAuthorization.js"(exports2) {
167703
167703
  "use strict";
167704
167704
  Object.defineProperty(exports2, "__esModule", { value: true });
167705
167705
  exports2.hashAuthorization = hashAuthorization2;
@@ -167709,12 +167709,13 @@ var require_hashAuthorization = __commonJS({
167709
167709
  var toRlp_js_1 = require_toRlp();
167710
167710
  var keccak256_js_1 = require_keccak256();
167711
167711
  function hashAuthorization2(parameters) {
167712
- const { chainId, contractAddress, nonce, to } = parameters;
167712
+ const { chainId, nonce, to } = parameters;
167713
+ const address = parameters.contractAddress ?? parameters.address;
167713
167714
  const hash2 = (0, keccak256_js_1.keccak256)((0, concat_js_1.concatHex)([
167714
167715
  "0x05",
167715
167716
  (0, toRlp_js_1.toRlp)([
167716
167717
  chainId ? (0, toHex_js_1.numberToHex)(chainId) : "0x",
167717
- contractAddress,
167718
+ address,
167718
167719
  nonce ? (0, toHex_js_1.numberToHex)(nonce) : "0x"
167719
167720
  ])
167720
167721
  ]));
@@ -167725,9 +167726,9 @@ var require_hashAuthorization = __commonJS({
167725
167726
  }
167726
167727
  });
167727
167728
 
167728
- // ../../node_modules/viem/_cjs/experimental/eip7702/utils/recoverAuthorizationAddress.js
167729
+ // ../../node_modules/viem/_cjs/utils/authorization/recoverAuthorizationAddress.js
167729
167730
  var require_recoverAuthorizationAddress = __commonJS({
167730
- "../../node_modules/viem/_cjs/experimental/eip7702/utils/recoverAuthorizationAddress.js"(exports2) {
167731
+ "../../node_modules/viem/_cjs/utils/authorization/recoverAuthorizationAddress.js"(exports2) {
167731
167732
  "use strict";
167732
167733
  Object.defineProperty(exports2, "__esModule", { value: true });
167733
167734
  exports2.recoverAuthorizationAddress = recoverAuthorizationAddress2;
@@ -168189,7 +168190,7 @@ var require_transactionRequest = __commonJS({
168189
168190
  exports2.defineTransactionRequest = (0, formatter_js_1.defineFormatter)("transactionRequest", formatTransactionRequest2);
168190
168191
  function formatAuthorizationList3(authorizationList) {
168191
168192
  return authorizationList.map((authorization) => ({
168192
- address: authorization.contractAddress,
168193
+ address: authorization.address,
168193
168194
  r: authorization.r ? (0, toHex_js_1.numberToHex)(BigInt(authorization.r)) : authorization.r,
168194
168195
  s: authorization.s ? (0, toHex_js_1.numberToHex)(BigInt(authorization.s)) : authorization.s,
168195
168196
  chainId: (0, toHex_js_1.numberToHex)(authorization.chainId),
@@ -168527,7 +168528,7 @@ var require_transaction4 = __commonJS({
168527
168528
  exports2.defineTransaction = (0, formatter_js_1.defineFormatter)("transaction", formatTransaction2);
168528
168529
  function formatAuthorizationList3(authorizationList) {
168529
168530
  return authorizationList.map((authorization) => ({
168530
- contractAddress: authorization.address,
168531
+ address: authorization.address,
168531
168532
  chainId: Number(authorization.chainId),
168532
168533
  nonce: Number(authorization.nonce),
168533
168534
  r: authorization.r,
@@ -169286,14 +169287,14 @@ var require_estimateGas2 = __commonJS({
169286
169287
  if (authorizationList) {
169287
169288
  const value2 = await (0, getBalance_js_1.getBalance)(client, { address: request.from });
169288
169289
  const estimates = await Promise.all(authorizationList.map(async (authorization) => {
169289
- const { contractAddress } = authorization;
169290
+ const { address } = authorization;
169290
169291
  const estimate2 = await estimateGas_rpc({
169291
169292
  block,
169292
169293
  request: {
169293
169294
  authorizationList: void 0,
169294
169295
  data,
169295
169296
  from: account?.address,
169296
- to: contractAddress,
169297
+ to: address,
169297
169298
  value: (0, toHex_js_1.numberToHex)(value2)
169298
169299
  },
169299
169300
  rpcStateOverride
@@ -178868,6 +178869,386 @@ var require_encodePacked = __commonJS({
178868
178869
  }
178869
178870
  });
178870
178871
 
178872
+ // ../../node_modules/viem/_cjs/utils/transaction/assertTransaction.js
178873
+ var require_assertTransaction = __commonJS({
178874
+ "../../node_modules/viem/_cjs/utils/transaction/assertTransaction.js"(exports2) {
178875
+ "use strict";
178876
+ Object.defineProperty(exports2, "__esModule", { value: true });
178877
+ exports2.assertTransactionEIP7702 = assertTransactionEIP77022;
178878
+ exports2.assertTransactionEIP4844 = assertTransactionEIP48442;
178879
+ exports2.assertTransactionEIP1559 = assertTransactionEIP15592;
178880
+ exports2.assertTransactionEIP2930 = assertTransactionEIP29302;
178881
+ exports2.assertTransactionLegacy = assertTransactionLegacy2;
178882
+ var kzg_js_1 = require_kzg();
178883
+ var number_js_1 = require_number3();
178884
+ var address_js_1 = require_address6();
178885
+ var base_js_1 = require_base2();
178886
+ var blob_js_1 = require_blob2();
178887
+ var chain_js_1 = require_chain();
178888
+ var node_js_1 = require_node3();
178889
+ var isAddress_js_1 = require_isAddress();
178890
+ var size_js_1 = require_size();
178891
+ var slice_js_1 = require_slice();
178892
+ var fromHex_js_1 = require_fromHex();
178893
+ function assertTransactionEIP77022(transaction) {
178894
+ const { authorizationList } = transaction;
178895
+ if (authorizationList) {
178896
+ for (const authorization of authorizationList) {
178897
+ const { chainId } = authorization;
178898
+ const address = authorization.address;
178899
+ if (!(0, isAddress_js_1.isAddress)(address))
178900
+ throw new address_js_1.InvalidAddressError({ address });
178901
+ if (chainId < 0)
178902
+ throw new chain_js_1.InvalidChainIdError({ chainId });
178903
+ }
178904
+ }
178905
+ assertTransactionEIP15592(transaction);
178906
+ }
178907
+ function assertTransactionEIP48442(transaction) {
178908
+ const { blobVersionedHashes } = transaction;
178909
+ if (blobVersionedHashes) {
178910
+ if (blobVersionedHashes.length === 0)
178911
+ throw new blob_js_1.EmptyBlobError();
178912
+ for (const hash2 of blobVersionedHashes) {
178913
+ const size_ = (0, size_js_1.size)(hash2);
178914
+ const version4 = (0, fromHex_js_1.hexToNumber)((0, slice_js_1.slice)(hash2, 0, 1));
178915
+ if (size_ !== 32)
178916
+ throw new blob_js_1.InvalidVersionedHashSizeError({ hash: hash2, size: size_ });
178917
+ if (version4 !== kzg_js_1.versionedHashVersionKzg)
178918
+ throw new blob_js_1.InvalidVersionedHashVersionError({
178919
+ hash: hash2,
178920
+ version: version4
178921
+ });
178922
+ }
178923
+ }
178924
+ assertTransactionEIP15592(transaction);
178925
+ }
178926
+ function assertTransactionEIP15592(transaction) {
178927
+ const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;
178928
+ if (chainId <= 0)
178929
+ throw new chain_js_1.InvalidChainIdError({ chainId });
178930
+ if (to && !(0, isAddress_js_1.isAddress)(to))
178931
+ throw new address_js_1.InvalidAddressError({ address: to });
178932
+ if (maxFeePerGas && maxFeePerGas > number_js_1.maxUint256)
178933
+ throw new node_js_1.FeeCapTooHighError({ maxFeePerGas });
178934
+ if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
178935
+ throw new node_js_1.TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
178936
+ }
178937
+ function assertTransactionEIP29302(transaction) {
178938
+ const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
178939
+ if (chainId <= 0)
178940
+ throw new chain_js_1.InvalidChainIdError({ chainId });
178941
+ if (to && !(0, isAddress_js_1.isAddress)(to))
178942
+ throw new address_js_1.InvalidAddressError({ address: to });
178943
+ if (maxPriorityFeePerGas || maxFeePerGas)
178944
+ throw new base_js_1.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
178945
+ if (gasPrice && gasPrice > number_js_1.maxUint256)
178946
+ throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
178947
+ }
178948
+ function assertTransactionLegacy2(transaction) {
178949
+ const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
178950
+ if (to && !(0, isAddress_js_1.isAddress)(to))
178951
+ throw new address_js_1.InvalidAddressError({ address: to });
178952
+ if (typeof chainId !== "undefined" && chainId <= 0)
178953
+ throw new chain_js_1.InvalidChainIdError({ chainId });
178954
+ if (maxPriorityFeePerGas || maxFeePerGas)
178955
+ throw new base_js_1.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
178956
+ if (gasPrice && gasPrice > number_js_1.maxUint256)
178957
+ throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
178958
+ }
178959
+ }
178960
+ });
178961
+
178962
+ // ../../node_modules/viem/_cjs/utils/transaction/serializeAccessList.js
178963
+ var require_serializeAccessList = __commonJS({
178964
+ "../../node_modules/viem/_cjs/utils/transaction/serializeAccessList.js"(exports2) {
178965
+ "use strict";
178966
+ Object.defineProperty(exports2, "__esModule", { value: true });
178967
+ exports2.serializeAccessList = serializeAccessList2;
178968
+ var address_js_1 = require_address6();
178969
+ var transaction_js_1 = require_transaction3();
178970
+ var isAddress_js_1 = require_isAddress();
178971
+ function serializeAccessList2(accessList) {
178972
+ if (!accessList || accessList.length === 0)
178973
+ return [];
178974
+ const serializedAccessList = [];
178975
+ for (let i = 0; i < accessList.length; i++) {
178976
+ const { address, storageKeys } = accessList[i];
178977
+ for (let j = 0; j < storageKeys.length; j++) {
178978
+ if (storageKeys[j].length - 2 !== 64) {
178979
+ throw new transaction_js_1.InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
178980
+ }
178981
+ }
178982
+ if (!(0, isAddress_js_1.isAddress)(address, { strict: false })) {
178983
+ throw new address_js_1.InvalidAddressError({ address });
178984
+ }
178985
+ serializedAccessList.push([address, storageKeys]);
178986
+ }
178987
+ return serializedAccessList;
178988
+ }
178989
+ }
178990
+ });
178991
+
178992
+ // ../../node_modules/viem/_cjs/utils/transaction/serializeTransaction.js
178993
+ var require_serializeTransaction = __commonJS({
178994
+ "../../node_modules/viem/_cjs/utils/transaction/serializeTransaction.js"(exports2) {
178995
+ "use strict";
178996
+ Object.defineProperty(exports2, "__esModule", { value: true });
178997
+ exports2.serializeTransaction = serializeTransaction3;
178998
+ exports2.toYParitySignatureArray = toYParitySignatureArray2;
178999
+ var transaction_js_1 = require_transaction3();
179000
+ var serializeAuthorizationList_js_1 = require_serializeAuthorizationList();
179001
+ var blobsToCommitments_js_1 = require_blobsToCommitments();
179002
+ var blobsToProofs_js_1 = require_blobsToProofs();
179003
+ var commitmentsToVersionedHashes_js_1 = require_commitmentsToVersionedHashes();
179004
+ var toBlobSidecars_js_1 = require_toBlobSidecars();
179005
+ var concat_js_1 = require_concat();
179006
+ var trim_js_1 = require_trim();
179007
+ var toHex_js_1 = require_toHex();
179008
+ var toRlp_js_1 = require_toRlp();
179009
+ var assertTransaction_js_1 = require_assertTransaction();
179010
+ var getTransactionType_js_1 = require_getTransactionType();
179011
+ var serializeAccessList_js_1 = require_serializeAccessList();
179012
+ function serializeTransaction3(transaction, signature) {
179013
+ const type = (0, getTransactionType_js_1.getTransactionType)(transaction);
179014
+ if (type === "eip1559")
179015
+ return serializeTransactionEIP15592(transaction, signature);
179016
+ if (type === "eip2930")
179017
+ return serializeTransactionEIP29302(transaction, signature);
179018
+ if (type === "eip4844")
179019
+ return serializeTransactionEIP48442(transaction, signature);
179020
+ if (type === "eip7702")
179021
+ return serializeTransactionEIP77022(transaction, signature);
179022
+ return serializeTransactionLegacy2(transaction, signature);
179023
+ }
179024
+ function serializeTransactionEIP77022(transaction, signature) {
179025
+ const { authorizationList, chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
179026
+ (0, assertTransaction_js_1.assertTransactionEIP7702)(transaction);
179027
+ const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
179028
+ const serializedAuthorizationList = (0, serializeAuthorizationList_js_1.serializeAuthorizationList)(authorizationList);
179029
+ return (0, concat_js_1.concatHex)([
179030
+ "0x04",
179031
+ (0, toRlp_js_1.toRlp)([
179032
+ (0, toHex_js_1.toHex)(chainId),
179033
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179034
+ maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
179035
+ maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
179036
+ gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179037
+ to ?? "0x",
179038
+ value ? (0, toHex_js_1.toHex)(value) : "0x",
179039
+ data ?? "0x",
179040
+ serializedAccessList,
179041
+ serializedAuthorizationList,
179042
+ ...toYParitySignatureArray2(transaction, signature)
179043
+ ])
179044
+ ]);
179045
+ }
179046
+ function serializeTransactionEIP48442(transaction, signature) {
179047
+ const { chainId, gas, nonce, to, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
179048
+ (0, assertTransaction_js_1.assertTransactionEIP4844)(transaction);
179049
+ let blobVersionedHashes = transaction.blobVersionedHashes;
179050
+ let sidecars = transaction.sidecars;
179051
+ if (transaction.blobs && (typeof blobVersionedHashes === "undefined" || typeof sidecars === "undefined")) {
179052
+ const blobs2 = typeof transaction.blobs[0] === "string" ? transaction.blobs : transaction.blobs.map((x) => (0, toHex_js_1.bytesToHex)(x));
179053
+ const kzg = transaction.kzg;
179054
+ const commitments2 = (0, blobsToCommitments_js_1.blobsToCommitments)({
179055
+ blobs: blobs2,
179056
+ kzg
179057
+ });
179058
+ if (typeof blobVersionedHashes === "undefined")
179059
+ blobVersionedHashes = (0, commitmentsToVersionedHashes_js_1.commitmentsToVersionedHashes)({
179060
+ commitments: commitments2
179061
+ });
179062
+ if (typeof sidecars === "undefined") {
179063
+ const proofs2 = (0, blobsToProofs_js_1.blobsToProofs)({ blobs: blobs2, commitments: commitments2, kzg });
179064
+ sidecars = (0, toBlobSidecars_js_1.toBlobSidecars)({ blobs: blobs2, commitments: commitments2, proofs: proofs2 });
179065
+ }
179066
+ }
179067
+ const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
179068
+ const serializedTransaction = [
179069
+ (0, toHex_js_1.toHex)(chainId),
179070
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179071
+ maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
179072
+ maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
179073
+ gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179074
+ to ?? "0x",
179075
+ value ? (0, toHex_js_1.toHex)(value) : "0x",
179076
+ data ?? "0x",
179077
+ serializedAccessList,
179078
+ maxFeePerBlobGas ? (0, toHex_js_1.toHex)(maxFeePerBlobGas) : "0x",
179079
+ blobVersionedHashes ?? [],
179080
+ ...toYParitySignatureArray2(transaction, signature)
179081
+ ];
179082
+ const blobs = [];
179083
+ const commitments = [];
179084
+ const proofs = [];
179085
+ if (sidecars)
179086
+ for (let i = 0; i < sidecars.length; i++) {
179087
+ const { blob, commitment, proof } = sidecars[i];
179088
+ blobs.push(blob);
179089
+ commitments.push(commitment);
179090
+ proofs.push(proof);
179091
+ }
179092
+ return (0, concat_js_1.concatHex)([
179093
+ "0x03",
179094
+ sidecars ? (0, toRlp_js_1.toRlp)([serializedTransaction, blobs, commitments, proofs]) : (0, toRlp_js_1.toRlp)(serializedTransaction)
179095
+ ]);
179096
+ }
179097
+ function serializeTransactionEIP15592(transaction, signature) {
179098
+ const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
179099
+ (0, assertTransaction_js_1.assertTransactionEIP1559)(transaction);
179100
+ const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
179101
+ const serializedTransaction = [
179102
+ (0, toHex_js_1.toHex)(chainId),
179103
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179104
+ maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
179105
+ maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
179106
+ gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179107
+ to ?? "0x",
179108
+ value ? (0, toHex_js_1.toHex)(value) : "0x",
179109
+ data ?? "0x",
179110
+ serializedAccessList,
179111
+ ...toYParitySignatureArray2(transaction, signature)
179112
+ ];
179113
+ return (0, concat_js_1.concatHex)([
179114
+ "0x02",
179115
+ (0, toRlp_js_1.toRlp)(serializedTransaction)
179116
+ ]);
179117
+ }
179118
+ function serializeTransactionEIP29302(transaction, signature) {
179119
+ const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;
179120
+ (0, assertTransaction_js_1.assertTransactionEIP2930)(transaction);
179121
+ const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
179122
+ const serializedTransaction = [
179123
+ (0, toHex_js_1.toHex)(chainId),
179124
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179125
+ gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : "0x",
179126
+ gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179127
+ to ?? "0x",
179128
+ value ? (0, toHex_js_1.toHex)(value) : "0x",
179129
+ data ?? "0x",
179130
+ serializedAccessList,
179131
+ ...toYParitySignatureArray2(transaction, signature)
179132
+ ];
179133
+ return (0, concat_js_1.concatHex)([
179134
+ "0x01",
179135
+ (0, toRlp_js_1.toRlp)(serializedTransaction)
179136
+ ]);
179137
+ }
179138
+ function serializeTransactionLegacy2(transaction, signature) {
179139
+ const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;
179140
+ (0, assertTransaction_js_1.assertTransactionLegacy)(transaction);
179141
+ let serializedTransaction = [
179142
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179143
+ gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : "0x",
179144
+ gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179145
+ to ?? "0x",
179146
+ value ? (0, toHex_js_1.toHex)(value) : "0x",
179147
+ data ?? "0x"
179148
+ ];
179149
+ if (signature) {
179150
+ const v = (() => {
179151
+ if (signature.v >= 35n) {
179152
+ const inferredChainId = (signature.v - 35n) / 2n;
179153
+ if (inferredChainId > 0)
179154
+ return signature.v;
179155
+ return 27n + (signature.v === 35n ? 0n : 1n);
179156
+ }
179157
+ if (chainId > 0)
179158
+ return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
179159
+ const v2 = 27n + (signature.v === 27n ? 0n : 1n);
179160
+ if (signature.v !== v2)
179161
+ throw new transaction_js_1.InvalidLegacyVError({ v: signature.v });
179162
+ return v2;
179163
+ })();
179164
+ const r = (0, trim_js_1.trim)(signature.r);
179165
+ const s = (0, trim_js_1.trim)(signature.s);
179166
+ serializedTransaction = [
179167
+ ...serializedTransaction,
179168
+ (0, toHex_js_1.toHex)(v),
179169
+ r === "0x00" ? "0x" : r,
179170
+ s === "0x00" ? "0x" : s
179171
+ ];
179172
+ } else if (chainId > 0) {
179173
+ serializedTransaction = [
179174
+ ...serializedTransaction,
179175
+ (0, toHex_js_1.toHex)(chainId),
179176
+ "0x",
179177
+ "0x"
179178
+ ];
179179
+ }
179180
+ return (0, toRlp_js_1.toRlp)(serializedTransaction);
179181
+ }
179182
+ function toYParitySignatureArray2(transaction, signature_) {
179183
+ const signature = signature_ ?? transaction;
179184
+ const { v, yParity } = signature;
179185
+ if (typeof signature.r === "undefined")
179186
+ return [];
179187
+ if (typeof signature.s === "undefined")
179188
+ return [];
179189
+ if (typeof v === "undefined" && typeof yParity === "undefined")
179190
+ return [];
179191
+ const r = (0, trim_js_1.trim)(signature.r);
179192
+ const s = (0, trim_js_1.trim)(signature.s);
179193
+ const yParity_ = (() => {
179194
+ if (typeof yParity === "number")
179195
+ return yParity ? (0, toHex_js_1.toHex)(1) : "0x";
179196
+ if (v === 0n)
179197
+ return "0x";
179198
+ if (v === 1n)
179199
+ return (0, toHex_js_1.toHex)(1);
179200
+ return v === 27n ? "0x" : (0, toHex_js_1.toHex)(1);
179201
+ })();
179202
+ return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
179203
+ }
179204
+ }
179205
+ });
179206
+
179207
+ // ../../node_modules/viem/_cjs/utils/authorization/serializeAuthorizationList.js
179208
+ var require_serializeAuthorizationList = __commonJS({
179209
+ "../../node_modules/viem/_cjs/utils/authorization/serializeAuthorizationList.js"(exports2) {
179210
+ "use strict";
179211
+ Object.defineProperty(exports2, "__esModule", { value: true });
179212
+ exports2.serializeAuthorizationList = serializeAuthorizationList2;
179213
+ var toHex_js_1 = require_toHex();
179214
+ var serializeTransaction_js_1 = require_serializeTransaction();
179215
+ function serializeAuthorizationList2(authorizationList) {
179216
+ if (!authorizationList || authorizationList.length === 0)
179217
+ return [];
179218
+ const serializedAuthorizationList = [];
179219
+ for (const authorization of authorizationList) {
179220
+ const { chainId, nonce, ...signature } = authorization;
179221
+ const contractAddress = authorization.address;
179222
+ serializedAuthorizationList.push([
179223
+ chainId ? (0, toHex_js_1.toHex)(chainId) : "0x",
179224
+ contractAddress,
179225
+ nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179226
+ ...(0, serializeTransaction_js_1.toYParitySignatureArray)({}, signature)
179227
+ ]);
179228
+ }
179229
+ return serializedAuthorizationList;
179230
+ }
179231
+ }
179232
+ });
179233
+
179234
+ // ../../node_modules/viem/_cjs/utils/authorization/verifyAuthorization.js
179235
+ var require_verifyAuthorization = __commonJS({
179236
+ "../../node_modules/viem/_cjs/utils/authorization/verifyAuthorization.js"(exports2) {
179237
+ "use strict";
179238
+ Object.defineProperty(exports2, "__esModule", { value: true });
179239
+ exports2.verifyAuthorization = verifyAuthorization;
179240
+ var getAddress_js_1 = require_getAddress();
179241
+ var isAddressEqual_js_1 = require_isAddressEqual();
179242
+ var recoverAuthorizationAddress_js_1 = require_recoverAuthorizationAddress();
179243
+ async function verifyAuthorization({ address, authorization, signature }) {
179244
+ return (0, isAddressEqual_js_1.isAddressEqual)((0, getAddress_js_1.getAddress)(address), await (0, recoverAuthorizationAddress_js_1.recoverAuthorizationAddress)({
179245
+ authorization,
179246
+ signature
179247
+ }));
179248
+ }
179249
+ }
179250
+ });
179251
+
178871
179252
  // ../../node_modules/viem/_cjs/utils/data/isBytes.js
178872
179253
  var require_isBytes = __commonJS({
178873
179254
  "../../node_modules/viem/_cjs/utils/data/isBytes.js"(exports2) {
@@ -179456,95 +179837,6 @@ var require_getSerializedTransactionType = __commonJS({
179456
179837
  }
179457
179838
  });
179458
179839
 
179459
- // ../../node_modules/viem/_cjs/utils/transaction/assertTransaction.js
179460
- var require_assertTransaction = __commonJS({
179461
- "../../node_modules/viem/_cjs/utils/transaction/assertTransaction.js"(exports2) {
179462
- "use strict";
179463
- Object.defineProperty(exports2, "__esModule", { value: true });
179464
- exports2.assertTransactionEIP7702 = assertTransactionEIP77022;
179465
- exports2.assertTransactionEIP4844 = assertTransactionEIP48442;
179466
- exports2.assertTransactionEIP1559 = assertTransactionEIP15592;
179467
- exports2.assertTransactionEIP2930 = assertTransactionEIP29302;
179468
- exports2.assertTransactionLegacy = assertTransactionLegacy2;
179469
- var kzg_js_1 = require_kzg();
179470
- var number_js_1 = require_number3();
179471
- var address_js_1 = require_address6();
179472
- var base_js_1 = require_base2();
179473
- var blob_js_1 = require_blob2();
179474
- var chain_js_1 = require_chain();
179475
- var node_js_1 = require_node3();
179476
- var isAddress_js_1 = require_isAddress();
179477
- var size_js_1 = require_size();
179478
- var slice_js_1 = require_slice();
179479
- var fromHex_js_1 = require_fromHex();
179480
- function assertTransactionEIP77022(transaction) {
179481
- const { authorizationList } = transaction;
179482
- if (authorizationList) {
179483
- for (const authorization of authorizationList) {
179484
- const { contractAddress, chainId } = authorization;
179485
- if (!(0, isAddress_js_1.isAddress)(contractAddress))
179486
- throw new address_js_1.InvalidAddressError({ address: contractAddress });
179487
- if (chainId < 0)
179488
- throw new chain_js_1.InvalidChainIdError({ chainId });
179489
- }
179490
- }
179491
- assertTransactionEIP15592(transaction);
179492
- }
179493
- function assertTransactionEIP48442(transaction) {
179494
- const { blobVersionedHashes } = transaction;
179495
- if (blobVersionedHashes) {
179496
- if (blobVersionedHashes.length === 0)
179497
- throw new blob_js_1.EmptyBlobError();
179498
- for (const hash2 of blobVersionedHashes) {
179499
- const size_ = (0, size_js_1.size)(hash2);
179500
- const version4 = (0, fromHex_js_1.hexToNumber)((0, slice_js_1.slice)(hash2, 0, 1));
179501
- if (size_ !== 32)
179502
- throw new blob_js_1.InvalidVersionedHashSizeError({ hash: hash2, size: size_ });
179503
- if (version4 !== kzg_js_1.versionedHashVersionKzg)
179504
- throw new blob_js_1.InvalidVersionedHashVersionError({
179505
- hash: hash2,
179506
- version: version4
179507
- });
179508
- }
179509
- }
179510
- assertTransactionEIP15592(transaction);
179511
- }
179512
- function assertTransactionEIP15592(transaction) {
179513
- const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;
179514
- if (chainId <= 0)
179515
- throw new chain_js_1.InvalidChainIdError({ chainId });
179516
- if (to && !(0, isAddress_js_1.isAddress)(to))
179517
- throw new address_js_1.InvalidAddressError({ address: to });
179518
- if (maxFeePerGas && maxFeePerGas > number_js_1.maxUint256)
179519
- throw new node_js_1.FeeCapTooHighError({ maxFeePerGas });
179520
- if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
179521
- throw new node_js_1.TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
179522
- }
179523
- function assertTransactionEIP29302(transaction) {
179524
- const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
179525
- if (chainId <= 0)
179526
- throw new chain_js_1.InvalidChainIdError({ chainId });
179527
- if (to && !(0, isAddress_js_1.isAddress)(to))
179528
- throw new address_js_1.InvalidAddressError({ address: to });
179529
- if (maxPriorityFeePerGas || maxFeePerGas)
179530
- throw new base_js_1.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
179531
- if (gasPrice && gasPrice > number_js_1.maxUint256)
179532
- throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
179533
- }
179534
- function assertTransactionLegacy2(transaction) {
179535
- const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
179536
- if (to && !(0, isAddress_js_1.isAddress)(to))
179537
- throw new address_js_1.InvalidAddressError({ address: to });
179538
- if (typeof chainId !== "undefined" && chainId <= 0)
179539
- throw new chain_js_1.InvalidChainIdError({ chainId });
179540
- if (maxPriorityFeePerGas || maxFeePerGas)
179541
- throw new base_js_1.BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
179542
- if (gasPrice && gasPrice > number_js_1.maxUint256)
179543
- throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
179544
- }
179545
- }
179546
- });
179547
-
179548
179840
  // ../../node_modules/viem/_cjs/utils/transaction/parseTransaction.js
179549
179841
  var require_parseTransaction = __commonJS({
179550
179842
  "../../node_modules/viem/_cjs/utils/transaction/parseTransaction.js"(exports2) {
@@ -179858,10 +180150,10 @@ var require_parseTransaction = __commonJS({
179858
180150
  function parseAuthorizationList(serializedAuthorizationList) {
179859
180151
  const authorizationList = [];
179860
180152
  for (let i = 0; i < serializedAuthorizationList.length; i++) {
179861
- const [chainId, contractAddress, nonce, yParity, r, s] = serializedAuthorizationList[i];
180153
+ const [chainId, address, nonce, yParity, r, s] = serializedAuthorizationList[i];
179862
180154
  authorizationList.push({
180155
+ address,
179863
180156
  chainId: (0, fromHex_js_1.hexToNumber)(chainId),
179864
- contractAddress,
179865
180157
  nonce: (0, fromHex_js_1.hexToNumber)(nonce),
179866
180158
  ...parseEIP155Signature([yParity, r, s])
179867
180159
  });
@@ -179881,277 +180173,6 @@ var require_parseTransaction = __commonJS({
179881
180173
  }
179882
180174
  });
179883
180175
 
179884
- // ../../node_modules/viem/_cjs/experimental/eip7702/utils/serializeAuthorizationList.js
179885
- var require_serializeAuthorizationList = __commonJS({
179886
- "../../node_modules/viem/_cjs/experimental/eip7702/utils/serializeAuthorizationList.js"(exports2) {
179887
- "use strict";
179888
- Object.defineProperty(exports2, "__esModule", { value: true });
179889
- exports2.serializeAuthorizationList = serializeAuthorizationList2;
179890
- var toHex_js_1 = require_toHex();
179891
- var serializeTransaction_js_1 = require_serializeTransaction();
179892
- function serializeAuthorizationList2(authorizationList) {
179893
- if (!authorizationList || authorizationList.length === 0)
179894
- return [];
179895
- const serializedAuthorizationList = [];
179896
- for (const authorization of authorizationList) {
179897
- const { contractAddress, chainId, nonce, ...signature } = authorization;
179898
- serializedAuthorizationList.push([
179899
- chainId ? (0, toHex_js_1.toHex)(chainId) : "0x",
179900
- contractAddress,
179901
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179902
- ...(0, serializeTransaction_js_1.toYParitySignatureArray)({}, signature)
179903
- ]);
179904
- }
179905
- return serializedAuthorizationList;
179906
- }
179907
- }
179908
- });
179909
-
179910
- // ../../node_modules/viem/_cjs/utils/transaction/serializeAccessList.js
179911
- var require_serializeAccessList = __commonJS({
179912
- "../../node_modules/viem/_cjs/utils/transaction/serializeAccessList.js"(exports2) {
179913
- "use strict";
179914
- Object.defineProperty(exports2, "__esModule", { value: true });
179915
- exports2.serializeAccessList = serializeAccessList2;
179916
- var address_js_1 = require_address6();
179917
- var transaction_js_1 = require_transaction3();
179918
- var isAddress_js_1 = require_isAddress();
179919
- function serializeAccessList2(accessList) {
179920
- if (!accessList || accessList.length === 0)
179921
- return [];
179922
- const serializedAccessList = [];
179923
- for (let i = 0; i < accessList.length; i++) {
179924
- const { address, storageKeys } = accessList[i];
179925
- for (let j = 0; j < storageKeys.length; j++) {
179926
- if (storageKeys[j].length - 2 !== 64) {
179927
- throw new transaction_js_1.InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
179928
- }
179929
- }
179930
- if (!(0, isAddress_js_1.isAddress)(address, { strict: false })) {
179931
- throw new address_js_1.InvalidAddressError({ address });
179932
- }
179933
- serializedAccessList.push([address, storageKeys]);
179934
- }
179935
- return serializedAccessList;
179936
- }
179937
- }
179938
- });
179939
-
179940
- // ../../node_modules/viem/_cjs/utils/transaction/serializeTransaction.js
179941
- var require_serializeTransaction = __commonJS({
179942
- "../../node_modules/viem/_cjs/utils/transaction/serializeTransaction.js"(exports2) {
179943
- "use strict";
179944
- Object.defineProperty(exports2, "__esModule", { value: true });
179945
- exports2.serializeTransaction = serializeTransaction3;
179946
- exports2.toYParitySignatureArray = toYParitySignatureArray2;
179947
- var transaction_js_1 = require_transaction3();
179948
- var blobsToCommitments_js_1 = require_blobsToCommitments();
179949
- var blobsToProofs_js_1 = require_blobsToProofs();
179950
- var commitmentsToVersionedHashes_js_1 = require_commitmentsToVersionedHashes();
179951
- var toBlobSidecars_js_1 = require_toBlobSidecars();
179952
- var concat_js_1 = require_concat();
179953
- var trim_js_1 = require_trim();
179954
- var toHex_js_1 = require_toHex();
179955
- var toRlp_js_1 = require_toRlp();
179956
- var serializeAuthorizationList_js_1 = require_serializeAuthorizationList();
179957
- var assertTransaction_js_1 = require_assertTransaction();
179958
- var getTransactionType_js_1 = require_getTransactionType();
179959
- var serializeAccessList_js_1 = require_serializeAccessList();
179960
- function serializeTransaction3(transaction, signature) {
179961
- const type = (0, getTransactionType_js_1.getTransactionType)(transaction);
179962
- if (type === "eip1559")
179963
- return serializeTransactionEIP15592(transaction, signature);
179964
- if (type === "eip2930")
179965
- return serializeTransactionEIP29302(transaction, signature);
179966
- if (type === "eip4844")
179967
- return serializeTransactionEIP48442(transaction, signature);
179968
- if (type === "eip7702")
179969
- return serializeTransactionEIP77022(transaction, signature);
179970
- return serializeTransactionLegacy2(transaction, signature);
179971
- }
179972
- function serializeTransactionEIP77022(transaction, signature) {
179973
- const { authorizationList, chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
179974
- (0, assertTransaction_js_1.assertTransactionEIP7702)(transaction);
179975
- const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
179976
- const serializedAuthorizationList = (0, serializeAuthorizationList_js_1.serializeAuthorizationList)(authorizationList);
179977
- return (0, concat_js_1.concatHex)([
179978
- "0x04",
179979
- (0, toRlp_js_1.toRlp)([
179980
- (0, toHex_js_1.toHex)(chainId),
179981
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
179982
- maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
179983
- maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
179984
- gas ? (0, toHex_js_1.toHex)(gas) : "0x",
179985
- to ?? "0x",
179986
- value ? (0, toHex_js_1.toHex)(value) : "0x",
179987
- data ?? "0x",
179988
- serializedAccessList,
179989
- serializedAuthorizationList,
179990
- ...toYParitySignatureArray2(transaction, signature)
179991
- ])
179992
- ]);
179993
- }
179994
- function serializeTransactionEIP48442(transaction, signature) {
179995
- const { chainId, gas, nonce, to, value, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
179996
- (0, assertTransaction_js_1.assertTransactionEIP4844)(transaction);
179997
- let blobVersionedHashes = transaction.blobVersionedHashes;
179998
- let sidecars = transaction.sidecars;
179999
- if (transaction.blobs && (typeof blobVersionedHashes === "undefined" || typeof sidecars === "undefined")) {
180000
- const blobs2 = typeof transaction.blobs[0] === "string" ? transaction.blobs : transaction.blobs.map((x) => (0, toHex_js_1.bytesToHex)(x));
180001
- const kzg = transaction.kzg;
180002
- const commitments2 = (0, blobsToCommitments_js_1.blobsToCommitments)({
180003
- blobs: blobs2,
180004
- kzg
180005
- });
180006
- if (typeof blobVersionedHashes === "undefined")
180007
- blobVersionedHashes = (0, commitmentsToVersionedHashes_js_1.commitmentsToVersionedHashes)({
180008
- commitments: commitments2
180009
- });
180010
- if (typeof sidecars === "undefined") {
180011
- const proofs2 = (0, blobsToProofs_js_1.blobsToProofs)({ blobs: blobs2, commitments: commitments2, kzg });
180012
- sidecars = (0, toBlobSidecars_js_1.toBlobSidecars)({ blobs: blobs2, commitments: commitments2, proofs: proofs2 });
180013
- }
180014
- }
180015
- const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
180016
- const serializedTransaction = [
180017
- (0, toHex_js_1.toHex)(chainId),
180018
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
180019
- maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
180020
- maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
180021
- gas ? (0, toHex_js_1.toHex)(gas) : "0x",
180022
- to ?? "0x",
180023
- value ? (0, toHex_js_1.toHex)(value) : "0x",
180024
- data ?? "0x",
180025
- serializedAccessList,
180026
- maxFeePerBlobGas ? (0, toHex_js_1.toHex)(maxFeePerBlobGas) : "0x",
180027
- blobVersionedHashes ?? [],
180028
- ...toYParitySignatureArray2(transaction, signature)
180029
- ];
180030
- const blobs = [];
180031
- const commitments = [];
180032
- const proofs = [];
180033
- if (sidecars)
180034
- for (let i = 0; i < sidecars.length; i++) {
180035
- const { blob, commitment, proof } = sidecars[i];
180036
- blobs.push(blob);
180037
- commitments.push(commitment);
180038
- proofs.push(proof);
180039
- }
180040
- return (0, concat_js_1.concatHex)([
180041
- "0x03",
180042
- sidecars ? (0, toRlp_js_1.toRlp)([serializedTransaction, blobs, commitments, proofs]) : (0, toRlp_js_1.toRlp)(serializedTransaction)
180043
- ]);
180044
- }
180045
- function serializeTransactionEIP15592(transaction, signature) {
180046
- const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
180047
- (0, assertTransaction_js_1.assertTransactionEIP1559)(transaction);
180048
- const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
180049
- const serializedTransaction = [
180050
- (0, toHex_js_1.toHex)(chainId),
180051
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
180052
- maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : "0x",
180053
- maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : "0x",
180054
- gas ? (0, toHex_js_1.toHex)(gas) : "0x",
180055
- to ?? "0x",
180056
- value ? (0, toHex_js_1.toHex)(value) : "0x",
180057
- data ?? "0x",
180058
- serializedAccessList,
180059
- ...toYParitySignatureArray2(transaction, signature)
180060
- ];
180061
- return (0, concat_js_1.concatHex)([
180062
- "0x02",
180063
- (0, toRlp_js_1.toRlp)(serializedTransaction)
180064
- ]);
180065
- }
180066
- function serializeTransactionEIP29302(transaction, signature) {
180067
- const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;
180068
- (0, assertTransaction_js_1.assertTransactionEIP2930)(transaction);
180069
- const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
180070
- const serializedTransaction = [
180071
- (0, toHex_js_1.toHex)(chainId),
180072
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
180073
- gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : "0x",
180074
- gas ? (0, toHex_js_1.toHex)(gas) : "0x",
180075
- to ?? "0x",
180076
- value ? (0, toHex_js_1.toHex)(value) : "0x",
180077
- data ?? "0x",
180078
- serializedAccessList,
180079
- ...toYParitySignatureArray2(transaction, signature)
180080
- ];
180081
- return (0, concat_js_1.concatHex)([
180082
- "0x01",
180083
- (0, toRlp_js_1.toRlp)(serializedTransaction)
180084
- ]);
180085
- }
180086
- function serializeTransactionLegacy2(transaction, signature) {
180087
- const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;
180088
- (0, assertTransaction_js_1.assertTransactionLegacy)(transaction);
180089
- let serializedTransaction = [
180090
- nonce ? (0, toHex_js_1.toHex)(nonce) : "0x",
180091
- gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : "0x",
180092
- gas ? (0, toHex_js_1.toHex)(gas) : "0x",
180093
- to ?? "0x",
180094
- value ? (0, toHex_js_1.toHex)(value) : "0x",
180095
- data ?? "0x"
180096
- ];
180097
- if (signature) {
180098
- const v = (() => {
180099
- if (signature.v >= 35n) {
180100
- const inferredChainId = (signature.v - 35n) / 2n;
180101
- if (inferredChainId > 0)
180102
- return signature.v;
180103
- return 27n + (signature.v === 35n ? 0n : 1n);
180104
- }
180105
- if (chainId > 0)
180106
- return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
180107
- const v2 = 27n + (signature.v === 27n ? 0n : 1n);
180108
- if (signature.v !== v2)
180109
- throw new transaction_js_1.InvalidLegacyVError({ v: signature.v });
180110
- return v2;
180111
- })();
180112
- const r = (0, trim_js_1.trim)(signature.r);
180113
- const s = (0, trim_js_1.trim)(signature.s);
180114
- serializedTransaction = [
180115
- ...serializedTransaction,
180116
- (0, toHex_js_1.toHex)(v),
180117
- r === "0x00" ? "0x" : r,
180118
- s === "0x00" ? "0x" : s
180119
- ];
180120
- } else if (chainId > 0) {
180121
- serializedTransaction = [
180122
- ...serializedTransaction,
180123
- (0, toHex_js_1.toHex)(chainId),
180124
- "0x",
180125
- "0x"
180126
- ];
180127
- }
180128
- return (0, toRlp_js_1.toRlp)(serializedTransaction);
180129
- }
180130
- function toYParitySignatureArray2(transaction, signature_) {
180131
- const signature = signature_ ?? transaction;
180132
- const { v, yParity } = signature;
180133
- if (typeof signature.r === "undefined")
180134
- return [];
180135
- if (typeof signature.s === "undefined")
180136
- return [];
180137
- if (typeof v === "undefined" && typeof yParity === "undefined")
180138
- return [];
180139
- const r = (0, trim_js_1.trim)(signature.r);
180140
- const s = (0, trim_js_1.trim)(signature.s);
180141
- const yParity_ = (() => {
180142
- if (typeof yParity === "number")
180143
- return yParity ? (0, toHex_js_1.toHex)(1) : "0x";
180144
- if (v === 0n)
180145
- return "0x";
180146
- if (v === 1n)
180147
- return (0, toHex_js_1.toHex)(1);
180148
- return v === 27n ? "0x" : (0, toHex_js_1.toHex)(1);
180149
- })();
180150
- return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
180151
- }
180152
- }
180153
- });
180154
-
180155
180176
  // ../../node_modules/viem/_cjs/errors/unit.js
180156
180177
  var require_unit2 = __commonJS({
180157
180178
  "../../node_modules/viem/_cjs/errors/unit.js"(exports2) {
@@ -180324,9 +180345,10 @@ var require_utils19 = __commonJS({
180324
180345
  "../../node_modules/viem/_cjs/utils/index.js"(exports2) {
180325
180346
  "use strict";
180326
180347
  Object.defineProperty(exports2, "__esModule", { value: true });
180327
- exports2.isAddress = exports2.getAddress = exports2.getCreate2Address = exports2.getCreateAddress = exports2.getContractAddress = exports2.publicKeyToAddress = exports2.parseAccount = exports2.formatAbiParams = exports2.formatAbiItem = exports2.formatAbiItemWithArgs = exports2.encodePacked = exports2.parseAbiParameters = exports2.parseAbiParameter = exports2.parseAbiItem = exports2.parseAbi = exports2.getAbiItem = exports2.parseEventLogs = exports2.encodeFunctionResult = exports2.encodeFunctionData = exports2.encodeEventTopics = exports2.encodeErrorResult = exports2.encodeDeployData = exports2.encodeAbiParameters = exports2.decodeFunctionResult = exports2.decodeFunctionData = exports2.decodeEventLog = exports2.decodeErrorResult = exports2.decodeAbiParameters = exports2.validateTypedData = exports2.serializeTypedData = exports2.stringify = exports2.getWebSocketRpcClient = exports2.socketClientCache = exports2.getSocketRpcClient = exports2.getHttpRpcClient = exports2.rpc = exports2.getSocket = exports2.integerRegex = exports2.bytesRegex = exports2.arrayRegex = exports2.getChainContractAddress = exports2.extractChain = exports2.defineChain = exports2.assertCurrentChain = exports2.offchainLookupSignature = exports2.offchainLookupAbiItem = exports2.offchainLookup = exports2.ccipFetch = exports2.ccipRequest = exports2.buildRequest = void 0;
180328
- exports2.getCallError = exports2.getNodeError = exports2.containsNodeError = exports2.fromRlp = exports2.hexToString = exports2.hexToNumber = exports2.hexToBigInt = exports2.hexToBool = exports2.fromHex = exports2.fromBytes = exports2.bytesToString = exports2.bytesToNumber = exports2.bytesToBool = exports2.bytesToBigint = exports2.bytesToBigInt = exports2.stringToHex = exports2.numberToHex = exports2.toHex = exports2.bytesToHex = exports2.boolToHex = exports2.stringToBytes = exports2.numberToBytes = exports2.hexToBytes = exports2.toBytes = exports2.boolToBytes = exports2.toRlp = exports2.extract = exports2.formatTransactionRequest = exports2.defineTransactionRequest = exports2.defineTransactionReceipt = exports2.formatLog = exports2.transactionType = exports2.formatTransaction = exports2.defineTransaction = exports2.formatBlock = exports2.defineBlock = exports2.trim = exports2.sliceHex = exports2.sliceBytes = exports2.slice = exports2.size = exports2.padHex = exports2.padBytes = exports2.pad = exports2.isHex = exports2.isBytes = exports2.concatHex = exports2.concatBytes = exports2.concat = exports2.isAddressEqual = void 0;
180329
- exports2.nonceManager = exports2.createNonceManager = exports2.parseGwei = exports2.parseEther = exports2.parseUnits = exports2.formatUnits = exports2.formatGwei = exports2.formatEther = exports2.serializeAccessList = exports2.serializeTransaction = exports2.parseTransaction = exports2.assertTransactionLegacy = exports2.assertTransactionEIP2930 = exports2.assertTransactionEIP1559 = exports2.assertRequest = exports2.getTransactionType = exports2.getSerializedTransactionType = exports2.serializeErc6492Signature = exports2.isErc6492Signature = exports2.parseErc6492Signature = exports2.hashMessage = exports2.verifyTypedData = exports2.verifyMessage = exports2.verifyHash = exports2.recoverTypedDataAddress = exports2.recoverPublicKey = exports2.recoverMessageAddress = exports2.recoverAddress = exports2.hashTypedData = exports2.hashStruct = exports2.ripemd160 = exports2.sha256 = exports2.keccak256 = exports2.isHash = exports2.toFunctionHash = exports2.toEventHash = exports2.getFunctionSignature = exports2.toFunctionSignature = exports2.getEventSignature = exports2.toEventSignature = exports2.getFunctionSelector = exports2.toFunctionSelector = exports2.getEventSelector = exports2.toEventSelector = exports2.defineFormatter = exports2.getAction = exports2.getTransactionError = exports2.getEstimateGasError = exports2.getContractError = void 0;
180348
+ exports2.getContractAddress = exports2.publicKeyToAddress = exports2.parseAccount = exports2.verifyAuthorization = exports2.serializeAuthorizationList = exports2.recoverAuthorizationAddress = exports2.hashAuthorization = exports2.formatAbiParams = exports2.formatAbiItem = exports2.formatAbiItemWithArgs = exports2.encodePacked = exports2.parseAbiParameters = exports2.parseAbiParameter = exports2.parseAbiItem = exports2.parseAbi = exports2.getAbiItem = exports2.parseEventLogs = exports2.encodeFunctionResult = exports2.encodeFunctionData = exports2.encodeEventTopics = exports2.encodeErrorResult = exports2.encodeDeployData = exports2.encodeAbiParameters = exports2.decodeFunctionResult = exports2.decodeFunctionData = exports2.decodeEventLog = exports2.decodeErrorResult = exports2.decodeAbiParameters = exports2.validateTypedData = exports2.serializeTypedData = exports2.stringify = exports2.getWebSocketRpcClient = exports2.socketClientCache = exports2.getSocketRpcClient = exports2.getHttpRpcClient = exports2.rpc = exports2.getSocket = exports2.integerRegex = exports2.bytesRegex = exports2.arrayRegex = exports2.getChainContractAddress = exports2.extractChain = exports2.defineChain = exports2.assertCurrentChain = exports2.offchainLookupSignature = exports2.offchainLookupAbiItem = exports2.offchainLookup = exports2.ccipFetch = exports2.ccipRequest = exports2.buildRequest = void 0;
180349
+ exports2.hexToString = exports2.hexToNumber = exports2.hexToBigInt = exports2.hexToBool = exports2.fromHex = exports2.fromBytes = exports2.bytesToString = exports2.bytesToNumber = exports2.bytesToBool = exports2.bytesToBigint = exports2.bytesToBigInt = exports2.stringToHex = exports2.numberToHex = exports2.toHex = exports2.bytesToHex = exports2.boolToHex = exports2.stringToBytes = exports2.numberToBytes = exports2.hexToBytes = exports2.toBytes = exports2.boolToBytes = exports2.toRlp = exports2.extract = exports2.formatTransactionRequest = exports2.defineTransactionRequest = exports2.defineTransactionReceipt = exports2.formatLog = exports2.transactionType = exports2.formatTransaction = exports2.defineTransaction = exports2.formatBlock = exports2.defineBlock = exports2.trim = exports2.sliceHex = exports2.sliceBytes = exports2.slice = exports2.size = exports2.padHex = exports2.padBytes = exports2.pad = exports2.isHex = exports2.isBytes = exports2.concatHex = exports2.concatBytes = exports2.concat = exports2.isAddressEqual = exports2.isAddress = exports2.getAddress = exports2.getCreate2Address = exports2.getCreateAddress = void 0;
180350
+ exports2.parseEther = exports2.parseUnits = exports2.formatUnits = exports2.formatGwei = exports2.formatEther = exports2.serializeAccessList = exports2.serializeTransaction = exports2.parseTransaction = exports2.assertTransactionLegacy = exports2.assertTransactionEIP2930 = exports2.assertTransactionEIP1559 = exports2.assertRequest = exports2.getTransactionType = exports2.getSerializedTransactionType = exports2.serializeErc6492Signature = exports2.isErc6492Signature = exports2.parseErc6492Signature = exports2.hashMessage = exports2.verifyTypedData = exports2.verifyMessage = exports2.verifyHash = exports2.recoverTypedDataAddress = exports2.recoverPublicKey = exports2.recoverMessageAddress = exports2.recoverAddress = exports2.hashTypedData = exports2.hashStruct = exports2.ripemd160 = exports2.sha256 = exports2.keccak256 = exports2.isHash = exports2.toFunctionHash = exports2.toEventHash = exports2.getFunctionSignature = exports2.toFunctionSignature = exports2.getEventSignature = exports2.toEventSignature = exports2.getFunctionSelector = exports2.toFunctionSelector = exports2.getEventSelector = exports2.toEventSelector = exports2.defineFormatter = exports2.getAction = exports2.getTransactionError = exports2.getEstimateGasError = exports2.getContractError = exports2.getCallError = exports2.getNodeError = exports2.containsNodeError = exports2.fromRlp = void 0;
180351
+ exports2.nonceManager = exports2.createNonceManager = exports2.parseGwei = void 0;
180330
180352
  var buildRequest_js_1 = require_buildRequest();
180331
180353
  Object.defineProperty(exports2, "buildRequest", { enumerable: true, get: function() {
180332
180354
  return buildRequest_js_1.buildRequest;
@@ -180486,6 +180508,22 @@ var require_utils19 = __commonJS({
180486
180508
  Object.defineProperty(exports2, "formatAbiParams", { enumerable: true, get: function() {
180487
180509
  return formatAbiItem_js_1.formatAbiParams;
180488
180510
  } });
180511
+ var hashAuthorization_js_1 = require_hashAuthorization();
180512
+ Object.defineProperty(exports2, "hashAuthorization", { enumerable: true, get: function() {
180513
+ return hashAuthorization_js_1.hashAuthorization;
180514
+ } });
180515
+ var recoverAuthorizationAddress_js_1 = require_recoverAuthorizationAddress();
180516
+ Object.defineProperty(exports2, "recoverAuthorizationAddress", { enumerable: true, get: function() {
180517
+ return recoverAuthorizationAddress_js_1.recoverAuthorizationAddress;
180518
+ } });
180519
+ var serializeAuthorizationList_js_1 = require_serializeAuthorizationList();
180520
+ Object.defineProperty(exports2, "serializeAuthorizationList", { enumerable: true, get: function() {
180521
+ return serializeAuthorizationList_js_1.serializeAuthorizationList;
180522
+ } });
180523
+ var verifyAuthorization_js_1 = require_verifyAuthorization();
180524
+ Object.defineProperty(exports2, "verifyAuthorization", { enumerable: true, get: function() {
180525
+ return verifyAuthorization_js_1.verifyAuthorization;
180526
+ } });
180489
180527
  var parseAccount_js_1 = require_parseAccount();
180490
180528
  Object.defineProperty(exports2, "parseAccount", { enumerable: true, get: function() {
180491
180529
  return parseAccount_js_1.parseAccount;
@@ -185953,6 +185991,52 @@ var require_getPermissions = __commonJS({
185953
185991
  }
185954
185992
  });
185955
185993
 
185994
+ // ../../node_modules/viem/_cjs/actions/wallet/prepareAuthorization.js
185995
+ var require_prepareAuthorization = __commonJS({
185996
+ "../../node_modules/viem/_cjs/actions/wallet/prepareAuthorization.js"(exports2) {
185997
+ "use strict";
185998
+ Object.defineProperty(exports2, "__esModule", { value: true });
185999
+ exports2.prepareAuthorization = prepareAuthorization2;
186000
+ var parseAccount_js_1 = require_parseAccount();
186001
+ var account_js_1 = require_account();
186002
+ var isAddressEqual_js_1 = require_isAddressEqual();
186003
+ var getAction_js_1 = require_getAction();
186004
+ var getChainId_js_1 = require_getChainId();
186005
+ var getTransactionCount_js_1 = require_getTransactionCount();
186006
+ async function prepareAuthorization2(client, parameters) {
186007
+ const { account: account_ = client.account, chainId, nonce } = parameters;
186008
+ if (!account_)
186009
+ throw new account_js_1.AccountNotFoundError({
186010
+ docsPath: "/docs/eip7702/prepareAuthorization"
186011
+ });
186012
+ const account = (0, parseAccount_js_1.parseAccount)(account_);
186013
+ const executor = (() => {
186014
+ if (!parameters.executor)
186015
+ return void 0;
186016
+ if (parameters.executor === "self")
186017
+ return parameters.executor;
186018
+ return (0, parseAccount_js_1.parseAccount)(parameters.executor);
186019
+ })();
186020
+ const authorization = {
186021
+ address: parameters.contractAddress ?? parameters.address,
186022
+ chainId,
186023
+ nonce
186024
+ };
186025
+ if (typeof authorization.chainId === "undefined")
186026
+ authorization.chainId = client.chain?.id ?? await (0, getAction_js_1.getAction)(client, getChainId_js_1.getChainId, "getChainId")({});
186027
+ if (typeof authorization.nonce === "undefined") {
186028
+ authorization.nonce = await (0, getAction_js_1.getAction)(client, getTransactionCount_js_1.getTransactionCount, "getTransactionCount")({
186029
+ address: account.address,
186030
+ blockTag: "pending"
186031
+ });
186032
+ if (executor === "self" || executor?.address && (0, isAddressEqual_js_1.isAddressEqual)(executor.address, account.address))
186033
+ authorization.nonce += 1;
186034
+ }
186035
+ return authorization;
186036
+ }
186037
+ }
186038
+ });
186039
+
185956
186040
  // ../../node_modules/viem/_cjs/actions/wallet/requestAddresses.js
185957
186041
  var require_requestAddresses = __commonJS({
185958
186042
  "../../node_modules/viem/_cjs/actions/wallet/requestAddresses.js"(exports2) {
@@ -185982,6 +186066,36 @@ var require_requestPermissions = __commonJS({
185982
186066
  }
185983
186067
  });
185984
186068
 
186069
+ // ../../node_modules/viem/_cjs/actions/wallet/signAuthorization.js
186070
+ var require_signAuthorization = __commonJS({
186071
+ "../../node_modules/viem/_cjs/actions/wallet/signAuthorization.js"(exports2) {
186072
+ "use strict";
186073
+ Object.defineProperty(exports2, "__esModule", { value: true });
186074
+ exports2.signAuthorization = signAuthorization3;
186075
+ var parseAccount_js_1 = require_parseAccount();
186076
+ var account_js_1 = require_account();
186077
+ var prepareAuthorization_js_1 = require_prepareAuthorization();
186078
+ async function signAuthorization3(client, parameters) {
186079
+ const { account: account_ = client.account } = parameters;
186080
+ if (!account_)
186081
+ throw new account_js_1.AccountNotFoundError({
186082
+ docsPath: "/docs/eip7702/signAuthorization"
186083
+ });
186084
+ const account = (0, parseAccount_js_1.parseAccount)(account_);
186085
+ if (!account.signAuthorization)
186086
+ throw new account_js_1.AccountTypeNotSupportedError({
186087
+ docsPath: "/docs/eip7702/signAuthorization",
186088
+ metaMessages: [
186089
+ "The `signAuthorization` Action does not support JSON-RPC Accounts."
186090
+ ],
186091
+ type: account.type
186092
+ });
186093
+ const authorization = await (0, prepareAuthorization_js_1.prepareAuthorization)(client, parameters);
186094
+ return account.signAuthorization(authorization);
186095
+ }
186096
+ }
186097
+ });
186098
+
185985
186099
  // ../../node_modules/viem/_cjs/actions/wallet/signMessage.js
185986
186100
  var require_signMessage = __commonJS({
185987
186101
  "../../node_modules/viem/_cjs/actions/wallet/signMessage.js"(exports2) {
@@ -186145,11 +186259,13 @@ var require_wallet3 = __commonJS({
186145
186259
  var deployContract_js_1 = require_deployContract();
186146
186260
  var getAddresses_js_1 = require_getAddresses();
186147
186261
  var getPermissions_js_1 = require_getPermissions();
186262
+ var prepareAuthorization_js_1 = require_prepareAuthorization();
186148
186263
  var prepareTransactionRequest_js_1 = require_prepareTransactionRequest();
186149
186264
  var requestAddresses_js_1 = require_requestAddresses();
186150
186265
  var requestPermissions_js_1 = require_requestPermissions();
186151
186266
  var sendRawTransaction_js_1 = require_sendRawTransaction();
186152
186267
  var sendTransaction_js_1 = require_sendTransaction();
186268
+ var signAuthorization_js_1 = require_signAuthorization();
186153
186269
  var signMessage_js_1 = require_signMessage();
186154
186270
  var signTransaction_js_1 = require_signTransaction();
186155
186271
  var signTypedData_js_1 = require_signTypedData();
@@ -186163,11 +186279,13 @@ var require_wallet3 = __commonJS({
186163
186279
  getAddresses: () => (0, getAddresses_js_1.getAddresses)(client),
186164
186280
  getChainId: () => (0, getChainId_js_1.getChainId)(client),
186165
186281
  getPermissions: () => (0, getPermissions_js_1.getPermissions)(client),
186282
+ prepareAuthorization: (args) => (0, prepareAuthorization_js_1.prepareAuthorization)(client, args),
186166
186283
  prepareTransactionRequest: (args) => (0, prepareTransactionRequest_js_1.prepareTransactionRequest)(client, args),
186167
186284
  requestAddresses: () => (0, requestAddresses_js_1.requestAddresses)(client),
186168
186285
  requestPermissions: (args) => (0, requestPermissions_js_1.requestPermissions)(client, args),
186169
186286
  sendRawTransaction: (args) => (0, sendRawTransaction_js_1.sendRawTransaction)(client, args),
186170
186287
  sendTransaction: (args) => (0, sendTransaction_js_1.sendTransaction)(client, args),
186288
+ signAuthorization: (args) => (0, signAuthorization_js_1.signAuthorization)(client, args),
186171
186289
  signMessage: (args) => (0, signMessage_js_1.signMessage)(client, args),
186172
186290
  signTransaction: (args) => (0, signTransaction_js_1.signTransaction)(client, args),
186173
186291
  signTypedData: (args) => (0, signTypedData_js_1.signTypedData)(client, args),
@@ -188003,7 +188121,7 @@ var require_actions = __commonJS({
188003
188121
  "use strict";
188004
188122
  Object.defineProperty(exports2, "__esModule", { value: true });
188005
188123
  exports2.watchPendingTransactions = exports2.watchEvent = exports2.watchBlockNumber = exports2.watchBlocks = exports2.simulateCalls = exports2.simulate = exports2.simulateBlocks = exports2.multicall = exports2.mine = exports2.loadState = exports2.increaseTime = exports2.impersonateAccount = exports2.getTransactionReceipt = exports2.getTransaction = exports2.getTransactionCount = exports2.getTransactionConfirmations = exports2.getStorageAt = exports2.getLogs = exports2.getGasPrice = exports2.getFilterLogs = exports2.getFilterChanges = exports2.getFeeHistory = exports2.getEip712Domain = exports2.getContractEvents = exports2.getCode = exports2.getBytecode = exports2.getChainId = exports2.getBlockTransactionCount = exports2.getBlockNumber = exports2.getBlock = exports2.getBlobBaseFee = exports2.getBalance = exports2.estimateGas = exports2.estimateMaxPriorityFeePerGas = exports2.estimateFeesPerGas = exports2.estimateContractGas = exports2.dumpState = exports2.createPendingTransactionFilter = exports2.createEventFilter = exports2.createContractEventFilter = exports2.createBlockFilter = exports2.createAccessList = exports2.call = exports2.getEnsText = exports2.getEnsResolver = exports2.getEnsName = exports2.getEnsAvatar = exports2.getEnsAddress = exports2.deployContract = exports2.addChain = void 0;
188006
- exports2.writeContract = exports2.watchContractEvent = exports2.watchAsset = exports2.verifyTypedData = exports2.verifyMessage = exports2.verifyHash = exports2.uninstallFilter = exports2.switchChain = exports2.stopImpersonatingAccount = exports2.simulateContract = exports2.signTypedData = exports2.signMessage = exports2.snapshot = exports2.setStorageAt = exports2.setRpcUrl = exports2.setNonce = exports2.setNextBlockTimestamp = exports2.setNextBlockBaseFeePerGas = exports2.setMinGasPrice = exports2.setLoggingEnabled = exports2.setIntervalMining = exports2.setCoinbase = exports2.setCode = exports2.setBlockTimestampInterval = exports2.setBlockGasLimit = exports2.setAutomine = exports2.setBalance = exports2.sendUnsignedTransaction = exports2.sendRawTransaction = exports2.signTransaction = exports2.sendTransaction = exports2.defaultPrepareTransactionRequestParameters = exports2.prepareTransactionRequest = exports2.revert = exports2.reset = exports2.removeBlockTimestampInterval = exports2.inspectTxpool = exports2.getTxpoolStatus = exports2.getTxpoolContent = exports2.getAutomine = exports2.dropTransaction = exports2.requestPermissions = exports2.requestAddresses = exports2.waitForTransactionReceipt = exports2.getProof = exports2.getPermissions = exports2.getAddresses = exports2.readContract = void 0;
188124
+ exports2.writeContract = exports2.watchContractEvent = exports2.watchAsset = exports2.verifyTypedData = exports2.verifyMessage = exports2.verifyHash = exports2.uninstallFilter = exports2.switchChain = exports2.stopImpersonatingAccount = exports2.simulateContract = exports2.signTypedData = exports2.signMessage = exports2.snapshot = exports2.setStorageAt = exports2.setRpcUrl = exports2.setNonce = exports2.setNextBlockTimestamp = exports2.setNextBlockBaseFeePerGas = exports2.setMinGasPrice = exports2.setLoggingEnabled = exports2.setIntervalMining = exports2.setCoinbase = exports2.setCode = exports2.setBlockTimestampInterval = exports2.setBlockGasLimit = exports2.setAutomine = exports2.setBalance = exports2.sendUnsignedTransaction = exports2.sendRawTransaction = exports2.signTransaction = exports2.signAuthorization = exports2.sendTransaction = exports2.defaultPrepareTransactionRequestParameters = exports2.prepareTransactionRequest = exports2.prepareAuthorization = exports2.revert = exports2.reset = exports2.removeBlockTimestampInterval = exports2.inspectTxpool = exports2.getTxpoolStatus = exports2.getTxpoolContent = exports2.getAutomine = exports2.dropTransaction = exports2.requestPermissions = exports2.requestAddresses = exports2.waitForTransactionReceipt = exports2.getProof = exports2.getPermissions = exports2.getAddresses = exports2.readContract = void 0;
188007
188125
  var addChain_js_1 = require_addChain();
188008
188126
  Object.defineProperty(exports2, "addChain", { enumerable: true, get: function() {
188009
188127
  return addChain_js_1.addChain;
@@ -188262,6 +188380,10 @@ var require_actions = __commonJS({
188262
188380
  Object.defineProperty(exports2, "revert", { enumerable: true, get: function() {
188263
188381
  return revert_js_1.revert;
188264
188382
  } });
188383
+ var prepareAuthorization_js_1 = require_prepareAuthorization();
188384
+ Object.defineProperty(exports2, "prepareAuthorization", { enumerable: true, get: function() {
188385
+ return prepareAuthorization_js_1.prepareAuthorization;
188386
+ } });
188265
188387
  var prepareTransactionRequest_js_1 = require_prepareTransactionRequest();
188266
188388
  Object.defineProperty(exports2, "prepareTransactionRequest", { enumerable: true, get: function() {
188267
188389
  return prepareTransactionRequest_js_1.prepareTransactionRequest;
@@ -188273,6 +188395,10 @@ var require_actions = __commonJS({
188273
188395
  Object.defineProperty(exports2, "sendTransaction", { enumerable: true, get: function() {
188274
188396
  return sendTransaction_js_1.sendTransaction;
188275
188397
  } });
188398
+ var signAuthorization_js_1 = require_signAuthorization();
188399
+ Object.defineProperty(exports2, "signAuthorization", { enumerable: true, get: function() {
188400
+ return signAuthorization_js_1.signAuthorization;
188401
+ } });
188276
188402
  var signTransaction_js_1 = require_signTransaction();
188277
188403
  Object.defineProperty(exports2, "signTransaction", { enumerable: true, get: function() {
188278
188404
  return signTransaction_js_1.signTransaction;
@@ -208322,7 +208448,7 @@ var require_config2 = __commonJS({
208322
208448
  { chainId: 39n, shortName: "u2u" },
208323
208449
  { chainId: 40n, shortName: "telosevm" },
208324
208450
  { chainId: 41n, shortName: "telosevmtestnet" },
208325
- { chainId: 42n, shortName: "kov" },
208451
+ { chainId: 42n, shortName: "lukso" },
208326
208452
  { chainId: 43n, shortName: "pangolin" },
208327
208453
  { chainId: 44n, shortName: "crab" },
208328
208454
  { chainId: 46n, shortName: "darwinia" },
@@ -208361,6 +208487,8 @@ var require_config2 = __commonJS({
208361
208487
  { chainId: 195n, shortName: "tokb" },
208362
208488
  { chainId: 196n, shortName: "okb" },
208363
208489
  { chainId: 204n, shortName: "opbnb" },
208490
+ { chainId: 228n, shortName: "fhe" },
208491
+ { chainId: 232n, shortName: "lens" },
208364
208492
  { chainId: 240n, shortName: "zkTCRO" },
208365
208493
  { chainId: 246n, shortName: "ewt" },
208366
208494
  { chainId: 250n, shortName: "ftm" },
@@ -208387,7 +208515,8 @@ var require_config2 = __commonJS({
208387
208515
  { chainId: 466n, shortName: "appchain" },
208388
208516
  { chainId: 478n, shortName: "formnetwork" },
208389
208517
  { chainId: 480n, shortName: "wc" },
208390
- { chainId: 530n, shortName: "FxCore" },
208518
+ { chainId: 530n, shortName: "pundiai" },
208519
+ { chainId: 545n, shortName: "flow-testnet" },
208391
208520
  { chainId: 570n, shortName: "sys-rollux" },
208392
208521
  { chainId: 588n, shortName: "metis-stardust" },
208393
208522
  { chainId: 592n, shortName: "astr" },
@@ -208396,10 +208525,12 @@ var require_config2 = __commonJS({
208396
208525
  { chainId: 648n, shortName: "ace" },
208397
208526
  { chainId: 686n, shortName: "kar" },
208398
208527
  { chainId: 690n, shortName: "redstone" },
208528
+ { chainId: 747n, shortName: "flow-mainnet" },
208399
208529
  { chainId: 787n, shortName: "aca" },
208400
208530
  { chainId: 919n, shortName: "modesep" },
208401
208531
  { chainId: 938n, shortName: "haust" },
208402
208532
  { chainId: 943n, shortName: "t4pls" },
208533
+ { chainId: 964n, shortName: "bittensor-evm-mainnet" },
208403
208534
  { chainId: 970n, shortName: "ccn" },
208404
208535
  { chainId: 995n, shortName: "5ire" },
208405
208536
  { chainId: 1001n, shortName: "baobab" },
@@ -208420,6 +208551,7 @@ var require_config2 = __commonJS({
208420
208551
  { chainId: 1285n, shortName: "mriver" },
208421
208552
  { chainId: 1287n, shortName: "mbase" },
208422
208553
  { chainId: 1294n, shortName: "bobabeam" },
208554
+ { chainId: 1315n, shortName: "story-aeneid" },
208423
208555
  { chainId: 1329n, shortName: "sei" },
208424
208556
  { chainId: 1337n, shortName: "geth" },
208425
208557
  { chainId: 1442n, shortName: "testnet-zkEVM-mango" },
@@ -208429,6 +208561,7 @@ var require_config2 = __commonJS({
208429
208561
  { chainId: 1625n, shortName: "gravity" },
208430
208562
  { chainId: 1663n, shortName: "Gobi" },
208431
208563
  { chainId: 1729n, shortName: "reya" },
208564
+ { chainId: 1740n, shortName: "metall2-testnet" },
208432
208565
  { chainId: 1750n, shortName: "metall2" },
208433
208566
  { chainId: 1807n, shortName: "rana" },
208434
208567
  { chainId: 1811n, shortName: "lif3-testnet" },
@@ -208452,7 +208585,9 @@ var require_config2 = __commonJS({
208452
208585
  { chainId: 2222n, shortName: "kava" },
208453
208586
  { chainId: 2331n, shortName: "rss3-testnet" },
208454
208587
  { chainId: 2358n, shortName: "kroma-sepolia" },
208588
+ { chainId: 2424n, shortName: "inevm-testnet" },
208455
208589
  { chainId: 2442n, shortName: "zkevm-testnet-cardona" },
208590
+ { chainId: 2741n, shortName: "abstract" },
208456
208591
  { chainId: 2810n, shortName: "hmorph" },
208457
208592
  { chainId: 2818n, shortName: "morph" },
208458
208593
  { chainId: 3338n, shortName: "PEAQ" },
@@ -208487,8 +208622,10 @@ var require_config2 = __commonJS({
208487
208622
  { chainId: 6322n, shortName: "aura" },
208488
208623
  { chainId: 6398n, shortName: "connext-sepolia" },
208489
208624
  { chainId: 6688n, shortName: "iris" },
208625
+ { chainId: 6880n, shortName: "mtt-network" },
208490
208626
  { chainId: 7000n, shortName: "zetachain-mainnet" },
208491
208627
  { chainId: 7001n, shortName: "zetachain-testnet" },
208628
+ { chainId: 7070n, shortName: "planq" },
208492
208629
  { chainId: 7171n, shortName: "bitrock" },
208493
208630
  { chainId: 7200n, shortName: "xsat" },
208494
208631
  { chainId: 7332n, shortName: "EON" },
@@ -208500,21 +208637,26 @@ var require_config2 = __commonJS({
208500
208637
  { chainId: 8194n, shortName: "ttqf" },
208501
208638
  { chainId: 8217n, shortName: "cypress" },
208502
208639
  { chainId: 8329n, shortName: "lrz" },
208640
+ { chainId: 8408n, shortName: "zentest" },
208503
208641
  { chainId: 8453n, shortName: "base" },
208642
+ { chainId: 8801n, shortName: "okto-testnet" },
208504
208643
  { chainId: 8822n, shortName: "iotaevm" },
208505
208644
  { chainId: 9000n, shortName: "evmos-testnet" },
208506
208645
  { chainId: 9001n, shortName: "evmos" },
208646
+ { chainId: 9369n, shortName: "z" },
208507
208647
  { chainId: 9700n, shortName: "MainnetDev" },
208508
208648
  { chainId: 9728n, shortName: "boba-testnet" },
208509
208649
  { chainId: 10000n, shortName: "smartbch" },
208510
208650
  { chainId: 10001n, shortName: "smartbchtest" },
208511
208651
  { chainId: 10081n, shortName: "joct" },
208652
+ { chainId: 10143n, shortName: "mon-testnet" },
208512
208653
  { chainId: 10200n, shortName: "chi" },
208513
208654
  { chainId: 10242n, shortName: "aa" },
208514
208655
  { chainId: 10243n, shortName: "aat" },
208515
208656
  { chainId: 10849n, shortName: "lamina1" },
208516
208657
  { chainId: 11011n, shortName: "shapesep" },
208517
208658
  { chainId: 11111n, shortName: "WAGMI" },
208659
+ { chainId: 11124n, shortName: "abstract-sepolia" },
208518
208660
  { chainId: 11235n, shortName: "islm" },
208519
208661
  { chainId: 11437n, shortName: "shyftt" },
208520
208662
  { chainId: 11501n, shortName: "bevm" },
@@ -208535,6 +208677,7 @@ var require_config2 = __commonJS({
208535
208677
  { chainId: 17172n, shortName: "eclipse" },
208536
208678
  { chainId: 18231n, shortName: "unreal-old" },
208537
208679
  { chainId: 18233n, shortName: "unreal" },
208680
+ { chainId: 18880n, shortName: "expchain" },
208538
208681
  { chainId: 22776n, shortName: "mapo" },
208539
208682
  { chainId: 23294n, shortName: "sapphire" },
208540
208683
  { chainId: 23295n, shortName: "sapphire-testnet" },
@@ -208565,6 +208708,8 @@ var require_config2 = __commonJS({
208565
208708
  { chainId: 47805n, shortName: "rei" },
208566
208709
  { chainId: 48899n, shortName: "zircuit-testnet" },
208567
208710
  { chainId: 48900n, shortName: "zircuit-mainnet" },
208711
+ { chainId: 53302n, shortName: "seedsep" },
208712
+ { chainId: 53456n, shortName: "birdlayer" },
208568
208713
  { chainId: 53457n, shortName: "dodochain" },
208569
208714
  { chainId: 54211n, shortName: "islmt" },
208570
208715
  { chainId: 56288n, shortName: "boba-bnb" },
@@ -208575,6 +208720,7 @@ var require_config2 = __commonJS({
208575
208720
  { chainId: 59140n, shortName: "linea-goerli" },
208576
208721
  { chainId: 59141n, shortName: "linea-sepolia" },
208577
208722
  { chainId: 59144n, shortName: "linea" },
208723
+ { chainId: 59902n, shortName: "metis-sepolia" },
208578
208724
  { chainId: 60808n, shortName: "bob" },
208579
208725
  { chainId: 61166n, shortName: "treasure" },
208580
208726
  { chainId: 71401n, shortName: "gw-testnet-v1" },
@@ -208642,6 +208788,7 @@ var require_config2 = __commonJS({
208642
208788
  { chainId: 11155111n, shortName: "sep" },
208643
208789
  { chainId: 11155420n, shortName: "opsep" },
208644
208790
  { chainId: 12227332n, shortName: "neox-t4" },
208791
+ { chainId: 21000000n, shortName: "corn" },
208645
208792
  { chainId: 52164803n, shortName: "fluence-testnet" },
208646
208793
  { chainId: 94204209n, shortName: "polygon-blackberry" },
208647
208794
  { chainId: 111557560n, shortName: "cysep" },
@@ -208657,9 +208804,11 @@ var require_config2 = __commonJS({
208657
208804
  { chainId: 476462898n, shortName: "Skopje" },
208658
208805
  { chainId: 666666666n, shortName: "degen-chain" },
208659
208806
  { chainId: 888888888n, shortName: "ancient8" },
208807
+ { chainId: 994873017n, shortName: "lumia-mainnet" },
208660
208808
  { chainId: 999999999n, shortName: "zsep" },
208661
208809
  { chainId: 1313161554n, shortName: "aurora" },
208662
208810
  { chainId: 1313161555n, shortName: "aurora-testnet" },
208811
+ { chainId: 1417429182n, shortName: "zephyr" },
208663
208812
  { chainId: 1511670449n, shortName: "GPT" },
208664
208813
  { chainId: 1570754601n, shortName: "hst-test" },
208665
208814
  { chainId: 1666600000n, shortName: "hmy-s0" },
@@ -217123,8 +217272,8 @@ var require_hoodi = __commonJS({
217123
217272
  },
217124
217273
  blockExplorers: {
217125
217274
  default: {
217126
- name: "Blockscout",
217127
- url: "https://hoodi.cloud.blockscout.com"
217275
+ name: "Etherscan",
217276
+ url: "https://hoodi.etherscan.io"
217128
217277
  }
217129
217278
  },
217130
217279
  testnet: true
@@ -217582,6 +217731,10 @@ var require_ink = __commonJS({
217582
217731
  }
217583
217732
  },
217584
217733
  contracts: {
217734
+ multicall3: {
217735
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
217736
+ blockCreated: 0
217737
+ },
217585
217738
  ...chainConfig_js_1.chainConfig.contracts,
217586
217739
  disputeGameFactory: {
217587
217740
  [sourceId3]: {
@@ -217633,6 +217786,10 @@ var require_inkSepolia = __commonJS({
217633
217786
  },
217634
217787
  contracts: {
217635
217788
  ...chainConfig_js_1.chainConfig.contracts,
217789
+ multicall3: {
217790
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
217791
+ blockCreated: 0
217792
+ },
217636
217793
  disputeGameFactory: {
217637
217794
  [sourceId3]: {
217638
217795
  address: "0x860e626c700af381133d9f4af31412a2d1db3d5d"
@@ -263079,7 +263236,7 @@ var require_toAccount = __commonJS({
263079
263236
  address: source.address,
263080
263237
  nonceManager: source.nonceManager,
263081
263238
  sign: source.sign,
263082
- experimental_signAuthorization: source.experimental_signAuthorization,
263239
+ signAuthorization: source.signAuthorization,
263083
263240
  signMessage: source.signMessage,
263084
263241
  signTransaction: source.signTransaction,
263085
263242
  signTypedData: source.signTypedData,
@@ -263124,23 +263281,24 @@ var require_sign2 = __commonJS({
263124
263281
  });
263125
263282
 
263126
263283
  // ../../node_modules/viem/_cjs/accounts/utils/signAuthorization.js
263127
- var require_signAuthorization = __commonJS({
263284
+ var require_signAuthorization2 = __commonJS({
263128
263285
  "../../node_modules/viem/_cjs/accounts/utils/signAuthorization.js"(exports2) {
263129
263286
  "use strict";
263130
263287
  Object.defineProperty(exports2, "__esModule", { value: true });
263131
- exports2.experimental_signAuthorization = experimental_signAuthorization2;
263288
+ exports2.signAuthorization = signAuthorization3;
263132
263289
  var hashAuthorization_js_1 = require_hashAuthorization();
263133
263290
  var sign_js_1 = require_sign2();
263134
- async function experimental_signAuthorization2(parameters) {
263135
- const { contractAddress, chainId, nonce, privateKey, to = "object" } = parameters;
263291
+ async function signAuthorization3(parameters) {
263292
+ const { chainId, nonce, privateKey, to = "object" } = parameters;
263293
+ const address = parameters.contractAddress ?? parameters.address;
263136
263294
  const signature = await (0, sign_js_1.sign)({
263137
- hash: (0, hashAuthorization_js_1.hashAuthorization)({ contractAddress, chainId, nonce }),
263295
+ hash: (0, hashAuthorization_js_1.hashAuthorization)({ address, chainId, nonce }),
263138
263296
  privateKey,
263139
263297
  to
263140
263298
  });
263141
263299
  if (to === "object")
263142
263300
  return {
263143
- contractAddress,
263301
+ address,
263144
263302
  chainId,
263145
263303
  nonce,
263146
263304
  ...signature
@@ -263222,7 +263380,7 @@ var require_privateKeyToAccount = __commonJS({
263222
263380
  var toAccount_js_1 = require_toAccount();
263223
263381
  var publicKeyToAddress_js_1 = require_publicKeyToAddress();
263224
263382
  var sign_js_1 = require_sign2();
263225
- var signAuthorization_js_1 = require_signAuthorization();
263383
+ var signAuthorization_js_1 = require_signAuthorization2();
263226
263384
  var signMessage_js_1 = require_signMessage2();
263227
263385
  var signTransaction_js_1 = require_signTransaction2();
263228
263386
  var signTypedData_js_1 = require_signTypedData2();
@@ -263236,8 +263394,8 @@ var require_privateKeyToAccount = __commonJS({
263236
263394
  async sign({ hash: hash2 }) {
263237
263395
  return (0, sign_js_1.sign)({ hash: hash2, privateKey, to: "hex" });
263238
263396
  },
263239
- async experimental_signAuthorization(authorization) {
263240
- return (0, signAuthorization_js_1.experimental_signAuthorization)({ ...authorization, privateKey });
263397
+ async signAuthorization(authorization) {
263398
+ return (0, signAuthorization_js_1.signAuthorization)({ ...authorization, privateKey });
263241
263399
  },
263242
263400
  async signMessage({ message: message2 }) {
263243
263401
  return (0, signMessage_js_1.signMessage)({ message: message2, privateKey });
@@ -263315,7 +263473,7 @@ var require_accounts = __commonJS({
263315
263473
  "../../node_modules/viem/_cjs/accounts/index.js"(exports2) {
263316
263474
  "use strict";
263317
263475
  Object.defineProperty(exports2, "__esModule", { value: true });
263318
- exports2.nonceManager = exports2.createNonceManager = exports2.privateKeyToAddress = exports2.publicKeyToAddress = exports2.parseAccount = exports2.signTypedData = exports2.signTransaction = exports2.signMessage = exports2.experimental_signAuthorization = exports2.serializeSignature = exports2.signatureToHex = exports2.sign = exports2.setSignEntropy = exports2.toAccount = exports2.privateKeyToAccount = exports2.mnemonicToAccount = exports2.hdKeyToAccount = exports2.generatePrivateKey = exports2.generateMnemonic = exports2.traditionalChinese = exports2.spanish = exports2.simplifiedChinese = exports2.portuguese = exports2.korean = exports2.japanese = exports2.italian = exports2.french = exports2.english = exports2.czech = exports2.HDKey = void 0;
263476
+ exports2.nonceManager = exports2.createNonceManager = exports2.privateKeyToAddress = exports2.publicKeyToAddress = exports2.parseAccount = exports2.signTypedData = exports2.signTransaction = exports2.signMessage = exports2.signAuthorization = exports2.serializeSignature = exports2.signatureToHex = exports2.sign = exports2.setSignEntropy = exports2.toAccount = exports2.privateKeyToAccount = exports2.mnemonicToAccount = exports2.hdKeyToAccount = exports2.generatePrivateKey = exports2.generateMnemonic = exports2.traditionalChinese = exports2.spanish = exports2.simplifiedChinese = exports2.portuguese = exports2.korean = exports2.japanese = exports2.italian = exports2.french = exports2.english = exports2.czech = exports2.HDKey = void 0;
263319
263477
  var bip32_1 = require_lib41();
263320
263478
  Object.defineProperty(exports2, "HDKey", { enumerable: true, get: function() {
263321
263479
  return bip32_1.HDKey;
@@ -263389,9 +263547,9 @@ var require_accounts = __commonJS({
263389
263547
  Object.defineProperty(exports2, "serializeSignature", { enumerable: true, get: function() {
263390
263548
  return serializeSignature_js_1.serializeSignature;
263391
263549
  } });
263392
- var signAuthorization_js_1 = require_signAuthorization();
263393
- Object.defineProperty(exports2, "experimental_signAuthorization", { enumerable: true, get: function() {
263394
- return signAuthorization_js_1.experimental_signAuthorization;
263550
+ var signAuthorization_js_1 = require_signAuthorization2();
263551
+ Object.defineProperty(exports2, "signAuthorization", { enumerable: true, get: function() {
263552
+ return signAuthorization_js_1.signAuthorization;
263395
263553
  } });
263396
263554
  var signMessage_js_1 = require_signMessage2();
263397
263555
  Object.defineProperty(exports2, "signMessage", { enumerable: true, get: function() {
@@ -264579,7 +264737,7 @@ var require_getProtocolKitVersion = __commonJS({
264579
264737
  "use strict";
264580
264738
  Object.defineProperty(exports2, "__esModule", { value: true });
264581
264739
  exports2.getProtocolKitVersion = void 0;
264582
- var getProtocolKitVersion = () => "5.2.4";
264740
+ var getProtocolKitVersion = () => "5.2.5";
264583
264741
  exports2.getProtocolKitVersion = getProtocolKitVersion;
264584
264742
  }
264585
264743
  });
@@ -344084,7 +344242,7 @@ async function recoverAddress({ hash: hash2, signature }) {
344084
344242
  return publicKeyToAddress(await recoverPublicKey({ hash: hash2, signature }));
344085
344243
  }
344086
344244
 
344087
- // ../../node_modules/viem/_esm/experimental/eip7702/utils/hashAuthorization.js
344245
+ // ../../node_modules/viem/_esm/utils/authorization/hashAuthorization.js
344088
344246
  init_concat();
344089
344247
  init_toBytes();
344090
344248
  init_toHex();
@@ -344182,15 +344340,16 @@ function getSizeOfLength(length) {
344182
344340
  throw new BaseError2("Length is too large.");
344183
344341
  }
344184
344342
 
344185
- // ../../node_modules/viem/_esm/experimental/eip7702/utils/hashAuthorization.js
344343
+ // ../../node_modules/viem/_esm/utils/authorization/hashAuthorization.js
344186
344344
  init_keccak256();
344187
344345
  function hashAuthorization(parameters) {
344188
- const { chainId, contractAddress, nonce, to } = parameters;
344346
+ const { chainId, nonce, to } = parameters;
344347
+ const address = parameters.contractAddress ?? parameters.address;
344189
344348
  const hash2 = keccak256(concatHex([
344190
344349
  "0x05",
344191
344350
  toRlp([
344192
344351
  chainId ? numberToHex(chainId) : "0x",
344193
- contractAddress,
344352
+ address,
344194
344353
  nonce ? numberToHex(nonce) : "0x"
344195
344354
  ])
344196
344355
  ]));
@@ -344199,7 +344358,7 @@ function hashAuthorization(parameters) {
344199
344358
  return hash2;
344200
344359
  }
344201
344360
 
344202
- // ../../node_modules/viem/_esm/experimental/eip7702/utils/recoverAuthorizationAddress.js
344361
+ // ../../node_modules/viem/_esm/utils/authorization/recoverAuthorizationAddress.js
344203
344362
  async function recoverAuthorizationAddress(parameters) {
344204
344363
  const { authorization, signature } = parameters;
344205
344364
  return recoverAddress({
@@ -344383,7 +344542,7 @@ function formatTransaction(transaction) {
344383
344542
  var defineTransaction = /* @__PURE__ */ defineFormatter("transaction", formatTransaction);
344384
344543
  function formatAuthorizationList2(authorizationList) {
344385
344544
  return authorizationList.map((authorization) => ({
344386
- contractAddress: authorization.address,
344545
+ address: authorization.address,
344387
344546
  chainId: Number(authorization.chainId),
344388
344547
  nonce: Number(authorization.nonce),
344389
344548
  r: authorization.r,
@@ -344951,14 +345110,14 @@ async function estimateGas(client, args) {
344951
345110
  if (authorizationList) {
344952
345111
  const value2 = await getBalance(client, { address: request.from });
344953
345112
  const estimates = await Promise.all(authorizationList.map(async (authorization) => {
344954
- const { contractAddress } = authorization;
345113
+ const { address } = authorization;
344955
345114
  const estimate2 = await estimateGas_rpc({
344956
345115
  block,
344957
345116
  request: {
344958
345117
  authorizationList: void 0,
344959
345118
  data,
344960
345119
  from: account?.address,
344961
- to: contractAddress,
345120
+ to: address,
344962
345121
  value: numberToHex(value2)
344963
345122
  },
344964
345123
  rpcStateOverride
@@ -347787,136 +347946,14 @@ function decodeFunctionData(parameters) {
347787
347946
  init_encodeFunctionData();
347788
347947
  init_formatAbiItem2();
347789
347948
 
347790
- // ../../node_modules/viem/_esm/utils/address/getContractAddress.js
347791
- init_concat();
347792
-
347793
- // ../../node_modules/viem/_esm/utils/data/isBytes.js
347794
- function isBytes3(value) {
347795
- if (!value)
347796
- return false;
347797
- if (typeof value !== "object")
347798
- return false;
347799
- if (!("BYTES_PER_ELEMENT" in value))
347800
- return false;
347801
- return value.BYTES_PER_ELEMENT === 1 && value.constructor.name === "Uint8Array";
347802
- }
347803
-
347804
- // ../../node_modules/viem/_esm/utils/address/getContractAddress.js
347805
- init_pad();
347806
- init_slice();
347807
- init_toBytes();
347808
- init_keccak256();
347809
- init_getAddress();
347810
- function getContractAddress2(opts) {
347811
- if (opts.opcode === "CREATE2")
347812
- return getCreate2Address(opts);
347813
- return getCreateAddress(opts);
347814
- }
347815
- function getCreateAddress(opts) {
347816
- const from5 = toBytes(getAddress(opts.from));
347817
- let nonce = toBytes(opts.nonce);
347818
- if (nonce[0] === 0)
347819
- nonce = new Uint8Array([]);
347820
- return getAddress(`0x${keccak256(toRlp([from5, nonce], "bytes")).slice(26)}`);
347821
- }
347822
- function getCreate2Address(opts) {
347823
- const from5 = toBytes(getAddress(opts.from));
347824
- const salt = pad(isBytes3(opts.salt) ? opts.salt : toBytes(opts.salt), {
347825
- size: 32
347826
- });
347827
- const bytecodeHash = (() => {
347828
- if ("bytecodeHash" in opts) {
347829
- if (isBytes3(opts.bytecodeHash))
347830
- return opts.bytecodeHash;
347831
- return toBytes(opts.bytecodeHash);
347832
- }
347833
- return keccak256(opts.bytecode, "bytes");
347834
- })();
347835
- return getAddress(slice(keccak256(concat([toBytes("0xff"), from5, salt, bytecodeHash])), 12));
347836
- }
347837
-
347838
- // ../../node_modules/viem/_esm/utils/formatters/transactionReceipt.js
347839
- init_fromHex();
347840
- init_formatter();
347841
- var receiptStatuses = {
347842
- "0x0": "reverted",
347843
- "0x1": "success"
347844
- };
347845
- function formatTransactionReceipt(transactionReceipt) {
347846
- const receipt = {
347847
- ...transactionReceipt,
347848
- blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
347849
- contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
347850
- cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
347851
- effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
347852
- gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
347853
- logs: transactionReceipt.logs ? transactionReceipt.logs.map((log2) => formatLog(log2)) : null,
347854
- to: transactionReceipt.to ? transactionReceipt.to : null,
347855
- transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
347856
- status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
347857
- type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
347858
- };
347859
- if (transactionReceipt.blobGasPrice)
347860
- receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
347861
- if (transactionReceipt.blobGasUsed)
347862
- receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
347863
- return receipt;
347864
- }
347865
- var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
347866
-
347867
- // ../../node_modules/viem/_esm/utils/index.js
347868
- init_fromHex();
347869
-
347870
- // ../../node_modules/viem/_esm/utils/signature/hashMessage.js
347871
- init_keccak256();
347872
-
347873
- // ../../node_modules/viem/_esm/constants/strings.js
347874
- var presignMessagePrefix = "Ethereum Signed Message:\n";
347875
-
347876
- // ../../node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
347877
- init_concat();
347878
- init_size();
347949
+ // ../../node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
347879
347950
  init_toHex();
347880
- function toPrefixedMessage(message_) {
347881
- const message2 = (() => {
347882
- if (typeof message_ === "string")
347883
- return stringToHex(message_);
347884
- if (typeof message_.raw === "string")
347885
- return message_.raw;
347886
- return bytesToHex(message_.raw);
347887
- })();
347888
- const prefix = stringToHex(`${presignMessagePrefix}${size(message2)}`);
347889
- return concat([prefix, message2]);
347890
- }
347891
347951
 
347892
- // ../../node_modules/viem/_esm/utils/signature/hashMessage.js
347893
- function hashMessage(message2, to_) {
347894
- return keccak256(toPrefixedMessage(message2), to_);
347895
- }
347896
-
347897
- // ../../node_modules/viem/_esm/constants/bytes.js
347898
- var erc6492MagicBytes = "0x6492649264926492649264926492649264926492649264926492649264926492";
347899
-
347900
- // ../../node_modules/viem/_esm/utils/signature/isErc6492Signature.js
347901
- init_slice();
347902
- function isErc6492Signature(signature) {
347903
- return sliceHex(signature, -32) === erc6492MagicBytes;
347904
- }
347905
-
347906
- // ../../node_modules/viem/_esm/utils/signature/serializeErc6492Signature.js
347907
- init_encodeAbiParameters();
347952
+ // ../../node_modules/viem/_esm/utils/transaction/serializeTransaction.js
347953
+ init_transaction();
347908
347954
  init_concat();
347909
- init_toBytes();
347910
- function serializeErc6492Signature(parameters) {
347911
- const { address, data, signature, to = "hex" } = parameters;
347912
- const signature_ = concatHex([
347913
- encodeAbiParameters([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], [address, data, signature]),
347914
- erc6492MagicBytes
347915
- ]);
347916
- if (to === "hex")
347917
- return signature_;
347918
- return hexToBytes(signature_);
347919
- }
347955
+ init_trim();
347956
+ init_toHex();
347920
347957
 
347921
347958
  // ../../node_modules/viem/_esm/utils/transaction/assertTransaction.js
347922
347959
  init_number();
@@ -347932,9 +347969,10 @@ function assertTransactionEIP7702(transaction) {
347932
347969
  const { authorizationList } = transaction;
347933
347970
  if (authorizationList) {
347934
347971
  for (const authorization of authorizationList) {
347935
- const { contractAddress, chainId } = authorization;
347936
- if (!isAddress(contractAddress))
347937
- throw new InvalidAddressError({ address: contractAddress });
347972
+ const { chainId } = authorization;
347973
+ const address = authorization.address;
347974
+ if (!isAddress(address))
347975
+ throw new InvalidAddressError({ address });
347938
347976
  if (chainId < 0)
347939
347977
  throw new InvalidChainIdError({ chainId });
347940
347978
  }
@@ -347994,30 +348032,6 @@ function assertTransactionLegacy(transaction) {
347994
348032
  throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
347995
348033
  }
347996
348034
 
347997
- // ../../node_modules/viem/_esm/utils/transaction/serializeTransaction.js
347998
- init_transaction();
347999
- init_concat();
348000
- init_trim();
348001
- init_toHex();
348002
-
348003
- // ../../node_modules/viem/_esm/experimental/eip7702/utils/serializeAuthorizationList.js
348004
- init_toHex();
348005
- function serializeAuthorizationList(authorizationList) {
348006
- if (!authorizationList || authorizationList.length === 0)
348007
- return [];
348008
- const serializedAuthorizationList = [];
348009
- for (const authorization of authorizationList) {
348010
- const { contractAddress, chainId, nonce, ...signature } = authorization;
348011
- serializedAuthorizationList.push([
348012
- chainId ? toHex(chainId) : "0x",
348013
- contractAddress,
348014
- nonce ? toHex(nonce) : "0x",
348015
- ...toYParitySignatureArray({}, signature)
348016
- ]);
348017
- }
348018
- return serializedAuthorizationList;
348019
- }
348020
-
348021
348035
  // ../../node_modules/viem/_esm/utils/transaction/serializeAccessList.js
348022
348036
  init_address();
348023
348037
  init_transaction();
@@ -348241,6 +348255,155 @@ function toYParitySignatureArray(transaction, signature_) {
348241
348255
  return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
348242
348256
  }
348243
348257
 
348258
+ // ../../node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
348259
+ function serializeAuthorizationList(authorizationList) {
348260
+ if (!authorizationList || authorizationList.length === 0)
348261
+ return [];
348262
+ const serializedAuthorizationList = [];
348263
+ for (const authorization of authorizationList) {
348264
+ const { chainId, nonce, ...signature } = authorization;
348265
+ const contractAddress = authorization.address;
348266
+ serializedAuthorizationList.push([
348267
+ chainId ? toHex(chainId) : "0x",
348268
+ contractAddress,
348269
+ nonce ? toHex(nonce) : "0x",
348270
+ ...toYParitySignatureArray({}, signature)
348271
+ ]);
348272
+ }
348273
+ return serializedAuthorizationList;
348274
+ }
348275
+
348276
+ // ../../node_modules/viem/_esm/utils/address/getContractAddress.js
348277
+ init_concat();
348278
+
348279
+ // ../../node_modules/viem/_esm/utils/data/isBytes.js
348280
+ function isBytes3(value) {
348281
+ if (!value)
348282
+ return false;
348283
+ if (typeof value !== "object")
348284
+ return false;
348285
+ if (!("BYTES_PER_ELEMENT" in value))
348286
+ return false;
348287
+ return value.BYTES_PER_ELEMENT === 1 && value.constructor.name === "Uint8Array";
348288
+ }
348289
+
348290
+ // ../../node_modules/viem/_esm/utils/address/getContractAddress.js
348291
+ init_pad();
348292
+ init_slice();
348293
+ init_toBytes();
348294
+ init_keccak256();
348295
+ init_getAddress();
348296
+ function getContractAddress2(opts) {
348297
+ if (opts.opcode === "CREATE2")
348298
+ return getCreate2Address(opts);
348299
+ return getCreateAddress(opts);
348300
+ }
348301
+ function getCreateAddress(opts) {
348302
+ const from5 = toBytes(getAddress(opts.from));
348303
+ let nonce = toBytes(opts.nonce);
348304
+ if (nonce[0] === 0)
348305
+ nonce = new Uint8Array([]);
348306
+ return getAddress(`0x${keccak256(toRlp([from5, nonce], "bytes")).slice(26)}`);
348307
+ }
348308
+ function getCreate2Address(opts) {
348309
+ const from5 = toBytes(getAddress(opts.from));
348310
+ const salt = pad(isBytes3(opts.salt) ? opts.salt : toBytes(opts.salt), {
348311
+ size: 32
348312
+ });
348313
+ const bytecodeHash = (() => {
348314
+ if ("bytecodeHash" in opts) {
348315
+ if (isBytes3(opts.bytecodeHash))
348316
+ return opts.bytecodeHash;
348317
+ return toBytes(opts.bytecodeHash);
348318
+ }
348319
+ return keccak256(opts.bytecode, "bytes");
348320
+ })();
348321
+ return getAddress(slice(keccak256(concat([toBytes("0xff"), from5, salt, bytecodeHash])), 12));
348322
+ }
348323
+
348324
+ // ../../node_modules/viem/_esm/utils/formatters/transactionReceipt.js
348325
+ init_fromHex();
348326
+ init_formatter();
348327
+ var receiptStatuses = {
348328
+ "0x0": "reverted",
348329
+ "0x1": "success"
348330
+ };
348331
+ function formatTransactionReceipt(transactionReceipt) {
348332
+ const receipt = {
348333
+ ...transactionReceipt,
348334
+ blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
348335
+ contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
348336
+ cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
348337
+ effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
348338
+ gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
348339
+ logs: transactionReceipt.logs ? transactionReceipt.logs.map((log2) => formatLog(log2)) : null,
348340
+ to: transactionReceipt.to ? transactionReceipt.to : null,
348341
+ transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
348342
+ status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
348343
+ type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
348344
+ };
348345
+ if (transactionReceipt.blobGasPrice)
348346
+ receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
348347
+ if (transactionReceipt.blobGasUsed)
348348
+ receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
348349
+ return receipt;
348350
+ }
348351
+ var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
348352
+
348353
+ // ../../node_modules/viem/_esm/utils/index.js
348354
+ init_fromHex();
348355
+
348356
+ // ../../node_modules/viem/_esm/utils/signature/hashMessage.js
348357
+ init_keccak256();
348358
+
348359
+ // ../../node_modules/viem/_esm/constants/strings.js
348360
+ var presignMessagePrefix = "Ethereum Signed Message:\n";
348361
+
348362
+ // ../../node_modules/viem/_esm/utils/signature/toPrefixedMessage.js
348363
+ init_concat();
348364
+ init_size();
348365
+ init_toHex();
348366
+ function toPrefixedMessage(message_) {
348367
+ const message2 = (() => {
348368
+ if (typeof message_ === "string")
348369
+ return stringToHex(message_);
348370
+ if (typeof message_.raw === "string")
348371
+ return message_.raw;
348372
+ return bytesToHex(message_.raw);
348373
+ })();
348374
+ const prefix = stringToHex(`${presignMessagePrefix}${size(message2)}`);
348375
+ return concat([prefix, message2]);
348376
+ }
348377
+
348378
+ // ../../node_modules/viem/_esm/utils/signature/hashMessage.js
348379
+ function hashMessage(message2, to_) {
348380
+ return keccak256(toPrefixedMessage(message2), to_);
348381
+ }
348382
+
348383
+ // ../../node_modules/viem/_esm/constants/bytes.js
348384
+ var erc6492MagicBytes = "0x6492649264926492649264926492649264926492649264926492649264926492";
348385
+
348386
+ // ../../node_modules/viem/_esm/utils/signature/isErc6492Signature.js
348387
+ init_slice();
348388
+ function isErc6492Signature(signature) {
348389
+ return sliceHex(signature, -32) === erc6492MagicBytes;
348390
+ }
348391
+
348392
+ // ../../node_modules/viem/_esm/utils/signature/serializeErc6492Signature.js
348393
+ init_encodeAbiParameters();
348394
+ init_concat();
348395
+ init_toBytes();
348396
+ function serializeErc6492Signature(parameters) {
348397
+ const { address, data, signature, to = "hex" } = parameters;
348398
+ const signature_ = concatHex([
348399
+ encodeAbiParameters([{ type: "address" }, { type: "bytes" }, { type: "bytes" }], [address, data, signature]),
348400
+ erc6492MagicBytes
348401
+ ]);
348402
+ if (to === "hex")
348403
+ return signature_;
348404
+ return hexToBytes(signature_);
348405
+ }
348406
+
348244
348407
  // ../../node_modules/viem/_esm/errors/unit.js
348245
348408
  init_base();
348246
348409
  var InvalidDecimalNumberError = class extends BaseError2 {
@@ -351385,6 +351548,41 @@ async function getPermissions(client) {
351385
351548
  return permissions;
351386
351549
  }
351387
351550
 
351551
+ // ../../node_modules/viem/_esm/actions/wallet/prepareAuthorization.js
351552
+ init_parseAccount();
351553
+ init_isAddressEqual();
351554
+ async function prepareAuthorization(client, parameters) {
351555
+ const { account: account_ = client.account, chainId, nonce } = parameters;
351556
+ if (!account_)
351557
+ throw new AccountNotFoundError({
351558
+ docsPath: "/docs/eip7702/prepareAuthorization"
351559
+ });
351560
+ const account = parseAccount(account_);
351561
+ const executor = (() => {
351562
+ if (!parameters.executor)
351563
+ return void 0;
351564
+ if (parameters.executor === "self")
351565
+ return parameters.executor;
351566
+ return parseAccount(parameters.executor);
351567
+ })();
351568
+ const authorization = {
351569
+ address: parameters.contractAddress ?? parameters.address,
351570
+ chainId,
351571
+ nonce
351572
+ };
351573
+ if (typeof authorization.chainId === "undefined")
351574
+ authorization.chainId = client.chain?.id ?? await getAction(client, getChainId, "getChainId")({});
351575
+ if (typeof authorization.nonce === "undefined") {
351576
+ authorization.nonce = await getAction(client, getTransactionCount, "getTransactionCount")({
351577
+ address: account.address,
351578
+ blockTag: "pending"
351579
+ });
351580
+ if (executor === "self" || executor?.address && isAddressEqual(executor.address, account.address))
351581
+ authorization.nonce += 1;
351582
+ }
351583
+ return authorization;
351584
+ }
351585
+
351388
351586
  // ../../node_modules/viem/_esm/actions/wallet/requestAddresses.js
351389
351587
  init_getAddress();
351390
351588
  async function requestAddresses(client) {
@@ -351400,6 +351598,27 @@ async function requestPermissions(client, permissions) {
351400
351598
  }, { retryCount: 0 });
351401
351599
  }
351402
351600
 
351601
+ // ../../node_modules/viem/_esm/actions/wallet/signAuthorization.js
351602
+ init_parseAccount();
351603
+ async function signAuthorization(client, parameters) {
351604
+ const { account: account_ = client.account } = parameters;
351605
+ if (!account_)
351606
+ throw new AccountNotFoundError({
351607
+ docsPath: "/docs/eip7702/signAuthorization"
351608
+ });
351609
+ const account = parseAccount(account_);
351610
+ if (!account.signAuthorization)
351611
+ throw new AccountTypeNotSupportedError({
351612
+ docsPath: "/docs/eip7702/signAuthorization",
351613
+ metaMessages: [
351614
+ "The `signAuthorization` Action does not support JSON-RPC Accounts."
351615
+ ],
351616
+ type: account.type
351617
+ });
351618
+ const authorization = await prepareAuthorization(client, parameters);
351619
+ return account.signAuthorization(authorization);
351620
+ }
351621
+
351403
351622
  // ../../node_modules/viem/_esm/actions/wallet/signMessage.js
351404
351623
  init_parseAccount();
351405
351624
  init_toHex();
@@ -351518,11 +351737,13 @@ function walletActions(client) {
351518
351737
  getAddresses: () => getAddresses(client),
351519
351738
  getChainId: () => getChainId(client),
351520
351739
  getPermissions: () => getPermissions(client),
351740
+ prepareAuthorization: (args) => prepareAuthorization(client, args),
351521
351741
  prepareTransactionRequest: (args) => prepareTransactionRequest(client, args),
351522
351742
  requestAddresses: () => requestAddresses(client),
351523
351743
  requestPermissions: (args) => requestPermissions(client, args),
351524
351744
  sendRawTransaction: (args) => sendRawTransaction(client, args),
351525
351745
  sendTransaction: (args) => sendTransaction(client, args),
351746
+ signAuthorization: (args) => signAuthorization(client, args),
351526
351747
  signMessage: (args) => signMessage(client, args),
351527
351748
  signTransaction: (args) => signTransaction(client, args),
351528
351749
  signTypedData: (args) => signTypedData(client, args),
@@ -363239,6 +363460,9 @@ var AddressMap = class {
363239
363460
  freeze() {
363240
363461
  this.#frozen = true;
363241
363462
  }
363463
+ get name() {
363464
+ return this.#name;
363465
+ }
363242
363466
  };
363243
363467
 
363244
363468
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/utils/bytes32ToString.js
@@ -382396,21 +382620,21 @@ var RouterV310Contract = class extends AbstractRouterContract {
382396
382620
  * Implements {@link IRouterContract.findAllSwaps}
382397
382621
  * @deprecated v3.0 legacy method
382398
382622
  */
382399
- findAllSwaps(props) {
382623
+ findAllSwaps(_) {
382400
382624
  throw ERR_NOT_IMPLEMENTED;
382401
382625
  }
382402
382626
  /**
382403
382627
  * Implements {@link IRouterContract.getAvailableConnectors}
382404
382628
  * @deprecated v3.0 legacy method
382405
382629
  */
382406
- getAvailableConnectors(collateralTokens) {
382630
+ getAvailableConnectors(_) {
382407
382631
  throw ERR_NOT_IMPLEMENTED;
382408
382632
  }
382409
382633
  /**
382410
382634
  * Implements {@link IRouterContract.getFindClosePathInput}
382411
382635
  * @deprecated v3.0 legacy method
382412
382636
  */
382413
- getFindClosePathInput(ca, cm, balances) {
382637
+ getFindClosePathInput(_, __, ___) {
382414
382638
  throw ERR_NOT_IMPLEMENTED;
382415
382639
  }
382416
382640
  };
@@ -382761,11 +382985,10 @@ var CreditAccountsService = class extends SDKConstruct {
382761
382985
  * Returns single credit account data, or undefined if it's not found
382762
382986
  * Performs all necessary price feed updates under the hood
382763
382987
  * @param account
382764
- * @param options
382988
+ * @param blockNumber
382765
382989
  * @returns
382766
382990
  */
382767
- async getCreditAccountData(account, options) {
382768
- const blockNumber = options?.blockNumber;
382991
+ async getCreditAccountData(account, blockNumber) {
382769
382992
  let raw;
382770
382993
  try {
382771
382994
  raw = await this.provider.publicClient.readContract({
@@ -382806,10 +383029,10 @@ var CreditAccountsService = class extends SDKConstruct {
382806
383029
  * TODO: do we want to expose "reverting"?
382807
383030
  * TODO: do we want to expose MarketFilter in any way? If so, we need to check that the MarketFilter is compatibled with attached markets?
382808
383031
  * @param args
382809
- * @param options
383032
+ * @param blockNumber
382810
383033
  * @returns returned credit accounts are sorted by health factor in ascending order
382811
383034
  */
382812
- async getCreditAccounts(args, options) {
383035
+ async getCreditAccounts(args, blockNumber) {
382813
383036
  const {
382814
383037
  creditManager,
382815
383038
  includeZeroDebt = false,
@@ -382843,7 +383066,7 @@ var CreditAccountsService = class extends SDKConstruct {
382843
383066
  // limit
382844
383067
  ] : [arg0, { ...caFilter, reverting }, offset],
382845
383068
  priceUpdateTxs,
382846
- options
383069
+ blockNumber
382847
383070
  );
382848
383071
  allCAs.push(...accounts);
382849
383072
  offset = newOffset;
@@ -383404,11 +383627,10 @@ var CreditAccountsService = class extends SDKConstruct {
383404
383627
  * Internal wrapper for CreditAccountCompressor.getCreditAccounts + price updates wrapped into multicall
383405
383628
  * @param args
383406
383629
  * @param priceUpdateTxs
383407
- * @param options
383630
+ * @param blockNumber
383408
383631
  * @returns
383409
383632
  */
383410
- async #getCreditAccounts(args, priceUpdateTxs, options) {
383411
- const blockNumber = options?.blockNumber;
383633
+ async #getCreditAccounts(args, priceUpdateTxs, blockNumber) {
383412
383634
  if (priceUpdateTxs?.length) {
383413
383635
  const [resp] = await simulateWithPriceUpdates(
383414
383636
  this.provider.publicClient,
@@ -383899,7 +384121,6 @@ var AbstractAddressProviderContract = class extends BaseContract {
383899
384121
  if (!version4) {
383900
384122
  throw new Error(`Latest version for ${contract} not found`);
383901
384123
  }
383902
- this.logger?.debug(`Latest version found for ${contract} : ${version4}`);
383903
384124
  return [this.getAddress(contract, version4), version4];
383904
384125
  }
383905
384126
  get state() {
@@ -390550,6 +390771,21 @@ var PriceFeedRegister = class extends SDKConstruct {
390550
390771
  }
390551
390772
  };
390552
390773
 
390774
+ // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/market/oracle/PriceFeedAnswerMap.js
390775
+ var PriceFeedAnswerMap = class extends AddressMap {
390776
+ price(token) {
390777
+ const answer = this.get(token);
390778
+ if (!answer) {
390779
+ throw new Error(`no answer found`);
390780
+ }
390781
+ const { success, price } = answer;
390782
+ if (!success) {
390783
+ throw new Error(`answer is not successful`);
390784
+ }
390785
+ return price;
390786
+ }
390787
+ };
390788
+
390553
390789
  // ../../node_modules/@gearbox-protocol/sdk/dist/esm/sdk/market/oracle/PriceOracleBaseContract.js
390554
390790
  var ZERO_PRICE_FEED = stringToHex("PRICE_FEED::ZERO", { size: 32 });
390555
390791
  var PriceOracleBaseContract = class extends BaseContract {
@@ -390572,24 +390808,16 @@ var PriceOracleBaseContract = class extends BaseContract {
390572
390808
  "reservePriceFeeds"
390573
390809
  );
390574
390810
  /**
390575
- * Mapping Token => Price in underlying
390811
+ * Mapping Token => Price in USD
390576
390812
  */
390577
- mainPrices = new AddressMap(void 0, "mainPrices");
390813
+ mainPrices = new PriceFeedAnswerMap(void 0, "mainPrices");
390578
390814
  /**
390579
- * Same, but with details
390815
+ * Mapping Token => Price in USD
390580
390816
  */
390581
- #mainPrices = new AddressMap();
390582
- /**
390583
- * Mapping Token => Price in underlying
390584
- */
390585
- reservePrices = new AddressMap(
390817
+ reservePrices = new PriceFeedAnswerMap(
390586
390818
  void 0,
390587
390819
  "reservePrices"
390588
390820
  );
390589
- /**
390590
- * Same, but with debug details
390591
- */
390592
- #reservePrices = new AddressMap();
390593
390821
  #priceFeedTree = [];
390594
390822
  constructor(sdk, args, data, underlying) {
390595
390823
  super(sdk, args);
@@ -390663,6 +390891,24 @@ var PriceOracleBaseContract = class extends BaseContract {
390663
390891
  );
390664
390892
  return result;
390665
390893
  }
390894
+ /**
390895
+ * Gets main price for given token
390896
+ * Throws if token price feed is not found or answer is not successful
390897
+ * @param token
390898
+ * @returns
390899
+ */
390900
+ mainPrice(token) {
390901
+ return this.mainPrices.price(token);
390902
+ }
390903
+ /**
390904
+ * Gets reserve price for given token
390905
+ * Throws if token price feed is not found or answer is not successful
390906
+ * @param token
390907
+ * @returns
390908
+ */
390909
+ reservePrice(token) {
390910
+ return this.reservePrices.price(token);
390911
+ }
390666
390912
  /**
390667
390913
  * Returns true if oracle's price feed tree contains given price feed
390668
390914
  * @param priceFeed
@@ -390694,9 +390940,9 @@ var PriceOracleBaseContract = class extends BaseContract {
390694
390940
  if (from5 === to) {
390695
390941
  return amount;
390696
390942
  }
390697
- const fromPrice = reserve ? this.reservePrices.mustGet(from5) : this.mainPrices.mustGet(from5);
390943
+ const fromPrice = reserve ? this.reservePrice(from5) : this.mainPrice(from5);
390698
390944
  const fromScale = 10n ** BigInt(this.sdk.tokensMeta.decimals(from5));
390699
- const toPrice = reserve ? this.reservePrices.mustGet(to) : this.mainPrices.mustGet(to);
390945
+ const toPrice = reserve ? this.reservePrice(to) : this.mainPrice(to);
390700
390946
  const toScale = 10n ** BigInt(this.sdk.tokensMeta.decimals(to));
390701
390947
  return amount * fromPrice * toScale / (toPrice * fromScale);
390702
390948
  }
@@ -390708,7 +390954,7 @@ var PriceOracleBaseContract = class extends BaseContract {
390708
390954
  * @param reserve
390709
390955
  */
390710
390956
  convertToUSD(from5, amount, reserve = false) {
390711
- const price = reserve ? this.reservePrices.mustGet(from5) : this.mainPrices.mustGet(from5);
390957
+ const price = reserve ? this.reservePrice(from5) : this.mainPrice(from5);
390712
390958
  const scale = 10n ** BigInt(this.sdk.tokensMeta.decimals(from5));
390713
390959
  return amount * price / scale;
390714
390960
  }
@@ -390766,22 +391012,16 @@ var PriceOracleBaseContract = class extends BaseContract {
390766
391012
  const priceFeedType = node?.baseParams.contractType;
390767
391013
  if (reserve) {
390768
391014
  this.reservePriceFeeds.upsert(token, ref);
390769
- if (price !== void 0) {
390770
- this.reservePrices.upsert(token, price);
390771
- }
391015
+ this.reservePrices.upsert(token, node?.answer);
390772
391016
  if (!price && priceFeedType !== ZERO_PRICE_FEED) {
390773
391017
  this.#noAnswerWarn(priceFeed, node);
390774
391018
  }
390775
- this.#reservePrices.upsert(token, node?.answer);
390776
391019
  } else {
390777
391020
  this.mainPriceFeeds.upsert(token, ref);
390778
- if (price !== void 0) {
390779
- this.mainPrices.upsert(token, price);
390780
- }
391021
+ this.mainPrices.upsert(token, node?.answer);
390781
391022
  if (!price && priceFeedType !== ZERO_PRICE_FEED) {
390782
391023
  this.#noAnswerWarn(priceFeed, node);
390783
391024
  }
390784
- this.#mainPrices.upsert(token, node?.answer);
390785
391025
  }
390786
391026
  this.#labelPriceFeed(priceFeed, reserve ? "Reserve" : "Main", token);
390787
391027
  });
@@ -390831,13 +391071,13 @@ var PriceOracleBaseContract = class extends BaseContract {
390831
391071
  this.reservePriceFeeds.entries().map(([token, v]) => [this.labelAddress(token), v.stateHuman(raw)])
390832
391072
  ),
390833
391073
  mainPrices: Object.fromEntries(
390834
- this.#mainPrices.entries().map(([token, answer]) => [
391074
+ this.mainPrices.entries().map(([token, answer]) => [
390835
391075
  this.labelAddress(token),
390836
391076
  formatAnswer(answer, raw)
390837
391077
  ])
390838
391078
  ),
390839
391079
  reservePrices: Object.fromEntries(
390840
- this.#reservePrices.entries().map(([token, answer]) => [
391080
+ this.reservePrices.entries().map(([token, answer]) => [
390841
391081
  this.labelAddress(token),
390842
391082
  formatAnswer(answer, raw)
390843
391083
  ])
@@ -392112,6 +392352,7 @@ var GearboxSDK = class _GearboxSDK {
392112
392352
  }
392113
392353
  /**
392114
392354
  * Converts contract call into some human-friendly string
392355
+ * This method is safe and should not throw
392115
392356
  * @param address
392116
392357
  * @param calldata
392117
392358
  * @returns
@@ -392122,6 +392363,7 @@ var GearboxSDK = class _GearboxSDK {
392122
392363
  }
392123
392364
  /**
392124
392365
  * Converts multicalls into some human-friendly strings
392366
+ * This method is safe and should not throw
392125
392367
  * @param address
392126
392368
  * @param calldata
392127
392369
  * @returns
@@ -413343,7 +413585,7 @@ function toAccount(source) {
413343
413585
  address: source.address,
413344
413586
  nonceManager: source.nonceManager,
413345
413587
  sign: source.sign,
413346
- experimental_signAuthorization: source.experimental_signAuthorization,
413588
+ signAuthorization: source.signAuthorization,
413347
413589
  signMessage: source.signMessage,
413348
413590
  signTransaction: source.signTransaction,
413349
413591
  signTypedData: source.signTypedData,
@@ -413372,16 +413614,17 @@ async function sign({ hash: hash2, privateKey, to = "object" }) {
413372
413614
  }
413373
413615
 
413374
413616
  // ../../node_modules/viem/_esm/accounts/utils/signAuthorization.js
413375
- async function experimental_signAuthorization(parameters) {
413376
- const { contractAddress, chainId, nonce, privateKey, to = "object" } = parameters;
413617
+ async function signAuthorization2(parameters) {
413618
+ const { chainId, nonce, privateKey, to = "object" } = parameters;
413619
+ const address = parameters.contractAddress ?? parameters.address;
413377
413620
  const signature = await sign({
413378
- hash: hashAuthorization({ contractAddress, chainId, nonce }),
413621
+ hash: hashAuthorization({ address, chainId, nonce }),
413379
413622
  privateKey,
413380
413623
  to
413381
413624
  });
413382
413625
  if (to === "object")
413383
413626
  return {
413384
- contractAddress,
413627
+ address,
413385
413628
  chainId,
413386
413629
  nonce,
413387
413630
  ...signature
@@ -413434,8 +413677,8 @@ function privateKeyToAccount(privateKey, options = {}) {
413434
413677
  async sign({ hash: hash2 }) {
413435
413678
  return sign({ hash: hash2, privateKey, to: "hex" });
413436
413679
  },
413437
- async experimental_signAuthorization(authorization) {
413438
- return experimental_signAuthorization({ ...authorization, privateKey });
413680
+ async signAuthorization(authorization) {
413681
+ return signAuthorization2({ ...authorization, privateKey });
413439
413682
  },
413440
413683
  async signMessage({ message: message2 }) {
413441
413684
  return signMessage2({ message: message2, privateKey });
@@ -421217,7 +421460,7 @@ var AdaptersPlugin = class extends SDKConstruct {
421217
421460
  }
421218
421461
  }
421219
421462
  }
421220
- stateHuman(raw) {
421463
+ stateHuman(_) {
421221
421464
  return {};
421222
421465
  }
421223
421466
  };
@@ -421478,7 +421721,7 @@ function getRenderer(opts) {
421478
421721
  var package_default = {
421479
421722
  name: "@gearbox-protocol/deploy-tools",
421480
421723
  description: "Gearbox deploy tools",
421481
- version: "5.24.19",
421724
+ version: "5.24.21",
421482
421725
  homepage: "https://gearbox.fi",
421483
421726
  keywords: [
421484
421727
  "gearbox"
@@ -421521,10 +421764,10 @@ var package_default = {
421521
421764
  "@gearbox-protocol/deploy-tools-node": "0.0.0",
421522
421765
  "@gearbox-protocol/deploy-tools-shared": "0.0.0",
421523
421766
  "@gearbox-protocol/deploy-tools-types": "0.0.0",
421524
- "@gearbox-protocol/sdk": "3.0.0-vfour.344",
421767
+ "@gearbox-protocol/sdk": "3.0.0-vfour.350",
421525
421768
  "@gearbox-protocol/sdk-gov": "^2.36.6",
421526
421769
  "@types/lodash-es": "^4.17.12",
421527
- "@types/node": "^22.13.10",
421770
+ "@types/node": "^22.13.14",
421528
421771
  "@types/react": "^19.0.10",
421529
421772
  "@types/react-dom": "^19.0.4",
421530
421773
  abitype: "^1.0.8",
@@ -421543,7 +421786,7 @@ var package_default = {
421543
421786
  "react-dom": "^19.0.0",
421544
421787
  table: "^6.9.0",
421545
421788
  tsx: "^4.19.3",
421546
- viem: "^2.23.11",
421789
+ viem: "^2.24.1",
421547
421790
  yaml: "^2.7.0",
421548
421791
  zod: "^3.24.2"
421549
421792
  },
@@ -421708,10 +421951,14 @@ function printPrices(oracle) {
421708
421951
  }
421709
421952
  return data;
421710
421953
  }
421711
- function printPrice(price) {
421712
- if (!price) {
421954
+ function printPrice(answer) {
421955
+ if (!answer) {
421713
421956
  return source_default.red("-");
421714
421957
  }
421958
+ const { price, success } = answer;
421959
+ if (!success) {
421960
+ return source_default.red("failed");
421961
+ }
421715
421962
  const pretty = formatBN(price, 8);
421716
421963
  const raw = source_default.grey(`(${price.toString(10)})`);
421717
421964
  return `${pretty} ${raw}`;
@@ -422133,7 +422380,7 @@ var ZappersPlugin = class extends SDKConstruct {
422133
422380
  }
422134
422381
  return this.#zappers;
422135
422382
  }
422136
- stateHuman(raw) {
422383
+ stateHuman(_) {
422137
422384
  return this.zappers.values().flatMap(
422138
422385
  (l) => l.flatMap((z2) => ({
422139
422386
  address: z2.baseParams.addr,