Code Monkey home page Code Monkey logo

cookietrack-api's Introduction

WeaverFi Banner

The NPM package to query DeFi.

CodeQL Version Downloads

NodeJS TypeScript

Contributing

Contribution guidelines can be found here.

Usage

Install the package using the following:

npm i weaverfi

Importing the package can be done through the following:

import weaver from 'weaverfi'

Other options to suit different app configurations:

import WeaverFi from 'weaverfi'
import { WeaverFi } from 'weaverfi'
const weaver = require('weaverfi').default

The WeaverFi object (or weaver if you prefer to import it that way) contains some global methods such as WeaverFi.getAllProjects(), WeaverFi.getAllTokens() or WeaverFi.getAllTokenPrices().

Each supported chain has its own methods that can be used as WeaverFi.eth.getWalletBalance(wallet), for example.

Global Methods Available

  • getAllChains()
  • getAllChainInfo()
  • getAllProjects()
  • getAllTokens()
  • getAllTokenPrices()
  • getNativeTokenPrices()
  • checkPrices()
  • getAllBalances(wallet)

Chain Methods Available

  • query(address, abi, method, args)
  • queryBlocks(address, abi, event, querySize, args)
  • isAddress(address)
  • getTXCount(address)
  • getWalletBalance(wallet)
  • getProjectBalance(wallet, project)
  • getAllProjectBalances(wallet)
  • getNFTBalance(wallet)
  • getTokens()
  • getTokenLogo(symbol)
  • getGasEstimates()
  • getInfo()
  • getProjects()
  • getTokenPrices()
  • getTokenPrice(address, decimals)
  • updateTokenPrice(priceData)
  • checkPrices()
  • setCustomRpcEndpoints(rpcs)
  • getProviders()

The ETH chain also contains the resolveENS(name), lookupENS(address) and fetchAvatarENS(name) methods.

Chains Supported

  • ETH (Ethereum)
  • BSC (Binance Smart Chain)
  • POLY (Polygon)
  • FTM (Fantom)
  • AVAX (Avalanche)
  • CRONOS (Cronos)
  • OP (Optimism)
  • ARB (Arbitrum)

Types

The WeaverFi package also exports its typings, found in the types.ts file.

If needed, these can be imported as follows:

import type { ChainID, Address, Token } from 'weaverfi';

cookietrack-api's People

Contributors

boujefi avatar djbears32 avatar hplightcorner avatar ncookiez avatar trmid avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cookietrack-api's Issues

Template Route

Make a template route for contributors to have an easier time deploying new endpoints.

Multicall Implementation

By utilizing multicall contracts we can potentially lower the number of calls needed to be made in order to get user balances or any other on-chain info.

Maybe a package like this could help.

Roco

Add support for Roco.

  • ETH
  • BSC
  • AVAX

CREAM

Add support for CREAM.

  • ETH
  • BSC
  • POLY
  • FTM
  • AVAX

Beefy

Add support for Beefy.

  • BSC
  • POLY
  • FTM
  • AVAX
  • ONE

Curve

Add support for Curve.

  • ETH
  • POLY
  • FTM
  • AVAX
  • ONE

Contribution Guidelines

Add a CONTRIBUTING.md file with guidelines, as well as any other community-centered documentation for future contributors.

RPC Fallback

Have a fallback RPC in case there are any RPC errors.

Aave

Add support for Aave.

  • ETH
  • POLY
  • AVAX

Aave V3:

  • POLY
  • FTM
  • AVAX
  • ONE

Migrate Routes

All the routes for dapps from the old repository need to be migrated into the new format.

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.