import { MultiSig } from '../../api/entities/Account/MultiSig'; import { Account, AuthorizationRequest, Context, Subsidy } from '../../internal'; import { AcceptPrimaryKeyRotationParams, AcceptSubsidyParams, AccountBalance, AddSecondaryAccountsParams, CreateMultiSigParams, Identity, InviteAccountParams, ModifySignerPermissionsParams, NoArgsProcedureMethod, ProcedureMethod, RemoveSecondaryAccountsParams, RevokeSubsidyParams, SubCallback, SubsidizeAccountParams, UnsubCallback } from '../../types'; /** * Handles functionality related to Account Management */ export declare class AccountManagement { private readonly context; /** * @hidden */ constructor(context: Context); /** * Disassociate the signing Account from its Identity. This operation can only be done if the signing Account is a secondary Account */ leaveIdentity: NoArgsProcedureMethod; /** * Remove a list of secondary Accounts associated with the signing Identity */ removeSecondaryAccounts: ProcedureMethod; /** * Adds a list of secondary Accounts to the signing Identity * * @throws if the signing Account is not the primary Account of the Identity */ addSecondaryAccounts: ProcedureMethod; /** * Revoke all permissions of a list of secondary Accounts associated with the signing Identity * * @throws if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being revoked */ revokePermissions: ProcedureMethod<{ secondaryAccounts: (string | Account)[]; }, void>; /** * Modify all permissions of a list of secondary Accounts associated with the signing Identity * * @throws if the signing Account is not the primary Account of the Identity whose secondary Account permissions are being modified */ modifyPermissions: ProcedureMethod; /** * Send an invitation to an Account to join the signing Identity as a secondary Account * * @note this will create an {@link AuthorizationRequest | Authorization Request} which has to be accepted by the `targetAccount`. * An {@link Account} or {@link Identity} can fetch its pending Authorization Requests by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getReceived | authorizations.getReceived}. * Also, an Account or Identity can directly fetch the details of an Authorization Request by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getOne | authorizations.getOne} */ inviteAccount: ProcedureMethod; /** * 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 {@link unfreezeSecondaryAccounts} */ freezeSecondaryAccounts: NoArgsProcedureMethod; /** * Unfreeze all of the secondary Accounts in the signing Identity. This will restore their permissions as they were before being frozen */ unfreezeSecondaryAccounts: NoArgsProcedureMethod; /** * Approves a subsidy request * * This is to be called in by the paying key to approve allowance with respect to a beneficiary key. * * @note this will create a pending subsidies entry, which has to be accepted by the `beneficiary` Account. Pending subsidies for a beneficiary can be fetched by calling {@link api/entities/Subsidies!Subsidies.getPendingSubsidies | subsidies.getPendingSubsidies}. * * @throws if same allowance amount is pending for acceptance with respect to same beneficiary */ approveSubsidy: ProcedureMethod; /** * Accepts a pending subsidy request from subsidizer * * @note Only the beneficiary can accept an already approved subsidy request. Pending subsidies for a beneficiary can be fetched by calling {@link api/entities/Subsidies!Subsidies.getPendingSubsidies | subsidies.getPendingSubsidies}. */ acceptSubsidy: ProcedureMethod; /** * Revokes an already approved subsidy request * * @note Only the subsidizer can revoke an already approved subsidy request. Pending subsidies for a beneficiary can be fetched by calling {@link api/entities/Subsidies!Subsidies.getPendingSubsidies | subsidies.getPendingSubsidies}. */ revokeSubsidy: ProcedureMethod; /** * Create a MultiSig Account * * @note this will create an {@link AuthorizationRequest | 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 {@link Account} or {@link Identity} can fetch its pending Authorization Requests by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getReceived | authorizations.getReceived}. * Also, an Account or Identity can directly fetch the details of an Authorization Request by calling {@link api/entities/common/namespaces/Authorizations!Authorizations.getOne | authorizations.getOne} */ createMultiSigAccount: ProcedureMethod; /** * Get the free/locked POLYX balance of an Account * * @param args.account - The account to get balance for (defaults to the signing Account) * @returns The account's POLYX balance information * @note can be subscribed to, if connected to node using a web socket */ getAccountBalance(args?: { account: string | Account; }): Promise; /** * Get the free/locked POLYX balance of the signing Account (with subscription) * * @param callback - Callback function to receive balance updates * @returns An unsubscribe function * @note can be subscribed to, if connected to node using a web socket */ getAccountBalance(callback: SubCallback): Promise; /** * Get the free/locked POLYX balance of an Account (with subscription) * * @param args.account - The account to get balance for * @param callback - Callback function to receive balance updates * @returns An unsubscribe function * @note can be subscribed to, if connected to node using a web socket */ getAccountBalance(args: { account: string | Account; }, callback: SubCallback): Promise; /** * Return an Account instance from an address. If the Account has multiSig signers, the returned value will be a {@link MultiSig} instance */ getAccount(args: { address: string; }): Promise; /** * Return the signing Account, or null if no signing Account has been set */ getSigningAccount(): Account | null; /** * Return a list that contains all the signing Accounts associated to the SDK instance's Signing Manager * * @throws — if there is no Signing Manager attached to the SDK */ getSigningAccounts(): Promise; /** * Return an Subsidy instance for a pair of beneficiary and subsidizer Account */ getSubsidy(args: { beneficiary: string | Account; subsidizer: string | Account; }): Subsidy; /** * Returns `true` @param args.address is a valid ss58 address for the connected network */ isValidAddress(args: { address: string; }): boolean; /** * 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. * * @note The caller (new primary key) must be either a secondary key of the issuing identity, or * unlinked to any identity. */ acceptPrimaryKey: ProcedureMethod; /** * Generate an offchain authorization signature with a specified signer * * @param args.signer Signer to be used to generate the off chain auth signature * @param args.target DID of the identity to which signer is targeting the authorization * @param args.expiry date after which the authorization expires */ generateOffChainAuthSignature(args: { signer: string | Account; target: string | Identity; expiry: Date; }): Promise<`0x${string}`>; } //# sourceMappingURL=AccountManagement.d.ts.map