Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

getContractInfo

Fetch a contract's metadata (code hash, label, admin) by address.

Signature

function getContractInfo(
  client: Client,
  parameters: {
    address: Address
    height?: number
  },
): Promise<ContractInfo>

Example

import { createPublicClient, createTransport, testnet } from "@left-curve/sdk"
import type { Address } from "@left-curve/sdk"
 
const client = createPublicClient({ chain: testnet, transport: createTransport() })
const contract: Address = "0x1234567890abcdef1234567890abcdef12345678"
 
const info = await client.getContractInfo({ address: contract })
console.log(info.codeHash, info.admin)

Parameters

addressAddress. The contract to query.

heightnumber, optional. Block height to query at. Default 0 (latest).

Returns

ContractInfo{ codeHash: Hex, label?: string, admin?: Address }.

See also