New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

weaverfi

Package Overview
Dependencies
Maintainers
2
Versions
115
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weaverfi

The NPM package to query DeFi.

  • 1.38.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
37
decreased by-61.05%
Maintainers
2
Weekly downloads
 
Created
Source

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';

Keywords

FAQs

Package last updated on 22 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc