Skip to main content
Version: 22.1.x

Class: Assets

api/client/Assets.Assets

Handles all Asset related functionality

Methods

createAsset

createAsset(args, opts?): Promise<GenericPolymeshTransaction <Asset, Asset>>

Create an Asset

Parameters

NameType
argsCreateAssetWithTickerParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction <Asset, Asset>>

Note

if ticker is already reserved, then required role:

  • Ticker Owner

Note

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

Defined in

api/client/Assets.ts:84


get

get(paginationOpts?): Promise<ResultSet <Asset>>

Retrieve all the Assets on chain

Parameters

NameType
paginationOpts?PaginationOptions

Returns

Promise<ResultSet <Asset>>

Note

supports pagination

Defined in

api/client/Assets.ts:226


getAsset

getAsset(args): Promise<Asset>

Retrieve an Asset

Parameters

NameTypeDescription
argsObject-
args.tickerstringAsset ticker

Returns

Promise<Asset>

Defined in

api/client/Assets.ts:205


getAssets

getAssets(args?): Promise<Asset[]>

Retrieve all of the Assets owned by an Identity

Parameters

NameTypeDescription
args?Object-
args.ownerstring | IdentityIdentity representation or Identity ID as stored in the blockchain

Returns

Promise<Asset[]>

Note

Assets with unreadable characters in their tickers will be left out

Defined in

api/client/Assets.ts:173


getGlobalMetadataKeys

getGlobalMetadataKeys(): Promise<GlobalMetadataKey[]>

Retrieve all the Asset Global Metadata on chain. This includes metadata id, name and specs

Returns

Promise<GlobalMetadataKey[]>

Defined in

api/client/Assets.ts:259


getTickerReservation

getTickerReservation(args): TickerReservation

Retrieve a Ticker Reservation

Parameters

NameTypeDescription
argsObject-
args.tickerstringAsset ticker

Returns

TickerReservation

Defined in

api/client/Assets.ts:159


getTickerReservations

getTickerReservations(args?): Promise<TickerReservation[]>

Retrieve all the ticker reservations currently owned by an Identity. This doesn't include Assets that have already been launched

Parameters

NameTypeDescription
args?Object-
args.ownerstring | Identitydefaults to the signing Identity

Returns

Promise<TickerReservation[]>

Note

reservations with unreadable characters in their tickers will be left out

Defined in

api/client/Assets.ts:125


isTickerAvailable

isTickerAvailable(args): Promise<boolean>

Check if a ticker hasn't been reserved

Parameters

NameType
argsObject
args.tickerstring

Returns

Promise<boolean>

Note

can be subscribed to

Defined in

api/client/Assets.ts:93

isTickerAvailable(args, callback): Promise<UnsubCallback>

Parameters

NameType
argsObject
args.tickerstring
callbackSubCallback<boolean>

Returns

Promise<UnsubCallback>

Defined in

api/client/Assets.ts:94


reserveTicker

reserveTicker(args, opts?): Promise<GenericPolymeshTransaction <TickerReservation, TickerReservation>>

Reserve a ticker symbol under the ownership of the signing Identity to later use in the creation of an Asset. The ticker will expire after a set amount of time, after which other users can reserve it

Parameters

NameType
argsReserveTickerParams
opts?ProcedureOpts

Returns

Promise<GenericPolymeshTransaction <TickerReservation, TickerReservation>>

Note

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

Defined in

api/client/Assets.ts:71