Type Alias shibuya_runtime::Assets

source ·
pub type Assets = Pallet<Runtime>;

Aliased Type§

struct Assets(/* private fields */);

Implementations

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

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.

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.

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.

pub fn total_supply(id: <T as Config<I>>::AssetId) -> <T as Config<I>>::Balance

Get the total supply of an asset id.

pub fn maybe_total_supply( id: <T as Config<I>>::AssetId ) -> Option<<T as Config<I>>::Balance>

Get the total supply of an asset id if the asset exists.

pub fn account_balances( account: <T as Config>::AccountId ) -> Vec<(<T as Config<I>>::AssetId, <T as Config<I>>::Balance)>

Returns all the non-zero balances for all assets of the given account.

§

impl<T, I> Pallet<T, I>
where T: Config<I>, I: 'static,

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. If [NextAssetId] 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)

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. If [NextAssetId] 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 using transfer_ownership and set_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)

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.

The asset class must be frozen before calling start_destroy.

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.

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.

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.

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.

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 which who’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.

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 and target’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.

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 and target’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.

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 the source’s balance of assets should be reduced and dest’s balance increased. The amount actually transferred may be slightly greater in the case that the transfer would otherwise take the source 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.

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 Accounts 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)

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)

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)

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)

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)

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)

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 by StringLimit.
  • symbol: The exchange symbol for this asset. Limited in length by StringLimit.
  • decimals: The number of decimals this asset uses to represent one unit.

Emits MetadataSet.

Weight: O(1)

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)

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 by StringLimit.
  • symbol: The exchange symbol for this asset. Limited in length by StringLimit.
  • 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.

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)

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 to true, then non-zero balances may be stored without a consumer 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)

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 by delegate. If there is already an approval in place, then this acts additively.

Emits ApprovedTransfer on success.

Weight: O(1)

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)

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)

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 least amount and from which the asset balance will be withdrawn.
  • destination: The account to which the asset balance of amount will be transferred.
  • amount: The amount of assets to transfer.

Emits TransferredApproved on success.

Weight: O(1)

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.

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: If true then assets may be destroyed in order to complete the refund.

Emits Refunded event when successful.

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 of min_balance.

Emits AssetMinBalanceChanged event when successful.

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 by Freezer or Admin of the asset id; 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.

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.

Emits Refunded event when successful.

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)

Trait Implementations

§

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.

§

fn contains( asset: &<T as Config<I>>::AssetId, who: &<T as Config>::AccountId ) -> bool

Check if an account with the given asset ID and account address exists.

§

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.

§

type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance

The type for currency units of the deposit.
§

fn deposit_required( _: <T as Config<I>>::AssetId ) -> <Pallet<T, I> as AccountTouch<<T as Config<I>>::AssetId, <T as Config>::AccountId>>::Balance

The deposit amount of a native currency required for touching an account of the asset.
§

fn should_touch( asset: <T as Config<I>>::AssetId, who: &<T as Config>::AccountId ) -> bool

Check if an account for a given asset should be touched to meet the existence requirements.
§

fn touch( asset: <T as Config<I>>::AssetId, who: &<T as Config>::AccountId, depositor: &<T as Config>::AccountId ) -> Result<(), DispatchError>

Create an account for who of the asset with a deposit taken from the depositor.
§

impl<T, I> Destroy<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn start_destroy( id: <T as Config<I>>::AssetId, maybe_check_owner: Option<<T as Config>::AccountId> ) -> Result<(), DispatchError>

Start the destruction an existing fungible asset. Read more
§

fn destroy_accounts( id: <T as Config<I>>::AssetId, max_items: u32 ) -> Result<u32, DispatchError>

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 Read more
§

fn destroy_approvals( id: <T as Config<I>>::AssetId, max_items: u32 ) -> Result<u32, DispatchError>

Destroy all approvals associated with a given asset up to the max_items destroy_approvals should only be called after start_destroy has been called, and the asset is in a Destroying state Read more
§

fn finish_destroy(id: <T as Config<I>>::AssetId) -> 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. Read more
§

impl<T, I> Mutate<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn set( asset: <T as Config<I>>::AssetId, from: &<T as Config>::AccountId, name: Vec<u8>, symbol: Vec<u8>, decimals: u8 ) -> Result<(), DispatchError>

§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

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>

§

impl<T, I> BeforeAllRuntimeMigrations for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type AssetId = <T as Config<I>>::AssetId

Means of identifying one asset class from another.
§

type Balance = <T as Config<I>>::Balance

Scalar type for representing balance of an account.
§

fn total_issuance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

