mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-22 17:07:58 +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:
@@ -3,7 +3,7 @@
|
||||
|
||||
import type { ApiPromise } from '@pezkuwi/api';
|
||||
import type { BountyIndex } from '@pezkuwi/types/interfaces';
|
||||
import type { PalletBountiesBounty, PalletBountiesBountyStatus } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletBountiesBounty, PezpalletBountiesBountyStatus } from '@pezkuwi/types/lookup';
|
||||
import type { Registry } from '@pezkuwi/types/types';
|
||||
|
||||
import { balanceOf } from './balance.js';
|
||||
@@ -20,27 +20,27 @@ export class BountyFactory {
|
||||
public aBountyIndex = (index = 0): BountyIndex =>
|
||||
this.#registry.createType('BountyIndex', index);
|
||||
|
||||
public defaultBounty = (): PalletBountiesBounty =>
|
||||
this.#registry.createType<PalletBountiesBounty>('Bounty');
|
||||
public defaultBounty = (): PezpalletBountiesBounty =>
|
||||
this.#registry.createType<PezpalletBountiesBounty>('Bounty');
|
||||
|
||||
public aBountyStatus = (status: string): PalletBountiesBountyStatus =>
|
||||
this.#registry.createType('PalletBountiesBountyStatus', status);
|
||||
public aBountyStatus = (status: string): PezpalletBountiesBountyStatus =>
|
||||
this.#registry.createType('PezpalletBountiesBountyStatus', status);
|
||||
|
||||
public bountyStatusWith = ({ curator = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', status = 'Active', updateDue = 100000 } = {}): PalletBountiesBountyStatus => {
|
||||
public bountyStatusWith = ({ curator = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY', status = 'Active', updateDue = 100000 } = {}): PezpalletBountiesBountyStatus => {
|
||||
if (status === 'Active') {
|
||||
return this.#registry.createType('PalletBountiesBountyStatus', { active: { curator, updateDue }, status });
|
||||
return this.#registry.createType('PezpalletBountiesBountyStatus', { active: { curator, updateDue }, status });
|
||||
}
|
||||
|
||||
if (status === 'CuratorProposed') {
|
||||
return this.#registry.createType('PalletBountiesBountyStatus', { curatorProposed: { curator }, status });
|
||||
return this.#registry.createType('PezpalletBountiesBountyStatus', { curatorProposed: { curator }, status });
|
||||
}
|
||||
|
||||
throw new Error('Unsupported status');
|
||||
};
|
||||
|
||||
public bountyWith = ({ status = 'Proposed', value = 1 } = {}): PalletBountiesBounty =>
|
||||
public bountyWith = ({ status = 'Proposed', value = 1 } = {}): PezpalletBountiesBounty =>
|
||||
this.aBounty({ status: this.aBountyStatus(status), value: balanceOf(value) });
|
||||
|
||||
public aBounty = ({ fee = balanceOf(10), status = this.aBountyStatus('Proposed'), value = balanceOf(500) }: Partial<PalletBountiesBounty> = {}): PalletBountiesBounty =>
|
||||
this.#registry.createType<PalletBountiesBounty>('Bounty', { fee, status, value });
|
||||
public aBounty = ({ fee = balanceOf(10), status = this.aBountyStatus('Proposed'), value = balanceOf(500) }: Partial<PezpalletBountiesBounty> = {}): PezpalletBountiesBounty =>
|
||||
this.#registry.createType<PezpalletBountiesBounty>('Bounty', { fee, status, value });
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// Copyright 2017-2026 @pezkuwi/app-bounties authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { PalletStakingStakingLedger } from '@pezkuwi/types/lookup';
|
||||
import type { PezpalletStakingStakingLedger } from '@pezkuwi/types/lookup';
|
||||
|
||||
import { TypeRegistry } from '@pezkuwi/types/create';
|
||||
import { BN } from '@pezkuwi/util';
|
||||
|
||||
export function makeStakingLedger (active: BN | number | string): PalletStakingStakingLedger {
|
||||
export function makeStakingLedger (active: BN | number | string): PezpalletStakingStakingLedger {
|
||||
const reg = new TypeRegistry();
|
||||
|
||||
// Constructing the whole StakingLedger structure is hard,
|
||||
@@ -16,5 +16,5 @@ export function makeStakingLedger (active: BN | number | string): PalletStakingS
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
||||
return {
|
||||
active: reg.createType('Compact<Balance>', reg.createType('Balance', new BN(active)))
|
||||
} as PalletStakingStakingLedger;
|
||||
} as PezpalletStakingStakingLedger;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user