-
Notifications
You must be signed in to change notification settings - Fork 11
api.client.Assets.Assets
api/client/Assets.Assets
Handles all Asset related functionality
- createAsset
- createNftCollection
- get
- getAsset
- getAssets
- getFungibleAsset
- getGlobalMetadataKeys
- getNextCustomAssetTypeId
- getNftCollection
- getTickerReservation
- getTickerReservations
- isTickerAvailable
- registerCustomAssetType
- reserveTicker
▸ createAsset(args
, opts?
): Promise
<GenericPolymeshTransaction
<FungibleAsset
, FungibleAsset
>>
Create an Asset
Name | Type |
---|---|
args |
CreateAssetWithTickerParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<FungibleAsset
, FungibleAsset
>>
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
▸ createNftCollection(args
, opts?
): Promise
<GenericPolymeshTransaction
<NftCollection
, NftCollection
>>
Create an NftCollection
Name | Type |
---|---|
args |
CreateNftCollectionParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<NftCollection
, NftCollection
>>
Note
if ticker is already reserved, then required role:
- Ticker Owner
Note
this method is of type ProcedureMethod, which means you can call createNftCollection.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
▸ get(paginationOpts?
): Promise
<ResultSet
<Asset
>>
Retrieve all the Assets on chain
Name | Type |
---|---|
paginationOpts? |
PaginationOptions |
Note
supports pagination
▸ getAsset(args
): Promise
<Asset
>
Retrieve a FungibleAsset or NftCollection
Name | Type |
---|---|
args |
Object |
args.ticker |
string |
Promise
<Asset
>
Note
getFungibleAsset
and getNftCollection
are similar to this method, but return a more specific type
▸ getAsset(args
): Promise
<Asset
>
Name | Type |
---|---|
args |
Object |
args.assetId |
string |
Promise
<Asset
>
▸ getAssets(args?
): Promise
<Asset
[]>
Retrieve all of the Assets owned by an Identity
Name | Type | Description |
---|---|---|
args? |
Object |
- |
args.owner |
string | Identity
|
Identity representation or Identity ID as stored in the blockchain |
Promise
<Asset
[]>
Note
Assets with unreadable characters in their tickers will be left out
▸ getFungibleAsset(args
): Promise
<FungibleAsset
>
Retrieve a FungibleAsset
Name | Type | Description |
---|---|---|
args |
Object |
- |
args.assetId |
string |
Unique Id of the Asset (for spec version 6.x, this is same as ticker) |
Promise
<FungibleAsset
>
▸ getFungibleAsset(args
): Promise
<FungibleAsset
>
Name | Type |
---|---|
args |
Object |
args.ticker |
string |
Promise
<FungibleAsset
>
▸ getGlobalMetadataKeys(): Promise
<GlobalMetadataKey
[]>
Retrieve all the Asset Global Metadata on chain. This includes metadata id, name and specs
Promise
<GlobalMetadataKey
[]>
▸ getNextCustomAssetTypeId(): Promise
<BigNumber
>
Gets the next custom Asset type Id
Promise
<BigNumber
>
▸ getNftCollection(args
): Promise
<NftCollection
>
Retrieve an NftCollection
Name | Type | Description |
---|---|---|
args |
Object |
- |
args.ticker |
string |
NftCollection ticker |
Promise
<NftCollection
>
▸ getNftCollection(args
): Promise
<NftCollection
>
Name | Type |
---|---|
args |
Object |
args.assetId |
string |
Promise
<NftCollection
>
▸ getTickerReservation(args
): TickerReservation
Retrieve a Ticker Reservation
Name | Type | Description |
---|---|---|
args |
Object |
- |
args.ticker |
string |
Asset ticker |
▸ getTickerReservations(args?
): Promise
<TickerReservation
[]>
Retrieve all the ticker reservations currently owned by an Identity. This doesn't include Assets that have already been launched
Name | Type | Description |
---|---|---|
args? |
Object |
- |
args.owner |
string | Identity
|
defaults to the signing Identity |
Promise
<TickerReservation
[]>
Note
reservations with unreadable characters in their tickers will be left out
▸ isTickerAvailable(args
): Promise
<boolean
>
Check if a ticker hasn't been reserved
Name | Type |
---|---|
args |
Object |
args.ticker |
string |
Promise
<boolean
>
Note
can be subscribed to, if connected to node using a web socket
▸ isTickerAvailable(args
, callback
): Promise
<UnsubCallback
>
Name | Type |
---|---|
args |
Object |
args.ticker |
string |
callback |
SubCallback <boolean > |
Promise
<UnsubCallback
>
▸ registerCustomAssetType(args
, opts?
): Promise
<GenericPolymeshTransaction
<BigNumber
, BigNumber
>>
Register a custom asset type
Name | Type |
---|---|
args |
RegisterCustomAssetTypeParams |
opts? |
ProcedureOpts |
Promise
<GenericPolymeshTransaction
<BigNumber
, BigNumber
>>
Note
this method is of type ProcedureMethod, which means you can call registerCustomAssetType.checkAuthorization on it to see whether the signing Account and Identity have the required roles and permissions to run it
▸ 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
Name | Type |
---|---|
args |
ReserveTickerParams |
opts? |
ProcedureOpts |
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
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