# Overview

Welcome to the Defy Blockchain API

The Defy Blockchain API can be used to pull balances, positions and historical granular transaction data from dozens of blockchain networks. This data enables hundreds of end-user use-cases like wallets, investor dashboards, taxation tools and as-of-yet unknown use-cases.

{% hint style="success" %}
***One Defy API. One Billion Possibilities.***
{% endhint %}

Defy API is RESTful. The API is designed around the main resources that's available through the web interface. Sample API calls are provided next to each method using cURL.

**Broadly speaking, there are four sections of endpoints:**

* Stream API
* Live AML API
* Security API
* Travel Rule API

## URL Patterns

*The API Host for all requests is* [*https://api.getdefy.co/v2/*](#url-patterns)

* The current version of the API is v2.
* All requests are done over HTTPS (calls over plain HTTP will fail.)
* The default return format for all endpoints is JSON.
* All requests require authentication.


# API Key

Let's start with Defy Blockchain API

To access the Defy API, you will need an API key. If you need one you can contact with us. Just send a mail to <info@getdefy.co>. We will reach you immediately.

### Authentication via Header/Query/Body parameter

Simply append **api*****key=API\_KEY*** as a query parameter or header parameter or body parameters to all requests. The main advantage of this method is to embed the API endpoints within applications that do not support more sophisticated auth mechanisms, like Google Sheets or as IFrames.

### Authentication via Basic Auth

Example of basic authentication.

```
curl --location 'https://api.getdefy.co/v2/ENDPOINT' \
--header 'apikey: APIKEY'
```

Provide your API key as the basic auth username. You do not need to provide a password.

<br>


# What is streaming?

You can listen all EVM accounts with Defy Streaming.

## What is this request?

With this service, the wallets you want to track will send a request to the webhook you want when they take any action.

## What can I do with this service?

There is no limit to what you can do as you can follow every action of any wallet you want. If you want, you can set up your own notification system. If you want, you can send an e-mail to your customers as they process. It's entirely up to your creativity.

## Tutorial

```javascript
var axios = require('axios');

// Create Wallet Streaming
axios.post(
    'https://api.getdefy.co/v2/stream/create',
    {
      address: '0x787970ad122d5947579e613c2464d9540081b46f',
      webhook: 'WEBHOOK_URL',
      aml_webhook: 'LIVE_AML_WEBHOOK_URL',
    },
    {
      headers: {
        apikey: 'API_KEY',
      },
    },
  )
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
```

#### Options

* `address` (required): A user address (i.e. `0x1a2b3x...`). If specified, the user attached to the query is ignored and the address will be used instead.
* `webhook` (required): You will be notified with this webhook if this wallet does something.
* `aml_webhook` (optinoal): You will be notified with this webhook if this wallet does something bad. With this URL you do not need any action for Live AML.

## Example Webhook Data (Ethereum, BSC, Avalanche, Polygon)

With this data you can everything you want in your system.

```json
{
  "blockNumber": 30125357, // Type: Number
  "chainId": 56, // Type: Number
  "tx": {
    "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40", // Type: String
    "to": "0x55d398326f99059ff775485246999027b3197955", // Type: String
    "hash": "0xdb16608a4983aba6cb4f0624559939f628ac410abb1b3ac2ab4d7b80e26cf41a", // Type: String
    "value": 100000000000000000000, // Type: Number
    "formattedValue": 1.0, // Type: Float
    "input": "0xa9059cbb0000000000000000000000001093a4feb3a20af33a4e51365c9de129f7ffdd0c0000000000000000000000000000000000000000000000056bc75e2d63100000", // Type: String
    "status": 1, // Type: Number
    "address": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", // Type: String
    "logs": [
      {
        "transactionIndex": 20,
        "blockNumber": 30125357,
        "transactionHash": "0xdb16608a4983aba6cb4f0624559939f628ac410abb1b3ac2ab4d7b80e26cf41a", // Type: String
        "address": "0x55d398326f99059fF775485246999027B3197955", // Type: String
        "topics": [
          "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
          "0x000000000000000000000000f89d7b9c864f589bbf53a82105107622b35eaa40",
          "0x0000000000000000000000001093a4feb3a20af33a4e51365c9de129f7ffdd0c"
        ],
        "data": "0x0000000000000000000000000000000000000000000000056bc75e2d63100000", // Type: String
        "logIndex": 31,
        "blockHash": "0x629dc404ea1783a056c4be41a160faf122b99868c70b1e1de07709d624f1307d" // Type: String
      }
    ], // Type: Array
    "gas": 90000, // Type: Number
    "gasPrice": 5000000000, // Type: Number
    "network": "bsc", // Type: String
    "blockNumber": 30125357 // Type: Number
  }, // Type: Object
  "confirmed": true, // Type: Boolean
  "approvals": [
    {
      "address": "0x55d398326f99059ff775485246999027b3197955", // Type: String
      "index": 31, // Type: Number
      "topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", // Type: String
      "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40", // Type: String
      "to": "0x1093a4feb3a20af33a4e51365c9de129f7ffdd0c", // Type: String
      "method": "approval" // Type: String
    }
  ], // Type: Array
  "erc20Transfers": [
    {
      "address": "0x55d398326f99059ff775485246999027b3197955", // Type: String
      "index": 31,
      "topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", // Type: String
      "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40", // Type: String
      "to": "0x1093a4feb3a20af33a4e51365c9de129f7ffdd0c", // Type: String
      "method": "transfer", // Type: String
      "type": "ERC20", // Type: String
      "name": "Tether USD", // Type: String
      "symbol": "USDT", // Type: String
      "decimals": 18, // Type: Number
      "created_at": "2022-10-13T13:09:25.574Z", // Type: String
      "value": 100000000000000000000, // Type: Number
      "formattedValue": 1.0 // Type: Float
    }
  ], // Type: Array
  "erc721Transfers": [
    {
      "address": "0x55d398326f99059ff775485246999027b3197955", // Type: String
      "index": 31, // Type: Number
      "topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", // Type: String
      "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40", // Type: String
      "to": "0x1093a4feb3a20af33a4e51365c9de129f7ffdd0c", // Type: String
      "method": "transfer", // Type: String
      "type": "ERC721", // Type: String
      "name": "CryptoBlades", // Type: String
      "symbol": "SKILL", // Type: String
      "decimals": 0, // Type: Number
      "tokenID": 3, // Type: Number
      "created_at": "2022-10-13T13:09:25.574Z", // Type: String
      "value": 1, // Type: Number
      "formattedValue": 1.0 // Type: Float
    }
  ], // Type: Array
  "erc1155Transfers": [
    {
      "address": "0x55d398326f99059ff775485246999027b3197955", // Type: String
      "index": 31, // Type: Number
      "topic": "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", // Type: String
      "from": "0xf89d7b9c864f589bbf53a82105107622b35eaa40", // Type: String
      "to": "0x1093a4feb3a20af33a4e51365c9de129f7ffdd0c", // Type: String
      "method": "transfer", // Type: String
      "type": "ERC1155", // Type: String
      "name": "CryptoBlades", // Type: String
      "symbol": "SKILL", // Type: String
      "decimals": 0, // Type: Number
      "tokenID": 3, // Type: Number
      "tokenValue": 32, // Type: Number
      "created_at": "2022-10-13T13:09:25.574Z", // Type: String
      "value": 1, // Type: Number
      "formattedValue": 1.0 // Type: Float
    }
  ], // Type: Array
  "contract_type": "ERC20", // Type: String
  "network": "bsc" // Type: String
}
```

In this example, our stream sends this data for the specific hash. In this data, the wallet only made an **ERC20** transaction and sent **Tether**. In addition, there is native data in the data. If you want to examine it in more detail yourself, the **original transaction** data is also available.

## Example Webhook Data (Bitcoin)

With this data you can everything you want in your system.

```json
{
  "hash": "693275a1a93a5f5e116f1f64f94a9f362184442fdd0ee7bac51c1e682b37f48b",
  "hex": "0100000000010119884ff853c286333cc418b3c2d3e851f93bd8dd0b32ac06bf74ab26cd3a0ea20100000000ffffffff10441fec00000000002251206e2703df3d00fb011bdfcea9c32992212cf030686495d8b4bbdb0714f976c58e825bac0900000000160014dc6bf86354105de2fcd9868a2b0376d6731cb92fafb33400000000001976a91459e76034fe8e5f1bcce04892313d867a9409937388ac1027000000000000160014963c8de83a73199324e920e0b35833827574ce21803e00000000000017a914e4653a60e35955c24a430f137f9eecb332a79884878b88000000000000160014efb7c91cf4cd80d464f326219fa99d258d548074962b0100000000001600143b3f1ab00c353355a17856c273b33727beace2a520a700000000000017a9147d8ee62b3c18e3b5fa1e5fc2912abd2811822819878d570900000000001976a9145e7c19da9162e09f91b3a570f1dc7592af334df788ac500f1e0000000000160014403eceab580299a001a10fffc5b67f9f2bd78fceef210100000000001976a91470dc07ad27f251e39aeac29341714ee9c25932c888acf0fcf300000000001976a91411b66af16d2c497e1068a2ea989e7fc932527a7c88ac02f53d00000000001600144b28d8248a247b51a0d295ce33fe77e5522fe5969bd9110000000000160014fc65c658c5368bae2334b05d1f73446df0d53df51c250300000000001976a91490a4c85f836ade43f16bcc4518a7178ea47be6d088ac13720000000000001976a914b018fd99222b5fe571fdbf61b62f0e5a8314cc0688ac0247304402200604b53fb2d64af7fa80f86124cd1e9a1cda5e08abcb87f7cf64bb5345b40e35022069574638d2933f8359275171ace9e1f253952abb904c2c1f8cdaf94923e58712012102174ee672429ff94304321cdae1fc1e487edf658b34bd1d36da03761658a2bb0900000000",
  "version": 1,
  "size": 688,
  "vsize": 607,
  "weight": 2425,
  "locktime": 0,
  "inputs": [
    {
      "prevout": {
        "hash": "a20e3acd26ab74bf06ac320bddd83bf951e8d3c2b318c43c3386c253f84f8819",
        "index": 1
      },
      "sequence": 4294967295,
      "script": "",
      "coin": {
        "version": 1,
        "height": 858256,
        "value": 205520479,
        "script": "0014dc6bf86354105de2fcd9868a2b0376d6731cb92f",
        "address": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
        "type": null,
        "reqSigs": null,
        "coinbase": false
      }
    }
  ],
  "timestamp": 1724509856,
  "outputs": [
    {
      "value": 15474500,
      "script": "51206e2703df3d00fb011bdfcea9c32992212cf030686495d8b4bbdb0714f976c58e",
      "address": "bc1pdcns8heaqraszx7le65ux2vjyyk0qvrgvj2a3d9mmvr3f7tkck8qu5uz84",
      "scriptPubKey": {
        "type": "witness_v1_taproot",
        "reqSigs": null
      }
    },
    {
      "value": 162290562,
      "script": "0014dc6bf86354105de2fcd9868a2b0376d6731cb92f",
      "address": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
      "scriptPubKey": {
        "type": "witness_v0_keyhash",
        "reqSigs": null
      }
    }
  ],
  "addresses": [
    "bc1pdcns8heaqraszx7le65ux2vjyyk0qvrgvj2a3d9mmvr3f7tkck8qu5uz84",
    "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h"
  ],
  "fee": 9105,
  "mapped": {
    "inputs": [
      {
        "address": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
        "value": 205520479
      }
    ],
    "outputs": [
      {
        "address": "bc1pdcns8heaqraszx7le65ux2vjyyk0qvrgvj2a3d9mmvr3f7tkck8qu5uz84",
        "value": 15474500
      },
      {
        "address": "bc1qm34lsc65zpw79lxes69zkqmk6ee3ewf0j77s3h",
        "value": 162290562
      }
    ]
  }
}
```


# Streaming API

## Create Stream

You can create streaming with this service. Just add **address** and **webhook** data then we will send notification to your webhook. Also if you want set your live anti money laundering tracking webhook you can set with this request (this is optional).

<mark style="color:green;">`POST`</mark> `https://api.getdefy.co/v2/stream/create`

#### Header Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| apikey<mark style="color:red;">\*</mark> | String | Service Apikey |

#### &#x20;Body Parameters

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| address<mark style="color:red;">\*</mark> | String | Wallet Address       |
| webhook<mark style="color:red;">\*</mark> | String | Webhook URL          |
| aml\_webhook                              | String | Live AML Webhook URL |

{% tabs %}
{% tab title="200: OK " %}
{% code lineNumbers="true" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request " %}
{% code lineNumbers="true" %}

```json
{
    "message": "Invalid webhook.",
    "code": 5004
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Delete Stream

You can stop your streaming with this request. Just enter which address you want to stop.

<mark style="color:red;">`DELETE`</mark> `https://api.getdefy.co/v2/stream/delete`

#### Header Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| apikey<mark style="color:red;">\*</mark> | String | Service Apikey |

#### Query Parameters

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| address<mark style="color:red;">\*</mark> | String | Wallet Address |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "message": "Invalid Address.",
    "code": 5002
}
```

{% endtab %}
{% endtabs %}

## List Streamed Addresses

You can list your streaming addresses with this request.

<mark style="color:blue;">`GET`</mark> `https://api.getdefy.co/v2/stream/list`

#### Query Parameters

| Name  | Type | Description           |
| ----- | ---- | --------------------- |
| page  | 1    | Page Number (Min: 1)  |
| limit | 50   | Page Limit (Max: 100) |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
            "stream_webhook": "https://www.getdefy.co/webhook",
            "created_at": "2024-07-25T13:57:09.644Z",
            "has_stream": true
        },
        {
            "address": "0x03906d9ce98bbbc8b7242ecf9448a4b4d2310705",
            "stream_webhook": "https://www.getdefy.co/webhook",
            "created_at": "2024-07-20T19:10:58.834Z",
            "has_stream": true
        }
    ],
    "page_count": 138
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "message": "Error Message",
  "status": 5002
}
```

{% endtab %}
{% endtabs %}


# What is Live AML?

You can listen all EVM accounts security with Defy Live AML.

## What is this request?

This is the live version of the address security service. With this service, the wallets you follow will notify you when they make a bad transaction.

## What can I do with this service?

With this service, secure the wallets on our platform and minimize all possible risks. Be aware of everything instantly.

## Tutorial

```javascript
var axios = require('axios');

