referrerpolicy=no-referrer-when-downgrade
asset_hub_rococo_runtime

Type Alias ForeignAssets

Source
pub type ForeignAssets = Pallet<Runtime, Instance2>;

Aliased Type§

struct ForeignAssets(/* private fields */);

Implementations

Source§

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

Source

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.

Source

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.

Source

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.

Source

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

Get the total supply of an asset id.

Source

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.

Source

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.

Source§

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

Source

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)

Source

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)

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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.

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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)

Source

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.

Source

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.

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.

Source

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.

Source

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.

Source

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.

Source

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)

Source

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

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

The type for currency units of the deposit.
Source§

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.
Source§

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.
Source§

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.
Source§

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

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

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.
Source§

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

Source§

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>

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

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

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

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

Removes value balance from who account if possible. Read more
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>>

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

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.
Source§

fn done_rescind(_asset: Self::AssetId, _amount: Self::Balance)

Source§

fn done_issue(_asset: Self::AssetId, _amount: Self::Balance)

Source§

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

Source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
Source§

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

Source§

fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
Source§

fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>

Run the benchmarks for this pallet.
Source§

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

Source§

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

Source§

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

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§

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.

Source§

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

Source§

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.
Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

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>

Start the destruction an existing fungible asset. Read more
Source§

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

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

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

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

Source§

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,

Source§

type InCodeStorageVersion = StorageVersion

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

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.
Source§

fn on_chain_storage_version() -> StorageVersion

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

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

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

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

fn on_finalize(_n: BlockNumber)

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

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

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

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

fn on_runtime_upgrade() -> Weight

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

fn try_state(_n: BlockNumber) -> Result<(), DispatchError>

Execute the sanity checks of this pallet, per block. Read more
Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
Source§

fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
Source§

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

fn integrity_test()

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

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn owner(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>

Source§

fn issuer(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>

Source§

fn admin(asset: <T as Config<I>>::AssetId) -> Option<<T as Config>::AccountId>

Source§

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,

Source§

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

Means of identifying one asset class from another.
Source§

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

Scalar type for representing balance of an account.
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

The total amount of issuance in the system.
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

The minimum balance any single account may have.
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

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

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

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

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

Returns 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

Returns true if an asset exists.
Source§

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

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

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

Returns an iterator of the assets in existence.

NOTE: iterating this list invokes a storage read per item.

Source§

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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>

Source§

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,

Source§

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

Source§

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

Source§

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>

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.
Source§

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.
Source§

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

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

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

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

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

Source§

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,

Source§

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

Source§

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

Source§

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

Source§

fn on_genesis()

Something that should happen at 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,

Source§

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

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,

Source§

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

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,

Source§

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

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

Source§

fn on_runtime_upgrade() -> Weight

Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Source§

fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>

Source§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
Source§

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

Source§

fn index() -> usize

Index of the pallet as configured in the runtime.
Source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
Source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
Source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
Source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
Source§

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

Source§

fn count() -> usize

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

fn infos() -> Vec<PalletInfoData>

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

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

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

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

Source§

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

Means of identifying one asset class from another.
Source§

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

Scalar type for representing deposit balance of an account.
Source§

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.
Source§

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.
Source§

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

Source§

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

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

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,

Source§

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

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.
Source§

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

Mutate the item.
Source§

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

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

Set the item to something new.
Source§

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

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

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

Source§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning 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,

Source§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, _s: Select, ) -> Result<(), DispatchError>

Execute the state checks.
Source§

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

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

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

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

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

Reduce the balance of who by amount. Read more
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>

Increase the balance of who by amount. Read more
Source§

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

Reduce the active issuance by some amount.
Source§

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

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

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

Source§

fn prefix() -> [u8; 16]

Source§

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

Source§

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.
Source§

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