extrinsics.md

title: Extrinsics
The following sections contain Extrinsics methods are part of the default Substrate runtime. On the api, these are exposed via api.tx.<module>.<method>
.
(NOTE: These were generated from a static/snapshot view of a recent Substrate master node. Some items may not be available in older nodes, or in any customized implementations.)
assets
Compact<u32>
, delegate: MultiAddress
, amount: Compact<u64>
)
approveTransfer(id: -
interface:
api.tx.assets.approveTransfer
-
summary: Approve an amount of asset for transfer by a delegated third-party account.
Origin must be Signed.
Ensures that
ApprovalDeposit
worth ofCurrency
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 todelegate
, 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.
Emits
ApprovedTransfer
on success.Weight:
O(1)
-
Compact<u32>
, who: MultiAddress
, amount: Compact<u64>
)
burn(id: -
interface:
api.tx.assets.burn
-
summary: Reduce the balance of
who
by as much as possible up toamount
assets ofid
.Origin must be Signed and the sender should be the Manager of the asset
id
.Bails with
BalanceZero
if thewho
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.
Emits
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 ofwho
; Pre & post Zombie-status ofwho
. -
Compact<u32>
, delegate: MultiAddress
)
cancelApproval(id: -
interface:
api.tx.assets.cancelApproval
-
summary: 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 and
delegate
.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.
Emits
ApprovalCancelled
on success.Weight:
O(1)
-
Compact<u32>
)
clearMetadata(id: -
interface:
api.tx.assets.clearMetadata
-
summary: Clear the metadata for an asset.
Origin must be Signed and the sender should be the Owner of the asset
id
.Any deposit is freed for the asset owner.
-
id
: The identifier of the asset to clear.
Emits
MetadataCleared
.Weight:
O(1)
-
Compact<u32>
, admin: MultiAddress
, min_balance: u64
)
create(id: -
interface:
api.tx.assets.create
-
summary: 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 by
AssetDeposit
.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.
Emits
Created
event when successful.Weight:
O(1)
-
Compact<u32>
, witness: PalletAssetsDestroyWitness
)
destroy(id: -
interface:
api.tx.assets.destroy
-
summary: Destroy a class of fungible assets.
The origin must conform to
ForceOrigin
or must be Signed and the sender must be the owner of the assetid
.-
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
Emits
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
-
Compact<u32>
, owner: MultiAddress
, issuer: MultiAddress
, admin: MultiAddress
, freezer: MultiAddress
, min_balance: Compact<u64>
, is_sufficient: bool
, is_frozen: bool
)
forceAssetStatus(id: -
interface:
api.tx.assets.forceAssetStatus
-
summary: Alter the attributes of a given asset.
Origin must be
ForceOrigin
.-
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.
Emits
AssetStatusChanged
with the identity of the asset.Weight:
O(1)
-
Compact<u32>
, owner: MultiAddress
, delegate: MultiAddress
)
forceCancelApproval(id: -
interface:
api.tx.assets.forceCancelApproval
-
summary: 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 asset
id
.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.
Emits
ApprovalCancelled
on success.Weight:
O(1)
-
Compact<u32>
)
forceClearMetadata(id: -
interface:
api.tx.assets.forceClearMetadata
-
summary: Clear the metadata for an asset.
Origin must be ForceOrigin.
Any deposit is returned.
-
id
: The identifier of the asset to clear.
Emits
MetadataCleared
.Weight:
O(1)
-
Compact<u32>
, owner: MultiAddress
, is_sufficient: bool
, min_balance: Compact<u64>
)
forceCreate(id: -
interface:
api.tx.assets.forceCreate
-
summary: Issue a new class of fungible assets from a privileged origin.
This new asset class has no assets initially.
The origin must conform to
ForceOrigin
.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.
Emits
ForceCreated
event when successful.Weight:
O(1)
-
Compact<u32>
, name: Bytes
, symbol: Bytes
, decimals: u8
, is_frozen: bool
)
forceSetMetadata(id: -
interface:
api.tx.assets.forceSetMetadata
-
summary: 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.
Emits
MetadataSet
.Weight:
O(N + S)
where N and S are the length of the name and symbol respectively. -
Compact<u32>
, source: MultiAddress
, dest: MultiAddress
, amount: Compact<u64>
)
forceTransfer(id: -
interface:
api.tx.assets.forceTransfer
-
summary: Move some assets from one account to another.
Origin must be Signed and the sender should be the Admin of the asset
id
.-
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.
Emits
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 ofdest
; Post-existence ofsource
; Account pre-existence ofdest
. -