Skip to content

TypeScript API surface

Generated from the built tx402 package’s own exports, so this list cannot claim a symbol the package does not ship. Signatures and per-symbol documentation live in the bundled .d.ts files, which your editor reads directly — this page answers “what is available and from where”.

Importing this path must not load a chain library, and a package-contract test asserts it. viem, @solana/kit, @x402/evm, and @x402/svm are reached through a lazy import() only when a payment on that family is actually planned (ADR-008, ADR-009).

  • assertValidReleaseManifest
  • chainFamily
  • createBalanceProbeCache
  • createTx402Client
  • decodePaymentRequired
  • digestRequestBody
  • fingerprintRequest
  • formatMoneyDecimal
  • isEvmSigner
  • isSolanaSigner
  • isTx402Error
  • normalizeFingerprintUrl
  • normalizePolicyHost
  • orderRouteCandidates
  • parseMoneyAtomic
  • parsePositiveMoneyAtomic
  • planRoutes
  • requireNetwork
  • resolveNetwork
  • verifyReleaseManifest
  • AmbiguousPaymentError
  • BudgetExceededError
  • ClockSkewError
  • ConfigurationError
  • DomainNotAllowedError
  • HealthIndex
  • InsufficientLiquidityError
  • InvalidPaymentRequiredError
  • MemorySpendStore
  • MoneyParseError
  • NonReplayableRequestError
  • PaidRedirectBlockedError
  • PolicyEngine
  • ReservedHeaderError
  • ResourceDeliveryError
  • SignerError
  • TransportError
  • Tx402Error
  • UnsupportedProtocolError
  • UnsupportedSchemeError
  • BALANCE_KEY_SEPARATOR
  • BALANCE_TIMEOUT_MS
  • BUNDLED_MANIFEST
  • CIRCUIT_OPEN_MS
  • HEALTH_CONSECUTIVE_FAILURES_TO_OPEN
  • HEALTH_EWMA_ALPHA
  • HEALTH_FAILURE_RATE_TO_OPEN
  • HEALTH_FAILURE_WINDOW
  • HEALTH_IDLE_RETENTION_MS
  • HEALTH_LATENCY_PENALTY_MAX
  • HEALTH_LATENCY_REFERENCE_MS
  • HEALTH_MAX_ENDPOINTS
  • HEALTH_MIN_SAMPLES_FOR_RATE
  • HEALTH_NEW_ENDPOINT_SCORE
  • HEALTH_OPEN_MS
  • MANIFEST_SIGNING_DOMAIN
  • MAX_AUTHORIZATION_SECONDS
  • MAX_PAYMENT_REQUIRED_BYTES
  • MAX_PAYMENT_REQUIRED_DEPTH
  • MAX_PAYMENT_REQUIREMENTS
  • MAX_PROVIDERS_PER_NETWORK
  • PACKAGE_NAME
  • PROJECT_URLS
  • PROTOCOL_HEADERS
  • REQUEST_FINGERPRINT_DOMAIN
  • REQUEST_ID_HEADER
  • RESERVATION_TTL_MS
  • RESERVED_REQUEST_HEADERS
  • ROLLING_WINDOW_MS
  • TRUSTED_MANIFEST_KEYS
  • TX402_ERROR_CODES
  • TX402_ERROR_DESCRIPTORS
  • TX402_ERROR_TAXONOMY
  • X402_PROTOCOL_VERSION
Import Loads Use when
tx402/evm viem, @x402/evm You pay on an EVM network and want the bundled adapter.
tx402/solana @solana/kit, @x402/svm You pay on Solana and want the bundled adapter.
tx402/signers viem/accounts Development only — wraps a raw private key as an EvmSigner (SEC-001).

The Python package mirrors this split with extras: pip install tx402 is the core, tx402[evm], tx402[svm], and tx402[all] add the chain libraries. import tx402 loads no chain library in either language.