pub enum Call<T: Config> {
pay {
recipient: T::AccountId,
asset: AssetIdOf<T>,
amount: BalanceOf<T>,
remark: Option<BoundedDataOf<T>>,
},
release {
to: T::AccountId,
},
cancel {
creator: T::AccountId,
},
resolve_payment {
from: T::AccountId,
recipient: T::AccountId,
recipient_share: Percent,
},
request_refund {
recipient: T::AccountId,
},
dispute_refund {
creator: T::AccountId,
},
request_payment {
from: T::AccountId,
asset: AssetIdOf<T>,
amount: BalanceOf<T>,
},
accept_and_pay {
to: T::AccountId,
},
// some variants omitted
}
Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
pay
This allows any user to create a new payment, that releases only to specified recipient The only action is to store the details of this payment in storage and reserve the specified amount. User also has the option to add a remark, this remark can then be used to run custom logic and trigger alternate payment flows. the specified amount.
Fields
remark: Option<BoundedDataOf<T>>
release
Release any created payment, this will transfer the reserved amount from the creator of the payment to the assigned recipient
cancel
Cancel a payment in created state, this will release the reserved back to creator of the payment. This extrinsic can only be called by the recipient of the payment
resolve_payment
This extrinsic is used to resolve disputes between the creator and recipient of the payment. This extrinsic allows the assigned judge to cancel/release/partial_release the payment.
request_refund
Allow the creator of a payment to initiate a refund that will return the funds after a configured amount of time that the receiver has to react and oppose the request
dispute_refund
Allow payment recipient to dispute the refund request from the payment creator This does not cancel the request, instead sends the payment to a NeedsReview state The assigned resolver account can then change the state of the payment after review.
request_payment
accept_and_pay
Implementations§
Source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
Sourcepub fn new_call_variant_pay(
recipient: T::AccountId,
asset: AssetIdOf<T>,
amount: BalanceOf<T>,
remark: Option<BoundedDataOf<T>>,
) -> Self
pub fn new_call_variant_pay( recipient: T::AccountId, asset: AssetIdOf<T>, amount: BalanceOf<T>, remark: Option<BoundedDataOf<T>>, ) -> Self
Create a call with the variant pay
.
Sourcepub fn new_call_variant_release(to: T::AccountId) -> Self
pub fn new_call_variant_release(to: T::AccountId) -> Self
Create a call with the variant release
.
Sourcepub fn new_call_variant_cancel(creator: T::AccountId) -> Self
pub fn new_call_variant_cancel(creator: T::AccountId) -> Self
Create a call with the variant cancel
.
Sourcepub fn new_call_variant_resolve_payment(
from: T::AccountId,
recipient: T::AccountId,
recipient_share: Percent,
) -> Self
pub fn new_call_variant_resolve_payment( from: T::AccountId, recipient: T::AccountId, recipient_share: Percent, ) -> Self
Create a call with the variant resolve_payment
.
Sourcepub fn new_call_variant_request_refund(recipient: T::AccountId) -> Self
pub fn new_call_variant_request_refund(recipient: T::AccountId) -> Self
Create a call with the variant request_refund
.
Sourcepub fn new_call_variant_dispute_refund(creator: T::AccountId) -> Self
pub fn new_call_variant_dispute_refund(creator: T::AccountId) -> Self
Create a call with the variant dispute_refund
.
Sourcepub fn new_call_variant_request_payment(
from: T::AccountId,
asset: AssetIdOf<T>,
amount: BalanceOf<T>,
) -> Self
pub fn new_call_variant_request_payment( from: T::AccountId, asset: AssetIdOf<T>, amount: BalanceOf<T>, ) -> Self
Create a call with the variant request_payment
.
Sourcepub fn new_call_variant_accept_and_pay(to: T::AccountId) -> Self
pub fn new_call_variant_accept_and_pay(to: T::AccountId) -> Self
Create a call with the variant accept_and_pay
.
Trait Implementations§
Source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
Source§type Origin = <T as Config>::RuntimeOrigin
type Origin = <T as Config>::RuntimeOrigin
Source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]
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) -> R
fn using_encoded<R, F>(&self, f: F) -> R
Source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
Source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
Source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
Source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName
.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]
GetCallIndex
.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> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
AssetIdOf<T>: TypeInfo + 'static,
BalanceOf<T>: HasCompact,
Option<BoundedDataOf<T>>: TypeInfo + 'static,
T: Config + 'static,
impl<T> TypeInfo for Call<T>where
PhantomData<(T,)>: TypeInfo + 'static,
T::AccountId: TypeInfo + 'static,
AssetIdOf<T>: TypeInfo + 'static,
BalanceOf<T>: HasCompact,
Option<BoundedDataOf<T>>: TypeInfo + 'static,
T: Config + 'static,
Source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
Source§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> DecodeWithMemTracking for Call<T>where
T::AccountId: DecodeWithMemTracking,
AssetIdOf<T>: DecodeWithMemTracking,
Option<BoundedDataOf<T>>: DecodeWithMemTracking,
BalanceOf<T>: HasCompact,
<BalanceOf<T> as HasCompact>::Type: DecodeWithMemTracking,
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>
impl<T> RefUnwindSafe for Call<T>where
<T as Config>::AccountId: RefUnwindSafe,
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::CurrencyId: RefUnwindSafe,
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::Balance: RefUnwindSafe,
T: RefUnwindSafe,
<T as Config>::MaxRemarkLength: RefUnwindSafe,
impl<T> Send for Call<T>where
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::CurrencyId: Send,
T: Send,
<T as Config>::MaxRemarkLength: Send,
impl<T> Sync for Call<T>where
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::CurrencyId: Sync,
T: Sync,
<T as Config>::MaxRemarkLength: Sync,
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
<T as Config>::AccountId: UnwindSafe,
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::CurrencyId: UnwindSafe,
<<T as Config>::Asset as MultiCurrency<<T as Config>::AccountId>>::Balance: UnwindSafe,
T: UnwindSafe,
<T as Config>::MaxRemarkLength: UnwindSafe,
Blanket Implementations§
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
Source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
Source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> 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<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
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 S
impl<T, S> UniqueSaturatedInto<T> for S
Source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.