📘CoinSend

Dispatch/Withdrawal

Roles

  • Data Submitter: This permission grants sub-accounts the ability to create a dispatch record.

  • Data Approver: This permission grants sub-accounts the ability to approve the data submitted by the data submitter in the dispatch record. The sub-account with data approval permission (first approver) will verify the data, including business ID, sending address, sending amount, token type, and associated flag.

  • Execution Approver: This permission grants sub-accounts the ability to execute the dispatch record created by the data submitter and approved by the data approver. The sub-account with execution approval permission (second approver) will verify the data's business ID and select the dispatching wallet for execution.

Manual withdraw

The corporate entity can execute an automated withdrawal through the CoinsDo API. To do this, the corporate entity can assign the required roles (data submitter, data approval, execution approval) to a server-based sub-account.

Another approach to semi-automate the dispatch process is by assigning specific roles to a server-based account while allowing other general accounts to handle different roles. For instance, the server-based account can automatically create a dispatch record, while sub-accounts with data approval and execution approval permissions will manually approve the record.

  1. A corporate user initiates a withdrawal.

  2. The corporate business's server uses the CoinsDo API to request a dispatch.

  3. Corporate's appointed approver A signs the data submitted in the dispatch record.

  4. Corporate's appointed approver B signs the data in the dispatch record and submits the final dispatch record with both approvers' signatures to CoinDo's server.

  5. Upon receiving the signed dispatch record, CoinDo's server submits the data to the corporate dispatching wallet through the CoinsDo API.

  6. The corporate dispatching wallet verifies both approvers' signatures before executing the dispatch request.

Automatic withdraw

Enterprises can utilize the CoinsDo API for automatic issuance. To implement an automatic issuance plan, the enterprise needs to assign submission data, data approval, and execution approval permissions to a server account.

Additionally, the enterprise can assign certain automatic issuance processes to both server and regular accounts. For instance, the server account can automatically create an issuance record, while the other two regular accounts can manually approve the data and execute the approval for that specific issuance record.

  1. A corporate user initiates a withdrawal.

  2. The corporate business's server uses the CoinsDo API to request a dispatch and signs the data before sending it to CoinsDo's server.

  3. Upon receiving the signed dispatch record, CoinsDo's server submits the data to the CoinSend through CoinsDo's API.

  4. CoinSend verifies both signatures before executing the dispatch request.

Access points

  • Execute a dispatch request

Address request

  • {URL}/v1/withdraw

Request method

  • POST

Request parameters

  • Body parameters

{
    "apiKey": "cd384rt80f5575dc",
    "submitAccount": "coinsdoTest",
    "address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
    "amount": "616.616",
    "coinsDoId": "3",
    "businessId": "TRX_999",
    "businessScene": "1",
    "timestamp": "1622775712229",
    "txMemo": "COINSDO TEST TRX",
    "reviewUuid": "A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B",
    "reviewSign": "DXoICpzZN7/yoHCLbb32czn0Goq9XLTdW9Dcn281qNNgcejzXPToGOJReA/wYMI0e3ikjAVxzXSDXImAFqslbjBbiR8PVnXImV6VBMYL5J3Lssfu4nZMPEPNgIFtAWlLk9drWoElGe/Ch6NaozD9VJx5xPNIPq7ErVwfeB+g2LM=",
    "reviewRemark": "trx test",
    "targetDeviceUuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D",
    "approveUuid": "BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30",
    "approveSign": "vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=",
    "approveRemark": "trx test"
}
  • Data parameters

Request Example

{
    "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"submitAccount\":\"coinsdoTest\",\"address\":\"TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR\",\"amount\":\"616.616\",\"coinsDoId\":\"3\",\"businessId\":\"TRX_999\",\"businessScene\":\"1\",\"timestamp\":\"1622775712229\",\"txMemo\":\"COINSDOTESTTRX\",\"reviewUuid\":\"A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B\",\"reviewSign\":\"3pIsqtrXPG/I4o/YGLOvtIvBUUrBrRyFehlt0wkezWU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=\",\"reviewRemark\":\"trxreview\",\"targetDeviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\",\"approveUuid\":\"BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30\",\"approveSign\":\"vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=\",\"approveRemark\":\"trxapprove\"}",
    "sign": "d32bfb9905f0b6713be45fea2bce001449146a43b3319479076a6d8c2bf22055"
}

Response example

{
  "code": 200, // State code
  "msg": "Success", // Response message
  "data": null // Response data
}

Response status

Callback notice

{
    "txTime": "1661336430",
    "businessId": "0x6305fb61_JDXqh_0_2",
    "mainnet": "TRX",
    "withdrawStatus": "1",
    "txMemo": "0",
    "feeSymbol": "TRX",
    "blockNumber": "29232059",
    "txFee": "8.34196",
    "coinName": "JST",
    "txHash": "b29e917066ed433b5d2753ae07a9b4bd71245509f8f9de51ec5a2e43425f91a8"
}
  • Data parameter

Request example

