The main client for interacting with the Steer Protocol. This client provides access to vault operations and smart rewards functionality.

import { createPublicClient, createWalletClient, http } from 'viem';
import { mainnet } from 'viem/chains';
import { SteerClient } from '@steerprotocol/sdk';

// Create viem clients
const publicClient = createPublicClient({
chain: mainnet,
transport: http()
});

const walletClient = createWalletClient({
chain: mainnet,
transport: http()
});

// Initialize the Steer client
const steerClient = new SteerClient({
environment: 'production',
client: publicClient,
walletClient: walletClient
});

// Use vault operations
const vaults = await steerClient.vaults.getLatestVaults();

// Use rewards functionality
const campaigns = await steerClient.rewards.getCampaigns(1);
const summary = await steerClient.rewards.getRewardSummary(userAddress, chainId);

Hierarchy (View Summary)

Constructors

Properties

vaults: VaultClient

The vault client instance for interacting with Steer vaults

rewards: SmartRewardsClient

The rewards client instance for interacting with Smart Rewards

staking: StakingClient

The staking client instance for interacting with staking pools

Methods

  • Checks if a chain is supported by checking if it has a subgraph URL

    Parameters

    • chainId: number

      The chain ID to check

    Returns boolean

    boolean indicating if the chain is supported

  • Gets the active chain ID from the client

    Type Parameters

    • T

    Returns Promise<SteerResponse<T>>

    A promise that resolves to the active chain ID

    Error if no active chain is found

    const chainId = await steerClient.getActiveChain();
    console.log(chainId.data); // e.g., 1 for Ethereum mainnet