ghost-portal/packages/react-hooks/src/useStakingInfo.ts
2021-07-28 11:50:06 +02:00

13 lines
447 B
TypeScript

// Copyright 2017-2021 @polkadot/app-bounties authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveStakingAccount } from '@polkadot/api-derive/types';
import { useApi, useCall } from '@polkadot/react-hooks';
export function useStakingInfo (accountId: string | null): DeriveStakingAccount | undefined {
const { api } = useApi();
return useCall<DeriveStakingAccount>(api.derive.staking?.account, [accountId]);
}