Receipt class

Constructors

Receipt({String? amount, String? from, String? id, String? network, String? nonce, String? payee, String? payeeOrg, String? payer, String? resource, int? settledAt, String? settledVia, String? txHash})
Returns a new Receipt instance.

Properties

amount ↔ String?
Amount is what actually moved, as an exact 18-decimal-place USD string. It is NOT the atomic-unit figure the client signed: the challenge quotes the asset's own units (USDC's 6 dp) and truncates to fit them, while the ledger moves this exact value.
getter/setter pair
from ↔ String?
From is the payer's EVM address: the account that signed the EIP-3009 authorization, recovered from the signature rather than taken on trust.
getter/setter pair
hashCode → int
The hash code for this object.
no setteroverride
id ↔ String?
ID is the settle-once key: "x402_" + keccak(from|nonce) in hex. It is DERIVED, not minted, so a client that re-submits the same authorization addresses the same settlement and is served again for free rather than charged twice. It is also the id GET /v1/x402/settlements/:id takes.
getter/setter pair
network ↔ String?
Network is the CAIP-2 identifier the payment was settled under, e.g. "eip155:36963". Its eip155 reference is the chain id in the EIP-712 domain the payer signed, so it is not a label — changing it invalidates the signature.
getter/setter pair
nonce ↔ String?
Nonce is the client-chosen nonce from the authorization, hex — up to 32 bytes, left-padded to the contract's bytes32. It is the replay anchor: the token contract refuses a second on-chain transfer for one (from, nonce), and this rail refuses a second settlement for the same pair, so a ledger settlement inherits the identical guarantee.
getter/setter pair
payee ↔ String?
Payee is the recipient's EVM address — the payTo the challenge advertised and the authorization named. A payment to any other address never settles.
getter/setter pair
payeeOrg ↔ String?
PayeeOrg is the tenant that owns the recipient wallet, resolved at settlement. It is who got PAID, as Payer is who paid.
getter/setter pair
payer ↔ String?
Payer is the payer ORG — the tenant whose ledger was debited — and not an address. It is the org the request was authenticated as, so it answers who is billed, which the payer address alone cannot.
getter/setter pair
resource ↔ String?
Resource is what was paid for, in the same spelling the price table and the challenge used: the request path for a priced route, "tool:
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
settledAt ↔ int?
SettledAt is when this settlement was CLAIMED, in unix seconds — the moment the authorization was accepted, which is also the moment the time window it carried stopped applying. A settlement finished later by reconciliation keeps this instant.
getter/setter pair
settledVia ↔ String?
SettledVia is which rail moved the money: "ledger", the live default, or "chain" when the authorization is broadcast. Those two values and no others.
getter/setter pair
txHash ↔ String?
TxHash is the chain transaction hash, present only for a "chain" settlement. Empty on a ledger settlement — that is the normal case today, and it means the money moved without a chain, not that it failed. The wire's PAYMENT-RESPONSE transaction falls back to ID when this is empty.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override

Static Methods

fromJson(dynamic value) → Receipt?
Returns a new Receipt instance and imports its values from value if it's a Map, null otherwise.
listFromJson(dynamic json, {bool growable = false}) → List<Receipt>
mapFromJson(dynamic json) → Map<String, Receipt>
mapListFromJson(dynamic json, {bool growable = false}) → Map<String, List<Receipt>>

Constants

requiredKeys → const Set<String>
The list of required keys that must be present in a JSON.