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"
        }
}