跳到主要内容

用户提币

1、发起提币

请求 URL:

http://wallet.unn.com:8080/v2/order/withdraw/create

UserId 为调用方系统的用户 ID

请求方式: POST

Header

参数类型必选说明
tokenstringtrueAccess Token
signaturestringtrue参数签名

请求参数

参数类型必选说明
contract_addrstringtrue合约地址
chainstringtrue网络 ERC20/TRC20
uidstringtrue用户 ID
to_addrstringtrue收款地址
valuestringtrue转账 ETH/TRX 数量,使用最小单位
token_addrstringtrue代币合约地址
token_valuestringtrue代币数量,使用最小单位

请求示例

curl --location 'http://wallet.unn.com:8080/v2/order/withdraw/create' \
--header 'token: service.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMHg1MkM1NDBFZDdBMTk4ZTQ4QjU3RjYwYTc5MWFhRTgzYTVBMmIwNjNFIiwiZW50ZXJwcmlzZV9saXN0IjpbeyJjaGFpbiI6IkVSQzIwIiwiY29udHJhY3RfYWRkciI6IjB4NTNCMTc3QWJiOEU1RjI2MTIwZjcwODMzQmI2NUQ0NTVlODg3MmRDQSIsImVudGVycHJpc2UiOiIweDUyQzU0MEVkN0ExOThlNDhCNTdGNjBhNzkxYWFFODNhNUEyYjA2M0UiLCJpc19vd25lciI6dHJ1ZSwicGVybWlzc2lvbiI6WzAsMSwyLDNdLCJpZCI6IiJ9XSwiY3JlYXRlVGltZSI6MTY4NTYwMjY1OSwiZXhwIjoxNjg4MTk0NjU5LCJhY2NvdW50X25hbWUiOiIifQ._Y4Ij_tug12vLF7cnAH8heukHyUTuZVCMnAhwDWaD80' \
--header 'signature: 0x55fab617d47d79496a2aa9ce66ee3f6d954bf98d59cf4b96dc3eaff8691412966536a58e65594ca1555c0b17a45c3776b0c4451b469a32a99fc496c6d45acbe31b' \
--header 'Content-Type: application/json' \
--data '{
"body" : {
"contract_addr": "0x53B177Abb8E5F26120f70833Bb65D455e8872dCA",
"chain": "ERC20",
"uid": "202302160001",
"to_addr": "0x5B83a267b6B8Be4bE6D9af1c1dd19C34FB2641B0",
"value": 0,
"token_addr": "0x85E3fC24B618cE2aEad700d51710756dFC88F765",
"token_value": 10000000000
}
}'

返回参数

参数名类型说明
idstring订单 ID
deadlineint订单截止时间
encode_msgstring订单参数信息

返回示例

{
"code": 200,
"message": "success",
"data": {
"entity": {
"id": "6478417858624eeddde32df3",
"encoded_msg": "0x48f6f7b8a65977ea7cc3a06e5cd7fd21ee4c9f63553275f82184aa4a577ad66e",
"deadline": 1686207480
}
}
}

2、确认提币

请求 URL:

http://wallet.unn.com:8080/v2/order/withdraw/submit/{id}

id 为发起提币接口返回的订单 ID

请求方式:PUT

Header

参数类型必选说明
tokenstringtrueAccess Token

请求参数

参数类型必选说明
submit_signaturestringtrue使用提币权限账户的私钥对 encode_msg 签名后的信息

请求示例

curl --location --request PUT 'http://wallet.unn.com:8080/v2/order/withdraw/submit/647d479712b7ab4c8799b25c' \
--header 'token: service.eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoiMHg1MkM1NDBFZDdBMTk4ZTQ4QjU3RjYwYTc5MWFhRTgzYTVBMmIwNjNFIiwiZW50ZXJwcmlzZV9saXN0IjpbeyJjaGFpbiI6IkVSQzIwIiwiY29udHJhY3RfYWRkciI6IjB4NTNCMTc3QWJiOEU1RjI2MTIwZjcwODMzQmI2NUQ0NTVlODg3MmRDQSIsImVudGVycHJpc2UiOiIweDUyQzU0MEVkN0ExOThlNDhCNTdGNjBhNzkxYWFFODNhNUEyYjA2M0UiLCJpc19vd25lciI6dHJ1ZSwicGVybWlzc2lvbiI6WzAsMSwyLDNdLCJpZCI6IiJ9XSwiY3JlYXRlVGltZSI6MTY4NTYwMjY1OSwiZXhwIjoxNjg4MTk0NjU5LCJhY2NvdW50X25hbWUiOiIifQ._Y4Ij_tug12vLF7cnAH8heukHyUTuZVCMnAhwDWaD80' \
--header 'Content-Type: application/json' \
--data '{
"body": {
"submit_signature": "0xf57131e3e1c36f270a78c6fc8c15be8a072cc458b73ea9a4072d9ee9ac5e98155dffcd3d9b1633824c0175eaab8802c5e09f893c9206bd2c1f85e5e46c1aeeb71c"
}
}'

返回参数

参数类型必选说明
contract_addrstringtrue合约地址
chainstringtrue网络 ERC20/TRC20
uidstringtrue用户 ID
to_addrstringtrue收款地址
valueinttrue转账 ETH/TRX 数量,使用最小单位
token_addrstringtrue代币合约地址
token_valueinttrue代币数量,使用最小单位
nonceinttrue调用合约参数
submit_tsinttrue订单提交时间
deadlineinttrue订单截止时间
statusinttrue状态,1-待审核
encoded_msginttrue待签名参数信息
submit_signatureinttrue签名

返回示例

{
"code": 200,
"message": "success",
"data": {
"entity": {
"contract_addr": "0x53B177Abb8E5F26120f70833Bb65D455e8872dCA",
"chain": "ERC20",
"uid": "202302160001",
"to_addr": "0x5B83a267b6B8Be4bE6D9af1c1dd19C34FB2641B0",
"value": "0",
"token_addr": "0x85E3fC24B618cE2aEad700d51710756dFC88F765",
"token_value": "1",
"nonce": 634,
"submit_ts": 1685602680,
"deadline": 1686207480,
"status": 1,
"encoded_msg": "0x48f6f7b8a65977ea7cc3a06e5cd7fd21ee4c9f63553275f82184aa4a577ad66e",
"create_time": 1685602680,
"update_time": 1685604726,
"detail": {
"gas": 0,
"submitter": "0xfeD5D2bE8e03711B7cB7FD9e44513026f44c02f2"
},
"submit_signature": "0xb966765992115ced2ff88efd9f9ec2c42a91f4dc57ff6bcdda88681ae8c59ef664f4035b1cfc6c562fb5f63590b6d99910844cc0e728a08618b1720a686832f21c",
"id": "6478417858624eeddde32df3"
}
}
}