# CoinGet

## Get receiving address <a href="#get-deposit-address" id="get-deposit-address"></a>

Retrieve receiving address from address pool.

<mark style="color:green;">`POST`</mark> `/v1/addressGet`

### **Request**&#x20;

<table><thead><tr><th width="99.5546875">Parameter</th><th width="99.7421875">Required</th><th width="80.16015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON string，refer below）</td></tr></tbody></table>

```
{
  "apiKey": "cd384rt80f5575dc",
  "mainnet": "TRX",
  "targetDeviceUuid": "085C28EC-0BD6-442B-8232-D23BC8F4D58E",
  "timestamp": "1622775712229",
  "addressRemark": "trx address"
}
```

* Data parameter

<table><thead><tr><th width="160.2734375">Parameter</th><th width="100.09765625">Required</th><th width="90.41015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API Key</td></tr><tr><td>mainnet</td><td>Yes</td><td>string</td><td>Network code, refer to <a href="../general#supported-networks">Supported Networks</a><a href="../general#supported-networks">.</a></td></tr><tr><td>targetDeviceUuid</td><td>Yes</td><td>string</td><td>CoinGet device UUID</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp (seconds or milliseconds)</td></tr><tr><td>addressRemark</td><td>No</td><td>string</td><td>Address remarks</td></tr><tr><td>isConvert</td><td>No</td><td>string</td><td>Do you want to convert the address?<br>(0. No - default 1. Yes, only used by BCH currently to convert to legacy address)</td></tr></tbody></table>



**Request example 1**

```
{
    "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"mainnet\":\"TRX\",\"targetDeviceUuid\":\"085C28EC-0BD6-442B-8232-D23BC8F4D58E\",\"timestamp\":\"1622775712229\",\"addressRemark\":\"trx address\"}",
    "sign": "67355f9ad0db846edd05761462edfc1f8d396af2624e8998ee52c010c7a60dbd"
}
```

**Request example 2**

```
{
    "data":"{\"mainnet\":\"BCH\",\"targetDeviceUuid\":\"92E30E38-63A1-41DC-B95C-8E729DFDDE7A\",\"apiKey\":\"4c90b98cc97b45b2\",\"isConvert\":\"1\",\"timestamp\":2639477935817}",
    "sign":"7d9ae0b10068422ff30be92f45bdda0fe69bf405224564cefdc81775241d4081"
}
```

### **Response**

**Response example 1**

```
{
  "code": 200, // Status code
  "msg": "Success", // Remarks
  "data": {
    "address": "TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR",
    "addrSign": "TESTTESTU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=",
    "convertedAddr": null
  }
}
```

**Response example 2**

```
{
  "code": 200,
  "msg": "Success",
  "data": {
    "address": "bchtest:qzfr5996z72me99flf32jf6yfs38hshcwcp3dx8eja",
    "addrSign": "ZJA+/GJGNUXFw2soBGBaEbWFSOPtNMD8eRdVLTyZyuKHjnyklWvGe8SqkV8xxhwlFcT1+td9AbKstLD6b+lJ4jSCIqm5WbcMJjo0k1mCdihAagsbn5zVyTYEO7LQac341wP/76jopdYnH/yVvP5VtcNq8ZgkrcOi08ReLaQsMO8=",
    "convertedAddr": "mtr8XbbzhJVG2TYy3bYFxfV5TBw8PSEzkB"
  }
}

```

* Data content

<table><thead><tr><th width="139.61328125">Parameter</th><th width="100.39453125">Required</th><th width="90.16015625">Type</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>Yes</td><td>string</td><td>Receiving address</td></tr><tr><td>addrSign</td><td>Yes</td><td>string</td><td>Receiving address signature (Verify address through CoinGet’s public key)</td></tr><tr><td>convertedAddr</td><td>No</td><td>string</td><td>Converted address (Currently only BCH can be changed to legacy address, a string of your address will be returned for callback, callback will only be based on address parameter)</td></tr></tbody></table>

**Response Status**

<table><thead><tr><th width="119.375">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4042</td><td>Failed to verify collection wallet</td></tr><tr><td>4043</td><td>Collection wallet does not exist</td></tr><tr><td>4044</td><td>Failed to receive collection address</td></tr><tr><td>4045</td><td>Insufficient addresses</td></tr><tr><td>4050</td><td>Currently does not support this mainnet</td></tr><tr><td>4051</td><td>EOS chain does not require a collection address</td></tr><tr><td>4052</td><td>Token does not require a collection address</td></tr><tr><td>4053</td><td>Failed to convert BCH address</td></tr><tr><td>4061</td><td>Failed to verify linked records</td></tr><tr><td>4062</td><td>Unable to generate address from a linked mainnet</td></tr><tr><td>4063</td><td>Failed to verify gas fee address</td></tr><tr><td>4064</td><td>Mainnet not supported by your dispatch wallet. Please update your dispatch wallet</td></tr><tr><td>4071</td><td>Select a mainnet</td></tr><tr><td>4072</td><td>Failed to verify mainnet</td></tr></tbody></table>

