@alchemy/common 0.0.0-alpha.2 → 0.0.0-alpha.20

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.
@@ -38,9 +38,18 @@ export declare const fraxtalSepolia: {
38
38
  sourceId?: number | undefined | undefined;
39
39
  testnet: true;
40
40
  custom?: Record<string, unknown> | undefined;
41
+ extendSchema?: Record<string, unknown> | undefined;
41
42
  fees?: import("viem").ChainFees<undefined> | undefined;
42
43
  formatters?: undefined;
44
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
45
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
46
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
47
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
48
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
49
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
50
+ }] | undefined;
43
51
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
52
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
44
53
  };
45
54
  export declare const openlootSepolia: {
46
55
  blockExplorers: {
@@ -76,9 +85,18 @@ export declare const openlootSepolia: {
76
85
  sourceId?: number | undefined | undefined;
77
86
  testnet: true;
78
87
  custom?: Record<string, unknown> | undefined;
88
+ extendSchema?: Record<string, unknown> | undefined;
79
89
  fees?: import("viem").ChainFees<undefined> | undefined;
80
90
  formatters?: undefined;
91
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
92
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
93
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
94
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
95
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
96
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
97
+ }] | undefined;
81
98
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
99
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
82
100
  };
83
101
  export declare const gensynTestnet: {
84
102
  blockExplorers: {
@@ -114,9 +132,18 @@ export declare const gensynTestnet: {
114
132
  sourceId?: number | undefined | undefined;
115
133
  testnet: true;
116
134
  custom?: Record<string, unknown> | undefined;
135
+ extendSchema?: Record<string, unknown> | undefined;
117
136
  fees?: import("viem").ChainFees<undefined> | undefined;
118
137
  formatters?: undefined;
138
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
139
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
140
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
141
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
142
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
143
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
144
+ }] | undefined;
119
145
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
146
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
120
147
  };
121
148
  export declare const riseTestnet: {
122
149
  blockExplorers: {
@@ -152,9 +179,18 @@ export declare const riseTestnet: {
152
179
  sourceId?: number | undefined | undefined;
153
180
  testnet: true;
154
181
  custom?: Record<string, unknown> | undefined;
182
+ extendSchema?: Record<string, unknown> | undefined;
155
183
  fees?: import("viem").ChainFees<undefined> | undefined;
156
184
  formatters?: undefined;
185
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
186
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
187
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
188
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
189
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
190
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
191
+ }] | undefined;
157
192
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
193
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
158
194
  };
159
195
  export declare const storyMainnet: {
160
196
  blockExplorers: {
@@ -190,9 +226,18 @@ export declare const storyMainnet: {
190
226
  sourceId?: number | undefined | undefined;
191
227
  testnet?: boolean | undefined | undefined;
192
228
  custom?: Record<string, unknown> | undefined;
229
+ extendSchema?: Record<string, unknown> | undefined;
193
230
  fees?: import("viem").ChainFees<undefined> | undefined;
194
231
  formatters?: undefined;
232
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
233
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
234
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
235
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
236
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
237
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
238
+ }] | undefined;
195
239
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
240
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
196
241
  };
197
242
  export declare const teaSepolia: {
198
243
  blockExplorers: {
@@ -228,7 +273,16 @@ export declare const teaSepolia: {
228
273
  sourceId?: number | undefined | undefined;
229
274
  testnet: true;
230
275
  custom?: Record<string, unknown> | undefined;
276
+ extendSchema?: Record<string, unknown> | undefined;
231
277
  fees?: import("viem").ChainFees<undefined> | undefined;
232
278
  formatters?: undefined;
279
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
280
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
281
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
282
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
283
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
284
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
285
+ }] | undefined;
233
286
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
287
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
234
288
  };
@@ -7,7 +7,7 @@ export { getAlchemyRpcUrl, isChainSupported, getSupportedChainIds, } from "./tra
7
7
  export type * from "./utils/types.js";
8
8
  export { assertNever } from "./utils/assertNever.js";
9
9
  export { raise } from "./utils/raise.js";
10
- export { bigIntMultiply } from "./utils/bigint.js";
10
+ export { bigIntMultiply, bigIntMax } from "./utils/bigint.js";
11
11
  export { lowerAddress } from "./utils/lowerAddress.js";
