Type: Balances
BalancesByWalletType
This type represents the balances returned by the Cede SDK for a given exchange instance.
type BalancesByWalletType = {
[walletType in WalletType]: {
[tokenSymbol: string]: {
freeBalance: number;
refFreeBalance: number;
usedBalance: number;
refUsedBalance: number;
totalBalance: number;
refTotalBalance: number;
};
};
};
walletType
-WalletType
The wallet type.tokenSymbol
-string
The token's symbol.freeBalance
-number
The balance able to be transfered, traded, sent without any action needed.refFreeBalance
-number
ThefreeBalance
value in american dollars.usedBalance
-number
The balance that is currently being used in open orders, loans, etc.refUsedBalance
-number
TheusedBalance
value in american dollars.totalBalance
-number
The total balance of the token.refTotalBalance
-number
ThetotalBalance
value in american dollars.
GetBalancesWithTokensResponse
This type represents the balances returned by the Cede SDK for a given exchange instance with token metadata.
type GetBalancesWithTokensResponse = {
[walletType in WalletType]: {
[tokenSymbol: string]: {
balance: BalancesByWalletType;
token: TokenWithMarketNetwork;
};
};
};
token
-TokenWithMarketNetwork
The token metadata.
SubAccountBalancesByWalletType
This type represents the balances returned by the Cede SDK for a given sub-account.
type SubAccountBalancesByWalletType = {
[walletType: string]: {
[tokenSymbol: string]: {
freeBalance: number;
refFreeBalance: number;
usedBalance: number;
refUsedBalance: number;
totalBalance: number;
refTotalBalance: number;
};
};
};
MainSubAccountsBalancesWithTokensResponse
This type represents the balances returned by the Cede SDK for a given exchange instance with token metadata.
type MainSubAccountsBalancesWithTokensResponse = {
main: BalancesWithTokens;
subAccounts: Record<string, BalancesWithTokens>;
};
type BalancesWithTokens = Partial<{
[walletType in WalletType]: {
[tokenSymbol: string]: {
balance: TokenBalanceTypes;
token: TokenWithMarketNetwork;
};
};
}>;
type TokenBalanceTypes = {
tokenName?: string;
freeBalance: number;
refFreeBalance: number;
usedBalance: number;
refUsedBalance: number;
totalBalance: number;
refTotalBalance: number;
marginBalance?: {
[symbol: string]: {
freeBalance: number;
totalBalance: number;
type: "base" | "quote";
};
};
};
main
-BalancesWithTokens
The main account balances with token metadata.subAccounts
-Record<string, BalancesWithTokens>
The sub-accounts balances with token metadata.token
-TokenWithMarketNetwork
The token metadata.