# 出入金接口

## POST /v1/wallet/withdraws/requestId

> 用户提现请求(获取requestId)

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/withdraws/requestId":{"post":{"tags":["wallet-api-controller"],"summary":"用户提现请求(获取requestId)","operationId":"withdrawRequestId","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"currencyId":{"type":"integer","format":"int64"},"amount":{"type":"number"},"address":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"object","properties":{"bfcAddress":{"type":"string","description":"BFC地址"},"action":{"type":"string","description":"动作","enum":["SIGNIN","WITHDRAW"]},"withdrawId":{"type":"integer","description":"提现id","format":"int64"},"coinType":{"type":"string"},"amount":{"type":"string"},"chainId":{"type":"integer","format":"int64"},"expires":{"type":"integer","format":"int64"},"hash":{"type":"string"},"payload":{"type":"string"}},"description":"响应数据，如果请求失败则为null"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```

## POST /v1/wallet/withdraw/sign

> 用户提现签名

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/withdraw/sign":{"post":{"tags":["wallet-api-controller"],"summary":"用户提现签名","operationId":"withdrawSign","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"bfcAddress":{"type":"string","description":"BFC地址"},"action":{"type":"string","description":"动作","enum":["SIGNIN","WITHDRAW"]},"withdrawId":{"type":"integer","description":"提现id","format":"int64"},"coinType":{"type":"string"},"amount":{"type":"string"},"chainId":{"type":"integer","format":"int64"},"expires":{"type":"integer","format":"int64"},"hash":{"type":"string"},"signature":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"boolean","description":"响应数据，如果请求失败则为null"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```

## GET /v1/wallet/withdraws

> 查询用户提现请求列表记录

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/withdraws":{"get":{"tags":["wallet-api-controller"],"summary":"查询用户提现请求列表记录","operationId":"withdrawRequestGet","parameters":[{"name":"offsetId","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"maxResults","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"object","properties":{"hasMore":{"type":"boolean","description":"是否存在下一页"},"nextOffsetId":{"type":"integer","description":"下一页起始查询ID","format":"int64"},"results":{"type":"array","description":"当前页数据","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"createdAt":{"type":"integer","format":"int64"},"updatedAt":{"type":"integer","format":"int64"},"withdrawId":{"type":"integer","format":"int64"},"userId":{"type":"integer","format":"int64"},"currency":{"type":"string"},"chainId":{"type":"integer","format":"int64"},"token":{"type":"string"},"tokenDecimals":{"type":"integer","format":"int32"},"amount":{"type":"number"},"status":{"type":"string","enum":["INIT","PENDING","PROCESSED","FAILED","DONE"]},"txHash":{"type":"string"},"expiresAt":{"type":"integer","format":"int64"},"operator":{"type":"string","description":"操作提现地址"},"withdrawFor":{"type":"string","description":"提现地址"},"approvedCount":{"type":"integer","description":"审批通过数量","format":"int32"},"requiredCount":{"type":"integer","description":"需要审批数量","format":"int32"},"validators":{"type":"string","description":"validator地址，逗号分隔"},"approvalStatus":{"type":"string","description":"审核状态，逗号分隔"},"userSig":{"type":"string","description":"用户签名"},"usdQuotedAmount":{"type":"number","description":"usd计价金额"},"usdQuotedPrice":{"type":"number","description":"usd计价价格"}},"description":"当前页数据"}}},"description":"响应数据，如果请求失败则为null"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```

## GET /v1/wallet/queryWithdrawById

> 查询用户提现请求列表记录

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/queryWithdrawById":{"get":{"tags":["wallet-api-controller"],"summary":"查询用户提现请求列表记录","operationId":"queryWithdrawById","parameters":[{"name":"requestId","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":0}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"createdAt":{"type":"integer","format":"int64"},"updatedAt":{"type":"integer","format":"int64"},"withdrawId":{"type":"integer","format":"int64"},"userId":{"type":"integer","format":"int64"},"currency":{"type":"string"},"chainId":{"type":"integer","format":"int64"},"token":{"type":"string"},"tokenDecimals":{"type":"integer","format":"int32"},"amount":{"type":"number"},"status":{"type":"string","enum":["INIT","PENDING","PROCESSED","FAILED","DONE"]},"txHash":{"type":"string"},"expiresAt":{"type":"integer","format":"int64"},"operator":{"type":"string","description":"操作提现地址"},"withdrawFor":{"type":"string","description":"提现地址"},"approvedCount":{"type":"integer","description":"审批通过数量","format":"int32"},"requiredCount":{"type":"integer","description":"需要审批数量","format":"int32"},"validators":{"type":"string","description":"validator地址，逗号分隔"},"approvalStatus":{"type":"string","description":"审核状态，逗号分隔"},"userSig":{"type":"string","description":"用户签名"},"usdQuotedAmount":{"type":"number","description":"usd计价金额"},"usdQuotedPrice":{"type":"number","description":"usd计价价格"}},"description":"当前页数据"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```

