Files
pezkuwi-apps/packages/page-staking/src/useIdentities.ts
T
pezkuwichain d21bfb1320 feat: initial Pezkuwi Apps rebrand from polkadot-apps
Rebranded terminology:
- Polkadot → Pezkuwi
- Kusama → Dicle
- Westend → Zagros
- Rococo → PezkuwiChain
- Substrate → Bizinikiwi
- parachain → teyrchain

Custom logos with Kurdistan brand colors (#e6007a → #86e62a):
- bizinikiwi-hexagon.svg
- sora-bizinikiwi.svg
- hezscanner.svg
- heztreasury.svg
- pezkuwiscan.svg
- pezkuwistats.svg
- pezkuwiassembly.svg
- pezkuwiholic.svg
2026-01-07 13:05:27 +03:00

31 lines
969 B
TypeScript

// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { DeriveHasIdentity } from '@pezkuwi/api-derive/types';
import { createNamedHook, useApi, useCall } from '@pezkuwi/react-hooks';
type Result = Record<string, DeriveHasIdentity>;
const OPT_CALL = {
transform: ([[validatorIds], hasIdentities]: [[string[]], DeriveHasIdentity[]]): Record<string, DeriveHasIdentity> => {
const result: Record<string, DeriveHasIdentity> = {};
for (let i = 0; i < validatorIds.length; i++) {
result[validatorIds[i]] = hasIdentities[i];
}
return result;
},
withParamsTransform: true
};
function useIdentitiesImpl (validatorIds: string[] = []): Result | undefined {
const { api } = useApi();
const allIdentity = useCall<Result>(api.derive.accounts.hasIdentityMulti, [validatorIds], OPT_CALL);
return allIdentity;
}
export default createNamedHook('useIdentities', useIdentitiesImpl);