Skip to content
Cive

getAdmin

Get the admin of the specified contract

Usage

import { publicClient } from "./client";
const contractAddress = await publicClient.getAdmin({
  address: "cfx:...",
});

Returns

Address | null

Return the admin of the specified contract address or null if the contract does not exist.

Parameters

address

  • Type: Address

The address to check for collateral storage

const contractAddress = await publicClient.getAdmin({
  address: "cfx:...", 
});

epochTag (optional)

  • Type: latest_state| latest_confirmed| latest_checkpoint | earliest
  • Defaut: latest_state
const contractAddress = await publicClient.getAdmin({
  address: "cfx:...",
  epochTag: "latest_state", 
});

epochNumber (optional)

  • Type: bigint
const contractAddress = await publicClient.getAdmin({
  address: "cfx:...",
  epochNumber: 1n, 
});

JSON-RPC Method

cfx_getAdmin