mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-06-13 04:41:02 +00:00
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:
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { u32 } from '@pezkuwi/types';
|
||||
import type { PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletNominationPoolsBondedPoolInner, PezpalletNominationPoolsPoolMember, PezpalletNominationPoolsRewardPool } from '@pezkuwi/types/lookup';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
export interface PoolAccounts {
|
||||
@@ -11,7 +11,7 @@ export interface PoolAccounts {
|
||||
}
|
||||
|
||||
export interface OwnPoolBase {
|
||||
members: Record<string, PalletNominationPoolsPoolMember>;
|
||||
members: Record<string, PezpalletNominationPoolsPoolMember>;
|
||||
poolId: u32;
|
||||
}
|
||||
|
||||
@@ -32,8 +32,8 @@ export interface Params {
|
||||
}
|
||||
|
||||
export interface PoolInfoBase {
|
||||
bonded: PalletNominationPoolsBondedPoolInner;
|
||||
reward: PalletNominationPoolsRewardPool;
|
||||
bonded: PezpalletNominationPoolsBondedPoolInner;
|
||||
reward: PezpalletNominationPoolsRewardPool;
|
||||
metadata: string | null;
|
||||
nominating: string[];
|
||||
rewardClaimable: BN;
|
||||
@@ -45,7 +45,7 @@ export interface PoolInfo extends PoolInfoBase, PoolAccounts {
|
||||
|
||||
export interface MembersMapEntry {
|
||||
accountId: string;
|
||||
member: PalletNominationPoolsPoolMember;
|
||||
member: PezpalletNominationPoolsPoolMember;
|
||||
}
|
||||
|
||||
export type MembersMap = Record<string, MembersMapEntry[]>;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import type { Changes } from '@pezkuwi/react-hooks/useEventChanges';
|
||||
import type { bool, Option, StorageKey, u32, u128 } from '@pezkuwi/types';
|
||||
import type { AccountId32, EventRecord } from '@pezkuwi/types/interfaces';
|
||||
import type { PalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
|
||||
import type { MembersMap, MembersMapEntry } from './types.js';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
@@ -14,7 +14,7 @@ import { createNamedHook, useApi, useCall, useEventChanges, useMapEntries } from
|
||||
const EMPTY_START: AccountId32[] = [];
|
||||
|
||||
const OPT_ENTRIES = {
|
||||
transform: (entries: [StorageKey<[AccountId32]>, Option<PalletNominationPoolsPoolMember>][]): MembersMap =>
|
||||
transform: (entries: [StorageKey<[AccountId32]>, Option<PezpalletNominationPoolsPoolMember>][]): MembersMap =>
|
||||
entries.reduce((all: MembersMap, [{ args: [accountId] }, optMember]) => {
|
||||
if (optMember.isSome) {
|
||||
const member = optMember.unwrap();
|
||||
@@ -35,7 +35,7 @@ const OPT_ENTRIES = {
|
||||
};
|
||||
|
||||
const OPT_MULTI = {
|
||||
transform: ([[ids], values]: [[AccountId32[]], Option<PalletNominationPoolsPoolMember>[]]): MembersMapEntry[] =>
|
||||
transform: ([[ids], values]: [[AccountId32[]], Option<PezpalletNominationPoolsPoolMember>[]]): MembersMapEntry[] =>
|
||||
ids
|
||||
.filter((_, i) => values[i].isSome)
|
||||
.map((accountId, i) => ({
|
||||
|
||||
@@ -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 { OwnPool, OwnPoolBase } from './types.js';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
@@ -12,7 +12,7 @@ import { createNamedHook, useAccounts, useApi, useCall } from '@pezkuwi/react-ho
|
||||
import { createAccounts } from './usePoolAccounts.js';
|
||||
|
||||
const OPT_MULTI = {
|
||||
transform: ([[ids], opts]: [[string[]], Option<PalletNominationPoolsPoolMember>[]]): OwnPoolBase[] => {
|
||||
transform: ([[ids], opts]: [[string[]], Option<PezpalletNominationPoolsPoolMember>[]]): OwnPoolBase[] => {
|
||||
const pools: OwnPoolBase[] = [];
|
||||
|
||||
for (let i = 0; i < ids.length; i++) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Bytes, Option } from '@pezkuwi/types';
|
||||
import type { FrameSystemAccountInfo, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsRewardPool, PalletStakingNominations } from '@pezkuwi/types/lookup';
|
||||
import type { PezframeSystemAccountInfo, PezpalletNominationPoolsBondedPoolInner, PezpalletNominationPoolsRewardPool, PezpalletStakingNominations } from '@pezkuwi/types/lookup';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { PoolInfo, PoolInfoBase } from './types.js';
|
||||
|
||||
@@ -15,7 +15,7 @@ import usePoolAccounts from './usePoolAccounts.js';
|
||||
|
||||
const OPT_MULTI = {
|
||||
defaultValue: null,
|
||||
transform: ([optBonded, metadata, optReward, optNominating, accountInfo]: [Option<PalletNominationPoolsBondedPoolInner>, Bytes, Option<PalletNominationPoolsRewardPool>, Option<PalletStakingNominations>, FrameSystemAccountInfo]): PoolInfoBase | null =>
|
||||
transform: ([optBonded, metadata, optReward, optNominating, accountInfo]: [Option<PezpalletNominationPoolsBondedPoolInner>, Bytes, Option<PezpalletNominationPoolsRewardPool>, Option<PezpalletStakingNominations>, PezframeSystemAccountInfo]): PoolInfoBase | null =>
|
||||
optBonded.isSome && optReward.isSome
|
||||
? {
|
||||
bonded: optBonded.unwrap(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2026 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { SpStakingExposure } from '@pezkuwi/types/lookup';
|
||||
import type { PezspStakingExposure } from '@pezkuwi/types/lookup';
|
||||
import type { SessionInfo, Validator } from '../types.js';
|
||||
import type { UseExposure, UseExposureExposure } from './types.js';
|
||||
|
||||
@@ -13,7 +13,7 @@ import { BN } from '@pezkuwi/util';
|
||||
import { useCacheMap } from '../useCache.js';
|
||||
|
||||
const OPT_EXPOSURE = {
|
||||
transform: ({ others, own, total }: SpStakingExposure): UseExposureExposure => ({
|
||||
transform: ({ others, own, total }: PezspStakingExposure): UseExposureExposure => ({
|
||||
others: others
|
||||
.map(({ value, who }) => ({
|
||||
value: value.unwrap(),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Copyright 2017-2026 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { PalletStakingEraRewardPoints } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletStakingEraRewardPoints } from '@pezkuwi/types/lookup';
|
||||
import type { SessionInfo } from '../types.js';
|
||||
import type { UsePoints } from './types.js';
|
||||
|
||||
@@ -13,7 +13,7 @@ import { BN_ZERO } from '@pezkuwi/util';
|
||||
import { useCacheValue } from '../useCache.js';
|
||||
|
||||
const OPT_POINTS = {
|
||||
transform: ({ individual }: PalletStakingEraRewardPoints): UsePoints =>
|
||||
transform: ({ individual }: PezpalletStakingEraRewardPoints): UsePoints =>
|
||||
[...individual.entries()]
|
||||
.filter(([, points]) => points.gt(BN_ZERO))
|
||||
.reduce((result: UsePoints, [stashId, points]): UsePoints => {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Option, u32 } from '@pezkuwi/types';
|
||||
import type { PalletStakingActiveEraInfo } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletStakingActiveEraInfo } from '@pezkuwi/types/lookup';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { SessionInfo } from './types.js';
|
||||
|
||||
@@ -11,7 +11,7 @@ import { useMemo } from 'react';
|
||||
import { createNamedHook, useApi, useCall } from '@pezkuwi/react-hooks';
|
||||
|
||||
const OPT_ACTIVEERA = {
|
||||
transform: (activeEra: Option<PalletStakingActiveEraInfo>): BN | null =>
|
||||
transform: (activeEra: Option<PezpalletStakingActiveEraInfo>): BN | null =>
|
||||
activeEra.isSome
|
||||
? activeEra.unwrap().index
|
||||
: null
|
||||
|
||||
Reference in New Issue
Block a user