createX402PaymentSigner
createX402PaymentSigner(
params):X402PaymentSigner
Defined in: src/x402/client.ts:293
Build an X402PaymentSigner bound to a single signing account.
The returned signer can produce many X402PaymentPayloads in succession — one per accepted requirement. Each call generates a fresh EIP-3009 nonce.
Parameters
params
Returns
Example
import { privateKeyToAccount } from "viem/accounts";import { createX402PaymentSigner } from "kawasekit";
const account = privateKeyToAccount("0x...");const signer = createX402PaymentSigner({ network: "testnet", account, asset: { kind: "known", id: "jpyc-v2" },});
// ...after receiving a 402 with PAYMENT-REQUIRED header...const paymentPayload = await signer.sign({ paymentRequirements });