useAptosClient
Use this hook to get an Aptos client connected to a chain from defaultChains. The client is reused for the same chainId.
Usage
const aptos = useAptosClient(chainId);
This example uses the useAptosClient hook to retrieve the Aptos client for chainId.
Parameters
| Parameter | Type | Description |
|---|---|---|
| chainId | number | The id for the chain as defined in defaultChains. The hook throws if no chain has this id. |
Return Value
aptos: AnAptosclient from the Aptos TypeScript SDK.