Principal

IC principals (user and canister smart contract IDs)

Principal

type Principal = Prim.Types.Principal

Internet Computer principal identifiers. Convert to Blob for access to bytes.

fromActor

let fromActor : (a : actor {  }) -> Principal

Conversion.

toBlob

let toBlob : (p : Principal) -> Blob

Conversion.

fromBlob

let fromBlob : (b : Blob) -> Principal

Conversion.

toText

func toText(p : Principal) : Text

Conversion.

isAnonymous

func isAnonymous(p : Principal) : Bool

hash

func hash(principal : Principal) : Hash.Hash

fromText

func fromText(t : Text) : Principal

equal

func equal(x : Principal, y : Principal) : Bool

Returns x == y.

notEqual

func notEqual(x : Principal, y : Principal) : Bool

Returns x != y.

less

func less(x : Principal, y : Principal) : Bool

Returns x < y.

lessOrEqual

func lessOrEqual(x : Principal, y : Principal) : Bool

Returns x ⇐ y.

greater

func greater(x : Principal, y : Principal) : Bool

Returns x > y.

greaterOrEqual

func greaterOrEqual(x : Principal, y : Principal) : Bool

Returns x >= y.

compare

func compare(x : Principal, y : Principal) : {#less; #equal; #greater}

Returns the order of x and y.