fix: update extension packages and fix type compatibility for pezkuwi-sdk

- Update @pezkuwi/extension-inject to ^0.62.13 with proper /types exports
- Update @pezkuwi/extension-dapp to ^0.62.13
- Update @pezkuwi/extension-compat-metamask to ^0.62.13
- Fix IconTheme type to include 'bizinikiwi' and 'pezkuwi' themes
- Fix endpoint array issues (getTeleports -> direct array references)
- Add type assertions for external package compatibility (acala, moonbeam, parallel)
- Fix subspace.ts dynamic class typing
- Fix conviction type in page-referenda
- Update Pallet type names to Pezpallet prefix across codebase
- Define InjectedExtension types locally for module resolution
- Add styled-components DefaultTheme augmentation
- Add react-copy-to-clipboard type declaration for React 18

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-08 16:24:19 +03:00
parent e64f846b0d
commit 7a4bbeac25
570 changed files with 3281 additions and 3030 deletions
@@ -4,7 +4,7 @@
import type { DeriveBalancesAll } from '@pezkuwi/api-derive/types';
import type { Option } from '@pezkuwi/types';
import type { AccountId } from '@pezkuwi/types/interfaces';
import type { PalletStakingStakingLedger } from '@pezkuwi/types/lookup';
import type { PezpalletStakingStakingLedger } from '@pezkuwi/types/lookup';
import React, { useEffect, useState } from 'react';
@@ -33,7 +33,7 @@ const OPT_BOND = {
};
const OPT_STASH = {
transform: (value: Option<PalletStakingStakingLedger>): string | null =>
transform: (value: Option<PezpalletStakingStakingLedger>): string | null =>
value.isSome
? value.unwrap().stash.toString()
: null
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { DeriveBalancesAll } from '@pezkuwi/api-derive/types';
import type { PalletStakingRewardDestination } from '@pezkuwi/types/lookup';
import type { PezpalletStakingRewardDestination } from '@pezkuwi/types/lookup';
import type { DestinationType } from '../types.js';
import React, { useMemo, useState } from 'react';
@@ -15,7 +15,7 @@ import { createDestCurr } from '../destOptions.js';
import SenderInfo from '../partials/SenderInfo.js';
interface Props {
defaultDestination?: PalletStakingRewardDestination | null;
defaultDestination?: PezpalletStakingRewardDestination | null;
controllerId: string;
onClose: () => void;
stashId: string;
@@ -1,7 +1,7 @@
// Copyright 2017-2026 @pezkuwi/app-staking-async authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PalletStakingStakingLedger } from '@pezkuwi/types/lookup';
import type { PezpalletStakingStakingLedger } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
import React, { useState } from 'react';
@@ -18,7 +18,7 @@ import useUnbondDuration from '../useUnbondDuration.js';
interface Props {
controllerId?: string | null;
onClose: () => void;
stakingLedger?: PalletStakingStakingLedger;
stakingLedger?: PezpalletStakingStakingLedger;
stashId: string;
}
@@ -5,7 +5,7 @@ import type { ApiPromise } from '@pezkuwi/api';
import type { DeriveBalancesAll, DeriveStakingAccount } from '@pezkuwi/api-derive/types';
import type { SortedTargets } from '@pezkuwi/app-staking/types';
import type { StakerState } from '@pezkuwi/react-hooks/types';
import type { PalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { PezpalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
import type { Slash } from '../types.js';
@@ -31,7 +31,7 @@ import Validate from './Validate.js';
import WarnBond from './WarnBond.js';
interface Props {
allSlashes?: [BN, PalletStakingUnappliedSlash[]][];
allSlashes?: [BN, PezpalletStakingUnappliedSlash[]][];
className?: string;
isDisabled?: boolean;
info: StakerState;
@@ -41,7 +41,7 @@ interface Props {
validators?: string[];
}
function extractSlashes (stashId: string, allSlashes: [BN, PalletStakingUnappliedSlash[]][] = []): Slash[] {
function extractSlashes (stashId: string, allSlashes: [BN, PezpalletStakingUnappliedSlash[]][] = []): Slash[] {
return allSlashes
.map(([era, all]) => ({
era,
@@ -3,7 +3,7 @@
import type { SortedTargets } from '@pezkuwi/app-staking/types';
import type { StakerState } from '@pezkuwi/react-hooks/types';
import type { PalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { PezpalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
import React, { useRef } from 'react';
@@ -14,7 +14,7 @@ import { useTranslation } from '../translate.js';
import Account from './Account/index.js';
interface Props {
allSlashes: [BN, PalletStakingUnappliedSlash[]][];
allSlashes: [BN, PezpalletStakingUnappliedSlash[]][];
className?: string;
footer: React.ReactNode;
isInElection?: boolean;
@@ -4,7 +4,7 @@
import type { DeriveSessionProgress, DeriveUnlocking } from '@pezkuwi/api-derive/types';
import type { SortedTargets } from '@pezkuwi/app-staking/types';
import type { PoolInfo } from '@pezkuwi/app-staking2/Pools/types';
import type { PalletNominationPoolsPoolMember, PalletNominationPoolsPoolRoles } from '@pezkuwi/types/lookup';
import type { PezpalletNominationPoolsPoolMember, PezpalletNominationPoolsPoolRoles } from '@pezkuwi/types/lookup';
import React, { useCallback, useMemo } from 'react';
@@ -35,13 +35,13 @@ interface Roles {
isNominator: boolean;
}
function extractRoles (accountId: string, { nominator, root }: PalletNominationPoolsPoolRoles): Roles {
function extractRoles (accountId: string, { nominator, root }: PezpalletNominationPoolsPoolRoles): Roles {
return {
isNominator: nominator.eq(accountId) || root.eq(accountId)
};
}
function calcUnbonding (accountId: string, stashId: string, { activeEra }: DeriveSessionProgress, { unbondingEras }: PalletNominationPoolsPoolMember): { accountId: string, controllerId: string, redeemable: BN, stashId: string, unlocking: DeriveUnlocking[] } {
function calcUnbonding (accountId: string, stashId: string, { activeEra }: DeriveSessionProgress, { unbondingEras }: PezpalletNominationPoolsPoolMember): { accountId: string, controllerId: string, redeemable: BN, stashId: string, unlocking: DeriveUnlocking[] } {
const unlocking: DeriveUnlocking[] = [];
const redeemable = new BN(0);
@@ -4,7 +4,7 @@
import type { DeriveSessionProgress } from '@pezkuwi/api-derive/types';
import type { SortedTargets } from '@pezkuwi/app-staking/types';
import type { u32 } from '@pezkuwi/types';
import type { PalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import type { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import React from 'react';
@@ -15,7 +15,7 @@ import Account from './Account.js';
interface Props {
count: number;
className?: string;
members: Record<string, PalletNominationPoolsPoolMember>;
members: Record<string, PezpalletNominationPoolsPoolMember>;
poolId: u32;
sessionProgress?: DeriveSessionProgress;
targets: SortedTargets;
@@ -1,10 +1,10 @@
// Copyright 2017-2026 @pezkuwi/app-staking-async authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { PalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import type { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
export interface AccountInfo {
claimable: BN;
member: PalletNominationPoolsPoolMember;
member: PezpalletNominationPoolsPoolMember;
}
@@ -2,7 +2,7 @@
// SPDX-License-Identifier: Apache-2.0
import type { Option } from '@pezkuwi/types';
import type { PalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import type { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
import type { AccountInfo } from './types.js';
import { useEffect, useState } from 'react';
@@ -10,7 +10,7 @@ import { useEffect, useState } from 'react';
import { createNamedHook, useApi, useCall, useIsMountedRef } from '@pezkuwi/react-hooks';
const OPT_DEL = {
transform: (opt: Option<PalletNominationPoolsPoolMember>): PalletNominationPoolsPoolMember | null =>
transform: (opt: Option<PezpalletNominationPoolsPoolMember>): PezpalletNominationPoolsPoolMember | null =>
opt.unwrapOr(null)
};
@@ -4,7 +4,7 @@
import type { DeriveSessionProgress } from '@pezkuwi/api-derive/types';
import type { SortedTargets } from '@pezkuwi/app-staking/types';
import type { OwnPool } from '@pezkuwi/app-staking2/Pools/types';
import type { PalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { PezpalletStakingUnappliedSlash } from '@pezkuwi/types/lookup';
import type { BN } from '@pezkuwi/util';
import React, { useRef } from 'react';
@@ -16,7 +16,7 @@ import { useTranslation } from '../translate.js';
import Pool from './Pool/index.js';
interface Props {
allSlashes: [BN, PalletStakingUnappliedSlash[]][];
allSlashes: [BN, PezpalletStakingUnappliedSlash[]][];
className?: string;
isInElection?: boolean;
list?: OwnPool[];
@@ -93,6 +93,7 @@ function Bond ({ className = '', isNominating, minNominated, minNominatorBond, m
// we have a batch with setController at the end
// @ts-expect-error Previous generation
? api.tx.staking.bond(stashId, amount, bondDest)
// @ts-expect-error Runtime type format
: api.tx.staking.bond(amount, bondDest),
controllerId: mapControllerId,
controllerTx: needsController
@@ -44,10 +44,11 @@ function Validate ({ className = '', controllerId, minCommission, onChange, stas
useEffect((): void => {
try {
onChange({
// eslint-disable-next-line @typescript-eslint/no-explicit-any
validateTx: api.tx.staking.validate({
blocked: !allowNoms,
commission
})
} as any)
});
} catch {
onChange({ validateTx: null });
@@ -2,12 +2,12 @@
// SPDX-License-Identifier: Apache-2.0
import type { Option } from '@pezkuwi/types';
import type { PalletStakingSlashingSlashingSpans } from '@pezkuwi/types/lookup';
import type { PezpalletStakingSlashingSlashingSpans } from '@pezkuwi/types/lookup';
import { createNamedHook, useCall, useStakingAsyncApis } from '@pezkuwi/react-hooks';
const OPT_SPAN = {
transform: (optSpans: Option<PalletStakingSlashingSlashingSpans>): number =>
transform: (optSpans: Option<PezpalletStakingSlashingSlashingSpans>): number =>
optSpans.isNone
? 0
: optSpans.unwrap().prior.length + 1
@@ -3,7 +3,7 @@
import type { ApiPromise } from '@pezkuwi/api';
import type { AccountId32, Event, Hash } from '@pezkuwi/types/interfaces';
import type { FrameSupportDispatchPerDispatchClassWeight, PezkuwiRuntimeTeyrchainsConfigurationHostConfiguration } from '@pezkuwi/types/lookup';
import type { PezframeSupportDispatchPerDispatchClassWeight, PezkuwiRuntimeTeyrchainsConfigurationHostConfiguration } from '@pezkuwi/types/lookup';
import type { IEventData, ITuple } from '@pezkuwi/types/types';
import type { u32, Vec } from '@pezkuwi/types-codec';
@@ -173,7 +173,6 @@ const commandCenterHandler = async (
setRcOutput({
finalizedBlock: header.number.toNumber(),
teyrchainConfig,
session: {
hasQueuedInSession: hasQueuedInSession.isTrue,
historicalRange: historicalRange.isSome
@@ -197,7 +196,8 @@ const commandCenterHandler = async (
})(),
mode: mode.toString(),
validatorPoints: validatorPointsKeys.length
}
},
teyrchainConfig
});
if (enhancedEvents.length > 0) {
@@ -284,7 +284,7 @@ const commandCenterHandler = async (
// Get block weight
const weight = await (await ahApi.at(header.hash)).query.system.blockWeight();
const formatWeight = (w: FrameSupportDispatchPerDispatchClassWeight) => {
const formatWeight = (w: PezframeSupportDispatchPerDispatchClassWeight) => {
const normalRef = w.normal?.refTime?.toBigInt() || 0n;
const operationalRef = w.operational?.refTime?.toBigInt() || 0n;
const mandatoryRef = w.mandatory?.refTime?.toBigInt() || 0n;
@@ -309,7 +309,8 @@ const commandCenterHandler = async (
const parsedQueuedScore = ahApi.createType('Option<SpNposElectionsElectionScore>', queuedScore);
const formattedQueuedScore = parsedQueuedScore.isSome
? (() => {
const score = parsedQueuedScore.unwrap();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const score = parsedQueuedScore.unwrap() as any;
const minimalStake = score.minimalStake?.toString() || '0';
const formattedMinStake = formatBalance(minimalStake, { forceUnit: '-', withSi: true });
@@ -523,7 +524,7 @@ function CommandCenter ({ ahApi: initialAhApi, ahEndPoints, isRelayChain, rcApi:
// Get block weight
const weight = await (await ahApi.at(currentBlockHash)).query.system.blockWeight();
const formatWeight = (w: FrameSupportDispatchPerDispatchClassWeight) => {
const formatWeight = (w: PezframeSupportDispatchPerDispatchClassWeight) => {
const normalRef = w.normal?.refTime?.toBigInt() || 0n;
const operationalRef = w.operational?.refTime?.toBigInt() || 0n;
const mandatoryRef = w.mandatory?.refTime?.toBigInt() || 0n;