Calls
burnFrom
Burns an asset from an account. Caller must be the asset owner Attempting to burn ROOT token will throw an error
Namespace
Copy api.tx.assetsExt.burnFrom
Type
Copy 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
Copy api.tx.assetsExt.createAsset
Type
Copy 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
Copy api.tx.assetsExt.mint
Type
Copy 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
Copy api.tx.assetsExt.setAssetDeposit
Type
Copy function setAssetDeposit (
asset_deposit : u128
)
transfer
Transfers either ROOT or an asset
Namespace
Copy api.tx.assetsExt.transfer
Type
Copy function transfer (
asset_id : u32 ,
destination : SeedPrimitivesSignatureAccountId20 ,
amount : Compact < u128 > ,
keep_alive : bool
)
Storage
assetDeposit
The minimum deposit for creating an asset
Namespace
Copy api.query.assetsExt.assetDeposit
Type
Copy function assetDeposit (
) : u128
holds
The holdings of a specific account for a specific asset.
Namespace
Copy api.query.assetsExt.holds
Type
Copy function holds (
u32 ,
SeedPrimitivesSignatureAccountId20
) : Vec <([ u8 ; 8 ] , u128 )>
nextAssetId
The total units issued in the system.
Namespace
Copy api.query.assetsExt.nextAssetId
Type
Copy function nextAssetId (
) : u32
Events
AssetDepositSet
The asset deposit was set
Namespace
Copy api.events.assetsExt.AssetDepositSet
Type
Copy type AssetDepositSet = {
asset_deposit : u128
}
CreateAsset
New asset has been created
Namespace
Copy api.events.assetsExt.CreateAsset
Type
Copy 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
Copy api.events.assetsExt.InternalDeposit
Type
Copy 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
Copy api.events.assetsExt.InternalWithdraw
Type
Copy type InternalWithdraw = {
asset_id : u32 ,
who : SeedPrimitivesSignatureAccountId20 ,
amount : u128
}
PlaceHold
Some assets have been placed on hold by a pallet
Namespace
Copy api.events.assetsExt.PlaceHold
Type
Copy type PlaceHold = {
asset_id : u32 ,
who : SeedPrimitivesSignatureAccountId20 ,
amount : u128 ,
pallet_id : [ u8 ; 8 ]
}
ReleaseHold
Some held assets have been released by a pallet
Namespace
Copy api.events.assetsExt.ReleaseHold
Type
Copy type ReleaseHold = {
asset_id : u32 ,
who : SeedPrimitivesSignatureAccountId20 ,
amount : u128 ,
pallet_id : [ u8 ; 8 ]
}
SpendHold
Some held assets were spend by a pallet
Namespace
Copy api.events.assetsExt.SpendHold
Type
Copy type SpendHold = {
asset_id : u32 ,
who : SeedPrimitivesSignatureAccountId20 ,
spends : Vec <(SeedPrimitivesSignatureAccountId20 , u128)> ,
pallet_id : [ u8 ; 8 ]
}
SplitTransfer
Multi-part transfer of assets from who
Namespace
Copy api.events.assetsExt.SplitTransfer
Type
Copy type SplitTransfer = {
asset_id : u32 ,
who : SeedPrimitivesSignatureAccountId20 ,
transfers : Vec <(SeedPrimitivesSignatureAccountId20 , u128)>
}
Errors
BalanceLow
Hold balance is less then the required amount
Namespace
Copy api.errors.assetsExt.BalanceLow
CreateAssetFailed
Failed to create a new asset
Namespace
Copy api.errors.assetsExt.CreateAssetFailed
DecimalsTooHigh
Decimals cannot be higher than 18
Namespace
Copy api.errors.assetsExt.DecimalsTooHigh
MaxHolds
Maximum holds placed on this asset/account pair
Namespace
Copy api.errors.assetsExt.MaxHolds
NoAccount
The account to alter does not exist
Namespace
Copy api.errors.assetsExt.NoAccount
NoAvailableIds
No more Ids are available, they've been exhausted
Namespace
Copy api.errors.assetsExt.NoAvailableIds
NoPermission
The signer does not have permission to perform this action
Namespace
Copy api.errors.assetsExt.NoPermission
Overflow
Operation would overflow
Namespace
Copy api.errors.assetsExt.Overflow
Constants
maxHolds
The maximum * of holds per asset & account
Namespace
Copy api.consts.assetsExt.maxHolds
Type
nativeAssetId
The native token asset Id (managed by pallet-balances)
Namespace
Copy api.consts.assetsExt.nativeAssetId
Type
Copy type nativeAssetId = u32
palletId
This pallet's Id, used for deriving a sovereign account ID
Namespace
Copy api.consts.assetsExt.palletId
Type
Copy type palletId = FrameSupportPalletId