Giter Club home page Giter Club logo

bsc-api's Introduction

BSC API

Binance Smart Chain On-Chain API (Live example)

Contracts

API Contract:

Autofarm Proxy:

Pancakeswap Proxy:

Pancakeswap Proxy V2:

Configuration

API first argument is key for accessing proxies:

  • Autofarm Proxy under auto key
  • Pancakeswap Proxy under cake key
  • Pancakeswap Proxy V2 under cake2 key

Autofarm CAKE Vault pid is 7 (full list available on Autofarm Vault contract)

Pancakeswap CAKE Pool pid is 0 (full list available on Pancakeswap Pool contract)

Pancekeswap V2 does not use pids for Pool (first argument can be omitted)

Example usage

Check balance of CAKE token:

address = 0x...
BscApi.getBalance("cake", address)

Get staked CAKE tokens:

cakePoolPid = 0
address = 0x...
BscApi.getStaked("cake", cakePoolPid, address)

Get pending AUTO tokens:

cakeVaultPid = 7
address = 0x...
BscApi.getPending("auto", cakeVaultPid, address)

Get balance, staked and pending for CAKE:

cakePoolPid = 0
address = 0x...
BscApi.get("cake", cakePoolPid, address)

Get balance, staked and pending for CAKE V2:

pid = 0 (is not used)
address = 0x...
BscApi.get("cake2", pid, address)

Read contract

Test it on Etherscan

Example implementation

With Ethers.js

bsc-api's People

Contributors

mc01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

linscomt

bsc-api's Issues

latest

hi is it possible with this api to retrieve newst tokens?

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.