@nomicfoundation/hardhat-utils 4.2.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/src/abi.d.ts +79 -0
  3. package/dist/src/abi.d.ts.map +1 -0
  4. package/dist/src/abi.js +114 -0
  5. package/dist/src/abi.js.map +1 -0
  6. package/dist/src/errors/abi.d.ts +93 -0
  7. package/dist/src/errors/abi.d.ts.map +1 -0
  8. package/dist/src/errors/abi.js +117 -0
  9. package/dist/src/errors/abi.js.map +1 -0
  10. package/dist/src/errors/request.d.ts +4 -0
  11. package/dist/src/errors/request.d.ts.map +1 -1
  12. package/dist/src/errors/request.js +7 -0
  13. package/dist/src/errors/request.js.map +1 -1
  14. package/dist/src/eth.d.ts +9 -0
  15. package/dist/src/eth.d.ts.map +1 -1
  16. package/dist/src/eth.js +16 -1
  17. package/dist/src/eth.js.map +1 -1
  18. package/dist/src/internal/abi.d.ts +50 -0
  19. package/dist/src/internal/abi.d.ts.map +1 -0
  20. package/dist/src/internal/abi.js +248 -0
  21. package/dist/src/internal/abi.js.map +1 -0
  22. package/dist/src/internal/bytes.js +3 -3
  23. package/dist/src/internal/bytes.js.map +1 -1
  24. package/dist/src/internal/eth.d.ts +14 -5
  25. package/dist/src/internal/eth.d.ts.map +1 -1
  26. package/dist/src/internal/eth.js +16 -6
  27. package/dist/src/internal/eth.js.map +1 -1
  28. package/dist/src/internal/request.d.ts +37 -0
  29. package/dist/src/internal/request.d.ts.map +1 -1
  30. package/dist/src/internal/request.js +168 -1
  31. package/dist/src/internal/request.js.map +1 -1
  32. package/dist/src/request.d.ts +26 -9
  33. package/dist/src/request.d.ts.map +1 -1
  34. package/dist/src/request.js +31 -38
  35. package/dist/src/request.js.map +1 -1
  36. package/package.json +5 -3
  37. package/src/abi.ts +199 -0
  38. package/src/errors/abi.ts +156 -0
  39. package/src/errors/request.ts +12 -0
  40. package/src/eth.ts +22 -0
  41. package/src/internal/abi.ts +431 -0
  42. package/src/internal/bytes.ts +4 -4
  43. package/src/internal/eth.ts +23 -6
  44. package/src/internal/request.ts +218 -0
  45. package/src/request.ts +38 -45
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @nomicfoundation/hardhat-utils
2
2
 
