Overview
Classes
Section titled “Classes”Principal
Section titled “Principal”Defined in: packages/core/src/principal/principal.ts:16
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”
protectednew Principal(_arr):Principal
Defined in: packages/core/src/principal/principal.ts:95
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”Properties
Section titled “Properties”_isPrincipal
Section titled “_isPrincipal”
readonly_isPrincipal:true=true
Defined in: packages/core/src/principal/principal.ts:93
Methods
Section titled “Methods”compareTo()
Section titled “compareTo()”compareTo(
other):"lt"|"eq"|"gt"
Defined in: packages/core/src/principal/principal.ts:143
Utility method taking a Principal to compare against. Used for determining canister ranges in certificate verification
Parameters
Section titled “Parameters”a Principal to compare
Returns
Section titled “Returns”"lt" | "eq" | "gt"
'lt' | 'eq' | 'gt' a string, representing less than, equal to, or greater than
gtEq()
Section titled “gtEq()”gtEq(
other):boolean
Defined in: packages/core/src/principal/principal.ts:177
Utility method checking whether a provided Principal is greater than or equal to the current one using the Principal.compareTo method
Parameters
Section titled “Parameters”a Principal to compare
Returns
Section titled “Returns”boolean
boolean
isAnonymous()
Section titled “isAnonymous()”isAnonymous():
boolean
Defined in: packages/core/src/principal/principal.ts:97
Returns
Section titled “Returns”boolean
ltEq()
Section titled “ltEq()”ltEq(
other):boolean
Defined in: packages/core/src/principal/principal.ts:167
Utility method checking whether a provided Principal is less than or equal to the current one using the Principal.compareTo method
Parameters
Section titled “Parameters”a Principal to compare
Returns
Section titled “Returns”boolean
boolean
toHex()
Section titled “toHex()”toHex():
string
Defined in: packages/core/src/principal/principal.ts:105
Returns
Section titled “Returns”string
toJSON()
Section titled “toJSON()”toJSON():
JsonnablePrincipal
Defined in: packages/core/src/principal/principal.ts:134
Serializes to JSON
Returns
Section titled “Returns”a JSON object with a single key, JSON_KEY_PRINCIPAL, whose value is the principal as a string
toString()
Section titled “toString()”toString():
string
Defined in: packages/core/src/principal/principal.ts:126
Returns
Section titled “Returns”string
toText()
Section titled “toText()”toText():
string
Defined in: packages/core/src/principal/principal.ts:109
Returns
Section titled “Returns”string
toUint8Array()
Section titled “toUint8Array()”toUint8Array():
Uint8Array
Defined in: packages/core/src/principal/principal.ts:101
Returns
Section titled “Returns”Uint8Array
anonymous()
Section titled “anonymous()”
staticanonymous():Principal
Defined in: packages/core/src/principal/principal.ts:17
Returns
Section titled “Returns”from()
Section titled “from()”
staticfrom(other):Principal
Defined in: packages/core/src/principal/principal.ts:34
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”fromHex()
Section titled “fromHex()”
staticfromHex(hex):Principal
Defined in: packages/core/src/principal/principal.ts:48
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”fromText()
Section titled “fromText()”
staticfromText(text):Principal
Defined in: packages/core/src/principal/principal.ts:52
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”fromUint8Array()
Section titled “fromUint8Array()”
staticfromUint8Array(arr):Principal
Defined in: packages/core/src/principal/principal.ts:77
Parameters
Section titled “Parameters”Uint8Array
Returns
Section titled “Returns”isPrincipal()
Section titled “isPrincipal()”
staticisPrincipal(other):other is Principal
Defined in: packages/core/src/principal/principal.ts:81
Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”other is Principal
managementCanister()
Section titled “managementCanister()”
staticmanagementCanister():Principal
Defined in: packages/core/src/principal/principal.ts:25
Utility method, returning the principal representing the management canister, decoded from the hex string 'aaaaa-aa'
Returns
Section titled “Returns”principal of the management canister
selfAuthenticating()
Section titled “selfAuthenticating()”
staticselfAuthenticating(publicKey):Principal
Defined in: packages/core/src/principal/principal.ts:29
Parameters
Section titled “Parameters”publicKey
Section titled “publicKey”Uint8Array
Returns
Section titled “Returns”Interfaces
Section titled “Interfaces”JsonnablePrincipal
Section titled “JsonnablePrincipal”Defined in: packages/core/src/principal/principal.ts:12
Properties
Section titled “Properties”__principal__
Section titled “__principal__”__principal__:
string
Defined in: packages/core/src/principal/principal.ts:13
Variables
Section titled “Variables”JSON_KEY_PRINCIPAL
Section titled “JSON_KEY_PRINCIPAL”
constJSON_KEY_PRINCIPAL:"__principal__"='__principal__'
Defined in: packages/core/src/principal/principal.ts:6
Functions
Section titled “Functions”base32Decode()
Section titled “base32Decode()”base32Decode(
input):Uint8Array
Defined in: packages/core/src/principal/utils/base32.ts:60
Parameters
Section titled “Parameters”string
The base32 encoded string to decode.
Returns
Section titled “Returns”Uint8Array
base32Encode()
Section titled “base32Encode()”base32Encode(
input):string
Defined in: packages/core/src/principal/utils/base32.ts:17
Parameters
Section titled “Parameters”Uint8Array
The Uint8Array to encode.
Returns
Section titled “Returns”string
A Base32 string encoding the input.
getCrc32()
Section titled “getCrc32()”getCrc32(
buf):number
Defined in: packages/core/src/principal/utils/getCrc.ts:42
Calculate the CRC32 of a Uint8Array.
Parameters
Section titled “Parameters”Uint8Array
The Uint8Array to calculate the CRC32 of.
Returns
Section titled “Returns”number