pub struct Capability {
pub signer: Address,
pub spending_cap: u64,
pub pool_id: B256,
pub expiry: u64,
}Expand description
A pool owner’s spending grant in its unsigned form.
Fields§
§signer: AddressThe address the owner delegates spend to — the voucher-signing key.
spending_cap: u64Maximum cumulative amount (token base units) the signer may spend
against pool_id under this grant. A u64 to match the
PaymentPool.spendingCap storage/calldata width exactly; the EIP-712
type-string still hashes it as a uint256 word (the signing hash widens
it with U256::from).
pool_id: B256The pool this capability draws from — the on-chain PaymentPool
deposit id.
expiry: u64Unix-seconds expiry. After it, vouchers under this capability are no longer redeemable and the node stops accepting them.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn signing_hash(&self, domain: &Eip712Domain) -> B256
pub fn signing_hash(&self, domain: &Eip712Domain) -> B256
EIP-712 signing hash bound to domain — the 32-byte digest the contract
recovers the owner signature against.
Sourcepub fn sign<S: SignerSync>(
self,
signer: &S,
domain: &Eip712Domain,
) -> Result<SignedCapability, Error>
pub fn sign<S: SignerSync>( self, signer: &S, domain: &Eip712Domain, ) -> Result<SignedCapability, Error>
Sign the capability with the pool owner’s signer for the given EIP-712
domain.
§Errors
Propagates any error returned by the underlying signer (key locked, remote signer offline, etc.).
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§impl Debug for Capability
impl Debug for Capability
impl Eq for Capability
Source§impl PartialEq for Capability
impl PartialEq for Capability
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 more