Coder Social home page Coder Social logo

yoloswap's Introduction

YoloSwap

Available Scripts

npm run local

Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.

REACT_APP_ENV=local node server/server.js

Run the API in the development mode, the server is served in port 3002 http://localhost:3002

Available APIs

1. /getRate

(GET) Get rate for a token pair by source token symbol, destination token symbol & source amount.

Parameters:
Name Type Required Description Example
srcSymbol String True Source token symbol EOS
destSymbol String True Destination token symbol IQ
srcAmount Number True Source amount 1
Success Response Example:
{
    status: {
        code: 200,
        message: "success"
    },
    data: 1213.6497
}
Error Response Example:
{
    status: {
        code: 400,
        message: "ETH is not supported by our API"
    }
}
Response Description:
Name Type Description
status Object The object contains status of request response
code Number Response status code
message String Response message
data Number Rate of the requested token pair

2. /fetchMarketRates

(GET) Fetching data of all available tokens supported in YoloSwap with buyRate & sellRate by EOS and USD. Also, 24h change percentage is returned that is fetched by CoinGecko API.

Parameters: N/A
Success Response Example:
[
    {
        id: "everipedia",
        token: "IQ",
        sellRate: 0.0007356324881262499,
        buyRate: 0.0008239609195914479,
        sellRateUsd: 0.004963648581434881,
        buyRateUsd: 0.005559640874623752,
        usdChangePercentage: 15.04167,
        eosChangePercentage: 4.15766
    },
    {
        id: "infiniverse",
        token: "INF",
        sellRate: 0.0005288105514751468,
        buyRate: 0.0005922870393190274,
        sellRateUsd: 0.0035681264572248396,
        buyRateUsd: 0.003996431329462446,
        usdChangePercentage: 5.45594,
        eosChangePercentage: -4.38324
    }
]
Response Description:
Name Type Description
id String CoinGecko token ID
token String Token symbol
sellRate Number Sell rate by EOS
buyRate Number Buy rate by EOS
sellRateUsd Number Sell rate by USD
buyRateUsd Number Buy rate by USD
usdChangePercentage Number 24h change percentage by USD
eosChangePercentage Number 24h change percentage by EOS

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.