12
12
  export { createEip1193HandlerFactory } from "./utils/createEip1193HandlerFactory.js";
13
13
  export type { AlchemyConnectionConfig } from "./transport/connectionSchema.js";
package/dist/esm/index.js CHANGED
@@ -4,7 +4,7 @@ export { alchemyTransport, isAlchemyTransport } from "./transport/alchemy.js";
4
4
  export { getAlchemyRpcUrl, isChainSupported, getSupportedChainIds, } from "./transport/chainRegistry.js";
5
5
  export { assertNever } from "./utils/assertNever.js";
6
6
  export { raise } from "./utils/raise.js";
7
- export { bigIntMultiply } from "./utils/bigint.js";
7
+ export { bigIntMultiply, bigIntMax } from "./utils/bigint.js";
8
8
  export { lowerAddress } from "./utils/lowerAddress.js";
9
9
  export { createEip1193HandlerFactory } from "./utils/createEip1193HandlerFactory.js";
10
10
  export { AlchemyConnectionConfigSchema, validateAlchemyConnectionConfig, isAlchemyConnectionConfig, } from "./transport/connectionSchema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,2BAA2B;AAC3B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAIrF,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAEzC,SAAS;AACT,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAI5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,4DAA4D;AAC5D,cAAc,aAAa,CAAC;AAE5B,sBAAsB;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// http\nexport type * from \"./rest/restClient.js\";\nexport type * from \"./rest/types.js\";\nexport { AlchemyRestClient } from \"./rest/restClient.js\";\n\n// transport\nexport type * from \"./transport/alchemy.js\";\nexport { alchemyTransport, isAlchemyTransport } from \"./transport/alchemy.js\";\n\n// chain registry utilities\nexport {\n getAlchemyRpcUrl,\n isChainSupported,\n getSupportedChainIds,\n} from \"./transport/chainRegistry.js\";\n\n// utils\nexport type * from \"./utils/types.js\";\nexport { assertNever } from \"./utils/assertNever.js\";\nexport { raise } from \"./utils/raise.js\";\nexport { bigIntMultiply } from \"./utils/bigint.js\";\nexport { lowerAddress } from \"./utils/lowerAddress.js\";\nexport { createEip1193HandlerFactory } from \"./utils/createEip1193HandlerFactory.js\";\n\n// config\nexport type { AlchemyConnectionConfig } from \"./transport/connectionSchema.js\";\nexport {\n AlchemyConnectionConfigSchema,\n validateAlchemyConnectionConfig,\n isAlchemyConnectionConfig,\n} from \"./transport/connectionSchema.js\";\n\n// errors\nexport { BaseError } from \"./errors/BaseError.js\";\nexport { ChainNotFoundError } from \"./errors/ChainNotFoundError.js\";\nexport { AccountNotFoundError } from \"./errors/AccountNotFoundError.js\";\nexport { ConnectionConfigError } from \"./errors/ConnectionConfigError.js\";\nexport { FetchError } from \"./errors/FetchError.js\";\nexport { ServerError } from \"./errors/ServerError.js\";\nexport { InvalidRequestError } from \"./errors/InvalidRequestError.js\";\nexport { MethodUnsupportedError } from \"./errors/MethodUnsupportedError.js\";\n\n// actions\nexport type * from \"./actions/addBreadCrumb.js\";\nexport { addBreadCrumb } from \"./actions/addBreadCrumb.js\";\n\n// chains (convenience exports for Alchemy-supported chains)\nexport * from \"./chains.js\";\n\n// diagnostics logging\nexport { createLogger } from \"./logging/logger.js\";\nexport {\n setGlobalLoggerConfig,\n getGlobalLoggerConfig,\n LogLevel,\n isLevelEnabled,\n isNamespaceEnabled,\n} from \"./logging/config.js\";\nexport type { DiagnosticsLogger } from \"./logging/logger.js\";\nexport { InMemorySink } from \"./logging/sinks.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE9E,2BAA2B;AAC3B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAIrF,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAEzC,SAAS;AACT,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAI5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,4DAA4D;AAC5D,cAAc,aAAa,CAAC;AAE5B,sBAAsB;AACtB,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC","sourcesContent":["// http\nexport type * from \"./rest/restClient.js\";\nexport type * from \"./rest/types.js\";\nexport { AlchemyRestClient } from \"./rest/restClient.js\";\n\n// transport\nexport type * from \"./transport/alchemy.js\";\nexport { alchemyTransport, isAlchemyTransport } from \"./transport/alchemy.js\";\n\n// chain registry utilities\nexport {\n getAlchemyRpcUrl,\n isChainSupported,\n getSupportedChainIds,\n} from \"./transport/chainRegistry.js\";\n\n// utils\nexport type * from \"./utils/types.js\";\nexport { assertNever } from \"./utils/assertNever.js\";\nexport { raise } from \"./utils/raise.js\";\nexport { bigIntMultiply, bigIntMax } from \"./utils/bigint.js\";\nexport { lowerAddress } from \"./utils/lowerAddress.js\";\nexport { createEip1193HandlerFactory } from \"./utils/createEip1193HandlerFactory.js\";\n\n// config\nexport type { AlchemyConnectionConfig } from \"./transport/connectionSchema.js\";\nexport {\n AlchemyConnectionConfigSchema,\n validateAlchemyConnectionConfig,\n isAlchemyConnectionConfig,\n} from \"./transport/connectionSchema.js\";\n\n// errors\nexport { BaseError } from \"./errors/BaseError.js\";\nexport { ChainNotFoundError } from \"./errors/ChainNotFoundError.js\";\nexport { AccountNotFoundError } from \"./errors/AccountNotFoundError.js\";\nexport { ConnectionConfigError } from \"./errors/ConnectionConfigError.js\";\nexport { FetchError } from \"./errors/FetchError.js\";\nexport { ServerError } from \"./errors/ServerError.js\";\nexport { InvalidRequestError } from \"./errors/InvalidRequestError.js\";\nexport { MethodUnsupportedError } from \"./errors/MethodUnsupportedError.js\";\n\n// actions\nexport type * from \"./actions/addBreadCrumb.js\";\nexport { addBreadCrumb } from \"./actions/addBreadCrumb.js\";\n\n// chains (convenience exports for Alchemy-supported chains)\nexport * from \"./chains.js\";\n\n// diagnostics logging\nexport { createLogger } from \"./logging/logger.js\";\nexport {\n setGlobalLoggerConfig,\n getGlobalLoggerConfig,\n LogLevel,\n isLevelEnabled,\n isNamespaceEnabled,\n} from \"./logging/config.js\";\nexport type { DiagnosticsLogger } from \"./logging/logger.js\";\nexport { InMemorySink } from \"./logging/sinks.js\";\n"]}
