Skip to main content

AssetsExt

Calls

burnFrom

Burns an asset from an account. Caller must be the asset owner Attempting to burn ROOT token will throw an error

Namespace

api.tx.assetsExt.burnFrom

Type

function burnFrom(
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  amount: Compact<u128>
)

createAsset

Creates a new asset with unique ID according to the network asset id scheme.

Namespace

api.tx.assetsExt.createAsset

Type

function createAsset(
  name: Bytes,
  symbol: Bytes,
  decimals: u8,
  min_balance: Option<u128>,
  owner: Option<SeedPrimitivesSignatureAccountId20>
)

mint

Mints an asset to an account if the caller is the asset owner Attempting to mint ROOT token will throw an error

Namespace

api.tx.assetsExt.mint

Type

function mint(
  asset_id: u32,
  beneficiary: SeedPrimitivesSignatureAccountId20,
  amount: Compact<u128>
)

setAssetDeposit

Sudo call to set the asset deposit for creating assets Note, this does not change the deposit when calling create within the assets pallet However that call is filtered

Namespace

api.tx.assetsExt.setAssetDeposit

Type

function setAssetDeposit(
  asset_deposit: u128
)

transfer

Transfers either ROOT or an asset

Namespace

api.tx.assetsExt.transfer

Type

function transfer(
  asset_id: u32,
  destination: SeedPrimitivesSignatureAccountId20,
  amount: Compact<u128>,
  keep_alive: bool
)

Storage

assetDeposit

The minimum deposit for creating an asset

Namespace

api.query.assetsExt.assetDeposit

Type

function assetDeposit(

): u128

holds

The holdings of a specific account for a specific asset.

Namespace

api.query.assetsExt.holds

Type

function holds(
  u32,
  SeedPrimitivesSignatureAccountId20
): Vec<([u8;8],u128)>

nextAssetId

The total units issued in the system.

Namespace

api.query.assetsExt.nextAssetId

Type

function nextAssetId(

): u32

Events

AssetDepositSet

The asset deposit was set

Namespace

api.events.assetsExt.AssetDepositSet

Type

type AssetDepositSet = {
  asset_deposit: u128
}

CreateAsset

New asset has been created

Namespace

api.events.assetsExt.CreateAsset

Type

type CreateAsset = {
  asset_id: u32,
  creator: SeedPrimitivesSignatureAccountId20,
  initial_balance: u128
}

InternalDeposit

Assets were deposited into this account by the system e.g. refunding gas

Namespace

api.events.assetsExt.InternalDeposit

Type

type InternalDeposit = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  amount: u128
}

InternalWithdraw

Assets were withdrawn from this account by the system e.g. paying tx fees

Namespace

api.events.assetsExt.InternalWithdraw

Type

type InternalWithdraw = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  amount: u128
}

PlaceHold

Some assets have been placed on hold by a pallet

Namespace

api.events.assetsExt.PlaceHold

Type

type PlaceHold = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  amount: u128,
  pallet_id: [u8;8]
}

ReleaseHold

Some held assets have been released by a pallet

Namespace

api.events.assetsExt.ReleaseHold

Type

type ReleaseHold = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  amount: u128,
  pallet_id: [u8;8]
}

SpendHold

Some held assets were spend by a pallet

Namespace

api.events.assetsExt.SpendHold

Type

type SpendHold = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  spends: Vec<(SeedPrimitivesSignatureAccountId20,u128)>,
  pallet_id: [u8;8]
}

SplitTransfer

Multi-part transfer of assets from who

Namespace

api.events.assetsExt.SplitTransfer

Type

type SplitTransfer = {
  asset_id: u32,
  who: SeedPrimitivesSignatureAccountId20,
  transfers: Vec<(SeedPrimitivesSignatureAccountId20,u128)>
}

Errors

BalanceLow

Hold balance is less then the required amount

Namespace

api.errors.assetsExt.BalanceLow

CreateAssetFailed

Failed to create a new asset

Namespace

api.errors.assetsExt.CreateAssetFailed

DecimalsTooHigh

Decimals cannot be higher than 18

Namespace

api.errors.assetsExt.DecimalsTooHigh

MaxHolds

Maximum holds placed on this asset/account pair

Namespace

api.errors.assetsExt.MaxHolds

NoAccount

The account to alter does not exist

Namespace

api.errors.assetsExt.NoAccount

NoAvailableIds

No more Ids are available, they've been exhausted

Namespace

api.errors.assetsExt.NoAvailableIds

NoPermission

The signer does not have permission to perform this action

Namespace

api.errors.assetsExt.NoPermission

Overflow

Operation would overflow

Namespace

api.errors.assetsExt.Overflow

Constants

maxHolds

The maximum * of holds per asset & account

Namespace

api.consts.assetsExt.maxHolds

Type

type maxHolds = u32

nativeAssetId

The native token asset Id (managed by pallet-balances)

Namespace

api.consts.assetsExt.nativeAssetId

Type

type nativeAssetId = u32

palletId

This pallet's Id, used for deriving a sovereign account ID

Namespace

api.consts.assetsExt.palletId

Type

type palletId = FrameSupportPalletId