-
Notifications
You must be signed in to change notification settings - Fork 11
api.client.AccountManagement.AccountManagement
api/client/AccountManagement.AccountManagement
Handles functionality related to Account Management
- acceptPrimaryKey
- addSecondaryAccounts
- createMultiSigAccount
- freezeSecondaryAccounts
- generateOffChainAuthSignature
- getAccount
- getAccountBalance
- getSigningAccount
- getSigningAccounts
- getSubsidy
- inviteAccount
- isValidAddress
- leaveIdentity
- modifyPermissions
- removeSecondaryAccounts
- revokePermissions
- subsidizeAccount
- unfreezeSecondaryAccounts
▸ 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.
Name | Type |
---|---|
args |
AcceptPrimaryKeyRotationParams |
opts? |
ProcedureOpts |
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
api/client/AccountManagement.ts:373
▸ addSecondaryAccounts(args
, opts?
): Promise
<GenericPolymeshTransaction
<Identity
, Identity
>>
Adds a list of secondary Accounts to the signing Identity
Name | Type |
---|---|
args |
AddSecondaryAccountsParams |
opts? |
ProcedureOpts |
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
api/client/AccountManagement.ts:163
▸ createMultiSigAccount(args
, opts?
): Promise
<GenericPolymeshTransaction
<MultiSig
, MultiSig
>>
Create a MultiSig Account
Name | Type |
---|---|
args |
CreateMultiSigParams |
opts? |
ProcedureOpts |
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
api/client/AccountManagement.ts:249
▸ 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
Name | Type |
---|---|
opts? |
ProcedureOpts |
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
api/client/AccountManagement.ts:211
▸ generateOffChainAuthSignature(args
): Promise
<`0x${string}`>
Generate an offchain authorization signature with a specified signer
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 |
Promise
<`0x${string}`>
api/client/AccountManagement.ts:384
▸ 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
Name | Type |
---|---|
args |
Object |
args.address |
string |
api/client/AccountManagement.ts:308
▸ getAccountBalance(args?
): Promise
<Balance
>
Get the free/locked POLYX balance of an Account
Name | Type | Description |
---|---|---|
args? |
Object |
- |
args.account |
string | Account
|
defaults to the signing Account |
Promise
<Balance
>
Note
can be subscribed to, if connected to node using a web socket
api/client/AccountManagement.ts:260
▸ getAccountBalance(callback
): Promise
<UnsubCallback
>
Name | Type |
---|---|
callback |
SubCallback <Balance > |
Promise
<UnsubCallback
>
api/client/AccountManagement.ts:261
▸ getAccountBalance(args
, callback
): Promise
<UnsubCallback
>
Name | Type |
---|---|
args |
Object |
args.account |
string | Account
|
callback |
SubCallback <Balance > |
Promise
<UnsubCallback
>
api/client/AccountManagement.ts:262
▸ getSigningAccount(): null
| Account
Return the signing Account, or null if no signing Account has been set
null
| Account
api/client/AccountManagement.ts:315
▸ getSigningAccounts(): Promise
<Account
[]>
Return a list that contains all the signing Accounts associated to the SDK instance's Signing Manager
Promise
<Account
[]>
Throws
— if there is no Signing Manager attached to the SDK
api/client/AccountManagement.ts:328
▸ getSubsidy(args
): Subsidy
Return an Subsidy instance for a pair of beneficiary and subsidizer Account
Name | Type |
---|---|
args |
Object |
args.beneficiary |
string | Account
|
args.subsidizer |
string | Account
|
api/client/AccountManagement.ts:335
▸ inviteAccount(args
, opts?
): Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
Send an invitation to an Account to join the signing Identity as a secondary Account
Name | Type |
---|---|
args |
InviteAccountParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
Note
this will create an Authorization Request which has 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 inviteAccount.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:201
▸ isValidAddress(args
): boolean
Returns true
Name | Type | Description |
---|---|---|
args |
Object |
- |
args.address |
string |
is a valid ss58 address for the connected network |
boolean
api/client/AccountManagement.ts:352
▸ leaveIdentity(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Disassociate the signing Account from its Identity. This operation can only be done if the signing Account is a secondary Account
Name | Type |
---|---|
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type NoArgsProcedureMethod, which means you can call leaveIdentity.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:141
▸ modifyPermissions(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Modify all permissions of a list of secondary Accounts associated with the signing Identity
Name | Type |
---|---|
args |
ModifySignerPermissionsParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
Throws
if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being modified
Note
this method is of type ProcedureMethod, which means you can call modifyPermissions.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:187
▸ removeSecondaryAccounts(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Remove a list of secondary Accounts associated with the signing Identity
Name | Type |
---|---|
args |
RemoveSecondaryAccountsParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type ProcedureMethod, which means you can call removeSecondaryAccounts.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:151
▸ revokePermissions(args
, opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Revoke all permissions of a list of secondary Accounts associated with the signing Identity
Name | Type |
---|---|
args |
Object |
args.secondaryAccounts |
(string | Account )[] |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
Throws
if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being revoked
Note
this method is of type ProcedureMethod, which means you can call revokePermissions.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:175
▸ subsidizeAccount(args
, opts?
): Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
Send an Authorization Request to an Account to subsidize its transaction fees
Name | Type |
---|---|
args |
SubsidizeAccountParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<AuthorizationRequest
, AuthorizationRequest
>>
Note
this will create an Authorization Request which has to be accepted by the beneficiary
Account.
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 subsidizeAccount.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
api/client/AccountManagement.ts:235
▸ unfreezeSecondaryAccounts(opts?
): Promise
<GenericPolymeshTransaction
<void
, void
>>
Unfreeze all of the secondary Accounts in the signing Identity. This will restore their permissions as they were before being frozen
Name | Type |
---|---|
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<void
, void
>>
Note
this method is of type NoArgsProcedureMethod, which means you can call unfreezeSecondaryAccounts.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
Entities
- Account
- Asset
- Authorization Request
- Checkpoint
- Checkpoint Schedule
- Corporate Action
- Corporate Action Base
- Custom Permission Group
- Default Portfolio
- Default Trusted Claim Issuer
- Dividend Distribution
- Entity
- Identity
- Instruction
- Known Permission Group
- Metadata Entry
- Multi Sig Proposal
- Numbered Portfolio
- Offering
- Permission Group
- Portfolio
- Subsidies
- Subsidy
- Ticker Reservation
- Venue
- Authorizations
- Types