viem 2.0.0-alpha.8 → 2.0.0-alpha.9

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '2.0.0-alpha.8';
4
+ exports.version = '2.0.0-alpha.9';
5
5
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export const version = '2.0.0-alpha.8';
1
+ export const version = '2.0.0-alpha.9';
2
2
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const version = "2.0.0-alpha.8";
1
+ export declare const version = "2.0.0-alpha.9";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -15,14 +15,14 @@ export type MulticallContracts<contracts extends readonly unknown[], options ext
15
15
  ], options, [
16
16
  ...result,
17
17
  MaybePartial<Prettify<GetMulticallContractParameters<contract, options['mutability']> & options['properties']>, options['optional']>
18
- ]> : readonly unknown[] extends contracts ? contracts : contracts extends readonly ContractFunctionParameters<infer abi, infer _, infer functionName, infer args>[] ? readonly MaybePartial<Prettify<ContractFunctionParameters<abi, options['mutability'], functionName, args> & options['properties']>, options['optional']>[] : readonly MaybePartial<Prettify<ContractFunctionParameters & options['properties']>, options['optional']>[];
18
+ ]> : readonly unknown[] extends contracts ? contracts : contracts extends readonly (infer contract extends ContractFunctionParameters)[] ? readonly MaybePartial<Prettify<contract & options['properties']>, options['optional']>[] : readonly MaybePartial<Prettify<ContractFunctionParameters & options['properties']>, options['optional']>[];
19
19
  export type MulticallResults<contracts extends readonly unknown[] = readonly ContractFunctionParameters[], allowFailure extends boolean = true, options extends {
20
20
  error?: Error;
21
21
  mutability: AbiStateMutability;
22
22
  } = {
23
23
  error: Error;
24
24
  mutability: AbiStateMutability;
25
- }, result extends any[] = []> = contracts extends readonly [] ? [] : contracts extends readonly [infer contract] ? [
25
+ }, result extends any[] = []> = contracts extends readonly [] ? readonly [] : contracts extends readonly [infer contract] ? [
26
26
  ...result,
27
27
  MulticallResponse<GetMulticallContractReturnType<contract, options['mutability']>, options['error'], allowFailure>
28
28
  ] : contracts extends readonly [infer contract, ...infer rest] ? MulticallResults<[
@@ -30,7 +30,7 @@ export type MulticallResults<contracts extends readonly unknown[] = readonly Con
30
30
  ], allowFailure, options, [
31
31
  ...result,
32
32
  MulticallResponse<GetMulticallContractReturnType<contract, options['mutability']>, options['error'], allowFailure>
33
- ]> : readonly unknown[] extends contracts ? unknown[] : contracts extends readonly (infer contract extends ContractFunctionParameters)[] ? MulticallResponse<GetMulticallContractReturnType<contract, options['mutability']>, options['error'], allowFailure>[] : unknown[];
33
+ ]> : readonly unknown[] extends contracts ? MulticallResponse<unknown, options['error'], allowFailure>[] : contracts extends readonly (infer contract extends ContractFunctionParameters)[] ? MulticallResponse<GetMulticallContractReturnType<contract, options['mutability']>, options['error'], allowFailure>[] : MulticallResponse<unknown, options['error'], allowFailure>[];
34
34
  export type MulticallResponse<result = unknown, error = unknown, allowFailure extends boolean = true> = allowFailure extends true ? {
35
35
  error?: undefined;
36
36
  result: result;
@@ -1 +1 @@
1
- {"version":3,"file":"multicall.d.ts","sourceRoot":"","sources":["../../types/multicall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,eAAe,CAAA;AACtB,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAExD,MAAM,MAAM,kBAAkB,CAC5B,SAAS,SAAS,SAAS,OAAO,EAAE,EACpC,OAAO,SAAS;IACd,UAAU,EAAE,kBAAkB,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,G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,YAAY,SAAS,oBAAoB,CAC3D,GAAG,EACH,UAAU,CACX,CAAA;CACF,GAEC,QAAQ,SAAS;IACf,IAAI,EAAE,MAAM,IAAI,SAAS,oBAAoB,CAC3C,GAAG,EACH,UAAU,EACV,YAAY,CACb,CAAA;CACF,GACC,0BAA0B,CAAC,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,GAC/D,0BAA0B,CAAC,GAAG,EAAE,UAAU,EAAE,YAAY,CAAC,GAE7D,GAAG,SAAS,GAAG,GACb,0BAA0B,GAE1B,0BAA0B,CAAC,GAAG,EAAE,UAAU,CAAC,GAC7C,0BAA0B,CAAC,SAAS,OAAO,EAAE,CAAC,CAAA;AAElD,KAAK,8BAA8B,CACjC,QAAQ,EACR,UAAU,SAAS,kBAAkB,IACnC,QAAQ,SAAS;IAAE,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,CAAA;CAAE,GAE/C,QAAQ,SAAS;IACf,YAAY,EAAE,MAAM,YAAY,SAAS,oBAAoB,CAC3D,GAAG,EACH,UAAU,CACX,CAAA;CACF,GAEC,QAAQ,SAAS;IACf,IAAI,EAAE,MAAM,IAAI,SAAS,oBAAoB,CAC3C,GAAG,EACH,UAAU,EACV,YAAY,CACb,CAAA;CACF,GACC,0BAA0B,CAAC,GAAG,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,CAAC,GAC/D,0BAA0B,CAAC,GAAG,EAAE,UAAU,EAAE,YAAY,CAAC,GAC3D,0BAA0B,CAAC,GAAG,EAAE,UAAU,CAAC,GAC7C,0BAA0B,CAAA"}
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.0.0-alpha.8'
1
+ export const version = '2.0.0-alpha.9'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.0.0-alpha.8",
4
+ "version": "2.0.0-alpha.9",
5
5
  "type": "module",
6
6
  "main": "./_cjs/index.js",
7
7
  "module": "./_esm/index.js",
@@ -49,22 +49,9 @@ export type MulticallContracts<
49
49
  ? contracts
50
50
  : // If `contracts` is *some* array but we couldn't assign `unknown[]` to it, then it must hold some known/homogenous type!
51
51
  // use this to infer the param types in the case of Array.map() argument
52
- contracts extends readonly ContractFunctionParameters<
53
- infer abi,
54
- infer _,
55
- infer functionName,
56
- infer args
57
- >[]
52
+ contracts extends readonly (infer contract extends ContractFunctionParameters)[]
58
53
  ? readonly MaybePartial<
59
- Prettify<
60
- ContractFunctionParameters<
61
- abi,
62
- options['mutability'],
63
- functionName,
64
- args
65
- > &
66
- options['properties']
67
- >,
54
+ Prettify<contract & options['properties']>,
68
55
  options['optional']
69
56
  >[]
70
57
  : // Fallback
@@ -83,7 +70,7 @@ export type MulticallResults<
83
70
  ///
84
71
  result extends any[] = [],
85
72
  > = contracts extends readonly [] // no contracts, return empty
86
- ? []
73
+ ? readonly []
87
74
  : contracts extends readonly [infer contract] // one contract left before returning `result`
88
75
  ? [
89
76
  ...result,
@@ -108,7 +95,7 @@ export type MulticallResults<
108
95
  ]
109
96
  >
110
97
  : readonly unknown[] extends contracts
111
- ? unknown[]
98
+ ? MulticallResponse<unknown, options['error'], allowFailure>[]
112
99
  : // If `contracts` is *some* array but we couldn't assign `unknown[]` to it, then it must hold some known/homogenous type!
113
100
  // use this to infer the param types in the case of Array.map() argument
114
101
  contracts extends readonly (infer contract extends ContractFunctionParameters)[]
@@ -118,7 +105,7 @@ export type MulticallResults<
118
105
  allowFailure
119
106
  >[]
120
107
  : // Fallback
121
- unknown[]
108
+ MulticallResponse<unknown, options['error'], allowFailure>[]
122
109
 
123
110
  export type MulticallResponse<
124
111
  result = unknown,