Welcome to OracleFinder’s documentation!

Available Oracles

Provider Oracle address Adapters
Smartcontract.com TBA Unknown
OracleFinder.com TBA
  • CoinMarketCap
  • CryptoCompare

Adapters

CoinMarketCap

Overview

Adapter for use on Google Cloud Platform or AWS Lambda. Upload Zip and use trigger URL as bridge endpoint.

This adapter will work for the CoinMarketCap.com API, both free and paid.

Installation

npm install
Create ZIP:
zip -r cl-cmc.zip .

Create a cloud function in GCP or Lambda, and set the handler function according to the platform you are using.

  • GCP: gcpservice
  • AWS: handler

Note

Remember set the environment variable API_KEY to your CoinMarketCap API Key!

Test Cases (GCP/AWS test events)

Fail
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {}
}
Result:
{
        "jobRunID": "278c97ffadb54a5bbb93cfec5f7b5503",
        "status": "errored",
        "error": "Not a valid endpoint"
}
Pass
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "cryptocurrency",
                "path": "info",
                "symbol": "BTC"
        }
}
Result:
{
        "jobRunID": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "status": {
                        "timestamp": "2018-09-05T08:19:35.467Z",
                        "error_code": 0,
                        "error_message": null,
                        "elapsed": 4,
                        "credit_count": 1
                },
                "data": {
                        "BTC": {
                                "urls": {
                                        "website": [
                                                "https://bitcoin.org/"
                                        ],
                                        "twitter": [],
                                        "reddit": [
                                                "https://reddit.com/r/bitcoin"
                                        ],
                                        "message_board": [
                                                "https://bitcointalk.org"
                                        ],
                                        "announcement": [],
                                        "chat": [],
                                        "explorer": [
                                                "https://blockchain.info/",
                                                "https://live.blockcypher.com/btc/",
                                                "https://blockchair.com/bitcoin/blocks"
                                        ],
                                        "source_code": [
                                                "https://github.com/bitcoin/"
                                        ]
                                },
                                "logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png",
                                "id": 1,
                                "name": "Bitcoin",
                                "symbol": "BTC",
                                "slug": "bitcoin",
                                "date_added": "2013-04-28T00:00:00.000Z",
                                "tags": [
                                        "mineable"
                                ],
                                "category": "coin"
                        }
                }
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "cryptocurrency",
                "path": "map"
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "cryptocurrency",
                "path": "latest",
                "resource": "quotes",
                "id": "1,2",
                "convert": "GBP"
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "global-metrics",
                "path": "latest",
                "resource": "quotes"
        }
}

CryptoCompare

Overview

Adapter for use on Google Cloud Platform or AWS Lambda. Upload Zip and use trigger URL as bridge endpoint.

Installation

Build
npm install
Create ZIP:
zip -r cl-cc.zip .

Tip

You can use one of our precompiled ZIP files from Releases. Most recent release: cl-cc-aws-gcp.zip

Upload

Create a cloud function in GCP or Lambda, upload the ZIP file and set the handler function according to the platform you are using.

  • GCP: gcpservice
  • AWS: handler

Test Cases (GCP/AWS test events)

Fail
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {}
}
Result:
{
        "jobRunID": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "Response": "Error",
                "Message": "",
                "Type": 1,
                "Aggregated": false,
                "Data": [],
                "Path": "/data/",
                "ErrorsSummary": "Not implemented"
        }
}
Pass
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "price",
                "fsym": "ETH",
                "tsyms": "USD"
        }
}
Result:
{
        "jobRunID": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "USD": 285.58
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "price",
                "fsym": "ETH",
                "tsyms": "USD,EUR,JPY"
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "pricemulti",
                "fsyms": "BTC,ETH",
                "tsyms": "USD,EUR"
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "pricemultifull",
                "fsyms": "BTC,ETH",
                "tsyms": "USD,EUR"
        }
}
Event:
{
        "id": "278c97ffadb54a5bbb93cfec5f7b5503",
        "data": {
                "endpoint": "generateAvg",
                "fsym": "ETH",
                "tsym": "USD",
                "exchange": "Kraken"
        }
}

Indices and tables