pub struct TransactionApi;Implementations§
Source§impl TransactionApi
impl TransactionApi
Sourcepub fn create_blueprint(
&self,
blueprint: Blueprint,
) -> StaticPayload<CreateBlueprint>
pub fn create_blueprint( &self, blueprint: Blueprint, ) -> StaticPayload<CreateBlueprint>
Create a new service blueprint.
A Service Blueprint is a template for a service that can be instantiated later on by a user.
§Parameters
origin: The account that is creating the service blueprint.blueprint: The blueprint of the service.
Sourcepub fn pre_register(
&self,
blueprint_id: BlueprintId,
) -> StaticPayload<PreRegister>
pub fn pre_register( &self, blueprint_id: BlueprintId, ) -> StaticPayload<PreRegister>
Pre-register the caller as an operator for a specific blueprint.
The caller can pre-register for a blueprint, which will emit a PreRegistration event.
This event can be listened to by the operator node to execute the custom blueprint’s
registration function.
§Parameters
origin: The account that is pre-registering for the service blueprint.blueprint_id: The ID of the service blueprint.
Sourcepub fn register(
&self,
blueprint_id: BlueprintId,
preferences: Preferences,
registration_args: RegistrationArgs,
value: Value,
) -> StaticPayload<Register>
pub fn register( &self, blueprint_id: BlueprintId, preferences: Preferences, registration_args: RegistrationArgs, value: Value, ) -> StaticPayload<Register>
Register the caller as an operator for a specific blueprint.
The caller may require an approval first before they can accept to provide the service for the users.
Sourcepub fn unregister(&self, blueprint_id: BlueprintId) -> StaticPayload<Unregister>
pub fn unregister(&self, blueprint_id: BlueprintId) -> StaticPayload<Unregister>
Unregister the caller from being an operator for the service blueprint so that, no more services will assigned to the caller for this specific blueprint. Note that, the caller needs to keep providing service for other active service that uses this blueprint, until the end of service time, otherwise they may get reported and slashed.
Sourcepub fn update_price_targets(
&self,
blueprint_id: BlueprintId,
price_targets: PriceTargets,
) -> StaticPayload<UpdatePriceTargets>
pub fn update_price_targets( &self, blueprint_id: BlueprintId, price_targets: PriceTargets, ) -> StaticPayload<UpdatePriceTargets>
Update the price targets for the caller for a specific service blueprint.
See Self::register for more information.
Sourcepub fn request(
&self,
blueprint_id: BlueprintId,
permitted_callers: PermittedCallers,
operators: Operators,
request_args: RequestArgs,
assets: Assets,
ttl: Ttl,
value: Value,
) -> StaticPayload<Request>
pub fn request( &self, blueprint_id: BlueprintId, permitted_callers: PermittedCallers, operators: Operators, request_args: RequestArgs, assets: Assets, ttl: Ttl, value: Value, ) -> StaticPayload<Request>
Request a new service to be initiated using the provided blueprint with a list of operators that will run your service. Optionally, you can specifiy who is permitted caller of this service, by default only the caller is allowed to call the service.
Sourcepub fn approve(
&self,
request_id: RequestId,
restaking_percent: RestakingPercent,
) -> StaticPayload<Approve>
pub fn approve( &self, request_id: RequestId, restaking_percent: RestakingPercent, ) -> StaticPayload<Approve>
Approve a service request, so that the service can be initiated.
The restaking_percent is the percentage of the restaked tokens that will be exposed to
the service.
Sourcepub fn reject(&self, request_id: RequestId) -> StaticPayload<Reject>
pub fn reject(&self, request_id: RequestId) -> StaticPayload<Reject>
Reject a service request. The service will not be initiated, and the requester will need to update the service request.
Sourcepub fn terminate(&self, service_id: ServiceId) -> StaticPayload<Terminate>
pub fn terminate(&self, service_id: ServiceId) -> StaticPayload<Terminate>
Terminates the service by the owner of the service.
Sourcepub fn call(
&self,
service_id: ServiceId,
job: Job,
args: Args,
) -> StaticPayload<Call>
pub fn call( &self, service_id: ServiceId, job: Job, args: Args, ) -> StaticPayload<Call>
Call a Job in the service. The caller needs to be the owner of the service, or a permitted caller.
Sourcepub fn submit_result(
&self,
service_id: ServiceId,
call_id: CallId,
result: Result,
) -> StaticPayload<SubmitResult>
pub fn submit_result( &self, service_id: ServiceId, call_id: CallId, result: Result, ) -> StaticPayload<SubmitResult>
Submit the job result by using the service ID and call ID.
Sourcepub fn slash(
&self,
offender: Offender,
service_id: ServiceId,
percent: Percent,
) -> StaticPayload<Slash>
pub fn slash( &self, offender: Offender, service_id: ServiceId, percent: Percent, ) -> StaticPayload<Slash>
Slash an operator (offender) for a service id with a given percent of their exposed stake for that service.
The caller needs to be an authorized Slash Origin for this service. Note that this does not apply the slash directly, but instead schedules a deferred call to apply the slash by another entity.
Sourcepub fn dispute(&self, era: Era, index: Index) -> StaticPayload<Dispute>
pub fn dispute(&self, era: Era, index: Index) -> StaticPayload<Dispute>
Dispute an [UnappliedSlash] for a given era and index.
The caller needs to be an authorized Dispute Origin for the service in the [UnappliedSlash].
pub fn update_master_blueprint_service_manager( &self, address: Address, ) -> StaticPayload<UpdateMasterBlueprintServiceManager>
Auto Trait Implementations§
impl Freeze for TransactionApi
impl RefUnwindSafe for TransactionApi
impl Send for TransactionApi
impl Sync for TransactionApi
impl Unpin for TransactionApi
impl UnwindSafe for TransactionApi
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> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.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<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.