viem 1.19.8 → 1.19.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 (228) hide show
  1. package/CHANGELOG.md +425 -405
  2. package/README.md +46 -46
  3. package/_cjs/accounts/utils/signTransaction.js.map +1 -1
  4. package/_cjs/actions/public/createContractEventFilter.js.map +1 -1
  5. package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js +1 -1
  6. package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
  7. package/_cjs/chains/celo/serializers.js +3 -7
  8. package/_cjs/chains/celo/serializers.js.map +1 -1
  9. package/_cjs/chains/definitions/confluxESpace.js +2 -0
  10. package/_cjs/chains/definitions/confluxESpace.js.map +1 -1
  11. package/_cjs/chains/definitions/confluxESpaceTestnet.js +34 -0
  12. package/_cjs/chains/definitions/confluxESpaceTestnet.js.map +1 -0
  13. package/_cjs/chains/definitions/filecoin.js +6 -0
  14. package/_cjs/chains/definitions/filecoin.js.map +1 -1
  15. package/_cjs/chains/definitions/pgn.js +38 -0
  16. package/_cjs/chains/definitions/pgn.js.map +1 -0
  17. package/_cjs/chains/definitions/pgnTestnet.js +39 -0
  18. package/_cjs/chains/definitions/pgnTestnet.js.map +1 -0
  19. package/_cjs/chains/definitions/sapphire.js +33 -0
  20. package/_cjs/chains/definitions/sapphire.js.map +1 -0
  21. package/_cjs/chains/definitions/sapphireTestnet.js +28 -0
  22. package/_cjs/chains/definitions/sapphireTestnet.js.map +1 -0
  23. package/_cjs/chains/index.js +14 -4
  24. package/_cjs/chains/index.js.map +1 -1
  25. package/_cjs/errors/base.js.map +1 -1
  26. package/_cjs/errors/version.js +1 -1
  27. package/_cjs/errors/version.js.map +1 -1
  28. package/_cjs/utils/abi/encodeEventTopics.js.map +1 -1
  29. package/_cjs/utils/ccip.js +3 -1
  30. package/_cjs/utils/ccip.js.map +1 -1
  31. package/_cjs/utils/encoding/toBytes.js +2 -2
  32. package/_cjs/utils/encoding/toBytes.js.map +1 -1
  33. package/_cjs/utils/ens/avatar/utils.js +1 -1
  34. package/_cjs/utils/ens/avatar/utils.js.map +1 -1
  35. package/_cjs/utils/errors/getContractError.js.map +1 -1
  36. package/_cjs/utils/errors/getNodeError.js +11 -11
  37. package/_cjs/utils/errors/getNodeError.js.map +1 -1
  38. package/_cjs/utils/transaction/getTransactionType.js.map +1 -1
  39. package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
  40. package/_esm/accounts/utils/signTransaction.js.map +1 -1
  41. package/_esm/actions/ens/getEnsAddress.js +2 -2
  42. package/_esm/actions/ens/getEnsAvatar.js +2 -2
  43. package/_esm/actions/ens/getEnsName.js +2 -2
  44. package/_esm/actions/ens/getEnsResolver.js +2 -2
  45. package/_esm/actions/ens/getEnsText.js +2 -2
  46. package/_esm/actions/public/createContractEventFilter.js.map +1 -1
  47. package/_esm/actions/public/estimateMaxPriorityFeePerGas.js +1 -1
  48. package/_esm/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
  49. package/_esm/actions/public/getBlock.js +1 -1
  50. package/_esm/actions/public/getBlockNumber.js +1 -1
  51. package/_esm/actions/public/getLogs.js +1 -1
  52. package/_esm/actions/public/getTransaction.js +1 -1
  53. package/_esm/actions/public/getTransactionConfirmations.js +1 -1
  54. package/_esm/actions/public/getTransactionReceipt.js +1 -1
  55. package/_esm/actions/public/readContract.js +1 -1
  56. package/_esm/actions/public/simulateContract.js +1 -1
  57. package/_esm/actions/public/waitForTransactionReceipt.js +1 -1
  58. package/_esm/actions/public/watchBlockNumber.js +1 -1
  59. package/_esm/actions/public/watchBlocks.js +1 -1
  60. package/_esm/actions/wallet/deployContract.js +1 -1
  61. package/_esm/actions/wallet/sendTransaction.js +1 -1
  62. package/_esm/actions/wallet/writeContract.js +1 -1
  63. package/_esm/chains/celo/serializers.js +3 -7
  64. package/_esm/chains/celo/serializers.js.map +1 -1
  65. package/_esm/chains/definitions/confluxESpace.js +2 -0
  66. package/_esm/chains/definitions/confluxESpace.js.map +1 -1
  67. package/_esm/chains/definitions/confluxESpaceTestnet.js +31 -0
  68. package/_esm/chains/definitions/confluxESpaceTestnet.js.map +1 -0
  69. package/_esm/chains/definitions/filecoin.js +6 -0
  70. package/_esm/chains/definitions/filecoin.js.map +1 -1
  71. package/_esm/chains/definitions/pgn.js +35 -0
  72. package/_esm/chains/definitions/pgn.js.map +1 -0
  73. package/_esm/chains/definitions/pgnTestnet.js +36 -0
  74. package/_esm/chains/definitions/pgnTestnet.js.map +1 -0
  75. package/_esm/chains/definitions/sapphire.js +30 -0
  76. package/_esm/chains/definitions/sapphire.js.map +1 -0
  77. package/_esm/chains/definitions/sapphireTestnet.js +25 -0
  78. package/_esm/chains/definitions/sapphireTestnet.js.map +1 -0
  79. package/_esm/chains/index.js +5 -0
  80. package/_esm/chains/index.js.map +1 -1
  81. package/_esm/errors/base.js.map +1 -1
  82. package/_esm/errors/version.js +1 -1
  83. package/_esm/errors/version.js.map +1 -1
  84. package/_esm/utils/abi/encodeEventTopics.js.map +1 -1
  85. package/_esm/utils/ccip.js +3 -1
  86. package/_esm/utils/ccip.js.map +1 -1
  87. package/_esm/utils/encoding/toBytes.js +2 -2
  88. package/_esm/utils/encoding/toBytes.js.map +1 -1
  89. package/_esm/utils/ens/avatar/utils.js +1 -1
  90. package/_esm/utils/ens/avatar/utils.js.map +1 -1
  91. package/_esm/utils/ens/namehash.js +1 -1
  92. package/_esm/utils/ens/normalize.js +2 -2
  93. package/_esm/utils/errors/getContractError.js.map +1 -1
  94. package/_esm/utils/errors/getNodeError.js +11 -11
  95. package/_esm/utils/errors/getNodeError.js.map +1 -1
  96. package/_esm/utils/transaction/getTransactionType.js.map +1 -1
  97. package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
  98. package/_types/accounts/utils/signTransaction.d.ts.map +1 -1
  99. package/_types/actions/ens/getEnsAddress.d.ts +2 -2
  100. package/_types/actions/ens/getEnsAvatar.d.ts +2 -2
  101. package/_types/actions/ens/getEnsName.d.ts +2 -2
  102. package/_types/actions/ens/getEnsResolver.d.ts +2 -2
  103. package/_types/actions/ens/getEnsText.d.ts +2 -2
  104. package/_types/actions/public/createContractEventFilter.d.ts.map +1 -1
  105. package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
  106. package/_types/actions/public/getBlock.d.ts +1 -1
  107. package/_types/actions/public/getBlockNumber.d.ts +1 -1
  108. package/_types/actions/public/getLogs.d.ts +1 -1
  109. package/_types/actions/public/getTransaction.d.ts +1 -1
  110. package/_types/actions/public/getTransactionConfirmations.d.ts +1 -1
  111. package/_types/actions/public/getTransactionReceipt.d.ts +1 -1
  112. package/_types/actions/public/readContract.d.ts +1 -1
  113. package/_types/actions/public/simulateContract.d.ts +1 -1
  114. package/_types/actions/public/waitForTransactionReceipt.d.ts +1 -1
  115. package/_types/actions/public/watchBlockNumber.d.ts +1 -1
  116. package/_types/actions/public/watchBlocks.d.ts +1 -1
  117. package/_types/actions/wallet/deployContract.d.ts +1 -1
  118. package/_types/actions/wallet/sendTransaction.d.ts +1 -1
  119. package/_types/actions/wallet/writeContract.d.ts +1 -1
  120. package/_types/chains/celo/serializers.d.ts.map +1 -1
  121. package/_types/chains/definitions/confluxESpace.d.ts +2 -0
  122. package/_types/chains/definitions/confluxESpace.d.ts.map +1 -1
  123. package/_types/chains/definitions/confluxESpaceTestnet.d.ts +34 -0
  124. package/_types/chains/definitions/confluxESpaceTestnet.d.ts.map +1 -0
  125. package/_types/chains/definitions/filecoin.d.ts +6 -0
  126. package/_types/chains/definitions/filecoin.d.ts.map +1 -1
  127. package/_types/chains/definitions/pgn.d.ts +340 -0
  128. package/_types/chains/definitions/pgn.d.ts.map +1 -0
  129. package/_types/chains/definitions/pgnTestnet.d.ts +341 -0
  130. package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -0
  131. package/_types/chains/definitions/sapphire.d.ts +33 -0
  132. package/_types/chains/definitions/sapphire.d.ts.map +1 -0
  133. package/_types/chains/definitions/sapphireTestnet.d.ts +28 -0
  134. package/_types/chains/definitions/sapphireTestnet.d.ts.map +1 -0
  135. package/_types/chains/index.d.ts +5 -0
  136. package/_types/chains/index.d.ts.map +1 -1
  137. package/_types/clients/decorators/public.d.ts +21 -21
  138. package/_types/clients/decorators/wallet.d.ts +3 -3
  139. package/_types/errors/version.d.ts +1 -1
  140. package/_types/errors/version.d.ts.map +1 -1
  141. package/_types/types/contract.d.ts.map +1 -1
  142. package/_types/types/filter.d.ts.map +1 -1
  143. package/_types/types/log.d.ts.map +1 -1
  144. package/_types/types/multicall.d.ts.map +1 -1
  145. package/_types/types/transaction.d.ts.map +1 -1
  146. package/_types/types/typedData.d.ts.map +1 -1
  147. package/_types/types/utils.d.ts.map +1 -1
  148. package/_types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
  149. package/_types/utils/abi/encodeErrorResult.d.ts.map +1 -1
  150. package/_types/utils/abi/encodeEventTopics.d.ts.map +1 -1
  151. package/_types/utils/abi/encodeFunctionData.d.ts.map +1 -1
  152. package/_types/utils/abi/encodeFunctionResult.d.ts.map +1 -1
  153. package/_types/utils/ccip.d.ts.map +1 -1
  154. package/_types/utils/encoding/fromBytes.d.ts.map +1 -1
  155. package/_types/utils/encoding/fromHex.d.ts.map +1 -1
  156. package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
  157. package/_types/utils/ens/namehash.d.ts +1 -1
  158. package/_types/utils/ens/normalize.d.ts +2 -2
  159. package/_types/utils/errors/getNodeError.d.ts.map +1 -1
  160. package/_types/utils/transaction/getSerializedTransactionType.d.ts.map +1 -1
  161. package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
  162. package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
  163. package/accounts/utils/signTransaction.ts +4 -2
  164. package/actions/ens/getEnsAddress.ts +3 -3
  165. package/actions/ens/getEnsAvatar.ts +2 -2
  166. package/actions/ens/getEnsName.ts +2 -2
  167. package/actions/ens/getEnsResolver.ts +2 -2
  168. package/actions/ens/getEnsText.ts +2 -2
  169. package/actions/public/call.ts +1 -1
  170. package/actions/public/createContractEventFilter.ts +11 -9
  171. package/actions/public/estimateMaxPriorityFeePerGas.ts +3 -1
  172. package/actions/public/getBlock.ts +1 -1
  173. package/actions/public/getBlockNumber.ts +1 -1
  174. package/actions/public/getLogs.ts +1 -1
  175. package/actions/public/getTransaction.ts +1 -1
  176. package/actions/public/getTransactionConfirmations.ts +1 -1
  177. package/actions/public/getTransactionReceipt.ts +1 -1
  178. package/actions/public/readContract.ts +1 -1
  179. package/actions/public/simulateContract.ts +1 -1
  180. package/actions/public/verifyHash.ts +1 -1
  181. package/actions/public/verifyMessage.ts +1 -1
  182. package/actions/public/verifyTypedData.ts +1 -1
  183. package/actions/public/waitForTransactionReceipt.ts +1 -1
  184. package/actions/public/watchBlockNumber.ts +1 -1
  185. package/actions/public/watchBlocks.ts +1 -1
  186. package/actions/wallet/deployContract.ts +1 -1
  187. package/actions/wallet/sendRawTransaction.ts +1 -1
  188. package/actions/wallet/sendTransaction.ts +1 -1
  189. package/actions/wallet/writeContract.ts +1 -1
  190. package/chains/celo/serializers.ts +3 -7
  191. package/chains/definitions/confluxESpace.ts +2 -0
  192. package/chains/definitions/confluxESpaceTestnet.ts +31 -0
  193. package/chains/definitions/filecoin.ts +6 -0
  194. package/chains/definitions/pgn.ts +38 -0
  195. package/chains/definitions/pgnTestnet.ts +39 -0
  196. package/chains/definitions/sapphire.ts +30 -0
  197. package/chains/definitions/sapphireTestnet.ts +25 -0
  198. package/chains/index.ts +5 -0
  199. package/clients/decorators/public.ts +21 -21
  200. package/clients/decorators/wallet.ts +3 -3
  201. package/errors/base.ts +2 -2
  202. package/errors/version.ts +1 -1
  203. package/package.json +3 -3
  204. package/types/contract.ts +63 -64
  205. package/types/filter.ts +12 -12
  206. package/types/log.ts +4 -4
  207. package/types/multicall.ts +65 -57
  208. package/types/transaction.ts +4 -4
  209. package/types/typedData.ts +12 -12
  210. package/types/utils.ts +6 -7
  211. package/utils/abi/decodeFunctionResult.ts +2 -2
  212. package/utils/abi/encodeErrorResult.ts +2 -2
  213. package/utils/abi/encodeEventTopics.ts +6 -6
  214. package/utils/abi/encodeFunctionData.ts +2 -2
  215. package/utils/abi/encodeFunctionResult.ts +5 -5
  216. package/utils/ccip.ts +4 -2
  217. package/utils/encoding/fromBytes.ts +8 -8
  218. package/utils/encoding/fromHex.ts +8 -8
  219. package/utils/encoding/toBytes.ts +2 -2
  220. package/utils/ens/avatar/utils.ts +3 -1
  221. package/utils/ens/namehash.ts +1 -1
  222. package/utils/ens/normalize.ts +2 -2
  223. package/utils/errors/getContractError.ts +2 -2
  224. package/utils/errors/getNodeError.ts +12 -11
  225. package/utils/rpc.ts +1 -1
  226. package/utils/transaction/getSerializedTransactionType.ts +2 -2
  227. package/utils/transaction/getTransactionType.ts +2 -1
  228. package/utils/transaction/serializeTransaction.ts +6 -3
