viem 2.47.5 → 2.47.10

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 (203) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/_cjs/actions/public/verifyHash.js +16 -6
  3. package/_cjs/actions/public/verifyHash.js.map +1 -1
  4. package/_cjs/actions/wallet/prepareTransactionRequest.js +14 -1
  5. package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
  6. package/_cjs/actions/wallet/sendTransaction.js +2 -2
  7. package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
  8. package/_cjs/actions/wallet/waitForCallsStatus.js.map +1 -1
  9. package/_cjs/chains/definitions/battlechainTestnet.js +26 -0
  10. package/_cjs/chains/definitions/battlechainTestnet.js.map +1 -0
  11. package/_cjs/chains/definitions/eden.js +32 -0
  12. package/_cjs/chains/definitions/eden.js.map +1 -0
  13. package/_cjs/chains/definitions/gensyn.js +29 -0
  14. package/_cjs/chains/definitions/gensyn.js.map +1 -0
  15. package/_cjs/chains/definitions/igra.js +26 -0
  16. package/_cjs/chains/definitions/igra.js.map +1 -0
  17. package/_cjs/chains/definitions/katana.js +6 -0
  18. package/_cjs/chains/definitions/katana.js.map +1 -1
  19. package/_cjs/chains/definitions/megaeth.js +25 -3
  20. package/_cjs/chains/definitions/megaeth.js.map +1 -1
  21. package/_cjs/chains/definitions/mezo.js +23 -0
  22. package/_cjs/chains/definitions/mezo.js.map +1 -0
  23. package/_cjs/chains/definitions/mezoTestnet.js +30 -0
  24. package/_cjs/chains/definitions/mezoTestnet.js.map +1 -0
  25. package/_cjs/chains/definitions/radius.js +22 -0
  26. package/_cjs/chains/definitions/radius.js.map +1 -0
  27. package/_cjs/chains/definitions/radiusTestnet.js +22 -0
  28. package/_cjs/chains/definitions/radiusTestnet.js.map +1 -0
  29. package/_cjs/chains/definitions/tempoDevnet.js +1 -0
  30. package/_cjs/chains/definitions/tempoDevnet.js.map +1 -1
  31. package/_cjs/chains/definitions/tempoLocalnet.js +1 -0
  32. package/_cjs/chains/definitions/tempoLocalnet.js.map +1 -1
  33. package/_cjs/chains/definitions/tempoModerato.js +1 -1
  34. package/_cjs/chains/definitions/tempoModerato.js.map +1 -1
  35. package/_cjs/chains/index.js +32 -17
  36. package/_cjs/chains/index.js.map +1 -1
  37. package/_cjs/errors/version.js +1 -1
  38. package/_cjs/errors/version.js.map +1 -1
  39. package/_cjs/tempo/Abis.js +45 -0
  40. package/_cjs/tempo/Abis.js.map +1 -1
  41. package/_cjs/tempo/Account.js +1 -3
  42. package/_cjs/tempo/Account.js.map +1 -1
  43. package/_cjs/tempo/Hardfork.js +18 -0
  44. package/_cjs/tempo/Hardfork.js.map +1 -0
  45. package/_cjs/tempo/Transaction.js +1 -0
  46. package/_cjs/tempo/Transaction.js.map +1 -1
  47. package/_cjs/tempo/actions/accessKey.js +26 -2
  48. package/_cjs/tempo/actions/accessKey.js.map +1 -1
  49. package/_cjs/tempo/actions/token.js +2 -1
  50. package/_cjs/tempo/actions/token.js.map +1 -1
  51. package/_cjs/tempo/chainConfig.js +44 -8
  52. package/_cjs/tempo/chainConfig.js.map +1 -1
  53. package/_cjs/tempo/index.js +2 -1
  54. package/_cjs/tempo/index.js.map +1 -1
  55. package/_cjs/utils/rpc/http.js +3 -0
  56. package/_cjs/utils/rpc/http.js.map +1 -1
  57. package/_esm/actions/public/verifyHash.js +17 -7
  58. package/_esm/actions/public/verifyHash.js.map +1 -1
  59. package/_esm/actions/wallet/prepareTransactionRequest.js +14 -1
  60. package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
  61. package/_esm/actions/wallet/sendTransaction.js +2 -2
  62. package/_esm/actions/wallet/sendTransaction.js.map +1 -1
  63. package/_esm/actions/wallet/waitForCallsStatus.js.map +1 -1
  64. package/_esm/chains/definitions/battlechainTestnet.js +23 -0
  65. package/_esm/chains/definitions/battlechainTestnet.js.map +1 -0
  66. package/_esm/chains/definitions/eden.js +29 -0
  67. package/_esm/chains/definitions/eden.js.map +1 -0
  68. package/_esm/chains/definitions/gensyn.js +26 -0
  69. package/_esm/chains/definitions/gensyn.js.map +1 -0
  70. package/_esm/chains/definitions/igra.js +23 -0
  71. package/_esm/chains/definitions/igra.js.map +1 -0
  72. package/_esm/chains/definitions/katana.js +6 -0
  73. package/_esm/chains/definitions/katana.js.map +1 -1
  74. package/_esm/chains/definitions/megaeth.js +25 -3
  75. package/_esm/chains/definitions/megaeth.js.map +1 -1
  76. package/_esm/chains/definitions/mezo.js +20 -0
  77. package/_esm/chains/definitions/mezo.js.map +1 -0
  78. package/_esm/chains/definitions/mezoTestnet.js +27 -0
  79. package/_esm/chains/definitions/mezoTestnet.js.map +1 -0
  80. package/_esm/chains/definitions/radius.js +19 -0
  81. package/_esm/chains/definitions/radius.js.map +1 -0
  82. package/_esm/chains/definitions/radiusTestnet.js +19 -0
  83. package/_esm/chains/definitions/radiusTestnet.js.map +1 -0
  84. package/_esm/chains/definitions/tempoDevnet.js +1 -0
  85. package/_esm/chains/definitions/tempoDevnet.js.map +1 -1
  86. package/_esm/chains/definitions/tempoLocalnet.js +1 -0
  87. package/_esm/chains/definitions/tempoLocalnet.js.map +1 -1
  88. package/_esm/chains/definitions/tempoModerato.js +1 -1
  89. package/_esm/chains/definitions/tempoModerato.js.map +1 -1
  90. package/_esm/chains/index.js +10 -7
  91. package/_esm/chains/index.js.map +1 -1
  92. package/_esm/errors/version.js +1 -1
  93. package/_esm/errors/version.js.map +1 -1
  94. package/_esm/tempo/Abis.js +45 -0
  95. package/_esm/tempo/Abis.js.map +1 -1
  96. package/_esm/tempo/Account.js +1 -5
  97. package/_esm/tempo/Account.js.map +1 -1
  98. package/_esm/tempo/Hardfork.js +15 -0
  99. package/_esm/tempo/Hardfork.js.map +1 -0
  100. package/_esm/tempo/Transaction.js +1 -0
  101. package/_esm/tempo/Transaction.js.map +1 -1
  102. package/_esm/tempo/actions/accessKey.js +34 -3
  103. package/_esm/tempo/actions/accessKey.js.map +1 -1
  104. package/_esm/tempo/actions/token.js +2 -1
  105. package/_esm/tempo/actions/token.js.map +1 -1
  106. package/_esm/tempo/chainConfig.js +52 -11
  107. package/_esm/tempo/chainConfig.js.map +1 -1
  108. package/_esm/tempo/index.js +1 -0
  109. package/_esm/tempo/index.js.map +1 -1
  110. package/_esm/utils/rpc/http.js +5 -0
  111. package/_esm/utils/rpc/http.js.map +1 -1
  112. package/_types/actions/public/verifyHash.d.ts +2 -0
  113. package/_types/actions/public/verifyHash.d.ts.map +1 -1
  114. package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
  115. package/_types/chains/definitions/battlechainTestnet.d.ts +441 -0
  116. package/_types/chains/definitions/battlechainTestnet.d.ts.map +1 -0
  117. package/_types/chains/definitions/eden.d.ts +46 -0
  118. package/_types/chains/definitions/eden.d.ts.map +1 -0
  119. package/_types/chains/definitions/gensyn.d.ts +45 -0
  120. package/_types/chains/definitions/gensyn.d.ts.map +1 -0
  121. package/_types/chains/definitions/igra.d.ts +48 -0
  122. package/_types/chains/definitions/igra.d.ts.map +1 -0
  123. package/_types/chains/definitions/katana.d.ts +6 -9
  124. package/_types/chains/definitions/katana.d.ts.map +1 -1
  125. package/_types/chains/definitions/megaeth.d.ts +274 -6
  126. package/_types/chains/definitions/megaeth.d.ts.map +1 -1
  127. package/_types/chains/definitions/mezo.d.ts +48 -0
  128. package/_types/chains/definitions/mezo.d.ts.map +1 -0
  129. package/_types/chains/definitions/mezoTestnet.d.ts +45 -0
  130. package/_types/chains/definitions/mezoTestnet.d.ts.map +1 -0
  131. package/_types/chains/definitions/radius.d.ts +48 -0
  132. package/_types/chains/definitions/radius.d.ts.map +1 -0
  133. package/_types/chains/definitions/radiusTestnet.d.ts +48 -0
  134. package/_types/chains/definitions/radiusTestnet.d.ts.map +1 -0
  135. package/_types/chains/definitions/tempo.d.ts +35 -32
  136. package/_types/chains/definitions/tempo.d.ts.map +1 -1
  137. package/_types/chains/definitions/tempoDevnet.d.ts +37 -32
  138. package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
  139. package/_types/chains/definitions/tempoLocalnet.d.ts +37 -32
  140. package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
  141. package/_types/chains/definitions/tempoModerato.d.ts +37 -34
  142. package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
  143. package/_types/chains/index.d.ts +10 -7
  144. package/_types/chains/index.d.ts.map +1 -1
  145. package/_types/errors/version.d.ts +1 -1
  146. package/_types/errors/version.d.ts.map +1 -1
  147. package/_types/tempo/Abis.d.ts +75 -0
  148. package/_types/tempo/Abis.d.ts.map +1 -1
  149. package/_types/tempo/Account.d.ts.map +1 -1
  150. package/_types/tempo/Decorator.d.ts +2 -2
  151. package/_types/tempo/Hardfork.d.ts +5 -0
  152. package/_types/tempo/Hardfork.d.ts.map +1 -0
  153. package/_types/tempo/Transaction.d.ts +7 -6
  154. package/_types/tempo/Transaction.d.ts.map +1 -1
  155. package/_types/tempo/actions/accessKey.d.ts +106 -3
  156. package/_types/tempo/actions/accessKey.d.ts.map +1 -1
  157. package/_types/tempo/actions/reward.d.ts +108 -0
  158. package/_types/tempo/actions/reward.d.ts.map +1 -1
  159. package/_types/tempo/actions/token.d.ts +828 -18
  160. package/_types/tempo/actions/token.d.ts.map +1 -1
  161. package/_types/tempo/chainConfig.d.ts +18 -16
  162. package/_types/tempo/chainConfig.d.ts.map +1 -1
  163. package/_types/tempo/index.d.ts +1 -0
  164. package/_types/tempo/index.d.ts.map +1 -1
  165. package/_types/utils/rpc/http.d.ts.map +1 -1
  166. package/actions/public/verifyHash.ts +23 -9
  167. package/actions/wallet/prepareTransactionRequest.ts +14 -1
  168. package/actions/wallet/sendTransaction.ts +2 -2
  169. package/actions/wallet/waitForCallsStatus.ts +1 -1
  170. package/chains/definitions/battlechainTestnet.ts +24 -0
  171. package/chains/definitions/eden.ts +29 -0
  172. package/chains/definitions/gensyn.ts +26 -0
  173. package/chains/definitions/igra.ts +23 -0
  174. package/chains/definitions/katana.ts +6 -0
  175. package/chains/definitions/megaeth.ts +26 -3
  176. package/chains/definitions/mezo.ts +20 -0
  177. package/chains/definitions/mezoTestnet.ts +27 -0
  178. package/chains/definitions/radius.ts +19 -0
  179. package/chains/definitions/radiusTestnet.ts +19 -0
  180. package/chains/definitions/tempoDevnet.ts +1 -0
  181. package/chains/definitions/tempoLocalnet.ts +1 -0
  182. package/chains/definitions/tempoModerato.ts +1 -1
  183. package/chains/index.ts +13 -8
  184. package/errors/version.ts +1 -1
  185. package/package.json +2 -2
  186. package/tempo/Abis.ts +45 -0
  187. package/tempo/Account.ts +1 -4
  188. package/tempo/Decorator.ts +2 -2
  189. package/tempo/Hardfork.ts +17 -0
  190. package/tempo/Transaction.ts +8 -7
  191. package/tempo/actions/accessKey.ts +40 -9
  192. package/tempo/actions/token.ts +2 -1
  193. package/tempo/chainConfig.ts +59 -15
  194. package/tempo/index.ts +1 -0
  195. package/tsconfig.json +1 -1
  196. package/utils/rpc/http.ts +8 -0
  197. package/_cjs/chains/definitions/tempoAndantino.js +0 -28
  198. package/_cjs/chains/definitions/tempoAndantino.js.map +0 -1
  199. package/_esm/chains/definitions/tempoAndantino.js +0 -25
  200. package/_esm/chains/definitions/tempoAndantino.js.map +0 -1
  201. package/_types/chains/definitions/tempoAndantino.d.ts +0 -918
  202. package/_types/chains/definitions/tempoAndantino.d.ts.map +0 -1
  203. package/chains/definitions/tempoAndantino.ts +0 -25
