viem 2.48.3 → 2.48.6

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 (270) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/_cjs/errors/utils.js +13 -1
  3. package/_cjs/errors/utils.js.map +1 -1
  4. package/_cjs/errors/version.js +1 -1
  5. package/_cjs/tempo/Addresses.js +2 -1
  6. package/_cjs/tempo/Addresses.js.map +1 -1
  7. package/_cjs/tempo/Decorator.js +7 -0
  8. package/_cjs/tempo/Decorator.js.map +1 -1
  9. package/_cjs/tempo/Formatters.js +4 -0
  10. package/_cjs/tempo/Formatters.js.map +1 -1
  11. package/_cjs/tempo/actions/accessKey.js.map +1 -1
  12. package/_cjs/tempo/actions/index.js +2 -1
  13. package/_cjs/tempo/actions/index.js.map +1 -1
  14. package/_cjs/tempo/actions/virtualAddress.js +95 -0
  15. package/_cjs/tempo/actions/virtualAddress.js.map +1 -0
  16. package/_cjs/tempo/index.js +3 -1
  17. package/_cjs/tempo/index.js.map +1 -1
  18. package/_cjs/tempo/zones/zone.js +16 -2
  19. package/_cjs/tempo/zones/zone.js.map +1 -1
  20. package/_cjs/utils/formatters/transaction.js +3 -0
  21. package/_cjs/utils/formatters/transaction.js.map +1 -1
  22. package/_esm/errors/utils.js +18 -1
  23. package/_esm/errors/utils.js.map +1 -1
  24. package/_esm/errors/version.js +1 -1
  25. package/_esm/tempo/Addresses.js +1 -0
  26. package/_esm/tempo/Addresses.js.map +1 -1
  27. package/_esm/tempo/Decorator.js +7 -0
  28. package/_esm/tempo/Decorator.js.map +1 -1
  29. package/_esm/tempo/Formatters.js +5 -0
  30. package/_esm/tempo/Formatters.js.map +1 -1
  31. package/_esm/tempo/actions/accessKey.js +14 -12
  32. package/_esm/tempo/actions/accessKey.js.map +1 -1
  33. package/_esm/tempo/actions/amm.js +14 -14
  34. package/_esm/tempo/actions/dex.js +34 -34
  35. package/_esm/tempo/actions/faucet.js +2 -2
  36. package/_esm/tempo/actions/fee.js +10 -10
  37. package/_esm/tempo/actions/index.js +1 -0
  38. package/_esm/tempo/actions/index.js.map +1 -1
  39. package/_esm/tempo/actions/nonce.js +2 -2
  40. package/_esm/tempo/actions/policy.js +18 -18
  41. package/_esm/tempo/actions/reward.js +14 -14
  42. package/_esm/tempo/actions/token.js +61 -61
  43. package/_esm/tempo/actions/validator.js +27 -27
  44. package/_esm/tempo/actions/virtualAddress.js +228 -0
  45. package/_esm/tempo/actions/virtualAddress.js.map +1 -0
  46. package/_esm/tempo/index.js +1 -1
  47. package/_esm/tempo/index.js.map +1 -1
  48. package/_esm/tempo/zones/zone.js +16 -2
  49. package/_esm/tempo/zones/zone.js.map +1 -1
  50. package/_esm/utils/formatters/transaction.js +3 -0
  51. package/_esm/utils/formatters/transaction.js.map +1 -1
  52. package/_types/celo/chainConfig.d.ts +16 -0
  53. package/_types/celo/chainConfig.d.ts.map +1 -1
  54. package/_types/celo/formatters.d.ts +8 -0
  55. package/_types/celo/formatters.d.ts.map +1 -1
  56. package/_types/chains/definitions/abstract.d.ts +8 -1
  57. package/_types/chains/definitions/abstract.d.ts.map +1 -1
  58. package/_types/chains/definitions/abstractTestnet.d.ts +8 -1
  59. package/_types/chains/definitions/abstractTestnet.d.ts.map +1 -1
  60. package/_types/chains/definitions/ancient8.d.ts +6 -0
  61. package/_types/chains/definitions/ancient8.d.ts.map +1 -1
  62. package/_types/chains/definitions/ancient8Sepolia.d.ts +6 -0
  63. package/_types/chains/definitions/ancient8Sepolia.d.ts.map +1 -1
  64. package/_types/chains/definitions/base.d.ts +12 -0
  65. package/_types/chains/definitions/base.d.ts.map +1 -1
  66. package/_types/chains/definitions/baseGoerli.d.ts +6 -0
  67. package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
  68. package/_types/chains/definitions/baseSepolia.d.ts +12 -0
  69. package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
  70. package/_types/chains/definitions/battlechainTestnet.d.ts +8 -1
  71. package/_types/chains/definitions/battlechainTestnet.d.ts.map +1 -1
  72. package/_types/chains/definitions/blast.d.ts +6 -0
  73. package/_types/chains/definitions/blast.d.ts.map +1 -1
  74. package/_types/chains/definitions/bob.d.ts +6 -0
  75. package/_types/chains/definitions/bob.d.ts.map +1 -1
  76. package/_types/chains/definitions/bobSepolia.d.ts +6 -0
  77. package/_types/chains/definitions/bobSepolia.d.ts.map +1 -1
  78. package/_types/chains/definitions/celo.d.ts +16 -0
  79. package/_types/chains/definitions/celo.d.ts.map +1 -1
  80. package/_types/chains/definitions/celoAlfajores.d.ts +16 -0
  81. package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
  82. package/_types/chains/definitions/celoSepolia.d.ts +16 -0
  83. package/_types/chains/definitions/celoSepolia.d.ts.map +1 -1
  84. package/_types/chains/definitions/codex.d.ts +6 -0
  85. package/_types/chains/definitions/codex.d.ts.map +1 -1
  86. package/_types/chains/definitions/codexTestnet.d.ts +6 -0
  87. package/_types/chains/definitions/codexTestnet.d.ts.map +1 -1
  88. package/_types/chains/definitions/dchain.d.ts +6 -0
  89. package/_types/chains/definitions/dchain.d.ts.map +1 -1
  90. package/_types/chains/definitions/dchainTestnet.d.ts +6 -0
  91. package/_types/chains/definitions/dchainTestnet.d.ts.map +1 -1
  92. package/_types/chains/definitions/elysiumTestnet.d.ts +6 -0
  93. package/_types/chains/definitions/elysiumTestnet.d.ts.map +1 -1
  94. package/_types/chains/definitions/fraxtal.d.ts +6 -0
  95. package/_types/chains/definitions/fraxtal.d.ts.map +1 -1
  96. package/_types/chains/definitions/fraxtalTestnet.d.ts +6 -0
  97. package/_types/chains/definitions/fraxtalTestnet.d.ts.map +1 -1
  98. package/_types/chains/definitions/funkiMainnet.d.ts +6 -0
  99. package/_types/chains/definitions/funkiMainnet.d.ts.map +1 -1
  100. package/_types/chains/definitions/funkiSepolia.d.ts +6 -0
  101. package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -1
  102. package/_types/chains/definitions/garnet.d.ts +6 -0
  103. package/_types/chains/definitions/garnet.d.ts.map +1 -1
  104. package/_types/chains/definitions/giwaSepolia.d.ts +12 -0
  105. package/_types/chains/definitions/giwaSepolia.d.ts.map +1 -1
  106. package/_types/chains/definitions/ink.d.ts +6 -0
  107. package/_types/chains/definitions/ink.d.ts.map +1 -1
  108. package/_types/chains/definitions/inkSepolia.d.ts +6 -0
  109. package/_types/chains/definitions/inkSepolia.d.ts.map +1 -1
  110. package/_types/chains/definitions/lisk.d.ts +6 -0
  111. package/_types/chains/definitions/lisk.d.ts.map +1 -1
  112. package/_types/chains/definitions/liskSepolia.d.ts +6 -0
  113. package/_types/chains/definitions/liskSepolia.d.ts.map +1 -1
  114. package/_types/chains/definitions/megaeth.d.ts +6 -0
  115. package/_types/chains/definitions/megaeth.d.ts.map +1 -1
  116. package/_types/chains/definitions/metalL2.d.ts +6 -0
  117. package/_types/chains/definitions/metalL2.d.ts.map +1 -1
  118. package/_types/chains/definitions/mode.d.ts +6 -0
  119. package/_types/chains/definitions/mode.d.ts.map +1 -1
  120. package/_types/chains/definitions/modeTestnet.d.ts +6 -0
  121. package/_types/chains/definitions/modeTestnet.d.ts.map +1 -1
  122. package/_types/chains/definitions/optimism.d.ts +6 -0
  123. package/_types/chains/definitions/optimism.d.ts.map +1 -1
  124. package/_types/chains/definitions/optimismGoerli.d.ts +6 -0
  125. package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
  126. package/_types/chains/definitions/optimismSepolia.d.ts +6 -0
  127. package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
  128. package/_types/chains/definitions/pgn.d.ts +6 -0
  129. package/_types/chains/definitions/pgn.d.ts.map +1 -1
  130. package/_types/chains/definitions/pgnTestnet.d.ts +6 -0
  131. package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
  132. package/_types/chains/definitions/playfiAlbireo.d.ts +8 -1
  133. package/_types/chains/definitions/playfiAlbireo.d.ts.map +1 -1
  134. package/_types/chains/definitions/pyrope.d.ts +6 -0
  135. package/_types/chains/definitions/pyrope.d.ts.map +1 -1
  136. package/_types/chains/definitions/redstone.d.ts +6 -0
  137. package/_types/chains/definitions/redstone.d.ts.map +1 -1
  138. package/_types/chains/definitions/rss3.d.ts +6 -0
  139. package/_types/chains/definitions/rss3.d.ts.map +1 -1
  140. package/_types/chains/definitions/rss3Sepolia.d.ts +6 -0
  141. package/_types/chains/definitions/rss3Sepolia.d.ts.map +1 -1
  142. package/_types/chains/definitions/shape.d.ts +6 -0
  143. package/_types/chains/definitions/shape.d.ts.map +1 -1
  144. package/_types/chains/definitions/shapeSepolia.d.ts +6 -0
  145. package/_types/chains/definitions/shapeSepolia.d.ts.map +1 -1
  146. package/_types/chains/definitions/snax.d.ts +6 -0
  147. package/_types/chains/definitions/snax.d.ts.map +1 -1
  148. package/_types/chains/definitions/snaxTestnet.d.ts +6 -0
  149. package/_types/chains/definitions/snaxTestnet.d.ts.map +1 -1
  150. package/_types/chains/definitions/soneium.d.ts +6 -0
  151. package/_types/chains/definitions/soneium.d.ts.map +1 -1
  152. package/_types/chains/definitions/soneiumMinato.d.ts +6 -0
  153. package/_types/chains/definitions/soneiumMinato.d.ts.map +1 -1
  154. package/_types/chains/definitions/sophon.d.ts +8 -1
  155. package/_types/chains/definitions/sophon.d.ts.map +1 -1
  156. package/_types/chains/definitions/sophonTestnet.d.ts +8 -1
  157. package/_types/chains/definitions/sophonTestnet.d.ts.map +1 -1
  158. package/_types/chains/definitions/superseed.d.ts +6 -0
  159. package/_types/chains/definitions/superseed.d.ts.map +1 -1
  160. package/_types/chains/definitions/superseedSepolia.d.ts +6 -0
  161. package/_types/chains/definitions/superseedSepolia.d.ts.map +1 -1
  162. package/_types/chains/definitions/swellchain.d.ts +6 -0
  163. package/_types/chains/definitions/swellchain.d.ts.map +1 -1
  164. package/_types/chains/definitions/swellchainTestnet.d.ts +6 -0
  165. package/_types/chains/definitions/swellchainTestnet.d.ts.map +1 -1
  166. package/_types/chains/definitions/tempo.d.ts +12 -0
  167. package/_types/chains/definitions/tempo.d.ts.map +1 -1
  168. package/_types/chains/definitions/tempoDevnet.d.ts +12 -0
  169. package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
  170. package/_types/chains/definitions/tempoLocalnet.d.ts +12 -0
  171. package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
  172. package/_types/chains/definitions/tempoModerato.d.ts +12 -0
  173. package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
  174. package/_types/chains/definitions/treasure.d.ts +8 -1
  175. package/_types/chains/definitions/treasure.d.ts.map +1 -1
  176. package/_types/chains/definitions/treasureTopaz.d.ts +8 -1
  177. package/_types/chains/definitions/treasureTopaz.d.ts.map +1 -1
  178. package/_types/chains/definitions/unichain.d.ts +6 -0
  179. package/_types/chains/definitions/unichain.d.ts.map +1 -1
  180. package/_types/chains/definitions/unichainSepolia.d.ts +6 -0
  181. package/_types/chains/definitions/unichainSepolia.d.ts.map +1 -1
  182. package/_types/chains/definitions/worldchain.d.ts +6 -0
  183. package/_types/chains/definitions/worldchain.d.ts.map +1 -1
  184. package/_types/chains/definitions/worldchainSepolia.d.ts +6 -0
  185. package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
  186. package/_types/chains/definitions/zircuit.d.ts +6 -0
  187. package/_types/chains/definitions/zircuit.d.ts.map +1 -1
  188. package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +6 -0
  189. package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts.map +1 -1
  190. package/_types/chains/definitions/zksync.d.ts +8 -1
  191. package/_types/chains/definitions/zksync.d.ts.map +1 -1
  192. package/_types/chains/definitions/zksyncInMemoryNode.d.ts +8 -1
  193. package/_types/chains/definitions/zksyncInMemoryNode.d.ts.map +1 -1
  194. package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +8 -1
  195. package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts.map +1 -1
  196. package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +8 -1
  197. package/_types/chains/definitions/zksyncLocalHyperchain.d.ts.map +1 -1
  198. package/_types/chains/definitions/zksyncLocalNode.d.ts +8 -1
  199. package/_types/chains/definitions/zksyncLocalNode.d.ts.map +1 -1
  200. package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +8 -1
  201. package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts.map +1 -1
  202. package/_types/chains/definitions/zora.d.ts +6 -0
  203. package/_types/chains/definitions/zora.d.ts.map +1 -1
  204. package/_types/chains/definitions/zoraSepolia.d.ts +6 -0
  205. package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
  206. package/_types/chains/definitions/zoraTestnet.d.ts +6 -0
  207. package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
  208. package/_types/errors/utils.d.ts +5 -0
  209. package/_types/errors/utils.d.ts.map +1 -1
  210. package/_types/errors/version.d.ts +1 -1
  211. package/_types/op-stack/chainConfig.d.ts +6 -0
  212. package/_types/op-stack/chainConfig.d.ts.map +1 -1
  213. package/_types/op-stack/formatters.d.ts +6 -0
  214. package/_types/op-stack/formatters.d.ts.map +1 -1
  215. package/_types/tempo/Addresses.d.ts +1 -0
  216. package/_types/tempo/Addresses.d.ts.map +1 -1
  217. package/_types/tempo/Decorator.d.ts +101 -1
  218. package/_types/tempo/Decorator.d.ts.map +1 -1
  219. package/_types/tempo/Formatters.d.ts.map +1 -1
  220. package/_types/tempo/actions/accessKey.d.ts +14 -12
  221. package/_types/tempo/actions/accessKey.d.ts.map +1 -1
  222. package/_types/tempo/actions/amm.d.ts +14 -14
  223. package/_types/tempo/actions/dex.d.ts +34 -34
  224. package/_types/tempo/actions/faucet.d.ts +2 -2
  225. package/_types/tempo/actions/fee.d.ts +10 -10
  226. package/_types/tempo/actions/index.d.ts +1 -0
  227. package/_types/tempo/actions/index.d.ts.map +1 -1
  228. package/_types/tempo/actions/nonce.d.ts +2 -2
  229. package/_types/tempo/actions/policy.d.ts +18 -18
  230. package/_types/tempo/actions/reward.d.ts +14 -14
  231. package/_types/tempo/actions/token.d.ts +61 -61
  232. package/_types/tempo/actions/validator.d.ts +27 -27
  233. package/_types/tempo/actions/virtualAddress.d.ts +350 -0
  234. package/_types/tempo/actions/virtualAddress.d.ts.map +1 -0
  235. package/_types/tempo/chainConfig.d.ts +6 -0
  236. package/_types/tempo/chainConfig.d.ts.map +1 -1
  237. package/_types/tempo/index.d.ts +1 -1
  238. package/_types/tempo/index.d.ts.map +1 -1
  239. package/_types/tempo/zones/zone.d.ts +48 -12
  240. package/_types/tempo/zones/zone.d.ts.map +1 -1
  241. package/_types/types/transaction.d.ts +3 -1
  242. package/_types/types/transaction.d.ts.map +1 -1
  243. package/_types/utils/formatters/transaction.d.ts +1 -1
  244. package/_types/utils/formatters/transaction.d.ts.map +1 -1
  245. package/_types/zksync/chainConfig.d.ts +8 -1
  246. package/_types/zksync/chainConfig.d.ts.map +1 -1
  247. package/_types/zksync/formatters.d.ts +8 -1
  248. package/_types/zksync/formatters.d.ts.map +1 -1
  249. package/errors/utils.ts +17 -1
  250. package/errors/version.ts +1 -1
  251. package/package.json +2 -2
  252. package/tempo/Addresses.ts +1 -0
  253. package/tempo/Decorator.ts +125 -1
  254. package/tempo/Formatters.ts +6 -0
  255. package/tempo/actions/accessKey.ts +14 -12
  256. package/tempo/actions/amm.ts +14 -14
  257. package/tempo/actions/dex.ts +34 -34
  258. package/tempo/actions/faucet.ts +2 -2
  259. package/tempo/actions/fee.ts +10 -10
  260. package/tempo/actions/index.ts +1 -0
  261. package/tempo/actions/nonce.ts +2 -2
  262. package/tempo/actions/policy.ts +18 -18
  263. package/tempo/actions/reward.ts +14 -14
  264. package/tempo/actions/token.ts +61 -61
  265. package/tempo/actions/validator.ts +27 -27
  266. package/tempo/actions/virtualAddress.ts +337 -0
  267. package/tempo/index.ts +8 -1
  268. package/tempo/zones/zone.ts +23 -2
  269. package/types/transaction.ts +3 -1
  270. package/utils/formatters/transaction.ts +3 -0
