api.entities.Identity.AssetPermissions - PolymeshAssociation/polymesh-sdk GitHub Wiki

@polymeshassociation/polymesh-sdk / api/entities/Identity/AssetPermissions

api/entities/Identity/AssetPermissions

Classes

AssetPermissions

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

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

Extends

Methods

checkPermissions()

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

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

Check whether this Identity has specific transaction Permissions over an Asset

Parameters
Parameter Type
args { asset: string | BaseAsset; transactions: TxTag[] | null; }
args.asset string | BaseAsset
args.transactions TxTag[] | null
Returns

Promise<CheckPermissionsResult<Identity>>

enabledAt()

enabledAt(__namedParameters): Promise<EventIdentifier | null>

Defined in: 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
Parameter Type
__namedParameters { asset: string | Asset; }
__namedParameters.asset string | Asset
Returns

Promise<EventIdentifier | null>

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: 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): Promise<CustomPermissionGroup | KnownPermissionGroup>

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

Retrieve this Identity's Permission Group for a specific Asset

Parameters
Parameter Type
__namedParameters { asset: string | BaseAsset; }
__namedParameters.asset string | BaseAsset
Returns

Promise<CustomPermissionGroup | KnownPermissionGroup>

getOperationHistory()

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

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

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

Parameters
Parameter Type Description
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, opts?): Promise<GenericPolymeshTransaction<CustomPermissionGroup | KnownPermissionGroup, CustomPermissionGroup | KnownPermissionGroup>>

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

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

Parameters
Parameter Type
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, opts?): Promise<GenericPolymeshTransaction<void, void>>

Defined in: 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
Parameter Type
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