// Create Live AML Account Tracking
axios.post(
    'https://api.getdefy.co/v2/liveaml/create',
    {
      address: '0x787970ad122d5947579e613c2464d9540081b46f',
      webhook: 'WEBHOOK_URL',
      stream_webhook: 'STREAM_WEBHOOK_URL',
    },
    {
      headers: {
        apikey: 'API_KEY',
      },
    },
  )
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
```

#### Options

* `address` (required): A user address (i.e. `0x1a2b3x...`). If specified, the user attached to the query is ignored and the address will be used instead.
* `webhook` (required): You will be notified with this webhook if this wallet does something bad.
* `stream_webhook` (optinoal): You will be notified with this webhook if this wallet does something. With this parameter you do not need any action for streaming.

## Example Webhook Data

With this data you can everything you want in your system.

```json
{
  "address": "0x28c6c06298d514db089934071355e5743bf21d60",
  "score": 100,
  "tags": {
    "mixer": false,
    "fake_kyc": false,
    "cybercrime": false,
    "new_wallet": false,
    "sanctioned": false,
    "direct_mixer": false,
    "indirect_mixer": false,
    "invalid_tokens": true,
    "direct_fake_kyc": false,
    "financial_crime": false,
    "stealing_attack": false,
    "money_laundering": false,
    "direct_cybercrime": false,
    "direct_sanctioned": false,
    "gambling_accounts": false,
    "indirect_fake_kyc": false,
    "blacklisted_tokens": false,
    "indirect_cybercrime": false,
    "indirect_sanctioned": false,
    "phishing_activities": false,
    "blacklisted_accounts": false,
    "blackmail_activities": false,
    "darkweb_transactions": false,
    "direct_financial_crime": false,
    "direct_stealing_attack": false,
    "direct_money_laundering": false,
    "direct_gambling_accounts": false,
    "indirect_financial_crime": false,
    "indirect_stealing_attack": false,
    "direct_blacklisted_tokens": false,
    "indirect_money_laundering": false,
    "direct_phishing_activities": false,
    "indirect_gambling_accounts": true,
    "direct_blacklisted_accounts": false,
    "direct_blackmail_activities": false,
    "direct_darkweb_transactions": false,
    "indirect_blacklisted_tokens": true,
    "indirect_phishing_activities": false,
    "indirect_blacklisted_accounts": true,
    "indirect_blackmail_activities": false,
    "indirect_darkweb_transactions": false,
    "number_of_malicious_contracts_created": false,
    "direct_number_of_malicious_contracts_created": false,
    "indirect_number_of_malicious_contracts_created": false
  },
  "hash": "0xba65cb8d6d377e0faac37309d66c4667a78a3a00db51c92962970ed08204b0fa",
  "block_number": 427911264,
  "hash_tags": {
    "indirect_blacklisted_accounts": true,
    "indirect_gambling_accounts": true
  },
  "created_at": "2024-05-07T08:02:05.181Z"
}
```

With this example our stream send this data for spesific hash. In this transaction this wallet contacted with **mixer** wallet. We are understanding this in hash\_tags variables. You can see **block number, hash number.** Also you can see **score** for this wallet. Scoring means 0 is bad and 100 is good.


# Live AML API

## Create Live AML

You can create live anti money laundering tracking with this service. Just add **address** and **webhook** data then we will send notification to your webhook. Also if you want set your streaming webhook you can set with this request (this is optional).

<mark style="color:orange;">`POST`</mark> `https://api.getdefy.co/v2/liveaml/create`

