8.0.1 • Published 1 year ago

@shapeshiftoss/investor-foxy v8.0.1

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

@shapeshiftoss/investor-foxy

ShapeShift's Yearn investor package.

Installation

yarn add @shapeshiftoss/investor-foxy

Initialization

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

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
})
8.0.1

1 year ago

7.1.3

1 year ago

7.1.2

1 year ago

7.1.1

1 year ago

8.0.0

1 year ago

7.1.0

1 year ago

7.0.4

1 year ago

7.0.3

1 year ago

7.0.0

2 years ago

7.0.2

2 years ago

7.0.1

2 years ago

6.1.0

2 years ago

6.1.2

2 years ago

6.1.1

2 years ago

5.0.1

2 years ago

5.0.0

2 years ago

6.0.0

2 years ago

4.0.5

2 years ago

4.0.4

2 years ago

4.0.7

2 years ago

4.0.6

2 years ago

4.0.1

2 years ago

4.0.3

2 years ago

4.0.2

2 years ago

4.0.8

2 years ago

4.1.0

2 years ago

4.1.1

2 years ago

1.4.6

2 years ago

1.4.5

2 years ago

1.4.4

2 years ago

1.5.1

2 years ago

1.5.0

2 years ago

2.0.0

2 years ago

3.4.0

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.1

2 years ago

3.4.2

2 years ago

3.4.1

2 years ago

3.0.0

2 years ago

4.0.0

2 years ago

1.4.3

2 years ago

1.3.4

2 years ago

1.4.2

2 years ago

1.3.3

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1-canary1

2 years ago

1.2.0

2 years ago

1.1.1

2 years ago

1.3.1-canary

2 years ago

1.3.1-canary3

2 years ago

1.3.1-canary-1

2 years ago

1.3.1-canary5

2 years ago

1.3.2

2 years ago

1.3.1-canary4

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.1

2 years ago

1.1.0

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago