Skip to main content

Function.FormattedBalance

function FormattedBalance(props: FormatedBalanceProps): string

A React component that formats and displays a balance.

Parameters

ParameterTypeDescription
propsFormatedBalancePropsThe properties for the FormattedBalance component.

Returns

string

The formatted balance.

Example

import { FormattedBalance } from "@keyban/sdk-react";
const MyComponent: React.FC = () => {
const balance = {
raw: BigInt(1000000000000000000),
decimals: 18,
symbol: "ETH",
isNative: true,
isFees: false,
};

return <div>Your balance: <FormattedBalance balance={balance} /></div>;
};