#### Header Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| apikey<mark style="color:red;">\*</mark> | String | Service Apikey |

#### Body Parameters

| Name                                      | Type   | Description           |
| ----------------------------------------- | ------ | --------------------- |
| address<mark style="color:red;">\*</mark> | String | Wallet Address        |
| webhook<mark style="color:red;">\*</mark> | String | Webhook URL           |
| stream\_webhook                           | String | Streaming Webhook URL |

{% tabs %}
{% tab title="200: OK " %}
{% code lineNumbers="true" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request " %}
{% code lineNumbers="true" %}

```json
{
    "message": "Error Message",
    "code": 5004
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Delete Live AML

You can stop your live anti money laundering tracking with this request. Just enter which address you want to stop.&#x20;

<mark style="color:blue;">`DELETE`</mark> `https://api.getdefy.co/v2/liveaml/delete`

#### Header Parameters

| Name                                     | Type   | Description    |
| ---------------------------------------- | ------ | -------------- |
| apikey<mark style="color:red;">\*</mark> | String | Service Apikey |

#### Query Parameters

| Name                                      | Type   | Description    |
| ----------------------------------------- | ------ | -------------- |
| address<mark style="color:red;">\*</mark> | String | Wallet Address |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "message": "Error Message",
    "code": 5004
}
```

{% endtab %}
{% endtabs %}

## List Tracked Live AML Addresses

You can list your live anti money laundering tracking addresses with this request.

<mark style="color:blue;">`GET`</mark> `https://api.getdefy.co/v2/liveaml/list`

#### Header Parameters

| Name                                     | Type   | Description |
| ---------------------------------------- | ------ | ----------- |
| apikey<mark style="color:red;">\*</mark> | string | API\_KEY    |

#### Query Parameters

| Name    | Type    | Description                 |
| ------- | ------- | --------------------------- |
| page\*  | integer | Value has to be minimum 1   |
| limit\* | integer | Value has to be maximum 100 |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "address": "0xde0b295669a9fd93d5f28d9ec85e40f4cb697bae",
            "aml_webhook": "https://www.getdefy.co/amlwebhook",
            "created_at": "2024-07-25T13:57:09.644Z",
            "has_stream": true
        }
    ],
    "page_count": 275
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "message": "Error Message",
    "code": 5004
}
```

{% endtab %}
{% endtabs %}

## Addresses Actions

You can list your tracked accounts notification with this request. Also you can paginate it.

<mark style="color:blue;">`GET`</mark> `https://api.getdefy.co/v2/liveaml/events`

#### Header Parameters

| Name     | Type   | Description |
| -------- | ------ | ----------- |
| apikey\* | String | API\_KEY    |

