viem 0.3.34 → 0.3.36

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 (88) hide show
  1. package/LICENSE +1 -1
  2. package/dist/cjs/actions/public/estimateGas.js +3 -2
  3. package/dist/cjs/actions/public/estimateGas.js.map +1 -1
  4. package/dist/cjs/errors/rpc.js +8 -2
  5. package/dist/cjs/errors/rpc.js.map +1 -1
  6. package/dist/cjs/errors/version.js +1 -1
  7. package/dist/cjs/index.js.map +1 -1
  8. package/dist/cjs/types/eip1193.js +3 -3
  9. package/dist/cjs/types/eip1193.js.map +1 -1
  10. package/dist/cjs/utils/buildRequest.js.map +1 -1
  11. package/dist/esm/actions/public/estimateGas.js +3 -2
  12. package/dist/esm/actions/public/estimateGas.js.map +1 -1
  13. package/dist/esm/errors/rpc.js +8 -2
  14. package/dist/esm/errors/rpc.js.map +1 -1
  15. package/dist/esm/errors/version.js +1 -1
  16. package/dist/esm/index.js.map +1 -1
  17. package/dist/esm/types/eip1193.js +1 -1
  18. package/dist/esm/types/eip1193.js.map +1 -1
  19. package/dist/esm/utils/buildRequest.js.map +1 -1
  20. package/dist/types/actions/public/createBlockFilter.d.ts +1 -1
  21. package/dist/types/actions/public/createContractEventFilter.d.ts +1 -1
  22. package/dist/types/actions/public/createEventFilter.d.ts +1 -1
  23. package/dist/types/actions/public/createPendingTransactionFilter.d.ts +1 -1
  24. package/dist/types/actions/public/estimateContractGas.d.ts +1 -1
  25. package/dist/types/actions/public/estimateGas.d.ts.map +1 -1
  26. package/dist/types/actions/public/getFilterChanges.d.ts +4 -4
  27. package/dist/types/actions/public/getTransaction.d.ts +1 -1
  28. package/dist/types/actions/public/getTransactionCount.d.ts +1 -1
  29. package/dist/types/actions/public/getTransactionReceipt.d.ts +1 -1
  30. package/dist/types/actions/public/multicall.d.ts +1 -1
  31. package/dist/types/actions/public/readContract.d.ts +2 -2
  32. package/dist/types/actions/public/readContract.d.ts.map +1 -1
  33. package/dist/types/actions/public/simulateContract.d.ts +2 -2
  34. package/dist/types/actions/public/uninstallFilter.d.ts +3 -3
  35. package/dist/types/actions/public/watchContractEvent.d.ts +1 -1
  36. package/dist/types/actions/public/watchEvent.d.ts +2 -2
  37. package/dist/types/actions/test/setBlockTimestampInterval.d.ts +1 -1
  38. package/dist/types/actions/test/stopImpersonatingAccount.d.ts +1 -1
  39. package/dist/types/actions/wallet/deployContract.d.ts +1 -1
  40. package/dist/types/actions/wallet/signMessage.d.ts +2 -2
  41. package/dist/types/actions/wallet/writeContract.d.ts +3 -3
  42. package/dist/types/clients/createPublicClient.d.ts +1 -1
  43. package/dist/types/clients/createTestClient.d.ts +2 -2
  44. package/dist/types/clients/createWalletClient.d.ts +2 -2
  45. package/dist/types/clients/decorators/public.d.ts +22 -22
  46. package/dist/types/clients/decorators/test.d.ts +2 -2
  47. package/dist/types/clients/decorators/wallet.d.ts +6 -6
  48. package/dist/types/errors/rpc.d.ts +12 -8
  49. package/dist/types/errors/rpc.d.ts.map +1 -1
  50. package/dist/types/errors/version.d.ts +1 -1
  51. package/dist/types/index.d.ts +3 -3
  52. package/dist/types/index.d.ts.map +1 -1
  53. package/dist/types/types/eip1193.d.ts +7 -8
  54. package/dist/types/types/eip1193.d.ts.map +1 -1
  55. package/dist/types/utils/buildRequest.d.ts.map +1 -1
  56. package/package.json +1 -1
  57. package/src/actions/public/createBlockFilter.ts +1 -1
  58. package/src/actions/public/createContractEventFilter.ts +1 -1
  59. package/src/actions/public/createEventFilter.ts +1 -1
  60. package/src/actions/public/createPendingTransactionFilter.ts +1 -1
  61. package/src/actions/public/estimateContractGas.ts +1 -1
  62. package/src/actions/public/estimateGas.ts +3 -2
  63. package/src/actions/public/getFilterChanges.ts +4 -4
  64. package/src/actions/public/getTransaction.ts +1 -1
  65. package/src/actions/public/getTransactionCount.ts +1 -1
  66. package/src/actions/public/getTransactionReceipt.ts +1 -1
  67. package/src/actions/public/multicall.ts +1 -1
  68. package/src/actions/public/readContract.ts +2 -2
  69. package/src/actions/public/simulateContract.ts +2 -2
  70. package/src/actions/public/uninstallFilter.ts +3 -3
  71. package/src/actions/public/watchContractEvent.ts +1 -1
  72. package/src/actions/public/watchEvent.ts +2 -2
  73. package/src/actions/test/setBlockTimestampInterval.ts +1 -1
  74. package/src/actions/test/stopImpersonatingAccount.ts +1 -1
  75. package/src/actions/wallet/deployContract.ts +1 -1
  76. package/src/actions/wallet/signMessage.ts +2 -2
  77. package/src/actions/wallet/writeContract.ts +3 -3
  78. package/src/clients/createPublicClient.ts +1 -1
  79. package/src/clients/createTestClient.ts +2 -2
  80. package/src/clients/createWalletClient.ts +2 -2
  81. package/src/clients/decorators/public.ts +22 -22
  82. package/src/clients/decorators/test.ts +2 -2
  83. package/src/clients/decorators/wallet.ts +6 -6
  84. package/src/errors/rpc.ts +43 -15
  85. package/src/errors/version.ts +1 -1
  86. package/src/index.ts +24 -2
  87. package/src/types/eip1193.ts +10 -13
  88. package/src/utils/buildRequest.ts +5 -1
