pub struct WireCapability {
pub spending_cap: u64,
pub expiry: u64,
pub owner_signature: Vec<u8>,
}Expand description
A pool owner’s spending capability, carried inside StreamRequestExt
(ADR 003 §Capability delegation). signer and pool_id are not on the
wire — they are derived from stream context, exactly like a Voucher’s
implicit fields: signer is the request’s bound Ethereum address
(ClientBinding::ethereum_address, or the registered on-chain signer
when binding is absent) and pool_id is StreamRequest::pool_id.
Fields§
§spending_cap: u64Maximum cumulative amount the signer may spend against the pool under
this grant. A u64, matching the PaymentPool.spendingCap on-chain
storage/calldata width exactly — the node zero-extends it to a uint256
word when it reconstructs the EIP-712 capability digest (just as it does
Voucher::amount).
expiry: u64Unix-seconds expiry. After it, vouchers under this capability are no longer redeemable.
owner_signature: Vec<u8>EIP-712 owner signature over the capability (r‖s‖v, 65 bytes for an
EOA owner; may be longer for an ERC-1271 contract owner, so unlike
VOUCHER_SIG_LEN-pinned signatures this is only checked non-empty at
the wire boundary — WireCapability::validate). The cryptographic
recovery/verification happens in decdn_incentive.
Implementations§
Source§impl WireCapability
impl WireCapability
Sourcepub const fn validate(&self) -> Result<(), MessageValidationError>
pub const fn validate(&self) -> Result<(), MessageValidationError>
Validate the wire-level owner_signature non-emptiness. Unlike
ClientBinding::validate / Voucher::validate this cannot pin an
exact length — an ERC-1271 contract signature may be longer than the
65-byte EOA form — so this is a floor, not a full shape check.
§Errors
MessageValidationError::EmptyCapabilitySignature if owner_signature
is empty.