#### Query Parameters

| Name    | Type    | Description              |
| ------- | ------- | ------------------------ |
| page\*  | Integer | Page Value (Minimum 1)   |
| limit\* | Integer | Page Limit (Maximum 100) |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "id": "18944185",
            "address": "0x388c818ca8b9251b393131c08a736a67ccb19297",
            "event": {
                "hash": "0x42bdfa13f78624505f2fa727749b2a2b01add52910bf3688126d553d4b217f54",
                "tags": {
                    "mixer": false,
                    "fake_kyc": false,
                    "cybercrime": false,
                    "new_wallet": false,
                    "sanctioned": false,
                    "indirect_mixer": false,
                    "invalid_tokens": false,
                    "financial_crime": false,
                    "stealing_attack": false,
                    "money_laundering": false,
                    "gambling_accounts": false,
                    "indirect_fake_kyc": false,
                    "blacklisted_tokens": false,
                    "indirect_cybercrime": false,
                    "indirect_sanctioned": false,
                    "phishing_activities": false,
                    "blacklisted_accounts": false,
                    "blackmail_activities": false,
                    "darkweb_transactions": false,
                    "indirect_financial_crime": false,
                    "indirect_stealing_attack": false,
                    "indirect_money_laundering": false,
                    "indirect_gambling_accounts": true,
                    "indirect_blacklisted_tokens": true,
                    "indirect_phishing_activities": false,
                    "indirect_blacklisted_accounts": true,
                    "indirect_blackmail_activities": false,
                    "indirect_darkweb_transactions": false,
                    "number_of_malicious_contracts_created": false,
                    "indirect_number_of_malicious_contracts_created": false
                },
                "score": 59,
                "hash_tags": {
                    "indirect_gambling_accounts": true,
                    "indirect_blacklisted_tokens": true,
                    "indirect_blacklisted_accounts": true
                },
                "block_number": 541168421
            },
            "created_at": "2024-07-30T12:20:01.211Z"
        }
    ],
    "page_count": 6656
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
    "message": "Error Message",
    "code": 5004
}
```

{% endtab %}
{% endtabs %}


# Anti Money Laundering (AML)

## What is this request?

If you are in doubt about the security of a wallet and you think it is a dangerous wallet, you can question the security of the wallet with this service.

***There are a lot of tags we have investigated. Also there is a score for these tags. For scoring 100 is bad and 0 is good.***

## What can I do with this service?

With this service, ensure the security of the wallets on our platform and minimize all possible risks.

<figure><img src="/files/OHII2HuZbTju6YiPX0Mn" alt="Example from getdefy.co"><figcaption><p>Example from getdefy.co</p></figcaption></figure>

## Tutorial

```javascript
var axios = require('axios');

axios.get('https://api.getdefy.co/v2/analyze/aml', {
    params: {
      address: '0x787970ad122d5947579e613c2464d9540081b46f',
      network: 'polygon',
      apikey: 'API_KEY',
      webhook: 'WEBHOOK_URL',
    },
  })
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
```

#### Options

* `address` (required): A user address (i.e. `0x1a2b3x...`). If specified, the user attached to the query is ignored and the address will be used instead.
* `apikey` (required): API key for requests. If you want you set apikey params to header.
* `network` (required): Address Network. Use can get network list with service. Also you can learn network code on [**Supported Networks.**](/developer-resources/supported-chains)
* `webhook` (optional): Live AML webhook URL.

There are a lot of tags we have investigated. Also there is a score for these tags. ***For scoring 100 is bad and 0 is good.***

### What is direct prefix?

There some direct prefix in tags. Direct means that the searched wallet is not a suspicious wallet, but has contacted a suspicious wallet.&#x20;

### What is indirect prefix?

There some indirect prefix in tags. Indirect means that the searched wallet is not directly a suspicious wallet, but has contacted a direct suspicious wallet.&#x20;

<mark style="color:blue;">`GET`</mark> `https://api.getdefy.co/v2/analyze/aml`

#### Query Parameters

| Name                                      | Type   | Description          |
| ----------------------------------------- | ------ | -------------------- |
| address<mark style="color:red;">\*</mark> | String | Wallet Address       |
| network<mark style="color:red;">\*</mark> | String | Wallet Network       |
| apikey<mark style="color:red;">\*</mark>  | String | API Key              |
| webhook                                   | String | Live AML Webhook URL |