@@ -22,3 +22,10 @@ export declare enum RoundingMode {
22
22
  * @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode
23
23
  */
24
24
  export declare const bigIntMultiply: (base: BigNumberish, multiplier: Multiplier["multiplier"], roundingMode?: RoundingMode) => bigint;
25
+ /**
26
+ * Returns the max bigint in a list of bigints
27
+ *
28
+ * @param {bigint[]} args a list of bigints to get the max of
29
+ * @returns {bigint} the max bigint in the list
30
+ */
31
+ export declare const bigIntMax: (...args: bigint[]) => bigint;
@@ -34,4 +34,16 @@ export const bigIntMultiply = (base, multiplier, roundingMode = RoundingMode.ROU
34
34
  ? result / BigInt(10 ** decimalPlaces) + 1n
35
35
  : result / BigInt(10 ** decimalPlaces);
36
36
  };
37
+ /**
38
+ * Returns the max bigint in a list of bigints
39
+ *
40
+ * @param {bigint[]} args a list of bigints to get the max of
41
+ * @returns {bigint} the max bigint in the list
42
+ */
43
+ export const bigIntMax = (...args) => {
44
+ if (!args.length) {
45
+ throw new Error("bigIntMax requires at least one argument");
46
+ }
47
+ return args.reduce((m, c) => (m > c ? m : c));
48
+ };
37
49
  //# sourceMappingURL=bigint.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.js","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,2DAAc,CAAA;IACd,uDAAY,CAAA;AACd,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,UAAsB;IAC/C,MAAM,aAAa,GACjB,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IAC9D,OAAO,aAAa,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAkB,EAClB,UAAoC,EACpC,eAA6B,YAAY,CAAC,QAAQ,EAClD,EAAE;IACF,IAAI,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;IACJ,CAAC;IAED,kFAAkF;IAClF,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IACvE,MAAM,MAAM,GACV,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,IAAI,aAAa,CAAC,CAAC,CAAC;IACtE,OAAO,YAAY,KAAK,YAAY,CAAC,QAAQ;QAC3C,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,GAAG,CAAC;QACxC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,GAAG,EAAE;QAC3C,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,CAAC;AAC3C,CAAC,CAAC","sourcesContent":["/**\n * BigNumberish represents values that can be converted to BigInt\n */\nexport type BigNumberish = string | number | bigint;\n\n/**\n * Multiplier configuration for bigint multiplication\n */\nexport type Multiplier = {\n multiplier: number;\n};\n\nexport enum RoundingMode {\n ROUND_DOWN = 0,\n ROUND_UP = 1,\n}\n\n/**\n * Validates if a multiplier has acceptable precision (max 4 decimal places)\n *\n * @param {Multiplier} multiplier - the multiplier to validate\n * @returns {boolean} true if valid, false otherwise\n */\nfunction isValidMultiplier(multiplier: Multiplier): boolean {\n const decimalPlaces =\n multiplier.multiplier.toString().split(\".\")[1]?.length ?? 0;\n return decimalPlaces <= 4;\n}\n\n/**\n * Given a bigint and a number (which can be a float), returns the bigint value.\n * Note: this function has loss and will round down to the nearest integer.\n *\n * @param {BigNumberish} base - the number to be multiplied\n * @param {number} multiplier - the amount to multiply by\n * @param {RoundingMode} roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP\n * @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode\n */\nexport const bigIntMultiply = (\n base: BigNumberish,\n multiplier: Multiplier[\"multiplier\"],\n roundingMode: RoundingMode = RoundingMode.ROUND_UP,\n) => {\n if (!isValidMultiplier({ multiplier })) {\n throw new Error(\n \"bigIntMultiply requires a multiplier validated number as the second argument (max 4 decimal places)\",\n );\n }\n\n // Get decimal places of b. Max decimal places is defined by the validation above.\n const decimalPlaces = multiplier.toString().split(\".\")[1]?.length ?? 0;\n const result =\n BigInt(base) * BigInt(Math.round(multiplier * 10 ** decimalPlaces));\n return roundingMode === RoundingMode.ROUND_UP &&\n result % BigInt(10 ** decimalPlaces) > 0\n ? result / BigInt(10 ** decimalPlaces) + 1n\n : result / BigInt(10 ** decimalPlaces);\n};\n"]}
1
+ {"version":3,"file":"bigint.js","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AAYA,MAAM,CAAN,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,2DAAc,CAAA;IACd,uDAAY,CAAA;AACd,CAAC,EAHW,YAAY,KAAZ,YAAY,QAGvB;AAED;;;;;GAKG;AACH,SAAS,iBAAiB,CAAC,UAAsB;IAC/C,MAAM,aAAa,GACjB,UAAU,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IAC9D,OAAO,aAAa,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,IAAkB,EAClB,UAAoC,EACpC,eAA6B,YAAY,CAAC,QAAQ,EAClD,EAAE;IACF,IAAI,CAAC,iBAAiB,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC;QACvC,MAAM,IAAI,KAAK,CACb,qGAAqG,CACtG,CAAC;IACJ,CAAC;IAED,kFAAkF;IAClF,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC;IACvE,MAAM,MAAM,GACV,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,GAAG,EAAE,IAAI,aAAa,CAAC,CAAC,CAAC;IACtE,OAAO,YAAY,KAAK,YAAY,CAAC,QAAQ;QAC3C,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,GAAG,CAAC;QACxC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,GAAG,EAAE;QAC3C,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,IAAI,aAAa,CAAC,CAAC;AAC3C,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,IAAc,EAAU,EAAE;IACrD,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAChD,CAAC,CAAC","sourcesContent":["/**\n * BigNumberish represents values that can be converted to BigInt\n */\nexport type BigNumberish = string | number | bigint;\n\n/**\n * Multiplier configuration for bigint multiplication\n */\nexport type Multiplier = {\n multiplier: number;\n};\n\nexport enum RoundingMode {\n ROUND_DOWN = 0,\n ROUND_UP = 1,\n}\n\n/**\n * Validates if a multiplier has acceptable precision (max 4 decimal places)\n *\n * @param {Multiplier} multiplier - the multiplier to validate\n * @returns {boolean} true if valid, false otherwise\n */\nfunction isValidMultiplier(multiplier: Multiplier): boolean {\n const decimalPlaces =\n multiplier.multiplier.toString().split(\".\")[1]?.length ?? 0;\n return decimalPlaces <= 4;\n}\n\n/**\n * Given a bigint and a number (which can be a float), returns the bigint value.\n * Note: this function has loss and will round down to the nearest integer.\n *\n * @param {BigNumberish} base - the number to be multiplied\n * @param {number} multiplier - the amount to multiply by\n * @param {RoundingMode} roundingMode - the rounding mode to use when calculating the percent. defaults to ROUND_UP\n * @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode\n */\nexport const bigIntMultiply = (\n base: BigNumberish,\n multiplier: Multiplier[\"multiplier\"],\n roundingMode: RoundingMode = RoundingMode.ROUND_UP,\n) => {\n if (!isValidMultiplier({ multiplier })) {\n throw new Error(\n \"bigIntMultiply requires a multiplier validated number as the second argument (max 4 decimal places)\",\n );\n }\n\n // Get decimal places of b. Max decimal places is defined by the validation above.\n const decimalPlaces = multiplier.toString().split(\".\")[1]?.length ?? 0;\n const result =\n BigInt(base) * BigInt(Math.round(multiplier * 10 ** decimalPlaces));\n return roundingMode === RoundingMode.ROUND_UP &&\n result % BigInt(10 ** decimalPlaces) > 0\n ? result / BigInt(10 ** decimalPlaces) + 1n\n : result / BigInt(10 ** decimalPlaces);\n};\n\n/**\n * Returns the max bigint in a list of bigints\n *\n * @param {bigint[]} args a list of bigints to get the max of\n * @returns {bigint} the max bigint in the list\n */\nexport const bigIntMax = (...args: bigint[]): bigint => {\n if (!args.length) {\n throw new Error(\"bigIntMax requires at least one argument\");\n }\n\n return args.reduce((m, c) => (m > c ? m : c));\n};\n"]}
@@ -1 +1 @@
1
- export declare const VERSION = "0.0.0";
1
+ export declare const VERSION = "0.0.0-alpha.19";
@@ -1,4 +1,4 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "0.0.0";
3
+ export const VERSION = "0.0.0-alpha.19";
4
4
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"0.0.0\";\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,gBAAgB,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"0.0.0-alpha.19\";\n"]}
@@ -38,9 +38,18 @@ export declare const fraxtalSepolia: {
38
38
  sourceId?: number | undefined | undefined;
39
39
  testnet: true;
40
40
  custom?: Record<string, unknown> | undefined;
41
+ extendSchema?: Record<string, unknown> | undefined;
41
42
  fees?: import("viem").ChainFees<undefined> | undefined;
42
43
  formatters?: undefined;
44
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
45
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
46
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
47
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
48
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
49
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
50
+ }] | undefined;
43
51
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
52
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
44
53
  };