@@ -62,7 +62,7 @@ export type GetEnsAddressErrorType =
62
62
  * Gets address for ENS name.
63
63
  *
64
64
  * - Docs: https://viem.sh/docs/ens/actions/getEnsAddress.html
65
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
65
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
66
66
  *
67
67
  * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
68
68
  *
@@ -82,11 +82,11 @@ export type GetEnsAddressErrorType =
82
82
  * transport: http(),
83
83
  * })
84
84
  * const ensAddress = await getEnsAddress(client, {
85
- * name: normalize('wagmi-dev.eth'),
85
+ * name: normalize('wevm.eth'),
86
86
  * })
87
87
  * // '0xd2135CfB216b74109775236E36d4b433F1DF507B'
88
88
  */
89
- export async function getEnsAddress<TChain extends Chain | undefined,>(
89
+ export async function getEnsAddress<TChain extends Chain | undefined>(
90
90
  client: Client<Transport, TChain>,
91
91
  {
92
92
  blockNumber,
@@ -34,7 +34,7 @@ export type GetEnsAvatarErrorType =
34
34
  * Gets the avatar of an ENS name.
35
35
  *
36
36
  * - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar.html
37
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
37
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
38
38
  *
39
39
  * Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText.html) with `key` set to `'avatar'`.
40
40
  *
@@ -54,7 +54,7 @@ export type GetEnsAvatarErrorType =
54
54
  * transport: http(),
55
55
  * })