@@ -0,0 +1,29 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const eden = /*#__PURE__*/ defineChain({
4
+ id: 714,
5
+ name: 'Eden',
6
+ nativeCurrency: {
7
+ name: 'TIA',
8
+ symbol: 'TIA',
9
+ decimals: 18,
10
+ },
11
+ rpcUrls: {
12
+ default: {
13
+ http: ['https://rpc.eden.gateway.fm'],
14
+ },
15
+ },
16
+ contracts: {
17
+ multicall3: {
18
+ address: '0xca11bde05977b3631167028862be2a173976ca11',
19
+ blockCreated: 0,
20
+ },
21
+ },
22
+ blockExplorers: {
23
+ default: {
24
+ name: 'Blockscout',
25
+ url: 'https://eden.blockscout.com',
26
+ apiUrl: 'https://eden.blockscout.com/api',
27
+ },
28
+ },
29
+ })
@@ -0,0 +1,26 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const gensyn = /*#__PURE__*/ defineChain({
4
+ id: 685_689,
5
+ name: 'Gensyn Mainnet',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Ether',
9
+ symbol: 'ETH',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://gensyn-mainnet.g.alchemy.com/public'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Blockscout',
17
+ url: 'https://gensyn-mainnet.explorer.alchemy.com',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
23
+ blockCreated: 0,
24
+ },
25
+ },
26
+ })
@@ -0,0 +1,23 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const igra = /*#__PURE__*/ defineChain({
4
+ id: 38833,
5
+ name: 'Igra Network',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'iKAS',
9
+ symbol: 'iKAS',
10
+ },
11
+ rpcUrls: {
12
+ default: {
13
+ http: ['https://rpc.igralabs.com:8545'],
14
+ },
15
+ },
16
+ blockExplorers: {
17
+ default: {
18
+ name: 'Igra Explorer',
19
+ url: 'https://explorer.igralabs.com',
20
+ },
21
+ },
22
+ testnet: false,
23
+ })
@@ -20,5 +20,11 @@ export const katana = /*#__PURE__*/ defineChain({
20
20
  url: 'https://katanascan.com',
21
21
  },
22
22
  },
