CanisterTarget
CanisterTarget = {
id:string;name?:never;certified?:boolean; } | {name:string;id?:never;certified?:boolean; }
Defined in: core/src/types.ts:172
Which canister client.canister() calls: by its id, or by the name the
ic_env cookie gives it.
{ id }: principal text. Text that is not a canonical principal throws aTypeErrorthat names it, when the canister is made.{ name }: read from the cookie’sPUBLIC_CANISTER_ID:<name>entry when a call or a key is built, and only where the network trusts the cookie. Unresolved (on a server, on an untrusted host, or with no such entry), every call rejectsinvalid_argswith code"canister_id_unresolved"and sends nothing, and keys carry"$unresolved:<name>"in place of the id.certified: truemakes another canister object, whosequerymethods are sent as replicated calls so that their replies are certified, and whose keys end in"certified". Acomposite_queryhas no certified path: on such a canister its direct call rejectsinvalid_args(code"no_certified_path") andqueryOptionsthrows aTypeError.