@@ -52,7 +52,7 @@ export type CreateContractEventFilterReturnType<
52
52
  > = Filter<'event', TAbi, TEventName, TArgs>
53
53
 
54
54
  /**
55
- * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).
55
+ * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html).
56
56
  *
57
57
  * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
58
58
  *
@@ -63,7 +63,7 @@ export type CreateEventFilterReturnType<
63
63
  > = Prettify<Filter<'event', TAbi, TEventName, TArgs>>
64
64
 
65
65
  /**
66
- * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
66
+ * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
67
67
  *
68
68
  * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
69
69
  * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
@@ -7,7 +7,7 @@ import { createFilterRequestScope } from '../../utils/filters/createFilterReques
7
7
  export type CreatePendingTransactionFilterReturnType = Filter<'transaction'>
8
8
 
9
9
  /**
10
- * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
10
+ * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
11
11
  *
12
12
  * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
13
13
  * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
@@ -29,7 +29,7 @@ export type EstimateContractGasReturnType = bigint
29
29
  *
30
30
  * - Docs: https://viem.sh/docs/contract/estimateContractGas.html
31
31
  *
32
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
32
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
33
33
  *
34
34
  * @param client - Client to use
35
35
  * @param parameters - {@link EstimateContractGasParameters}
@@ -86,11 +86,12 @@ export async function estimateGas<
86
86
  | WalletClient<Transport, TChain, TAccount>,
87
87
  args: EstimateGasParameters<TChain, TAccount>,
88
88
  ): Promise<EstimateGasReturnType> {
89
- if (!args.account)
89
+ const account_ = args.account ?? (client as WalletClient).account
90
+ if (!account_)
90
91
  throw new AccountNotFoundError({
91
92
  docsPath: '/docs/actions/public/estimateGas',
92
93
  })
93
- const account = parseAccount(args.account)
94
+ const account = parseAccount(account_)
94
95
 
95
96
  try {
96
97
  const {
@@ -38,10 +38,10 @@ export type GetFilterChangesReturnType<
38
38
  *
39
39
  * A Filter can be created from the following actions:
40
40
  *
41
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
42
- * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
43
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
44
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
41
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
42
+ * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
43
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
44
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
45
45
  *
46
46
  * Depending on the type of filter, the return value will be different:
47
47
  *
@@ -54,7 +54,7 @@ export type GetTransactionReturnType<TChain extends Chain | undefined = Chain> =
54
54
  FormattedTransaction<TransactionFormatter<TChain>>
55
55
 
56
56
  /**
57
- * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
57
+ * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
58
58
  *
59
59
  * - Docs: https://viem.sh/docs/actions/public/getTransaction.html
60
60
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -27,7 +27,7 @@ export type GetTransactionCountParameters = {
27
27
  export type GetTransactionCountReturnType = number
28
28
 
29
29
  /**
30
- * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
30
+ * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
31
31
  *
32
32
  * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
33
33
  * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
@@ -20,7 +20,7 @@ export type GetTransactionReceiptReturnType<
20
20
  > = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>
21
21
 
22
22
  /**
23
- * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
23
+ * 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.
24
24
  *
25
25
  * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
26
26
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -41,7 +41,7 @@ export type MulticallReturnType<
41
41
  > = MulticallResults<TContracts, TAllowFailure>
42
42
 
43
43
  /**
44
- * Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
44
+ * Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
45
45
  *
46
46
  * - Docs: https://viem.sh/docs/contract/multicall.html
47
47
  *
@@ -23,7 +23,7 @@ import { type CallParameters, call } from './call.js'
23
23
  export type ReadContractParameters<
24
24
  TAbi extends Abi | readonly unknown[] = Abi,
25
25
  TFunctionName extends string = string,
26
- > = Pick<CallParameters, 'blockNumber' | 'blockTag'> &
26
+ > = Pick<CallParameters, 'account' | 'blockNumber' | 'blockTag'> &
27
27
  ContractFunctionConfig<TAbi, TFunctionName, 'view' | 'pure'>
28
28
 
29
29
  export type ReadContractReturnType<
@@ -39,7 +39,7 @@ export type ReadContractReturnType<
39
39
  *
40
40
  * 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.
41
41
  *
42
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
42
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
43
43
  *
44
44
  * @param client - Client to use
45
45
  * @param parameters - {@link ReadContractParameters}
@@ -68,9 +68,9 @@ export type SimulateContractReturnType<
68
68
  * - Docs: https://viem.sh/docs/contract/simulateContract.html
69
69
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
70
70
  *
71
- * 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), but also supports contract write functions.
71
+ * 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.
72
72
  *
73
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
73
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
74
74
  *
75
75
  * @param client - Client to use
76
76
  * @param parameters - {@link SimulateContractParameters}
@@ -15,9 +15,9 @@ export type UninstallFilterReturnType = boolean
15
15
  * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
16
16
  *
17
17
  * Destroys a Filter that was created from one of the following Actions:
18
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
19
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
20
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
18
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
19
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
20
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
21
21
  *
22
22
  * @param client - Client to use
23
23
  * @param parameters - {@link UninstallFilterParameters}
@@ -64,7 +64,7 @@ export type WatchContractEventReturnType = () => void
64
64
  *
65
65
  * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs).
66
66
  *
67
- * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
67
+ * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
68
68
  *
69
69
  * @param client - Client to use
70
70
  * @param parameters - {@link WatchContractEventParameters}
@@ -62,7 +62,7 @@ export type WatchEventParameters<
62
62
  export type WatchEventReturnType = () => void
63
63
 
64
64
  /**
65
- * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
65
+ * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
66
66
  *
67
67
  * - Docs: https://viem.sh/docs/actions/public/watchEvent.html
68
68
  * - JSON-RPC Methods:
@@ -74,7 +74,7 @@ export type WatchEventReturnType = () => void
74
74
  *
75
75
  * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs).
76
76
  *
77
- * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
77
+ * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.
78
78
  *
79
79
  * @param client - Client to use
80
80
  * @param parameters - {@link WatchEventParameters}
@@ -11,7 +11,7 @@ export type SetBlockTimestampIntervalParameters = {
11
11
  }
12
12
 
13
13
  /**
14
- * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
14
+ * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime.html), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
15
15
  *
16
16
  * - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
17
17
  *
@@ -13,7 +13,7 @@ export type StopImpersonatingAccountParameters = {
13
13
  }
14
14
 
15
15
  /**
16
- * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
16
+ * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
17
17
  *
18
18
  * - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
19
19
  *
@@ -38,7 +38,7 @@ export type DeployContractReturnType = SendTransactionReturnType
38
38
  *
39
39
  * @param client - Client to use
40
40
  * @param parameters - {@link DeployContractParameters}
41
- * @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}
41
+ * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
42
42
  *
43
43
  * @example
44
44
  * import { createWalletClient, http } from 'viem'
@@ -25,8 +25,8 @@ export type SignMessageReturnType = Hex
25
25
  * - Local Accounts: Signs locally. No JSON-RPC request.
26
26
  *
27
27
  * With the calculated signature, you can:
28
- * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
29
- * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
28
+ * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
29
+ * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
30
30
  *
31
31
  * @param client - Client to use
32
32
  * @param parameters - {@link SignMessageParameters}
@@ -42,15 +42,15 @@ export type WriteContractReturnType = SendTransactionReturnType
42
42
  * - Docs: https://viem.sh/docs/contract/writeContract.html
43
43
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
44
44
  *
45
- * 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) is needed to be broadcast in order to change the state.
45
+ * 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.
46
46
  *
47
- * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
47
+ * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
48
48
  *
49
49
  * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__
50
50
  *
51
51
  * @param client - Client to use
52
52
  * @param parameters - {@link WriteContractParameters}
53
- * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
53
+ * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}
54
54
  *
55
55
  * @example
56
56
  * import { createWalletClient, custom, parseAbi } from 'viem'
@@ -38,7 +38,7 @@ export type PublicClient<
38
38
  >
39
39
 
40
40
  /**
41
- * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
41
+ * Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
42
42
  *
43
43
  * - Docs: https://viem.sh/docs/clients/public.html
44
44
  *
@@ -33,11 +33,11 @@ export type TestClient<
33
33
  * @description Creates a test client with a given transport.
34
34
  */
