Class: AccountManagement
api/client/AccountManagement.AccountManagement
Handles functionality related to Account Management
Methods
acceptPrimaryKey
▸ acceptPrimaryKey(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Accepts the authorization to become the new primary key of the issuing identity.
If a CDD service provider approved this change (or this is not required), primary key of the Identity is updated.
Parameters
Name | Type |
---|---|
args | AcceptPrimaryKeyRotationParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
The caller (new primary key) must be either a secondary key of the issuing identity, or unlinked to any identity.
Note
this method is of type ProcedureMethod, which means you can call acceptPrimaryKey.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/client/AccountManagement.ts:373
addSecondaryAccounts
▸ addSecondaryAccounts(args
, opts?
): Promise
<GenericPolymeshTransaction
<Identity
, Identity
>>
Adds a list of secondary Accounts to the signing Identity
Parameters
Name | Type |
---|---|
args | AddSecondaryAccountsParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<Identity
, Identity
>>
Throws
if the signing Account is not the primary Account of the Identity
Note
this method is of type ProcedureMethod, which means you can call addSecondaryAccounts.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/client/AccountManagement.ts:163
createMultiSigAccount
▸ createMultiSigAccount(args
, opts?
): Promise
<GenericPolymeshTransaction
<MultiSig
, MultiSig
>>
Create a MultiSig Account
Parameters
Name | Type |
---|---|
args | CreateMultiSigParams |
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<MultiSig
, MultiSig
>>
Note
this will create an Authorization Request for each signing Account which will have to be accepted before they can approve transactions. None of the signing Accounts can be associated with an Identity when accepting the Authorization 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 createMultiSigAccount.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/client/AccountManagement.ts:249
freezeSecondaryAccounts
▸ freezeSecondaryAccounts(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Freeze all of the secondary Accounts in the signing Identity. This means revoking their permission to perform any operation on the blockchain and freezing their funds until the Accounts are unfrozen via unfreezeSecondaryAccounts
Parameters
Name | Type |
---|---|
opts? | ProcedureOpts |
Returns
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type NoArgsProcedureMethod, which means you can call freezeSecondaryAccounts.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Defined in
api/client/AccountManagement.ts:211
generateOffChainAuthSignature
▸ generateOffChainAuthSignature(args
): Promise
<`0x${string}`>
Generate an offchain authorization signature with a specified signer
Parameters
Name | Type | Description |
---|---|---|
args | Object | - |
args.expiry | Date | date after which the authorization expires |
args.signer | string | Account | Signer to be used to generate the off chain auth signature |
args.target | string | Identity | DID of the identity to which signer is targeting the authorization |
Returns
Promise
<`0x${string}`>
Defined in
api/client/AccountManagement.ts:384
getAccount
▸ getAccount(args
): Promise
<Account
| MultiSig
>
Return an Account instance from an address. If the Account has multiSig signers, the returned value will be a MultiSig instance
Parameters
Name | Type |
---|---|
args | Object |
args.address | string |
Returns
Defined in
api/client/AccountManagement.ts:308
getAccountBalance
▸ getAccountBalance(args?
): Promise
<Balance
>
Get the free/locked POLYX balance of an Account
Parameters
Name | Type | Description |
---|---|---|
args? | Object | - |
args.account | string | Account | defaults to the signing Account |
Returns
Promise
<Balance
>
Note
can be subscribed to, if connected to node using a web socket
Defined in
api/client/AccountManagement.ts:260
▸ getAccountBalance(callback
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
callback | SubCallback <Balance > |
Returns
Promise
<UnsubCallback
>
Defined in
api/client/AccountManagement.ts:261
▸ getAccountBalance(args
, callback
): Promise
<UnsubCallback
>
Parameters
Name | Type |
---|---|
args | Object |
args.account | string | Account |
callback | SubCallback <Balance > |
Returns
Promise
<UnsubCallback
>
Defined in
api/client/AccountManagement.ts:262