3
+ ## 4.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#8632](https://github.com/NomicFoundation/hardhat/pull/8632) [`eb2b13d`](https://github.com/NomicFoundation/hardhat/commit/eb2b13da0a4395006e39bc5927403dd21be13b02) Thanks [@schaable](https://github.com/schaable)! - Added an `abi` module with `encodeAbiParameters()` for ABI-encoding values against a list of Solidity parameter types.
8
+
9
+ ### Patch Changes
10
+
11
+ - [#8646](https://github.com/NomicFoundation/hardhat/pull/8646) [`ac45dab`](https://github.com/NomicFoundation/hardhat/commit/ac45dab636432dbe98da5eb2909913dab0e202f5) Thanks [@renovate](https://github.com/apps/renovate)! - Updated the `@streamparser/json-node` dependency to 0.0.26.
12
+
13
+ ## 4.3.0
14
+
15
+ ### Minor Changes
16
+
17
+ - [#8616](https://github.com/NomicFoundation/hardhat/pull/8616) [`8b73917`](https://github.com/NomicFoundation/hardhat/commit/8b73917cbf830b58c773ea7580d2d30c4fb11b43) Thanks [@rome-xi](https://github.com/rome-xi)! - Fixed invalid `HTTPS_PROXY`/`HTTP_PROXY` values being reported as unexpected errors instead of a Hardhat error.
18
+
19
+ ### Patch Changes
20
+
21
+ - [#8601](https://github.com/NomicFoundation/hardhat/pull/8601) [`34087dd`](https://github.com/NomicFoundation/hardhat/commit/34087dd349e40be5bf4d5dbdce557b23b98cfefd) Thanks [@cdesch](https://github.com/cdesch)! - Improved HTTP proxy support.
22
+
3
23
  ## 4.2.0
4
24
 
5
25
  ### Minor Changes
@@ -0,0 +1,79 @@
1
+ import type { PrefixedHexString } from "./hex.js";
2
+ /**
3
+ * A parameter of an ABI fragment.
4
+ */
5
+ export interface AbiParameter {
6
+ readonly name?: string;
7
+ readonly type: string;
8
+ readonly components?: readonly AbiParameter[];
9
+ }
10
+ /**
11
+ * An entry of a contract's ABI. Only the fields needed to encode values are
12
+ * modeled.
13
+ */
14
+ export interface AbiFragment {
15
+ readonly type?: string;
16
+ readonly name?: string;
17
+ readonly inputs?: readonly AbiParameter[];
18
+ }
19
+ /**
20
+ * The signedness and size of a Solidity integer type.
21
+ */
22
+ export interface IntType {
23
+ readonly signed: boolean;
24
+ readonly bits: number;
25
+ }
26
+ /**
27
+ * The inclusive range of values that a Solidity integer type can hold.
28
+ */
29
+ export interface IntTypeRange {
30
+ readonly min: bigint;
31
+ readonly max: bigint;
32
+ }
33
+ /**
34
+ * Parses a Solidity integer type name, like `uint256` or `int128`, into its
35
+ * signedness and size in bits. As in Solidity, `uint` and `int` are accepted as
36
+ * aliases of the 256-bit types.
37
+ *
38
+ * @param type The type name to parse.
39
+ * @returns The parsed type, or `undefined` if it isn't a Solidity integer type.
40
+ */
41
+ export declare function parseIntType(type: string): IntType | undefined;
42
+ /**
43
+ * Returns the inclusive range of values that a Solidity integer type can hold.
44
+ *
45
+ * @param intType The integer type, as returned by {@link parseIntType}.
46
+ * @returns The minimum and maximum values of the type.
47
+ */
48
+ export declare function getIntTypeRange({ signed, bits }: IntType): IntTypeRange;
49
+ /**
50
+ * Returns the parameters of the constructor declared in an ABI.
51
+ *
52
+ * An ABI that declares no constructor yields an empty array, matching the
53
+ * Solidity semantics of an implicit parameterless constructor.
54
+ *
55
+ * @param abi The ABI to read the constructor from.
56
+ * @returns The constructor's parameters.
57
+ */
58
+ export declare function getAbiConstructorParameters(abi: readonly AbiFragment[]): readonly AbiParameter[];
59
+ /**
60
+ * ABI-encodes a list of values, as Solidity encodes a constructor's arguments
61
+ * (i.e. without a function selector).
62
+ *
63
+ * Values are accepted in the same shapes that most Ethereum libraries accept:
64
+ * integers as bigints, safe numbers, or decimal or hex strings; `bytes` as hex
65
+ * strings or `Uint8Array`s; tuples as arrays or as objects keyed by component
66
+ * name; and addresses with or without the "0x" prefix.
67
+ *
68
+ * @param parameters The ABI parameters to encode the values as.
69
+ * @param values The values to encode, in the order of the parameters.
70
+ * @returns The encoded values as a prefixed hex string, or "0x" if there are none.
71
+ * @throws AbiParametersLengthMismatchError If the counts don't match.
72
+ * @throws InvalidAbiValueError If a value can't be encoded as its type.
73
+ * @throws AbiValueOutOfBoundsError If a numeric value is out of its type's range.
74
+ * @throws UnsupportedAbiTypeError If a parameter's type can't be encoded.
75
+ * @throws AbiEncodingFailedError If the encoder fails for any other reason.
76
+ */
77
+ export declare function encodeAbiParameters(parameters: readonly AbiParameter[], values: readonly unknown[]): Promise<PrefixedHexString>;
78
+ export { AbiEncodingError, AbiEncodingFailedError, AbiParametersLengthMismatchError, AbiValueOutOfBoundsError, DuplicateAbiParameterNameError, InvalidAbiValueError, UnsupportedAbiTypeError, isAbiEncodingError, type AbiEncodingErrorKind, type AnyAbiEncodingError, } from "./errors/abi.js";
79
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../src/abi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAmBlD;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC/C;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,YAAY,EAAE,CAAC;CAC3C;AAED;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAc9D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,GAAG,YAAY,CAOvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,GAAG,EAAE,SAAS,WAAW,EAAE,GAC1B,SAAS,YAAY,EAAE,CAEzB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,MAAM,EAAE,SAAS,OAAO,EAAE,GACzB,OAAO,CAAC,iBAAiB,CAAC,CAsD5B;AAED,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gCAAgC,EAChC,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { ensureError } from "./error.js";
2
+ import { AbiEncodingFailedError, AbiParametersLengthMismatchError, } from "./errors/abi.js";
3
+ import { getPrefixedHexString } from "./hex.js";
4
+ import { assertNoDuplicateAbiParameterNames, normalizeAbiValue, toUnnamedAbiParameters, } from "./internal/abi.js";
5
+ // We don't load micro-eth-signer on startup because it's slow to initialize,
6
+ // and most callers of this module never encode anything.
7
+ let deployContractImpl;
8
+ const INT_TYPE_PATTERN = /^(u?)int([1-9]\d*)?$/;
9
+ /**
10
+ * Parses a Solidity integer type name, like `uint256` or `int128`, into its
11
+ * signedness and size in bits. As in Solidity, `uint` and `int` are accepted as
12
+ * aliases of the 256-bit types.
13
+ *
14
+ * @param type The type name to parse.
15
+ * @returns The parsed type, or `undefined` if it isn't a Solidity integer type.
16
+ */
17
+ export function parseIntType(type) {
18
+ const match = INT_TYPE_PATTERN.exec(type);
19
+ if (match === null) {
20
+ return undefined;
21
+ }
22
+ const bits = match[2] === undefined ? 256 : Number(match[2]);
23
+ if (bits > 256 || bits % 8 !== 0) {
24
+ return undefined;
25
+ }
26
+ return { signed: match[1] === "", bits };
27
+ }
28
+ /**
29
+ * Returns the inclusive range of values that a Solidity integer type can hold.
30
+ *
31
+ * @param intType The integer type, as returned by {@link parseIntType}.
32
+ * @returns The minimum and maximum values of the type.
33
+ */
34
+ export function getIntTypeRange({ signed, bits }) {
35
+ if (signed) {
36
+ const bound = 2n ** BigInt(bits - 1);
37
+ return { min: -bound, max: bound - 1n };
38
+ }
39
+ return { min: 0n, max: 2n ** BigInt(bits) - 1n };
40
+ }
41
+ /**
42
+ * Returns the parameters of the constructor declared in an ABI.
43
+ *
44
+ * An ABI that declares no constructor yields an empty array, matching the
45
+ * Solidity semantics of an implicit parameterless constructor.
46
+ *
47
+ * @param abi The ABI to read the constructor from.
48
+ * @returns The constructor's parameters.
49
+ */
50
+ export function getAbiConstructorParameters(abi) {
51
+ return abi.find(({ type }) => type === "constructor")?.inputs ?? [];
52
+ }
53
+ /**
54
+ * ABI-encodes a list of values, as Solidity encodes a constructor's arguments
55
+ * (i.e. without a function selector).
56
+ *
57
+ * Values are accepted in the same shapes that most Ethereum libraries accept:
58
+ * integers as bigints, safe numbers, or decimal or hex strings; `bytes` as hex
59
+ * strings or `Uint8Array`s; tuples as arrays or as objects keyed by component
60
+ * name; and addresses with or without the "0x" prefix.
61
+ *
62
+ * @param parameters The ABI parameters to encode the values as.
63
+ * @param values The values to encode, in the order of the parameters.
64
+ * @returns The encoded values as a prefixed hex string, or "0x" if there are none.
65
+ * @throws AbiParametersLengthMismatchError If the counts don't match.
66
+ * @throws InvalidAbiValueError If a value can't be encoded as its type.
67
+ * @throws AbiValueOutOfBoundsError If a numeric value is out of its type's range.
68
+ * @throws UnsupportedAbiTypeError If a parameter's type can't be encoded.
69
+ * @throws AbiEncodingFailedError If the encoder fails for any other reason.
70
+ */
71
+ export async function encodeAbiParameters(parameters, values) {
72
+ if (parameters.length !== values.length) {
73
+ throw new AbiParametersLengthMismatchError(parameters.length, values.length);
74
+ }
75
+ // Returning here also keeps micro-eth-signer unloaded.
76
+ if (parameters.length === 0) {
77
+ return "0x";
78
+ }
79
+ assertNoDuplicateAbiParameterNames(parameters);
80
+ // The values are normalized sequentially so that, when more than one is
81
+ // invalid, the error reported is always the one of the first.
82
+ const normalizedValues = [];
83
+ for (const [i, parameter] of parameters.entries()) {
84
+ normalizedValues.push(await normalizeAbiValue(parameter, values[i], parameter.name ?? `[${i}]`));
85
+ }
86
+ if (deployContractImpl === undefined) {
87
+ ({ deployContract: deployContractImpl } =
88
+ await import("micro-eth-signer/advanced/abi.js"));
89
+ }
90
+ // The encoder takes the bare value when there's a single parameter, and a
91
+ // positional array otherwise. The array is positional at every level because
92
+ // toUnnamedAbiParameters drops the names.
93
+ const value = parameters.length === 1 ? normalizedValues[0] : normalizedValues;
94
+ // NOTE: this must not be annotated nor frozen with `as const`. With `type`
95
+ // widened to `string`, micro-eth-signer's generic overload resolves to its
96
+ // untyped form, which is what we want for a dynamically built ABI.
97
+ const abi = [
98
+ { type: "constructor", inputs: toUnnamedAbiParameters(parameters) },
99
+ ];
100
+ let encoded;
101
+ try {
102
+ // deployContract returns `<bytecode><encoded args>`, so we pass no bytecode.
103
+ encoded = deployContractImpl(abi, "0x", value);
104
+ }
105
+ catch (error) {
106
+ // Reached by types that pass validation but the encoder still refuses,
107
+ // such as `uint256[0][]`, whose zero-size element it treats as a DoS risk.
108
+ ensureError(error);
109
+ throw new AbiEncodingFailedError(error);
110
+ }
111
+ return getPrefixedHexString(encoded);
112
+ }
113
+ export { AbiEncodingError, AbiEncodingFailedError, AbiParametersLengthMismatchError, AbiValueOutOfBoundsError, DuplicateAbiParameterNameError, InvalidAbiValueError, UnsupportedAbiTypeError, isAbiEncodingError, } from "./errors/abi.js";
114
+ //# sourceMappingURL=abi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.js","sourceRoot":"","sources":["../../src/abi.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,sBAAsB,EACtB,gCAAgC,GACjC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,EACL,kCAAkC,EAClC,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAE3B,6EAA6E;AAC7E,yDAAyD;AACzD,IAAI,kBAAsD,CAAC;AAqC3D,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,MAAM,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAE1C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7D,IAAI,IAAI,GAAG,GAAG,IAAI,IAAI,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;QACjC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC;AAC3C,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAAE,MAAM,EAAE,IAA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I,CAAC,GAAG,CAAC,CAC1E,CAAC;IACJ,CAAC;IAED,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;QACrC,CAAC,EAAE,cAAc,EAAE,kBAAkB,EAAE;YACrC,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAC,CAAC;IACtD,CAAC;IAED,0EAA0E;IAC1E,6EAA6E;IAC7E,0CAA0C;IAC1C,MAAM,KAAK,GACT,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC;IAEnE,2EAA2E;IAC3E,2EAA2E;IAC3E,mEAAmE;IACnE,MAAM,GAAG,GAAG;QACV,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,sBAAsB,CAAC,UAAU,CAAC,EAAE;KACpE,CAAC;IAEF,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,6EAA6E;QAC7E,OAAO,GAAG,kBAAkB,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,uEAAuE;QACvE,2EAA2E;QAC3E,WAAW,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAI,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAC1C,CAAC;IAED,OAAO,oBAAoB,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,gCAAgC,EAChC,wBAAwB,EACxB,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,GAGnB,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,93 @@
1
+ import { CustomError } from "../error.js";
2
+ /**
3
+ * Discriminates the errors that ABI encoding can throw.
4
+ */
5
+ export type AbiEncodingErrorKind = "parameters-length-mismatch" | "invalid-value" | "value-out-of-bounds" | "unsupported-type" | "duplicate-parameter-name" | "encoding-failed";
6
+ /**
7
+ * Base class of every error thrown while ABI-encoding values.
8
+ *
9
+ * Consumers should discriminate with `isAbiEncodingError` rather than
10
+ * `instanceof`, so that the checks keep working if more than one copy of this
11
+ * package ends up installed.
12
+ */
13
+ export declare abstract class AbiEncodingError extends CustomError {
14
+ abstract readonly kind: AbiEncodingErrorKind;
15
+ }
16
+ /**
17
+ * Thrown when the number of values to encode doesn't match the number of
18
+ * parameters.
19
+ */
20
+ export declare class AbiParametersLengthMismatchError extends AbiEncodingError {
21
+ readonly expectedLength: number;
22
+ readonly providedLength: number;
23
+ readonly kind: "parameters-length-mismatch";
24
+ constructor(expectedLength: number, providedLength: number);
25
+ }
26
+ /**
27
+ * Thrown when a value can't be encoded as its parameter's Solidity type.
28
+ */
29
+ export declare class InvalidAbiValueError extends AbiEncodingError {
30
+ readonly path: string;
31
+ readonly solidityType: string;
32
+ readonly value: unknown;
33
+ readonly reason: string;
34
+ readonly kind: "invalid-value";
35
+ constructor(path: string, solidityType: string, value: unknown, reason: string);
36
+ }
37
+ /**
38
+ * Thrown when a numeric value is outside the range of its Solidity type.
39
+ */
40
+ export declare class AbiValueOutOfBoundsError extends AbiEncodingError {
41
+ readonly path: string;
42
+ readonly solidityType: string;
43
+ readonly value: unknown;
44
+ readonly min: bigint;
45
+ readonly max: bigint;
46
+ readonly kind: "value-out-of-bounds";
47
+ constructor(path: string, solidityType: string, value: unknown, min: bigint, max: bigint);
48
+ }
49
+ /**
50
+ * Thrown when a parameter's Solidity type can't be encoded at all.
51
+ */
52
+ export declare class UnsupportedAbiTypeError extends AbiEncodingError {
53
+ readonly path: string;
54
+ readonly solidityType: string;
55
+ readonly kind: "unsupported-type";
56
+ constructor(path: string, solidityType: string);
57
+ }
58
+ /**
59
+ * Thrown when two parameters, or two components of the same tuple, share a
60
+ * name.
61
+ *
62
+ * Only a hand-written ABI can carry duplicate names; solc never emits one. The
63
+ * encoder's own guard covers named parameters only, and names are stripped
64
+ * before it runs, so it never sees them.
65
+ */
66
+ export declare class DuplicateAbiParameterNameError extends AbiEncodingError {
67
+ readonly path: string | undefined;
68
+ readonly duplicatedName: string;
69
+ readonly kind: "duplicate-parameter-name";
70
+ constructor(path: string | undefined, duplicatedName: string);
71
+ }
72
+ /**
73
+ * Thrown when the encoder refuses values that already passed validation.
74
+ */
75
+ export declare class AbiEncodingFailedError extends AbiEncodingError {
76
+ readonly kind: "encoding-failed";
77
+ constructor(cause: Error);
78
+ }
79
+ /**
80
+ * The union of every error that ABI encoding can throw.
81
+ */
82
+ export type AnyAbiEncodingError = AbiParametersLengthMismatchError | InvalidAbiValueError | AbiValueOutOfBoundsError | UnsupportedAbiTypeError | DuplicateAbiParameterNameError | AbiEncodingFailedError;
83
+ /**
84
+ * Checks whether a value is the ABI encoding error of the given kind.
85
+ *
86
+ * @param error The value to check.
87
+ * @param kind The kind of error to check for.
88
+ * @returns True if the value is an ABI encoding error of that kind.
89
+ */
90
+ export declare function isAbiEncodingError<KindT extends AbiEncodingErrorKind>(error: unknown, kind: KindT): error is Extract<AnyAbiEncodingError, {
91
+ kind: KindT;
92
+ }>;
93
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../../src/errors/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAC5B,4BAA4B,GAC5B,eAAe,GACf,qBAAqB,GACrB,kBAAkB,GAClB,0BAA0B,GAC1B,iBAAiB,CAAC;AAEtB;;;;;;GAMG;AACH,8BAAsB,gBAAiB,SAAQ,WAAW;IACxD,kBAAyB,IAAI,EAAE,oBAAoB,CAAC;CACrD;AAED;;;GAGG;AACH,qBAAa,gCAAiC,SAAQ,gBAAgB;aAKlD,cAAc,EAAE,MAAM;aACtB,cAAc,EAAE,MAAM;IALxC,SAAgB,IAAI,EAAE,4BAA4B,CACnB;gBAGb,cAAc,EA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M,MAAM,mBAAmB,GAC3B,gCAAgC,GAChC,oBAAoB,GACpB,wBAAwB,GACxB,uBAAuB,GACvB,8BAA8B,GAC9B,sBAAsB,CAAC;AAE3B;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,SAAS,oBAAoB,EACnE,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,KAAK,GACV,KAAK,IAAI,OAAO,CAAC,mBAAmB,EAAE;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC,CAExD"}
@@ -0,0 +1,117 @@
1
+ import { CustomError } from "../error.js";
2
+ /**
3
+ * Base class of every error thrown while ABI-encoding values.
4
+ *
5
+ * Consumers should discriminate with `isAbiEncodingError` rather than
6
+ * `instanceof`, so that the checks keep working if more than one copy of this
7
+ * package ends up installed.
8
+ */
9
+ export class AbiEncodingError extends CustomError {
10
+ }
11
+ /**
12
+ * Thrown when the number of values to encode doesn't match the number of
13
+ * parameters.
14
+ */
15
+ export class AbiParametersLengthMismatchError extends AbiEncodingError {
16
+ expectedLength;
17
+ providedLength;
18
+ kind = "parameters-length-mismatch";
19
+ constructor(expectedLength, providedLength) {
20
+ super(`Expected ${expectedLength} values to encode, but ${providedLength} were provided.`);
21
+ this.expectedLength = expectedLength;
22
+ this.providedLength = providedLength;
23
+ }
24
+ }
25
+ /**
26
+ * Thrown when a value can't be encoded as its parameter's Solidity type.
27
+ */
28
+ export class InvalidAbiValueError extends AbiEncodingError {
29
+ path;
30
+ solidityType;
31
+ value;
32
+ reason;
33
+ kind = "invalid-value";
34
+ constructor(path, solidityType, value, reason) {
35
+ super(`The value provided for the parameter "${path}" of type "${solidityType}" cannot be encoded. Reason: ${reason}.`);
36
+ this.path = path;
37
+ this.solidityType = solidityType;
38
+ this.value = value;
39
+ this.reason = reason;
40
+ }
41
+ }
42
+ /**
43
+ * Thrown when a numeric value is outside the range of its Solidity type.
44
+ */
45
+ export class AbiValueOutOfBoundsError extends AbiEncodingError {
46
+ path;
47
+ solidityType;
48
+ value;
49
+ min;
50
+ max;
51
+ kind = "value-out-of-bounds";
52
+ constructor(path, solidityType, value, min, max) {
53
+ super(`The value provided for the parameter "${path}" is out of bounds for the type "${solidityType}". Expected a value between ${min} and ${max}.`);
54
+ this.path = path;
55
+ this.solidityType = solidityType;
56
+ this.value = value;
57
+ this.min = min;
58
+ this.max = max;
59
+ }
60
+ }
61
+ /**
62
+ * Thrown when a parameter's Solidity type can't be encoded at all.
63
+ */
64
+ export class UnsupportedAbiTypeError extends AbiEncodingError {
65
+ path;
66
+ solidityType;
67
+ kind = "unsupported-type";
68
+ constructor(path, solidityType) {
69
+ super(`The type "${solidityType}" of the parameter "${path}" is not supported.`);
70
+ this.path = path;
71
+ this.solidityType = solidityType;
72
+ }
73
+ }
74
+ /**
75
+ * Thrown when two parameters, or two components of the same tuple, share a
76
+ * name.
77
+ *
78
+ * Only a hand-written ABI can carry duplicate names; solc never emits one. The
79
+ * encoder's own guard covers named parameters only, and names are stripped
80
+ * before it runs, so it never sees them.
81
+ */
82
+ export class DuplicateAbiParameterNameError extends AbiEncodingError {
83
+ path;
84
+ duplicatedName;
85
+ kind = "duplicate-parameter-name";
86
+ constructor(
87
+ // undefined when the duplicate is between top-level parameters
88
+ path, duplicatedName) {
89
+ super(path === undefined
90
+ ? `Two or more parameters are named "${duplicatedName}".`
91
+ : `Two or more components of the parameter "${path}" are named "${duplicatedName}".`);
92
+ this.path = path;
93
+ this.duplicatedName = duplicatedName;
94
+ }
95
+ }
96
+ /**
97
+ * Thrown when the encoder refuses values that already passed validation.
98
+ */
99
+ export class AbiEncodingFailedError extends AbiEncodingError {
100
+ kind = "encoding-failed";
101
+ constructor(cause) {
102
+ // The encoder's messages don't end with a period, so one is added to keep
103
+ // this message punctuated like the rest.
104
+ super(`The values could not be ABI-encoded: ${cause.message}.`, cause);
105
+ }
106
+ }
107
+ /**
108
+ * Checks whether a value is the ABI encoding error of the given kind.
109
+ *
110
+ * @param error The value to check.
111
+ * @param kind The kind of error to check for.
112
+ * @returns True if the value is an ABI encoding error of that kind.
113
+ */
114
+ export function isAbiEncodingError(error, kind) {
115
+ return error instanceof Error && "kind" in error && error.kind === kind;
116
+ }
117
+ //# sourceMappingURL=abi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.js","sourceRoot":"","sources":["../../../src/errors/abi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAa1C;;;;;;GAMG;AACH,MAAM,OAAgB,gBAAiB,SAAQ,WAAW;CAEzD;AAED;;;GAGG;AACH,MAAM,OAAO,gCAAiC,SAAQ,gBAAgB;IAKlD;IACA;IALF,IAAI,GAClB,4BAA4B,CAAC;IAE/B,YACkB,cAAsB,EACtB,cAAsB;QAEtC,KAAK,CACH,YAAY,cAAc,0BAA0B,cAAc,iBAAiB,CACpF,CAAC;QALc,mBAAc,GAAd,cAAc,CAAQ;QACtB,mBAAc,GAAd,cAAc,CAAQ;IAKxC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,oBAAqB,SAAQ,gBAAgB;IAItC;IACA;IACA;IACA;IANF,IAAI,GAAoB,eAAe,CAAC;IAExD,YACkB,IAAY,EACZ,YAAoB,EACpB,KAAc,EACd,MAAc;QAE9B,KAAK,CACH,yCAAyC,IAAI,cAAc,YAAY,gCAAgC,MAAM,GAAG,CACjH,CAAC;QAPc,SAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAY,GAAZ,YAAY,CAAQ;QACpB,UAAK,GAAL,KAAK,CAAS;QACd,WAAM,GAAN,MAAM,CAAQ;IAKhC,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,gBAAgB;IAI1C;IACA;IACA;IACA;IACA;IAPF,IAAI,GAA0B,qBAAqB,CAAC;IAEpE,YACkB,IAAY,EACZ,YAAoB,EACpB,KAAc,EACd,GAAW,EACX,GAAW;QAE3B,KAAK,CACH,yCAAyC,IAAI,oCAAoC,YAAY,+BAA+B,GAAG,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,KAAK,IAAI,CAAC;AAC1E,CAAC"}
@@ -9,6 +9,10 @@ export declare class DownloadError extends CustomError {
9
9
  export declare class DispatcherError extends CustomError {
10
10
  constructor(message: string, cause?: Error);
11
11
  }
12
+ export declare class InvalidProxyUrlError extends CustomError {
13
+ readonly envVarName: string;
14
+ constructor(envVarName: string, cause?: Error);
15
+ }
12
16
  export declare class RequestTimeoutError extends CustomError {
13
17
  constructor(url: string, cause?: Error);
14
18
  }
@@ -1 +1 @@
1
- {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../src/errors/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI1C,qBAAa,YAAa,SAAQ,WAAW;gBAC/B,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,UAAU,EAAE,KAAK,CAAC,EAAE,KAAK;CAG5E;AAED,qBAAa,aAAc,SAAQ,WAAW;gBAChC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,eAAgB,SAAQ,WAAW;gBAClC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAG3C;AAED,qBAAa,mBAAoB,SAAQ,WAAW;gBACtC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,sBAAuB,SAAQ,WAAW;gBACzC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAGvC;AAED,qBAAa,uBAAwB,SAAQ,WAAW;;IACtD,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,OAAO,EACrB,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC;IAClE,SAAgB,IAAI,EAAE,IAAI,GAAG,MAAM,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,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAuCtC"}
@@ -16,6 +16,13 @@ export class DispatcherError extends CustomError {
16
16
  super(`Failed to create dispatcher: ${message}`, cause);
17
17
  }
18
18
  }
19
+ export class InvalidProxyUrlError extends CustomError {
20
+ envVarName;
21
+ constructor(envVarName, cause) {
22
+ super(`The proxy url configured in the ${envVarName} environment variable is not a valid url`, cause);
23
+ this.envVarName = envVarName;
24
+ }
25
+ }
19
26
  export class RequestTimeoutError extends CustomError {
20
27
  constructor(url, cause) {
21
28
  super(`Request to ${sanitizeUrl(url)} timed out`, cause);
@@ -1 +1 @@
1
- {"version":3,"file":"request.js","sourceRoot":"","sources":["../../../src/errors/request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAY,GAAW,EAAE,IAAmC,EAAE,KAAa;QACzE,KAAK,CAAC,kBAAkB,IAAI,eAAe,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACxE,CAAC;CACF;AAED,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C,YAAY,GAAW,EAAE,KAAa;QACpC,KAAK,CAAC,gCAAgC,WAAW,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IACnE,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C,YAAY,OAAe,EAAE,KAAa;QACxC,KAAK,CAAC,gCAAgC,OAAO,EAAE,EAAE,KAAK,CAAC,CAAC;IAC1D,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,YAAY,GAAW,EAAE,KAAa;QACpC,KAAK,CAAC,cAAc,WAAW,CAAC,GAAG,CAAC,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,OAAO,CAAC;YACjB,CAAC;iBAAM,IAAI,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;gBACzC,OAAO,OAAO,CAAC;YACjB,CAAC;QACH,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,eAAe,CACb,OAAgB;QAEhB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,CACjC,CAAC,MAAM,EAAE,EAAE,CACT,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBACpB,MAAM,CAAC,KAAK,CAAC,CAAC,IAAa,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC;YAC5D,MAAM,KAAK,SAAS,CACvB,CAAC;IACJ,CAAC;CACF"}
package/dist/src/eth.d.ts CHANGED
@@ -13,6 +13,15 @@ export declare function isAddress(value: unknown): value is PrefixedHexString;
13
13
  * @returns True if the value is an Ethereum address with a valid checksum, false otherwise.
14
14
  */
15
15
  export declare function isValidChecksumAddress(value: unknown): Promise<boolean>;
16
+ /**
17
+ * Converts an Ethereum address to its EIP-55 checksummed representation.
18
+ *
19
+ * @param address The address to convert. It can be checksummed or not, but it
20
+ * must be a valid Ethereum address.
21
+ * @returns The EIP-55 checksummed representation of the address.
22
+ * @throws InvalidParameterError If the input is not an Ethereum address.
23
+ */
24
+ export declare function toChecksumAddress(address: string): Promise<PrefixedHexString>;
16
25
  /**
17
26
  * Checks if a value is an Ethereum hash.
18
27
  *
@@ -1 +1 @@
1
- {"version":3,"file":"eth.d.ts","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AASlD;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,KAA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CAEnE;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,UAAU,CAAC,CAG7D;AAED;;;;GAIG;AACH,wBAAsB,UAAU,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAG7D;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,CAIhE;AAED;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAGhE"}
package/dist/src/eth.js CHANGED
@@ -1,5 +1,6 @@
1
+ import { InvalidParameterError } from "./common-errors.js";
1
2
  import { bytesToHexString, numberToHexString, setLengthLeft } from "./hex.js";
2
- import { getAddressGenerator, getHashGenerator, isValidChecksum, } from "./internal/eth.js";
3
+ import { getAddressGenerator, getHashGenerator, isValidChecksum, toChecksumAddress as toChecksumAddressImpl, } from "./internal/eth.js";
3
4
  /**
4
5
  * Checks if a value is an Ethereum address.
5
6
  *
@@ -18,6 +19,20 @@ export function isAddress(value) {
18
19
  export async function isValidChecksumAddress(value) {
19
20
  return await (isAddress(value) && isValidChecksum(value));
20
21
  }
22
+ /**
23
+ * Converts an Ethereum address to its EIP-55 checksummed representation.
24
+ *
25
+ * @param address The address to convert. It can be checksummed or not, but it
26
+ * must be a valid Ethereum address.
27
+ * @returns The EIP-55 checksummed representation of the address.
28
+ * @throws InvalidParameterError If the input is not an Ethereum address.
29
+ */
30
+ export async function toChecksumAddress(address) {
31
+ if (!isAddress(address)) {
32
+ throw new InvalidParameterError(`Expected an Ethereum address. Received: ${address}`);
33
+ }
34
+ return await toChecksumAddressImpl(address);
35
+ }
21
36
  /**
22
37
  * Checks if a value is an Ethereum hash.
23
38
  *
@@ -1 +1 @@
1
- {"version":3,"file":"eth.js","sourceRoot":"","sources":["../../src/eth.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,mBA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UAAU,SAAS,CAAC,KAAsB;IAC9C,OAAO,aAAa,CAAC,iBAAiB,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,aAAa,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC/C,OAAO,MAAM,aAAa,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,SAAS,GAAG,MAAM,iBAAiB,EAAE,CAAC;IAC5C,OAAO,gBAAgB,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,MAAM,gBAAgB,GAAG,MAAM,mBAAmB,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,CAAC;IAChD,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa;IACjC,MAAM,YAAY,GAAG,MAAM,oBAAoB,EAAE,CAAC;IAClD,OAAO,gBAAgB,CAAC,YAAY,CAAC,CAAC;AACxC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import type { AbiParameter } from "../abi.js";
2
+ /**
3
+ * A value in the shape that the encoder expects. Aggregates are always
4
+ * positional, because we strip the parameter names before encoding.
5
+ */
6
+ export type NormalizedAbiValue = bigint | boolean | string | Uint8Array | NormalizedAbiValue[];
7
+ /**
8
+ * An ABI parameter with every name removed, recursively.
9
+ */
10
+ export interface UnnamedAbiParameter {
11
+ readonly type: string;
12
+ readonly components?: readonly UnnamedAbiParameter[];
13
+ }
14
+ /**
15
+ * Throws if two of the given parameters share a name.
16
+ *
17
+ * This is checked against the parameter list rather than the value, so that the
18
+ * array and object input shapes fail the same way.
19
+ *
20
+ * @param parameters The parameters to check.
21
+ * @param path The path of their container, or undefined at the top level.
22
+ * @throws DuplicateAbiParameterNameError If a name is repeated.
23
+ */
24
+ export declare function assertNoDuplicateAbiParameterNames(parameters: readonly AbiParameter[], path?: string): void;
25
+ /**
26
+ * Removes the names of a list of ABI parameters, recursively.
27
+ *
28
+ * The encoder derives the shape of the value it expects from whether the
29
+ * parameters are named: named ones take an object keyed by name, unnamed ones
30
+ * take a positional array. Dropping the names makes every aggregate positional,
31
+ * at every nesting level.
32
+ *
33
+ * @param parameters The parameters to strip.
34
+ * @returns The same parameters, without their names.
35
+ */
36
+ export declare function toUnnamedAbiParameters(parameters: readonly AbiParameter[]): UnnamedAbiParameter[];
37
+ /**
38
+ * Converts a value into the shape that the encoder expects for a parameter,
39
+ * validating it against the parameter's Solidity type.
40
+ *
41
+ * @param parameter The ABI parameter to normalize the value for.
42
+ * @param value The value to normalize.
43
+ * @param path The path of the parameter, used to report errors.
44
+ * @returns The normalized value.
45
+ * @throws InvalidAbiValueError If the value can't be encoded as the type.
46
+ * @throws AbiValueOutOfBoundsError If a numeric value is out of the type's range.
47
+ * @throws UnsupportedAbiTypeError If the type itself can't be encoded.
48
+ */
49
+ export declare function normalizeAbiValue(parameter: AbiParameter, value: unknown, path: string): Promise<NormalizedAbiValue>;
50
+ //# sourceMappingURL=abi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abi.d.ts","sourceRoot":"","sources":["../../../src/internal/abi.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAmB9C;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GAC5B,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,UAAU,GAAG,kBAAkB,EAAE,CAAC;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,mBAAmB,EAAE,CAAC;CACtD;AASD;;;;;;;;;GASG;AACH,wBAAgB,kCAAkC,CAChD,UAAU,EAAE,SAAS,YAAY,EAAE,EACnC,IAAI,CAAC,EAAE,MAAM,GACZ,IAAI,CAaN;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,SAAS,YAAY,EAAE,GAClC,mBAAmB,EAAE,CAMvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CACrC,SAAS,EAAE,YAAY,EACvB,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,kBAAkB,CAAC,CA+C7B"}