Enum pallet_oracle::pallet::Call
source · pub enum Call<T: Config> {
confirm_swap {
request_id: Hash,
market_makers: Vec<SwapConfirmation>,
},
cancel_swap {
request_id: Hash,
},
set_account_id {
new_account_id: T::AccountId,
},
set_status {
is_enabled: bool,
},
update_assets_value {
value: Vec<(AssetId, Balance)>,
},
add_market_maker {
account_id: T::AccountId,
},
remove_market_maker {
account_id: T::AccountId,
},
add_market_pair {
market_pair: MarketPair,
},
remove_market_pair {
market_pair: MarketPair,
},
// some variants omitted
}
Expand description
Contains one variant per dispatchable that can be called by an extrinsic.
Variants§
confirm_swap
Oracle have confirmation and confirm the trade.
request_id
: Unique request ID.market_makers
: Vector ofSwapConfirmation
who represent the allocation of multiple source.
Emits SwapProcessed
event when successful.
Weight: O(1)
cancel_swap
Oracle cancel a swap request and release remaining funds
request_id
: Unique request ID.
Emits SwapCancelled
event when successful.
Weight: O(1)
set_account_id
Oracle change the account ID who can confirm trade.
Make sure to have access to the account_id
otherwise
only root
will be able to update the oracle account.
new_account_id
: The new Oracle account id.
Emits AccountChanged
event when successful.
Weight: O(1)
set_status
Change Oracle status.
is_enabled
: Is the oracle enabled?
Emits StatusChanged
event when successful.
Weight: O(1)
update_assets_value
Update assets values.
value
: How many TDFY required for 1 Asset.
The value should be formatted with TDFY decimals (12)
Example:
If the Bitcoin price is 0.001815 BTC (for 1 TDFY) You get 550.9641873278 TDFY for 1 BTC
The value should be: vec![(2, 550_964_187_327_800)]
If the ETH price is 0.03133 ETH (for 1 TDFY) You get 31.9182891796999 TDFY for 1 ETH
The value sent should be: vec![(4, 31_918_289_179_699)]
If the USDT price is 33.650000 USDT (for 1 TDFY) You get 0.029717682000 TDFY for 1 USDT
The value sent should be: vec![(4, 29_717_682_020)]
Weight: O(1)
add_market_maker
Add market maker to the local storage
Emits StatusChanged
event when successful.
Weight: O(1)
remove_market_maker
Remove market maker to the local storage
delete_orders
: Should we delete all existing swaps on chain for this user?
Emits StatusChanged
event when successful.
Weight: O(1)
add_market_pair
Fields
market_pair: MarketPair
Add a new market pair to be supported
market_pair
: Market pair
Emits MarketPairAdded
event when successful.
remove_market_pair
Fields
market_pair: MarketPair
Remove a market pair from the supported list
market_pair
: Market pair
Emits MarketPairRemoved
event when successful.
Implementations§
source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
sourcepub fn new_call_variant_confirm_swap(
request_id: Hash,
market_makers: Vec<SwapConfirmation>
) -> Self
pub fn new_call_variant_confirm_swap(
request_id: Hash,
market_makers: Vec<SwapConfirmation>
) -> Self
Create a call with the variant confirm_swap
.
sourcepub fn new_call_variant_cancel_swap(request_id: Hash) -> Self
pub fn new_call_variant_cancel_swap(request_id: Hash) -> Self
Create a call with the variant cancel_swap
.
sourcepub fn new_call_variant_set_account_id(new_account_id: T::AccountId) -> Self
pub fn new_call_variant_set_account_id(new_account_id: T::AccountId) -> Self
Create a call with the variant set_account_id
.
sourcepub fn new_call_variant_set_status(is_enabled: bool) -> Self
pub fn new_call_variant_set_status(is_enabled: bool) -> Self
Create a call with the variant set_status
.
sourcepub fn new_call_variant_update_assets_value(
value: Vec<(AssetId, Balance)>
) -> Self
pub fn new_call_variant_update_assets_value(
value: Vec<(AssetId, Balance)>
) -> Self
Create a call with the variant update_assets_value
.
sourcepub fn new_call_variant_add_market_maker(account_id: T::AccountId) -> Self
pub fn new_call_variant_add_market_maker(account_id: T::AccountId) -> Self
Create a call with the variant add_market_maker
.
sourcepub fn new_call_variant_remove_market_maker(account_id: T::AccountId) -> Self
pub fn new_call_variant_remove_market_maker(account_id: T::AccountId) -> Self
Create a call with the variant remove_market_maker
.
sourcepub fn new_call_variant_add_market_pair(market_pair: MarketPair) -> Self
pub fn new_call_variant_add_market_pair(market_pair: MarketPair) -> Self
Create a call with the variant add_market_pair
.
sourcepub fn new_call_variant_remove_market_pair(market_pair: MarketPair) -> Self
pub fn new_call_variant_remove_market_pair(market_pair: MarketPair) -> Self
Create a call with the variant remove_market_pair
.
Trait Implementations§
source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo
, containing relevant information of this dispatch. Read moresource§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
frame_support::dispatch
source§impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
T: Config + 'static,
source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin
).source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin
) -> DispatchResultWithPostInfo
impl<T: Config> EncodeLike<Call<T>> for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for Call<T>where
T: RefUnwindSafe,
<T as Config>::AccountId: RefUnwindSafe,
impl<T> Send for Call<T>where
T: Send,
impl<T> Sync for Call<T>where
T: Sync,
impl<T> Unpin for Call<T>where
T: Unpin,
<T as Config>::AccountId: Unpin,
impl<T> UnwindSafe for Call<T>where
T: UnwindSafe,
<T as Config>::AccountId: UnwindSafe,
Blanket Implementations§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresource§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresource§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read moresource§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> Hashable for Twhere
T: Codec,
impl<T> Hashable for Twhere
T: Codec,
fn blake2_128(&self) -> [u8; 16]
fn blake2_256(&self) -> [u8; 32]
fn blake2_128_concat(&self) -> Vec<u8, Global> ⓘ
fn twox_128(&self) -> [u8; 16]
fn twox_256(&self) -> [u8; 32]
fn twox_64_concat(&self) -> Vec<u8, Global> ⓘ
fn identity(&self) -> Vec<u8, Global> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
source§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read moresource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.