Skip to content

request

request(options): Promise<StatusMap>

Defined in: packages/core/src/agent/canisterStatus/index.ts:81

Requests information from a canister’s read_state endpoint. Can be used to request information about the canister’s controllers, time, module hash, candid interface, and more.

[!WARNING] Requesting the subnet path from the canister status might be deprecated in the future. Use SubnetStatus.request to fetch subnet information instead.

CanisterStatusOptions

The configuration for the canister status request.

Promise<StatusMap>

A map populated with data from the requested paths. Each path is a key in the map, and the value is the data obtained from the certificate for that path.

CanisterStatusOptions for detailed options.

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