TypeScript SDK
@pontx/open-exchange-rates
Open Exchange Rates 汇率 API 的运营方发布 SDK,覆盖当前 PontxSpec 的全部接口。
SDK 质量门禁
v0.1.1 对应源码已在 Node.js 18 / 20 / 22 完成 100% UT 通过率与构建产物 E2E。
安装并调用
SDK 由 Pontx 生成器产生,并在发布前完成类型检查与构建验证。
pnpm add @pontx/open-exchange-ratesimport { createOpenExchangeRatesClient } from "@pontx/open-exchange-rates";
const client = createOpenExchangeRatesClient({
appId: process.env.PONTX_OPEN_EXCHANGE_RATES_APP_ID!
});
const result = await client.listCurrencies(
{}
);
console.log(result);命令行调用
此 npm 包同时发布面向该 API 的独立 CLI;先用 dry-run 检查参数,再按供应商要求提供自己的凭证。
pnpm add --global @pontx/open-exchange-rates
pontx-open-exchange-rates call listCurrencies --dry-run