mirror of
https://github.com/lux-tel/websites.git
synced 2026-10-30 20:31:36 +00:00
18 lines
617 B
TypeScript
18 lines
617 B
TypeScript
import { getTotalStakedAmountForAddress } from '@/components/getTotalStakedAmountForAddress';
|
|
import { SENT_DECIMALS } from '@session/contracts';
|
|
import { formatSENTBigInt } from '@session/contracts/hooks/Token';
|
|
import type {
|
|
ContributionContractContributor,
|
|
StakeContributor,
|
|
} from '@session/staking-api-js/schema';
|
|
|
|
export const getTotalStakedAmountForAddressFormatted = (
|
|
contributors: Array<StakeContributor | ContributionContractContributor>,
|
|
address?: string
|
|
): string => {
|
|
return formatSENTBigInt(
|
|
address ? getTotalStakedAmountForAddress(contributors, address) : 0n,
|
|
SENT_DECIMALS
|
|
);
|
|
};
|