pub struct WalletReservationsReserveParams {
pub coin_ids: Vec<String>,
pub ttl_secs: Option<u64>,
}Expand description
control.wallet.reservations.reserve params: take EVERY named coin, or take none.
The wire form of dig_account::wallet::reservation::CoinReservationStore::reserve_all, so a
client backing that seam with the node forwards its arguments rather than translating them.
§All-or-none is the whole contract
Reading the held set, selecting, then reserving is check-then-act: two processes both read an
empty set and both take the same coin. Atomic acquisition is what closes that window, so a
conflict on ANY coin refuses the WHOLE call and reserves nothing — see
ControlErrorCode::WalletCoinsReserved. A caller that loses re-reads
WalletReservationsHeldParams and re-selects from what remains.
§An empty list is a success, not an error
It yields a handle that releases nothing, which is what the caller asked for. This matches dig-account exactly: an empty reservation can never conflict, so refusing it would make a legitimate no-op selection look like a malformed request.
§No key material (§908)
A coin id is a public chain fact. There is no seed, key, signature or bundle field here and there never may be: a reservation is BOOKKEEPING — it narrows what a selector will choose and authorizes nothing.
Fields§
§coin_ids: Vec<String>The coin ids to hold: lowercase 64-hex, unprefixed. A 0x prefix is TOLERATED on input and
normalized away by Self::validated; it is never emitted.
ttl_secs: Option<u64>How long the hold should live, in seconds; None asks for the node’s default.
A REQUEST, never a command. The node clamps this to its own maximum and returns the value it
actually applied as
ttl_secs — an unclamped caller-chosen
lifetime is a lockout weapon, since one call could hold a wallet’s coins away from its owner
for as long as it liked.
Implementations§
Source§impl WalletReservationsReserveParams
impl WalletReservationsReserveParams
Sourcepub fn validated(self) -> Result<Self, ControlError>
pub fn validated(self) -> Result<Self, ControlError>
Normalize and check every coin id, or reject the request as -32602 INVALID_PARAMS.
The WHOLE request is refused when any id is malformed, never the well-formed subset. A partial reservation would leave the caller believing it holds inputs it does not — the exact state all-or-none acquisition exists to make unreachable.
Trait Implementations§
Source§impl Clone for WalletReservationsReserveParams
impl Clone for WalletReservationsReserveParams
Source§fn clone(&self) -> WalletReservationsReserveParams
fn clone(&self) -> WalletReservationsReserveParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more