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
This commit is contained in:
2026-01-07 13:05:27 +03:00
commit d21bfb1320
5867 changed files with 329019 additions and 0 deletions
@@ -0,0 +1,68 @@
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Option, StorageKey, u64 } from '@pezkuwi/types';
import type { PalletBagsListListBag } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
import type { BagInfo } from './types.js';
import { useEffect, useState } from 'react';
import { createNamedHook, useCall, useMapKeys } from '@pezkuwi/react-hooks';
import { BN_ZERO } from '@pezkuwi/util';
import useQueryModule from './useQueryModule.js';
const KEY_OPTS = {
transform: (keys: StorageKey<[u64]>[]): BN[] =>
keys.map(({ args: [id] }) => id)
};
const MULTI_OPTS = {
transform: ([[ids], opts]: [[BN[]], Option<PalletBagsListListBag>[]]): BagInfo[] => {
const sorted = ids
.map((id, index): [BN, Option<PalletBagsListListBag>] => [id, opts[index]])
.filter(([, o]) => o.isSome)
.sort(([a], [b]) => b.cmp(a))
.map(([bagUpper, o], index): BagInfo => ({
bagLower: BN_ZERO,
bagUpper,
index,
info: o.unwrap(),
key: bagUpper.toString()
}));
return sorted.map((entry, index) =>
(index === (sorted.length - 1))
? entry
// We could probably use a .add(BN_ONE) here
: { ...entry, bagLower: sorted[index + 1].bagUpper }
);
},
withParamsTransform: true
};
function merge (prev: BagInfo[] | undefined, curr: BagInfo[]): BagInfo[] {
return !prev || curr.length !== prev.length
? curr
: curr.map((q, i) =>
JSON.stringify(q) === JSON.stringify(prev[i])
? prev[i]
: q
);
}
function useBagsListImpl (): BagInfo[] | undefined {
const mod = useQueryModule();
const [result, setResult] = useState<BagInfo[] | undefined>();
const ids = useMapKeys(mod.listBags, [], KEY_OPTS);
const query = useCall(ids && ids.length !== 0 && mod.listBags.multi, [ids], MULTI_OPTS);
useEffect((): void => {
query && setResult((prev) => merge(prev, query));
}, [query]);
return result;
}
export default createNamedHook('useBagsList', useBagsListImpl);