56
56
  * const ensAvatar = await getEnsAvatar(client, {
57
- * name: normalize('wagmi-dev.eth'),
57
+ * name: normalize('wevm.eth'),
58
58
  * })
59
59
  * // 'https://ipfs.io/ipfs/Qma8mnp6xV3J2cRNf3mTth5C8nV11CAnceVinc3y8jSbio'
60
60
  */
@@ -45,7 +45,7 @@ export type GetEnsNameErrorType =
45
45
  * Gets primary name for specified address.
46
46
  *
47
47
  * - Docs: https://viem.sh/docs/ens/actions/getEnsName.html
48
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
48
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
49
49
  *
50
50
  * Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name.
51
51
  *
@@ -65,7 +65,7 @@ export type GetEnsNameErrorType =
65
65
  * const ensName = await getEnsName(client, {
66
66
  * address: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
67
67
  * })
68
- * // 'wagmi-dev.eth'
68
+ * // 'wevm.eth'
69
69
  */
70
70
  export async function getEnsName<TChain extends Chain | undefined>(
71
71
  client: Client<Transport, TChain>,
@@ -41,7 +41,7 @@ export type GetEnsResolverErrorType =
41
41
  * Gets resolver for ENS name.
42
42
  *
43
43
  * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
44
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
44
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
45
45
  *
46
46
  * Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.
47
47
  *
@@ -61,7 +61,7 @@ export type GetEnsResolverErrorType =
61
61
  * transport: http(),
62
62
  * })
