Calls
approveTransfer
Approve an amount of asset for transfer by a delegated third-party account. Origin must be Signed. Ensures thatApprovalDeposit
worth of Currency
is reserved from signing account for the purpose of holding the approval. If some non-zero amount of assets is already approved from signing account to delegate
, then it is topped up or unreserved to meet the right value.
NOTE: The signing account does not need to own amount
of assets at the point of making this call.
-
id
: The identifier of the asset. -
delegate
: The account to delegate permission to transfer asset. -
amount
: The amount of asset that may be transferred bydelegate
. If there is already an approval in place, then this acts additively.
ApprovedTransfer
on success.
Weight: O(1)
Namespace
burn
Reduce the balance ofwho
by as much as possible up to amount
assets of id
.
Origin must be Signed and the sender should be the Manager of the asset id
.
Bails with NoAccount
if the who
is already dead.
-
id
: The identifier of the asset to have some amount burned. -
who
: The account to be debited from. -
amount
: The maximum amount by whichwho
’s balance should be reduced.
Burned
with the actual amount burned. If this takes the balance to below the minimum for the asset, then the amount burned is increased to take it to zero.
Weight: O(1)
Modes: Post-existence of who
; Pre & post Zombie-status of who
.
Namespace
cancelApproval
Cancel all of some asset approved for delegated transfer by a third-party account. Origin must be Signed and there must be an approval in place between signer anddelegate
.
Unreserves any deposit previously reserved by approve_transfer
for the approval.
-
id
: The identifier of the asset. -
delegate
: The account delegated permission to transfer asset.
ApprovalCancelled
on success.
Weight: O(1)
Namespace
clearMetadata
Clear the metadata for an asset. Origin must be Signed and the sender should be the Owner of the assetid
.
Any deposit is freed for the asset owner.
id
: The identifier of the asset to clear.
MetadataCleared
.
Weight: O(1)
Namespace
create
Issue a new class of fungible assets from a public origin. This new asset class has no assets initially and its owner is the origin. The origin must be Signed and the sender must have sufficient funds free. Funds of sender are reserved byAssetDeposit
.
Parameters:
-
id
: The identifier of the new asset. This must not be currently in use to identify an existing asset. -
admin
: The admin of this class of assets. The admin is the initial address of each member of the asset class’s admin team. -
min_balance
: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.
Created
event when successful.
Weight: O(1)
Namespace
destroy
Destroy a class of fungible assets. The origin must conform toForceOrigin
or must be Signed and the sender must be the owner of the asset id
.
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
Destroyed
event when successful.
NOTE: It can be helpful to first freeze an asset before destroying it so that you can provide accurate witness information and prevent users from manipulating state in a way that can make it harder to destroy.
Weight: O(c + p + a)
where:
-
c = (witness.accounts - witness.sufficients)
-
s = witness.sufficients
-
a = witness.approvals
forceAssetStatus
Alter the attributes of a given asset. Origin must beForceOrigin
.
-
id
: The identifier of the asset. -
owner
: The new Owner of this asset. -
issuer
: The new Issuer of this asset. -
admin
: The new Admin of this asset. -
freezer
: The new Freezer of this asset. -
min_balance
: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero. -
is_sufficient
: Whether a non-zero balance of this asset is deposit of sufficient value to account for the state bloat associated with its balance storage. If set totrue
, then non-zero balances may be stored without aconsumer
reference (and thus an ED in the Balances pallet or whatever else is used to control user-account state growth). -
is_frozen
: Whether this asset class is frozen except for permissioned/admin instructions.
AssetStatusChanged
with the identity of the asset.
Weight: O(1)
Namespace
forceCancelApproval
Cancel all of some asset approved for delegated transfer by a third-party account. Origin must be either ForceOrigin or Signed origin with the signer being the Admin account of the assetid
.
Unreserves any deposit previously reserved by approve_transfer
for the approval.
-
id
: The identifier of the asset. -
delegate
: The account delegated permission to transfer asset.
ApprovalCancelled
on success.
Weight: O(1)
Namespace
forceClearMetadata
Clear the metadata for an asset. Origin must be ForceOrigin. Any deposit is returned.id
: The identifier of the asset to clear.
MetadataCleared
.
Weight: O(1)
Namespace
forceCreate
Issue a new class of fungible assets from a privileged origin. This new asset class has no assets initially. The origin must conform toForceOrigin
.
Unlike create
, no funds are reserved.
-
id
: The identifier of the new asset. This must not be currently in use to identify an existing asset. -
owner
: The owner of this class of assets. The owner has full superuser permissions over this asset, but may later change and configure the permissions usingtransfer_ownership
andset_team
. -
min_balance
: The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.
ForceCreated
event when successful.
Weight: O(1)
Namespace
forceSetMetadata
Force the metadata for an asset to some value. Origin must be ForceOrigin. Any deposit is left alone.-
id
: The identifier of the asset to update. -
name
: The user friendly name of this asset. Limited in length byStringLimit
. -
symbol
: The exchange symbol for this asset. Limited in length byStringLimit
. -
decimals
: The number of decimals this asset uses to represent one unit.
MetadataSet
.
Weight: O(N + S)
where N and S are the length of the name and symbol respectively.
Namespace
forceTransfer
Move some assets from one account to another. Origin must be Signed and the sender should be the Admin of the assetid
.
-
id
: The identifier of the asset to have some amount transferred. -
source
: The account to be debited. -
dest
: The account to be credited. -
amount
: The amount by which thesource
’s balance of assets should be reduced anddest
’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take thesource
balance above zero but below the minimum balance. Must be greater than zero.
Transferred
with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.
Weight: O(1)
Modes: Pre-existence of dest
; Post-existence of source
; Account pre-existence of dest
.
Namespace
freeze
Disallow further unprivileged transfers from an account. Origin must be Signed and the sender should be the Freezer of the assetid
.
-
id
: The identifier of the asset to be frozen. -
who
: The account to be frozen.
Frozen
.
Weight: O(1)
Namespace
freezeAsset
Disallow further unprivileged transfers for the asset class. Origin must be Signed and the sender should be the Freezer of the assetid
.
id
: The identifier of the asset to be frozen.
Frozen
.
Weight: O(1)
Namespace
mint
Mint assets of a particular class. The origin must be Signed and the sender must be the Issuer of the assetid
.
-
id
: The identifier of the asset to have some amount minted. -
beneficiary
: The account to be credited with the minted assets. -
amount
: The amount of the asset to be minted.
Issued
event when successful.
Weight: O(1)
Modes: Pre-existing balance of beneficiary
; Account pre-existence of beneficiary
.
Namespace
refund
Return the deposit (if any) of an asset account. The origin must be Signed.-
id
: The identifier of the asset for the account to be created. -
allow_burn
: Iftrue
then assets may be destroyed in order to complete the refund.
Refunded
event when successful.
Namespace
setMetadata
Set the metadata for an asset. Origin must be Signed and the sender should be the Owner of the assetid
.
Funds of sender are reserved according to the formula: MetadataDepositBase + MetadataDepositPerByte * (name.len + symbol.len)
taking into account any already reserved funds.
-
id
: The identifier of the asset to update. -
name
: The user friendly name of this asset. Limited in length byStringLimit
. -
symbol
: The exchange symbol for this asset. Limited in length byStringLimit
. -
decimals
: The number of decimals this asset uses to represent one unit.
MetadataSet
.
Weight: O(1)
Namespace
setTeam
Change the Issuer, Admin and Freezer of an asset. Origin must be Signed and the sender should be the Owner of the assetid
.
-
id
: The identifier of the asset to be frozen. -
issuer
: The new Issuer of this asset. -
admin
: The new Admin of this asset. -
freezer
: The new Freezer of this asset.
TeamChanged
.
Weight: O(1)
Namespace
thaw
Allow unprivileged transfers from an account again. Origin must be Signed and the sender should be the Admin of the assetid
.
-
id
: The identifier of the asset to be frozen. -
who
: The account to be unfrozen.
Thawed
.
Weight: O(1)
Namespace
thawAsset
Allow unprivileged transfers for the asset again. Origin must be Signed and the sender should be the Admin of the assetid
.
id
: The identifier of the asset to be thawed.
Thawed
.
Weight: O(1)
Namespace
touch
Create an asset account for non-provider assets. A deposit will be taken from the signer account.-
origin
: Must be Signed; the signer account must have sufficient funds for a deposit to be taken. -
id
: The identifier of the asset for the account to be created.
Touched
event when successful.
Namespace
transfer
Move some assets from the sender account to another. Origin must be Signed.-
id
: The identifier of the asset to have some amount transferred. -
target
: The account to be credited. -
amount
: The amount by which the sender’s balance of assets should be reduced andtarget
’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the sender balance above zero but below the minimum balance. Must be greater than zero.
Transferred
with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.
Weight: O(1)
Modes: Pre-existence of target
; Post-existence of sender; Account pre-existence of target
.
Namespace
transferApproved
Transfer some asset balance from a previously delegated account to some third-party account. Origin must be Signed and there must be an approval in place by theowner
to the signer.
If the entire amount approved for transfer is transferred, then any deposit previously reserved by approve_transfer
is unreserved.
-
id
: The identifier of the asset. -
owner
: The account which previously approved for a transfer of at leastamount
and from which the asset balance will be withdrawn. -
destination
: The account to which the asset balance ofamount
will be transferred. -
amount
: The amount of assets to transfer.
TransferredApproved
on success.
Weight: O(1)
Namespace
transferKeepAlive
Move some assets from the sender account to another, keeping the sender account alive. Origin must be Signed.-
id
: The identifier of the asset to have some amount transferred. -
target
: The account to be credited. -
amount
: The amount by which the sender’s balance of assets should be reduced andtarget
’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the sender balance above zero but below the minimum balance. Must be greater than zero.
Transferred
with the actual amount transferred. If this takes the source balance to below the minimum for the asset, then the amount transferred is increased to take it to zero.
Weight: O(1)
Modes: Pre-existence of target
; Post-existence of sender; Account pre-existence of target
.
Namespace
transferOwnership
Change the Owner of an asset. Origin must be Signed and the sender should be the Owner of the assetid
.
-
id
: The identifier of the asset. -
owner
: The new Owner of this asset.
OwnerChanged
.
Weight: O(1)
Namespace
Storage
account
The holdings of a specific account for a specific asset. Namespaceapprovals
Approved balance transfers. First balance is the amount approved for transfer. Second is the amount ofT::Currency
reserved for storing this. First key is the asset ID, second key is the owner and third key is the delegate.
Namespace
asset
Details of an asset. Namespacemetadata
Metadata of an asset. NamespaceEvents
ApprovalCancelled
An approval for accountdelegate
was cancelled by owner
.
Namespace
ApprovedTransfer
(Additional) funds have been approved for transfer to a destination account. NamespaceAssetFrozen
Some assetasset_id
was frozen.
Namespace
AssetStatusChanged
An asset has had its attributes changed by theForce
origin.
Namespace
AssetThawed
Some assetasset_id
was thawed.
Namespace
Burned
Some assets were destroyed. NamespaceCreated
Some asset class was created. NamespaceDestroyed
An asset class was destroyed. NamespaceForceCreated
Some asset class was force-created. NamespaceFrozen
Some accountwho
was frozen.
Namespace
Issued
Some assets were issued. NamespaceMetadataCleared
Metadata has been cleared for an asset. NamespaceMetadataSet
New metadata has been set for an asset. NamespaceOwnerChanged
The owner changed. NamespaceTeamChanged
The management team changed. NamespaceThawed
Some accountwho
was thawed.
Namespace
Transferred
Some assets were transferred. NamespaceTransferredApproved
Anamount
was transferred in its entirety from owner
to destination
by the approved delegate
.
Namespace