Skip to main content

WalletCoinsByParentParams

Struct WalletCoinsByParentParams 

Source
pub struct WalletCoinsByParentParams {
    pub parent_coin_id: String,
    pub after_coin_id: Option<String>,
    pub limit: Option<u32>,
}
Expand description

control.wallet.coinsByParent params: WHICH coin’s direct children to read.

§One hop, and the field name says so

The field is parent_coin_id rather than coin_id because the coin named here is the one being asked ABOUT as a parent — it is never the coin the caller wants back. A walk up or down a lineage is the CALLER’s composition of repeated single hops; the node performs exactly one. Naming it coin_id would make a recursive reading of the method plausible from the request alone, and a caller expecting a whole lineage from one call would read a one-hop answer as a truncated chain.

§Bounded, because a parent’s child count is not

This is the only OPEN wallet read whose answer has unbounded cardinality — every other one returns a single record (coinById, peak, syncStatus) or is already paged (arrivals). So the read is PAGED, and the page is bounded by COINS_BY_PARENT_MAX_LIMIT.

The bound is the ONLY thing bounding this call — there is no rate limiter anywhere behind it. dig-node’s control plane has no request rate limiting of any kind (dig_ecosystem#2577); the bandwidth limiter it does have governs content serving and is not on this path. A future reader weighing whether to relax this cap should assume no limiter exists, because none does.

That matters more than a local resource bound would, because the node does not necessarily answer from its own replica: on the fallback tier it forwards a caller-supplied identifier to a THIRD-PARTY coinset HTTPS oracle. An unbounded page is therefore unbounded work against somebody else’s service, requested by a token-less caller on a loopback endpoint.

Paging rather than a bare cap, because a bare cap is a dead end: a parent with more children than the cap could never be fully enumerated, and this method exists to WALK a lineage. A walk that cannot see past the cap is a walk that silently stops.

Fields§

§parent_coin_id: String

The PARENT coin’s id: lowercase 64-hex, unprefixed. A 0x prefix is TOLERATED on input and normalized away by Self::validated; it is never emitted.

§after_coin_id: Option<String>

Resume STRICTLY AFTER this child, in the read’s documented order. None starts at the first child.

This is the value the previous page handed back as cursor — never a value the caller invented, and never a marker for where the chain “got to”. control.wallet.arrivals records why that distinction loses rows; this read avoids the trap by having no such marker to reach for.

§limit: Option<u32>

The page size. None asks for COINS_BY_PARENT_DEFAULT_LIMIT.

A value above COINS_BY_PARENT_MAX_LIMIT, or a zero, is REFUSED as INVALID_PARAMS rather than clamped — see Self::validated.

Implementations§

Source§

impl WalletCoinsByParentParams

Source

pub fn first_page(parent_coin_id: impl Into<String>) -> Self

A first page of children for one parent: the node’s default size, starting at the beginning.

The common case, and the one a caller should not have to spell out — naming a page size means asserting a number this caller invented over the one the contract chose.

Source

pub fn effective_limit(&self) -> u32

The page size this request asks for, resolving None to COINS_BY_PARENT_DEFAULT_LIMIT.

Stated once here so a node and a client cannot resolve the same omitted field to two different numbers — a disagreement that would show up as a page boundary in the wrong place, which is exactly where a paged walk loses rows.

Source

pub fn validated(self) -> Result<Self, ControlError>

Normalize and check both ids and the page bound, or reject as -32602 INVALID_PARAMS.

The ids follow the rule every by-coin read in this crate follows (lowercase 64-hex, 0x tolerated on input and never emitted).

An out-of-range limit is REFUSED, never clamped. That is a deliberate departure from control.wallet.arrivals, which lets a node clamp: this read’s page boundary is what a caller RESUMES from, so a silently shrunk page hands back a cursor for a position the caller did not ask about, and a caller that believed its own number would mis-size every subsequent request. Refusing keeps the caller’s model of the page and the node’s identical, which is the same reason a 65-hex coin id is refused rather than truncated.

limit: 0 is refused for a separate reason: a page that can hold nothing makes no progress, so a caller looping until a page comes back short would loop forever.

Trait Implementations§

Source§

impl Clone for WalletCoinsByParentParams

Source§

fn clone(&self) -> WalletCoinsByParentParams

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 ControlCall for WalletCoinsByParentParams

Source§

const METHOD: ControlMethod = ControlMethod::WalletCoinsByParent

The wire method this call invokes.
Source§

type Output = WalletCoinsByParentResult

The typed result this call returns on success.
Source§

impl Debug for WalletCoinsByParentParams

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for WalletCoinsByParentParams

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for WalletCoinsByParentParams

Source§

impl PartialEq for WalletCoinsByParentParams

Source§

fn eq(&self, other: &WalletCoinsByParentParams) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for WalletCoinsByParentParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for WalletCoinsByParentParams

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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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.