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.burnFromType
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.createAssetType
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.mintType
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.setAssetDepositType
function setAssetDeposit(
asset_deposit: u128
)transfer
Transfers either ROOT or an asset
Namespace
api.tx.assetsExt.transferType
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.assetDepositType
function assetDeposit(
): u128holds
The holdings of a specific account for a specific asset.
Namespace
api.query.assetsExt.holdsType
function holds(
u32,
SeedPrimitivesSignatureAccountId20
): Vec<([u8;8],u128)>nextAssetId
The total units issued in the system.
Namespace
api.query.assetsExt.nextAssetIdType
function nextAssetId(
): u32Events
AssetDepositSet
The asset deposit was set
Namespace
api.events.assetsExt.AssetDepositSetType
type AssetDepositSet = {
asset_deposit: u128
}CreateAsset
New asset has been created
Namespace
api.events.assetsExt.CreateAssetType
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.InternalDepositType
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.InternalWithdrawType
type InternalWithdraw = {
asset_id: u32,
who: SeedPrimitivesSignatureAccountId20,
amount: u128
}PlaceHold
Some assets have been placed on hold by a pallet
Namespace
api.events.assetsExt.PlaceHoldType
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.ReleaseHoldType
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.SpendHoldType
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.SplitTransferType
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.BalanceLowCreateAssetFailed
Failed to create a new asset
Namespace
api.errors.assetsExt.CreateAssetFailedDecimalsTooHigh
Decimals cannot be higher than 18
Namespace
api.errors.assetsExt.DecimalsTooHighMaxHolds
Maximum holds placed on this asset/account pair
Namespace
api.errors.assetsExt.MaxHoldsNoAccount
The account to alter does not exist
Namespace
api.errors.assetsExt.NoAccountNoAvailableIds
No more Ids are available, they've been exhausted
Namespace
api.errors.assetsExt.NoAvailableIdsNoPermission
The signer does not have permission to perform this action
Namespace
api.errors.assetsExt.NoPermissionOverflow
Operation would overflow
Namespace
api.errors.assetsExt.OverflowConstants
maxHolds
The maximum * of holds per asset & account
Namespace
api.consts.assetsExt.maxHoldsType
type maxHolds = u32nativeAssetId
The native token asset Id (managed by pallet-balances)
Namespace
api.consts.assetsExt.nativeAssetIdType
type nativeAssetId = u32palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
api.consts.assetsExt.palletIdType
type palletId = FrameSupportPalletId