***

## Convert BCH address <a href="#bch-converting-address" id="bch-converting-address"></a>

Convert BCH Legacy address to Cash address

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/bchAddrConvert`

<table><thead><tr><th width="109.9375">Parameter</th><th width="99.5859375">Required</th><th width="80.06640625">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON string, refer below）</td></tr></tbody></table>

```
{
  "apiKey": "4c90b98cc97b45b2",
  "address": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
  "timestamp": "2639474345487"
}
```

* data content

<table><thead><tr><th width="110.14453125">Parameter</th><th width="89.5234375">Required</th><th width="79.71875">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API Key</td></tr><tr><td>address</td><td>Yes</td><td>string</td><td>BCH address，Legacy (classic) and CashAddr (Standard)</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp(seconds or milliseconds)</td></tr></tbody></table>

**Request example 1**

```
{
  "data":"{\"apiKey\":\"4c90b98cc97b45b2\",\"address\":\"msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s\",\"timestamp\":\"2639474345487\"}",
  "sign":"fc2ed2d7713a499ff718e69507cb95b1a49ac00f4be1daf34187381b8afc43c9"
}
```

**Request example 2**

```
{
  "data":"{\"apiKey\":\"4c90b98cc97b45b2\",\"address\":\"bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca\",\"timestamp\":\"2639474345487\"}",
  "sign":"7acecc69f1b8c05be5ebfc8435d9fea0cf39aa9138af22084f3a9aa96b323844"
}
```

### **Response**

**Response example 1**

```
{
  "code": 200,
  "msg": "success",
  "data": {
    "legacyAddr": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
    "cashAddr": "bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca"
  }
}
```

**Response example 2**

```
{
  "code": 200,
  "msg": "success",
  "data": {
    "legacyAddr": "msGoSKtnZyyw5QSu53zerPmuT4wdnhXg3s",
    "cashAddr": "bchtest:qzq0gjkv2qmwe0ph25nuh28c2gxn7dezqgvc8c2aca"
  }
}
```

* data parameters

<table><thead><tr><th width="110.03515625">Parameter</th><th width="99.7734375">Required</th><th width="89.8046875">Type</th><th>Description</th></tr></thead><tbody><tr><td>legacyAddr</td><td>Yes</td><td>string</td><td>Legacy format (classic address)</td></tr><tr><td>cashAddr</td><td>Yes</td><td>string</td><td>CashAddr format (Standard address)</td></tr></tbody></table>

**Response status**

<table><thead><tr><th width="110.078125">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4053</td><td>Failed to convert BCH address</td></tr><tr><td>4054</td><td>Wrong format for BCH address</td></tr><tr><td>4055</td><td>Failed to verify BCH address</td></tr></tbody></table>

***

## Token sweep <a href="#manual-collection" id="manual-collection"></a>

Trigger token sweep on specific address

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/manualCollect`

<table><thead><tr><th width="109.6484375">Parameter</th><th width="99.98828125">Required</th><th width="80.2578125">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON string，refer to below）</td></tr></tbody></table>

```
{
    "apiKey": "4c90b98cc97b45b2",
    "address": "0xd065380c78847bfba75ad158067a5e8e845205f0",
    "coinsDoId": "22",
    "collectAmount": "0.12",
    "timestamp": "1671699594204"
}
```

* Data content

<table><thead><tr><th width="134.9765625">Parameter</th><th width="99.9296875">Require</th><th width="85.31640625">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API KEY</td></tr><tr><td>address</td><td>Yes</td><td>string</td><td>Receiving address</td></tr><tr><td>coinsDoId</td><td>Yes</td><td>string</td><td>CoinsDo assigned Token ID(Refer to token list)</td></tr><tr><td>collectAmount</td><td>No</td><td>string</td><td>Collection amount(will collect all available balance if not filled)</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp (in seconds or milliseconds)</td></tr></tbody></table>

**Request example 1**

