save-forever-mcp 0.1.0 → 0.2.0
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/{ccip-X5HB77FX.js → ccip-7N4DENAM.js} +1 -1
- package/dist/{chunk-MDUN2K7E.js → chunk-4UXTALEH.js} +2 -2
- package/dist/{chunk-IS73UAH3.js → chunk-ZGDY5OSW.js} +208 -2084
- package/dist/{secp256k1-YU6BFYUO.js → secp256k1-JRPUSUH3.js} +1 -1
- package/dist/server.js +1447 -14583
- package/package.json +1 -1
|
@@ -168,12 +168,6 @@ var receiveSignatureRegex = /^receive\(\) external payable$/;
|
|
|
168
168
|
function isReceiveSignature(signature) {
|
|
169
169
|
return receiveSignatureRegex.test(signature);
|
|
170
170
|
}
|
|
171
|
-
var modifiers = /* @__PURE__ */ new Set([
|
|
172
|
-
"memory",
|
|
173
|
-
"indexed",
|
|
174
|
-
"storage",
|
|
175
|
-
"calldata"
|
|
176
|
-
]);
|
|
177
171
|
var eventModifiers = /* @__PURE__ */ new Set(["indexed"]);
|
|
178
172
|
var functionModifiers = /* @__PURE__ */ new Set([
|
|
179
173
|
"calldata",
|
|
@@ -182,20 +176,6 @@ var functionModifiers = /* @__PURE__ */ new Set([
|
|
|
182
176
|
]);
|
|
183
177
|
|
|
184
178
|
// node_modules/abitype/dist/esm/human-readable/errors/abiItem.js
|
|
185
|
-
var InvalidAbiItemError = class extends BaseError {
|
|
186
|
-
constructor({ signature }) {
|
|
187
|
-
super("Failed to parse ABI item.", {
|
|
188
|
-
details: `parseAbiItem(${JSON.stringify(signature, null, 2)})`,
|
|
189
|
-
docsPath: "/api/human#parseabiitem-1"
|
|
190
|
-
});
|
|
191
|
-
Object.defineProperty(this, "name", {
|
|
192
|
-
enumerable: true,
|
|
193
|
-
configurable: true,
|
|
194
|
-
writable: true,
|
|
195
|
-
value: "InvalidAbiItemError"
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
179
|
var UnknownTypeError = class extends BaseError {
|
|
200
180
|
constructor({ type }) {
|
|
201
181
|
super("Unknown type.", {
|
|
@@ -226,20 +206,6 @@ var UnknownSolidityTypeError = class extends BaseError {
|
|
|
226
206
|
};
|
|
227
207
|
|
|
228
208
|
// node_modules/abitype/dist/esm/human-readable/errors/abiParameter.js
|
|
229
|
-
var InvalidAbiParametersError = class extends BaseError {
|
|
230
|
-
constructor({ params }) {
|
|
231
|
-
super("Failed to parse ABI parameters.", {
|
|
232
|
-
details: `parseAbiParameters(${JSON.stringify(params, null, 2)})`,
|
|
233
|
-
docsPath: "/api/human#parseabiparameters-1"
|
|
234
|
-
});
|
|
235
|
-
Object.defineProperty(this, "name", {
|
|
236
|
-
enumerable: true,
|
|
237
|
-
configurable: true,
|
|
238
|
-
writable: true,
|
|
239
|
-
value: "InvalidAbiParametersError"
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
};
|
|
243
209
|
var InvalidParameterError = class extends BaseError {
|
|
244
210
|
constructor({ param }) {
|
|
245
211
|
super("Invalid ABI parameter.", {
|
|
@@ -747,276 +713,6 @@ function parseAbi(signatures) {
|
|
|
747
713
|
return abi;
|
|
748
714
|
}
|
|
749
715
|
|
|
750
|
-
// node_modules/abitype/dist/esm/human-readable/parseAbiItem.js
|
|
751
|
-
function parseAbiItem(signature) {
|
|
752
|
-
let abiItem;
|
|
753
|
-
if (typeof signature === "string")
|
|
754
|
-
abiItem = parseSignature(signature);
|
|
755
|
-
else {
|
|
756
|
-
const structs = parseStructs(signature);
|
|
757
|
-
const length = signature.length;
|
|
758
|
-
for (let i = 0; i < length; i++) {
|
|
759
|
-
const signature_ = signature[i];
|
|
760
|
-
if (isStructSignature(signature_))
|
|
761
|
-
continue;
|
|
762
|
-
abiItem = parseSignature(signature_, structs);
|
|
763
|
-
break;
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
if (!abiItem)
|
|
767
|
-
throw new InvalidAbiItemError({ signature });
|
|
768
|
-
return abiItem;
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
// node_modules/abitype/dist/esm/human-readable/parseAbiParameters.js
|
|
772
|
-
function parseAbiParameters(params) {
|
|
773
|
-
const abiParameters = [];
|
|
774
|
-
if (typeof params === "string") {
|
|
775
|
-
const parameters = splitParameters(params);
|
|
776
|
-
const length = parameters.length;
|
|
777
|
-
for (let i = 0; i < length; i++) {
|
|
778
|
-
abiParameters.push(parseAbiParameter(parameters[i], { modifiers }));
|
|
779
|
-
}
|
|
780
|
-
} else {
|
|
781
|
-
const structs = parseStructs(params);
|
|
782
|
-
const length = params.length;
|
|
783
|
-
for (let i = 0; i < length; i++) {
|
|
784
|
-
const signature = params[i];
|
|
785
|
-
if (isStructSignature(signature))
|
|
786
|
-
continue;
|
|
787
|
-
const parameters = splitParameters(signature);
|
|
788
|
-
const length2 = parameters.length;
|
|
789
|
-
for (let k = 0; k < length2; k++) {
|
|
790
|
-
abiParameters.push(parseAbiParameter(parameters[k], { modifiers, structs }));
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
if (abiParameters.length === 0)
|
|
795
|
-
throw new InvalidAbiParametersError({ params });
|
|
796
|
-
return abiParameters;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
// node_modules/ox/node_modules/@noble/curves/esm/abstract/utils.js
|
|
800
|
-
var _0n = /* @__PURE__ */ BigInt(0);
|
|
801
|
-
var _1n = /* @__PURE__ */ BigInt(1);
|
|
802
|
-
function isBytes(a) {
|
|
803
|
-
return a instanceof Uint8Array || ArrayBuffer.isView(a) && a.constructor.name === "Uint8Array";
|
|
804
|
-
}
|
|
805
|
-
function abytes2(item) {
|
|
806
|
-
if (!isBytes(item))
|
|
807
|
-
throw new Error("Uint8Array expected");
|
|
808
|
-
}
|
|
809
|
-
function abool(title, value) {
|
|
810
|
-
if (typeof value !== "boolean")
|
|
811
|
-
throw new Error(title + " boolean expected, got " + value);
|
|
812
|
-
}
|
|
813
|
-
function numberToHexUnpadded(num) {
|
|
814
|
-
const hex = num.toString(16);
|
|
815
|
-
return hex.length & 1 ? "0" + hex : hex;
|
|
816
|
-
}
|
|
817
|
-
function hexToNumber(hex) {
|
|
818
|
-
if (typeof hex !== "string")
|
|
819
|
-
throw new Error("hex string expected, got " + typeof hex);
|
|
820
|
-
return hex === "" ? _0n : BigInt("0x" + hex);
|
|
821
|
-
}
|
|
822
|
-
var hasHexBuiltin = (
|
|
823
|
-
// @ts-ignore
|
|
824
|
-
typeof Uint8Array.from([]).toHex === "function" && typeof Uint8Array.fromHex === "function"
|
|
825
|
-
);
|
|
826
|
-
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, "0"));
|
|
827
|
-
function bytesToHex(bytes) {
|
|
828
|
-
abytes2(bytes);
|
|
829
|
-
if (hasHexBuiltin)
|
|
830
|
-
return bytes.toHex();
|
|
831
|
-
let hex = "";
|
|
832
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
833
|
-
hex += hexes[bytes[i]];
|
|
834
|
-
}
|
|
835
|
-
return hex;
|
|
836
|
-
}
|
|
837
|
-
var asciis = { _0: 48, _9: 57, A: 65, F: 70, a: 97, f: 102 };
|
|
838
|
-
function asciiToBase16(ch) {
|
|
839
|
-
if (ch >= asciis._0 && ch <= asciis._9)
|
|
840
|
-
return ch - asciis._0;
|
|
841
|
-
if (ch >= asciis.A && ch <= asciis.F)
|
|
842
|
-
return ch - (asciis.A - 10);
|
|
843
|
-
if (ch >= asciis.a && ch <= asciis.f)
|
|
844
|
-
return ch - (asciis.a - 10);
|
|
845
|
-
return;
|
|
846
|
-
}
|
|
847
|
-
function hexToBytes(hex) {
|
|
848
|
-
if (typeof hex !== "string")
|
|
849
|
-
throw new Error("hex string expected, got " + typeof hex);
|
|
850
|
-
if (hasHexBuiltin)
|
|
851
|
-
return Uint8Array.fromHex(hex);
|
|
852
|
-
const hl = hex.length;
|
|
853
|
-
const al = hl / 2;
|
|
854
|
-
if (hl % 2)
|
|
855
|
-
throw new Error("hex string expected, got unpadded hex of length " + hl);
|
|
856
|
-
const array = new Uint8Array(al);
|
|
857
|
-
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
858
|
-
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
|
859
|
-
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
|
860
|
-
if (n1 === void 0 || n2 === void 0) {
|
|
861
|
-
const char = hex[hi] + hex[hi + 1];
|
|
862
|
-
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
863
|
-
}
|
|
864
|
-
array[ai] = n1 * 16 + n2;
|
|
865
|
-
}
|
|
866
|
-
return array;
|
|
867
|
-
}
|
|
868
|
-
function bytesToNumberBE(bytes) {
|
|
869
|
-
return hexToNumber(bytesToHex(bytes));
|
|
870
|
-
}
|
|
871
|
-
function bytesToNumberLE(bytes) {
|
|
872
|
-
abytes2(bytes);
|
|
873
|
-
return hexToNumber(bytesToHex(Uint8Array.from(bytes).reverse()));
|
|
874
|
-
}
|
|
875
|
-
function numberToBytesBE(n, len) {
|
|
876
|
-
return hexToBytes(n.toString(16).padStart(len * 2, "0"));
|
|
877
|
-
}
|
|
878
|
-
function numberToBytesLE(n, len) {
|
|
879
|
-
return numberToBytesBE(n, len).reverse();
|
|
880
|
-
}
|
|
881
|
-
function ensureBytes(title, hex, expectedLength) {
|
|
882
|
-
let res;
|
|
883
|
-
if (typeof hex === "string") {
|
|
884
|
-
try {
|
|
885
|
-
res = hexToBytes(hex);
|
|
886
|
-
} catch (e) {
|
|
887
|
-
throw new Error(title + " must be hex string or Uint8Array, cause: " + e);
|
|
888
|
-
}
|
|
889
|
-
} else if (isBytes(hex)) {
|
|
890
|
-
res = Uint8Array.from(hex);
|
|
891
|
-
} else {
|
|
892
|
-
throw new Error(title + " must be hex string or Uint8Array");
|
|
893
|
-
}
|
|
894
|
-
const len = res.length;
|
|
895
|
-
if (typeof expectedLength === "number" && len !== expectedLength)
|
|
896
|
-
throw new Error(title + " of length " + expectedLength + " expected, got " + len);
|
|
897
|
-
return res;
|
|
898
|
-
}
|
|
899
|
-
function concatBytes(...arrays) {
|
|
900
|
-
let sum = 0;
|
|
901
|
-
for (let i = 0; i < arrays.length; i++) {
|
|
902
|
-
const a = arrays[i];
|
|
903
|
-
abytes2(a);
|
|
904
|
-
sum += a.length;
|
|
905
|
-
}
|
|
906
|
-
const res = new Uint8Array(sum);
|
|
907
|
-
for (let i = 0, pad4 = 0; i < arrays.length; i++) {
|
|
908
|
-
const a = arrays[i];
|
|
909
|
-
res.set(a, pad4);
|
|
910
|
-
pad4 += a.length;
|
|
911
|
-
}
|
|
912
|
-
return res;
|
|
913
|
-
}
|
|
914
|
-
var isPosBig = (n) => typeof n === "bigint" && _0n <= n;
|
|
915
|
-
function inRange(n, min, max) {
|
|
916
|
-
return isPosBig(n) && isPosBig(min) && isPosBig(max) && min <= n && n < max;
|
|
917
|
-
}
|
|
918
|
-
function aInRange(title, n, min, max) {
|
|
919
|
-
if (!inRange(n, min, max))
|
|
920
|
-
throw new Error("expected valid " + title + ": " + min + " <= n < " + max + ", got " + n);
|
|
921
|
-
}
|
|
922
|
-
function bitLen(n) {
|
|
923
|
-
let len;
|
|
924
|
-
for (len = 0; n > _0n; n >>= _1n, len += 1)
|
|
925
|
-
;
|
|
926
|
-
return len;
|
|
927
|
-
}
|
|
928
|
-
var bitMask = (n) => (_1n << BigInt(n)) - _1n;
|
|
929
|
-
var u8n = (len) => new Uint8Array(len);
|
|
930
|
-
var u8fr = (arr) => Uint8Array.from(arr);
|
|
931
|
-
function createHmacDrbg(hashLen, qByteLen, hmacFn) {
|
|
932
|
-
if (typeof hashLen !== "number" || hashLen < 2)
|
|
933
|
-
throw new Error("hashLen must be a number");
|
|
934
|
-
if (typeof qByteLen !== "number" || qByteLen < 2)
|
|
935
|
-
throw new Error("qByteLen must be a number");
|
|
936
|
-
if (typeof hmacFn !== "function")
|
|
937
|
-
throw new Error("hmacFn must be a function");
|
|
938
|
-
let v = u8n(hashLen);
|
|
939
|
-
let k = u8n(hashLen);
|
|
940
|
-
let i = 0;
|
|
941
|
-
const reset = () => {
|
|
942
|
-
v.fill(1);
|
|
943
|
-
k.fill(0);
|
|
944
|
-
i = 0;
|
|
945
|
-
};
|
|
946
|
-
const h = (...b) => hmacFn(k, v, ...b);
|
|
947
|
-
const reseed = (seed = u8n(0)) => {
|
|
948
|
-
k = h(u8fr([0]), seed);
|
|
949
|
-
v = h();
|
|
950
|
-
if (seed.length === 0)
|
|
951
|
-
return;
|
|
952
|
-
k = h(u8fr([1]), seed);
|
|
953
|
-
v = h();
|
|
954
|
-
};
|
|
955
|
-
const gen2 = () => {
|
|
956
|
-
if (i++ >= 1e3)
|
|
957
|
-
throw new Error("drbg: tried 1000 values");
|
|
958
|
-
let len = 0;
|
|
959
|
-
const out = [];
|
|
960
|
-
while (len < qByteLen) {
|
|
961
|
-
v = h();
|
|
962
|
-
const sl = v.slice();
|
|
963
|
-
out.push(sl);
|
|
964
|
-
len += v.length;
|
|
965
|
-
}
|
|
966
|
-
return concatBytes(...out);
|
|
967
|
-
};
|
|
968
|
-
const genUntil = (seed, pred) => {
|
|
969
|
-
reset();
|
|
970
|
-
reseed(seed);
|
|
971
|
-
let res = void 0;
|
|
972
|
-
while (!(res = pred(gen2())))
|
|
973
|
-
reseed();
|
|
974
|
-
reset();
|
|
975
|
-
return res;
|
|
976
|
-
};
|
|
977
|
-
return genUntil;
|
|
978
|
-
}
|
|
979
|
-
var validatorFns = {
|
|
980
|
-
bigint: (val) => typeof val === "bigint",
|
|
981
|
-
function: (val) => typeof val === "function",
|
|
982
|
-
boolean: (val) => typeof val === "boolean",
|
|
983
|
-
string: (val) => typeof val === "string",
|
|
984
|
-
stringOrUint8Array: (val) => typeof val === "string" || isBytes(val),
|
|
985
|
-
isSafeInteger: (val) => Number.isSafeInteger(val),
|
|
986
|
-
array: (val) => Array.isArray(val),
|
|
987
|
-
field: (val, object) => object.Fp.isValid(val),
|
|
988
|
-
hash: (val) => typeof val === "function" && Number.isSafeInteger(val.outputLen)
|
|
989
|
-
};
|
|
990
|
-
function validateObject(object, validators, optValidators = {}) {
|
|
991
|
-
const checkField = (fieldName, type, isOptional) => {
|
|
992
|
-
const checkVal = validatorFns[type];
|
|
993
|
-
if (typeof checkVal !== "function")
|
|
994
|
-
throw new Error("invalid validator function");
|
|
995
|
-
const val = object[fieldName];
|
|
996
|
-
if (isOptional && val === void 0)
|
|
997
|
-
return;
|
|
998
|
-
if (!checkVal(val, object)) {
|
|
999
|
-
throw new Error("param " + String(fieldName) + " is invalid. Expected " + type + ", got " + val);
|
|
1000
|
-
}
|
|
1001
|
-
};
|
|
1002
|
-
for (const [fieldName, type] of Object.entries(validators))
|
|
1003
|
-
checkField(fieldName, type, false);
|
|
1004
|
-
for (const [fieldName, type] of Object.entries(optValidators))
|
|
1005
|
-
checkField(fieldName, type, true);
|
|
1006
|
-
return object;
|
|
1007
|
-
}
|
|
1008
|
-
function memoized(fn) {
|
|
1009
|
-
const map = /* @__PURE__ */ new WeakMap();
|
|
1010
|
-
return (arg, ...args) => {
|
|
1011
|
-
const val = map.get(arg);
|
|
1012
|
-
if (val !== void 0)
|
|
1013
|
-
return val;
|
|
1014
|
-
const computed = fn(arg, ...args);
|
|
1015
|
-
map.set(arg, computed);
|
|
1016
|
-
return computed;
|
|
1017
|
-
};
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
716
|
// node_modules/ox/_esm/core/version.js
|
|
1021
717
|
var version2 = "0.1.1";
|
|
1022
718
|
|
|
@@ -1154,381 +850,31 @@ function walk(err, fn) {
|
|
|
1154
850
|
return fn ? null : err;
|
|
1155
851
|
}
|
|
1156
852
|
|
|
1157
|
-
// node_modules/ox/_esm/core/internal/bytes.js
|
|
1158
|
-
function assertSize(bytes, size_) {
|
|
1159
|
-
if (size(bytes) > size_)
|
|
1160
|
-
throw new SizeOverflowError({
|
|
1161
|
-
givenSize: size(bytes),
|
|
1162
|
-
maxSize: size_
|
|
1163
|
-
});
|
|
1164
|
-
}
|
|
1165
|
-
function assertStartOffset(value, start) {
|
|
1166
|
-
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
1167
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
1168
|
-
offset: start,
|
|
1169
|
-
position: "start",
|
|
1170
|
-
size: size(value)
|
|
1171
|
-
});
|
|
1172
|
-
}
|
|
1173
|
-
function assertEndOffset(value, start, end) {
|
|
1174
|
-
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
1175
|
-
throw new SliceOffsetOutOfBoundsError({
|
|
1176
|
-
offset: end,
|
|
1177
|
-
position: "end",
|
|
1178
|
-
size: size(value)
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
var charCodeMap = {
|
|
1183
|
-
zero: 48,
|
|
1184
|
-
nine: 57,
|
|
1185
|
-
A: 65,
|
|
1186
|
-
F: 70,
|
|
1187
|
-
a: 97,
|
|
1188
|
-
f: 102
|
|
1189
|
-
};
|
|
1190
|
-
function charCodeToBase16(char) {
|
|
1191
|
-
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
1192
|
-
return char - charCodeMap.zero;
|
|
1193
|
-
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
1194
|
-
return char - (charCodeMap.A - 10);
|
|
1195
|
-
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
1196
|
-
return char - (charCodeMap.a - 10);
|
|
1197
|
-
return void 0;
|
|
1198
|
-
}
|
|
1199
|
-
function pad(bytes, options = {}) {
|
|
1200
|
-
const { dir, size: size4 = 32 } = options;
|
|
1201
|
-
if (size4 === 0)
|
|
1202
|
-
return bytes;
|
|
1203
|
-
if (bytes.length > size4)
|
|
1204
|
-
throw new SizeExceedsPaddingSizeError({
|
|
1205
|
-
size: bytes.length,
|
|
1206
|
-
targetSize: size4,
|
|
1207
|
-
type: "Bytes"
|
|
1208
|
-
});
|
|
1209
|
-
const paddedBytes = new Uint8Array(size4);
|
|
1210
|
-
for (let i = 0; i < size4; i++) {
|
|
1211
|
-
const padEnd = dir === "right";
|
|
1212
|
-
paddedBytes[padEnd ? i : size4 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
1213
|
-
}
|
|
1214
|
-
return paddedBytes;
|
|
1215
|
-
}
|
|
1216
|
-
function trim(value, options = {}) {
|
|
1217
|
-
const { dir = "left" } = options;
|
|
1218
|
-
let data = value;
|
|
1219
|
-
let sliceLength = 0;
|
|
1220
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
1221
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
1222
|
-
sliceLength++;
|
|
1223
|
-
else
|
|
1224
|
-
break;
|
|
1225
|
-
}
|
|
1226
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
1227
|
-
return data;
|
|
1228
|
-
}
|
|
1229
|
-
|
|
1230
853
|
// node_modules/ox/_esm/core/internal/hex.js
|
|
1231
|
-
function
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
givenSize: size2(hex),
|
|
1235
|
-
maxSize: size_
|
|
1236
|
-
});
|
|
1237
|
-
}
|
|
1238
|
-
function assertStartOffset2(value, start) {
|
|
1239
|
-
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
1240
|
-
throw new SliceOffsetOutOfBoundsError2({
|
|
1241
|
-
offset: start,
|
|
1242
|
-
position: "start",
|
|
1243
|
-
size: size2(value)
|
|
1244
|
-
});
|
|
1245
|
-
}
|
|
1246
|
-
function assertEndOffset2(value, start, end) {
|
|
1247
|
-
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
1248
|
-
throw new SliceOffsetOutOfBoundsError2({
|
|
1249
|
-
offset: end,
|
|
1250
|
-
position: "end",
|
|
1251
|
-
size: size2(value)
|
|
1252
|
-
});
|
|
1253
|
-
}
|
|
1254
|
-
}
|
|
1255
|
-
function pad2(hex_, options = {}) {
|
|
1256
|
-
const { dir, size: size4 = 32 } = options;
|
|
1257
|
-
if (size4 === 0)
|
|
854
|
+
function pad(hex_, options = {}) {
|
|
855
|
+
const { dir, size: size3 = 32 } = options;
|
|
856
|
+
if (size3 === 0)
|
|
1258
857
|
return hex_;
|
|
1259
858
|
const hex = hex_.replace("0x", "");
|
|
1260
|
-
if (hex.length >
|
|
1261
|
-
throw new
|
|
859
|
+
if (hex.length > size3 * 2)
|
|
860
|
+
throw new SizeExceedsPaddingSizeError({
|
|
1262
861
|
size: Math.ceil(hex.length / 2),
|
|
1263
|
-
targetSize:
|
|
862
|
+
targetSize: size3,
|
|
1264
863
|
type: "Hex"
|
|
1265
864
|
});
|
|
1266
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](
|
|
1267
|
-
}
|
|
1268
|
-
function trim2(value, options = {}) {
|
|
1269
|
-
const { dir = "left" } = options;
|
|
1270
|
-
let data = value.replace("0x", "");
|
|
1271
|
-
let sliceLength = 0;
|
|
1272
|
-
for (let i = 0; i < data.length - 1; i++) {
|
|
1273
|
-
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
1274
|
-
sliceLength++;
|
|
1275
|
-
else
|
|
1276
|
-
break;
|
|
1277
|
-
}
|
|
1278
|
-
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
1279
|
-
if (data === "0")
|
|
1280
|
-
return "0x";
|
|
1281
|
-
if (dir === "right" && data.length % 2 === 1)
|
|
1282
|
-
return `0x${data}0`;
|
|
1283
|
-
return `0x${data}`;
|
|
865
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
1284
866
|
}
|
|
1285
867
|
|
|
1286
|
-
// node_modules/ox/_esm/core/Json.js
|
|
1287
|
-
var bigIntSuffix = "#__bigint";
|
|
1288
|
-
function stringify(value, replacer, space) {
|
|
1289
|
-
return JSON.stringify(value, (key, value2) => {
|
|
1290
|
-
if (typeof replacer === "function")
|
|
1291
|
-
return replacer(key, value2);
|
|
1292
|
-
if (typeof value2 === "bigint")
|
|
1293
|
-
return value2.toString() + bigIntSuffix;
|
|
1294
|
-
return value2;
|
|
1295
|
-
}, space);
|
|
1296
|
-
}
|
|
1297
|
-
|
|
1298
|
-
// node_modules/ox/_esm/core/Bytes.js
|
|
1299
|
-
var decoder = /* @__PURE__ */ new TextDecoder();
|
|
1300
|
-
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
1301
|
-
function assert(value) {
|
|
1302
|
-
if (value instanceof Uint8Array)
|
|
1303
|
-
return;
|
|
1304
|
-
if (!value)
|
|
1305
|
-
throw new InvalidBytesTypeError(value);
|
|
1306
|
-
if (typeof value !== "object")
|
|
1307
|
-
throw new InvalidBytesTypeError(value);
|
|
1308
|
-
if (!("BYTES_PER_ELEMENT" in value))
|
|
1309
|
-
throw new InvalidBytesTypeError(value);
|
|
1310
|
-
if (value.BYTES_PER_ELEMENT !== 1 || value.constructor.name !== "Uint8Array")
|
|
1311
|
-
throw new InvalidBytesTypeError(value);
|
|
1312
|
-
}
|
|
1313
|
-
function from(value) {
|
|
1314
|
-
if (value instanceof Uint8Array)
|
|
1315
|
-
return value;
|
|
1316
|
-
if (typeof value === "string")
|
|
1317
|
-
return fromHex(value);
|
|
1318
|
-
return fromArray(value);
|
|
1319
|
-
}
|
|
1320
|
-
function fromArray(value) {
|
|
1321
|
-
return value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
1322
|
-
}
|
|
1323
|
-
function fromHex(value, options = {}) {
|
|
1324
|
-
const { size: size4 } = options;
|
|
1325
|
-
let hex = value;
|
|
1326
|
-
if (size4) {
|
|
1327
|
-
assertSize2(value, size4);
|
|
1328
|
-
hex = padRight(value, size4);
|
|
1329
|
-
}
|
|
1330
|
-
let hexString = hex.slice(2);
|
|
1331
|
-
if (hexString.length % 2)
|
|
1332
|
-
hexString = `0${hexString}`;
|
|
1333
|
-
const length = hexString.length / 2;
|
|
1334
|
-
const bytes = new Uint8Array(length);
|
|
1335
|
-
for (let index = 0, j = 0; index < length; index++) {
|
|
1336
|
-
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1337
|
-
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1338
|
-
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
1339
|
-
throw new BaseError2(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
1340
|
-
}
|
|
1341
|
-
bytes[index] = nibbleLeft << 4 | nibbleRight;
|
|
1342
|
-
}
|
|
1343
|
-
return bytes;
|
|
1344
|
-
}
|
|
1345
|
-
function fromString(value, options = {}) {
|
|
1346
|
-
const { size: size4 } = options;
|
|
1347
|
-
const bytes = encoder.encode(value);
|
|
1348
|
-
if (typeof size4 === "number") {
|
|
1349
|
-
assertSize(bytes, size4);
|
|
1350
|
-
return padRight2(bytes, size4);
|
|
1351
|
-
}
|
|
1352
|
-
return bytes;
|
|
1353
|
-
}
|
|
1354
|
-
function padRight2(value, size4) {
|
|
1355
|
-
return pad(value, { dir: "right", size: size4 });
|
|
1356
|
-
}
|
|
1357
|
-
function size(value) {
|
|
1358
|
-
return value.length;
|
|
1359
|
-
}
|
|
1360
|
-
function slice(value, start, end, options = {}) {
|
|
1361
|
-
const { strict } = options;
|
|
1362
|
-
assertStartOffset(value, start);
|
|
1363
|
-
const value_ = value.slice(start, end);
|
|
1364
|
-
if (strict)
|
|
1365
|
-
assertEndOffset(value_, start, end);
|
|
1366
|
-
return value_;
|
|
1367
|
-
}
|
|
1368
|
-
function toBigInt2(bytes, options = {}) {
|
|
1369
|
-
const { size: size4 } = options;
|
|
1370
|
-
if (typeof size4 !== "undefined")
|
|
1371
|
-
assertSize(bytes, size4);
|
|
1372
|
-
const hex = fromBytes(bytes, options);
|
|
1373
|
-
return toBigInt(hex, options);
|
|
1374
|
-
}
|
|
1375
|
-
function toBoolean(bytes, options = {}) {
|
|
1376
|
-
const { size: size4 } = options;
|
|
1377
|
-
let bytes_ = bytes;
|
|
1378
|
-
if (typeof size4 !== "undefined") {
|
|
1379
|
-
assertSize(bytes_, size4);
|
|
1380
|
-
bytes_ = trimLeft(bytes_);
|
|
1381
|
-
}
|
|
1382
|
-
if (bytes_.length > 1 || bytes_[0] > 1)
|
|
1383
|
-
throw new InvalidBytesBooleanError(bytes_);
|
|
1384
|
-
return Boolean(bytes_[0]);
|
|
1385
|
-
}
|
|
1386
|
-
function toNumber2(bytes, options = {}) {
|
|
1387
|
-
const { size: size4 } = options;
|
|
1388
|
-
if (typeof size4 !== "undefined")
|
|
1389
|
-
assertSize(bytes, size4);
|
|
1390
|
-
const hex = fromBytes(bytes, options);
|
|
1391
|
-
return toNumber(hex, options);
|
|
1392
|
-
}
|
|
1393
|
-
function toString(bytes, options = {}) {
|
|
1394
|
-
const { size: size4 } = options;
|
|
1395
|
-
let bytes_ = bytes;
|
|
1396
|
-
if (typeof size4 !== "undefined") {
|
|
1397
|
-
assertSize(bytes_, size4);
|
|
1398
|
-
bytes_ = trimRight(bytes_);
|
|
1399
|
-
}
|
|
1400
|
-
return decoder.decode(bytes_);
|
|
1401
|
-
}
|
|
1402
|
-
function trimLeft(value) {
|
|
1403
|
-
return trim(value, { dir: "left" });
|
|
1404
|
-
}
|
|
1405
|
-
function trimRight(value) {
|
|
1406
|
-
return trim(value, { dir: "right" });
|
|
1407
|
-
}
|
|
1408
|
-
function validate(value) {
|
|
1409
|
-
try {
|
|
1410
|
-
assert(value);
|
|
1411
|
-
return true;
|
|
1412
|
-
} catch {
|
|
1413
|
-
return false;
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
var InvalidBytesBooleanError = class extends BaseError2 {
|
|
1417
|
-
constructor(bytes) {
|
|
1418
|
-
super(`Bytes value \`${bytes}\` is not a valid boolean.`, {
|
|
1419
|
-
metaMessages: [
|
|
1420
|
-
"The bytes array must contain a single byte of either a `0` or `1` value."
|
|
1421
|
-
]
|
|
1422
|
-
});
|
|
1423
|
-
Object.defineProperty(this, "name", {
|
|
1424
|
-
enumerable: true,
|
|
1425
|
-
configurable: true,
|
|
1426
|
-
writable: true,
|
|
1427
|
-
value: "Bytes.InvalidBytesBooleanError"
|
|
1428
|
-
});
|
|
1429
|
-
}
|
|
1430
|
-
};
|
|
1431
|
-
var InvalidBytesTypeError = class extends BaseError2 {
|
|
1432
|
-
constructor(value) {
|
|
1433
|
-
super(`Value \`${typeof value === "object" ? stringify(value) : value}\` of type \`${typeof value}\` is an invalid Bytes value.`, {
|
|
1434
|
-
metaMessages: ["Bytes values must be of type `Bytes`."]
|
|
1435
|
-
});
|
|
1436
|
-
Object.defineProperty(this, "name", {
|
|
1437
|
-
enumerable: true,
|
|
1438
|
-
configurable: true,
|
|
1439
|
-
writable: true,
|
|
1440
|
-
value: "Bytes.InvalidBytesTypeError"
|
|
1441
|
-
});
|
|
1442
|
-
}
|
|
1443
|
-
};
|
|
1444
|
-
var SizeOverflowError = class extends BaseError2 {
|
|
1445
|
-
constructor({ givenSize, maxSize }) {
|
|
1446
|
-
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
1447
|
-
Object.defineProperty(this, "name", {
|
|
1448
|
-
enumerable: true,
|
|
1449
|
-
configurable: true,
|
|
1450
|
-
writable: true,
|
|
1451
|
-
value: "Bytes.SizeOverflowError"
|
|
1452
|
-
});
|
|
1453
|
-
}
|
|
1454
|
-
};
|
|
1455
|
-
var SliceOffsetOutOfBoundsError = class extends BaseError2 {
|
|
1456
|
-
constructor({ offset, position, size: size4 }) {
|
|
1457
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
|
|
1458
|
-
Object.defineProperty(this, "name", {
|
|
1459
|
-
enumerable: true,
|
|
1460
|
-
configurable: true,
|
|
1461
|
-
writable: true,
|
|
1462
|
-
value: "Bytes.SliceOffsetOutOfBoundsError"
|
|
1463
|
-
});
|
|
1464
|
-
}
|
|
1465
|
-
};
|
|
1466
|
-
var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
1467
|
-
constructor({ size: size4, targetSize, type }) {
|
|
1468
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
1469
|
-
Object.defineProperty(this, "name", {
|
|
1470
|
-
enumerable: true,
|
|
1471
|
-
configurable: true,
|
|
1472
|
-
writable: true,
|
|
1473
|
-
value: "Bytes.SizeExceedsPaddingSizeError"
|
|
1474
|
-
});
|
|
1475
|
-
}
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
868
|
// node_modules/ox/_esm/core/Hex.js
|
|
1479
|
-
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
1480
|
-
var hexes2 = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
1481
|
-
function assert2(value, options = {}) {
|
|
1482
|
-
const { strict = false } = options;
|
|
1483
|
-
if (!value)
|
|
1484
|
-
throw new InvalidHexTypeError(value);
|
|
1485
|
-
if (typeof value !== "string")
|
|
1486
|
-
throw new InvalidHexTypeError(value);
|
|
1487
|
-
if (strict) {
|
|
1488
|
-
if (!/^0x[0-9a-fA-F]*$/.test(value))
|
|
1489
|
-
throw new InvalidHexValueError(value);
|
|
1490
|
-
}
|
|
1491
|
-
if (!value.startsWith("0x"))
|
|
1492
|
-
throw new InvalidHexValueError(value);
|
|
1493
|
-
}
|
|
1494
|
-
function concat(...values) {
|
|
1495
|
-
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
1496
|
-
}
|
|
1497
|
-
function from2(value) {
|
|
1498
|
-
if (value instanceof Uint8Array)
|
|
1499
|
-
return fromBytes(value);
|
|
1500
|
-
if (Array.isArray(value))
|
|
1501
|
-
return fromBytes(new Uint8Array(value));
|
|
1502
|
-
return value;
|
|
1503
|
-
}
|
|
1504
|
-
function fromBoolean(value, options = {}) {
|
|
1505
|
-
const hex = `0x${Number(value)}`;
|
|
1506
|
-
if (typeof options.size === "number") {
|
|
1507
|
-
assertSize2(hex, options.size);
|
|
1508
|
-
return padLeft(hex, options.size);
|
|
1509
|
-
}
|
|
1510
|
-
return hex;
|
|
1511
|
-
}
|
|
1512
|
-
function fromBytes(value, options = {}) {
|
|
1513
|
-
let string = "";
|
|
1514
|
-
for (let i = 0; i < value.length; i++)
|
|
1515
|
-
string += hexes2[value[i]];
|
|
1516
|
-
const hex = `0x${string}`;
|
|
1517
|
-
if (typeof options.size === "number") {
|
|
1518
|
-
assertSize2(hex, options.size);
|
|
1519
|
-
return padRight(hex, options.size);
|
|
1520
|
-
}
|
|
1521
|
-
return hex;
|
|
1522
|
-
}
|
|
1523
869
|
function fromNumber(value, options = {}) {
|
|
1524
|
-
const { signed, size:
|
|
870
|
+
const { signed, size: size3 } = options;
|
|
1525
871
|
const value_ = BigInt(value);
|
|
1526
872
|
let maxValue;
|
|
1527
|
-
if (
|
|
873
|
+
if (size3) {
|
|
1528
874
|
if (signed)
|
|
1529
|
-
maxValue = (1n << BigInt(
|
|
875
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
1530
876
|
else
|
|
1531
|
-
maxValue = 2n ** (BigInt(
|
|
877
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
1532
878
|
} else if (typeof value === "number") {
|
|
1533
879
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
1534
880
|
}
|
|
@@ -1539,71 +885,22 @@ function fromNumber(value, options = {}) {
|
|
|
1539
885
|
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
1540
886
|
min: `${minValue}${suffix}`,
|
|
1541
887
|
signed,
|
|
1542
|
-
size:
|
|
888
|
+
size: size3,
|
|
1543
889
|
value: `${value}${suffix}`
|
|
1544
890
|
});
|
|
1545
891
|
}
|
|
1546
|
-
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(
|
|
892
|
+
const stringValue = (signed && value_ < 0 ? BigInt.asUintN(size3 * 8, BigInt(value_)) : value_).toString(16);
|
|
1547
893
|
const hex = `0x${stringValue}`;
|
|
1548
|
-
if (
|
|
1549
|
-
return padLeft(hex,
|
|
894
|
+
if (size3)
|
|
895
|
+
return padLeft(hex, size3);
|
|
1550
896
|
return hex;
|
|
1551
897
|
}
|
|
1552
|
-
function
|
|
1553
|
-
return
|
|
1554
|
-
}
|
|
1555
|
-
function padLeft(value, size4) {
|
|
1556
|
-
return pad2(value, { dir: "left", size: size4 });
|
|
1557
|
-
}
|
|
1558
|
-
function padRight(value, size4) {
|
|
1559
|
-
return pad2(value, { dir: "right", size: size4 });
|
|
1560
|
-
}
|
|
1561
|
-
function slice2(value, start, end, options = {}) {
|
|
1562
|
-
const { strict } = options;
|
|
1563
|
-
assertStartOffset2(value, start);
|
|
1564
|
-
const value_ = `0x${value.replace("0x", "").slice((start ?? 0) * 2, (end ?? value.length) * 2)}`;
|
|
1565
|
-
if (strict)
|
|
1566
|
-
assertEndOffset2(value_, start, end);
|
|
1567
|
-
return value_;
|
|
1568
|
-
}
|
|
1569
|
-
function size2(value) {
|
|
1570
|
-
return Math.ceil((value.length - 2) / 2);
|
|
1571
|
-
}
|
|
1572
|
-
function trimLeft2(value) {
|
|
1573
|
-
return trim2(value, { dir: "left" });
|
|
1574
|
-
}
|
|
1575
|
-
function toBigInt(hex, options = {}) {
|
|
1576
|
-
const { signed } = options;
|
|
1577
|
-
if (options.size)
|
|
1578
|
-
assertSize2(hex, options.size);
|
|
1579
|
-
const value = BigInt(hex);
|
|
1580
|
-
if (!signed)
|
|
1581
|
-
return value;
|
|
1582
|
-
const size4 = (hex.length - 2) / 2;
|
|
1583
|
-
const max_unsigned = (1n << BigInt(size4) * 8n) - 1n;
|
|
1584
|
-
const max_signed = max_unsigned >> 1n;
|
|
1585
|
-
if (value <= max_signed)
|
|
1586
|
-
return value;
|
|
1587
|
-
return value - max_unsigned - 1n;
|
|
1588
|
-
}
|
|
1589
|
-
function toNumber(hex, options = {}) {
|
|
1590
|
-
const { signed, size: size4 } = options;
|
|
1591
|
-
if (!signed && !size4)
|
|
1592
|
-
return Number(hex);
|
|
1593
|
-
return Number(toBigInt(hex, options));
|
|
1594
|
-
}
|
|
1595
|
-
function validate2(value, options = {}) {
|
|
1596
|
-
const { strict = false } = options;
|
|
1597
|
-
try {
|
|
1598
|
-
assert2(value, { strict });
|
|
1599
|
-
return true;
|
|
1600
|
-
} catch {
|
|
1601
|
-
return false;
|
|
1602
|
-
}
|
|
898
|
+
function padLeft(value, size3) {
|
|
899
|
+
return pad(value, { dir: "left", size: size3 });
|
|
1603
900
|
}
|
|
1604
901
|
var IntegerOutOfRangeError = class extends BaseError2 {
|
|
1605
|
-
constructor({ max, min, signed, size:
|
|
1606
|
-
super(`Number \`${value}\` is not in safe${
|
|
902
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
903
|
+
super(`Number \`${value}\` is not in safe${size3 ? ` ${size3 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
1607
904
|
Object.defineProperty(this, "name", {
|
|
1608
905
|
enumerable: true,
|
|
1609
906
|
configurable: true,
|
|
@@ -1612,59 +909,9 @@ var IntegerOutOfRangeError = class extends BaseError2 {
|
|
|
1612
909
|
});
|
|
1613
910
|
}
|
|
1614
911
|
};
|
|
1615
|
-
var
|
|
1616
|
-
constructor(
|
|
1617
|
-
super(
|
|
1618
|
-
metaMessages: ['Hex types must be represented as `"0x${string}"`.']
|
|
1619
|
-
});
|
|
1620
|
-
Object.defineProperty(this, "name", {
|
|
1621
|
-
enumerable: true,
|
|
1622
|
-
configurable: true,
|
|
1623
|
-
writable: true,
|
|
1624
|
-
value: "Hex.InvalidHexTypeError"
|
|
1625
|
-
});
|
|
1626
|
-
}
|
|
1627
|
-
};
|
|
1628
|
-
var InvalidHexValueError = class extends BaseError2 {
|
|
1629
|
-
constructor(value) {
|
|
1630
|
-
super(`Value \`${value}\` is an invalid hex value.`, {
|
|
1631
|
-
metaMessages: [
|
|
1632
|
-
'Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).'
|
|
1633
|
-
]
|
|
1634
|
-
});
|
|
1635
|
-
Object.defineProperty(this, "name", {
|
|
1636
|
-
enumerable: true,
|
|
1637
|
-
configurable: true,
|
|
1638
|
-
writable: true,
|
|
1639
|
-
value: "Hex.InvalidHexValueError"
|
|
1640
|
-
});
|
|
1641
|
-
}
|
|
1642
|
-
};
|
|
1643
|
-
var SizeOverflowError2 = class extends BaseError2 {
|
|
1644
|
-
constructor({ givenSize, maxSize }) {
|
|
1645
|
-
super(`Size cannot exceed \`${maxSize}\` bytes. Given size: \`${givenSize}\` bytes.`);
|
|
1646
|
-
Object.defineProperty(this, "name", {
|
|
1647
|
-
enumerable: true,
|
|
1648
|
-
configurable: true,
|
|
1649
|
-
writable: true,
|
|
1650
|
-
value: "Hex.SizeOverflowError"
|
|
1651
|
-
});
|
|
1652
|
-
}
|
|
1653
|
-
};
|
|
1654
|
-
var SliceOffsetOutOfBoundsError2 = class extends BaseError2 {
|
|
1655
|
-
constructor({ offset, position, size: size4 }) {
|
|
1656
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset \`${offset}\` is out-of-bounds (size: \`${size4}\`).`);
|
|
1657
|
-
Object.defineProperty(this, "name", {
|
|
1658
|
-
enumerable: true,
|
|
1659
|
-
configurable: true,
|
|
1660
|
-
writable: true,
|
|
1661
|
-
value: "Hex.SliceOffsetOutOfBoundsError"
|
|
1662
|
-
});
|
|
1663
|
-
}
|
|
1664
|
-
};
|
|
1665
|
-
var SizeExceedsPaddingSizeError2 = class extends BaseError2 {
|
|
1666
|
-
constructor({ size: size4, targetSize, type }) {
|
|
1667
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size4}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
912
|
+
var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
913
|
+
constructor({ size: size3, targetSize, type }) {
|
|
914
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
1668
915
|
Object.defineProperty(this, "name", {
|
|
1669
916
|
enumerable: true,
|
|
1670
917
|
configurable: true,
|
|
@@ -1819,258 +1066,31 @@ var batchGatewayAbi = [
|
|
|
1819
1066
|
}
|
|
1820
1067
|
]
|
|
1821
1068
|
}
|
|
1822
|
-
],
|
|
1823
|
-
outputs: [
|
|
1824
|
-
{
|
|
1825
|
-
type: "bool[]",
|
|
1826
|
-
name: "failures"
|
|
1827
|
-
},
|
|
1828
|
-
{
|
|
1829
|
-
type: "bytes[]",
|
|
1830
|
-
name: "responses"
|
|
1831
|
-
}
|
|
1832
|
-
]
|
|
1833
|
-
},
|
|
1834
|
-
{
|
|
1835
|
-
name: "HttpError",
|
|
1836
|
-
type: "error",
|
|
1837
|
-
inputs: [
|
|
1838
|
-
{
|
|
1839
|
-
type: "uint16",
|
|
1840
|
-
name: "status"
|
|
1841
|
-
},
|
|
1842
|
-
{
|
|
1843
|
-
type: "string",
|
|
1844
|
-
name: "message"
|
|
1845
|
-
}
|
|
1846
|
-
]
|
|
1847
|
-
}
|
|
1848
|
-
];
|
|
1849
|
-
var universalResolverErrors = [
|
|
1850
|
-
{
|
|
1851
|
-
inputs: [
|
|
1852
|
-
{
|
|
1853
|
-
name: "dns",
|
|
1854
|
-
type: "bytes"
|
|
1855
|
-
}
|
|
1856
|
-
],
|
|
1857
|
-
name: "DNSDecodingFailed",
|
|
1858
|
-
type: "error"
|
|
1859
|
-
},
|
|
1860
|
-
{
|
|
1861
|
-
inputs: [
|
|
1862
|
-
{
|
|
1863
|
-
name: "ens",
|
|
1864
|
-
type: "string"
|
|
1865
|
-
}
|
|
1866
|
-
],
|
|
1867
|
-
name: "DNSEncodingFailed",
|
|
1868
|
-
type: "error"
|
|
1869
|
-
},
|
|
1870
|
-
{
|
|
1871
|
-
inputs: [],
|
|
1872
|
-
name: "EmptyAddress",
|
|
1873
|
-
type: "error"
|
|
1874
|
-
},
|
|
1875
|
-
{
|
|
1876
|
-
inputs: [
|
|
1877
|
-
{
|
|
1878
|
-
name: "status",
|
|
1879
|
-
type: "uint16"
|
|
1880
|
-
},
|
|
1881
|
-
{
|
|
1882
|
-
name: "message",
|
|
1883
|
-
type: "string"
|
|
1884
|
-
}
|
|
1885
|
-
],
|
|
1886
|
-
name: "HttpError",
|
|
1887
|
-
type: "error"
|
|
1888
|
-
},
|
|
1889
|
-
{
|
|
1890
|
-
inputs: [],
|
|
1891
|
-
name: "InvalidBatchGatewayResponse",
|
|
1892
|
-
type: "error"
|
|
1893
|
-
},
|
|
1894
|
-
{
|
|
1895
|
-
inputs: [
|
|
1896
|
-
{
|
|
1897
|
-
name: "errorData",
|
|
1898
|
-
type: "bytes"
|
|
1899
|
-
}
|
|
1900
|
-
],
|
|
1901
|
-
name: "ResolverError",
|
|
1902
|
-
type: "error"
|
|
1903
|
-
},
|
|
1904
|
-
{
|
|
1905
|
-
inputs: [
|
|
1906
|
-
{
|
|
1907
|
-
name: "name",
|
|
1908
|
-
type: "bytes"
|
|
1909
|
-
},
|
|
1910
|
-
{
|
|
1911
|
-
name: "resolver",
|
|
1912
|
-
type: "address"
|
|
1913
|
-
}
|
|
1914
|
-
],
|
|
1915
|
-
name: "ResolverNotContract",
|
|
1916
|
-
type: "error"
|
|
1917
|
-
},
|
|
1918
|
-
{
|
|
1919
|
-
inputs: [
|
|
1920
|
-
{
|
|
1921
|
-
name: "name",
|
|
1922
|
-
type: "bytes"
|
|
1923
|
-
}
|
|
1924
|
-
],
|
|
1925
|
-
name: "ResolverNotFound",
|
|
1926
|
-
type: "error"
|
|
1927
|
-
},
|
|
1928
|
-
{
|
|
1929
|
-
inputs: [
|
|
1930
|
-
{
|
|
1931
|
-
name: "primary",
|
|
1932
|
-
type: "string"
|
|
1933
|
-
},
|
|
1934
|
-
{
|
|
1935
|
-
name: "primaryAddress",
|
|
1936
|
-
type: "bytes"
|
|
1937
|
-
}
|
|
1938
|
-
],
|
|
1939
|
-
name: "ReverseAddressMismatch",
|
|
1940
|
-
type: "error"
|
|
1941
|
-
},
|
|
1942
|
-
{
|
|
1943
|
-
inputs: [
|
|
1944
|
-
{
|
|
1945
|
-
internalType: "bytes4",
|
|
1946
|
-
name: "selector",
|
|
1947
|
-
type: "bytes4"
|
|
1948
|
-
}
|
|
1949
|
-
],
|
|
1950
|
-
name: "UnsupportedResolverProfile",
|
|
1951
|
-
type: "error"
|
|
1952
|
-
}
|
|
1953
|
-
];
|
|
1954
|
-
var universalResolverResolveAbi = [
|
|
1955
|
-
...universalResolverErrors,
|
|
1956
|
-
{
|
|
1957
|
-
name: "resolveWithGateways",
|
|
1958
|
-
type: "function",
|
|
1959
|
-
stateMutability: "view",
|
|
1960
|
-
inputs: [
|
|
1961
|
-
{ name: "name", type: "bytes" },
|
|
1962
|
-
{ name: "data", type: "bytes" },
|
|
1963
|
-
{ name: "gateways", type: "string[]" }
|
|
1964
|
-
],
|
|
1965
|
-
outputs: [
|
|
1966
|
-
{ name: "", type: "bytes" },
|
|
1967
|
-
{ name: "address", type: "address" }
|
|
1968
|
-
]
|
|
1969
|
-
}
|
|
1970
|
-
];
|
|
1971
|
-
var universalResolverReverseAbi = [
|
|
1972
|
-
...universalResolverErrors,
|
|
1973
|
-
{
|
|
1974
|
-
name: "reverseWithGateways",
|
|
1975
|
-
type: "function",
|
|
1976
|
-
stateMutability: "view",
|
|
1977
|
-
inputs: [
|
|
1978
|
-
{ type: "bytes", name: "reverseName" },
|
|
1979
|
-
{ type: "uint256", name: "coinType" },
|
|
1980
|
-
{ type: "string[]", name: "gateways" }
|
|
1981
|
-
],
|
|
1982
|
-
outputs: [
|
|
1983
|
-
{ type: "string", name: "resolvedName" },
|
|
1984
|
-
{ type: "address", name: "resolver" },
|
|
1985
|
-
{ type: "address", name: "reverseResolver" }
|
|
1986
|
-
]
|
|
1987
|
-
}
|
|
1988
|
-
];
|
|
1989
|
-
var textResolverAbi = [
|
|
1990
|
-
{
|
|
1991
|
-
name: "text",
|
|
1992
|
-
type: "function",
|
|
1993
|
-
stateMutability: "view",
|
|
1994
|
-
inputs: [
|
|
1995
|
-
{ name: "name", type: "bytes32" },
|
|
1996
|
-
{ name: "key", type: "string" }
|
|
1997
|
-
],
|
|
1998
|
-
outputs: [{ name: "", type: "string" }]
|
|
1999
|
-
}
|
|
2000
|
-
];
|
|
2001
|
-
var addressResolverAbi = [
|
|
2002
|
-
{
|
|
2003
|
-
name: "addr",
|
|
2004
|
-
type: "function",
|
|
2005
|
-
stateMutability: "view",
|
|
2006
|
-
inputs: [{ name: "name", type: "bytes32" }],
|
|
2007
|
-
outputs: [{ name: "", type: "address" }]
|
|
2008
|
-
},
|
|
2009
|
-
{
|
|
2010
|
-
name: "addr",
|
|
2011
|
-
type: "function",
|
|
2012
|
-
stateMutability: "view",
|
|
2013
|
-
inputs: [
|
|
2014
|
-
{ name: "name", type: "bytes32" },
|
|
2015
|
-
{ name: "coinType", type: "uint256" }
|
|
2016
|
-
],
|
|
2017
|
-
outputs: [{ name: "", type: "bytes" }]
|
|
2018
|
-
}
|
|
2019
|
-
];
|
|
2020
|
-
var erc1271Abi = [
|
|
2021
|
-
{
|
|
2022
|
-
name: "isValidSignature",
|
|
2023
|
-
type: "function",
|
|
2024
|
-
stateMutability: "view",
|
|
2025
|
-
inputs: [
|
|
2026
|
-
{ name: "hash", type: "bytes32" },
|
|
2027
|
-
{ name: "signature", type: "bytes" }
|
|
2028
|
-
],
|
|
2029
|
-
outputs: [{ name: "", type: "bytes4" }]
|
|
2030
|
-
}
|
|
2031
|
-
];
|
|
2032
|
-
var erc6492SignatureValidatorAbi = [
|
|
2033
|
-
{
|
|
2034
|
-
inputs: [
|
|
2035
|
-
{
|
|
2036
|
-
name: "_signer",
|
|
2037
|
-
type: "address"
|
|
2038
|
-
},
|
|
1069
|
+
],
|
|
1070
|
+
outputs: [
|
|
2039
1071
|
{
|
|
2040
|
-
|
|
2041
|
-
|
|
1072
|
+
type: "bool[]",
|
|
1073
|
+
name: "failures"
|
|
2042
1074
|
},
|
|
2043
1075
|
{
|
|
2044
|
-
|
|
2045
|
-
|
|
1076
|
+
type: "bytes[]",
|
|
1077
|
+
name: "responses"
|
|
2046
1078
|
}
|
|
2047
|
-
]
|
|
2048
|
-
stateMutability: "nonpayable",
|
|
2049
|
-
type: "constructor"
|
|
1079
|
+
]
|
|
2050
1080
|
},
|
|
2051
1081
|
{
|
|
1082
|
+
name: "HttpError",
|
|
1083
|
+
type: "error",
|
|
2052
1084
|
inputs: [
|
|
2053
1085
|
{
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
},
|
|
2057
|
-
{
|
|
2058
|
-
name: "_hash",
|
|
2059
|
-
type: "bytes32"
|
|
1086
|
+
type: "uint16",
|
|
1087
|
+
name: "status"
|
|
2060
1088
|
},
|
|
2061
1089
|
{
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
}
|
|
2065
|
-
],
|
|
2066
|
-
outputs: [
|
|
2067
|
-
{
|
|
2068
|
-
type: "bool"
|
|
1090
|
+
type: "string",
|
|
1091
|
+
name: "message"
|
|
2069
1092
|
}
|
|
2070
|
-
]
|
|
2071
|
-
stateMutability: "nonpayable",
|
|
2072
|
-
type: "function",
|
|
2073
|
-
name: "isValidSig"
|
|
1093
|
+
]
|
|
2074
1094
|
}
|
|
2075
1095
|
];
|
|
2076
1096
|
|
|
@@ -2080,7 +1100,6 @@ var aggregate3Signature = "0x82ad56cb";
|
|
|
2080
1100
|
// node_modules/viem/_esm/constants/contracts.js
|
|
2081
1101
|
var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
|
|
2082
1102
|
var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
2083
|
-
var erc6492SignatureValidatorByteCode = "0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572";
|
|
2084
1103
|
var multicall3Bytecode = "0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";
|
|
2085
1104
|
|
|
2086
1105
|
// node_modules/viem/_esm/errors/version.js
|
|
@@ -2200,17 +1219,6 @@ var InvalidChainIdError = class extends BaseError3 {
|
|
|
2200
1219
|
};
|
|
2201
1220
|
|
|
2202
1221
|
// node_modules/viem/_esm/constants/solidity.js
|
|
2203
|
-
var panicReasons = {
|
|
2204
|
-
1: "An `assert` condition failed.",
|
|
2205
|
-
17: "Arithmetic operation resulted in underflow or overflow.",
|
|
2206
|
-
18: "Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",
|
|
2207
|
-
33: "Attempted to convert to an invalid type.",
|
|
2208
|
-
34: "Attempted to access a storage byte array that is incorrectly encoded.",
|
|
2209
|
-
49: "Performed `.pop()` on an empty array",
|
|
2210
|
-
50: "Array index is out of bounds.",
|
|
2211
|
-
65: "Allocated too much memory or created an array which is too large.",
|
|
2212
|
-
81: "Attempted to call a zero-initialized variable of internal function type."
|
|
2213
|
-
};
|
|
2214
1222
|
var solidityError = {
|
|
2215
1223
|
inputs: [
|
|
2216
1224
|
{
|
|
@@ -2260,7 +1268,7 @@ function isHex(value, { strict = true } = {}) {
|
|
|
2260
1268
|
}
|
|
2261
1269
|
|
|
2262
1270
|
// node_modules/viem/_esm/utils/data/size.js
|
|
2263
|
-
function
|
|
1271
|
+
function size2(value) {
|
|
2264
1272
|
if (isHex(value, { strict: false }))
|
|
2265
1273
|
return Math.ceil((value.length - 2) / 2);
|
|
2266
1274
|
return value.length;
|
|
@@ -2290,11 +1298,11 @@ var AbiConstructorParamsNotFoundError = class extends BaseError3 {
|
|
|
2290
1298
|
}
|
|
2291
1299
|
};
|
|
2292
1300
|
var AbiDecodingDataSizeTooSmallError = class extends BaseError3 {
|
|
2293
|
-
constructor({ data, params, size:
|
|
2294
|
-
super([`Data size of ${
|
|
1301
|
+
constructor({ data, params, size: size3 }) {
|
|
1302
|
+
super([`Data size of ${size3} bytes is too small for given parameters.`].join("\n"), {
|
|
2295
1303
|
metaMessages: [
|
|
2296
1304
|
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
2297
|
-
`Data: ${data} (${
|
|
1305
|
+
`Data: ${data} (${size3} bytes)`
|
|
2298
1306
|
],
|
|
2299
1307
|
name: "AbiDecodingDataSizeTooSmallError"
|
|
2300
1308
|
});
|
|
@@ -2318,7 +1326,7 @@ var AbiDecodingDataSizeTooSmallError = class extends BaseError3 {
|
|
|
2318
1326
|
});
|
|
2319
1327
|
this.data = data;
|
|
2320
1328
|
this.params = params;
|
|
2321
|
-
this.size =
|
|
1329
|
+
this.size = size3;
|
|
2322
1330
|
}
|
|
2323
1331
|
};
|
|
2324
1332
|
var AbiDecodingZeroDataError = class extends BaseError3 {
|
|
@@ -2340,7 +1348,7 @@ var AbiEncodingArrayLengthMismatchError = class extends BaseError3 {
|
|
|
2340
1348
|
};
|
|
2341
1349
|
var AbiEncodingBytesSizeMismatchError = class extends BaseError3 {
|
|
2342
1350
|
constructor({ expectedSize, value }) {
|
|
2343
|
-
super(`Size of bytes "${value}" (bytes${
|
|
1351
|
+
super(`Size of bytes "${value}" (bytes${size2(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
2344
1352
|
}
|
|
2345
1353
|
};
|
|
2346
1354
|
var AbiEncodingLengthMismatchError = class extends BaseError3 {
|
|
@@ -2395,37 +1403,6 @@ var AbiErrorSignatureNotFoundError = class extends BaseError3 {
|
|
|
2395
1403
|
this.signature = signature;
|
|
2396
1404
|
}
|
|
2397
1405
|
};
|
|
2398
|
-
var AbiEventSignatureEmptyTopicsError = class extends BaseError3 {
|
|
2399
|
-
constructor({ docsPath: docsPath6 }) {
|
|
2400
|
-
super("Cannot extract event signature from empty topics.", {
|
|
2401
|
-
docsPath: docsPath6,
|
|
2402
|
-
name: "AbiEventSignatureEmptyTopicsError"
|
|
2403
|
-
});
|
|
2404
|
-
}
|
|
2405
|
-
};
|
|
2406
|
-
var AbiEventSignatureNotFoundError = class extends BaseError3 {
|
|
2407
|
-
constructor(signature, { docsPath: docsPath6 }) {
|
|
2408
|
-
super([
|
|
2409
|
-
`Encoded event signature "${signature}" not found on ABI.`,
|
|
2410
|
-
"Make sure you are using the correct ABI and that the event exists on it.",
|
|
2411
|
-
`You can look up the signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
2412
|
-
].join("\n"), {
|
|
2413
|
-
docsPath: docsPath6,
|
|
2414
|
-
name: "AbiEventSignatureNotFoundError"
|
|
2415
|
-
});
|
|
2416
|
-
}
|
|
2417
|
-
};
|
|
2418
|
-
var AbiEventNotFoundError = class extends BaseError3 {
|
|
2419
|
-
constructor(eventName, { docsPath: docsPath6 } = {}) {
|
|
2420
|
-
super([
|
|
2421
|
-
`Event ${eventName ? `"${eventName}" ` : ""}not found on ABI.`,
|
|
2422
|
-
"Make sure you are using the correct ABI and that the event exists on it."
|
|
2423
|
-
].join("\n"), {
|
|
2424
|
-
docsPath: docsPath6,
|
|
2425
|
-
name: "AbiEventNotFoundError"
|
|
2426
|
-
});
|
|
2427
|
-
}
|
|
2428
|
-
};
|
|
2429
1406
|
var AbiFunctionNotFoundError = class extends BaseError3 {
|
|
2430
1407
|
constructor(functionName, { docsPath: docsPath6 } = {}) {
|
|
2431
1408
|
super([
|
|
@@ -2482,61 +1459,6 @@ var BytesSizeMismatchError = class extends BaseError3 {
|
|
|
2482
1459
|
});
|
|
2483
1460
|
}
|
|
2484
1461
|
};
|
|
2485
|
-
var DecodeLogDataMismatch = class extends BaseError3 {
|
|
2486
|
-
constructor({ abiItem, data, params, size: size4 }) {
|
|
2487
|
-
super([
|
|
2488
|
-
`Data size of ${size4} bytes is too small for non-indexed event parameters.`
|
|
2489
|
-
].join("\n"), {
|
|
2490
|
-
metaMessages: [
|
|
2491
|
-
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
2492
|
-
`Data: ${data} (${size4} bytes)`
|
|
2493
|
-
],
|
|
2494
|
-
name: "DecodeLogDataMismatch"
|
|
2495
|
-
});
|
|
2496
|
-
Object.defineProperty(this, "abiItem", {
|
|
2497
|
-
enumerable: true,
|
|
2498
|
-
configurable: true,
|
|
2499
|
-
writable: true,
|
|
2500
|
-
value: void 0
|
|
2501
|
-
});
|
|
2502
|
-
Object.defineProperty(this, "data", {
|
|
2503
|
-
enumerable: true,
|
|
2504
|
-
configurable: true,
|
|
2505
|
-
writable: true,
|
|
2506
|
-
value: void 0
|
|
2507
|
-
});
|
|
2508
|
-
Object.defineProperty(this, "params", {
|
|
2509
|
-
enumerable: true,
|
|
2510
|
-
configurable: true,
|
|
2511
|
-
writable: true,
|
|
2512
|
-
value: void 0
|
|
2513
|
-
});
|
|
2514
|
-
Object.defineProperty(this, "size", {
|
|
2515
|
-
enumerable: true,
|
|
2516
|
-
configurable: true,
|
|
2517
|
-
writable: true,
|
|
2518
|
-
value: void 0
|
|
2519
|
-
});
|
|
2520
|
-
this.abiItem = abiItem;
|
|
2521
|
-
this.data = data;
|
|
2522
|
-
this.params = params;
|
|
2523
|
-
this.size = size4;
|
|
2524
|
-
}
|
|
2525
|
-
};
|
|
2526
|
-
var DecodeLogTopicsMismatch = class extends BaseError3 {
|
|
2527
|
-
constructor({ abiItem, param }) {
|
|
2528
|
-
super([
|
|
2529
|
-
`Expected a topic for indexed event parameter${param.name ? ` "${param.name}"` : ""} on event "${formatAbiItem2(abiItem, { includeName: true })}".`
|
|
2530
|
-
].join("\n"), { name: "DecodeLogTopicsMismatch" });
|
|
2531
|
-
Object.defineProperty(this, "abiItem", {
|
|
2532
|
-
enumerable: true,
|
|
2533
|
-
configurable: true,
|
|
2534
|
-
writable: true,
|
|
2535
|
-
value: void 0
|
|
2536
|
-
});
|
|
2537
|
-
this.abiItem = abiItem;
|
|
2538
|
-
}
|
|
2539
|
-
};
|
|
2540
1462
|
var InvalidAbiEncodingTypeError = class extends BaseError3 {
|
|
2541
1463
|
constructor(type, { docsPath: docsPath6 }) {
|
|
2542
1464
|
super([
|
|
@@ -2570,24 +1492,24 @@ var InvalidDefinitionTypeError = class extends BaseError3 {
|
|
|
2570
1492
|
};
|
|
2571
1493
|
|
|
2572
1494
|
// node_modules/viem/_esm/errors/data.js
|
|
2573
|
-
var
|
|
2574
|
-
constructor({ offset, position, size:
|
|
2575
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${
|
|
1495
|
+
var SliceOffsetOutOfBoundsError2 = class extends BaseError3 {
|
|
1496
|
+
constructor({ offset, position, size: size3 }) {
|
|
1497
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size3}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
2576
1498
|
}
|
|
2577
1499
|
};
|
|
2578
|
-
var
|
|
2579
|
-
constructor({ size:
|
|
2580
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${
|
|
1500
|
+
var SizeExceedsPaddingSizeError2 = class extends BaseError3 {
|
|
1501
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1502
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size3}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
2581
1503
|
}
|
|
2582
1504
|
};
|
|
2583
1505
|
var InvalidBytesLengthError = class extends BaseError3 {
|
|
2584
|
-
constructor({ size:
|
|
2585
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${
|
|
1506
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1507
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size3} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
2586
1508
|
}
|
|
2587
1509
|
};
|
|
2588
1510
|
|
|
2589
1511
|
// node_modules/viem/_esm/utils/data/slice.js
|
|
2590
|
-
function
|
|
1512
|
+
function slice(value, start, end, { strict } = {}) {
|
|
2591
1513
|
if (isHex(value, { strict: false }))
|
|
2592
1514
|
return sliceHex(value, start, end, {
|
|
2593
1515
|
strict
|
|
@@ -2596,99 +1518,94 @@ function slice3(value, start, end, { strict } = {}) {
|
|
|
2596
1518
|
strict
|
|
2597
1519
|
});
|
|
2598
1520
|
}
|
|
2599
|
-
function
|
|
2600
|
-
if (typeof start === "number" && start > 0 && start >
|
|
2601
|
-
throw new
|
|
1521
|
+
function assertStartOffset2(value, start) {
|
|
1522
|
+
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
1523
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
2602
1524
|
offset: start,
|
|
2603
1525
|
position: "start",
|
|
2604
|
-
size:
|
|
1526
|
+
size: size2(value)
|
|
2605
1527
|
});
|
|
2606
1528
|
}
|
|
2607
|
-
function
|
|
2608
|
-
if (typeof start === "number" && typeof end === "number" &&
|
|
2609
|
-
throw new
|
|
1529
|
+
function assertEndOffset2(value, start, end) {
|
|
1530
|
+
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
1531
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
2610
1532
|
offset: end,
|
|
2611
1533
|
position: "end",
|
|
2612
|
-
size:
|
|
1534
|
+
size: size2(value)
|
|
2613
1535
|
});
|
|
2614
1536
|
}
|
|
2615
1537
|
}
|
|
2616
1538
|
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
2617
|
-
|
|
1539
|
+
assertStartOffset2(value_, start);
|
|
2618
1540
|
const value = value_.slice(start, end);
|
|
2619
1541
|
if (strict)
|
|
2620
|
-
|
|
1542
|
+
assertEndOffset2(value, start, end);
|
|
2621
1543
|
return value;
|
|
2622
1544
|
}
|
|
2623
1545
|
function sliceHex(value_, start, end, { strict } = {}) {
|
|
2624
|
-
|
|
1546
|
+
assertStartOffset2(value_, start);
|
|
2625
1547
|
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
2626
1548
|
if (strict)
|
|
2627
|
-
|
|
1549
|
+
assertEndOffset2(value, start, end);
|
|
2628
1550
|
return value;
|
|
2629
1551
|
}
|
|
2630
1552
|
|
|
2631
1553
|
// node_modules/viem/_esm/utils/data/pad.js
|
|
2632
|
-
function
|
|
1554
|
+
function pad2(hexOrBytes, { dir, size: size3 = 32 } = {}) {
|
|
2633
1555
|
if (typeof hexOrBytes === "string")
|
|
2634
|
-
return padHex(hexOrBytes, { dir, size:
|
|
2635
|
-
return padBytes(hexOrBytes, { dir, size:
|
|
1556
|
+
return padHex(hexOrBytes, { dir, size: size3 });
|
|
1557
|
+
return padBytes(hexOrBytes, { dir, size: size3 });
|
|
2636
1558
|
}
|
|
2637
|
-
function padHex(hex_, { dir, size:
|
|
2638
|
-
if (
|
|
1559
|
+
function padHex(hex_, { dir, size: size3 = 32 } = {}) {
|
|
1560
|
+
if (size3 === null)
|
|
2639
1561
|
return hex_;
|
|
2640
1562
|
const hex = hex_.replace("0x", "");
|
|
2641
|
-
if (hex.length >
|
|
2642
|
-
throw new
|
|
1563
|
+
if (hex.length > size3 * 2)
|
|
1564
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
2643
1565
|
size: Math.ceil(hex.length / 2),
|
|
2644
|
-
targetSize:
|
|
1566
|
+
targetSize: size3,
|
|
2645
1567
|
type: "hex"
|
|
2646
1568
|
});
|
|
2647
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](
|
|
1569
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
2648
1570
|
}
|
|
2649
|
-
function padBytes(bytes, { dir, size:
|
|
2650
|
-
if (
|
|
1571
|
+
function padBytes(bytes, { dir, size: size3 = 32 } = {}) {
|
|
1572
|
+
if (size3 === null)
|
|
2651
1573
|
return bytes;
|
|
2652
|
-
if (bytes.length >
|
|
2653
|
-
throw new
|
|
1574
|
+
if (bytes.length > size3)
|
|
1575
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
2654
1576
|
size: bytes.length,
|
|
2655
|
-
targetSize:
|
|
1577
|
+
targetSize: size3,
|
|
2656
1578
|
type: "bytes"
|
|
2657
1579
|
});
|
|
2658
|
-
const paddedBytes = new Uint8Array(
|
|
2659
|
-
for (let i = 0; i <
|
|
1580
|
+
const paddedBytes = new Uint8Array(size3);
|
|
1581
|
+
for (let i = 0; i < size3; i++) {
|
|
2660
1582
|
const padEnd = dir === "right";
|
|
2661
|
-
paddedBytes[padEnd ? i :
|
|
1583
|
+
paddedBytes[padEnd ? i : size3 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
2662
1584
|
}
|
|
2663
1585
|
return paddedBytes;
|
|
2664
1586
|
}
|
|
2665
1587
|
|
|
2666
1588
|
// node_modules/viem/_esm/errors/encoding.js
|
|
2667
1589
|
var IntegerOutOfRangeError2 = class extends BaseError3 {
|
|
2668
|
-
constructor({ max, min, signed, size:
|
|
2669
|
-
super(`Number "${value}" is not in safe ${
|
|
1590
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
1591
|
+
super(`Number "${value}" is not in safe ${size3 ? `${size3 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
2670
1592
|
}
|
|
2671
1593
|
};
|
|
2672
|
-
var
|
|
1594
|
+
var InvalidBytesBooleanError = class extends BaseError3 {
|
|
2673
1595
|
constructor(bytes) {
|
|
2674
1596
|
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
2675
1597
|
name: "InvalidBytesBooleanError"
|
|
2676
1598
|
});
|
|
2677
1599
|
}
|
|
2678
1600
|
};
|
|
2679
|
-
var
|
|
2680
|
-
constructor(hex) {
|
|
2681
|
-
super(`Hex value "${hex}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`, { name: "InvalidHexBooleanError" });
|
|
2682
|
-
}
|
|
2683
|
-
};
|
|
2684
|
-
var SizeOverflowError3 = class extends BaseError3 {
|
|
1601
|
+
var SizeOverflowError2 = class extends BaseError3 {
|
|
2685
1602
|
constructor({ givenSize, maxSize }) {
|
|
2686
1603
|
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
2687
1604
|
}
|
|
2688
1605
|
};
|
|
2689
1606
|
|
|
2690
1607
|
// node_modules/viem/_esm/utils/data/trim.js
|
|
2691
|
-
function
|
|
1608
|
+
function trim2(hexOrBytes, { dir = "left" } = {}) {
|
|
2692
1609
|
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
2693
1610
|
let sliceLength = 0;
|
|
2694
1611
|
for (let i = 0; i < data.length - 1; i++) {
|
|
@@ -2707,39 +1624,27 @@ function trim3(hexOrBytes, { dir = "left" } = {}) {
|
|
|
2707
1624
|
}
|
|
2708
1625
|
|
|
2709
1626
|
// node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
2710
|
-
function
|
|
2711
|
-
if (
|
|
2712
|
-
throw new
|
|
2713
|
-
givenSize:
|
|
2714
|
-
maxSize:
|
|
1627
|
+
function assertSize2(hexOrBytes, { size: size3 }) {
|
|
1628
|
+
if (size2(hexOrBytes) > size3)
|
|
1629
|
+
throw new SizeOverflowError2({
|
|
1630
|
+
givenSize: size2(hexOrBytes),
|
|
1631
|
+
maxSize: size3
|
|
2715
1632
|
});
|
|
2716
1633
|
}
|
|
2717
1634
|
function hexToBigInt(hex, opts = {}) {
|
|
2718
1635
|
const { signed } = opts;
|
|
2719
1636
|
if (opts.size)
|
|
2720
|
-
|
|
1637
|
+
assertSize2(hex, { size: opts.size });
|
|
2721
1638
|
const value = BigInt(hex);
|
|
2722
1639
|
if (!signed)
|
|
2723
1640
|
return value;
|
|
2724
|
-
const
|
|
2725
|
-
const max = (1n << BigInt(
|
|
1641
|
+
const size3 = (hex.length - 2) / 2;
|
|
1642
|
+
const max = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
2726
1643
|
if (value <= max)
|
|
2727
1644
|
return value;
|
|
2728
|
-
return value - BigInt(`0x${"f".padStart(
|
|
2729
|
-
}
|
|
2730
|
-
function hexToBool(hex_, opts = {}) {
|
|
2731
|
-
let hex = hex_;
|
|
2732
|
-
if (opts.size) {
|
|
2733
|
-
assertSize3(hex, { size: opts.size });
|
|
2734
|
-
hex = trim3(hex);
|
|
2735
|
-
}
|
|
2736
|
-
if (trim3(hex) === "0x00")
|
|
2737
|
-
return false;
|
|
2738
|
-
if (trim3(hex) === "0x01")
|
|
2739
|
-
return true;
|
|
2740
|
-
throw new InvalidHexBooleanError(hex);
|
|
1645
|
+
return value - BigInt(`0x${"f".padStart(size3 * 2, "f")}`) - 1n;
|
|
2741
1646
|
}
|
|
2742
|
-
function
|
|
1647
|
+
function hexToNumber(hex, opts = {}) {
|
|
2743
1648
|
const value = hexToBigInt(hex, opts);
|
|
2744
1649
|
const number = Number(value);
|
|
2745
1650
|
if (!Number.isSafeInteger(number))
|
|
@@ -2754,7 +1659,7 @@ function hexToNumber2(hex, opts = {}) {
|
|
|
2754
1659
|
}
|
|
2755
1660
|
|
|
2756
1661
|
// node_modules/viem/_esm/utils/encoding/toHex.js
|
|
2757
|
-
var
|
|
1662
|
+
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
2758
1663
|
function toHex(value, opts = {}) {
|
|
2759
1664
|
if (typeof value === "number" || typeof value === "bigint")
|
|
2760
1665
|
return numberToHex(value, opts);
|
|
@@ -2763,37 +1668,37 @@ function toHex(value, opts = {}) {
|
|
|
2763
1668
|
}
|
|
2764
1669
|
if (typeof value === "boolean")
|
|
2765
1670
|
return boolToHex(value, opts);
|
|
2766
|
-
return
|
|
1671
|
+
return bytesToHex(value, opts);
|
|
2767
1672
|
}
|
|
2768
1673
|
function boolToHex(value, opts = {}) {
|
|
2769
1674
|
const hex = `0x${Number(value)}`;
|
|
2770
1675
|
if (typeof opts.size === "number") {
|
|
2771
|
-
|
|
2772
|
-
return
|
|
1676
|
+
assertSize2(hex, { size: opts.size });
|
|
1677
|
+
return pad2(hex, { size: opts.size });
|
|
2773
1678
|
}
|
|
2774
1679
|
return hex;
|
|
2775
1680
|
}
|
|
2776
|
-
function
|
|
1681
|
+
function bytesToHex(value, opts = {}) {
|
|
2777
1682
|
let string = "";
|
|
2778
1683
|
for (let i = 0; i < value.length; i++) {
|
|
2779
|
-
string +=
|
|
1684
|
+
string += hexes[value[i]];
|
|
2780
1685
|
}
|
|
2781
1686
|
const hex = `0x${string}`;
|
|
2782
1687
|
if (typeof opts.size === "number") {
|
|
2783
|
-
|
|
2784
|
-
return
|
|
1688
|
+
assertSize2(hex, { size: opts.size });
|
|
1689
|
+
return pad2(hex, { dir: "right", size: opts.size });
|
|
2785
1690
|
}
|
|
2786
1691
|
return hex;
|
|
2787
1692
|
}
|
|
2788
1693
|
function numberToHex(value_, opts = {}) {
|
|
2789
|
-
const { signed, size:
|
|
1694
|
+
const { signed, size: size3 } = opts;
|
|
2790
1695
|
const value = BigInt(value_);
|
|
2791
1696
|
let maxValue;
|
|
2792
|
-
if (
|
|
1697
|
+
if (size3) {
|
|
2793
1698
|
if (signed)
|
|
2794
|
-
maxValue = (1n << BigInt(
|
|
1699
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
2795
1700
|
else
|
|
2796
|
-
maxValue = 2n ** (BigInt(
|
|
1701
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
2797
1702
|
} else if (typeof value_ === "number") {
|
|
2798
1703
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
2799
1704
|
}
|
|
@@ -2804,42 +1709,42 @@ function numberToHex(value_, opts = {}) {
|
|
|
2804
1709
|
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
2805
1710
|
min: `${minValue}${suffix}`,
|
|
2806
1711
|
signed,
|
|
2807
|
-
size:
|
|
1712
|
+
size: size3,
|
|
2808
1713
|
value: `${value_}${suffix}`
|
|
2809
1714
|
});
|
|
2810
1715
|
}
|
|
2811
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(
|
|
2812
|
-
if (
|
|
2813
|
-
return
|
|
1716
|
+
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size3 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
1717
|
+
if (size3)
|
|
1718
|
+
return pad2(hex, { size: size3 });
|
|
2814
1719
|
return hex;
|
|
2815
1720
|
}
|
|
2816
|
-
var
|
|
1721
|
+
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
2817
1722
|
function stringToHex(value_, opts = {}) {
|
|
2818
|
-
const value =
|
|
2819
|
-
return
|
|
1723
|
+
const value = encoder.encode(value_);
|
|
1724
|
+
return bytesToHex(value, opts);
|
|
2820
1725
|
}
|
|
2821
1726
|
|
|
2822
1727
|
// node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
2823
|
-
var
|
|
1728
|
+
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
2824
1729
|
function toBytes2(value, opts = {}) {
|
|
2825
1730
|
if (typeof value === "number" || typeof value === "bigint")
|
|
2826
1731
|
return numberToBytes(value, opts);
|
|
2827
1732
|
if (typeof value === "boolean")
|
|
2828
1733
|
return boolToBytes(value, opts);
|
|
2829
1734
|
if (isHex(value))
|
|
2830
|
-
return
|
|
1735
|
+
return hexToBytes(value, opts);
|
|
2831
1736
|
return stringToBytes(value, opts);
|
|
2832
1737
|
}
|
|
2833
1738
|
function boolToBytes(value, opts = {}) {
|
|
2834
1739
|
const bytes = new Uint8Array(1);
|
|
2835
1740
|
bytes[0] = Number(value);
|
|
2836
1741
|
if (typeof opts.size === "number") {
|
|
2837
|
-
|
|
2838
|
-
return
|
|
1742
|
+
assertSize2(bytes, { size: opts.size });
|
|
1743
|
+
return pad2(bytes, { size: opts.size });
|
|
2839
1744
|
}
|
|
2840
1745
|
return bytes;
|
|
2841
1746
|
}
|
|
2842
|
-
var
|
|
1747
|
+
var charCodeMap = {
|
|
2843
1748
|
zero: 48,
|
|
2844
1749
|
nine: 57,
|
|
2845
1750
|
A: 65,
|
|
@@ -2847,20 +1752,20 @@ var charCodeMap2 = {
|
|
|
2847
1752
|
a: 97,
|
|
2848
1753
|
f: 102
|
|
2849
1754
|
};
|
|
2850
|
-
function
|
|
2851
|
-
if (char >=
|
|
2852
|
-
return char -
|
|
2853
|
-
if (char >=
|
|
2854
|
-
return char - (
|
|
2855
|
-
if (char >=
|
|
2856
|
-
return char - (
|
|
1755
|
+
function charCodeToBase16(char) {
|
|
1756
|
+
if (char >= charCodeMap.zero && char <= charCodeMap.nine)
|
|
1757
|
+
return char - charCodeMap.zero;
|
|
1758
|
+
if (char >= charCodeMap.A && char <= charCodeMap.F)
|
|
1759
|
+
return char - (charCodeMap.A - 10);
|
|
1760
|
+
if (char >= charCodeMap.a && char <= charCodeMap.f)
|
|
1761
|
+
return char - (charCodeMap.a - 10);
|
|
2857
1762
|
return void 0;
|
|
2858
1763
|
}
|
|
2859
|
-
function
|
|
1764
|
+
function hexToBytes(hex_, opts = {}) {
|
|
2860
1765
|
let hex = hex_;
|
|
2861
1766
|
if (opts.size) {
|
|
2862
|
-
|
|
2863
|
-
hex =
|
|
1767
|
+
assertSize2(hex, { size: opts.size });
|
|
1768
|
+
hex = pad2(hex, { dir: "right", size: opts.size });
|
|
2864
1769
|
}
|
|
2865
1770
|
let hexString = hex.slice(2);
|
|
2866
1771
|
if (hexString.length % 2)
|
|
@@ -2868,8 +1773,8 @@ function hexToBytes2(hex_, opts = {}) {
|
|
|
2868
1773
|
const length = hexString.length / 2;
|
|
2869
1774
|
const bytes = new Uint8Array(length);
|
|
2870
1775
|
for (let index = 0, j = 0; index < length; index++) {
|
|
2871
|
-
const nibbleLeft =
|
|
2872
|
-
const nibbleRight =
|
|
1776
|
+
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1777
|
+
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
2873
1778
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
2874
1779
|
throw new BaseError3(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
2875
1780
|
}
|
|
@@ -2879,20 +1784,20 @@ function hexToBytes2(hex_, opts = {}) {
|
|
|
2879
1784
|
}
|
|
2880
1785
|
function numberToBytes(value, opts) {
|
|
2881
1786
|
const hex = numberToHex(value, opts);
|
|
2882
|
-
return
|
|
1787
|
+
return hexToBytes(hex);
|
|
2883
1788
|
}
|
|
2884
1789
|
function stringToBytes(value, opts = {}) {
|
|
2885
|
-
const bytes =
|
|
1790
|
+
const bytes = encoder2.encode(value);
|
|
2886
1791
|
if (typeof opts.size === "number") {
|
|
2887
|
-
|
|
2888
|
-
return
|
|
1792
|
+
assertSize2(bytes, { size: opts.size });
|
|
1793
|
+
return pad2(bytes, { dir: "right", size: opts.size });
|
|
2889
1794
|
}
|
|
2890
1795
|
return bytes;
|
|
2891
1796
|
}
|
|
2892
1797
|
|
|
2893
1798
|
// node_modules/@noble/hashes/esm/sha3.js
|
|
2894
|
-
var
|
|
2895
|
-
var
|
|
1799
|
+
var _0n = BigInt(0);
|
|
1800
|
+
var _1n = BigInt(1);
|
|
2896
1801
|
var _2n = BigInt(2);
|
|
2897
1802
|
var _7n = BigInt(7);
|
|
2898
1803
|
var _256n = BigInt(256);
|
|
@@ -2900,15 +1805,15 @@ var _0x71n = BigInt(113);
|
|
|
2900
1805
|
var SHA3_PI = [];
|
|
2901
1806
|
var SHA3_ROTL = [];
|
|
2902
1807
|
var _SHA3_IOTA = [];
|
|
2903
|
-
for (let round = 0, R =
|
|
1808
|
+
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
2904
1809
|
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
2905
1810
|
SHA3_PI.push(2 * (5 * y + x));
|
|
2906
1811
|
SHA3_ROTL.push((round + 1) * (round + 2) / 2 % 64);
|
|
2907
|
-
let t =
|
|
1812
|
+
let t = _0n;
|
|
2908
1813
|
for (let j = 0; j < 7; j++) {
|
|
2909
|
-
R = (R <<
|
|
1814
|
+
R = (R << _1n ^ (R >> _7n) * _0x71n) % _256n;
|
|
2910
1815
|
if (R & _2n)
|
|
2911
|
-
t ^=
|
|
1816
|
+
t ^= _1n << (_1n << /* @__PURE__ */ BigInt(j)) - _1n;
|
|
2912
1817
|
}
|
|
2913
1818
|
_SHA3_IOTA.push(t);
|
|
2914
1819
|
}
|
|
@@ -3146,7 +2051,7 @@ function toSignatureHash(fn) {
|
|
|
3146
2051
|
}
|
|
3147
2052
|
|
|
3148
2053
|
// node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
3149
|
-
var toFunctionSelector = (fn) =>
|
|
2054
|
+
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
3150
2055
|
|
|
3151
2056
|
// node_modules/viem/_esm/errors/address.js
|
|
3152
2057
|
var InvalidAddressError = class extends BaseError3 {
|
|
@@ -3163,7 +2068,7 @@ var InvalidAddressError = class extends BaseError3 {
|
|
|
3163
2068
|
|
|
3164
2069
|
// node_modules/viem/_esm/utils/lru.js
|
|
3165
2070
|
var LruMap = class extends Map {
|
|
3166
|
-
constructor(
|
|
2071
|
+
constructor(size3) {
|
|
3167
2072
|
super();
|
|
3168
2073
|
Object.defineProperty(this, "maxSize", {
|
|
3169
2074
|
enumerable: true,
|
|
@@ -3171,7 +2076,7 @@ var LruMap = class extends Map {
|
|
|
3171
2076
|
writable: true,
|
|
3172
2077
|
value: void 0
|
|
3173
2078
|
});
|
|
3174
|
-
this.maxSize =
|
|
2079
|
+
this.maxSize = size3;
|
|
3175
2080
|
}
|
|
3176
2081
|
get(key) {
|
|
3177
2082
|
const value = super.get(key);
|
|
@@ -3367,11 +2272,11 @@ var staticCursor = {
|
|
|
3367
2272
|
this.position++;
|
|
3368
2273
|
return value;
|
|
3369
2274
|
},
|
|
3370
|
-
readBytes(length,
|
|
2275
|
+
readBytes(length, size3) {
|
|
3371
2276
|
this.assertReadLimit();
|
|
3372
2277
|
this._touch();
|
|
3373
2278
|
const value = this.inspectBytes(length);
|
|
3374
|
-
this.position +=
|
|
2279
|
+
this.position += size3 ?? length;
|
|
3375
2280
|
return value;
|
|
3376
2281
|
},
|
|
3377
2282
|
readUint8() {
|
|
@@ -3432,42 +2337,42 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
|
3432
2337
|
// node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
3433
2338
|
function bytesToBigInt(bytes, opts = {}) {
|
|
3434
2339
|
if (typeof opts.size !== "undefined")
|
|
3435
|
-
|
|
3436
|
-
const hex =
|
|
2340
|
+
assertSize2(bytes, { size: opts.size });
|
|
2341
|
+
const hex = bytesToHex(bytes, opts);
|
|
3437
2342
|
return hexToBigInt(hex, opts);
|
|
3438
2343
|
}
|
|
3439
2344
|
function bytesToBool(bytes_, opts = {}) {
|
|
3440
2345
|
let bytes = bytes_;
|
|
3441
2346
|
if (typeof opts.size !== "undefined") {
|
|
3442
|
-
|
|
3443
|
-
bytes =
|
|
2347
|
+
assertSize2(bytes, { size: opts.size });
|
|
2348
|
+
bytes = trim2(bytes);
|
|
3444
2349
|
}
|
|
3445
2350
|
if (bytes.length > 1 || bytes[0] > 1)
|
|
3446
|
-
throw new
|
|
2351
|
+
throw new InvalidBytesBooleanError(bytes);
|
|
3447
2352
|
return Boolean(bytes[0]);
|
|
3448
2353
|
}
|
|
3449
2354
|
function bytesToNumber(bytes, opts = {}) {
|
|
3450
2355
|
if (typeof opts.size !== "undefined")
|
|
3451
|
-
|
|
3452
|
-
const hex =
|
|
3453
|
-
return
|
|
2356
|
+
assertSize2(bytes, { size: opts.size });
|
|
2357
|
+
const hex = bytesToHex(bytes, opts);
|
|
2358
|
+
return hexToNumber(hex, opts);
|
|
3454
2359
|
}
|
|
3455
2360
|
function bytesToString(bytes_, opts = {}) {
|
|
3456
2361
|
let bytes = bytes_;
|
|
3457
2362
|
if (typeof opts.size !== "undefined") {
|
|
3458
|
-
|
|
3459
|
-
bytes =
|
|
2363
|
+
assertSize2(bytes, { size: opts.size });
|
|
2364
|
+
bytes = trim2(bytes, { dir: "right" });
|
|
3460
2365
|
}
|
|
3461
2366
|
return new TextDecoder().decode(bytes);
|
|
3462
2367
|
}
|
|
3463
2368
|
|
|
3464
2369
|
// node_modules/viem/_esm/utils/data/concat.js
|
|
3465
|
-
function
|
|
2370
|
+
function concat(values) {
|
|
3466
2371
|
if (typeof values[0] === "string")
|
|
3467
2372
|
return concatHex(values);
|
|
3468
|
-
return
|
|
2373
|
+
return concatBytes(values);
|
|
3469
2374
|
}
|
|
3470
|
-
function
|
|
2375
|
+
function concatBytes(values) {
|
|
3471
2376
|
let length = 0;
|
|
3472
2377
|
for (const arr of values) {
|
|
3473
2378
|
length += arr.length;
|
|
@@ -3530,10 +2435,10 @@ function prepareParam({ param, value }) {
|
|
|
3530
2435
|
}
|
|
3531
2436
|
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
3532
2437
|
const signed = param.type.startsWith("int");
|
|
3533
|
-
const [, ,
|
|
2438
|
+
const [, , size3 = "256"] = integerRegex2.exec(param.type) ?? [];
|
|
3534
2439
|
return encodeNumber(value, {
|
|
3535
2440
|
signed,
|
|
3536
|
-
size: Number(
|
|
2441
|
+
size: Number(size3)
|
|
3537
2442
|
});
|
|
3538
2443
|
}
|
|
3539
2444
|
if (param.type.startsWith("bytes")) {
|
|
@@ -3553,7 +2458,7 @@ function encodeParams(preparedParams) {
|
|
|
3553
2458
|
if (dynamic)
|
|
3554
2459
|
staticSize += 32;
|
|
3555
2460
|
else
|
|
3556
|
-
staticSize +=
|
|
2461
|
+
staticSize += size2(encoded);
|
|
3557
2462
|
}
|
|
3558
2463
|
const staticParams = [];
|
|
3559
2464
|
const dynamicParams = [];
|
|
@@ -3563,12 +2468,12 @@ function encodeParams(preparedParams) {
|
|
|
3563
2468
|
if (dynamic) {
|
|
3564
2469
|
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
3565
2470
|
dynamicParams.push(encoded);
|
|
3566
|
-
dynamicSize +=
|
|
2471
|
+
dynamicSize += size2(encoded);
|
|
3567
2472
|
} else {
|
|
3568
2473
|
staticParams.push(encoded);
|
|
3569
2474
|
}
|
|
3570
2475
|
}
|
|
3571
|
-
return
|
|
2476
|
+
return concat([...staticParams, ...dynamicParams]);
|
|
3572
2477
|
}
|
|
3573
2478
|
function encodeAddress(value) {
|
|
3574
2479
|
if (!isAddress(value))
|
|
@@ -3599,7 +2504,7 @@ function encodeArray(value, { length, param }) {
|
|
|
3599
2504
|
const length2 = numberToHex(preparedParams.length, { size: 32 });
|
|
3600
2505
|
return {
|
|
3601
2506
|
dynamic: true,
|
|
3602
|
-
encoded: preparedParams.length > 0 ?
|
|
2507
|
+
encoded: preparedParams.length > 0 ? concat([length2, data]) : length2
|
|
3603
2508
|
};
|
|
3604
2509
|
}
|
|
3605
2510
|
if (dynamicChild)
|
|
@@ -3607,12 +2512,12 @@ function encodeArray(value, { length, param }) {
|
|
|
3607
2512
|
}
|
|
3608
2513
|
return {
|
|
3609
2514
|
dynamic: false,
|
|
3610
|
-
encoded:
|
|
2515
|
+
encoded: concat(preparedParams.map(({ encoded }) => encoded))
|
|
3611
2516
|
};
|
|
3612
2517
|
}
|
|
3613
2518
|
function encodeBytes(value, { param }) {
|
|
3614
2519
|
const [, paramSize] = param.type.split("bytes");
|
|
3615
|
-
const bytesSize =
|
|
2520
|
+
const bytesSize = size2(value);
|
|
3616
2521
|
if (!paramSize) {
|
|
3617
2522
|
let value_ = value;
|
|
3618
2523
|
if (bytesSize % 32 !== 0)
|
|
@@ -3622,7 +2527,7 @@ function encodeBytes(value, { param }) {
|
|
|
3622
2527
|
});
|
|
3623
2528
|
return {
|
|
3624
2529
|
dynamic: true,
|
|
3625
|
-
encoded:
|
|
2530
|
+
encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_])
|
|
3626
2531
|
};
|
|
3627
2532
|
}
|
|
3628
2533
|
if (bytesSize !== Number.parseInt(paramSize, 10))
|
|
@@ -3637,16 +2542,16 @@ function encodeBool(value) {
|
|
|
3637
2542
|
throw new BaseError3(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
3638
2543
|
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
3639
2544
|
}
|
|
3640
|
-
function encodeNumber(value, { signed, size:
|
|
3641
|
-
if (typeof
|
|
3642
|
-
const max = 2n ** (BigInt(
|
|
2545
|
+
function encodeNumber(value, { signed, size: size3 = 256 }) {
|
|
2546
|
+
if (typeof size3 === "number") {
|
|
2547
|
+
const max = 2n ** (BigInt(size3) - (signed ? 1n : 0n)) - 1n;
|
|
3643
2548
|
const min = signed ? -max - 1n : 0n;
|
|
3644
2549
|
if (value > max || value < min)
|
|
3645
2550
|
throw new IntegerOutOfRangeError2({
|
|
3646
2551
|
max: max.toString(),
|
|
3647
2552
|
min: min.toString(),
|
|
3648
2553
|
signed,
|
|
3649
|
-
size:
|
|
2554
|
+
size: size3 / 8,
|
|
3650
2555
|
value: value.toString()
|
|
3651
2556
|
});
|
|
3652
2557
|
}
|
|
@@ -3660,17 +2565,17 @@ function encodeNumber(value, { signed, size: size4 = 256 }) {
|
|
|
3660
2565
|
}
|
|
3661
2566
|
function encodeString(value) {
|
|
3662
2567
|
const hexValue = stringToHex(value);
|
|
3663
|
-
const partsLength = Math.ceil(
|
|
2568
|
+
const partsLength = Math.ceil(size2(hexValue) / 32);
|
|
3664
2569
|
const parts = [];
|
|
3665
2570
|
for (let i = 0; i < partsLength; i++) {
|
|
3666
|
-
parts.push(padHex(
|
|
2571
|
+
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
3667
2572
|
dir: "right"
|
|
3668
2573
|
}));
|
|
3669
2574
|
}
|
|
3670
2575
|
return {
|
|
3671
2576
|
dynamic: true,
|
|
3672
|
-
encoded:
|
|
3673
|
-
padHex(numberToHex(
|
|
2577
|
+
encoded: concat([
|
|
2578
|
+
padHex(numberToHex(size2(hexValue), { size: 32 })),
|
|
3674
2579
|
...parts
|
|
3675
2580
|
])
|
|
3676
2581
|
};
|
|
@@ -3691,7 +2596,7 @@ function encodeTuple(value, { param }) {
|
|
|
3691
2596
|
}
|
|
3692
2597
|
return {
|
|
3693
2598
|
dynamic,
|
|
3694
|
-
encoded: dynamic ? encodeParams(preparedParams) :
|
|
2599
|
+
encoded: dynamic ? encodeParams(preparedParams) : concat(preparedParams.map(({ encoded }) => encoded))
|
|
3695
2600
|
};
|
|
3696
2601
|
}
|
|
3697
2602
|
function getArrayComponents(type) {
|
|
@@ -3704,15 +2609,15 @@ function getArrayComponents(type) {
|
|
|
3704
2609
|
|
|
3705
2610
|
// node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
3706
2611
|
function decodeAbiParameters(params, data) {
|
|
3707
|
-
const bytes = typeof data === "string" ?
|
|
2612
|
+
const bytes = typeof data === "string" ? hexToBytes(data) : data;
|
|
3708
2613
|
const cursor = createCursor(bytes);
|
|
3709
|
-
if (
|
|
2614
|
+
if (size2(bytes) === 0 && params.length > 0)
|
|
3710
2615
|
throw new AbiDecodingZeroDataError();
|
|
3711
|
-
if (
|
|
2616
|
+
if (size2(data) && size2(data) < 32)
|
|
3712
2617
|
throw new AbiDecodingDataSizeTooSmallError({
|
|
3713
|
-
data: typeof data === "string" ? data :
|
|
2618
|
+
data: typeof data === "string" ? data : bytesToHex(data),
|
|
3714
2619
|
params,
|
|
3715
|
-
size:
|
|
2620
|
+
size: size2(data)
|
|
3716
2621
|
});
|
|
3717
2622
|
let consumed = 0;
|
|
3718
2623
|
const values = [];
|
|
@@ -3753,7 +2658,7 @@ var sizeOfLength = 32;
|
|
|
3753
2658
|
var sizeOfOffset = 32;
|
|
3754
2659
|
function decodeAddress(cursor) {
|
|
3755
2660
|
const value = cursor.readBytes(32);
|
|
3756
|
-
return [checksumAddress(
|
|
2661
|
+
return [checksumAddress(bytesToHex(sliceBytes(value, -20))), 32];
|
|
3757
2662
|
}
|
|
3758
2663
|
function decodeArray(cursor, param, { length, staticPosition }) {
|
|
3759
2664
|
if (!length) {
|
|
@@ -3805,8 +2710,8 @@ function decodeBool(cursor) {
|
|
|
3805
2710
|
return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];
|
|
3806
2711
|
}
|
|
3807
2712
|
function decodeBytes(cursor, param, { staticPosition }) {
|
|
3808
|
-
const [_,
|
|
3809
|
-
if (!
|
|
2713
|
+
const [_, size3] = param.type.split("bytes");
|
|
2714
|
+
if (!size3) {
|
|
3810
2715
|
const offset = bytesToNumber(cursor.readBytes(32));
|
|
3811
2716
|
cursor.setPosition(staticPosition + offset);
|
|
3812
2717
|
const length = bytesToNumber(cursor.readBytes(32));
|
|
@@ -3816,17 +2721,17 @@ function decodeBytes(cursor, param, { staticPosition }) {
|
|
|
3816
2721
|
}
|
|
3817
2722
|
const data = cursor.readBytes(length);
|
|
3818
2723
|
cursor.setPosition(staticPosition + 32);
|
|
3819
|
-
return [
|
|
2724
|
+
return [bytesToHex(data), 32];
|
|
3820
2725
|
}
|
|
3821
|
-
const value =
|
|
2726
|
+
const value = bytesToHex(cursor.readBytes(Number.parseInt(size3, 10), 32));
|
|
3822
2727
|
return [value, 32];
|
|
3823
2728
|
}
|
|
3824
2729
|
function decodeNumber(cursor, param) {
|
|
3825
2730
|
const signed = param.type.startsWith("int");
|
|
3826
|
-
const
|
|
2731
|
+
const size3 = Number.parseInt(param.type.split("int")[1] || "256", 10);
|
|
3827
2732
|
const value = cursor.readBytes(32);
|
|
3828
2733
|
return [
|
|
3829
|
-
|
|
2734
|
+
size3 > 48 ? bytesToBigInt(value, { signed }) : bytesToNumber(value, { signed }),
|
|
3830
2735
|
32
|
|
3831
2736
|
];
|
|
3832
2737
|
}
|
|
@@ -3869,7 +2774,7 @@ function decodeString(cursor, { staticPosition }) {
|
|
|
3869
2774
|
return ["", 32];
|
|
3870
2775
|
}
|
|
3871
2776
|
const data = cursor.readBytes(length, 32);
|
|
3872
|
-
const value = bytesToString(
|
|
2777
|
+
const value = bytesToString(trim2(data));
|
|
3873
2778
|
cursor.setPosition(staticPosition + 32);
|
|
3874
2779
|
return [value, 32];
|
|
3875
2780
|
}
|
|
@@ -3892,7 +2797,7 @@ function hasDynamicChild(param) {
|
|
|
3892
2797
|
// node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
3893
2798
|
function decodeErrorResult(parameters) {
|
|
3894
2799
|
const { abi, data, cause } = parameters;
|
|
3895
|
-
const signature =
|
|
2800
|
+
const signature = slice(data, 0, 4);
|
|
3896
2801
|
if (signature === "0x")
|
|
3897
2802
|
throw new AbiDecodingZeroDataError({ cause });
|
|
3898
2803
|
const abi_ = [...abi || [], solidityError, solidityPanic];
|
|
@@ -3904,28 +2809,17 @@ function decodeErrorResult(parameters) {
|
|
|
3904
2809
|
});
|
|
3905
2810
|
return {
|
|
3906
2811
|
abiItem,
|
|
3907
|
-
args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs,
|
|
2812
|
+
args: "inputs" in abiItem && abiItem.inputs && abiItem.inputs.length > 0 ? decodeAbiParameters(abiItem.inputs, slice(data, 4)) : void 0,
|
|
3908
2813
|
errorName: abiItem.name
|
|
3909
2814
|
};
|
|
3910
2815
|
}
|
|
3911
2816
|
|
|
3912
2817
|
// node_modules/viem/_esm/utils/stringify.js
|
|
3913
|
-
var
|
|
2818
|
+
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
3914
2819
|
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
3915
2820
|
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
3916
2821
|
}, space);
|
|
3917
2822
|
|
|
3918
|
-
// node_modules/viem/_esm/utils/abi/formatAbiItemWithArgs.js
|
|
3919
|
-
function formatAbiItemWithArgs({ abiItem, args, includeFunctionName = true, includeName = false }) {
|
|
3920
|
-
if (!("name" in abiItem))
|
|
3921
|
-
return;
|
|
3922
|
-
if (!("inputs" in abiItem))
|
|
3923
|
-
return;
|
|
3924
|
-
if (!abiItem.inputs)
|
|
3925
|
-
return;
|
|
3926
|
-
return `${includeFunctionName ? abiItem.name : ""}(${abiItem.inputs.map((input, i) => `${includeName && input.name ? `${input.name}: ` : ""}${typeof args[i] === "object" ? stringify2(args[i]) : args[i]}`).join(", ")})`;
|
|
3927
|
-
}
|
|
3928
|
-
|
|
3929
2823
|
// node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
3930
2824
|
var toEventSelector = toSignatureHash;
|
|
3931
2825
|
|
|
@@ -4165,91 +3059,8 @@ var InvalidStorageKeySizeError = class extends BaseError3 {
|
|
|
4165
3059
|
super(`Size for storage key "${storageKey}" is invalid. Expected 32 bytes. Got ${Math.floor((storageKey.length - 2) / 2)} bytes.`, { name: "InvalidStorageKeySizeError" });
|
|
4166
3060
|
}
|
|
4167
3061
|
};
|
|
4168
|
-
var TransactionExecutionError = class extends BaseError3 {
|
|
4169
|
-
constructor(cause, { account, docsPath: docsPath6, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value }) {
|
|
4170
|
-
const prettyArgs = prettyPrint({
|
|
4171
|
-
chain: chain && `${chain?.name} (id: ${chain?.id})`,
|
|
4172
|
-
from: account?.address,
|
|
4173
|
-
to,
|
|
4174
|
-
value: typeof value !== "undefined" && `${formatEther(value)} ${chain?.nativeCurrency?.symbol || "ETH"}`,
|
|
4175
|
-
data,
|
|
4176
|
-
gas,
|
|
4177
|
-
gasPrice: typeof gasPrice !== "undefined" && `${formatGwei(gasPrice)} gwei`,
|
|
4178
|
-
maxFeePerGas: typeof maxFeePerGas !== "undefined" && `${formatGwei(maxFeePerGas)} gwei`,
|
|
4179
|
-
maxPriorityFeePerGas: typeof maxPriorityFeePerGas !== "undefined" && `${formatGwei(maxPriorityFeePerGas)} gwei`,
|
|
4180
|
-
nonce
|
|
4181
|
-
});
|
|
4182
|
-
super(cause.shortMessage, {
|
|
4183
|
-
cause,
|
|
4184
|
-
docsPath: docsPath6,
|
|
4185
|
-
metaMessages: [
|
|
4186
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
4187
|
-
"Request Arguments:",
|
|
4188
|
-
prettyArgs
|
|
4189
|
-
].filter(Boolean),
|
|
4190
|
-
name: "TransactionExecutionError"
|
|
4191
|
-
});
|
|
4192
|
-
Object.defineProperty(this, "cause", {
|
|
4193
|
-
enumerable: true,
|
|
4194
|
-
configurable: true,
|
|
4195
|
-
writable: true,
|
|
4196
|
-
value: void 0
|
|
4197
|
-
});
|
|
4198
|
-
this.cause = cause;
|
|
4199
|
-
}
|
|
4200
|
-
};
|
|
4201
|
-
var TransactionNotFoundError = class extends BaseError3 {
|
|
4202
|
-
constructor({ blockHash, blockNumber, blockTag, hash: hash2, index }) {
|
|
4203
|
-
let identifier = "Transaction";
|
|
4204
|
-
if (blockTag && index !== void 0)
|
|
4205
|
-
identifier = `Transaction at block time "${blockTag}" at index "${index}"`;
|
|
4206
|
-
if (blockHash && index !== void 0)
|
|
4207
|
-
identifier = `Transaction at block hash "${blockHash}" at index "${index}"`;
|
|
4208
|
-
if (blockNumber && index !== void 0)
|
|
4209
|
-
identifier = `Transaction at block number "${blockNumber}" at index "${index}"`;
|
|
4210
|
-
if (hash2)
|
|
4211
|
-
identifier = `Transaction with hash "${hash2}"`;
|
|
4212
|
-
super(`${identifier} could not be found.`, {
|
|
4213
|
-
name: "TransactionNotFoundError"
|
|
4214
|
-
});
|
|
4215
|
-
}
|
|
4216
|
-
};
|
|
4217
|
-
var TransactionReceiptNotFoundError = class extends BaseError3 {
|
|
4218
|
-
constructor({ hash: hash2 }) {
|
|
4219
|
-
super(`Transaction receipt with hash "${hash2}" could not be found. The Transaction may not be processed on a block yet.`, {
|
|
4220
|
-
name: "TransactionReceiptNotFoundError"
|
|
4221
|
-
});
|
|
4222
|
-
}
|
|
4223
|
-
};
|
|
4224
|
-
var TransactionReceiptRevertedError = class extends BaseError3 {
|
|
4225
|
-
constructor({ receipt }) {
|
|
4226
|
-
super(`Transaction with hash "${receipt.transactionHash}" reverted.`, {
|
|
4227
|
-
metaMessages: [
|
|
4228
|
-
'The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.',
|
|
4229
|
-
" ",
|
|
4230
|
-
"You can attempt to extract the revert reason by:",
|
|
4231
|
-
"- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract",
|
|
4232
|
-
"- using the `call` Action with raw `data`"
|
|
4233
|
-
],
|
|
4234
|
-
name: "TransactionReceiptRevertedError"
|
|
4235
|
-
});
|
|
4236
|
-
Object.defineProperty(this, "receipt", {
|
|
4237
|
-
enumerable: true,
|
|
4238
|
-
configurable: true,
|
|
4239
|
-
writable: true,
|
|
4240
|
-
value: void 0
|
|
4241
|
-
});
|
|
4242
|
-
this.receipt = receipt;
|
|
4243
|
-
}
|
|
4244
|
-
};
|
|
4245
|
-
var WaitForTransactionReceiptTimeoutError = class extends BaseError3 {
|
|
4246
|
-
constructor({ hash: hash2 }) {
|
|
4247
|
-
super(`Timed out while waiting for transaction with hash "${hash2}" to be confirmed.`, { name: "WaitForTransactionReceiptTimeoutError" });
|
|
4248
|
-
}
|
|
4249
|
-
};
|
|
4250
3062
|
|
|
4251
3063
|
// node_modules/viem/_esm/errors/utils.js
|
|
4252
|
-
var getContractAddress = (address) => address;
|
|
4253
3064
|
function getAbortError(signal) {
|
|
4254
3065
|
if (signal?.reason)
|
|
4255
3066
|
return signal.reason;
|
|
@@ -4306,181 +3117,11 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
4306
3117
|
});
|
|
4307
3118
|
Object.defineProperty(this, "cause", {
|
|
4308
3119
|
enumerable: true,
|
|
4309
|
-
configurable: true,
|
|
4310
|
-
writable: true,
|
|
4311
|
-
value: void 0
|
|
4312
|
-
});
|
|
4313
|
-
this.cause = cause;
|
|
4314
|
-
}
|
|
4315
|
-
};
|
|
4316
|
-
var ContractFunctionExecutionError = class extends BaseError3 {
|
|
4317
|
-
constructor(cause, { abi, args, contractAddress, docsPath: docsPath6, functionName, sender }) {
|
|
4318
|
-
const abiItem = getAbiItem({ abi, args, name: functionName });
|
|
4319
|
-
const formattedArgs = abiItem ? formatAbiItemWithArgs({
|
|
4320
|
-
abiItem,
|
|
4321
|
-
args,
|
|
4322
|
-
includeFunctionName: false,
|
|
4323
|
-
includeName: false
|
|
4324
|
-
}) : void 0;
|
|
4325
|
-
const functionWithParams = abiItem ? formatAbiItem2(abiItem, { includeName: true }) : void 0;
|
|
4326
|
-
const prettyArgs = prettyPrint({
|
|
4327
|
-
address: contractAddress && getContractAddress(contractAddress),
|
|
4328
|
-
function: functionWithParams,
|
|
4329
|
-
args: formattedArgs && formattedArgs !== "()" && `${[...Array(functionName?.length ?? 0).keys()].map(() => " ").join("")}${formattedArgs}`,
|
|
4330
|
-
sender
|
|
4331
|
-
});
|
|
4332
|
-
super(cause.shortMessage || `An unknown error occurred while executing the contract function "${functionName}".`, {
|
|
4333
|
-
cause,
|
|
4334
|
-
docsPath: docsPath6,
|
|
4335
|
-
metaMessages: [
|
|
4336
|
-
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
4337
|
-
prettyArgs && "Contract Call:",
|
|
4338
|
-
prettyArgs
|
|
4339
|
-
].filter(Boolean),
|
|
4340
|
-
name: "ContractFunctionExecutionError"
|
|
4341
|
-
});
|
|
4342
|
-
Object.defineProperty(this, "abi", {
|
|
4343
|
-
enumerable: true,
|
|
4344
|
-
configurable: true,
|
|
4345
|
-
writable: true,
|
|
4346
|
-
value: void 0
|
|
4347
|
-
});
|
|
4348
|
-
Object.defineProperty(this, "args", {
|
|
4349
|
-
enumerable: true,
|
|
4350
|
-
configurable: true,
|
|
4351
|
-
writable: true,
|
|
4352
|
-
value: void 0
|
|
4353
|
-
});
|
|
4354
|
-
Object.defineProperty(this, "cause", {
|
|
4355
|
-
enumerable: true,
|
|
4356
|
-
configurable: true,
|
|
4357
|
-
writable: true,
|
|
4358
|
-
value: void 0
|
|
4359
|
-
});
|
|
4360
|
-
Object.defineProperty(this, "contractAddress", {
|
|
4361
|
-
enumerable: true,
|
|
4362
|
-
configurable: true,
|
|
4363
|
-
writable: true,
|
|
4364
|
-
value: void 0
|
|
4365
|
-
});
|
|
4366
|
-
Object.defineProperty(this, "formattedArgs", {
|
|
4367
|
-
enumerable: true,
|
|
4368
|
-
configurable: true,
|
|
4369
|
-
writable: true,
|
|
4370
|
-
value: void 0
|
|
4371
|
-
});
|
|
4372
|
-
Object.defineProperty(this, "functionName", {
|
|
4373
|
-
enumerable: true,
|
|
4374
|
-
configurable: true,
|
|
4375
|
-
writable: true,
|
|
4376
|
-
value: void 0
|
|
4377
|
-
});
|
|
4378
|
-
Object.defineProperty(this, "sender", {
|
|
4379
|
-
enumerable: true,
|
|
4380
|
-
configurable: true,
|
|
4381
|
-
writable: true,
|
|
4382
|
-
value: void 0
|
|
4383
|
-
});
|
|
4384
|
-
this.abi = abi;
|
|
4385
|
-
this.args = args;
|
|
4386
|
-
this.cause = cause;
|
|
4387
|
-
this.contractAddress = contractAddress;
|
|
4388
|
-
this.functionName = functionName;
|
|
4389
|
-
this.sender = sender;
|
|
4390
|
-
}
|
|
4391
|
-
};
|
|
4392
|
-
var ContractFunctionRevertedError = class extends BaseError3 {
|
|
4393
|
-
constructor({ abi, data, functionName, message, cause: error }) {
|
|
4394
|
-
let cause;
|
|
4395
|
-
let decodedData;
|
|
4396
|
-
let metaMessages;
|
|
4397
|
-
let reason;
|
|
4398
|
-
if (data && data !== "0x") {
|
|
4399
|
-
try {
|
|
4400
|
-
decodedData = decodeErrorResult({ abi, data, cause: error });
|
|
4401
|
-
const { abiItem, errorName, args: errorArgs } = decodedData;
|
|
4402
|
-
if (errorName === "Error") {
|
|
4403
|
-
reason = errorArgs[0];
|
|
4404
|
-
} else if (errorName === "Panic") {
|
|
4405
|
-
const [firstArg] = errorArgs;
|
|
4406
|
-
reason = panicReasons[firstArg];
|
|
4407
|
-
} else {
|
|
4408
|
-
const errorWithParams = abiItem ? formatAbiItem2(abiItem, { includeName: true }) : void 0;
|
|
4409
|
-
const formattedArgs = abiItem && errorArgs ? formatAbiItemWithArgs({
|
|
4410
|
-
abiItem,
|
|
4411
|
-
args: errorArgs,
|
|
4412
|
-
includeFunctionName: false,
|
|
4413
|
-
includeName: false
|
|
4414
|
-
}) : void 0;
|
|
4415
|
-
metaMessages = [
|
|
4416
|
-
errorWithParams ? `Error: ${errorWithParams}` : "",
|
|
4417
|
-
formattedArgs && formattedArgs !== "()" ? ` ${[...Array(errorName?.length ?? 0).keys()].map(() => " ").join("")}${formattedArgs}` : ""
|
|
4418
|
-
];
|
|
4419
|
-
}
|
|
4420
|
-
} catch (err) {
|
|
4421
|
-
cause = err;
|
|
4422
|
-
}
|
|
4423
|
-
} else if (message)
|
|
4424
|
-
reason = message;
|
|
4425
|
-
let signature;
|
|
4426
|
-
if (cause instanceof AbiErrorSignatureNotFoundError) {
|
|
4427
|
-
signature = cause.signature;
|
|
4428
|
-
metaMessages = [
|
|
4429
|
-
`Unable to decode signature "${signature}" as it was not found on the provided ABI.`,
|
|
4430
|
-
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
4431
|
-
`You can look up the decoded signature here: https://4byte.sourcify.dev/?q=${signature}.`
|
|
4432
|
-
];
|
|
4433
|
-
}
|
|
4434
|
-
super(reason && reason !== "execution reverted" || signature ? [
|
|
4435
|
-
`The contract function "${functionName}" reverted with the following ${signature ? "signature" : "reason"}:`,
|
|
4436
|
-
reason || signature
|
|
4437
|
-
].join("\n") : `The contract function "${functionName}" reverted.`, {
|
|
4438
|
-
cause: cause ?? error,
|
|
4439
|
-
metaMessages,
|
|
4440
|
-
name: "ContractFunctionRevertedError"
|
|
4441
|
-
});
|
|
4442
|
-
Object.defineProperty(this, "data", {
|
|
4443
|
-
enumerable: true,
|
|
4444
|
-
configurable: true,
|
|
4445
|
-
writable: true,
|
|
4446
|
-
value: void 0
|
|
4447
|
-
});
|
|
4448
|
-
Object.defineProperty(this, "raw", {
|
|
4449
|
-
enumerable: true,
|
|
4450
|
-
configurable: true,
|
|
4451
|
-
writable: true,
|
|
4452
|
-
value: void 0
|
|
4453
|
-
});
|
|
4454
|
-
Object.defineProperty(this, "reason", {
|
|
4455
|
-
enumerable: true,
|
|
4456
|
-
configurable: true,
|
|
4457
|
-
writable: true,
|
|
4458
|
-
value: void 0
|
|
4459
|
-
});
|
|
4460
|
-
Object.defineProperty(this, "signature", {
|
|
4461
|
-
enumerable: true,
|
|
4462
|
-
configurable: true,
|
|
4463
|
-
writable: true,
|
|
4464
|
-
value: void 0
|
|
4465
|
-
});
|
|
4466
|
-
this.data = decodedData;
|
|
4467
|
-
this.raw = data;
|
|
4468
|
-
this.reason = reason;
|
|
4469
|
-
this.signature = signature;
|
|
4470
|
-
}
|
|
4471
|
-
};
|
|
4472
|
-
var ContractFunctionZeroDataError = class extends BaseError3 {
|
|
4473
|
-
constructor({ functionName, cause }) {
|
|
4474
|
-
super(`The contract function "${functionName}" returned no data ("0x").`, {
|
|
4475
|
-
metaMessages: [
|
|
4476
|
-
"This could be due to any of the following:",
|
|
4477
|
-
` - The contract does not have the function "${functionName}",`,
|
|
4478
|
-
" - The parameters passed to the contract function may be invalid, or",
|
|
4479
|
-
" - The address is not a contract."
|
|
4480
|
-
],
|
|
4481
|
-
name: "ContractFunctionZeroDataError",
|
|
4482
|
-
cause
|
|
3120
|
+
configurable: true,
|
|
3121
|
+
writable: true,
|
|
3122
|
+
value: void 0
|
|
4483
3123
|
});
|
|
3124
|
+
this.cause = cause;
|
|
4484
3125
|
}
|
|
4485
3126
|
};
|
|
4486
3127
|
var CounterfactualDeploymentFailedError = class extends BaseError3 {
|
|
@@ -4820,7 +3461,7 @@ var HttpRequestError = class extends BaseError3 {
|
|
|
4820
3461
|
metaMessages: [
|
|
4821
3462
|
status && `Status: ${status}`,
|
|
4822
3463
|
`URL: ${getUrl(url)}`,
|
|
4823
|
-
body && `Request body: ${
|
|
3464
|
+
body && `Request body: ${stringify(body)}`
|
|
4824
3465
|
].filter(Boolean),
|
|
4825
3466
|
name: "HttpRequestError"
|
|
4826
3467
|
});
|
|
@@ -4854,496 +3495,6 @@ var HttpRequestError = class extends BaseError3 {
|
|
|
4854
3495
|
this.url = url;
|
|
4855
3496
|
}
|
|
4856
3497
|
};
|
|
4857
|
-
var RpcRequestError = class extends BaseError3 {
|
|
4858
|
-
constructor({ body, error, url }) {
|
|
4859
|
-
super("RPC Request failed.", {
|
|
4860
|
-
cause: error,
|
|
4861
|
-
details: error.message,
|
|
4862
|
-
metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify2(body)}`],
|
|
4863
|
-
name: "RpcRequestError"
|
|
4864
|
-
});
|
|
4865
|
-
Object.defineProperty(this, "code", {
|
|
4866
|
-
enumerable: true,
|
|
4867
|
-
configurable: true,
|
|
4868
|
-
writable: true,
|
|
4869
|
-
value: void 0
|
|
4870
|
-
});
|
|
4871
|
-
Object.defineProperty(this, "data", {
|
|
4872
|
-
enumerable: true,
|
|
4873
|
-
configurable: true,
|
|
4874
|
-
writable: true,
|
|
4875
|
-
value: void 0
|
|
4876
|
-
});
|
|
4877
|
-
Object.defineProperty(this, "url", {
|
|
4878
|
-
enumerable: true,
|
|
4879
|
-
configurable: true,
|
|
4880
|
-
writable: true,
|
|
4881
|
-
value: void 0
|
|
4882
|
-
});
|
|
4883
|
-
this.code = error.code;
|
|
4884
|
-
this.data = error.data;
|
|
4885
|
-
this.url = url;
|
|
4886
|
-
}
|
|
4887
|
-
};
|
|
4888
|
-
var TimeoutError = class extends BaseError3 {
|
|
4889
|
-
constructor({ body, url }) {
|
|
4890
|
-
super("The request took too long to respond.", {
|
|
4891
|
-
details: "The request timed out.",
|
|
4892
|
-
metaMessages: [`URL: ${getUrl(url)}`, `Request body: ${stringify2(body)}`],
|
|
4893
|
-
name: "TimeoutError"
|
|
4894
|
-
});
|
|
4895
|
-
Object.defineProperty(this, "url", {
|
|
4896
|
-
enumerable: true,
|
|
4897
|
-
configurable: true,
|
|
4898
|
-
writable: true,
|
|
4899
|
-
value: void 0
|
|
4900
|
-
});
|
|
4901
|
-
this.url = url;
|
|
4902
|
-
}
|
|
4903
|
-
};
|
|
4904
|
-
|
|
4905
|
-
// node_modules/viem/_esm/errors/rpc.js
|
|
4906
|
-
var unknownErrorCode = -1;
|
|
4907
|
-
var RpcError = class extends BaseError3 {
|
|
4908
|
-
constructor(cause, { code, docsPath: docsPath6, metaMessages, name, shortMessage }) {
|
|
4909
|
-
super(shortMessage, {
|
|
4910
|
-
cause,
|
|
4911
|
-
docsPath: docsPath6,
|
|
4912
|
-
metaMessages: metaMessages || cause?.metaMessages,
|
|
4913
|
-
name: name || "RpcError"
|
|
4914
|
-
});
|
|
4915
|
-
Object.defineProperty(this, "code", {
|
|
4916
|
-
enumerable: true,
|
|
4917
|
-
configurable: true,
|
|
4918
|
-
writable: true,
|
|
4919
|
-
value: void 0
|
|
4920
|
-
});
|
|
4921
|
-
this.name = name || cause.name;
|
|
4922
|
-
this.code = cause instanceof RpcRequestError ? cause.code : code ?? unknownErrorCode;
|
|
4923
|
-
}
|
|
4924
|
-
};
|
|
4925
|
-
var ProviderRpcError = class extends RpcError {
|
|
4926
|
-
constructor(cause, options) {
|
|
4927
|
-
super(cause, options);
|
|
4928
|
-
Object.defineProperty(this, "data", {
|
|
4929
|
-
enumerable: true,
|
|
4930
|
-
configurable: true,
|
|
4931
|
-
writable: true,
|
|
4932
|
-
value: void 0
|
|
4933
|
-
});
|
|
4934
|
-
this.data = options.data;
|
|
4935
|
-
}
|
|
4936
|
-
};
|
|
4937
|
-
var ParseRpcError = class _ParseRpcError extends RpcError {
|
|
4938
|
-
constructor(cause) {
|
|
4939
|
-
super(cause, {
|
|
4940
|
-
code: _ParseRpcError.code,
|
|
4941
|
-
name: "ParseRpcError",
|
|
4942
|
-
shortMessage: "Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."
|
|
4943
|
-
});
|
|
4944
|
-
}
|
|
4945
|
-
};
|
|
4946
|
-
Object.defineProperty(ParseRpcError, "code", {
|
|
4947
|
-
enumerable: true,
|
|
4948
|
-
configurable: true,
|
|
4949
|
-
writable: true,
|
|
4950
|
-
value: -32700
|
|
4951
|
-
});
|
|
4952
|
-
var InvalidRequestRpcError = class _InvalidRequestRpcError extends RpcError {
|
|
4953
|
-
constructor(cause) {
|
|
4954
|
-
super(cause, {
|
|
4955
|
-
code: _InvalidRequestRpcError.code,
|
|
4956
|
-
name: "InvalidRequestRpcError",
|
|
4957
|
-
shortMessage: "JSON is not a valid request object."
|
|
4958
|
-
});
|
|
4959
|
-
}
|
|
4960
|
-
};
|
|
4961
|
-
Object.defineProperty(InvalidRequestRpcError, "code", {
|
|
4962
|
-
enumerable: true,
|
|
4963
|
-
configurable: true,
|
|
4964
|
-
writable: true,
|
|
4965
|
-
value: -32600
|
|
4966
|
-
});
|
|
4967
|
-
var MethodNotFoundRpcError = class _MethodNotFoundRpcError extends RpcError {
|
|
4968
|
-
constructor(cause, { method } = {}) {
|
|
4969
|
-
super(cause, {
|
|
4970
|
-
code: _MethodNotFoundRpcError.code,
|
|
4971
|
-
name: "MethodNotFoundRpcError",
|
|
4972
|
-
shortMessage: `The method${method ? ` "${method}"` : ""} does not exist / is not available.`
|
|
4973
|
-
});
|
|
4974
|
-
}
|
|
4975
|
-
};
|
|
4976
|
-
Object.defineProperty(MethodNotFoundRpcError, "code", {
|
|
4977
|
-
enumerable: true,
|
|
4978
|
-
configurable: true,
|
|
4979
|
-
writable: true,
|
|
4980
|
-
value: -32601
|
|
4981
|
-
});
|
|
4982
|
-
var InvalidParamsRpcError = class _InvalidParamsRpcError extends RpcError {
|
|
4983
|
-
constructor(cause) {
|
|
4984
|
-
super(cause, {
|
|
4985
|
-
code: _InvalidParamsRpcError.code,
|
|
4986
|
-
name: "InvalidParamsRpcError",
|
|
4987
|
-
shortMessage: [
|
|
4988
|
-
"Invalid parameters were provided to the RPC method.",
|
|
4989
|
-
"Double check you have provided the correct parameters."
|
|
4990
|
-
].join("\n")
|
|
4991
|
-
});
|
|
4992
|
-
}
|
|
4993
|
-
};
|
|
4994
|
-
Object.defineProperty(InvalidParamsRpcError, "code", {
|
|
4995
|
-
enumerable: true,
|
|
4996
|
-
configurable: true,
|
|
4997
|
-
writable: true,
|
|
4998
|
-
value: -32602
|
|
4999
|
-
});
|
|
5000
|
-
var InternalRpcError = class _InternalRpcError extends RpcError {
|
|
5001
|
-
constructor(cause) {
|
|
5002
|
-
super(cause, {
|
|
5003
|
-
code: _InternalRpcError.code,
|
|
5004
|
-
name: "InternalRpcError",
|
|
5005
|
-
shortMessage: "An internal error was received."
|
|
5006
|
-
});
|
|
5007
|
-
}
|
|
5008
|
-
};
|
|
5009
|
-
Object.defineProperty(InternalRpcError, "code", {
|
|
5010
|
-
enumerable: true,
|
|
5011
|
-
configurable: true,
|
|
5012
|
-
writable: true,
|
|
5013
|
-
value: -32603
|
|
5014
|
-
});
|
|
5015
|
-
var InvalidInputRpcError = class _InvalidInputRpcError extends RpcError {
|
|
5016
|
-
constructor(cause) {
|
|
5017
|
-
super(cause, {
|
|
5018
|
-
code: _InvalidInputRpcError.code,
|
|
5019
|
-
name: "InvalidInputRpcError",
|
|
5020
|
-
shortMessage: [
|
|
5021
|
-
"Missing or invalid parameters.",
|
|
5022
|
-
"Double check you have provided the correct parameters."
|
|
5023
|
-
].join("\n")
|
|
5024
|
-
});
|
|
5025
|
-
}
|
|
5026
|
-
};
|
|
5027
|
-
Object.defineProperty(InvalidInputRpcError, "code", {
|
|
5028
|
-
enumerable: true,
|
|
5029
|
-
configurable: true,
|
|
5030
|
-
writable: true,
|
|
5031
|
-
value: -32e3
|
|
5032
|
-
});
|
|
5033
|
-
var ResourceNotFoundRpcError = class _ResourceNotFoundRpcError extends RpcError {
|
|
5034
|
-
constructor(cause) {
|
|
5035
|
-
super(cause, {
|
|
5036
|
-
code: _ResourceNotFoundRpcError.code,
|
|
5037
|
-
name: "ResourceNotFoundRpcError",
|
|
5038
|
-
shortMessage: "Requested resource not found."
|
|
5039
|
-
});
|
|
5040
|
-
Object.defineProperty(this, "name", {
|
|
5041
|
-
enumerable: true,
|
|
5042
|
-
configurable: true,
|
|
5043
|
-
writable: true,
|
|
5044
|
-
value: "ResourceNotFoundRpcError"
|
|
5045
|
-
});
|
|
5046
|
-
}
|
|
5047
|
-
};
|
|
5048
|
-
Object.defineProperty(ResourceNotFoundRpcError, "code", {
|
|
5049
|
-
enumerable: true,
|
|
5050
|
-
configurable: true,
|
|
5051
|
-
writable: true,
|
|
5052
|
-
value: -32001
|
|
5053
|
-
});
|
|
5054
|
-
var ResourceUnavailableRpcError = class _ResourceUnavailableRpcError extends RpcError {
|
|
5055
|
-
constructor(cause) {
|
|
5056
|
-
super(cause, {
|
|
5057
|
-
code: _ResourceUnavailableRpcError.code,
|
|
5058
|
-
name: "ResourceUnavailableRpcError",
|
|
5059
|
-
shortMessage: "Requested resource not available."
|
|
5060
|
-
});
|
|
5061
|
-
}
|
|
5062
|
-
};
|
|
5063
|
-
Object.defineProperty(ResourceUnavailableRpcError, "code", {
|
|
5064
|
-
enumerable: true,
|
|
5065
|
-
configurable: true,
|
|
5066
|
-
writable: true,
|
|
5067
|
-
value: -32002
|
|
5068
|
-
});
|
|
5069
|
-
var TransactionRejectedRpcError = class _TransactionRejectedRpcError extends RpcError {
|
|
5070
|
-
constructor(cause) {
|
|
5071
|
-
super(cause, {
|
|
5072
|
-
code: _TransactionRejectedRpcError.code,
|
|
5073
|
-
name: "TransactionRejectedRpcError",
|
|
5074
|
-
shortMessage: "Transaction creation failed."
|
|
5075
|
-
});
|
|
5076
|
-
}
|
|
5077
|
-
};
|
|
5078
|
-
Object.defineProperty(TransactionRejectedRpcError, "code", {
|
|
5079
|
-
enumerable: true,
|
|
5080
|
-
configurable: true,
|
|
5081
|
-
writable: true,
|
|
5082
|
-
value: -32003
|
|
5083
|
-
});
|
|
5084
|
-
var MethodNotSupportedRpcError = class _MethodNotSupportedRpcError extends RpcError {
|
|
5085
|
-
constructor(cause, { method } = {}) {
|
|
5086
|
-
super(cause, {
|
|
5087
|
-
code: _MethodNotSupportedRpcError.code,
|
|
5088
|
-
name: "MethodNotSupportedRpcError",
|
|
5089
|
-
shortMessage: `Method${method ? ` "${method}"` : ""} is not supported.`
|
|
5090
|
-
});
|
|
5091
|
-
}
|
|
5092
|
-
};
|
|
5093
|
-
Object.defineProperty(MethodNotSupportedRpcError, "code", {
|
|
5094
|
-
enumerable: true,
|
|
5095
|
-
configurable: true,
|
|
5096
|
-
writable: true,
|
|
5097
|
-
value: -32004
|
|
5098
|
-
});
|
|
5099
|
-
var LimitExceededRpcError = class _LimitExceededRpcError extends RpcError {
|
|
5100
|
-
constructor(cause) {
|
|
5101
|
-
super(cause, {
|
|
5102
|
-
code: _LimitExceededRpcError.code,
|
|
5103
|
-
name: "LimitExceededRpcError",
|
|
5104
|
-
shortMessage: "Request exceeds defined limit."
|
|
5105
|
-
});
|
|
5106
|
-
}
|
|
5107
|
-
};
|
|
5108
|
-
Object.defineProperty(LimitExceededRpcError, "code", {
|
|
5109
|
-
enumerable: true,
|
|
5110
|
-
configurable: true,
|
|
5111
|
-
writable: true,
|
|
5112
|
-
value: -32005
|
|
5113
|
-
});
|
|
5114
|
-
var JsonRpcVersionUnsupportedError = class _JsonRpcVersionUnsupportedError extends RpcError {
|
|
5115
|
-
constructor(cause) {
|
|
5116
|
-
super(cause, {
|
|
5117
|
-
code: _JsonRpcVersionUnsupportedError.code,
|
|
5118
|
-
name: "JsonRpcVersionUnsupportedError",
|
|
5119
|
-
shortMessage: "Version of JSON-RPC protocol is not supported."
|
|
5120
|
-
});
|
|
5121
|
-
}
|
|
5122
|
-
};
|
|
5123
|
-
Object.defineProperty(JsonRpcVersionUnsupportedError, "code", {
|
|
5124
|
-
enumerable: true,
|
|
5125
|
-
configurable: true,
|
|
5126
|
-
writable: true,
|
|
5127
|
-
value: -32006
|
|
5128
|
-
});
|
|
5129
|
-
var UserRejectedRequestError = class _UserRejectedRequestError extends ProviderRpcError {
|
|
5130
|
-
constructor(cause) {
|
|
5131
|
-
super(cause, {
|
|
5132
|
-
code: _UserRejectedRequestError.code,
|
|
5133
|
-
name: "UserRejectedRequestError",
|
|
5134
|
-
shortMessage: "User rejected the request."
|
|
5135
|
-
});
|
|
5136
|
-
}
|
|
5137
|
-
};
|
|
5138
|
-
Object.defineProperty(UserRejectedRequestError, "code", {
|
|
5139
|
-
enumerable: true,
|
|
5140
|
-
configurable: true,
|
|
5141
|
-
writable: true,
|
|
5142
|
-
value: 4001
|
|
5143
|
-
});
|
|
5144
|
-
var UnauthorizedProviderError = class _UnauthorizedProviderError extends ProviderRpcError {
|
|
5145
|
-
constructor(cause) {
|
|
5146
|
-
super(cause, {
|
|
5147
|
-
code: _UnauthorizedProviderError.code,
|
|
5148
|
-
name: "UnauthorizedProviderError",
|
|
5149
|
-
shortMessage: "The requested method and/or account has not been authorized by the user."
|
|
5150
|
-
});
|
|
5151
|
-
}
|
|
5152
|
-
};
|
|
5153
|
-
Object.defineProperty(UnauthorizedProviderError, "code", {
|
|
5154
|
-
enumerable: true,
|
|
5155
|
-
configurable: true,
|
|
5156
|
-
writable: true,
|
|
5157
|
-
value: 4100
|
|
5158
|
-
});
|
|
5159
|
-
var UnsupportedProviderMethodError = class _UnsupportedProviderMethodError extends ProviderRpcError {
|
|
5160
|
-
constructor(cause, { method } = {}) {
|
|
5161
|
-
super(cause, {
|
|
5162
|
-
code: _UnsupportedProviderMethodError.code,
|
|
5163
|
-
name: "UnsupportedProviderMethodError",
|
|
5164
|
-
shortMessage: `The Provider does not support the requested method${method ? ` " ${method}"` : ""}.`
|
|
5165
|
-
});
|
|
5166
|
-
}
|
|
5167
|
-
};
|
|
5168
|
-
Object.defineProperty(UnsupportedProviderMethodError, "code", {
|
|
5169
|
-
enumerable: true,
|
|
5170
|
-
configurable: true,
|
|
5171
|
-
writable: true,
|
|
5172
|
-
value: 4200
|
|
5173
|
-
});
|
|
5174
|
-
var ProviderDisconnectedError = class _ProviderDisconnectedError extends ProviderRpcError {
|
|
5175
|
-
constructor(cause) {
|
|
5176
|
-
super(cause, {
|
|
5177
|
-
code: _ProviderDisconnectedError.code,
|
|
5178
|
-
name: "ProviderDisconnectedError",
|
|
5179
|
-
shortMessage: "The Provider is disconnected from all chains."
|
|
5180
|
-
});
|
|
5181
|
-
}
|
|
5182
|
-
};
|
|
5183
|
-
Object.defineProperty(ProviderDisconnectedError, "code", {
|
|
5184
|
-
enumerable: true,
|
|
5185
|
-
configurable: true,
|
|
5186
|
-
writable: true,
|
|
5187
|
-
value: 4900
|
|
5188
|
-
});
|
|
5189
|
-
var ChainDisconnectedError = class _ChainDisconnectedError extends ProviderRpcError {
|
|
5190
|
-
constructor(cause) {
|
|
5191
|
-
super(cause, {
|
|
5192
|
-
code: _ChainDisconnectedError.code,
|
|
5193
|
-
name: "ChainDisconnectedError",
|
|
5194
|
-
shortMessage: "The Provider is not connected to the requested chain."
|
|
5195
|
-
});
|
|
5196
|
-
}
|
|
5197
|
-
};
|
|
5198
|
-
Object.defineProperty(ChainDisconnectedError, "code", {
|
|
5199
|
-
enumerable: true,
|
|
5200
|
-
configurable: true,
|
|
5201
|
-
writable: true,
|
|
5202
|
-
value: 4901
|
|
5203
|
-
});
|
|
5204
|
-
var SwitchChainError = class _SwitchChainError extends ProviderRpcError {
|
|
5205
|
-
constructor(cause) {
|
|
5206
|
-
super(cause, {
|
|
5207
|
-
code: _SwitchChainError.code,
|
|
5208
|
-
name: "SwitchChainError",
|
|
5209
|
-
shortMessage: "An error occurred when attempting to switch chain."
|
|
5210
|
-
});
|
|
5211
|
-
}
|
|
5212
|
-
};
|
|
5213
|
-
Object.defineProperty(SwitchChainError, "code", {
|
|
5214
|
-
enumerable: true,
|
|
5215
|
-
configurable: true,
|
|
5216
|
-
writable: true,
|
|
5217
|
-
value: 4902
|
|
5218
|
-
});
|
|
5219
|
-
var UnsupportedNonOptionalCapabilityError = class _UnsupportedNonOptionalCapabilityError extends ProviderRpcError {
|
|
5220
|
-
constructor(cause) {
|
|
5221
|
-
super(cause, {
|
|
5222
|
-
code: _UnsupportedNonOptionalCapabilityError.code,
|
|
5223
|
-
name: "UnsupportedNonOptionalCapabilityError",
|
|
5224
|
-
shortMessage: "This Wallet does not support a capability that was not marked as optional."
|
|
5225
|
-
});
|
|
5226
|
-
}
|
|
5227
|
-
};
|
|
5228
|
-
Object.defineProperty(UnsupportedNonOptionalCapabilityError, "code", {
|
|
5229
|
-
enumerable: true,
|
|
5230
|
-
configurable: true,
|
|
5231
|
-
writable: true,
|
|
5232
|
-
value: 5700
|
|
5233
|
-
});
|
|
5234
|
-
var UnsupportedChainIdError = class _UnsupportedChainIdError extends ProviderRpcError {
|
|
5235
|
-
constructor(cause) {
|
|
5236
|
-
super(cause, {
|
|
5237
|
-
code: _UnsupportedChainIdError.code,
|
|
5238
|
-
name: "UnsupportedChainIdError",
|
|
5239
|
-
shortMessage: "This Wallet does not support the requested chain ID."
|
|
5240
|
-
});
|
|
5241
|
-
}
|
|
5242
|
-
};
|
|
5243
|
-
Object.defineProperty(UnsupportedChainIdError, "code", {
|
|
5244
|
-
enumerable: true,
|
|
5245
|
-
configurable: true,
|
|
5246
|
-
writable: true,
|
|
5247
|
-
value: 5710
|
|
5248
|
-
});
|
|
5249
|
-
var DuplicateIdError = class _DuplicateIdError extends ProviderRpcError {
|
|
5250
|
-
constructor(cause) {
|
|
5251
|
-
super(cause, {
|
|
5252
|
-
code: _DuplicateIdError.code,
|
|
5253
|
-
name: "DuplicateIdError",
|
|
5254
|
-
shortMessage: "There is already a bundle submitted with this ID."
|
|
5255
|
-
});
|
|
5256
|
-
}
|
|
5257
|
-
};
|
|
5258
|
-
Object.defineProperty(DuplicateIdError, "code", {
|
|
5259
|
-
enumerable: true,
|
|
5260
|
-
configurable: true,
|
|
5261
|
-
writable: true,
|
|
5262
|
-
value: 5720
|
|
5263
|
-
});
|
|
5264
|
-
var UnknownBundleIdError = class _UnknownBundleIdError extends ProviderRpcError {
|
|
5265
|
-
constructor(cause) {
|
|
5266
|
-
super(cause, {
|
|
5267
|
-
code: _UnknownBundleIdError.code,
|
|
5268
|
-
name: "UnknownBundleIdError",
|
|
5269
|
-
shortMessage: "This bundle id is unknown / has not been submitted"
|
|
5270
|
-
});
|
|
5271
|
-
}
|
|
5272
|
-
};
|
|
5273
|
-
Object.defineProperty(UnknownBundleIdError, "code", {
|
|
5274
|
-
enumerable: true,
|
|
5275
|
-
configurable: true,
|
|
5276
|
-
writable: true,
|
|
5277
|
-
value: 5730
|
|
5278
|
-
});
|
|
5279
|
-
var BundleTooLargeError = class _BundleTooLargeError extends ProviderRpcError {
|
|
5280
|
-
constructor(cause) {
|
|
5281
|
-
super(cause, {
|
|
5282
|
-
code: _BundleTooLargeError.code,
|
|
5283
|
-
name: "BundleTooLargeError",
|
|
5284
|
-
shortMessage: "The call bundle is too large for the Wallet to process."
|
|
5285
|
-
});
|
|
5286
|
-
}
|
|
5287
|
-
};
|
|
5288
|
-
Object.defineProperty(BundleTooLargeError, "code", {
|
|
5289
|
-
enumerable: true,
|
|
5290
|
-
configurable: true,
|
|
5291
|
-
writable: true,
|
|
5292
|
-
value: 5740
|
|
5293
|
-
});
|
|
5294
|
-
var AtomicReadyWalletRejectedUpgradeError = class _AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError {
|
|
5295
|
-
constructor(cause) {
|
|
5296
|
-
super(cause, {
|
|
5297
|
-
code: _AtomicReadyWalletRejectedUpgradeError.code,
|
|
5298
|
-
name: "AtomicReadyWalletRejectedUpgradeError",
|
|
5299
|
-
shortMessage: "The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."
|
|
5300
|
-
});
|
|
5301
|
-
}
|
|
5302
|
-
};
|
|
5303
|
-
Object.defineProperty(AtomicReadyWalletRejectedUpgradeError, "code", {
|
|
5304
|
-
enumerable: true,
|
|
5305
|
-
configurable: true,
|
|
5306
|
-
writable: true,
|
|
5307
|
-
value: 5750
|
|
5308
|
-
});
|
|
5309
|
-
var AtomicityNotSupportedError = class _AtomicityNotSupportedError extends ProviderRpcError {
|
|
5310
|
-
constructor(cause) {
|
|
5311
|
-
super(cause, {
|
|
5312
|
-
code: _AtomicityNotSupportedError.code,
|
|
5313
|
-
name: "AtomicityNotSupportedError",
|
|
5314
|
-
shortMessage: "The wallet does not support atomic execution but the request requires it."
|
|
5315
|
-
});
|
|
5316
|
-
}
|
|
5317
|
-
};
|
|
5318
|
-
Object.defineProperty(AtomicityNotSupportedError, "code", {
|
|
5319
|
-
enumerable: true,
|
|
5320
|
-
configurable: true,
|
|
5321
|
-
writable: true,
|
|
5322
|
-
value: 5760
|
|
5323
|
-
});
|
|
5324
|
-
var WalletConnectSessionSettlementError = class _WalletConnectSessionSettlementError extends ProviderRpcError {
|
|
5325
|
-
constructor(cause) {
|
|
5326
|
-
super(cause, {
|
|
5327
|
-
code: _WalletConnectSessionSettlementError.code,
|
|
5328
|
-
name: "WalletConnectSessionSettlementError",
|
|
5329
|
-
shortMessage: "WalletConnect session settlement failed."
|
|
5330
|
-
});
|
|
5331
|
-
}
|
|
5332
|
-
};
|
|
5333
|
-
Object.defineProperty(WalletConnectSessionSettlementError, "code", {
|
|
5334
|
-
enumerable: true,
|
|
5335
|
-
configurable: true,
|
|
5336
|
-
writable: true,
|
|
5337
|
-
value: 7e3
|
|
5338
|
-
});
|
|
5339
|
-
var UnknownRpcError = class extends RpcError {
|
|
5340
|
-
constructor(cause) {
|
|
5341
|
-
super(cause, {
|
|
5342
|
-
name: "UnknownRpcError",
|
|
5343
|
-
shortMessage: "An unknown RPC error occurred."
|
|
5344
|
-
});
|
|
5345
|
-
}
|
|
5346
|
-
};
|
|
5347
3498
|
|
|
5348
3499
|
// node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
5349
3500
|
function getNodeError(err, args) {
|
|
@@ -5427,28 +3578,6 @@ function extract(value_, { format }) {
|
|
|
5427
3578
|
return value;
|
|
5428
3579
|
}
|
|
5429
3580
|
|
|
5430
|
-
// node_modules/viem/_esm/utils/formatters/formatter.js
|
|
5431
|
-
function defineFormatter(type, format) {
|
|
5432
|
-
return ({ exclude, format: overrides }) => {
|
|
5433
|
-
return {
|
|
5434
|
-
exclude,
|
|
5435
|
-
format: (args, action) => {
|
|
5436
|
-
const formatted = format(args, action);
|
|
5437
|
-
if (exclude) {
|
|
5438
|
-
for (const key of exclude) {
|
|
5439
|
-
delete formatted[key];
|
|
5440
|
-
}
|
|
5441
|
-
}
|
|
5442
|
-
return {
|
|
5443
|
-
...formatted,
|
|
5444
|
-
...overrides(args, action)
|
|
5445
|
-
};
|
|
5446
|
-
},
|
|
5447
|
-
type
|
|
5448
|
-
};
|
|
5449
|
-
};
|
|
5450
|
-
}
|
|
5451
|
-
|
|
5452
3581
|
// node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
5453
3582
|
var rpcTransactionType = {
|
|
5454
3583
|
legacy: "0x0",
|
|
@@ -5467,7 +3596,7 @@ function formatTransactionRequest(request, _) {
|
|
|
5467
3596
|
rpcRequest.blobVersionedHashes = request.blobVersionedHashes;
|
|
5468
3597
|
if (typeof request.blobs !== "undefined") {
|
|
5469
3598
|
if (typeof request.blobs[0] !== "string")
|
|
5470
|
-
rpcRequest.blobs = request.blobs.map((x) =>
|
|
3599
|
+
rpcRequest.blobs = request.blobs.map((x) => bytesToHex(x));
|
|
5471
3600
|
else
|
|
5472
3601
|
rpcRequest.blobs = request.blobs;
|
|
5473
3602
|
}
|
|
@@ -5738,7 +3867,7 @@ async function call(client, args) {
|
|
|
5738
3867
|
if (isAbortError(err))
|
|
5739
3868
|
throw err;
|
|
5740
3869
|
const data2 = getRevertErrorData(err);
|
|
5741
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import('./ccip-
|
|
3870
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import('./ccip-7N4DENAM.js');
|
|
5742
3871
|
if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
|
|
5743
3872
|
return {
|
|
5744
3873
|
data: await offchainLookup2(client, { data: data2, requestOptions, to })
|
|
@@ -5795,8 +3924,8 @@ async function scheduleMulticall(client, args) {
|
|
|
5795
3924
|
id: `${client.uid}.${blockId}.${getRequestOptionsId(requestOptions)}${stateOverrideKey}`,
|
|
5796
3925
|
wait,
|
|
5797
3926
|
shouldSplitBatch(args2) {
|
|
5798
|
-
const
|
|
5799
|
-
return
|
|
3927
|
+
const size3 = args2.reduce((size4, { data: data2 }) => size4 + (data2.length - 2), 0);
|
|
3928
|
+
return size3 > batchSize * 2;
|
|
5800
3929
|
},
|
|
5801
3930
|
fn: async (requests) => {
|
|
5802
3931
|
const calls = requests.map((request) => ({
|
|
@@ -5903,7 +4032,7 @@ var OffchainLookupResponseMalformedError = class extends BaseError3 {
|
|
|
5903
4032
|
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
5904
4033
|
metaMessages: [
|
|
5905
4034
|
`Gateway URL: ${getUrl(url)}`,
|
|
5906
|
-
`Response: ${
|
|
4035
|
+
`Response: ${stringify(result)}`
|
|
5907
4036
|
],
|
|
5908
4037
|
name: "OffchainLookupResponseMalformedError"
|
|
5909
4038
|
});
|
|
@@ -5924,7 +4053,7 @@ var OffchainLookupSenderMismatchError = class extends BaseError3 {
|
|
|
5924
4053
|
// node_modules/viem/_esm/utils/abi/decodeFunctionData.js
|
|
5925
4054
|
function decodeFunctionData(parameters) {
|
|
5926
4055
|
const { abi, data } = parameters;
|
|
5927
|
-
const signature =
|
|
4056
|
+
const signature = slice(data, 0, 4);
|
|
5928
4057
|
const description = abi.find((x) => x.type === "function" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
5929
4058
|
if (!description)
|
|
5930
4059
|
throw new AbiFunctionSignatureNotFoundError(signature, {
|
|
@@ -5932,7 +4061,7 @@ function decodeFunctionData(parameters) {
|
|
|
5932
4061
|
});
|
|
5933
4062
|
return {
|
|
5934
4063
|
functionName: description.name,
|
|
5935
|
-
args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs,
|
|
4064
|
+
args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice(data, 4)) : void 0
|
|
5936
4065
|
};
|
|
5937
4066
|
}
|
|
5938
4067
|
|
|
@@ -6069,7 +4198,7 @@ async function offchainLookup(client, { blockNumber, blockTag, data, requestOpti
|
|
|
6069
4198
|
const { data: data_ } = await call(client, {
|
|
6070
4199
|
blockNumber,
|
|
6071
4200
|
blockTag,
|
|
6072
|
-
data:
|
|
4201
|
+
data: concat([
|
|
6073
4202
|
callbackSelector,
|
|
6074
4203
|
encodeAbiParameters([{ type: "bytes" }, { type: "bytes" }], [result, extraData])
|
|
6075
4204
|
]),
|
|
@@ -6117,7 +4246,7 @@ async function ccipRequest({ data, requestOptions, sender, urls }) {
|
|
|
6117
4246
|
if (!response.ok) {
|
|
6118
4247
|
error = new HttpRequestError({
|
|
6119
4248
|
body,
|
|
6120
|
-
details: result?.error ?
|
|
4249
|
+
details: result?.error ? stringify(result.error) : response.statusText,
|
|
6121
4250
|
headers: response.headers,
|
|
6122
4251
|
status: response.status,
|
|
6123
4252
|
url
|
|
@@ -6146,10 +4275,5 @@ async function ccipRequest({ data, requestOptions, sender, urls }) {
|
|
|
6146
4275
|
}
|
|
6147
4276
|
throw error;
|
|
6148
4277
|
}
|
|
6149
|
-
/*! Bundled license information:
|
|
6150
|
-
|
|
6151
|
-
@noble/curves/esm/abstract/utils.js:
|
|
6152
|
-
(*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
6153
|
-
*/
|
|
6154
4278
|
|
|
6155
|
-
export {
|
|
4279
|
+
export { BaseError3 as BaseError, BytesSizeMismatchError, FeeCapTooHighError, InvalidAddressError, InvalidChainIdError, InvalidLegacyVError, InvalidSerializableTransactionError, InvalidStorageKeySizeError, TipAboveFeeCapError, bytesRegex2 as bytesRegex, bytesToHex, ccipRequest, checksumAddress, concat, concatHex, createCursor, encodeAbiParameters, getAddress, hexToBigInt, hexToBytes, hexToNumber, integerRegex2 as integerRegex, isAddress, isHex, keccak256, maxUint256, numberToHex, offchainLookup, offchainLookupAbiItem, offchainLookupSignature, size2 as size, slice, stringToHex, stringify, toBytes2 as toBytes, toHex, trim2 as trim };
|