63
63
  * const resolverAddress = await getEnsResolver(client, {
64
- * name: normalize('wagmi-dev.eth'),
64
+ * name: normalize('wevm.eth'),
65
65
  * })
66
66
  * // '0x4976fb03C32e5B8cfe2b6cCB31c09Ba78EBaBa41'
67
67
  */
@@ -60,7 +60,7 @@ export type GetEnsTextErrorType =
60
60
  * Gets a text record for specified ENS name.
61
61
  *
62
62
  * - Docs: https://viem.sh/docs/ens/actions/getEnsResolver.html
63
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/ens
63
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
64
64
  *
65
65
  * Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
66
66
  *
@@ -80,7 +80,7 @@ export type GetEnsTextErrorType =
80
80
  * transport: http(),
81
81
  * })
82
82
  * const twitterRecord = await getEnsText(client, {
83
- * name: normalize('wagmi-dev.eth'),
83
+ * name: normalize('wevm.eth'),
84
84
  * key: 'com.twitter',
85
85
  * })
86
86
  * // 'wagmi_sh'
@@ -244,7 +244,7 @@ export type ScheduleMulticallErrorType =
244
244
  | RawContractErrorType
245
245
  | ErrorType
246
246
 
247
- async function scheduleMulticall<TChain extends Chain | undefined,>(
247
+ async function scheduleMulticall<TChain extends Chain | undefined>(
248
248
  client: Client<Transport>,
249
249
  args: ScheduleMulticallParameters<TChain>,
250
250
  ) {
@@ -48,15 +48,17 @@ export type CreateContractEventFilterParameters<
48
48
  args?: never
49
49
  }
50
50
  : MaybeExtractEventArgsFromAbi<
51
- TAbi,
52
- TEventName
53
- > extends infer TEventFilterArgs
54
- ? {
55
- args?: TEventFilterArgs | (TArgs extends TEventFilterArgs ? TArgs : never)
56
- }
57
- : {
58
- args?: never
59
- })
51
+ TAbi,
52
+ TEventName
53
+ > extends infer TEventFilterArgs
54
+ ? {
55
+ args?:
56
+ | TEventFilterArgs
57
+ | (TArgs extends TEventFilterArgs ? TArgs : never)
58
+ }
59
+ : {
60
+ args?: never
61
+ })
60
62
 
