Skip to main content

User withdrawal

1、Initiate withdrawal

Request URL:

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

UserId is the user ID of the calling system

Request method: POST

Header

parametertyperequireddescription
tokenstringtrueAccess Token
signaturestringtrueparameter signature

Request parameters

parametertyperequireddescription
contract_addrstringtruecontract address
chainstringtruenetwork ERC20/TRC20
uidstringtrueuser ID
to_addrstringtruereceiving address
valuestringtruetransfer ETH/TRX amount, using the smallest unit
token_addrstringtruetoken contract address
token_valuestringtruethe number of tokens, using the smallest unit

Request Example

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"
}
}'

return parameters

parameter nametypedescription
idstringorder ID
deadlineintorder deadline
encode_msgstringorder parameter information

Back to example

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

2、Confirm withdrawal

Request URL:

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

id is the order ID returned by the withdrawal interface

Request method: PUT

Header

parametertyperequireddescription
tokenstringtrueAccess Token

request parameters

parametertyperequireddescription
submit_signaturestringtrueUse the private key of the account with withdrawal authority to sign encode_msg

request example

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"
}
}'

return parameter

parametertyperequireddescription
contract_addrstringtruecontract address
chainstringtruenetwork ERC20/TRC20
uidstringtrueuser ID
to_addrstringtruereceiving address
valueinttrueThe amount of ETH/TRX to transfer, using the smallest unit
token_addrstringtruetoken contract address
token_valueinttruethe number of tokens, using the smallest unit
nonceinttruecall contract parameters
submit_tsinttrueorder submission time
deadlineinttrueorder deadline
statusinttruestatus, 1-pending review
encoded_msginttrueParameter information to be signed
submit_signatureinttruesignature

return example

{
"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": "0xb966765992115ced2ff88efd9f9ec2c42a91f4dc57ff6bcdda88681ae8c59ef664f4035b1cfc6c562fb5f63590b6d99910844cc0e728a08618b172 0a686832f21c",
"id": "6478417858624eeddde32df3"
}
}
}