seismic-react / useShieldedWriteContract
Function: useShieldedWriteContract()
function useShieldedWriteContract<TAbi, TFunctionName, TArgs>(config): objectDefined in: packages/seismic-react/src/hooks/shieldedWriteContract.ts:42
Similar to wagmi's useWriteContract hook, but uses shieldedWriteContract instead.
Type Parameters
• TAbi extends Abi | readonly unknown[]
• TFunctionName extends string
• TArgs extends unknown
Parameters
config
UseShieldedWriteContractConfig<TAbi, TFunctionName, TArgs>
The configuration object.
address(Hex) - The address of the contract.abi(Abi) - The contract ABI.functionName(string) - The name of the contract function to call.args(array) - The arguments to pass to the contract function.gas(bigint) - Optional gas limit for the transaction.gasPrice(bigint) - Optional gas price for the transaction.
Returns
object
An object containing:
writeContract(function): A function to execute contract writes.isLoading(boolean): Indicates if the write operation is in progress.hash(string): The transaction hash from the last successful call towriteContract.error(string): Any error message from the most recent call towriteContract, if present.
| Name | Type | Default value | Defined in |
|---|---|---|---|
error | null | Error | - | packages/seismic-react/src/hooks/shieldedWriteContract.ts:101 |
hash | null | `0x${string}` | - | packages/seismic-react/src/hooks/shieldedWriteContract.ts:102 |
isLoading | boolean | - | packages/seismic-react/src/hooks/shieldedWriteContract.ts:100 |
write | () => Promise<undefined | `0x${string}`> | writeContract | packages/seismic-react/src/hooks/shieldedWriteContract.ts:99 |
writeContract | () => Promise<undefined | `0x${string}`> | - | packages/seismic-react/src/hooks/shieldedWriteContract.ts:98 |