api.client.Identities - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/client/Identities

api/client/Identities

Classes

Identities

Defined in: api/client/Identities.ts:34

Handles all Identity related functionality

Methods

allowIdentityToCreatePortfolios()

allowIdentityToCreatePortfolios(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/client/Identities.ts:229

Gives permission to the Identity to create Portfolios on behalf of the signing Identity

Parameters
Parameter Type
args AllowIdentityToCreatePortfoliosParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Throws

if

  • the provided Identity already has permissions to create portfolios for signing Identity
  • the provided Identity does not exist
Note

this method is of type ProcedureMethod, which means you can call allowIdentityToCreatePortfolios.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

attestPrimaryKeyRotation()

attestPrimaryKeyRotation(args, opts?): Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Defined in: api/client/Identities.ts:157

Get a DID Registrar's attestation to change primary key

Parameters
Parameter Type
args AttestPrimaryKeyRotationParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Note

the transaction signer must be a DID Registrar

Note

this creates an Authorization Requests which have to be accepted by the targetAccount along with the authorization for RotatingPrimaryKey. An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived. Also, an Account or Identity can directly fetch the details of an Authorization Request by calling authorizations.getOne

Note

required role:

  • DID Registrar
Note

this method is of type ProcedureMethod, which means you can call attestPrimaryKeyRotation.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

createPortfolio()

createPortfolio(args, opts?): Promise<GenericPolymeshTransaction<NumberedPortfolio[], NumberedPortfolio>>

Defined in: api/client/Identities.ts:191

Create a new Portfolio under the ownership of the signing Identity

Parameters
Parameter Type
args { name: string; ownerDid?: string; }
args.name string
args.ownerDid? string
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<NumberedPortfolio[], NumberedPortfolio>>

Note

the ownerDid is optional. If provided portfolios will be created as Custody Portfolios under the ownerDid

Note

this method is of type ProcedureMethod, which means you can call createPortfolio.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

createPortfolios()

createPortfolios(args, opts?): Promise<GenericPolymeshTransaction<NumberedPortfolio[], NumberedPortfolio[]>>

Defined in: api/client/Identities.ts:201

Creates a set of new Portfolios under the ownership of the signing Identity

Parameters
Parameter Type
args { names: string[]; ownerDid?: string; }
args.names string[]
args.ownerDid? string
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<NumberedPortfolio[], NumberedPortfolio[]>>

Note

the ownerDid is optional. If provided portfolios will be created as Custody Portfolios under the ownerDid

Note

this method is of type ProcedureMethod, which means you can call createPortfolios.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

getAllowedCustodians()

getAllowedCustodians(did): Promise<string[]>

Defined in: api/client/Identities.ts:251

Returns a list of allowed custodian did(s) for Identity

Parameters
Parameter Type
did string | Identity
Returns

Promise<string[]>

Throws

if

  • the provided Identity does not exist
getIdentity()

getIdentity(args): Promise<Identity>

Defined in: api/client/Identities.ts:211

Create an Identity instance from a DID

Parameters
Parameter Type
args { did: string; }
args.did string
Returns

Promise<Identity>

Throws

if there is no Identity with the passed DID

isIdentityValid()

isIdentityValid(args): Promise<boolean>

Defined in: api/client/Identities.ts:218

Return whether the supplied Identity/DID exists

Parameters
Parameter Type
args { identity: string | Identity; }
args.identity string | Identity
Returns

Promise<boolean>

registerDid()

registerDid(args, opts?): Promise<GenericPolymeshTransaction<Identity, Identity>>

Defined in: api/client/Identities.ts:144

Register a new DID for the targetAccount

Parameters
Parameter Type
args RegisterDidParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Identity, Identity>>

Note

the transaction signer must be an active DID Registrar

Note

unlike registerIdentity, this does not support secondary keys or CDD claims

Throws

if the targetAccount is already linked to an Identity

Note

this method is of type ProcedureMethod, which means you can call registerDid.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

registerIdentity()

registerIdentity(args, opts?): Promise<GenericPolymeshTransaction<Identity, Identity>>

Defined in: api/client/Identities.ts:127

Register an Identity

Parameters
Parameter Type
args RegisterIdentityParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Identity, Identity>>

Deprecated

as of chain v8, createCdd/expiry no longer have any on-chain effect (the underlying cdd_register_did/cdd_register_did_with_cdd calls are deprecated and no longer attach a CustomerDueDiligence claim). Use registerDid instead.

Note

the transaction signer must be a DID Registrar

Note

this may create Authorization Requests which have to be accepted by the targetAccount. An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived. Also, an Account or Identity can directly fetch the details of an Authorization Request by calling authorizations.getOne

Note

required role:

  • DID Registrar
Note

this method is of type ProcedureMethod, which means you can call registerIdentity.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

revokeIdentityToCreatePortfolios()

revokeIdentityToCreatePortfolios(args, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: api/client/Identities.ts:241

Revokes permission from the Identity to create Portfolios on behalf of the signing Identity

Parameters
Parameter Type
args RevokeIdentityToCreatePortfoliosParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<void, void>>

Throws

if

  • the provided Identity already does not have permissions to create portfolios for signing Identity
  • the provided Identity does not exist
Note

this method is of type ProcedureMethod, which means you can call revokeIdentityToCreatePortfolios.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

rotatePrimaryKey()

rotatePrimaryKey(args, opts?): Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Defined in: api/client/Identities.ts:169

Creates an Authorization to rotate primary key of the signing Identity by the targetAccount

Parameters
Parameter Type
args RotatePrimaryKeyParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Note

this creates an Authorization Requests which have to be accepted by the targetAccount An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived. Also, an Account or Identity can directly fetch the details of an Authorization Request by calling authorizations.getOne

Note

this method is of type ProcedureMethod, which means you can call rotatePrimaryKey.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

rotatePrimaryKeyToSecondary()

rotatePrimaryKeyToSecondary(args, opts?): Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Defined in: api/client/Identities.ts:182

Creates an Authorization to rotate primary key of the signing Identity to an existing secondary key identified by the targetAccount

Parameters
Parameter Type
args RotatePrimaryKeyToSecondaryParams
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<AuthorizationRequest, AuthorizationRequest>>

Note

the given targetAccount must be an existing secondaryKey or unlinked to any other Identity

Note

this creates an Authorization Requests which have to be accepted by the targetAccount An Account or Identity can fetch its pending Authorization Requests by calling authorizations.getReceived. Also, an Account or Identity can directly fetch the details of an Authorization Request by calling authorizations.getOne

Throws

if the given targetAccount is linked with another Identity

Throws

if the given targetAccount is already the primary key of the signing Identity

Throws

if the given targetAccount already has a pending invitation to become the primary key of the signing Identity

Note

this method is of type ProcedureMethod, which means you can call rotatePrimaryKeyToSecondary.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

selfRegisterDid()

selfRegisterDid(opts?): Promise<GenericPolymeshTransaction<Identity, Identity>>

Defined in: api/client/Identities.ts:134

Register a new DID for the signing Account

Parameters
Parameter Type
opts? ProcedureOpts
Returns

Promise<GenericPolymeshTransaction<Identity, Identity>>

Throws

if the signing Account is already linked to an Identity

Note

this method is of type NoArgsProcedureMethod, which means you can call selfRegisterDid.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it

⚠️ **GitHub.com Fallback** ⚠️