Type Alias pallet_moonbeam_foreign_assets::pallet::Module

source ·
pub type Module<T> = Pallet<T>;
👎Deprecated: use Pallet instead
Expand description

Type alias to Pallet, to be used by construct_runtime.

Generated by pallet attribute macro.

Aliased Type§

struct Module<T>(/* private fields */);

Implementations

source§

impl<T: Config> Pallet<T>

source

pub fn assets_by_id<KArg>(k: KArg) -> Option<Location>
where KArg: EncodeLike<AssetId>,

An auto-generated getter for AssetsById.

source§

impl<T: Config> Pallet<T>

source

pub fn assets_by_location<KArg>(k: KArg) -> Option<(AssetId, AssetStatus)>
where KArg: EncodeLike<Location>,

An auto-generated getter for AssetsByLocation.

source§

impl<T: Config> Pallet<T>

source

pub fn assets_creation_details<KArg>(k: KArg) -> Option<AssetDepositDetails<T>>
where KArg: EncodeLike<AssetId>,

An auto-generated getter for AssetsCreationDetails.

source§

impl<T: Config> Pallet<T>

source

pub fn account_id() -> H160

The account ID of this pallet

source

pub fn contract_address_from_asset_id(asset_id: AssetId) -> H160

Compute asset contract address from asset id

source

pub fn register_foreign_asset( asset_id: AssetId, xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>>, ) -> DispatchResult

This method only exists for migration purposes and will be deleted once the foreign assets migration is finished.

source

pub fn mint_into( asset_id: AssetId, beneficiary: T::AccountId, amount: U256, ) -> Result<(), EvmError>

Mint an asset into a specific account

source

pub fn transfer( asset_id: AssetId, from: T::AccountId, to: T::AccountId, amount: U256, ) -> Result<(), EvmError>

Transfer an asset from an account to another one

source

pub fn balance(asset_id: AssetId, who: T::AccountId) -> Result<U256, EvmError>

source

pub fn approve( asset_id: AssetId, owner: T::AccountId, spender: T::AccountId, amount: U256, ) -> Result<(), EvmError>

Aprrove a spender to spend a certain amount of tokens from the owner account

source

pub fn weight_of_erc20_burn() -> Weight

source

pub fn weight_of_erc20_mint() -> Weight

source

pub fn weight_of_erc20_transfer() -> Weight

source§

impl<T: Config> Pallet<T>

source

pub fn create_foreign_asset( origin: OriginFor<T>, asset_id: AssetId, asset_xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>>, ) -> DispatchResult

Create new asset with the ForeignAssetCreator

source

pub fn change_xcm_location( origin: OriginFor<T>, asset_id: AssetId, new_xcm_location: Location, ) -> DispatchResult

Change the xcm type mapping for a given assetId We also change this if the previous units per second where pointing at the old assetType

source

pub fn freeze_foreign_asset( origin: OriginFor<T>, asset_id: AssetId, allow_xcm_deposit: bool, ) -> DispatchResult

Freeze a given foreign assetId

source

pub fn unfreeze_foreign_asset( origin: OriginFor<T>, asset_id: AssetId, ) -> DispatchResult

Unfreeze a given foreign assetId

source§

impl<T: Config> Pallet<T>

source

pub fn do_create_asset( asset_id: AssetId, asset_xcm_location: Location, decimals: u8, symbol: BoundedVec<u8, ConstU32<256>>, name: BoundedVec<u8, ConstU32<256>>, deposit_account: Option<T::AccountId>, ) -> DispatchResult

source

pub fn do_change_xcm_location( asset_id: AssetId, previous_xcm_location: Location, new_xcm_location: Location, ) -> DispatchResult

source

pub fn do_freeze_asset( asset_id: AssetId, xcm_location: Location, allow_xcm_deposit: bool, ) -> DispatchResult

source

pub fn do_unfreeze_asset( asset_id: AssetId, xcm_location: Location, ) -> DispatchResult

