Skip to main content

IntentCall

Struct IntentCall 

Source
pub struct IntentCall {
    pub op: String,
    pub summary: String,
    /* private fields */
}
Expand description

A metadata-resolved call plus immutable product-level transaction semantics.

The call target, parameters, signer, and policy classification are private so callers cannot change the encoded call after a trusted constructor has attached its spend/subnet semantics. Use IntentCall::new only for an arbitrary call: it is deliberately classified as raw, unbounded, and unknown/all-subnet scope. Narrower semantics are available only through fixed operation-specific constructors in this module.

Fields§

§op: String§summary: String

Implementations§

Source§

impl IntentCall

Source

pub fn new( op: impl Into<String>, signer: SignerRole, pallet: impl Into<String>, function: impl Into<String>, params: Value, ) -> Self

Construct an arbitrary metadata call.

Arbitrary calls are always raw, Spend::Unbounded, and treated as affecting every subnet. This fail-closed classification means they require explicit allow_raw_calls, cannot pass a spend cap, and cannot pass an explicit subnet allowlist. Callers cannot downgrade that classification after construction.

Source

pub fn raw_call( op: impl Into<String>, signer: SignerRole, pallet: impl Into<String>, function: impl Into<String>, params: Value, ) -> Self

Explicitly named alias for IntentCall::new.

Source

pub fn op(&self) -> &str

Stable operation name used in plans and diagnostics.

Source

pub fn signer_role(&self) -> SignerRole

Signer selected by the constructor. Read-only: callers cannot change it.

Source

pub fn pallet(&self) -> &str

Metadata call target. Read-only: callers cannot replace the trusted call.

Source

pub fn function(&self) -> &str

Metadata function target. Read-only: callers cannot replace the trusted call.

Source

pub fn params(&self) -> &Value

SCALE input value. Read-only: callers cannot replace trusted parameters.

Source

pub fn summary(self, summary: impl Into<String>) -> Self

Replace presentation text only. This cannot alter policy semantics.

Source

pub fn spend(self, spend: Spend) -> Self

Compatibility policy floor for older call sites. This can only make a trusted classification stricter. Arbitrary calls remain unbounded.

Source

pub fn touches(self, netuids: impl IntoIterator<Item = u16>) -> Self

Compatibility policy floor for older call sites. Supplied netuids are unioned with constructor-derived scope; they can never remove scope.

Source

pub fn affects_all_subnets(self) -> Self

Broaden this call’s subnet scope. There is intentionally no inverse.

Source

pub fn raw(self) -> Self

Force the arbitrary-call classification. There is intentionally no inverse that can turn a raw call into a trusted call.

Source

pub fn transfer(dest: impl Into<String>, amount_rao: u128) -> Self

A bounded keep-alive TAO transfer.

Source

pub fn fund_evm_key(mirror: impl Into<String>, amount_rao: u128) -> Self

Fund the native mirror of an EVM address with a bounded TAO amount.

Source

pub fn transfer_allow_death(dest: impl Into<String>, amount_rao: u128) -> Self

A bounded TAO transfer that may reap the sender.

Source

pub fn transfer_all(dest: impl Into<String>, keep_alive: bool) -> Self

Transfer the account’s full transferable balance.

Source

pub fn add_stake( hotkey: impl Into<String>, netuid: u16, amount_rao: u128, ) -> Self

Stake a bounded amount of TAO on one subnet.

Source

pub fn add_stake_limit( hotkey: impl Into<String>, netuid: u16, amount_rao: u128, limit_price_rao: u128, allow_partial: bool, ) -> Self

Stake a bounded amount of TAO with a limit price.

Source

pub fn remove_stake( hotkey: impl Into<String>, netuid: u16, amount_alpha_rao: u128, ) -> Self

Remove alpha stake from one subnet. This moves value back to the signer, so it is subnet-scoped but not an outgoing spend.

Source

pub fn remove_stake_limit( hotkey: impl Into<String>, netuid: u16, amount_alpha_rao: u128, limit_price_rao: u128, allow_partial: bool, ) -> Self

Remove alpha stake from one subnet with a limit price.

Source

pub fn register_subnet(hotkey: impl Into<String>) -> Self

Register a subnet. The live registration cost is not known locally.

Source

pub fn start_call(netuid: u16) -> Self

Activate one owned subnet.

Source

pub fn burned_register(netuid: u16, hotkey: impl Into<String>) -> Self

Register a hotkey by burning the subnet’s live registration cost.

Source

pub fn root_register(hotkey: impl Into<String>) -> Self

Register a hotkey on root.

Source

pub fn move_stake( origin_hotkey: impl Into<String>, origin_netuid: u16, destination_hotkey: impl Into<String>, destination_netuid: u16, amount_alpha_rao: u128, ) -> Self

Move stake between hotkeys/subnets without transferring ownership.

Source

pub fn move_stake_limit( origin_hotkey: impl Into<String>, origin_netuid: u16, destination_hotkey: impl Into<String>, destination_netuid: u16, amount_alpha_rao: u128, limit_price: u128, allow_partial: bool, ) -> Self

Move stake between hotkeys/subnets with a relative cross-subnet price limit.

Source

pub fn swap_stake( hotkey: impl Into<String>, origin_netuid: u16, destination_netuid: u16, amount_alpha_rao: u128, ) -> Self

Swap stake between two subnets on one hotkey.

Source

pub fn transfer_stake( destination_coldkey: impl Into<String>, hotkey: impl Into<String>, origin_netuid: u16, destination_netuid: u16, amount_alpha_rao: u128, ) -> Self

Transfer stake ownership to another coldkey. The alpha value is not cheaply TAO-bounded, so a spend cap must reject it.

Source

pub fn transfer_stake_and_hotkey( destination_coldkey: impl Into<String>, origin_hotkey: impl Into<String>, destination_hotkey: impl Into<String>, origin_netuid: u16, destination_netuid: u16, amount_alpha_rao: u128, ) -> Self

Transfer stake ownership to another coldkey, landing it on a different hotkey. Like transfer_stake, the alpha value is not cheaply TAO-bounded, so a spend cap must reject it.

Source

pub fn unstake_all(hotkey: impl Into<String>) -> Self

Unstake from every subnet on one hotkey.

Source

pub fn unstake_all_alpha(hotkey: impl Into<String>) -> Self

Move all alpha stake to root across every subnet on one hotkey.

Source

pub fn set_hyperparameter( netuid: u16, name: &str, value: Value, ) -> Result<Self, CoreError>

Construct an owner-settable subnet hyperparameter call while rejecting root-only or compound parameters before signing.

Source

pub fn set_root_claim_type( claim_type: &str, subnets: Option<Vec<u16>>, ) -> Result<Self, CoreError>

Construct and validate the runtime’s root-claim enum.

Source

pub fn set_take( client: &Client, hotkey: impl Into<String>, take: u16, ) -> Result<Self, CoreError>

Set a delegate take to an absolute value, selecting the runtime’s directional call from the current on-chain take. This mirrors the semantic set_take intent without hard-coding a direction at callers.

Source

pub fn encode(&self, client: &Client) -> Result<Vec<u8>, CoreError>

Source

pub fn batch(client: &Client, children: Vec<Self>) -> Result<Self, CoreError>

Build an all-or-nothing Utility.batch_all, aggregating signer, spend, and subnet policy metadata across every child.

Trait Implementations§

Source§

impl Clone for IntentCall

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for IntentCall

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

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

fn in_current_span(self) -> Instrumented<Self> ⓘ

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> JsonSchemaMaybe for T

Source§

impl<T> MaybeDebug for T
where T: Debug,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

Source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more