mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-08-02 20:35:39 +00:00
c71ddb6e0d
- Clone Polkadot.js Apps repository - Update package.json with Pezkuwi branding - Add Pezkuwi endpoint to production chains (wss://pezkuwichain.app:9944) - Create comprehensive README for SDK UI - Set up project structure with all packages Next steps: - Apply Kurdistan colors (Kesk, Sor, Zer, Spi + Black) to UI theme - Replace logos with Pezkuwi branding - Test build and deployment
31 lines
972 B
TypeScript
31 lines
972 B
TypeScript
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { DeriveHasIdentity } from '@polkadot/api-derive/types';
|
|
|
|
import { createNamedHook, useApi, useCall } from '@polkadot/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);
|