@shogun-sdk/money-legos
Version:
Shogun Money Legos: clients and types for quotes, memes, prices, balances, fees, validations, etc.
398 lines • 15.5 kB
TypeScript
import { Codex } from '@codex-data/sdk';
import { Token, TokenBalanceResults, TokenPrice } from '@shogun-sdk/money-legos';
import { Balance } from '../lib/codex.js';
/**
* Client for interacting with Shogun balances API
*/
export declare class ShogunBalancesApiClient {
readonly sdk: Codex;
constructor(apiKey: string);
/**
* Get EVM wallet balances across multiple chains
* @param address - Wallet address to check balances for
*/
getEvmWalletBalance(address: string): Promise<{
Balances: {
items: Balance[];
};
} | null>;
/**
* Get token balances with additional info like prices
* @param data - Balance data from getEvmWalletBalance
* @param walletAddress - Wallet address
* @param fallbackTokens - Optional fallback tokens to include
*/
getPortfolioTokens(data: Balance[], walletAddress: string, fallbackTokens?: {
tokenIn?: Token | null;
tokenOut?: Token | null;
}): Promise<TokenBalanceResults[]>;
/**
* Search for a token by symbol or address
* @param symbolOrAddress - Symbol or address to search for
*/
searchToken(symbolOrAddress: string): Promise<{
symbol: string | null | undefined;
address: string | undefined;
decimals: number | undefined;
chainId: number;
image: string | null | undefined;
name: string | null | undefined;
mcap: string | null | undefined;
}[]>;
/**
* Get Solana token balances for a wallet
* @param walletAddress - Solana wallet address
*/
getSolanaTokenBalances(walletAddress: string): Promise<TokenBalanceResults[]>;
/**
* Get USD price for a token
* @param tokenAddress - Token address
* @param chainId - Chain ID the token is on
*/
getTokenUSDPrice(tokenAddress: string, chainId: number): Promise<TokenPrice | null>;
/**
* Validate if an address is a valid Solana or EVM address
* @param address - Address to validate
*/
isValidAddress(address: string): boolean;
/**
* Search for a token by address
* @param options - Options for the search
*/
searchTokenByAddress(options: {
addresses: string[];
network?: number[];
}): Promise<({
__typename?: "TokenFilterResult";
buyCount1?: number | null;
buyCount4?: number | null;
buyCount5m?: number | null;
buyCount12?: number | null;
buyCount24?: number | null;
change1?: string | null;
change4?: string | null;
change5m?: string | null;
change12?: string | null;
change24?: string | null;
createdAt?: number | null;
high1?: string | null;
high4?: string | null;
high5m?: string | null;
high12?: string | null;
high24?: string | null;
holders?: number | null;
isScam?: boolean | null;
lastTransaction?: number | null;
liquidity?: string | null;
low1?: string | null;
low4?: string | null;
low5m?: string | null;
low12?: string | null;
low24?: string | null;
marketCap?: string | null;
priceUSD?: string | null;
quoteToken?: string | null;
sellCount1?: number | null;
sellCount4?: number | null;
sellCount5m?: number | null;
sellCount12?: number | null;
sellCount24?: number | null;
txnCount1?: number | null;
txnCount4?: number | null;
txnCount5m?: number | null;
txnCount12?: number | null;
txnCount24?: number | null;
uniqueBuys1?: number | null;
uniqueBuys4?: number | null;
uniqueBuys5m?: number | null;
uniqueBuys12?: number | null;
uniqueBuys24?: number | null;
uniqueSells1?: number | null;
uniqueSells4?: number | null;
uniqueSells5m?: number | null;
uniqueSells12?: number | null;
uniqueSells24?: number | null;
uniqueTransactions1?: number | null;
uniqueTransactions4?: number | null;
uniqueTransactions5m?: number | null;
uniqueTransactions12?: number | null;
uniqueTransactions24?: number | null;
volume1?: string | null;
volume4?: string | null;
volume5m?: string | null;
volume12?: string | null;
volume24?: string | null;
volumeChange1?: string | null;
volumeChange4?: string | null;
volumeChange5m?: string | null;
volumeChange12?: string | null;
volumeChange24?: string | null;
exchanges?: Array<{
__typename?: "Exchange";
address: string;
color?: string | null;
exchangeVersion?: string | null;
iconUrl?: string | null;
id: string;
name?: string | null;
networkId: number;
tradeUrl?: string | null;
} | null> | null;
pair?: {
__typename?: "Pair";
address: string;
createdAt?: number | null;
exchangeHash: string;
fee?: number | null;
id: string;
networkId: number;
tickSpacing?: number | null;
token0: string;
token1: string;
pooled?: {
__typename?: "PooledTokenValues";
token0?: string | null;
token1?: string | null;
} | null;
token0Data?: {
__typename?: "EnhancedToken";
address: string;
cmcId?: number | null;
createBlockNumber?: number | null;
createTransactionHash?: string | null;
createdAt?: number | null;
creatorAddress?: string | null;
decimals: number;
freezable?: string | null;
id: string;
isScam?: boolean | null;
mintable?: string | null;
name?: string | null;
networkId: number;
symbol?: string | null;
exchanges?: Array<{
__typename?: "Exchange";
address: string;
color?: string | null;
exchangeVersion?: string | null;
iconUrl?: string | null;
id: string;
name?: string | null;
networkId: number;
tradeUrl?: string | null;
}> | null;
info?: {
__typename?: "TokenInfo";
address: string;
circulatingSupply?: string | null;
cmcId?: number | null;
description?: string | null;
id: string;
imageBannerUrl?: string | null;
imageLargeUrl?: string | null;
imageSmallUrl?: string | null;
imageThumbUrl?: string | null;
isScam?: boolean | null;
name?: string | null;
networkId: number;
symbol: string;
totalSupply?: string | null;
} | null;
launchpad?: {
__typename?: "LaunchpadData";
completed?: boolean | null;
completedAt?: number | null;
completedSlot?: number | null;
graduationPercent?: number | null;
migrated?: boolean | null;
migratedAt?: number | null;
migratedPoolAddress?: string | null;
migratedSlot?: number | null;
poolAddress?: string | null;
} | null;
socialLinks?: {
__typename?: "SocialLinks";
bitcointalk?: string | null;
blog?: string | null;
coingecko?: string | null;
coinmarketcap?: string | null;
discord?: string | null;
email?: string | null;
facebook?: string | null;
github?: string | null;
instagram?: string | null;
linkedin?: string | null;
reddit?: string | null;
slack?: string | null;
telegram?: string | null;
twitch?: string | null;
twitter?: string | null;
website?: string | null;
wechat?: string | null;
whitepaper?: string | null;
youtube?: string | null;
} | null;
} | null;
token1Data?: {
__typename?: "EnhancedToken";
address: string;
cmcId?: number | null;
createBlockNumber?: number | null;
createTransactionHash?: string | null;
createdAt?: number | null;
creatorAddress?: string | null;
decimals: number;
freezable?: string | null;
id: string;
isScam?: boolean | null;
mintable?: string | null;
name?: string | null;
networkId: number;
symbol?: string | null;
exchanges?: Array<{
__typename?: "Exchange";
address: string;
color?: string | null;
exchangeVersion?: string | null;
iconUrl?: string | null;
id: string;
name?: string | null;
networkId: number;
tradeUrl?: string | null;
}> | null;
info?: {
__typename?: "TokenInfo";
address: string;
circulatingSupply?: string | null;
cmcId?: number | null;
description?: string | null;
id: string;
imageBannerUrl?: string | null;
imageLargeUrl?: string | null;
imageSmallUrl?: string | null;
imageThumbUrl?: string | null;
isScam?: boolean | null;
name?: string | null;
networkId: number;
symbol: string;
totalSupply?: string | null;
} | null;
launchpad?: {
__typename?: "LaunchpadData";
completed?: boolean | null;
completedAt?: number | null;
completedSlot?: number | null;
graduationPercent?: number | null;
migrated?: boolean | null;
migratedAt?: number | null;
migratedPoolAddress?: string | null;
migratedSlot?: number | null;
poolAddress?: string | null;
} | null;
socialLinks?: {
__typename?: "SocialLinks";
bitcointalk?: string | null;
blog?: string | null;
coingecko?: string | null;
coinmarketcap?: string | null;
discord?: string | null;
email?: string | null;
facebook?: string | null;
github?: string | null;
instagram?: string | null;
linkedin?: string | null;
reddit?: string | null;
slack?: string | null;
telegram?: string | null;
twitch?: string | null;
twitter?: string | null;
website?: string | null;
wechat?: string | null;
whitepaper?: string | null;
youtube?: string | null;
} | null;
} | null;
} | null;
token?: {
__typename?: "EnhancedToken";
address: string;
cmcId?: number | null;
createBlockNumber?: number | null;
createTransactionHash?: string | null;
createdAt?: number | null;
creatorAddress?: string | null;
decimals: number;
freezable?: string | null;
id: string;
isScam?: boolean | null;
mintable?: string | null;
name?: string | null;
networkId: number;
symbol?: string | null;
exchanges?: Array<{
__typename?: "Exchange";
address: string;
color?: string | null;
exchangeVersion?: string | null;
iconUrl?: string | null;
id: string;
name?: string | null;
networkId: number;
tradeUrl?: string | null;
}> | null;
info?: {
__typename?: "TokenInfo";
address: string;
circulatingSupply?: string | null;
cmcId?: number | null;
description?: string | null;
id: string;
imageBannerUrl?: string | null;
imageLargeUrl?: string | null;
imageSmallUrl?: string | null;
imageThumbUrl?: string | null;
isScam?: boolean | null;
name?: string | null;
networkId: number;
symbol: string;
totalSupply?: string | null;
} | null;
launchpad?: {
__typename?: "LaunchpadData";
completed?: boolean | null;
completedAt?: number | null;
completedSlot?: number | null;
graduationPercent?: number | null;
migrated?: boolean | null;
migratedAt?: number | null;
migratedPoolAddress?: string | null;
migratedSlot?: number | null;
poolAddress?: string | null;
} | null;
socialLinks?: {
__typename?: "SocialLinks";
bitcointalk?: string | null;
blog?: string | null;
coingecko?: string | null;
coinmarketcap?: string | null;
discord?: string | null;
email?: string | null;
facebook?: string | null;
github?: string | null;
instagram?: string | null;
linkedin?: string | null;
reddit?: string | null;
slack?: string | null;
telegram?: string | null;
twitch?: string | null;
twitter?: string | null;
website?: string | null;
wechat?: string | null;
whitepaper?: string | null;
youtube?: string | null;
} | null;
} | null;
} | null)[] | null | undefined>;
getTokenInfo(tokenAddress: string, chainId: number): Promise<import("@codex-data/sdk/dist/resources/graphql.js").TokenFilterResult>;
}
//# sourceMappingURL=shogun-balances-api-client.d.ts.map