Struct oasis_runtime_sdk::modules::accounts::Module
source · pub struct Module;
Implementations§
Trait Implementations§
source§impl API for Module
impl API for Module
source§fn transfer(from: Address, to: Address, amount: &BaseUnits) -> Result<(), Error>
fn transfer(from: Address, to: Address, amount: &BaseUnits) -> Result<(), Error>
Transfer an amount from one account to the other.
source§fn transfer_silent(
from: Address,
to: Address,
amount: &BaseUnits,
) -> Result<(), Error>
fn transfer_silent( from: Address, to: Address, amount: &BaseUnits, ) -> Result<(), Error>
Transfer an amount from one account to the other without emitting an event.
source§fn mint(to: Address, amount: &BaseUnits) -> Result<(), Error>
fn mint(to: Address, amount: &BaseUnits) -> Result<(), Error>
Mint new tokens, increasing the total supply.
source§fn burn(from: Address, amount: &BaseUnits) -> Result<(), Error>
fn burn(from: Address, amount: &BaseUnits) -> Result<(), Error>
Burn existing tokens, decreasing the total supply.
source§fn set_balance(address: Address, amount: &BaseUnits)
fn set_balance(address: Address, amount: &BaseUnits)
Sets an account’s balance of the given denomination. Read more
source§fn get_balance(
address: Address,
denomination: Denomination,
) -> Result<u128, Error>
fn get_balance( address: Address, denomination: Denomination, ) -> Result<u128, Error>
Fetch an account’s balance of the given denomination.
source§fn get_balances(address: Address) -> Result<AccountBalances, Error>
fn get_balances(address: Address) -> Result<AccountBalances, Error>
Fetch an account’s current balances.
source§fn get_addresses(denomination: Denomination) -> Result<Vec<Address>, Error>
fn get_addresses(denomination: Denomination) -> Result<Vec<Address>, Error>
Fetch addresses.
source§fn get_total_supplies() -> Result<BTreeMap<Denomination, u128>, Error>
fn get_total_supplies() -> Result<BTreeMap<Denomination, u128>, Error>
Fetch total supplies.
source§fn set_total_supply(amount: &BaseUnits)
fn set_total_supply(amount: &BaseUnits)
Sets the total supply for the given denomination. Read more
source§fn get_denomination_info(
denomination: &Denomination,
) -> Result<DenominationInfo, Error>
fn get_denomination_info( denomination: &Denomination, ) -> Result<DenominationInfo, Error>
Fetch information about a denomination.
source§fn charge_tx_fee(from: Address, amount: &BaseUnits) -> Result<(), Error>
fn charge_tx_fee(from: Address, amount: &BaseUnits) -> Result<(), Error>
Moves the amount into the per-transaction fee accumulator.
source§fn set_refund_unused_tx_fee(refund: bool)
fn set_refund_unused_tx_fee(refund: bool)
Indicates that the unused portion of the transaction fee should be refunded after the
transaction completes (even in case it fails).
source§fn take_refund_unused_tx_fee() -> bool
fn take_refund_unused_tx_fee() -> bool
Take the flag indicating that the unused portion of the transaction fee should be refunded
after the transaction completes is set. Read more
source§fn check_signer_nonces<C: Context>(
_ctx: &C,
auth_info: &AuthInfo,
) -> Result<Address, Error>
fn check_signer_nonces<C: Context>( _ctx: &C, auth_info: &AuthInfo, ) -> Result<Address, Error>
Check transaction signer account nonces.
Return payer address.
source§impl BlockHandler for Module
impl BlockHandler for Module
source§impl InvariantHandler for Module
impl InvariantHandler for Module
source§impl MethodHandler for Module
impl MethodHandler for Module
source§fn prefetch(
prefixes: &mut BTreeSet<Prefix>,
method: &str,
body: Value,
auth_info: &AuthInfo,
) -> DispatchResult<Value, Result<(), RuntimeError>>
fn prefetch( prefixes: &mut BTreeSet<Prefix>, method: &str, body: Value, auth_info: &AuthInfo, ) -> DispatchResult<Value, Result<(), RuntimeError>>
Add storage prefixes to prefetch.
source§fn dispatch_call<C: Context>(
ctx: &C,
method: &str,
body: Value,
) -> DispatchResult<Value, CallResult>
fn dispatch_call<C: Context>( ctx: &C, method: &str, body: Value, ) -> DispatchResult<Value, CallResult>
Dispatch a call.
source§fn dispatch_query<C: Context>(
ctx: &C,
method: &str,
args: Value,
) -> DispatchResult<Value, Result<Value, RuntimeError>>
fn dispatch_query<C: Context>( ctx: &C, method: &str, args: Value, ) -> DispatchResult<Value, Result<Value, RuntimeError>>
Dispatch a query.
source§fn supported_methods() -> Vec<MethodHandlerInfo>
fn supported_methods() -> Vec<MethodHandlerInfo>
Lists the names of all RPC methods exposed by this module. The result is informational
only. An empty return vector means that the implementor does not care to list the methods,
or the implementor is a tuple of modules.
source§fn is_expensive_query(method: &str) -> bool
fn is_expensive_query(method: &str) -> bool
Checks whether the given query method is tagged as expensive.
source§fn dispatch_message_result<C: Context>(
_ctx: &C,
_handler_name: &str,
result: MessageResult,
) -> DispatchResult<MessageResult, ()>
fn dispatch_message_result<C: Context>( _ctx: &C, _handler_name: &str, result: MessageResult, ) -> DispatchResult<MessageResult, ()>
Dispatch a message result.
source§fn is_allowed_private_km_query(_method: &str) -> bool
fn is_allowed_private_km_query(_method: &str) -> bool
Checks whether the given query is allowed to access private key manager state.
source§fn is_allowed_interactive_call(_method: &str) -> bool
fn is_allowed_interactive_call(_method: &str) -> bool
Checks whether the given call is allowed to be called interactively via read-only
transactions.
source§impl MigrationHandler for Module
impl MigrationHandler for Module
source§impl Module for Module
impl Module for Module
§type Parameters = Parameters
type Parameters = Parameters
Module parameters.
source§fn params() -> Self::Parameters
fn params() -> Self::Parameters
Return the module’s parameters.
source§fn set_params(params: Self::Parameters)
fn set_params(params: Self::Parameters)
Set the module’s parameters.
source§impl TransactionHandler for Module
impl TransactionHandler for Module
source§fn authenticate_tx<C: Context>(
ctx: &C,
tx: &Transaction,
) -> Result<AuthDecision, Error>
fn authenticate_tx<C: Context>( ctx: &C, tx: &Transaction, ) -> Result<AuthDecision, Error>
Authenticate a transaction. Read more
source§fn after_handle_call<C: Context>(
_ctx: &C,
result: CallResult,
) -> Result<CallResult, Error>
fn after_handle_call<C: Context>( _ctx: &C, result: CallResult, ) -> Result<CallResult, Error>
Perform any action after call, within the transaction context. Read more
source§fn after_dispatch_tx<C: Context>(
ctx: &C,
tx_auth_info: &AuthInfo,
result: &CallResult,
)
fn after_dispatch_tx<C: Context>( ctx: &C, tx_auth_info: &AuthInfo, result: &CallResult, )
Perform any action after dispatching the transaction, in batch context.
source§fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>
fn approve_raw_tx<C: Context>(_ctx: &C, _tx: &[u8]) -> Result<(), Error>
Judge if a raw transaction is good enough to undergo decoding.
This takes place before even decoding the transaction.
source§fn approve_unverified_tx<C: Context>(
_ctx: &C,
_utx: &UnverifiedTransaction,
) -> Result<(), Error>
fn approve_unverified_tx<C: Context>( _ctx: &C, _utx: &UnverifiedTransaction, ) -> Result<(), Error>
Judge if an unverified transaction is good enough to undergo verification.
This takes place before even verifying signatures.
source§fn decode_tx<C: Context>(
_ctx: &C,
_scheme: &str,
_body: &[u8],
) -> Result<Option<Transaction>, Error>
fn decode_tx<C: Context>( _ctx: &C, _scheme: &str, _body: &[u8], ) -> Result<Option<Transaction>, Error>
Decode a transaction that was sent with module-controlled decoding and verify any
signatures. Read more
source§fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>
fn before_handle_call<C: Context>(_ctx: &C, _call: &Call) -> Result<(), Error>
Perform any action after authentication, within the transaction context. Read more
Perform any action after authentication and decoding, within the transaction context. Read more
Auto Trait Implementations§
impl Freeze for Module
impl RefUnwindSafe for Module
impl Send for Module
impl Sync for Module
impl Unpin for Module
impl UnwindSafe for Module
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<M> ModuleInfoHandler for Mwhere
M: Module + MethodHandler,
impl<M> ModuleInfoHandler for Mwhere
M: Module + MethodHandler,
source§fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>where
C: Context,
fn module_info<C>(_ctx: &C) -> BTreeMap<String, ModuleInfo>where
C: Context,
Reports info about the module (or modules, if
Self
is a tuple).