Struct serp_tes::module::Pallet [−][src]
Implementations
impl<T: Config> Pallet<T>
[src]
pub fn transfer(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::CurrencyId,
amount: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
[src]
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
currency_id: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::CurrencyId,
amount: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
Transfer some balance to another account under currency_id
.
The dispatch origin for this call must be Signed
by the
transactor.
pub fn transfer_native_currency(
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
amount: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
[src]
origin: OriginFor<T>,
dest: <T::Lookup as StaticLookup>::Source,
amount: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::Balance
) -> DispatchResultWithPostInfo
Transfer some native currency to another account.
The dispatch origin for this call must be Signed
by the
transactor.
pub fn update_balance(
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
currency_id: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::CurrencyId,
amount: <<T as Config>::Stp258Currency as Stp258CurrencyExtended<<T as Config>::AccountId>>::Amount
) -> DispatchResultWithPostInfo
[src]
origin: OriginFor<T>,
who: <T::Lookup as StaticLookup>::Source,
currency_id: <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::CurrencyId,
amount: <<T as Config>::Stp258Currency as Stp258CurrencyExtended<<T as Config>::AccountId>>::Amount
) -> DispatchResultWithPostInfo
update amount of account who
under currency_id
.
The dispatch origin of this call must be Root.
Trait Implementations
impl<T: Config> Callable<T> for Pallet<T>
[src]
impl<T> Clone for Pallet<T>
[src]
fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for Pallet<T>
[src]
impl<T> Eq for Pallet<T>
[src]
impl<T: Config> GetPalletVersion for Pallet<T>
[src]
fn current_version() -> PalletVersion
[src]
fn storage_version() -> Option<PalletVersion>
[src]
impl<T: Config> Hooks<<T as Config>::BlockNumber> for Pallet<T>
[src]
pub fn on_finalize(_n: BlockNumber)
[src]
pub fn on_initialize(_n: BlockNumber) -> u64
[src]
pub fn on_runtime_upgrade() -> u64
[src]
pub fn offchain_worker(_n: BlockNumber)
[src]
pub fn integrity_test()
[src]
impl<T: Config> IntegrityTest for Pallet<T>
[src]
fn integrity_test()
[src]
impl<T: Config> MergeAccount<<T as Config>::AccountId> for Pallet<T>
[src]
fn merge_account(source: &T::AccountId, dest: &T::AccountId) -> DispatchResult
[src]
impl<T: Config> ModuleErrorMetadata for Pallet<T>
[src]
fn metadata() -> &'static [ErrorMetadata]
[src]
impl<T: Config> OffchainWorker<<T as Config>::BlockNumber> for Pallet<T>
[src]
fn offchain_worker(n: <T as Config>::BlockNumber)
[src]
impl<T: Config> OnFinalize<<T as Config>::BlockNumber> for Pallet<T>
[src]
fn on_finalize(n: <T as Config>::BlockNumber)
[src]
impl<T: Config> OnGenesis for Pallet<T>
[src]
fn on_genesis()
[src]
impl<T: Config> OnInitialize<<T as Config>::BlockNumber> for Pallet<T>
[src]
fn on_initialize(n: <T as Config>::BlockNumber) -> Weight
[src]
impl<T: Config> OnRuntimeUpgrade for Pallet<T>
[src]
fn on_runtime_upgrade() -> Weight
[src]
impl<T> PartialEq<Pallet<T>> for Pallet<T>
[src]
impl<T: Config> SerpMarket<<T as Config>::AccountId> for Pallet<T>
[src]
fn expand_supply(
native_currency_id: Self::CurrencyId,
stable_currency_id: Self::CurrencyId,
expand_by: Self::Balance,
quote_price: Self::Balance
) -> DispatchResult
[src]
native_currency_id: Self::CurrencyId,
stable_currency_id: Self::CurrencyId,
expand_by: Self::Balance,
quote_price: Self::Balance
) -> DispatchResult
Called when expand_supply
is received from the SERP by the SerpTes
through the on_expand_supply
trigger.
Implementation should deposit
the amount
to serpup_to
,
then amount
will be slashed from serpup_from
and update
new_supply
. quote_price
is the price ( relative to the settcurrency) of
the native_currency
used to expand settcurrency supply.
who
is the account to serp with.
quote_price
here is sampled from mock and can be connected to an oracle.
fn contract_supply(
native_currency_id: Self::CurrencyId,
stable_currency_id: Self::CurrencyId,
contract_by: Self::Balance,
quote_price: Self::Balance
) -> DispatchResult
[src]
native_currency_id: Self::CurrencyId,
stable_currency_id: Self::CurrencyId,
contract_by: Self::Balance,
quote_price: Self::Balance
) -> DispatchResult
Called when contract_supply
is received from the SERP by the SerpTes
through the on_contract_supply
trigger.
Implementation should deposit
the base_currency_id
(The Native Currency)
of amount
to serpup_to
, then amount
will be slashed from serpup_from
and update new_supply
. quote_price
is the price ( relative to the settcurrency) of
the native_currency
used to contract settcurrency supply.
who
is the account to serp with.
quote_price
here is sampled from mock and can be connected to an oracle.
impl<T: Config> SerpTes<<T as Config>::AccountId> for Pallet<T>
[src]
type BlockNumber = <<T as Config>::Stp258Currency as SerpTes<<T as Config>::AccountId>>::BlockNumber
fn on_serp_block(
now: Self::BlockNumber,
stable_currency_id: Self::CurrencyId,
stable_currency_price: Self::Balance,
native_currency_id: Self::CurrencyId,
native_currency_price: Self::Balance
) -> DispatchResult
[src]
now: Self::BlockNumber,
stable_currency_id: Self::CurrencyId,
stable_currency_price: Self::Balance,
native_currency_id: Self::CurrencyId,
native_currency_price: Self::Balance
) -> DispatchResult
Contracts or expands the currency supply based on conditions. Filters through the conditions to see whether it’s time to adjust supply or not.
fn supply_change(
currency_id: Self::CurrencyId,
new_price: Self::Balance
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
new_price: Self::Balance
) -> Self::Balance
Calculate the amount of supply change from a fraction.
fn serp_elast(
stable_currency_id: Self::CurrencyId,
stable_currency_price: Self::Balance,
native_currency_id: Self::CurrencyId,
native_currency_price: Self::Balance
) -> DispatchResult
[src]
stable_currency_id: Self::CurrencyId,
stable_currency_price: Self::Balance,
native_currency_id: Self::CurrencyId,
native_currency_price: Self::Balance
) -> DispatchResult
Expands (if the price is above pegbase) or contracts (if the price is below pegbase) the supply of SettCurrencies.
Weight:
- complexity:
O(S + C)
S
being the complexity of executing eitherexpand_supply
orcontract_supply
C
being a constant amount of storage reads for SettCurrency supply
- DB access:
- 1 read for total_issuance
- execute
expand_supply
OR executecontract_supply
which have DB accesses
impl<T: Config> Stp258Currency<<T as Config>::AccountId> for Pallet<T>
[src]
type CurrencyId = <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::CurrencyId
The currency identifier.
type Balance = <<T as Config>::Stp258Currency as Stp258Currency<<T as Config>::AccountId>>::Balance
The balance of an account.
fn base_unit(currency_id: Self::CurrencyId) -> Self::Balance
[src]
fn minimum_balance(currency_id: Self::CurrencyId) -> Self::Balance
[src]
fn total_issuance(currency_id: Self::CurrencyId) -> Self::Balance
[src]
fn total_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
fn free_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
fn ensure_can_withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn transfer(
currency_id: Self::CurrencyId,
from: &T::AccountId,
to: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
from: &T::AccountId,
to: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn deposit(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn withdraw(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn can_slash(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> bool
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> bool
fn slash(
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> Self::Balance
impl<T: Config> Stp258CurrencyExtended<<T as Config>::AccountId> for Pallet<T>
[src]
type Amount = <<T as Config>::Stp258Currency as Stp258CurrencyExtended<<T as Config>::AccountId>>::Amount
The type for balance related operations, typically signed int.
fn update_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId,
by_amount: Self::Amount
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
by_amount: Self::Amount
) -> DispatchResult
impl<T: Config> Stp258CurrencyLockable<<T as Config>::AccountId> for Pallet<T>
[src]
type Moment = T::BlockNumber
The quantity used to denote time; usually just a BlockNumber
.
fn set_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn extend_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
[src]
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId,
amount: Self::Balance
) -> DispatchResult
fn remove_lock(
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> DispatchResult
[src]
lock_id: LockIdentifier,
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> DispatchResult
impl<T: Config> Stp258CurrencyReservable<<T as Config>::AccountId> for Pallet<T>
[src]
fn can_reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> bool
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> bool
fn slash_reserved(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
fn reserved_balance(
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId
) -> Self::Balance
fn reserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> DispatchResult
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> DispatchResult
fn unreserve(
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
[src]
currency_id: Self::CurrencyId,
who: &T::AccountId,
value: Self::Balance
) -> Self::Balance
fn repatriate_reserved(
currency_id: Self::CurrencyId,
slashed: &T::AccountId,
beneficiary: &T::AccountId,
value: Self::Balance,
status: BalanceStatus
) -> Result<Self::Balance, DispatchError>
[src]
currency_id: Self::CurrencyId,
slashed: &T::AccountId,
beneficiary: &T::AccountId,
value: Self::Balance,
status: BalanceStatus
) -> Result<Self::Balance, DispatchError>
Auto Trait Implementations
impl<T> RefUnwindSafe for Pallet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Pallet<T> where
T: Send,
T: Send,
impl<T> Sync for Pallet<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Pallet<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Pallet<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
pub fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
pub fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IsType<T> for T
[src]
pub fn from_ref(t: &T) -> &T
[src]
pub fn into_ref(&self) -> &T
[src]
pub fn from_mut(t: &mut T) -> &mut T
[src]
pub fn into_mut(&mut self) -> &mut T
[src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
pub fn from_ref(outer: &Outer) -> &T
Get a reference to the inner from the outer.
pub fn from_mut(outer: &mut Outer) -> &mut T
Get a mutable reference to the inner from the outer.
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Member for T where
T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone,
[src]
T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
pub fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Self: UniqueSaturatedFrom<T>,
pub fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Self: UniqueSaturatedInto<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
T: UncheckedFrom<S>,
pub fn unchecked_into(self) -> T
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
T: Bounded,
S: TryInto<T>,
pub fn unique_saturated_into(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,