@inco/js 0.1.21 → 0.1.22

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.
@@ -188,9 +188,14 @@ var init_abi = __esm(() => {
188
188
  });
189
189
 
190
190
  // node_modules/viem/_esm/errors/data.js
191
- var SizeExceedsPaddingSizeError;
191
+ var SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
192
192
  var init_data = __esm(() => {
193
193
  init_base();
194
+ SliceOffsetOutOfBoundsError = class SliceOffsetOutOfBoundsError extends BaseError {
195
+ constructor({ offset, position, size: size22 }) {
196
+ super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size22}).`, { name: "SliceOffsetOutOfBoundsError" });
197
+ }
198
+ };
194
199
  SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
195
200
  constructor({ size: size22, targetSize, type: type2 }) {
196
201
  super(`${type2.charAt(0).toUpperCase()}${type2.slice(1).toLowerCase()} size (${size22}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
@@ -252,6 +257,25 @@ var init_encoding = __esm(() => {
252
257
  };
253
258
  });
254
259
 
260
+ // node_modules/viem/_esm/utils/data/trim.js
261
+ function trim(hexOrBytes, { dir: dir2 = "left" } = {}) {
262
+ let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
263
+ let sliceLength = 0;
264
+ for (let i = 0;i < data.length - 1; i++) {
265
+ if (data[dir2 === "left" ? i : data.length - i - 1].toString() === "0")
266
+ sliceLength++;
267
+ else
268
+ break;
269
+ }
270
+ data = dir2 === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
271
+ if (typeof hexOrBytes === "string") {
272
+ if (data.length === 1 && dir2 === "right")
273
+ data = `${data}0`;
274
+ return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
275
+ }
276
+ return data;
277
+ }
278
+
255
279
  // node_modules/viem/_esm/utils/encoding/fromHex.js
256
280
  function assertSize(hexOrBytes, { size: size22 }) {
257
281
  if (size21(hexOrBytes) > size22)
@@ -260,6 +284,22 @@ function assertSize(hexOrBytes, { size: size22 }) {
260
284
  maxSize: size22
261
285
  });
262
286
  }
287
+ function hexToBigInt(hex, opts = {}) {
288
+ const { signed } = opts;
289
+ if (opts.size)
290
+ assertSize(hex, { size: opts.size });
291
+ const value6 = BigInt(hex);
292
+ if (!signed)
293
+ return value6;
294
+ const size22 = (hex.length - 2) / 2;
295
+ const max6 = (1n << BigInt(size22) * 8n - 1n) - 1n;
296
+ if (value6 <= max6)
297
+ return value6;
298
+ return value6 - BigInt(`0x${"f".padStart(size22 * 2, "f")}`) - 1n;
299
+ }
300
+ function hexToNumber(hex, opts = {}) {
301
+ return Number(hexToBigInt(hex, opts));
302
+ }
263
303
  var init_fromHex = __esm(() => {
264
304
  init_encoding();
265
305
  init_size();
@@ -470,6 +510,12 @@ var init__u64 = __esm(() => {
470
510
  function u32(arr) {
471
511
  return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
472
512
  }
513
+ function createView(arr) {
514
+ return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
515
+ }
516
+ function rotr(word, shift2) {
517
+ return word << 32 - shift2 | word >>> shift2;
518
+ }
473
519
  function byteSwap(word) {
474
520
  return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
475
521
  }
@@ -828,6 +874,52 @@ function concatHex(values7) {
828
874
  return `0x${values7.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
829
875
  }
830
876
 
877
+ // node_modules/viem/_esm/utils/data/slice.js
878
+ function slice(value6, start5, end6, { strict: strict2 } = {}) {
879
+ if (isHex(value6, { strict: false }))
880
+ return sliceHex(value6, start5, end6, {
881
+ strict: strict2
882
+ });
883
+ return sliceBytes(value6, start5, end6, {
884
+ strict: strict2
885
+ });
886
+ }
887
+ function assertStartOffset(value6, start5) {
888
+ if (typeof start5 === "number" && start5 > 0 && start5 > size21(value6) - 1)
889
+ throw new SliceOffsetOutOfBoundsError({
890
+ offset: start5,
891
+ position: "start",
892
+ size: size21(value6)
893
+ });
894
+ }
895
+ function assertEndOffset(value6, start5, end6) {
896
+ if (typeof start5 === "number" && typeof end6 === "number" && size21(value6) !== end6 - start5) {
897
+ throw new SliceOffsetOutOfBoundsError({
898
+ offset: end6,
899
+ position: "end",
900
+ size: size21(value6)
901
+ });
902
+ }
903
+ }
904
+ function sliceBytes(value_, start5, end6, { strict: strict2 } = {}) {
905
+ assertStartOffset(value_, start5);
906
+ const value6 = value_.slice(start5, end6);
907
+ if (strict2)
908
+ assertEndOffset(value6, start5, end6);
909
+ return value6;
910
+ }
911
+ function sliceHex(value_, start5, end6, { strict: strict2 } = {}) {
912
+ assertStartOffset(value_, start5);
913
+ const value6 = `0x${value_.replace("0x", "").slice((start5 ?? 0) * 2, (end6 ?? value_.length) * 2)}`;
914
+ if (strict2)
915
+ assertEndOffset(value6, start5, end6);
916
+ return value6;
917
+ }
918
+ var init_slice = __esm(() => {
919
+ init_data();
920
+ init_size();
921
+ });
922
+
831
923
  // node_modules/viem/_esm/utils/regex.js
832
924
  var arrayRegex, bytesRegex, integerRegex;
833
925
  var init_regex = __esm(() => {
@@ -836,6 +928,861 @@ var init_regex = __esm(() => {
836
928
  integerRegex = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
837
929
  });
838
930
 
931
+ // node_modules/viem/_esm/errors/cursor.js
932
+ var NegativeOffsetError, PositionOutOfBoundsError, RecursiveReadLimitExceededError;
933
+ var init_cursor = __esm(() => {
934
+ init_base();
935
+ NegativeOffsetError = class NegativeOffsetError extends BaseError {
936
+ constructor({ offset }) {
937
+ super(`Offset \`${offset}\` cannot be negative.`, {
938
+ name: "NegativeOffsetError"
939
+ });
940
+ }
941
+ };
942
+ PositionOutOfBoundsError = class PositionOutOfBoundsError extends BaseError {
943
+ constructor({ length: length4, position }) {
944
+ super(`Position \`${position}\` is out of bounds (\`0 < position < ${length4}\`).`, { name: "PositionOutOfBoundsError" });
945
+ }
946
+ };
947
+ RecursiveReadLimitExceededError = class RecursiveReadLimitExceededError extends BaseError {
948
+ constructor({ count: count5, limit }) {
949
+ super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count5}\`).`, { name: "RecursiveReadLimitExceededError" });
950
+ }
951
+ };
952
+ });
953
+
954
+ // node_modules/viem/_esm/utils/cursor.js
955
+ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
956
+ const cursor = Object.create(staticCursor);
957
+ cursor.bytes = bytes;
958
+ cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
959
+ cursor.positionReadCount = new Map;
960
+ cursor.recursiveReadLimit = recursiveReadLimit;
961
+ return cursor;
962
+ }
963
+ var staticCursor;
964
+ var init_cursor2 = __esm(() => {
965
+ init_cursor();
966
+ staticCursor = {
967
+ bytes: new Uint8Array,
968
+ dataView: new DataView(new ArrayBuffer(0)),
969
+ position: 0,
970
+ positionReadCount: new Map,
971
+ recursiveReadCount: 0,
972
+ recursiveReadLimit: Number.POSITIVE_INFINITY,
973
+ assertReadLimit() {
974
+ if (this.recursiveReadCount >= this.recursiveReadLimit)
975
+ throw new RecursiveReadLimitExceededError({
976
+ count: this.recursiveReadCount + 1,
977
+ limit: this.recursiveReadLimit
978
+ });
979
+ },
980
+ assertPosition(position) {
981
+ if (position < 0 || position > this.bytes.length - 1)
982
+ throw new PositionOutOfBoundsError({
983
+ length: this.bytes.length,
984
+ position
985
+ });
986
+ },
987
+ decrementPosition(offset) {
988
+ if (offset < 0)
989
+ throw new NegativeOffsetError({ offset });
990
+ const position = this.position - offset;
991
+ this.assertPosition(position);
992
+ this.position = position;
993
+ },
994
+ getReadCount(position) {
995
+ return this.positionReadCount.get(position || this.position) || 0;
996
+ },
997
+ incrementPosition(offset) {
998
+ if (offset < 0)
999
+ throw new NegativeOffsetError({ offset });
1000
+ const position = this.position + offset;
1001
+ this.assertPosition(position);
1002
+ this.position = position;
1003
+ },
1004
+ inspectByte(position_) {
1005
+ const position = position_ ?? this.position;
1006
+ this.assertPosition(position);
1007
+ return this.bytes[position];
1008
+ },
1009
+ inspectBytes(length4, position_) {
1010
+ const position = position_ ?? this.position;
1011
+ this.assertPosition(position + length4 - 1);
1012
+ return this.bytes.subarray(position, position + length4);
1013
+ },
1014
+ inspectUint8(position_) {
1015
+ const position = position_ ?? this.position;
1016
+ this.assertPosition(position);
1017
+ return this.bytes[position];
1018
+ },
1019
+ inspectUint16(position_) {
1020
+ const position = position_ ?? this.position;
1021
+ this.assertPosition(position + 1);
1022
+ return this.dataView.getUint16(position);
1023
+ },
1024
+ inspectUint24(position_) {
1025
+ const position = position_ ?? this.position;
1026
+ this.assertPosition(position + 2);
1027
+ return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
1028
+ },
1029
+ inspectUint32(position_) {
1030
+ const position = position_ ?? this.position;
1031
+ this.assertPosition(position + 3);
1032
+ return this.dataView.getUint32(position);
1033
+ },
1034
+ pushByte(byte) {
1035
+ this.assertPosition(this.position);
1036
+ this.bytes[this.position] = byte;
1037
+ this.position++;
1038
+ },
1039
+ pushBytes(bytes) {
1040
+ this.assertPosition(this.position + bytes.length - 1);
1041
+ this.bytes.set(bytes, this.position);
1042
+ this.position += bytes.length;
1043
+ },
1044
+ pushUint8(value6) {
1045
+ this.assertPosition(this.position);
1046
+ this.bytes[this.position] = value6;
1047
+ this.position++;
1048
+ },
1049
+ pushUint16(value6) {
1050
+ this.assertPosition(this.position + 1);
1051
+ this.dataView.setUint16(this.position, value6);
1052
+ this.position += 2;
1053
+ },
1054
+ pushUint24(value6) {
1055
+ this.assertPosition(this.position + 2);
1056
+ this.dataView.setUint16(this.position, value6 >> 8);
1057
+ this.dataView.setUint8(this.position + 2, value6 & ~4294967040);
1058
+ this.position += 3;
1059
+ },
1060
+ pushUint32(value6) {
1061
+ this.assertPosition(this.position + 3);
1062
+ this.dataView.setUint32(this.position, value6);
1063
+ this.position += 4;
1064
+ },
1065
+ readByte() {
1066
+ this.assertReadLimit();
1067
+ this._touch();
1068
+ const value6 = this.inspectByte();
1069
+ this.position++;
1070
+ return value6;
1071
+ },
1072
+ readBytes(length4, size22) {
1073
+ this.assertReadLimit();
1074
+ this._touch();
1075
+ const value6 = this.inspectBytes(length4);
1076
+ this.position += size22 ?? length4;
1077
+ return value6;
1078
+ },
1079
+ readUint8() {
1080
+ this.assertReadLimit();
1081
+ this._touch();
1082
+ const value6 = this.inspectUint8();
1083
+ this.position += 1;
1084
+ return value6;
1085
+ },
1086
+ readUint16() {
1087
+ this.assertReadLimit();
1088
+ this._touch();
1089
+ const value6 = this.inspectUint16();
1090
+ this.position += 2;
1091
+ return value6;
1092
+ },
1093
+ readUint24() {
1094
+ this.assertReadLimit();
1095
+ this._touch();
1096
+ const value6 = this.inspectUint24();
1097
+ this.position += 3;
1098
+ return value6;
1099
+ },
1100
+ readUint32() {
1101
+ this.assertReadLimit();
1102
+ this._touch();
1103
+ const value6 = this.inspectUint32();
1104
+ this.position += 4;
1105
+ return value6;
1106
+ },
1107
+ get remaining() {
1108
+ return this.bytes.length - this.position;
1109
+ },
1110
+ setPosition(position) {
1111
+ const oldPosition = this.position;
1112
+ this.assertPosition(position);
1113
+ this.position = position;
1114
+ return () => this.position = oldPosition;
1115
+ },
1116
+ _touch() {
1117
+ if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
1118
+ return;
1119
+ const count5 = this.getReadCount();
1120
+ this.positionReadCount.set(this.position, count5 + 1);
1121
+ if (count5 > 0)
1122
+ this.recursiveReadCount++;
1123
+ }
1124
+ };
1125
+ });
1126
+
1127
+ // node_modules/viem/_esm/constants/unit.js
1128
+ var gweiUnits;
1129
+ var init_unit = __esm(() => {
1130
+ gweiUnits = {
1131
+ ether: -9,
1132
+ wei: 9
1133
+ };
1134
+ });
1135
+
1136
+ // node_modules/viem/_esm/utils/unit/formatUnits.js
1137
+ function formatUnits(value6, decimals) {
1138
+ let display = value6.toString();
1139
+ const negative2 = display.startsWith("-");
1140
+ if (negative2)
1141
+ display = display.slice(1);
1142
+ display = display.padStart(decimals, "0");
1143
+ let [integer3, fraction] = [
1144
+ display.slice(0, display.length - decimals),
1145
+ display.slice(display.length - decimals)
1146
+ ];
1147
+ fraction = fraction.replace(/(0+)$/, "");
1148
+ return `${negative2 ? "-" : ""}${integer3 || "0"}${fraction ? `.${fraction}` : ""}`;
1149
+ }
1150
+
1151
+ // node_modules/viem/_esm/utils/unit/formatGwei.js
1152
+ function formatGwei(wei, unit = "wei") {
1153
+ return formatUnits(wei, gweiUnits[unit]);
1154
+ }
1155
+ var init_formatGwei = __esm(() => {
1156
+ init_unit();
1157
+ });
1158
+
1159
+ // node_modules/viem/_esm/errors/transaction.js
1160
+ function prettyPrint(args2) {
1161
+ const entries3 = Object.entries(args2).map(([key, value6]) => {
1162
+ if (value6 === undefined || value6 === false)
1163
+ return null;
1164
+ return [key, value6];
1165
+ }).filter(Boolean);
1166
+ const maxLength2 = entries3.reduce((acc, [key]) => Math.max(acc, key.length), 0);
1167
+ return entries3.map(([key, value6]) => ` ${`${key}:`.padEnd(maxLength2 + 1)} ${value6}`).join(`
1168
+ `);
1169
+ }
1170
+ var InvalidLegacyVError, InvalidSerializableTransactionError, InvalidStorageKeySizeError;
1171
+ var init_transaction = __esm(() => {
1172
+ init_base();
1173
+ InvalidLegacyVError = class InvalidLegacyVError extends BaseError {
1174
+ constructor({ v }) {
1175
+ super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
1176
+ name: "InvalidLegacyVError"
1177
+ });
1178
+ }
1179
+ };
1180
+ InvalidSerializableTransactionError = class InvalidSerializableTransactionError extends BaseError {
1181
+ constructor({ transaction }) {
1182
+ super("Cannot infer a transaction type from provided transaction.", {
1183
+ metaMessages: [
1184
+ "Provided Transaction:",
1185
+ "{",
1186
+ prettyPrint(transaction),
1187
+ "}",
1188
+ "",
1189
+ "To infer the type, either provide:",
1190
+ "- a `type` to the Transaction, or",
1191
+ "- an EIP-1559 Transaction with `maxFeePerGas`, or",
1192
+ "- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
1193
+ "- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
1194
+ "- an EIP-7702 Transaction with `authorizationList`, or",
1195
+ "- a Legacy Transaction with `gasPrice`"
1196
+ ],
1197
+ name: "InvalidSerializableTransactionError"
1198
+ });
1199
+ }
1200
+ };
1201
+ InvalidStorageKeySizeError = class InvalidStorageKeySizeError extends BaseError {
1202
+ constructor({ storageKey }) {
1203
+ super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
1204
+ }
1205
+ };
1206
+ });
1207
+
1208
+ // node_modules/viem/_esm/errors/node.js
1209
+ var ExecutionRevertedError, FeeCapTooHighError, FeeCapTooLowError, NonceTooHighError, NonceTooLowError, NonceMaxValueError, InsufficientFundsError, IntrinsicGasTooHighError, IntrinsicGasTooLowError, TransactionTypeNotSupportedError, TipAboveFeeCapError;
1210
+ var init_node = __esm(() => {
1211
+ init_formatGwei();
1212
+ init_base();
1213
+ ExecutionRevertedError = class ExecutionRevertedError extends BaseError {
1214
+ constructor({ cause: cause2, message } = {}) {
1215
+ const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
1216
+ super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
1217
+ cause: cause2,
1218
+ name: "ExecutionRevertedError"
1219
+ });
1220
+ }
1221
+ };
1222
+ Object.defineProperty(ExecutionRevertedError, "code", {
1223
+ enumerable: true,
1224
+ configurable: true,
1225
+ writable: true,
1226
+ value: 3
1227
+ });
1228
+ Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
1229
+ enumerable: true,
1230
+ configurable: true,
1231
+ writable: true,
1232
+ value: /execution reverted/
1233
+ });
1234
+ FeeCapTooHighError = class FeeCapTooHighError extends BaseError {
1235
+ constructor({ cause: cause2, maxFeePerGas } = {}) {
1236
+ super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
1237
+ cause: cause2,
1238
+ name: "FeeCapTooHighError"
1239
+ });
1240
+ }
1241
+ };
1242
+ Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
1243
+ enumerable: true,
1244
+ configurable: true,
1245
+ writable: true,
1246
+ value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
1247
+ });
1248
+ FeeCapTooLowError = class FeeCapTooLowError extends BaseError {
1249
+ constructor({ cause: cause2, maxFeePerGas } = {}) {
1250
+ super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
1251
+ cause: cause2,
1252
+ name: "FeeCapTooLowError"
1253
+ });
1254
+ }
1255
+ };
1256
+ Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
1257
+ enumerable: true,
1258
+ configurable: true,
1259
+ writable: true,
1260
+ value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
1261
+ });
1262
+ NonceTooHighError = class NonceTooHighError extends BaseError {
1263
+ constructor({ cause: cause2, nonce } = {}) {
1264
+ super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause: cause2, name: "NonceTooHighError" });
1265
+ }
1266
+ };
1267
+ Object.defineProperty(NonceTooHighError, "nodeMessage", {
1268
+ enumerable: true,
1269
+ configurable: true,
1270
+ writable: true,
1271
+ value: /nonce too high/
1272
+ });
1273
+ NonceTooLowError = class NonceTooLowError extends BaseError {
1274
+ constructor({ cause: cause2, nonce } = {}) {
1275
+ super([
1276
+ `Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
1277
+ "Try increasing the nonce or find the latest nonce with `getTransactionCount`."
1278
+ ].join(`
1279
+ `), { cause: cause2, name: "NonceTooLowError" });
1280
+ }
1281
+ };
1282
+ Object.defineProperty(NonceTooLowError, "nodeMessage", {
1283
+ enumerable: true,
1284
+ configurable: true,
1285
+ writable: true,
1286
+ value: /nonce too low|transaction already imported|already known/
1287
+ });
1288
+ NonceMaxValueError = class NonceMaxValueError extends BaseError {
1289
+ constructor({ cause: cause2, nonce } = {}) {
1290
+ super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause: cause2, name: "NonceMaxValueError" });
1291
+ }
1292
+ };
1293
+ Object.defineProperty(NonceMaxValueError, "nodeMessage", {
1294
+ enumerable: true,
1295
+ configurable: true,
1296
+ writable: true,
1297
+ value: /nonce has max value/
1298
+ });
1299
+ InsufficientFundsError = class InsufficientFundsError extends BaseError {
1300
+ constructor({ cause: cause2 } = {}) {
1301
+ super([
1302
+ "The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
1303
+ ].join(`
1304
+ `), {
1305
+ cause: cause2,
1306
+ metaMessages: [
1307
+ "This error could arise when the account does not have enough funds to:",
1308
+ " - pay for the total gas fee,",
1309
+ " - pay for the value to send.",
1310
+ " ",
1311
+ "The cost of the transaction is calculated as `gas * gas fee + value`, where:",
1312
+ " - `gas` is the amount of gas needed for transaction to execute,",
1313
+ " - `gas fee` is the gas fee,",
1314
+ " - `value` is the amount of ether to send to the recipient."
1315
+ ],
1316
+ name: "InsufficientFundsError"
1317
+ });
1318
+ }
1319
+ };
1320
+ Object.defineProperty(InsufficientFundsError, "nodeMessage", {
1321
+ enumerable: true,
1322
+ configurable: true,
1323
+ writable: true,
1324
+ value: /insufficient funds|exceeds transaction sender account balance/
1325
+ });
1326
+ IntrinsicGasTooHighError = class IntrinsicGasTooHighError extends BaseError {
1327
+ constructor({ cause: cause2, gas } = {}) {
1328
+ super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
1329
+ cause: cause2,
1330
+ name: "IntrinsicGasTooHighError"
1331
+ });
1332
+ }
1333
+ };
1334
+ Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
1335
+ enumerable: true,
1336
+ configurable: true,
1337
+ writable: true,
1338
+ value: /intrinsic gas too high|gas limit reached/
1339
+ });
1340
+ IntrinsicGasTooLowError = class IntrinsicGasTooLowError extends BaseError {
1341
+ constructor({ cause: cause2, gas } = {}) {
1342
+ super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
1343
+ cause: cause2,
1344
+ name: "IntrinsicGasTooLowError"
1345
+ });
1346
+ }
1347
+ };
1348
+ Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
1349
+ enumerable: true,
1350
+ configurable: true,
1351
+ writable: true,
1352
+ value: /intrinsic gas too low/
1353
+ });
1354
+ TransactionTypeNotSupportedError = class TransactionTypeNotSupportedError extends BaseError {
1355
+ constructor({ cause: cause2 }) {
1356
+ super("The transaction type is not supported for this chain.", {
1357
+ cause: cause2,
1358
+ name: "TransactionTypeNotSupportedError"
1359
+ });
1360
+ }
1361
+ };
1362
+ Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
1363
+ enumerable: true,
1364
+ configurable: true,
1365
+ writable: true,
1366
+ value: /transaction type not valid/
1367
+ });
1368
+ TipAboveFeeCapError = class TipAboveFeeCapError extends BaseError {
1369
+ constructor({ cause: cause2, maxPriorityFeePerGas, maxFeePerGas } = {}) {
1370
+ super([
1371
+ `The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
1372
+ ].join(`
1373
+ `), {
1374
+ cause: cause2,
1375
+ name: "TipAboveFeeCapError"
1376
+ });
1377
+ }
1378
+ };
1379
+ Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
1380
+ enumerable: true,
1381
+ configurable: true,
1382
+ writable: true,
1383
+ value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
1384
+ });
1385
+ });
1386
+
1387
+ // node_modules/viem/_esm/utils/formatters/formatter.js
1388
+ function defineFormatter(type2, format7) {
1389
+ return ({ exclude: exclude3, format: overrides }) => {
1390
+ return {
1391
+ exclude: exclude3,
1392
+ format: (args2) => {
1393
+ const formatted = format7(args2);
1394
+ if (exclude3) {
1395
+ for (const key of exclude3) {
1396
+ delete formatted[key];
1397
+ }
1398
+ }
1399
+ return {
1400
+ ...formatted,
1401
+ ...overrides(args2)
1402
+ };
1403
+ },
1404
+ type: type2
1405
+ };
1406
+ };
1407
+ }
1408
+
1409
+ // node_modules/viem/_esm/constants/number.js
1410
+ var maxInt8, maxInt16, maxInt24, maxInt32, maxInt40, maxInt48, maxInt56, maxInt64, maxInt72, maxInt80, maxInt88, maxInt96, maxInt104, maxInt112, maxInt120, maxInt128, maxInt136, maxInt144, maxInt152, maxInt160, maxInt168, maxInt176, maxInt184, maxInt192, maxInt200, maxInt208, maxInt216, maxInt224, maxInt232, maxInt240, maxInt248, maxInt256, minInt8, minInt16, minInt24, minInt32, minInt40, minInt48, minInt56, minInt64, minInt72, minInt80, minInt88, minInt96, minInt104, minInt112, minInt120, minInt128, minInt136, minInt144, minInt152, minInt160, minInt168, minInt176, minInt184, minInt192, minInt200, minInt208, minInt216, minInt224, minInt232, minInt240, minInt248, minInt256, maxUint8, maxUint16, maxUint24, maxUint32, maxUint40, maxUint48, maxUint56, maxUint64, maxUint72, maxUint80, maxUint88, maxUint96, maxUint104, maxUint112, maxUint120, maxUint128, maxUint136, maxUint144, maxUint152, maxUint160, maxUint168, maxUint176, maxUint184, maxUint192, maxUint200, maxUint208, maxUint216, maxUint224, maxUint232, maxUint240, maxUint248, maxUint256;
1411
+ var init_number = __esm(() => {
1412
+ maxInt8 = 2n ** (8n - 1n) - 1n;
1413
+ maxInt16 = 2n ** (16n - 1n) - 1n;
1414
+ maxInt24 = 2n ** (24n - 1n) - 1n;
1415
+ maxInt32 = 2n ** (32n - 1n) - 1n;
1416
+ maxInt40 = 2n ** (40n - 1n) - 1n;
1417
+ maxInt48 = 2n ** (48n - 1n) - 1n;
1418
+ maxInt56 = 2n ** (56n - 1n) - 1n;
1419
+ maxInt64 = 2n ** (64n - 1n) - 1n;
1420
+ maxInt72 = 2n ** (72n - 1n) - 1n;
1421
+ maxInt80 = 2n ** (80n - 1n) - 1n;
1422
+ maxInt88 = 2n ** (88n - 1n) - 1n;
1423
+ maxInt96 = 2n ** (96n - 1n) - 1n;
1424
+ maxInt104 = 2n ** (104n - 1n) - 1n;
1425
+ maxInt112 = 2n ** (112n - 1n) - 1n;
1426
+ maxInt120 = 2n ** (120n - 1n) - 1n;
1427
+ maxInt128 = 2n ** (128n - 1n) - 1n;
1428
+ maxInt136 = 2n ** (136n - 1n) - 1n;
1429
+ maxInt144 = 2n ** (144n - 1n) - 1n;
1430
+ maxInt152 = 2n ** (152n - 1n) - 1n;
1431
+ maxInt160 = 2n ** (160n - 1n) - 1n;
1432
+ maxInt168 = 2n ** (168n - 1n) - 1n;
1433
+ maxInt176 = 2n ** (176n - 1n) - 1n;
1434
+ maxInt184 = 2n ** (184n - 1n) - 1n;
1435
+ maxInt192 = 2n ** (192n - 1n) - 1n;
1436
+ maxInt200 = 2n ** (200n - 1n) - 1n;
1437
+ maxInt208 = 2n ** (208n - 1n) - 1n;
1438
+ maxInt216 = 2n ** (216n - 1n) - 1n;
1439
+ maxInt224 = 2n ** (224n - 1n) - 1n;
1440
+ maxInt232 = 2n ** (232n - 1n) - 1n;
1441
+ maxInt240 = 2n ** (240n - 1n) - 1n;
1442
+ maxInt248 = 2n ** (248n - 1n) - 1n;
1443
+ maxInt256 = 2n ** (256n - 1n) - 1n;
1444
+ minInt8 = -(2n ** (8n - 1n));
1445
+ minInt16 = -(2n ** (16n - 1n));
1446
+ minInt24 = -(2n ** (24n - 1n));
1447
+ minInt32 = -(2n ** (32n - 1n));
1448
+ minInt40 = -(2n ** (40n - 1n));
1449
+ minInt48 = -(2n ** (48n - 1n));
1450
+ minInt56 = -(2n ** (56n - 1n));
1451
+ minInt64 = -(2n ** (64n - 1n));
1452
+ minInt72 = -(2n ** (72n - 1n));
1453
+ minInt80 = -(2n ** (80n - 1n));
1454
+ minInt88 = -(2n ** (88n - 1n));
1455
+ minInt96 = -(2n ** (96n - 1n));
1456
+ minInt104 = -(2n ** (104n - 1n));
1457
+ minInt112 = -(2n ** (112n - 1n));
1458
+ minInt120 = -(2n ** (120n - 1n));
1459
+ minInt128 = -(2n ** (128n - 1n));
1460
+ minInt136 = -(2n ** (136n - 1n));
1461
+ minInt144 = -(2n ** (144n - 1n));
1462
+ minInt152 = -(2n ** (152n - 1n));
1463
+ minInt160 = -(2n ** (160n - 1n));
1464
+ minInt168 = -(2n ** (168n - 1n));
1465
+ minInt176 = -(2n ** (176n - 1n));
1466
+ minInt184 = -(2n ** (184n - 1n));
1467
+ minInt192 = -(2n ** (192n - 1n));
1468
+ minInt200 = -(2n ** (200n - 1n));
1469
+ minInt208 = -(2n ** (208n - 1n));
1470
+ minInt216 = -(2n ** (216n - 1n));
1471
+ minInt224 = -(2n ** (224n - 1n));
1472
+ minInt232 = -(2n ** (232n - 1n));
1473
+ minInt240 = -(2n ** (240n - 1n));
1474
+ minInt248 = -(2n ** (248n - 1n));
1475
+ minInt256 = -(2n ** (256n - 1n));
1476
+ maxUint8 = 2n ** 8n - 1n;
1477
+ maxUint16 = 2n ** 16n - 1n;
1478
+ maxUint24 = 2n ** 24n - 1n;
1479
+ maxUint32 = 2n ** 32n - 1n;
1480
+ maxUint40 = 2n ** 40n - 1n;
1481
+ maxUint48 = 2n ** 48n - 1n;
1482
+ maxUint56 = 2n ** 56n - 1n;
1483
+ maxUint64 = 2n ** 64n - 1n;
1484
+ maxUint72 = 2n ** 72n - 1n;
1485
+ maxUint80 = 2n ** 80n - 1n;
1486
+ maxUint88 = 2n ** 88n - 1n;
1487
+ maxUint96 = 2n ** 96n - 1n;
1488
+ maxUint104 = 2n ** 104n - 1n;
1489
+ maxUint112 = 2n ** 112n - 1n;
1490
+ maxUint120 = 2n ** 120n - 1n;
1491
+ maxUint128 = 2n ** 128n - 1n;
1492
+ maxUint136 = 2n ** 136n - 1n;
1493
+ maxUint144 = 2n ** 144n - 1n;
1494
+ maxUint152 = 2n ** 152n - 1n;
1495
+ maxUint160 = 2n ** 160n - 1n;
1496
+ maxUint168 = 2n ** 168n - 1n;
1497
+ maxUint176 = 2n ** 176n - 1n;
1498
+ maxUint184 = 2n ** 184n - 1n;
1499
+ maxUint192 = 2n ** 192n - 1n;
1500
+ maxUint200 = 2n ** 200n - 1n;
1501
+ maxUint208 = 2n ** 208n - 1n;
1502
+ maxUint216 = 2n ** 216n - 1n;
1503
+ maxUint224 = 2n ** 224n - 1n;
1504
+ maxUint232 = 2n ** 232n - 1n;
1505
+ maxUint240 = 2n ** 240n - 1n;
1506
+ maxUint248 = 2n ** 248n - 1n;
1507
+ maxUint256 = 2n ** 256n - 1n;
1508
+ });
1509
+
1510
+ // ../node_modules/@noble/hashes/esm/_md.js
1511
+ function setBigUint64(view, byteOffset, value6, isLE2) {
1512
+ if (typeof view.setBigUint64 === "function")
1513
+ return view.setBigUint64(byteOffset, value6, isLE2);
1514
+ const _32n2 = BigInt(32);
1515
+ const _u32_max = BigInt(4294967295);
1516
+ const wh = Number(value6 >> _32n2 & _u32_max);
1517
+ const wl = Number(value6 & _u32_max);
1518
+ const h = isLE2 ? 4 : 0;
1519
+ const l = isLE2 ? 0 : 4;
1520
+ view.setUint32(byteOffset + h, wh, isLE2);
1521
+ view.setUint32(byteOffset + l, wl, isLE2);
1522
+ }
1523
+ function Chi(a, b, c) {
1524
+ return a & b ^ ~a & c;
1525
+ }
1526
+ function Maj(a, b, c) {
1527
+ return a & b ^ a & c ^ b & c;
1528
+ }
1529
+ var HashMD;
1530
+ var init__md = __esm(() => {
1531
+ init__assert();
1532
+ init_utils();
1533
+ HashMD = class HashMD extends Hash {
1534
+ constructor(blockLen, outputLen, padOffset, isLE2) {
1535
+ super();
1536
+ this.blockLen = blockLen;
1537
+ this.outputLen = outputLen;
1538
+ this.padOffset = padOffset;
1539
+ this.isLE = isLE2;
1540
+ this.finished = false;
1541
+ this.length = 0;
1542
+ this.pos = 0;
1543
+ this.destroyed = false;
1544
+ this.buffer = new Uint8Array(blockLen);
1545
+ this.view = createView(this.buffer);
1546
+ }
1547
+ update(data) {
1548
+ aexists(this);
1549
+ const { view, buffer: buffer3, blockLen } = this;
1550
+ data = toBytes2(data);
1551
+ const len = data.length;
1552
+ for (let pos = 0;pos < len; ) {
1553
+ const take10 = Math.min(blockLen - this.pos, len - pos);
1554
+ if (take10 === blockLen) {
1555
+ const dataView = createView(data);
1556
+ for (;blockLen <= len - pos; pos += blockLen)
1557
+ this.process(dataView, pos);
1558
+ continue;
1559
+ }
1560
+ buffer3.set(data.subarray(pos, pos + take10), this.pos);
1561
+ this.pos += take10;
1562
+ pos += take10;
1563
+ if (this.pos === blockLen) {
1564
+ this.process(view, 0);
1565
+ this.pos = 0;
1566
+ }
1567
+ }
1568
+ this.length += data.length;
1569
+ this.roundClean();
1570
+ return this;
1571
+ }
1572
+ digestInto(out) {
1573
+ aexists(this);
1574
+ aoutput(out, this);
1575
+ this.finished = true;
1576
+ const { buffer: buffer3, view, blockLen, isLE: isLE2 } = this;
1577
+ let { pos } = this;
1578
+ buffer3[pos++] = 128;
1579
+ this.buffer.subarray(pos).fill(0);
1580
+ if (this.padOffset > blockLen - pos) {
1581
+ this.process(view, 0);
1582
+ pos = 0;
1583
+ }
1584
+ for (let i = pos;i < blockLen; i++)
1585
+ buffer3[i] = 0;
1586
+ setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
1587
+ this.process(view, 0);
1588
+ const oview = createView(out);
1589
+ const len = this.outputLen;
1590
+ if (len % 4)
1591
+ throw new Error("_sha2: outputLen should be aligned to 32bit");
1592
+ const outLen = len / 4;
1593
+ const state = this.get();
1594
+ if (outLen > state.length)
1595
+ throw new Error("_sha2: outputLen bigger than state");
1596
+ for (let i = 0;i < outLen; i++)
1597
+ oview.setUint32(4 * i, state[i], isLE2);
1598
+ }
1599
+ digest() {
1600
+ const { buffer: buffer3, outputLen } = this;
1601
+ this.digestInto(buffer3);
1602
+ const res = buffer3.slice(0, outputLen);
1603
+ this.destroy();
1604
+ return res;
1605
+ }
1606
+ _cloneInto(to) {
1607
+ to || (to = new this.constructor);
1608
+ to.set(...this.get());
1609
+ const { blockLen, buffer: buffer3, length: length4, finished, destroyed, pos } = this;
1610
+ to.length = length4;
1611
+ to.pos = pos;
1612
+ to.finished = finished;
1613
+ to.destroyed = destroyed;
1614
+ if (length4 % blockLen)
1615
+ to.buffer.set(buffer3);
1616
+ return to;
1617
+ }
1618
+ };
1619
+ });
1620
+
1621
+ // ../node_modules/@noble/hashes/esm/sha256.js
1622
+ var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256;
1623
+ var init_sha256 = __esm(() => {
1624
+ init__md();
1625
+ init_utils();
1626
+ SHA256_K = /* @__PURE__ */ new Uint32Array([
1627
+ 1116352408,
1628
+ 1899447441,
1629
+ 3049323471,
1630
+ 3921009573,
1631
+ 961987163,
1632
+ 1508970993,
1633
+ 2453635748,
1634
+ 2870763221,
1635
+ 3624381080,
1636
+ 310598401,
1637
+ 607225278,
1638
+ 1426881987,
1639
+ 1925078388,
1640
+ 2162078206,
1641
+ 2614888103,
1642
+ 3248222580,
1643
+ 3835390401,
1644
+ 4022224774,
1645
+ 264347078,
1646
+ 604807628,
1647
+ 770255983,
1648
+ 1249150122,
1649
+ 1555081692,
1650
+ 1996064986,
1651
+ 2554220882,
1652
+ 2821834349,
1653
+ 2952996808,
1654
+ 3210313671,
1655
+ 3336571891,
1656
+ 3584528711,
1657
+ 113926993,
1658
+ 338241895,
1659
+ 666307205,
1660
+ 773529912,
1661
+ 1294757372,
1662
+ 1396182291,
1663
+ 1695183700,
1664
+ 1986661051,
1665
+ 2177026350,
1666
+ 2456956037,
1667
+ 2730485921,
1668
+ 2820302411,
1669
+ 3259730800,
1670
+ 3345764771,
1671
+ 3516065817,
1672
+ 3600352804,
1673
+ 4094571909,
1674
+ 275423344,
1675
+ 430227734,
1676
+ 506948616,
1677
+ 659060556,
1678
+ 883997877,
1679
+ 958139571,
1680
+ 1322822218,
1681
+ 1537002063,
1682
+ 1747873779,
1683
+ 1955562222,
1684
+ 2024104815,
1685
+ 2227730452,
1686
+ 2361852424,
1687
+ 2428436474,
1688
+ 2756734187,
1689
+ 3204031479,
1690
+ 3329325298
1691
+ ]);
1692
+ SHA256_IV = /* @__PURE__ */ new Uint32Array([
1693
+ 1779033703,
1694
+ 3144134277,
1695
+ 1013904242,
1696
+ 2773480762,
1697
+ 1359893119,
1698
+ 2600822924,
1699
+ 528734635,
1700
+ 1541459225
1701
+ ]);
1702
+ SHA256_W = /* @__PURE__ */ new Uint32Array(64);
1703
+ SHA256 = class SHA256 extends HashMD {
1704
+ constructor() {
1705
+ super(64, 32, 8, false);
1706
+ this.A = SHA256_IV[0] | 0;
1707
+ this.B = SHA256_IV[1] | 0;
1708
+ this.C = SHA256_IV[2] | 0;
1709
+ this.D = SHA256_IV[3] | 0;
1710
+ this.E = SHA256_IV[4] | 0;
1711
+ this.F = SHA256_IV[5] | 0;
1712
+ this.G = SHA256_IV[6] | 0;
1713
+ this.H = SHA256_IV[7] | 0;
1714
+ }
1715
+ get() {
1716
+ const { A, B, C, D, E, F, G, H } = this;
1717
+ return [A, B, C, D, E, F, G, H];
1718
+ }
1719
+ set(A, B, C, D, E, F, G, H) {
1720
+ this.A = A | 0;
1721
+ this.B = B | 0;
1722
+ this.C = C | 0;
1723
+ this.D = D | 0;
1724
+ this.E = E | 0;
1725
+ this.F = F | 0;
1726
+ this.G = G | 0;
1727
+ this.H = H | 0;
1728
+ }
1729
+ process(view, offset) {
1730
+ for (let i = 0;i < 16; i++, offset += 4)
1731
+ SHA256_W[i] = view.getUint32(offset, false);
1732
+ for (let i = 16;i < 64; i++) {
1733
+ const W15 = SHA256_W[i - 15];
1734
+ const W2 = SHA256_W[i - 2];
1735
+ const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
1736
+ const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
1737
+ SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
1738
+ }
1739
+ let { A, B, C, D, E, F, G, H } = this;
1740
+ for (let i = 0;i < 64; i++) {
1741
+ const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
1742
+ const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
1743
+ const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
1744
+ const T2 = sigma0 + Maj(A, B, C) | 0;
1745
+ H = G;
1746
+ G = F;
1747
+ F = E;
1748
+ E = D + T1 | 0;
1749
+ D = C;
1750
+ C = B;
1751
+ B = A;
1752
+ A = T1 + T2 | 0;
1753
+ }
1754
+ A = A + this.A | 0;
1755
+ B = B + this.B | 0;
1756
+ C = C + this.C | 0;
1757
+ D = D + this.D | 0;
1758
+ E = E + this.E | 0;
1759
+ F = F + this.F | 0;
1760
+ G = G + this.G | 0;
1761
+ H = H + this.H | 0;
1762
+ this.set(A, B, C, D, E, F, G, H);
1763
+ }
1764
+ roundClean() {
1765
+ SHA256_W.fill(0);
1766
+ }
1767
+ destroy() {
1768
+ this.set(0, 0, 0, 0, 0, 0, 0, 0);
1769
+ this.buffer.fill(0);
1770
+ }
1771
+ };
1772
+ sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256);
1773
+ });
1774
+
1775
+ // node_modules/viem/_esm/errors/chain.js
1776
+ var InvalidChainIdError;
1777
+ var init_chain = __esm(() => {
1778
+ init_base();
1779
+ InvalidChainIdError = class InvalidChainIdError extends BaseError {
1780
+ constructor({ chainId }) {
1781
+ super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
1782
+ }
1783
+ };
1784
+ });
1785
+
839
1786
  // node:buffer
