Collators support (#7495)

* Collators support

* Ordering

* Adjust

* Adjust icons

* Bump API

* Adjust

* Rebuild
This commit is contained in:
Jaco 2022-04-30 14:07:00 +02:00 committed by GitHub
parent 4a4b6e0a43
commit 3bf0562a51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 693 additions and 140 deletions

View File

@ -91,24 +91,24 @@
"webpack-cli": "^4.9.2"
},
"resolutions": {
"@polkadot/api": "^8.2.2-8",
"@polkadot/api-augment": "^8.2.2-8",
"@polkadot/api-base": "^8.2.2-8",
"@polkadot/api-contract": "^8.2.2-8",
"@polkadot/api-derive": "^8.2.2-8",
"@polkadot/api": "^8.2.2-9",
"@polkadot/api-augment": "^8.2.2-9",
"@polkadot/api-base": "^8.2.2-9",
"@polkadot/api-contract": "^8.2.2-9",
"@polkadot/api-derive": "^8.2.2-9",
"@polkadot/hw-ledger": "^9.1.1",
"@polkadot/keyring": "^9.1.1",
"@polkadot/networks": "^9.1.1",
"@polkadot/phishing": "^0.12.1",
"@polkadot/rpc-augment": "^8.2.2-8",
"@polkadot/rpc-core": "^8.2.2-8",
"@polkadot/rpc-provider": "^8.2.2-8",
"@polkadot/types": "^8.2.2-8",
"@polkadot/types-augment": "^8.2.2-8",
"@polkadot/types-codec": "^8.2.2-8",
"@polkadot/types-create": "^8.2.2-8",
"@polkadot/types-known": "^8.2.2-8",
"@polkadot/types-support": "^8.2.2-8",
"@polkadot/rpc-augment": "^8.2.2-9",
"@polkadot/rpc-core": "^8.2.2-9",
"@polkadot/rpc-provider": "^8.2.2-9",
"@polkadot/types": "^8.2.2-9",
"@polkadot/types-augment": "^8.2.2-9",
"@polkadot/types-codec": "^8.2.2-9",
"@polkadot/types-create": "^8.2.2-9",
"@polkadot/types-known": "^8.2.2-9",
"@polkadot/types-support": "^8.2.2-9",
"@polkadot/util": "^9.1.1",
"@polkadot/util-crypto": "^9.1.1",
"@polkadot/wasm-crypto": "^6.0.1",

View File

@ -29,10 +29,10 @@
"@metaverse-network-sdk/type-definitions": "^0.0.1-13",
"@parallel-finance/type-definitions": "1.6.7",
"@phala/typedefs": "0.2.30",
"@polkadot/api": "^8.2.2-8",
"@polkadot/api-derive": "^8.2.2-8",
"@polkadot/api": "^8.2.2-9",
"@polkadot/api-derive": "^8.2.2-9",
"@polkadot/networks": "^9.1.1",
"@polkadot/types": "^8.2.2-8",
"@polkadot/types": "^8.2.2-9",
"@polkadot/util": "^9.1.1",
"@polkadot/x-fetch": "^9.1.1",
"@polymathnetwork/polymesh-types": "0.0.2",

View File

@ -402,7 +402,7 @@ export function createKusama (t: TFunction): EndpointOption {
info: 'shiden',
homepage: 'https://shiden.astar.network/',
paraId: 2120,
text: t('rpc.kusama.shiden', 'Shiden Crowdloan 2', { ns: 'apps-config' }),
text: t('rpc.kusama.shiden2', 'Shiden Crowdloan 2', { ns: 'apps-config' }),
isUnreachable: true,
providers: {
StakeTechnologies: 'wss://rpc.shiden.astar.network'

View File

@ -0,0 +1,22 @@
// Copyright 2017-2022 @polkadot/apps-routing authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { TFunction } from 'i18next';
import type { Route } from './types';
import Component from '@polkadot/app-collator';
export default function create (t: TFunction): Route {
return {
Component,
display: {
needsApi: [
'query.collatorSelection.candidacyBond'
]
},
group: 'network',
icon: 'timeline',
name: 'collators',
text: t('nav.collator', 'Collators', { ns: 'apps-routing' })
};
}

View File

@ -10,6 +10,7 @@ import assets from './assets';
import bounties from './bounties';
import calendar from './calendar';
import claims from './claims';
import collator from './collator';
import contracts from './contracts';
import council from './council';
import democracy from './democracy';
@ -44,6 +45,7 @@ export default function create (t: TFunction): Routes {
transfer(t),
teleport(t),
staking(t),
collator(t),
democracy(t),
council(t),
treasury(t),

View File

@ -0,0 +1,9 @@
{
"No running collators": "No running collators",
"Overview": "Overview",
"balance": "balance",
"collators": "collators",
"deposit": "deposit",
"desired": "desired",
"last #": "last #"
}

View File

@ -173,7 +173,6 @@
"The funds will only be available for withdrawal after the unbonding period, however will not be part of the staked amount after the next validator election. You can follow the unlock countdown in the UI.": "The funds will only be available for withdrawal after the unbonding period, however will not be part of the staked amount after the next validator election. You can follow the unlock countdown in the UI.",
"The hex output from author_rotateKeys, as executed on the validator node. The keys will show as pending until applied at the start of a new session.": "The hex output from author_rotateKeys, as executed on the validator node. The keys will show as pending until applied at the start of a new session.",
"The id that will be assigned to this nomination pool.": "The id that will be assigned to this nomination pool.",
"The initial value to assign to the pool. It is set the the maximum of the minimum bond and the minium nomination value.": "The initial value to assign to the pool. It is set the the maximum of the minimum bond and the minium nomination value.",
"The initial value to assign to the pool. It is set to the maximum of the minimum bond and the minium nomination value.": "The initial value to assign to the pool. It is set to the maximum of the minimum bond and the minium nomination value.",
"The key type and crypto type to use for this key. Be aware that different keys have different crypto requirements. You should be familiar with the type requirements for the different keys.": "The key type and crypto type to use for this key. Be aware that different keys have different crypto requirements. You should be familiar with the type requirements for the different keys.",
"The metadata description to set for this pool": "The metadata description to set for this pool",
@ -248,7 +247,6 @@
"crypto type to use": "crypto type to use",
"currently elected": "currently elected",
"defer": "defer",
"delegators": "delegators",
"description": "description",
"ed25519, Edwards": "ed25519, Edwards",
"elected stake": "elected stake",
@ -271,8 +269,6 @@
"last reward": "last reward",
"lowest / avg staked": "lowest / avg staked",
"max": "max",
"max. delegators": "max. delegators",
"max. delegators / pool": "max. delegators / pool",
"max. members": "max. members",
"max. members / pool": "max. members / pool",
"member account": "member account",

View File

@ -50,6 +50,7 @@
"rpc.kusama.sakura": "Sakura",
"rpc.kusama.shadow": "Crust Shadow",
"rpc.kusama.shiden": "Shiden",
"rpc.kusama.shiden2": "Shiden Crowdloan 2",
"rpc.kusama.sora_ksm": "SORA Kusama Parachain",
"rpc.kusama.standard": "Unorthodox",
"rpc.kusama.statemine": "Statemine",
@ -128,7 +129,7 @@
"rpc.prod.westlake": "Westlake",
"rpc.rococo": "Rococo",
"rpc.rococo.arctic": "Arctic",
"rpc.rococo.bajun": "Bajun",
"rpc.rococo.bajun": "Bajun Network",
"rpc.rococo.basilisk": "Basilisk",
"rpc.rococo.bitgreen": "Bitgreen",
"rpc.rococo.canvas": "Canvas",
@ -194,7 +195,6 @@
"rpc.test.nodle-arcadia": "Arcadia",
"rpc.test.oak": "Neumann Network",
"rpc.test.opportunity": "Opportunity",
"rpc.test.origintrail": "OriginTrail Parachain Testnet",
"rpc.test.pangolin": "Pangolin",
"rpc.test.pangoro": "Pangoro",
"rpc.test.phala": "Phala (PoC 5)",

View File

@ -5,6 +5,7 @@
"nav.bounties": "Bounties",
"nav.calendar": "Event calendar",
"nav.claims": "Claim Tokens",
"nav.collator": "Collators",
"nav.contracts": "Contracts",
"nav.council": "Council",
"nav.democracy": "Democracy",

View File

@ -5,6 +5,7 @@
"app-bounties.json",
"app-calendar.json",
"app-claims.json",
"app-collator.json",
"app-contracts.json",
"app-council.json",
"app-democracy.json",

View File

@ -261,7 +261,6 @@
"crowdloan": "",
"curator": "",
"defender": "",
"delegators": "",
"denomination vote": "",
"deploy": "",
"deployment account": "",

View File

View File

View File

@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -0,0 +1 @@
# @polkadot/app-collator

View File

@ -0,0 +1,18 @@
{
"bugs": "https://github.com/polkadot-js/apps/issues",
"homepage": "https://github.com/polkadot-js/apps/tree/master/packages/page-collator#readme",
"license": "Apache-2.0",
"name": "@polkadot/app-collator",
"private": true,
"repository": {
"directory": "packages/page-collator",
"type": "git",
"url": "https://github.com/polkadot-js/apps.git"
},
"sideEffects": false,
"type": "module",
"version": "0.113.2-25",
"dependencies": {
"@babel/runtime": "^7.17.9"
}
}

View File

@ -0,0 +1,46 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { Collator as CollatorType } from './types';
import React from 'react';
import { AddressSmall, Badge } from '@polkadot/react-components';
import { BalanceFree, FormatBalance } from '@polkadot/react-query';
import { formatNumber } from '@polkadot/util';
interface Props {
className?: string;
info: CollatorType;
}
function Collator ({ className, info: { accountId, deposit, isInvulnerable, lastBlock } }: Props): React.ReactElement<Props> {
return (
<tr className={className}>
<td className='badge number'>
{isInvulnerable && (
<Badge
color='green'
icon='shield'
/>
)}
</td>
<td className='address'>
<AddressSmall value={accountId} />
</td>
<td className='number'>
{deposit && (
<FormatBalance value={deposit} />
)}
</td>
<td className='number'>
<BalanceFree params={accountId} />
</td>
<td className='number'>
{lastBlock && formatNumber(lastBlock)}
</td>
</tr>
);
}
export default React.memo(Collator);

View File

@ -0,0 +1,46 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { useRef } from 'react';
import { Table } from '@polkadot/react-components';
import Collator from './Collator';
import Summary from './Summary';
import { useTranslation } from './translate';
import useCollators from './useCollators';
interface Props {
className?: string;
}
function Collators ({ className }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const collators = useCollators();
const hdrRef = useRef([
[t<string>('collators'), 'start', 2],
[t<string>('deposit'), 'number'],
[t<string>('balance'), 'number'],
[t<string>('last #'), 'number']
]);
return (
<div className={className}>
<Summary />
<Table
empty={collators && t<string>('No running collators')}
header={hdrRef.current}
>
{collators && collators.map((c) => (
<Collator
info={c}
key={c.accountId}
/>
))}
</Table>
</div>
);
}
export default React.memo(Collators);

View File

@ -0,0 +1,36 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
import React from 'react';
import { CardSummary, SummaryBox } from '@polkadot/react-components';
import { useApi, useCall } from '@polkadot/react-hooks';
import { formatNumber } from '@polkadot/util';
import { useTranslation } from './translate';
interface Props {
className?: string;
}
function Summary ({ className }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const { api } = useApi();
const desiredCandidates = useCall<BN>(api.query.collatorSelection.desiredCandidates);
return (
<SummaryBox className={className}>
<section>
{desiredCandidates && (
<CardSummary label={t<string>('desired')}>
{formatNumber(desiredCandidates)}
</CardSummary>
)}
</section>
</SummaryBox>
);
}
export default React.memo(Summary);

View File

@ -0,0 +1,38 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import React, { useRef } from 'react';
import { Tabs } from '@polkadot/react-components';
import Collators from './Collators';
import { useTranslation } from './translate';
interface Props {
basePath: string;
className?: string;
}
function CollatorApp ({ basePath, className }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const itemsRef = useRef([
{
isRoot: true,
name: 'index',
text: t<string>('Overview')
}
]);
return (
<main className={className}>
<Tabs
basePath={basePath}
items={itemsRef.current}
/>
<Collators />
</main>
);
}
export default React.memo(CollatorApp);

View File

@ -0,0 +1,10 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { UseTranslationResponse } from 'react-i18next';
import { useTranslation as useTranslationBase } from 'react-i18next';
export function useTranslation (): UseTranslationResponse<'app-collator', undefined> {
return useTranslationBase('app-collator');
}

View File

@ -0,0 +1,11 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BN } from '@polkadot/util';
export interface Collator {
accountId: string;
deposit?: BN;
isInvulnerable: boolean;
lastBlock?: BN;
}

View File

@ -0,0 +1,98 @@
// Copyright 2017-2022 @polkadot/app-collator authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { BTreeSet } from '@polkadot/types';
import type { AccountId32, Balance } from '@polkadot/types/interfaces';
import type { BN } from '@polkadot/util';
import type { Collator } from './types';
import { useEffect, useMemo, useState } from 'react';
import { createNamedHook, useApi, useCall } from '@polkadot/react-hooks';
type Authored = Record<string, BN>;
interface PalletCollatorSelectionCandidateInfo {
deposit: Balance;
who: AccountId32;
}
const OPT_INV = {
transform: (invulnerables: AccountId32[]) =>
invulnerables.map((accountId32): Collator => ({
accountId: accountId32.toString(),
isInvulnerable: true
}))
};
const OPT_CAN = {
transform: (candidates: PalletCollatorSelectionCandidateInfo[] | BTreeSet) =>
Array.isArray(candidates)
? candidates.map(({ deposit, who }): Collator => ({
accountId: who.toString(),
deposit,
isInvulnerable: false
}))
: candidates.strings.map((accountId): Collator => ({
accountId,
isInvulnerable: false
}))
};
const OPT_AUT = {
transform: ([[accountIds], lastAuthoredBlocks]: [[string[]], BN[]]) =>
accountIds.reduce<Authored>((map, accountId, index): Authored => ({
...map,
[accountId]: lastAuthoredBlocks[index]
}), {}),
withParamsTransform: true
};
function includeAuthors (prev: Collator[], authored: Authored): Collator[] {
let hasDiff = false;
const adjusted = prev.map((c): Collator => {
if (authored[c.accountId] && (!c.lastBlock || !authored[c.accountId].eq(c.lastBlock))) {
hasDiff = true;
return { ...c, lastBlock: authored[c.accountId] };
}
return c;
});
return hasDiff
? adjusted
: prev;
}
function useCollatorImpl (): Collator[] | undefined {
const { api } = useApi();
const [state, setState] = useState<Collator[] | undefined>();
const accountIds = useMemo(
() => state && state.map(({ accountId }) => accountId),
[state]
);
const invulnerables = useCall<Collator[]>(api.query.collatorSelection.invulnerables, [], OPT_INV);
const candidates = useCall<Collator[]>(api.query.collatorSelection.candidates, [], OPT_CAN);
const lastBlocks = useCall<Authored>(accountIds && api.query.collatorSelection.lastAuthoredBlock?.multi, [accountIds], OPT_AUT);
useEffect(
() => invulnerables && candidates && setState(() =>
[...invulnerables, ...candidates]
),
[candidates, invulnerables]
);
useEffect(
() => lastBlocks && setState((prev) =>
prev && includeAuthors(prev, lastBlocks)
),
[lastBlocks]
);
return state;
}
export default createNamedHook('useCollatorImpl', useCollatorImpl);

View File

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": "..",
"outDir": "./build",
"rootDir": "./src"
},
"references": []
}

View File

@ -14,6 +14,6 @@
"version": "0.113.2-25",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/api-contract": "^8.2.2-8"
"@polkadot/api-contract": "^8.2.2-9"
}
}

