Skip to main content

WalletCoinsByParentResult

Struct WalletCoinsByParentResult 

Source
pub struct WalletCoinsByParentResult {
    pub coins: Vec<WalletCoinRecord>,
    pub complete: bool,
    pub cursor: Option<String>,
    pub source: Option<WalletReadSource>,
    pub synced: bool,
    pub peak_height: Option<u32>,
}
Expand description

control.wallet.coinsByParent — the DIRECT children created by spending one coin.

§ONE hop, never a walk

The list is the coins the named parent’s spend created, and nothing further. It is not a lineage, not a subtree, and not transitive: a grandchild appears only when the caller asks again with the child’s id. A node MUST NOT recurse — an unbounded server-side walk over caller-supplied input is work the caller cannot bound, and a partial walk returned as if complete would be a lineage with a silent hole in it.

§A page, and it says so — the truncation rule

coins is ONE PAGE of the parent’s children, bounded by COINS_BY_PARENT_MAX_LIMIT. Whether it is the WHOLE child set is stated by complete and never left to be inferred from the page’s length.

This is the money-critical shape in this type. A caller walking a lineage reads “no more children” as this branch ends here, so a page that was truncated but looks whole terminates the walk early and presents a partial lineage as a complete one. Inferring completeness from coins.len() < limit is NOT equivalent and MUST NOT be done: a node is free to return a short page for its own reasons, and a child set that is an exact multiple of the page size makes the last full page indistinguishable from a truncated one.

§Resuming: the same lesson control.wallet.arrivals records

Resume from cursor — the last child you were actually HANDED — by passing it as after_coin_id. There is deliberately no “where the chain got to” marker on this type to reach for instead; that is the distinction WalletArrivalsResult::latest exists to warn about, and the cheapest way not to lose a row to it is to give a caller nothing else to resume from.

§The order is part of the contract, because paging is meaningless without one

A node MUST return children in ASCENDING coin_id order, and MUST keep that order stable across the pages of one walk. after_coin_id means strictly after this id in that order. Without a fixed order a cursor names no position, and a walk would silently repeat some children and skip others. Coin ids are fixed-length lowercase hex, so ascending lexicographic order and ascending 32-byte numeric order are the SAME order — an implementation may use whichever it has, and the two can never disagree.

§An empty list is an ANSWER, never a fallback

coins: [] means the node consulted a chain and that parent created no children it knows of — typically because the parent is unspent. It is NEVER what a caller gets when the chain could not be reached: those are the catalogued errors (WalletNoChainSource / WalletReadFailed / WalletRateLimited). The distinction is the same one every read in this family carries, and it matters most here: a caller walking a singleton forward reads an empty list as this is the tip.

§asset is null on every record

A child is named by its parent, not by an address and not by an asset, so this read classifies nothing — exactly like WalletCoinByIdResult. Every record MUST report asset as null rather than assert a class the read never verified.

Fields§

§coins: Vec<WalletCoinRecord>

One page of the parent’s direct children, ascending by coin_id, possibly empty. One hop only, and NOT necessarily the whole child set — see complete.

§complete: bool

Is this page the WHOLE child set?

true means every child the node knows of is in coins and the walk of this hop is finished. false means the answer was TRUNCATED and more children exist — resume from cursor.

Required on the wire, and stated positively so that the reading a caller falls into when the field is absent or defaulted is the SAFE one. A boolean spelled truncated would default to false, i.e. to “this is everything”, which is the claim that ends a lineage walk early; complete defaults to “there may be more”, which costs at worst one redundant request.

§cursor: Option<String>

The last child in this page — the value to resume from — or null for an empty page.

It is the id the caller was HANDED, never a marker for where the chain got to. Pass it as after_coin_id to fetch the next page.

The key MUST be present. null is meaningful here — it says this page carried nothing — so an ABSENT key must not decode into it: serde’s default treatment of Option would let a truncated or mis-routed payload decode into a confident “there was nothing to resume from”.

§source: Option<WalletReadSource>

Which tier answered, or None from a node too old to disclose it. See WalletReadSource.

§synced: bool

Whether these children reflect a caught-up view of the tier that ANSWERED, measured against that tier’s own peak — never against the node’s replica or its held peers.

true only when that peak came from the SAME read that produced these figures; a carried-over peak means false.

§peak_height: Option<u32>

The peak height of the tier that ANSWERED, or null when that tier tracks no peak.

It MUST be the height that tier reported in the SAME read that produced the figures, or null.

Trait Implementations§

Source§

impl Clone for WalletCoinsByParentResult

Source§

fn clone(&self) -> WalletCoinsByParentResult

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 WalletCoinsByParentResult

Source§

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

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

impl<'de> Deserialize<'de> for WalletCoinsByParentResult

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 WalletCoinsByParentResult

Source§

impl PartialEq for WalletCoinsByParentResult

Source§

fn eq(&self, other: &WalletCoinsByParentResult) -> 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 WalletCoinsByParentResult

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 WalletCoinsByParentResult

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.