Skip to main content

useAptosClient

Use this hook to get an Aptos client connected to the defined chain.

Usage

const aptos = useAptosClient(chainId);

This example uses the useAptosClient hook to retrieve the Aptos client for chainId.

Parameters

ParameterTypeDescription
chainIdstringThe id for the chain as defined in defaultChains.

Return Value

  • data: Object containing address and abi of contract.