Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 434 Bytes

usecontract.md

File metadata and controls

14 lines (9 loc) · 434 Bytes

useContract

Initializing and managing Contract instance given a registered ContractId, it will use the information from contract deployments to initialize the instance.

import { useContract } from 'typink';
import { ContractId } from 'contracts/deployments';
import { GreeterContractApi } from 'contracts/types/greeter';

const { contract } = useContract<GreeterContractApi>(ContractId.GREETER);

// contract.query...