viem 2.44.4 → 2.45.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 (136) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js +4 -2
  3. package/_cjs/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  4. package/_cjs/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  5. package/_cjs/account-abstraction/clients/createBundlerClient.js +8 -2
  6. package/_cjs/account-abstraction/clients/createBundlerClient.js.map +1 -1
  7. package/_cjs/actions/public/estimateContractGas.js +3 -1
  8. package/_cjs/actions/public/estimateContractGas.js.map +1 -1
  9. package/_cjs/actions/public/simulateContract.js +3 -1
  10. package/_cjs/actions/public/simulateContract.js.map +1 -1
  11. package/_cjs/actions/wallet/sendCalls.js +17 -1
  12. package/_cjs/actions/wallet/sendCalls.js.map +1 -1
  13. package/_cjs/actions/wallet/sendTransaction.js +6 -3
  14. package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
  15. package/_cjs/actions/wallet/sendTransactionSync.js +6 -3
  16. package/_cjs/actions/wallet/sendTransactionSync.js.map +1 -1
  17. package/_cjs/actions/wallet/writeContract.js +2 -2
  18. package/_cjs/actions/wallet/writeContract.js.map +1 -1
  19. package/_cjs/chains/definitions/megaeth.js +33 -0
  20. package/_cjs/chains/definitions/megaeth.js.map +1 -0
  21. package/_cjs/chains/definitions/megaethTestnet.js +6 -1
  22. package/_cjs/chains/definitions/megaethTestnet.js.map +1 -1
  23. package/_cjs/chains/definitions/rise.js +28 -0
  24. package/_cjs/chains/definitions/rise.js.map +1 -0
  25. package/_cjs/chains/definitions/stable.js +35 -0
  26. package/_cjs/chains/definitions/stable.js.map +1 -0
  27. package/_cjs/chains/definitions/stableTestnet.js +10 -3
  28. package/_cjs/chains/definitions/stableTestnet.js.map +1 -1
  29. package/_cjs/chains/index.js +13 -7
  30. package/_cjs/chains/index.js.map +1 -1
  31. package/_cjs/clients/createClient.js +2 -1
  32. package/_cjs/clients/createClient.js.map +1 -1
  33. package/_cjs/clients/createWalletClient.js.map +1 -1
  34. package/_cjs/errors/version.js +1 -1
  35. package/_cjs/index.js.map +1 -1
  36. package/_cjs/op-stack/index.js +9 -1
  37. package/_cjs/op-stack/index.js.map +1 -1
  38. package/_cjs/types/dataSuffix.js +3 -0
  39. package/_cjs/types/dataSuffix.js.map +1 -0
  40. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js +4 -2
  41. package/_esm/account-abstraction/actions/bundler/prepareUserOperation.js.map +1 -1
  42. package/_esm/account-abstraction/actions/bundler/sendUserOperation.js.map +1 -1
  43. package/_esm/account-abstraction/clients/createBundlerClient.js +8 -2
  44. package/_esm/account-abstraction/clients/createBundlerClient.js.map +1 -1
  45. package/_esm/actions/public/estimateContractGas.js +3 -1
  46. package/_esm/actions/public/estimateContractGas.js.map +1 -1
  47. package/_esm/actions/public/simulateContract.js +3 -1
  48. package/_esm/actions/public/simulateContract.js.map +1 -1
  49. package/_esm/actions/wallet/sendCalls.js +17 -1
  50. package/_esm/actions/wallet/sendCalls.js.map +1 -1
  51. package/_esm/actions/wallet/sendTransaction.js +6 -3
  52. package/_esm/actions/wallet/sendTransaction.js.map +1 -1
  53. package/_esm/actions/wallet/sendTransactionSync.js +6 -3
  54. package/_esm/actions/wallet/sendTransactionSync.js.map +1 -1
  55. package/_esm/actions/wallet/writeContract.js +2 -2
  56. package/_esm/actions/wallet/writeContract.js.map +1 -1
  57. package/_esm/chains/definitions/megaeth.js +30 -0
  58. package/_esm/chains/definitions/megaeth.js.map +1 -0
  59. package/_esm/chains/definitions/megaethTestnet.js +6 -1
  60. package/_esm/chains/definitions/megaethTestnet.js.map +1 -1
  61. package/_esm/chains/definitions/rise.js +25 -0
  62. package/_esm/chains/definitions/rise.js.map +1 -0
  63. package/_esm/chains/definitions/stable.js +32 -0
  64. package/_esm/chains/definitions/stable.js.map +1 -0
  65. package/_esm/chains/definitions/stableTestnet.js +10 -3
  66. package/_esm/chains/definitions/stableTestnet.js.map +1 -1
  67. package/_esm/chains/index.js +3 -0
  68. package/_esm/chains/index.js.map +1 -1
  69. package/_esm/clients/createClient.js +2 -1
  70. package/_esm/clients/createClient.js.map +1 -1
  71. package/_esm/clients/createWalletClient.js.map +1 -1
  72. package/_esm/errors/version.js +1 -1
  73. package/_esm/index.js.map +1 -1
  74. package/_esm/op-stack/index.js +4 -0
  75. package/_esm/op-stack/index.js.map +1 -1
  76. package/_esm/types/dataSuffix.js +2 -0
  77. package/_esm/types/dataSuffix.js.map +1 -0
  78. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts +2 -0
  79. package/_types/account-abstraction/actions/bundler/prepareUserOperation.d.ts.map +1 -1
  80. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts +2 -0
  81. package/_types/account-abstraction/actions/bundler/sendUserOperation.d.ts.map +1 -1
  82. package/_types/account-abstraction/clients/createBundlerClient.d.ts +4 -0
  83. package/_types/account-abstraction/clients/createBundlerClient.d.ts.map +1 -1
  84. package/_types/actions/public/estimateContractGas.d.ts.map +1 -1
  85. package/_types/actions/public/simulateContract.d.ts.map +1 -1
  86. package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
  87. package/_types/actions/wallet/sendTransaction.d.ts +3 -1
  88. package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
  89. package/_types/actions/wallet/sendTransactionSync.d.ts +3 -0
  90. package/_types/actions/wallet/sendTransactionSync.d.ts.map +1 -1
  91. package/_types/actions/wallet/writeContract.d.ts.map +1 -1
  92. package/_types/chains/definitions/megaeth.d.ts +46 -0
  93. package/_types/chains/definitions/megaeth.d.ts.map +1 -0
  94. package/_types/chains/definitions/megaethTestnet.d.ts +6 -1
  95. package/_types/chains/definitions/megaethTestnet.d.ts.map +1 -1
  96. package/_types/chains/definitions/rise.d.ts +46 -0
  97. package/_types/chains/definitions/rise.d.ts.map +1 -0
  98. package/_types/chains/definitions/stable.d.ts +47 -0
  99. package/_types/chains/definitions/stable.d.ts.map +1 -0
  100. package/_types/chains/definitions/stableTestnet.d.ts +10 -13
  101. package/_types/chains/definitions/stableTestnet.d.ts.map +1 -1
  102. package/_types/chains/index.d.ts +3 -0
  103. package/_types/chains/index.d.ts.map +1 -1
  104. package/_types/clients/createClient.d.ts +5 -0
  105. package/_types/clients/createClient.d.ts.map +1 -1
  106. package/_types/clients/createWalletClient.d.ts +1 -1
  107. package/_types/clients/createWalletClient.d.ts.map +1 -1
  108. package/_types/errors/version.d.ts +1 -1
  109. package/_types/index.d.ts +2 -1
  110. package/_types/index.d.ts.map +1 -1
  111. package/_types/op-stack/index.d.ts +4 -0
  112. package/_types/op-stack/index.d.ts.map +1 -1
  113. package/_types/types/dataSuffix.d.ts +16 -0
  114. package/_types/types/dataSuffix.d.ts.map +1 -0
  115. package/account-abstraction/actions/bundler/prepareUserOperation.ts +7 -1
  116. package/account-abstraction/actions/bundler/sendUserOperation.ts +2 -0
  117. package/account-abstraction/clients/createBundlerClient.ts +12 -1
  118. package/actions/public/estimateContractGas.ts +11 -2
  119. package/actions/public/simulateContract.ts +11 -2
  120. package/actions/wallet/sendCalls.ts +18 -1
  121. package/actions/wallet/sendTransaction.ts +9 -3
  122. package/actions/wallet/sendTransactionSync.ts +9 -3
  123. package/actions/wallet/writeContract.ts +1 -2
  124. package/chains/definitions/megaeth.ts +30 -0
  125. package/chains/definitions/megaethTestnet.ts +6 -1
  126. package/chains/definitions/rise.ts +25 -0
  127. package/chains/definitions/stable.ts +32 -0
  128. package/chains/definitions/stableTestnet.ts +10 -3
  129. package/chains/index.ts +3 -0
  130. package/clients/createClient.ts +7 -0
  131. package/clients/createWalletClient.ts +1 -0
  132. package/errors/version.ts +1 -1
  133. package/index.ts +2 -0
  134. package/op-stack/index.ts +24 -0
  135. package/package.json +1 -1
  136. package/types/dataSuffix.ts +18 -0