840
1787
  var exports_buffer = {};
841
1788
  __export(exports_buffer, {
@@ -25466,9 +26413,9 @@ var require_256 = __commonJS((exports, module) => {
25466
26413
  3204031479,
25467
26414
  3329325298
25468
26415
  ];
25469
- function SHA256() {
25470
- if (!(this instanceof SHA256))
25471
- return new SHA256;
26416
+ function SHA2562() {
26417
+ if (!(this instanceof SHA2562))
26418
+ return new SHA2562;
25472
26419
  BlockHash.call(this);
25473
26420
  this.h = [
25474
26421
  1779033703,
@@ -25483,13 +26430,13 @@ var require_256 = __commonJS((exports, module) => {
25483
26430
  this.k = sha256_K;
25484
26431
  this.W = new Array(64);
25485
26432
  }
25486
- utils.inherits(SHA256, BlockHash);
25487
- module.exports = SHA256;
25488
- SHA256.blockSize = 512;
25489
- SHA256.outSize = 256;
25490
- SHA256.hmacStrength = 192;
25491
- SHA256.padLength = 64;
25492
- SHA256.prototype._update = function _update(msg, start5) {
26433
+ utils.inherits(SHA2562, BlockHash);
26434
+ module.exports = SHA2562;
26435
+ SHA2562.blockSize = 512;
26436
+ SHA2562.outSize = 256;
26437
+ SHA2562.hmacStrength = 192;
26438
+ SHA2562.padLength = 64;
26439
+ SHA2562.prototype._update = function _update(msg, start5) {
25493
26440
  var W = this.W;
25494
26441
  for (var i = 0;i < 16; i++)
25495
26442
  W[i] = msg[start5 + i];
@@ -25525,7 +26472,7 @@ var require_256 = __commonJS((exports, module) => {
25525
26472
  this.h[6] = sum32(this.h[6], g);
25526
26473
  this.h[7] = sum32(this.h[7], h);
25527
26474
  };
25528
- SHA256.prototype._digest = function digest(enc) {
26475
+ SHA2562.prototype._digest = function digest(enc) {
25529
26476
  if (enc === "hex")
25530
26477
  return utils.toHex32(this.h, "big");
25531
26478
  else
@@ -25536,11 +26483,11 @@ var require_256 = __commonJS((exports, module) => {
25536
26483
  // ../node_modules/hash.js/lib/hash/sha/224.js
25537
26484
  var require_224 = __commonJS((exports, module) => {
25538
26485
  var utils = require_utils3();
25539
- var SHA256 = require_256();
26486
+ var SHA2562 = require_256();
25540
26487
  function SHA224() {
25541
26488
  if (!(this instanceof SHA224))
25542
26489
  return new SHA224;
25543
- SHA256.call(this);
26490
+ SHA2562.call(this);
25544
26491
  this.h = [
25545
26492
  3238371032,
25546
26493
  914150663,
@@ -25552,7 +26499,7 @@ var require_224 = __commonJS((exports, module) => {
25552
26499
  3204075428
25553
26500
  ];
25554
26501
  }
25555
- utils.inherits(SHA224, SHA256);
26502
+ utils.inherits(SHA224, SHA2562);
25556
26503
  module.exports = SHA224;
25557
26504
  SHA224.blockSize = 512;
25558
26505
  SHA224.outSize = 224;
@@ -28816,9 +29763,9 @@ var require_elliptic2 = __commonJS((exports, module) => {
28816
29763
  const point = pair.getPublic().mul(scalar);
28817
29764
  if (hashfn === undefined) {
28818
29765
  const data2 = point.encode(null, true);
28819
- const sha256 = ec.hash().update(data2).digest();
29766
+ const sha2563 = ec.hash().update(data2).digest();
28820
29767
  for (let i = 0;i < 32; ++i)
28821
- output[i] = sha256[i];
29768
+ output[i] = sha2563[i];
28822
29769
  } else {
28823
29770
  if (!xbuf)
28824
29771
  xbuf = new Uint8Array(32);
@@ -29034,7 +29981,7 @@ var require_node = __commonJS((exports) => {
29034
29981
  var elliptic_1 = require_elliptic();
29035
29982
  var secp256k1_1 = __importDefault(require_elliptic3());
29036
29983
  var ec = new elliptic_1.ec("secp256k1");
29037
- var sha256 = function(msg) {
29984
+ var sha2563 = function(msg) {
29038
29985
  return (0, crypto_1.createHash)("sha256").update(msg).digest();
29039
29986
  };
29040
29987
  var hmacSha256 = function(key, msg) {
@@ -29077,7 +30024,7 @@ var require_node = __commonJS((exports) => {
29077
30024
  var result = Buffer.from("");
29078
30025
  while (written < outputLength) {
29079
30026
  var ctrs = Buffer.from([ctr >> 24, ctr >> 16, ctr >> 8, ctr]);
29080
- var hashResult = sha256(Buffer.concat([ctrs, secret2]));
30027
+ var hashResult = sha2563(Buffer.concat([ctrs, secret2]));
29081
30028
  result = Buffer.concat([result, hashResult]);
29082
30029
  written += 32;
29083
30030
  ctr += 1;
@@ -29163,7 +30110,7 @@ var require_node = __commonJS((exports) => {
29163
30110
  return __generator(this, function(_a2) {
29164
30111
  encryptionKey = hash2.slice(0, 16);
29165
30112
  iv = opts.iv || (0, crypto_1.randomBytes)(16);
29166
- macKey = sha256(hash2.slice(16));
30113
+ macKey = sha2563(hash2.slice(16));
29167
30114
  cipherText = aes128CtrEncrypt(iv, encryptionKey, msg);
29168
30115
  HMAC = hmacSha256(macKey, cipherText);
29169
30116
  return [2, (0, exports.getPublic)(ephemPrivateKey).then(function(ephemPublicKey) {
@@ -29194,7 +30141,7 @@ var require_node = __commonJS((exports) => {
29194
30141
  return (0, exports.kdf)(sharedPx, 32);
29195
30142
  }).then(function(hash2) {
29196
30143
  var encryptionKey = hash2.slice(0, 16);
29197
- var macKey = sha256(hash2.slice(16));
30144
+ var macKey = sha2563(hash2.slice(16));
29198
30145
  var currentHMAC = hmacSha256(macKey, cipherAndIv_1);
29199
30146
  if (!equalConstTime(currentHMAC, msgMac_1)) {
29200
30147
  return Promise.reject(new Error("Incorrect MAC"));
@@ -29346,7 +30293,7 @@ var require_browser = __commonJS((exports) => {
29346
30293
  var randomBytes = function(size22) {
29347
30294
  return crypto2.getRandomValues(Buffer.alloc(size22));
29348
30295
  };
29349
- var sha256 = function(msg) {
30296
+ var sha2563 = function(msg) {
29350
30297
  return subtle.digest({ name: "SHA-256" }, msg).then(Buffer.from);
29351
30298
  };
29352
30299
  var kdf = function(secret2, outputLength) {
@@ -29355,7 +30302,7 @@ var require_browser = __commonJS((exports) => {
29355
30302
  var willBeResult = Promise.resolve(Buffer.from(""));
29356
30303
  var _loop_1 = function() {
29357
30304
  var ctrs = Buffer.from([ctr >> 24, ctr >> 16, ctr >> 8, ctr]);
29358
- var willBeHashResult = sha256(Buffer.concat([ctrs, secret2]));
30305
+ var willBeHashResult = sha2563(Buffer.concat([ctrs, secret2]));
29359
30306
  willBeResult = willBeResult.then(function(result) {
29360
30307
  return willBeHashResult.then(function(hashResult) {
29361
30308
  return Buffer.concat([result, hashResult]);
@@ -29471,7 +30418,7 @@ var require_browser = __commonJS((exports) => {
29471
30418
  return [2, aesCtrEncrypt(iv, encryptionKey, msg).then(function(cipherText) {
29472
30419
  return Buffer.concat([iv, cipherText]);
29473
30420
  }).then(function(ivCipherText) {
29474
- return sha256(hash2.slice(16)).then(function(macKey) {
30421
+ return sha2563(hash2.slice(16)).then(function(macKey) {
29475
30422
  return hmacSha256Sign(macKey, ivCipherText);
29476
30423
  }).then(function(HMAC) {
29477
30424
  return (0, exports.getPublic)(ephemPrivateKey).then(function(ephemPublicKey) {
@@ -29503,7 +30450,7 @@ var require_browser = __commonJS((exports) => {
29503
30450
  resolve((0, exports.derive)(privateKey, ephemPublicKey).then(function(px) {
29504
30451
  return (0, exports.kdf)(px, 32);
29505
30452
  }).then(function(hash2) {
29506
- return sha256(hash2.slice(16)).then(function(macKey) {
30453
+ return sha2563(hash2.slice(16)).then(function(macKey) {
29507
30454
  return [hash2.slice(0, 16), macKey];
29508
30455
  });
29509
30456
  }).then(function(_a) {
@@ -51062,6 +52009,413 @@ class TrieIterator {
51062
52009
  }
51063
52010
  }
51064
52011
  var isTrie = (u) => hasProperty(u, TrieTypeId);
52012
+ // node_modules/viem/_esm/utils/encoding/toRlp.js
52013
+ init_base();
52014
+ init_cursor2();
52015
+ init_toBytes();
52016
+ init_toHex();
52017
+ function toRlp(bytes, to = "hex") {
52018
+ const encodable = getEncodable(bytes);
52019
+ const cursor = createCursor(new Uint8Array(encodable.length));
52020
+ encodable.encode(cursor);
52021
+ if (to === "hex")
52022
+ return bytesToHex2(cursor.bytes);
52023
+ return cursor.bytes;
52024
+ }
52025
+ function getEncodable(bytes) {
52026
+ if (Array.isArray(bytes))
52027
+ return getEncodableList(bytes.map((x) => getEncodable(x)));
52028
+ return getEncodableBytes(bytes);
52029
+ }
52030
+ function getEncodableList(list) {
52031
+ const bodyLength = list.reduce((acc, x) => acc + x.length, 0);
52032
+ const sizeOfBodyLength = getSizeOfLength(bodyLength);
52033
+ const length4 = (() => {
52034
+ if (bodyLength <= 55)
52035
+ return 1 + bodyLength;
52036
+ return 1 + sizeOfBodyLength + bodyLength;
52037
+ })();
52038
+ return {
52039
+ length: length4,
52040
+ encode(cursor) {
52041
+ if (bodyLength <= 55) {
52042
+ cursor.pushByte(192 + bodyLength);
52043
+ } else {
52044
+ cursor.pushByte(192 + 55 + sizeOfBodyLength);
52045
+ if (sizeOfBodyLength === 1)
52046
+ cursor.pushUint8(bodyLength);
52047
+ else if (sizeOfBodyLength === 2)
52048
+ cursor.pushUint16(bodyLength);
52049
+ else if (sizeOfBodyLength === 3)
52050
+ cursor.pushUint24(bodyLength);
52051
+ else
52052
+ cursor.pushUint32(bodyLength);
52053
+ }
52054
+ for (const { encode: encode6 } of list) {
52055
+ encode6(cursor);
52056
+ }
52057
+ }
52058
+ };
52059
+ }
52060
+ function getEncodableBytes(bytesOrHex) {
52061
+ const bytes = typeof bytesOrHex === "string" ? hexToBytes(bytesOrHex) : bytesOrHex;
52062
+ const sizeOfBytesLength = getSizeOfLength(bytes.length);
52063
+ const length4 = (() => {
52064
+ if (bytes.length === 1 && bytes[0] < 128)
52065
+ return 1;
52066
+ if (bytes.length <= 55)
52067
+ return 1 + bytes.length;
52068
+ return 1 + sizeOfBytesLength + bytes.length;
52069
+ })();
52070
+ return {
52071
+ length: length4,
52072
+ encode(cursor) {
52073
+ if (bytes.length === 1 && bytes[0] < 128) {
52074
+ cursor.pushBytes(bytes);
52075
+ } else if (bytes.length <= 55) {
52076
+ cursor.pushByte(128 + bytes.length);
52077
+ cursor.pushBytes(bytes);
52078
+ } else {
52079
+ cursor.pushByte(128 + 55 + sizeOfBytesLength);
52080
+ if (sizeOfBytesLength === 1)
52081
+ cursor.pushUint8(bytes.length);
52082
+ else if (sizeOfBytesLength === 2)
52083
+ cursor.pushUint16(bytes.length);
52084
+ else if (sizeOfBytesLength === 3)
52085
+ cursor.pushUint24(bytes.length);
52086
+ else
52087
+ cursor.pushUint32(bytes.length);
52088
+ cursor.pushBytes(bytes);
52089
+ }
52090
+ }
52091
+ };
52092
+ }
52093
+ function getSizeOfLength(length4) {
52094
+ if (length4 < 2 ** 8)
52095
+ return 1;
52096
+ if (length4 < 2 ** 16)
52097
+ return 2;
52098
+ if (length4 < 2 ** 24)
52099
+ return 3;
52100
+ if (length4 < 2 ** 32)
52101
+ return 4;
52102
+ throw new BaseError("Length is too large.");
52103
+ }
52104
+ // node_modules/viem/_esm/utils/formatters/transaction.js
52105
+ init_fromHex();
52106
+ var transactionType = {
52107
+ "0x0": "legacy",
52108
+ "0x1": "eip2930",
52109
+ "0x2": "eip1559",
52110
+ "0x3": "eip4844",
52111
+ "0x4": "eip7702"
52112
+ };
52113
+ function formatTransaction(transaction) {
52114
+ const transaction_ = {
52115
+ ...transaction,
52116
+ blockHash: transaction.blockHash ? transaction.blockHash : null,
52117
+ blockNumber: transaction.blockNumber ? BigInt(transaction.blockNumber) : null,
52118
+ chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,
52119
+ gas: transaction.gas ? BigInt(transaction.gas) : undefined,
52120
+ gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,
52121
+ maxFeePerBlobGas: transaction.maxFeePerBlobGas ? BigInt(transaction.maxFeePerBlobGas) : undefined,
52122
+ maxFeePerGas: transaction.maxFeePerGas ? BigInt(transaction.maxFeePerGas) : undefined,
52123
+ maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? BigInt(transaction.maxPriorityFeePerGas) : undefined,
52124
+ nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,
52125
+ to: transaction.to ? transaction.to : null,
52126
+ transactionIndex: transaction.transactionIndex ? Number(transaction.transactionIndex) : null,
52127
+ type: transaction.type ? transactionType[transaction.type] : undefined,
52128
+ typeHex: transaction.type ? transaction.type : undefined,
52129
+ value: transaction.value ? BigInt(transaction.value) : undefined,
52130
+ v: transaction.v ? BigInt(transaction.v) : undefined
52131
+ };
52132
+ if (transaction.authorizationList)
52133
+ transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);
52134
+ transaction_.yParity = (() => {
52135
+ if (transaction.yParity)
52136
+ return Number(transaction.yParity);
52137
+ if (typeof transaction_.v === "bigint") {
52138
+ if (transaction_.v === 0n || transaction_.v === 27n)
52139
+ return 0;
52140
+ if (transaction_.v === 1n || transaction_.v === 28n)
52141
+ return 1;
52142
+ if (transaction_.v >= 35n)
52143
+ return transaction_.v % 2n === 0n ? 1 : 0;
52144
+ }
52145
+ return;
52146
+ })();
52147
+ if (transaction_.type === "legacy") {
52148
+ delete transaction_.accessList;
52149
+ delete transaction_.maxFeePerBlobGas;
52150
+ delete transaction_.maxFeePerGas;
52151
+ delete transaction_.maxPriorityFeePerGas;
52152
+ delete transaction_.yParity;
52153
+ }
52154
+ if (transaction_.type === "eip2930") {
52155
+ delete transaction_.maxFeePerBlobGas;
52156
+ delete transaction_.maxFeePerGas;
52157
+ delete transaction_.maxPriorityFeePerGas;
52158
+ }
52159
+ if (transaction_.type === "eip1559") {
52160
+ delete transaction_.maxFeePerBlobGas;
52161
+ }
52162
+ return transaction_;
52163
+ }
52164
+ var defineTransaction = /* @__PURE__ */ defineFormatter("transaction", formatTransaction);
52165
+ function formatAuthorizationList(authorizationList) {
52166
+ return authorizationList.map((authorization) => ({
52167
+ contractAddress: authorization.address,
52168
+ chainId: Number(authorization.chainId),
52169
+ nonce: Number(authorization.nonce),
52170
+ r: authorization.r,
52171
+ s: authorization.s,
52172
+ yParity: Number(authorization.yParity)
52173
+ }));
52174
+ }
52175
+
52176
+ // node_modules/viem/_esm/utils/formatters/block.js
52177
+ function formatBlock(block) {
52178
+ const transactions = (block.transactions ?? []).map((transaction) => {
52179
+ if (typeof transaction === "string")
52180
+ return transaction;
52181
+ return formatTransaction(transaction);
52182
+ });
52183
+ return {
52184
+ ...block,
52185
+ baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,
52186
+ blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : undefined,
52187
+ difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,
52188
+ excessBlobGas: block.excessBlobGas ? BigInt(block.excessBlobGas) : undefined,
52189
+ gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,
52190
+ gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,
52191
+ hash: block.hash ? block.hash : null,
52192
+ logsBloom: block.logsBloom ? block.logsBloom : null,
52193
+ nonce: block.nonce ? block.nonce : null,
52194
+ number: block.number ? BigInt(block.number) : null,
52195
+ size: block.size ? BigInt(block.size) : undefined,
52196
+ timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,
52197
+ transactions,
52198
+ totalDifficulty: block.totalDifficulty ? BigInt(block.totalDifficulty) : null
52199
+ };
52200
+ }
52201
+ var defineBlock = /* @__PURE__ */ defineFormatter("block", formatBlock);
52202
+
52203
+ // node_modules/viem/_esm/utils/blob/blobsToCommitments.js
52204
+ init_toBytes();
52205
+ init_toHex();
52206
+ function blobsToCommitments(parameters) {
52207
+ const { kzg } = parameters;
52208
+ const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
52209
+ const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
52210
+ const commitments = [];
52211
+ for (const blob of blobs)
52212
+ commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));
52213
+ return to === "bytes" ? commitments : commitments.map((x) => bytesToHex2(x));
52214
+ }
52215
+
52216
+ // node_modules/viem/_esm/utils/blob/blobsToProofs.js
52217
+ init_toBytes();
52218
+ init_toHex();
52219
+ function blobsToProofs(parameters) {
52220
+ const { kzg } = parameters;
52221
+ const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
52222
+ const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
52223
+ const commitments = typeof parameters.commitments[0] === "string" ? parameters.commitments.map((x) => hexToBytes(x)) : parameters.commitments;
52224
+ const proofs = [];
52225
+ for (let i = 0;i < blobs.length; i++) {
52226
+ const blob = blobs[i];
52227
+ const commitment = commitments[i];
52228
+ proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));
52229
+ }
52230
+ return to === "bytes" ? proofs : proofs.map((x) => bytesToHex2(x));
52231
+ }
52232
+
52233
+ // node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
52234
+ init_toHex();
52235
+
52236
+ // node_modules/viem/_esm/utils/hash/sha256.js
52237
+ init_sha256();
52238
+ init_toBytes();
52239
+ init_toHex();
52240
+ function sha2562(value6, to_) {
52241
+ const to = to_ || "hex";
52242
+ const bytes = sha256(isHex(value6, { strict: false }) ? toBytes(value6) : value6);
52243
+ if (to === "bytes")
52244
+ return bytes;
52245
+ return toHex(bytes);
52246
+ }
52247
+
52248
+ // node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
52249
+ function commitmentToVersionedHash(parameters) {
52250
+ const { commitment, version: version2 = 1 } = parameters;
52251
+ const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
52252
+ const versionedHash = sha2562(commitment, "bytes");
52253
+ versionedHash.set([version2], 0);
52254
+ return to === "bytes" ? versionedHash : bytesToHex2(versionedHash);
52255
+ }
52256
+
52257
+ // node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
52258
+ function commitmentsToVersionedHashes(parameters) {
52259
+ const { commitments, version: version2 } = parameters;
52260
+ const to = parameters.to ?? (typeof commitments[0] === "string" ? "hex" : "bytes");
52261
+ const hashes = [];
52262
+ for (const commitment of commitments) {
52263
+ hashes.push(commitmentToVersionedHash({
52264
+ commitment,
52265
+ to,
52266
+ version: version2
52267
+ }));
52268
+ }
52269
+ return hashes;
52270
+ }
52271
+
52272
+ // node_modules/viem/_esm/constants/blob.js
52273
+ var blobsPerTransaction = 6;
52274
+ var bytesPerFieldElement = 32;
52275
+ var fieldElementsPerBlob = 4096;
52276
+ var bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
52277
+ var maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - 1 - 1 * fieldElementsPerBlob * blobsPerTransaction;
52278
+
52279
+ // node_modules/viem/_esm/constants/kzg.js
52280
+ var versionedHashVersionKzg = 1;
52281
+
52282
+ // node_modules/viem/_esm/errors/blob.js
52283
+ init_base();
52284
+
52285
+ class BlobSizeTooLargeError extends BaseError {
52286
+ constructor({ maxSize, size: size22 }) {
52287
+ super("Blob size is too large.", {
52288
+ metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size22} bytes`],
52289
+ name: "BlobSizeTooLargeError"
52290
+ });
52291
+ }
52292
+ }
52293
+
52294
+ class EmptyBlobError extends BaseError {
52295
+ constructor() {
52296
+ super("Blob data must not be empty.", { name: "EmptyBlobError" });
52297
+ }
52298
+ }
52299
+
52300
+ class InvalidVersionedHashSizeError extends BaseError {
52301
+ constructor({ hash: hash2, size: size22 }) {
52302
+ super(`Versioned hash "${hash2}" size is invalid.`, {
52303
+ metaMessages: ["Expected: 32", `Received: ${size22}`],
52304
+ name: "InvalidVersionedHashSizeError"
52305
+ });
52306
+ }
52307
+ }
52308
+
52309
+ class InvalidVersionedHashVersionError extends BaseError {
52310
+ constructor({ hash: hash2, version: version2 }) {
52311
+ super(`Versioned hash "${hash2}" version is invalid.`, {
52312
+ metaMessages: [
52313
+ `Expected: ${versionedHashVersionKzg}`,
52314
+ `Received: ${version2}`
52315
+ ],
52316
+ name: "InvalidVersionedHashVersionError"
52317
+ });
52318
+ }
52319
+ }
52320
+
52321
+ // node_modules/viem/_esm/utils/blob/toBlobs.js
52322
+ init_cursor2();
52323
+ init_size();
52324
+ init_toBytes();
52325
+ init_toHex();
52326
+ function toBlobs(parameters) {
52327
+ const to = parameters.to ?? (typeof parameters.data === "string" ? "hex" : "bytes");
52328
+ const data = typeof parameters.data === "string" ? hexToBytes(parameters.data) : parameters.data;
52329
+ const size_ = size21(data);
52330
+ if (!size_)
52331
+ throw new EmptyBlobError;
52332
+ if (size_ > maxBytesPerTransaction)
52333
+ throw new BlobSizeTooLargeError({
52334
+ maxSize: maxBytesPerTransaction,
52335
+ size: size_
52336
+ });
52337
+ const blobs = [];
52338
+ let active2 = true;
52339
+ let position = 0;
52340
+ while (active2) {
52341
+ const blob = createCursor(new Uint8Array(bytesPerBlob));
52342
+ let size22 = 0;
52343
+ while (size22 < fieldElementsPerBlob) {
52344
+ const bytes = data.slice(position, position + (bytesPerFieldElement - 1));
52345
+ blob.pushByte(0);
52346
+ blob.pushBytes(bytes);
52347
+ if (bytes.length < 31) {
52348
+ blob.pushByte(128);
52349
+ active2 = false;
52350
+ break;
52351
+ }
52352
+ size22++;
52353
+ position += 31;
52354
+ }
52355
+ blobs.push(blob);
52356
+ }
52357
+ return to === "bytes" ? blobs.map((x) => x.bytes) : blobs.map((x) => bytesToHex2(x.bytes));
52358
+ }
52359
+
52360
+ // node_modules/viem/_esm/utils/blob/toBlobSidecars.js
52361
+ function toBlobSidecars(parameters) {
52362
+ const { data, kzg, to } = parameters;
52363
+ const blobs = parameters.blobs ?? toBlobs({ data, to });
52364
+ const commitments = parameters.commitments ?? blobsToCommitments({ blobs, kzg, to });
52365
+ const proofs = parameters.proofs ?? blobsToProofs({ blobs, commitments, kzg, to });
52366
+ const sidecars = [];
52367
+ for (let i = 0;i < blobs.length; i++)
52368
+ sidecars.push({
52369
+ blob: blobs[i],
52370
+ commitment: commitments[i],
52371
+ proof: proofs[i]
52372
+ });
52373
+ return sidecars;
52374
+ }
52375
+
52376
+ // node_modules/viem/_esm/utils/transaction/getTransactionType.js
52377
+ init_transaction();
52378
+ function getTransactionType(transaction) {
52379
+ if (transaction.type)
52380
+ return transaction.type;
52381
+ if (typeof transaction.authorizationList !== "undefined")
52382
+ return "eip7702";
52383
+ if (typeof transaction.blobs !== "undefined" || typeof transaction.blobVersionedHashes !== "undefined" || typeof transaction.maxFeePerBlobGas !== "undefined" || typeof transaction.sidecars !== "undefined")
52384
+ return "eip4844";
52385
+ if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") {
52386
+ return "eip1559";
52387
+ }
52388
+ if (typeof transaction.gasPrice !== "undefined") {
52389
+ if (typeof transaction.accessList !== "undefined")
52390
+ return "eip2930";
52391
+ return "legacy";
52392
+ }
52393
+ throw new InvalidSerializableTransactionError({ transaction });
52394
+ }
52395
+
52396
+ // node_modules/viem/_esm/utils/formatters/log.js
52397
+ function formatLog(log3, { args: args2, eventName } = {}) {
52398
+ return {
52399
+ ...log3,
52400
+ blockHash: log3.blockHash ? log3.blockHash : null,
52401
+ blockNumber: log3.blockNumber ? BigInt(log3.blockNumber) : null,
52402
+ logIndex: log3.logIndex ? Number(log3.logIndex) : null,
52403
+ transactionHash: log3.transactionHash ? log3.transactionHash : null,
52404
+ transactionIndex: log3.transactionIndex ? Number(log3.transactionIndex) : null,
52405
+ ...eventName ? { args: args2, eventName } : {}
52406
+ };
52407
+ }
52408
+
52409
+ // node_modules/viem/_esm/utils/chain/defineChain.js
52410
+ function defineChain(chain) {
52411
+ return {
52412
+ formatters: undefined,
52413
+ fees: undefined,
52414
+ serializers: undefined,
52415
+ ...chain
52416
+ };
52417
+ }
52418
+
51065
52419
  // node_modules/viem/_esm/utils/abi/encodePacked.js
51066
52420
  init_abi();
51067
52421
  init_address();
@@ -51131,6 +52485,349 @@ function encode6(type2, value6, isArray2 = false) {
51131
52485
  throw new UnsupportedPackedAbiType(type2);
51132
52486
  }
51133
52487
 
52488
+ // node_modules/viem/_esm/utils/formatters/transactionReceipt.js
52489
+ init_fromHex();
52490
+ var receiptStatuses = {
52491
+ "0x0": "reverted",
52492
+ "0x1": "success"
52493
+ };
52494
+ function formatTransactionReceipt(transactionReceipt) {
52495
+ const receipt = {
52496
+ ...transactionReceipt,
52497
+ blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
52498
+ contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
52499
+ cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
52500
+ effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
52501
+ gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
52502
+ logs: transactionReceipt.logs ? transactionReceipt.logs.map((log3) => formatLog(log3)) : null,
52503
+ to: transactionReceipt.to ? transactionReceipt.to : null,
52504
+ transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
52505
+ status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
52506
+ type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
52507
+ };
52508
+ if (transactionReceipt.blobGasPrice)
52509
+ receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
52510
+ if (transactionReceipt.blobGasUsed)
52511
+ receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
52512
+ return receipt;
52513
+ }
52514
+ var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
52515
+
52516
+ // node_modules/viem/_esm/utils/transaction/assertTransaction.js
52517
+ init_number();
52518
+ init_address();
52519
+ init_base();
52520
+ init_chain();
52521
+ init_node();
52522
+ init_isAddress();
52523
+ init_size();
52524
+ init_slice();
52525
+ init_fromHex();
52526
+ function assertTransactionEIP7702(transaction) {
52527
+ const { authorizationList } = transaction;
52528
+ if (authorizationList) {
52529
+ for (const authorization of authorizationList) {
52530
+ const { contractAddress, chainId } = authorization;
52531
+ if (!isAddress(contractAddress))
52532
+ throw new InvalidAddressError({ address: contractAddress });
52533
+ if (chainId < 0)
52534
+ throw new InvalidChainIdError({ chainId });
52535
+ }
52536
+ }
52537
+ assertTransactionEIP1559(transaction);
52538
+ }
52539
+ function assertTransactionEIP4844(transaction) {
52540
+ const { blobVersionedHashes } = transaction;
52541
+ if (blobVersionedHashes) {
52542
+ if (blobVersionedHashes.length === 0)
52543
+ throw new EmptyBlobError;
52544
+ for (const hash2 of blobVersionedHashes) {
52545
+ const size_ = size21(hash2);
52546
+ const version2 = hexToNumber(slice(hash2, 0, 1));
52547
+ if (size_ !== 32)
52548
+ throw new InvalidVersionedHashSizeError({ hash: hash2, size: size_ });
52549
+ if (version2 !== versionedHashVersionKzg)
52550
+ throw new InvalidVersionedHashVersionError({
52551
+ hash: hash2,
52552
+ version: version2
52553
+ });
52554
+ }
52555
+ }
52556
+ assertTransactionEIP1559(transaction);
52557
+ }
52558
+ function assertTransactionEIP1559(transaction) {
52559
+ const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;
52560
+ if (chainId <= 0)
52561
+ throw new InvalidChainIdError({ chainId });
52562
+ if (to && !isAddress(to))
52563
+ throw new InvalidAddressError({ address: to });
52564
+ if (maxFeePerGas && maxFeePerGas > maxUint256)
52565
+ throw new FeeCapTooHighError({ maxFeePerGas });
52566
+ if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
52567
+ throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
52568
+ }
52569
+ function assertTransactionEIP2930(transaction) {
52570
+ const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
52571
+ if (chainId <= 0)
52572
+ throw new InvalidChainIdError({ chainId });
52573
+ if (to && !isAddress(to))
52574
+ throw new InvalidAddressError({ address: to });
52575
+ if (maxPriorityFeePerGas || maxFeePerGas)
52576
+ throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
52577
+ if (gasPrice && gasPrice > maxUint256)
52578
+ throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
52579
+ }
52580
+ function assertTransactionLegacy(transaction) {
52581
+ const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
52582
+ if (to && !isAddress(to))
52583
+ throw new InvalidAddressError({ address: to });
52584
+ if (typeof chainId !== "undefined" && chainId <= 0)
52585
+ throw new InvalidChainIdError({ chainId });
52586
+ if (maxPriorityFeePerGas || maxFeePerGas)
52587
+ throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
52588
+ if (gasPrice && gasPrice > maxUint256)
52589
+ throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
52590
+ }
52591
+
52592
+ // node_modules/viem/_esm/utils/transaction/serializeTransaction.js
52593
+ init_transaction();
52594
+ init_toHex();
52595
+
52596
+ // node_modules/viem/_esm/experimental/eip7702/utils/serializeAuthorizationList.js
52597
+ init_toHex();
52598
+ function serializeAuthorizationList(authorizationList) {
52599
+ if (!authorizationList || authorizationList.length === 0)
52600
+ return [];
52601
+ const serializedAuthorizationList = [];
52602
+ for (const authorization of authorizationList) {
52603
+ const { contractAddress, chainId, nonce, ...signature } = authorization;
52604
+ serializedAuthorizationList.push([
52605
+ chainId ? toHex(chainId) : "0x",
52606
+ contractAddress,
52607
+ nonce ? toHex(nonce) : "0x",
52608
+ ...toYParitySignatureArray({}, signature)
52609
+ ]);
52610
+ }
52611
+ return serializedAuthorizationList;
52612
+ }
52613
+
52614
+ // node_modules/viem/_esm/utils/transaction/serializeAccessList.js
52615
+ init_address();
52616
+ init_transaction();
52617
+ init_isAddress();
52618
+ function serializeAccessList(accessList) {
52619
+ if (!accessList || accessList.length === 0)
52620
+ return [];
52621
+ const serializedAccessList = [];
52622
+ for (let i = 0;i < accessList.length; i++) {
52623
+ const { address, storageKeys } = accessList[i];
52624
+ for (let j = 0;j < storageKeys.length; j++) {
52625
+ if (storageKeys[j].length - 2 !== 64) {
52626
+ throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
52627
+ }
52628
+ }
52629
+ if (!isAddress(address, { strict: false })) {
52630
+ throw new InvalidAddressError({ address });
52631
+ }
52632
+ serializedAccessList.push([address, storageKeys]);
52633
+ }
52634
+ return serializedAccessList;
52635
+ }
52636
+
52637
+ // node_modules/viem/_esm/utils/transaction/serializeTransaction.js
52638
+ function serializeTransaction(transaction, signature) {
52639
+ const type2 = getTransactionType(transaction);
52640
+ if (type2 === "eip1559")
52641
+ return serializeTransactionEIP1559(transaction, signature);
52642
+ if (type2 === "eip2930")
52643
+ return serializeTransactionEIP2930(transaction, signature);
52644
+ if (type2 === "eip4844")
52645
+ return serializeTransactionEIP4844(transaction, signature);
52646
+ if (type2 === "eip7702")
52647
+ return serializeTransactionEIP7702(transaction, signature);
52648
+ return serializeTransactionLegacy(transaction, signature);
52649
+ }
52650
+ function serializeTransactionEIP7702(transaction, signature) {
52651
+ const { authorizationList, chainId, gas, nonce, to, value: value6, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
52652
+ assertTransactionEIP7702(transaction);
52653
+ const serializedAccessList = serializeAccessList(accessList);
52654
+ const serializedAuthorizationList = serializeAuthorizationList(authorizationList);
52655
+ return concatHex([
52656
+ "0x04",
52657
+ toRlp([
52658
+ toHex(chainId),
52659
+ nonce ? toHex(nonce) : "0x",
52660
+ maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
52661
+ maxFeePerGas ? toHex(maxFeePerGas) : "0x",
52662
+ gas ? toHex(gas) : "0x",
52663
+ to ?? "0x",
52664
+ value6 ? toHex(value6) : "0x",
52665
+ data ?? "0x",
52666
+ serializedAccessList,
52667
+ serializedAuthorizationList,
52668
+ ...toYParitySignatureArray(transaction, signature)
52669
+ ])
52670
+ ]);
52671
+ }
52672
+ function serializeTransactionEIP4844(transaction, signature) {
52673
+ const { chainId, gas, nonce, to, value: value6, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
52674
+ assertTransactionEIP4844(transaction);
52675
+ let blobVersionedHashes = transaction.blobVersionedHashes;
52676
+ let sidecars = transaction.sidecars;
52677
+ if (transaction.blobs && (typeof blobVersionedHashes === "undefined" || typeof sidecars === "undefined")) {
52678
+ const blobs2 = typeof transaction.blobs[0] === "string" ? transaction.blobs : transaction.blobs.map((x) => bytesToHex2(x));
52679
+ const kzg = transaction.kzg;
52680
+ const commitments2 = blobsToCommitments({
52681
+ blobs: blobs2,
52682
+ kzg
52683
+ });
52684
+ if (typeof blobVersionedHashes === "undefined")
52685
+ blobVersionedHashes = commitmentsToVersionedHashes({
52686
+ commitments: commitments2
52687
+ });
52688
+ if (typeof sidecars === "undefined") {
52689
+ const proofs2 = blobsToProofs({ blobs: blobs2, commitments: commitments2, kzg });
52690
+ sidecars = toBlobSidecars({ blobs: blobs2, commitments: commitments2, proofs: proofs2 });
52691
+ }
52692
+ }
52693
+ const serializedAccessList = serializeAccessList(accessList);
52694
+ const serializedTransaction = [
52695
+ toHex(chainId),
52696
+ nonce ? toHex(nonce) : "0x",
52697
+ maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
52698
+ maxFeePerGas ? toHex(maxFeePerGas) : "0x",
52699
+ gas ? toHex(gas) : "0x",
52700
+ to ?? "0x",
52701
+ value6 ? toHex(value6) : "0x",
52702
+ data ?? "0x",
52703
+ serializedAccessList,
52704
+ maxFeePerBlobGas ? toHex(maxFeePerBlobGas) : "0x",
52705
+ blobVersionedHashes ?? [],
52706
+ ...toYParitySignatureArray(transaction, signature)
52707
+ ];
52708
+ const blobs = [];
52709
+ const commitments = [];
52710
+ const proofs = [];
52711
+ if (sidecars)
52712
+ for (let i = 0;i < sidecars.length; i++) {
52713
+ const { blob, commitment, proof } = sidecars[i];
52714
+ blobs.push(blob);
52715
+ commitments.push(commitment);
52716
+ proofs.push(proof);
52717
+ }
52718
+ return concatHex([
52719
+ "0x03",
52720
+ sidecars ? toRlp([serializedTransaction, blobs, commitments, proofs]) : toRlp(serializedTransaction)
52721
+ ]);
52722
+ }
52723
+ function serializeTransactionEIP1559(transaction, signature) {
52724
+ const { chainId, gas, nonce, to, value: value6, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
52725
+ assertTransactionEIP1559(transaction);
52726
+ const serializedAccessList = serializeAccessList(accessList);
52727
+ const serializedTransaction = [
52728
+ toHex(chainId),
52729
+ nonce ? toHex(nonce) : "0x",
52730
+ maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
52731
+ maxFeePerGas ? toHex(maxFeePerGas) : "0x",
52732
+ gas ? toHex(gas) : "0x",
52733
+ to ?? "0x",
52734
+ value6 ? toHex(value6) : "0x",
52735
+ data ?? "0x",
52736
+ serializedAccessList,
52737
+ ...toYParitySignatureArray(transaction, signature)
52738
+ ];
52739
+ return concatHex([
52740
+ "0x02",
52741
+ toRlp(serializedTransaction)
52742
+ ]);
52743
+ }
52744
+ function serializeTransactionEIP2930(transaction, signature) {
52745
+ const { chainId, gas, data, nonce, to, value: value6, accessList, gasPrice } = transaction;
52746
+ assertTransactionEIP2930(transaction);
52747
+ const serializedAccessList = serializeAccessList(accessList);
52748
+ const serializedTransaction = [
52749
+ toHex(chainId),
52750
+ nonce ? toHex(nonce) : "0x",
52751
+ gasPrice ? toHex(gasPrice) : "0x",
52752
+ gas ? toHex(gas) : "0x",
52753
+ to ?? "0x",
52754
+ value6 ? toHex(value6) : "0x",
52755
+ data ?? "0x",
52756
+ serializedAccessList,
52757
+ ...toYParitySignatureArray(transaction, signature)
52758
+ ];
52759
+ return concatHex([
52760
+ "0x01",
52761
+ toRlp(serializedTransaction)
52762
+ ]);
52763
+ }
52764
+ function serializeTransactionLegacy(transaction, signature) {
52765
+ const { chainId = 0, gas, data, nonce, to, value: value6, gasPrice } = transaction;
52766
+ assertTransactionLegacy(transaction);
52767
+ let serializedTransaction = [
52768
+ nonce ? toHex(nonce) : "0x",
52769
+ gasPrice ? toHex(gasPrice) : "0x",
52770
+ gas ? toHex(gas) : "0x",
52771
+ to ?? "0x",
52772
+ value6 ? toHex(value6) : "0x",
52773
+ data ?? "0x"
52774
+ ];
52775
+ if (signature) {
52776
+ const v = (() => {
52777
+ if (signature.v >= 35n) {
52778
+ const inferredChainId = (signature.v - 35n) / 2n;
52779
+ if (inferredChainId > 0)
52780
+ return signature.v;
52781
+ return 27n + (signature.v === 35n ? 0n : 1n);
52782
+ }
52783
+ if (chainId > 0)
52784
+ return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
52785
+ const v2 = 27n + (signature.v === 27n ? 0n : 1n);
52786
+ if (signature.v !== v2)
52787
+ throw new InvalidLegacyVError({ v: signature.v });
52788
+ return v2;
52789
+ })();
52790
+ const r = trim(signature.r);
52791
+ const s = trim(signature.s);
52792
+ serializedTransaction = [
52793
+ ...serializedTransaction,
52794
+ toHex(v),
52795
+ r === "0x00" ? "0x" : r,
52796
+ s === "0x00" ? "0x" : s
52797
+ ];
52798
+ } else if (chainId > 0) {
52799
+ serializedTransaction = [
52800
+ ...serializedTransaction,
52801
+ toHex(chainId),
52802
+ "0x",
52803
+ "0x"
52804
+ ];
52805
+ }
52806
+ return toRlp(serializedTransaction);
52807
+ }
52808
+ function toYParitySignatureArray(transaction, signature_) {
52809
+ const signature = signature_ ?? transaction;
52810
+ const { v, yParity } = signature;
52811
+ if (typeof signature.r === "undefined")
52812
+ return [];
52813
+ if (typeof signature.s === "undefined")
52814
+ return [];
52815
+ if (typeof v === "undefined" && typeof yParity === "undefined")
52816
+ return [];
52817
+ const r = trim(signature.r);
52818
+ const s = trim(signature.s);
52819
+ const yParity_ = (() => {
52820
+ if (typeof yParity === "number")
52821
+ return yParity ? toHex(1) : "0x";
52822
+ if (v === 0n)
52823
+ return "0x";
52824
+ if (v === 1n)
52825
+ return toHex(1);
52826
+ return v === 27n ? "0x" : toHex(1);
52827
+ })();
52828
+ return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
52829
+ }
52830
+
51134
52831
  // node_modules/viem/_esm/index.js
51135
52832
  init_toBytes();
51136
52833
  init_toHex();
@@ -57291,15 +58988,15 @@ async function decryptGrpcResponse(response, ephemeralKeypair, handle) {
57291
58988
  return bigintToPlaintext(encryptionSchemes.ecies, getHandleType(handle), plaintext);
57292
58989
  }
57293
58990
  function defaultCovalidatorGrpc(chain) {
57294
- return denverTestnetCovalidatorGrpc(chain);
58991
+ return lightningTestnetCovalidatorGrpc(chain);
57295
58992
  }
57296
58993
  function pulumiCovalidatorGrpc(chain) {
57297
58994
  return `https://grpc.${chain.name.toLowerCase()}.covalidator.denver.inco.org`;
57298
58995
  }
57299
- function denverDevnetCovalidatorGrpc(chain) {
58996
+ function lightningDevnetCovalidatorGrpc(chain) {
57300
58997
  return getCovalidatorGrpcHelper(chain, "devnet", "lightning");
57301
58998
  }
57302
- function denverTestnetCovalidatorGrpc(chain) {
58999
+ function lightningTestnetCovalidatorGrpc(chain) {
57303
59000
  return getCovalidatorGrpcHelper(chain, "testnet", "lightning");
57304
59001
  }
57305
59002
  function camelToDashCase(str) {
@@ -69673,6 +71370,8 @@ export {
69673
71370
  proxyAbi,
69674
71371
  ownableUpgradeableAbi,
69675
71372
  mockOpHandlerAbi,
71373
+ lightningTestnetCovalidatorGrpc,
71374
+ lightningDevnetCovalidatorGrpc,
69676
71375
  initializableAbi,
69677
71376
  incoTestAbi,
69678
71377
  incoLiteReencryptor,
@@ -69704,8 +71403,6 @@ export {
69704
71403
  emitterAbi,
69705
71404
  eip712Abi,
69706
71405
  deployUtilsAbi,
69707
- denverTestnetCovalidatorGrpc,
69708
- denverDevnetCovalidatorGrpc,
69709
71406
  defaultCovalidatorGrpc,
69710
71407
  decryptionHandlerEip712CheckerAbi,
69711
71408
  decryptionHandlerAbi,