23
+ contracts: {
24
+ multicall3: {
25
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
26
+ blockCreated: 0,
27
+ },
28
+ },
23
29
  testnet: false,
24
30
  })
@@ -1,6 +1,10 @@
1
+ import { chainConfig } from '../../op-stack/chainConfig.js'
1
2
  import { defineChain } from '../../utils/chain/defineChain.js'
2
3
 
4
+ const sourceId = 1 // mainnet
5
+
3
6
  export const megaeth = /*#__PURE__*/ defineChain({
7
+ ...chainConfig,
4
8
  id: 4326,
5
9
  blockTime: 1_000,
6
10
  name: 'MegaETH',
@@ -22,15 +26,34 @@ export const megaeth = /*#__PURE__*/ defineChain({
22
26
  apiUrl: 'https://api.etherscan.io/v2/api',
23
27
  },
24
28
  blockscout: {
25
- name: 'Etherscan',
26
- url: 'https://mega.etherscan.io',
27
- apiUrl: 'https://api.etherscan.io/v2/api',
29
+ name: 'Blockscout',
30
+ url: 'https://megaeth.blockscout.com',
31
+ apiUrl: 'https://megaeth.blockscout.com/api',
28
32
  },
29
33
  },
30
34
  contracts: {
35
+ ...chainConfig.contracts,
36
+ disputeGameFactory: {
37
+ [sourceId]: {
38
+ address: '0x8546840adF796875cD9AAcc5B3B048f6B2c9D563',
39
+ },
40
+ },
31
41
  multicall3: {
32
42
  address: '0xcA11bde05977b3631167028862bE2a173976CA11',
33
43
  blockCreated: 0,
34
44
  },
45
+ portal: {
46
+ [sourceId]: {
47
+ address: '0x7f82f57F0Dd546519324392e408b01fcC7D709e8',
48
+ blockCreated: 21644285,
49
+ },
50
+ },
51
+ l1StandardBridge: {
52
+ [sourceId]: {
53
+ address: '0x0CA3A2FBC3D770b578223FBB6b062fa875a2eE75',
54
+ blockCreated: 21644285,
55
+ },
56
+ },
35
57
  },
58
+ sourceId,
36
59
  })
