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

var axios = require('axios');

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

// Delete Wallet Streaming
axios.delete('https://api.getdefy.co/outsource/stream/delete', {
    params: {
      address: '0x787970ad122d5947579e613c2464d9540081b46f',
      key: 'API_KEY'
    },
  })
  .then(function (response) {
    console.log(JSON.stringify(response.data));
  })
  .catch(function (error) {
    console.log(error);
  });

// List Streamed Walllets
axios.get('https://api.getdefy.co/v1/outsource/list', {
    params: {
      key: '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.

  • key (required): API key for requests.

  • 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

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

{
  "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.

Create Streaming

POST https://api.getdefy.co/outsource/stream/create

Query Parameters

{
  "message": "Error Message",
  "status": 500
}

Delete Streaming

DELETE https://api.getdefy.co/outsource/stream/delete

Query Parameters

{
    "data": "OK"
}

List Streamed Wallets

GET https://api.getdefy.co/outsource/stream/list

Query Parameters

{
    "data": [
        {
            "address": "0x4f797d5e551b5dc25b68298c97d68aa24ddc49d4",
            "stream_webhook": "https://webhook.site/004315c0-f2e0-4c0d-be91-aa39c773e57d",
            "created_at": "2023-03-09T15:20:18.121Z"
        }
    ]
}

Last updated