viem 0.0.0-main.20230523T022129 → 0.0.0-main.20230523T094945
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.
- package/dist/cjs/errors/version.js +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/types/actions/public/createBlockFilter.d.ts +1 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +1 -1
- package/dist/types/actions/public/createEventFilter.d.ts +1 -1
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +4 -4
- package/dist/types/actions/public/getTransaction.d.ts +1 -1
- package/dist/types/actions/public/getTransactionCount.d.ts +1 -1
- package/dist/types/actions/public/getTransactionReceipt.d.ts +1 -1
- package/dist/types/actions/public/multicall.d.ts +1 -1
- package/dist/types/actions/public/readContract.d.ts +1 -1
- package/dist/types/actions/public/simulateContract.d.ts +2 -2
- package/dist/types/actions/public/uninstallFilter.d.ts +3 -3
- package/dist/types/actions/public/watchContractEvent.d.ts +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +2 -2
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +1 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +1 -1
- package/dist/types/actions/wallet/deployContract.d.ts +1 -1
- package/dist/types/actions/wallet/signMessage.d.ts +2 -2
- package/dist/types/actions/wallet/writeContract.d.ts +3 -3
- package/dist/types/clients/createPublicClient.d.ts +1 -1
- package/dist/types/clients/createTestClient.d.ts +2 -2
- package/dist/types/clients/createWalletClient.d.ts +2 -2
- package/dist/types/clients/decorators/public.d.ts +22 -22
- package/dist/types/clients/decorators/test.d.ts +2 -2
- package/dist/types/clients/decorators/wallet.d.ts +6 -6
- package/dist/types/errors/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/public/createBlockFilter.ts +1 -1
- package/src/actions/public/createContractEventFilter.ts +1 -1
- package/src/actions/public/createEventFilter.ts +1 -1
- package/src/actions/public/createPendingTransactionFilter.ts +1 -1
- package/src/actions/public/estimateContractGas.ts +1 -1
- package/src/actions/public/getFilterChanges.ts +4 -4
- package/src/actions/public/getTransaction.ts +1 -1
- package/src/actions/public/getTransactionCount.ts +1 -1
- package/src/actions/public/getTransactionReceipt.ts +1 -1
- package/src/actions/public/multicall.ts +1 -1
- package/src/actions/public/readContract.ts +1 -1
- package/src/actions/public/simulateContract.ts +2 -2
- package/src/actions/public/uninstallFilter.ts +3 -3
- package/src/actions/public/watchContractEvent.ts +1 -1
- package/src/actions/public/watchEvent.ts +2 -2
- package/src/actions/test/setBlockTimestampInterval.ts +1 -1
- package/src/actions/test/stopImpersonatingAccount.ts +1 -1
- package/src/actions/wallet/deployContract.ts +1 -1
- package/src/actions/wallet/signMessage.ts +2 -2
- package/src/actions/wallet/writeContract.ts +3 -3
- package/src/clients/createPublicClient.ts +1 -1
- package/src/clients/createTestClient.ts +2 -2
- package/src/clients/createWalletClient.ts +2 -2
- package/src/clients/decorators/public.ts +22 -22
- package/src/clients/decorators/test.ts +2 -2
- package/src/clients/decorators/wallet.ts +6 -6
- package/src/errors/version.ts +1 -1
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20230523T094945';
|
2
2
|
//# sourceMappingURL=version.js.map
|
@@ -4,7 +4,7 @@ import type { Chain } from '../../types/chain.js';
|
|
4
4
|
import type { Filter } from '../../types/filter.js';
|
5
5
|
export type CreateBlockFilterReturnType = Filter<'block'>;
|
6
6
|
/**
|
7
|
-
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
7
|
+
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
8
8
|
*
|
9
9
|
* - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html
|
10
10
|
* - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
|
@@ -20,7 +20,7 @@ export type CreateContractEventFilterParameters<TAbi extends Abi | readonly unkn
|
|
20
20
|
});
|
21
21
|
export type CreateContractEventFilterReturnType<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Filter<'event', TAbi, TEventName, TArgs>;
|
22
22
|
/**
|
23
|
-
* 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).
|
23
|
+
* 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).
|
24
24
|
*
|
25
25
|
* - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
|
26
26
|
*
|
@@ -25,7 +25,7 @@ export type CreateEventFilterParameters<TAbiEvent extends AbiEvent | undefined =
|
|
25
25
|
});
|
26
26
|
export type CreateEventFilterReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Prettify<Filter<'event', TAbi, TEventName, TArgs>>;
|
27
27
|
/**
|
28
|
-
* 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).
|
28
|
+
* 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).
|
29
29
|
*
|
30
30
|
* - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
|
31
31
|
* - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
|
@@ -4,7 +4,7 @@ import type { Chain } from '../../types/chain.js';
|
|
4
4
|
import type { Filter } from '../../types/filter.js';
|
5
5
|
export type CreatePendingTransactionFilterReturnType = Filter<'transaction'>;
|
6
6
|
/**
|
7
|
-
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
7
|
+
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
8
8
|
*
|
9
9
|
* - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
|
10
10
|
* - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
|
@@ -11,7 +11,7 @@ export type EstimateContractGasReturnType = bigint;
|
|
11
11
|
*
|
12
12
|
* - Docs: https://viem.sh/docs/contract/estimateContractGas.html
|
13
13
|
*
|
14
|
-
* 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).
|
14
|
+
* 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).
|
15
15
|
*
|
16
16
|
* @param client - Client to use
|
17
17
|
* @param parameters - {@link EstimateContractGasParameters}
|
@@ -17,10 +17,10 @@ export type GetFilterChangesReturnType<TFilterType extends FilterType = FilterTy
|
|
17
17
|
*
|
18
18
|
* A Filter can be created from the following actions:
|
19
19
|
*
|
20
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
21
|
-
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
|
22
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
23
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
20
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
21
|
+
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
|
22
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
23
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
24
24
|
*
|
25
25
|
* Depending on the type of filter, the return value will be different:
|
26
26
|
*
|
@@ -38,7 +38,7 @@ export type GetTransactionParameters = {
|
|
38
38
|
};
|
39
39
|
export type GetTransactionReturnType<TChain extends Chain | undefined = Chain> = FormattedTransaction<TransactionFormatter<TChain>>;
|
40
40
|
/**
|
41
|
-
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
|
41
|
+
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
|
42
42
|
*
|
43
43
|
* - Docs: https://viem.sh/docs/actions/public/getTransaction.html
|
44
44
|
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
@@ -19,7 +19,7 @@ export type GetTransactionCountParameters = {
|
|
19
19
|
});
|
20
20
|
export type GetTransactionCountReturnType = number;
|
21
21
|
/**
|
22
|
-
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
|
22
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
|
23
23
|
*
|
24
24
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
|
25
25
|
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
@@ -9,7 +9,7 @@ export type GetTransactionReceiptParameters = {
|
|
9
9
|
};
|
10
10
|
export type GetTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
11
11
|
/**
|
12
|
-
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
|
12
|
+
* 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.
|
13
13
|
*
|
14
14
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
|
15
15
|
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
@@ -14,7 +14,7 @@ export type MulticallParameters<TContracts extends ContractFunctionConfig[] = Co
|
|
14
14
|
};
|
15
15
|
export type MulticallReturnType<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
|
16
16
|
/**
|
17
|
-
* 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).
|
17
|
+
* 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).
|
18
18
|
*
|
19
19
|
* - Docs: https://viem.sh/docs/contract/multicall.html
|
20
20
|
*
|
@@ -14,7 +14,7 @@ export type ReadContractReturnType<TAbi extends Abi | readonly unknown[] = Abi,
|
|
14
14
|
*
|
15
15
|
* 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.
|
16
16
|
*
|
17
|
-
* 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).
|
17
|
+
* 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).
|
18
18
|
*
|
19
19
|
* @param client - Client to use
|
20
20
|
* @param parameters - {@link ReadContractParameters}
|
@@ -24,9 +24,9 @@ export type SimulateContractReturnType<TAbi extends Abi | readonly unknown[] = A
|
|
24
24
|
* - Docs: https://viem.sh/docs/contract/simulateContract.html
|
25
25
|
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
26
26
|
*
|
27
|
-
* 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.
|
27
|
+
* 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.
|
28
28
|
*
|
29
|
-
* 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).
|
29
|
+
* 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).
|
30
30
|
*
|
31
31
|
* @param client - Client to use
|
32
32
|
* @param parameters - {@link SimulateContractParameters}
|
@@ -13,9 +13,9 @@ export type UninstallFilterReturnType = boolean;
|
|
13
13
|
* - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
|
14
14
|
*
|
15
15
|
* Destroys a Filter that was created from one of the following Actions:
|
16
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
17
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
18
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
16
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
17
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
18
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
19
19
|
*
|
20
20
|
* @param client - Client to use
|
21
21
|
* @param parameters - {@link UninstallFilterParameters}
|
@@ -31,7 +31,7 @@ export type WatchContractEventReturnType = () => void;
|
|
31
31
|
*
|
32
32
|
* 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).
|
33
33
|
*
|
34
|
-
* `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.
|
34
|
+
* `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.
|
35
35
|
*
|
36
36
|
* @param client - Client to use
|
37
37
|
* @param parameters - {@link WatchContractEventParameters}
|
@@ -29,7 +29,7 @@ export type WatchEventParameters<TAbiEvent extends AbiEvent | undefined = undefi
|
|
29
29
|
});
|
30
30
|
export type WatchEventReturnType = () => void;
|
31
31
|
/**
|
32
|
-
* Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
|
32
|
+
* Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
|
33
33
|
*
|
34
34
|
* - Docs: https://viem.sh/docs/actions/public/watchEvent.html
|
35
35
|
* - JSON-RPC Methods:
|
@@ -41,7 +41,7 @@ export type WatchEventReturnType = () => void;
|
|
41
41
|
*
|
42
42
|
* 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).
|
43
43
|
*
|
44
|
-
* `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.
|
44
|
+
* `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.
|
45
45
|
*
|
46
46
|
* @param client - Client to use
|
47
47
|
* @param parameters - {@link WatchEventParameters}
|
@@ -6,7 +6,7 @@ export type SetBlockTimestampIntervalParameters = {
|
|
6
6
|
interval: number;
|
7
7
|
};
|
8
8
|
/**
|
9
|
-
* 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`.
|
9
|
+
* 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`.
|
10
10
|
*
|
11
11
|
* - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
|
12
12
|
*
|
@@ -7,7 +7,7 @@ export type StopImpersonatingAccountParameters = {
|
|
7
7
|
address: Address;
|
8
8
|
};
|
9
9
|
/**
|
10
|
-
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
|
10
|
+
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
|
11
11
|
*
|
12
12
|
* - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
|
13
13
|
*
|
@@ -19,7 +19,7 @@ export type DeployContractReturnType = SendTransactionReturnType;
|
|
19
19
|
*
|
20
20
|
* @param client - Client to use
|
21
21
|
* @param parameters - {@link DeployContractParameters}
|
22
|
-
* @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}
|
22
|
+
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
|
23
23
|
*
|
24
24
|
* @example
|
25
25
|
* import { createWalletClient, http } from 'viem'
|
@@ -17,8 +17,8 @@ export type SignMessageReturnType = Hex;
|
|
17
17
|
* - Local Accounts: Signs locally. No JSON-RPC request.
|
18
18
|
*
|
19
19
|
* With the calculated signature, you can:
|
20
|
-
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
|
21
|
-
* - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
|
20
|
+
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
|
21
|
+
* - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
|
22
22
|
*
|
23
23
|
* @param client - Client to use
|
24
24
|
* @param parameters - {@link SignMessageParameters}
|
@@ -17,15 +17,15 @@ export type WriteContractReturnType = SendTransactionReturnType;
|
|
17
17
|
* - Docs: https://viem.sh/docs/contract/writeContract.html
|
18
18
|
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
19
19
|
*
|
20
|
-
* 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.
|
20
|
+
* 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.
|
21
21
|
*
|
22
|
-
* 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).
|
22
|
+
* 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).
|
23
23
|
*
|
24
24
|
* __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.__
|
25
25
|
*
|
26
26
|
* @param client - Client to use
|
27
27
|
* @param parameters - {@link WriteContractParameters}
|
28
|
-
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
|
28
|
+
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}
|
29
29
|
*
|
30
30
|
* @example
|
31
31
|
* import { createWalletClient, custom, parseAbi } from 'viem'
|
@@ -19,7 +19,7 @@ export type PublicClientConfig<TTransport extends Transport = Transport, TChain
|
|
19
19
|
};
|
20
20
|
export type PublicClient<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain | undefined, TIncludeActions extends boolean = true> = Prettify<Client<TTransport, PublicRequests, TChain> & Pick<PublicClientConfig, 'batch'> & (TIncludeActions extends true ? PublicActions<TTransport, TChain> : unknown)>;
|
21
21
|
/**
|
22
|
-
* Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
22
|
+
* 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).
|
23
23
|
*
|
24
24
|
* - Docs: https://viem.sh/docs/clients/public.html
|
25
25
|
*
|
@@ -15,11 +15,11 @@ export type TestClient<TMode extends TestClientMode = TestClientMode, TTransport
|
|
15
15
|
* @description Creates a test client with a given transport.
|
16
16
|
*/
|
17
17
|
/**
|
18
|
-
* Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
18
|
+
* 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).
|
19
19
|
*
|
20
20
|
* - Docs: https://viem.sh/docs/clients/test.html
|
21
21
|
*
|
22
|
-
* 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).
|
22
|
+
* 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).
|
23
23
|
*
|
24
24
|
* @param config - {@link TestClientConfig}
|
25
25
|
* @returns A Test Client. {@link TestClient}
|
@@ -15,11 +15,11 @@ export type WalletClient<TTransport extends Transport = Transport, TChain extend
|
|
15
15
|
account: TAccount;
|
16
16
|
}>;
|
17
17
|
/**
|
18
|
-
* Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
18
|
+
* 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).
|
19
19
|
*
|
20
20
|
* - Docs: https://viem.sh/docs/clients/wallet.html
|
21
21
|
*
|
22
|
-
* 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).
|
22
|
+
* 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).
|
23
23
|
*
|
24
24
|
* The Wallet Client supports signing over:
|
25
25
|
* - [JSON-RPC Accounts](https://viem.sh/docs/clients/wallet.html#json-rpc-accounts) (e.g. Browser Extension Wallets, WalletConnect, etc).
|
@@ -70,7 +70,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
70
70
|
*/
|
71
71
|
call: (parameters: CallParameters<TChain>) => Promise<CallReturnType>;
|
72
72
|
/**
|
73
|
-
* Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
73
|
+
* Creates a Filter to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
74
74
|
*
|
75
75
|
* - Docs: https://viem.sh/docs/actions/public/createBlockFilter.html
|
76
76
|
* - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
|
@@ -90,7 +90,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
90
90
|
*/
|
91
91
|
createBlockFilter: () => Promise<CreateBlockFilterReturnType>;
|
92
92
|
/**
|
93
|
-
* 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).
|
93
|
+
* 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).
|
94
94
|
*
|
95
95
|
* - Docs: https://viem.sh/docs/contract/createContractEventFilter.html
|
96
96
|
*
|
@@ -111,7 +111,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
111
111
|
*/
|
112
112
|
createContractEventFilter: <TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args: CreateContractEventFilterParameters<TAbi, TEventName, TArgs>) => Promise<CreateContractEventFilterReturnType<TAbi, TEventName, TArgs>>;
|
113
113
|
/**
|
114
|
-
* 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).
|
114
|
+
* 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).
|
115
115
|
*
|
116
116
|
* - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
|
117
117
|
* - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
|
@@ -133,7 +133,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
133
133
|
*/
|
134
134
|
createEventFilter: <TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined>(args?: CreateEventFilterParameters<TAbiEvent, TAbi, TEventName, TArgs>) => Promise<CreateEventFilterReturnType<TAbiEvent, TAbi, TEventName, TArgs>>;
|
135
135
|
/**
|
136
|
-
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
136
|
+
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
137
137
|
*
|
138
138
|
* - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
|
139
139
|
* - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
|
@@ -158,7 +158,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
158
158
|
* - Docs: https://viem.sh/docs/contract/estimateContractGas.html
|
159
159
|
*
|
160
160
|
* @remarks
|
161
|
-
* 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).
|
161
|
+
* 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).
|
162
162
|
*
|
163
163
|
* @param args - {@link EstimateContractGasParameters}
|
164
164
|
* @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
|
@@ -522,10 +522,10 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
522
522
|
* @remarks
|
523
523
|
* A Filter can be created from the following actions:
|
524
524
|
*
|
525
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
526
|
-
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
|
527
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
528
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
525
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
526
|
+
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
|
527
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
528
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
529
529
|
*
|
530
530
|
* Depending on the type of filter, the return value will be different:
|
531
531
|
*
|
@@ -684,7 +684,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
684
684
|
*/
|
685
685
|
getStorageAt: (args: GetStorageAtParameters) => Promise<GetStorageAtReturnType>;
|
686
686
|
/**
|
687
|
-
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
|
687
|
+
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
|
688
688
|
*
|
689
689
|
* - Docs: https://viem.sh/docs/actions/public/getTransaction.html
|
690
690
|
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
@@ -730,7 +730,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
730
730
|
*/
|
731
731
|
getTransactionConfirmations: (args: GetTransactionConfirmationsParameters<TChain>) => Promise<GetTransactionConfirmationsReturnType>;
|
732
732
|
/**
|
733
|
-
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
|
733
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
|
734
734
|
*
|
735
735
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
|
736
736
|
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
@@ -752,7 +752,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
752
752
|
*/
|
753
753
|
getTransactionCount: (args: GetTransactionCountParameters) => Promise<GetTransactionCountReturnType>;
|
754
754
|
/**
|
755
|
-
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
|
755
|
+
* 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.
|
756
756
|
*
|
757
757
|
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
|
758
758
|
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
@@ -775,7 +775,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
775
775
|
*/
|
776
776
|
getTransactionReceipt: (args: GetTransactionReceiptParameters) => Promise<GetTransactionReceiptReturnType<TChain>>;
|
777
777
|
/**
|
778
|
-
* 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).
|
778
|
+
* 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).
|
779
779
|
*
|
780
780
|
* - Docs: https://viem.sh/docs/contract/multicall.html
|
781
781
|
*
|
@@ -821,7 +821,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
821
821
|
* @remarks
|
822
822
|
* 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.
|
823
823
|
*
|
824
|
-
* 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).
|
824
|
+
* 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).
|
825
825
|
*
|
826
826
|
* @param args - {@link ReadContractParameters}
|
827
827
|
* @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
|
@@ -851,9 +851,9 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
851
851
|
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
852
852
|
*
|
853
853
|
* @remarks
|
854
|
-
* 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.
|
854
|
+
* 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.
|
855
855
|
*
|
856
|
-
* 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).
|
856
|
+
* 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).
|
857
857
|
*
|
858
858
|
* @param args - {@link SimulateContractParameters}
|
859
859
|
* @returns The simulation result and write request. {@link SimulateContractReturnType}
|
@@ -880,9 +880,9 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
880
880
|
/**
|
881
881
|
* Destroys a Filter that was created from one of the following Actions:
|
882
882
|
*
|
883
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
884
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
885
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
883
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
884
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
885
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
886
886
|
*
|
887
887
|
* - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
|
888
888
|
* - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
|
@@ -997,7 +997,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
997
997
|
* @remarks
|
998
998
|
* 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).
|
999
999
|
*
|
1000
|
-
* `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.
|
1000
|
+
* `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.
|
1001
1001
|
*
|
1002
1002
|
* @param args - {@link WatchContractEventParameters}
|
1003
1003
|
* @returns A function that can be invoked to stop watching for new event logs. {@link WatchContractEventReturnType}
|
@@ -1020,7 +1020,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
1020
1020
|
*/
|
1021
1021
|
watchContractEvent: <TAbi extends Abi | readonly unknown[], TEventName extends string>(args: WatchContractEventParameters<TAbi, TEventName>) => WatchContractEventReturnType;
|
1022
1022
|
/**
|
1023
|
-
* Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms#event-log).
|
1023
|
+
* Watches and returns emitted [Event Logs](https://viem.sh/docs/glossary/terms.html#event-log).
|
1024
1024
|
*
|
1025
1025
|
* - Docs: https://viem.sh/docs/actions/public/watchEvent.html
|
1026
1026
|
* - JSON-RPC Methods:
|
@@ -1033,7 +1033,7 @@ export type PublicActions<TTransport extends Transport = Transport, TChain exten
|
|
1033
1033
|
* @remarks
|
1034
1034
|
* 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).
|
1035
1035
|
*
|
1036
|
-
* `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.
|
1036
|
+
* `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.
|
1037
1037
|
*
|
1038
1038
|
* @param args - {@link WatchEventParameters}
|
1039
1039
|
* @returns A function that can be invoked to stop watching for new Event Logs. {@link WatchEventReturnType}
|
@@ -324,7 +324,7 @@ export type TestActions = {
|
|
324
324
|
*/
|
325
325
|
setBlockGasLimit: (args: SetBlockGasLimitParameters) => Promise<void>;
|
326
326
|
/**
|
327
|
-
* 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`.
|
327
|
+
* 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`.
|
328
328
|
*
|
329
329
|
* - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
|
330
330
|
*
|
@@ -569,7 +569,7 @@ export type TestActions = {
|
|
569
569
|
*/
|
570
570
|
snapshot: () => Promise<Quantity>;
|
571
571
|
/**
|
572
|
-
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
|
572
|
+
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
|
573
573
|
*
|
574
574
|
* - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
|
575
575
|
*
|
@@ -42,7 +42,7 @@ export type WalletActions<TChain extends Chain | undefined = Chain | undefined,
|
|
42
42
|
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts
|
43
43
|
*
|
44
44
|
* @param args - {@link DeployContractParameters}
|
45
|
-
* @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}
|
45
|
+
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
|
46
46
|
*
|
47
47
|
* @example
|
48
48
|
* import { createWalletClient, http } from 'viem'
|
@@ -216,8 +216,8 @@ export type WalletActions<TChain extends Chain | undefined = Chain | undefined,
|
|
216
216
|
* - Local Accounts: Signs locally. No JSON-RPC request.
|
217
217
|
*
|
218
218
|
* With the calculated signature, you can:
|
219
|
-
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,
|
220
|
-
* - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.
|
219
|
+
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
|
220
|
+
* - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
|
221
221
|
*
|
222
222
|
* @param args - {@link SignMessageParameters}
|
223
223
|
* @returns The signed message. {@link SignMessageReturnType}
|
@@ -402,14 +402,14 @@ export type WalletActions<TChain extends Chain | undefined = Chain | undefined,
|
|
402
402
|
* - Docs: https://viem.sh/docs/contract/writeContract.html
|
403
403
|
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
404
404
|
*
|
405
|
-
* 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.
|
405
|
+
* 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.
|
406
406
|
*
|
407
|
-
* 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).
|
407
|
+
* 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).
|
408
408
|
*
|
409
409
|
* __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.__
|
410
410
|
*
|
411
411
|
* @param args - {@link WriteContractParameters}
|
412
|
-
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
|
412
|
+
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms.html#hash). {@link WriteContractReturnType}
|
413
413
|
*
|
414
414
|
* @example
|
415
415
|
* import { createWalletClient, custom, parseAbi } from 'viem'
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "0.0.0-main.
|
1
|
+
export declare const version = "0.0.0-main.20230523T094945";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
@@ -7,7 +7,7 @@ import { createFilterRequestScope } from '../../utils/filters/createFilterReques
|
|
7
7
|
export type CreateBlockFilterReturnType = Filter<'block'>
|
8
8
|
|
9
9
|
/**
|
10
|
-
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
10
|
+
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new block 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/createBlockFilter.html
|
13
13
|
* - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
|
@@ -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}
|
@@ -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
|
*
|
@@ -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'
|
package/src/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20230523T094945'
|