ghost-portal/packages/react-hooks/src/useStakingInfo.ts
Jaco 32a25009f5
Cleanup file headers (some mis-named locations) (#8789)
* Cleanup file headers (some mis-named locations)

* Update packages/page-council/src/Motions/Motion.tsx
2023-01-14 08:43:40 +02:00

17 lines
597 B
TypeScript

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