Initialization

Installation

To install the SDK, use npm or pnpm:

npm install @yelay-lite/sdk

or

pnpm add @yelay-lite/sdk

The SDK uses ethers.js v5.

Vaults and pools

Yelay has two types of vaults: test (on Base) and production (various chains)

  • Use test vaults on Base for testing transactions.

  • For real user funds, use production vaults only.

Test vaults are available on Base only, while production vaults are be deployed across multiple chains in addition to Base.

To retrieve actual vault addresses, use the getVaults() method.

Alternatively, see up-to-date addresses of deployed vaults across all chains here: https://github.com/YieldLayer/yelay-lite/tree/27a03d61f56fea92e4ab73d36fe401391dd20edd/deployments

To fetch pool IDs belonging to a vault, use the clientData() method.

Both methods are described here: 🔗 Yelay SDK Supportive Methods

Initialising the SDK

To start using the SDK, initialize it with an Ethereum signer or provider and a chain ID.

For Test Use

Ensure you pass the third parameter as true to initialize access to test vaults instead of production vaults.

import { Signer } from 'ethers';
import { Provider } from '@ethersproject/abstract-provider';
import { YelayLiteSdk } from '@yelay-lite/sdk';

const signerOrProvider: Signer | Provider = /* Your signer or provider */;
const chainId = 8453; // Supported chain ID

const sdk = new YelayLiteSdk(signerOrProvider, chainID, true);

For Production Use

Initialize the SDK with an Ethereum signer or provider and a chain ID:

import { Signer } from 'ethers';
import { Provider } from '@ethersproject/abstract-provider';
import { YelayLiteSdk, sdkConfig } from '@yelay-lite/sdk';

const signerOrProvider: Signer | Provider = /* Your signer or provider */;
const chainId = 8453; // Supported chain ID

const sdk = new YelayLiteSdk(signerOrProvider, chainId);

Last updated