pub type Assets = Pallet<Runtime, Instance1>;
Aliased Type§
struct Assets(/* private fields */);
Implementations
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn adjust_extra(
id: <T as Config<I>>::AssetId,
who: impl Borrow<<T as Config>::AccountId>,
) -> Option<ExtraMutator<T, I>>
pub fn adjust_extra( id: <T as Config<I>>::AssetId, who: impl Borrow<<T as Config>::AccountId>, ) -> Option<ExtraMutator<T, I>>
Return the extra “sid-car” data for id
/who
, or None
if the account doesn’t exist.
Sourcepub fn balance(
id: <T as Config<I>>::AssetId,
who: impl Borrow<<T as Config>::AccountId>,
) -> <T as Config<I>>::Balance
pub fn balance( id: <T as Config<I>>::AssetId, who: impl Borrow<<T as Config>::AccountId>, ) -> <T as Config<I>>::Balance
Get the asset id
balance of who
, or zero if the asset-account doesn’t exist.
Sourcepub fn maybe_balance(
id: <T as Config<I>>::AssetId,
who: impl Borrow<<T as Config>::AccountId>,
) -> Option<<T as Config<I>>::Balance>
pub fn maybe_balance( id: <T as Config<I>>::AssetId, who: impl Borrow<<T as Config>::AccountId>, ) -> Option<<T as Config<I>>::Balance>
Get the asset id
balance of who
if the asset-account exists.
Sourcepub fn total_supply(id: <T as Config<I>>::AssetId) -> <T as Config<I>>::Balance
pub fn total_supply(id: <T as Config<I>>::AssetId) -> <T as Config<I>>::Balance
Get the total supply of an asset id
.
Source§impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Pallet<T, I>where
T: Config<I>,
I: 'static,
Sourcepub fn create(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
admin: <<T as Config>::Lookup as StaticLookup>::Source,
min_balance: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn create( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, admin: <<T as Config>::Lookup as StaticLookup>::Source, min_balance: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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 conform to the configured CreateOrigin
and 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. IfNextAssetId
is set, then this must be equal to it.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)
Sourcepub fn force_create(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
owner: <<T as Config>::Lookup as StaticLookup>::Source,
is_sufficient: bool,
min_balance: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn force_create( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, is_sufficient: bool, min_balance: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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. IfNextAssetId
is set, then this must be equal to it.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)
Sourcepub fn start_destroy(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn start_destroy( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
Start the process of destroying a fungible asset class.
start_destroy
is the first in a series of extrinsics that should be called, to allow
destruction of an asset class.
The origin must conform to ForceOrigin
or must be Signed
by the asset’s owner
.
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
It will fail with either Error::ContainsHolds
or Error::ContainsFreezes
if
an account contains holds or freezes in place.
Sourcepub fn destroy_accounts(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn destroy_accounts( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Destroy all accounts associated with a given asset.
destroy_accounts
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state.
Due to weight restrictions, this function may need to be called multiple times to fully
destroy all accounts. It will destroy RemoveItemsLimit
accounts at a time.
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
Each call emits the Event::DestroyedAccounts
event.
Sourcepub fn destroy_approvals(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
pub fn destroy_approvals( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>
Destroy all approvals associated with a given asset up to the max (T::RemoveItemsLimit).
destroy_approvals
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state.
Due to weight restrictions, this function may need to be called multiple times to fully
destroy all approvals. It will destroy RemoveItemsLimit
approvals at a time.
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
Each call emits the Event::DestroyedApprovals
event.
Sourcepub fn finish_destroy(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn finish_destroy( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
Complete destroying asset and unreserve currency.
finish_destroy
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state. All accounts or approvals should be destroyed before
hand.
id
: The identifier of the asset to be destroyed. This must identify an existing asset.
Each successful call emits the Event::Destroyed
event.
Sourcepub fn mint(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
beneficiary: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn mint( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, beneficiary: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
Mint assets of a particular class.
The origin must be Signed and the sender must be the Issuer of the asset id
.
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.
Emits Issued
event when successful.
Weight: O(1)
Modes: Pre-existing balance of beneficiary
; Account pre-existence of beneficiary
.
Sourcepub fn burn(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn burn( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
Reduce the balance of who
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.
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 of who
; Pre & post Zombie-status of who
.
Sourcepub fn transfer(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
target: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn transfer( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, target: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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.
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 of target
; Post-existence of sender; Account pre-existence of
target
.
Sourcepub fn transfer_keep_alive(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
target: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn transfer_keep_alive( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, target: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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.
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 of target
; Post-existence of sender; Account pre-existence of
target
.
Sourcepub fn force_transfer(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
source: <<T as Config>::Lookup as StaticLookup>::Source,
dest: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn force_transfer( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, source: <<T as Config>::Lookup as StaticLookup>::Source, dest: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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 of dest
; Post-existence of source
; Account pre-existence of
dest
.
Sourcepub fn freeze(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn freeze( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Disallow further unprivileged transfers of an asset id
from an account who
. who
must already exist as an entry in Account
s of the asset. If you want to freeze an
account that does not have an entry, use touch_other
first.
Origin must be Signed and the sender should be the Freezer of the asset id
.
id
: The identifier of the asset to be frozen.who
: The account to be frozen.
Emits Frozen
.
Weight: O(1)
Sourcepub fn thaw(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn thaw( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Allow unprivileged transfers to and from an account again.
Origin must be Signed and the sender should be the Admin of the asset id
.
id
: The identifier of the asset to be frozen.who
: The account to be unfrozen.
Emits Thawed
.
Weight: O(1)
Sourcepub fn freeze_asset(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn freeze_asset( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
Disallow further unprivileged transfers for the asset class.
Origin must be Signed and the sender should be the Freezer of the asset id
.
id
: The identifier of the asset to be frozen.
Emits Frozen
.
Weight: O(1)
Sourcepub fn thaw_asset(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn thaw_asset( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
Allow unprivileged transfers for the asset again.
Origin must be Signed and the sender should be the Admin of the asset id
.
id
: The identifier of the asset to be thawed.
Emits Thawed
.
Weight: O(1)
Sourcepub fn transfer_ownership(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
owner: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn transfer_ownership( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Change the Owner of an asset.
Origin must be Signed and the sender should be the Owner of the asset id
.
id
: The identifier of the asset.owner
: The new Owner of this asset.
Emits OwnerChanged
.
Weight: O(1)
Sourcepub fn set_team(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
issuer: <<T as Config>::Lookup as StaticLookup>::Source,
admin: <<T as Config>::Lookup as StaticLookup>::Source,
freezer: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn set_team( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Change the Issuer, Admin and Freezer of an asset.
Origin must be Signed and the sender should be the Owner of the asset id
.
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.
Emits TeamChanged
.
Weight: O(1)
Sourcepub fn set_metadata(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
name: Vec<u8>,
symbol: Vec<u8>,
decimals: u8,
) -> Result<(), DispatchError>
pub fn set_metadata( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, name: Vec<u8>, symbol: Vec<u8>, decimals: u8, ) -> Result<(), DispatchError>
Set the metadata for an asset.
Origin must be Signed and the sender should be the Owner of the asset id
.
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.
Emits MetadataSet
.
Weight: O(1)
Sourcepub fn clear_metadata(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn clear_metadata( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
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)
Sourcepub fn force_set_metadata(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
name: Vec<u8>,
symbol: Vec<u8>,
decimals: u8,
is_frozen: bool,
) -> Result<(), DispatchError>
pub fn force_set_metadata( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, name: Vec<u8>, symbol: Vec<u8>, decimals: u8, is_frozen: bool, ) -> Result<(), DispatchError>
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.
Sourcepub fn force_clear_metadata(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn force_clear_metadata( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
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)
Sourcepub fn force_asset_status(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
owner: <<T as Config>::Lookup as StaticLookup>::Source,
issuer: <<T as Config>::Lookup as StaticLookup>::Source,
admin: <<T as Config>::Lookup as StaticLookup>::Source,
freezer: <<T as Config>::Lookup as StaticLookup>::Source,
min_balance: <T as Config<I>>::Balance,
is_sufficient: bool,
is_frozen: bool,
) -> Result<(), DispatchError>
pub fn force_asset_status( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, issuer: <<T as Config>::Lookup as StaticLookup>::Source, admin: <<T as Config>::Lookup as StaticLookup>::Source, freezer: <<T as Config>::Lookup as StaticLookup>::Source, min_balance: <T as Config<I>>::Balance, is_sufficient: bool, is_frozen: bool, ) -> Result<(), DispatchError>
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)
Sourcepub fn approve_transfer(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
delegate: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn approve_transfer( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, delegate: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
Approve an amount of asset for transfer by a delegated third-party account.
Origin must be Signed.
Ensures that ApprovalDeposit
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.
Emits ApprovedTransfer
on success.
Weight: O(1)
Sourcepub fn cancel_approval(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
delegate: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn cancel_approval( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, delegate: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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)
Sourcepub fn force_cancel_approval(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
owner: <<T as Config>::Lookup as StaticLookup>::Source,
delegate: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn force_cancel_approval( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, delegate: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
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)
Sourcepub fn transfer_approved(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
owner: <<T as Config>::Lookup as StaticLookup>::Source,
destination: <<T as Config>::Lookup as StaticLookup>::Source,
amount: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn transfer_approved( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, owner: <<T as Config>::Lookup as StaticLookup>::Source, destination: <<T as Config>::Lookup as StaticLookup>::Source, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
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 the owner
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.
Emits TransferredApproved
on success.
Weight: O(1)
Sourcepub fn touch(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
) -> Result<(), DispatchError>
pub fn touch( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, ) -> Result<(), DispatchError>
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.
Emits Touched
event when successful.
Sourcepub fn refund(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
allow_burn: bool,
) -> Result<(), DispatchError>
pub fn refund( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, allow_burn: bool, ) -> Result<(), DispatchError>
Return the deposit (if any) of an asset account or a consumer reference (if any) of an account.
The origin must be Signed.
id
: The identifier of the asset for which the caller would like the deposit refunded.allow_burn
: Iftrue
then assets may be destroyed in order to complete the refund.
It will fail with either Error::ContainsHolds
or Error::ContainsFreezes
if
the asset account contains holds or freezes in place.
Emits Refunded
event when successful.
Sourcepub fn set_min_balance(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
min_balance: <T as Config<I>>::Balance,
) -> Result<(), DispatchError>
pub fn set_min_balance( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, min_balance: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
Sets the minimum balance of an asset.
Only works if there aren’t any accounts that are holding the asset or if
the new value of min_balance
is less than the old one.
Origin must be Signed and the sender has to be the Owner of the
asset id
.
id
: The identifier of the asset.min_balance
: The new value ofmin_balance
.
Emits AssetMinBalanceChanged
event when successful.
Sourcepub fn touch_other(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn touch_other( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Create an asset account for who
.
A deposit will be taken from the signer account.
origin
: Must be Signed byFreezer
orAdmin
of the assetid
; 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.who
: The account to be created.
Emits Touched
event when successful.
Sourcepub fn refund_other(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn refund_other( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Return the deposit (if any) of a target asset account. Useful if you are the depositor.
The origin must be Signed and either the account owner, depositor, or asset Admin
. In
order to burn a non-zero balance of the asset, the caller must be the account and should
use refund
.
id
: The identifier of the asset for the account holding a deposit.who
: The account to refund.
It will fail with either Error::ContainsHolds
or Error::ContainsFreezes
if
the asset account contains holds or freezes in place.
Emits Refunded
event when successful.
Sourcepub fn block(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
who: <<T as Config>::Lookup as StaticLookup>::Source,
) -> Result<(), DispatchError>
pub fn block( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, who: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>
Disallow further unprivileged transfers of an asset id
to and from an account who
.
Origin must be Signed and the sender should be the Freezer of the asset id
.
id
: The identifier of the account’s asset.who
: The account to be unblocked.
Emits Blocked
.
Weight: O(1)
Sourcepub fn transfer_all(
origin: <T as Config>::RuntimeOrigin,
id: <T as Config<I>>::AssetIdParameter,
dest: <<T as Config>::Lookup as StaticLookup>::Source,
keep_alive: bool,
) -> Result<(), DispatchError>
pub fn transfer_all( origin: <T as Config>::RuntimeOrigin, id: <T as Config<I>>::AssetIdParameter, dest: <<T as Config>::Lookup as StaticLookup>::Source, keep_alive: bool, ) -> Result<(), DispatchError>
Transfer the entire transferable balance from the caller asset account.
NOTE: This function only attempts to transfer transferable balances. This means that
any held, frozen, or minimum balance (when keep_alive
is true
), will not be
transferred by this function. To ensure that this function results in a killed account,
you might need to prepare the account by removing any reference counters, storage
deposits, etc…
The dispatch origin of this call must be Signed.
id
: The identifier of the asset for the account holding a deposit.dest
: The recipient of the transfer.keep_alive
: A boolean to determine if thetransfer_all
operation should send all of the funds the asset account has, causing the sender asset account to be killed (false), or transfer everything except at least the minimum balance, which will guarantee to keep the sender asset account alive (true).
Trait Implementations
Source§impl<T, I> AccountTouch<<T as Config<I>>::AssetId, <T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> AccountTouch<<T as Config<I>>::AssetId, <T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Implements AccountTouch
trait.
Note that a depositor can be any account, without any specific privilege.
This implementation is supposed to be used only for creation of system accounts.
Source§type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
Source§fn deposit_required(
_: <T as Config<I>>::AssetId,
) -> <Pallet<T, I> as AccountTouch<<T as Config<I>>::AssetId, <T as Config>::AccountId>>::Balance
fn deposit_required( _: <T as Config<I>>::AssetId, ) -> <Pallet<T, I> as AccountTouch<<T as Config<I>>::AssetId, <T as Config>::AccountId>>::Balance
asset
.Source§impl<T, I> Balanced<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Balanced<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§type OnDropCredit = DecreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>
type OnDropCredit = DecreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>
Credit
is dropped without being
used.Source§type OnDropDebt = IncreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>
type OnDropDebt = IncreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>
Debt
is dropped without being used.fn done_deposit( asset_id: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
fn done_withdraw( asset_id: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
Source§fn rescind(
asset: Self::AssetId,
amount: Self::Balance,
) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>
fn rescind( asset: Self::AssetId, amount: Self::Balance, ) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>
amount
and return the according imbalance. The imbalance will
typically be used to reduce an account by the same amount with e.g. settle
. Read moreSource§fn issue(
asset: Self::AssetId,
amount: Self::Balance,
) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>
fn issue( asset: Self::AssetId, amount: Self::Balance, ) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>
amount
and return the according imbalance. The imbalance
will typically be used to increase an account by the same amount with e.g.
resolve_into_existing
or resolve_creating
. Read moreSource§fn pair(
asset: Self::AssetId,
amount: Self::Balance,
) -> Result<(Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>), DispatchError>
fn pair( asset: Self::AssetId, amount: Self::Balance, ) -> Result<(Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>), DispatchError>
Source§fn deposit(
asset: Self::AssetId,
who: &AccountId,
value: Self::Balance,
precision: Precision,
) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, DispatchError>
fn deposit( asset: Self::AssetId, who: &AccountId, value: Self::Balance, precision: Precision, ) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, DispatchError>
Source§fn withdraw(
asset: Self::AssetId,
who: &AccountId,
value: Self::Balance,
precision: Precision,
preservation: Preservation,
force: Fortitude,
) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, DispatchError>
fn withdraw( asset: Self::AssetId, who: &AccountId, value: Self::Balance, precision: Precision, preservation: Preservation, force: Fortitude, ) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, DispatchError>
Source§fn resolve(
who: &AccountId,
credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>,
) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>
fn resolve( who: &AccountId, credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, ) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>
who
is increased in order to counter credit
. If the whole of credit
cannot be countered, then nothing is changed and the original credit
is returned in an
Err
. Read moreSource§fn settle(
who: &AccountId,
debt: Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>,
preservation: Preservation,
) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>
fn settle( who: &AccountId, debt: Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, preservation: Preservation, ) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>>
who
is decreased in order to counter debt
. If the whole of debt
cannot be countered, then nothing is changed and the original debt
is returned in an
Err
.fn done_rescind(_asset: Self::AssetId, _amount: Self::Balance)
fn done_issue(_asset: Self::AssetId, _amount: Self::Balance)
Source§impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
Source§impl<T, I> Benchmarking for Pallet<T, I>
impl<T, I> Benchmarking for Pallet<T, I>
Source§fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>
Source§fn run_benchmark(
extrinsic: &[u8],
c: &[(BenchmarkParameter, u32)],
whitelist: &[TrackedStorageKey],
verify: bool,
internal_repeats: u32,
) -> Result<Vec<BenchmarkResult>, BenchmarkError>
fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>
Source§impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Callable<T> for Pallet<T, I>where
T: Config<I>,
I: 'static,
type RuntimeCall = Call<T, I>
Source§impl<T, I> ContainsPair<<T as Config<I>>::AssetId, <T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ContainsPair<<T as Config<I>>::AssetId, <T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Implements ContainsPair
trait for a pair of asset and account IDs.
Source§impl<T, I> Destroy<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Destroy<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn start_destroy(
id: <T as Config<I>>::AssetId,
maybe_check_owner: Option<<T as Config>::AccountId>,
) -> Result<(), DispatchError>
fn start_destroy( id: <T as Config<I>>::AssetId, maybe_check_owner: Option<<T as Config>::AccountId>, ) -> Result<(), DispatchError>
Source§fn destroy_accounts(
id: <T as Config<I>>::AssetId,
max_items: u32,
) -> Result<u32, DispatchError>
fn destroy_accounts( id: <T as Config<I>>::AssetId, max_items: u32, ) -> Result<u32, DispatchError>
destroy_accounts
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state Read moreSource§fn destroy_approvals(
id: <T as Config<I>>::AssetId,
max_items: u32,
) -> Result<u32, DispatchError>
fn destroy_approvals( id: <T as Config<I>>::AssetId, max_items: u32, ) -> Result<u32, DispatchError>
max_items
destroy_approvals
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state Read moreSource§fn finish_destroy(id: <T as Config<I>>::AssetId) -> Result<(), DispatchError>
fn finish_destroy(id: <T as Config<I>>::AssetId) -> Result<(), DispatchError>
finish_destroy
should only be called after start_destroy
has been called, and the
asset is in a Destroying
state. All accounts or approvals should be destroyed before
hand. Read moreSource§impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> DispatchViewFunction for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn dispatch_view_function<O>(
id: &ViewFunctionId,
input: &mut &[u8],
output: &mut O,
) -> Result<(), ViewFunctionDispatchError>where
O: Output,
Source§impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> GetStorageVersion for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
fn in_code_storage_version() -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion
storage_version
attribute, or
NoStorageVersionSet
if the attribute is missing.Source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
Source§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
instead. Read moreSource§impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
Source§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
Source§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
). Read moreSource§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read moreSource§fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
fn try_state(_n: BlockNumber) -> Result<(), DispatchError>
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Source§fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>
Source§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
Source§fn integrity_test()
fn integrity_test()
Source§impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn owner(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>
fn issuer(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>
fn admin(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>
fn freezer(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>
Source§impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn total_issuance(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
fn total_issuance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
Source§fn minimum_balance(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
fn minimum_balance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
Source§fn balance(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
who: &<T as Config>::AccountId,
) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
fn balance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
who
which does not include funds which are exclusively allocated to
subsystems of the chain (“on hold” or “reserved”). Read moreSource§fn total_balance(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
who: &<T as Config>::AccountId,
) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
fn total_balance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
who
. Read moreSource§fn reducible_balance(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
who: &<T as Config>::AccountId,
preservation: Preservation,
_: Fortitude,
) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
fn reducible_balance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, preservation: Preservation, _: Fortitude, ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance
who
can withdraw/transfer successfully based on whether the
account should be kept alive (preservation
) or whether we are willing to force the
transfer and potentially go below user-level restrictions on the minimum amount of the
account. Read moreSource§fn can_deposit(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
who: &<T as Config>::AccountId,
amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
provenance: Provenance,
) -> DepositConsequence
fn can_deposit( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, provenance: Provenance, ) -> DepositConsequence
Source§fn can_withdraw(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
who: &<T as Config>::AccountId,
amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
) -> WithdrawConsequence<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>
fn can_withdraw( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, ) -> WithdrawConsequence<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>
Failed
if the asset
balance of who
may not be decreased by amount
, otherwise
the consequence.Source§fn asset_exists(
asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
) -> bool
fn asset_exists( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, ) -> bool
true
if an asset
exists.Source§fn active_issuance(asset: Self::AssetId) -> Self::Balance
fn active_issuance(asset: Self::AssetId) -> Self::Balance
Source§impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn asset_ids() -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetsIterator
fn asset_ids() -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetsIterator
Returns an iterator of the assets in existence.
NOTE: iterating this list invokes a storage read per item.
type AssetsIterator = KeyPrefixIterator<<T as Config<I>>::AssetId>
Source§impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> IntegrityTest for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> MetadataDeposit<<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> MetadataDeposit<<<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn approve( asset: <T as Config<I>>::AssetId, owner: &<T as Config>::AccountId, delegate: &<T as Config>::AccountId, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
fn transfer_from( asset: <T as Config<I>>::AssetId, owner: &<T as Config>::AccountId, delegate: &<T as Config>::AccountId, dest: &<T as Config>::AccountId, amount: <T as Config<I>>::Balance, ) -> Result<(), DispatchError>
Source§impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn done_mint_into( asset_id: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, beneficiary: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
fn done_burn_from( asset_id: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, target: &<T as Config>::AccountId, balance: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
fn done_transfer( asset_id: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, source: &<T as Config>::AccountId, dest: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
Source§fn mint_into(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
) -> Result<Self::Balance, DispatchError>
fn mint_into( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, ) -> Result<Self::Balance, DispatchError>
who
by exactly amount
, minting new tokens. If that isn’t
possible then an Err
is returned and nothing is changed.Source§fn burn_from(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
preservation: Preservation,
precision: Precision,
force: Fortitude,
) -> Result<Self::Balance, DispatchError>
fn burn_from( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, preservation: Preservation, precision: Precision, force: Fortitude, ) -> Result<Self::Balance, DispatchError>
who
by at least amount
, possibly slightly more in the case of
minimum-balance requirements, burning the tokens. If that isn’t possible then an Err
is
returned and nothing is changed. If successful, the amount of tokens reduced is returned.Source§fn shelve(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
) -> Result<Self::Balance, DispatchError>
fn shelve( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, ) -> Result<Self::Balance, DispatchError>
Source§fn restore(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
) -> Result<Self::Balance, DispatchError>
fn restore( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, ) -> Result<Self::Balance, DispatchError>
Source§fn transfer(
asset: Self::AssetId,
source: &AccountId,
dest: &AccountId,
amount: Self::Balance,
preservation: Preservation,
) -> Result<Self::Balance, DispatchError>
fn transfer( asset: Self::AssetId, source: &AccountId, dest: &AccountId, amount: Self::Balance, preservation: Preservation, ) -> Result<Self::Balance, DispatchError>
Source§fn set_balance(
asset: Self::AssetId,
who: &AccountId,
amount: Self::Balance,
) -> Self::Balance
fn set_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, ) -> Self::Balance
fn done_shelve(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)
fn done_restore(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)
Source§impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_finalize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
)
fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )
Hooks::on_finalize
.Source§impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnGenesis for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_genesis()
fn on_genesis()
Source§impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_initialize(
n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number,
) -> Weight
fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight
Hooks::on_initialize
.Source§impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> OnRuntimeUpgrade for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Source§fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
fn pre_upgrade() -> Result<Vec<u8>, DispatchError>
Hooks::pre_upgrade
.Source§fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>
Hooks::post_upgrade
.Source§fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>
pre_upgrade
->
on_runtime_upgrade
-> post_upgrade
hooks for a migration. Read moreSource§impl<T, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn module_name() -> &'static str
fn module_name() -> &'static str
Source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
Source§impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> PalletsInfoAccess for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> Refund<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Refund<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance
Source§impl<T, I> ResetTeam<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ResetTeam<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> StorageInfoTrait for Pallet<T, I>where
T: Config<I>,
I: 'static,
fn storage_info() -> Vec<StorageInfo>
Source§impl<T, I> StoredMap<(<T as Config<I>>::AssetId, <T as Config>::AccountId), <T as Config<I>>::Extra> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> StoredMap<(<T as Config<I>>::AssetId, <T as Config>::AccountId), <T as Config<I>>::Extra> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn get(
id_who: &(<T as Config<I>>::AssetId, <T as Config>::AccountId),
) -> <T as Config<I>>::Extra
fn get( id_who: &(<T as Config<I>>::AssetId, <T as Config>::AccountId), ) -> <T as Config<I>>::Extra
Source§fn try_mutate_exists<R, E>(
id_who: &(<T as Config<I>>::AssetId, <T as Config>::AccountId),
f: impl FnOnce(&mut Option<<T as Config<I>>::Extra>) -> Result<R, E>,
) -> Result<R, E>where
E: From<DispatchError>,
fn try_mutate_exists<R, E>(
id_who: &(<T as Config<I>>::AssetId, <T as Config>::AccountId),
f: impl FnOnce(&mut Option<<T as Config<I>>::Extra>) -> Result<R, E>,
) -> Result<R, E>where
E: From<DispatchError>,
Ok
value is returned from f
. Do nothing if an Err
is
returned. It is removed or reset to default value if it has been mutated to None
.
f
will always be called with an option representing if the storage item exists (Some<V>
)
or if the storage item does not exist (None
), independent of the QueryType
.Source§fn mutate_exists<R>(
k: &K,
f: impl FnOnce(&mut Option<T>) -> R,
) -> Result<R, DispatchError>
fn mutate_exists<R>( k: &K, f: impl FnOnce(&mut Option<T>) -> R, ) -> Result<R, DispatchError>
None
. Read moreSource§impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryDecodeEntireStorage for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>
Ok(bytes_decoded)
if success.Source§impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn handle_raw_dust(
_: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
_: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
)
fn handle_raw_dust( _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
Self::handle_dust
. This is an unbalanced operation
and it must only be used when an account is modified in a raw fashion, outside of the entire
fungibles API. The amount
is capped at Self::minimum_balance() - 1
. Read moreSource§fn handle_dust(_: Dust<<T as Config>::AccountId, Pallet<T, I>>)
fn handle_dust(_: Dust<<T as Config>::AccountId, Pallet<T, I>>)
Dust
can be converted
into a Credit
with the Balanced
trait impl.Source§fn write_balance(
_: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId,
_: &<T as Config>::AccountId,
_: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
) -> Result<Option<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>, DispatchError>
fn write_balance( _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, _: &<T as Config>::AccountId, _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, ) -> Result<Option<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance>, DispatchError>
Source§fn set_total_issuance(
id: <T as Config<I>>::AssetId,
amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
)
fn set_total_issuance( id: <T as Config<I>>::AssetId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, )
amount
.Source§fn decrease_balance(
asset: <T as Config<I>>::AssetId,
who: &<T as Config>::AccountId,
amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
precision: Precision,
preservation: Preservation,
_: Fortitude,
) -> Result<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, DispatchError>
fn decrease_balance( asset: <T as Config<I>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, precision: Precision, preservation: Preservation, _: Fortitude, ) -> Result<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, DispatchError>
Source§fn increase_balance(
asset: <T as Config<I>>::AssetId,
who: &<T as Config>::AccountId,
amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance,
_: Precision,
) -> Result<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, DispatchError>
fn increase_balance( asset: <T as Config<I>>::AssetId, who: &<T as Config>::AccountId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, _: Precision, ) -> Result<<Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance, DispatchError>
Source§fn deactivate(_asset: Self::AssetId, _: Self::Balance)
fn deactivate(_asset: Self::AssetId, _: Self::Balance)
Source§fn reactivate(_asset: Self::AssetId, _: Self::Balance)
fn reactivate(_asset: Self::AssetId, _: Self::Balance)
Source§impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> ViewFunctionIdPrefix for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
impl<T, I> WhitelistedStorageKeys for Pallet<T, I>where
T: Config<I>,
I: 'static,
Source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.