The total amount of issuance in the system.
§

fn minimum_balance( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId ) -> <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance

The minimum balance any single account may have.
§

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

Get the balance of who which does not include funds which are exclusively allocated to subsystems of the chain (“on hold” or “reserved”). Read more
§

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

Get the total amount of funds whose ultimate beneficial ownership can be determined as who. Read more
§

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

Get the maximum amount that 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 more
§

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

Returns true if the asset balance of who may be increased by amount. Read more
§

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>

Returns Failed if the asset balance of who may not be decreased by amount, otherwise the consequence.
§

fn asset_exists( asset: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId ) -> bool

Returns true if an asset exists.
§

fn active_issuance(asset: Self::AssetId) -> Self::Balance

The total amount of issuance in the system excluding those which are controlled by the system.
§

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>

§

impl<T, I> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )

See [Hooks::on_finalize].
§

impl<T, I> OnGenesis for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_genesis()

Something that should happen at genesis.
§

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 )

§

fn mint_into( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Increase the balance of who by exactly amount, minting new tokens. If that isn’t possible then an Err is returned and nothing is changed.
§

fn burn_from( asset: Self::AssetId, who: &AccountId, amount: Self::Balance, preservation: Preservation, precision: Precision, force: Fortitude ) -> Result<Self::Balance, DispatchError>

Decrease the balance of 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.
§

fn shelve( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to decrease the asset balance of who by amount. Read more
§

fn restore( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Result<Self::Balance, DispatchError>

Attempt to increase the asset balance of who by amount. Read more
§

fn transfer( asset: Self::AssetId, source: &AccountId, dest: &AccountId, amount: Self::Balance, preservation: Preservation ) -> Result<Self::Balance, DispatchError>

Transfer funds from one account into another. Read more
§

fn set_balance( asset: Self::AssetId, who: &AccountId, amount: Self::Balance ) -> Self::Balance

Simple infallible function to force an account to have a particular balance, good for use in tests and benchmarks but not recommended for production code owing to the lack of error reporting. Read more
§

fn done_shelve(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)

§

fn done_restore(_asset: Self::AssetId, _who: &AccountId, _amount: Self::Balance)

§

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>

§

impl<T, I> Balanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type OnDropCredit = DecreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>

The type for managing what happens when an instance of Credit is dropped without being used.
§

type OnDropDebt = IncreaseIssuance<<T as Config>::AccountId, Pallet<T, I>>

The type for managing what happens when an instance of 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 )

§

fn rescind( asset: Self::AssetId, amount: Self::Balance ) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>

Reduce the total issuance by 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 more
§

fn issue( asset: Self::AssetId, amount: Self::Balance ) -> Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>

Increase the total issuance by 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 more
§

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>

Produce a pair of imbalances that cancel each other out exactly. Read more
§

fn deposit( asset: Self::AssetId, who: &AccountId, value: Self::Balance, precision: Precision ) -> Result<Imbalance<Self::AssetId, Self::Balance, Self::OnDropDebt, Self::OnDropCredit>, DispatchError>

Mints value into the account of who, creating it as needed. Read more
§

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>

Removes value balance from who account if possible. Read more
§

fn resolve( who: &AccountId, credit: Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt> ) -> Result<(), Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>>

The balance of 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 more
§

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>>

The balance of 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)

§

impl<T, I> Create<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn create( id: <T as Config<I>>::AssetId, admin: <T as Config>::AccountId, is_sufficient: bool, min_balance: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance ) -> Result<(), DispatchError>

Create a new fungible asset.
§

impl<T, I> Eq for Pallet<T, I>

§

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,

§

fn get( id_who: &(<T as Config<I>>::AssetId, <T as Config>::AccountId) ) -> <T as Config<I>>::Extra

Get the item, or its default if it doesn’t yet exist; we make no distinction between the two.
§

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>,

Maybe mutate the item only if an 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.
§

fn mutate<R>(k: &K, f: impl FnOnce(&mut T) -> R) -> Result<R, DispatchError>

Mutate the item.
§

fn mutate_exists<R>( k: &K, f: impl FnOnce(&mut Option<T>) -> R ) -> Result<R, DispatchError>

Mutate the item, removing or resetting to default value if it has been mutated to None. Read more
§

fn insert(k: &K, t: T) -> Result<(), DispatchError>

Set the item to something new.
§

fn remove(k: &K) -> Result<(), DispatchError>

Remove the item or otherwise replace it with its default value; we don’t care which.
§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn allowance( asset: <T as Config<I>>::AssetId, owner: &<T as Config>::AccountId, delegate: &<T as Config>::AccountId ) -> <T as Config<I>>::Balance

§

impl<T, I> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_initialize(_n: BlockNumber) -> Weight

Block initialization hook. This is called at the very beginning of block execution. Read more
§

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. Read more
§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before [Hooks::on_finalize]). Read more
§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
§

