Skip to main content
Version: 29.0.x

Class: AssetPermissions

Defined in: src/api/entities/Identity/AssetPermissions.ts:82

Handles all Asset Permissions (External Agents) related functionality on the Identity side

Extends

Methods

checkPermissions()

checkPermissions(args: object): Promise<CheckPermissionsResult<Identity>>

Defined in: src/api/entities/Identity/AssetPermissions.ts:135

Check whether this Identity has specific transaction Permissions over an Asset

Parameters

ParameterType

args

{ asset: string | BaseAsset; transactions: null | TxTag[]; }

args.asset

string | BaseAsset

args.transactions

null | TxTag[]

Returns

Promise<CheckPermissionsResult<Identity>>


enabledAt()

enabledAt(__namedParameters: object): Promise<null | EventIdentifier>

Defined in: src/api/entities/Identity/AssetPermissions.ts:326

Retrieve the identifier data (block number, date and event index) of the event that was emitted when this Identity was enabled/added as an Agent with permissions over a specific Asset

Parameters

ParameterType

__namedParameters

{ asset: string | Asset; }

__namedParameters.asset

string | Asset

Returns

Promise<null | EventIdentifier>

Note

uses the middlewareV2

Note

there is a possibility that the data is not ready by the time it is requested. In that case, null is returned


get()

get(): Promise<AssetWithGroup[]>

Defined in: src/api/entities/Identity/AssetPermissions.ts:103

Retrieve all the Assets over which this Identity has permissions, with the corresponding Permission Group

Returns

Promise<AssetWithGroup[]>


getGroup()

getGroup(__namedParameters: object): Promise<CustomPermissionGroup | KnownPermissionGroup>

Defined in: src/api/entities/Identity/AssetPermissions.ts:285

Retrieve this Identity's Permission Group for a specific Asset

Parameters

ParameterType

__namedParameters

{ asset: string | BaseAsset; }

__namedParameters.asset

string | BaseAsset

Returns

Promise<CustomPermissionGroup | KnownPermissionGroup>


getOperationHistory()

getOperationHistory(opts: object): Promise<ResultSet<EventIdentifier>>

Defined in: src/api/entities/Identity/AssetPermissions.ts:370

Retrieve all Events triggered by Operations this Identity has performed on a specific Asset

Parameters

ParameterTypeDescription

opts

{ asset: string | FungibleAsset; eventId?: EventIdEnum; moduleId?: ModuleIdEnum; size?: BigNumber; start?: BigNumber; }

opts.asset

string | FungibleAsset

opts.eventId?

EventIdEnum

filters results by event

opts.moduleId?

ModuleIdEnum

filters results by module

opts.size?

BigNumber

page size

opts.start?

BigNumber

page offset

Returns

Promise<ResultSet<EventIdentifier>>

Note

uses the middlewareV2

Note

supports pagination


setGroup()

setGroup(args: SetPermissionGroupParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<CustomPermissionGroup | KnownPermissionGroup, CustomPermissionGroup | KnownPermissionGroup>>

Defined in: src/api/entities/Identity/AssetPermissions.ts:354

Assign this Identity to a different Permission Group for a given Asset

Parameters

ParameterType

args

SetPermissionGroupParams

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<CustomPermissionGroup | KnownPermissionGroup, CustomPermissionGroup | KnownPermissionGroup>>

Note

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


waive()

waive(args: WaivePermissionsParams, opts?: ProcedureOpts): Promise<GenericPolymeshTransaction<void, void>>

Defined in: src/api/entities/Identity/AssetPermissions.ts:349

Abdicate from the current Permissions Group for a given Asset. This means that this Identity will no longer have any permissions over said Asset

Parameters

ParameterType

args

WaivePermissionsParams

opts?

ProcedureOpts

Returns

Promise<GenericPolymeshTransaction<void, void>>

Note

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