package/errors/utils.ts CHANGED
@@ -3,4 +3,20 @@ import type { Address } from 'abitype'
3
3
  export type ErrorType<name extends string = 'Error'> = Error & { name: name }
4
4
 
5
5
  export const getContractAddress = (address: Address) => address
6
- export const getUrl = (url: string) => url
6
+
7
+ /**
8
+ * Returns the URL with any embedded basic-auth credentials stripped, so
9
+ * error messages and logs don't leak secrets when an RPC URL like
10
+ * `https://user:pass@host` is used.
11
+ */
12
+ export const getUrl = (url: string) => {
13
+ try {
14
+ const parsed = new URL(url)
15
+ if (!parsed.username && !parsed.password) return url
16
+ parsed.username = ''
17
+ parsed.password = ''
18
+ return parsed.toString()
19
+ } catch {
20
+ return url
21
+ }
22
+ }
package/errors/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.48.3'
1
+ export const version = '2.48.6'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "viem",
3
3
  "description": "TypeScript Interface for Ethereum",
4
- "version": "2.48.3",
4
+ "version": "2.48.6",
5
5
  "main": "./_cjs/index.js",
6
6
  "module": "./_esm/index.js",
7
7
  "types": "./_types/index.d.ts",
@@ -222,7 +222,7 @@
222
222
  "@scure/bip39": "1.6.0",