45
54
  export declare const openlootSepolia: {
46
55
  blockExplorers: {
@@ -76,9 +85,18 @@ export declare const openlootSepolia: {
76
85
  sourceId?: number | undefined | undefined;
77
86
  testnet: true;
78
87
  custom?: Record<string, unknown> | undefined;
88
+ extendSchema?: Record<string, unknown> | undefined;
79
89
  fees?: import("viem").ChainFees<undefined> | undefined;
80
90
  formatters?: undefined;
91
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
92
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
93
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
94
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
95
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
96
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
97
+ }] | undefined;
81
98
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
99
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
82
100
  };
83
101
  export declare const gensynTestnet: {
84
102
  blockExplorers: {
@@ -114,9 +132,18 @@ export declare const gensynTestnet: {
114
132
  sourceId?: number | undefined | undefined;
115
133
  testnet: true;
116
134
  custom?: Record<string, unknown> | undefined;
135
+ extendSchema?: Record<string, unknown> | undefined;
117
136
  fees?: import("viem").ChainFees<undefined> | undefined;
118
137
  formatters?: undefined;
138
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
139
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
140
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
141
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
142
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
143
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
144
+ }] | undefined;
119
145
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
146
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
120
147
  };
121
148
  export declare const riseTestnet: {
122
149
  blockExplorers: {
@@ -152,9 +179,18 @@ export declare const riseTestnet: {
152
179
  sourceId?: number | undefined | undefined;
153
180
  testnet: true;
154
181
  custom?: Record<string, unknown> | undefined;
182
+ extendSchema?: Record<string, unknown> | undefined;
155
183
  fees?: import("viem").ChainFees<undefined> | undefined;
156
184
  formatters?: undefined;
185
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
186
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
187
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
188
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
189
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
190
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
191
+ }] | undefined;
157
192
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
193
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
158
194
  };
