⛓️Getting Ecosystem Information
Request all available chains, bridges, and exchanges.
Get supported chains
Example
import { ShogunBalancesApiClient } from '@shogun-sdk/money-legos';
// Initialize the balances client
const balancesClient = new ShogunBalancesApiClient('YOUR_API_KEY');
// Check EVM wallet balances
const evmBalances = await balancesClient.getEvmWalletBalance('0x742d35Cc6634C0532925a3b844Bc454e4438f44e');
// Check Solana token balances
const solanaBalances = await balancesClient.getSolanaTokenBalances('your_solana_address');
// Get token price in USD
const tokenPrice = await balancesClient.getTokenUSDPrice(
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
1 // Ethereum mainnet
);
// Get token information
const tokenInfo = await balancesClient.getTokenInfo(
'0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH
1 // Ethereum mainnet
);
Get liquidity venues
Example
import { getLiquidityVenues } from '@{PLACEHOLDER}/sdk';
try {
//Request all supported liquidity venues
const venues = await getLiquidityVenues();
} catch (error) {
console.error('Error: ', error);
}
Get available pairs
Fetches a list of all supported pairs, including intrachain and interchain routes.
srcChain
(number, optional): Chain ID of the source chain.srcToken
(string, optional): The contract address of the source token.destChain
(number, optional): Chain ID of the destination chain.destToken
(string, optional): The contract address of the destination token.allowInterchain
(boolean, optional): Default isTrue
. Decides whether to include pairs that require interchain routing.excludeVenue
(string[], optional): Array of liquidity venues to be excluded from routing.excludeInterop
(string[], optional): Array of interoperability protocols to be excluded from routing.maxiVenue
(string[], optional): Give preference for some liquidity venues over others.maxiInterop
(string[], optional): Give preference for some interoperability protocols over others.
Example
import { getAvailableRoutes } from '@{PLACEHOLDER}/sdk';
//Request all available routes from BOOP on Arbitrum to PRESS on Solana
const routeRequest = {
srcChain: 42161,
srcToken: '0x13A7DeDb7169a17bE92B0E3C7C2315B46f4772B3',
destChain: 900,
destToken: 'FaZwrtepqwBf2TMHVaxRWt4U3Zjv4LxmcisQXYy1pump',
};
try {
const availableRoutes = await getAvailableRoutes(routeRequest);
} catch (error) {
console.error('Error: ', error);
}
We have additional guides you may find helpful for supplemental information when working with the SDK:
Last updated