impl<T, I> StorageInfoTrait for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn storage_info() -> Vec<StorageInfo>

§

impl<T, I> Debug for Pallet<T, I>

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

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,

§

fn calc_metadata_deposit( name: &[u8], symbol: &[u8] ) -> <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance

§

impl<T, I> Inspect<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn name(asset: <T as Config<I>>::AssetId) -> Vec<u8>

§

fn symbol(asset: <T as Config<I>>::AssetId) -> Vec<u8>

§

fn decimals(asset: <T as Config<I>>::AssetId) -> u8

§

impl<T, I> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter )

Code to execute every now and then at the beginning of the block after inherent application. Read more
§

impl<T, I> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight ) -> Weight

See [Hooks::on_idle].
§

impl<T, I> PalletInfoAccess for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn index() -> usize

Index of the pallet as configured in the runtime.
§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
§

fn name_hash() -> [u8; 16]

Two128 hash of name.
§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
§

impl<T, I> Callable<T> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type RuntimeCall = Call<T, I>

§

impl<T, I> WhitelistedStorageKeys for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a 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.
§

impl<T, I> GetStorageVersion for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type InCodeStorageVersion = StorageVersion

This type is generated by the pallet macro. Read more
§

fn in_code_storage_version( ) -> <Pallet<T, I> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or [NoStorageVersionSet] if the attribute is missing.
§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use [Self::current_storage_version] instead. Read more
§

impl<T, I> OnRuntimeUpgrade for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
§

impl<T, I> Refund<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

type AssetId = <T as Config<I>>::AssetId

Means of identifying one asset class from another.
§

type Balance = <<T as Config<I>>::Currency as Currency<<T as Config>::AccountId>>::Balance

Scalar type for representing deposit balance of an account.
§

fn deposit_held( id: <Pallet<T, I> as Refund<<T as Config>::AccountId>>::AssetId, who: <T as Config>::AccountId ) -> Option<(<T as Config>::AccountId, <Pallet<T, I> as Refund<<T as Config>::AccountId>>::Balance)>

Returns the amount of account deposit and depositor address, if any.
§

fn refund( id: <Pallet<T, I> as Refund<<T as Config>::AccountId>>::AssetId, who: <T as Config>::AccountId ) -> Result<(), DispatchError>

Return the deposit (if any) of a target asset account.
§

impl<T, I> PalletsInfoAccess for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
§

impl<T, I> ResetTeam<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn reset_team( id: <T as Config<I>>::AssetId, owner: <T as Config>::AccountId, admin: <T as Config>::AccountId, issuer: <T as Config>::AccountId, freezer: <T as Config>::AccountId ) -> Result<(), DispatchError>

Reset the team for the asset with the given id. Read more
§

impl<T, I> Unbalanced<<T as Config>::AccountId> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn handle_raw_dust( _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::AssetId, _: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

Create some dust and handle it with 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 more
§

fn handle_dust(_: Dust<<T as Config>::AccountId, Pallet<T, I>>)

Do something with the dust which has been destroyed from the system. Dust can be converted into a Credit with the Balanced trait impl.
§

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>

Forcefully set the balance of who to amount. Read more
§

fn set_total_issuance( id: <T as Config<I>>::AssetId, amount: <Pallet<T, I> as Inspect<<T as Config>::AccountId>>::Balance )

Set the total issuance to amount.
§

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>

Reduce the balance of who by amount. Read more
§

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>

Increase the balance of who by amount. Read more
§

fn deactivate(_asset: Self::AssetId, _: Self::Balance)

Reduce the active issuance by some amount.
§

fn reactivate(_asset: Self::AssetId, _: Self::Balance)

Increase the active issuance by some amount, up to the outstanding amount reduced.
§

impl<T, I> IntegrityTest for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn integrity_test()

See [Hooks::integrity_test].
§

impl<T, I> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number ) -> Weight

See [Hooks::on_initialize].
§

impl<T, I> Clone for Pallet<T, I>

§

fn clone(&self) -> Pallet<T, I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl<T, I> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T, I>
where T: Config<I>, I: 'static,

§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number )

This function is being called after every block import (when fully synced). Read more
§

impl<T, I> PartialEq for Pallet<T, I>

§

fn eq(&self, other: &Pallet<T, I>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.