35
35
  /**
36
- * Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
36
+ * Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
37
37
  *
38
38
  * - Docs: https://viem.sh/docs/clients/test.html
39
39
  *
40
- * A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction).
40
+ * A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction.html).
41
41
  *
42
42
  * @param config - {@link TestClientConfig}
43
43
  * @returns A Test Client. {@link TestClient}
@@ -41,11 +41,11 @@ export type WalletClient<
41
41
  >
42
42
 
43
43
  /**
44
- * Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
44
+ * Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro.html) configured for a [Chain](https://viem.sh/docs/clients/chains.html).
45
45
  *
46
46
  * - Docs: https://viem.sh/docs/clients/wallet.html
47
47
  *
48
- * A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction).
48
+ * A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction.html).
49
49
  *
50
50
  * The Wallet Client supports signing over:
51
51
  * - [JSON-RPC Accounts](https://viem.sh/docs/clients/wallet.html#json-rpc-accounts) (e.g. Browser Extension Wallets, WalletConnect, etc).
@@ -234,7 +234,7 @@ export type PublicActions<
234
234
  */
235
235
  call: (parameters: CallParameters<TChain>) => Promise<CallReturnType>
236
236
  /**
237
- * Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
237
+ * Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
238
238
  *
239
239
  * - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html
240
240
  * - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
@@ -254,7 +254,7 @@ export type PublicActions<
254
254
  */
