@faremeter/payment-evm

中文文档
0.22.0发布于 2026/05/27LGPL-3.0-onlyTypeScriptESM + CJS近 30 天下载 2480

EVM payment scheme implementations for x402 protocol (EIP-3009 gasless USDC transfers)

原始使用文档
文档目录9 节
  1. Installation
  2. Features
  3. API Reference
  4. Functions
  5. getTokenBalance
  6. Interfaces
  7. GetTokenBalanceArgs
  8. Related Packages
  9. License

@faremeter/payment-evm

EVM payment scheme implementations for the x402 protocol, supporting EIP-3009 gasless USDC transfers.

Installation

pnpm install @faremeter/payment-evm

Features

  • Gasless transfers (EIP-3009)
  • USDC payments on Base, Polygon, Skale, and more
  • EIP-712 typed signatures
  • Facilitator pays gas fees
  • Secure authorization pattern

API Reference

Functions

getTokenBalance

Retrieves the ERC-20 token balance and decimals for an account.

Uses multicall to fetch both values in a single RPC request.

FunctionType
getTokenBalance(args: GetTokenBalanceArgs) => Promise<{ amount: bigint; decimals: number; }>

Parameters:

  • args: - The account, asset, and client configuration

Returns:

The balance amount and token decimals

Interfaces

GetTokenBalanceArgs

Arguments for retrieving an ERC-20 token balance.

PropertyTypeDescription
accountAddressThe wallet address to check the balance for
assetAddressThe ERC-20 token contract address
client{ account: undefined; batch?: { multicall?: boolean or { batchSize?: number or undefined; deployless?: boolean or undefined; wait?: number or undefined; } or undefined; } or undefined; cacheTime: number; ... 67 more ...; extend: <const client extends { ...; } and ExactPartial<...>>(fn: (client: Client<...>) => client) => Cl...Viem public client for querying the chain

License

LGPL-3.0-only

版本与发布记录

@faremeter/payment-evm 共发布 26 个版本,首次发布于 2025/08/29;过去 12 个月发布了 12 个版本。

版本发布日期距今
0.22.0latest2026/05/275 个月前
0.21.02026/04/216 个月前
0.20.12026/04/147 个月前
0.20.02026/04/147 个月前
0.19.02026/03/217 个月前
0.18.02026/03/207 个月前

关于 @faremeter/payment-evm 的常见问题

@faremeter/payment-evm 是什么?

EVM payment scheme implementations for x402 protocol (EIP-3009 gasless USDC transfers)

如何安装 @faremeter/payment-evm?

在项目目录运行 npm install @faremeter/payment-evm,或使用 pnpm add / yarn add / bun add。

@faremeter/payment-evm 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@faremeter/payment-evm 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@faremeter/payment-evm 可以商用吗?

@faremeter/payment-evm 使用 LGPL-3.0-only 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@faremeter/payment-evm 的下载量有多少?

根据 npm 官方下载统计,@faremeter/payment-evm 在 2026/10/15 – 2026/11/13 这 30 天内被下载 2,480 次,日均约 83 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@faremeter/payment-evm 还在维护吗?

最新版本 0.22.0 发布于 2026/05/27(5 个月前);至今共发布 26 个版本,其中过去 12 个月发布了 12 个;首次发布于 2025/08/29。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。