@x402r/evm
v0.0.3
Published
Escrow payment scheme for x402 using Base Commerce Payments
Readme
@x402r/evm
Escrow payment scheme for x402 HTTP 402 flows. Bridges the x402 protocol with x402r escrow contracts on Base.
Install
npm install @x402r/evmUsage
Client — Create payment payloads
import { EscrowEvmScheme, registerEscrowEvmScheme } from '@x402r/evm/escrow/client'
import { x402Client } from '@x402/core/client'
const client = new x402Client()
registerEscrowEvmScheme(client, { signer })
// or with specific networks:
registerEscrowEvmScheme(client, { signer, networks: 'eip155:84532' })Server — Register with x402 resource server
import { EscrowServerScheme, registerEscrowEvmScheme } from '@x402r/evm/escrow/server'
import { x402ResourceServer } from '@x402/core/server'
const server = new x402ResourceServer(facilitatorConfig)
registerEscrowEvmScheme(server)
// or with specific networks:
registerEscrowEvmScheme(server, { networks: 'eip155:84532' })Facilitator — Verify and settle payments
import { EscrowFacilitatorScheme, registerEscrowEvmScheme } from '@x402r/evm/escrow/facilitator'
import { x402Facilitator } from '@x402/core/facilitator'
const facilitator = new x402Facilitator()
registerEscrowEvmScheme(facilitator, { signer, networks: 'eip155:84532' })Exports
@x402r/evm—EscrowEvmScheme(client scheme class)@x402r/evm/escrow/client—EscrowEvmScheme,registerEscrowEvmScheme(),EvmClientConfig@x402r/evm/escrow/server—EscrowServerScheme,registerEscrowEvmScheme(),EvmResourceServerConfig@x402r/evm/escrow/facilitator—EscrowFacilitatorScheme,registerEscrowEvmScheme(),EvmFacilitatorConfig
Links
License
MIT