159
195
  export declare const storyMainnet: {
160
196
  blockExplorers: {
@@ -190,9 +226,18 @@ export declare const storyMainnet: {
190
226
  sourceId?: number | undefined | undefined;
191
227
  testnet?: boolean | undefined | undefined;
192
228
  custom?: Record<string, unknown> | undefined;
229
+ extendSchema?: Record<string, unknown> | undefined;
193
230
  fees?: import("viem").ChainFees<undefined> | undefined;
194
231
  formatters?: undefined;
232
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
233
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
234
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
235
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
236
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
237
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
238
+ }] | undefined;
195
239
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
240
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
196
241
  };
197
242
  export declare const teaSepolia: {
198
243
  blockExplorers: {
@@ -228,8 +273,17 @@ export declare const teaSepolia: {
228
273
  sourceId?: number | undefined | undefined;
229
274
  testnet: true;
230
275
  custom?: Record<string, unknown> | undefined;
276
+ extendSchema?: Record<string, unknown> | undefined;
231
277
  fees?: import("viem").ChainFees<undefined> | undefined;
232
278
  formatters?: undefined;
279
+ prepareTransactionRequest?: ((args: import("viem").PrepareTransactionRequestParameters, options: {
280
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
281
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | [fn: ((args: import("viem").PrepareTransactionRequestParameters, options: {
282
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
283
+ }) => Promise<import("viem").PrepareTransactionRequestParameters>) | undefined, options: {
284
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
285
+ }] | undefined;
233
286
  serializers?: import("viem").ChainSerializers<undefined, import("viem").TransactionSerializable> | undefined;
287
+ verifyHash?: ((client: import("viem").Client, parameters: import("viem").VerifyHashActionParameters) => Promise<import("viem").VerifyHashActionReturnType>) | undefined;
234
288
  };
235
289
  //# sourceMappingURL=chains.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBtB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAevB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBrB,CAAC"}
1
+ {"version":3,"file":"chains.d.ts","sourceRoot":"","sources":["../../src/chains.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUzB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBtB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAevB,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBrB,CAAC"}
@@ -7,7 +7,7 @@ export { getAlchemyRpcUrl, isChainSupported, getSupportedChainIds, } from "./tra
7
7
  export type * from "./utils/types.js";
8
8
  export { assertNever } from "./utils/assertNever.js";
9
9
  export { raise } from "./utils/raise.js";
10
- export { bigIntMultiply } from "./utils/bigint.js";
10
+ export { bigIntMultiply, bigIntMax } from "./utils/bigint.js";
11
11
  export { lowerAddress } from "./utils/lowerAddress.js";
12
12
  export { createEip1193HandlerFactory } from "./utils/createEip1193HandlerFactory.js";
13
13
  export type { AlchemyConnectionConfig } from "./transport/connectionSchema.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,mBAAmB,wBAAwB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAGtC,mBAAmB,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGrF,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAG5E,mBAAmB,4BAA4B,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,iBAAiB,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,mBAAmB,wBAAwB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG9E,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AAGtC,mBAAmB,kBAAkB,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AAGrF,YAAY,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,EACL,6BAA6B,EAC7B,+BAA+B,EAC/B,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAG5E,mBAAmB,4BAA4B,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAG3D,cAAc,aAAa,CAAC;AAG5B,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -22,4 +22,11 @@ export declare enum RoundingMode {
22
22
  * @returns {bigint} the bigint value of the multiplication with the number rounded by the rounding mode
23
23
  */
24
24
  export declare const bigIntMultiply: (base: BigNumberish, multiplier: Multiplier["multiplier"], roundingMode?: RoundingMode) => bigint;
25
+ /**
26
+ * Returns the max bigint in a list of bigints
27
+ *
28
+ * @param {bigint[]} args a list of bigints to get the max of
29
+ * @returns {bigint} the max bigint in the list
30
+ */
31
+ export declare const bigIntMax: (...args: bigint[]) => bigint;
25
32
  //# sourceMappingURL=bigint.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,YAAY;IACtB,UAAU,IAAI;IACd,QAAQ,IAAI;CACb;AAcD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,YAAY,EAClB,YAAY,UAAU,CAAC,YAAY,CAAC,EACpC,eAAc,YAAoC,WAgBnD,CAAC"}
1
+ {"version":3,"file":"bigint.d.ts","sourceRoot":"","sources":["../../../src/utils/bigint.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,YAAY;IACtB,UAAU,IAAI;IACd,QAAQ,IAAI;CACb;AAcD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,GACzB,MAAM,YAAY,EAClB,YAAY,UAAU,CAAC,YAAY,CAAC,EACpC,eAAc,YAAoC,WAgBnD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,MAAM,EAAE,KAAG,MAM7C,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.0";
1
+ export declare const VERSION = "0.0.0-alpha.19";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,UAAU,CAAC"}
1
+ {"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alchemy/common",
3
- "version": "0.0.0-alpha.2",
3
+ "version": "0.0.0-alpha.20",
4
4
  "description": "A collection of interfaces and utilities to be used by other Alchemy packages",
5
5
  "author": "Alchemy",
6
6
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "typescript-template": "*"
48
48
  },
49
49
  "dependencies": {
50
- "viem": "^2.32.0"
50
+ "viem": "^2.44.2"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",
@@ -61,5 +61,5 @@
61
61
  "url": "https://github.com/alchemyplatform/aa-sdk/issues"
62
62
  },
63
63
  "homepage": "https://github.com/alchemyplatform/aa-sdk#readme",
64
- "gitHead": "6f91085bd0f35267d8fcb6cc533f884391b5ea14"
64
+ "gitHead": "b759d878f074f4d657d62d2a8e2ef4a5631ab209"
65
65
  }
package/src/index.ts CHANGED
@@ -18,7 +18,7 @@ export {
18
18
  export type * from "./utils/types.js";
19
19
  export { assertNever } from "./utils/assertNever.js";
20
20
  export { raise } from "./utils/raise.js";
21
- export { bigIntMultiply } from "./utils/bigint.js";
21
+ export { bigIntMultiply, bigIntMax } from "./utils/bigint.js";
22
22
  export { lowerAddress } from "./utils/lowerAddress.js";
23
23
  export { createEip1193HandlerFactory } from "./utils/createEip1193HandlerFactory.js";
24
24
 
@@ -56,3 +56,17 @@ export const bigIntMultiply = (
56
56
  ? result / BigInt(10 ** decimalPlaces) + 1n
57
57
  : result / BigInt(10 ** decimalPlaces);
58
58
  };
59
+
60
+ /**
61
+ * Returns the max bigint in a list of bigints
62
+ *
63
+ * @param {bigint[]} args a list of bigints to get the max of
64
+ * @returns {bigint} the max bigint in the list
65
+ */
66
+ export const bigIntMax = (...args: bigint[]): bigint => {
67
+ if (!args.length) {
68
+ throw new Error("bigIntMax requires at least one argument");
69
+ }
70
+
71
+ return args.reduce((m, c) => (m > c ? m : c));
72
+ };
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file is autogenerated by inject-version.ts. Any changes will be
2
2
  // overwritten on commit!
3
- export const VERSION = "0.0.0";
3
+ export const VERSION = "0.0.0-alpha.20";