Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace CanisterStatus

Index

Type Aliases

CanisterStatusOptions: { agent: HttpAgent; blsVerify?: CreateCertificateOptions["blsVerify"]; canisterId: Principal; paths?: Path[] | Set<Path> }

Type declaration

Path: "time" | "controllers" | "subnet" | "module_hash" | "candid" | MetaData | CustomPath

Pre-configured fields for canister status paths

Status: string | ArrayBuffer | Date | ArrayBuffer[] | Principal[] | SubnetStatus | bigint | null

Types of an entry on the canisterStatus map. An entry of null indicates that the request failed, due to lack of permissions or the result being missing.

StatusMap: Map<Path | string, Status>
SubnetStatus: { metrics?: { canister_state_bytes: bigint; consumed_cycles_total: { current: bigint; deleted: bigint }; num_canisters: bigint; update_transactions_total: bigint }; nodeKeys: Map<string, DerEncodedPublicKey>; subnetId: string }

Represents the useful information about a subnet

param subnetId

the principal id of the canister's subnet

param nodeKeys

the keys of the individual nodes in the subnet

Type declaration

  • Optional metrics?: { canister_state_bytes: bigint; consumed_cycles_total: { current: bigint; deleted: bigint }; num_canisters: bigint; update_transactions_total: bigint }
    • canister_state_bytes: bigint
    • consumed_cycles_total: { current: bigint; deleted: bigint }
      • current: bigint
      • deleted: bigint
    • num_canisters: bigint
    • update_transactions_total: bigint
  • nodeKeys: Map<string, DerEncodedPublicKey>
  • subnetId: string

Functions

  • encodePath(path: Path, canisterId: Principal): ArrayBuffer[]
  • fetchNodeKeys(certificate: ArrayBuffer, canisterId: Principal, root_key?: ArrayBuffer | Uint8Array): SubnetStatus
  • Request information in the request_status state tree for a given canister. Can be used to request information about the canister's controllers, time, module hash, candid interface, and more.

    example

    const status = await canisterStatus({ paths: ['controllers', 'candid'], ...options });

    const controllers = status.get('controllers');

    Parameters

    • options: { agent: HttpAgent; canisterId: Principal; paths?: Set<Path> | Path[] }
      • agent: HttpAgent

        HttpAgent optional authenticated agent to use to make the canister request. Useful for accessing private metadata under icp:private

      • canisterId: Principal

        {@link Principal}

      • Optional paths?: Set<Path> | Path[]

        {@link Path[]}

    Returns Promise<StatusMap>

    object populated with data from the requested paths

Generated using TypeDoc