```
{
    "data":"{\"address\":\"0xd065380c78847bfba75ad158067a5e8e845205f0\",\"apiKey\":\"4c90b98cc97b45b2\",\"coinsDoId\":\"22\",\"timestamp\":\"1671698862478\"}",
    "sign":"bca9130ebc1998e2fea8c81bf480f13dbdd7259f05ac7019f47a70bc8bae407f"
}
```

**Request example 2**

```
{
    "data":"{\"address\":\"0xd065380c78847bfba75ad158067a5e8e845205f0\",\"apiKey\":\"4c90b98cc97b45b2\",\"coinsDoId\":\"22\",\"collectAmount\":\"0.12\",\"timestamp\":\"1671699594204\"}",
    "sign":"278682f15ae9afba34566b79eb26d90b1ba5d5542f53a2a6b650542265aac429"
}
```

### **Response**

**Response example**

```
{
    "code": 200, // status code
    "msg": "成功", // message
    "data": null // response data
}
```

**Response status code**

<table><thead><tr><th width="139.5">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4066</td><td>Failed to verify supported tokens</td></tr><tr><td>4073</td><td>CoinsDoId does not exist</td></tr><tr><td>4074</td><td>Receiving address does not exist</td></tr><tr><td>4075</td><td>Wallet version not supported</td></tr><tr><td>4076</td><td>Insufficient balance</td></tr><tr><td>4077</td><td>Existing collections not yet complete</td></tr><tr><td>4078</td><td>Wallet collection switch not turned on</td></tr><tr><td>4079</td><td>Failed to save manual collection record</td></tr><tr><td>4080</td><td>Failed to query minimum balance configuration</td></tr><tr><td>4081</td><td>Failed to query manual collection record</td></tr><tr><td>4082</td><td>Collection amount should be greater than 0</td></tr></tbody></table>

***

## Get address balance <a href="#get-balance" id="get-balance"></a>

Retrieve address balance info

### **Request**

<mark style="color:green;">`POST`</mark> `/v1/balanceGet`

<table><thead><tr><th width="109.7109375">Parameter</th><th width="100.16015625">Required</th><th width="79.85546875">Type</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>Yes</td><td>string</td><td>Content（JSON string，refer to below）</td></tr></tbody></table>

```
{
    "apiKey": "d3a0beaa70474d3b",
    "address": "r4NXBFySVyhwR1yFBLm2ocxq731KvZKcVR",
    "coinsDoId": "30",
    "timestamp": 1679397493762
}
```

* Data content

<table><thead><tr><th width="109.984375">Parameter</th><th width="99.6171875">Required</th><th width="80.11328125">Type</th><th>Description</th></tr></thead><tbody><tr><td>apiKey</td><td>Yes</td><td>string</td><td>API KEY</td></tr><tr><td>address</td><td>Yes</td><td>string</td><td>Receiving address</td></tr><tr><td>coinsDoId</td><td>Yes</td><td>string</td><td>CoinsDo assigned Token ID(Refer to token list)</td></tr><tr><td>timestamp</td><td>Yes</td><td>string</td><td>Timestamp (in seconds or milliseconds)</td></tr></tbody></table>

**Request example**

```
{
    "data":"{\"address\":\"r4NXBFySVyhwR1yFBLm2ocxq731KvZKcVR\",\"apiKey\":\"d3a0beaa70474d3b\",\"coinsDoId\":\"30\",\"timestamp\":\"1679497593762\"}",
    "sign":"03dabf4073bad9d5fcde3b881bba076cae211ac28b11995289740f96f51162a5"
}
```

### **Response**

**Response example**

```
{
    "code": 200,
    "msg": "成功",
    "data": {
        "balance": 15.000000000000000000,
        "balanceUpdateTime": "1669712411"
    }
}
```

* Data parameter

<table><thead><tr><th width="179.84765625">Parameter</th><th width="99.77734375">Required</th><th width="80.12890625">Type</th><th>Description</th></tr></thead><tbody><tr><td>balance</td><td>Yes</td><td>string</td><td>receiving address’ balance</td></tr><tr><td>balanceUpdateTime</td><td>Yes</td><td>string</td><td>Transaction confirmation timestamp(seconds)</td></tr></tbody></table>

**Response status**

<table><thead><tr><th width="114.5859375">Status code</th><th>Description</th></tr></thead><tbody><tr><td>4034</td><td>Failed to verify address</td></tr><tr><td>4066</td><td>Failed to verify supported tokens</td></tr><tr><td>4073</td><td>CoinsDoId does not exist</td></tr><tr><td>4074</td><td>Receiving address does not exist</td></tr></tbody></table>
