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()
Section titled “decode()”decode: <
T
>(input
) =>T
Decode a CBOR encoded value into a JavaScript value.
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”Uint8Array
The CBOR encoded value
Returns
Section titled “Returns”T
encode()
Section titled “encode()”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.
Parameters
Section titled “Parameters”unknown
The value to encode
Returns
Section titled “Returns”Uint8Array