{% tabs %}
{% tab title="200: OK" %}
{% code lineNumbers="true" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": {
        "score": 100,
        "tags": {
            "mixer": false,
            "fake_kyc": false,
            "cybercrime": false,
            "new_wallet": false,
            "sanctioned": false,
            "direct_mixer": true,
            "indirect_mixer": true,
            "invalid_tokens": false,
            "direct_fake_kyc": false,
            "financial_crime": false,
            "stealing_attack": false,
            "money_laundering": false,
            "direct_cybercrime": false,
            "direct_sanctioned": false,
            "gambling_accounts": false,
            "indirect_fake_kyc": false,
            "blacklisted_tokens": false,
            "indirect_cybercrime": false,
            "indirect_sanctioned": false,
            "phishing_activities": false,
            "blacklisted_accounts": false,
            "blackmail_activities": false,
            "darkweb_transactions": false,
            "direct_financial_crime": false,
            "direct_stealing_attack": false,
            "direct_money_laundering": false,
            "direct_gambling_accounts": true,
            "indirect_financial_crime": false,
            "indirect_stealing_attack": false,
            "direct_blacklisted_tokens": false,
            "indirect_money_laundering": false,
            "direct_phishing_activities": false,
            "indirect_gambling_accounts": true,
            "direct_blacklisted_accounts": true,
            "direct_blackmail_activities": false,
            "direct_darkweb_transactions": false,
            "indirect_blacklisted_tokens": true,
            "indirect_phishing_activities": false,
            "indirect_blacklisted_accounts": true,
            "indirect_blackmail_activities": false,
            "indirect_darkweb_transactions": false,
            "number_of_malicious_contracts_created": false,
            "direct_number_of_malicious_contracts_created": false,
            "indirect_number_of_malicious_contracts_created": false
        }
    }
}
```

{% endcode %}
{% endtab %}

{% tab title="400: Bad Request" %}
{% code lineNumbers="true" %}

```json
{
  "message": "Error Message",
  "status": 5000
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


# Transaction Detail

## What is this request?

You can see more detailed transactions with this service.

## What can I do with this service?

With this service, you have a more detailed transaction and transaction aml information. You can see what was done in the transaction and with which contract this transaction was run.

## Tutorial

```javascript
var axios = require('axios');

axios.get('https://api.getdefy.co/v2/analyze/tx_detail', {
    params: {
      hash: '0xaef1b250f3c09dde83c5c040c4b0fa2363db5b35980e74cd72560d509b365299',
      network: 'polygon',
      apikey: 'API_KEY',
    },
  })
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });
```

#### Options

* `hash` (required): A transaction hash (i.e. `0x1a2b3x...`).
* `network` (required): A transaction network (i.e. `avalanche...`).
* `apikey` (required): API key for requests.

## Request Example

<mark style="color:blue;">`GET`</mark> `https://api.getdefy.co/v2/analyze/tx_detail`

#### Query Parameters

| Name                                      | Type   | Description         |
| ----------------------------------------- | ------ | ------------------- |
| apikey<mark style="color:red;">\*</mark>  | String | API Key             |
| hash<mark style="color:red;">\*</mark>    | String | Transaction Hash    |
| network<mark style="color:red;">\*</mark> | String | Transaction Network |

{% tabs %}
{% tab title="200: OK " %}

```json
{
    "code": 0,
    "message": "OK",
    "data": {
        "from": "0x1d0d2d8c85441050abc9eb654399fa198fbd5722",
        "to": "0x2791bca1f2de4661ed88a30c99a7a9449aa84174",
        "status": "Success",
        "timestamp": 1696506036,
        "network": "polygon",
        "hash": "0xd2aae7196455c600ca8759a37e10d917ab89e96d5ba5514161828e6d31b4973a",
        "value": 0,
        "transfers": [
            {
                "from": "0x1d0d2d8c85441050abc9eb654399fa198fbd5722",
                "to": "0x777f415324d56e1d54fa832902d8797db7a4c57c",
                "value": 0.01,
                "token_name": "USD Coin (PoS)",
                "token_symbol": "USDC"
            }
        ],
        "aml_data": {
            "tags": {
                "direct_blacklisted_accounts": true,
                "direct_gambling_accounts": true,
                "indirect_mixer": true,
                "indirect_blacklisted_accounts": true,
                "indirect_gambling_accounts": true
            },
            "score": 100,
            "threshold": {
                "low": 0,
                "modarate": 30,
                "high": 70
            }
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```json
{
  "message": "Error Message",
  "status": 5002
}
```

{% endtab %}
{% endtabs %}


# What is Travel Rule?

The Travel Rule requires financial institutions participating in a cryptocurrency transaction (aka VASPs: Virtual Asset Service Providers) to exchange relevant beneficiary and originator KYC information. Any business holding crypto on behalf of their customers (a VASP) is required to implement the Travel Rule for transactions over a certain threshold sent to customers of another VASP. The specific threshold amount is determined by each national regulator. MASAK has recommended it be set to 15000 TRY.

<figure><img src="/files/m1nmyNF3otu54NcU50Qh" alt=""><figcaption></figcaption></figure>

### What information needs to be included in the Travel Rule request?​

Primarily you need to include the following information:

* The asset to be transferred (eg. BTC)
* Amount of asset to be transferred
* Information about the Originating Customer. Each country will have different requirements, but generally may include:
  * Name
  * Account number or blockchain address
  * Physical Address
  * Identity number eg. National ID number or Passport number
* Information about the Beneficiary Customer
  * Name
  * Account number or blockchain address

The industry has convened on the IVMS101 standard data model for defining this, which is supported in its entirety by Defy.


# Withdrawal Interactions

The DEFY Travel Rule system ensures secure and compliant handling of withdrawal transactions between Virtual Asset Service Providers (VASPs). The process begins when the customer initiates a transaction, which is sent to the Beneficiary VASP Backend. From there, DEFY Backend processes the request, performing necessary AML and security checks.

DEFY communicates with the Originator VASP to verify the transaction. If the transaction is approved, the Beneficiary VASP provides the transaction hash to DEFY, which is then forwarded to the Originator VASP for completion. In case of rejection, the transaction is logged, and the Beneficiary VASP is notified. This seamless and secure flow ensures compliance with travel rule regulations.

<figure><img src="/files/xnR58dSzNaYs4LmMzyCh" alt=""><figcaption><p>Defy Travel Rule Withdrawal Schema</p></figcaption></figure>

### Travel Rule Step-by-step

1. **Customer initiates a withdrawal transaction**
   * The customer sends withdrawal transaction information to Beneficiary VASP Backend via the [`create_tx`](/travel-rule/api-reference#create-transaction) service.
2. **Backend sent to Frontend**
   * It appears as a pending operation on the interface. In the meantime, AML and security inquiries were carried out by us.
3. **Action** **at Dashboard**
   * If the transaction is **rejected**, nothing happens, it just appears in the history.&#x20;
   * If the transaction is accepted, it is sent to the other party in accordance with the TRP protocol. If the other party does not use a protocol, communication is established via e-mail.
4. **Originator VASP Backend Reponses**
   * The other party sends its response regarding the transaction.
5. **Decision by the Originator VASP Backend**
   * If the transaction is **rejected**:
     * DEFY notifies the Beneficiary VASP Backend via webhook.
     * The rejection appears in the transaction history, and no further action is taken.
   * If the transaction is **approved**:
     * DEFY notifies the Beneficiary VASP Backend via webhook.
     * DEFY requests the `transaction_hash` data from the Beneficiary VASP Backend.
6. **Beneficiary VASP Backend provides transaction hash**
   * The "Beneficiary VASP Backend" sends the `transaction_hash` data to DEFY using the [`send_transaction`](/travel-rule/api-reference#send-transaction-hash) service.
7. **Transaction completion**
   * DEFY forwards the `transaction_hash` to the Originator VASP Backend along with the approval service.
   * If the Originator VASP Backend lacks a protocol, communication is established via [e-mail](/travel-rule/e-mail-notification).

> ### 📘 Do I have everything?
>
> Once all the information about the originator and beneficiary has been pulled from the databases and orchestrated into the IVMS101 format, you can send it to [`create_tx`](/travel-rule/api-reference#create-transaction) to confirm that everything is present.

You could also leverage [`create_tx`](/travel-rule/api-reference#create-transaction) when building the address book database so that everything gets collected from the start.


# Deposit Interactions

## Deposit With Travel Rule

The Travel Rule deposit process ensures compliance with international regulatory requirements by facilitating the secure exchange of information between Virtual Asset Service Providers (VASPs) during cryptocurrency transactions. This process involves verifying and sharing key details, such as wallet addresses and transaction data, between the originator and beneficiary VASPs. By integrating tools like DEFY’s backend services, the workflow ensures that all parties involved adhere to the Travel Rule by validating transaction details, confirming wallet ownership, and securely transmitting transaction hashes. This helps prevent illicit activities such as money laundering and enhances trust and transparency in digital asset transactions.

<figure><img src="/files/TxD9JJLH4qvvTFRnJMBJ" alt=""><figcaption><p>Defy Travel Rule Deposit Schema</p></figcaption></figure>

### Travel Rule Step-by-step

1. **Travel Rule Message Sending**
   * Originator VASP Backend sends a Travel Rule message to Defy Backend.
2. **Pending Operation Display**
   * Our Backend does AML and other jobs displays the transaction as a pending operation on the interface.
3. **Approval or Rejection Decision**
   * If you accept the transaction (Step 3.a), you will find the wallet address used in the transaction from your own database and report it to us.
   * If you reject the transaction (Step 3.b), it will revert to the other VASP.
4. **Wallet Address Transmission**
   * The wallet address in the transaction is sent to the DEFY Backend via the [`send_address`](/travel-rule/api-reference#send-wallet-address) service.
5. **Wallet Forwarding via Approval Service**
   * The wallet address received is delivered to the other VASP through the approval service.
6. **Transaction Hash Information**
   * The counterpart VASP provides the `transaction_hash` information on-chain.
7. **Transaction Hash Forwarding**
   * The DEFY Backend sends the `transaction_hash` data to the "Beneficiary VASP Backend" via a webhook.

> ### 📘 Do I have everything?
>
> Once all the information about the originator and beneficiary has been pulled from the databases and orchestrated into the IVMS101 format, you can send it to [`create_tx`](/travel-rule/api-reference#create-transaction) to confirm that everything is present.

You could also leverage [`create_tx`](/travel-rule/api-reference#create-transaction) when building the address book database so that everything gets collected from the start.

## Deposit Without Travel Rule

If the other VASP customer has sent money directly to your customer, you need to continue with this flow.

<figure><img src="/files/kxM6VEgnt8k90wInCOjh" alt=""><figcaption><p>Defy Travel Rule Deposit without TRP Schema</p></figcaption></figure>

### Travel Rule Step-by-step

1. **Sends Funds**
   * Originator VASP Backend sends funds directly to beneficiary VASP.
2. **Beneficiary VASP Collects Infos**
   * Beneficiary VASP collect customer infos prepares data.
3. **Requesting Service**
   * Beneficiary VASP backend requests [`receive_tx_without_protocol`](/travel-rule/api-reference#receive-transaction-without-protocol) service with prepared data.
4. **Screening on Dashboard**
   * After all these steps you can look transaction on our dashboard.

You could also leverage [`receive_tx_without_protocol`](/travel-rule/api-reference#receive-transaction-without-protocol) when building the address book database so that everything gets collected from the start.


# E-Mail Notification

If the travel rule information of the other party is unknown and not available in the list-vasp service, we contact the other exchange via e-mail on your behalf. We send all the necessary information to the other party as a receipt. The sample e-mail is similar to the one below.

```
Here is the travel rule transaction notification. You can view the transaction details by clicking the link below:

https://api.getdefy.co/v2/travelrule/transaction/87166db2-78b4-4f71-92e6-0ba6aa83d4a8?q=0k9zUVegf4oCkFJOPVJgeQ6qTEOqTdv5
```

In that URL there will be IVMS101 data of transaction.


# Status and Webhook Data

### Webhooks

There are several types of webhook datas. Here is the list of webhook data we can send to your backend.

```javascript
const axios = require("axios");

// after this status, you have to send transaction hash for TRP.
await axios.post("YOUR_WEBHOOK_URL", {
          transaction_ref: "YOUR_TRANSACTION_REFERENCE",
          status: "OTHER_VASP_APPROVED",
});

// this is sent only to inform you and to enable you to take action on your own end.
await axios.post("YOUR_WEBHOOK_URL", {
          transaction_ref: "YOUR_TRANSACTION_REFERENCE",
          status: "OTHER_VASP_REJECTED",
});

// you need to send the wallet address of the person in the persons object we sent you.
await axios.post("YOUR_WEBHOOK_URL", {
          transaction_ref: "YOUR_TRANSACTION_REFERENCE",
          status: "WAITING_ADDRESS_DATA",
          persons: persons,
          accountNumber: ["0xTest"]
});

// the transaction hash information of the transaction sent to you by the other party
await axios.post("YOUR_WEBHOOK_URL", {
          transaction_ref: "YOUR_TRANSACTION_REFERENCE",
          status: "TRANSACTION_CONFIRMED",
          txid: txid
});
```

### Statuses

Here is the status list for TRP transactions.

* **CREATED:** The transaction or request has been initiated or generated.
* **REJECTED:** The transaction or request has been denied or disapproved.
* **APPROVED:** The transaction or request has been authorized or accepted.
* **COMPLETED:** The transaction or request has been finalized or concluded successfully.
* **SCORE:** This could represent a rating, evaluation, or priority assigned to the transaction or request.
* **PENDING:** The transaction or request is awaiting further processing or confirmation.
* **WAITING\_TX\_HASH:** The system is expecting a transaction hash, a unique identifier for a transaction on a blockchain.
* **OTHER\_VASP\_PENDING, OTHER\_VASP\_APPROVED, OTHER\_VASP\_REJECTED:** These states likely indicate that the transaction is being processed by a different Verified Service Provider (VASP) and its current status there.
* **WAITING\_ADDRESS\_DATA:** The system is waiting for the necessary address information to proceed with the transaction.
* **WAITING\_FOR\_CONFIRMATION:** The transaction is awaiting confirmation on the blockchain network.
* **TRANSACTION\_CONFIRMED:** The transaction has been confirmed on the blockchain network.


# API Reference

All services for Travel Rule are listed here. You can search for services from the indicator on the right.

### Create Transaction

<mark style="color:green;">`POST`</mark> `https://api.getdefy.co/v2/travelrule/create_tx`

This service is there to allow you to create a transaction when sending money of the endpoint. The originator data must definitely include the name and wallet address. In the originator data, you must send one of the following data: date of birth, identity information, address or customer number. On the beneficiary side, it is sufficient to send only the name and wallet address data.

**Body**

<table><thead><tr><th width="308">Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td><code>transaction_ref</code></td><td>string</td><td>Transaction reference number from your system. (Required)</td></tr><tr><td><code>transaction_asset</code></td><td>string</td><td>Asset Symbol (Required)</td></tr><tr><td><code>transaction_network</code></td><td>string</td><td>Asset Network</td></tr><tr><td><code>transaction_amount</code></td><td>string</td><td>Asset Amount (Required)</td></tr><tr><td><code>transaction_asset_decimals</code></td><td>string</td><td>Asset Decimals (Required)</td></tr><tr><td><code>originator</code></td><td>object</td><td>Originator Data (Required)</td></tr><tr><td><code>persons</code></td><td>array</td><td>Originator Person Data (Required)</td></tr><tr><td><code>name</code></td><td>object</td><td>Originator Person Name (Required)</td></tr><tr><td><code>dateAndPlaceOfBirth</code></td><td>object</td><td>Originator Person birthplace or birthday</td></tr><tr><td><code>nationalIdentifier</code></td><td>object</td><td>Originator Person national identifier</td></tr><tr><td><code>customerIdenficiation</code></td><td>object</td><td>Originator Person customer ID</td></tr><tr><td><code>geographicAddress</code></td><td>object</td><td>Originator Person's Address</td></tr><tr><td><code>accountNumber</code></td><td>array</td><td>Originator Wallet Address (Required)</td></tr><tr><td><code>beneficiary</code></td><td>object</td><td>Beneficiary Data (Required)</td></tr><tr><td><code>persons</code></td><td>array</td><td>Beneficiary Person Data (Required)</td></tr><tr><td><code>name</code></td><td>object</td><td>Beneficiary Person Name (Required)</td></tr><tr><td><code>dateAndPlaceOfBirth</code></td><td>object</td><td>Beneficiary Person birthplace or birthday</td></tr><tr><td><code>nationalIdenficiation</code></td><td>object</td><td>Beneficiary Person national identifier</td></tr><tr><td><code>customerIdenficiation</code></td><td>object</td><td>Beneficiary Person customer ID</td></tr><tr><td><code>geographicAddress</code></td><td>object</td><td>Beneficiary Person's Address</td></tr><tr><td><code>accountNumber</code></td><td>array</td><td>Beneficiary Wallet Address (Required)</td></tr></tbody></table>

{% tabs %}
{% tab title="Request" %}

```javascript
const axios = require('axios');

const data = JSON.stringify({
    "transaction_ref": "a4de3f3f-668f-4844-995a-03ad1b73a52f",
    "transaction_asset": "ETH",
    "transaction_amount": "20000000000000000000", 
    "transaction_asset_decimals": "18",
    "beneficiary_vasp_id": "3651dcbf-b41f-4f68-b79b-7ce794caf233",
    "originator": {
        "persons": [
            {
                "naturalPerson": {
                    "name": {
                        "nameIdentifier": [
                            {
                                "primaryIdentifier": "Merve",
                                "secondaryIdentifier": "Güler",
                                "nameIdentifierType": "LEGL"
                            }
                        ]
                    },
                    "dateAndPlaceOfBirth": {
                        "dateOfBirth": "1990-02-24",
                        "placeOfBirth": "Singapore"
                    },
                    "nationalIdentification": {
                        "nationalIdentifier": "12345678910",
                        "nationalIdentifierType": "CCPT",
                        "countryOfIssue": "TR"
                    },
                    "geographicAddress": [
                        {
                            "addressType": "GEOG",
                            "streetName": "Potential Street",
                            "buildingNumber": "123",
                            "buildingName": "Cheese Hut",
                            "postCode": "91361",
                            "townName": "Thousand Oaks",
                            "countrySubDivision": "California",
                            "country": "US"
                        }
                    ],
                    "customerIdentification": "01010101"
                }
            }
        ],
        "accountNumber": [
            "0x1d0d2d8c85441050abc9eb654399fa198fbd5720"
        ]
    },
    "beneficiary": {
        "persons": [
            {
                "naturalPerson": {
                    "name": {
                        "nameIdentifier": [
                            {
                                "primaryIdentifier": "Merve",
                                "secondaryIdentifier": "Güler",
                                "nameIdentifierType": "LEGL"
                            }
                        ]
                    }
                }
            }
        ],
        "accountNumber": [
            "0x1d0d2d8c85441050abc9eb654399fa198fbd5722"
        ]
    }
});

const config = {
  method: 'post',
  url: 'https://api.getdefy.co/v2/travelrule/create_tx',
  headers: { 
    'Content-Type': 'application/json', 
    'apikey': 'APIKEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": "PENDING"
}
```

{% endtab %}
{% endtabs %}

### Send Transaction Hash

<mark style="color:green;">`POST`</mark> `https://api.getdefy.co/v2/travelrule/send_tx_hash`

This service is sending transaction hash to us for travel rule protocol.

**Body**

| Name               | Type   | Description                                   |
| ------------------ | ------ | --------------------------------------------- |
| `transaction_ref`  | string | Your transaction reference number. (Required) |
| `transaction_hash` | string | On-Chain Transaction Hash  (Required)         |

{% tabs %}
{% tab title="Request" %}

```javascript
const axios = require('axios');

const data = JSON.stringify({
  "transaction_ref": "a4de3f3f-668f-4844-995a-03ad1b73a54d",
  "transaction_hash": "0xETH"
});

const config = {
  method: 'post',
  url: 'https://api.getdefy.co/v2/travelrule/send_tx_hash',
  headers: { 
    'Content-Type': 'application/json', 
    'apikey': 'APIKEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endtab %}
{% endtabs %}

### List Available VASPs

<mark style="color:green;">`GET`</mark> `https://api.getdefy.co/v2/travelrule/list_vasps`

This service is listing available vasps for travel rule withdrawal.

{% tabs %}
{% tab title="Request" %}

```javascript
const axios = require('axios');

const config = {
  method: 'get',
  url: 'https://api.getdefy.co/v2/travelrule/list_vasps?page=1&limit=10',
  headers: { 
    'apikey': 'APIKEY'
  }
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": [
        {
            "uid": "acb4b639-3709-4571-a3cf-e3f2d3991421",
            "name": "BitPreco",
            "legal_name": "Cbtc Servicos Digitais LTDA",
            "country": "BR",
            "website": "https://bitpreco.com"
        },
        {
            "uid": "15291543-677a-4d1e-a147-e184a922be74",
            "name": "Buda",
            "legal_name": "SURBTC SpA",
            "country": "CL",
            "website": "https://www.buda.com/"
        },
        {
            "uid": "bfd1a0d0-4229-48dc-a671-befaed4efaaf",
            "name": "BTCC US",
            "legal_name": "BTCC USA Limited",
            "country": "US",
            "website": "https://www.btcc.com/en-US"
        },
        {
            "uid": "a9c9bed7-615a-4322-9ac6-fd57b7ac6b98",
            "name": "BTC Markets",
            "legal_name": "BTC Markets Pty Ltd",
            "country": "AU",
            "website": "https://www.btcmarkets.net"
        },
        {
            "uid": "1fa438e0-04ca-4f9d-92fb-463f2d8248e9",
            "name": "TOPBTC",
            "legal_name": null,
            "country": null,
            "website": "https://www.topbtc.com"
        },
        {
            "uid": "77a3a254-4a9f-45b5-a50a-e2621f8c56f1",
            "name": "BITPESA",
            "legal_name": "BTC AFRICA SA",
            "country": "KE",
            "website": "https://bitpesa.co"
        },
        {
            "uid": "9a515f3c-e6f9-4e58-ab17-f0de6a0ffff9",
            "name": "BTC-Alpha",
            "legal_name": "BTC-Alpha",
            "country": "GB",
            "website": "https://btc-alpha.com"
        },
        {
            "uid": "8588c632-8038-4f9e-a681-9036d7a055c1",
            "name": "BTCC.com",
            "legal_name": "BTCC Lithuania Limited UAB",
            "country": "LT",
            "website": "https://btcc.com"
        },
        {
            "uid": "57a9095a-ee48-46e5-b72c-2f4688f2dbb8",
            "name": "BtcTurk | Pro",
            "legal_name": "Eliptik Yazilim ve Ticaret",
            "country": "TR",
            "website": "https://pro.btcturk.com"
        },
        {
            "uid": "a86e5408-fb3b-42a6-9761-5dc8996b285e",
            "name": "BTCTurk",
            "legal_name": null,
            "country": "tr",
            "website": "https://webhook.site/ca1e089b-326a-4c7a-8511-6ca5e2756125"
        }
    ],
    "page_count": 3
}
```

{% endtab %}
{% endtabs %}

### Send Wallet Address

<mark style="color:green;">`POST`</mark> `https://api.getdefy.co/v2/travelrule/send_address`

This service is sending wallet address to us for travel rule protocol.

**Body**

| Name              | Type   | Description                                   |
| ----------------- | ------ | --------------------------------------------- |
| `transaction_ref` | string | Your transaction reference number. (Required) |
| `address`         | string | Wallet Address (Required)                     |

{% tabs %}
{% tab title="Request" %}

```javascript
const axios = require('axios');

const data = JSON.stringify({
  "transaction_ref": "a4de3f3f-668f-4844-995a-03ad1b73a54d",
  "address": "0x1d0d2d8c85441050abc9eb654399fa198fbd5722"
});

const config = {
  method: 'post',
  url: 'https://api.getdefy.co/v2/travelrule/send_address',
  headers: { 
    'Content-Type': 'application/json', 
    'apikey': 'APIKEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});
```

{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": null
}
```

{% endtab %}
{% endtabs %}

### Receive Transaction Without Protocol

<mark style="color:green;">`POST`</mark> `https://api.getdefy.co/v2/travelrule/receive_tx_without_protocol`

This service is there to allow you to receive a transaction when without protocol.

{% tabs %}
{% tab title="Request" %}

```javascript
const axios = require('axios');

const data = JSON.stringify({
  "transaction_ref": "a4de3f3f-668f-4844-995a-03ad1b73a51f",
  "transaction_asset": "ETH",
  "transaction_hash": "0xTest",
  "transaction_amount": "20000000000000000000",
  "transaction_asset_decimals": "18",
  "originator": {
    "persons": [
      {
        "naturalPerson": {
          "name": {
            "nameIdentifier": [
              {
                "primaryIdentifier": "Merve",
                "secondaryIdentifier": "Güler",
                "nameIdentifierType": "LEGL"
              }
            ]
          },
          "dateAndPlaceOfBirth": {
            "dateOfBirth": "1990-02-24",
            "placeOfBirth": "Singapore"
          },
          "nationalIdentification": {
            "nationalIdentifier": "12345678910",
            "nationalIdentifierType": "CCPT",
            "countryOfIssue": "TR"
          },
          "geographicAddress": [
            {
              "addressType": "GEOG",
              "streetName": "Potential Street",
              "buildingNumber": "123",
              "buildingName": "Cheese Hut",
              "postCode": "91361",
              "townName": "Thousand Oaks",
              "countrySubDivision": "California",
              "country": "US"
            }
          ],
          "customerIdentification": "01010101"
        }
      }
    ],
    "accountNumber": [
      "0x1d0d2d8c85441050abc9eb654399fa198fbd5722"
    ]
  },
  "beneficiary": {
    "persons": [
      {
        "naturalPerson": {
          "name": {
            "nameIdentifier": [
              {
                "primaryIdentifier": "Merve",
                "secondaryIdentifier": "Güler",
                "nameIdentifierType": "LEGL"
              }
            ]
          }
        }
      }
    ],
    "accountNumber": [
      "0x1d0d2d8c85441050abc9eb654399fa198fbd5722"
    ]
  },
  "created_at": "2025-02-10T14:16:03.544Z"
});

const config = {
  method: 'post',
  url: 'https://api.getdefy.co/v2/travelrule/receive_tx_without_protocol',
  headers: { 
    'apikey': 'APIKEY'
  },
  data : data
};

axios.request(config)
.then((response) => {
  console.log(JSON.stringify(response.data));
})
.catch((error) => {
  console.log(error);
});

```

{% endtab %}

{% tab title="Response" %}

```json
{
    "code": 0,
    "message": "OK",
    "data": "APPROVED"
}
```

{% endtab %}
{% endtabs %}

### Notes

* You need to enter the network parameter to get clearer data. If you do not enter the network parameter, we add the default network according to the wallet address.


# Supported Chains

This docs section provides the list of all chains available on services. Each chain in the list contains a short overview and the networks supported.

{% hint style="info" %}
***In addition to the networks we support, we support approximately 11,000 tokens.***
{% endhint %}

## Chains Supported

* Ethereum Mainnet
* Binance Smart Chain
* Polygon Mainnet (PoS)
* Avalanche C-Chain
* Bitcoin
* Tron Network
* Ripple
* Solana
* Cardano
* Dogecoin
* Stellar
* Sui
* Litecoin
* TON Network
* Polkadot
* Aptos
* VeChain
* Algorand
* Cosmos
* Arbitrum
* Optimism
* Tezos
* EOS

## Streaming Supported Chains

* Ethereum Mainnet
* Binance Smart Chain
* Polygon Mainnet (PoS)
* Avalanche C-Chain
* Bitcoin

## Live AML Supported Chains

* Ethereum Mainnet
* Binance Smart Chain
* Polygon Mainnet (PoS)
* Avalanche C-Chain
* Bitcoin

## KYT Supported Chains

* Ethereum Mainnet
* Binance Smart Chain
* Polygon Mainnet (PoS)
* Avalanche C-Chain
* Bitcoin
* Tron Network
* Ripple
* Solana

{% hint style="success" %}
**Tron Network** will be added for streaming and live anti money laundering.
{% endhint %}

## Chain Details

| Name                | Symbol   | Network Symbol |
| ------------------- | -------- | -------------- |
| Ethereum Mainnet    | **ETH**  | eth            |
| Binance Smart Chain | **BSC**  | bsc            |
| Polygon Mainnet     | **POL**  | polygon        |
| Avalanche C-Chain   | **AVAX** | avalanche      |
| Bitcoin             | **BTC**  | bitcoin        |
| Tron Network        | **TRX**  | trx            |
| Ripple              | **XRP**  | xrp            |
| Solana              | **SOL**  | solana         |
| Cordano             | **ADA**  | ada            |
| Dogecoin            | **DOGE** | doge           |
| Stellar             | **XLM**  | stellar        |
| Sui                 | **SUI**  | sui            |
| Litecoin            | **LTC**  | litecoin       |
| TON Network         | **TON**  | ton            |
| Polkadot            | **DOT**  | dot            |
| Aptos               | **APT**  | apt            |
| VeChain             | **VET**  | vet            |
| Algorand            | **ALGO** | algo           |
| Cosmos              | **ATOM** | atom           |
| Optimism            | **OP**   | op             |
| Arbitrum            | **ARB**  | arb            |
| Tezos               | **XTZ**  | xtz            |
| EOS                 | **EOS**  | eos            |

All APIs supports all requests.


