viem 2.57.18 → 2.57.19

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 (121) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/_cjs/actions/ens/getEnsText.js.map +1 -1
  3. package/_cjs/actions/public/getDelegation.js +2 -1
  4. package/_cjs/actions/public/getDelegation.js.map +1 -1
  5. package/_cjs/actions/public/getFeeHistory.js.map +1 -1
  6. package/_cjs/actions/token/internal.js +2 -10
  7. package/_cjs/actions/token/internal.js.map +1 -1
  8. package/_cjs/actions/wallet/deployContract.js +2 -1
  9. package/_cjs/actions/wallet/deployContract.js.map +1 -1
  10. package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
  11. package/_cjs/actions/wallet/sendCalls.js +2 -1
  12. package/_cjs/actions/wallet/sendCalls.js.map +1 -1
  13. package/_cjs/actions/wallet/signAuthorization.js +2 -1
  14. package/_cjs/actions/wallet/signAuthorization.js.map +1 -1
  15. package/_cjs/chains/definitions/kinetiqElysium.js +30 -0
  16. package/_cjs/chains/definitions/kinetiqElysium.js.map +1 -0
  17. package/_cjs/chains/definitions/kinetiqElysiumTestnet.js +31 -0
  18. package/_cjs/chains/definitions/kinetiqElysiumTestnet.js.map +1 -0
  19. package/_cjs/chains/index.js +14 -9
  20. package/_cjs/chains/index.js.map +1 -1
  21. package/_cjs/errors/typedData.js +2 -0
  22. package/_cjs/errors/typedData.js.map +1 -1
  23. package/_cjs/errors/version.js +1 -1
  24. package/_cjs/tempo/actions/accounts.js +14 -4
  25. package/_cjs/tempo/actions/accounts.js.map +1 -1
  26. package/_cjs/tempo/chainConfig.js +23 -1
  27. package/_cjs/tempo/chainConfig.js.map +1 -1
  28. package/_cjs/tempo/internal/relay.js +2 -2
  29. package/_cjs/tempo/internal/relay.js.map +1 -1
  30. package/_cjs/tempo/internal/utils.js +2 -10
  31. package/_cjs/tempo/internal/utils.js.map +1 -1
  32. package/_cjs/tokens/defineToken.js +1 -1
  33. package/_cjs/tokens/defineToken.js.map +1 -1
  34. package/_cjs/tokens/definitions/ousd.js +1 -0
  35. package/_cjs/tokens/definitions/ousd.js.map +1 -1
  36. package/_esm/actions/ens/getEnsText.js.map +1 -1
  37. package/_esm/actions/public/getDelegation.js +2 -1
  38. package/_esm/actions/public/getDelegation.js.map +1 -1
  39. package/_esm/actions/public/getFeeHistory.js.map +1 -1
  40. package/_esm/actions/token/internal.js +2 -10
  41. package/_esm/actions/token/internal.js.map +1 -1
  42. package/_esm/actions/wallet/deployContract.js +2 -1
  43. package/_esm/actions/wallet/deployContract.js.map +1 -1
  44. package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
  45. package/_esm/actions/wallet/sendCalls.js +2 -1
  46. package/_esm/actions/wallet/sendCalls.js.map +1 -1
  47. package/_esm/actions/wallet/signAuthorization.js +2 -1
  48. package/_esm/actions/wallet/signAuthorization.js.map +1 -1
  49. package/_esm/chains/definitions/kinetiqElysium.js +27 -0
  50. package/_esm/chains/definitions/kinetiqElysium.js.map +1 -0
  51. package/_esm/chains/definitions/kinetiqElysiumTestnet.js +28 -0
  52. package/_esm/chains/definitions/kinetiqElysiumTestnet.js.map +1 -0
  53. package/_esm/chains/index.js +2 -0
  54. package/_esm/chains/index.js.map +1 -1
  55. package/_esm/errors/typedData.js +2 -0
  56. package/_esm/errors/typedData.js.map +1 -1
  57. package/_esm/errors/version.js +1 -1
  58. package/_esm/tempo/actions/accounts.js +19 -5
  59. package/_esm/tempo/actions/accounts.js.map +1 -1
  60. package/_esm/tempo/chainConfig.js +25 -1
  61. package/_esm/tempo/chainConfig.js.map +1 -1
  62. package/_esm/tempo/internal/relay.js +8 -3
  63. package/_esm/tempo/internal/relay.js.map +1 -1
  64. package/_esm/tempo/internal/utils.js +2 -10
  65. package/_esm/tempo/internal/utils.js.map +1 -1
  66. package/_esm/tokens/defineToken.js +2 -1
  67. package/_esm/tokens/defineToken.js.map +1 -1
  68. package/_esm/tokens/definitions/ousd.js +2 -1
  69. package/_esm/tokens/definitions/ousd.js.map +1 -1
  70. package/_types/actions/ens/getEnsText.d.ts +2 -1
  71. package/_types/actions/ens/getEnsText.d.ts.map +1 -1
  72. package/_types/actions/public/getDelegation.d.ts.map +1 -1
  73. package/_types/actions/public/getFeeHistory.d.ts +2 -1
  74. package/_types/actions/public/getFeeHistory.d.ts.map +1 -1
  75. package/_types/actions/token/internal.d.ts.map +1 -1
  76. package/_types/actions/wallet/deployContract.d.ts.map +1 -1
  77. package/_types/actions/wallet/prepareTransactionRequest.d.ts +2 -1
  78. package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
  79. package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
  80. package/_types/actions/wallet/signAuthorization.d.ts.map +1 -1
  81. package/_types/chains/definitions/kinetiqElysium.d.ts +52 -0
  82. package/_types/chains/definitions/kinetiqElysium.d.ts.map +1 -0
  83. package/_types/chains/definitions/kinetiqElysiumTestnet.d.ts +52 -0
  84. package/_types/chains/definitions/kinetiqElysiumTestnet.d.ts.map +1 -0
  85. package/_types/chains/index.d.ts +2 -0
  86. package/_types/chains/index.d.ts.map +1 -1
  87. package/_types/errors/typedData.d.ts.map +1 -1
  88. package/_types/errors/version.d.ts +1 -1
  89. package/_types/tempo/actions/accounts.d.ts +4 -1
  90. package/_types/tempo/actions/accounts.d.ts.map +1 -1
  91. package/_types/tempo/chainConfig.d.ts.map +1 -1
  92. package/_types/tempo/internal/utils.d.ts.map +1 -1
  93. package/_types/tokens/defineToken.d.ts +5 -1
  94. package/_types/tokens/defineToken.d.ts.map +1 -1
  95. package/_types/tokens/definitions/ousd.d.ts +2 -1
  96. package/_types/tokens/definitions/ousd.d.ts.map +1 -1
  97. package/_types/tokens/sets.d.ts +3 -0
  98. package/_types/tokens/sets.d.ts.map +1 -1
  99. package/_types/zksync/errors/bridge.d.ts +1 -1
  100. package/_types/zksync/errors/bridge.d.ts.map +1 -1
  101. package/actions/ens/getEnsText.ts +2 -0
  102. package/actions/public/getDelegation.ts +6 -1
  103. package/actions/public/getFeeHistory.ts +2 -0
  104. package/actions/token/internal.ts +2 -10
  105. package/actions/wallet/deployContract.ts +6 -1
  106. package/actions/wallet/prepareTransactionRequest.ts +2 -0
  107. package/actions/wallet/sendCalls.ts +6 -1
  108. package/actions/wallet/signAuthorization.ts +6 -1
  109. package/chains/definitions/kinetiqElysium.ts +27 -0
  110. package/chains/definitions/kinetiqElysiumTestnet.ts +28 -0
  111. package/chains/index.ts +2 -0
  112. package/errors/typedData.ts +2 -0
  113. package/errors/version.ts +1 -1
  114. package/package.json +1 -1
  115. package/tempo/actions/accounts.ts +24 -6
  116. package/tempo/chainConfig.ts +33 -5
  117. package/tempo/internal/relay.ts +8 -3
  118. package/tempo/internal/utils.ts +2 -10
  119. package/tokens/defineToken.ts +6 -2
  120. package/tokens/definitions/ousd.ts +2 -1
  121. package/zksync/errors/bridge.ts +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../tempo/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAS,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EACV,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAK9C;;;;;;;;;;;;;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EAClB,YAAY,CACb,EAED,IAAI,EACA,IAAI,GACJ,0BAA0B,CAAC,GAAG,EAAE,kBAAkB,EAAE,YAAY,CAAC,GACpE,0BAA0B,CAC3B;IAAC,cAAc,CAAC,GAAG,EAAE,YAAY,CAAC;CAAC,EACnC,kBAAkB,EAClB,YAAY,CACb,GAAG;IACF,IAAI,EAAE,GAAG,CAAA;IACT,EAAE,EAAE,OAAO,CAAA;CACZ,CAQA;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,CActD;AAKD,iEAAiE;AACjE,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,IAAI,OAAO,CAEvE"}
