signAuthorization (evm/sign.ts)

x402 · typescript/packages/legacy/x402/src/schemes/exact/evm/sign.ts · typescript · Apache-2.0
auth

Signs EIP‑3009 authorizations for USDC transfers and generates nonces.

// Source: https://github.com/x402-foundation/x402 | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
import { Chain, getAddress, Hex, LocalAccount, toHex, Transport } from "viem";
import { getNetworkId } from "../../../shared";
import {
  authorizationTypes,
  isAccount,
  isSignerWallet,
  SignerWallet,
} from "../../../types/shared/evm";
import { ExactEvmPayloadAuthorization, PaymentRequirements } from "../../../types/verify";

/**
 * Signs an EIP-3009 authorization for USDC transfer
 *
 * @param walletClient - The wallet client that will sign the authorization
 * @param params - The authorization parameters containing transfer details
 * @param params.from - The address tokens wi

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key