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: StringImplementations§
Source§impl IntentCall
impl IntentCall
Sourcepub fn new(
op: impl Into<String>,
signer: SignerRole,
pallet: impl Into<String>,
function: impl Into<String>,
params: Value,
) -> Self
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.
Sourcepub fn raw_call(
op: impl Into<String>,
signer: SignerRole,
pallet: impl Into<String>,
function: impl Into<String>,
params: Value,
) -> Self
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.
Sourcepub fn signer_role(&self) -> SignerRole
pub fn signer_role(&self) -> SignerRole
Signer selected by the constructor. Read-only: callers cannot change it.
Sourcepub fn pallet(&self) -> &str
pub fn pallet(&self) -> &str
Metadata call target. Read-only: callers cannot replace the trusted call.
Sourcepub fn function(&self) -> &str
pub fn function(&self) -> &str
Metadata function target. Read-only: callers cannot replace the trusted call.
Sourcepub fn params(&self) -> &Value
pub fn params(&self) -> &Value
SCALE input value. Read-only: callers cannot replace trusted parameters.
Sourcepub fn summary(self, summary: impl Into<String>) -> Self
pub fn summary(self, summary: impl Into<String>) -> Self
Replace presentation text only. This cannot alter policy semantics.
Sourcepub fn spend(self, spend: Spend) -> Self
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.
Sourcepub fn touches(self, netuids: impl IntoIterator<Item = u16>) -> Self
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.
Sourcepub fn affects_all_subnets(self) -> Self
pub fn affects_all_subnets(self) -> Self
Broaden this call’s subnet scope. There is intentionally no inverse.
Sourcepub fn raw(self) -> Self
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.
Sourcepub fn transfer(dest: impl Into<String>, amount_rao: u128) -> Self
pub fn transfer(dest: impl Into<String>, amount_rao: u128) -> Self
A bounded keep-alive TAO transfer.
Sourcepub fn fund_evm_key(mirror: impl Into<String>, amount_rao: u128) -> Self
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.
Sourcepub fn transfer_allow_death(dest: impl Into<String>, amount_rao: u128) -> Self
pub fn transfer_allow_death(dest: impl Into<String>, amount_rao: u128) -> Self
A bounded TAO transfer that may reap the sender.
Sourcepub fn transfer_all(dest: impl Into<String>, keep_alive: bool) -> Self
pub fn transfer_all(dest: impl Into<String>, keep_alive: bool) -> Self
Transfer the account’s full transferable balance.
Sourcepub fn add_stake(
hotkey: impl Into<String>,
netuid: u16,
amount_rao: u128,
) -> Self
pub fn add_stake( hotkey: impl Into<String>, netuid: u16, amount_rao: u128, ) -> Self
Stake a bounded amount of TAO on one subnet.
Sourcepub fn add_stake_limit(
hotkey: impl Into<String>,
netuid: u16,
amount_rao: u128,
limit_price_rao: u128,
allow_partial: bool,
) -> Self
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.
Sourcepub fn remove_stake(
hotkey: impl Into<String>,
netuid: u16,
amount_alpha_rao: u128,
) -> Self
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.
Sourcepub fn remove_stake_limit(
hotkey: impl Into<String>,
netuid: u16,
amount_alpha_rao: u128,
limit_price_rao: u128,
allow_partial: bool,
) -> Self
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.
Sourcepub fn register_subnet(hotkey: impl Into<String>) -> Self
pub fn register_subnet(hotkey: impl Into<String>) -> Self
Register a subnet. The live registration cost is not known locally.
Sourcepub fn start_call(netuid: u16) -> Self
pub fn start_call(netuid: u16) -> Self
Activate one owned subnet.
Sourcepub fn burned_register(netuid: u16, hotkey: impl Into<String>) -> Self
pub fn burned_register(netuid: u16, hotkey: impl Into<String>) -> Self
Register a hotkey by burning the subnet’s live registration cost.
Sourcepub fn root_register(hotkey: impl Into<String>) -> Self
pub fn root_register(hotkey: impl Into<String>) -> Self
Register a hotkey on root.
Sourcepub fn move_stake(
origin_hotkey: impl Into<String>,
origin_netuid: u16,
destination_hotkey: impl Into<String>,
destination_netuid: u16,
amount_alpha_rao: u128,
) -> Self
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.
Sourcepub 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
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.
Sourcepub fn swap_stake(
hotkey: impl Into<String>,
origin_netuid: u16,
destination_netuid: u16,
amount_alpha_rao: u128,
) -> Self
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.
Sourcepub fn transfer_stake(
destination_coldkey: impl Into<String>,
hotkey: impl Into<String>,
origin_netuid: u16,
destination_netuid: u16,
amount_alpha_rao: u128,
) -> Self
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.
Sourcepub 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
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.
Sourcepub fn unstake_all(hotkey: impl Into<String>) -> Self
pub fn unstake_all(hotkey: impl Into<String>) -> Self
Unstake from every subnet on one hotkey.
Sourcepub fn unstake_all_alpha(hotkey: impl Into<String>) -> Self
pub fn unstake_all_alpha(hotkey: impl Into<String>) -> Self
Move all alpha stake to root across every subnet on one hotkey.
Sourcepub fn set_hyperparameter(
netuid: u16,
name: &str,
value: Value,
) -> Result<Self, CoreError>
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.
Sourcepub fn set_root_claim_type(
claim_type: &str,
subnets: Option<Vec<u16>>,
) -> Result<Self, CoreError>
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.
Sourcepub fn set_take(
client: &Client,
hotkey: impl Into<String>,
take: u16,
) -> Result<Self, CoreError>
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.
pub fn encode(&self, client: &Client) -> Result<Vec<u8>, CoreError>
Trait Implementations§
Source§impl Clone for IntentCall
impl Clone for IntentCall
Auto Trait Implementations§
impl Forget for IntentCall
impl Freeze for IntentCall
impl Move for IntentCall
impl RefUnwindSafe for IntentCall
impl Send for IntentCall
impl Sync for IntentCall
impl Unpin for IntentCall
impl UnsafeUnpin for IntentCall
impl UnwindSafe for IntentCall
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreimpl<T> JsonSchemaMaybe for T
impl<T> MaybeDebug for Twhere
T: Debug,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.