Skip to main content
Defined in: client.ts:322 A Coinbase CDP-powered x402 client that initializes lazily on first payment. Extends x402Client with automatic wallet provisioning and scheme registration. Credentials and RPC URLs fall back to environment variables; wallet configuration is supplied explicitly via config. The account name/address used for payments is resolved internally. Use CdpX402Client.getAddresses to retrieve it — for example, to fund the wallet before making a payment.

Examples

Extends

  • x402Client

Constructors

Constructor

Defined in: client.ts:332 Creates a CdpX402Client that initializes lazily on first payment.

Parameters

config?
CdpX402ClientConfig Optional configuration. Credentials and RPC URLs fall back to environment variables.

Returns

CdpX402Client

Overrides

Accessors

accountName

Get Signature

Defined in: client.ts:344 The CDP account name that this client provisions (or has already provisioned) for payment signing. Resolved synchronously from config and defaults — does not perform any CDP account lookups.
Returns
string The resolved account name, e.g. "x402-client-wallet-1".

Methods

getAddresses()

Defined in: client.ts:355 Provisions the CDP wallet (if not already provisioned) and returns its addresses. Call this eagerly — for example, to display or fund the wallet — instead of waiting for the lazy initialization on first payment.

Returns

Promise<CdpX402WalletAddresses> The EVM and Solana addresses backing this client’s payments.

createPaymentPayload()

Defined in: client.ts:366 Creates the payment payload, initializing the CDP wallet lazily on first call.

Parameters

paymentRequired
PaymentRequired The x402 payment requirements from the resource server.

Returns

Promise<PaymentPayload> The signed payment payload.

Overrides