Type: Balances
Every balance is represented by a PortfolioBalanceEntry object:
type PortfolioBalanceEntry = {
tokenName?: string;
freeBalance: string;
refFreeBalance: string;
usedBalance: string;
refUsedBalance: string;
totalBalance: string;
refTotalBalance: string;
marginBalance?: {
[symbol: string]: {
freeBalance: string;
totalBalance: string;
type: "base" | "quote";
};
};
};BalancesByWalletTypeV2
This type represents the balances returned by the Cede SDK for a given exchange instance.
type BalancesByWalletTypeV2 = {
[walletType: string]: {
[tokenSymbol: string]: PortfolioBalanceEntry;
};
};walletType-string
The wallet type, one value fromWalletType.tokenSymbol-string
The token's symbol.freeBalance-number
The balance able to be transfered, traded, sent without any action needed.refFreeBalance-number
ThefreeBalancevalue in american dollars.usedBalance-number
The balance that is currently being used in open orders, loans, etc.refUsedBalance-number
TheusedBalancevalue in american dollars.totalBalance-number
The total balance of the token.refTotalBalance-number
ThetotalBalancevalue in american dollars.
BalancesWithTokensV2
This type represents the balances returned by the Cede SDK for a given exchange instance with token metadata.
type BalancesWithTokensV2 = Partial<{
[walletType: string]: {
[tokenSymbol: string]: {
balance: PortfolioBalanceEntry;
token: TokenWithMarketNetwork;
};
};
}>;token-TokenWithMarketNetwork
The token metadata.
SubAccountBalancesByWalletTypeV2
This type represents the balances returned by the Cede SDK for a given sub-account.
type SubAccountBalancesByWalletTypeV2 = {
[walletType: string]: {
[tokenSymbol: string]: PortfolioBalanceEntry;
};
};MainSubAccountsBalancesWithTokensResponseV2
This type represents the balances returned by the Cede SDK for a given exchange instance with token metadata.
type MainSubAccountsBalancesWithTokensResponseV2 = {
main: BalancesWithTokensV2;
subAccounts: Record<string, BalancesWithTokensV2>;
};main-BalancesWithTokensV2
The main account balances with token metadata.subAccounts-Record<string, BalancesWithTokensV2>
The sub-accounts balances with token metadata.