npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@shapeshiftoss/investor-idle

v2.7.0

Published

An api layer for interaction with the ShapeShift Idle Router Contract and the Idle Vault contracts

Downloads

10

Readme

@shapeshiftoss/investor-idle

ShapeShift's Idle investor package.

Installation

yarn add @shapeshiftoss/investor-idle

Initialization

import { IdleVaultApi } from '@shapeshiftoss/investor-idle'

const api = new IdleVaultApi({
  adapter: adapters.byChainId(KnownChainIds.EthereumMainnet), // adapter is an ETH @shapeshiftoss/chain-adapters
  providerUrl: '<your eth node privider url>'
})
await api.initialize()

Functions

  • initialize
  • findAll
  • findByDepositVaultAddress
  • getGasPrice
  • getTxReceipt
  • checksumAddress
  • getVaultId
  • estimateApproveGas
  • approve
  • allowance
  • estimateDepositGas
  • deposit
  • estimateWithdrawGas
  • withdraw
  • balance
  • token
  • totalSupply
  • pricePerShare
  • apy

Examples


await api.initialize()

// (object)
await api.deposit({
  amountDesired: new BigNumber(10).times(`1e+18`), // 10 underlying tokens
  tokenContractAddress: '0xdef1cafe',
  vaultAddress: '0xdef1c4fe',
  userAddress: '0xdef1caf3',
  dryRun: false,
  wallet: HDWallet
})

// returns a string of the txid
//   '0x2d1e60192fe3f671ecb46d9165fdf2a03bd4a4fb8764dacc2a07c5df6307ac59'

// (object)
await api.deposit({
  amountDesired: new BigNumber(10).times(`1e+18`), // 10 underlying tokens
  tokenContractAddress: '0xdef1cafe',
  vaultAddress: '0xdef1c4fe',
  userAddress: '0xdef1caf3',
  dryRun: true,
  wallet: HDWallet
})
// When dryrun is true, it returns a string signed transaction
// '0xf86c0a85046c7cfe0083016dea94d1310c1e038bc12865d3d3997275b3e4737c6302880b503be34d9fe80080269fc7eaaa9c21f59adf8ad43ed66cf5ef9ee1c317bd4d32cd65401e7aaca47cfaa0387d79c65b90be6260d09dcfb780f29dd8133b9b1ceb20b83b7e442b4bfc30cb'

// (object)
await api.estimateDepositGas({
  amountDesired: new BigNumber(10).times(`1e+18`), // 10 underlying tokens
  tokenContractAddress: '0xdef1cafe',
  vaultAddress: '0xdef1c4fe',
  userAddress: '0xdef1caf3',
})
// returns a BigNumber of the gas estimate

// (object)
await api.apy({
  vaultAddress: '0xdef1cafe'
})
// returns a string of the net_apy for that vault
// '32.59'