fittings-treasury-reporting-rate
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUS Treasury reporting rate of exchange
美国财政部报告汇率
treasury.reporting-ratehttps://fittings.shThe Treasury's official quarterly 'Reporting Rates of Exchange' for a country's currency, as required for federal financial reporting.
treasury.reporting-ratehttps://fittings.sh美国财政部官方发布的季度《汇率报告》,供联邦财务报告所需。
The call
调用方式
GET https://fittings.sh/v1/treasury/reporting-rate| Field | Type | Required | Notes |
|---|---|---|---|
| string | yes | Country as Treasury names it, e.g. 'Canada' |
| string | no | Optional currency name, e.g. 'Dollar', to disambiguate |
| string | no | Optional ISO date; returns the rate in force on that date |
Example input:
json
{
"country": "Canada",
"asOf": "2024-03-31"
}GET https://fittings.sh/v1/treasury/reporting-rate| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| 字符串 | 是 | 财政部规定的国家名称,例如 'Canada' |
| 字符串 | 否 | 可选的货币名称,例如 'Dollar',用于消除歧义 |
| 字符串 | 否 | 可选的ISO格式日期;返回该日期生效的汇率 |
示例输入:
json
{
"country": "Canada",
"asOf": "2024-03-31"
}Cost and provenance
费用与数据源
| Price | $0.003 |
| Source | US Treasury Bureau of the Fiscal Service, Fiscal Data API, public domain |
| Licence | public-domain |
| 价格 | 0.003美元 |
| 数据源 | 美国财政部财政服务局,Fiscal Data API,公有领域 |
| 许可证 | 公有领域 |
Why call it rather than answer from memory
为何调用该接口而非凭记忆估算
Federal grantees, contractors and anyone filing in USD must convert at the Treasury rate rather than a market rate, and using the wrong one makes the filing wrong.
联邦受赠方、承包商及所有以美元提交申报的主体必须使用财政部汇率而非市场汇率,使用错误汇率会导致申报无效。
Calling it
调用指南
A skill is loaded on its own, so this document has to be enough by itself. It
does not assume the general skill is also loaded.
ships alongside this file; if it is missing (this document reached you without
the rest of the skill), fetch it once with
.
fittingscall.mjscurl -sO https://fittings.sh/skill/call.mjsFree, and needs no wallet. Read the schema and see what a call would cost:
bash
curl -s https://fittings.sh/catalog/treasury.reporting-rate | jqPaying. The endpoint answers with a signed quote,
you sign an authorization, and a facilitator settles it — you never send a
transaction and never pay gas. Before it spends anything, the client checks its
own hash against the gateway and refuses rather than sign with logic the
gateway has moved past:
402 Payment Requiredbash
undefined该技能独立加载,因此本文档需包含全部必要信息,无需依赖通用的 技能。 文件随本文档一同提供;若缺失(即您仅收到本文档而未获取技能的其他部分),可通过以下命令一次性获取:
fittingscall.mjscurl -sO https://fittings.sh/skill/call.mjs免费操作,无需钱包。查看接口 schema 及查询调用费用:
bash
curl -s https://fittings.sh/catalog/treasury.reporting-rate | jq付费调用。该端点会返回 状态码及签名报价,您需签署授权,由服务商完成结算——您无需发送交易,也无需支付Gas费。在产生任何费用前,客户端会将自身哈希与网关进行校验,若网关逻辑已更新则拒绝签署:
402 Payment Requiredbash
undefinedDry run. Prints the quote and pays nothing, because no key is set.
试运行。仅打印报价,无需支付费用,因为未设置密钥。
node call.mjs treasury.reporting-rate country=Canada asOf=2024-03-31
node call.mjs treasury.reporting-rate country=Canada asOf=2024-03-31
For real: a wallet holding USDC on Base, and nothing else.
正式调用:需使用在Base链上持有USDC的钱包,且钱包中无需其他资产。
export FITTINGS_PRIVATE_KEY=0x...
node call.mjs treasury.reporting-rate country=Canada asOf=2024-03-31
Spending is never a side effect of curiosity: with no `FITTINGS_PRIVATE_KEY`
the client fetches the quote and stops. `FITTINGS_MAX_PRICE` caps what it will
pay without asking, and defaults to $0.05.
**Use a throwaway wallet holding a few dollars, not a main one.** The key sits
in plaintext wherever the agent runs, and the whole cost of entry is USDC on
Base — no account, no API key, and no ETH, because the payer signs off-chain and
the facilitator broadcasts and pays the gas.
Writing your own client instead of using this one? `@x402/core` and
`@x402/evm` on npm, and the `fittings` skill records the two things that cost
real debugging time: the challenge is in a response header rather than the body,
and it must be re-signed from the exact request being retried.
If this is not the right service, `https://fittings.sh/catalog/search?q=...`
searches all of them for free.export FITTINGS_PRIVATE_KEY=0x...
node call.mjs treasury.reporting-rate country=Canada asOf=2024-03-31
仅出于好奇的操作不会产生费用:未设置 `FITTINGS_PRIVATE_KEY` 时,客户端仅获取报价即停止操作。`FITTINGS_MAX_PRICE` 用于设置无需确认即可支付的最高金额,默认值为0.05美元。
**建议使用仅持有少量资金的临时钱包,而非主钱包**。密钥以明文形式存储在代理运行的环境中,入门成本仅为Base链上的USDC——无需账户、无需API密钥、无需ETH,因为付款方进行链下签名,由服务商广播交易并支付Gas费。
若您不想使用此客户端,而是自行开发?可使用npm上的 `@x402/core` 和 `@x402/evm` 包,`fittings` 技能记录了两个容易耗费调试时间的要点:挑战信息位于响应头而非响应体中,且必须针对重试的精确请求重新签名。
若此服务不符合您的需求,可访问 `https://fittings.sh/catalog/search?q=...` 免费搜索所有服务。