mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-10-20 18:56:30 +00:00
Move to @pezkuwi/dev 0.86.4 (eslint 10 toolchain)
- dev ^0.86.4 at the root and in packages/apps; directives renamed by pezkuwi-dev-migrate-eslint10. - eslint --fix with the 0.86.4 config; one fix broke syntax (typescript-eslint prefer-optional-chain turned `(isStarted && onStart) && onStart()` into `(isStarted && onStart?.();` in TxButton) and is corrected by hand. - The remaining findings fixed rather than disabled: optional chains (each suggestion reviewed), `cause` on rethrown errors, `if` instead of `a && promise` in effects, parallel instead of sequential awaits in Promise.all, Error rejections, no `delete` on arrays (the storage query cache is a Map; an upload's file list no longer keeps a hole), no `[object Object]` stringification (TFunction's second argument is text or options), dead code removed (referenda's never-shown expand button, react-query's unused CoreDescriptor).
This commit is contained in:
1 parent
c800e9affb
commit
45d479d2ec
325 files changed
+2942
-3531
No files matched your search
+1
-1
@@ -48,7 +48,7 @@
|
|||||||
"test:skipped": "echo 'tests skipped'"
|
"test:skipped": "echo 'tests skipped'"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@pezkuwi/dev": "^0.85.12",
|
"@pezkuwi/dev": "^0.86.4",
|
||||||
"@pezkuwi/extension-dapp": "^0.62.27",
|
"@pezkuwi/extension-dapp": "^0.62.27",
|
||||||
"@pezkuwi/extension-inject": "^0.62.27",
|
"@pezkuwi/extension-inject": "^0.62.27",
|
||||||
"@types/chart.js": "^2.9.41",
|
"@types/chart.js": "^2.9.41",
|
||||||
|
|||||||
@@ -6,5 +6,4 @@ import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
|||||||
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@acala-network/type-definitions';
|
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@acala-network/type-definitions';
|
||||||
|
|
||||||
// External package types, cast to proper type for compatibility
|
// External package types, cast to proper type for compatibility
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
export default ((typesBundleForPezkuwi as Record<string, unknown>).spec || {}) as Record<string, OverrideBundleDefinition>;
|
export default ((typesBundleForPezkuwi as Record<string, unknown>).spec || {}) as Record<string, OverrideBundleDefinition>;
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -5,5 +5,4 @@ import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
|||||||
|
|
||||||
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@crustio/type-definitions';
|
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@crustio/type-definitions';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
export default (typesBundleForPezkuwi as Record<string, Record<string, unknown>>).spec.crust as OverrideBundleDefinition;
|
export default (typesBundleForPezkuwi as Record<string, Record<string, unknown>>).spec.crust as OverrideBundleDefinition;
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
/* eslint-disable camelcase */
|
|
||||||
|
|
||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
||||||
|
|
||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
import acala from './acala.js';
|
import acala from './acala.js';
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
// Copyright 2017-2026 @pezkuwi/apps-config authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-assignment */
|
|
||||||
|
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
||||||
import type { DeriveBalancesAll } from '@pezkuwi/api-derive/types';
|
import type { DeriveBalancesAll } from '@pezkuwi/api-derive/types';
|
||||||
@@ -21,7 +19,6 @@ function balanceOf (number: number | string): U128 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defaultAccountBalance (): DeriveBalancesAll {
|
function defaultAccountBalance (): DeriveBalancesAll {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
||||||
return {
|
return {
|
||||||
accountNonce: new BN(1),
|
accountNonce: new BN(1),
|
||||||
additional: [],
|
additional: [],
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -5,5 +5,4 @@ import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
|||||||
|
|
||||||
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@laminar/type-definitions';
|
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@laminar/type-definitions';
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
export default (typesBundleForPezkuwi as Record<string, Record<string, unknown>>).spec.laminar as OverrideBundleDefinition;
|
export default (typesBundleForPezkuwi as Record<string, Record<string, unknown>>).spec.laminar as OverrideBundleDefinition;
|
||||||
@@ -2,7 +2,6 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys, @typescript-eslint/no-unsafe-assignment */
|
|
||||||
|
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
||||||
@@ -22,7 +21,6 @@ function balanceOf (number: number | string): U128 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function defaultAccountBalance (): DeriveBalancesAll {
|
function defaultAccountBalance (): DeriveBalancesAll {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
||||||
return {
|
return {
|
||||||
accountNonce: new BN(1),
|
accountNonce: new BN(1),
|
||||||
additional: [],
|
additional: [],
|
||||||
@@ -54,7 +52,6 @@ export function getBalance (
|
|||||||
return {
|
return {
|
||||||
...defaultAccountBalance(),
|
...defaultAccountBalance(),
|
||||||
accountId: api.registry.createType('AccountId', account),
|
accountId: api.registry.createType('AccountId', account),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
accountNonce: systemAccount.nonce,
|
accountNonce: systemAccount.nonce,
|
||||||
availableBalance: api.registry.createType('Balance', data.free.sub(data.frozen)),
|
availableBalance: api.registry.createType('Balance', data.free.sub(data.frozen)),
|
||||||
freeBalance: data.free,
|
freeBalance: data.free,
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
/* eslint-disable camelcase */
|
|
||||||
|
|
||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -6,5 +6,4 @@ import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
|||||||
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@parallel-finance/type-definitions';
|
import { typesBundleForPolkadot as typesBundleForPezkuwi } from '@parallel-finance/type-definitions';
|
||||||
|
|
||||||
// External package types, cast to proper type for compatibility
|
// External package types, cast to proper type for compatibility
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
||||||
export default ((typesBundleForPezkuwi as Record<string, unknown>).spec || {}) as Record<string, OverrideBundleDefinition>;
|
export default ((typesBundleForPezkuwi as Record<string, unknown>).spec || {}) as Record<string, OverrideBundleDefinition>;
|
||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
import type { Observable } from 'rxjs';
|
import type { Observable } from 'rxjs';
|
||||||
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
import type { ApiInterfaceRx } from '@pezkuwi/api/types';
|
||||||
@@ -52,7 +51,6 @@ function createHeaderExtended (
|
|||||||
api: ApiInterfaceRx
|
api: ApiInterfaceRx
|
||||||
): HeaderExtended {
|
): HeaderExtended {
|
||||||
// HeaderBase is dynamically created at runtime, so we need type assertions
|
// HeaderBase is dynamically created at runtime, so we need type assertions
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
const HeaderBase = registry.createClass('Header') as any;
|
const HeaderBase = registry.createClass('Header') as any;
|
||||||
|
|
||||||
class SubHeaderExtended extends HeaderBase {
|
class SubHeaderExtended extends HeaderBase {
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
import type { OverrideBundleDefinition } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
// structs need to be in order
|
// structs need to be in order
|
||||||
/* eslint-disable sort-keys */
|
|
||||||
|
|
||||||
const definitions: OverrideBundleDefinition = {
|
const definitions: OverrideBundleDefinition = {
|
||||||
types: [
|
types: [
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ describe('typesBundle', (): void => {
|
|||||||
|
|
||||||
import type { OverrideBundleType } from '@pezkuwi/types/types';
|
import type { OverrideBundleType } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
/* eslint-disable quotes */
|
/* eslint-disable @stylistic/quotes */
|
||||||
/* eslint-disable quote-props */
|
/* eslint-disable @stylistic/quote-props */
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
|
|
||||||
export const typesBundle = ${JSON.stringify(typesBundle, null, 2)} as unknown as OverrideBundleType;
|
export const typesBundle = ${JSON.stringify(typesBundle, null, 2)} as unknown as OverrideBundleType;
|
||||||
|
|||||||
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
import type { OverrideBundleType } from '@pezkuwi/types/types';
|
import type { OverrideBundleType } from '@pezkuwi/types/types';
|
||||||
|
|
||||||
/* eslint-disable quotes */
|
/* eslint-disable @stylistic/quotes */
|
||||||
/* eslint-disable quote-props */
|
/* eslint-disable @stylistic/quote-props */
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
|
|
||||||
export const typesBundle = {
|
export const typesBundle = {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ describe('check endpoints', (): void => {
|
|||||||
assert(result?.startsWith('0x'), 'Invalid/non-hex response');
|
assert(result?.startsWith('0x'), 'Invalid/non-hex response');
|
||||||
resolve(result);
|
resolve(result);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
reject(e);
|
reject(e instanceof Error ? e : new Error(String(e)));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import type { LinkOption } from './types.js';
|
|||||||
export const CUSTOM_ENDPOINT_KEY = 'pezkuwi-app-custom-endpoints';
|
export const CUSTOM_ENDPOINT_KEY = 'pezkuwi-app-custom-endpoints';
|
||||||
|
|
||||||
interface EnvWindow {
|
interface EnvWindow {
|
||||||
// eslint-disable-next-line camelcase
|
|
||||||
process_env?: {
|
process_env?: {
|
||||||
WS_URL: string;
|
WS_URL: string;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,10 +13,15 @@ export { CUSTOM_ENDPOINT_KEY } from './development.js';
|
|||||||
export * from './production.js';
|
export * from './production.js';
|
||||||
export * from './testing.js';
|
export * from './testing.js';
|
||||||
|
|
||||||
function defaultT (keyOrText: string, text?: string | TOptions, options?: TOptions): string {
|
function defaultT (keyOrText: string, textOrOptions?: string | TOptions, options?: TOptions): string {
|
||||||
|
// as TFunction: the second argument is either the default text or the options
|
||||||
|
const [text, opts] = typeof textOrOptions === 'string'
|
||||||
|
? [textOrOptions, options]
|
||||||
|
: [undefined, textOrOptions];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
(options?.replace?.host as string) ||
|
(opts?.replace?.host as string) ||
|
||||||
text?.toString() ||
|
text ||
|
||||||
keyOrText
|
keyOrText
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import Component, { useCounter } from '@pezkuwi/app-democracy';
|
|||||||
function needsApiCheck (api: ApiPromise): boolean {
|
function needsApiCheck (api: ApiPromise): boolean {
|
||||||
try {
|
try {
|
||||||
// we need to be able to create an actual vote
|
// we need to be able to create an actual vote
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
api.tx.democracy.vote(1, { Standard: { balance: 1, vote: { aye: true, conviction: 1 } } } as any);
|
api.tx.democracy.vote(1, { Standard: { balance: 1, vote: { aye: true, conviction: 1 } } } as any);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -19,13 +19,11 @@ function needsApiCheck (api: ApiPromise): boolean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we need a known Exposure type
|
// we need a known Exposure type
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
||||||
const { nominatorCount, own, pageCount, total } = api.registry.createType<PezspStakingPagedExposureMetadata>(
|
const { nominatorCount, own, pageCount, total } = api.registry.createType<PezspStakingPagedExposureMetadata>(
|
||||||
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
|
unwrapStorageType(api.registry, api.query.staking.erasStakersOverview.creator.meta.type),
|
||||||
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
|
{ nominatorCount: BN_ONE, own: BN_ONE, pageCount: BN_ONE, total: BN_ONE }
|
||||||
);
|
);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
||||||
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
|
assert(total && own && nominatorCount && pageCount && total.eq(BN_ONE) && own.eq(BN_ONE), 'Needs a known Exposure type');
|
||||||
} catch {
|
} catch {
|
||||||
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
||||||
|
|||||||
@@ -13,13 +13,11 @@ import { assert, BN_ONE } from '@pezkuwi/util';
|
|||||||
function needsApiCheck (api: ApiPromise): boolean {
|
function needsApiCheck (api: ApiPromise): boolean {
|
||||||
try {
|
try {
|
||||||
// we need a known Exposure type
|
// we need a known Exposure type
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
||||||
const { others: [{ value, who }], own, total } = api.registry.createType<PezspStakingExposure>(
|
const { others: [{ value, who }], own, total } = api.registry.createType<PezspStakingExposure>(
|
||||||
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
|
unwrapStorageType(api.registry, api.query.staking.erasStakers.creator.meta.type),
|
||||||
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
|
{ others: [{ value: BN_ONE, who: ZERO_ACCOUNT }], own: BN_ONE, total: BN_ONE }
|
||||||
);
|
);
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
|
|
||||||
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
|
assert(total && own && value && who && total.eq(BN_ONE) && own.eq(BN_ONE) && value.eq(BN_ONE), 'Needs a known Exposure type');
|
||||||
} catch {
|
} catch {
|
||||||
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
console.warn('Unable to create known-shape Exposure type, disabling staking route');
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
"@acala-network/chopsticks-core": "^1.2.1",
|
"@acala-network/chopsticks-core": "^1.2.1",
|
||||||
"@pezkuwi/apps-config": "^1.0.2-1-x",
|
"@pezkuwi/apps-config": "^1.0.2-1-x",
|
||||||
"@pezkuwi/apps-routing": "^1.0.2-1-x",
|
"@pezkuwi/apps-routing": "^1.0.2-1-x",
|
||||||
"@pezkuwi/dev": "^0.85.2",
|
"@pezkuwi/dev": "^0.86.4",
|
||||||
"@pezkuwi/react-api": "^1.0.2-1-x",
|
"@pezkuwi/react-api": "^1.0.2-1-x",
|
||||||
"@pezkuwi/react-components": "^1.0.2-1-x",
|
"@pezkuwi/react-components": "^1.0.2-1-x",
|
||||||
"@pezkuwi/react-hooks": "^1.0.2-1-x",
|
"@pezkuwi/react-hooks": "^1.0.2-1-x",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const BrowserCheckAlert: React.FC = () => {
|
|||||||
const ua = navigator.userAgent;
|
const ua = navigator.userAgent;
|
||||||
|
|
||||||
// Detect Firefox
|
// Detect Firefox
|
||||||
const firefoxMatch = ua.match(/Firefox\/(\d+\.\d+)/);
|
const firefoxMatch = /Firefox\/(\d+\.\d+)/.exec(ua);
|
||||||
|
|
||||||
if (firefoxMatch) {
|
if (firefoxMatch) {
|
||||||
// Check for Firefox 145.0 specifically
|
// Check for Firefox 145.0 specifically
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ function GroupDisplay ({ affinities, apiUrl, children, className = '', favoriteC
|
|||||||
[index, isSelected, setGroup]
|
[index, isSelected, setGroup]
|
||||||
);
|
);
|
||||||
|
|
||||||
const isFavoriteHeader = useMemo(() => header?.toString().includes('Favorite'), [header]);
|
const isFavoriteHeader = useMemo(() => typeof header === 'string' && header.includes('Favorite'), [header]);
|
||||||
|
|
||||||
const filtered = useMemo(
|
const filtered = useMemo(
|
||||||
() => networks.filter(({ isUnreachable }) => !isUnreachable),
|
() => networks.filter(({ isUnreachable }) => !isUnreachable),
|
||||||
|
|||||||
@@ -63,9 +63,9 @@ function combineEndpoints (endpoints: LinkOption[]): Group[] {
|
|||||||
const prov = { isLightClient: e.isLightClient, name: e.textBy, url: e.value };
|
const prov = { isLightClient: e.isLightClient, name: e.textBy, url: e.value };
|
||||||
|
|
||||||
const isFavorite = isFavoriteChain(favoriteChains,
|
const isFavorite = isFavoriteChain(favoriteChains,
|
||||||
{ chainName: e.text?.toString() ?? '',
|
{ chainName: typeof e.text === 'string' ? e.text : '',
|
||||||
paraId: e.paraId,
|
paraId: e.paraId,
|
||||||
relay: e.textRelay?.toString() });
|
relay: typeof e.textRelay === 'string' ? e.textRelay : undefined });
|
||||||
|
|
||||||
if (isFavorite && favoriteGroupIndex !== -1 && !e.isUnreachable) {
|
if (isFavorite && favoriteGroupIndex !== -1 && !e.isUnreachable) {
|
||||||
const favGroup = result[favoriteGroupIndex];
|
const favGroup = result[favoriteGroupIndex];
|
||||||
@@ -106,7 +106,7 @@ function combineEndpoints (endpoints: LinkOption[]): Group[] {
|
|||||||
|
|
||||||
// Swap first two items in `networks` if first item is relay chain
|
// Swap first two items in `networks` if first item is relay chain
|
||||||
combinedEndpoints.forEach((r) => {
|
combinedEndpoints.forEach((r) => {
|
||||||
if (r.networks.length >= 2 && r.networks[0].isRelay && r.header?.toString().includes('teyrchains')) {
|
if (r.networks.length >= 2 && r.networks[0].isRelay && typeof r.header === 'string' && r.header.includes('teyrchains')) {
|
||||||
[r.networks[0], r.networks[1]] = [r.networks[1], r.networks[0]];
|
[r.networks[0], r.networks[1]] = [r.networks[1], r.networks[0]];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export interface IFavoriteChainProps {
|
|||||||
paraId?: number;
|
paraId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IFavoriteChainsStorage = Record<string, {relay: string, paraId: number}[]>
|
export type IFavoriteChainsStorage = Record<string, { relay: string, paraId: number }[]>;
|
||||||
|
|
||||||
export interface Network {
|
export interface Network {
|
||||||
isChild?: boolean;
|
isChild?: boolean;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import type { IFavoriteChainProps, IFavoriteChainsStorage } from './types.js';
|
|||||||
import { createWsEndpoints } from '@pezkuwi/apps-config';
|
import { createWsEndpoints } from '@pezkuwi/apps-config';
|
||||||
|
|
||||||
export const FAVORITE_CHAINS_KEY = 'pezkuwi-app-favorite-chains';
|
export const FAVORITE_CHAINS_KEY = 'pezkuwi-app-favorite-chains';
|
||||||
const chainsConfig = createWsEndpoints((k, v) => v?.toString() || k);
|
const chainsConfig = createWsEndpoints((k, v) => (typeof v === 'string' && v) || k);
|
||||||
|
|
||||||
export const toggleFavoriteChain = (
|
export const toggleFavoriteChain = (
|
||||||
chainInfo: IFavoriteChainProps
|
chainInfo: IFavoriteChainProps
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// This is for the use of `Ledger`
|
// This is for the use of `Ledger`
|
||||||
//
|
//
|
||||||
/* eslint-disable deprecation/deprecation */
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
||||||
|
|
||||||
import type { ApiPromise } from '@pezkuwi/api';
|
import type { ApiPromise } from '@pezkuwi/api';
|
||||||
import type { SubmittableExtrinsic } from '@pezkuwi/api/types';
|
import type { SubmittableExtrinsic } from '@pezkuwi/api/types';
|
||||||
|
|||||||
@@ -41,16 +41,18 @@ function useMultisigApprovalsImpl (address: string): [H256, Multisig][] | undefi
|
|||||||
|
|
||||||
// query all the entries for the multisig, extracting approvals with their hash
|
// query all the entries for the multisig, extracting approvals with their hash
|
||||||
useEffect((): void => {
|
useEffect((): void => {
|
||||||
trigger && api.query.multisig?.multisigs && api.query.multisig?.multisigs
|
if (trigger) {
|
||||||
.entries(address)
|
api.query.multisig?.multisigs
|
||||||
.then((infos: [StorageKey, Option<Multisig>][]): void => {
|
.entries(address)
|
||||||
mountedRef.current && setMultiInfos(
|
.then((infos: [StorageKey, Option<Multisig>][]): void => {
|
||||||
infos
|
mountedRef.current && setMultiInfos(
|
||||||
.filter(([, opt]) => opt.isSome)
|
infos
|
||||||
.map(([key, opt]) => [key.args[1] as H256, opt.unwrap()])
|
.filter(([, opt]) => opt.isSome)
|
||||||
);
|
.map(([key, opt]) => [key.args[1] as H256, opt.unwrap()])
|
||||||
})
|
);
|
||||||
.catch(console.error);
|
})
|
||||||
|
.catch(console.error);
|
||||||
|
}
|
||||||
}, [address, api, mountedRef, trigger]);
|
}, [address, api, mountedRef, trigger]);
|
||||||
|
|
||||||
return multiInfos;
|
return multiInfos;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ function useProxiesImpl (address?: string | null): State | null {
|
|||||||
useEffect((): void => {
|
useEffect((): void => {
|
||||||
setState(null);
|
setState(null);
|
||||||
|
|
||||||
address &&
|
if (address) {
|
||||||
api.query.proxy
|
api.query.proxy
|
||||||
?.proxies<ITuple<[Vec<ITuple<[AccountId, KitchensinkRuntimeProxyType]> | PezpalletProxyProxyDefinition>, BalanceOf]>>(address)
|
?.proxies<ITuple<[Vec<ITuple<[AccountId, KitchensinkRuntimeProxyType]> | PezpalletProxyProxyDefinition>, BalanceOf]>>(address)
|
||||||
.then(([_proxies]): void => {
|
.then(([_proxies]): void => {
|
||||||
@@ -65,6 +65,7 @@ function useProxiesImpl (address?: string | null): State | null {
|
|||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
|
}
|
||||||
}, [allAccounts, api, address, mountedRef]);
|
}, [allAccounts, api, address, mountedRef]);
|
||||||
|
|
||||||
return known;
|
return known;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ function Backup ({ address, onClose }: Props): React.ReactElement<Props> {
|
|||||||
const json = addressKeyring && keyring.backupAccount(addressKeyring, password);
|
const json = addressKeyring && keyring.backupAccount(addressKeyring, password);
|
||||||
const blob = new Blob([JSON.stringify(json)], { type: 'application/json; charset=utf-8' });
|
const blob = new Blob([JSON.stringify(json)], { type: 'application/json; charset=utf-8' });
|
||||||
|
|
||||||
// eslint-disable-next-line deprecation/deprecation
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||||
FileSaver.saveAs(blob, `${address}.json`);
|
FileSaver.saveAs(blob, `${address}.json`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setBackupFailed(true);
|
setBackupFailed(true);
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ function generateSeed (_seed: string | undefined | null, derivePath: string, see
|
|||||||
function updateAddress (seed: string, derivePath: string, seedType: SeedType, pairType: PairType): AddressState {
|
function updateAddress (seed: string, derivePath: string, seedType: SeedType, pairType: PairType): AddressState {
|
||||||
let address: string | null = null;
|
let address: string | null = null;
|
||||||
let deriveValidation: DeriveValidationOutput = deriveValidate(seed, seedType, derivePath, pairType);
|
let deriveValidation: DeriveValidationOutput = deriveValidate(seed, seedType, derivePath, pairType);
|
||||||
let isSeedValid = false;
|
let isSeedValid: boolean;
|
||||||
|
|
||||||
if (seedType === 'raw') {
|
if (seedType === 'raw') {
|
||||||
isSeedValid = rawValidate(seed);
|
isSeedValid = rawValidate(seed);
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function ExportAll ({ accountsByGroup, className, onClose, onStatusChange }: Pro
|
|||||||
|
|
||||||
const blob = new Blob([JSON.stringify(accounts, null, 2)], { type: 'application/json; charset=utf-8' });
|
const blob = new Blob([JSON.stringify(accounts, null, 2)], { type: 'application/json; charset=utf-8' });
|
||||||
|
|
||||||
// eslint-disable-next-line deprecation/deprecation
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||||
FileSaver.saveAs(blob, `batch_exported_accounts_${new Date().getTime()}.json`);
|
FileSaver.saveAs(blob, `batch_exported_accounts_${new Date().getTime()}.json`);
|
||||||
|
|
||||||
status.status = 'success';
|
status.status = 'success';
|
||||||
@@ -138,7 +138,7 @@ function ExportAll ({ accountsByGroup, className, onClose, onStatusChange }: Pro
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const BrowserAccounts = ({ accounts, allPassword, setAllPassword }: {accounts: string[], allPassword: TPassword[], setAllPassword: React.Dispatch<React.SetStateAction<TPassword[]>>}) => {
|
const BrowserAccounts = ({ accounts, allPassword, setAllPassword }: { accounts: string[], allPassword: TPassword[], setAllPassword: React.Dispatch<React.SetStateAction<TPassword[]>> }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const _onChangePass = useCallback(
|
const _onChangePass = useCallback(
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { MarkWarning } from '@pezkuwi/react-components';
|
|||||||
|
|
||||||
import { useTranslation } from '../translate.js';
|
import { useTranslation } from '../translate.js';
|
||||||
|
|
||||||
const isElectron = navigator.userAgent.toLowerCase().indexOf(' electron/') > -1;
|
const isElectron = navigator.userAgent.toLowerCase().includes(' electron/');
|
||||||
|
|
||||||
function ExternalWarning (): React.ReactElement | null {
|
function ExternalWarning (): React.ReactElement | null {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ interface PeopleIdentityInfo extends Struct {
|
|||||||
const WHITESPACE = [' ', '\t'];
|
const WHITESPACE = [' ', '\t'];
|
||||||
|
|
||||||
function setData (data: Data, setActive: null | ((isActive: boolean) => void), setVal: (val: string) => void): void {
|
function setData (data: Data, setActive: null | ((isActive: boolean) => void), setVal: (val: string) => void): void {
|
||||||
if (data && data.isRaw) {
|
if (data?.isRaw) {
|
||||||
setActive && setActive(true);
|
setActive?.(true);
|
||||||
setVal(u8aToString(data.asRaw.toU8a(true)));
|
setVal(u8aToString(data.asRaw.toU8a(true)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,7 +64,7 @@ function setAdditionalFieldData (api: ApiPromise, info: IdentityInfo, key: strin
|
|||||||
const dataNone = api.registry.createType('Data', '');
|
const dataNone = api.registry.createType('Data', '');
|
||||||
const value = info.additional.find((v) => v[0].eq(dataKey))?.[1] || dataNone;
|
const value = info.additional.find((v) => v[0].eq(dataKey))?.[1] || dataNone;
|
||||||
|
|
||||||
if (value && value.isRaw) {
|
if (value?.isRaw) {
|
||||||
setData(value, setActive, setVal);
|
setData(value, setActive, setVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ function setAdditionalFieldData (api: ApiPromise, info: IdentityInfo, key: strin
|
|||||||
|
|
||||||
function setDiscordFieldData (info: PeopleIdentityInfo, setActive: null | ((isActive: boolean) => void), setVal: (val: string) => void): Data {
|
function setDiscordFieldData (info: PeopleIdentityInfo, setActive: null | ((isActive: boolean) => void), setVal: (val: string) => void): Data {
|
||||||
if (info.discord && !info.discord.isNone) {
|
if (info.discord && !info.discord.isNone) {
|
||||||
setActive && setActive(true);
|
setActive?.(true);
|
||||||
setVal(u8aToString(info.discord.asRaw.toU8a(true)));
|
setVal(u8aToString(info.discord.asRaw.toU8a(true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -124,7 +124,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
|
|||||||
const [isPalletChecked, setIsPalletChecked] = useState<boolean>(false);
|
const [isPalletChecked, setIsPalletChecked] = useState<boolean>(false);
|
||||||
|
|
||||||
useEffect((): void => {
|
useEffect((): void => {
|
||||||
if (identityOpt && identityOpt.isSome) {
|
if (identityOpt?.isSome) {
|
||||||
const identity = identityOpt.unwrap();
|
const identity = identityOpt.unwrap();
|
||||||
const foundInfo = Array.isArray(identity) ? identity[0].info : (identity as Registration).info;
|
const foundInfo = Array.isArray(identity) ? identity[0].info : (identity as Registration).info;
|
||||||
|
|
||||||
@@ -150,7 +150,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
|
|||||||
: [foundInfo.display, foundInfo.email, (foundInfo as unknown as PeopleIdentityInfo).github, foundInfo.legal, (foundInfo as unknown as PeopleIdentityInfo).matrix, foundInfo.twitter, infoDiscord, foundInfo.web];
|
: [foundInfo.display, foundInfo.email, (foundInfo as unknown as PeopleIdentityInfo).github, foundInfo.legal, (foundInfo as unknown as PeopleIdentityInfo).matrix, foundInfo.twitter, infoDiscord, foundInfo.web];
|
||||||
|
|
||||||
previousKeys.some((info: Data | null) => {
|
previousKeys.some((info: Data | null) => {
|
||||||
if (info && info.isRaw) {
|
if (info?.isRaw) {
|
||||||
setGotPreviousIdentity(true);
|
setGotPreviousIdentity(true);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ interface TPassword {
|
|||||||
|
|
||||||
type FileAccount = (KeyringPair$Json | KeyringPair);
|
type FileAccount = (KeyringPair$Json | KeyringPair);
|
||||||
|
|
||||||
type File = FileAccount[]
|
type File = FileAccount[];
|
||||||
|
|
||||||
const acceptedFormats = ['application/json'];
|
const acceptedFormats = ['application/json'];
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
// This is for the use of `Ledger`
|
// This is for the use of `Ledger`
|
||||||
//
|
//
|
||||||
/* eslint-disable deprecation/deprecation */
|
/* eslint-disable @typescript-eslint/no-deprecated */
|
||||||
|
|
||||||
import type { ApiPromise } from '@pezkuwi/api';
|
import type { ApiPromise } from '@pezkuwi/api';
|
||||||
import type { Ledger, LedgerGeneric } from '@pezkuwi/hw-ledger';
|
import type { Ledger, LedgerGeneric } from '@pezkuwi/hw-ledger';
|
||||||
|
|||||||
@@ -140,7 +140,6 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold = 0, who
|
|||||||
? isMultiCall && isCallOverride
|
? isMultiCall && isCallOverride
|
||||||
? callData
|
? callData
|
||||||
? multiMod.asMulti.meta.args.length === 5
|
? multiMod.asMulti.meta.args.length === 5
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
||||||
? multiMod.asMulti(threshold, others as any, multisig.when, callData.toHex(), weight as any)
|
? multiMod.asMulti(threshold, others as any, multisig.when, callData.toHex(), weight as any)
|
||||||
: multiMod.asMulti.meta.args.length === 6
|
: multiMod.asMulti.meta.args.length === 6
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
@@ -151,7 +150,6 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold = 0, who
|
|||||||
: multiMod.asMulti(threshold, others as any, multisig.when, callData)
|
: multiMod.asMulti(threshold, others as any, multisig.when, callData)
|
||||||
: null
|
: null
|
||||||
: multiMod.approveAsMulti.meta.args.length === 5
|
: multiMod.approveAsMulti.meta.args.length === 5
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
||||||
? multiMod.approveAsMulti(threshold, others as any, multisig.when, hash, weight as any)
|
? multiMod.approveAsMulti(threshold, others as any, multisig.when, hash, weight as any)
|
||||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ function ProxyOverview ({ className, onClose, previousProxy: [existing] = EMPTY_
|
|||||||
[api]
|
[api]
|
||||||
);
|
);
|
||||||
|
|
||||||
const isSameAdd = added.some(([accountId]) => accountId && accountId.eq(proxiedAccount));
|
const isSameAdd = added.some(([accountId]) => accountId?.eq(proxiedAccount));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<StyledModal
|
<StyledModal
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export function createMenuGroup (key: string, items: (React.ReactNode | false |
|
|||||||
export type AccountIdIsh = AccountId | AccountIndex | Address | string | Uint8Array | null;
|
export type AccountIdIsh = AccountId | AccountIndex | Address | string | Uint8Array | null;
|
||||||
|
|
||||||
export function downloadAccount ({ json, pair }: CreateResult): void {
|
export function downloadAccount ({ json, pair }: CreateResult): void {
|
||||||
// eslint-disable-next-line deprecation/deprecation
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||||
FileSaver.saveAs(
|
FileSaver.saveAs(
|
||||||
new Blob([JSON.stringify(json)], { type: 'application/json; charset=utf-8' }),
|
new Blob([JSON.stringify(json)], { type: 'application/json; charset=utf-8' }),
|
||||||
`${pair.address}.json`
|
`${pair.address}.json`
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ function Export ({ sortedAddresses }: Props): React.ReactElement<Props> {
|
|||||||
|
|
||||||
const blob = new Blob([JSON.stringify(accounts, null, 2)], { type: 'application/json; charset=utf-8' });
|
const blob = new Blob([JSON.stringify(accounts, null, 2)], { type: 'application/json; charset=utf-8' });
|
||||||
|
|
||||||
// eslint-disable-next-line deprecation/deprecation
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
||||||
FileSaver.saveAs(blob, `batch_exported_address_book_${new Date().getTime()}.json`);
|
FileSaver.saveAs(blob, `batch_exported_address_book_${new Date().getTime()}.json`);
|
||||||
|
|
||||||
/** ********************* ************** ************************/
|
/** ********************* ************** ************************/
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ function Import ({ favorites, onStatusChange, toggleFavorite }: Props): React.Re
|
|||||||
status
|
status
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[onStatusChange, t]
|
[onStatusChange, t]
|
||||||
);
|
);
|
||||||
|
|
||||||
const validateAccountInfo = useCallback(({ address: addressInput, name }: SaveFile) => {
|
const validateAccountInfo = useCallback(({ address: addressInput, name }: SaveFile) => {
|
||||||
|
|||||||
@@ -7,4 +7,4 @@ export interface SortedAddress { address: string; isFavorite: boolean, isVisible
|
|||||||
|
|
||||||
export interface SaveFile { address: string; isFavorite: boolean, name: string }
|
export interface SaveFile { address: string; isFavorite: boolean, name: string }
|
||||||
|
|
||||||
export type FunInputFile = (e: React.ChangeEvent<HTMLInputElement>) => void
|
export type FunInputFile = (e: React.ChangeEvent<HTMLInputElement>) => void;
|
||||||
@@ -18,7 +18,7 @@ function useMemberInfoImpl (accountId: string): MemberInfo | undefined {
|
|||||||
() => depositOf && {
|
() => depositOf && {
|
||||||
accountId,
|
accountId,
|
||||||
deposit: depositOf.unwrapOr(null),
|
deposit: depositOf.unwrapOr(null),
|
||||||
isUpForKicking: upForKicking && upForKicking.isTrue,
|
isUpForKicking: upForKicking?.isTrue,
|
||||||
retiringAt: retiringAt?.unwrapOr(null)
|
retiringAt: retiringAt?.unwrapOr(null)
|
||||||
},
|
},
|
||||||
[accountId, depositOf, retiringAt, upForKicking]
|
[accountId, depositOf, retiringAt, upForKicking]
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ const BASE_BORDER = 0.125;
|
|||||||
const BORDER_TOP = `${BASE_BORDER * 3}rem solid var(--bg-page)`;
|
const BORDER_TOP = `${BASE_BORDER * 3}rem solid var(--bg-page)`;
|
||||||
const BORDER_RADIUS = `${BASE_BORDER * 4}rem`;
|
const BORDER_RADIUS = `${BASE_BORDER * 4}rem`;
|
||||||
|
|
||||||
const StyledTr = styled.tr<{isFirstItem: boolean; isLastItem: boolean}>`
|
const StyledTr = styled.tr<{ isFirstItem: boolean; isLastItem: boolean }>`
|
||||||
td {
|
td {
|
||||||
border-top: ${(props) => props.isFirstItem && BORDER_TOP};
|
border-top: ${(props) => props.isFirstItem && BORDER_TOP};
|
||||||
border-radius: 0rem !important;
|
border-radius: 0rem !important;
|
||||||
|
|||||||
@@ -34,8 +34,7 @@ function Balances ({ className, infos = [] }: Props): React.ReactElement<Props>
|
|||||||
|
|
||||||
const completeAssets = useMemo(
|
const completeAssets = useMemo(
|
||||||
() => infos
|
() => infos
|
||||||
.filter((i): i is AssetInfoComplete => !!(i.details && i.metadata) && !i.details.supply.isZero())
|
.filter((i): i is AssetInfoComplete => !!(i.details && i.metadata) && !i.details.supply.isZero()),
|
||||||
,
|
|
||||||
[infos]
|
[infos]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ function Mint ({ className, details: { issuer, minBalance }, id, metadata, onClo
|
|||||||
const [recipientId, setRecipientId] = useState<string | null>(null);
|
const [recipientId, setRecipientId] = useState<string | null>(null);
|
||||||
|
|
||||||
const isAmountValid = useMemo(
|
const isAmountValid = useMemo(
|
||||||
() => amount && amount.gte(minBalance),
|
() => amount?.gte(minBalance),
|
||||||
[amount, minBalance]
|
[amount, minBalance]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ function Query ({ className = '', onQuery }: Props): React.ReactElement<Props> {
|
|||||||
|
|
||||||
const _onQuery = useCallback(
|
const _onQuery = useCallback(
|
||||||
(): void => {
|
(): void => {
|
||||||
onQuery && onQuery(input);
|
onQuery?.(input);
|
||||||
},
|
},
|
||||||
[input, onQuery]
|
[input, onQuery]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ function AssetApp ({ basePath, className }: Props): React.ReactElement<Props> {
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
const showForeignAssetsTab = useMemo(() => !!foreignAssetLocations.length, [foreignAssetLocations.length]);
|
const showForeignAssetsTab = useMemo(() => !!foreignAssetLocations.length, [foreignAssetLocations.length]);
|
||||||
const showBalancesTab = useMemo(() => hasAccounts && infos && infos.some(({ details, metadata }) => !!(details && metadata)), [hasAccounts, infos]);
|
const showBalancesTab = useMemo(() => hasAccounts && infos?.some(({ details, metadata }) => !!(details && metadata)), [hasAccounts, infos]);
|
||||||
|
|
||||||
const hidden = useMemo(
|
const hidden = useMemo(
|
||||||
() =>
|
() =>
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function useForeignAssetInfosImpl (locations?: StagingXcmV3MultiLocation[]): For
|
|||||||
const [state, setState] = useState<ForeignAssetInfo[] | undefined>();
|
const [state, setState] = useState<ForeignAssetInfo[] | undefined>();
|
||||||
|
|
||||||
useEffect((): void => {
|
useEffect((): void => {
|
||||||
details && metadata && (details[0][0].length === metadata[0][0].length) &&
|
details && details[0][0].length === metadata?.[0][0].length &&
|
||||||
setState(
|
setState(
|
||||||
details[0][0].map((location, index) =>
|
details[0][0].map((location, index) =>
|
||||||
extractInfo(allAccounts, location, details[1][index], metadata[1][index])
|
extractInfo(allAccounts, location, details[1][index], metadata[1][index])
|
||||||
|
|||||||
@@ -52,9 +52,9 @@ jest.mock('./hooks/useBounties', () => ({
|
|||||||
|
|
||||||
let aProposal: (extrinsic: SubmittableExtrinsic<'promise'>, ayes?: string[], nays?: string[]) => DeriveCollectiveProposal;
|
let aProposal: (extrinsic: SubmittableExtrinsic<'promise'>, ayes?: string[], nays?: string[]) => DeriveCollectiveProposal;
|
||||||
let augmentedApi: any;
|
let augmentedApi: any;
|
||||||
let aBounty: ({ status, value }?: Partial<PezpalletBountiesBounty>) => PezpalletBountiesBounty;
|
let aBounty: (bounty?: Partial<PezpalletBountiesBounty>) => PezpalletBountiesBounty;
|
||||||
let aBountyIndex: (index?: number) => BountyIndex;
|
let aBountyIndex: (index?: number) => BountyIndex;
|
||||||
let bountyStatusWith: ({ curator, status, updateDue }: { curator?: string, status?: string, updateDue?: number}) => PezpalletBountiesBountyStatus;
|
let bountyStatusWith: ({ curator, status, updateDue }: { curator?: string, status?: string, updateDue?: number }) => PezpalletBountiesBountyStatus;
|
||||||
let bountyWith: ({ status, value }: { status?: string, value?: number }) => PezpalletBountiesBounty;
|
let bountyWith: ({ status, value }: { status?: string, value?: number }) => PezpalletBountiesBounty;
|
||||||
|
|
||||||
describe('Bounties', () => {
|
describe('Bounties', () => {
|
||||||
|
|||||||
@@ -53,14 +53,14 @@ function Index ({ bestNumber, className, description, index, proposals, status }
|
|||||||
|
|
||||||
const existingCloseBountyProposal = useMemo(
|
const existingCloseBountyProposal = useMemo(
|
||||||
() => proposals?.find(({ proposal }) =>
|
() => proposals?.find(({ proposal }) =>
|
||||||
proposal && proposal.method === 'closeBounty'
|
proposal?.method === 'closeBounty'
|
||||||
),
|
),
|
||||||
[proposals]
|
[proposals]
|
||||||
);
|
);
|
||||||
|
|
||||||
const existingUnassignCuratorProposal = useMemo(
|
const existingUnassignCuratorProposal = useMemo(
|
||||||
() => proposals?.find(({ proposal }) =>
|
() => proposals?.find(({ proposal }) =>
|
||||||
proposal && proposal.method === 'unassignCurator'
|
proposal?.method === 'unassignCurator'
|
||||||
),
|
),
|
||||||
[proposals]
|
[proposals]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ export function determineUnassignCuratorAction (roles: UserRole[], status: Pezpa
|
|||||||
actions.push('SlashCuratorMotion');
|
actions.push('SlashCuratorMotion');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roles.includes('User') && blocksUntilUpdate && blocksUntilUpdate.lt(BN_ZERO)) {
|
if (roles.includes('User') && blocksUntilUpdate?.lt(BN_ZERO)) {
|
||||||
actions.push('SlashCuratorAction');
|
actions.push('SlashCuratorAction');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export interface BountyStatusType {
|
|||||||
export type HelpMessages = Record<StatusName, string>;
|
export type HelpMessages = Record<StatusName, string>;
|
||||||
|
|
||||||
export type StatusName = 'Active' | 'Approved' | 'CuratorProposed' | 'Funded' | 'PendingPayout' | 'Proposed';
|
export type StatusName = 'Active' | 'Approved' | 'CuratorProposed' | 'Funded' | 'PendingPayout' | 'Proposed';
|
||||||
export type BountyVotingStatuses = { [status in StatusName]: string[] };
|
export type BountyVotingStatuses = Record<StatusName, string[]>;
|
||||||
export type ValidUnassignCuratorAction = 'UnassignCurator' | 'SlashCuratorMotion' | 'SlashCuratorAction';
|
export type ValidUnassignCuratorAction = 'UnassignCurator' | 'SlashCuratorMotion' | 'SlashCuratorAction';
|
||||||
export type UnassignCuratorAction = ValidUnassignCuratorAction | 'None';
|
export type UnassignCuratorAction = ValidUnassignCuratorAction | 'None';
|
||||||
export type UserRole = 'User' | 'Member' | 'Curator' | 'None';
|
export type UserRole = 'User' | 'Member' | 'Curator' | 'None';
|
||||||
@@ -37,7 +37,7 @@ function aGenesisHash () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type FindOne = (match: string) => Promise<HTMLElement>;
|
type FindOne = (match: string) => Promise<HTMLElement>;
|
||||||
type FindManyWithMatcher = (match: string | ((match: string) => boolean)) => Promise<HTMLElement[]>
|
type FindManyWithMatcher = (match: string | ((match: string) => boolean)) => Promise<HTMLElement[]>;
|
||||||
type GetMany = (match: string) => HTMLElement[];
|
type GetMany = (match: string) => HTMLElement[];
|
||||||
|
|
||||||
class NotYetRendered extends Error {
|
class NotYetRendered extends Error {
|
||||||
@@ -57,7 +57,7 @@ interface RenderedBountiesPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class BountiesPage {
|
export class BountiesPage {
|
||||||
aBounty: ({ status, value }?: Partial<PezpalletBountiesBounty>) => PezpalletBountiesBounty;
|
aBounty: (bounty?: Partial<PezpalletBountiesBounty>) => PezpalletBountiesBounty;
|
||||||
aBountyIndex: (index?: number) => BountyIndex;
|
aBountyIndex: (index?: number) => BountyIndex;
|
||||||
aBountyStatus: (status: string) => PezpalletBountiesBountyStatus;
|
aBountyStatus: (status: string) => PezpalletBountiesBountyStatus;
|
||||||
bountyStatusWith: ({ curator, status }: { curator?: string, status?: string, }) => PezpalletBountiesBountyStatus;
|
bountyStatusWith: ({ curator, status }: { curator?: string, status?: string, }) => PezpalletBountiesBountyStatus;
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ function Filters ({ data, onFilter }: Props): React.ReactElement<Props> {
|
|||||||
const coreArr: number[] = useMemo(() =>
|
const coreArr: number[] = useMemo(() =>
|
||||||
data?.length
|
data?.length
|
||||||
? Array.from({ length: data.length || 0 }, (_, index) => index)
|
? Array.from({ length: data.length || 0 }, (_, index) => index)
|
||||||
: []
|
: [],
|
||||||
, [data]);
|
[data]);
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const teyrchainId = useDebounce(_teyrchainId);
|
const teyrchainId = useDebounce(_teyrchainId);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ function RegionLength ({ children, className }: Props): React.ReactElement<Props
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className}>
|
<div className={className}>
|
||||||
{length?.toString() || '-'}
|
{typeof length === 'number' ? length : '-'}
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ function Workload ({ api, config, core, workload, workplan }: Props): React.Reac
|
|||||||
const { currentRegion, status } = useBrokerContext();
|
const { currentRegion, status } = useBrokerContext();
|
||||||
|
|
||||||
const currentTimeSlice = useMemo(() =>
|
const currentTimeSlice = useMemo(() =>
|
||||||
status?.lastTimeslice ?? 0
|
status?.lastTimeslice ?? 0,
|
||||||
, [status]);
|
[status]);
|
||||||
|
|
||||||
const regionInfo = useRegions(api);
|
const regionInfo = useRegions(api);
|
||||||
const regionOwnerInfo: RegionInfo | undefined = useMemo(() => regionInfo?.find((v) => v.core === core && v.start <= currentTimeSlice && v.end > currentTimeSlice), [regionInfo, core, currentTimeSlice]);
|
const regionOwnerInfo: RegionInfo | undefined = useMemo(() => regionInfo?.find((v) => v.core === core && v.start <= currentTimeSlice && v.end > currentTimeSlice), [regionInfo, core, currentTimeSlice]);
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ interface Props {
|
|||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
type LeaseMapType = Record<number, LegacyLease>
|
type LeaseMapType = Record<number, LegacyLease>;
|
||||||
type ReservationMapType = Record<number, Reservation>
|
type ReservationMapType = Record<number, Reservation>;
|
||||||
|
|
||||||
const formatDataObject = (one: CoreWorkplan | CoreWorkload, leaseMap: LeaseMapType, reservationMap: ReservationMapType) => ({
|
const formatDataObject = (one: CoreWorkplan | CoreWorkload, leaseMap: LeaseMapType, reservationMap: ReservationMapType) => ({
|
||||||
...one,
|
...one,
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ function DayItem ({ className, item: { blockNumber, date, info, type }, showAllE
|
|||||||
: ['teyrchainAuction'].includes(type)
|
: ['teyrchainAuction'].includes(type)
|
||||||
? createLink('teyrchains/auction', t('via Teyrchains/Auction'))
|
? createLink('teyrchains/auction', t('via Teyrchains/Auction'))
|
||||||
: undefined;
|
: undefined;
|
||||||
let s = '';
|
let s: string;
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'councilElection':
|
case 'councilElection':
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import type { BN } from '@pezkuwi/util';
|
import type { BN } from '@pezkuwi/util';
|
||||||
|
|
||||||
export type EntryType = 'councilElection' | 'councilMotion' | 'democracyDispatch' | 'democracyLaunch' | 'teyrchainAuction' | 'teyrchainLease' | 'referendumDispatch' | 'referendumVote' | 'scheduler' | 'societyChallenge' | 'societyRotate'| 'stakingEpoch' | 'stakingEra' | 'stakingSlash' | 'treasurySpend';
|
export type EntryType = 'councilElection' | 'councilMotion' | 'democracyDispatch' | 'democracyLaunch' | 'teyrchainAuction' | 'teyrchainLease' | 'referendumDispatch' | 'referendumVote' | 'scheduler' | 'societyChallenge' | 'societyRotate' | 'stakingEpoch' | 'stakingEra' | 'stakingSlash' | 'treasurySpend';
|
||||||
|
|
||||||
export interface EntryInfo {
|
export interface EntryInfo {
|
||||||
blockNumber: BN;
|
blockNumber: BN;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { AddressMini, Card, styled } from '@pezkuwi/react-components';
|
|||||||
import { useTranslation } from './translate.js';
|
import { useTranslation } from './translate.js';
|
||||||
import usePezkuwiPreclaims from './usePezkuwiPreclaims.js';
|
import usePezkuwiPreclaims from './usePezkuwiPreclaims.js';
|
||||||
|
|
||||||
export interface Props{
|
export interface Props {
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ enum Step {
|
|||||||
Account = 0,
|
Account = 0,
|
||||||
ETHAddress = 1,
|
ETHAddress = 1,
|
||||||
Sign = 2,
|
Sign = 2,
|
||||||
Claim = 3,
|
Claim = 3
|
||||||
}
|
}
|
||||||
|
|
||||||
const PRECLAIMS_LOADING = 'PRECLAIMS_LOADING';
|
const PRECLAIMS_LOADING = 'PRECLAIMS_LOADING';
|
||||||
@@ -105,7 +105,7 @@ function ClaimsApp ({ basePath }: Props): React.ReactElement<Props> {
|
|||||||
setEthereumAddress(null);
|
setEthereumAddress(null);
|
||||||
setPreclaimEthereumAddress(PRECLAIMS_LOADING);
|
setPreclaimEthereumAddress(PRECLAIMS_LOADING);
|
||||||
|
|
||||||
if (!api.query.claims || !api.query.claims.preclaims) {
|
if (!api.query.claims?.preclaims) {
|
||||||
return setPreclaimEthereumAddress(null);
|
return setPreclaimEthereumAddress(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ declare module 'react-copy-to-clipboard' {
|
|||||||
options?: Options;
|
options?: Options;
|
||||||
}
|
}
|
||||||
|
|
||||||
function CopyToClipboard(props: Props): ReactElement;
|
function CopyToClipboard (props: Props): ReactElement;
|
||||||
|
|
||||||
export = CopyToClipboard;
|
export = CopyToClipboard;
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,7 @@ function Code ({ className, code, onShowDeploy }: Props): React.ReactElement<Pro
|
|||||||
|
|
||||||
const _onDeployConstructor = useCallback(
|
const _onDeployConstructor = useCallback(
|
||||||
(constructorIndex?: number): void => {
|
(constructorIndex?: number): void => {
|
||||||
onShowDeploy && onShowDeploy(code.json.codeHash, constructorIndex || 0);
|
onShowDeploy?.(code.json.codeHash, constructorIndex || 0);
|
||||||
},
|
},
|
||||||
[code, onShowDeploy]
|
[code, onShowDeploy]
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -97,7 +97,6 @@ function Upload ({ onClose }: Props): React.ReactElement {
|
|||||||
: api.registry.createType('Balance', BN_ZERO),
|
: api.registry.createType('Balance', BN_ZERO),
|
||||||
weight.weightV2,
|
weight.weightV2,
|
||||||
null,
|
null,
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
||||||
{ Upload: api.registry.createType('Raw', wasm) } as any,
|
{ Upload: api.registry.createType('Raw', wasm) } as any,
|
||||||
contractAbi?.constructors[constructorIndex]?.toU8a(params),
|
contractAbi?.constructors[constructorIndex]?.toU8a(params),
|
||||||
''
|
''
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
// Copyright 2017-2026 @pezkuwi/app-contracts authors & contributors
|
// Copyright 2017-2026 @pezkuwi/app-contracts authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
/* eslint-disable camelcase */
|
|
||||||
|
|
||||||
import type { Option } from '@pezkuwi/types';
|
import type { Option } from '@pezkuwi/types';
|
||||||
import type { PrefabWasmModule } from '@pezkuwi/types/interfaces';
|
import type { PrefabWasmModule } from '@pezkuwi/types/interfaces';
|
||||||
|
|
||||||
|
|||||||
@@ -138,11 +138,11 @@ function Call ({ className = '', contract, messageIndex, onCallResult, onChangeM
|
|||||||
params,
|
params,
|
||||||
when: new Date()
|
when: new Date()
|
||||||
}, ...outcomes]);
|
}, ...outcomes]);
|
||||||
onCallResult && onCallResult(messageIndex, result);
|
onCallResult?.(messageIndex, result);
|
||||||
})
|
})
|
||||||
.catch((error): void => {
|
.catch((error): void => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
onCallResult && onCallResult(messageIndex);
|
onCallResult?.(messageIndex);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
[accountId, contract.query, message, messageIndex, onCallResult, outcomes, params, value, weight]
|
[accountId, contract.query, message, messageIndex, onCallResult, outcomes, params, value, weight]
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ function Deploy ({ codeHash, constructorIndex = 0, onClose, setConstructorIndex
|
|||||||
tags: []
|
tags: []
|
||||||
});
|
});
|
||||||
|
|
||||||
onClose && onClose();
|
onClose?.();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[api, name, onClose]
|
[api, name, onClose]
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ function RemoveABI ({ code, onClose, onRemove }: Props): React.ReactElement<Prop
|
|||||||
|
|
||||||
const _onRemove = useCallback(
|
const _onRemove = useCallback(
|
||||||
(): void => {
|
(): void => {
|
||||||
onClose && onClose();
|
onClose?.();
|
||||||
onRemove();
|
onRemove();
|
||||||
},
|
},
|
||||||
[onClose, onRemove]
|
[onClose, onRemove]
|
||||||
|
|||||||
Loaded 100 of 325 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user