GithubHelp home page GithubHelp logo

oracle_price_api's Introduction

oracle_price_api-

Clone the project

$ git clone https://go.googlesource.com/example
$ cd example

ENV File

$ mv .env.exmaple .env
$ vi .env

Fill in the env variable. Params example attract below

RPC=https://mainnet.infura.io/v3/3630895f60c94b159c58e16c0680b93a
API_URL=https://min-api.cryptocompare.com/data/v2
API_KEY=26f21f23e74c9d8545fea88c2d5446811f9306dbd33b83c2cae4c83ec7fa9493

Docker

$ docker-compose up -d

To running with docker compose. Unit test will run automatic after built.

Test

$ go test

To running unit test local.

Run the project on local

$ go run main.go

The application will listen to 3000 port.

API Endpoint

External price API source only can provide 5000 minutes histroy.

Support coin: ETH, BTC, MATIC, BNB, LINK

Swagger

http://localhost:3000/swagger/index.html#/

Get Last Price of ETH

GET /lastPrice/ETH

Get Last Price of ETH with specific timestamp

GET /lastPrice/ETH/1666856160 //eg:time now -1800

Get token average price in a time range

POST /rangePrice
 {
    "token": "ETH",
    "from_time_stamp" : 1666850160, // eg:Time now - 1800s
    "to_time_stamp" : 1666856580 //eg: time now
}

oracle_price_api's People

Contributors

ccy1026 avatar

Stargazers

 avatar

Watchers

 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.