@latticexyz/world-module-erc20 2.2.22-d8eef923b761a5efe83ddf9f5b0a1460b5ca4db9 → 2.2.22-ee974a22927644f43e02e8ba221f436c023824f2
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/{_esm-H47RQ4ED.js → _esm-4QBXERIC.js} +136 -131
- package/dist/_esm-4QBXERIC.js.map +1 -0
- package/dist/{ccip-VIBPEQNI.js → ccip-2WG2FVCT.js} +3 -3
- package/dist/{chunk-XE443CMG.js → chunk-72CUSHOS.js} +733 -342
- package/dist/chunk-72CUSHOS.js.map +1 -0
- package/dist/chunk-Y6LDJZ7L.js +408 -0
- package/dist/chunk-Y6LDJZ7L.js.map +1 -0
- package/dist/internal.js +2 -2
- package/dist/{secp256k1-QT34R5PW.js → secp256k1-QCGY4Z6Q.js} +405 -624
- package/dist/secp256k1-QCGY4Z6Q.js.map +1 -0
- package/package.json +8 -8
- package/dist/_esm-H47RQ4ED.js.map +0 -1
- package/dist/chunk-M5FHJZR5.js +0 -139
- package/dist/chunk-M5FHJZR5.js.map +0 -1
- package/dist/chunk-XE443CMG.js.map +0 -1
- package/dist/secp256k1-QT34R5PW.js.map +0 -1
- /package/dist/{ccip-VIBPEQNI.js.map → ccip-2WG2FVCT.js.map} +0 -0
|
@@ -4,13 +4,17 @@ import {
|
|
|
4
4
|
aexists,
|
|
5
5
|
anumber,
|
|
6
6
|
aoutput,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
clean,
|
|
8
|
+
createHasher,
|
|
9
|
+
rotlBH,
|
|
10
|
+
rotlBL,
|
|
11
|
+
rotlSH,
|
|
12
|
+
rotlSL,
|
|
13
|
+
split,
|
|
14
|
+
swap32IfBE,
|
|
9
15
|
toBytes,
|
|
10
|
-
u32
|
|
11
|
-
|
|
12
|
-
wrapXOFConstructorWithOpts
|
|
13
|
-
} from "./chunk-M5FHJZR5.js";
|
|
16
|
+
u32
|
|
17
|
+
} from "./chunk-Y6LDJZ7L.js";
|
|
14
18
|
|
|
15
19
|
// ../../node_modules/.pnpm/abitype@1.0.8_typescript@5.4.2_zod@3.23.8/node_modules/abitype/dist/esm/version.js
|
|
16
20
|
var version = "1.0.8";
|
|
@@ -19,12 +23,12 @@ var version = "1.0.8";
|
|
|
19
23
|
var BaseError = class _BaseError extends Error {
|
|
20
24
|
constructor(shortMessage, args = {}) {
|
|
21
25
|
const details = args.cause instanceof _BaseError ? args.cause.details : args.cause?.message ? args.cause.message : args.details;
|
|
22
|
-
const
|
|
26
|
+
const docsPath6 = args.cause instanceof _BaseError ? args.cause.docsPath || args.docsPath : args.docsPath;
|
|
23
27
|
const message = [
|
|
24
28
|
shortMessage || "An error occurred.",
|
|
25
29
|
"",
|
|
26
30
|
...args.metaMessages ? [...args.metaMessages, ""] : [],
|
|
27
|
-
...
|
|
31
|
+
...docsPath6 ? [`Docs: https://abitype.dev${docsPath6}`] : [],
|
|
28
32
|
...details ? [`Details: ${details}`] : [],
|
|
29
33
|
`Version: abitype@${version}`
|
|
30
34
|
].join("\n");
|
|
@@ -62,7 +66,7 @@ var BaseError = class _BaseError extends Error {
|
|
|
62
66
|
if (args.cause)
|
|
63
67
|
this.cause = args.cause;
|
|
64
68
|
this.details = details;
|
|
65
|
-
this.docsPath =
|
|
69
|
+
this.docsPath = docsPath6;
|
|
66
70
|
this.metaMessages = args.metaMessages;
|
|
67
71
|
this.shortMessage = shortMessage;
|
|
68
72
|
}
|
|
@@ -722,14 +726,226 @@ function parseAbi(signatures) {
|
|
|
722
726
|
return abi;
|
|
723
727
|
}
|
|
724
728
|
|
|
725
|
-
// ../../node_modules/.pnpm/
|
|
729
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/version.js
|
|
730
|
+
var version2 = "0.1.1";
|
|
731
|
+
|
|
732
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/internal/errors.js
|
|
733
|
+
function getVersion() {
|
|
734
|
+
return version2;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/Errors.js
|
|
738
|
+
var BaseError2 = class _BaseError extends Error {
|
|
739
|
+
constructor(shortMessage, options = {}) {
|
|
740
|
+
const details = (() => {
|
|
741
|
+
if (options.cause instanceof _BaseError) {
|
|
742
|
+
if (options.cause.details)
|
|
743
|
+
return options.cause.details;
|
|
744
|
+
if (options.cause.shortMessage)
|
|
745
|
+
return options.cause.shortMessage;
|
|
746
|
+
}
|
|
747
|
+
if (options.cause && "details" in options.cause && typeof options.cause.details === "string")
|
|
748
|
+
return options.cause.details;
|
|
749
|
+
if (options.cause?.message)
|
|
750
|
+
return options.cause.message;
|
|
751
|
+
return options.details;
|
|
752
|
+
})();
|
|
753
|
+
const docsPath6 = (() => {
|
|
754
|
+
if (options.cause instanceof _BaseError)
|
|
755
|
+
return options.cause.docsPath || options.docsPath;
|
|
756
|
+
return options.docsPath;
|
|
757
|
+
})();
|
|
758
|
+
const docsBaseUrl = "https://oxlib.sh";
|
|
759
|
+
const docs = `${docsBaseUrl}${docsPath6 ?? ""}`;
|
|
760
|
+
const message = [
|
|
761
|
+
shortMessage || "An error occurred.",
|
|
762
|
+
...options.metaMessages ? ["", ...options.metaMessages] : [],
|
|
763
|
+
...details || docsPath6 ? [
|
|
764
|
+
"",
|
|
765
|
+
details ? `Details: ${details}` : void 0,
|
|
766
|
+
docsPath6 ? `See: ${docs}` : void 0
|
|
767
|
+
] : []
|
|
768
|
+
].filter((x) => typeof x === "string").join("\n");
|
|
769
|
+
super(message, options.cause ? { cause: options.cause } : void 0);
|
|
770
|
+
Object.defineProperty(this, "details", {
|
|
771
|
+
enumerable: true,
|
|
772
|
+
configurable: true,
|
|
773
|
+
writable: true,
|
|
774
|
+
value: void 0
|
|
775
|
+
});
|
|
776
|
+
Object.defineProperty(this, "docs", {
|
|
777
|
+
enumerable: true,
|
|
778
|
+
configurable: true,
|
|
779
|
+
writable: true,
|
|
780
|
+
value: void 0
|
|
781
|
+
});
|
|
782
|
+
Object.defineProperty(this, "docsPath", {
|
|
783
|
+
enumerable: true,
|
|
784
|
+
configurable: true,
|
|
785
|
+
writable: true,
|
|
786
|
+
value: void 0
|
|
787
|
+
});
|
|
788
|
+
Object.defineProperty(this, "shortMessage", {
|
|
789
|
+
enumerable: true,
|
|
790
|
+
configurable: true,
|
|
791
|
+
writable: true,
|
|
792
|
+
value: void 0
|
|
793
|
+
});
|
|
794
|
+
Object.defineProperty(this, "cause", {
|
|
795
|
+
enumerable: true,
|
|
796
|
+
configurable: true,
|
|
797
|
+
writable: true,
|
|
798
|
+
value: void 0
|
|
799
|
+
});
|
|
800
|
+
Object.defineProperty(this, "name", {
|
|
801
|
+
enumerable: true,
|
|
802
|
+
configurable: true,
|
|
803
|
+
writable: true,
|
|
804
|
+
value: "BaseError"
|
|
805
|
+
});
|
|
806
|
+
Object.defineProperty(this, "version", {
|
|
807
|
+
enumerable: true,
|
|
808
|
+
configurable: true,
|
|
809
|
+
writable: true,
|
|
810
|
+
value: `ox@${getVersion()}`
|
|
811
|
+
});
|
|
812
|
+
this.cause = options.cause;
|
|
813
|
+
this.details = details;
|
|
814
|
+
this.docs = docs;
|
|
815
|
+
this.docsPath = docsPath6;
|
|
816
|
+
this.shortMessage = shortMessage;
|
|
817
|
+
}
|
|
818
|
+
walk(fn) {
|
|
819
|
+
return walk(this, fn);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
function walk(err, fn) {
|
|
823
|
+
if (fn?.(err))
|
|
824
|
+
return err;
|
|
825
|
+
if (err && typeof err === "object" && "cause" in err && err.cause)
|
|
826
|
+
return walk(err.cause, fn);
|
|
827
|
+
return fn ? null : err;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/internal/hex.js
|
|
831
|
+
function pad(hex_, options = {}) {
|
|
832
|
+
const { dir, size: size3 = 32 } = options;
|
|
833
|
+
if (size3 === 0)
|
|
834
|
+
return hex_;
|
|
835
|
+
const hex = hex_.replace("0x", "");
|
|
836
|
+
if (hex.length > size3 * 2)
|
|
837
|
+
throw new SizeExceedsPaddingSizeError({
|
|
838
|
+
size: Math.ceil(hex.length / 2),
|
|
839
|
+
targetSize: size3,
|
|
840
|
+
type: "Hex"
|
|
841
|
+
});
|
|
842
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/Hex.js
|
|
846
|
+
function fromNumber(value, options = {}) {
|
|
847
|
+
const { signed, size: size3 } = options;
|
|
848
|
+
const value_ = BigInt(value);
|
|
849
|
+
let maxValue;
|
|
850
|
+
if (size3) {
|
|
851
|
+
if (signed)
|
|
852
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
853
|
+
else
|
|
854
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
855
|
+
} else if (typeof value === "number") {
|
|
856
|
+
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
857
|
+
}
|
|
858
|
+
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
859
|
+
if (maxValue && value_ > maxValue || value_ < minValue) {
|
|
860
|
+
const suffix = typeof value === "bigint" ? "n" : "";
|
|
861
|
+
throw new IntegerOutOfRangeError({
|
|
862
|
+
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
863
|
+
min: `${minValue}${suffix}`,
|
|
864
|
+
signed,
|
|
865
|
+
size: size3,
|
|
866
|
+
value: `${value}${suffix}`
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
const stringValue = (signed && value_ < 0 ? (1n << BigInt(size3 * 8)) + BigInt(value_) : value_).toString(16);
|
|
870
|
+
const hex = `0x${stringValue}`;
|
|
871
|
+
if (size3)
|
|
872
|
+
return padLeft(hex, size3);
|
|
873
|
+
return hex;
|
|
874
|
+
}
|
|
875
|
+
function padLeft(value, size3) {
|
|
876
|
+
return pad(value, { dir: "left", size: size3 });
|
|
877
|
+
}
|
|
878
|
+
var IntegerOutOfRangeError = class extends BaseError2 {
|
|
879
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
880
|
+
super(`Number \`${value}\` is not in safe${size3 ? ` ${size3 * 8}-bit` : ""}${signed ? " signed" : " unsigned"} integer range ${max ? `(\`${min}\` to \`${max}\`)` : `(above \`${min}\`)`}`);
|
|
881
|
+
Object.defineProperty(this, "name", {
|
|
882
|
+
enumerable: true,
|
|
883
|
+
configurable: true,
|
|
884
|
+
writable: true,
|
|
885
|
+
value: "Hex.IntegerOutOfRangeError"
|
|
886
|
+
});
|
|
887
|
+
}
|
|
888
|
+
};
|
|
889
|
+
var SizeExceedsPaddingSizeError = class extends BaseError2 {
|
|
890
|
+
constructor({ size: size3, targetSize, type }) {
|
|
891
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (\`${size3}\`) exceeds padding size (\`${targetSize}\`).`);
|
|
892
|
+
Object.defineProperty(this, "name", {
|
|
893
|
+
enumerable: true,
|
|
894
|
+
configurable: true,
|
|
895
|
+
writable: true,
|
|
896
|
+
value: "Hex.SizeExceedsPaddingSizeError"
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
};
|
|
900
|
+
|
|
901
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/Withdrawal.js
|
|
902
|
+
function toRpc(withdrawal) {
|
|
903
|
+
return {
|
|
904
|
+
address: withdrawal.address,
|
|
905
|
+
amount: fromNumber(withdrawal.amount),
|
|
906
|
+
index: fromNumber(withdrawal.index),
|
|
907
|
+
validatorIndex: fromNumber(withdrawal.validatorIndex)
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
// ../../node_modules/.pnpm/ox@0.7.1_typescript@5.4.2_zod@3.23.8/node_modules/ox/_esm/core/BlockOverrides.js
|
|
912
|
+
function toRpc2(blockOverrides) {
|
|
913
|
+
return {
|
|
914
|
+
...typeof blockOverrides.baseFeePerGas === "bigint" && {
|
|
915
|
+
baseFeePerGas: fromNumber(blockOverrides.baseFeePerGas)
|
|
916
|
+
},
|
|
917
|
+
...typeof blockOverrides.blobBaseFee === "bigint" && {
|
|
918
|
+
blobBaseFee: fromNumber(blockOverrides.blobBaseFee)
|
|
919
|
+
},
|
|
920
|
+
...typeof blockOverrides.feeRecipient === "string" && {
|
|
921
|
+
feeRecipient: blockOverrides.feeRecipient
|
|
922
|
+
},
|
|
923
|
+
...typeof blockOverrides.gasLimit === "bigint" && {
|
|
924
|
+
gasLimit: fromNumber(blockOverrides.gasLimit)
|
|
925
|
+
},
|
|
926
|
+
...typeof blockOverrides.number === "bigint" && {
|
|
927
|
+
number: fromNumber(blockOverrides.number)
|
|
928
|
+
},
|
|
929
|
+
...typeof blockOverrides.prevRandao === "bigint" && {
|
|
930
|
+
prevRandao: fromNumber(blockOverrides.prevRandao)
|
|
931
|
+
},
|
|
932
|
+
...typeof blockOverrides.time === "bigint" && {
|
|
933
|
+
time: fromNumber(blockOverrides.time)
|
|
934
|
+
},
|
|
935
|
+
...blockOverrides.withdrawals && {
|
|
936
|
+
withdrawals: blockOverrides.withdrawals.map(toRpc)
|
|
937
|
+
}
|
|
938
|
+
};
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/accounts/utils/parseAccount.js
|
|
726
942
|
function parseAccount(account) {
|
|
727
943
|
if (typeof account === "string")
|
|
728
944
|
return { address: account, type: "json-rpc" };
|
|
729
945
|
return account;
|
|
730
946
|
}
|
|
731
947
|
|
|
732
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
948
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/abis.js
|
|
733
949
|
var multicall3Abi = [
|
|
734
950
|
{
|
|
735
951
|
inputs: [
|
|
@@ -773,6 +989,57 @@ var multicall3Abi = [
|
|
|
773
989
|
type: "function"
|
|
774
990
|
}
|
|
775
991
|
];
|
|
992
|
+
var batchGatewayAbi = [
|
|
993
|
+
{
|
|
994
|
+
name: "query",
|
|
995
|
+
type: "function",
|
|
996
|
+
stateMutability: "view",
|
|
997
|
+
inputs: [
|
|
998
|
+
{
|
|
999
|
+
type: "tuple[]",
|
|
1000
|
+
name: "queries",
|
|
1001
|
+
components: [
|
|
1002
|
+
{
|
|
1003
|
+
type: "address",
|
|
1004
|
+
name: "sender"
|
|
1005
|
+
},
|
|
1006
|
+
{
|
|
1007
|
+
type: "string[]",
|
|
1008
|
+
name: "urls"
|
|
1009
|
+
},
|
|
1010
|
+
{
|
|
1011
|
+
type: "bytes",
|
|
1012
|
+
name: "data"
|
|
1013
|
+
}
|
|
1014
|
+
]
|
|
1015
|
+
}
|
|
1016
|
+
],
|
|
1017
|
+
outputs: [
|
|
1018
|
+
{
|
|
1019
|
+
type: "bool[]",
|
|
1020
|
+
name: "failures"
|
|
1021
|
+
},
|
|
1022
|
+
{
|
|
1023
|
+
type: "bytes[]",
|
|
1024
|
+
name: "responses"
|
|
1025
|
+
}
|
|
1026
|
+
]
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
name: "HttpError",
|
|
1030
|
+
type: "error",
|
|
1031
|
+
inputs: [
|
|
1032
|
+
{
|
|
1033
|
+
type: "uint16",
|
|
1034
|
+
name: "status"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
type: "string",
|
|
1038
|
+
name: "message"
|
|
1039
|
+
}
|
|
1040
|
+
]
|
|
1041
|
+
}
|
|
1042
|
+
];
|
|
776
1043
|
var universalResolverErrors = [
|
|
777
1044
|
{
|
|
778
1045
|
inputs: [],
|
|
@@ -881,22 +1148,22 @@ var universalResolverReverseAbi = [
|
|
|
881
1148
|
}
|
|
882
1149
|
];
|
|
883
1150
|
|
|
884
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1151
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/contract.js
|
|
885
1152
|
var aggregate3Signature = "0x82ad56cb";
|
|
886
1153
|
|
|
887
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1154
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/contracts.js
|
|
888
1155
|
var deploylessCallViaBytecodeBytecode = "0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe";
|
|
889
1156
|
var deploylessCallViaFactoryBytecode = "0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe";
|
|
890
1157
|
|
|
891
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
892
|
-
var
|
|
1158
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/version.js
|
|
1159
|
+
var version3 = "2.30.5";
|
|
893
1160
|
|
|
894
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1161
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/base.js
|
|
895
1162
|
var errorConfig = {
|
|
896
|
-
getDocsUrl: ({ docsBaseUrl, docsPath:
|
|
897
|
-
version: `viem@${
|
|
1163
|
+
getDocsUrl: ({ docsBaseUrl, docsPath: docsPath6 = "", docsSlug }) => docsPath6 ? `${docsBaseUrl ?? "https://viem.sh"}${docsPath6}${docsSlug ? `#${docsSlug}` : ""}` : void 0,
|
|
1164
|
+
version: `viem@${version3}`
|
|
898
1165
|
};
|
|
899
|
-
var
|
|
1166
|
+
var BaseError3 = class _BaseError extends Error {
|
|
900
1167
|
constructor(shortMessage, args = {}) {
|
|
901
1168
|
const details = (() => {
|
|
902
1169
|
if (args.cause instanceof _BaseError)
|
|
@@ -905,12 +1172,12 @@ var BaseError2 = class _BaseError extends Error {
|
|
|
905
1172
|
return args.cause.message;
|
|
906
1173
|
return args.details;
|
|
907
1174
|
})();
|
|
908
|
-
const
|
|
1175
|
+
const docsPath6 = (() => {
|
|
909
1176
|
if (args.cause instanceof _BaseError)
|
|
910
1177
|
return args.cause.docsPath || args.docsPath;
|
|
911
1178
|
return args.docsPath;
|
|
912
1179
|
})();
|
|
913
|
-
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath:
|
|
1180
|
+
const docsUrl = errorConfig.getDocsUrl?.({ ...args, docsPath: docsPath6 });
|
|
914
1181
|
const message = [
|
|
915
1182
|
shortMessage || "An error occurred.",
|
|
916
1183
|
"",
|
|
@@ -957,26 +1224,26 @@ var BaseError2 = class _BaseError extends Error {
|
|
|
957
1224
|
value: "BaseError"
|
|
958
1225
|
});
|
|
959
1226
|
this.details = details;
|
|
960
|
-
this.docsPath =
|
|
1227
|
+
this.docsPath = docsPath6;
|
|
961
1228
|
this.metaMessages = args.metaMessages;
|
|
962
1229
|
this.name = args.name ?? this.name;
|
|
963
1230
|
this.shortMessage = shortMessage;
|
|
964
|
-
this.version =
|
|
1231
|
+
this.version = version3;
|
|
965
1232
|
}
|
|
966
1233
|
walk(fn) {
|
|
967
|
-
return
|
|
1234
|
+
return walk2(this, fn);
|
|
968
1235
|
}
|
|
969
1236
|
};
|
|
970
|
-
function
|
|
1237
|
+
function walk2(err, fn) {
|
|
971
1238
|
if (fn?.(err))
|
|
972
1239
|
return err;
|
|
973
1240
|
if (err && typeof err === "object" && "cause" in err && err.cause !== void 0)
|
|
974
|
-
return
|
|
1241
|
+
return walk2(err.cause, fn);
|
|
975
1242
|
return fn ? null : err;
|
|
976
1243
|
}
|
|
977
1244
|
|
|
978
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
979
|
-
var ChainDoesNotSupportContract = class extends
|
|
1245
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/chain.js
|
|
1246
|
+
var ChainDoesNotSupportContract = class extends BaseError3 {
|
|
980
1247
|
constructor({ blockNumber, chain, contract }) {
|
|
981
1248
|
super(`Chain "${chain.name}" does not support contract "${contract.name}".`, {
|
|
982
1249
|
metaMessages: [
|
|
@@ -991,7 +1258,7 @@ var ChainDoesNotSupportContract = class extends BaseError2 {
|
|
|
991
1258
|
});
|
|
992
1259
|
}
|
|
993
1260
|
};
|
|
994
|
-
var ClientChainNotConfiguredError = class extends
|
|
1261
|
+
var ClientChainNotConfiguredError = class extends BaseError3 {
|
|
995
1262
|
constructor() {
|
|
996
1263
|
super("No chain was provided to the Client.", {
|
|
997
1264
|
name: "ClientChainNotConfiguredError"
|
|
@@ -999,7 +1266,7 @@ var ClientChainNotConfiguredError = class extends BaseError2 {
|
|
|
999
1266
|
}
|
|
1000
1267
|
};
|
|
1001
1268
|
|
|
1002
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1269
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/solidity.js
|
|
1003
1270
|
var solidityError = {
|
|
1004
1271
|
inputs: [
|
|
1005
1272
|
{
|
|
@@ -1021,7 +1288,7 @@ var solidityPanic = {
|
|
|
1021
1288
|
type: "error"
|
|
1022
1289
|
};
|
|
1023
1290
|
|
|
1024
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1291
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/formatAbiItem.js
|
|
1025
1292
|
function formatAbiItem2(abiItem, { includeName = false } = {}) {
|
|
1026
1293
|
if (abiItem.type !== "function" && abiItem.type !== "event" && abiItem.type !== "error")
|
|
1027
1294
|
throw new InvalidDefinitionTypeError(abiItem.type);
|
|
@@ -1039,7 +1306,7 @@ function formatAbiParam(param, { includeName }) {
|
|
|
1039
1306
|
return param.type + (includeName && param.name ? ` ${param.name}` : "");
|
|
1040
1307
|
}
|
|
1041
1308
|
|
|
1042
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1309
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/isHex.js
|
|
1043
1310
|
function isHex(value, { strict = true } = {}) {
|
|
1044
1311
|
if (!value)
|
|
1045
1312
|
return false;
|
|
@@ -1048,42 +1315,42 @@ function isHex(value, { strict = true } = {}) {
|
|
|
1048
1315
|
return strict ? /^0x[0-9a-fA-F]*$/.test(value) : value.startsWith("0x");
|
|
1049
1316
|
}
|
|
1050
1317
|
|
|
1051
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1052
|
-
function
|
|
1318
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/size.js
|
|
1319
|
+
function size2(value) {
|
|
1053
1320
|
if (isHex(value, { strict: false }))
|
|
1054
1321
|
return Math.ceil((value.length - 2) / 2);
|
|
1055
1322
|
return value.length;
|
|
1056
1323
|
}
|
|
1057
1324
|
|
|
1058
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1059
|
-
var AbiConstructorNotFoundError = class extends
|
|
1060
|
-
constructor({ docsPath:
|
|
1325
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/abi.js
|
|
1326
|
+
var AbiConstructorNotFoundError = class extends BaseError3 {
|
|
1327
|
+
constructor({ docsPath: docsPath6 }) {
|
|
1061
1328
|
super([
|
|
1062
1329
|
"A constructor was not found on the ABI.",
|
|
1063
1330
|
"Make sure you are using the correct ABI and that the constructor exists on it."
|
|
1064
1331
|
].join("\n"), {
|
|
1065
|
-
docsPath:
|
|
1332
|
+
docsPath: docsPath6,
|
|
1066
1333
|
name: "AbiConstructorNotFoundError"
|
|
1067
1334
|
});
|
|
1068
1335
|
}
|
|
1069
1336
|
};
|
|
1070
|
-
var AbiConstructorParamsNotFoundError = class extends
|
|
1071
|
-
constructor({ docsPath:
|
|
1337
|
+
var AbiConstructorParamsNotFoundError = class extends BaseError3 {
|
|
1338
|
+
constructor({ docsPath: docsPath6 }) {
|
|
1072
1339
|
super([
|
|
1073
1340
|
"Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.",
|
|
1074
1341
|
"Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."
|
|
1075
1342
|
].join("\n"), {
|
|
1076
|
-
docsPath:
|
|
1343
|
+
docsPath: docsPath6,
|
|
1077
1344
|
name: "AbiConstructorParamsNotFoundError"
|
|
1078
1345
|
});
|
|
1079
1346
|
}
|
|
1080
1347
|
};
|
|
1081
|
-
var AbiDecodingDataSizeTooSmallError = class extends
|
|
1082
|
-
constructor({ data, params, size:
|
|
1083
|
-
super([`Data size of ${
|
|
1348
|
+
var AbiDecodingDataSizeTooSmallError = class extends BaseError3 {
|
|
1349
|
+
constructor({ data, params, size: size3 }) {
|
|
1350
|
+
super([`Data size of ${size3} bytes is too small for given parameters.`].join("\n"), {
|
|
1084
1351
|
metaMessages: [
|
|
1085
1352
|
`Params: (${formatAbiParams(params, { includeName: true })})`,
|
|
1086
|
-
`Data: ${data} (${
|
|
1353
|
+
`Data: ${data} (${size3} bytes)`
|
|
1087
1354
|
],
|
|
1088
1355
|
name: "AbiDecodingDataSizeTooSmallError"
|
|
1089
1356
|
});
|
|
@@ -1107,17 +1374,17 @@ var AbiDecodingDataSizeTooSmallError = class extends BaseError2 {
|
|
|
1107
1374
|
});
|
|
1108
1375
|
this.data = data;
|
|
1109
1376
|
this.params = params;
|
|
1110
|
-
this.size =
|
|
1377
|
+
this.size = size3;
|
|
1111
1378
|
}
|
|
1112
1379
|
};
|
|
1113
|
-
var AbiDecodingZeroDataError = class extends
|
|
1380
|
+
var AbiDecodingZeroDataError = class extends BaseError3 {
|
|
1114
1381
|
constructor() {
|
|
1115
1382
|
super('Cannot decode zero data ("0x") with ABI parameters.', {
|
|
1116
1383
|
name: "AbiDecodingZeroDataError"
|
|
1117
1384
|
});
|
|
1118
1385
|
}
|
|
1119
1386
|
};
|
|
1120
|
-
var AbiEncodingArrayLengthMismatchError = class extends
|
|
1387
|
+
var AbiEncodingArrayLengthMismatchError = class extends BaseError3 {
|
|
1121
1388
|
constructor({ expectedLength, givenLength, type }) {
|
|
1122
1389
|
super([
|
|
1123
1390
|
`ABI encoding array length mismatch for type ${type}.`,
|
|
@@ -1126,12 +1393,12 @@ var AbiEncodingArrayLengthMismatchError = class extends BaseError2 {
|
|
|
1126
1393
|
].join("\n"), { name: "AbiEncodingArrayLengthMismatchError" });
|
|
1127
1394
|
}
|
|
1128
1395
|
};
|
|
1129
|
-
var AbiEncodingBytesSizeMismatchError = class extends
|
|
1396
|
+
var AbiEncodingBytesSizeMismatchError = class extends BaseError3 {
|
|
1130
1397
|
constructor({ expectedSize, value }) {
|
|
1131
|
-
super(`Size of bytes "${value}" (bytes${
|
|
1398
|
+
super(`Size of bytes "${value}" (bytes${size2(value)}) does not match expected size (bytes${expectedSize}).`, { name: "AbiEncodingBytesSizeMismatchError" });
|
|
1132
1399
|
}
|
|
1133
1400
|
};
|
|
1134
|
-
var AbiEncodingLengthMismatchError = class extends
|
|
1401
|
+
var AbiEncodingLengthMismatchError = class extends BaseError3 {
|
|
1135
1402
|
constructor({ expectedLength, givenLength }) {
|
|
1136
1403
|
super([
|
|
1137
1404
|
"ABI encoding params/values length mismatch.",
|
|
@@ -1140,14 +1407,37 @@ var AbiEncodingLengthMismatchError = class extends BaseError2 {
|
|
|
1140
1407
|
].join("\n"), { name: "AbiEncodingLengthMismatchError" });
|
|
1141
1408
|
}
|
|
1142
1409
|
};
|
|
1143
|
-
var
|
|
1144
|
-
constructor(
|
|
1410
|
+
var AbiErrorInputsNotFoundError = class extends BaseError3 {
|
|
1411
|
+
constructor(errorName, { docsPath: docsPath6 }) {
|
|
1412
|
+
super([
|
|
1413
|
+
`Arguments (\`args\`) were provided to "${errorName}", but "${errorName}" on the ABI does not contain any parameters (\`inputs\`).`,
|
|
1414
|
+
"Cannot encode error result without knowing what the parameter types are.",
|
|
1415
|
+
"Make sure you are using the correct ABI and that the inputs exist on it."
|
|
1416
|
+
].join("\n"), {
|
|
1417
|
+
docsPath: docsPath6,
|
|
1418
|
+
name: "AbiErrorInputsNotFoundError"
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
};
|
|
1422
|
+
var AbiErrorNotFoundError = class extends BaseError3 {
|
|
1423
|
+
constructor(errorName, { docsPath: docsPath6 } = {}) {
|
|
1424
|
+
super([
|
|
1425
|
+
`Error ${errorName ? `"${errorName}" ` : ""}not found on ABI.`,
|
|
1426
|
+
"Make sure you are using the correct ABI and that the error exists on it."
|
|
1427
|
+
].join("\n"), {
|
|
1428
|
+
docsPath: docsPath6,
|
|
1429
|
+
name: "AbiErrorNotFoundError"
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
var AbiErrorSignatureNotFoundError = class extends BaseError3 {
|
|
1434
|
+
constructor(signature, { docsPath: docsPath6 }) {
|
|
1145
1435
|
super([
|
|
1146
1436
|
`Encoded error signature "${signature}" not found on ABI.`,
|
|
1147
1437
|
"Make sure you are using the correct ABI and that the error exists on it.",
|
|
1148
1438
|
`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
1149
1439
|
].join("\n"), {
|
|
1150
|
-
docsPath:
|
|
1440
|
+
docsPath: docsPath6,
|
|
1151
1441
|
name: "AbiErrorSignatureNotFoundError"
|
|
1152
1442
|
});
|
|
1153
1443
|
Object.defineProperty(this, "signature", {
|
|
@@ -1159,30 +1449,42 @@ var AbiErrorSignatureNotFoundError = class extends BaseError2 {
|
|
|
1159
1449
|
this.signature = signature;
|
|
1160
1450
|
}
|
|
1161
1451
|
};
|
|
1162
|
-
var AbiFunctionNotFoundError = class extends
|
|
1163
|
-
constructor(functionName, { docsPath:
|
|
1452
|
+
var AbiFunctionNotFoundError = class extends BaseError3 {
|
|
1453
|
+
constructor(functionName, { docsPath: docsPath6 } = {}) {
|
|
1164
1454
|
super([
|
|
1165
1455
|
`Function ${functionName ? `"${functionName}" ` : ""}not found on ABI.`,
|
|
1166
1456
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1167
1457
|
].join("\n"), {
|
|
1168
|
-
docsPath:
|
|
1458
|
+
docsPath: docsPath6,
|
|
1169
1459
|
name: "AbiFunctionNotFoundError"
|
|
1170
1460
|
});
|
|
1171
1461
|
}
|
|
1172
1462
|
};
|
|
1173
|
-
var AbiFunctionOutputsNotFoundError = class extends
|
|
1174
|
-
constructor(functionName, { docsPath:
|
|
1463
|
+
var AbiFunctionOutputsNotFoundError = class extends BaseError3 {
|
|
1464
|
+
constructor(functionName, { docsPath: docsPath6 }) {
|
|
1175
1465
|
super([
|
|
1176
1466
|
`Function "${functionName}" does not contain any \`outputs\` on ABI.`,
|
|
1177
1467
|
"Cannot decode function result without knowing what the parameter types are.",
|
|
1178
1468
|
"Make sure you are using the correct ABI and that the function exists on it."
|
|
1179
1469
|
].join("\n"), {
|
|
1180
|
-
docsPath:
|
|
1470
|
+
docsPath: docsPath6,
|
|
1181
1471
|
name: "AbiFunctionOutputsNotFoundError"
|
|
1182
1472
|
});
|
|
1183
1473
|
}
|
|
1184
1474
|
};
|
|
1185
|
-
var
|
|
1475
|
+
var AbiFunctionSignatureNotFoundError = class extends BaseError3 {
|
|
1476
|
+
constructor(signature, { docsPath: docsPath6 }) {
|
|
1477
|
+
super([
|
|
1478
|
+
`Encoded function signature "${signature}" not found on ABI.`,
|
|
1479
|
+
"Make sure you are using the correct ABI and that the function exists on it.",
|
|
1480
|
+
`You can look up the signature here: https://openchain.xyz/signatures?query=${signature}.`
|
|
1481
|
+
].join("\n"), {
|
|
1482
|
+
docsPath: docsPath6,
|
|
1483
|
+
name: "AbiFunctionSignatureNotFoundError"
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
};
|
|
1487
|
+
var AbiItemAmbiguityError = class extends BaseError3 {
|
|
1186
1488
|
constructor(x, y) {
|
|
1187
1489
|
super("Found ambiguous types in overloaded ABI items.", {
|
|
1188
1490
|
metaMessages: [
|
|
@@ -1196,30 +1498,30 @@ var AbiItemAmbiguityError = class extends BaseError2 {
|
|
|
1196
1498
|
});
|
|
1197
1499
|
}
|
|
1198
1500
|
};
|
|
1199
|
-
var InvalidAbiEncodingTypeError = class extends
|
|
1200
|
-
constructor(type, { docsPath:
|
|
1501
|
+
var InvalidAbiEncodingTypeError = class extends BaseError3 {
|
|
1502
|
+
constructor(type, { docsPath: docsPath6 }) {
|
|
1201
1503
|
super([
|
|
1202
1504
|
`Type "${type}" is not a valid encoding type.`,
|
|
1203
1505
|
"Please provide a valid ABI type."
|
|
1204
|
-
].join("\n"), { docsPath:
|
|
1506
|
+
].join("\n"), { docsPath: docsPath6, name: "InvalidAbiEncodingType" });
|
|
1205
1507
|
}
|
|
1206
1508
|
};
|
|
1207
|
-
var InvalidAbiDecodingTypeError = class extends
|
|
1208
|
-
constructor(type, { docsPath:
|
|
1509
|
+
var InvalidAbiDecodingTypeError = class extends BaseError3 {
|
|
1510
|
+
constructor(type, { docsPath: docsPath6 }) {
|
|
1209
1511
|
super([
|
|
1210
1512
|
`Type "${type}" is not a valid decoding type.`,
|
|
1211
1513
|
"Please provide a valid ABI type."
|
|
1212
|
-
].join("\n"), { docsPath:
|
|
1514
|
+
].join("\n"), { docsPath: docsPath6, name: "InvalidAbiDecodingType" });
|
|
1213
1515
|
}
|
|
1214
1516
|
};
|
|
1215
|
-
var InvalidArrayError = class extends
|
|
1517
|
+
var InvalidArrayError = class extends BaseError3 {
|
|
1216
1518
|
constructor(value) {
|
|
1217
1519
|
super([`Value "${value}" is not a valid array.`].join("\n"), {
|
|
1218
1520
|
name: "InvalidArrayError"
|
|
1219
1521
|
});
|
|
1220
1522
|
}
|
|
1221
1523
|
};
|
|
1222
|
-
var InvalidDefinitionTypeError = class extends
|
|
1524
|
+
var InvalidDefinitionTypeError = class extends BaseError3 {
|
|
1223
1525
|
constructor(type) {
|
|
1224
1526
|
super([
|
|
1225
1527
|
`"${type}" is not a valid definition type.`,
|
|
@@ -1228,24 +1530,24 @@ var InvalidDefinitionTypeError = class extends BaseError2 {
|
|
|
1228
1530
|
}
|
|
1229
1531
|
};
|
|
1230
1532
|
|
|
1231
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1232
|
-
var
|
|
1233
|
-
constructor({ offset, position, size:
|
|
1234
|
-
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${
|
|
1533
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/data.js
|
|
1534
|
+
var SliceOffsetOutOfBoundsError2 = class extends BaseError3 {
|
|
1535
|
+
constructor({ offset, position, size: size3 }) {
|
|
1536
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size3}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
1235
1537
|
}
|
|
1236
1538
|
};
|
|
1237
|
-
var
|
|
1238
|
-
constructor({ size:
|
|
1239
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${
|
|
1539
|
+
var SizeExceedsPaddingSizeError2 = class extends BaseError3 {
|
|
1540
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1541
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size3}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
1240
1542
|
}
|
|
1241
1543
|
};
|
|
1242
|
-
var InvalidBytesLengthError = class extends
|
|
1243
|
-
constructor({ size:
|
|
1244
|
-
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${
|
|
1544
|
+
var InvalidBytesLengthError = class extends BaseError3 {
|
|
1545
|
+
constructor({ size: size3, targetSize, type }) {
|
|
1546
|
+
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} is expected to be ${targetSize} ${type} long, but is ${size3} ${type} long.`, { name: "InvalidBytesLengthError" });
|
|
1245
1547
|
}
|
|
1246
1548
|
};
|
|
1247
1549
|
|
|
1248
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1550
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/slice.js
|
|
1249
1551
|
function slice(value, start, end, { strict } = {}) {
|
|
1250
1552
|
if (isHex(value, { strict: false }))
|
|
1251
1553
|
return sliceHex(value, start, end, {
|
|
@@ -1255,94 +1557,94 @@ function slice(value, start, end, { strict } = {}) {
|
|
|
1255
1557
|
strict
|
|
1256
1558
|
});
|
|
1257
1559
|
}
|
|
1258
|
-
function
|
|
1259
|
-
if (typeof start === "number" && start > 0 && start >
|
|
1260
|
-
throw new
|
|
1560
|
+
function assertStartOffset2(value, start) {
|
|
1561
|
+
if (typeof start === "number" && start > 0 && start > size2(value) - 1)
|
|
1562
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
1261
1563
|
offset: start,
|
|
1262
1564
|
position: "start",
|
|
1263
|
-
size:
|
|
1565
|
+
size: size2(value)
|
|
1264
1566
|
});
|
|
1265
1567
|
}
|
|
1266
|
-
function
|
|
1267
|
-
if (typeof start === "number" && typeof end === "number" &&
|
|
1268
|
-
throw new
|
|
1568
|
+
function assertEndOffset2(value, start, end) {
|
|
1569
|
+
if (typeof start === "number" && typeof end === "number" && size2(value) !== end - start) {
|
|
1570
|
+
throw new SliceOffsetOutOfBoundsError2({
|
|
1269
1571
|
offset: end,
|
|
1270
1572
|
position: "end",
|
|
1271
|
-
size:
|
|
1573
|
+
size: size2(value)
|
|
1272
1574
|
});
|
|
1273
1575
|
}
|
|
1274
1576
|
}
|
|
1275
1577
|
function sliceBytes(value_, start, end, { strict } = {}) {
|
|
1276
|
-
|
|
1578
|
+
assertStartOffset2(value_, start);
|
|
1277
1579
|
const value = value_.slice(start, end);
|
|
1278
1580
|
if (strict)
|
|
1279
|
-
|
|
1581
|
+
assertEndOffset2(value, start, end);
|
|
1280
1582
|
return value;
|
|
1281
1583
|
}
|
|
1282
1584
|
function sliceHex(value_, start, end, { strict } = {}) {
|
|
1283
|
-
|
|
1585
|
+
assertStartOffset2(value_, start);
|
|
1284
1586
|
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
1285
1587
|
if (strict)
|
|
1286
|
-
|
|
1588
|
+
assertEndOffset2(value, start, end);
|
|
1287
1589
|
return value;
|
|
1288
1590
|
}
|
|
1289
1591
|
|
|
1290
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1291
|
-
function
|
|
1592
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/pad.js
|
|
1593
|
+
function pad2(hexOrBytes, { dir, size: size3 = 32 } = {}) {
|
|
1292
1594
|
if (typeof hexOrBytes === "string")
|
|
1293
|
-
return padHex(hexOrBytes, { dir, size:
|
|
1294
|
-
return padBytes(hexOrBytes, { dir, size:
|
|
1595
|
+
return padHex(hexOrBytes, { dir, size: size3 });
|
|
1596
|
+
return padBytes(hexOrBytes, { dir, size: size3 });
|
|
1295
1597
|
}
|
|
1296
|
-
function padHex(hex_, { dir, size:
|
|
1297
|
-
if (
|
|
1598
|
+
function padHex(hex_, { dir, size: size3 = 32 } = {}) {
|
|
1599
|
+
if (size3 === null)
|
|
1298
1600
|
return hex_;
|
|
1299
1601
|
const hex = hex_.replace("0x", "");
|
|
1300
|
-
if (hex.length >
|
|
1301
|
-
throw new
|
|
1602
|
+
if (hex.length > size3 * 2)
|
|
1603
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
1302
1604
|
size: Math.ceil(hex.length / 2),
|
|
1303
|
-
targetSize:
|
|
1605
|
+
targetSize: size3,
|
|
1304
1606
|
type: "hex"
|
|
1305
1607
|
});
|
|
1306
|
-
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](
|
|
1608
|
+
return `0x${hex[dir === "right" ? "padEnd" : "padStart"](size3 * 2, "0")}`;
|
|
1307
1609
|
}
|
|
1308
|
-
function padBytes(bytes, { dir, size:
|
|
1309
|
-
if (
|
|
1610
|
+
function padBytes(bytes, { dir, size: size3 = 32 } = {}) {
|
|
1611
|
+
if (size3 === null)
|
|
1310
1612
|
return bytes;
|
|
1311
|
-
if (bytes.length >
|
|
1312
|
-
throw new
|
|
1613
|
+
if (bytes.length > size3)
|
|
1614
|
+
throw new SizeExceedsPaddingSizeError2({
|
|
1313
1615
|
size: bytes.length,
|
|
1314
|
-
targetSize:
|
|
1616
|
+
targetSize: size3,
|
|
1315
1617
|
type: "bytes"
|
|
1316
1618
|
});
|
|
1317
|
-
const paddedBytes = new Uint8Array(
|
|
1318
|
-
for (let i = 0; i <
|
|
1619
|
+
const paddedBytes = new Uint8Array(size3);
|
|
1620
|
+
for (let i = 0; i < size3; i++) {
|
|
1319
1621
|
const padEnd = dir === "right";
|
|
1320
|
-
paddedBytes[padEnd ? i :
|
|
1622
|
+
paddedBytes[padEnd ? i : size3 - i - 1] = bytes[padEnd ? i : bytes.length - i - 1];
|
|
1321
1623
|
}
|
|
1322
1624
|
return paddedBytes;
|
|
1323
1625
|
}
|
|
1324
1626
|
|
|
1325
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1326
|
-
var
|
|
1327
|
-
constructor({ max, min, signed, size:
|
|
1328
|
-
super(`Number "${value}" is not in safe ${
|
|
1627
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/encoding.js
|
|
1628
|
+
var IntegerOutOfRangeError2 = class extends BaseError3 {
|
|
1629
|
+
constructor({ max, min, signed, size: size3, value }) {
|
|
1630
|
+
super(`Number "${value}" is not in safe ${size3 ? `${size3 * 8}-bit ${signed ? "signed" : "unsigned"} ` : ""}integer range ${max ? `(${min} to ${max})` : `(above ${min})`}`, { name: "IntegerOutOfRangeError" });
|
|
1329
1631
|
}
|
|
1330
1632
|
};
|
|
1331
|
-
var InvalidBytesBooleanError = class extends
|
|
1633
|
+
var InvalidBytesBooleanError = class extends BaseError3 {
|
|
1332
1634
|
constructor(bytes) {
|
|
1333
1635
|
super(`Bytes value "${bytes}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`, {
|
|
1334
1636
|
name: "InvalidBytesBooleanError"
|
|
1335
1637
|
});
|
|
1336
1638
|
}
|
|
1337
1639
|
};
|
|
1338
|
-
var
|
|
1640
|
+
var SizeOverflowError2 = class extends BaseError3 {
|
|
1339
1641
|
constructor({ givenSize, maxSize }) {
|
|
1340
1642
|
super(`Size cannot exceed ${maxSize} bytes. Given size: ${givenSize} bytes.`, { name: "SizeOverflowError" });
|
|
1341
1643
|
}
|
|
1342
1644
|
};
|
|
1343
1645
|
|
|
1344
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1345
|
-
function
|
|
1646
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/trim.js
|
|
1647
|
+
function trim2(hexOrBytes, { dir = "left" } = {}) {
|
|
1346
1648
|
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
1347
1649
|
let sliceLength = 0;
|
|
1348
1650
|
for (let i = 0; i < data.length - 1; i++) {
|
|
@@ -1360,32 +1662,32 @@ function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
|
1360
1662
|
return data;
|
|
1361
1663
|
}
|
|
1362
1664
|
|
|
1363
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1364
|
-
function
|
|
1365
|
-
if (
|
|
1366
|
-
throw new
|
|
1367
|
-
givenSize:
|
|
1368
|
-
maxSize:
|
|
1665
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
1666
|
+
function assertSize2(hexOrBytes, { size: size3 }) {
|
|
1667
|
+
if (size2(hexOrBytes) > size3)
|
|
1668
|
+
throw new SizeOverflowError2({
|
|
1669
|
+
givenSize: size2(hexOrBytes),
|
|
1670
|
+
maxSize: size3
|
|
1369
1671
|
});
|
|
1370
1672
|
}
|
|
1371
1673
|
function hexToBigInt(hex, opts = {}) {
|
|
1372
1674
|
const { signed } = opts;
|
|
1373
1675
|
if (opts.size)
|
|
1374
|
-
|
|
1676
|
+
assertSize2(hex, { size: opts.size });
|
|
1375
1677
|
const value = BigInt(hex);
|
|
1376
1678
|
if (!signed)
|
|
1377
1679
|
return value;
|
|
1378
|
-
const
|
|
1379
|
-
const max = (1n << BigInt(
|
|
1680
|
+
const size3 = (hex.length - 2) / 2;
|
|
1681
|
+
const max = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
1380
1682
|
if (value <= max)
|
|
1381
1683
|
return value;
|
|
1382
|
-
return value - BigInt(`0x${"f".padStart(
|
|
1684
|
+
return value - BigInt(`0x${"f".padStart(size3 * 2, "f")}`) - 1n;
|
|
1383
1685
|
}
|
|
1384
1686
|
function hexToNumber(hex, opts = {}) {
|
|
1385
1687
|
return Number(hexToBigInt(hex, opts));
|
|
1386
1688
|
}
|
|
1387
1689
|
|
|
1388
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1690
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/toHex.js
|
|
1389
1691
|
var hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_v, i) => i.toString(16).padStart(2, "0"));
|
|
1390
1692
|
function toHex(value, opts = {}) {
|
|
1391
1693
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -1400,8 +1702,8 @@ function toHex(value, opts = {}) {
|
|
|
1400
1702
|
function boolToHex(value, opts = {}) {
|
|
1401
1703
|
const hex = `0x${Number(value)}`;
|
|
1402
1704
|
if (typeof opts.size === "number") {
|
|
1403
|
-
|
|
1404
|
-
return
|
|
1705
|
+
assertSize2(hex, { size: opts.size });
|
|
1706
|
+
return pad2(hex, { size: opts.size });
|
|
1405
1707
|
}
|
|
1406
1708
|
return hex;
|
|
1407
1709
|
}
|
|
@@ -1412,37 +1714,37 @@ function bytesToHex(value, opts = {}) {
|
|
|
1412
1714
|
}
|
|
1413
1715
|
const hex = `0x${string}`;
|
|
1414
1716
|
if (typeof opts.size === "number") {
|
|
1415
|
-
|
|
1416
|
-
return
|
|
1717
|
+
assertSize2(hex, { size: opts.size });
|
|
1718
|
+
return pad2(hex, { dir: "right", size: opts.size });
|
|
1417
1719
|
}
|
|
1418
1720
|
return hex;
|
|
1419
1721
|
}
|
|
1420
1722
|
function numberToHex(value_, opts = {}) {
|
|
1421
|
-
const { signed, size:
|
|
1723
|
+
const { signed, size: size3 } = opts;
|
|
1422
1724
|
const value = BigInt(value_);
|
|
1423
1725
|
let maxValue;
|
|
1424
|
-
if (
|
|
1726
|
+
if (size3) {
|
|
1425
1727
|
if (signed)
|
|
1426
|
-
maxValue = (1n << BigInt(
|
|
1728
|
+
maxValue = (1n << BigInt(size3) * 8n - 1n) - 1n;
|
|
1427
1729
|
else
|
|
1428
|
-
maxValue = 2n ** (BigInt(
|
|
1730
|
+
maxValue = 2n ** (BigInt(size3) * 8n) - 1n;
|
|
1429
1731
|
} else if (typeof value_ === "number") {
|
|
1430
1732
|
maxValue = BigInt(Number.MAX_SAFE_INTEGER);
|
|
1431
1733
|
}
|
|
1432
1734
|
const minValue = typeof maxValue === "bigint" && signed ? -maxValue - 1n : 0;
|
|
1433
1735
|
if (maxValue && value > maxValue || value < minValue) {
|
|
1434
1736
|
const suffix = typeof value_ === "bigint" ? "n" : "";
|
|
1435
|
-
throw new
|
|
1737
|
+
throw new IntegerOutOfRangeError2({
|
|
1436
1738
|
max: maxValue ? `${maxValue}${suffix}` : void 0,
|
|
1437
1739
|
min: `${minValue}${suffix}`,
|
|
1438
1740
|
signed,
|
|
1439
|
-
size:
|
|
1741
|
+
size: size3,
|
|
1440
1742
|
value: `${value_}${suffix}`
|
|
1441
1743
|
});
|
|
1442
1744
|
}
|
|
1443
|
-
const hex = `0x${(signed && value < 0 ? (1n << BigInt(
|
|
1444
|
-
if (
|
|
1445
|
-
return
|
|
1745
|
+
const hex = `0x${(signed && value < 0 ? (1n << BigInt(size3 * 8)) + BigInt(value) : value).toString(16)}`;
|
|
1746
|
+
if (size3)
|
|
1747
|
+
return pad2(hex, { size: size3 });
|
|
1446
1748
|
return hex;
|
|
1447
1749
|
}
|
|
1448
1750
|
var encoder = /* @__PURE__ */ new TextEncoder();
|
|
@@ -1451,7 +1753,7 @@ function stringToHex(value_, opts = {}) {
|
|
|
1451
1753
|
return bytesToHex(value, opts);
|
|
1452
1754
|
}
|
|
1453
1755
|
|
|
1454
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1756
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/toBytes.js
|
|
1455
1757
|
var encoder2 = /* @__PURE__ */ new TextEncoder();
|
|
1456
1758
|
function toBytes2(value, opts = {}) {
|
|
1457
1759
|
if (typeof value === "number" || typeof value === "bigint")
|
|
@@ -1466,8 +1768,8 @@ function boolToBytes(value, opts = {}) {
|
|
|
1466
1768
|
const bytes = new Uint8Array(1);
|
|
1467
1769
|
bytes[0] = Number(value);
|
|
1468
1770
|
if (typeof opts.size === "number") {
|
|
1469
|
-
|
|
1470
|
-
return
|
|
1771
|
+
assertSize2(bytes, { size: opts.size });
|
|
1772
|
+
return pad2(bytes, { size: opts.size });
|
|
1471
1773
|
}
|
|
1472
1774
|
return bytes;
|
|
1473
1775
|
}
|
|
@@ -1491,8 +1793,8 @@ function charCodeToBase16(char) {
|
|
|
1491
1793
|
function hexToBytes(hex_, opts = {}) {
|
|
1492
1794
|
let hex = hex_;
|
|
1493
1795
|
if (opts.size) {
|
|
1494
|
-
|
|
1495
|
-
hex =
|
|
1796
|
+
assertSize2(hex, { size: opts.size });
|
|
1797
|
+
hex = pad2(hex, { dir: "right", size: opts.size });
|
|
1496
1798
|
}
|
|
1497
1799
|
let hexString = hex.slice(2);
|
|
1498
1800
|
if (hexString.length % 2)
|
|
@@ -1503,7 +1805,7 @@ function hexToBytes(hex_, opts = {}) {
|
|
|
1503
1805
|
const nibbleLeft = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1504
1806
|
const nibbleRight = charCodeToBase16(hexString.charCodeAt(j++));
|
|
1505
1807
|
if (nibbleLeft === void 0 || nibbleRight === void 0) {
|
|
1506
|
-
throw new
|
|
1808
|
+
throw new BaseError3(`Invalid byte sequence ("${hexString[j - 2]}${hexString[j - 1]}" in "${hexString}").`);
|
|
1507
1809
|
}
|
|
1508
1810
|
bytes[index] = nibbleLeft * 16 + nibbleRight;
|
|
1509
1811
|
}
|
|
@@ -1516,44 +1818,22 @@ function numberToBytes(value, opts) {
|
|
|
1516
1818
|
function stringToBytes(value, opts = {}) {
|
|
1517
1819
|
const bytes = encoder2.encode(value);
|
|
1518
1820
|
if (typeof opts.size === "number") {
|
|
1519
|
-
|
|
1520
|
-
return
|
|
1821
|
+
assertSize2(bytes, { size: opts.size });
|
|
1822
|
+
return pad2(bytes, { dir: "right", size: opts.size });
|
|
1521
1823
|
}
|
|
1522
1824
|
return bytes;
|
|
1523
1825
|
}
|
|
1524
1826
|
|
|
1525
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.
|
|
1526
|
-
var
|
|
1527
|
-
var
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
}
|
|
1533
|
-
function split(lst, le = false) {
|
|
1534
|
-
let Ah = new Uint32Array(lst.length);
|
|
1535
|
-
let Al = new Uint32Array(lst.length);
|
|
1536
|
-
for (let i = 0; i < lst.length; i++) {
|
|
1537
|
-
const { h, l } = fromBig(lst[i], le);
|
|
1538
|
-
[Ah[i], Al[i]] = [h, l];
|
|
1539
|
-
}
|
|
1540
|
-
return [Ah, Al];
|
|
1541
|
-
}
|
|
1542
|
-
var rotlSH = (h, l, s) => h << s | l >>> 32 - s;
|
|
1543
|
-
var rotlSL = (h, l, s) => l << s | h >>> 32 - s;
|
|
1544
|
-
var rotlBH = (h, l, s) => l << s - 32 | h >>> 64 - s;
|
|
1545
|
-
var rotlBL = (h, l, s) => h << s - 32 | l >>> 64 - s;
|
|
1546
|
-
|
|
1547
|
-
// ../../node_modules/.pnpm/@noble+hashes@1.7.1/node_modules/@noble/hashes/esm/sha3.js
|
|
1827
|
+
// ../../node_modules/.pnpm/@noble+hashes@1.8.0/node_modules/@noble/hashes/esm/sha3.js
|
|
1828
|
+
var _0n = BigInt(0);
|
|
1829
|
+
var _1n = BigInt(1);
|
|
1830
|
+
var _2n = BigInt(2);
|
|
1831
|
+
var _7n = BigInt(7);
|
|
1832
|
+
var _256n = BigInt(256);
|
|
1833
|
+
var _0x71n = BigInt(113);
|
|
1548
1834
|
var SHA3_PI = [];
|
|
1549
1835
|
var SHA3_ROTL = [];
|
|
1550
1836
|
var _SHA3_IOTA = [];
|
|
1551
|
-
var _0n = /* @__PURE__ */ BigInt(0);
|
|
1552
|
-
var _1n = /* @__PURE__ */ BigInt(1);
|
|
1553
|
-
var _2n = /* @__PURE__ */ BigInt(2);
|
|
1554
|
-
var _7n = /* @__PURE__ */ BigInt(7);
|
|
1555
|
-
var _256n = /* @__PURE__ */ BigInt(256);
|
|
1556
|
-
var _0x71n = /* @__PURE__ */ BigInt(113);
|
|
1557
1837
|
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
1558
1838
|
[x, y] = [y, (2 * x + 3 * y) % 5];
|
|
1559
1839
|
SHA3_PI.push(2 * (5 * y + x));
|
|
@@ -1566,7 +1846,9 @@ for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
|
|
|
1566
1846
|
}
|
|
1567
1847
|
_SHA3_IOTA.push(t);
|
|
1568
1848
|
}
|
|
1569
|
-
var
|
|
1849
|
+
var IOTAS = split(_SHA3_IOTA, true);
|
|
1850
|
+
var SHA3_IOTA_H = IOTAS[0];
|
|
1851
|
+
var SHA3_IOTA_L = IOTAS[1];
|
|
1570
1852
|
var rotlH = (h, l, s) => s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s);
|
|
1571
1853
|
var rotlL = (h, l, s) => s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s);
|
|
1572
1854
|
function keccakP(s, rounds = 24) {
|
|
@@ -1607,40 +1889,43 @@ function keccakP(s, rounds = 24) {
|
|
|
1607
1889
|
s[0] ^= SHA3_IOTA_H[round];
|
|
1608
1890
|
s[1] ^= SHA3_IOTA_L[round];
|
|
1609
1891
|
}
|
|
1610
|
-
B
|
|
1892
|
+
clean(B);
|
|
1611
1893
|
}
|
|
1612
1894
|
var Keccak = class _Keccak extends Hash {
|
|
1613
1895
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
1614
1896
|
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
|
|
1615
1897
|
super();
|
|
1898
|
+
this.pos = 0;
|
|
1899
|
+
this.posOut = 0;
|
|
1900
|
+
this.finished = false;
|
|
1901
|
+
this.destroyed = false;
|
|
1902
|
+
this.enableXOF = false;
|
|
1616
1903
|
this.blockLen = blockLen;
|
|
1617
1904
|
this.suffix = suffix;
|
|
1618
1905
|
this.outputLen = outputLen;
|
|
1619
1906
|
this.enableXOF = enableXOF;
|
|
1620
1907
|
this.rounds = rounds;
|
|
1621
|
-
this.pos = 0;
|
|
1622
|
-
this.posOut = 0;
|
|
1623
|
-
this.finished = false;
|
|
1624
|
-
this.destroyed = false;
|
|
1625
1908
|
anumber(outputLen);
|
|
1626
|
-
if (0
|
|
1627
|
-
throw new Error("
|
|
1909
|
+
if (!(0 < blockLen && blockLen < 200))
|
|
1910
|
+
throw new Error("only keccak-f1600 function is supported");
|
|
1628
1911
|
this.state = new Uint8Array(200);
|
|
1629
1912
|
this.state32 = u32(this.state);
|
|
1630
1913
|
}
|
|
1914
|
+
clone() {
|
|
1915
|
+
return this._cloneInto();
|
|
1916
|
+
}
|
|
1631
1917
|
keccak() {
|
|
1632
|
-
|
|
1633
|
-
byteSwap32(this.state32);
|
|
1918
|
+
swap32IfBE(this.state32);
|
|
1634
1919
|
keccakP(this.state32, this.rounds);
|
|
1635
|
-
|
|
1636
|
-
byteSwap32(this.state32);
|
|
1920
|
+
swap32IfBE(this.state32);
|
|
1637
1921
|
this.posOut = 0;
|
|
1638
1922
|
this.pos = 0;
|
|
1639
1923
|
}
|
|
1640
1924
|
update(data) {
|
|
1641
1925
|
aexists(this);
|
|
1642
|
-
const { blockLen, state } = this;
|
|
1643
1926
|
data = toBytes(data);
|
|
1927
|
+
abytes(data);
|
|
1928
|
+
const { blockLen, state } = this;
|
|
1644
1929
|
const len = data.length;
|
|
1645
1930
|
for (let pos = 0; pos < len; ) {
|
|
1646
1931
|
const take = Math.min(blockLen - this.pos, len - pos);
|
|
@@ -1700,7 +1985,7 @@ var Keccak = class _Keccak extends Hash {
|
|
|
1700
1985
|
}
|
|
1701
1986
|
destroy() {
|
|
1702
1987
|
this.destroyed = true;
|
|
1703
|
-
this.state
|
|
1988
|
+
clean(this.state);
|
|
1704
1989
|
}
|
|
1705
1990
|
_cloneInto(to) {
|
|
1706
1991
|
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
|
|
@@ -1717,20 +2002,10 @@ var Keccak = class _Keccak extends Hash {
|
|
|
1717
2002
|
return to;
|
|
1718
2003
|
}
|
|
1719
2004
|
};
|
|
1720
|
-
var gen = (suffix, blockLen, outputLen) =>
|
|
1721
|
-
var
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
var sha3_512 = /* @__PURE__ */ gen(6, 72, 512 / 8);
|
|
1725
|
-
var keccak_224 = /* @__PURE__ */ gen(1, 144, 224 / 8);
|
|
1726
|
-
var keccak_256 = /* @__PURE__ */ gen(1, 136, 256 / 8);
|
|
1727
|
-
var keccak_384 = /* @__PURE__ */ gen(1, 104, 384 / 8);
|
|
1728
|
-
var keccak_512 = /* @__PURE__ */ gen(1, 72, 512 / 8);
|
|
1729
|
-
var genShake = (suffix, blockLen, outputLen) => wrapXOFConstructorWithOpts((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === void 0 ? outputLen : opts.dkLen, true));
|
|
1730
|
-
var shake128 = /* @__PURE__ */ genShake(31, 168, 128 / 8);
|
|
1731
|
-
var shake256 = /* @__PURE__ */ genShake(31, 136, 256 / 8);
|
|
1732
|
-
|
|
1733
|
-
// ../../node_modules/.pnpm/viem@2.23.2_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
2005
|
+
var gen = (suffix, blockLen, outputLen) => createHasher(() => new Keccak(blockLen, suffix, outputLen));
|
|
2006
|
+
var keccak_256 = /* @__PURE__ */ (() => gen(1, 136, 256 / 8))();
|
|
2007
|
+
|
|
2008
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/keccak256.js
|
|
1734
2009
|
function keccak256(value, to_) {
|
|
1735
2010
|
const to = to_ || "hex";
|
|
1736
2011
|
const bytes = keccak_256(isHex(value, { strict: false }) ? toBytes2(value) : value);
|
|
@@ -1739,13 +2014,13 @@ function keccak256(value, to_) {
|
|
|
1739
2014
|
return toHex(bytes);
|
|
1740
2015
|
}
|
|
1741
2016
|
|
|
1742
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2017
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/hashSignature.js
|
|
1743
2018
|
var hash = (value) => keccak256(toBytes2(value));
|
|
1744
2019
|
function hashSignature(sig) {
|
|
1745
2020
|
return hash(sig);
|
|
1746
2021
|
}
|
|
1747
2022
|
|
|
1748
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2023
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/normalizeSignature.js
|
|
1749
2024
|
function normalizeSignature(signature) {
|
|
1750
2025
|
let active = true;
|
|
1751
2026
|
let current = "";
|
|
@@ -1785,11 +2060,11 @@ function normalizeSignature(signature) {
|
|
|
1785
2060
|
current += char;
|
|
1786
2061
|
}
|
|
1787
2062
|
if (!valid)
|
|
1788
|
-
throw new
|
|
2063
|
+
throw new BaseError3("Unable to normalize signature.");
|
|
1789
2064
|
return result;
|
|
1790
2065
|
}
|
|
1791
2066
|
|
|
1792
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2067
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toSignature.js
|
|
1793
2068
|
var toSignature = (def) => {
|
|
1794
2069
|
const def_ = (() => {
|
|
1795
2070
|
if (typeof def === "string")
|
|
@@ -1799,16 +2074,16 @@ var toSignature = (def) => {
|
|
|
1799
2074
|
return normalizeSignature(def_);
|
|
1800
2075
|
};
|
|
1801
2076
|
|
|
1802
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2077
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toSignatureHash.js
|
|
1803
2078
|
function toSignatureHash(fn) {
|
|
1804
2079
|
return hashSignature(toSignature(fn));
|
|
1805
2080
|
}
|
|
1806
2081
|
|
|
1807
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2082
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toFunctionSelector.js
|
|
1808
2083
|
var toFunctionSelector = (fn) => slice(toSignatureHash(fn), 0, 4);
|
|
1809
2084
|
|
|
1810
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1811
|
-
var InvalidAddressError = class extends
|
|
2085
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/address.js
|
|
2086
|
+
var InvalidAddressError = class extends BaseError3 {
|
|
1812
2087
|
constructor({ address }) {
|
|
1813
2088
|
super(`Address "${address}" is invalid.`, {
|
|
1814
2089
|
metaMessages: [
|
|
@@ -1820,9 +2095,9 @@ var InvalidAddressError = class extends BaseError2 {
|
|
|
1820
2095
|
}
|
|
1821
2096
|
};
|
|
1822
2097
|
|
|
1823
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2098
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/lru.js
|
|
1824
2099
|
var LruMap = class extends Map {
|
|
1825
|
-
constructor(
|
|
2100
|
+
constructor(size3) {
|
|
1826
2101
|
super();
|
|
1827
2102
|
Object.defineProperty(this, "maxSize", {
|
|
1828
2103
|
enumerable: true,
|
|
@@ -1830,7 +2105,7 @@ var LruMap = class extends Map {
|
|
|
1830
2105
|
writable: true,
|
|
1831
2106
|
value: void 0
|
|
1832
2107
|
});
|
|
1833
|
-
this.maxSize =
|
|
2108
|
+
this.maxSize = size3;
|
|
1834
2109
|
}
|
|
1835
2110
|
get(key) {
|
|
1836
2111
|
const value = super.get(key);
|
|
@@ -1851,7 +2126,7 @@ var LruMap = class extends Map {
|
|
|
1851
2126
|
}
|
|
1852
2127
|
};
|
|
1853
2128
|
|
|
1854
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2129
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/isAddress.js
|
|
1855
2130
|
var addressRegex = /^0x[a-fA-F0-9]{40}$/;
|
|
1856
2131
|
var isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1857
2132
|
function isAddress(address, options) {
|
|
@@ -1872,7 +2147,7 @@ function isAddress(address, options) {
|
|
|
1872
2147
|
return result;
|
|
1873
2148
|
}
|
|
1874
2149
|
|
|
1875
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2150
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/getAddress.js
|
|
1876
2151
|
var checksumAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
1877
2152
|
function checksumAddress(address_, chainId) {
|
|
1878
2153
|
if (checksumAddressCache.has(`${address_}.${chainId}`))
|
|
@@ -1893,26 +2168,26 @@ function checksumAddress(address_, chainId) {
|
|
|
1893
2168
|
return result;
|
|
1894
2169
|
}
|
|
1895
2170
|
|
|
1896
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
1897
|
-
var NegativeOffsetError = class extends
|
|
2171
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/cursor.js
|
|
2172
|
+
var NegativeOffsetError = class extends BaseError3 {
|
|
1898
2173
|
constructor({ offset }) {
|
|
1899
2174
|
super(`Offset \`${offset}\` cannot be negative.`, {
|
|
1900
2175
|
name: "NegativeOffsetError"
|
|
1901
2176
|
});
|
|
1902
2177
|
}
|
|
1903
2178
|
};
|
|
1904
|
-
var PositionOutOfBoundsError = class extends
|
|
2179
|
+
var PositionOutOfBoundsError = class extends BaseError3 {
|
|
1905
2180
|
constructor({ length, position }) {
|
|
1906
2181
|
super(`Position \`${position}\` is out of bounds (\`0 < position < ${length}\`).`, { name: "PositionOutOfBoundsError" });
|
|
1907
2182
|
}
|
|
1908
2183
|
};
|
|
1909
|
-
var RecursiveReadLimitExceededError = class extends
|
|
2184
|
+
var RecursiveReadLimitExceededError = class extends BaseError3 {
|
|
1910
2185
|
constructor({ count, limit }) {
|
|
1911
2186
|
super(`Recursive read limit of \`${limit}\` exceeded (recursive read count: \`${count}\`).`, { name: "RecursiveReadLimitExceededError" });
|
|
1912
2187
|
}
|
|
1913
2188
|
};
|
|
1914
2189
|
|
|
1915
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2190
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/cursor.js
|
|
1916
2191
|
var staticCursor = {
|
|
1917
2192
|
bytes: new Uint8Array(),
|
|
1918
2193
|
dataView: new DataView(new ArrayBuffer(0)),
|
|
@@ -2019,11 +2294,11 @@ var staticCursor = {
|
|
|
2019
2294
|
this.position++;
|
|
2020
2295
|
return value;
|
|
2021
2296
|
},
|
|
2022
|
-
readBytes(length,
|
|
2297
|
+
readBytes(length, size3) {
|
|
2023
2298
|
this.assertReadLimit();
|
|
2024
2299
|
this._touch();
|
|
2025
2300
|
const value = this.inspectBytes(length);
|
|
2026
|
-
this.position +=
|
|
2301
|
+
this.position += size3 ?? length;
|
|
2027
2302
|
return value;
|
|
2028
2303
|
},
|
|
2029
2304
|
readUint8() {
|
|
@@ -2081,18 +2356,18 @@ function createCursor(bytes, { recursiveReadLimit = 8192 } = {}) {
|
|
|
2081
2356
|
return cursor;
|
|
2082
2357
|
}
|
|
2083
2358
|
|
|
2084
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2359
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
2085
2360
|
function bytesToBigInt(bytes, opts = {}) {
|
|
2086
2361
|
if (typeof opts.size !== "undefined")
|
|
2087
|
-
|
|
2362
|
+
assertSize2(bytes, { size: opts.size });
|
|
2088
2363
|
const hex = bytesToHex(bytes, opts);
|
|
2089
2364
|
return hexToBigInt(hex, opts);
|
|
2090
2365
|
}
|
|
2091
2366
|
function bytesToBool(bytes_, opts = {}) {
|
|
2092
2367
|
let bytes = bytes_;
|
|
2093
2368
|
if (typeof opts.size !== "undefined") {
|
|
2094
|
-
|
|
2095
|
-
bytes =
|
|
2369
|
+
assertSize2(bytes, { size: opts.size });
|
|
2370
|
+
bytes = trim2(bytes);
|
|
2096
2371
|
}
|
|
2097
2372
|
if (bytes.length > 1 || bytes[0] > 1)
|
|
2098
2373
|
throw new InvalidBytesBooleanError(bytes);
|
|
@@ -2100,20 +2375,20 @@ function bytesToBool(bytes_, opts = {}) {
|
|
|
2100
2375
|
}
|
|
2101
2376
|
function bytesToNumber(bytes, opts = {}) {
|
|
2102
2377
|
if (typeof opts.size !== "undefined")
|
|
2103
|
-
|
|
2378
|
+
assertSize2(bytes, { size: opts.size });
|
|
2104
2379
|
const hex = bytesToHex(bytes, opts);
|
|
2105
2380
|
return hexToNumber(hex, opts);
|
|
2106
2381
|
}
|
|
2107
2382
|
function bytesToString(bytes_, opts = {}) {
|
|
2108
2383
|
let bytes = bytes_;
|
|
2109
2384
|
if (typeof opts.size !== "undefined") {
|
|
2110
|
-
|
|
2111
|
-
bytes =
|
|
2385
|
+
assertSize2(bytes, { size: opts.size });
|
|
2386
|
+
bytes = trim2(bytes, { dir: "right" });
|
|
2112
2387
|
}
|
|
2113
2388
|
return new TextDecoder().decode(bytes);
|
|
2114
2389
|
}
|
|
2115
2390
|
|
|
2116
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2391
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/data/concat.js
|
|
2117
2392
|
function concat(values) {
|
|
2118
2393
|
if (typeof values[0] === "string")
|
|
2119
2394
|
return concatHex(values);
|
|
@@ -2136,10 +2411,10 @@ function concatHex(values) {
|
|
|
2136
2411
|
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
2137
2412
|
}
|
|
2138
2413
|
|
|
2139
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2414
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/regex.js
|
|
2140
2415
|
var integerRegex2 = /^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;
|
|
2141
2416
|
|
|
2142
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2417
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeAbiParameters.js
|
|
2143
2418
|
function encodeAbiParameters(params, values) {
|
|
2144
2419
|
if (params.length !== values.length)
|
|
2145
2420
|
throw new AbiEncodingLengthMismatchError({
|
|
@@ -2181,10 +2456,10 @@ function prepareParam({ param, value }) {
|
|
|
2181
2456
|
}
|
|
2182
2457
|
if (param.type.startsWith("uint") || param.type.startsWith("int")) {
|
|
2183
2458
|
const signed = param.type.startsWith("int");
|
|
2184
|
-
const [, ,
|
|
2459
|
+
const [, , size3 = "256"] = integerRegex2.exec(param.type) ?? [];
|
|
2185
2460
|
return encodeNumber(value, {
|
|
2186
2461
|
signed,
|
|
2187
|
-
size: Number(
|
|
2462
|
+
size: Number(size3)
|
|
2188
2463
|
});
|
|
2189
2464
|
}
|
|
2190
2465
|
if (param.type.startsWith("bytes")) {
|
|
@@ -2204,7 +2479,7 @@ function encodeParams(preparedParams) {
|
|
|
2204
2479
|
if (dynamic)
|
|
2205
2480
|
staticSize += 32;
|
|
2206
2481
|
else
|
|
2207
|
-
staticSize +=
|
|
2482
|
+
staticSize += size2(encoded);
|
|
2208
2483
|
}
|
|
2209
2484
|
const staticParams = [];
|
|
2210
2485
|
const dynamicParams = [];
|
|
@@ -2214,7 +2489,7 @@ function encodeParams(preparedParams) {
|
|
|
2214
2489
|
if (dynamic) {
|
|
2215
2490
|
staticParams.push(numberToHex(staticSize + dynamicSize, { size: 32 }));
|
|
2216
2491
|
dynamicParams.push(encoded);
|
|
2217
|
-
dynamicSize +=
|
|
2492
|
+
dynamicSize += size2(encoded);
|
|
2218
2493
|
} else {
|
|
2219
2494
|
staticParams.push(encoded);
|
|
2220
2495
|
}
|
|
@@ -2263,7 +2538,7 @@ function encodeArray(value, { length, param }) {
|
|
|
2263
2538
|
}
|
|
2264
2539
|
function encodeBytes(value, { param }) {
|
|
2265
2540
|
const [, paramSize] = param.type.split("bytes");
|
|
2266
|
-
const bytesSize =
|
|
2541
|
+
const bytesSize = size2(value);
|
|
2267
2542
|
if (!paramSize) {
|
|
2268
2543
|
let value_ = value;
|
|
2269
2544
|
if (bytesSize % 32 !== 0)
|
|
@@ -2285,19 +2560,19 @@ function encodeBytes(value, { param }) {
|
|
|
2285
2560
|
}
|
|
2286
2561
|
function encodeBool(value) {
|
|
2287
2562
|
if (typeof value !== "boolean")
|
|
2288
|
-
throw new
|
|
2563
|
+
throw new BaseError3(`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`);
|
|
2289
2564
|
return { dynamic: false, encoded: padHex(boolToHex(value)) };
|
|
2290
2565
|
}
|
|
2291
|
-
function encodeNumber(value, { signed, size:
|
|
2292
|
-
if (typeof
|
|
2293
|
-
const max = 2n ** (BigInt(
|
|
2566
|
+
function encodeNumber(value, { signed, size: size3 = 256 }) {
|
|
2567
|
+
if (typeof size3 === "number") {
|
|
2568
|
+
const max = 2n ** (BigInt(size3) - (signed ? 1n : 0n)) - 1n;
|
|
2294
2569
|
const min = signed ? -max - 1n : 0n;
|
|
2295
2570
|
if (value > max || value < min)
|
|
2296
|
-
throw new
|
|
2571
|
+
throw new IntegerOutOfRangeError2({
|
|
2297
2572
|
max: max.toString(),
|
|
2298
2573
|
min: min.toString(),
|
|
2299
2574
|
signed,
|
|
2300
|
-
size:
|
|
2575
|
+
size: size3 / 8,
|
|
2301
2576
|
value: value.toString()
|
|
2302
2577
|
});
|
|
2303
2578
|
}
|
|
@@ -2311,7 +2586,7 @@ function encodeNumber(value, { signed, size: size2 = 256 }) {
|
|
|
2311
2586
|
}
|
|
2312
2587
|
function encodeString(value) {
|
|
2313
2588
|
const hexValue = stringToHex(value);
|
|
2314
|
-
const partsLength = Math.ceil(
|
|
2589
|
+
const partsLength = Math.ceil(size2(hexValue) / 32);
|
|
2315
2590
|
const parts = [];
|
|
2316
2591
|
for (let i = 0; i < partsLength; i++) {
|
|
2317
2592
|
parts.push(padHex(slice(hexValue, i * 32, (i + 1) * 32), {
|
|
@@ -2321,7 +2596,7 @@ function encodeString(value) {
|
|
|
2321
2596
|
return {
|
|
2322
2597
|
dynamic: true,
|
|
2323
2598
|
encoded: concat([
|
|
2324
|
-
padHex(numberToHex(
|
|
2599
|
+
padHex(numberToHex(size2(hexValue), { size: 32 })),
|
|
2325
2600
|
...parts
|
|
2326
2601
|
])
|
|
2327
2602
|
};
|
|
@@ -2353,17 +2628,17 @@ function getArrayComponents(type) {
|
|
|
2353
2628
|
) : void 0;
|
|
2354
2629
|
}
|
|
2355
2630
|
|
|
2356
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2631
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeAbiParameters.js
|
|
2357
2632
|
function decodeAbiParameters(params, data) {
|
|
2358
2633
|
const bytes = typeof data === "string" ? hexToBytes(data) : data;
|
|
2359
2634
|
const cursor = createCursor(bytes);
|
|
2360
|
-
if (
|
|
2635
|
+
if (size2(bytes) === 0 && params.length > 0)
|
|
2361
2636
|
throw new AbiDecodingZeroDataError();
|
|
2362
|
-
if (
|
|
2637
|
+
if (size2(data) && size2(data) < 32)
|
|
2363
2638
|
throw new AbiDecodingDataSizeTooSmallError({
|
|
2364
2639
|
data: typeof data === "string" ? data : bytesToHex(data),
|
|
2365
2640
|
params,
|
|
2366
|
-
size:
|
|
2641
|
+
size: size2(data)
|
|
2367
2642
|
});
|
|
2368
2643
|
let consumed = 0;
|
|
2369
2644
|
const values = [];
|
|
@@ -2456,8 +2731,8 @@ function decodeBool(cursor) {
|
|
|
2456
2731
|
return [bytesToBool(cursor.readBytes(32), { size: 32 }), 32];
|
|
2457
2732
|
}
|
|
2458
2733
|
function decodeBytes(cursor, param, { staticPosition }) {
|
|
2459
|
-
const [_,
|
|
2460
|
-
if (!
|
|
2734
|
+
const [_, size3] = param.type.split("bytes");
|
|
2735
|
+
if (!size3) {
|
|
2461
2736
|
const offset = bytesToNumber(cursor.readBytes(32));
|
|
2462
2737
|
cursor.setPosition(staticPosition + offset);
|
|
2463
2738
|
const length = bytesToNumber(cursor.readBytes(32));
|
|
@@ -2469,15 +2744,15 @@ function decodeBytes(cursor, param, { staticPosition }) {
|
|
|
2469
2744
|
cursor.setPosition(staticPosition + 32);
|
|
2470
2745
|
return [bytesToHex(data), 32];
|
|
2471
2746
|
}
|
|
2472
|
-
const value = bytesToHex(cursor.readBytes(Number.parseInt(
|
|
2747
|
+
const value = bytesToHex(cursor.readBytes(Number.parseInt(size3), 32));
|
|
2473
2748
|
return [value, 32];
|
|
2474
2749
|
}
|
|
2475
2750
|
function decodeNumber(cursor, param) {
|
|
2476
2751
|
const signed = param.type.startsWith("int");
|
|
2477
|
-
const
|
|
2752
|
+
const size3 = Number.parseInt(param.type.split("int")[1] || "256");
|
|
2478
2753
|
const value = cursor.readBytes(32);
|
|
2479
2754
|
return [
|
|
2480
|
-
|
|
2755
|
+
size3 > 48 ? bytesToBigInt(value, { signed }) : bytesToNumber(value, { signed }),
|
|
2481
2756
|
32
|
|
2482
2757
|
];
|
|
2483
2758
|
}
|
|
@@ -2520,7 +2795,7 @@ function decodeString(cursor, { staticPosition }) {
|
|
|
2520
2795
|
return ["", 32];
|
|
2521
2796
|
}
|
|
2522
2797
|
const data = cursor.readBytes(length, 32);
|
|
2523
|
-
const value = bytesToString(
|
|
2798
|
+
const value = bytesToString(trim2(data));
|
|
2524
2799
|
cursor.setPosition(staticPosition + 32);
|
|
2525
2800
|
return [value, 32];
|
|
2526
2801
|
}
|
|
@@ -2540,7 +2815,7 @@ function hasDynamicChild(param) {
|
|
|
2540
2815
|
return false;
|
|
2541
2816
|
}
|
|
2542
2817
|
|
|
2543
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2818
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeErrorResult.js
|
|
2544
2819
|
function decodeErrorResult(parameters) {
|
|
2545
2820
|
const { abi, data } = parameters;
|
|
2546
2821
|
const signature = slice(data, 0, 4);
|
|
@@ -2559,16 +2834,16 @@ function decodeErrorResult(parameters) {
|
|
|
2559
2834
|
};
|
|
2560
2835
|
}
|
|
2561
2836
|
|
|
2562
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2837
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/stringify.js
|
|
2563
2838
|
var stringify = (value, replacer, space) => JSON.stringify(value, (key, value_) => {
|
|
2564
2839
|
const value2 = typeof value_ === "bigint" ? value_.toString() : value_;
|
|
2565
2840
|
return typeof replacer === "function" ? replacer(key, value2) : value2;
|
|
2566
2841
|
}, space);
|
|
2567
2842
|
|
|
2568
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2843
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/hash/toEventSelector.js
|
|
2569
2844
|
var toEventSelector = toSignatureHash;
|
|
2570
2845
|
|
|
2571
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2846
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/getAbiItem.js
|
|
2572
2847
|
function getAbiItem(parameters) {
|
|
2573
2848
|
const { abi, args = [], name } = parameters;
|
|
2574
2849
|
const isSelector = isHex(name, { strict: false });
|
|
@@ -2680,7 +2955,7 @@ function getAmbiguousTypes(sourceParameters, targetParameters, args) {
|
|
|
2680
2955
|
return;
|
|
2681
2956
|
}
|
|
2682
2957
|
|
|
2683
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2958
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/unit.js
|
|
2684
2959
|
var etherUnits = {
|
|
2685
2960
|
gwei: 9,
|
|
2686
2961
|
wei: 18
|
|
@@ -2690,7 +2965,7 @@ var gweiUnits = {
|
|
|
2690
2965
|
wei: 9
|
|
2691
2966
|
};
|
|
2692
2967
|
|
|
2693
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2968
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatUnits.js
|
|
2694
2969
|
function formatUnits(value, decimals) {
|
|
2695
2970
|
let display = value.toString();
|
|
2696
2971
|
const negative = display.startsWith("-");
|
|
@@ -2705,25 +2980,25 @@ function formatUnits(value, decimals) {
|
|
|
2705
2980
|
return `${negative ? "-" : ""}${integer || "0"}${fraction ? `.${fraction}` : ""}`;
|
|
2706
2981
|
}
|
|
2707
2982
|
|
|
2708
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2983
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatEther.js
|
|
2709
2984
|
function formatEther(wei, unit = "wei") {
|
|
2710
2985
|
return formatUnits(wei, etherUnits[unit]);
|
|
2711
2986
|
}
|
|
2712
2987
|
|
|
2713
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2988
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/unit/formatGwei.js
|
|
2714
2989
|
function formatGwei(wei, unit = "wei") {
|
|
2715
2990
|
return formatUnits(wei, gweiUnits[unit]);
|
|
2716
2991
|
}
|
|
2717
2992
|
|
|
2718
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2719
|
-
var AccountStateConflictError = class extends
|
|
2993
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/stateOverride.js
|
|
2994
|
+
var AccountStateConflictError = class extends BaseError3 {
|
|
2720
2995
|
constructor({ address }) {
|
|
2721
2996
|
super(`State for account "${address}" is set multiple times.`, {
|
|
2722
2997
|
name: "AccountStateConflictError"
|
|
2723
2998
|
});
|
|
2724
2999
|
}
|
|
2725
3000
|
};
|
|
2726
|
-
var StateAssignmentConflictError = class extends
|
|
3001
|
+
var StateAssignmentConflictError = class extends BaseError3 {
|
|
2727
3002
|
constructor() {
|
|
2728
3003
|
super("state and stateDiff are set on the same account.", {
|
|
2729
3004
|
name: "StateAssignmentConflictError"
|
|
@@ -2761,7 +3036,7 @@ function prettyStateOverride(stateOverride) {
|
|
|
2761
3036
|
}, " State Override:\n").slice(0, -1);
|
|
2762
3037
|
}
|
|
2763
3038
|
|
|
2764
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3039
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/transaction.js
|
|
2765
3040
|
function prettyPrint(args) {
|
|
2766
3041
|
const entries = Object.entries(args).map(([key, value]) => {
|
|
2767
3042
|
if (value === void 0 || value === false)
|
|
@@ -2771,7 +3046,7 @@ function prettyPrint(args) {
|
|
|
2771
3046
|
const maxLength = entries.reduce((acc, [key]) => Math.max(acc, key.length), 0);
|
|
2772
3047
|
return entries.map(([key, value]) => ` ${`${key}:`.padEnd(maxLength + 1)} ${value}`).join("\n");
|
|
2773
3048
|
}
|
|
2774
|
-
var FeeConflictError = class extends
|
|
3049
|
+
var FeeConflictError = class extends BaseError3 {
|
|
2775
3050
|
constructor() {
|
|
2776
3051
|
super([
|
|
2777
3052
|
"Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.",
|
|
@@ -2780,12 +3055,12 @@ var FeeConflictError = class extends BaseError2 {
|
|
|
2780
3055
|
}
|
|
2781
3056
|
};
|
|
2782
3057
|
|
|
2783
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3058
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/utils.js
|
|
2784
3059
|
var getUrl = (url) => url;
|
|
2785
3060
|
|
|
2786
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2787
|
-
var CallExecutionError = class extends
|
|
2788
|
-
constructor(cause, { account: account_, docsPath:
|
|
3061
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/contract.js
|
|
3062
|
+
var CallExecutionError = class extends BaseError3 {
|
|
3063
|
+
constructor(cause, { account: account_, docsPath: docsPath6, chain, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride }) {
|
|
2789
3064
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
2790
3065
|
let prettyArgs = prettyPrint({
|
|
2791
3066
|
from: account?.address,
|
|
@@ -2804,7 +3079,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2804
3079
|
}
|
|
2805
3080
|
super(cause.shortMessage, {
|
|
2806
3081
|
cause,
|
|
2807
|
-
docsPath:
|
|
3082
|
+
docsPath: docsPath6,
|
|
2808
3083
|
metaMessages: [
|
|
2809
3084
|
...cause.metaMessages ? [...cause.metaMessages, " "] : [],
|
|
2810
3085
|
"Raw Call Arguments:",
|
|
@@ -2821,7 +3096,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
2821
3096
|
this.cause = cause;
|
|
2822
3097
|
}
|
|
2823
3098
|
};
|
|
2824
|
-
var CounterfactualDeploymentFailedError = class extends
|
|
3099
|
+
var CounterfactualDeploymentFailedError = class extends BaseError3 {
|
|
2825
3100
|
constructor({ factory }) {
|
|
2826
3101
|
super(`Deployment for counterfactual contract call failed${factory ? ` for factory "${factory}".` : ""}`, {
|
|
2827
3102
|
metaMessages: [
|
|
@@ -2833,7 +3108,7 @@ var CounterfactualDeploymentFailedError = class extends BaseError2 {
|
|
|
2833
3108
|
});
|
|
2834
3109
|
}
|
|
2835
3110
|
};
|
|
2836
|
-
var RawContractError = class extends
|
|
3111
|
+
var RawContractError = class extends BaseError3 {
|
|
2837
3112
|
constructor({ data, message }) {
|
|
2838
3113
|
super(message || "", { name: "RawContractError" });
|
|
2839
3114
|
Object.defineProperty(this, "code", {
|
|
@@ -2852,7 +3127,7 @@ var RawContractError = class extends BaseError2 {
|
|
|
2852
3127
|
}
|
|
2853
3128
|
};
|
|
2854
3129
|
|
|
2855
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3130
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeFunctionResult.js
|
|
2856
3131
|
var docsPath = "/docs/contract/decodeFunctionResult";
|
|
2857
3132
|
function decodeFunctionResult(parameters) {
|
|
2858
3133
|
const { abi, args, functionName, data } = parameters;
|
|
@@ -2875,7 +3150,7 @@ function decodeFunctionResult(parameters) {
|
|
|
2875
3150
|
return void 0;
|
|
2876
3151
|
}
|
|
2877
3152
|
|
|
2878
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3153
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeDeployData.js
|
|
2879
3154
|
var docsPath2 = "/docs/contract/encodeDeployData";
|
|
2880
3155
|
function encodeDeployData(parameters) {
|
|
2881
3156
|
const { abi, args, bytecode } = parameters;
|
|
@@ -2892,7 +3167,7 @@ function encodeDeployData(parameters) {
|
|
|
2892
3167
|
return concatHex([bytecode, data]);
|
|
2893
3168
|
}
|
|
2894
3169
|
|
|
2895
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3170
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/prepareEncodeFunctionData.js
|
|
2896
3171
|
var docsPath3 = "/docs/contract/encodeFunctionData";
|
|
2897
3172
|
function prepareEncodeFunctionData(parameters) {
|
|
2898
3173
|
const { abi, args, functionName } = parameters;
|
|
@@ -2915,7 +3190,7 @@ function prepareEncodeFunctionData(parameters) {
|
|
|
2915
3190
|
};
|
|
2916
3191
|
}
|
|
2917
3192
|
|
|
2918
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3193
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeFunctionData.js
|
|
2919
3194
|
function encodeFunctionData(parameters) {
|
|
2920
3195
|
const { args } = parameters;
|
|
2921
3196
|
const { abi, functionName } = (() => {
|
|
@@ -2929,7 +3204,7 @@ function encodeFunctionData(parameters) {
|
|
|
2929
3204
|
return concatHex([signature, data ?? "0x"]);
|
|
2930
3205
|
}
|
|
2931
3206
|
|
|
2932
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3207
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/chain/getChainContractAddress.js
|
|
2933
3208
|
function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
2934
3209
|
const contract = chain?.contracts?.[name];
|
|
2935
3210
|
if (!contract)
|
|
@@ -2949,8 +3224,8 @@ function getChainContractAddress({ blockNumber, chain, contract: name }) {
|
|
|
2949
3224
|
return contract.address;
|
|
2950
3225
|
}
|
|
2951
3226
|
|
|
2952
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
2953
|
-
var ExecutionRevertedError = class extends
|
|
3227
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/node.js
|
|
3228
|
+
var ExecutionRevertedError = class extends BaseError3 {
|
|
2954
3229
|
constructor({ cause, message } = {}) {
|
|
2955
3230
|
const reason = message?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
2956
3231
|
super(`Execution reverted ${reason ? `with reason: ${reason}` : "for an unknown reason"}.`, {
|
|
@@ -2971,7 +3246,7 @@ Object.defineProperty(ExecutionRevertedError, "nodeMessage", {
|
|
|
2971
3246
|
writable: true,
|
|
2972
3247
|
value: /execution reverted/
|
|
2973
3248
|
});
|
|
2974
|
-
var FeeCapTooHighError = class extends
|
|
3249
|
+
var FeeCapTooHighError = class extends BaseError3 {
|
|
2975
3250
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
2976
3251
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
2977
3252
|
cause,
|
|
@@ -2985,7 +3260,7 @@ Object.defineProperty(FeeCapTooHighError, "nodeMessage", {
|
|
|
2985
3260
|
writable: true,
|
|
2986
3261
|
value: /max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/
|
|
2987
3262
|
});
|
|
2988
|
-
var FeeCapTooLowError = class extends
|
|
3263
|
+
var FeeCapTooLowError = class extends BaseError3 {
|
|
2989
3264
|
constructor({ cause, maxFeePerGas } = {}) {
|
|
2990
3265
|
super(`The fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
2991
3266
|
cause,
|
|
@@ -2999,7 +3274,7 @@ Object.defineProperty(FeeCapTooLowError, "nodeMessage", {
|
|
|
2999
3274
|
writable: true,
|
|
3000
3275
|
value: /max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/
|
|
3001
3276
|
});
|
|
3002
|
-
var NonceTooHighError = class extends
|
|
3277
|
+
var NonceTooHighError = class extends BaseError3 {
|
|
3003
3278
|
constructor({ cause, nonce } = {}) {
|
|
3004
3279
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is higher than the next one expected.`, { cause, name: "NonceTooHighError" });
|
|
3005
3280
|
}
|
|
@@ -3010,7 +3285,7 @@ Object.defineProperty(NonceTooHighError, "nodeMessage", {
|
|
|
3010
3285
|
writable: true,
|
|
3011
3286
|
value: /nonce too high/
|
|
3012
3287
|
});
|
|
3013
|
-
var NonceTooLowError = class extends
|
|
3288
|
+
var NonceTooLowError = class extends BaseError3 {
|
|
3014
3289
|
constructor({ cause, nonce } = {}) {
|
|
3015
3290
|
super([
|
|
3016
3291
|
`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}is lower than the current nonce of the account.`,
|
|
@@ -3024,7 +3299,7 @@ Object.defineProperty(NonceTooLowError, "nodeMessage", {
|
|
|
3024
3299
|
writable: true,
|
|
3025
3300
|
value: /nonce too low|transaction already imported|already known/
|
|
3026
3301
|
});
|
|
3027
|
-
var NonceMaxValueError = class extends
|
|
3302
|
+
var NonceMaxValueError = class extends BaseError3 {
|
|
3028
3303
|
constructor({ cause, nonce } = {}) {
|
|
3029
3304
|
super(`Nonce provided for the transaction ${nonce ? `(${nonce}) ` : ""}exceeds the maximum allowed nonce.`, { cause, name: "NonceMaxValueError" });
|
|
3030
3305
|
}
|
|
@@ -3035,7 +3310,7 @@ Object.defineProperty(NonceMaxValueError, "nodeMessage", {
|
|
|
3035
3310
|
writable: true,
|
|
3036
3311
|
value: /nonce has max value/
|
|
3037
3312
|
});
|
|
3038
|
-
var InsufficientFundsError = class extends
|
|
3313
|
+
var InsufficientFundsError = class extends BaseError3 {
|
|
3039
3314
|
constructor({ cause } = {}) {
|
|
3040
3315
|
super([
|
|
3041
3316
|
"The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."
|
|
@@ -3061,7 +3336,7 @@ Object.defineProperty(InsufficientFundsError, "nodeMessage", {
|
|
|
3061
3336
|
writable: true,
|
|
3062
3337
|
value: /insufficient funds|exceeds transaction sender account balance/
|
|
3063
3338
|
});
|
|
3064
|
-
var IntrinsicGasTooHighError = class extends
|
|
3339
|
+
var IntrinsicGasTooHighError = class extends BaseError3 {
|
|
3065
3340
|
constructor({ cause, gas } = {}) {
|
|
3066
3341
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction exceeds the limit allowed for the block.`, {
|
|
3067
3342
|
cause,
|
|
@@ -3075,7 +3350,7 @@ Object.defineProperty(IntrinsicGasTooHighError, "nodeMessage", {
|
|
|
3075
3350
|
writable: true,
|
|
3076
3351
|
value: /intrinsic gas too high|gas limit reached/
|
|
3077
3352
|
});
|
|
3078
|
-
var IntrinsicGasTooLowError = class extends
|
|
3353
|
+
var IntrinsicGasTooLowError = class extends BaseError3 {
|
|
3079
3354
|
constructor({ cause, gas } = {}) {
|
|
3080
3355
|
super(`The amount of gas ${gas ? `(${gas}) ` : ""}provided for the transaction is too low.`, {
|
|
3081
3356
|
cause,
|
|
@@ -3089,7 +3364,7 @@ Object.defineProperty(IntrinsicGasTooLowError, "nodeMessage", {
|
|
|
3089
3364
|
writable: true,
|
|
3090
3365
|
value: /intrinsic gas too low/
|
|
3091
3366
|
});
|
|
3092
|
-
var TransactionTypeNotSupportedError = class extends
|
|
3367
|
+
var TransactionTypeNotSupportedError = class extends BaseError3 {
|
|
3093
3368
|
constructor({ cause }) {
|
|
3094
3369
|
super("The transaction type is not supported for this chain.", {
|
|
3095
3370
|
cause,
|
|
@@ -3103,7 +3378,7 @@ Object.defineProperty(TransactionTypeNotSupportedError, "nodeMessage", {
|
|
|
3103
3378
|
writable: true,
|
|
3104
3379
|
value: /transaction type not valid/
|
|
3105
3380
|
});
|
|
3106
|
-
var TipAboveFeeCapError = class extends
|
|
3381
|
+
var TipAboveFeeCapError = class extends BaseError3 {
|
|
3107
3382
|
constructor({ cause, maxPriorityFeePerGas, maxFeePerGas } = {}) {
|
|
3108
3383
|
super([
|
|
3109
3384
|
`The provided tip (\`maxPriorityFeePerGas\`${maxPriorityFeePerGas ? ` = ${formatGwei(maxPriorityFeePerGas)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ""}).`
|
|
@@ -3119,7 +3394,7 @@ Object.defineProperty(TipAboveFeeCapError, "nodeMessage", {
|
|
|
3119
3394
|
writable: true,
|
|
3120
3395
|
value: /max priority fee per gas higher than max fee per gas|tip higher than fee cap/
|
|
3121
3396
|
});
|
|
3122
|
-
var UnknownNodeError = class extends
|
|
3397
|
+
var UnknownNodeError = class extends BaseError3 {
|
|
3123
3398
|
constructor({ cause }) {
|
|
3124
3399
|
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
|
3125
3400
|
cause,
|
|
@@ -3128,8 +3403,8 @@ var UnknownNodeError = class extends BaseError2 {
|
|
|
3128
3403
|
}
|
|
3129
3404
|
};
|
|
3130
3405
|
|
|
3131
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3132
|
-
var HttpRequestError = class extends
|
|
3406
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/request.js
|
|
3407
|
+
var HttpRequestError = class extends BaseError3 {
|
|
3133
3408
|
constructor({ body, cause, details, headers, status, url }) {
|
|
3134
3409
|
super("HTTP request failed.", {
|
|
3135
3410
|
cause,
|
|
@@ -3172,11 +3447,11 @@ var HttpRequestError = class extends BaseError2 {
|
|
|
3172
3447
|
}
|
|
3173
3448
|
};
|
|
3174
3449
|
|
|
3175
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3450
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/errors/getNodeError.js
|
|
3176
3451
|
function getNodeError(err, args) {
|
|
3177
3452
|
const message = (err.details || "").toLowerCase();
|
|
3178
|
-
const executionRevertedError = err instanceof
|
|
3179
|
-
if (executionRevertedError instanceof
|
|
3453
|
+
const executionRevertedError = err instanceof BaseError3 ? err.walk((e) => e?.code === ExecutionRevertedError.code) : err;
|
|
3454
|
+
if (executionRevertedError instanceof BaseError3)
|
|
3180
3455
|
return new ExecutionRevertedError({
|
|
3181
3456
|
cause: err,
|
|
3182
3457
|
message: executionRevertedError.details
|
|
@@ -3221,8 +3496,8 @@ function getNodeError(err, args) {
|
|
|
3221
3496
|
});
|
|
3222
3497
|
}
|
|
3223
3498
|
|
|
3224
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3225
|
-
function getCallError(err, { docsPath:
|
|
3499
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/errors/getCallError.js
|
|
3500
|
+
function getCallError(err, { docsPath: docsPath6, ...args }) {
|
|
3226
3501
|
const cause = (() => {
|
|
3227
3502
|
const cause2 = getNodeError(err, args);
|
|
3228
3503
|
if (cause2 instanceof UnknownNodeError)
|
|
@@ -3230,12 +3505,12 @@ function getCallError(err, { docsPath: docsPath4, ...args }) {
|
|
|
3230
3505
|
return cause2;
|
|
3231
3506
|
})();
|
|
3232
3507
|
return new CallExecutionError(cause, {
|
|
3233
|
-
docsPath:
|
|
3508
|
+
docsPath: docsPath6,
|
|
3234
3509
|
...args
|
|
3235
3510
|
});
|
|
3236
3511
|
}
|
|
3237
3512
|
|
|
3238
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3513
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/formatters/extract.js
|
|
3239
3514
|
function extract(value_, { format }) {
|
|
3240
3515
|
if (!format)
|
|
3241
3516
|
return {};
|
|
@@ -3254,7 +3529,7 @@ function extract(value_, { format }) {
|
|
|
3254
3529
|
return value;
|
|
3255
3530
|
}
|
|
3256
3531
|
|
|
3257
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3532
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/formatters/transactionRequest.js
|
|
3258
3533
|
var rpcTransactionType = {
|
|
3259
3534
|
legacy: "0x0",
|
|
3260
3535
|
eip2930: "0x1",
|
|
@@ -3302,9 +3577,9 @@ function formatTransactionRequest(request) {
|
|
|
3302
3577
|
}
|
|
3303
3578
|
function formatAuthorizationList(authorizationList) {
|
|
3304
3579
|
return authorizationList.map((authorization) => ({
|
|
3305
|
-
address: authorization.
|
|
3306
|
-
r: authorization.r,
|
|
3307
|
-
s: authorization.s,
|
|
3580
|
+
address: authorization.address,
|
|
3581
|
+
r: authorization.r ? numberToHex(BigInt(authorization.r)) : authorization.r,
|
|
3582
|
+
s: authorization.s ? numberToHex(BigInt(authorization.s)) : authorization.s,
|
|
3308
3583
|
chainId: numberToHex(authorization.chainId),
|
|
3309
3584
|
nonce: numberToHex(authorization.nonce),
|
|
3310
3585
|
...typeof authorization.yParity !== "undefined" ? { yParity: numberToHex(authorization.yParity) } : {},
|
|
@@ -3312,7 +3587,7 @@ function formatAuthorizationList(authorizationList) {
|
|
|
3312
3587
|
}));
|
|
3313
3588
|
}
|
|
3314
3589
|
|
|
3315
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3590
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/promise/withResolvers.js
|
|
3316
3591
|
function withResolvers() {
|
|
3317
3592
|
let resolve = () => void 0;
|
|
3318
3593
|
let reject = () => void 0;
|
|
@@ -3323,7 +3598,7 @@ function withResolvers() {
|
|
|
3323
3598
|
return { promise, resolve, reject };
|
|
3324
3599
|
}
|
|
3325
3600
|
|
|
3326
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3601
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/promise/createBatchScheduler.js
|
|
3327
3602
|
var schedulerCache = /* @__PURE__ */ new Map();
|
|
3328
3603
|
function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
3329
3604
|
const exec = async () => {
|
|
@@ -3369,7 +3644,7 @@ function createBatchScheduler({ fn, id, shouldSplitBatch, wait = 0, sort }) {
|
|
|
3369
3644
|
};
|
|
3370
3645
|
}
|
|
3371
3646
|
|
|
3372
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3647
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/stateOverride.js
|
|
3373
3648
|
function serializeStateMapping(stateMapping) {
|
|
3374
3649
|
if (!stateMapping || stateMapping.length === 0)
|
|
3375
3650
|
return void 0;
|
|
@@ -3422,7 +3697,7 @@ function serializeStateOverride(parameters) {
|
|
|
3422
3697
|
return rpcStateOverride;
|
|
3423
3698
|
}
|
|
3424
3699
|
|
|
3425
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3700
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/constants/number.js
|
|
3426
3701
|
var maxInt8 = 2n ** (8n - 1n) - 1n;
|
|
3427
3702
|
var maxInt16 = 2n ** (16n - 1n) - 1n;
|
|
3428
3703
|
var maxInt24 = 2n ** (24n - 1n) - 1n;
|
|
@@ -3520,7 +3795,7 @@ var maxUint240 = 2n ** 240n - 1n;
|
|
|
3520
3795
|
var maxUint248 = 2n ** 248n - 1n;
|
|
3521
3796
|
var maxUint256 = 2n ** 256n - 1n;
|
|
3522
3797
|
|
|
3523
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3798
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/transaction/assertRequest.js
|
|
3524
3799
|
function assertRequest(args) {
|
|
3525
3800
|
const { account: account_, gasPrice, maxFeePerGas, maxPriorityFeePerGas, to } = args;
|
|
3526
3801
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
@@ -3536,14 +3811,14 @@ function assertRequest(args) {
|
|
|
3536
3811
|
throw new TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
|
3537
3812
|
}
|
|
3538
3813
|
|
|
3539
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3814
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/actions/public/call.js
|
|
3540
3815
|
async function call(client, args) {
|
|
3541
|
-
const { account: account_ = client.account, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = "
|
|
3816
|
+
const { account: account_ = client.account, authorizationList, batch = Boolean(client.batch?.multicall), blockNumber, blockTag = "pending", accessList, blobs, blockOverrides, code, data: data_, factory, factoryData, gas, gasPrice, maxFeePerBlobGas, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, stateOverride, ...rest } = args;
|
|
3542
3817
|
const account = account_ ? parseAccount(account_) : void 0;
|
|
3543
3818
|
if (code && (factory || factoryData))
|
|
3544
|
-
throw new
|
|
3819
|
+
throw new BaseError3("Cannot provide both `code` & `factory`/`factoryData` as parameters.");
|
|
3545
3820
|
if (code && to)
|
|
3546
|
-
throw new
|
|
3821
|
+
throw new BaseError3("Cannot provide both `code` & `to` as parameters.");
|
|
3547
3822
|
const deploylessCallViaBytecode = code && data_;
|
|
3548
3823
|
const deploylessCallViaFactory = factory && factoryData && to && data_;
|
|
3549
3824
|
const deploylessCall = deploylessCallViaBytecode || deploylessCallViaFactory;
|
|
@@ -3564,8 +3839,9 @@ async function call(client, args) {
|
|
|
3564
3839
|
})();
|
|
3565
3840
|
try {
|
|
3566
3841
|
assertRequest(args);
|
|
3567
|
-
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
|
3842
|
+
const blockNumberHex = typeof blockNumber === "bigint" ? numberToHex(blockNumber) : void 0;
|
|
3568
3843
|
const block = blockNumberHex || blockTag;
|
|
3844
|
+
const rpcBlockOverrides = blockOverrides ? toRpc2(blockOverrides) : void 0;
|
|
3569
3845
|
const rpcStateOverride = serializeStateOverride(stateOverride);
|
|
3570
3846
|
const chainFormat = client.chain?.formatters?.transactionRequest?.format;
|
|
3571
3847
|
const format = chainFormat || formatTransactionRequest;
|
|
@@ -3574,6 +3850,7 @@ async function call(client, args) {
|
|
|
3574
3850
|
...extract(rest, { format: chainFormat }),
|
|
3575
3851
|
from: account?.address,
|
|
3576
3852
|
accessList,
|
|
3853
|
+
authorizationList,
|
|
3577
3854
|
blobs,
|
|
3578
3855
|
data,
|
|
3579
3856
|
gas,
|
|
@@ -3585,7 +3862,7 @@ async function call(client, args) {
|
|
|
3585
3862
|
to: deploylessCall ? void 0 : to,
|
|
3586
3863
|
value
|
|
3587
3864
|
});
|
|
3588
|
-
if (batch && shouldPerformMulticall({ request }) && !rpcStateOverride) {
|
|
3865
|
+
if (batch && shouldPerformMulticall({ request }) && !rpcStateOverride && !rpcBlockOverrides) {
|
|
3589
3866
|
try {
|
|
3590
3867
|
return await scheduleMulticall(client, {
|
|
3591
3868
|
...request,
|
|
@@ -3597,20 +3874,29 @@ async function call(client, args) {
|
|
|
3597
3874
|
throw err;
|
|
3598
3875
|
}
|
|
3599
3876
|
}
|
|
3877
|
+
const params = (() => {
|
|
3878
|
+
const base = [
|
|
3879
|
+
request,
|
|
3880
|
+
block
|
|
3881
|
+
];
|
|
3882
|
+
if (rpcStateOverride && rpcBlockOverrides)
|
|
3883
|
+
return [...base, rpcStateOverride, rpcBlockOverrides];
|
|
3884
|
+
if (rpcStateOverride)
|
|
3885
|
+
return [...base, rpcStateOverride];
|
|
3886
|
+
if (rpcBlockOverrides)
|
|
3887
|
+
return [...base, {}, rpcBlockOverrides];
|
|
3888
|
+
return base;
|
|
3889
|
+
})();
|
|
3600
3890
|
const response = await client.request({
|
|
3601
3891
|
method: "eth_call",
|
|
3602
|
-
params
|
|
3603
|
-
request,
|
|
3604
|
-
block,
|
|
3605
|
-
rpcStateOverride
|
|
3606
|
-
] : [request, block]
|
|
3892
|
+
params
|
|
3607
3893
|
});
|
|
3608
3894
|
if (response === "0x")
|
|
3609
3895
|
return { data: void 0 };
|
|
3610
3896
|
return { data: response };
|
|
3611
3897
|
} catch (err) {
|
|
3612
3898
|
const data2 = getRevertErrorData(err);
|
|
3613
|
-
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-
|
|
3899
|
+
const { offchainLookup: offchainLookup2, offchainLookupSignature: offchainLookupSignature2 } = await import("./ccip-2WG2FVCT.js");
|
|
3614
3900
|
if (client.ccipRead !== false && data2?.slice(0, 10) === offchainLookupSignature2 && to)
|
|
3615
3901
|
return { data: await offchainLookup2(client, { data: data2, to }) };
|
|
3616
3902
|
if (deploylessCall && data2?.slice(0, 10) === "0x101bb98d")
|
|
@@ -3636,7 +3922,7 @@ function shouldPerformMulticall({ request }) {
|
|
|
3636
3922
|
}
|
|
3637
3923
|
async function scheduleMulticall(client, args) {
|
|
3638
3924
|
const { batchSize = 1024, wait = 0 } = typeof client.batch?.multicall === "object" ? client.batch.multicall : {};
|
|
3639
|
-
const { blockNumber, blockTag = "
|
|
3925
|
+
const { blockNumber, blockTag = "pending", data, multicallAddress: multicallAddress_, to } = args;
|
|
3640
3926
|
let multicallAddress = multicallAddress_;
|
|
3641
3927
|
if (!multicallAddress) {
|
|
3642
3928
|
if (!client.chain)
|
|
@@ -3647,14 +3933,14 @@ async function scheduleMulticall(client, args) {
|
|
|
3647
3933
|
contract: "multicall3"
|
|
3648
3934
|
});
|
|
3649
3935
|
}
|
|
3650
|
-
const blockNumberHex = blockNumber ? numberToHex(blockNumber) : void 0;
|
|
3936
|
+
const blockNumberHex = typeof blockNumber === "bigint" ? numberToHex(blockNumber) : void 0;
|
|
3651
3937
|
const block = blockNumberHex || blockTag;
|
|
3652
3938
|
const { schedule } = createBatchScheduler({
|
|
3653
3939
|
id: `${client.uid}.${block}`,
|
|
3654
3940
|
wait,
|
|
3655
3941
|
shouldSplitBatch(args2) {
|
|
3656
|
-
const
|
|
3657
|
-
return
|
|
3942
|
+
const size3 = args2.reduce((size4, { data: data2 }) => size4 + (data2.length - 2), 0);
|
|
3943
|
+
return size3 > batchSize * 2;
|
|
3658
3944
|
},
|
|
3659
3945
|
fn: async (requests) => {
|
|
3660
3946
|
const calls = requests.map((request) => ({
|
|
@@ -3709,14 +3995,14 @@ function toDeploylessCallViaFactoryData(parameters) {
|
|
|
3709
3995
|
});
|
|
3710
3996
|
}
|
|
3711
3997
|
function getRevertErrorData(err) {
|
|
3712
|
-
if (!(err instanceof
|
|
3998
|
+
if (!(err instanceof BaseError3))
|
|
3713
3999
|
return void 0;
|
|
3714
4000
|
const error = err.walk();
|
|
3715
4001
|
return typeof error?.data === "object" ? error.data?.data : error.data;
|
|
3716
4002
|
}
|
|
3717
4003
|
|
|
3718
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
3719
|
-
var OffchainLookupError = class extends
|
|
4004
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js
|
|
4005
|
+
var OffchainLookupError = class extends BaseError3 {
|
|
3720
4006
|
constructor({ callbackSelector, cause, data, extraData, sender, urls }) {
|
|
3721
4007
|
super(cause.shortMessage || "An error occurred while fetching for an offchain result.", {
|
|
3722
4008
|
cause,
|
|
@@ -3737,7 +4023,7 @@ var OffchainLookupError = class extends BaseError2 {
|
|
|
3737
4023
|
});
|
|
3738
4024
|
}
|
|
3739
4025
|
};
|
|
3740
|
-
var OffchainLookupResponseMalformedError = class extends
|
|
4026
|
+
var OffchainLookupResponseMalformedError = class extends BaseError3 {
|
|
3741
4027
|
constructor({ result, url }) {
|
|
3742
4028
|
super("Offchain gateway response is malformed. Response data must be a hex value.", {
|
|
3743
4029
|
metaMessages: [
|
|
@@ -3748,7 +4034,7 @@ var OffchainLookupResponseMalformedError = class extends BaseError2 {
|
|
|
3748
4034
|
});
|
|
3749
4035
|
}
|
|
3750
4036
|
};
|
|
3751
|
-
var OffchainLookupSenderMismatchError = class extends
|
|
4037
|
+
var OffchainLookupSenderMismatchError = class extends BaseError3 {
|
|
3752
4038
|
constructor({ sender, to }) {
|
|
3753
4039
|
super("Reverted sender address does not match target contract address (`to`).", {
|
|
3754
4040
|
metaMessages: [
|
|
@@ -3760,7 +4046,7 @@ var OffchainLookupSenderMismatchError = class extends BaseError2 {
|
|
|
3760
4046
|
}
|
|
3761
4047
|
};
|
|
3762
4048
|
|
|
3763
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4049
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/address/isAddressEqual.js
|
|
3764
4050
|
function isAddressEqual(a, b) {
|
|
3765
4051
|
if (!isAddress(a, { strict: false }))
|
|
3766
4052
|
throw new InvalidAddressError({ address: a });
|
|
@@ -3769,7 +4055,109 @@ function isAddressEqual(a, b) {
|
|
|
3769
4055
|
return a.toLowerCase() === b.toLowerCase();
|
|
3770
4056
|
}
|
|
3771
4057
|
|
|
3772
|
-
// ../../node_modules/.pnpm/viem@2.
|
|
4058
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/decodeFunctionData.js
|
|
4059
|
+
function decodeFunctionData(parameters) {
|
|
4060
|
+
const { abi, data } = parameters;
|
|
4061
|
+
const signature = slice(data, 0, 4);
|
|
4062
|
+
const description = abi.find((x) => x.type === "function" && signature === toFunctionSelector(formatAbiItem2(x)));
|
|
4063
|
+
if (!description)
|
|
4064
|
+
throw new AbiFunctionSignatureNotFoundError(signature, {
|
|
4065
|
+
docsPath: "/docs/contract/decodeFunctionData"
|
|
4066
|
+
});
|
|
4067
|
+
return {
|
|
4068
|
+
functionName: description.name,
|
|
4069
|
+
args: "inputs" in description && description.inputs && description.inputs.length > 0 ? decodeAbiParameters(description.inputs, slice(data, 4)) : void 0
|
|
4070
|
+
};
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeErrorResult.js
|
|
4074
|
+
var docsPath4 = "/docs/contract/encodeErrorResult";
|
|
4075
|
+
function encodeErrorResult(parameters) {
|
|
4076
|
+
const { abi, errorName, args } = parameters;
|
|
4077
|
+
let abiItem = abi[0];
|
|
4078
|
+
if (errorName) {
|
|
4079
|
+
const item = getAbiItem({ abi, args, name: errorName });
|
|
4080
|
+
if (!item)
|
|
4081
|
+
throw new AbiErrorNotFoundError(errorName, { docsPath: docsPath4 });
|
|
4082
|
+
abiItem = item;
|
|
4083
|
+
}
|
|
4084
|
+
if (abiItem.type !== "error")
|
|
4085
|
+
throw new AbiErrorNotFoundError(void 0, { docsPath: docsPath4 });
|
|
4086
|
+
const definition = formatAbiItem2(abiItem);
|
|
4087
|
+
const signature = toFunctionSelector(definition);
|
|
4088
|
+
let data = "0x";
|
|
4089
|
+
if (args && args.length > 0) {
|
|
4090
|
+
if (!abiItem.inputs)
|
|
4091
|
+
throw new AbiErrorInputsNotFoundError(abiItem.name, { docsPath: docsPath4 });
|
|
4092
|
+
data = encodeAbiParameters(abiItem.inputs, args);
|
|
4093
|
+
}
|
|
4094
|
+
return concatHex([signature, data]);
|
|
4095
|
+
}
|
|
4096
|
+
|
|
4097
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/abi/encodeFunctionResult.js
|
|
4098
|
+
var docsPath5 = "/docs/contract/encodeFunctionResult";
|
|
4099
|
+
function encodeFunctionResult(parameters) {
|
|
4100
|
+
const { abi, functionName, result } = parameters;
|
|
4101
|
+
let abiItem = abi[0];
|
|
4102
|
+
if (functionName) {
|
|
4103
|
+
const item = getAbiItem({ abi, name: functionName });
|
|
4104
|
+
if (!item)
|
|
4105
|
+
throw new AbiFunctionNotFoundError(functionName, { docsPath: docsPath5 });
|
|
4106
|
+
abiItem = item;
|
|
4107
|
+
}
|
|
4108
|
+
if (abiItem.type !== "function")
|
|
4109
|
+
throw new AbiFunctionNotFoundError(void 0, { docsPath: docsPath5 });
|
|
4110
|
+
if (!abiItem.outputs)
|
|
4111
|
+
throw new AbiFunctionOutputsNotFoundError(abiItem.name, { docsPath: docsPath5 });
|
|
4112
|
+
const values = (() => {
|
|
4113
|
+
if (abiItem.outputs.length === 0)
|
|
4114
|
+
return [];
|
|
4115
|
+
if (abiItem.outputs.length === 1)
|
|
4116
|
+
return [result];
|
|
4117
|
+
if (Array.isArray(result))
|
|
4118
|
+
return result;
|
|
4119
|
+
throw new InvalidArrayError(result);
|
|
4120
|
+
})();
|
|
4121
|
+
return encodeAbiParameters(abiItem.outputs, values);
|
|
4122
|
+
}
|
|
4123
|
+
|
|
4124
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/ens/localBatchGatewayRequest.js
|
|
4125
|
+
var localBatchGatewayUrl = "x-batch-gateway:true";
|
|
4126
|
+
async function localBatchGatewayRequest(parameters) {
|
|
4127
|
+
const { data, ccipRequest: ccipRequest2 } = parameters;
|
|
4128
|
+
const { args: [queries] } = decodeFunctionData({ abi: batchGatewayAbi, data });
|
|
4129
|
+
const failures = [];
|
|
4130
|
+
const responses = [];
|
|
4131
|
+
await Promise.all(queries.map(async (query, i) => {
|
|
4132
|
+
try {
|
|
4133
|
+
responses[i] = await ccipRequest2(query);
|
|
4134
|
+
failures[i] = false;
|
|
4135
|
+
} catch (err) {
|
|
4136
|
+
failures[i] = true;
|
|
4137
|
+
responses[i] = encodeError(err);
|
|
4138
|
+
}
|
|
4139
|
+
}));
|
|
4140
|
+
return encodeFunctionResult({
|
|
4141
|
+
abi: batchGatewayAbi,
|
|
4142
|
+
functionName: "query",
|
|
4143
|
+
result: [failures, responses]
|
|
4144
|
+
});
|
|
4145
|
+
}
|
|
4146
|
+
function encodeError(error) {
|
|
4147
|
+
if (error.name === "HttpRequestError" && error.status)
|
|
4148
|
+
return encodeErrorResult({
|
|
4149
|
+
abi: batchGatewayAbi,
|
|
4150
|
+
errorName: "HttpError",
|
|
4151
|
+
args: [error.status, error.shortMessage]
|
|
4152
|
+
});
|
|
4153
|
+
return encodeErrorResult({
|
|
4154
|
+
abi: [solidityError],
|
|
4155
|
+
errorName: "Error",
|
|
4156
|
+
args: ["shortMessage" in error ? error.shortMessage : error.message]
|
|
4157
|
+
});
|
|
4158
|
+
}
|
|
4159
|
+
|
|
4160
|
+
// ../../node_modules/.pnpm/viem@2.30.5_bufferutil@4.0.8_typescript@5.4.2_utf-8-validate@5.0.10_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js
|
|
3773
4161
|
var offchainLookupSignature = "0x556f1830";
|
|
3774
4162
|
var offchainLookupAbiItem = {
|
|
3775
4163
|
name: "OffchainLookup",
|
|
@@ -3808,7 +4196,10 @@ async function offchainLookup(client, { blockNumber, blockTag, data, to }) {
|
|
|
3808
4196
|
try {
|
|
3809
4197
|
if (!isAddressEqual(to, sender))
|
|
3810
4198
|
throw new OffchainLookupSenderMismatchError({ sender, to });
|
|
3811
|
-
const result = await
|
|
4199
|
+
const result = urls.includes(localBatchGatewayUrl) ? await localBatchGatewayRequest({
|
|
4200
|
+
data: callData,
|
|
4201
|
+
ccipRequest: ccipRequest_
|
|
4202
|
+
}) : await ccipRequest_({ data: callData, sender, urls });
|
|
3812
4203
|
const { data: data_ } = await call(client, {
|
|
3813
4204
|
blockNumber,
|
|
3814
4205
|
blockTag,
|
|
@@ -3838,7 +4229,7 @@ async function ccipRequest({ data, sender, urls }) {
|
|
|
3838
4229
|
const body = method === "POST" ? { data, sender } : void 0;
|
|
3839
4230
|
const headers = method === "POST" ? { "Content-Type": "application/json" } : {};
|
|
3840
4231
|
try {
|
|
3841
|
-
const response = await fetch(url.replace("{sender}", sender).replace("{data}", data), {
|
|
4232
|
+
const response = await fetch(url.replace("{sender}", sender.toLowerCase()).replace("{data}", data), {
|
|
3842
4233
|
body: JSON.stringify(body),
|
|
3843
4234
|
headers,
|
|
3844
4235
|
method
|
|
@@ -3886,4 +4277,4 @@ export {
|
|
|
3886
4277
|
offchainLookup,
|
|
3887
4278
|
ccipRequest
|
|
3888
4279
|
};
|
|
3889
|
-
//# sourceMappingURL=chunk-
|
|
4280
|
+
//# sourceMappingURL=chunk-72CUSHOS.js.map
|