@inco/js 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/encryption/index.cjs +1702 -1
- package/dist/encryption/index.mjs +1702 -1
- package/dist/generated/abis/addTwo.d.ts +8 -0
- package/dist/generated/abis/index.cjs +11 -0
- package/dist/generated/abis/index.mjs +11 -0
- package/dist/index.cjs +1949 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +1949 -1
- package/dist/lite/index.cjs +15096 -13293
- package/dist/lite/index.d.ts +3 -2
- package/dist/lite/index.mjs +15090 -13287
- package/dist/lite/lightning.d.ts +12 -3
- package/dist/lite/reencrypt.d.ts +2 -2
- package/dist/local/index.cjs +1702 -1
- package/dist/local/index.mjs +1702 -1
- package/dist/reencryption/index.cjs +1702 -1
- package/dist/reencryption/index.mjs +1702 -1
- package/package.json +1 -1
@@ -180,9 +180,14 @@ var init_abi = __esm(() => {
|
|
180
180
|
});
|
181
181
|
|
182
182
|
// ../node_modules/viem/_esm/errors/data.js
|
183
|
-
var SizeExceedsPaddingSizeError;
|
183
|
+
var SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
|
184
184
|
var init_data = __esm(() => {
|
185
185
|
init_base();
|
186
|
+
SliceOffsetOutOfBoundsError = class SliceOffsetOutOfBoundsError extends BaseError {
|
187
|
+
constructor({ offset, position, size: size22 }) {
|
188
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size22}).`, { name: "SliceOffsetOutOfBoundsError" });
|
189
|
+
}
|
190
|
+
};
|
186
191
|
SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
|
187
192
|
constructor({ size: size22, targetSize, type: type2 }) {
|
188
193
|
super(`${type2.charAt(0).toUpperCase()}${type2.slice(1).toLowerCase()} size (${size22}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
@@ -244,6 +249,25 @@ var init_encoding = __esm(() => {
|
|
244
249
|
};
|
245
250
|
});
|
246
251
|
|
252
|
+
// ../node_modules/viem/_esm/utils/data/trim.js
|
253
|
+
function trim(hexOrBytes, { dir: dir2 = "left" } = {}) {
|
254
|
+
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
255
|
+
let sliceLength = 0;
|
256
|
+
for (let i = 0;i < data.length - 1; i++) {
|
257
|
+
if (data[dir2 === "left" ? i : data.length - i - 1].toString() === "0")
|
258
|
+
sliceLength++;
|
259
|
+
else
|
260
|
+
break;
|
261
|
+
}
|
262
|
+
data = dir2 === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
263
|
+
if (typeof hexOrBytes === "string") {
|
264
|
+
if (data.length === 1 && dir2 === "right")
|
265
|
+
data = `${data}0`;
|
266
|
+
return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
|
267
|
+
}
|
268
|
+
return data;
|
269
|
+
}
|
270
|
+
|
247
271
|
// ../node_modules/viem/_esm/utils/encoding/fromHex.js
|
248
272
|
function assertSize(hexOrBytes, { size: size22 }) {
|
249
273
|
if (size21(hexOrBytes) > size22)
|
@@ -252,6 +276,22 @@ function assertSize(hexOrBytes, { size: size22 }) {
|
|
252
276
|
maxSize: size22
|
253
277
|
});
|
254
278
|
}
|
279
|
+
function hexToBigInt(hex, opts = {}) {
|
280
|
+
const { signed } = opts;
|
281
|
+
if (opts.size)
|
282
|
+
assertSize(hex, { size: opts.size });
|
283
|
+
const value6 = BigInt(hex);
|
284
|
+
if (!signed)
|
285
|
+
return value6;
|
286
|
+
const size22 = (hex.length - 2) / 2;
|
287
|
+
const max6 = (1n << BigInt(size22) * 8n - 1n) - 1n;
|
288
|
+
if (value6 <= max6)
|
289
|
+
return value6;
|
290
|
+
return value6 - BigInt(`0x${"f".padStart(size22 * 2, "f")}`) - 1n;
|
291
|
+
}
|
292
|
+
function hexToNumber(hex, opts = {}) {
|
293
|
+
return Number(hexToBigInt(hex, opts));
|
294
|
+
}
|
255
295
|
var init_fromHex = __esm(() => {
|
256
296
|
init_encoding();
|
257
297
|
init_size();
|
@@ -461,6 +501,12 @@ var init__u64 = __esm(() => {
|
|
461
501
|
function u32(arr) {
|
462
502
|
return new Uint32Array(arr.buffer, arr.byteOffset, Math.floor(arr.byteLength / 4));
|
463
503
|
}
|
504
|
+
function createView(arr) {
|
505
|
+
return new DataView(arr.buffer, arr.byteOffset, arr.byteLength);
|
506
|
+
}
|
507
|
+
function rotr(word, shift2) {
|
508
|
+
return word << 32 - shift2 | word >>> shift2;
|
509
|
+
}
|
464
510
|
function byteSwap(word) {
|
465
511
|
return word << 24 & 4278190080 | word << 8 & 16711680 | word >>> 8 & 65280 | word >>> 24 & 255;
|
466
512
|
}
|
@@ -819,6 +865,52 @@ function concatHex(values7) {
|
|
819
865
|
return `0x${values7.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
820
866
|
}
|
821
867
|
|
868
|
+
// ../node_modules/viem/_esm/utils/data/slice.js
|
869
|
+
function slice(value6, start5, end6, { strict: strict2 } = {}) {
|
870
|
+
if (isHex(value6, { strict: false }))
|
871
|
+
return sliceHex(value6, start5, end6, {
|
872
|
+
strict: strict2
|
873
|
+
});
|
874
|
+
return sliceBytes(value6, start5, end6, {
|
875
|
+
strict: strict2
|
876
|
+
});
|
877
|
+
}
|
878
|
+
function assertStartOffset(value6, start5) {
|
879
|
+
if (typeof start5 === "number" && start5 > 0 && start5 > size21(value6) - 1)
|
880
|
+
throw new SliceOffsetOutOfBoundsError({
|
881
|
+
offset: start5,
|
882
|
+
position: "start",
|
883
|
+
size: size21(value6)
|
884
|
+
});
|
885
|
+
}
|
886
|
+
function assertEndOffset(value6, start5, end6) {
|
887
|
+
if (typeof start5 === "number" && typeof end6 === "number" && size21(value6) !== end6 - start5) {
|
888
|
+
throw new SliceOffsetOutOfBoundsError({
|
889
|
+
offset: end6,
|
890
|
+
position: "end",
|
891
|
+
size: size21(value6)
|
892
|
+
});
|
893
|
+
}
|
894
|
+
}
|
895
|
+
function sliceBytes(value_, start5, end6, { strict: strict2 } = {}) {
|
896
|
+
assertStartOffset(value_, start5);
|
897
|
+
const value6 = value_.slice(start5, end6);
|
898
|
+
if (strict2)
|
899
|
+
assertEndOffset(value6, start5, end6);
|
900
|
+
return value6;
|
901
|
+
}
|
902
|
+
function sliceHex(value_, start5, end6, { strict: strict2 } = {}) {
|
903
|
+
assertStartOffset(value_, start5);
|
904
|
+
const value6 = `0x${value_.replace("0x", "").slice((start5 ?? 0) * 2, (end6 ?? value_.length) * 2)}`;
|
905
|
+
if (strict2)
|
906
|
+
assertEndOffset(value6, start5, end6);
|
907
|
+
return value6;
|
908
|
+
}
|
909
|
+
var init_slice = __esm(() => {
|
910
|
+
init_data();
|
911
|
+
init_size();
|
912
|
+
});
|
913
|
+
|
822
914
|
// ../node_modules/viem/_esm/utils/regex.js
|
823
915
|
var arrayRegex, bytesRegex, integerRegex;
|
824
916
|
var init_regex = __esm(() => {
|
@@ -827,6 +919,861 @@ var init_regex = __esm(() => {
|
|
827
919
|
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)?$/;
|
828
920
|
});
|
829
921
|
|
922
|
+
// ../node_modules/viem/_esm/errors/cursor.js
|
923
|
+
var NegativeOffsetError, PositionOutOfBoundsError, RecursiveReadLimitExceededError;
|
924
|
+
var init_cursor = __esm(() => {
|
925
|
+
init_base();
|
926
|
+
NegativeOffsetError = class NegativeOffsetError extends BaseError {
|
927
|
+
constructor({ offset }) {
|
928
|
+
super(`Offset \`${offset}\` cannot be negative.`, {
|
929
|
+
name: "NegativeOffsetError"
|
930
|
+
});
|
931
|
+
}
|
932
|
+
};
|
933
|
+
PositionOutOfBoundsError = class PositionOutOfBoundsError extends BaseError {
|
934
|
+
constructor({ length: length4, position }) {
|
935
|
+
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length4}\`).`, { name: "PositionOutOfBoundsError" });
|
936
|
+
}
|
937
|
+
};
|
938
|
+
RecursiveReadLimitExceededError = class RecursiveReadLimitExceededError extends BaseError {
|
939
|
+
constructor({ count: count5, limit }) {
|
940
|
+
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count5}\`).`, { name: "RecursiveReadLimitExceededError" });
|
941
|
+
}
|
942
|
+
};
|
943
|
+
});
|
944
|
+
|
945
|
+
// ../node_modules/viem/_esm/utils/cursor.js
|
946
|
+
function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
947
|
+
const cursor = Object.create(staticCursor);
|
948
|
+
cursor.bytes = bytes;
|
949
|
+
cursor.dataView = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
|
950
|
+
cursor.positionReadCount = new Map;
|
951
|
+
cursor.recursiveReadLimit = recursiveReadLimit;
|
952
|
+
return cursor;
|
953
|
+
}
|
954
|
+
var staticCursor;
|
955
|
+
var init_cursor2 = __esm(() => {
|
956
|
+
init_cursor();
|
957
|
+
staticCursor = {
|
958
|
+
bytes: new Uint8Array,
|
959
|
+
dataView: new DataView(new ArrayBuffer(0)),
|
960
|
+
position: 0,
|
961
|
+
positionReadCount: new Map,
|
962
|
+
recursiveReadCount: 0,
|
963
|
+
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
964
|
+
assertReadLimit() {
|
965
|
+
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
966
|
+
throw new RecursiveReadLimitExceededError({
|
967
|
+
count: this.recursiveReadCount + 1,
|
968
|
+
limit: this.recursiveReadLimit
|
969
|
+
});
|
970
|
+
},
|
971
|
+
assertPosition(position) {
|
972
|
+
if (position < 0 || position > this.bytes.length - 1)
|
973
|
+
throw new PositionOutOfBoundsError({
|
974
|
+
length: this.bytes.length,
|
975
|
+
position
|
976
|
+
});
|
977
|
+
},
|
978
|
+
decrementPosition(offset) {
|
979
|
+
if (offset < 0)
|
980
|
+
throw new NegativeOffsetError({ offset });
|
981
|
+
const position = this.position - offset;
|
982
|
+
this.assertPosition(position);
|
983
|
+
this.position = position;
|
984
|
+
},
|
985
|
+
getReadCount(position) {
|
986
|
+
return this.positionReadCount.get(position || this.position) || 0;
|
987
|
+
},
|
988
|
+
incrementPosition(offset) {
|
989
|
+
if (offset < 0)
|
990
|
+
throw new NegativeOffsetError({ offset });
|
991
|
+
const position = this.position + offset;
|
992
|
+
this.assertPosition(position);
|
993
|
+
this.position = position;
|
994
|
+
},
|
995
|
+
inspectByte(position_) {
|
996
|
+
const position = position_ ?? this.position;
|
997
|
+
this.assertPosition(position);
|
998
|
+
return this.bytes[position];
|
999
|
+
},
|
1000
|
+
inspectBytes(length4, position_) {
|
1001
|
+
const position = position_ ?? this.position;
|
1002
|
+
this.assertPosition(position + length4 - 1);
|
1003
|
+
return this.bytes.subarray(position, position + length4);
|
1004
|
+
},
|
1005
|
+
inspectUint8(position_) {
|
1006
|
+
const position = position_ ?? this.position;
|
1007
|
+
this.assertPosition(position);
|
1008
|
+
return this.bytes[position];
|
1009
|
+
},
|
1010
|
+
inspectUint16(position_) {
|
1011
|
+
const position = position_ ?? this.position;
|
1012
|
+
this.assertPosition(position + 1);
|
1013
|
+
return this.dataView.getUint16(position);
|
1014
|
+
},
|
1015
|
+
inspectUint24(position_) {
|
1016
|
+
const position = position_ ?? this.position;
|
1017
|
+
this.assertPosition(position + 2);
|
1018
|
+
return (this.dataView.getUint16(position) << 8) + this.dataView.getUint8(position + 2);
|
1019
|
+
},
|
1020
|
+
inspectUint32(position_) {
|
1021
|
+
const position = position_ ?? this.position;
|
1022
|
+
this.assertPosition(position + 3);
|
1023
|
+
return this.dataView.getUint32(position);
|
1024
|
+
},
|
1025
|
+
pushByte(byte) {
|
1026
|
+
this.assertPosition(this.position);
|
1027
|
+
this.bytes[this.position] = byte;
|
1028
|
+
this.position++;
|
1029
|
+
},
|
1030
|
+
pushBytes(bytes) {
|
1031
|
+
this.assertPosition(this.position + bytes.length - 1);
|
1032
|
+
this.bytes.set(bytes, this.position);
|
1033
|
+
this.position += bytes.length;
|
1034
|
+
},
|
1035
|
+
pushUint8(value6) {
|
1036
|
+
this.assertPosition(this.position);
|
1037
|
+
this.bytes[this.position] = value6;
|
1038
|
+
this.position++;
|
1039
|
+
},
|
1040
|
+
pushUint16(value6) {
|
1041
|
+
this.assertPosition(this.position + 1);
|
1042
|
+
this.dataView.setUint16(this.position, value6);
|
1043
|
+
this.position += 2;
|
1044
|
+
},
|
1045
|
+
pushUint24(value6) {
|
1046
|
+
this.assertPosition(this.position + 2);
|
1047
|
+
this.dataView.setUint16(this.position, value6 >> 8);
|
1048
|
+
this.dataView.setUint8(this.position + 2, value6 & ~4294967040);
|
1049
|
+
this.position += 3;
|
1050
|
+
},
|
1051
|
+
pushUint32(value6) {
|
1052
|
+
this.assertPosition(this.position + 3);
|
1053
|
+
this.dataView.setUint32(this.position, value6);
|
1054
|
+
this.position += 4;
|
1055
|
+
},
|
1056
|
+
readByte() {
|
1057
|
+
this.assertReadLimit();
|
1058
|
+
this._touch();
|
1059
|
+
const value6 = this.inspectByte();
|
1060
|
+
this.position++;
|
1061
|
+
return value6;
|
1062
|
+
},
|
1063
|
+
readBytes(length4, size22) {
|
1064
|
+
this.assertReadLimit();
|
1065
|
+
this._touch();
|
1066
|
+
const value6 = this.inspectBytes(length4);
|
1067
|
+
this.position += size22 ?? length4;
|
1068
|
+
return value6;
|
1069
|
+
},
|
1070
|
+
readUint8() {
|
1071
|
+
this.assertReadLimit();
|
1072
|
+
this._touch();
|
1073
|
+
const value6 = this.inspectUint8();
|
1074
|
+
this.position += 1;
|
1075
|
+
return value6;
|
1076
|
+
},
|
1077
|
+
readUint16() {
|
1078
|
+
this.assertReadLimit();
|
1079
|
+
this._touch();
|
1080
|
+
const value6 = this.inspectUint16();
|
1081
|
+
this.position += 2;
|
1082
|
+
return value6;
|
1083
|
+
},
|
1084
|
+
readUint24() {
|
1085
|
+
this.assertReadLimit();
|
1086
|
+
this._touch();
|
1087
|
+
const value6 = this.inspectUint24();
|
1088
|
+
this.position += 3;
|
1089
|
+
return value6;
|
1090
|
+
},
|
1091
|
+
readUint32() {
|
1092
|
+
this.assertReadLimit();
|
1093
|
+
this._touch();
|
1094
|
+
const value6 = this.inspectUint32();
|
1095
|
+
this.position += 4;
|
1096
|
+
return value6;
|
1097
|
+
},
|
1098
|
+
get remaining() {
|
1099
|
+
return this.bytes.length - this.position;
|
1100
|
+
},
|
1101
|
+
setPosition(position) {
|
1102
|
+
const oldPosition = this.position;
|
1103
|
+
this.assertPosition(position);
|
1104
|
+
this.position = position;
|
1105
|
+
return () => this.position = oldPosition;
|
1106
|
+
},
|
1107
|
+
_touch() {
|
1108
|
+
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY)
|
1109
|
+
return;
|
1110
|
+
const count5 = this.getReadCount();
|
1111
|
+
this.positionReadCount.set(this.position, count5 + 1);
|
1112
|
+
if (count5 > 0)
|
1113
|
+
this.recursiveReadCount++;
|
1114
|
+
}
|
1115
|
+
};
|
1116
|
+
});
|
1117
|
+
|
1118
|
+
// ../node_modules/viem/_esm/constants/unit.js
|
1119
|
+
var gweiUnits;
|
1120
|
+
var init_unit = __esm(() => {
|
1121
|
+
gweiUnits = {
|
1122
|
+
ether: -9,
|
1123
|
+
wei: 9
|
1124
|
+
};
|
1125
|
+
});
|
1126
|
+
|
1127
|
+
// ../node_modules/viem/_esm/utils/unit/formatUnits.js
|
1128
|
+
function formatUnits(value6, decimals) {
|
1129
|
+
let display = value6.toString();
|
1130
|
+
const negative2 = display.startsWith("-");
|
1131
|
+
if (negative2)
|
1132
|
+
display = display.slice(1);
|
1133
|
+
display = display.padStart(decimals, "0");
|
1134
|
+
let [integer3, fraction] = [
|
1135
|
+
display.slice(0, display.length - decimals),
|
1136
|
+
display.slice(display.length - decimals)
|
1137
|
+
];
|
1138
|
+
fraction = fraction.replace(/(0+)$/, "");
|
1139
|
+
return `${negative2 ? "-" : ""}${integer3 || "0"}${fraction ? `.${fraction}` : ""}`;
|
1140
|
+
}
|
1141
|
+
|
1142
|
+
// ../node_modules/viem/_esm/utils/unit/formatGwei.js
|
1143
|
+
function formatGwei(wei, unit = "wei") {
|
1144
|
+
return formatUnits(wei, gweiUnits[unit]);
|
1145
|
+
}
|
1146
|
+
var init_formatGwei = __esm(() => {
|
1147
|
+
init_unit();
|
1148
|
+
});
|
1149
|
+
|
1150
|
+
// ../node_modules/viem/_esm/errors/transaction.js
|
1151
|
+
function prettyPrint(args2) {
|
1152
|
+
const entries3 = Object.entries(args2).map(([key, value6]) => {
|
1153
|
+
if (value6 === undefined || value6 === false)
|
1154
|
+
return null;
|
1155
|
+
return [key, value6];
|
1156
|
+
}).filter(Boolean);
|
1157
|
+
const maxLength2 = entries3.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
1158
|
+
return entries3.map(([key, value6]) => ` ${`${key}:`.padEnd(maxLength2 + 1)} ${value6}`).join(`
|
1159
|
+
`);
|
1160
|
+
}
|
1161
|
+
var InvalidLegacyVError, InvalidSerializableTransactionError, InvalidStorageKeySizeError;
|
1162
|
+
var init_transaction = __esm(() => {
|
1163
|
+
init_base();
|
1164
|
+
InvalidLegacyVError = class InvalidLegacyVError extends BaseError {
|
1165
|
+
constructor({ v }) {
|
1166
|
+
super(`Invalid \`v\` value "${v}". Expected 27 or 28.`, {
|
1167
|
+
name: "InvalidLegacyVError"
|
1168
|
+
});
|
1169
|
+
}
|
1170
|
+
};
|
1171
|
+
InvalidSerializableTransactionError = class InvalidSerializableTransactionError extends BaseError {
|
1172
|
+
constructor({ transaction }) {
|
1173
|
+
super("Cannot infer a transaction type from provided transaction.", {
|
1174
|
+
metaMessages: [
|
1175
|
+
"Provided Transaction:",
|
1176
|
+
"{",
|
1177
|
+
prettyPrint(transaction),
|
1178
|
+
"}",
|
1179
|
+
"",
|
1180
|
+
"To infer the type, either provide:",
|
1181
|
+
"- a `type` to the Transaction, or",
|
1182
|
+
"- an EIP-1559 Transaction with `maxFeePerGas`, or",
|
1183
|
+
"- an EIP-2930 Transaction with `gasPrice` & `accessList`, or",
|
1184
|
+
"- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or",
|
1185
|
+
"- an EIP-7702 Transaction with `authorizationList`, or",
|
1186
|
+
"- a Legacy Transaction with `gasPrice`"
|
1187
|
+
],
|
1188
|
+
name: "InvalidSerializableTransactionError"
|
1189
|
+
});
|
1190
|
+
}
|
1191
|
+
};
|
1192
|
+
InvalidStorageKeySizeError = class InvalidStorageKeySizeError extends BaseError {
|
1193
|
+
constructor({ storageKey }) {
|
1194
|
+
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
1195
|
+
}
|
1196
|
+
};
|
1197
|
+
});
|
1198
|
+
|
1199
|
+
// ../node_modules/viem/_esm/errors/node.js
|
1200
|
+
var ExecutionRevertedError, FeeCapTooHighError, FeeCapTooLowError, NonceTooHighError, NonceTooLowError, NonceMaxValueError, InsufficientFundsError, IntrinsicGasTooHighError, IntrinsicGasTooLowError, TransactionTypeNotSupportedError, TipAboveFeeCapError;
|
1201
|
+
var init_node = __esm(() => {
|
1202
|
+
init_formatGwei();
|
1203
|
+
init_base();
|
1204
|
+
ExecutionRevertedError = class ExecutionRevertedError extends BaseError {
|
1205
|
+
constructor({ cause: cause2, message } = {}) {
|
1206
|
+
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
1207
|
+
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
1208
|
+
cause: cause2,
|
1209
|
+
name: "ExecutionRevertedError"
|
1210
|
+
});
|
1211
|
+
}
|
1212
|
+
};
|
1213
|
+
Object.defineProperty(ExecutionRevertedError, "code", {
|
1214
|
+
enumerable: true,
|
1215
|
+
configurable: true,
|
1216
|
+
writable: true,
|
1217
|
+
value: 3
|
1218
|
+
});
|
1219
|
+
Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
1220
|
+
enumerable: true,
|
1221
|
+
configurable: true,
|
1222
|
+
writable: true,
|
1223
|
+
value: /execution reverted/
|
1224
|
+
});
|
1225
|
+
FeeCapTooHighError = class FeeCapTooHighError extends BaseError {
|
1226
|
+
constructor({ cause: cause2, maxFeePerGas } = {}) {
|
1227
|
+
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
1228
|
+
cause: cause2,
|
1229
|
+
name: "FeeCapTooHighError"
|
1230
|
+
});
|
1231
|
+
}
|
1232
|
+
};
|
1233
|
+
Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
1234
|
+
enumerable: true,
|
1235
|
+
configurable: true,
|
1236
|
+
writable: true,
|
1237
|
+
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
1238
|
+
});
|
1239
|
+
FeeCapTooLowError = class FeeCapTooLowError extends BaseError {
|
1240
|
+
constructor({ cause: cause2, maxFeePerGas } = {}) {
|
1241
|
+
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
1242
|
+
cause: cause2,
|
1243
|
+
name: "FeeCapTooLowError"
|
1244
|
+
});
|
1245
|
+
}
|
1246
|
+
};
|
1247
|
+
Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
1248
|
+
enumerable: true,
|
1249
|
+
configurable: true,
|
1250
|
+
writable: true,
|
1251
|
+
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
1252
|
+
});
|
1253
|
+
NonceTooHighError = class NonceTooHighError extends BaseError {
|
1254
|
+
constructor({ cause: cause2, nonce } = {}) {
|
1255
|
+
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause: cause2, name: "NonceTooHighError" });
|
1256
|
+
}
|
1257
|
+
};
|
1258
|
+
Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
1259
|
+
enumerable: true,
|
1260
|
+
configurable: true,
|
1261
|
+
writable: true,
|
1262
|
+
value: /nonce too high/
|
1263
|
+
});
|
1264
|
+
NonceTooLowError = class NonceTooLowError extends BaseError {
|
1265
|
+
constructor({ cause: cause2, nonce } = {}) {
|
1266
|
+
super([
|
1267
|
+
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
1268
|
+
"Try increasing the nonce or find the latest nonce with `getTransactionCount`."
|
1269
|
+
].join(`
|
1270
|
+
`), { cause: cause2, name: "NonceTooLowError" });
|
1271
|
+
}
|
1272
|
+
};
|
1273
|
+
Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
1274
|
+
enumerable: true,
|
1275
|
+
configurable: true,
|
1276
|
+
writable: true,
|
1277
|
+
value: /nonce too low|transaction already imported|already known/
|
1278
|
+
});
|
1279
|
+
NonceMaxValueError = class NonceMaxValueError extends BaseError {
|
1280
|
+
constructor({ cause: cause2, nonce } = {}) {
|
1281
|
+
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause: cause2, name: "NonceMaxValueError" });
|
1282
|
+
}
|
1283
|
+
};
|
1284
|
+
Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
1285
|
+
enumerable: true,
|
1286
|
+
configurable: true,
|
1287
|
+
writable: true,
|
1288
|
+
value: /nonce has max value/
|
1289
|
+
});
|
1290
|
+
InsufficientFundsError = class InsufficientFundsError extends BaseError {
|
1291
|
+
constructor({ cause: cause2 } = {}) {
|
1292
|
+
super([
|
1293
|
+
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
1294
|
+
].join(`
|
1295
|
+
`), {
|
1296
|
+
cause: cause2,
|
1297
|
+
metaMessages: [
|
1298
|
+
"This error could arise when the account does not have enough funds to:",
|
1299
|
+
" - pay for the total gas fee,",
|
1300
|
+
" - pay for the value to send.",
|
1301
|
+
" ",
|
1302
|
+
"The cost of the transaction is calculated as `gas * gas fee + value`, where:",
|
1303
|
+
" - `gas` is the amount of gas needed for transaction to execute,",
|
1304
|
+
" - `gas fee` is the gas fee,",
|
1305
|
+
" - `value` is the amount of ether to send to the recipient."
|
1306
|
+
],
|
1307
|
+
name: "InsufficientFundsError"
|
1308
|
+
});
|
1309
|
+
}
|
1310
|
+
};
|
1311
|
+
Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
1312
|
+
enumerable: true,
|
1313
|
+
configurable: true,
|
1314
|
+
writable: true,
|
1315
|
+
value: /insufficient funds|exceeds transaction sender account balance/
|
1316
|
+
});
|
1317
|
+
IntrinsicGasTooHighError = class IntrinsicGasTooHighError extends BaseError {
|
1318
|
+
constructor({ cause: cause2, gas } = {}) {
|
1319
|
+
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
1320
|
+
cause: cause2,
|
1321
|
+
name: "IntrinsicGasTooHighError"
|
1322
|
+
});
|
1323
|
+
}
|
1324
|
+
};
|
1325
|
+
Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
1326
|
+
enumerable: true,
|
1327
|
+
configurable: true,
|
1328
|
+
writable: true,
|
1329
|
+
value: /intrinsic gas too high|gas limit reached/
|
1330
|
+
});
|
1331
|
+
IntrinsicGasTooLowError = class IntrinsicGasTooLowError extends BaseError {
|
1332
|
+
constructor({ cause: cause2, gas } = {}) {
|
1333
|
+
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
1334
|
+
cause: cause2,
|
1335
|
+
name: "IntrinsicGasTooLowError"
|
1336
|
+
});
|
1337
|
+
}
|
1338
|
+
};
|
1339
|
+
Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
1340
|
+
enumerable: true,
|
1341
|
+
configurable: true,
|
1342
|
+
writable: true,
|
1343
|
+
value: /intrinsic gas too low/
|
1344
|
+
});
|
1345
|
+
TransactionTypeNotSupportedError = class TransactionTypeNotSupportedError extends BaseError {
|
1346
|
+
constructor({ cause: cause2 }) {
|
1347
|
+
super("The transaction type is not supported for this chain.", {
|
1348
|
+
cause: cause2,
|
1349
|
+
name: "TransactionTypeNotSupportedError"
|
1350
|
+
});
|
1351
|
+
}
|
1352
|
+
};
|
1353
|
+
Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
1354
|
+
enumerable: true,
|
1355
|
+
configurable: true,
|
1356
|
+
writable: true,
|
1357
|
+
value: /transaction type not valid/
|
1358
|
+
});
|
1359
|
+
TipAboveFeeCapError = class TipAboveFeeCapError extends BaseError {
|
1360
|
+
constructor({ cause: cause2, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
1361
|
+
super([
|
1362
|
+
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
1363
|
+
].join(`
|
1364
|
+
`), {
|
1365
|
+
cause: cause2,
|
1366
|
+
name: "TipAboveFeeCapError"
|
1367
|
+
});
|
1368
|
+
}
|
1369
|
+
};
|
1370
|
+
Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
1371
|
+
enumerable: true,
|
1372
|
+
configurable: true,
|
1373
|
+
writable: true,
|
1374
|
+
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
1375
|
+
});
|
1376
|
+
});
|
1377
|
+
|
1378
|
+
// ../node_modules/viem/_esm/utils/formatters/formatter.js
|
1379
|
+
function defineFormatter(type2, format7) {
|
1380
|
+
return ({ exclude: exclude3, format: overrides }) => {
|
1381
|
+
return {
|
1382
|
+
exclude: exclude3,
|
1383
|
+
format: (args2) => {
|
1384
|
+
const formatted = format7(args2);
|
1385
|
+
if (exclude3) {
|
1386
|
+
for (const key of exclude3) {
|
1387
|
+
delete formatted[key];
|
1388
|
+
}
|
1389
|
+
}
|
1390
|
+
return {
|
1391
|
+
...formatted,
|
1392
|
+
...overrides(args2)
|
1393
|
+
};
|
1394
|
+
},
|
1395
|
+
type: type2
|
1396
|
+
};
|
1397
|
+
};
|
1398
|
+
}
|
1399
|
+
|
1400
|
+
// ../node_modules/viem/_esm/constants/number.js
|
1401
|
+
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;
|
1402
|
+
var init_number = __esm(() => {
|
1403
|
+
maxInt8 = 2n ** (8n - 1n) - 1n;
|
1404
|
+
maxInt16 = 2n ** (16n - 1n) - 1n;
|
1405
|
+
maxInt24 = 2n ** (24n - 1n) - 1n;
|
1406
|
+
maxInt32 = 2n ** (32n - 1n) - 1n;
|
1407
|
+
maxInt40 = 2n ** (40n - 1n) - 1n;
|
1408
|
+
maxInt48 = 2n ** (48n - 1n) - 1n;
|
1409
|
+
maxInt56 = 2n ** (56n - 1n) - 1n;
|
1410
|
+
maxInt64 = 2n ** (64n - 1n) - 1n;
|
1411
|
+
maxInt72 = 2n ** (72n - 1n) - 1n;
|
1412
|
+
maxInt80 = 2n ** (80n - 1n) - 1n;
|
1413
|
+
maxInt88 = 2n ** (88n - 1n) - 1n;
|
1414
|
+
maxInt96 = 2n ** (96n - 1n) - 1n;
|
1415
|
+
maxInt104 = 2n ** (104n - 1n) - 1n;
|
1416
|
+
maxInt112 = 2n ** (112n - 1n) - 1n;
|
1417
|
+
maxInt120 = 2n ** (120n - 1n) - 1n;
|
1418
|
+
maxInt128 = 2n ** (128n - 1n) - 1n;
|
1419
|
+
maxInt136 = 2n ** (136n - 1n) - 1n;
|
1420
|
+
maxInt144 = 2n ** (144n - 1n) - 1n;
|
1421
|
+
maxInt152 = 2n ** (152n - 1n) - 1n;
|
1422
|
+
maxInt160 = 2n ** (160n - 1n) - 1n;
|
1423
|
+
maxInt168 = 2n ** (168n - 1n) - 1n;
|
1424
|
+
maxInt176 = 2n ** (176n - 1n) - 1n;
|
1425
|
+
maxInt184 = 2n ** (184n - 1n) - 1n;
|
1426
|
+
maxInt192 = 2n ** (192n - 1n) - 1n;
|
1427
|
+
maxInt200 = 2n ** (200n - 1n) - 1n;
|
1428
|
+
maxInt208 = 2n ** (208n - 1n) - 1n;
|
1429
|
+
maxInt216 = 2n ** (216n - 1n) - 1n;
|
1430
|
+
maxInt224 = 2n ** (224n - 1n) - 1n;
|
1431
|
+
maxInt232 = 2n ** (232n - 1n) - 1n;
|
1432
|
+
maxInt240 = 2n ** (240n - 1n) - 1n;
|
1433
|
+
maxInt248 = 2n ** (248n - 1n) - 1n;
|
1434
|
+
maxInt256 = 2n ** (256n - 1n) - 1n;
|
1435
|
+
minInt8 = -(2n ** (8n - 1n));
|
1436
|
+
minInt16 = -(2n ** (16n - 1n));
|
1437
|
+
minInt24 = -(2n ** (24n - 1n));
|
1438
|
+
minInt32 = -(2n ** (32n - 1n));
|
1439
|
+
minInt40 = -(2n ** (40n - 1n));
|
1440
|
+
minInt48 = -(2n ** (48n - 1n));
|
1441
|
+
minInt56 = -(2n ** (56n - 1n));
|
1442
|
+
minInt64 = -(2n ** (64n - 1n));
|
1443
|
+
minInt72 = -(2n ** (72n - 1n));
|
1444
|
+
minInt80 = -(2n ** (80n - 1n));
|
1445
|
+
minInt88 = -(2n ** (88n - 1n));
|
1446
|
+
minInt96 = -(2n ** (96n - 1n));
|
1447
|
+
minInt104 = -(2n ** (104n - 1n));
|
1448
|
+
minInt112 = -(2n ** (112n - 1n));
|
1449
|
+
minInt120 = -(2n ** (120n - 1n));
|
1450
|
+
minInt128 = -(2n ** (128n - 1n));
|
1451
|
+
minInt136 = -(2n ** (136n - 1n));
|
1452
|
+
minInt144 = -(2n ** (144n - 1n));
|
1453
|
+
minInt152 = -(2n ** (152n - 1n));
|
1454
|
+
minInt160 = -(2n ** (160n - 1n));
|
1455
|
+
minInt168 = -(2n ** (168n - 1n));
|
1456
|
+
minInt176 = -(2n ** (176n - 1n));
|
1457
|
+
minInt184 = -(2n ** (184n - 1n));
|
1458
|
+
minInt192 = -(2n ** (192n - 1n));
|
1459
|
+
minInt200 = -(2n ** (200n - 1n));
|
1460
|
+
minInt208 = -(2n ** (208n - 1n));
|
1461
|
+
minInt216 = -(2n ** (216n - 1n));
|
1462
|
+
minInt224 = -(2n ** (224n - 1n));
|
1463
|
+
minInt232 = -(2n ** (232n - 1n));
|
1464
|
+
minInt240 = -(2n ** (240n - 1n));
|
1465
|
+
minInt248 = -(2n ** (248n - 1n));
|
1466
|
+
minInt256 = -(2n ** (256n - 1n));
|
1467
|
+
maxUint8 = 2n ** 8n - 1n;
|
1468
|
+
maxUint16 = 2n ** 16n - 1n;
|
1469
|
+
maxUint24 = 2n ** 24n - 1n;
|
1470
|
+
maxUint32 = 2n ** 32n - 1n;
|
1471
|
+
maxUint40 = 2n ** 40n - 1n;
|
1472
|
+
maxUint48 = 2n ** 48n - 1n;
|
1473
|
+
maxUint56 = 2n ** 56n - 1n;
|
1474
|
+
maxUint64 = 2n ** 64n - 1n;
|
1475
|
+
maxUint72 = 2n ** 72n - 1n;
|
1476
|
+
maxUint80 = 2n ** 80n - 1n;
|
1477
|
+
maxUint88 = 2n ** 88n - 1n;
|
1478
|
+
maxUint96 = 2n ** 96n - 1n;
|
1479
|
+
maxUint104 = 2n ** 104n - 1n;
|
1480
|
+
maxUint112 = 2n ** 112n - 1n;
|
1481
|
+
maxUint120 = 2n ** 120n - 1n;
|
1482
|
+
maxUint128 = 2n ** 128n - 1n;
|
1483
|
+
maxUint136 = 2n ** 136n - 1n;
|
1484
|
+
maxUint144 = 2n ** 144n - 1n;
|
1485
|
+
maxUint152 = 2n ** 152n - 1n;
|
1486
|
+
maxUint160 = 2n ** 160n - 1n;
|
1487
|
+
maxUint168 = 2n ** 168n - 1n;
|
1488
|
+
maxUint176 = 2n ** 176n - 1n;
|
1489
|
+
maxUint184 = 2n ** 184n - 1n;
|
1490
|
+
maxUint192 = 2n ** 192n - 1n;
|
1491
|
+
maxUint200 = 2n ** 200n - 1n;
|
1492
|
+
maxUint208 = 2n ** 208n - 1n;
|
1493
|
+
maxUint216 = 2n ** 216n - 1n;
|
1494
|
+
maxUint224 = 2n ** 224n - 1n;
|
1495
|
+
maxUint232 = 2n ** 232n - 1n;
|
1496
|
+
maxUint240 = 2n ** 240n - 1n;
|
1497
|
+
maxUint248 = 2n ** 248n - 1n;
|
1498
|
+
maxUint256 = 2n ** 256n - 1n;
|
1499
|
+
});
|
1500
|
+
|
1501
|
+
// ../node_modules/@noble/hashes/esm/_md.js
|
1502
|
+
function setBigUint64(view, byteOffset, value6, isLE2) {
|
1503
|
+
if (typeof view.setBigUint64 === "function")
|
1504
|
+
return view.setBigUint64(byteOffset, value6, isLE2);
|
1505
|
+
const _32n2 = BigInt(32);
|
1506
|
+
const _u32_max = BigInt(4294967295);
|
1507
|
+
const wh = Number(value6 >> _32n2 & _u32_max);
|
1508
|
+
const wl = Number(value6 & _u32_max);
|
1509
|
+
const h = isLE2 ? 4 : 0;
|
1510
|
+
const l = isLE2 ? 0 : 4;
|
1511
|
+
view.setUint32(byteOffset + h, wh, isLE2);
|
1512
|
+
view.setUint32(byteOffset + l, wl, isLE2);
|
1513
|
+
}
|
1514
|
+
function Chi(a, b, c) {
|
1515
|
+
return a & b ^ ~a & c;
|
1516
|
+
}
|
1517
|
+
function Maj(a, b, c) {
|
1518
|
+
return a & b ^ a & c ^ b & c;
|
1519
|
+
}
|
1520
|
+
var HashMD;
|
1521
|
+
var init__md = __esm(() => {
|
1522
|
+
init__assert();
|
1523
|
+
init_utils();
|
1524
|
+
HashMD = class HashMD extends Hash {
|
1525
|
+
constructor(blockLen, outputLen, padOffset, isLE2) {
|
1526
|
+
super();
|
1527
|
+
this.blockLen = blockLen;
|
1528
|
+
this.outputLen = outputLen;
|
1529
|
+
this.padOffset = padOffset;
|
1530
|
+
this.isLE = isLE2;
|
1531
|
+
this.finished = false;
|
1532
|
+
this.length = 0;
|
1533
|
+
this.pos = 0;
|
1534
|
+
this.destroyed = false;
|
1535
|
+
this.buffer = new Uint8Array(blockLen);
|
1536
|
+
this.view = createView(this.buffer);
|
1537
|
+
}
|
1538
|
+
update(data) {
|
1539
|
+
aexists(this);
|
1540
|
+
const { view, buffer: buffer3, blockLen } = this;
|
1541
|
+
data = toBytes2(data);
|
1542
|
+
const len = data.length;
|
1543
|
+
for (let pos = 0;pos < len; ) {
|
1544
|
+
const take10 = Math.min(blockLen - this.pos, len - pos);
|
1545
|
+
if (take10 === blockLen) {
|
1546
|
+
const dataView = createView(data);
|
1547
|
+
for (;blockLen <= len - pos; pos += blockLen)
|
1548
|
+
this.process(dataView, pos);
|
1549
|
+
continue;
|
1550
|
+
}
|
1551
|
+
buffer3.set(data.subarray(pos, pos + take10), this.pos);
|
1552
|
+
this.pos += take10;
|
1553
|
+
pos += take10;
|
1554
|
+
if (this.pos === blockLen) {
|
1555
|
+
this.process(view, 0);
|
1556
|
+
this.pos = 0;
|
1557
|
+
}
|
1558
|
+
}
|
1559
|
+
this.length += data.length;
|
1560
|
+
this.roundClean();
|
1561
|
+
return this;
|
1562
|
+
}
|
1563
|
+
digestInto(out) {
|
1564
|
+
aexists(this);
|
1565
|
+
aoutput(out, this);
|
1566
|
+
this.finished = true;
|
1567
|
+
const { buffer: buffer3, view, blockLen, isLE: isLE2 } = this;
|
1568
|
+
let { pos } = this;
|
1569
|
+
buffer3[pos++] = 128;
|
1570
|
+
this.buffer.subarray(pos).fill(0);
|
1571
|
+
if (this.padOffset > blockLen - pos) {
|
1572
|
+
this.process(view, 0);
|
1573
|
+
pos = 0;
|
1574
|
+
}
|
1575
|
+
for (let i = pos;i < blockLen; i++)
|
1576
|
+
buffer3[i] = 0;
|
1577
|
+
setBigUint64(view, blockLen - 8, BigInt(this.length * 8), isLE2);
|
1578
|
+
this.process(view, 0);
|
1579
|
+
const oview = createView(out);
|
1580
|
+
const len = this.outputLen;
|
1581
|
+
if (len % 4)
|
1582
|
+
throw new Error("_sha2: outputLen should be aligned to 32bit");
|
1583
|
+
const outLen = len / 4;
|
1584
|
+
const state = this.get();
|
1585
|
+
if (outLen > state.length)
|
1586
|
+
throw new Error("_sha2: outputLen bigger than state");
|
1587
|
+
for (let i = 0;i < outLen; i++)
|
1588
|
+
oview.setUint32(4 * i, state[i], isLE2);
|
1589
|
+
}
|
1590
|
+
digest() {
|
1591
|
+
const { buffer: buffer3, outputLen } = this;
|
1592
|
+
this.digestInto(buffer3);
|
1593
|
+
const res = buffer3.slice(0, outputLen);
|
1594
|
+
this.destroy();
|
1595
|
+
return res;
|
1596
|
+
}
|
1597
|
+
_cloneInto(to) {
|
1598
|
+
to || (to = new this.constructor);
|
1599
|
+
to.set(...this.get());
|
1600
|
+
const { blockLen, buffer: buffer3, length: length4, finished, destroyed, pos } = this;
|
1601
|
+
to.length = length4;
|
1602
|
+
to.pos = pos;
|
1603
|
+
to.finished = finished;
|
1604
|
+
to.destroyed = destroyed;
|
1605
|
+
if (length4 % blockLen)
|
1606
|
+
to.buffer.set(buffer3);
|
1607
|
+
return to;
|
1608
|
+
}
|
1609
|
+
};
|
1610
|
+
});
|
1611
|
+
|
1612
|
+
// ../node_modules/@noble/hashes/esm/sha256.js
|
1613
|
+
var SHA256_K, SHA256_IV, SHA256_W, SHA256, sha256;
|
1614
|
+
var init_sha256 = __esm(() => {
|
1615
|
+
init__md();
|
1616
|
+
init_utils();
|
1617
|
+
SHA256_K = /* @__PURE__ */ new Uint32Array([
|
1618
|
+
1116352408,
|
1619
|
+
1899447441,
|
1620
|
+
3049323471,
|
1621
|
+
3921009573,
|
1622
|
+
961987163,
|
1623
|
+
1508970993,
|
1624
|
+
2453635748,
|
1625
|
+
2870763221,
|
1626
|
+
3624381080,
|
1627
|
+
310598401,
|
1628
|
+
607225278,
|
1629
|
+
1426881987,
|
1630
|
+
1925078388,
|
1631
|
+
2162078206,
|
1632
|
+
2614888103,
|
1633
|
+
3248222580,
|
1634
|
+
3835390401,
|
1635
|
+
4022224774,
|
1636
|
+
264347078,
|
1637
|
+
604807628,
|
1638
|
+
770255983,
|
1639
|
+
1249150122,
|
1640
|
+
1555081692,
|
1641
|
+
1996064986,
|
1642
|
+
2554220882,
|
1643
|
+
2821834349,
|
1644
|
+
2952996808,
|
1645
|
+
3210313671,
|
1646
|
+
3336571891,
|
1647
|
+
3584528711,
|
1648
|
+
113926993,
|
1649
|
+
338241895,
|
1650
|
+
666307205,
|
1651
|
+
773529912,
|
1652
|
+
1294757372,
|
1653
|
+
1396182291,
|
1654
|
+
1695183700,
|
1655
|
+
1986661051,
|
1656
|
+
2177026350,
|
1657
|
+
2456956037,
|
1658
|
+
2730485921,
|
1659
|
+
2820302411,
|
1660
|
+
3259730800,
|
1661
|
+
3345764771,
|
1662
|
+
3516065817,
|
1663
|
+
3600352804,
|
1664
|
+
4094571909,
|
1665
|
+
275423344,
|
1666
|
+
430227734,
|
1667
|
+
506948616,
|
1668
|
+
659060556,
|
1669
|
+
883997877,
|
1670
|
+
958139571,
|
1671
|
+
1322822218,
|
1672
|
+
1537002063,
|
1673
|
+
1747873779,
|
1674
|
+
1955562222,
|
1675
|
+
2024104815,
|
1676
|
+
2227730452,
|
1677
|
+
2361852424,
|
1678
|
+
2428436474,
|
1679
|
+
2756734187,
|
1680
|
+
3204031479,
|
1681
|
+
3329325298
|
1682
|
+
]);
|
1683
|
+
SHA256_IV = /* @__PURE__ */ new Uint32Array([
|
1684
|
+
1779033703,
|
1685
|
+
3144134277,
|
1686
|
+
1013904242,
|
1687
|
+
2773480762,
|
1688
|
+
1359893119,
|
1689
|
+
2600822924,
|
1690
|
+
528734635,
|
1691
|
+
1541459225
|
1692
|
+
]);
|
1693
|
+
SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
1694
|
+
SHA256 = class SHA256 extends HashMD {
|
1695
|
+
constructor() {
|
1696
|
+
super(64, 32, 8, false);
|
1697
|
+
this.A = SHA256_IV[0] | 0;
|
1698
|
+
this.B = SHA256_IV[1] | 0;
|
1699
|
+
this.C = SHA256_IV[2] | 0;
|
1700
|
+
this.D = SHA256_IV[3] | 0;
|
1701
|
+
this.E = SHA256_IV[4] | 0;
|
1702
|
+
this.F = SHA256_IV[5] | 0;
|
1703
|
+
this.G = SHA256_IV[6] | 0;
|
1704
|
+
this.H = SHA256_IV[7] | 0;
|
1705
|
+
}
|
1706
|
+
get() {
|
1707
|
+
const { A, B, C, D, E, F, G, H } = this;
|
1708
|
+
return [A, B, C, D, E, F, G, H];
|
1709
|
+
}
|
1710
|
+
set(A, B, C, D, E, F, G, H) {
|
1711
|
+
this.A = A | 0;
|
1712
|
+
this.B = B | 0;
|
1713
|
+
this.C = C | 0;
|
1714
|
+
this.D = D | 0;
|
1715
|
+
this.E = E | 0;
|
1716
|
+
this.F = F | 0;
|
1717
|
+
this.G = G | 0;
|
1718
|
+
this.H = H | 0;
|
1719
|
+
}
|
1720
|
+
process(view, offset) {
|
1721
|
+
for (let i = 0;i < 16; i++, offset += 4)
|
1722
|
+
SHA256_W[i] = view.getUint32(offset, false);
|
1723
|
+
for (let i = 16;i < 64; i++) {
|
1724
|
+
const W15 = SHA256_W[i - 15];
|
1725
|
+
const W2 = SHA256_W[i - 2];
|
1726
|
+
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
1727
|
+
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
1728
|
+
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
1729
|
+
}
|
1730
|
+
let { A, B, C, D, E, F, G, H } = this;
|
1731
|
+
for (let i = 0;i < 64; i++) {
|
1732
|
+
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
1733
|
+
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
1734
|
+
const sigma0 = rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22);
|
1735
|
+
const T2 = sigma0 + Maj(A, B, C) | 0;
|
1736
|
+
H = G;
|
1737
|
+
G = F;
|
1738
|
+
F = E;
|
1739
|
+
E = D + T1 | 0;
|
1740
|
+
D = C;
|
1741
|
+
C = B;
|
1742
|
+
B = A;
|
1743
|
+
A = T1 + T2 | 0;
|
1744
|
+
}
|
1745
|
+
A = A + this.A | 0;
|
1746
|
+
B = B + this.B | 0;
|
1747
|
+
C = C + this.C | 0;
|
1748
|
+
D = D + this.D | 0;
|
1749
|
+
E = E + this.E | 0;
|
1750
|
+
F = F + this.F | 0;
|
1751
|
+
G = G + this.G | 0;
|
1752
|
+
H = H + this.H | 0;
|
1753
|
+
this.set(A, B, C, D, E, F, G, H);
|
1754
|
+
}
|
1755
|
+
roundClean() {
|
1756
|
+
SHA256_W.fill(0);
|
1757
|
+
}
|
1758
|
+
destroy() {
|
1759
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
1760
|
+
this.buffer.fill(0);
|
1761
|
+
}
|
1762
|
+
};
|
1763
|
+
sha256 = /* @__PURE__ */ wrapConstructor(() => new SHA256);
|
1764
|
+
});
|
1765
|
+
|
1766
|
+
// ../node_modules/viem/_esm/errors/chain.js
|
1767
|
+
var InvalidChainIdError;
|
1768
|
+
var init_chain = __esm(() => {
|
1769
|
+
init_base();
|
1770
|
+
InvalidChainIdError = class InvalidChainIdError extends BaseError {
|
1771
|
+
constructor({ chainId }) {
|
1772
|
+
super(typeof chainId === "number" ? `Chain ID "${chainId}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
1773
|
+
}
|
1774
|
+
};
|
1775
|
+
});
|
1776
|
+
|
830
1777
|
// src/reencryption/index.ts
|
831
1778
|
var exports_reencryption = {};
|
832
1779
|
__export(exports_reencryption, {
|
@@ -22344,6 +23291,413 @@ class TrieIterator {
|
|
22344
23291
|
}
|
22345
23292
|
}
|
22346
23293
|
var isTrie = (u) => hasProperty(u, TrieTypeId);
|
23294
|
+
// ../node_modules/viem/_esm/utils/encoding/toRlp.js
|
23295
|
+
init_base();
|
23296
|
+
init_cursor2();
|
23297
|
+
init_toBytes();
|
23298
|
+
init_toHex();
|
23299
|
+
function toRlp(bytes, to = "hex") {
|
23300
|
+
const encodable = getEncodable(bytes);
|
23301
|
+
const cursor = createCursor(new Uint8Array(encodable.length));
|
23302
|
+
encodable.encode(cursor);
|
23303
|
+
if (to === "hex")
|
23304
|
+
return bytesToHex2(cursor.bytes);
|
23305
|
+
return cursor.bytes;
|
23306
|
+
}
|
23307
|
+
function getEncodable(bytes) {
|
23308
|
+
if (Array.isArray(bytes))
|
23309
|
+
return getEncodableList(bytes.map((x) => getEncodable(x)));
|
23310
|
+
return getEncodableBytes(bytes);
|
23311
|
+
}
|
23312
|
+
function getEncodableList(list) {
|
23313
|
+
const bodyLength = list.reduce((acc, x) => acc + x.length, 0);
|
23314
|
+
const sizeOfBodyLength = getSizeOfLength(bodyLength);
|
23315
|
+
const length4 = (() => {
|
23316
|
+
if (bodyLength <= 55)
|
23317
|
+
return 1 + bodyLength;
|
23318
|
+
return 1 + sizeOfBodyLength + bodyLength;
|
23319
|
+
})();
|
23320
|
+
return {
|
23321
|
+
length: length4,
|
23322
|
+
encode(cursor) {
|
23323
|
+
if (bodyLength <= 55) {
|
23324
|
+
cursor.pushByte(192 + bodyLength);
|
23325
|
+
} else {
|
23326
|
+
cursor.pushByte(192 + 55 + sizeOfBodyLength);
|
23327
|
+
if (sizeOfBodyLength === 1)
|
23328
|
+
cursor.pushUint8(bodyLength);
|
23329
|
+
else if (sizeOfBodyLength === 2)
|
23330
|
+
cursor.pushUint16(bodyLength);
|
23331
|
+
else if (sizeOfBodyLength === 3)
|
23332
|
+
cursor.pushUint24(bodyLength);
|
23333
|
+
else
|
23334
|
+
cursor.pushUint32(bodyLength);
|
23335
|
+
}
|
23336
|
+
for (const { encode: encode6 } of list) {
|
23337
|
+
encode6(cursor);
|
23338
|
+
}
|
23339
|
+
}
|
23340
|
+
};
|
23341
|
+
}
|
23342
|
+
function getEncodableBytes(bytesOrHex) {
|
23343
|
+
const bytes = typeof bytesOrHex === "string" ? hexToBytes(bytesOrHex) : bytesOrHex;
|
23344
|
+
const sizeOfBytesLength = getSizeOfLength(bytes.length);
|
23345
|
+
const length4 = (() => {
|
23346
|
+
if (bytes.length === 1 && bytes[0] < 128)
|
23347
|
+
return 1;
|
23348
|
+
if (bytes.length <= 55)
|
23349
|
+
return 1 + bytes.length;
|
23350
|
+
return 1 + sizeOfBytesLength + bytes.length;
|
23351
|
+
})();
|
23352
|
+
return {
|
23353
|
+
length: length4,
|
23354
|
+
encode(cursor) {
|
23355
|
+
if (bytes.length === 1 && bytes[0] < 128) {
|
23356
|
+
cursor.pushBytes(bytes);
|
23357
|
+
} else if (bytes.length <= 55) {
|
23358
|
+
cursor.pushByte(128 + bytes.length);
|
23359
|
+
cursor.pushBytes(bytes);
|
23360
|
+
} else {
|
23361
|
+
cursor.pushByte(128 + 55 + sizeOfBytesLength);
|
23362
|
+
if (sizeOfBytesLength === 1)
|
23363
|
+
cursor.pushUint8(bytes.length);
|
23364
|
+
else if (sizeOfBytesLength === 2)
|
23365
|
+
cursor.pushUint16(bytes.length);
|
23366
|
+
else if (sizeOfBytesLength === 3)
|
23367
|
+
cursor.pushUint24(bytes.length);
|
23368
|
+
else
|
23369
|
+
cursor.pushUint32(bytes.length);
|
23370
|
+
cursor.pushBytes(bytes);
|
23371
|
+
}
|
23372
|
+
}
|
23373
|
+
};
|
23374
|
+
}
|
23375
|
+
function getSizeOfLength(length4) {
|
23376
|
+
if (length4 < 2 ** 8)
|
23377
|
+
return 1;
|
23378
|
+
if (length4 < 2 ** 16)
|
23379
|
+
return 2;
|
23380
|
+
if (length4 < 2 ** 24)
|
23381
|
+
return 3;
|
23382
|
+
if (length4 < 2 ** 32)
|
23383
|
+
return 4;
|
23384
|
+
throw new BaseError("Length is too large.");
|
23385
|
+
}
|
23386
|
+
// ../node_modules/viem/_esm/utils/formatters/transaction.js
|
23387
|
+
init_fromHex();
|
23388
|
+
var transactionType = {
|
23389
|
+
"0x0": "legacy",
|
23390
|
+
"0x1": "eip2930",
|
23391
|
+
"0x2": "eip1559",
|
23392
|
+
"0x3": "eip4844",
|
23393
|
+
"0x4": "eip7702"
|
23394
|
+
};
|
23395
|
+
function formatTransaction(transaction) {
|
23396
|
+
const transaction_ = {
|
23397
|
+
...transaction,
|
23398
|
+
blockHash: transaction.blockHash ? transaction.blockHash : null,
|
23399
|
+
blockNumber: transaction.blockNumber ? BigInt(transaction.blockNumber) : null,
|
23400
|
+
chainId: transaction.chainId ? hexToNumber(transaction.chainId) : undefined,
|
23401
|
+
gas: transaction.gas ? BigInt(transaction.gas) : undefined,
|
23402
|
+
gasPrice: transaction.gasPrice ? BigInt(transaction.gasPrice) : undefined,
|
23403
|
+
maxFeePerBlobGas: transaction.maxFeePerBlobGas ? BigInt(transaction.maxFeePerBlobGas) : undefined,
|
23404
|
+
maxFeePerGas: transaction.maxFeePerGas ? BigInt(transaction.maxFeePerGas) : undefined,
|
23405
|
+
maxPriorityFeePerGas: transaction.maxPriorityFeePerGas ? BigInt(transaction.maxPriorityFeePerGas) : undefined,
|
23406
|
+
nonce: transaction.nonce ? hexToNumber(transaction.nonce) : undefined,
|
23407
|
+
to: transaction.to ? transaction.to : null,
|
23408
|
+
transactionIndex: transaction.transactionIndex ? Number(transaction.transactionIndex) : null,
|
23409
|
+
type: transaction.type ? transactionType[transaction.type] : undefined,
|
23410
|
+
typeHex: transaction.type ? transaction.type : undefined,
|
23411
|
+
value: transaction.value ? BigInt(transaction.value) : undefined,
|
23412
|
+
v: transaction.v ? BigInt(transaction.v) : undefined
|
23413
|
+
};
|
23414
|
+
if (transaction.authorizationList)
|
23415
|
+
transaction_.authorizationList = formatAuthorizationList(transaction.authorizationList);
|
23416
|
+
transaction_.yParity = (() => {
|
23417
|
+
if (transaction.yParity)
|
23418
|
+
return Number(transaction.yParity);
|
23419
|
+
if (typeof transaction_.v === "bigint") {
|
23420
|
+
if (transaction_.v === 0n || transaction_.v === 27n)
|
23421
|
+
return 0;
|
23422
|
+
if (transaction_.v === 1n || transaction_.v === 28n)
|
23423
|
+
return 1;
|
23424
|
+
if (transaction_.v >= 35n)
|
23425
|
+
return transaction_.v % 2n === 0n ? 1 : 0;
|
23426
|
+
}
|
23427
|
+
return;
|
23428
|
+
})();
|
23429
|
+
if (transaction_.type === "legacy") {
|
23430
|
+
delete transaction_.accessList;
|
23431
|
+
delete transaction_.maxFeePerBlobGas;
|
23432
|
+
delete transaction_.maxFeePerGas;
|
23433
|
+
delete transaction_.maxPriorityFeePerGas;
|
23434
|
+
delete transaction_.yParity;
|
23435
|
+
}
|
23436
|
+
if (transaction_.type === "eip2930") {
|
23437
|
+
delete transaction_.maxFeePerBlobGas;
|
23438
|
+
delete transaction_.maxFeePerGas;
|
23439
|
+
delete transaction_.maxPriorityFeePerGas;
|
23440
|
+
}
|
23441
|
+
if (transaction_.type === "eip1559") {
|
23442
|
+
delete transaction_.maxFeePerBlobGas;
|
23443
|
+
}
|
23444
|
+
return transaction_;
|
23445
|
+
}
|
23446
|
+
var defineTransaction = /* @__PURE__ */ defineFormatter("transaction", formatTransaction);
|
23447
|
+
function formatAuthorizationList(authorizationList) {
|
23448
|
+
return authorizationList.map((authorization) => ({
|
23449
|
+
address: authorization.address,
|
23450
|
+
chainId: Number(authorization.chainId),
|
23451
|
+
nonce: Number(authorization.nonce),
|
23452
|
+
r: authorization.r,
|
23453
|
+
s: authorization.s,
|
23454
|
+
yParity: Number(authorization.yParity)
|
23455
|
+
}));
|
23456
|
+
}
|
23457
|
+
|
23458
|
+
// ../node_modules/viem/_esm/utils/formatters/block.js
|
23459
|
+
function formatBlock(block) {
|
23460
|
+
const transactions = (block.transactions ?? []).map((transaction) => {
|
23461
|
+
if (typeof transaction === "string")
|
23462
|
+
return transaction;
|
23463
|
+
return formatTransaction(transaction);
|
23464
|
+
});
|
23465
|
+
return {
|
23466
|
+
...block,
|
23467
|
+
baseFeePerGas: block.baseFeePerGas ? BigInt(block.baseFeePerGas) : null,
|
23468
|
+
blobGasUsed: block.blobGasUsed ? BigInt(block.blobGasUsed) : undefined,
|
23469
|
+
difficulty: block.difficulty ? BigInt(block.difficulty) : undefined,
|
23470
|
+
excessBlobGas: block.excessBlobGas ? BigInt(block.excessBlobGas) : undefined,
|
23471
|
+
gasLimit: block.gasLimit ? BigInt(block.gasLimit) : undefined,
|
23472
|
+
gasUsed: block.gasUsed ? BigInt(block.gasUsed) : undefined,
|
23473
|
+
hash: block.hash ? block.hash : null,
|
23474
|
+
logsBloom: block.logsBloom ? block.logsBloom : null,
|
23475
|
+
nonce: block.nonce ? block.nonce : null,
|
23476
|
+
number: block.number ? BigInt(block.number) : null,
|
23477
|
+
size: block.size ? BigInt(block.size) : undefined,
|
23478
|
+
timestamp: block.timestamp ? BigInt(block.timestamp) : undefined,
|
23479
|
+
transactions,
|
23480
|
+
totalDifficulty: block.totalDifficulty ? BigInt(block.totalDifficulty) : null
|
23481
|
+
};
|
23482
|
+
}
|
23483
|
+
var defineBlock = /* @__PURE__ */ defineFormatter("block", formatBlock);
|
23484
|
+
|
23485
|
+
// ../node_modules/viem/_esm/utils/blob/blobsToCommitments.js
|
23486
|
+
init_toBytes();
|
23487
|
+
init_toHex();
|
23488
|
+
function blobsToCommitments(parameters) {
|
23489
|
+
const { kzg } = parameters;
|
23490
|
+
const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
|
23491
|
+
const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
|
23492
|
+
const commitments = [];
|
23493
|
+
for (const blob of blobs)
|
23494
|
+
commitments.push(Uint8Array.from(kzg.blobToKzgCommitment(blob)));
|
23495
|
+
return to === "bytes" ? commitments : commitments.map((x) => bytesToHex2(x));
|
23496
|
+
}
|
23497
|
+
|
23498
|
+
// ../node_modules/viem/_esm/utils/blob/blobsToProofs.js
|
23499
|
+
init_toBytes();
|
23500
|
+
init_toHex();
|
23501
|
+
function blobsToProofs(parameters) {
|
23502
|
+
const { kzg } = parameters;
|
23503
|
+
const to = parameters.to ?? (typeof parameters.blobs[0] === "string" ? "hex" : "bytes");
|
23504
|
+
const blobs = typeof parameters.blobs[0] === "string" ? parameters.blobs.map((x) => hexToBytes(x)) : parameters.blobs;
|
23505
|
+
const commitments = typeof parameters.commitments[0] === "string" ? parameters.commitments.map((x) => hexToBytes(x)) : parameters.commitments;
|
23506
|
+
const proofs = [];
|
23507
|
+
for (let i = 0;i < blobs.length; i++) {
|
23508
|
+
const blob = blobs[i];
|
23509
|
+
const commitment = commitments[i];
|
23510
|
+
proofs.push(Uint8Array.from(kzg.computeBlobKzgProof(blob, commitment)));
|
23511
|
+
}
|
23512
|
+
return to === "bytes" ? proofs : proofs.map((x) => bytesToHex2(x));
|
23513
|
+
}
|
23514
|
+
|
23515
|
+
// ../node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
|
23516
|
+
init_toHex();
|
23517
|
+
|
23518
|
+
// ../node_modules/viem/_esm/utils/hash/sha256.js
|
23519
|
+
init_sha256();
|
23520
|
+
init_toBytes();
|
23521
|
+
init_toHex();
|
23522
|
+
function sha2562(value6, to_) {
|
23523
|
+
const to = to_ || "hex";
|
23524
|
+
const bytes = sha256(isHex(value6, { strict: false }) ? toBytes(value6) : value6);
|
23525
|
+
if (to === "bytes")
|
23526
|
+
return bytes;
|
23527
|
+
return toHex(bytes);
|
23528
|
+
}
|
23529
|
+
|
23530
|
+
// ../node_modules/viem/_esm/utils/blob/commitmentToVersionedHash.js
|
23531
|
+
function commitmentToVersionedHash(parameters) {
|
23532
|
+
const { commitment, version: version2 = 1 } = parameters;
|
23533
|
+
const to = parameters.to ?? (typeof commitment === "string" ? "hex" : "bytes");
|
23534
|
+
const versionedHash = sha2562(commitment, "bytes");
|
23535
|
+
versionedHash.set([version2], 0);
|
23536
|
+
return to === "bytes" ? versionedHash : bytesToHex2(versionedHash);
|
23537
|
+
}
|
23538
|
+
|
23539
|
+
// ../node_modules/viem/_esm/utils/blob/commitmentsToVersionedHashes.js
|
23540
|
+
function commitmentsToVersionedHashes(parameters) {
|
23541
|
+
const { commitments, version: version2 } = parameters;
|
23542
|
+
const to = parameters.to ?? (typeof commitments[0] === "string" ? "hex" : "bytes");
|
23543
|
+
const hashes = [];
|
23544
|
+
for (const commitment of commitments) {
|
23545
|
+
hashes.push(commitmentToVersionedHash({
|
23546
|
+
commitment,
|
23547
|
+
to,
|
23548
|
+
version: version2
|
23549
|
+
}));
|
23550
|
+
}
|
23551
|
+
return hashes;
|
23552
|
+
}
|
23553
|
+
|
23554
|
+
// ../node_modules/viem/_esm/constants/blob.js
|
23555
|
+
var blobsPerTransaction = 6;
|
23556
|
+
var bytesPerFieldElement = 32;
|
23557
|
+
var fieldElementsPerBlob = 4096;
|
23558
|
+
var bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob;
|
23559
|
+
var maxBytesPerTransaction = bytesPerBlob * blobsPerTransaction - 1 - 1 * fieldElementsPerBlob * blobsPerTransaction;
|
23560
|
+
|
23561
|
+
// ../node_modules/viem/_esm/constants/kzg.js
|
23562
|
+
var versionedHashVersionKzg = 1;
|
23563
|
+
|
23564
|
+
// ../node_modules/viem/_esm/errors/blob.js
|
23565
|
+
init_base();
|
23566
|
+
|
23567
|
+
class BlobSizeTooLargeError extends BaseError {
|
23568
|
+
constructor({ maxSize, size: size22 }) {
|
23569
|
+
super("Blob size is too large.", {
|
23570
|
+
metaMessages: [`Max: ${maxSize} bytes`, `Given: ${size22} bytes`],
|
23571
|
+
name: "BlobSizeTooLargeError"
|
23572
|
+
});
|
23573
|
+
}
|
23574
|
+
}
|
23575
|
+
|
23576
|
+
class EmptyBlobError extends BaseError {
|
23577
|
+
constructor() {
|
23578
|
+
super("Blob data must not be empty.", { name: "EmptyBlobError" });
|
23579
|
+
}
|
23580
|
+
}
|
23581
|
+
|
23582
|
+
class InvalidVersionedHashSizeError extends BaseError {
|
23583
|
+
constructor({ hash: hash2, size: size22 }) {
|
23584
|
+
super(`Versioned hash "${hash2}" size is invalid.`, {
|
23585
|
+
metaMessages: ["Expected: 32", `Received: ${size22}`],
|
23586
|
+
name: "InvalidVersionedHashSizeError"
|
23587
|
+
});
|
23588
|
+
}
|
23589
|
+
}
|
23590
|
+
|
23591
|
+
class InvalidVersionedHashVersionError extends BaseError {
|
23592
|
+
constructor({ hash: hash2, version: version2 }) {
|
23593
|
+
super(`Versioned hash "${hash2}" version is invalid.`, {
|
23594
|
+
metaMessages: [
|
23595
|
+
`Expected: ${versionedHashVersionKzg}`,
|
23596
|
+
`Received: ${version2}`
|
23597
|
+
],
|
23598
|
+
name: "InvalidVersionedHashVersionError"
|
23599
|
+
});
|
23600
|
+
}
|
23601
|
+
}
|
23602
|
+
|
23603
|
+
// ../node_modules/viem/_esm/utils/blob/toBlobs.js
|
23604
|
+
init_cursor2();
|
23605
|
+
init_size();
|
23606
|
+
init_toBytes();
|
23607
|
+
init_toHex();
|
23608
|
+
function toBlobs(parameters) {
|
23609
|
+
const to = parameters.to ?? (typeof parameters.data === "string" ? "hex" : "bytes");
|
23610
|
+
const data = typeof parameters.data === "string" ? hexToBytes(parameters.data) : parameters.data;
|
23611
|
+
const size_ = size21(data);
|
23612
|
+
if (!size_)
|
23613
|
+
throw new EmptyBlobError;
|
23614
|
+
if (size_ > maxBytesPerTransaction)
|
23615
|
+
throw new BlobSizeTooLargeError({
|
23616
|
+
maxSize: maxBytesPerTransaction,
|
23617
|
+
size: size_
|
23618
|
+
});
|
23619
|
+
const blobs = [];
|
23620
|
+
let active2 = true;
|
23621
|
+
let position = 0;
|
23622
|
+
while (active2) {
|
23623
|
+
const blob = createCursor(new Uint8Array(bytesPerBlob));
|
23624
|
+
let size22 = 0;
|
23625
|
+
while (size22 < fieldElementsPerBlob) {
|
23626
|
+
const bytes = data.slice(position, position + (bytesPerFieldElement - 1));
|
23627
|
+
blob.pushByte(0);
|
23628
|
+
blob.pushBytes(bytes);
|
23629
|
+
if (bytes.length < 31) {
|
23630
|
+
blob.pushByte(128);
|
23631
|
+
active2 = false;
|
23632
|
+
break;
|
23633
|
+
}
|
23634
|
+
size22++;
|
23635
|
+
position += 31;
|
23636
|
+
}
|
23637
|
+
blobs.push(blob);
|
23638
|
+
}
|
23639
|
+
return to === "bytes" ? blobs.map((x) => x.bytes) : blobs.map((x) => bytesToHex2(x.bytes));
|
23640
|
+
}
|
23641
|
+
|
23642
|
+
// ../node_modules/viem/_esm/utils/blob/toBlobSidecars.js
|
23643
|
+
function toBlobSidecars(parameters) {
|
23644
|
+
const { data, kzg, to } = parameters;
|
23645
|
+
const blobs = parameters.blobs ?? toBlobs({ data, to });
|
23646
|
+
const commitments = parameters.commitments ?? blobsToCommitments({ blobs, kzg, to });
|
23647
|
+
const proofs = parameters.proofs ?? blobsToProofs({ blobs, commitments, kzg, to });
|
23648
|
+
const sidecars = [];
|
23649
|
+
for (let i = 0;i < blobs.length; i++)
|
23650
|
+
sidecars.push({
|
23651
|
+
blob: blobs[i],
|
23652
|
+
commitment: commitments[i],
|
23653
|
+
proof: proofs[i]
|
23654
|
+
});
|
23655
|
+
return sidecars;
|
23656
|
+
}
|
23657
|
+
|
23658
|
+
// ../node_modules/viem/_esm/utils/transaction/getTransactionType.js
|
23659
|
+
init_transaction();
|
23660
|
+
function getTransactionType(transaction) {
|
23661
|
+
if (transaction.type)
|
23662
|
+
return transaction.type;
|
23663
|
+
if (typeof transaction.authorizationList !== "undefined")
|
23664
|
+
return "eip7702";
|
23665
|
+
if (typeof transaction.blobs !== "undefined" || typeof transaction.blobVersionedHashes !== "undefined" || typeof transaction.maxFeePerBlobGas !== "undefined" || typeof transaction.sidecars !== "undefined")
|
23666
|
+
return "eip4844";
|
23667
|
+
if (typeof transaction.maxFeePerGas !== "undefined" || typeof transaction.maxPriorityFeePerGas !== "undefined") {
|
23668
|
+
return "eip1559";
|
23669
|
+
}
|
23670
|
+
if (typeof transaction.gasPrice !== "undefined") {
|
23671
|
+
if (typeof transaction.accessList !== "undefined")
|
23672
|
+
return "eip2930";
|
23673
|
+
return "legacy";
|
23674
|
+
}
|
23675
|
+
throw new InvalidSerializableTransactionError({ transaction });
|
23676
|
+
}
|
23677
|
+
|
23678
|
+
// ../node_modules/viem/_esm/utils/formatters/log.js
|
23679
|
+
function formatLog(log3, { args: args2, eventName } = {}) {
|
23680
|
+
return {
|
23681
|
+
...log3,
|
23682
|
+
blockHash: log3.blockHash ? log3.blockHash : null,
|
23683
|
+
blockNumber: log3.blockNumber ? BigInt(log3.blockNumber) : null,
|
23684
|
+
logIndex: log3.logIndex ? Number(log3.logIndex) : null,
|
23685
|
+
transactionHash: log3.transactionHash ? log3.transactionHash : null,
|
23686
|
+
transactionIndex: log3.transactionIndex ? Number(log3.transactionIndex) : null,
|
23687
|
+
...eventName ? { args: args2, eventName } : {}
|
23688
|
+
};
|
23689
|
+
}
|
23690
|
+
|
23691
|
+
// ../node_modules/viem/_esm/utils/chain/defineChain.js
|
23692
|
+
function defineChain(chain) {
|
23693
|
+
return {
|
23694
|
+
formatters: undefined,
|
23695
|
+
fees: undefined,
|
23696
|
+
serializers: undefined,
|
23697
|
+
...chain
|
23698
|
+
};
|
23699
|
+
}
|
23700
|
+
|
22347
23701
|
// ../node_modules/viem/_esm/utils/abi/encodePacked.js
|
22348
23702
|
init_abi();
|
22349
23703
|
init_address();
|
@@ -22413,6 +23767,353 @@ function encode6(type2, value6, isArray2 = false) {
|
|
22413
23767
|
throw new UnsupportedPackedAbiType(type2);
|
22414
23768
|
}
|
22415
23769
|
|
23770
|
+
// ../node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
|
23771
|
+
init_toHex();
|
23772
|
+
|
23773
|
+
// ../node_modules/viem/_esm/utils/transaction/serializeTransaction.js
|
23774
|
+
init_transaction();
|
23775
|
+
init_toHex();
|
23776
|
+
|
23777
|
+
// ../node_modules/viem/_esm/utils/transaction/assertTransaction.js
|
23778
|
+
init_number();
|
23779
|
+
init_address();
|
23780
|
+
init_base();
|
23781
|
+
init_chain();
|
23782
|
+
init_node();
|
23783
|
+
init_isAddress();
|
23784
|
+
init_size();
|
23785
|
+
init_slice();
|
23786
|
+
init_fromHex();
|
23787
|
+
function assertTransactionEIP7702(transaction) {
|
23788
|
+
const { authorizationList } = transaction;
|
23789
|
+
if (authorizationList) {
|
23790
|
+
for (const authorization of authorizationList) {
|
23791
|
+
const { chainId } = authorization;
|
23792
|
+
const address = authorization.address;
|
23793
|
+
if (!isAddress(address))
|
23794
|
+
throw new InvalidAddressError({ address });
|
23795
|
+
if (chainId < 0)
|
23796
|
+
throw new InvalidChainIdError({ chainId });
|
23797
|
+
}
|
23798
|
+
}
|
23799
|
+
assertTransactionEIP1559(transaction);
|
23800
|
+
}
|
23801
|
+
function assertTransactionEIP4844(transaction) {
|
23802
|
+
const { blobVersionedHashes } = transaction;
|
23803
|
+
if (blobVersionedHashes) {
|
23804
|
+
if (blobVersionedHashes.length === 0)
|
23805
|
+
throw new EmptyBlobError;
|
23806
|
+
for (const hash2 of blobVersionedHashes) {
|
23807
|
+
const size_ = size21(hash2);
|
23808
|
+
const version2 = hexToNumber(slice(hash2, 0, 1));
|
23809
|
+
if (size_ !== 32)
|
23810
|
+
throw new InvalidVersionedHashSizeError({ hash: hash2, size: size_ });
|
23811
|
+
if (version2 !== versionedHashVersionKzg)
|
23812
|
+
throw new InvalidVersionedHashVersionError({
|
23813
|
+
hash: hash2,
|
23814
|
+
version: version2
|
23815
|
+
});
|
23816
|
+
}
|
23817
|
+
}
|
23818
|
+
assertTransactionEIP1559(transaction);
|
23819
|
+
}
|
23820
|
+
function assertTransactionEIP1559(transaction) {
|
23821
|
+
const { chainId, maxPriorityFeePerGas, maxFeePerGas, to } = transaction;
|
23822
|
+
if (chainId <= 0)
|
23823
|
+
throw new InvalidChainIdError({ chainId });
|
23824
|
+
if (to && !isAddress(to))
|
23825
|
+
throw new InvalidAddressError({ address: to });
|
23826
|
+
if (maxFeePerGas && maxFeePerGas > maxUint256)
|
23827
|
+
throw new FeeCapTooHighError({ maxFeePerGas });
|
23828
|
+
if (maxPriorityFeePerGas && maxFeePerGas && maxPriorityFeePerGas > maxFeePerGas)
|
23829
|
+
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
23830
|
+
}
|
23831
|
+
function assertTransactionEIP2930(transaction) {
|
23832
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
23833
|
+
if (chainId <= 0)
|
23834
|
+
throw new InvalidChainIdError({ chainId });
|
23835
|
+
if (to && !isAddress(to))
|
23836
|
+
throw new InvalidAddressError({ address: to });
|
23837
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
23838
|
+
throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
23839
|
+
if (gasPrice && gasPrice > maxUint256)
|
23840
|
+
throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
23841
|
+
}
|
23842
|
+
function assertTransactionLegacy(transaction) {
|
23843
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
23844
|
+
if (to && !isAddress(to))
|
23845
|
+
throw new InvalidAddressError({ address: to });
|
23846
|
+
if (typeof chainId !== "undefined" && chainId <= 0)
|
23847
|
+
throw new InvalidChainIdError({ chainId });
|
23848
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
23849
|
+
throw new BaseError("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
23850
|
+
if (gasPrice && gasPrice > maxUint256)
|
23851
|
+
throw new FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
23852
|
+
}
|
23853
|
+
|
23854
|
+
// ../node_modules/viem/_esm/utils/transaction/serializeAccessList.js
|
23855
|
+
init_address();
|
23856
|
+
init_transaction();
|
23857
|
+
init_isAddress();
|
23858
|
+
function serializeAccessList(accessList) {
|
23859
|
+
if (!accessList || accessList.length === 0)
|
23860
|
+
return [];
|
23861
|
+
const serializedAccessList = [];
|
23862
|
+
for (let i = 0;i < accessList.length; i++) {
|
23863
|
+
const { address, storageKeys } = accessList[i];
|
23864
|
+
for (let j = 0;j < storageKeys.length; j++) {
|
23865
|
+
if (storageKeys[j].length - 2 !== 64) {
|
23866
|
+
throw new InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
|
23867
|
+
}
|
23868
|
+
}
|
23869
|
+
if (!isAddress(address, { strict: false })) {
|
23870
|
+
throw new InvalidAddressError({ address });
|
23871
|
+
}
|
23872
|
+
serializedAccessList.push([address, storageKeys]);
|
23873
|
+
}
|
23874
|
+
return serializedAccessList;
|
23875
|
+
}
|
23876
|
+
|
23877
|
+
// ../node_modules/viem/_esm/utils/transaction/serializeTransaction.js
|
23878
|
+
function serializeTransaction(transaction, signature) {
|
23879
|
+
const type2 = getTransactionType(transaction);
|
23880
|
+
if (type2 === "eip1559")
|
23881
|
+
return serializeTransactionEIP1559(transaction, signature);
|
23882
|
+
if (type2 === "eip2930")
|
23883
|
+
return serializeTransactionEIP2930(transaction, signature);
|
23884
|
+
if (type2 === "eip4844")
|
23885
|
+
return serializeTransactionEIP4844(transaction, signature);
|
23886
|
+
if (type2 === "eip7702")
|
23887
|
+
return serializeTransactionEIP7702(transaction, signature);
|
23888
|
+
return serializeTransactionLegacy(transaction, signature);
|
23889
|
+
}
|
23890
|
+
function serializeTransactionEIP7702(transaction, signature) {
|
23891
|
+
const { authorizationList, chainId, gas, nonce, to, value: value6, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
23892
|
+
assertTransactionEIP7702(transaction);
|
23893
|
+
const serializedAccessList = serializeAccessList(accessList);
|
23894
|
+
const serializedAuthorizationList = serializeAuthorizationList(authorizationList);
|
23895
|
+
return concatHex([
|
23896
|
+
"0x04",
|
23897
|
+
toRlp([
|
23898
|
+
toHex(chainId),
|
23899
|
+
nonce ? toHex(nonce) : "0x",
|
23900
|
+
maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
|
23901
|
+
maxFeePerGas ? toHex(maxFeePerGas) : "0x",
|
23902
|
+
gas ? toHex(gas) : "0x",
|
23903
|
+
to ?? "0x",
|
23904
|
+
value6 ? toHex(value6) : "0x",
|
23905
|
+
data ?? "0x",
|
23906
|
+
serializedAccessList,
|
23907
|
+
serializedAuthorizationList,
|
23908
|
+
...toYParitySignatureArray(transaction, signature)
|
23909
|
+
])
|
23910
|
+
]);
|
23911
|
+
}
|
23912
|
+
function serializeTransactionEIP4844(transaction, signature) {
|
23913
|
+
const { chainId, gas, nonce, to, value: value6, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
23914
|
+
assertTransactionEIP4844(transaction);
|
23915
|
+
let blobVersionedHashes = transaction.blobVersionedHashes;
|
23916
|
+
let sidecars = transaction.sidecars;
|
23917
|
+
if (transaction.blobs && (typeof blobVersionedHashes === "undefined" || typeof sidecars === "undefined")) {
|
23918
|
+
const blobs2 = typeof transaction.blobs[0] === "string" ? transaction.blobs : transaction.blobs.map((x) => bytesToHex2(x));
|
23919
|
+
const kzg = transaction.kzg;
|
23920
|
+
const commitments2 = blobsToCommitments({
|
23921
|
+
blobs: blobs2,
|
23922
|
+
kzg
|
23923
|
+
});
|
23924
|
+
if (typeof blobVersionedHashes === "undefined")
|
23925
|
+
blobVersionedHashes = commitmentsToVersionedHashes({
|
23926
|
+
commitments: commitments2
|
23927
|
+
});
|
23928
|
+
if (typeof sidecars === "undefined") {
|
23929
|
+
const proofs2 = blobsToProofs({ blobs: blobs2, commitments: commitments2, kzg });
|
23930
|
+
sidecars = toBlobSidecars({ blobs: blobs2, commitments: commitments2, proofs: proofs2 });
|
23931
|
+
}
|
23932
|
+
}
|
23933
|
+
const serializedAccessList = serializeAccessList(accessList);
|
23934
|
+
const serializedTransaction = [
|
23935
|
+
toHex(chainId),
|
23936
|
+
nonce ? toHex(nonce) : "0x",
|
23937
|
+
maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
|
23938
|
+
maxFeePerGas ? toHex(maxFeePerGas) : "0x",
|
23939
|
+
gas ? toHex(gas) : "0x",
|
23940
|
+
to ?? "0x",
|
23941
|
+
value6 ? toHex(value6) : "0x",
|
23942
|
+
data ?? "0x",
|
23943
|
+
serializedAccessList,
|
23944
|
+
maxFeePerBlobGas ? toHex(maxFeePerBlobGas) : "0x",
|
23945
|
+
blobVersionedHashes ?? [],
|
23946
|
+
...toYParitySignatureArray(transaction, signature)
|
23947
|
+
];
|
23948
|
+
const blobs = [];
|
23949
|
+
const commitments = [];
|
23950
|
+
const proofs = [];
|
23951
|
+
if (sidecars)
|
23952
|
+
for (let i = 0;i < sidecars.length; i++) {
|
23953
|
+
const { blob, commitment, proof } = sidecars[i];
|
23954
|
+
blobs.push(blob);
|
23955
|
+
commitments.push(commitment);
|
23956
|
+
proofs.push(proof);
|
23957
|
+
}
|
23958
|
+
return concatHex([
|
23959
|
+
"0x03",
|
23960
|
+
sidecars ? toRlp([serializedTransaction, blobs, commitments, proofs]) : toRlp(serializedTransaction)
|
23961
|
+
]);
|
23962
|
+
}
|
23963
|
+
function serializeTransactionEIP1559(transaction, signature) {
|
23964
|
+
const { chainId, gas, nonce, to, value: value6, maxFeePerGas, maxPriorityFeePerGas, accessList, data } = transaction;
|
23965
|
+
assertTransactionEIP1559(transaction);
|
23966
|
+
const serializedAccessList = serializeAccessList(accessList);
|
23967
|
+
const serializedTransaction = [
|
23968
|
+
toHex(chainId),
|
23969
|
+
nonce ? toHex(nonce) : "0x",
|
23970
|
+
maxPriorityFeePerGas ? toHex(maxPriorityFeePerGas) : "0x",
|
23971
|
+
maxFeePerGas ? toHex(maxFeePerGas) : "0x",
|
23972
|
+
gas ? toHex(gas) : "0x",
|
23973
|
+
to ?? "0x",
|
23974
|
+
value6 ? toHex(value6) : "0x",
|
23975
|
+
data ?? "0x",
|
23976
|
+
serializedAccessList,
|
23977
|
+
...toYParitySignatureArray(transaction, signature)
|
23978
|
+
];
|
23979
|
+
return concatHex([
|
23980
|
+
"0x02",
|
23981
|
+
toRlp(serializedTransaction)
|
23982
|
+
]);
|
23983
|
+
}
|
23984
|
+
function serializeTransactionEIP2930(transaction, signature) {
|
23985
|
+
const { chainId, gas, data, nonce, to, value: value6, accessList, gasPrice } = transaction;
|
23986
|
+
assertTransactionEIP2930(transaction);
|
23987
|
+
const serializedAccessList = serializeAccessList(accessList);
|
23988
|
+
const serializedTransaction = [
|
23989
|
+
toHex(chainId),
|
23990
|
+
nonce ? toHex(nonce) : "0x",
|
23991
|
+
gasPrice ? toHex(gasPrice) : "0x",
|
23992
|
+
gas ? toHex(gas) : "0x",
|
23993
|
+
to ?? "0x",
|
23994
|
+
value6 ? toHex(value6) : "0x",
|
23995
|
+
data ?? "0x",
|
23996
|
+
serializedAccessList,
|
23997
|
+
...toYParitySignatureArray(transaction, signature)
|
23998
|
+
];
|
23999
|
+
return concatHex([
|
24000
|
+
"0x01",
|
24001
|
+
toRlp(serializedTransaction)
|
24002
|
+
]);
|
24003
|
+
}
|
24004
|
+
function serializeTransactionLegacy(transaction, signature) {
|
24005
|
+
const { chainId = 0, gas, data, nonce, to, value: value6, gasPrice } = transaction;
|
24006
|
+
assertTransactionLegacy(transaction);
|
24007
|
+
let serializedTransaction = [
|
24008
|
+
nonce ? toHex(nonce) : "0x",
|
24009
|
+
gasPrice ? toHex(gasPrice) : "0x",
|
24010
|
+
gas ? toHex(gas) : "0x",
|
24011
|
+
to ?? "0x",
|
24012
|
+
value6 ? toHex(value6) : "0x",
|
24013
|
+
data ?? "0x"
|
24014
|
+
];
|
24015
|
+
if (signature) {
|
24016
|
+
const v = (() => {
|
24017
|
+
if (signature.v >= 35n) {
|
24018
|
+
const inferredChainId = (signature.v - 35n) / 2n;
|
24019
|
+
if (inferredChainId > 0)
|
24020
|
+
return signature.v;
|
24021
|
+
return 27n + (signature.v === 35n ? 0n : 1n);
|
24022
|
+
}
|
24023
|
+
if (chainId > 0)
|
24024
|
+
return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
|
24025
|
+
const v2 = 27n + (signature.v === 27n ? 0n : 1n);
|
24026
|
+
if (signature.v !== v2)
|
24027
|
+
throw new InvalidLegacyVError({ v: signature.v });
|
24028
|
+
return v2;
|
24029
|
+
})();
|
24030
|
+
const r = trim(signature.r);
|
24031
|
+
const s = trim(signature.s);
|
24032
|
+
serializedTransaction = [
|
24033
|
+
...serializedTransaction,
|
24034
|
+
toHex(v),
|
24035
|
+
r === "0x00" ? "0x" : r,
|
24036
|
+
s === "0x00" ? "0x" : s
|
24037
|
+
];
|
24038
|
+
} else if (chainId > 0) {
|
24039
|
+
serializedTransaction = [
|
24040
|
+
...serializedTransaction,
|
24041
|
+
toHex(chainId),
|
24042
|
+
"0x",
|
24043
|
+
"0x"
|
24044
|
+
];
|
24045
|
+
}
|
24046
|
+
return toRlp(serializedTransaction);
|
24047
|
+
}
|
24048
|
+
function toYParitySignatureArray(transaction, signature_) {
|
24049
|
+
const signature = signature_ ?? transaction;
|
24050
|
+
const { v, yParity } = signature;
|
24051
|
+
if (typeof signature.r === "undefined")
|
24052
|
+
return [];
|
24053
|
+
if (typeof signature.s === "undefined")
|
24054
|
+
return [];
|
24055
|
+
if (typeof v === "undefined" && typeof yParity === "undefined")
|
24056
|
+
return [];
|
24057
|
+
const r = trim(signature.r);
|
24058
|
+
const s = trim(signature.s);
|
24059
|
+
const yParity_ = (() => {
|
24060
|
+
if (typeof yParity === "number")
|
24061
|
+
return yParity ? toHex(1) : "0x";
|
24062
|
+
if (v === 0n)
|
24063
|
+
return "0x";
|
24064
|
+
if (v === 1n)
|
24065
|
+
return toHex(1);
|
24066
|
+
return v === 27n ? "0x" : toHex(1);
|
24067
|
+
})();
|
24068
|
+
return [yParity_, r === "0x00" ? "0x" : r, s === "0x00" ? "0x" : s];
|
24069
|
+
}
|
24070
|
+
|
24071
|
+
// ../node_modules/viem/_esm/utils/authorization/serializeAuthorizationList.js
|
24072
|
+
function serializeAuthorizationList(authorizationList) {
|
24073
|
+
if (!authorizationList || authorizationList.length === 0)
|
24074
|
+
return [];
|
24075
|
+
const serializedAuthorizationList = [];
|
24076
|
+
for (const authorization of authorizationList) {
|
24077
|
+
const { chainId, nonce, ...signature } = authorization;
|
24078
|
+
const contractAddress = authorization.address;
|
24079
|
+
serializedAuthorizationList.push([
|
24080
|
+
chainId ? toHex(chainId) : "0x",
|
24081
|
+
contractAddress,
|
24082
|
+
nonce ? toHex(nonce) : "0x",
|
24083
|
+
...toYParitySignatureArray({}, signature)
|
24084
|
+
]);
|
24085
|
+
}
|
24086
|
+
return serializedAuthorizationList;
|
24087
|
+
}
|
24088
|
+
|
24089
|
+
// ../node_modules/viem/_esm/utils/formatters/transactionReceipt.js
|
24090
|
+
init_fromHex();
|
24091
|
+
var receiptStatuses = {
|
24092
|
+
"0x0": "reverted",
|
24093
|
+
"0x1": "success"
|
24094
|
+
};
|
24095
|
+
function formatTransactionReceipt(transactionReceipt) {
|
24096
|
+
const receipt = {
|
24097
|
+
...transactionReceipt,
|
24098
|
+
blockNumber: transactionReceipt.blockNumber ? BigInt(transactionReceipt.blockNumber) : null,
|
24099
|
+
contractAddress: transactionReceipt.contractAddress ? transactionReceipt.contractAddress : null,
|
24100
|
+
cumulativeGasUsed: transactionReceipt.cumulativeGasUsed ? BigInt(transactionReceipt.cumulativeGasUsed) : null,
|
24101
|
+
effectiveGasPrice: transactionReceipt.effectiveGasPrice ? BigInt(transactionReceipt.effectiveGasPrice) : null,
|
24102
|
+
gasUsed: transactionReceipt.gasUsed ? BigInt(transactionReceipt.gasUsed) : null,
|
24103
|
+
logs: transactionReceipt.logs ? transactionReceipt.logs.map((log3) => formatLog(log3)) : null,
|
24104
|
+
to: transactionReceipt.to ? transactionReceipt.to : null,
|
24105
|
+
transactionIndex: transactionReceipt.transactionIndex ? hexToNumber(transactionReceipt.transactionIndex) : null,
|
24106
|
+
status: transactionReceipt.status ? receiptStatuses[transactionReceipt.status] : null,
|
24107
|
+
type: transactionReceipt.type ? transactionType[transactionReceipt.type] || transactionReceipt.type : null
|
24108
|
+
};
|
24109
|
+
if (transactionReceipt.blobGasPrice)
|
24110
|
+
receipt.blobGasPrice = BigInt(transactionReceipt.blobGasPrice);
|
24111
|
+
if (transactionReceipt.blobGasUsed)
|
24112
|
+
receipt.blobGasUsed = BigInt(transactionReceipt.blobGasUsed);
|
24113
|
+
return receipt;
|
24114
|
+
}
|
24115
|
+
var defineTransactionReceipt = /* @__PURE__ */ defineFormatter("transactionReceipt", formatTransactionReceipt);
|
24116
|
+
|
22416
24117
|
// ../node_modules/viem/_esm/index.js
|
22417
24118
|
init_toBytes();
|
22418
24119
|
init_toHex();
|