Skip to content
Still using @dfinity/agent? Migrate to @icp-sdk/core!

Cbor

const Cbor: object

Defined in: packages/agent/src/cbor.ts:60

The CanisterStatus utility is used to request structured data directly from the IC public API. This data can be accessed using agent.readState, but CanisterStatus provides a helpful abstraction with some known paths.

You can request a canisters Controllers, ModuleHash, Candid interface, Subnet, or Time, or provide a custom path CanisterStatus.CustomPath and pass arbitrary buffers for valid paths identified in https://internetcomputer.org/docs/current/references/ic-interface-spec.

The primary method for this namespace is CanisterStatus.request

decode: <T>(input) => T

Decode a CBOR encoded value into a JavaScript value.

T

Uint8Array

The CBOR encoded value

T

encode: (value) => Uint8Array

Encode a JavaScript value into CBOR. If the value is an instance of ToCborValue, the ToCborValue.toCborValue method will be called to get the value to encode.

unknown

The value to encode

Uint8Array