mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-07-25 04:45:41 +00:00
Rebrand: polkadot → pezkuwi build fixes
- Fixed TypeScript type assertion issues - Updated imports from api-augment/substrate to api-augment/bizinikiwi - Fixed imgConvert.mjs header and imports - Added @ts-expect-error for runtime-converted types - Fixed all @polkadot copyright headers to @pezkuwi
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { Params } from './types.js';
|
||||
|
||||
import React, { useMemo, useState } from 'react';
|
||||
|
||||
import { Button, Input, InputAddress, InputBalance, InputNumber, Modal, TxButton } from '@polkadot/react-components';
|
||||
import { useApi, useToggle } from '@polkadot/react-hooks';
|
||||
import { bnMax } from '@polkadot/util';
|
||||
import { Button, Input, InputAddress, InputBalance, InputNumber, Modal, TxButton } from '@pezkuwi/react-components';
|
||||
import { useApi, useToggle } from '@pezkuwi/react-hooks';
|
||||
import { bnMax } from '@pezkuwi/util';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import useAmountError from './useAmountError.js';
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { Params } from './types.js';
|
||||
|
||||
import React, { useState } from 'react';
|
||||
|
||||
import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components';
|
||||
import { useApi, useToggle } from '@polkadot/react-hooks';
|
||||
import { Button, InputAddress, InputBalance, Modal, TxButton } from '@pezkuwi/react-components';
|
||||
import { useApi, useToggle } from '@pezkuwi/react-hooks';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import useAmountError from './useAmountError.js';
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { MembersMapEntry, Params } from './types.js';
|
||||
|
||||
import React, { useCallback } from 'react';
|
||||
|
||||
import { AddressMini, ExpandButton, ExpanderScroll, Spinner, styled, Table } from '@polkadot/react-components';
|
||||
import { useToggle } from '@polkadot/react-hooks';
|
||||
import { FormatBalance } from '@polkadot/react-query';
|
||||
import { AddressMini, ExpandButton, ExpanderScroll, Spinner, styled, Table } from '@pezkuwi/react-components';
|
||||
import { useToggle } from '@pezkuwi/react-hooks';
|
||||
import { FormatBalance } from '@pezkuwi/react-query';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import Join from './Join.js';
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { OwnPool, Params } from './types.js';
|
||||
|
||||
import React, { useMemo, useRef, useState } from 'react';
|
||||
|
||||
import { Button, Table, ToggleGroup } from '@polkadot/react-components';
|
||||
import { arrayFlatten } from '@polkadot/util';
|
||||
import { Button, Table, ToggleGroup } from '@pezkuwi/react-components';
|
||||
import { arrayFlatten } from '@pezkuwi/util';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
import Create from './Create.js';
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Params } from './types.js';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
import { CardSummary, SummaryBox } from '@polkadot/react-components';
|
||||
import { formatNumber, isNumber } from '@polkadot/util';
|
||||
import { CardSummary, SummaryBox } from '@pezkuwi/react-components';
|
||||
import { formatNumber, isNumber } from '@pezkuwi/util';
|
||||
|
||||
import { useTranslation } from '../translate.js';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { OwnPool } from './types.js';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { u32 } from '@polkadot/types';
|
||||
import type { PalletNominationPoolsBondedPoolInner, PalletNominationPoolsPoolMember, PalletNominationPoolsRewardPool } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { u32 } from '@pezkuwi/types';
|
||||
import type { PezpalletNominationPoolsBondedPoolInner, PezpalletNominationPoolsPoolMember, PezpalletNominationPoolsRewardPool } from '@pezkuwi/types/lookup';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
export interface PoolAccounts {
|
||||
rewardId: string;
|
||||
@@ -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[]>;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DeriveBalancesAll } from '@polkadot/api-derive/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { DeriveBalancesAll } from '@pezkuwi/api-derive/types';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { createNamedHook, useApi, useCall } from '@polkadot/react-hooks';
|
||||
import { BN_ZERO, hexToString } from '@polkadot/util';
|
||||
import { createNamedHook, useApi, useCall } from '@pezkuwi/react-hooks';
|
||||
import { BN_ZERO, hexToString } from '@pezkuwi/util';
|
||||
|
||||
// Consider only OpenGov-related locks
|
||||
const openGovLockIds = ['referenda', 'convictionVoting', 'pyconvot'];
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Changes } from '@polkadot/react-hooks/useEventChanges';
|
||||
import type { bool, Option, StorageKey, u32, u128 } from '@polkadot/types';
|
||||
import type { AccountId32, EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { PalletNominationPoolsPoolMember } from '@polkadot/types/lookup';
|
||||
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 { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
|
||||
import type { MembersMap, MembersMapEntry } from './types.js';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
import { createNamedHook, useApi, useCall, useEventChanges, useMapEntries } from '@polkadot/react-hooks';
|
||||
import { createNamedHook, useApi, useCall, useEventChanges, useMapEntries } from '@pezkuwi/react-hooks';
|
||||
|
||||
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) => ({
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Option } from '@polkadot/types';
|
||||
import type { PalletNominationPoolsPoolMember } from '@polkadot/types/lookup';
|
||||
import type { Option } from '@pezkuwi/types';
|
||||
import type { PezpalletNominationPoolsPoolMember } from '@pezkuwi/types/lookup';
|
||||
import type { OwnPool, OwnPoolBase } from './types.js';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { createNamedHook, useAccounts, useApi, useCall } from '@polkadot/react-hooks';
|
||||
import { createNamedHook, useAccounts, useApi, useCall } from '@pezkuwi/react-hooks';
|
||||
|
||||
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++) {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Option, u32 } from '@polkadot/types';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { Option, u32 } from '@pezkuwi/types';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { Params } from './types.js';
|
||||
|
||||
import { createNamedHook, useApi, useCallMulti } from '@polkadot/react-hooks';
|
||||
import { BN_ONE, BN_ZERO } from '@polkadot/util';
|
||||
import { createNamedHook, useApi, useCallMulti } from '@pezkuwi/react-hooks';
|
||||
import { BN_ONE, BN_ZERO } from '@pezkuwi/util';
|
||||
|
||||
const OPT_MULTI = {
|
||||
defaultValue: {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { ApiPromise } from '@polkadot/api';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { PoolAccounts } from './types.js';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { createNamedHook, useApi } from '@polkadot/react-hooks';
|
||||
import { bnToU8a, stringToU8a, u8aConcat } from '@polkadot/util';
|
||||
import { createNamedHook, useApi } from '@pezkuwi/react-hooks';
|
||||
import { bnToU8a, stringToU8a, u8aConcat } from '@pezkuwi/util';
|
||||
|
||||
const EMPTY_H256 = new Uint8Array(32);
|
||||
const MOD_PREFIX = stringToU8a('modl');
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Changes } from '@polkadot/react-hooks/useEventChanges';
|
||||
import type { StorageKey, u32 } from '@polkadot/types';
|
||||
import type { EventRecord } from '@polkadot/types/interfaces';
|
||||
import type { Changes } from '@pezkuwi/react-hooks/useEventChanges';
|
||||
import type { StorageKey, u32 } from '@pezkuwi/types';
|
||||
import type { EventRecord } from '@pezkuwi/types/interfaces';
|
||||
|
||||
import { createNamedHook, useApi, useEventChanges, useMapKeys } from '@polkadot/react-hooks';
|
||||
import { createNamedHook, useApi, useEventChanges, useMapKeys } from '@pezkuwi/react-hooks';
|
||||
|
||||
const OPT_KEYS = {
|
||||
transform: (keys: StorageKey<[u32]>[]): u32[] =>
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
// Copyright 2017-2025 @polkadot/app-staking authors & contributors
|
||||
// Copyright 2017-2025 @pezkuwi/app-staking authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { Bytes, Option } from '@polkadot/types';
|
||||
import type { FrameSystemAccountInfo, PalletNominationPoolsBondedPoolInner, PalletNominationPoolsRewardPool, PalletStakingNominations } from '@polkadot/types/lookup';
|
||||
import type { BN } from '@polkadot/util';
|
||||
import type { Bytes, Option } from '@pezkuwi/types';
|
||||
import type { PezframeSystemAccountInfo, PezpalletNominationPoolsBondedPoolInner, PezpalletNominationPoolsRewardPool, PezpalletStakingNominations } from '@pezkuwi/types/lookup';
|
||||
import type { BN } from '@pezkuwi/util';
|
||||
import type { PoolInfo, PoolInfoBase } from './types.js';
|
||||
|
||||
import { useMemo } from 'react';
|
||||
|
||||
import { createNamedHook, useApi, useCallMulti } from '@polkadot/react-hooks';
|
||||
import { BN_ZERO, bnMax } from '@polkadot/util';
|
||||
import { createNamedHook, useApi, useCallMulti } from '@pezkuwi/react-hooks';
|
||||
import { BN_ZERO, bnMax } from '@pezkuwi/util';
|
||||
|
||||
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(),
|
||||
|
||||
Reference in New Issue
Block a user