Type Alias pallet_moonbeam_foreign_assets::pallet::Module
source · pub type Module<T> = Pallet<T>;
Pallet
insteadExpand 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>
impl<T: Config> Pallet<T>
sourcepub fn assets_by_id<KArg>(k: KArg) -> Option<Location>where
KArg: EncodeLike<AssetId>,
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>
impl<T: Config> Pallet<T>
sourcepub fn assets_by_location<KArg>(k: KArg) -> Option<(AssetId, AssetStatus)>where
KArg: EncodeLike<Location>,
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>
impl<T: Config> Pallet<T>
sourcepub fn assets_creation_details<KArg>(k: KArg) -> Option<AssetDepositDetails<T>>where
KArg: EncodeLike<AssetId>,
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>
impl<T: Config> Pallet<T>
sourcepub fn account_id() -> H160
pub fn account_id() -> H160
The account ID of this pallet
sourcepub fn contract_address_from_asset_id(asset_id: AssetId) -> H160
pub fn contract_address_from_asset_id(asset_id: AssetId) -> H160
Compute asset contract address from asset id
sourcepub fn register_foreign_asset(
asset_id: AssetId,
xcm_location: Location,
decimals: u8,
symbol: BoundedVec<u8, ConstU32<256>>,
name: BoundedVec<u8, ConstU32<256>>,
) -> DispatchResult
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.
sourcepub fn mint_into(
asset_id: AssetId,
beneficiary: T::AccountId,
amount: U256,
) -> Result<(), EvmError>
pub fn mint_into( asset_id: AssetId, beneficiary: T::AccountId, amount: U256, ) -> Result<(), EvmError>
Mint an asset into a specific account
sourcepub fn transfer(
asset_id: AssetId,
from: T::AccountId,
to: T::AccountId,
amount: U256,
) -> Result<(), EvmError>
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
pub fn balance(asset_id: AssetId, who: T::AccountId) -> Result<U256, EvmError>
sourcepub fn approve(
asset_id: AssetId,
owner: T::AccountId,
spender: T::AccountId,
amount: U256,
) -> Result<(), EvmError>
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
pub fn weight_of_erc20_burn() -> Weight
pub fn weight_of_erc20_mint() -> Weight
pub fn weight_of_erc20_transfer() -> Weight
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
sourcepub 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
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
sourcepub fn change_xcm_location(
origin: OriginFor<T>,
asset_id: AssetId,
new_xcm_location: Location,
) -> DispatchResult
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
sourcepub fn freeze_foreign_asset(
origin: OriginFor<T>,
asset_id: AssetId,
allow_xcm_deposit: bool,
) -> DispatchResult
pub fn freeze_foreign_asset( origin: OriginFor<T>, asset_id: AssetId, allow_xcm_deposit: bool, ) -> DispatchResult
Freeze a given foreign assetId
sourcepub fn unfreeze_foreign_asset(
origin: OriginFor<T>,
asset_id: AssetId,
) -> DispatchResult
pub fn unfreeze_foreign_asset( origin: OriginFor<T>, asset_id: AssetId, ) -> DispatchResult
Unfreeze a given foreign assetId
source§impl<T: Config> Pallet<T>
impl<T: Config> Pallet<T>
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
pub fn do_change_xcm_location( asset_id: AssetId, previous_xcm_location: Location, new_xcm_location: Location, ) -> DispatchResult
pub fn do_freeze_asset( asset_id: AssetId, xcm_location: Location, allow_xcm_deposit: bool, ) -> DispatchResult
pub fn do_unfreeze_asset( asset_id: AssetId, xcm_location: Location, ) -> DispatchResult
Trait Implementations
source§impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
impl<T: Config> BeforeAllRuntimeMigrations for Pallet<T>
source§fn before_all_runtime_migrations() -> Weight
fn before_all_runtime_migrations() -> Weight
source§impl<T: Config> GetStorageVersion for Pallet<T>
impl<T: Config> GetStorageVersion for Pallet<T>
§type InCodeStorageVersion = NoStorageVersionSet
type InCodeStorageVersion = NoStorageVersionSet
source§fn in_code_storage_version() -> Self::InCodeStorageVersion
fn in_code_storage_version() -> Self::InCodeStorageVersion
storage_version
attribute, or
[NoStorageVersionSet
] if the attribute is missing.source§fn on_chain_storage_version() -> StorageVersion
fn on_chain_storage_version() -> StorageVersion
§fn current_storage_version() -> Self::InCodeStorageVersion
fn current_storage_version() -> Self::InCodeStorageVersion
in_code_storage_version
and will be removed after March 2024.Self::current_storage_version
] instead. Read moresource§impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
§fn on_initialize(_n: BlockNumber) -> Weight
fn on_initialize(_n: BlockNumber) -> Weight
§fn on_finalize(_n: BlockNumber)
fn on_finalize(_n: BlockNumber)
§fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight
Hooks::on_finalize
]). Read more§fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)
§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Executive
pallet. Read more§fn offchain_worker(_n: BlockNumber)
fn offchain_worker(_n: BlockNumber)
§fn integrity_test()
fn integrity_test()
source§impl<T: Config> IntegrityTest for Pallet<T>
impl<T: Config> IntegrityTest for Pallet<T>
source§fn integrity_test()
fn integrity_test()
Hooks::integrity_test
].source§impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn offchain_worker(n: BlockNumberFor<T>)
fn offchain_worker(n: BlockNumberFor<T>)
source§impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§fn on_finalize(n: BlockNumberFor<T>)
fn on_finalize(n: BlockNumberFor<T>)
Hooks::on_finalize
].source§impl<T: Config> OnGenesis for Pallet<T>
impl<T: Config> OnGenesis for Pallet<T>
source§fn on_genesis()
fn on_genesis()
source§impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
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
fn on_initialize(n: BlockNumberFor<T>) -> Weight
Hooks::on_initialize
].source§impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
impl<T: Config> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
source§impl<T: Config> OnRuntimeUpgrade for Pallet<T>
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
source§fn on_runtime_upgrade() -> Weight
fn on_runtime_upgrade() -> Weight
Hooks::on_runtime_upgrade
].source§impl<T: Config> PalletInfoAccess for Pallet<T>
impl<T: Config> PalletInfoAccess for Pallet<T>
source§fn module_name() -> &'static str
fn module_name() -> &'static str
source§fn crate_version() -> CrateVersion
fn crate_version() -> CrateVersion
source§impl<T> PartialEq for Pallet<T>
impl<T> PartialEq for Pallet<T>
source§impl<T: Config> TransactAsset for Pallet<T>
impl<T: Config> TransactAsset for Pallet<T>
source§fn deposit_asset(
what: &Asset,
who: &Location,
_context: Option<&XcmContext>,
) -> XcmResult
fn deposit_asset( what: &Asset, who: &Location, _context: Option<&XcmContext>, ) -> XcmResult
source§fn internal_transfer_asset(
asset: &Asset,
from: &Location,
to: &Location,
_context: &XcmContext,
) -> Result<AssetsInHolding, XcmError>
fn internal_transfer_asset( asset: &Asset, from: &Location, to: &Location, _context: &XcmContext, ) -> Result<AssetsInHolding, XcmError>
source§fn withdraw_asset(
what: &Asset,
who: &Location,
_context: Option<&XcmContext>,
) -> Result<AssetsInHolding, XcmError>
fn withdraw_asset( what: &Asset, who: &Location, _context: Option<&XcmContext>, ) -> Result<AssetsInHolding, XcmError>
_what
. Read more§fn can_check_in(
_origin: &Location,
_what: &Asset,
_context: &XcmContext,
) -> Result<(), Error>
fn can_check_in( _origin: &Location, _what: &Asset, _context: &XcmContext, ) -> Result<(), Error>
check_in
will do as expected. Read more§fn check_in(_origin: &Location, _what: &Asset, _context: &XcmContext)
fn check_in(_origin: &Location, _what: &Asset, _context: &XcmContext)
§fn can_check_out(
_dest: &Location,
_what: &Asset,
_context: &XcmContext,
) -> Result<(), Error>
fn can_check_out( _dest: &Location, _what: &Asset, _context: &XcmContext, ) -> Result<(), Error>
check_out
will do as expected. Read more§fn check_out(_dest: &Location, _what: &Asset, _context: &XcmContext)
fn check_out(_dest: &Location, _what: &Asset, _context: &XcmContext)
§fn transfer_asset(
asset: &Asset,
from: &Location,
to: &Location,
context: &XcmContext,
) -> Result<AssetsInHolding, Error>
fn transfer_asset( asset: &Asset, from: &Location, to: &Location, context: &XcmContext, ) -> Result<AssetsInHolding, Error>
source§impl<T: Config> WhitelistedStorageKeys for Pallet<T>
impl<T: Config> WhitelistedStorageKeys for Pallet<T>
source§fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>
Vec<TrackedStorageKey>
indicating the storage keys that
should be whitelisted during benchmarking. This means that those keys
will be excluded from the benchmarking performance calculation.