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

Fields

§request_id: Hash
§market_makers: Vec<SwapConfirmation>

Oracle have confirmation and confirm the trade.

  • request_id: Unique request ID.
  • market_makers: Vector of SwapConfirmation who represent the allocation of multiple source.

Emits SwapProcessed event when successful.

Weight: O(1)

§

cancel_swap

Fields

§request_id: Hash

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

Fields

§new_account_id: T::AccountId

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

Fields

§is_enabled: bool

Change Oracle status.

  • is_enabled: Is the oracle enabled?

Emits StatusChanged event when successful.

Weight: O(1)

§

update_assets_value

Fields

§value: Vec<(AssetId, Balance)>

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

Fields

§account_id: T::AccountId

Add market maker to the local storage

Emits StatusChanged event when successful.

Weight: O(1)

§

remove_market_maker

Fields

§account_id: T::AccountId

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§

Create a call with the variant confirm_swap.

Create a call with the variant cancel_swap.

Create a call with the variant set_account_id.

Create a call with the variant set_status.

Create a call with the variant update_assets_value.

Create a call with the variant add_market_maker.

Create a call with the variant remove_market_maker.

Create a call with the variant add_market_pair.

Create a call with the variant remove_market_pair.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Attempt to deserialise the value from input.
Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Attempt to skip the encoded value from input. Read more
Returns the fixed encoded size of the type. Read more
If possible give a hint of expected size of the encoding. Read more
Convert self to a slice and append it to the destination.
Convert self to an owned vector.
Convert self to a slice and then invoke the given closure with it.
Calculates the encoded size. Read more
Return the function name of the Call.
Return all function names.
Return a DispatchInfo, containing relevant information of this dispatch. Read more
👎Deprecated: Trait has moved to frame_support::dispatch
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
The type identifying for which type info is provided. Read more
Returns the static type identifier for Self.
The origin type of the runtime, (i.e. frame_system::Config::RuntimeOrigin).
Dispatch this call but do not check the filter in origin.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert from a value of T into an equivalent instance of Option<Self>. Read more
Consume self to return Some equivalent value of Option<T>. Read more
Decode Self and consume all of the given input data. Read more
Decode Self and consume all of the given input data. Read more
Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
Convert 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 more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more
Compare self to key and return true if they are equal.
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Cast reference.
Cast reference.
Cast mutable reference.
Cast mutable reference.

Get a reference to the inner from the outer.

Get a mutable reference to the inner from the outer.

Return an encoding of Self prepended by given slice.
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
Convert from a value of T into an equivalent instance of Self. Read more
Consume self to return an equivalent value of T. Read more
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
The counterpart to unchecked_from.
Consume self to return an equivalent value of T.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more