open-index/open-npm huggingface dataset:
npm package: @shapeshiftoss/investor-foxy
Description: An API layer for interaction with the ShapeShift FOXy contract
Latest version: 8.0.1

# @shapeshiftoss/investor-foxy

ShapeShift's Yearn investor package.

## Installation

```bash
yarn add @shapeshiftoss/investor-foxy
```

## Initialization

```javascript
import { FoxyApi } from '@shapeshiftoss/investor-foxy'
import { toChainId, CHAIN_NAMESPACE, CHAIN_REFERENCE } from '@shapeshiftoss/caip'

const api = new FoxyApi({
  adapter: await adapterManager.byChainId(
    toChainId({ chainNamespace: CHAIN_NAMESPACE.Evm, chainReference: CHAIN_REFERENCE.EthereumMainnet })
  ), // adapter is an ETH @shapeshiftoss/chain-adapters
  providerUrl: '<your eth node privider url>'
})
```

### Functions

- getFoxyOpportunities
- getFoxyOpportunityByStakingAddress
- getGasPrice
- getTxReceipt
- checksumAddress
- estimateClaimWithdrawGas
- estimateSendWithdrawalRequestsGas
- estimateAddLiquidityGas
- estimateRemoveLiquidityGas
- estimateWithdrawGas
- estimateInstantWithdrawGas
- estimateDepositGas
- estimateApproveGas
- approve
- allowance
- deposit
- withdraw
- instantWithdraw
- claimWithdraw
- sendWithdrawalRequests
- addLiquidity
- removeLiquidity
- getTimeUntilClaimable
- balance
- totalSupply
- pricePerShare
- apy
- tvl

### Examples

For more in-depth examples, check out ./src/foxycli.ts

```javascript
const api = new FoxyApi({
  adapter: await adapterManager.byChainId(
    toChainId({ chainNamespace: CHAIN_NAMESPACE.Evm, chainReference: CHAIN_REFERENCE.EthereumMainnet })
  ),
  providerUrl: 'https://dev-api.ethereum.shapeshift.com'
})

await api.approve({
  tokenContractAddress, // FOX address
  contractAddress, // Staking contract address
  userAddress, // User's wallet address
  wallet // HDWallet
})

await api.deposit({
  contractAddress, // Staking contract address
  amountDesired, // Amount to stake
  userAddress, // User's wallet address
  wallet // HDWallet
})

await api.withdraw({
  contractAddress, // Staking contract address
  amountDesired, // Amount to unstake
  userAddress, // User's wallet address
  wallet // HDWallet
})
```
npm package: @shapeshiftoss/investor-idle
Description: An api layer for interaction with the ShapeShift Idle Router Contract and the Idle Vault contracts
Latest version: 2.7.0

# @shapeshiftoss/investor-idle

ShapeShift's Idle investor package.

## Installation

```bash
yarn add @shapeshiftoss/investor-idle
```

## Initialization

```javascript
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
```javascript

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'
```
npm package: @shapeshiftoss/investor-yearn
Description: An api layer for interaction with the ShapeShift Yearn Router Contract and the Yearn Vault contracts
Latest version: 6.4.4

# @shapeshiftoss/investor-yearn

ShapeShift's Yearn investor package.

## Installation

```bash
yarn add @shapeshiftoss/investor-yearn
```

## Initialization

```javascript
import { YearnVaultApi } from '@shapeshiftoss/investor-yearn'

const api = new YearnVaultApi({
  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
```javascript

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