Trait Implementations

source§

impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>

source§

fn before_all_runtime_migrations() -> Weight

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

impl<T: Config> Callable<T> for Pallet<T>

source§

impl<T> Clone for Pallet<T>

source§

fn clone(&self) -> Self

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> Debug for Pallet<T>

source§

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

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

impl<T: Config> GetStorageVersion for Pallet<T>

§

type InCodeStorageVersion = NoStorageVersionSet

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

fn in_code_storage_version() -> Self::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.
§

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: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

§

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

impl<T: Config> IntegrityTest for Pallet<T>

source§

fn integrity_test()

See [Hooks::integrity_test].
source§

impl<T: Config> MaybeEquivalence<Location, u128> for Pallet<T>

source§

fn convert(location: &Location) -> Option<AssetId>

Attempt to convert reference of A into value of B, returning None if not possible.
source§

fn convert_back(asset_id: &AssetId) -> Option<Location>

Attempt to convert reference of B into value of A, returning None if not possible.
source§

impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn offchain_worker(n: BlockNumberFor<T>)

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

impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_finalize(n: BlockNumberFor<T>)

See [Hooks::on_finalize].
source§

impl<T: Config> OnGenesis for Pallet<T>

source§

fn on_genesis()

Something that should happen at genesis.
source§

impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_idle(n: BlockNumberFor<T>, remaining_weight: Weight) -> Weight

See [Hooks::on_idle].
source§

impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_initialize(n: BlockNumberFor<T>) -> Weight

See [Hooks::on_initialize].
source§

impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>

source§

fn on_poll(n: BlockNumberFor<T>, weight: &mut WeightMeter)

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

impl<T: Config> OnRuntimeUpgrade for Pallet<T>

source§

fn on_runtime_upgrade() -> Weight

See [Hooks::on_runtime_upgrade].
source§

impl<T: Config> PalletInfoAccess for Pallet<T>

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: Config> PalletsInfoAccess for Pallet<T>

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> PartialEq for Pallet<T>

source§

fn eq(&self, other: &Self) -> 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.
source§

impl<T: Config> StorageInfoTrait for Pallet<T>

source§

fn storage_info() -> Vec<StorageInfo>

source§

impl<T: Config> TransactAsset for Pallet<T>

source§

fn deposit_asset( what: &Asset, who: &Location, _context: Option<&XcmContext>, ) -> XcmResult

Deposit the what asset into the account of who. Read more
source§

fn internal_transfer_asset( asset: &Asset, from: &Location, to: &Location, _context: &XcmContext, ) -> Result<AssetsInHolding, XcmError>

Move an asset from one location in to another location. Read more
source§

fn withdraw_asset( what: &Asset, who: &Location, _context: Option<&XcmContext>, ) -> Result<AssetsInHolding, XcmError>

Withdraw the given asset from the consensus system. Return the actual asset(s) withdrawn, which should always be equal to _what. Read more
§

fn can_check_in( _origin: &Location, _what: &Asset, _context: &XcmContext, ) -> Result<(), Error>

Ensure that check_in will do as expected. Read more
§

fn check_in(_origin: &Location, _what: &Asset, _context: &XcmContext)

An asset has been teleported in from the given origin. This should do whatever housekeeping is needed. Read more
§

fn can_check_out( _dest: &Location, _what: &Asset, _context: &XcmContext, ) -> Result<(), Error>

Ensure that check_out will do as expected. Read more
§

fn check_out(_dest: &Location, _what: &Asset, _context: &XcmContext)

An asset has been teleported out to the given destination. This should do whatever housekeeping is needed. Read more
§

fn transfer_asset( asset: &Asset, from: &Location, to: &Location, context: &XcmContext, ) -> Result<AssetsInHolding, Error>

Move an asset from one location in to another location. Read more
source§

impl<T: Config> WhitelistedStorageKeys for Pallet<T>

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> Eq for Pallet<T>