223
223
  "abitype": "1.2.3",
224
224
  "isows": "1.0.7",
225
- "ox": "0.14.17",
225
+ "ox": "0.14.20",
226
226
  "ws": "8.18.3"
227
227
  },
228
228
  "license": "MIT",
@@ -2,6 +2,7 @@ export const accountImplementation =
2
2
  '0x7702c00000000000000000000000000000000000'
3
3
  export const accountKeychain = '0xaAAAaaAA00000000000000000000000000000000'
4
4
  export const accountRegistrar = '0x7702ac0000000000000000000000000000000000'
5
+ export const addressRegistry = '0xfdc0000000000000000000000000000000000000'
5
6
  export const feeManager = '0xfeec000000000000000000000000000000000000'
6
7
  export const nonceManager = '0x4e4F4E4345000000000000000000000000000000'
7
8
  export const pathUsd = '0x20c0000000000000000000000000000000000000'
@@ -14,6 +14,7 @@ import * as rewardActions from './actions/reward.js'
14
14
  import * as simulateActions from './actions/simulate.js'
15
15
  import * as tokenActions from './actions/token.js'
16
16
  import * as validatorActions from './actions/validator.js'
17
+ import * as virtualAddressActions from './actions/virtualAddress.js'
17
18
  import * as zoneActions from './actions/zone.js'