## GET /v1/wallet/deposits

> 查询用户充值日志列表记录

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/deposits":{"get":{"tags":["wallet-api-controller"],"summary":"查询用户充值日志列表记录","operationId":"depositGetLogs","parameters":[{"name":"offsetId","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"maxResults","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"object","properties":{"hasMore":{"type":"boolean","description":"是否存在下一页"},"nextOffsetId":{"type":"integer","description":"下一页起始查询ID","format":"int64"},"results":{"type":"array","description":"当前页数据","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"txHash":{"type":"string"},"currency":{"type":"string"},"blockHash":{"type":"string"},"blockNumber":{"type":"integer","format":"int64"},"blockTimestamp":{"type":"integer","format":"int64"},"operator":{"type":"string","description":"操作充值地址"},"depositFor":{"type":"string","description":"充值地址"},"token":{"type":"string"},"amount":{"type":"number"},"removed":{"type":"boolean"}},"description":"当前页数据"}}},"description":"响应数据，如果请求失败则为null"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```

## GET /v1/wallet/flows

> 查询用户钱包账户流入流出列表信息

```json
{"openapi":"3.0.1","info":{"title":"OpenAPI definition","version":"v0"},"servers":[{"url":"https://dex-api.benpay.com","description":"Default Server URL"}],"paths":{"/v1/wallet/flows":{"get":{"tags":["wallet-api-controller"],"summary":"查询用户钱包账户流入流出列表信息","operationId":"flowGet","parameters":[{"name":"range","in":"query","required":false,"schema":{"type":"string","default":""}},{"name":"currency","in":"query","required":false,"schema":{"type":"string","default":""}},{"name":"offsetId","in":"query","required":false,"schema":{"type":"integer","format":"int64","default":0}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int32","default":100}}],"responses":{"200":{"description":"OK","content":{"*/*":{"schema":{"type":"object","properties":{"success":{"type":"boolean","description":"请求是否成功"},"data":{"type":"object","properties":{"hasMore":{"type":"boolean","description":"是否存在下一页"},"nextOffsetId":{"type":"integer","description":"下一页起始查询ID","format":"int64"},"results":{"type":"array","description":"当前页数据","items":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"currency":{"type":"string"},"flowType":{"type":"string","description":"账户流水类型","enum":["DEPOSIT","UNDEPOSIT","WITHDRAW","WITHDRAW_FEE","TRANSFER_OUT","TRANSFER_IN","INTERNAL_OUT","INTERNAL_IN","BONUS","ADJUST"]},"sign":{"type":"boolean"},"amount":{"type":"number"},"createdAt":{"type":"integer","format":"int64"}},"description":"当前页数据"}},"range":{"type":"string","description":"查询范围(数据分片)"}},"description":"响应数据，如果请求失败则为null"},"error":{"type":"string","description":"如果请求失败，指示错误代码"},"errorField":{"type":"string","description":"如果请求失败，指示出错的字段"},"errorMessage":{"type":"string","description":"如果请求失败，指示详细错误信息"}}}}}}}}}}}
```
