@fun-xyz/fiat-contract

中文文档
0.61.0发布于 2026/11/15MITTypeScriptESM + CJS零依赖近 30 天下载 19.5万

Published conformance contract for Fun's headless fiat onramp: FlowState/Transition types, zod schemas, the transition table as data, recorded fixtures, assertion helpers.

原始使用文档

Fiat contract

MoonPay guest provider

MOONPAY_GUEST owns guest checkout on POST /fiat/next; regular MOONPAY retains customer connection and KYC. Select guest checkout through routingOverrides.providers on a quote (or the ordered providers list on a routing quote). The backend requires explicit client selection and its own enablement switch. A guest quote answers handoff: { provider: "MOONPAY_GUEST" }. Send provider: "MOONPAY_GUEST" on every next request, with no path or customer credentials. After a guest refusal with REQUOTE, omit MOONPAY_GUEST from the next selection so MOONPAY remains available. The separate ./moonpay-guest entry exports its wire types; schemas are exported from the root.

MoonPay connect preparation

Regular MoonPay's connect next action may carry an optional nonempty, unclaimed orderId. A client may use it to prepare a hidden, inert payment surface beside the connection check. This is not authorization to pay: wait for an accepted order response before revealing the surface. For that first order, the client may retain its prepared id even if the response carries a different id. Without the field, retain the existing behavior and wait for order before creating the payment surface.

Publish this additive contract before backend emission and update backend/frontend dependency pins. Older strict contract schemas reject the field; optionality preserves acceptance of older backend responses, not compatibility with old strict validators receiving the new field.

版本与发布记录

@fun-xyz/fiat-contract 共发布 72 个版本,首次发布于 2026/08/18;过去 12 个月发布了 72 个版本。

版本发布日期距今
0.61.0latest2026/11/151 天前
0.60.02026/11/132 天前
0.60.0-payward.0payward2026/11/132 天前
0.59.02026/11/133 天前
0.58.02026/11/133 天前
0.56.0-alchemypay.0alchemypay2026/11/114 天前

其他发布通道:uda → 0.36.0-uda.5,alchemypay → 0.56.0-alchemypay.0,payward → 0.60.0-payward.0。

关于 @fun-xyz/fiat-contract 的常见问题

@fun-xyz/fiat-contract 是什么?

Published conformance contract for Fun's headless fiat onramp: FlowState/Transition types, zod schemas, the transition table as data, recorded fixtures, assertion helpers.

如何安装 @fun-xyz/fiat-contract?

在项目目录运行 npm install @fun-xyz/fiat-contract,或使用 pnpm add / yarn add / bun add。

@fun-xyz/fiat-contract 支持 TypeScript 吗?

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

@fun-xyz/fiat-contract 支持 ESM 还是 CommonJS?

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

@fun-xyz/fiat-contract 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@fun-xyz/fiat-contract 可以商用吗?

@fun-xyz/fiat-contract 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@fun-xyz/fiat-contract 的下载量有多少?

根据 npm 官方下载统计,@fun-xyz/fiat-contract 在 2026/10/16 – 2026/11/14 这 30 天内被下载 194,998 次,日均约 6,500 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fun-xyz/fiat-contract 还在维护吗?

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