Skip to main content

TypeAlias.Balance

type Balance = {
decimals?: number;
isFees?: boolean;
isNative?: boolean;
raw: string | bigint;
symbol?: string;
};

Represents a balance with optional metadata.

Example​

const balance: Balance = { raw: 1_000_000_000_000_000_000n, decimals: 18, symbol: "ETH", isNative: true };
const tokenBalance: Balance = { raw: 500_000_000_000_000_000n, decimals: 18, symbol: "DAI" };

Properties​

PropertyTypeDescription
decimals?numberThe number of decimal places for the balance.
isFees?booleanIndicates if the balance is used for fees.
isNative?booleanIndicates if the balance is in the native currency.
rawstringbigint
symbol?stringThe symbol of the currency.