@@ -97,7 +97,6 @@ export async function sendCalls<
97
97
  ): Promise<SendCallsReturnType> {
98
98
  const {
99
99
  account: account_ = client.account,
100
- capabilities,
101
100
  chain = client.chain,
102
101
  experimental_fallback,
103
102
  experimental_fallbackDelay = 32,
@@ -108,6 +107,24 @@ export async function sendCalls<
108
107
 
109
108
  const account = account_ ? parseAccount(account_) : null
110
109
 
110
+ let capabilities = parameters.capabilities
111
+
112
+ if (client.dataSuffix && !parameters.capabilities?.dataSuffix) {
113
+ if (typeof client.dataSuffix === 'string')
114
+ capabilities = {
115
+ ...parameters.capabilities,
116
+ dataSuffix: { value: client.dataSuffix, optional: true },
117
+ }
118
+ else
119
+ capabilities = {
120
+ ...parameters.capabilities,
121
+ dataSuffix: {
122
+ value: client.dataSuffix.value,
123
+ ...(client.dataSuffix.required ? {} : { optional: true }),
124
+ },
125
+ }
126
+ }
127
+
111
128
  const calls = parameters.calls.map((call_: unknown) => {
112
129
  const call = call_ as Call
113
130
 
@@ -23,7 +23,7 @@ import type {
23
23
  GetChainParameter,
24
24
  } from '../../types/chain.js'
25
25
  import type { GetTransactionRequestKzgParameter } from '../../types/kzg.js'
26
- import type { Hash } from '../../types/misc.js'
26
+ import type { Hash, Hex } from '../../types/misc.js'
27
27
  import type { TransactionRequest } from '../../types/transaction.js'
28
28
  import type { UnionOmit } from '../../types/utils.js'
29
29
  import {
@@ -35,6 +35,7 @@ import {
35
35
  type AssertCurrentChainErrorType,
36
36
  assertCurrentChain,
37
37
  } from '../../utils/chain/assertCurrentChain.js'
38
+ import { concat } from '../../utils/data/concat.js'
38
39
  import {
39
40
  type GetTransactionErrorReturnType,
40
41
  getTransactionError,
@@ -86,6 +87,8 @@ export type SendTransactionParameters<
86
87
  GetTransactionRequestKzgParameter<request> & {
87
88
  /** Whether to assert that the client chain is on the correct chain. @default true */
88
89
  assertChainId?: boolean | undefined
90
+ /** Data to append to the end of the calldata. Takes precedence over `client.dataSuffix`. */
91
+ dataSuffix?: Hex | undefined
89
92
  }
90
93
 
91
94
  export type SendTransactionReturnType = Hash
@@ -168,6 +171,9 @@ export async function sendTransaction<
168
171
  authorizationList,
169
172
  blobs,
170
173
  data,
174
+ dataSuffix = typeof client.dataSuffix === 'string'
175
+ ? client.dataSuffix
176
+ : client.dataSuffix?.value,
171
177
  gas,
172
178
  gasPrice,
173
179
  maxFeePerBlobGas,
@@ -233,7 +239,7 @@ export async function sendTransaction<
233
239
  authorizationList,
234
240
  blobs,
235
241
  chainId,
236
- data,
242
+ data: data ? concat([data, dataSuffix ?? '0x']) : data,
237
243
  gas,
238
244
  gasPrice,
239
245
  maxFeePerBlobGas,
@@ -314,7 +320,7 @@ export async function sendTransaction<
314
320
  authorizationList,
315
321
  blobs,
316
322
  chain,
317
- data,
323
+ data: data ? concat([data, dataSuffix ?? '0x']) : data,
318
324
  gas,
319
325
  gasPrice,
320
326
  maxFeePerBlobGas,
@@ -27,7 +27,7 @@ import type {
27
27
  GetChainParameter,
28
28
  } from '../../types/chain.js'
29
29
  import type { GetTransactionRequestKzgParameter } from '../../types/kzg.js'
30
- import type { Hash } from '../../types/misc.js'
30
+ import type { Hash, Hex } from '../../types/misc.js'
31
31
  import type { TransactionRequest } from '../../types/transaction.js'
32
32
  import type { UnionOmit } from '../../types/utils.js'
33
33
  import {
@@ -39,6 +39,7 @@ import {
39
39
  type AssertCurrentChainErrorType,
40
40
  assertCurrentChain,
41
41
  } from '../../utils/chain/assertCurrentChain.js'
42
+ import { concat } from '../../utils/data/concat.js'
42
43
  import {
43
44
  type GetTransactionErrorReturnType,
44
45
  getTransactionError,
@@ -95,6 +96,8 @@ export type SendTransactionSyncParameters<
95
96
  GetTransactionRequestKzgParameter<request> & {
96
97
  /** Whether to assert that the client chain is on the correct chain. @default true */
97
98
  assertChainId?: boolean | undefined
99
+ /** Data to append to the end of the calldata. Takes precedence over `client.dataSuffix`. */
100
+ dataSuffix?: Hex | undefined
98
101
  /** Polling interval (ms) to poll for the transaction receipt. @default client.pollingInterval */
99
102
  pollingInterval?: number | undefined
100
103
  /** Whether to throw an error if the transaction was detected as reverted. @default true */
@@ -187,6 +190,9 @@ export async function sendTransactionSync<
187
190
  authorizationList,
188
191
  blobs,
189
192
  data,
193
+ dataSuffix = typeof client.dataSuffix === 'string'
194
+ ? client.dataSuffix
195
+ : client.dataSuffix?.value,
190
196
  gas,
191
197
  gasPrice,
192
198
  maxFeePerBlobGas,
@@ -256,7 +262,7 @@ export async function sendTransactionSync<
256
262
  authorizationList,
257
263
  blobs,
258
264
  chainId,
259
- data,
265
+ data: data ? concat([data, dataSuffix ?? '0x']) : data,
260
266
  gas,
261
267
  gasPrice,
262
268
  maxFeePerBlobGas,
@@ -353,7 +359,7 @@ export async function sendTransactionSync<
353
359
  authorizationList,
354
360
  blobs,
355
361
  chain,
356
- data,
362
+ data: data ? concat([data, dataSuffix ?? '0x']) : data,
357
363
  gas,
358
364
  gasPrice,
359
365
  maxFeePerBlobGas,
@@ -210,7 +210,6 @@ export namespace writeContract {
210
210
  account: account_ = client.account,
211
211
  address,
212
212
  args,
213
- dataSuffix,
214
213
  functionName,
215
214
  ...request
216
215
  } = parameters as WriteContractParameters
@@ -233,7 +232,7 @@ export namespace writeContract {
233
232
  actionFn as never,
234
233
  name,
235
234
  )({
236
- data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,
235
+ data,
237
236
  to: address,
238
237
  account,
239
238
  ...request,
@@ -0,0 +1,30 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const megaeth = /*#__PURE__*/ defineChain({
4
+ id: 4326,
5
+ blockTime: 1_000,
6
+ name: 'MegaETH',
7
+ nativeCurrency: {
8
+ name: 'Ether',
9
+ symbol: 'ETH',
10
+ decimals: 18,
11
+ },
12
+ rpcUrls: {
13
+ default: {
14
+ http: ['https://mainnet.megaeth.com/rpc'],
15
+ webSocket: ['wss://mainnet.megaeth.com/ws'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'Blockscout',
21
+ url: 'https://megaeth.blockscout.com',
22
+ apiUrl: 'https://megaeth.blockscout.com/api',
23
+ },
24
+ },
25
+ contracts: {
26
+ multicall3: {
27
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
28
+ },
29
+ },
30
+ })
@@ -1,7 +1,7 @@
1
1
  import { defineChain } from '../../utils/chain/defineChain.js'
2
2
 
3
3
  export const megaethTestnet = /*#__PURE__*/ defineChain({
4
- id: 6342,
4
+ id: 6343,
5
5
  blockTime: 1_000,
6
6
  name: 'MegaETH Testnet',
7
7
  nativeCurrency: {
@@ -20,6 +20,11 @@ export const megaethTestnet = /*#__PURE__*/ defineChain({
20
20
  name: 'MegaETH Testnet Explorer',
21
21
  url: 'https://www.megaexplorer.xyz/',
22
22
  },
23
+ blockscout: {
24
+ name: 'Blockscout',
25
+ url: 'https://megaeth-testnet-v2.blockscout.com',
26
+ apiUrl: 'https://megaeth-testnet-v2.blockscout.com/api',
27
+ },
23
28
  },
24
29
  contracts: {
25
30
  multicall3: {
@@ -0,0 +1,25 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const rise = /*#__PURE__*/ defineChain({
4
+ id: 4153,
5
+ name: 'RISE',
6
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
7
+ rpcUrls: {
8
+ default: {
9
+ http: ['https://rpc.risechain.com'],
10
+ webSocket: ['wss://rpc.risechain.com/ws'],
11
+ },
12
+ },
13
+ blockExplorers: {
14
+ default: {
15
+ name: 'Blockscout',
16
+ url: 'https://explorer.risechain.com',
17
+ apiUrl: 'https://explorer.risechain.com/api',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xca11bde05977b3631167028862be2a173976ca11',
23
+ },
24
+ },
25
+ })
@@ -0,0 +1,32 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const stable = /*#__PURE__*/ defineChain({
4
+ id: 988,
5
+ name: 'Stable Mainnet',
6
+ blockTime: 700,
7
+ nativeCurrency: {
8
+ name: 'gUSDT',
9
+ symbol: 'gUSDT',
10
+ decimals: 18,
11
+ },
12
+ rpcUrls: {
13
+ default: {
14
+ http: ['https://rpc.stable.xyz'],
15
+ webSocket: ['wss://rpc.stable.xyz'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'Stablescan',
21
+ url: 'https://stablescan.xyz',
22
+ apiUrl: 'https://api.etherscan.io/v2/api?chainid=988',
23
+ },
24
+ },
25
+ contracts: {
26
+ multicall3: {
27
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
28
+ blockCreated: 2423647,
29
+ },
30
+ },
31
+ testnet: false,
32
+ })
@@ -3,10 +3,11 @@ import { defineChain } from '../../utils/chain/defineChain.js'
3
3
  export const stableTestnet = /*#__PURE__*/ defineChain({
4
4
  id: 2201,
5
5
  name: 'Stable Testnet',
6
+ blockTime: 700,
6
7
  nativeCurrency: {
8
+ name: 'USDT0',
9
+ symbol: 'USDT0',
7
10
  decimals: 18,
8
- name: 'gUSDT',
9
- symbol: 'gUSDT',
10
11
  },
11
12
  rpcUrls: {
12
13
  default: {
@@ -18,7 +19,13 @@ export const stableTestnet = /*#__PURE__*/ defineChain({
18
19
  default: {
19
20
  name: 'Stablescan',
20
21
  url: 'https://testnet.stablescan.xyz',
21
- apiUrl: 'https://testnet.stablescan.xyz/api',
22
+ apiUrl: 'https://api.etherscan.io/v2/api?chainid=2201',
23
+ },
24
+ },
25
+ contracts: {
26
+ multicall3: {
27
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
28
+ blockCreated: 22364430,
22
29
  },
23
30
  },
24
31
  testnet: true,
package/chains/index.ts CHANGED
@@ -379,6 +379,7 @@ export { mapProtocol } from './definitions/mapProtocol.js'
379
379
  export { matchain } from './definitions/matchain.js'
380
380
  export { matchainTestnet } from './definitions/matchainTestnet.js'
381
381
  export { mchVerse } from './definitions/mchVerse.js'
382
+ export { megaeth } from './definitions/megaeth.js'
382
383
  export { megaethTestnet } from './definitions/megaethTestnet.js'
383
384
  export { mekong } from './definitions/mekong.js'
384
385
  export { meld } from './definitions/meld.js'
@@ -498,6 +499,7 @@ export { reddioSepolia } from './definitions/reddioSepolia.js'
498
499
  export { redstone } from './definitions/redstone.js'
499
500
  export { rei } from './definitions/rei.js'
500
501
  export { reyaNetwork } from './definitions/reyaNetwork.js'
502
+ export { rise } from './definitions/rise.js'
501
503
  export { riseTestnet } from './definitions/riseTestnet.js'
502
504
  export { rivalz } from './definitions/rivalz.js'
503
505
  export { rollux } from './definitions/rollux.js'
@@ -575,6 +577,7 @@ export { sophonTestnet } from './definitions/sophonTestnet.js'
575
577
  export { sova } from './definitions/sova.js'
576
578
  export { sovaSepolia } from './definitions/sovaSepolia.js'
577
579
  export { spicy } from './definitions/spicy.js'
580
+ export { stable } from './definitions/stable.js'
578
581
  export { stableTestnet } from './definitions/stableTestnet.js'
579
582
  export {
580
583
  statusSepolia,
@@ -9,6 +9,7 @@ import type { ErrorType } from '../errors/utils.js'
9
9
  import type { Account } from '../types/account.js'
10
10
  import type { BlockTag } from '../types/block.js'
11
11
  import type { Chain } from '../types/chain.js'
12
+ import type { DataSuffix } from '../types/dataSuffix.js'
12
13
  import type {
13
14
  EIP1193RequestFn,
14
15
  EIP1474Methods,
@@ -74,6 +75,8 @@ export type ClientConfig<
74
75
  | undefined
75
76
  /** Chain for the client. */
76
77
  chain?: Chain | undefined | chain
78
+ /** Data suffix to append to transaction data. */
79
+ dataSuffix?: DataSuffix | undefined
77
80
  /** A key for the client. */
78
81
  key?: string | undefined
79
82
  /** A name for the client. */
@@ -171,6 +174,8 @@ type Client_Base<
171
174
  ccipRead?: ClientConfig['ccipRead'] | undefined
172
175
  /** Chain for the client. */
173
176
  chain: chain
177
+ /** Data suffix to append to transaction data. */
178
+ dataSuffix?: DataSuffix | undefined
174
179
  /** Default block tag to use for RPC requests. */
175
180
  experimental_blockTag?: BlockTag | undefined
176
181
  /** A key for the client. */
@@ -232,6 +237,7 @@ export function createClient(parameters: ClientConfig): Client {
232
237
  batch,
233
238
  chain,
234
239
  ccipRead,
240
+ dataSuffix,
235
241
  key = 'base',
236
242
  name = 'Base Client',
237
243
  type = 'base',
@@ -267,6 +273,7 @@ export function createClient(parameters: ClientConfig): Client {
267
273
  cacheTime,
268
274
  ccipRead,
269
275
  chain,
276
+ dataSuffix,
270
277
  key,
271
278
  name,
272
279
  pollingInterval,
@@ -30,6 +30,7 @@ export type WalletClientConfig<
30
30
  | 'cacheTime'
31
31
  | 'ccipRead'
32
32
  | 'chain'
33
+ | 'dataSuffix'
33
34
  | 'key'
34
35
  | 'name'
35
36
  | 'pollingInterval'
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.44.4'
1
+ export const version = '2.45.0'
package/index.ts CHANGED
@@ -539,6 +539,7 @@ export type {
539
539
  export type {
540
540
  SignTransactionErrorType,
541
541
  SignTransactionParameters,
542
+ SignTransactionRequest,
542
543
  SignTransactionReturnType,
543
544
  } from './actions/wallet/signTransaction.js'
544
545
  export type {
@@ -1119,6 +1120,7 @@ export type {
1119
1120
  UnionWiden,
1120
1121
  Widen,
1121
1122
  } from './types/contract.js'
1123
+ export type { DataSuffix } from './types/dataSuffix.js'
1122
1124
  export type {
1123
1125
  AddEthereumChainParameter,
1124
1126
  BundlerRpcSchema,
package/op-stack/index.ts CHANGED
@@ -47,6 +47,24 @@ export {
47
47
  type EstimateContractTotalGasReturnType,
48
48
  estimateContractTotalGas,
49
49
  } from './actions/estimateContractTotalGas.js'
50
+ export {
51
+ type EstimateDepositTransactionGasErrorType,
52
+ type EstimateDepositTransactionGasParameters,
53
+ type EstimateDepositTransactionGasReturnType,
54
+ estimateDepositTransactionGas,
55
+ } from './actions/estimateDepositTransactionGas.js'
56
+ export {
57
+ type EstimateFinalizeWithdrawalGasErrorType,
58
+ type EstimateFinalizeWithdrawalGasParameters,
59
+ type EstimateFinalizeWithdrawalGasReturnType,
60
+ estimateFinalizeWithdrawalGas,
61
+ } from './actions/estimateFinalizeWithdrawalGas.js'
62
+ export {
63
+ type EstimateInitiateWithdrawalGasErrorType,
64
+ type EstimateInitiateWithdrawalGasParameters,
65
+ type EstimateInitiateWithdrawalGasReturnType,
66
+ estimateInitiateWithdrawalGas,
67
+ } from './actions/estimateInitiateWithdrawalGas.js'
50
68
  export {
51
69
  type EstimateL1FeeErrorType,
52
70
  type EstimateL1FeeParameters,
@@ -65,6 +83,12 @@ export {
65
83
  type EstimateOperatorFeeReturnType,
66
84
  estimateOperatorFee,
67
85
  } from './actions/estimateOperatorFee.js'
86
+ export {
87
+ type EstimateProveWithdrawalGasErrorType,
88
+ type EstimateProveWithdrawalGasParameters,
89
+ type EstimateProveWithdrawalGasReturnType,
90
+ estimateProveWithdrawalGas,
91
+ } from './actions/estimateProveWithdrawalGas.js'
68
92
  export {
69
93
  type EstimateTotalFeeErrorType,
70
94
  type EstimateTotalFeeParameters,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.44.4",
4
+ "version": "2.45.0",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -0,0 +1,18 @@
1
+ import type { Hex } from './misc.js'
2
+
3
+ /**
4
+ * Data suffix configuration for transaction attribution.
5
+ *
6
+ * Can be specified in two forms:
7
+ * - Simple hex string: `"0x1234"` - Appended to transaction data, not required
8
+ * - Object form: `{ value: "0x1234", required: true }` - Explicit required flag
9
+ *
10
+ * When `required` is `true`, transactions will fail if the suffix cannot be appended.
11
+ * When `required` is `false` (default), the suffix is best-effort.
12
+ */
13
+ export type DataSuffix =
14
+ | Hex
15
+ | {
16
+ value: Hex
17
+ required?: boolean | undefined
18
+ }