# 说明

### 事项注意

1. 中心化兑换接口均需要进行签名鉴权，签名方式，参见相关文档.
2. 中心化接口对接，所有接口应放于服务器端与SWFT进行交互（接口鉴权密钥放于客户端太过危险）
3. 请求方式为 **POST, application/json.**
4. 以下接口中的所用到的币种简称可从  [查询币种列表](https://docs.swft.pro/chang-yong-jie-kou-shuo-ming/coin-list) `api/v1/queryCoinList` 接口返回值中获取.

### 接入中心化兑换方式

#### 1. 非资金抵押方式

用户需要兑换什么币即需要先把币存到SWFT钱包，只能兑换自己已有的币种

**举例子：**

> 用户资产：10000 SWFTC、 0.5 ETH，
>
> 用户可以用 5000SWFTC进行兑换，最多只能拿10000 SWFTC兑换成其他币

#### 2. 资金抵押方式

用户可以用自己没有的币进行兑换，但需要项目方在SWFT 抵押一定数量的主流数字货币，当账户内负资产（借的SWFT的币） -  正资产   超过抵押币数量时，则不再允许兑换，需要继续抵押币或进行清算后才能继续兑换

**举例子：**

> 用户各项资产：0
>
> 用户抵押资产：1 ETH ，抵押实际可用 0.5 ETH
>
> 用户可以用任何币种进行兑换，如 EOS 兑换BTC ，用户可以向SWFT平台借200 EOS 兑换成 0.15 BTC，此时，用户资产为： -200 EOS 、 0.15 BTC，
>
> 假设次数 200EOS折合美元 - 0.15BTC折合美元 > 0.5ETH 折合美元，则该用户无法再向SWFT借币进行兑换，账户会被锁定，无法进行提币、转账、发红包等操作，反之则可以向SWFT继续借币进行兑换

### 中心化兑换和去中心兑换通用接口

1. [查询币种列表](https://docs.swft.pro/chang-yong-jie-kou-shuo-ming/coin-list) `api/v1/queryCoinList`

&#x20;   2\.  [获取兑换汇率等基本信息](https://docs.swft.pro/chang-yong-jie-kou-shuo-ming/get-base-info)  `api/v1/getBaseInfo`

### 公共请求参数：

| 参数        | 是否必须 | 说明                |
| --------- | ---- | ----------------- |
| channelId | 是    | 渠道ID              |
| sign      | 是    | 签名，签名方式，请详见加密签名文档 |
| timestamp | 是    | 时间戳 毫秒            |

### 公共返回参数：

| 参数      | 是否必须 | 说明              |
| ------- | ---- | --------------- |
| resCode | 是    | 错误码（详见google文档） |
| resMsg  | 是    | 错误信息说明          |
| data    | 否    | 返回数据信息          |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-swft.swft.pro/zhong-xin-hua-dui-huan-api-jie-kou/overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