18
19
 
19
20
  export type Decorator<
@@ -264,7 +265,7 @@ export type Decorator<
264
265
  * import { tempoActions } from 'viem/tempo'
265
266
  *
266
267
  * const client = createClient({
267
- * chain: tempo({ feeToken: '0x20c...001' }),
268
+ * chain: tempo.extend({ feeToken: '0x20c...001' }),
268
269
  * transport: http(),
269
270
  * }).extend(tempoActions())
270
271
  *
@@ -3805,6 +3806,119 @@ export type Decorator<
3805
3806
  parameters: validatorActions.updateSync.Parameters<chain, account>,
3806
3807
  ) => Promise<validatorActions.updateSync.ReturnValue>
3807
3808
  }
3809
+ virtualAddress: {
3810
+ /**
3811
+ * Gets the registered master address for a given master ID.
3812
+ *
3813
+ * @example
3814
+ * ```ts
3815
+ * import { createClient, http } from 'viem'
3816
+ * import { tempo } from 'viem/chains'
3817
+ * import { tempoActions } from 'viem/tempo'
3818
+ *
3819
+ * const client = createClient({
3820
+ * chain: tempo,
3821
+ * transport: http(),
3822
+ * }).extend(tempoActions())
3823
+ *
3824
+ * const master = await client.virtualAddress.getMasterAddress({
3825
+ * masterId: '0x58e21090',
3826
+ * })
3827
+ * ```
3828
+ *
3829
+ * @param parameters - Parameters.
3830
+ * @returns The master address, or null if unregistered.
3831
+ */
3832
+ getMasterAddress: (
3833
+ parameters: virtualAddressActions.getMasterAddress.Parameters,
3834
+ ) => Promise<virtualAddressActions.getMasterAddress.ReturnValue>
3835
+ /**
3836
+ * Registers the caller as a virtual address master.
3837
+ *
3838
+ * @example
3839
+ * ```ts
3840
+ * import { createClient, http } from 'viem'
3841
+ * import { privateKeyToAccount } from 'viem/accounts'
3842
+ * import { tempo } from 'viem/chains'
3843
+ * import { tempoActions } from 'viem/tempo'
3844
+ *
3845
+ * const client = createClient({
3846
+ * account: privateKeyToAccount('0x...'),
3847
+ * chain: tempo,
3848
+ * transport: http(),
3849
+ * }).extend(tempoActions())
3850
+ *
3851
+ * const hash = await client.virtualAddress.registerMaster({
3852
+ * salt: '0x...',
3853
+ * })
3854
+ * ```
3855
+ *
3856
+ * @param parameters - Parameters.
3857
+ * @returns The transaction hash.
3858
+ */
3859
+ registerMaster: (
3860
+ parameters: virtualAddressActions.registerMaster.Parameters<
3861
+ chain,
3862
+ account
3863
+ >,
3864
+ ) => Promise<virtualAddressActions.registerMaster.ReturnValue>
3865
+ /**
3866
+ * Registers the caller as a virtual address master and waits for confirmation.
3867
+ *
3868
+ * @example
3869
+ * ```ts
3870
+ * import { createClient, http } from 'viem'
3871
+ * import { privateKeyToAccount } from 'viem/accounts'
3872
+ * import { tempo } from 'viem/chains'
3873
+ * import { tempoActions } from 'viem/tempo'
3874
+ *
3875
+ * const client = createClient({
3876
+ * account: privateKeyToAccount('0x...'),
3877
+ * chain: tempo,
3878
+ * transport: http(),
3879
+ * }).extend(tempoActions())
3880
+ *
3881
+ * const { receipt, masterId, masterAddress } =
3882
+ * await client.virtualAddress.registerMasterSync({
3883
+ * salt: '0x...',
3884
+ * })
3885
+ * ```
3886
+ *
3887
+ * @param parameters - Parameters.
3888
+ * @returns The transaction receipt and event data.
3889
+ */
3890
+ registerMasterSync: (
3891
+ parameters: virtualAddressActions.registerMasterSync.Parameters<
3892
+ chain,
3893
+ account
3894
+ >,
3895
+ ) => Promise<virtualAddressActions.registerMasterSync.ReturnValue>
3896
+ /**
3897
+ * Resolves an address to its effective recipient.
3898
+ *
3899
+ * @example
3900
+ * ```ts
3901
+ * import { createClient, http } from 'viem'
3902
+ * import { tempo } from 'viem/chains'
3903
+ * import { tempoActions } from 'viem/tempo'
3904
+ *
3905
+ * const client = createClient({
3906
+ * chain: tempo,
3907
+ * transport: http(),
3908
+ * }).extend(tempoActions())
3909
+ *
3910
+ * const recipient = await client.virtualAddress.resolve({
3911
+ * address: '0x58e21090fdfdfdfdfdfdfdfdfdfd010203040506',
3912
+ * })
3913
+ * ```
3914
+ *
3915
+ * @param parameters - Parameters.
3916
+ * @returns The resolved address, or null if virtual and unregistered.
3917
+ */
3918
+ resolve: (
3919
+ parameters: virtualAddressActions.resolve.Parameters,
3920
+ ) => Promise<virtualAddressActions.resolve.ReturnValue>
3921
+ }
3808
3922
  zone: {
3809
3923
  /**
3810
3924
  * Deposits tokens into a zone.
@@ -4361,6 +4475,16 @@ export function decorator() {
4361
4475
  updateSync: (parameters) =>
4362
4476
  validatorActions.updateSync(client, parameters),
4363
4477
  },
4478
+ virtualAddress: {
4479
+ getMasterAddress: (parameters) =>
4480
+ virtualAddressActions.getMasterAddress(client, parameters),
4481
+ registerMaster: (parameters) =>
4482
+ virtualAddressActions.registerMaster(client, parameters),
4483
+ registerMasterSync: (parameters) =>
4484
+ virtualAddressActions.registerMasterSync(client, parameters),
4485
+ resolve: (parameters) =>
4486
+ virtualAddressActions.resolve(client, parameters),
4487
+ },
4364
4488
  zone: {
4365
4489
  deposit: (parameters) => zoneActions.deposit(client, parameters),
4366
4490
  depositSync: (parameters) =>
@@ -27,6 +27,11 @@ export function formatTransaction(
27
27
  ): Transaction<bigint, number, boolean> {
28
28
  if (!isTempo(transaction)) return viem_formatTransaction(transaction as never)
29
29
 
30
+ // TODO: upstream `blockTimestamp` formatting into `ox`.
31
+ const blockTimestamp =
32
+ transaction.blockTimestamp == null
33
+ ? undefined
34
+ : BigInt(transaction.blockTimestamp)
30
35
  const {
31
36
  feePayerSignature,
32
37
  gasPrice: _,
@@ -37,6 +42,7 @@ export function formatTransaction(
37
42
  return {
38
43
  ...tx,
39
44
  accessList: tx.accessList!,
45
+ ...(typeof blockTimestamp !== 'undefined' && { blockTimestamp }),
40
46
  feePayerSignature: feePayerSignature
41
47
  ? {
42
48
  r: Hex.fromNumber(feePayerSignature.r, { size: 32 }),
@@ -55,7 +55,7 @@ const spendPolicies = {
55
55
  * const account = Account.from({ privateKey: '0x...' })
56
56
  * const client = createClient({
57
57
  * account,
58
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
58
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
59
59
  * transport: http(),
60
60
  * })
61
61
  *
@@ -169,7 +169,7 @@ export namespace authorize {
169
169
  * const account = Account.from({ privateKey: '0x...' })
170
170
  * const client = createClient({
171
171
  * account,
172
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
172
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
173
173
  * transport: http(),
174
174
  * })
175
175
  *
@@ -240,7 +240,7 @@ export namespace authorizeSync {
240
240
  *
241
241
  * const client = createClient({
242
242
  * account: privateKeyToAccount('0x...'),
243
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
243
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
244
244
  * transport: http(),
245
245
  * })
246
246
  *
@@ -312,7 +312,7 @@ export namespace revoke {
312
312
  * import { Actions } from 'viem/tempo'
313
313
  *
314
314
  * const client = createClient({
315
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
315
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
316
316
  * transport: http(),
317
317
  * }).extend(walletActions)
318
318
  *
@@ -360,7 +360,7 @@ export namespace revoke {
360
360
  *
361
361
  * const client = createClient({
362
362
  * account: privateKeyToAccount('0x...'),
363
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
363
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
364
364
  * transport: http(),
365
365
  * })
366
366
  *
@@ -426,7 +426,7 @@ export namespace revokeSync {
426
426
  *
427
427
  * const client = createClient({
428
428
  * account: privateKeyToAccount('0x...'),
429
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
429
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
430
430
  * transport: http(),
431
431
  * })
432
432
  *
@@ -504,7 +504,7 @@ export namespace updateLimit {
504
504
  * import { Actions } from 'viem/tempo'
505
505
  *
506
506
  * const client = createClient({
507
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
507
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
508
508
  * transport: http(),
509
509
  * }).extend(walletActions)
510
510
  *
@@ -556,7 +556,7 @@ export namespace updateLimit {
556
556
  *
557
557
  * const client = createClient({
558
558
  * account: privateKeyToAccount('0x...'),
559
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
559
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
560
560
  * transport: http(),
561
561
  * })
562
562
  *
@@ -628,7 +628,7 @@ export namespace updateLimitSync {
628
628
  * import { Actions } from 'viem/tempo'
629
629
  *
630
630
  * const client = createClient({
631
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
631
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
632
632
  * transport: http(),
633
633
  * })
634
634
  *
@@ -719,20 +719,22 @@ export namespace getMetadata {
719
719
  * import { Actions } from 'viem/tempo'
720
720
  *
721
721
  * const client = createClient({
722
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' }),
722
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' }),
723
723
  * transport: http(),
724
724
  * })
725
725
  *
726
- * const remaining = await Actions.accessKey.getRemainingLimit(client, {
726
+ * const { remaining, periodEnd } = await Actions.accessKey.getRemainingLimit(client, {
727
727
  * account: '0x...',
728
728
  * accessKey: '0x...',
729
729
  * token: '0x...',
730
730
  * })
731
+ *
732
+ * console.log(remaining, periodEnd)
731
733
  * ```
732
734
  *
733
735
  * @param client - Client.
734
736
  * @param parameters - Parameters.
735
- * @returns The remaining spending amount.
737
+ * @returns The remaining spending amount and period end timestamp.
736
738
  */
737
739
  export async function getRemainingLimit<
738
740
  chain extends Chain | undefined,
@@ -34,7 +34,7 @@ import { defineCall } from '../internal/utils.js'
34
34
  * import { Actions } from 'viem/tempo'
35
35
  *
36
36
  * const client = createClient({
37
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
37
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
38
38
  * transport: http(),
39
39
  * })
40
40
  *
@@ -124,7 +124,7 @@ export namespace getPool {
124
124
  * import { Actions } from 'viem/tempo'
125
125
  *
126
126
  * const client = createClient({
127
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
127
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
128
128
  * transport: http(),
129
129
  * })
130
130
  *
@@ -224,7 +224,7 @@ export namespace getLiquidityBalance {
224
224
  *
225
225
  * const client = createClient({
226
226
  * account: privateKeyToAccount('0x...'),
227
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
227
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
228
228
  * transport: http(),
229
229
  * })
230
230
  *
@@ -307,7 +307,7 @@ export namespace rebalanceSwap {
307
307
  * import { Actions } from 'viem/tempo'
308
308
  *
309
309
  * const client = createClient({
310
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
310
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
311
311
  * transport: http(),
312
312
  * }).extend(walletActions)
313
313
  *
@@ -377,7 +377,7 @@ export namespace rebalanceSwap {
377
377
  *
378
378
  * const client = createClient({
379
379
  * account: privateKeyToAccount('0x...'),
380
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
380
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
381
381
  * transport: http(),
382
382
  * })
383
383
  *
@@ -444,7 +444,7 @@ export namespace rebalanceSwapSync {
444
444
  *
445
445
  * const client = createClient({
446
446
  * account: privateKeyToAccount('0x...'),
447
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
447
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
448
448
  * transport: http(),
449
449
  * })
450
450
  *
@@ -533,7 +533,7 @@ export namespace mint {
533
533
  * import { Actions } from 'viem/tempo'
534
534
  *
535
535
  * const client = createClient({
536
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
536
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
537
537
  * transport: http(),
538
538
  * }).extend(walletActions)
539
539
  *
@@ -608,7 +608,7 @@ export namespace mint {
608
608
  *
609
609
  * const client = createClient({
610
610
  * account: privateKeyToAccount('0x...'),
611
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
611
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
612
612
  * transport: http(),
613
613
  * })
614
614
  *
@@ -675,7 +675,7 @@ export namespace mintSync {
675
675
  *
676
676
  * const client = createClient({
677
677
  * account: privateKeyToAccount('0x...'),
678
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
678
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
679
679
  * transport: http(),
680
680
  * })
681
681
  *
@@ -753,7 +753,7 @@ export namespace burn {
753
753
  * import { Actions } from 'viem/tempo'
754
754
  *
755
755
  * const client = createClient({
756
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
756
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
757
757
  * transport: http(),
758
758
  * }).extend(walletActions)
759
759
  *
@@ -823,7 +823,7 @@ export namespace burn {
823
823
  *
824
824
  * const client = createClient({
825
825
  * account: privateKeyToAccount('0x...'),
826
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
826
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
827
827
  * transport: http(),
828
828
  * })
829
829
  *
@@ -888,7 +888,7 @@ export namespace burnSync {
888
888
  * import { Actions } from 'viem/tempo'
889
889
  *
890
890
  * const client = createClient({
891
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
891
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
892
892
  * transport: http(),
893
893
  * })
894
894
  *
@@ -968,7 +968,7 @@ export declare namespace watchRebalanceSwap {
968
968
  * import { Actions } from 'viem/tempo'
969
969
  *
970
970
  * const client = createClient({
971
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
971
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
972
972
  * transport: http(),
973
973
  * })
974
974
  *
@@ -1051,7 +1051,7 @@ export declare namespace watchMint {
1051
1051
  * import { Actions } from 'viem/tempo'
1052
1052
  *
1053
1053
  * const client = createClient({
1054
- * chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
1054
+ * chain: tempo.extend({ feeToken: '0x20c0000000000000000000000000000000000001' })
1055
1055
  * transport: http(),
1056
1056
  * })
1057
1057
  *