@@ -0,0 +1,20 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const mezo = /*#__PURE__*/ defineChain({
4
+ id: 31_612,
5
+ name: 'Mezo',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Bitcoin',
9
+ symbol: 'BTC',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://rpc.mezo.org'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Mezo Explorer',
17
+ url: 'https://explorer.mezo.org',
18
+ },
19
+ },
20
+ })
@@ -0,0 +1,27 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const mezoTestnet = /*#__PURE__*/ defineChain({
4
+ id: 31_611,
5
+ name: 'Mezo Testnet',
6
+ nativeCurrency: {
7
+ decimals: 18,
8
+ name: 'Bitcoin',
9
+ symbol: 'BTC',
10
+ },
11
+ rpcUrls: {
12
+ default: { http: ['https://rpc.test.mezo.org'] },
13
+ },
14
+ blockExplorers: {
15
+ default: {
16
+ name: 'Mezo Testnet Explorer',
17
+ url: 'https://explorer.test.mezo.org',
18
+ },
19
+ },
20
+ contracts: {
21
+ multicall3: {
22
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
23
+ blockCreated: 3_328_573,
24
+ },
25
+ },
26
+ testnet: true,
27
+ })
@@ -0,0 +1,19 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const radius = /*#__PURE__*/ defineChain({
4
+ id: 723_487,
5
+ name: 'Radius Network',
6
+ nativeCurrency: { name: 'Radius USD', symbol: 'RUSD', decimals: 18 },
7
+ rpcUrls: {
8
+ default: {
9
+ http: ['https://rpc.radiustech.xyz'],
10
+ },
11
+ },
12
+ blockExplorers: {
13
+ default: {
14
+ name: 'Radius Network Explorer',
15
+ url: 'https://network.radiustech.xyz',
16
+ },
17
+ },
18
+ testnet: false,
19
+ })
@@ -0,0 +1,19 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const radiusTestnet = /*#__PURE__*/ defineChain({
4
+ id: 72_344,
5
+ name: 'Radius Test Network',
6
+ nativeCurrency: { name: 'Radius USD', symbol: 'RUSD', decimals: 18 },
7
+ rpcUrls: {
8
+ default: {
9
+ http: ['https://rpc.testnet.radiustech.xyz'],
10
+ },
11
+ },
12
+ blockExplorers: {
13
+ default: {
14
+ name: 'Radius Test Network Explorer',
15
+ url: 'https://testnet.radiustech.xyz',
16
+ },
17
+ },
18
+ testnet: true,
19
+ })
@@ -5,6 +5,7 @@ export const tempoDevnet = /*#__PURE__*/ defineChain({
5
5
  ...chainConfig,
6
6
  id: 31318,
7
7
  name: 'Tempo Devnet',
8
+ hardfork: 't3',
8
9
  blockExplorers: {
9
10
  default: {
10
11
  name: 'Tempo Explorer',
@@ -5,6 +5,7 @@ export const tempoLocalnet = /*#__PURE__*/ defineChain({
5
5
  ...chainConfig,
6
6
  id: 1337,
7
7
  name: 'Tempo',
8
+ hardfork: 't3',
8
9
  nativeCurrency: {
9
10
  name: 'USD',
10
11
  symbol: 'USD',
@@ -7,7 +7,7 @@ export const tempoModerato = /*#__PURE__*/ defineChain({
7
7
  blockExplorers: {
8
8
  default: {
9
9
  name: 'Tempo Explorer',
10
- url: 'https://explore.moderato.tempo.xyz',
10
+ url: 'https://explore.testnet.tempo.xyz',
11
11
  },
12
12
  },
13
13
  name: 'Tempo Testnet (Moderato)',
package/chains/index.ts CHANGED
@@ -62,6 +62,7 @@ export { base, basePreconf } from './definitions/base.js'
62
62
  export { basecampTestnet } from './definitions/basecampTestnet.js'
63
63
  export { baseGoerli } from './definitions/baseGoerli.js'
64
64
  export { baseSepolia, baseSepoliaPreconf } from './definitions/baseSepolia.js'
65
+ export { battlechainTestnet } from './definitions/battlechainTestnet.js'
65
66
  export { beam } from './definitions/beam.js'
66
67
  export { beamTestnet } from './definitions/beamTestnet.js'
67
68
  export { bearNetworkChainMainnet } from './definitions/bearNetworkChainMainnet.js'
@@ -164,6 +165,7 @@ export { dreyerxMainnet } from './definitions/dreyerxMainnet.js'
164
165
  export { dreyerxTestnet } from './definitions/dreyerxTestnet.js'
165
166
  export { dustboyIoT } from './definitions/dustboyIoT.js'
166
167
  export { dymension } from './definitions/dymension.js'
168
+ export { eden } from './definitions/eden.js'
167
169
  export { edexa } from './definitions/edexa.js'
168
170
  export { edexaTestnet } from './definitions/edexaTestnet.js'
169
171
  export { edgeless } from './definitions/edgeless.js'
@@ -234,6 +236,7 @@ export { garnet } from './definitions/garnet.js'
234
236
  export { gatechain } from './definitions/gatechain.js'
235
237
  export { geist } from './definitions/geist.js'
236
238
  export { genesys } from './definitions/genesys.js'
239
+ export { gensyn } from './definitions/gensyn.js'
237
240
  export { giwaSepolia, giwaSepoliaPreconf } from './definitions/giwaSepolia.js'
238
241
  export { glideL1Protocol } from './definitions/glideL1Protocol.js'
239
242
  export { glideL2Protocol } from './definitions/glideL2Protocol.js'
@@ -285,6 +288,7 @@ export { hyperEvm, hyperEvm as hyperliquid } from './definitions/hyperEvm.js'
285
288
  export { hyperliquidEvmTestnet } from './definitions/hyperliquidEvmTestnet.js'
286
289
  export { icbNetwork } from './definitions/icbNetwork.js'
287
290
  export { idchain } from './definitions/idchain.js'
291
+ export { igra } from './definitions/igra.js'
288
292
  export { immutableZkEvm } from './definitions/immutableZkEvm.js'
289
293
  export { immutableZkEvmTestnet } from './definitions/immutableZkEvmTestnet.js'
290
294
  export { inEVM } from './definitions/inEVM.js'
@@ -404,6 +408,8 @@ export { metisGoerli } from './definitions/metisGoerli.js'
404
408
  export { metisSepolia } from './definitions/metisSepolia.js'
405
409
  export { mev } from './definitions/mev.js'
406
410
  export { mevTestnet } from './definitions/mevTestnet.js'
411
+ export { mezo } from './definitions/mezo.js'
412
+ export { mezoTestnet } from './definitions/mezoTestnet.js'
407
413
  export { mint } from './definitions/mint.js'
408
414
  export { mintSepoliaTestnet } from './definitions/mintSepoliaTestnet.js'
409
415
  export { mitosisTestnet } from './definitions/mitosisTestnet.js'
@@ -495,6 +501,8 @@ export { qMainnet } from './definitions/qMainnet.js'
495
501
  export { qTestnet } from './definitions/qTestnet.js'
496
502
  export { quai } from './definitions/quai.js'
497
503
  export { quaiTestnet } from './definitions/quaiTestnet.js'
504
+ export { radius } from './definitions/radius.js'
505
+ export { radiusTestnet } from './definitions/radiusTestnet.js'
498
506
  export { reactiveTestnet } from './definitions/reactiveTestnet.js'
499
507
  export { real } from './definitions/real.js'
500
508
  export { redbellyMainnet } from './definitions/redbellyMainnet.js'
@@ -627,16 +635,13 @@ export { teaSepolia } from './definitions/teaSepolia.js'
627
635
  export { telcoinTestnet } from './definitions/telcoinTestnet.js'
628
636
  export { telos } from './definitions/telos.js'
629
637
  export { telosTestnet } from './definitions/telosTestnet.js'
630
- export { tempo } from './definitions/tempo.js'
631
- export {
632
- /** @deprecated Use `tempoModerato` instead. */
633
- tempoAndantino,
634
- /** @deprecated Use `tempoModerato` instead. */
635
- tempoAndantino as tempoTestnet,
636
- } from './definitions/tempoAndantino.js'
638
+ export { tempo, tempo as tempoMainnet } from './definitions/tempo.js'
637
639
  export { tempoDevnet } from './definitions/tempoDevnet.js'
638
640
  export { tempoLocalnet } from './definitions/tempoLocalnet.js'
639
- export { tempoModerato } from './definitions/tempoModerato.js'
641
+ export {
642
+ tempoModerato,
643
+ tempoModerato as tempoTestnet,
644
+ } from './definitions/tempoModerato.js'
640
645
  export { tenet } from './definitions/tenet.js'
641
646
  export { ternoa } from './definitions/ternoa.js'
642
647
  export { thaiChain } from './definitions/thaiChain.js'
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.47.5'
1
+ export const version = '2.47.10'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.47.5",
4
+ "version": "2.47.10",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -217,7 +217,7 @@
217
217
  "@scure/bip39": "1.6.0",
218
218
  "abitype": "1.2.3",
219
219
  "isows": "1.0.7",
220
- "ox": "0.14.5",
220
+ "ox": "0.14.7",
221
221
  "ws": "8.18.3"
222
222
  },
223
223
  "license": "MIT",
package/tempo/Abis.ts CHANGED
@@ -260,6 +260,35 @@ export const tip20 = [
260
260
  inputs: [],
261
261
  outputs: [{ type: 'bytes32' }],
262
262
  },
263
+ {
264
+ name: 'permit',
265
+ type: 'function',
266
+ stateMutability: 'nonpayable',
267
+ inputs: [
268
+ { type: 'address', name: 'owner' },
269
+ { type: 'address', name: 'spender' },
270
+ { type: 'uint256', name: 'value' },
271
+ { type: 'uint256', name: 'deadline' },
272
+ { type: 'uint8', name: 'v' },
273
+ { type: 'bytes32', name: 'r' },
274
+ { type: 'bytes32', name: 's' },
275
+ ],
276
+ outputs: [],
277
+ },
278
+ {
279
+ name: 'nonces',
280
+ type: 'function',
281
+ stateMutability: 'view',
282
+ inputs: [{ type: 'address', name: 'owner' }],
283
+ outputs: [{ type: 'uint256' }],
284
+ },
285
+ {
286
+ name: 'DOMAIN_SEPARATOR',
287
+ type: 'function',
288
+ stateMutability: 'view',
289
+ inputs: [],
290
+ outputs: [{ type: 'bytes32' }],
291
+ },
263
292
  {
264
293
  name: 'distributeReward',
265
294
  type: 'function',
@@ -453,6 +482,8 @@ export const tip20 = [
453
482
  { name: 'InvalidToken', type: 'error', inputs: [] },
454
483
  { name: 'Uninitialized', type: 'error', inputs: [] },
455
484
  { name: 'InvalidTransferPolicyId', type: 'error', inputs: [] },
485
+ { name: 'PermitExpired', type: 'error', inputs: [] },
486
+ { name: 'InvalidSignature', type: 'error', inputs: [] },
456
487
  {
457
488
  name: 'hasRole',
458
489
  type: 'function',
@@ -1172,6 +1203,20 @@ export const accountKeychain = [
1172
1203
  ],
1173
1204
  outputs: [{ type: 'uint256' }],
1174
1205
  },
1206
+ {
1207
+ name: 'getRemainingLimitWithPeriod',
1208
+ type: 'function',
1209
+ stateMutability: 'view',
1210
+ inputs: [
1211
+ { type: 'address', name: 'account' },
1212
+ { type: 'address', name: 'keyId' },
1213
+ { type: 'address', name: 'token' },
1214
+ ],
1215
+ outputs: [
1216
+ { type: 'uint256', name: 'remaining' },
1217
+ { type: 'uint64', name: 'periodEnd' },
1218
+ ],
1219
+ },
1175
1220
  {
1176
1221
  name: 'getTransactionKey',
1177
1222
  type: 'function',
package/tempo/Account.ts CHANGED
@@ -444,10 +444,7 @@ function fromBase(parameters: fromBase.Parameters): Account_base {
444
444
  version: internal_version,
445
445
  }),
446
446
  )
447
- // Don't need to append magic bytes to secp256k1 signatures as they are
448
- // backwards compatible with existing verification logic.
449
- if (keyType === 'secp256k1') return signature
450
- return Hex.concat(signature, SignatureEnvelope.magicBytes)
447
+ return signature
451
448
  }
452
449
 
453
450
  return {
@@ -124,7 +124,7 @@ export type Decorator<
124
124
  * transport: http(),
125
125
  * }).extend(tempoActions())
126
126
  *
127
- * const remaining = await client.accessKey.getRemainingLimit({
127
+ * const { remaining, periodEnd } = await client.accessKey.getRemainingLimit({
128
128
  * account: '0x...',
129
129
  * accessKey: '0x...',
130
130
  * token: '0x...',
@@ -132,7 +132,7 @@ export type Decorator<
132
132
  * ```
133
133
  *
134
134
  * @param parameters - Parameters.
135
- * @returns The remaining spending amount.
135
+ * @returns The remaining spending amount and period end timestamp.
136
136
  */
137
137
  getRemainingLimit: (
138
138
  parameters: accessKeyActions.getRemainingLimit.Parameters<account>,
@@ -0,0 +1,17 @@
1
+ export const hardforks = [
2
+ 'genesis',
3
+ 't0',
4
+ 't1',
5
+ 't1a',
6
+ 't1b',
7
+ 't1c',
8
+ 't2',
9
+ 't3',
10
+ ] as const
11
+
12
+ export type Hardfork = (typeof hardforks)[number]
13
+
14
+ /** Returns `true` if `current` is before `target`. */
15
+ export function lt(current: string, target: Hardfork): boolean {
16
+ return hardforks.indexOf(current as Hardfork) < hardforks.indexOf(target)
17
+ }
@@ -73,7 +73,7 @@ export type TransactionTempo<
73
73
  authorizationList?: AuthorizationTempo.ListSigned<quantity, index> | undefined
74
74
  calls: readonly TxTempo.Call<quantity>[]
75
75
  chainId: index
76
- feeToken?: TempoAddress.Address | undefined
76
+ feeToken?: Address | undefined
77
77
  feePayerSignature?: viem_Signature | undefined
78
78
  keyAuthorization?: KeyAuthorization.Signed<quantity, index> | null | undefined
79
79
  nonceKey?: quantity | undefined
@@ -100,8 +100,8 @@ export type TransactionReceipt<
100
100
  status = 'success' | 'reverted',
101
101
  type = TransactionType,
102
102
  > = viem_TransactionReceipt<quantity, index, status, type> & {
103
- feePayer?: TempoAddress.Address | undefined
104
- feeToken?: TempoAddress.Address | undefined
103
+ feePayer?: Address | undefined
104
+ feeToken?: Address | undefined
105
105
  }
106
106
 
107
107
  export type TransactionReceiptRpc = TransactionReceipt<
@@ -137,11 +137,11 @@ export type TransactionSerializableTempo<
137
137
  > = TransactionSerializableBase<quantity, index> &
138
138
  ExactPartial<FeeValuesEIP1559<quantity>> & {
139
139
  accessList?: AccessList | undefined
140
- calls: readonly TxTempo.Call<quantity, TempoAddress.Address>[]
140
+ calls: readonly TxTempo.Call<quantity>[]
141
141
  chainId: number
142
- feeToken?: TempoAddress.Address | bigint | undefined
142
+ feeToken?: Address | bigint | undefined
143
143
  feePayerSignature?: viem_Signature | null | undefined
144
- from?: TempoAddress.Address | undefined
144
+ from?: Address | undefined
145
145
  keyAuthorization?: KeyAuthorization.Signed<quantity, index> | undefined
146
146
  nonceKey?: quantity | undefined
147
147
  signature?: SignatureEnvelope.SignatureEnvelope<quantity, index> | undefined
@@ -163,10 +163,11 @@ export function getType(
163
163
  transaction: Record<string, unknown>,
164
164
  ): Transaction['type'] {
165
165
  const account = transaction.account as
166
- | { keyType?: string | undefined }
166
+ | { keyType?: string | undefined; source?: string | undefined }
167
167
  | undefined
168
168
  if (
169
169
  (account?.keyType && account.keyType !== 'secp256k1') ||
170
+ account?.source === 'accessKey' ||
170
171
  typeof transaction.calls !== 'undefined' ||
171
172
  typeof transaction.feePayer !== 'undefined' ||
172
173
  typeof transaction.feeToken !== 'undefined' ||
@@ -1,7 +1,6 @@
1
1
  import type { Address } from 'abitype'
2
2
  import type { Account } from '../../accounts/types.js'
3
3
  import { parseAccount } from '../../accounts/utils/parseAccount.js'
4
- import type { ReadContractReturnType } from '../../actions/public/readContract.js'
5
4
  import { readContract } from '../../actions/public/readContract.js'
6
5
  import { sendTransaction } from '../../actions/wallet/sendTransaction.js'
7
6
  import { sendTransactionSync } from '../../actions/wallet/sendTransactionSync.js'
@@ -20,6 +19,7 @@ import * as Abis from '../Abis.js'
20
19
  import type { AccessKeyAccount } from '../Account.js'
21
20
  import { signKeyAuthorization } from '../Account.js'
22
21
  import * as Addresses from '../Addresses.js'
22
+ import * as Hardfork from '../Hardfork.js'
23
23
  import type {
24
24
  GetAccountParameter,
25
25
  ReadParameters,
@@ -742,10 +742,26 @@ export async function getRemainingLimit<
742
742
  } = parameters
743
743
  if (!account_) throw new Error('account is required.')
744
744
  const account = parseAccount(account_)
745
- return readContract(client, {
745
+
746
+ // TODO: remove pre-t3 branch once mainnet is on t3.
747
+ const hardfork = (client.chain as { hardfork?: string } | undefined)?.hardfork
748
+ if (hardfork && Hardfork.lt(hardfork, 't3')) {
749
+ const remaining = await readContract(client, {
750
+ ...rest,
751
+ ...getRemainingLimit.call({ account: account.address, accessKey, token }),
752
+ })
753
+ return { remaining, periodEnd: undefined }
754
+ }
755
+
756
+ const [remaining, periodEnd] = await readContract(client, {
746
757
  ...rest,
747
- ...getRemainingLimit.call({ account: account.address, accessKey, token }),
758
+ ...getRemainingLimit.callWithPeriod({
759
+ account: account.address,
760
+ accessKey,
761
+ token,
762
+ }),
748
763
  })
764
+ return { remaining, periodEnd }
749
765
  }
750
766
 
751
767
  export namespace getRemainingLimit {
@@ -764,14 +780,13 @@ export namespace getRemainingLimit {
764
780
  token: Address
765
781
  }
766
782
 
767
- export type ReturnValue = ReadContractReturnType<
768
- typeof Abis.accountKeychain,
769
- 'getRemainingLimit',
770
- never
771
- >
783
+ export type ReturnValue = {
784
+ remaining: bigint
785
+ periodEnd: bigint | undefined
786
+ }
772
787
 
773
788
  /**
774
- * Defines a call to the `getRemainingLimit` function.
789
+ * Defines a call to the `getRemainingLimit` function (pre-T3).
775
790
  *
776
791
  * @param args - Arguments.
777
792
  * @returns The call.
@@ -785,6 +800,22 @@ export namespace getRemainingLimit {
785
800
  args: [account, resolveAccessKey(accessKey), token],
786
801
  })
787
802
  }
803
+
804
+ /**
805
+ * Defines a call to the `getRemainingLimitWithPeriod` function (T3+).
806
+ *
807
+ * @param args - Arguments.
808
+ * @returns The call.
809
+ */
810
+ export function callWithPeriod(args: Args) {
811
+ const { account, accessKey, token } = args
812
+ return defineCall({
813
+ address: Addresses.accountKeychain,
814
+ abi: Abis.accountKeychain,
815
+ functionName: 'getRemainingLimitWithPeriod',
816
+ args: [account, resolveAccessKey(accessKey), token],
817
+ })
818
+ }
788
819
  }
789
820
 
790
821
  /**
@@ -2510,8 +2510,9 @@ export namespace revokeRoles {
2510
2510
  client: Client<Transport, chain, account>,
2511
2511
  parameters: revokeRoles.Parameters<chain, account>,
2512
2512
  ): Promise<ReturnType<action>> {
2513
+ const { from: _, ...rest } = parameters
2513
2514
  return (await action(client, {
2514
- ...parameters,
2515
+ ...rest,
2515
2516
  calls: parameters.roles.map((role) => {
2516
2517
  const call = revokeRoles.call({ ...parameters, role })
2517
2518
  return {