Add Pezkuwi SDK UI - Polkadot.js Apps clone

- 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
This commit is contained in:
Claude
2025-11-14 00:55:17 +00:00
parent c48ded7ff2
commit c71ddb6e0d
5836 changed files with 324981 additions and 17 deletions
@@ -0,0 +1,57 @@
// Copyright 2017-2025 @polkadot/react-hooks authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { AugmentedEvent } from '@polkadot/api/types';
import type { Vec } from '@polkadot/types';
import type { EventRecord } from '@polkadot/types/interfaces';
import { useEffect, useState } from 'react';
import { createNamedHook } from './createNamedHook.js';
import { useApi } from './useApi.js';
import { useCall } from './useCall.js';
import { useIsMountedRef } from './useIsMountedRef.js';
import { useMemoValue } from './useMemoValue.js';
export type EventCheck = AugmentedEvent<'promise'> | false | undefined | null;
interface Result {
blockHash: string;
events: EventRecord[];
}
const EMPTY_RESULT: Result = {
blockHash: '',
events: []
};
const IDENTITY_FILTER = () => true;
function useEventTriggerImpl (checks: EventCheck[], filter: (record: EventRecord) => boolean = IDENTITY_FILTER): Result {
const { api } = useApi();
const [state, setState] = useState(() => EMPTY_RESULT);
const memoChecks = useMemoValue(checks);
const mountedRef = useIsMountedRef();
const eventRecords = useCall<Vec<EventRecord>>(api.query.system.events);
useEffect((): void => {
if (mountedRef.current && eventRecords) {
const events = eventRecords.filter((r) =>
r.event &&
memoChecks.some((c) => c && c.is(r.event)) &&
filter(r)
);
if (events.length) {
setState({
blockHash: eventRecords.createdAtHash?.toHex() || '',
events
});
}
}
}, [eventRecords, filter, memoChecks, mountedRef]);
return state;
}
export const useEventTrigger = createNamedHook('useEventTrigger', useEventTriggerImpl);