pub struct ApprovalBinding {
pub chain_id: u64,
pub payee_address: String,
pub amount_minor_units: u128,
pub token_symbol: String,
pub token_contract: Option<String>,
pub approval_expires_at: u64,
}Expand description
Approval-bound settlement parameters the caller MUST supply.
EIP-3009 authorizations are independently replay-able and are not, by themselves, tied to the approval that governs the spend. This binding requires the prepared authorization to be bound to its governing approval so a captured signature cannot be redirected to a different payee, inflated to a different amount, or replayed on a different chain.
This type is the seam to the governed-approval layer: once a verified
[chio_core_types::capability::governance::GovernedApprovalToken] is
available at the settlement layer, the caller derives these bound
values from that token’s governed intent and passes them here. Until
then, the caller is the trust boundary that MUST extract the values
from the verified approval before calling
prepare_transfer_with_authorization. Either way the bound values
are asserted against the authorization and any mismatch fails closed.
The GovernedApprovalToken itself does not carry chain/amount/payee/token
as discrete fields (they are folded into its governed_intent_hash), so
this layer cannot re-derive them from the token alone; it asserts the
explicitly-bound values the caller resolved from the verified intent.
Fields§
§chain_id: u64Chain id the governing approval authorized the spend on. Must equal
the EIP-3009 domain chain_id.
payee_address: StringPayee the governing approval authorized. Must equal the EIP-3009
authorization to address (case-insensitive hex / checksum).
amount_minor_units: u128Amount in token minor units the governing approval authorized. Must
equal the EIP-3009 authorization value.
token_symbol: StringToken/currency symbol the governing approval authorized (for example
"USDC"). The chain id alone does not pin the token: a captured
authorization for one token contract can otherwise be redirected to a
different token on the same chain with the same payee and numeric
amount. Each lane asserts its lane-specific token identity against
this symbol (x402 accepted tokens, Circle token symbol). Compared
case-insensitively after trimming.
token_contract: Option<String>Token contract address the governing approval authorized (for example
the USDC contract on the target chain). It is asserted against the
EIP-3009 domain verifying_contract, which is the contract the signed
transfer actually targets, so a captured authorization cannot be
redirected to a different token contract on the same chain. Compared as
parsed Address bytes so checksum vs lowercase hex compare equal.
REQUIRED for the EIP-3009 lane: prepare_transfer_with_authorization
fails closed when this is None, because a symbol alone cannot pin the
on-chain token. The field stays Option only because lanes that
identify their token by symbol and have no contract to compare against
(the x402 accepted-token list and the Circle token symbol) still bind
via token_symbol and legitimately leave this None.
approval_expires_at: u64Approval expiry as a Unix timestamp in seconds. The prepared
authorization MUST NOT outlive the governing approval: when an
EIP-3009 valid_before would let a signed transfer stay broadcastable
past this instant, preparation fails closed. Binds the off-chain
authorization window to the approval window so a captured signature
cannot be broadcast after the approval that governs it has expired.
Implementations§
Source§impl ApprovalBinding
impl ApprovalBinding
Sourcepub fn assert_dispatch(
&self,
lane: &str,
dispatch: &Web3SettlementDispatchArtifact,
) -> Result<(), SettlementError>
pub fn assert_dispatch( &self, lane: &str, dispatch: &Web3SettlementDispatchArtifact, ) -> Result<(), SettlementError>
Assert that a settlement dispatch matches the approval-bound spend.
Sourcepub fn assert_token_symbol(
&self,
lane: &str,
lane_token_symbol: &str,
) -> Result<(), SettlementError>
pub fn assert_token_symbol( &self, lane: &str, lane_token_symbol: &str, ) -> Result<(), SettlementError>
Assert that a lane’s token symbol matches the approval-bound token.
Trait Implementations§
Source§impl Clone for ApprovalBinding
impl Clone for ApprovalBinding
Source§fn clone(&self) -> ApprovalBinding
fn clone(&self) -> ApprovalBinding
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more