r402-near
NEAR chain support for the x402 payment protocol, part of the
r402 workspace.
Highlights
- Exact scheme — one NEP-141
ft_transferauthorized as a NEP-366SignedDelegate. The facilitator relayer submits the outer transaction and reports success only when the innerft_transferreceipt succeeds. - CAIP-2 networks —
near:mainnetandnear:testnet. - No client extra — the relayer is facilitator-local.
price_tagsetsenricher: None.supported().signers["near:*"]lists relayer account IDs. - In-process facilitator — verify and settle against FastNEAR JSON-RPC
(overridable). Duplicate settle is blocked by
SettlementCache(120s TTL) keyed by the base64 delegate.
Cargo Features
| Feature | Surface |
|---|---|
client |
Buyer-side NEP-366 delegate signing. |
server |
Server-side PriceTag generation. |
facilitator |
On-chain verify and settle (JSON-RPC). |
telemetry |
tracing instrumentation. |
full |
All of the above. |
Quick Start (server price tag)
use ;
let tag = price_tag;
Documentation
- Crate docs: https://docs.rs/r402-near
- Project README:
../../README.md
License
Dual-licensed under MIT and Apache-2.0.