View File

@ -14,10 +14,10 @@
"version": "0.113.2-25",
"dependencies": {
"@babel/runtime": "^7.17.9",
"@polkadot/api": "^8.2.2-8",
"@polkadot/api": "^8.2.2-9",
"@polkadot/extension-compat-metamask": "^0.43.2-4",
"@polkadot/extension-dapp": "^0.43.2-4",
"@polkadot/rpc-provider": "^8.2.2-8",
"@polkadot/rpc-provider": "^8.2.2-9",
"fflate": "^0.7.3",
"rxjs": "^7.5.5"
}

View File

@ -6,7 +6,7 @@ import type { BN } from '@polkadot/util';
import React from 'react';
import { Balance, FormatBalance } from '@polkadot/react-query';
import { BalanceFree, FormatBalance } from '@polkadot/react-query';
import { BN_ZERO } from '@polkadot/util';
export interface RenderProps {
@ -63,7 +63,7 @@ function BalanceDisplay (props: Props): React.ReactElement<Props> | null {
return balance
? <>{renderProvided({ className, label, value: balance })}</>
: (
<Balance
<BalanceFree
className={`ui--Balance ${className}`}
label={label}
params={params}

View File

@ -2,7 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
export { default as Available } from './Available';
export { default as Balance } from './Balance';
export { default as BalanceFree } from './BalanceFree';
export { default as BalanceVoting } from './BalanceVoting';
export { BlockAuthors, BlockAuthorsContext, ValidatorsContext } from './BlockAuthors';

View File

@ -17,7 +17,7 @@
"testcontainers": "^8.9.0"
},
"devDependencies": {
"@polkadot/types-support": "^8.2.2-8",
"@polkadot/types-support": "^8.2.2-9",
"@testing-library/jest-dom": "^5.16.4",
"tsconfig-paths": "^3.14.1"
}

View File

@ -22,6 +22,8 @@
"@polkadot/app-calendar/*": ["page-calendar/src/*"],
"@polkadot/app-claims": ["page-claims/src"],
"@polkadot/app-claims/*": ["page-claims/src/*"],
"@polkadot/app-collator": ["page-collator/src"],
"@polkadot/app-collator/*": ["page-collator/src/*"],
"@polkadot/app-contracts": ["page-contracts/src"],
"@polkadot/app-contracts/*": ["page-contracts/src/*"],
"@polkadot/app-council": ["page-council/src"],

224
yarn.lock
View File

@ -2617,90 +2617,90 @@ __metadata:
languageName: node
linkType: hard
"@polkadot/api-augment@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/api-augment@npm:8.2.2-8"
"@polkadot/api-augment@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/api-augment@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api-base": 8.2.2-8
"@polkadot/rpc-augment": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/types-augment": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/api-base": 8.2.2-9
"@polkadot/rpc-augment": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/types-augment": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/util": ^9.1.1
checksum: 937981dd39a4ec1afdcb611f80a04c0c8fc1da4a3f48f12c9ac3ed3d92e2ef5132022a772ffd4cf668b73b46268bbef44497a8cf84969b2403bf1c08800413ab
checksum: da1758dacf24493be19aa47ae8375cdc74fbad250103592d9a19e99d1d9fb0f8ff29de8be799c95bec840f84b6693ade7b6587c1a8f94a049e25c52435ed4983
languageName: node
linkType: hard
"@polkadot/api-base@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/api-base@npm:8.2.2-8"
"@polkadot/api-base@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/api-base@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/rpc-core": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/rpc-core": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/util": ^9.1.1
rxjs: ^7.5.5
checksum: e944bc69d8eac0191c2bdae531060e31e027f8fde269fdbbb4039bf12799b9688f2c07ecdab967bf1011c9d9938dd07f1b6f3c734b5b7bfa6fad4f08dcaebc29
checksum: 0a3867f56e446f4ea8f28c80522374d4e67c7993430a634e882ae07c8fc5f442e77638b923ee6367b5a23fb056d4d55cc3a594f10da4103874060400144b39fe
languageName: node
linkType: hard
"@polkadot/api-contract@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/api-contract@npm:8.2.2-8"
"@polkadot/api-contract@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/api-contract@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types-create": 8.2.2-8
"@polkadot/api": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/types-create": 8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/util-crypto": ^9.1.1
rxjs: ^7.5.5
checksum: efafc93fb9f3ff3f3fe5b2f07ad7a64be79c8d43b05e92b07f8f2e7c12240491cafaf085125921d74daab314a43e2e74db3aeb2d51a780d2d54ac6cd1a70d9f9
checksum: 0cc47c5cf014f93298dc13e476ce9689c02f33416722ed47042ae50465e7f83e0ddd28751caae777635ee14265546f3735649fd9046af1342cf98d5031fb065a
languageName: node
linkType: hard
"@polkadot/api-derive@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/api-derive@npm:8.2.2-8"
"@polkadot/api-derive@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/api-derive@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api": 8.2.2-8
"@polkadot/api-augment": 8.2.2-8
"@polkadot/api-base": 8.2.2-8
"@polkadot/rpc-core": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/api": 8.2.2-9
"@polkadot/api-augment": 8.2.2-9
"@polkadot/api-base": 8.2.2-9
"@polkadot/rpc-core": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/util-crypto": ^9.1.1
rxjs: ^7.5.5
checksum: bb60566d9bb82ff8ae5906159b409cdf6d798c5c59395dc69a49fd122533dc5f7f7450643d1490b45d3bd10ed90f02c54477b4fed9b3c65c2183fe64e4de3392
checksum: b8244f982cea7bbe71e90924c0bb8eaf675810f60cd61b4a39f440cac7f53e87852331eeb58093cc619d5406825864a83e5e295fd4ee35c618d93c921c7ced12
languageName: node
linkType: hard
"@polkadot/api@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/api@npm:8.2.2-8"
"@polkadot/api@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/api@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api-augment": 8.2.2-8
"@polkadot/api-base": 8.2.2-8
"@polkadot/api-derive": 8.2.2-8
"@polkadot/api-augment": 8.2.2-9
"@polkadot/api-base": 8.2.2-9
"@polkadot/api-derive": 8.2.2-9
"@polkadot/keyring": ^9.1.1
"@polkadot/rpc-augment": 8.2.2-8
"@polkadot/rpc-core": 8.2.2-8
"@polkadot/rpc-provider": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/types-augment": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types-create": 8.2.2-8
"@polkadot/types-known": 8.2.2-8
"@polkadot/rpc-augment": 8.2.2-9
"@polkadot/rpc-core": 8.2.2-9
"@polkadot/rpc-provider": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/types-augment": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/types-create": 8.2.2-9
"@polkadot/types-known": 8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/util-crypto": ^9.1.1
eventemitter3: ^4.0.7
rxjs: ^7.5.5
checksum: 7cc3e5b79fc34e085484eb2ac4b7c9d105be634ea7beaee07839215c6dd3842386e4f78d75da54b0b75c60a730fd33ef7c3cf76ca530194d8112c8d98a5c659c
checksum: f580750e4103c67f23b9a91bb4727c0dc653e4541f6b453ec71e12f79669b674c556a9a21b1cf50675a9ba26a9a4c12e6cb3936e8557b89056bf8170079b0b38
languageName: node
linkType: hard
@ -2771,12 +2771,20 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/app-collator@workspace:packages/page-collator":
version: 0.0.0-use.local
resolution: "@polkadot/app-collator@workspace:packages/page-collator"
dependencies:
"@babel/runtime": ^7.17.9
languageName: unknown
linkType: soft
"@polkadot/app-contracts@workspace:packages/page-contracts":
version: 0.0.0-use.local
resolution: "@polkadot/app-contracts@workspace:packages/page-contracts"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api-contract": ^8.2.2-8
"@polkadot/api-contract": ^8.2.2-9
languageName: unknown
linkType: soft
@ -2994,10 +3002,10 @@ __metadata:
"@metaverse-network-sdk/type-definitions": ^0.0.1-13
"@parallel-finance/type-definitions": 1.6.7
"@phala/typedefs": 0.2.30
"@polkadot/api": ^8.2.2-8
"@polkadot/api-derive": ^8.2.2-8
"@polkadot/api": ^8.2.2-9
"@polkadot/api-derive": ^8.2.2-9
"@polkadot/networks": ^9.1.1
"@polkadot/types": ^8.2.2-8
"@polkadot/types": ^8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/x-fetch": ^9.1.1
"@polymathnetwork/polymesh-types": 0.0.2
@ -3302,10 +3310,10 @@ __metadata:
resolution: "@polkadot/react-api@workspace:packages/react-api"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/api": ^8.2.2-8
"@polkadot/api": ^8.2.2-9
"@polkadot/extension-compat-metamask": ^0.43.2-4
"@polkadot/extension-dapp": ^0.43.2-4
"@polkadot/rpc-provider": ^8.2.2-8
"@polkadot/rpc-provider": ^8.2.2-9
fflate: ^0.7.3
rxjs: ^7.5.5
languageName: unknown
@ -3440,41 +3448,41 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/rpc-augment@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/rpc-augment@npm:8.2.2-8"
"@polkadot/rpc-augment@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/rpc-augment@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/rpc-core": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/rpc-core": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/util": ^9.1.1
checksum: eb8245b78df73a95893390cefdb65034608ccd1419a44b04a66b990efc4e5aab9b9dbb7f7f1f19651ecf30e3cc9c0bc133f5ee2c2b2e2d4e70ffbdcfa2f36c5d
checksum: 22b3c4b427eb6aecc367ced69571b0fe9c14a49134b669a928e147269ddb5f5c36c2f777699d7eff786437bc121bf21f747021e67aec14095a0b7dce464b3b8f
languageName: node
linkType: hard
"@polkadot/rpc-core@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/rpc-core@npm:8.2.2-8"
"@polkadot/rpc-core@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/rpc-core@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/rpc-augment": 8.2.2-8
"@polkadot/rpc-provider": 8.2.2-8
"@polkadot/types": 8.2.2-8
"@polkadot/rpc-augment": 8.2.2-9
"@polkadot/rpc-provider": 8.2.2-9
"@polkadot/types": 8.2.2-9
"@polkadot/util": ^9.1.1
rxjs: ^7.5.5
checksum: 14e8114b3de666a1b1dc34875027fb1bde4557dede7e64d9a63f66f94f4785423047cb7b5028268e37d213ab063adcecb90ce4f98cfcda528e40929c1d54c6de
checksum: 52289ab76124bf8eec3b6fd75777274adacab30601c6ea30f1d66d023cce1a45113760c0427b23b4d5f718acc0fbb50135f0f2fda9055d6b6826506384b1ad2b
languageName: node
linkType: hard
"@polkadot/rpc-provider@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/rpc-provider@npm:8.2.2-8"
"@polkadot/rpc-provider@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/rpc-provider@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/keyring": ^9.1.1
"@polkadot/types": 8.2.2-8
"@polkadot/types-support": 8.2.2-8
"@polkadot/types": 8.2.2-9
"@polkadot/types-support": 8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/util-crypto": ^9.1.1
"@polkadot/x-fetch": ^9.1.1
@ -3484,7 +3492,7 @@ __metadata:
eventemitter3: ^4.0.7
mock-socket: ^9.1.3
nock: ^13.2.4
checksum: 473899229d6bf3a4c89a575c40c10a1486391b9b036b5c8f1707badc2cac267624a473738be0015af9098cc6c0b5daaf11a39fa1d645db50726a54fe1115532b
checksum: c44cae311781cd38477c2df8dc65a120f3eb3f7e8bbcb0e400bc6ac2d8c49a26f3f5f3e6d59900620e7d9e0e8610f66c1ba0dabad02ef87ad1ac3990f2e90c88
languageName: node
linkType: hard
@ -3492,7 +3500,7 @@ __metadata:
version: 0.0.0-use.local
resolution: "@polkadot/test-support@workspace:packages/test-support"
dependencies:
"@polkadot/types-support": ^8.2.2-8
"@polkadot/types-support": ^8.2.2-9
"@testing-library/jest-dom": ^5.16.4
"@testing-library/react": ^13.1.1
testcontainers: ^8.9.0
@ -3500,76 +3508,76 @@ __metadata:
languageName: unknown
linkType: soft
"@polkadot/types-augment@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types-augment@npm:8.2.2-8"
"@polkadot/types-augment@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types-augment@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/types": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/util": ^9.1.1
checksum: e22634441759de4821a804550638e052a07b6979d7dfccff2ab2582c0999e858428dc55af36e5d3415980ef6902219a0db6f9ea954f08c71899220f70863d713
checksum: 7c6c0d71985518264374c1bd2ac1c39047fc5c641dbc6707dc70e5fe6b139b51c39bb21762ecfebdd6a7baadac3b0f1a49a0f626542084af1a5ce1bfae841a2f
languageName: node
linkType: hard
"@polkadot/types-codec@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types-codec@npm:8.2.2-8"
"@polkadot/types-codec@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types-codec@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/util": ^9.1.1
checksum: 0cae6dbae77b5cdd43ecd60acc201f5b0e633e011ab97dac4c7797d9eb064a8f5dcd917ea051fc0a3b5cee7ed7025ee8ee6caa53538238d71278c123c9113b52
checksum: 41fc0eb291b3ce6f51607b02eb453934c1bd48649bfa180d6bbe682537b771b4b5b380c05bff4cb27e1583f6400c4500307fce3f1c1af3e9978bab08e11bd9c6
languageName: node
linkType: hard
"@polkadot/types-create@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types-create@npm:8.2.2-8"
"@polkadot/types-create@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types-create@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types-codec": 8.2.2-9
"@polkadot/util": ^9.1.1
checksum: 27aadb3309eef0ee2ab2bc0efad5f86d4b9d5c39fb037ddb3a13cf8af84240329f51f304dcdd09bd5130b1b0522ddf9799a5ce91a0a76a9eb9181de1de568142
checksum: e0f2791f3fd1f3f352269d0ec00e4ae519ef3a95fe5dae8c252f52a0ca09d2c759c7799880e06243f0494e37f12d61440cb96a41119d11840a18ce82053fc185
languageName: node
linkType: hard
"@polkadot/types-known@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types-known@npm:8.2.2-8"
"@polkadot/types-known@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types-known@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/networks": ^9.1.1
"@polkadot/types": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types-create": 8.2.2-8
"@polkadot/types": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/types-create": 8.2.2-9
"@polkadot/util": ^9.1.1
checksum: 1024acced10b01778bfd48d9a7e9a56b91ad67b06e30b933e14c9ed0ab46f126be4995589978e4b751332ca9c784f9c4850be298357edef57515e011cada7e29
checksum: 719b6da99f59dbd2c07ca3f09b4f953804caae66195f6ffcbca33112dde33f34f8e13f387d9784f2db9426371561af1047f40c3341a2297d0c1ebca6763df380
languageName: node
linkType: hard
"@polkadot/types-support@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types-support@npm:8.2.2-8"
"@polkadot/types-support@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types-support@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/util": ^9.1.1
checksum: c31dbd44a52b3d9565586fcffad2a8b80a767d321813c5238f85f76b8ab01e8a5443d8be27f2bb904057533f02795bffea5e9af36a786bcf0bc3a09c44e47726
checksum: 76f5f44541ff4ff6119446d8782aad08ed399632b1f716214f3649e6e86899857d1d425235e70427b4af5ba64ba460ab75e8bfd837f8385ae69a44ce219d3e6b
languageName: node
linkType: hard
"@polkadot/types@npm:^8.2.2-8":
version: 8.2.2-8
resolution: "@polkadot/types@npm:8.2.2-8"
"@polkadot/types@npm:^8.2.2-9":
version: 8.2.2-9
resolution: "@polkadot/types@npm:8.2.2-9"
dependencies:
"@babel/runtime": ^7.17.9
"@polkadot/keyring": ^9.1.1
"@polkadot/types-augment": 8.2.2-8
"@polkadot/types-codec": 8.2.2-8
"@polkadot/types-create": 8.2.2-8
"@polkadot/types-augment": 8.2.2-9
"@polkadot/types-codec": 8.2.2-9
"@polkadot/types-create": 8.2.2-9
"@polkadot/util": ^9.1.1
"@polkadot/util-crypto": ^9.1.1
rxjs: ^7.5.5
checksum: 9dc0543c2f202eb16f2b6e619a00902097d5b655b888e661ee660f6763130e4b55320650324acf46a8fdf94eec7053300dcb1d7e89e98113cf3c792bb04c7427
checksum: 4eadfdf7bb0b824c12447ffd8aadedf7d91e508655e48473ceef9adb1dbc37cf3b536c4ecddb44bc18f2ffd7adac220ddade4a59b91e3ca3f87281b8c679a9eb
languageName: node
linkType: hard