Skip to content

Latest commit

 

History

History
210 lines (170 loc) · 6.84 KB

File metadata and controls

210 lines (170 loc) · 6.84 KB

Chainlink External Adapters for BTC.com

1.3.33 v2

Base URL https://chain.api.btc.com

This document was generated automatically. Please see README Generator for more info.

Known Issues

MAX_PAYLOAD_SIZE_LIMIT configuration

The MAX_PAYLOAD_SIZE_LIMIT environment variable is used for controlling the maximum size of the incoming request body that the EA can handle. If you decide to customize this value it's essential to ensure that any reverse proxy or web server in front of the EA, such as Nginx, is also configured with a corresponding limit. This alignment prevents scenarios where Nginx rejects a request for exceeding its payload size limit before it reaches the EA.

Environment Variables

Required? Name Description Type Options Default
API_ENDPOINT string https://chain.api.btc.com

Data Provider Rate Limits

Name Requests/credits per second Requests/credits per minute Requests/credits per hour Note
default 1

Input Parameters

Every EA supports base input parameters from this list

Required? Name Description Type Options Default
endpoint The endpoint to use string balance, difficulty, height balance

Balance Endpoint

Address

balance is the only supported name for this endpoint.

Input Params

Required? Name Aliases Description Type Options Default Depends On Not Valid With
addresses Array of objects with address information as defined below array
confirmations Confirmations parameter number 6
dataPath Path where to find the addresses array string result

Address objects within addresses have the following properties:

Required? Name Description Type Options Default
address Address to query string
chain Chain to query (Ethereum testnet is Rinkeby) string mainnet, testnet mainnet
coin Currency to query string Ex. bch, btc, btsv, eth, ltc, zec btc

Example

Request:

{
  "id": "1",
  "data": {
    "dataPath": "addresses",
    "addresses": [
      {
        "address": "3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1",
        "coin": "btc"
      }
    ],
    "endpoint": "balance"
  },
  "debug": {
    "cacheKey": "Cb2Iad6Ved2MBSrLzAhVjL4uDSY="
  }
}

Response:

{
  "jobRunID": "1",
  "statusCode": 200,
  "data": {
    "responses": [
      {
        "data": {
          "address": "3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1",
          "received": 357176196514,
          "sent": 357176196514,
          "balance": 0,
          "tx_count": 63,
          "unconfirmed_tx_count": 0,
          "unconfirmed_received": 0,
          "unconfirmed_sent": 0,
          "unspent_tx_count": 0,
          "first_tx": "d542926e85a98302a1b3af88a88ae55364696f230ea909e45fe20ce0fefe33d1",
          "last_tx": "4df75d3ef0f0e13cfd00625ded80b278e76475d4a73884d245edcb42c2814556"
        },
        "err_code": 0,
        "err_no": 0,
        "message": "success",
        "status": "success"
      }
    ],
    "result": [
      {
        "address": "3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1",
        "coin": "btc",
        "chain": "mainnet",
        "balance": "0"
      }
    ]
  },
  "result": [
    {
      "address": "3EyjZ6CtEZEKyc719NZMyWaJpJG5jsVJL1",
      "coin": "btc",
      "chain": "mainnet",
      "balance": "0"
    }
  ]
}

Block Endpoint

Block

Supported names for this endpoint are: difficulty, height.

Input Params

There are no input parameters for this endpoint.

Example

Request:

{
  "id": "1",
  "data": {
    "endpoint": "difficulty",
    "resultPath": "difficulty"
  },
  "debug": {
    "cacheKey": "6W28xrdH7o4fj8edEEzQUhcwOLw="
  }
}

Response:

{
  "jobRunID": "1",
  "data": {
    "data": {
      "height": 709857,
      "version": 671080448,
      "mrkl_root": "a5b2db5e74c9f1866e3a62eae4bc645471b8ecc6fea8c452dace91d63e3836b9",
      "timestamp": 1636991861,
      "bits": 386689514,
      "nonce": 1647131200,
      "hash": "0000000000000000000964f8c9ae099170b0b1dfe6b3bf1a82edf15db1d2a847",
      "prev_block_hash": "00000000000000000000a750aef6a001b1b4f2202d46990700412f5fb59bf32f",
      "next_block_hash": "0000000000000000000000000000000000000000000000000000000000000000",
      "size": 1218365,
      "pool_difficulty": 29961509697911,
      "difficulty": 22674148233453,
      "difficulty_double": 22674148233453.105,
      "tx_count": 1771,
      "reward_block": 625000000,
      "reward_fees": 4006745,
      "confirmations": 1,
      "is_orphan": false,
      "curr_max_timestamp": 1636991861,
      "is_sw_block": true,
      "stripped_size": 716583,
      "sigops": 10655,
      "weight": 3368114,
      "extras": {
        "pool_name": "Binance Pool",
        "pool_link": "https://pool.binance.com/"
      }
    },
    "err_code": 0,
    "err_no": 0,
    "message": "success",
    "status": "success",
    "result": 22674148233453
  },
  "result": 22674148233453,
  "statusCode": 200,
  "providerStatusCode": 200
}

MIT License