API 参考
获取市场的官方费率表
返回平台当前为某个市场发布的费率,每种用途一个槽位:deposit、sale 和 withdraw。
GET /websites/{code}/fee-schedule
返回平台当前为某个市场发布的费率,每种用途一个槽位:deposit、sale 和 withdraw。
- 每个已发布的槽位都带有完全展开的官方计算链,取平台在该用途上应用的
revision:包含每个费用算子、换币算子和换币算子组及其数值、货币和当前revision,因此一次请求就足以复现平台的计算。官方计算链的每个算子本身也是官方的。 - 如果槽位的计算链
id为0,则明确表示免费:平台不对该用途收取任何费用,且该计算链没有步骤。 - 如果平台尚未为某种用途发布官方计算链,对应槽位为
null:费用未知,或该市场不提供此用途。null绝不表示免费。 - 每条计算链都会注明其
start_currency:价格必须采用该货币,计算链才适用(null:任意货币);input_auto和output_auto说明其他货币的价格以及计算结果是否应在计算链前后进行换算。 - 不包含归属和管理类字段。
404 表示没有使用该代码的市场。
用量
| 名称 | 说明 |
|---|---|
| 认证 | 无需认证 |
| 点数费用 | 免费 |
| 建议间隔 | 300 秒 |
参数
| 名称 | 位置 | 类型 | 必填 | 说明 |
|---|---|---|---|---|
code | path | string | 是 | 市场代码,即 GET /websites 列出的代码。 |
响应
| 状态 | 说明 | 结构 |
|---|---|---|
200 | 请求成功 | Envelope_FeeScheduleOut_ |
404 | 请求的资源不存在 | ErrorEnvelope |
422 | 参数或请求体无效 | ErrorEnvelope |
503 | 服务暂时不可用;请稍后重试 | ErrorEnvelope |
模型
CreditMeta
计费请求的点数结算信息。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
cost | integer | 是 | 本次请求花费的点数。 |
remaining | integer | 是 | 本次请求后的预估剩余点数。仅作参考而非账目:并发请求可能导致其略有偏差。 |
Envelope_FeeScheduleOut_
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
data | FeeScheduleOut | 是 | 端点返回的数据。 |
meta | Meta | 是 | 请求元数据。 |
ErrorBody
失败请求的详细信息。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 是 | 稳定的机器可读错误代码。请根据此值进行分支处理,而不是 message。 |
message | string | 是 | 面向人类阅读的说明。措辞可能变化。 |
details | object 或 null | 否 | 可选的结构化上下文,例如校验错误列表;对于 credit_insufficient,则为所需点数和剩余点数。 |
ErrorEnvelope
错误响应:error 中为错误信息,meta 中为请求元数据。
FeeScheduleOut
平台当前为某个市场发布的官方费率,按用途划分。某种用途尚未发布官方计算链时,其值为 null。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
website_code | string | 是 | 市场代码。 |
slots | FeeScheduleSlotsOut | 是 | 每种用途已发布的官方计算链。 |
FeeScheduleSlotOut
为某一用途发布的官方计算链。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
purpose | string | 是 | 用途:deposit、sale 或 withdraw。可选值:deposit, sale, withdraw。 |
calculation_chain | PublicCalculationChainOut | 是 | 该用途的官方计算链。 |
FeeScheduleSlotsOut
某个市场已发布的官方计算链,按用途划分。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
deposit | FeeScheduleSlotOut 或 null | 是 | 充值费用;未发布时为 null。 |
sale | FeeScheduleSlotOut 或 null | 是 | 出售费用;未发布时为 null。 |
withdraw | FeeScheduleSlotOut 或 null | 是 | 提现费用;未发布时为 null。 |
Meta
每个带信封的响应中都包含的请求元数据。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
request_id | string | 是 | 本次请求的唯一标识符,与响应头 X-Request-ID 相同。联系支持时请提供。 |
billable | boolean 或 null | 否 | 该请求是否以点数计费。仅出现在计量端点上;false 表示该请求免费,例如因为它本身不收费,或已被你的订阅覆盖。 |
credit | CreditMeta 或 null | 否 | 本次请求的费用和你的预估剩余余额。仅在 billable 为 true 时出现。 |
page | PageMeta 或 null | 否 | 分页状态。仅出现在按页列出结果的响应中。 |
PageMeta
本页之后分页列表的进度。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
limit | integer | 是 | 本次请求实际采用的每页条数。 |
has_next | boolean | 是 | 是否还有下一页。 |
next_cursor | string 或 null | 是 | 将其原样作为 cursor 传回即可获取下一页;列表已全部返回时为 null。 |
PublicCalculationChainOut
费率表中发布的一条官方计算链。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer 或 null | 是 | 计算链的唯一 ID。0 是内置的免费计算链:平台不对该用途收取任何费用。 |
name | string 或 null | 是 | 显示名称(如已设置)。 |
start_currency | string 或 null | 是 | 计算链所期望的价格货币;适用于任意货币时为 null。采用其他货币的价格不在其适用范围内。 |
revision | integer 或 null | 是 | 平台在该用途上应用的计算链修订;更新的修订在此处被应用之前不会生效。 |
input_auto | boolean | 是 | 其他货币的价格是否先换算为 start_currency(通过官方的美元价值)。 |
output_auto | boolean | 是 | 结果是否应在最后一步之后换算为查看者的基准货币。 |
steps | PublicFeeOperatorOut 或 PublicConvertOperatorOut 或 PublicConvertOperatorGroupOut 数组 | 是 | 按执行顺序排列的步骤,以 kind 区分类型。 |
PublicConvertOperatorGroupOut
已发布费率表中的一组备选换算。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
kind | "convert_operator_group" | 是 | 步骤类型:始终为 convert_operator_group。 |
id | integer 或 null | 是 | 组的唯一 ID。 |
name | string | 是 | 显示名称。 |
rule | string | 是 | 如何从换算成功的成员中选出结果:min、max 或 avg。可选值:min, max, avg。 |
members | PublicConvertOperatorOut 数组 | 是 | 成员换算,按顺序排列。 |
revision | integer 或 null | 是 | 组的当前修订。 |
PublicConvertOperatorOut
已发布费率表中的一个货币换算步骤。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
kind | "convert" | 是 | 步骤类型:始终为 convert。 |
id | integer 或 null | 是 | 换币算子的唯一 ID。 |
name | string | 是 | 显示名称。 |
from | PublicCurrencyOut | 是 | 源货币。 |
to | PublicCurrencyOut | 是 | 目标货币。 |
mode | string | 是 | auto 通过两种货币各自的 usd_rate 换算;fixed 乘以 rate。可选值:auto, fixed。 |
rate | string 或 null | 是 | 每一单位源货币对应的目标货币数量,以十进制字符串表示;用于 fixed 模式。 |
revision | integer 或 null | 是 | 换币算子的当前修订。 |
PublicCurrencyOut
已发布费率表所使用的一种货币。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
id | integer 或 null | 是 | 货币的唯一 ID。 |
code | string | 是 | 货币代码,例如 USD。 |
name | string 或 null | 是 | 显示名称。 |
kind | string | 是 | 货币种类,例如 fiat。 |
usd_rate | string | 是 | 一单位对应的美元价值,以十进制字符串表示。 |
PublicFeeOperatorOut
已发布费率表中的一个费用步骤。
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
kind | "fee" | 是 | 步骤类型:始终为 fee。 |
id | integer 或 null | 是 | 费用算子的唯一 ID。 |
name | string | 是 | 显示名称。 |
operator | string | 是 | 作用于当前金额的算术运算:add、sub、mul 或 div。可选值:add, sub, mul, div。 |
value | string | 是 | 算术运算的操作数,以十进制字符串表示。 |
currency_code | string 或 null | 是 | add 和 sub 金额的货币;mul 和 div 时为 null。 |
revision | integer 或 null | 是 | 费用算子的当前修订。 |