61
63
  export type CreateContractEventFilterReturnType<
62
64
  TAbi extends Abi | readonly unknown[] = Abi,
@@ -89,7 +89,9 @@ export async function internal_estimateMaxPriorityFeePerGas<
89
89
  client,
90
90
  request,
91
91
  } as ChainFeesFnParameters)
92
- } else if (typeof chain?.fees?.defaultPriorityFee !== 'undefined')
92
+ }
93
+
94
+ if (typeof chain?.fees?.defaultPriorityFee !== 'undefined')
93
95
  return chain?.fees?.defaultPriorityFee
94
96
 
95
97
  try {
@@ -66,7 +66,7 @@ export type GetBlockErrorType =
66
66
  * Returns information about a block at a block number, hash, or tag.
67
67
  *
68
68
  * - Docs: https://viem.sh/docs/actions/public/getBlock.html
69
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
69
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
70
70
  * - JSON-RPC Methods:
71
71
  * - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
72
72
  * - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
@@ -26,7 +26,7 @@ export function getBlockNumberCache(id: string) {
26
26
  * Returns the number of the most recent block seen.
27
27
  *
28
28
  * - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html
29
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
29
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
30
30
  * - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
31
31
  *
32
32
  * @param client - Client to use
@@ -119,7 +119,7 @@ export type GetLogsErrorType =
119
119
  * Returns a list of event logs matching the provided parameters.
120
120
  *
121
121
  * - Docs: https://viem.sh/docs/actions/public/getLogs.html
122
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs
122
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs
123
123
  * - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
124
124
  *
125
125
  * @param client - Client to use
@@ -67,7 +67,7 @@ export type GetTransactionErrorType =
67
67
  * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
68
68
  *
69
69
  * - Docs: https://viem.sh/docs/actions/public/getTransaction.html
70
- * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
70
+ * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
71
71
  * - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
72
72
  *
73
73
  * @param client - Client to use
@@ -40,7 +40,7 @@ export type GetTransactionConfirmationsErrorType =
40
40
  * Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
41
41
  *
42
42
  * - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html
43
- * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
43
+ * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
44
44
  * - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
45
45
  *
46
46
  * @param client - Client to use
@@ -31,7 +31,7 @@ export type GetTransactionReceiptErrorType =
31
31
  * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.
32
32
  *
33
33
  * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
34
- * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
34
+ * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
35
35
  * - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)
36
36
  *
37
37
  * @param client - Client to use
@@ -45,7 +45,7 @@ export type ReadContractErrorType = GetContractErrorReturnType<
45
45
  * Calls a read-only function on a contract, and returns the response.
46
46
  *
47
47
  * - Docs: https://viem.sh/docs/contract/readContract.html
48
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts
48
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts
49
49
  *
50
50
  * A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.
51
51
  *
@@ -89,7 +89,7 @@ export type SimulateContractErrorType =
89
89
  * Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
90
90
  *
91
91
  * - Docs: https://viem.sh/docs/contract/simulateContract.html
92
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
92
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
93
93
  *
94
94
  * This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract.html), but also supports contract write functions.
