Page cover

Wallet Integration

Example code + mini tutorial showing Portfolio and Transactional integrations with Vaults.fyi

The example will:

  • Check user balances (idle assets) and display them in a formatted table

  • Display the best deposit options filtered for USDC/USDS only

  • Generate a transactional payload for depositing into a vault that includes optional deposit fee for wallets

  • Show all user positions across different vaults

Run the tutorial code

  1. Clone or download tutorial code

git clone https://github.com/WallfacerLabs/js-examples.git

  1. Create virtual environment and install dependencies:

cd js_examples/
npm install

  1. Set your API key as an environment variable:

export VAULTS_FYI_API_KEY="your_api_key_here"

Run

npm run wallet_integration

Step by step

1. SDK Initialization

2. Viewing User Balances

3. Finding Best Deposit Options

4. Generating Deposit Transactions

5. Viewing User Positions

Last updated