255
255
  createBlockFilter: () => Promise<CreateBlockFilterReturnType>
256
256
  /**
257
- * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).
257
+ * Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs.html).
258
258
  *
259
259
  * - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
260
260
  *
@@ -281,7 +281,7 @@ export type PublicActions<
281
281
  args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>,
282
282
  ) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>
283
283
  /**
284
- * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
284
+ * Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
285
285
  *
286
286
  * - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
287
287
  * - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
@@ -310,7 +310,7 @@ export type PublicActions<
310
310
  args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>,
311
311
  ) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>
312
312
  /**
313
- * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
313
+ * Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
314
314
  *
315
315
  * - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
316
316
  * - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
@@ -335,7 +335,7 @@ export type PublicActions<
335
335
  * - Docs: https://viem.sh/docs/contract/estimateContractGas.html
336
336
  *
337
337
  * @remarks
338
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
338
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
339
339
  *
340
340
  * @param args - {@link EstimateContractGasParameters}
341
341
  * @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
@@ -719,10 +719,10 @@ export type PublicActions<
719
719
  * @remarks
720
720
  * A Filter can be created from the following actions:
721
721
  *
722
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
723
- * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
724
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
725
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
722
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
723
+ * - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
724
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
725
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
726
726
  *
727
727
  * Depending on the type of filter, the return value will be different:
728
728
  *
@@ -896,7 +896,7 @@ export type PublicActions<
896
896
  args: GetStorageAtParameters,
897
897
  ) => Promise<GetStorageAtReturnType>
898
898
  /**
899
- * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
899
+ * Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
900
900
  *
901
901
  * - Docs: https://viem.sh/docs/actions/public/getTransaction.html
902
902
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -946,7 +946,7 @@ export type PublicActions<
946
946
  args: GetTransactionConfirmationsParameters<TChain>,
947
947
  ) => Promise<GetTransactionConfirmationsReturnType>
948
948
  /**
949
- * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
949
+ * Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
950
950
  *
951
951
  * - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
952
952
  * - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
@@ -970,7 +970,7 @@ export type PublicActions<
970
970
  args: GetTransactionCountParameters,
971
971
  ) => Promise<GetTransactionCountReturnType>
972
972
  /**
973
- * Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
973
+ * 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.
974
974
  *
975
975
  * - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
976
976
  * - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
@@ -995,7 +995,7 @@ export type PublicActions<
995
995
  args: GetTransactionReceiptParameters,
996
996
  ) => Promise<GetTransactionReceiptReturnType<TChain>>
997
997
  /**
998
- * Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
998
+ * Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
999
999
  *
1000
1000
  * - Docs: https://viem.sh/docs/contract/multicall.html
1001
1001
  *
@@ -1046,7 +1046,7 @@ export type PublicActions<
1046
1046
  * @remarks
1047
1047
  * 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.
1048
1048
  *
1049
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
1049
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
1050
1050
  *
1051
1051
  * @param args - {@link ReadContractParameters}
1052
1052
  * @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
@@ -1081,9 +1081,9 @@ export type PublicActions<
1081
1081
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
1082
1082
  *
1083
1083
  * @remarks
1084
- * 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), but also supports contract write functions.
1084
+ * 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.
1085
1085
  *
1086
- * Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
1086
+ * Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
1087
1087
  *
1088
1088
  * @param args - {@link SimulateContractParameters}
1089
1089
  * @returns The simulation result and write request. {@link SimulateContractReturnType}
@@ -1127,9 +1127,9 @@ export type PublicActions<
1127
1127
  /**
1128
1128
  * Destroys a Filter that was created from one of the following Actions:
1129
1129
  *
1130
- * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
1131
- * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
1132
- * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
1130
+ * - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
1131
+ * - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
1132
+ * - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
1133
1133
  *
1134
1134
  * - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
1135
1135
  * - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
@@ -1252,7 +1252,7 @@ export type PublicActions<
1252
1252
  * @remarks
1253
1253
  * This Action will batch up all the event logs found within the [`pollingInterval`](https://viem.sh/docs/contract/watchContractEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/contract/watchContractEvent.html#onLogs).
1254
1254
  *
1255
- * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
1255
+ * `watchContractEvent` will attempt to create an [Event Filter](https://viem.sh/docs/contract/createContractEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchContractEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.
1256
1256
  *
1257
1257
  * @param args - {@link WatchContractEventParameters}
1258
1258
  * @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}
@@ -1280,7 +1280,7 @@ export type PublicActions<
1280
1280
  args: WatchContractEventParameters<TAbi, TEventName>,
1281
1281
  ) => WatchContractEventReturnType
1282
1282
  /**
1283
- * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
1283
+ * Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
1284
1284
  *
1285
1285
  * - Docs: https://viem.sh/docs/actions/public/watchEvent.html
1286
1286
  * - JSON-RPC Methods:
@@ -1293,7 +1293,7 @@ export type PublicActions<
1293
1293
  * @remarks
1294
1294
  * This Action will batch up all the Event Logs found within the [`pollingInterval`](https://viem.sh/docs/actions/public/watchEvent.html#pollinginterval-optional), and invoke them via [`onLogs`](https://viem.sh/docs/actions/public/watchEvent.html#onLogs).
1295
1295
  *
1296
- * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs) instead.
1296
+ * `watchEvent` will attempt to create an [Event Filter](https://viem.sh/docs/actions/public/createEventFilter.html) and listen to changes to the Filter per polling interval, however, if the RPC Provider does not support Filters (e.g. `eth_newFilter`), then `watchEvent` will fall back to using [`getLogs`](https://viem.sh/docs/actions/public/getLogs.html) instead.
1297
1297
  *
1298
1298
  * @param args - {@link WatchEventParameters}
1299
1299
  * @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}
@@ -390,7 +390,7 @@ export type TestActions = {
390
390
  */
391
391
  setBlockGasLimit: (args: SetBlockGasLimitParameters) => Promise<void>
392
392
  /**
393
- * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
393
+ * Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime.html), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
394
394
  *
395
395
  * - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
396
396
  *
@@ -641,7 +641,7 @@ export type TestActions = {
641
641
  */
642
642
  snapshot: () => Promise<Quantity>
643
643
  /**
644
- * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
644
+ * Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
645
645
  *
646
646
  * - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
647
647
  *
@@ -93,7 +93,7 @@ export type WalletActions<
93
93
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts
94
94
  *
95
95
  * @param args - {@link DeployContractParameters}
96
- * @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}
96
+ * @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
97
97
  *
98
98
  * @example
99
99
  * import { createWalletClient, http } from 'viem'
@@ -276,8 +276,8 @@ export type WalletActions<
276
276
  * - Local Accounts: Signs locally. No JSON-RPC request.
277
277
  *
278
278
  * With the calculated signature, you can:
279
- * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
280
- * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
279
+ * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
280
+ * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
281
281
  *
282
282
  * @param args - {@link SignMessageParameters}
283
283
  * @returns The signed message. {@link SignMessageReturnType}
@@ -467,14 +467,14 @@ export type WalletActions<
467
467
  * - Docs: https://viem.sh/docs/contract/writeContract.html
468
468
  * - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
469
469
  *
470
- * 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) is needed to be broadcast in order to change the state.
470
+ * 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.
471
471
  *
472
- * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
472
+ * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet.html) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
473
473
  *
474
474
  * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract.html#usage) before you execute it.__
475
475
  *
476
476
  * @param args - {@link WriteContractParameters}
477
- * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
477
+ * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}
478
478
  *
479
479
  * @example
480
480
  * import { createWalletClient, custom, parseAbi } from 'viem'