95
95
  *
@@ -48,7 +48,7 @@ export type VerifyHashErrorType =
48
48
  * @param parameters - {@link VerifyHashParameters}
49
49
  * @returns Whether or not the signature is valid. {@link VerifyHashReturnType}
50
50
  */
51
- export async function verifyHash<TChain extends Chain | undefined,>(
51
+ export async function verifyHash<TChain extends Chain | undefined>(
52
52
  client: Client<Transport, TChain>,
53
53
  { address, hash, signature, ...callRequest }: VerifyHashParameters,
54
54
  ): Promise<VerifyHashReturnType> {
@@ -40,7 +40,7 @@ export type VerifyMessageErrorType =
40
40
  * @param parameters - {@link VerifyMessageParameters}
41
41
  * @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}
42
42
  */
43
- export async function verifyMessage<TChain extends Chain | undefined,>(
43
+ export async function verifyMessage<TChain extends Chain | undefined>(
44
44
  client: Client<Transport, TChain>,
45
45
  { address, message, signature, ...callRequest }: VerifyMessageParameters,
46
46
  ): Promise<VerifyMessageReturnType> {
@@ -43,7 +43,7 @@ export type VerifyTypedDataErrorType =
43
43
  * @param parameters - {@link VerifyTypedDataParameters}
44
44
  * @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}
45
45
  */
46
- export async function verifyTypedData<TChain extends Chain | undefined,>(
46
+ export async function verifyTypedData<TChain extends Chain | undefined>(
47
47
  client: Client<Transport, TChain>,
48
48
  {
49
49
  address,
@@ -77,7 +77,7 @@ export type WaitForTransactionReceiptErrorType =
77
77
  * Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.
78
78
  *
79
79
  * - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html
80
- * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
80
+ * - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions
81
81
  * - JSON-RPC Methods:
82
82
  * - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.
83
83
  * - If a Transaction has been replaced:
@@ -56,7 +56,7 @@ export type WatchBlockNumberErrorType = PollErrorType | ErrorType
56
56
  * Watches and returns incoming block numbers.
57
57
  *
58
58
  * - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html
59
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
59
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks
60
60
  * - JSON-RPC Methods:
61
61
  * - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.
62
62
  * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
@@ -80,7 +80,7 @@ export type WatchBlocksErrorType =
80
80
  * Watches and returns information for incoming blocks.
81
81
  *
82
82
  * - Docs: https://viem.sh/docs/actions/public/watchBlocks.html
83
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
83
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/watching-blocks
84
84
  * - JSON-RPC Methods:
85
85
  * - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.
86
86
  * - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
@@ -40,7 +40,7 @@ export type DeployContractErrorType = SendTransactionErrorType | ErrorType
40
40
  * Deploys a contract to the network, given bytecode and constructor arguments.
41
41
  *
42
42
  * - Docs: https://viem.sh/docs/contract/deployContract.html
43
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts
43
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/deploying-contracts
44
44
  *
45
45
  * @param client - Client to use
46
46
  * @param parameters - {@link DeployContractParameters}
@@ -41,7 +41,7 @@ export type SendRawTransactionErrorType = RequestErrorType | ErrorType
41
41
  * serializedTransaction: '0x02f850018203118080825208808080c080a04012522854168b27e5dc3d5839bab5e6b39e1a0ffd343901ce1622e3d64b48f1a04e00902ae0502c4728cbf12156290df99c3ed7de85b1dbfe20b5c36931733a33'
42
42
  * })
43
43
  */
44
- export async function sendRawTransaction<TChain extends Chain | undefined,>(
44
+ export async function sendRawTransaction<TChain extends Chain | undefined>(
45
45
  client: Client<Transport, TChain>,
46
46
  { serializedTransaction }: SendRawTransactionParameters,
47
47
  ): Promise<SendRawTransactionReturnType> {
@@ -80,7 +80,7 @@ export type SendTransactionErrorType =
80
80
  * Creates, signs, and sends a new transaction to the network.
81
81
  *
82
82
  * - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html
83
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
83
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/sending-transactions
84
84
  * - JSON-RPC Methods:
85
85
  * - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
86
86
  * - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
@@ -61,7 +61,7 @@ export type WriteContractErrorType =
61
61
  * Executes a write function on a contract.
62
62
  *
63
63
  * - Docs: https://viem.sh/docs/contract/writeContract.html
64
- * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
64
+ * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
65
65
  *
66
66
  * A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms.html) is needed to be broadcast in order to change the state.
67
67
  *
@@ -27,13 +27,9 @@ import { isCIP42, isCIP64, isEmpty, isPresent } from './utils.js'
27
27
  export const serializeTransactionCelo: SerializeTransactionFn<
28
28
  CeloTransactionSerializable | TransactionSerializable
29
29
  > = (tx, signature) => {
30
- if (isCIP64(tx)) {
31
- return serializeTransactionCIP64(tx, signature)
32
- } else if (isCIP42(tx)) {
33
- return serializeTransactionCIP42(tx, signature)
34
- } else {
35
- return serializeTransaction(tx as TransactionSerializable, signature)
36
- }
30
+ if (isCIP64(tx)) return serializeTransactionCIP64(tx, signature)
31
+ if (isCIP42(tx)) return serializeTransactionCIP42(tx, signature)
32
+ return serializeTransaction(tx as TransactionSerializable, signature)
37
33
  }
38
34
 
39
35
  export const serializersCelo = {
@@ -8,9 +8,11 @@ export const confluxESpace = /*#__PURE__*/ defineChain({
8
8
  rpcUrls: {
9
9
  default: {
10
10
  http: ['https://evm.confluxrpc.org'],
11
+ webSocket: ['wss://evm.confluxrpc.org/ws'],
11
12
  },
12
13
  public: {
13
14
  http: ['https://evm.confluxrpc.org'],
15
+ webSocket: ['wss://evm.confluxrpc.org/ws'],
14
16
  },
15
17
  },
16
18
  blockExplorers: {
@@ -0,0 +1,31 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const confluxESpaceTestnet = /*#__PURE__*/ defineChain({
4
+ id: 71,
5
+ name: 'Conflux eSpace Testnet',
6
+ network: 'cfx-espace-testnet',
7
+ testnet: true,
8
+ nativeCurrency: { name: 'Conflux', symbol: 'CFX', decimals: 18 },
9
+ rpcUrls: {
10
+ default: {
11
+ http: ['https://evmtestnet.confluxrpc.org'],
12
+ webSocket: ['wss://evmtestnet.confluxrpc.org/ws'],
13
+ },
14
+ public: {
15
+ http: ['https://evmtestnet.confluxrpc.org'],
16
+ webSocket: ['wss://evmtestnet.confluxrpc.org/ws'],
17
+ },
18
+ },
19
+ blockExplorers: {
20
+ default: {
21
+ name: 'ConfluxScan',
22
+ url: 'https://evmtestnet.confluxscan.io',
23
+ },
24
+ },
25
+ contracts: {
26
+ multicall3: {
27
+ address: '0xEFf0078910f638cd81996cc117bccD3eDf2B072F',
28
+ blockCreated: 117499050,
29
+ },
30
+ },
31
+ })
@@ -19,4 +19,10 @@ export const filecoin = /*#__PURE__*/ defineChain({
19
19
  filscout: { name: 'Filscout', url: 'https://filscout.io/en' },
20
20
  glif: { name: 'Glif', url: 'https://explorer.glif.io' },
21
21
  },
22
+ contracts: {
23
+ multicall3: {
24
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
25
+ blockCreated: 3328594,
26
+ },
27
+ },
22
28
  })
@@ -0,0 +1,38 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+ import { formattersOptimism } from '../optimism/formatters.js'
3
+
4
+ export const pgn = /*#__PURE__*/ defineChain(
5
+ {
6
+ id: 424,
7
+ network: 'pgn',
8
+ name: 'PGN',
9
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
10
+ rpcUrls: {
11
+ default: {
12
+ http: ['https://rpc.publicgoods.network'],
13
+ },
14
+ public: {
15
+ http: ['https://rpc.publicgoods.network'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'PGN Explorer',
21
+ url: 'https://explorer.publicgoods.network',
22
+ },
23
+ blocksout: {
24
+ name: 'PGN Explorer',
25
+ url: 'https://explorer.publicgoods.network',
26
+ },
27
+ },
28
+ contracts: {
29
+ multicall3: {
30
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
31
+ blockCreated: 3380209,
32
+ },
33
+ },
34
+ },
35
+ {
36
+ formatters: formattersOptimism,
37
+ },
38
+ )
@@ -0,0 +1,39 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+ import { formattersOptimism } from '../optimism/formatters.js'
3
+
4
+ export const pgnTestnet = /*#__PURE__*/ defineChain(
5
+ {
6
+ id: 58008,
7
+ network: 'pgn-testnet',
8
+ name: 'PGN ',
9
+ nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
10
+ rpcUrls: {
11
+ default: {
12
+ http: ['https://sepolia.publicgoods.network'],
13
+ },
14
+ public: {
15
+ http: ['https://sepolia.publicgoods.network'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'PGN Testnet Explorer',
21
+ url: 'https://explorer.sepolia.publicgoods.network',
22
+ },
23
+ blocksout: {
24
+ name: 'PGN Testnet Explorer',
25
+ url: 'https://explorer.sepolia.publicgoods.network',
26
+ },
27
+ },
28
+ contracts: {
29
+ multicall3: {
30
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
31
+ blockCreated: 3754925,
32
+ },
33
+ },
34
+ testnet: true,
35
+ },
36
+ {
37
+ formatters: formattersOptimism,
38
+ },
39
+ )
@@ -0,0 +1,30 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const sapphire = /*#__PURE__*/ defineChain({
4
+ id: 23294,
5
+ name: 'Oasis Sapphire',
6
+ network: 'sapphire',
7
+ nativeCurrency: { name: 'Sapphire Rose', symbol: 'ROSE', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://sapphire.oasis.io'],
11
+ webSocket: ['wss://sapphire.oasis.io/ws'],
12
+ },
13
+ public: {
14
+ http: ['https://sapphire.oasis.io'],
15
+ webSocket: ['wss://sapphire.oasis.io/ws'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'Oasis Sapphire Explorer',
21
+ url: 'https://explorer.sapphire.oasis.io',
22
+ },
23
+ },
24
+ contracts: {
25
+ multicall3: {
26
+ address: '0xcA11bde05977b3631167028862bE2a173976CA11',
27
+ blockCreated: 734531,
28
+ },
29
+ },
30
+ })
@@ -0,0 +1,25 @@
1
+ import { defineChain } from '../../utils/chain/defineChain.js'
2
+
3
+ export const sapphireTestnet = /*#__PURE__*/ defineChain({
4
+ id: 23295,
5
+ name: 'Oasis Sapphire Testnet',
6
+ network: 'sapphire-testnet',
7
+ nativeCurrency: { name: 'Sapphire Test Rose', symbol: 'TEST', decimals: 18 },
8
+ rpcUrls: {
9
+ default: {
10
+ http: ['https://testnet.sapphire.oasis.dev'],
11
+ webSocket: ['wss://testnet.sapphire.oasis.dev/ws'],
12
+ },
13
+ public: {
14
+ http: ['https://testnet.sapphire.oasis.dev'],
15
+ webSocket: ['wss://testnet.sapphire.oasis.dev/ws'],
16
+ },
17
+ },
18
+ blockExplorers: {
19
+ default: {
20
+ name: 'Oasis Sapphire Testnet Explorer',
21
+ url: 'https://testnet.explorer.sapphire.oasis.dev',
22
+ },
23
+ },
24
+ testnet: true,
25
+ })
package/chains/index.ts CHANGED
@@ -29,6 +29,7 @@ export { chiliz } from './definitions/chiliz.js'
29
29
  export { celoCannoli } from './definitions/celoCannoli.js'
30
30
  export { classic } from './definitions/classic.js'
31
31
  export { confluxESpace } from './definitions/confluxESpace.js'
32
+ export { confluxESpaceTestnet } from './definitions/confluxESpaceTestnet.js'
32
33
  export { coreDao } from './definitions/coreDao.js'
33
34
  export { cronos } from './definitions/cronos.js'
34
35
  export { cronosTestnet } from './definitions/cronosTestnet.js'
@@ -102,6 +103,8 @@ export { optimismGoerli } from './definitions/optimismGoerli.js'
102
103
  export { optimismSepolia } from './definitions/optimismSepolia.js'
103
104
  export { opBNB } from './definitions/opBNB.js'
104
105
  export { opBNBTestnet } from './definitions/opBNBTestnet.js'
106
+ export { pgn } from './definitions/pgn.js'
107
+ export { pgnTestnet } from './definitions/pgnTestnet.js'
105
108
  export { plinga } from './definitions/plinga.js'
106
109
  export { polygon } from './definitions/polygon.js'
107
110
  export { polygonMumbai } from './definitions/polygonMumbai.js'
@@ -116,6 +119,8 @@ export { rolluxTestnet } from './definitions/rolluxTestnet.js'
116
119
  export { ronin } from './definitions/ronin.js'
117
120
  export { rootstock } from './definitions/rootstock.js'
118
121
  export { saigon } from './definitions/saigon.js'
122
+ export { sapphire } from './definitions/sapphire.js'
123
+ export { sapphireTestnet } from './definitions/sapphireTestnet.js'
119
124
  export { scroll } from './definitions/scroll.js'
120
125
  export { scrollSepolia } from './definitions/scrollSepolia.js'
121
126
  export { scrollTestnet } from './definitions/scrollTestnet.js'