@xenga/types
v0.1.0
Published
Shared types, constants, and ABIs for xenga escrow payment protocol
Readme
@xenga/types
Shared types, constants, ABIs, and utilities for the xenga escrow payment protocol.
Install
npm install @xenga/typesWhat's included
- Types —
Order,OnChainEscrow,EscrowState,ReputationScore,EscrowPaymentRequired,EscrowPaymentPayload,EscrowPaymentResponse,Stats, etc. - Constants — Chain configs (Base Sepolia/Mainnet), USDC addresses, service type windows, reputation thresholds
- EIP-712 —
buildReceiveAuthSigningParams()for ERC-3009 gasless USDC authorizations - ABIs — Auto-generated EscrowVault ABI (via
@xenga/types/abi) - Errors —
X402Error,NetworkError,InvalidPaymentHeaderError,SettlementError, etc. - Retry —
withRetry()exponential backoff helper,isRetryableError()predicate
Usage
import {
type Order,
type OnChainEscrow,
EscrowState,
getChainConfig,
buildReceiveAuthSigningParams,
NetworkError,
withRetry,
} from "@xenga/types";
import { escrowVaultAbi } from "@xenga/types/abi";Peer dependencies
viem^2.21.0
