Git Product home page Git Product logo

fixer-adapter's Introduction

Chainlink Fixer External Adapter

This adapter has moved to our external adapters monorepo!

Input Params

  • base or from: The target currency to query (required)
  • quote or to: The currency to convert to (required)
  • endpoint: The endpoint to call (optional)
  • amount: The amount to convert (optional)

Output

{
 "jobRunID": "1",
 "data": {
  "success": true,
  "query": {
   "from": "GBP",
   "to": "JPY",
   "amount": 1
  },
  "info": {
   "timestamp": 1519328414,
   "rate": 148.972231
  },
  "historical": "",
  "date": "2018-02-22",
  "result": 148.972231
 },
 "result": 148.972231,
 "statusCode": 200
}

Install

yarn

Test

yarn test

Create the zip

zip -r cl-fixer.zip .

Docker

If you wish to use Docker to run the adapter, you can build the image by running the following command:

docker build . -t fixer-adapter

Then run it with:

docker run -p 8080:8080 -e API_KEY='YOUR_API_KEY' -it fixer-adapter:latest

Install to AWS Lambda

  • In Lambda Functions, create function
  • On the Create function page:
    • Give the function a name
    • Use Node.js 12.x for the runtime
    • Choose an existing role or create a new one
    • Click Create Function
  • Under Function code, select "Upload a .zip file" from the Code entry type drop-down
  • Click Upload and select the cl-fixer.zip file
  • Handler should remain index.handler
  • Add the environment variable (repeat for all environment variables):
    • Key: API_KEY
    • Value: Your_API_key
  • Save

Install to GCP

  • In Functions, create a new function, choose to ZIP upload
  • Click Browse and select the cl-fixer.zip file
  • Select a Storage Bucket to keep the zip in
  • Function to execute: gcpservice
  • Click More, Add variable (repeat for all environment variables)
    • NAME: API_KEY
    • VALUE: Your_API_key

fixer-adapter's People

Contributors

thodges-gh avatar boxhock avatar dependabot[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.