@@ -12,6 +12,8 @@ export type Tokens = readonly Token[];
12
12
  export type ResolvedToken = {
13
13
  /** Token contract address. */
14
14
  address: Address;
15
+ /** Chain id the token was resolved for. */
16
+ chainId: number;
15
17
  /** Token currency denomination. */
16
18
  currency?: string | undefined;
17
19
  /** Token decimals, used to parse human-readable `amount` strings. */
@@ -51,6 +53,7 @@ export type ResolvedToken = {
51
53
  * usdc(1)
52
54
  * // {
53
55
  * // address: '0xA0b8…48',
56
+ * // chainId: 1,
54
57
  * // currency: 'USD',
55
58
  * // decimals: 6,
56
59
  * // name: 'USD Coin',
@@ -83,11 +86,12 @@ export declare namespace defineToken {
83
86
  };
84
87
  export type ReturnType<token extends Parameters = Parameters> = {
85
88
  /**
86
- * Resolves the token config (`address`, `currency`, `decimals`, `name`,
89
+ * Resolves the token config (`address`, `chainId`, `currency`, `decimals`, `name`,
87
90
  * `popular`, `symbol`) for a chain id.
88
91
  */
89
92
  <chainId extends keyof token['addresses']>(chainId: chainId): {
90
93
  address: token['addresses'][chainId];
94
+ chainId: chainId;
91
95
  currency: ParameterValue<token, 'currency'>;
92
96
  decimals: token['decimals'];
93
97
  name: ParameterValue<token, 'name'>;
@@ -1 +1 @@
1
- {"version":3,"file":"defineToken.d.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QACzD,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;QAC3C,yCAAyC;QACzC,QAAQ,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QAC3B,wCAAwC;QACxC,IAAI,EAAE,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;QACnC,qEAAqE;QACrE,OAAO,EAAE,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;QACzC,kCAAkC;QAClC,MAAM,EAAE,cAAc,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;KACxC,CAAA;;CACF"}
@@ -1,7 +1,7 @@
1
1
  import { defineToken } from '../defineToken.js';
2
2
  /**
3
3
  * [Open USD](https://joinopenstandard.com/) token, with canonical contract
4
- * addresses on Ethereum, Tempo, and Base.
4
+ * addresses on Ethereum, Tempo, Tempo Moderato, and Base.
5
5
  *
6
6
  * @example
7
7
  * ```ts
@@ -16,6 +16,7 @@ export declare const ousd: defineToken.ReturnType<{
16
16
  readonly 1: "0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436";
17
17
  readonly 4217: "0x20c0000000000000000000006a37DA5C996874BE";
18
18
  readonly 8453: "0xB2000000000000000000002fEb517dFeC7415344";
19
+ readonly 42431: "0x20c0000000000000000000006a37DA5C996874BE";
19
20
  };
20
21
  readonly currency: "USD";
21
22
  readonly decimals: 6;
@@ -1 +1 @@
1
- {"version":3,"file":"ousd.d.ts","sourceRoot":"","sources":["../../../tokens/definitions/ousd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;EAWf,CAAA"}
1
+ {"version":3,"file":"ousd.d.ts","sourceRoot":"","sources":["../../../tokens/definitions/ousd.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE/C;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI;;;;;;;;;;;;EAYf,CAAA"}
@@ -141,6 +141,7 @@ export declare const tokens: {
141
141
  readonly 1: "0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436";
142
142
  readonly 4217: "0x20c0000000000000000000006a37DA5C996874BE";
143
143
  readonly 8453: "0xB2000000000000000000002fEb517dFeC7415344";
144
+ readonly 42431: "0x20c0000000000000000000006a37DA5C996874BE";
144
145
  };
145
146
  readonly currency: "USD";
146
147
  readonly decimals: 6;
@@ -349,6 +350,7 @@ export declare const tokens: {
349
350
  readonly 1: "0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436";
350
351
  readonly 4217: "0x20c0000000000000000000006a37DA5C996874BE";
351
352
  readonly 8453: "0xB2000000000000000000002fEb517dFeC7415344";
353
+ readonly 42431: "0x20c0000000000000000000006a37DA5C996874BE";
352
354
  };
353
355
  readonly currency: "USD";
354
356
  readonly decimals: 6;
@@ -528,6 +530,7 @@ export declare const tokens: {
528
530
  readonly 1: "0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436";
529
531
  readonly 4217: "0x20c0000000000000000000006a37DA5C996874BE";
530
532
  readonly 8453: "0xB2000000000000000000002fEb517dFeC7415344";
533
+ readonly 42431: "0x20c0000000000000000000006a37DA5C996874BE";
531
534
  };
532
535
  readonly currency: "USD";
533
536
  readonly decimals: 6;
@@ -1 +1 @@
1
- {"version":3,"file":"sets.d.ts","sourceRoot":"","sources":["../../tokens/sets.ts"],"names":[],"mappings":"AA8GA,6EAA6E;AAC7E,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAA"}
@@ -6,7 +6,7 @@ export type BaseFeeHigherThanValueErrorType = BaseFeeHigherThanValueError & {
6
6
  export declare class BaseFeeHigherThanValueError extends BaseError {
7
7
  constructor(baseCost: bigint, value: bigint);
8
8
  }
9
- export type TxHashNotFoundInLogsErrorType = BaseFeeHigherThanValueError & {
9
+ export type TxHashNotFoundInLogsErrorType = TxHashNotFoundInLogsError & {
10
10
  name: 'TxHashNotFoundInLogsError';
11
11
  };
12
12
  export declare class TxHashNotFoundInLogsError extends BaseError {
@@ -1 +1 @@
1
- {"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../../../zksync/errors/bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAE/C,MAAM,MAAM,+BAA+B,GAAG,2BAA2B,GAAG;IAC1E,IAAI,EAAE,6BAA6B,CAAA;CACpC,CAAA;AACD,qBAAa,2BAA4B,SAAQ,SAAS;gBAC5C,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;CAW5C;AAED,MAAM,MAAM,6BAA6B,GAAG,2BAA2B,GAAG;IACxE,IAAI,EAAE,2BAA2B,CAAA;CAClC,CAAA;AACD,qBAAa,yBAA0B,SAAQ,SAAS;;CAMvD;AAED,MAAM,MAAM,8BAA8B,GAAG,0BAA0B,GAAG;IACxE,IAAI,EAAE,4BAA4B,CAAA;CACnC,CAAA;AACD,qBAAa,0BAA2B,SAAQ,SAAS;gBAC3C,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,C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3C,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE;CAUrC;AAED,MAAM,MAAM,qCAAqC,GAC/C,iCAAiC,GAAG;IAClC,IAAI,EAAE,mCAAmC,CAAA;CAC1C,CAAA;AACH,qBAAa,iCAAkC,SAAQ,SAAS;gBAClD,EAAE,IAAI,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAA;KAAE;CAKrC;AAED,MAAM,MAAM,yBAAyB,GAAG,qBAAqB,GAAG;IAC9D,IAAI,EAAE,uBAAuB,CAAA;CAC9B,CAAA;AACD,qBAAa,qBAAsB,SAAQ,SAAS;gBACtC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE;CAM3D;AAED,MAAM,MAAM,yBAAyB,GAAG,qBAAqB,GAAG;IAC9D,IAAI,EAAE,uBAAuB,CAAA;CAC9B,CAAA;AACD,qBAAa,qBAAsB,SAAQ,SAAS;;CAMnD"}
@@ -6,6 +6,7 @@ import {
6
6
  textResolverAbi,
7
7
  universalResolverResolveAbi,
8
8
  } from '../../constants/abis.js'
9
+ import type { ErrorType } from '../../errors/utils.js'
9
10
  import type { Chain } from '../../types/chain.js'
10
11
  import type { Prettify } from '../../types/utils.js'
11
12
  import {
@@ -60,6 +61,7 @@ export type GetEnsTextErrorType =
60
61
  | EncodeFunctionDataErrorType
61
62
  | NamehashErrorType
62
63
  | DecodeFunctionResultErrorType
64
+ | ErrorType
63
65
 
64
66
  /**
65
67
  * Gets a text record for specified ENS name.
@@ -11,6 +11,7 @@ import {
11
11
  } from '../../utils/address/getAddress.js'
12
12
  import { type SizeErrorType, size } from '../../utils/data/size.js'
13
13
  import { type SliceErrorType, slice } from '../../utils/data/slice.js'
14
+ import { getAction } from '../../utils/getAction.js'
14
15
  import { type GetCodeErrorType, getCode } from './getCode.js'
15
16
 
16
17
  export type GetDelegationParameters = {
@@ -62,7 +63,11 @@ export async function getDelegation<chain extends Chain | undefined>(
62
63
  client: Client<Transport, chain>,
63
64
  { address, blockNumber, blockTag = 'latest' }: GetDelegationParameters,
64
65
  ): Promise<GetDelegationReturnType> {
65
- const code = await getCode(client, {
66
+ const code = await getAction(
67
+ client,
68
+ getCode,
69
+ 'getCode',
70
+ )({
66
71
  address,
67
72
  ...(blockNumber !== undefined ? { blockNumber } : { blockTag }),
68
73
  } as GetDelegationParameters)
@@ -1,5 +1,6 @@
1
1
  import type { Client } from '../../clients/createClient.js'
2
2
  import type { Transport } from '../../clients/transports/createTransport.js'
3
+ import type { ErrorType } from '../../errors/utils.js'
3
4
  import type { BlockTag } from '../../types/block.js'
4
5
  import type { Chain } from '../../types/chain.js'
5
6
  import type { FeeHistory } from '../../types/fee.js'
@@ -43,6 +44,7 @@ export type GetFeeHistoryErrorType =
43
44
  | NumberToHexErrorType
44
45
  | RequestErrorType
45
46
  | FormatFeeHistoryErrorType
47
+ | ErrorType
46
48
 
47
49
  /**
48
50
  * Returns a collection of historical gas information.
@@ -247,16 +247,8 @@ function resolveTokenForChain(
247
247
  token: Token,
248
248
  chainId: number,
249
249
  ): ResolvedToken | undefined {
250
- const address = (token.addresses as Record<number, Address>)[chainId]
251
- if (!address) return undefined
252
- return {
253
- address,
254
- currency: token.currency,
255
- decimals: token.decimals,
256
- name: token.name,
257
- popular: token.popular,
258
- symbol: token.symbol,
259
- }
250
+ if (!(token.addresses as Record<number, Address>)[chainId]) return undefined
251
+ return token(chainId as never)
260
252
  }
261
253
 
262
254
  /** Finds a {@link Token} by symbol (case-insensitively) on a `tokens` array. @internal */
@@ -9,6 +9,7 @@ import type { ContractConstructorArgs } from '../../types/contract.js'
9
9
  import type { Hex } from '../../types/misc.js'
10
10
  import type { UnionEvaluate, UnionOmit } from '../../types/utils.js'
11
11
  import { encodeDeployData } from '../../utils/abi/encodeDeployData.js'
12
+ import { getAction } from '../../utils/getAction.js'
12
13
  import {
13
14
  type SendTransactionErrorType,
14
15
  type SendTransactionParameters,
@@ -80,7 +81,11 @@ export function deployContract<
80
81
  const { abi, args, bytecode, ...request } =
81
82
  parameters as DeployContractParameters
82
83
  const calldata = encodeDeployData({ abi, args, bytecode })
83
- return sendTransaction(walletClient, {
84
+ return getAction(
85
+ walletClient,
86
+ sendTransaction,
87
+ 'sendTransaction',
88
+ )({
84
89
  ...request,
85
90
  ...(request.authorizationList ? { to: null } : {}),
86
91
  data: calldata,
@@ -34,6 +34,7 @@ import {
34
34
  MaxFeePerGasTooLowError,
35
35
  } from '../../errors/fee.js'
36
36
  import { FeePayerNonceMismatchError } from '../../errors/transaction.js'
37
+ import type { ErrorType } from '../../errors/utils.js'
37
38
  import type { DeriveAccount, GetAccountParameter } from '../../types/account.js'
38
39
  import type { Block } from '../../types/block.js'
39
40
  import type { ExtractCapabilities } from '../../types/capabilities.js'
@@ -242,6 +243,7 @@ export type PrepareTransactionRequestErrorType =
242
243
  | GetTransactionCountErrorType
243
244
  | EstimateGasErrorType
244
245
  | EstimateFeesPerGasErrorType
246
+ | ErrorType
245
247
 
246
248
  /**
247
249
  * Prepares a transaction request for signing.
@@ -21,6 +21,7 @@ import { concat } from '../../utils/data/concat.js'
21
21
  import { hexToBigInt } from '../../utils/encoding/fromHex.js'
22
22
  import { numberToHex } from '../../utils/encoding/toHex.js'
23
23
  import { getTransactionError } from '../../utils/errors/getTransactionError.js'
24
+ import { getAction } from '../../utils/getAction.js'
24
25
  import { sendTransaction } from './sendTransaction.js'
25
26
 
26
27
  export const fallbackMagicIdentifier =
@@ -225,7 +226,11 @@ export async function sendCalls<
225
226
  const results: PromiseSettledResult<Hex>[] = []
226
227
  for (const call of calls) {
227
228
  try {
228
- const value = await sendTransaction(client, {
229
+ const value = await getAction(
230
+ client,
231
+ sendTransaction,
232
+ 'sendTransaction',
233
+ )({
229
234
  account,
230
235
  chain,
231
236
  data: call.data,
@@ -17,6 +17,7 @@ import {
17
17
  } from '../../errors/account.js'
18
18
  import type { ErrorType } from '../../errors/utils.js'
19
19
  import type { Chain } from '../../types/chain.js'
20
+ import { getAction } from '../../utils/getAction.js'
20
21
  import {
21
22
  type PrepareAuthorizationErrorType,
22
23
  type PrepareAuthorizationParameters,
@@ -103,6 +104,10 @@ export async function signAuthorization<
103
104
  type: account.type,
104
105
  })
105
106
 
106
- const authorization = await prepareAuthorization(client, parameters)
107
+ const authorization = await getAction(
108
+ client,
109
+ prepareAuthorization,
110
+ 'prepareAuthorization',
111
+ )(parameters)
107
112
  return account.signAuthorization(authorization)
108
113
  }
@@ -0,0 +1,27 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const kinetiqElysium = /*#__PURE__*/ defineChain({
4
+ id: 99_901,
5
+ name: 'Elysium',
6
+ blockTime: 100,
7
+ nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://rpc.elysium.kinetiq.xyz'],
11
+ },
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Elysium Explorer',
16
+ url: 'https://elysium.kinetiq.xyz',
17
+ apiUrl: 'https://elysium.kinetiq.xyz/api',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
23
+ blockCreated: 1343,
24
+ },
25
+ },
26
+ sourceId: 999,
27
+ })
@@ -0,0 +1,28 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const kinetiqElysiumTestnet = /*#__PURE__*/ defineChain({
4
+ id: 99_801,
5
+ name: 'Kinetiq Elysium Testnet',
6
+ blockTime: 100,
7
+ nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://testnet-rpc.elysium.kinetiq.xyz'],
11
+ },
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Elysium Testnet Explorer',
16
+ url: 'https://testnet.elysium.kinetiq.xyz',
17
+ apiUrl: 'https://testnet.elysium.kinetiq.xyz/api',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
23
+ blockCreated: 91163,
24
+ },
25
+ },
26
+ sourceId: 998,
27
+ testnet: true,
28
+ })
package/chains/index.ts CHANGED
@@ -351,6 +351,8 @@ export { kavaTestnet } from './definitions/kavaTestnet.js'
351
351
  export { kcc } from './definitions/kcc.js'
352
352
  export { kii } from './definitions/kii.js'
353
353
  export { kiiTestnetOro } from './definitions/kiiTestnet.js'
354
+ export { kinetiqElysium } from './definitions/kinetiqElysium.js'
355
+ export { kinetiqElysiumTestnet } from './definitions/kinetiqElysiumTestnet.js'
354
356
  export { kinto } from './definitions/kinto.js'
355
357
  /** @deprecated Use `kaia` instead. */
356
358
  export { klaytn } from './definitions/klaytn.js'
@@ -10,6 +10,7 @@ export class InvalidDomainError extends BaseError {
10
10
  constructor({ domain }: { domain: unknown }) {
11
11
  super(`Invalid domain "${stringify(domain)}".`, {
12
12
  metaMessages: ['Must be a valid EIP-712 domain.'],
13
+ name: 'InvalidDomainError',
13
14
  })
14
15
  }
15
16
  }
@@ -27,6 +28,7 @@ export class InvalidPrimaryTypeError extends BaseError {
27
28
  {
28
29
  docsPath: '/api/glossary/Errors#typeddatainvalidprimarytypeerror',
29
30
  metaMessages: ['Check that the primary type is a key in `types`.'],
31
+ name: 'InvalidPrimaryTypeError',
30
32
  },
31
33
  )
32
34
  }
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.57.18'
1
+ export const version = '2.57.19'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.57.18",
4
+ "version": "2.57.19",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -3,13 +3,17 @@ import type * as Hex from 'ox/Hex'
3
3
  import type * as RpcSchema from 'ox/RpcSchema'
4
4
  import { AccountConfig, AccountOperation, type RpcSchemaTempo } from 'ox/tempo'
5
5
  import type { Account } from '../../accounts/types.js'
6
- import type { ReadContractReturnType } from '../../actions/public/readContract.js'
6
+ import type {
7
+ ReadContractErrorType,
8
+ ReadContractReturnType,
9
+ } from '../../actions/public/readContract.js'
7
10
  import { readContract } from '../../actions/public/readContract.js'
8
11
  import type { WriteContractReturnType } from '../../actions/wallet/writeContract.js'
9
12
  import { writeContract } from '../../actions/wallet/writeContract.js'
10
13
  import { writeContractSync } from '../../actions/wallet/writeContractSync.js'
11
14
  import type { Client } from '../../clients/createClient.js'
12
15
  import type { Transport } from '../../clients/transports/createTransport.js'
16
+ import { zeroHash } from '../../constants/bytes.js'
13
17
  import type { BaseErrorType } from '../../errors/base.js'
14
18
  import type { Chain } from '../../types/chain.js'
15
19
  import type { Log } from '../../types/log.js'
@@ -156,6 +160,9 @@ export declare namespace getConfig {
156
160
  /**
157
161
  * Gets the current configuration commitment for a configurable account.
158
162
  *
163
+ * A chain without the configurable account precompile holds no commitments,
164
+ * so the commitment of every account on it is zero.
165
+ *
159
166
  * @example
160
167
  * ```ts
161
168
  * import { createClient, http } from 'viem'
@@ -175,7 +182,7 @@ export declare namespace getConfig {
175
182
  * @param client - Client.
176
183
  * @param parameters - Parameters.
177
184
  * @returns The current configuration commitment, or zero when no config has
178
- * been committed.
185
+ * been committed or the chain has no configurable account precompile.
179
186
  */
180
187
  export async function getConfigCommitment<
181
188
  chain extends Chain | undefined,
@@ -185,10 +192,21 @@ export async function getConfigCommitment<
185
192
  parameters: getConfigCommitment.Parameters,
186
193
  ): Promise<getConfigCommitment.ReturnValue> {
187
194
  const { account, ...rest } = parameters
188
- return withExecutionError(readContract)(client, {
189
- ...rest,
190
- ...getConfigCommitment.call({ account }),
191
- })
195
+ try {
196
+ return await withExecutionError(readContract)(client, {
197
+ ...rest,
198
+ ...getConfigCommitment.call({ account }),
199
+ })
200
+ } catch (e) {
201
+ const error = e as ReadContractErrorType
202
+ // A chain without the precompile answers no data, and holds no commitments.
203
+ if (
204
+ error.name === 'ContractFunctionExecutionError' &&
205
+ error.cause.name === 'ContractFunctionZeroDataError'
206
+ )
207
+ return zeroHash
208
+ throw error
209
+ }
192
210
  }
193
211
 
194
212
  export namespace getConfigCommitment {
@@ -25,6 +25,7 @@ import { defineTransactionReceipt } from '../utils/formatters/transactionReceipt
25
25
  import { defineTransactionRequest } from '../utils/formatters/transactionRequest.js'
26
26
  import { getAction } from '../utils/getAction.js'
27
27
  import { keccak256 } from '../utils/hash/keccak256.js'
28
+ import { recoverAddress } from '../utils/signature/recoverAddress.js'
28
29
  import type { SerializeTransactionFn } from '../utils/transaction/serializeTransaction.js'
29
30
  import type { Account, ConfigurableAccount } from './Account.js'
30
31
  import {
@@ -578,11 +579,38 @@ export const chainConfig = {
578
579
  }
579
580
  }
580
581
 
581
- return await getAction(
582
- client,
583
- verifyHash,
584
- 'verifyHash',
585
- )({ ...parameters, chain: null })
582
+ const verify = () =>
583
+ getAction(
584
+ client,
585
+ verifyHash,
586
+ 'verifyHash',
587
+ )({ ...parameters, chain: null })
588
+
589
+ const root = await (async () => {
590
+ try {
591
+ return isAddressEqual(
592
+ address,
593
+ await recoverAddress({ hash, signature }),
594
+ )
595
+ } catch {
596
+ return false
597
+ }
598
+ })()
599
+ if (!root) return await verify()
600
+
601
+ // A config commitment retires the root key (TIP-1113), whose signature still recovers
602
+ // to the account. Only the chain knows the commitment, so this reads it in every mode.
603
+ const [commitment, valid] = await Promise.all([
604
+ getConfigCommitment(client, {
605
+ account: address,
606
+ blockHash: parameters.blockHash,
607
+ blockNumber: parameters.blockNumber,
608
+ blockTag: parameters.blockTag,
609
+ requireCanonical: parameters.requireCanonical,
610
+ } as never),
611
+ verify(),
612
+ ])
613
+ return valid && BigInt(commitment) === 0n
586
614
  },
587
615
  } as const satisfies viem_ChainConfig & { blockTime: number }
588
616
 
@@ -174,10 +174,15 @@ export async function fetch(
174
174
  : Response.json(response)
175
175
  }
176
176
 
177
- /** Reads a request body, returning `undefined` once its declared or streamed size exceeds {@link maxBodySize}. */
177
+ /**
178
+ * Reads a request body, returning `undefined` once its declared or streamed size exceeds {@link maxBodySize}.
179
+ *
180
+ * The cancel of an oversized body is not awaited: a cloned request's body settles its cancel only once
181
+ * the clone's body ends too.
182
+ */
178
183
  async function readBody(request: Request) {
179
184
  if (Number(request.headers.get('content-length')) > maxBodySize) {
180
- await request.body?.cancel()
185
+ void request.body?.cancel().catch(() => {})
181
186
  return undefined
182
187
  }
183
188
  const chunks: Uint8Array<ArrayBuffer>[] = []
@@ -189,7 +194,7 @@ async function readBody(request: Request) {
189
194
  if (done) return chunks
190
195
  size += value.byteLength
191
196
  if (size > maxBodySize) {
192
- await reader.cancel()
197
+ void reader.cancel().catch(() => {})
193
198
  return undefined
194
199
  }
195
200
  chunks.push(value)
@@ -126,16 +126,8 @@ function resolveTokenForChain(
126
126
  token: Token,
127
127
  chainId: number,
128
128
  ): ResolvedToken | undefined {
129
- const address = (token.addresses as Record<number, Address>)[chainId]
130
- if (!address) return undefined
131
- return {
132
- address,
133
- currency: token.currency,
134
- decimals: token.decimals,
135
- name: token.name,
136
- popular: token.popular,
137
- symbol: token.symbol,
138
- }
129
+ if (!(token.addresses as Record<number, Address>)[chainId]) return undefined
130
+ return token(chainId as never)
139
131
  }
140
132
 
141
133
  /**
@@ -17,6 +17,8 @@ export type Tokens = readonly Token[]
17
17
  export type ResolvedToken = {
18
18
  /** Token contract address. */
19
19
  address: Address
20
+ /** Chain id the token was resolved for. */
21
+ chainId: number
20
22
  /** Token currency denomination. */
21
23
  currency?: string | undefined
22
24
  /** Token decimals, used to parse human-readable `amount` strings. */
@@ -57,6 +59,7 @@ export type ResolvedToken = {
57
59
  * usdc(1)
58
60
  * // {
59
61
  * // address: '0xA0b8…48',
62
+ * // chainId: 1,
60
63
  * // currency: 'USD',
61
64
  * // decimals: 6,
62
65
  * // name: 'USD Coin',
@@ -76,7 +79,7 @@ export function defineToken<const token extends defineToken.Parameters>(
76
79
  const address = (addresses as Record<number, Address>)[chainId]
77
80
  if (!address)
78
81
  throw new Error(`Token has no address for chain id "${chainId}".`)
79
- return { address, currency, decimals, name, popular, symbol }
82
+ return { address, chainId, currency, decimals, name, popular, symbol }
80
83
  }
81
84
  return Object.defineProperties(fn, {
82
85
  addresses: { enumerable: true, value: addresses },
@@ -113,13 +116,14 @@ export namespace defineToken {
113
116
 
114
117
  export type ReturnType<token extends Parameters = Parameters> = {
115
118
  /**
116
- * Resolves the token config (`address`, `currency`, `decimals`, `name`,
119
+ * Resolves the token config (`address`, `chainId`, `currency`, `decimals`, `name`,
117
120
  * `popular`, `symbol`) for a chain id.
118
121
  */
119
122
  <chainId extends keyof token['addresses']>(
120
123
  chainId: chainId,
121
124
  ): {
122
125
  address: token['addresses'][chainId]
126
+ chainId: chainId
123
127
  currency: ParameterValue<token, 'currency'>
124
128
  decimals: token['decimals']
125
129
  name: ParameterValue<token, 'name'>
@@ -2,7 +2,7 @@ import { defineToken } from '../defineToken.js'
2
2
 
3
3
  /**
4
4
  * [Open USD](https://joinopenstandard.com/) token, with canonical contract
5
- * addresses on Ethereum, Tempo, and Base.
5
+ * addresses on Ethereum, Tempo, Tempo Moderato, and Base.
6
6
  *
7
7
  * @example
8
8
  * ```ts
@@ -17,6 +17,7 @@ export const ousd = /*#__PURE__*/ defineToken({
17
17
  1: '0x9f6F3991D525015a6F8CaF062C83b62fD3AC4436', // mainnet
18
18
  4217: '0x20c0000000000000000000006a37DA5C996874BE', // tempo
19
19
  8453: '0xB2000000000000000000002fEb517dFeC7415344', // base
20
+ 42431: '0x20c0000000000000000000006a37DA5C996874BE', // tempoModerato
20
21
  },
21
22
  currency: 'USD',
22
23
  decimals: 6,
@@ -18,7 +18,7 @@ export class BaseFeeHigherThanValueError extends BaseError {
18
18
  }
19
19
  }
20
20
 
21
- export type TxHashNotFoundInLogsErrorType = BaseFeeHigherThanValueError & {
21
+ export type TxHashNotFoundInLogsErrorType = TxHashNotFoundInLogsError & {
22
22
  name: 'TxHashNotFoundInLogsError'
23
23
  }
24
24
  export class TxHashNotFoundInLogsError extends BaseError {