{
    "data": "{\"txTime\":\"1661336430\",\"businessId\":\"0x6305fb61_JDXqh_0_2\",\"mainnet\":\"TRX\",\"withdrawStatus\":\"1\",\"txMemo\":\"0\",\"feeSymbol\":\"TRX\",\"blockNumber\":\"29232059\",\"txFee\":\"8.34196\",\"coinName\":\"JST\",\"txHash\":\"b29e917066ed433b5d2753ae07a9b4bd71245509f8f9de51ec5a2e43425f91a8\"}",
    "sign": "1b248bbf33dffb5004f4f179bb4b20e1a455e5c7d3be366c0b07e75ddc229d10"
}

Response example

{
  "code": 200, // State code
  "msg": "Success", // Remarks
  "data": {
    "businessId": "TRX_999"
  }
}

Get device info

Endpoint description

  • Retrieve information from CoinSend client.

Request URL

  • {URL}/v1/deviceDetail

Request method

  • POST

  • Body parameter

{
  "apiKey": "cd384rt80f5575dc",
  "deviceUuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D"
}
  • data parameter

Request example

{
  "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"deviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\"}",
  "sign": "d32bfb9905f0b6713be45fea2bce001449146a43b3319479076a6d8c2bf22055"
}

Response example

{
  "code": 200, // State code
  "msg": "成功", // Remarks
  "data": {
    "onlineStatus": 1,
    "useStatus": 1,
    "addressList": [{
      "flag": "TRX",
      "address": "TEN51U1W5hW5bJ833J6CLojvJdFGEQtz39",
      "balance": "222.1",
      "currency": "TRX"
    }, {
      "flag": "0xe7b0d9104aec8ea4ec6a02dfc5ae5180f9f78f95",
      "address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
      "balance": "6161.999",
      "currency": "TRC20"
    }],
    "devicePublicKey":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQD311wvweaxTv9bJBz3dxxd8e1nhInyoS/my8zarbeyqwAcTjWkMsWQt5cquU5G463nd5nSAOUGDgdytOZu78ZT4OQPFyeKRM/TWC7ghibhi/FDxJvE7txj7QRjdY0vTDTM/6CYxi2F8PIgjzX9TKBP7DK6pZq/sN1VciBuRWz2kQIDAQAB"
    "deviceExpiryTime": "1628380800",
    "deviceRegisterTime": "1625802606"
  }
}
  • data parameter

  • Address List parameter

Response status

Adding a new approval device

Endpoint description

  • Adding a new approval device

Request URL

  • {URL}/v1/reviewAdd

Request method

  • POST

  • Body parameter

{
  "apiKey": "cd384rt80f5575dc",
  "reviewPubkey":"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDi7RszjTelyGLJmpyXUPKo7xSUGQSv/5fUXO0npAGKP0oukx7tHQ6nJsnXdztX3yR3zhgjBnCdqN8DBPr+LzF4kSzG4t2/a6NdFlnPAUrtFZcqRbGDwliIqlKb5XCTu0Pgs6fNjx8tPE6XIW7OX/8NmQIbBw9Qjn28gjSuaTAD9QIDAQAB",
  "plainText":"test",
  "signature":"Fy6kcJsOY38jO+m/OsvmVj9kJdkC8CCl4WwPbMjWP/AAGS3dAAUHgIGQQlkIo3uBiEIIr85axpYmmsvXfeGg3MmYLim1XOeI65oOnDN084EaXjlCvTlFMqnt61YUYcN/9WPRjtbOsfSaK1ivOfKux9Fh8lGzRoNYKahCA1t69Kk=",
  "authorizationCode": "CFZQ-RJWN-VDDH"
}
  • Data parameter

Request example

{
  "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"reviewPubkey\":\"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDi7RszjTelyGLJmpyXUPKo7xSUGQSv/5fUXO0npAGKP0oukx7tHQ6nJsnXdztX3yR3zhgjBnCdqN8DBPr+LzF4kSzG4t2/a6NdFlnPAUrtFZcqRbGDwliIqlKb5XCTu0Pgs6fNjx8tPE6XIW7OX/8NmQIbBw9Qjn28gjSuaTAD9QIDAQAB\",\"plainText\":\"test\",\"signature\":\"Fy6kcJsOY38jO+m/OsvmVj9kJdkC8CCl4WwPbMjWP/AAGS3dAAUHgIGQQlkIo3uBiEIIr85axpYmmsvXfeGg3MmYLim1XOeI65oOnDN084EaXjlCvTlFMqnt61YUYcN/9WPRjtbOsfSaK1ivOfKux9Fh8lGzRoNYKahCA1t69Kk=\",\"authorizationCode\":\"CFZQ-RJWN-VDDH\"}",
  "sign": "ee7809433ed0200b55f79e85f3489d455a28ac3f14c8757b7799f890f42d74e8"
}

Response example

{
  "code": 200, // State code
  "msg": "Success", // Remarks
  "data": {
    "uuid": "2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4W"
  }
}
  • Data parameter

Response status

Last updated