Bump deps (incl. TS) (#8931)

* Bump deps (incl. TS)

* Adjust ESM packages for Jest

* Yet more Jest hacks

* Make horrible jest config slightly prettier

* Unbump electron

* Fix external package deps
This commit is contained in:
Jaco 2023-02-03 15:01:45 +02:00 committed by GitHub
parent 8ace90a082
commit 7d24f50c38
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
173 changed files with 966 additions and 720 deletions

View File

@ -9,14 +9,31 @@ const findPackages = require('./scripts/findPackages.cjs');
// ... TL;DR We still end up with a massive list here
const ESM_PKG = [
// general packages
'bail', 'character-entities', 'chart.js', 'comma-separated-tokens', 'decode-named-character-reference', 'hast-to-', 'hast-util-', 'hastscript', 'html-void-elements', 'is-plain-obj', 'mdast-', 'micromark', 'multiformats', 'property-information', 'react-markdown', 'rehype-raw', 'remark-parse', 'remark-rehype', 'space-separated-tokens', 'trough', 'uint8arrays', 'unified', 'unist-', 'vfile', 'vfile-', 'web-namespaces', 'zwitch',
'bail', 'character-entities', 'chart.js', 'comma-separated-tokens', 'decode-named-character-reference', 'decode-uri-component', 'filter-obj', 'hast-to-', 'hast-util-', 'hastscript', 'html-void-elements', 'is-ipfs', 'is-plain-obj', 'mdast-', 'micromark', 'multiformats', 'property-information', 'query-string', 'react-markdown', 'rehype-raw', 'remark-parse', 'remark-rehype', 'space-separated-tokens', 'split-on-first', 'trough', 'uint8arrays', 'unified', 'unist-', 'vfile', 'vfile-', 'web-namespaces', 'zwitch',
// type packages
'@logion/node-api'
];
// Jest does not support import maps... more issues
const MAP_ESM = {
'is-ipfs': '<rootDir>/node_modules/is-ipfs/dist/src/index.js',
'multiformats/basics': '<rootDir>/node_modules/multiformats/src/basics.js',
'multiformats': '<rootDir>/node_modules/multiformats/src/index.js',
'uint8arrays/to-string': '<rootDir>/node_modules/uint8arrays/src/to-string.js'
}
// file mapping
const MAP_FILE = {
'\\.(css|less)$': 'empty/object',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object',
'\\.(md)$': '<rootDir>/jest/mocks/empty.js'
}
module.exports = {
...config,
moduleNameMapper: {
...MAP_ESM,
...MAP_FILE,
...(
findPackages()
.filter(({ name }) => !['@polkadot/apps'].includes(name))
@ -26,10 +43,7 @@ module.exports = {
return modules;
}, {})
),
'@polkadot/apps/(.*)$': '<rootDir>/packages/apps/src/$1',
'\\.(css|less)$': 'empty/object',
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object',
'\\.(md)$': '<rootDir>/jest/mocks/empty.js'
'@polkadot/apps/(.*)$': '<rootDir>/packages/apps/src/$1'
},
setupFilesAfterEnv: ['<rootDir>/jest/setupEnv.cjs'],
testEnvironment: 'jsdom',

View File

@ -69,7 +69,7 @@
"@babel/runtime": "^7.20.13",
"@crustio/crust-pin": "^1.0.0",
"@pinata/sdk": "^1.2.1",
"@polkadot/dev": "^0.68.3",
"@polkadot/dev": "^0.68.4",
"@types/chart.js": "^2.9.37",
"@types/file-saver": "^2.0.5",
"@types/jest": "^29.4.0",
@ -83,7 +83,7 @@
"concurrently": "^7.6.0",
"devtron": "^1.4.0",
"dnslink-cloudflare": "^3.0.0",
"electron": "^21.3.5",
"electron": "^21.4.1",
"electron-builder": "23.6.0",
"electron-builder-notarize": "^1.5.1",
"i18next-scanner": "^4.1.1",
@ -124,6 +124,6 @@
"@polkadot/x-ws": "^10.3.1",
"babel-core": "^7.0.0-bridge.0",
"styled-components": "^5.3.1",
"typescript": "^4.9.4"
"typescript": "^4.9.5"
}
}

View File

@ -13,7 +13,7 @@
"version": "0.124.2-20-x",
"main": "index.js",
"dependencies": {
"@acala-network/type-definitions": "^4.1.8-1",
"@acala-network/type-definitions": "4.1.8-1",
"@babel/runtime": "^7.20.13",
"@bifrost-finance/type-definitions": "1.7.2",
"@crustio/type-definitions": "1.3.0",
@ -23,13 +23,13 @@
"@docknetwork/node-types": "0.15.0",
"@edgeware/node-types": "3.6.2-wako",
"@equilab/definitions": "1.4.18",
"@frequency-chain/api-augment": "^1.0.0",
"@interlay/interbtc-types": "1.11.0",
"@kiltprotocol/type-definitions": "^0.30.0",
"@frequency-chain/api-augment": "1.2.0-rc1",
"@interlay/interbtc-types": "1.11.1",
"@kiltprotocol/type-definitions": "0.30.0",
"@laminar/type-definitions": "0.3.1",
"@logion/node-api": "^0.9.0-3",
"@mangata-finance/types": "^0.17.0",
"@metaverse-network-sdk/type-definitions": "^0.0.1-13",
"@logion/node-api": "0.9.0-3",
"@mangata-finance/types": "0.17.0",
"@metaverse-network-sdk/type-definitions": "0.0.1-13",
"@parallel-finance/type-definitions": "1.7.14",
"@phala/typedefs": "0.2.33",
"@polkadot/api": "^9.13.5",
@ -40,14 +40,13 @@
"@polkadot/x-fetch": "^10.3.1",
"@polymathnetwork/polymesh-types": "0.0.2",
"@snowfork/snowbridge-types": "0.2.7",
"@sora-substrate/type-definitions": "1.12.4",
"@subsocial/definitions": "^0.7.9",
"@unique-nft/opal-testnet-types": "930.34.0",
"@unique-nft/quartz-mainnet-types": "930.34.0",
"@sora-substrate/type-definitions": "1.14.2",
"@subsocial/definitions": "0.7.11",
"@unique-nft/opal-testnet-types": "936.50.4",
"@unique-nft/quartz-mainnet-types": "936.50.4",
"@unique-nft/unique-mainnet-types": "930.33.0",
"@zeitgeistpm/type-defs": "0.10.0",
"@zeitgeistpm/type-defs": "1.0.0",
"@zeroio/type-definitions": "0.0.14",
"lodash": "^4.17.21",
"moonbeam-types-bundle": "2.0.9",
"pontem-types-bundle": "1.0.15",
"rxjs": "^7.8.0"

View File

@ -51482,6 +51482,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [
@ -51963,6 +51991,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [
@ -52444,6 +52500,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [
@ -54063,6 +54147,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [
@ -65722,6 +65834,29 @@ export const typesBundle = {
}
],
"type": "Option<u128>"
},
"allowanceForAll": {
"description": "Tells whether the given `owner` approves the `operator`.",
"params": [
{
"name": "collection",
"type": "u32"
},
{
"name": "owner",
"type": "PalletEvmAccountBasicCrossAccountIdRepr"
},
{
"name": "operator",
"type": "PalletEvmAccountBasicCrossAccountIdRepr"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "Option<bool>"
}
}
}
@ -69028,6 +69163,29 @@ export const typesBundle = {
}
],
"type": "Option<u128>"
},
"allowanceForAll": {
"description": "Tells whether the given `owner` approves the `operator`.",
"params": [
{
"name": "collection",
"type": "u32"
},
{
"name": "owner",
"type": "PalletEvmAccountBasicCrossAccountIdRepr"
},
{
"name": "operator",
"type": "PalletEvmAccountBasicCrossAccountIdRepr"
},
{
"name": "at",
"type": "Hash",
"isOptional": true
}
],
"type": "Option<bool>"
}
}
}
@ -70985,7 +71143,8 @@ export const typesBundle = {
"DAI",
"ETH",
"XSTUSD",
"XST"
"XST",
"TBCD"
]
},
"RewardInfo": {
@ -72629,7 +72788,8 @@ export const typesBundle = {
"DAI",
"ETH",
"XSTUSD",
"XST"
"XST",
"TBCD"
]
},
"RewardInfo": {
@ -75402,6 +75562,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [
@ -75883,6 +76071,34 @@ export const typesBundle = {
}
},
"reward": {
"estimateEscrowRewardRate": {
"description": "Estimate the escrow reward rate for a given account",
"params": [
{
"name": "account_id",
"type": "AccountId"
},
{
"name": "amount",
"type": "Option<Balance>"
},
{
"name": "lock_time",
"type": "Option<BlockNumber>"
}
],
"type": "UnsignedFixedPoint"
},
"estimateVaultRewardRate": {
"description": "Estimate the vault reward rate a given vault id",
"params": [
{
"name": "vault_id",
"type": "VaultId"
}
],
"type": "UnsignedFixedPoint"
},
"computeEscrowReward": {
"description": "Get a given user's rewards due",
"params": [

View File

@ -14,15 +14,15 @@
"dependencies": {
"@babel/core": "^7.20.12",
"@babel/polyfill": "^7.12.1",
"@polkadot/dev": "^0.68.3",
"@polkadot/dev": "^0.68.4",
"@polkadot/react-components": "^0.124.2-20-x",
"electron-log": "^4.4.8",
"electron-log": "^5.0.0-beta.16",
"electron-updater": "^5.3.0"
},
"devDependencies": {
"@types/react-dom": "^18.0.10",
"@types/tmp": "^0.2.3",
"babel-loader": "^8.3.0",
"babel-loader": "^9.1.2",
"copy-webpack-plugin": "^11.0.0",
"html-webpack-plugin": "^5.5.0",
"react": "^18.2.0",

View File

@ -15,7 +15,7 @@ export default function create (t: TFunction): Route {
group: 'accounts',
icon: 'users',
name: 'accounts',
text: t('nav.accounts', 'Accounts', { ns: 'apps-routing' }),
text: t<string>('nav.accounts', 'Accounts', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'accounts',
icon: 'address-card',
name: 'addresses',
text: t('nav.addresses', 'Address book', { ns: 'apps-routing' })
text: t<string>('nav.addresses', 'Address book', { ns: 'apps-routing' })
};
}

View File

@ -17,7 +17,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'people-group',
name: 'alliance',
text: t('nav.alliance', 'Alliance', { ns: 'apps-routing' }),
text: t<string>('nav.alliance', 'Alliance', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'shopping-basket',
name: 'assets',
text: t('nav.assets', 'Assets', { ns: 'apps-routing' })
text: t<string>('nav.assets', 'Assets', { ns: 'apps-routing' })
};
}

View File

@ -17,7 +17,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'coins',
name: 'bounties',
text: t('nav.bounties', 'Bounties', { ns: 'apps-routing' }),
text: t<string>('nav.bounties', 'Bounties', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'calendar-alt',
name: 'calendar',
text: t('nav.calendar', 'Event calendar', { ns: 'apps-routing' })
text: t<string>('nav.calendar', 'Event calendar', { ns: 'apps-routing' })
};
}

View File

@ -18,7 +18,7 @@ export default function create (t: TFunction): Route {
group: 'accounts',
icon: 'star',
name: 'claims',
text: t('nav.claims', 'Claim Tokens', { ns: 'apps-routing' }),
text: t<string>('nav.claims', 'Claim Tokens', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -17,6 +17,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'timeline',
name: 'collators',
text: t('nav.collator', 'Collators', { ns: 'apps-routing' })
text: t<string>('nav.collator', 'Collators', { ns: 'apps-routing' })
};
}

View File

@ -32,6 +32,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'compress',
name: 'contracts',
text: t('nav.contracts', 'Contracts', { ns: 'apps-routing' })
text: t<string>('nav.contracts', 'Contracts', { ns: 'apps-routing' })
};
}

View File

@ -18,7 +18,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'building',
name: 'council',
text: t('nav.council', 'Council', { ns: 'apps-routing' }),
text: t<string>('nav.council', 'Council', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -32,7 +32,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'calendar-check',
name: 'democracy',
text: t('nav.democracy', 'Democracy', { ns: 'apps-routing' }),
text: t<string>('nav.democracy', 'Democracy', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'braille',
name: 'explorer',
text: t('nav.explorer', 'Explorer', { ns: 'apps-routing' })
text: t<string>('nav.explorer', 'Explorer', { ns: 'apps-routing' })
};
}

View File

@ -16,6 +16,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'envelope-open-text',
name: 'extrinsics',
text: t('nav.extrinsics', 'Extrinsics', { ns: 'apps-routing' })
text: t<string>('nav.extrinsics', 'Extrinsics', { ns: 'apps-routing' })
};
}

View File

@ -20,7 +20,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'people-arrows',
name: 'fellowship',
text: t('nav.fellowship', 'Fellowship', { ns: 'apps-routing' }),
text: t<string>('nav.fellowship', 'Fellowship', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -16,6 +16,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'file',
name: 'files',
text: t('nav.files', 'Files (IPFS)', { ns: 'apps-routing' })
text: t<string>('nav.files', 'Files (IPFS)', { ns: 'apps-routing' })
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'leaf',
name: 'gilt',
text: t('nav.gilt', 'Gilt', { ns: 'apps-routing' })
text: t<string>('nav.gilt', 'Gilt', { ns: 'apps-routing' })
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'code',
name: 'js',
text: t('nav.js', 'JavaScript', { ns: 'apps-routing' })
text: t<string>('nav.js', 'JavaScript', { ns: 'apps-routing' })
};
}

View File

@ -18,7 +18,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'people-carry',
name: 'membership',
text: t('nav.membership', 'Membership', { ns: 'apps-routing' }),
text: t<string>('nav.membership', 'Membership', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -17,6 +17,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'shopping-cart',
name: 'nfts',
text: t('nav.nfts', 'NFTs', { ns: 'apps-routing' })
text: t<string>('nav.nfts', 'NFTs', { ns: 'apps-routing' })
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'link',
name: 'parachains',
text: t('nav.parachains', 'Parachains', { ns: 'apps-routing' })
text: t<string>('nav.parachains', 'Parachains', { ns: 'apps-routing' })
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'podcast',
name: 'poll',
text: t('nav.poll', 'Token poll', { ns: 'apps-routing' })
text: t<string>('nav.poll', 'Token poll', { ns: 'apps-routing' })
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'panorama',
name: 'preimages',
text: t('nav.preimages', 'Preimages', { ns: 'apps-routing' })
text: t<string>('nav.preimages', 'Preimages', { ns: 'apps-routing' })
};
}

View File

@ -19,7 +19,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'people-arrows',
name: 'ranked',
text: t('nav.ranked', 'Ranked collective', { ns: 'apps-routing' }),
text: t<string>('nav.ranked', 'Ranked collective', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -19,7 +19,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'person-booth',
name: 'referenda',
text: t('nav.referenda', 'Referenda', { ns: 'apps-routing' }),
text: t<string>('nav.referenda', 'Referenda', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'network-wired',
name: 'rpc',
text: t('nav.rpc', 'RPC calls', { ns: 'apps-routing' })
text: t<string>('nav.rpc', 'RPC calls', { ns: 'apps-routing' })
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'arrows-to-circle',
name: 'runtime',
text: t('nav.runtime', 'Runtime calls', { ns: 'apps-routing' })
text: t<string>('nav.runtime', 'Runtime calls', { ns: 'apps-routing' })
};
}

View File

@ -17,6 +17,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'clock',
name: 'scheduler',
text: t('nav.scheduler', 'Scheduler', { ns: 'apps-routing' })
text: t<string>('nav.scheduler', 'Scheduler', { ns: 'apps-routing' })
};
}

View File

@ -13,7 +13,7 @@ export default function create (t: TFunction): Route {
group: 'settings',
icon: 'cogs',
name: 'settings',
text: t('nav.settings', 'Settings', { ns: 'apps-routing' }),
text: t<string>('nav.settings', 'Settings', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -16,6 +16,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'signature',
name: 'signing',
text: t('nav.signing', 'Sign and verify', { ns: 'apps-routing' })
text: t<string>('nav.signing', 'Sign and verify', { ns: 'apps-routing' })
};
}

View File

@ -18,7 +18,7 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'hand-spock',
name: 'society',
text: t('nav.society', 'Society', { ns: 'apps-routing' }),
text: t<string>('nav.society', 'Society', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -51,6 +51,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'certificate',
name: 'staking',
text: t('nav.staking', 'Staking', { ns: 'apps-routing' })
text: t<string>('nav.staking', 'Staking', { ns: 'apps-routing' })
};
}

View File

@ -53,6 +53,6 @@ export default function create (t: TFunction): Route {
group: 'network',
icon: 'certificate',
name: 'test-staking',
text: t('nav.staking', 'Staking', { ns: 'apps-routing' })
text: t<string>('nav.staking', 'Staking', { ns: 'apps-routing' })
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'database',
name: 'chainstate',
text: t('nav.storage', 'Chain state', { ns: 'apps-routing' })
text: t<string>('nav.storage', 'Chain state', { ns: 'apps-routing' })
};
}

View File

@ -19,6 +19,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'unlock',
name: 'sudo',
text: t('nav.sudo', 'Sudo', { ns: 'apps-routing' })
text: t<string>('nav.sudo', 'Sudo', { ns: 'apps-routing' })
};
}

View File

@ -19,7 +19,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'microchip',
name: 'techcomm',
text: t('nav.tech-comm', 'Tech. comm.', { ns: 'apps-routing' }),
text: t<string>('nav.tech-comm', 'Tech. comm.', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -28,6 +28,6 @@ export default function create (t: TFunction): Route {
group: 'accounts',
icon: 'share-square',
name: 'teleport',
text: t('nav.teleport', 'Teleport', { ns: 'apps-routing' })
text: t<string>('nav.teleport', 'Teleport', { ns: 'apps-routing' })
};
}

View File

@ -20,6 +20,6 @@ export default function create (t: TFunction): Route {
group: 'accounts',
icon: 'paper-plane',
name: 'transfer',
text: t('nav.transfer', 'Transfer', { ns: 'apps-routing' })
text: t<string>('nav.transfer', 'Transfer', { ns: 'apps-routing' })
};
}

View File

@ -17,7 +17,7 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'gem',
name: 'treasury',
text: t('nav.treasury', 'Treasury', { ns: 'apps-routing' }),
text: t<string>('nav.treasury', 'Treasury', { ns: 'apps-routing' }),
useCounter
};
}

View File

@ -15,6 +15,6 @@ export default function create (t: TFunction): Route {
group: 'developer',
icon: 'wrench',
name: 'utilities',
text: t('nav.utilities', 'Utilities', { ns: 'apps-routing' })
text: t<string>('nav.utilities', 'Utilities', { ns: 'apps-routing' })
};
}

View File

@ -18,6 +18,6 @@ export default function create (t: TFunction): Route {
group: 'governance',
icon: 'list-check',
name: 'whitelist',
text: t('nav.whitelist', 'Whitelist', { ns: 'apps-routing' })
text: t<string>('nav.whitelist', 'Whitelist', { ns: 'apps-routing' })
};
}

View File

@ -18,7 +18,7 @@
"@babel/runtime": "^7.20.13",
"@polkadot/apps-config": "^0.124.2-20-x",
"@polkadot/apps-routing": "^0.124.2-20-x",
"@polkadot/dev": "^0.68.3",
"@polkadot/dev": "^0.68.4",
"@polkadot/react-api": "^0.124.2-20-x",
"@polkadot/react-components": "^0.124.2-20-x",
"@polkadot/react-hooks": "^0.124.2-20-x",
@ -26,12 +26,12 @@
"@polkadot/react-query": "^0.124.2-20-x",
"@polkadot/react-signer": "^0.124.2-20-x",
"punycode": "^2.3.0",
"query-string": "^7.1.3"
"query-string": "^8.1.0"
},
"devDependencies": {
"@types/punycode": "^2.1.0",
"assert": "^2.0.0",
"babel-loader": "^8.3.0",
"babel-loader": "^9.1.2",
"buffer": "^6.0.3",
"copy-webpack-plugin": "^11.0.0",
"crypto-browserify": "^3.12.0",

View File

@ -16,6 +16,7 @@
"Yes": "Yes",
"aye: bool": "aye: bool",
"call hash / {{section}}.{{method}}": "call hash / {{section}}.{{method}}",
"click to select or drag and drop JSON key/value (hex-encoded) file": "click to select or drag and drop JSON key/value (hex-encoded) file",
"conviction: Conviction": "conviction: Conviction",
"details": "details",
"file upload": "file upload",

View File

@ -99,12 +99,12 @@ function Menu ({ className = '' }: Props): React.ReactElement<Props> {
const routeRef = useRef(createRoutes(t));
const groupRef = useRef({
accounts: t('Accounts'),
developer: t('Developer'),
files: t('Files'),
governance: t('Governance'),
network: t('Network'),
settings: t('Settings')
accounts: t<string>('Accounts'),
developer: t<string>('Developer'),
files: t<string>('Files'),
governance: t<string>('Governance'),
network: t<string>('Network'),
settings: t<string>('Settings')
});
const hasSudo = useMemo(

View File

@ -307,7 +307,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='link'
key='identityMain'
label={t('Set on-chain identity')}
label={t<string>('Set on-chain identity')}
onClick={toggleIdentityMain}
/>
),
@ -315,7 +315,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='vector-square'
key='identitySub'
label={t('Set on-chain sub-identities')}
label={t<string>('Set on-chain sub-identities')}
onClick={toggleIdentitySub}
/>
),
@ -323,7 +323,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='broom'
key='clearDemocracy'
label={t('Clear expired democracy locks')}
label={t<string>('Clear expired democracy locks')}
onClick={_clearDemocracyLocks}
/>
),
@ -331,7 +331,7 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='broom'
key='clearReferenda'
label={t('Clear expired referenda locks')}
label={t<string>('Clear expired referenda locks')}
onClick={_clearReferendaLocks}
/>
),
@ -339,17 +339,17 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='unlock'
key='vestingVest'
label={t('Unlock vested amount')}
label={t<string>('Unlock vested amount')}
onClick={_vestingVest}
/>
)
], t('Identity')),
], t<string>('Identity')),
createMenuGroup('deriveGroup', [
!(isEthereum || isExternal || isHardware || isInjected || isMultisig || api.isEthereum) && (
<Menu.Item
icon='download'
key='deriveAccount'
label={t('Derive account via derivation path')}
label={t<string>('Derive account via derivation path')}
onClick={toggleDerive}
/>
),
@ -357,17 +357,17 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='eye'
key='showHwAddress'
label={t('Show address on hardware device')}
label={t<string>('Show address on hardware device')}
onClick={_showOnHardware}
/>
)
], t('Derive')),
], t<string>('Derive')),
createMenuGroup('backupGroup', [
!(isExternal || isHardware || isInjected || isMultisig || isDevelopment) && (
<Menu.Item
icon='database'
key='backupJson'
label={t('Create a backup file for this account')}
label={t<string>('Create a backup file for this account')}
onClick={toggleBackup}
/>
),
@ -383,56 +383,56 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
<Menu.Item
icon='trash-alt'
key='forgetAccount'
label={t('Forget this account')}
label={t<string>('Forget this account')}
onClick={toggleForget}
/>
)
], t('Backup')),
], t<string>('Backup')),
isFunction(api.api.tx.recovery?.createRecovery) && createMenuGroup('reoveryGroup', [
!recoveryInfo && (
<Menu.Item
icon='redo'
key='makeRecoverable'
label={t('Make recoverable')}
label={t<string>('Make recoverable')}
onClick={toggleRecoverSetup}
/>
),
<Menu.Item
icon='screwdriver'
key='initRecovery'
label={t('Initiate recovery for another')}
label={t<string>('Initiate recovery for another')}
onClick={toggleRecoverAccount}
/>
], t('Recovery')),
], t<string>('Recovery')),
isFunction(api.api.tx.multisig?.asMulti) && isMultisig && createMenuGroup('multisigGroup', [
<Menu.Item
icon='file-signature'
isDisabled={!multiInfos || !multiInfos.length}
key='multisigApprovals'
label={t('Multisig approvals')}
label={t<string>('Multisig approvals')}
onClick={toggleMultisig}
/>
], t('Multisig')),
], t<string>('Multisig')),
isFunction(api.api.query.democracy?.votingOf) && delegation?.accountDelegated && createMenuGroup('undelegateGroup', [
<Menu.Item
icon='user-edit'
key='changeDelegate'
label={t('Change democracy delegation')}
label={t<string>('Change democracy delegation')}
onClick={toggleDelegate}
/>,
<Menu.Item
icon='user-minus'
key='undelegate'
label= {t('Undelegate')}
label= {t<string>('Undelegate')}
onClick={toggleUndelegate}
/>
], t('Undelegate')),
], t<string>('Undelegate')),
createMenuGroup('delegateGroup', [
isFunction(api.api.query.democracy?.votingOf) && !delegation?.accountDelegated && (
<Menu.Item
icon='user-plus'
key='delegate'
label={t('Delegate democracy votes')}
label={t<string>('Delegate democracy votes')}
onClick={toggleDelegate}
/>
),
@ -441,13 +441,13 @@ function Account ({ account: { address, meta }, className = '', delegation, filt
icon='sitemap'
key='proxy-overview'
label={proxy?.[0].length
? t('Manage proxies')
: t('Add proxy')
? t<string>('Manage proxies')
: t<string>('Add proxy')
}
onClick={toggleProxyOverview}
/>
)
], t('Delegate')),
], t<string>('Delegate')),
isEditable && !api.isDevelopment && createMenuGroup('genesisGroup', [
<ChainLock
className='accounts--network-toggle'

View File

@ -197,13 +197,13 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen
const header = useMemo(
(): Record<GroupName, [React.ReactNode?, string?, number?, (() => void)?][]> => {
const ret: Record<GroupName, [React.ReactNode?, string?, number?, (() => void)?][]> = {
accounts: [[<>{t('accounts')}<div className='sub'>{t<string>('all locally stored accounts')}</div></>]],
hardware: [[<>{t('hardware')}<div className='sub'>{t<string>('accounts managed via hardware devices')}</div></>]],
injected: [[<>{t('extension')}<div className='sub'>{t<string>('accounts available via browser extensions')}</div></>]],
multisig: [[<>{t('multisig')}<div className='sub'>{t<string>('on-chain multisig accounts')}</div></>]],
proxied: [[<>{t('proxied')}<div className='sub'>{t<string>('on-chain proxied accounts')}</div></>]],
qr: [[<>{t('via qr')}<div className='sub'>{t<string>('accounts available via mobile devices')}</div></>]],
testing: [[<>{t('development')}<div className='sub'>{t<string>('accounts derived via development seeds')}</div></>]]
accounts: [[<>{t<string>('accounts')}<div className='sub'>{t<string>('all locally stored accounts')}</div></>]],
hardware: [[<>{t<string>('hardware')}<div className='sub'>{t<string>('accounts managed via hardware devices')}</div></>]],
injected: [[<>{t<string>('extension')}<div className='sub'>{t<string>('accounts available via browser extensions')}</div></>]],
multisig: [[<>{t<string>('multisig')}<div className='sub'>{t<string>('on-chain multisig accounts')}</div></>]],
proxied: [[<>{t<string>('proxied')}<div className='sub'>{t<string>('on-chain proxied accounts')}</div></>]],
qr: [[<>{t<string>('via qr')}<div className='sub'>{t<string>('accounts available via mobile devices')}</div></>]],
testing: [[<>{t<string>('development')}<div className='sub'>{t<string>('accounts derived via development seeds')}</div></>]]
};
Object.values(ret).forEach((a): void => {

View File

@ -172,15 +172,15 @@ function VanityApp ({ className = '', onStatusChange }: Props): React.ReactEleme
const header = useMemo<[React.ReactNode?, string?, number?][]>(
() => [
[t('matches'), 'start', 2],
[t('Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)', {
[t<string>('matches'), 'start', 2],
[t<string>('Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)', {
replace: {
avg: (keyCount / (elapsed / 1000)).toFixed(3),
count: keyCount,
elapsed: (elapsed / 1000).toFixed(2)
}
}), 'start --digits'],
[t('secret'), 'start'],
[t<string>('secret'), 'start'],
[]
],
[elapsed, keyCount, t]

View File

@ -32,7 +32,7 @@ function CreateEthDerivationPath ({ className, derivePath, deriveValidation, onC
.fill(0)
.map((_, i) => ({
key: i,
text: t('Address index {{index}}', {
text: t<string>('Address index {{index}}', {
replace: { index: i }
}),
value: i
@ -82,7 +82,7 @@ function CreateEthDerivationPath ({ className, derivePath, deriveValidation, onC
)
: (
<Dropdown
label={t('address index')}
label={t<string>('address index')}
onChange={setAddIndex}
options={addressList}
value={addIndex}

View File

@ -29,12 +29,12 @@ function CreateSuriLedger ({ className, onChange, seedType }: Props): React.Reac
})));
const accOps = useRef(AVAIL_INDEXES.map((value) => ({
text: t('Account type {{index}}', { replace: { index: value } }),
text: t<string>('Account type {{index}}', { replace: { index: value } }),
value
})));
const addOps = useRef(AVAIL_INDEXES.map((value) => ({
text: t('Address index {{index}}', { replace: { index: value } }),
text: t<string>('Address index {{index}}', { replace: { index: value } }),
value
})));
@ -53,19 +53,19 @@ function CreateSuriLedger ({ className, onChange, seedType }: Props): React.Reac
? (
<>
<Dropdown
label={t('Ledger app type (originated from)')}
label={t<string>('Ledger app type (originated from)')}
onChange={setChainType}
options={netOpts.current}
value={chainType}
/>
<Dropdown
label={t('account type')}
label={t<string>('account type')}
onChange={setAccIndex}
options={accOps.current}
value={accIndex}
/>
<Dropdown
label={t('address index')}
label={t<string>('address index')}
onChange={setAddIndex}
options={addOps.current}
value={addIndex}

View File

@ -73,7 +73,7 @@ function Delegate ({ onClose, previousAmount, previousConviction, previousDelega
value={delegatedAccount}
/>
</Modal.Columns>
<Modal.Columns hint={t('The amount to allocate and the conviction that will be applied to all votes made on a referendum.')}>
<Modal.Columns hint={t<string>('The amount to allocate and the conviction that will be applied to all votes made on a referendum.')}>
<InputBalance
autoFocus
isError={!!amountError?.error}

View File

@ -132,7 +132,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
label={t<string>('display name')}
maxLength={32}
onChange={setValDisplay}
placeholder={t('My On-Chain Name')}
placeholder={t<string>('My On-Chain Name')}
value={valDisplay}
/>
<Input
@ -148,7 +148,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
}
maxLength={32}
onChange={setValLegal}
placeholder={t('Full Legal Name')}
placeholder={t<string>('Full Legal Name')}
value={hasLegal ? valLegal : '<none>'}
/>
<Input
@ -164,7 +164,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
}
maxLength={32}
onChange={setValEmail}
placeholder={t('somebody@example.com')}
placeholder={t<string>('somebody@example.com')}
value={hasEmail ? valEmail : '<none>'}
/>
<Input
@ -180,7 +180,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
}
maxLength={32}
onChange={setValWeb}
placeholder={t('https://example.com')}
placeholder={t<string>('https://example.com')}
value={hasWeb ? valWeb : '<none>'}
/>
<Input
@ -195,7 +195,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
/>
}
onChange={setValTwitter}
placeholder={t('@YourTwitterName')}
placeholder={t<string>('@YourTwitterName')}
value={hasTwitter ? valTwitter : '<none>'}
/>
<Input
@ -211,7 +211,7 @@ function IdentityMain ({ address, className = '', onClose }: Props): React.React
}
maxLength={32}
onChange={setValRiot}
placeholder={t('@yourname:matrix.org')}
placeholder={t<string>('@yourname:matrix.org')}
value={hasRiot ? valRiot : '<none>'}
/>
<InputBalance

View File

@ -131,7 +131,7 @@ function IdentitySubModal ({ address, className, onClose }: Props): React.ReactE
: (
<div>
{!infos.length
? <article>{t('No sub identities set.')}</article>
? <article>{t<string>('No sub identities set.')}</article>
: infos.map(([address, name], index) =>
<IdentitySubMemo
address={address}

View File

@ -30,7 +30,7 @@ function ValidateAmount ({ amount, delegatingAccount, onError }: Props): React.R
let newError: string | null = null;
if (amount.gte(delegatingAccountBalance.freeBalance)) {
newError = t('The maximum amount you can delegate is the amount of funds available on the delegating account.');
newError = t<string>('The maximum amount you can delegate is the amount of funds available on the delegating account.');
}
setResult((state): AmountValidateState => {

View File

@ -48,12 +48,12 @@ function LedgerModal ({ className, onClose }: Props): React.ReactElement<Props>
const [isBusy, setIsBusy] = useState(false);
const accOps = useRef(AVAIL_INDEXES.map((value): Option => ({
text: t('Account type {{index}}', { replace: { index: value } }),
text: t<string>('Account type {{index}}', { replace: { index: value } }),
value
})));
const addOps = useRef(AVAIL_INDEXES.map((value): Option => ({
text: t('Address index {{index}}', { replace: { index: value } }),
text: t<string>('Address index {{index}}', { replace: { index: value } }),
value
})));
@ -98,17 +98,17 @@ function LedgerModal ({ className, onClose }: Props): React.ReactElement<Props>
value={name}
/>
</Modal.Columns>
<Modal.Columns hint={t('The account type that you wish to create. This is the top-level derivation.')}>
<Modal.Columns hint={t<string>('The account type that you wish to create. This is the top-level derivation.')}>
<Dropdown
label={t('account type')}
label={t<string>('account type')}
onChange={setAccIndex}
options={accOps.current}
value={accIndex}
/>
</Modal.Columns>
<Modal.Columns hint={t('The address index on the account that you wish to add. This is the second-level derivation.')}>
<Modal.Columns hint={t<string>('The address index on the account that you wish to add. This is the second-level derivation.')}>
<Dropdown
label={t('address index')}
label={t<string>('address index')}
onChange={setAddIndex}
options={addOps.current}
value={addIndex}

View File

@ -170,7 +170,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
size='large'
>
<Modal.Content>
<Modal.Columns hint={t('The call hash from the list of available and unapproved calls.')}>
<Modal.Columns hint={t<string>('The call hash from the list of available and unapproved calls.')}>
<Dropdown
label={t<string>('pending hashes {{count}}', {
replace: { count: hashes.length }
@ -210,7 +210,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
</Modal.Columns>
</>
)}
<Modal.Columns hint={t('The operation type to apply. For approvals both non-final and final approvals are supported.')}>
<Modal.Columns hint={t<string>('The operation type to apply. For approvals both non-final and final approvals are supported.')}>
<Dropdown
label={t<string>('approval type')}
onChange={setType}
@ -220,7 +220,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
</Modal.Columns>
{whoFilter.length !== 0 && (
<>
<Modal.Columns hint={t('For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.')}>
<Modal.Columns hint={t<string>('For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.')}>
<InputAddress
filter={whoFilter}
label={t<string>('signatory')}
@ -230,7 +230,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
{type === 'aye' && isMultiCall && (
<>
{isCallOverride && (
<Modal.Columns hint={t('The call data for this transaction matching the hash. Once sent, the multisig will be executed against this.')}>
<Modal.Columns hint={t<string>('The call data for this transaction matching the hash. Once sent, the multisig will be executed against this.')}>
{callData && callInfo
? (
<Expander
@ -248,7 +248,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
<Input
autoFocus
isError={!callHex || !!callError}
label={t('call data for final approval')}
label={t<string>('call data for final approval')}
onChange={setCallHex}
/>
)}
@ -257,7 +257,7 @@ function MultisigApprove ({ className = '', onClose, ongoing, threshold, who }:
)}
</Modal.Columns>
)}
<Modal.Columns hint={t('Swap to a non-executing approval type, with subsequent calls providing the actual call data.')}>
<Modal.Columns hint={t<string>('Swap to a non-executing approval type, with subsequent calls providing the actual call data.')}>
<Toggle
className='tipToggle'
label={

View File

@ -166,7 +166,7 @@ function Transfer ({ className = '', onClose, recipientId: propRecipientId, send
)
}
</Modal.Columns>
<Modal.Columns hint={t('With the keep-alive option set, the account is protected against removal due to low balances.')}>
<Modal.Columns hint={t<string>('With the keep-alive option set, the account is protected against removal due to low balances.')}>
{isFunction(api.tx.balances?.transferKeepAlive) && (
<Toggle
className='typeToggle'

View File

@ -32,7 +32,7 @@ function Overview ({ className = '', onStatusChange }: Props): React.ReactElemen
const isNextTick = useNextTick();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('contacts'), 'start', 4]
[t<string>('contacts'), 'start', 4]
]);
useEffect((): void => {

View File

@ -52,7 +52,7 @@ function Join ({ className, members, onClose, unscrupulous: { accounts } }: Prop
type='account'
/>
</Modal.Columns>
<Modal.Columns hint={t('The bond will be reserved for the duration of your alliance membership.')}>
<Modal.Columns hint={t<string>('The bond will be reserved for the duration of your alliance membership.')}>
<InputBalance
defaultValue={api.consts.alliance.allyDeposit}
isDisabled

View File

@ -73,7 +73,7 @@ function Transfer ({ accountId, assetId, className, minBalance, siFormat: [siDec
siSymbol={siSymbol}
/>
</Modal.Columns>
<Modal.Columns hint={t('With the keep-alive option set, the account is protected against removal due to low balances.')}>
<Modal.Columns hint={t<string>('With the keep-alive option set, the account is protected against removal due to low balances.')}>
<Toggle
className='typeToggle'
label={

View File

@ -25,9 +25,9 @@ function Balances ({ className, infos = [] }: Props): React.ReactElement<Props>
const balances = useBalances(info?.id);
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('accounts'), 'start'],
[t('frozen'), 'start'],
[t('sufficient'), 'start'],
[t<string>('accounts'), 'start'],
[t<string>('frozen'), 'start'],
[t<string>('sufficient'), 'start'],
[],
[]
]);

View File

@ -19,12 +19,12 @@ function Assets ({ className, infos }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('assets'), 'start', 2],
[t('owner'), 'address media--1000'],
[t('admin'), 'address media--1300'],
[t('issuer'), 'address media--1600'],
[t('freezer'), 'address media--1900'],
[t('supply')],
[t<string>('assets'), 'start', 2],
[t<string>('owner'), 'address media--1000'],
[t<string>('admin'), 'address media--1300'],
[t<string>('issuer'), 'address media--1600'],
[t<string>('freezer'), 'address media--1900'],
[t<string>('supply')],
[]
]);

View File

@ -28,10 +28,10 @@ function Bounties ({ className }: Props): React.ReactElement {
);
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('bounties'), 'start', 3],
[t('value')],
[t('curator'), 'start'],
[t('next action'), 'start', 3]
[t<string>('bounties'), 'start', 3],
[t<string>('value')],
[t<string>('curator'), 'start'],
[t<string>('next action'), 'start', 3]
]);
return (

View File

@ -148,11 +148,11 @@ function Bounty ({ bestNumber, bounty, className = '', description, index, propo
</Columar.Column>
<Columar.Column>
<div className='column'>
<h5>{t('Proposer')}</h5>
<h5>{t<string>('Proposer')}</h5>
<AddressSmall value={proposer} />
</div>
<div className='column'>
<h5>{t('Bond')}</h5>
<h5>{t<string>('Bond')}</h5>
<div className='inline-balance'><FormatBalance value={bond} /></div>
</div>
{curator && (

View File

@ -55,29 +55,29 @@ function SlashCurator ({ action, curatorId, description, index, toggleOpen }: Pr
const actionProperties = useMemo<Record<ValidUnassignCuratorAction, ActionProperties>>(() => ({
SlashCuratorAction: {
filter: allAccounts,
header: t('This action will Slash the Curator.'),
header: t<string>('This action will Slash the Curator.'),
params: [index],
proposingAccountTip: t('The account that will create the transaction.'),
proposingAccountTip: t<string>('The account that will create the transaction.'),
tip: t("Curator's deposit will be slashed and curator will be unassigned. Bounty will return to the Funded state."),
title: t('Slash curator'),
title: t<string>('Slash curator'),
tx: unassignCurator
},
SlashCuratorMotion: {
filter: members,
header: t('This action will create a Council motion to slash the Curator.'),
header: t<string>('This action will create a Council motion to slash the Curator.'),
params: [threshold, unassignCuratorProposal, unassignCuratorProposal?.length],
proposingAccountTip: t('The council member that will create the motion, submission equates to an "aye" vote.'),
proposingAccountTip: t<string>('The council member that will create the motion, submission equates to an "aye" vote.'),
tip: t("If the motion is approved, Curator's deposit will be slashed and Curator will be unassigned. Bounty will return to the Funded state."),
title: t('Slash curator'),
title: t<string>('Slash curator'),
tx: councilMod && api.tx[councilMod].propose
},
UnassignCurator: {
filter: members,
header: t('This action will create a Council motion to unassign the Curator.'),
header: t<string>('This action will create a Council motion to unassign the Curator.'),
params: [threshold, unassignCuratorProposal, unassignCuratorProposal?.length],
proposingAccountTip: t('The council member that will create the motion, submission equates to an "aye" vote.'),
tip: t('If the motion is approved, the current Curator will be unassigned and the Bounty will return to the Funded state.'),
title: t('Unassign curator'),
proposingAccountTip: t<string>('The council member that will create the motion, submission equates to an "aye" vote.'),
tip: t<string>('If the motion is approved, the current Curator will be unassigned and the Bounty will return to the Funded state.'),
title: t<string>('Unassign curator'),
tx: councilMod && api.tx[councilMod].propose
}
}), [t, index, unassignCurator, api, allAccounts, councilMod, members, threshold, unassignCuratorProposal]);

View File

@ -45,9 +45,9 @@ function Index ({ bestNumber, className, description, index, proposals, status }
const availableSlashActions = determineUnassignCuratorAction(roles, status, blocksUntilUpdate);
const slashCuratorActionNames = useRef<Record<ValidUnassignCuratorAction, string>>({
SlashCuratorAction: t('Slash curator'),
SlashCuratorMotion: t('Slash curator (Council)'),
UnassignCurator: t('Unassign curator')
SlashCuratorAction: t<string>('Slash curator'),
SlashCuratorMotion: t<string>('Slash curator (Council)'),
UnassignCurator: t<string>('Unassign curator')
});
const existingCloseBountyProposal = useMemo(

View File

@ -22,11 +22,11 @@ function VotingDescriptionInfo ({ className, proposal, status }: Props): React.R
const bestProposalName = proposalNameToDisplay(proposal, status);
const { t } = useTranslation();
const votingDescriptions = useRef<Record<string, string>>({
approveBounty: t('Bounty approval under voting'),
closeBounty: t('Bounty rejection under voting'),
proposeCurator: t('Curator proposal under voting'),
slashCurator: t('Curator slash under voting'),
unassignCurator: t('Unassign curator under voting')
approveBounty: t<string>('Bounty approval under voting'),
closeBounty: t<string>('Bounty rejection under voting'),
proposeCurator: t<string>('Curator proposal under voting'),
slashCurator: t<string>('Curator slash under voting'),
unassignCurator: t<string>('Unassign curator under voting')
});
return (

View File

@ -34,8 +34,8 @@ function VotingSummary ({ className, proposal, status }: Props): JSX.Element {
className={className}
data-testid='voting-summary'
>
<div className='voting-summary-text'><span>{t('Aye')}</span> <b>{ayes}/{threshold}</b></div>
<div className='voting-summary-text'><span>{t('Nay')}</span> <b>{nays}/{nayThreshold}</b></div>
<div className='voting-summary-text'><span>{t<string>('Aye')}</span> <b>{ayes}/{threshold}</b></div>
<div className='voting-summary-text'><span>{t<string>('Nay')}</span> <b>{nays}/{nayThreshold}</b></div>
<div className='link-info'>
<VotingLink />
<VotingDescriptionInfo

View File

@ -47,8 +47,8 @@ function VotersColumn ({ className, option, proposals, status }: Props): React.R
<div className='vote-numbers'>
<span className='vote-numbers-icon'><Icon icon={icons[option]} /></span>
<span className='vote-numbers-label'>
{option === 'ayes' && t('Aye: {{count}}', { replace: { count: votes ? votes.length : 0 } })}
{option === 'nays' && t('Nay: {{count}}', { replace: { count: votes ? votes.length : 0 } })}
{option === 'ayes' && t<string>('Aye: {{count}}', { replace: { count: votes ? votes.length : 0 } })}
{option === 'nays' && t<string>('Nay: {{count}}', { replace: { count: votes ? votes.length : 0 } })}
</span>
</div>
{voters}

View File

@ -96,7 +96,7 @@ function Claim ({ accountId, className = '', ethereumAddress, ethereumSignature,
<TxButton
icon='paper-plane'
isUnsigned
label={t('Claim')}
label={t<string>('Claim')}
onSuccess={onSuccess}
{...constructTx(api, systemChain, accountId, ethereumSignature, statementKind, isOldClaimProcess)}
/>

View File

@ -27,7 +27,7 @@ function StatementFullText ({ statementUrl, systemChain }: { statementUrl?: stri
: null;
default:
return <p>{t('Warning: we did not find any attest statement for {{chain}}', { replace: { chain: systemChain } })}</p>;
return <p>{t<string>('Warning: we did not find any attest statement for {{chain}}', { replace: { chain: systemChain } })}</p>;
}
}
@ -41,7 +41,7 @@ function Statement ({ className, kind, systemChain }: Props): React.ReactElement
return (
<StyledDiv className={className}>
{t('Please read these terms and conditions carefully. By submitting this statement, you are deemed to have accepted these Terms and Conditions. If you do not agree to these terms, please refrain from accessing or proceeding. You can also find them at:')}
{t<string>('Please read these terms and conditions carefully. By submitting this statement, you are deemed to have accepted these Terms and Conditions. If you do not agree to these terms, please refrain from accessing or proceeding. You can also find them at:')}
<a
className='statementUrl'
href={statementUrl}

View File

@ -26,8 +26,8 @@ function Warning ({ className }: Props): React.ReactElement<Props> | null {
<StyledDiv className={className}>
{
needsAttest.length > 1
? t('You need to sign an attestation for the following accounts:')
: t('You need to sign an attestation for the following account:')
? t<string>('You need to sign an attestation for the following accounts:')
: t<string>('You need to sign an attestation for the following account:')
}{
needsAttest.map((address) => (
<AddressMini

View File

@ -40,14 +40,14 @@ function Add ({ onClose }: Props): React.ReactElement {
return (
<Modal
header={t('Add an existing code hash')}
header={t<string>('Add an existing code hash')}
onClose={onClose}
>
<Modal.Content>
<Input
autoFocus
isError={codeHash.length > 0 && !isCodeHashValid}
label={t('code hash')}
label={t<string>('code hash')}
onChange={setCodeHash}
value={codeHash}
/>
@ -74,7 +74,7 @@ function Add ({ onClose }: Props): React.ReactElement {
<Button
icon='save'
isDisabled={!isValid}
label={t('Save')}
label={t<string>('Save')}
onClick={_onSave}
/>
</Modal.Actions>

View File

@ -106,7 +106,7 @@ function Code ({ className, code, onShowDeploy }: Props): React.ReactElement<Pro
{!contractAbi && (
<Button
icon='upload'
label={t('deploy')}
label={t<string>('deploy')}
onClick={_onShowDeploy}
/>
)}

View File

@ -132,7 +132,7 @@ function Upload ({ onClose }: Props): React.ReactElement {
return (
<Modal
header={t('Upload & deploy code {{info}}', { replace: { info: `${step}/2` } })}
header={t<string>('Upload & deploy code {{info}}', { replace: { info: `${step}/2` } })}
onClose={onClose}
>
<Modal.Content>
@ -140,7 +140,7 @@ function Upload ({ onClose }: Props): React.ReactElement {
<>
<InputAddress
isInput={false}
label={t('deployment account')}
label={t<string>('deployment account')}
labelExtra={
<Available
label={t<string>('transferrable')}
@ -185,7 +185,7 @@ function Upload ({ onClose }: Props): React.ReactElement {
<>
<Dropdown
isDisabled={contractAbi.constructors.length <= 1}
label={t('deployment constructor')}
label={t<string>('deployment constructor')}
onChange={setConstructorIndex}
options={constructOptions}
value={constructorIndex}
@ -237,7 +237,7 @@ function Upload ({ onClose }: Props): React.ReactElement {
extrinsic={uploadTx}
icon='upload'
isDisabled={!isSubmittable}
label={t('Deploy')}
label={t<string>('Deploy')}
onClick={onClose}
onSuccess={_onSuccess}
/>

View File

@ -47,8 +47,8 @@ function ValidateCode ({ codeHash, onChange }: Props): React.ReactElement<Props>
<InfoForInput type='error'>
{
isValidHex
? t('Unable to find on-chain WASM code for the supplied codeHash')
: t('The codeHash is not a valid hex hash')
? t<string>('Unable to find on-chain WASM code for the supplied codeHash')
: t<string>('The codeHash is not a valid hex hash')
}
</InfoForInput>
);

View File

@ -18,10 +18,10 @@ function Codes ({ onShowDeploy }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const headerRef = useRef<[string?, string?, number?][]>([
[t('code hashes'), 'start'],
[t<string>('code hashes'), 'start'],
[],
[],
[t('status'), 'start'],
[t<string>('status'), 'start'],
[]
]);

View File

@ -65,7 +65,7 @@ function Add ({ onClose }: Props): React.ReactElement {
return (
<Modal
header={t('Add an existing contract')}
header={t<string>('Add an existing contract')}
onClose={onClose}
>
<Modal.Content>

View File

@ -212,7 +212,7 @@ function Call ({ className = '', contract, messageIndex, onCallResult, onChangeM
extrinsic={execTx}
icon='sign-in-alt'
isDisabled={!isValid || !execTx}
label={t('Execute')}
label={t<string>('Execute')}
onStart={onClose}
/>
)

View File

@ -44,9 +44,9 @@ function ContractsTable ({ contracts: keyringContracts }: Props): React.ReactEle
const [contractLinks, setContractLinks] = useState<Record<string, ContractLink[]>>({});
const headerRef = useRef<[string?, string?, number?][]>([
[t('contracts'), 'start'],
[t<string>('contracts'), 'start'],
[undefined, undefined, 3],
[t('status'), 'start'],
[t<string>('status'), 'start'],
[]
]);

View File

@ -118,13 +118,13 @@ function Deploy ({ codeHash, constructorIndex = 0, onClose, setConstructorIndex
return (
<Modal
header={t('Deploy a contract')}
header={t<string>('Deploy a contract')}
onClose={onClose}
>
<Modal.Content>
<InputAddress
isInput={false}
label={t('deployment account')}
label={t<string>('deployment account')}
labelExtra={
<Available
label={t<string>('transferrable')}
@ -156,7 +156,7 @@ function Deploy ({ codeHash, constructorIndex = 0, onClose, setConstructorIndex
<>
<Dropdown
isDisabled={contractAbi.constructors.length <= 1}
label={t('deployment constructor')}
label={t<string>('deployment constructor')}
onChange={setConstructorIndex}
options={constructOptions}
value={constructorIndex}
@ -201,7 +201,7 @@ function Deploy ({ codeHash, constructorIndex = 0, onClose, setConstructorIndex
extrinsic={initTx}
icon='upload'
isDisabled={!isValid || !initTx}
label={t('Deploy')}
label={t<string>('Deploy')}
onClick={onClose}
onSuccess={_onSuccess}
withSpinner

View File

@ -53,17 +53,17 @@ function Contracts ({ className = '' }: Props): React.ReactElement<Props> {
<Button.Group>
<Button
icon='plus'
label={t('Upload & deploy code')}
label={t<string>('Upload & deploy code')}
onClick={toggleUpload}
/>
<Button
icon='plus'
label={t('Add an existing code hash')}
label={t<string>('Add an existing code hash')}
onClick={toggleHash}
/>
<Button
icon='plus'
label={t('Add an existing contract')}
label={t<string>('Add an existing contract')}
onClick={toggleAdd}
/>
</Button.Group>

View File

@ -17,7 +17,7 @@ function ContractsApp ({ basePath, className = '' }: Props): React.ReactElement<
{
isRoot: true,
name: 'contracts',
text: t('Contracts')
text: t<string>('Contracts')
}
]);

View File

@ -26,10 +26,10 @@ function Proposals ({ className = '', motions, prime }: Props): React.ReactEleme
const { isMember, members } = useCollectiveMembers('council');
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('motions'), 'start', 2],
[t('threshold')],
[t('voting end')],
[t('votes'), 'expand'],
[t<string>('motions'), 'start', 2],
[t<string>('threshold')],
[t<string>('voting end')],
[t<string>('votes'), 'expand'],
[],
[undefined, 'badge'],
[]

View File

@ -22,11 +22,11 @@ function Candidates ({ allVotes = {}, electionsInfo, hasElections }: Props): Rea
const { t } = useTranslation();
const headerCandidatesRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('candidates'), 'start', 2]
[t<string>('candidates'), 'start', 2]
]);
const headerRunnersRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('runners up'), 'start', 2]
[t<string>('runners up'), 'start', 2]
]);
return (

View File

@ -23,7 +23,7 @@ function Members ({ allVotes = {}, className = '', electionsInfo, hasElections,
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('members'), 'start', 2]
[t<string>('members'), 'start', 2]
]);
return (

View File

@ -40,7 +40,7 @@ function SubmitCandidacy ({ electionsInfo }: Props): React.ReactElement<Props> |
/>
</Modal.Columns>
{api.consts[modLocation] && (
<Modal.Columns hint={t('The bond will be reserved for the duration of your candidacy and membership.')}>
<Modal.Columns hint={t<string>('The bond will be reserved for the duration of your candidacy and membership.')}>
<InputBalance
defaultValue={api.consts[modLocation as 'council']?.candidacyBond as u128}
isDisabled

View File

@ -115,7 +115,7 @@ function Vote ({ electionsInfo }: Props): React.ReactElement<Props> | null {
/>
</Modal.Columns>
{bondValue && (
<Modal.Columns hint={t('The amount will be reserved for the duration of your vote')}>
<Modal.Columns hint={t<string>('The amount will be reserved for the duration of your vote')}>
<InputBalance
defaultValue={bondValue}
isDisabled

View File

@ -21,9 +21,9 @@ function Externals ({ className }: Props): React.ReactElement<Props> | null {
const external = useCall<DeriveProposalExternal | null>(api.derive.democracy.nextExternal);
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('external'), 'start'],
[t('proposer'), 'address'],
[t('locked')],
[t<string>('external'), 'start'],
[t<string>('proposer'), 'address'],
[t<string>('locked')],
[]
]);

View File

@ -21,9 +21,9 @@ function Proposals ({ className }: Props): React.ReactElement<Props> {
const proposals = useCall<DeriveProposal[]>(api.derive.democracy.proposals);
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('proposals'), 'start', 2],
[t('proposer'), 'address'],
[t('locked'), 'media--1200'],
[t<string>('proposals'), 'start', 2],
[t<string>('proposer'), 'address'],
[t<string>('locked'), 'media--1200'],
[undefined, undefined, 2]
]);

View File

@ -19,12 +19,12 @@ function Referendums ({ className = '', referendums }: Props): React.ReactElemen
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('referenda'), 'start', 2],
[t('remaining'), 'media--1200'],
[t('activate'), 'media--1400'],
[t('turnout'), 'media--1400'],
[t<string>('referenda'), 'start', 2],
[t<string>('remaining'), 'media--1200'],
[t<string>('activate'), 'media--1400'],
[t<string>('turnout'), 'media--1400'],
[undefined, 'badge'],
[t('votes'), 'expand'],
[t<string>('votes'), 'expand'],
[undefined, 'media--1000'],
[undefined, undefined, 2]
]);

View File

@ -18,7 +18,7 @@ function BlockHeaders ({ headers }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('recent blocks'), 'start', 3]
[t<string>('recent blocks'), 'start', 3]
]);
return (

View File

@ -105,10 +105,10 @@ function BlockByHash ({ className = '', error, value }: Props): React.ReactEleme
() => getHeader
? [
[formatNumber(getHeader.number.unwrap()), 'start --digits', 1],
[t('hash'), 'start'],
[t('parent'), 'start'],
[t('extrinsics'), 'start media--1300'],
[t('state'), 'start media--1200'],
[t<string>('hash'), 'start'],
[t<string>('parent'), 'start'],
[t<string>('extrinsics'), 'start media--1300'],
[t<string>('state'), 'start media--1200'],
[runtimeVersion ? `${runtimeVersion.specName.toString()}/${runtimeVersion.specVersion.toString()}` : undefined, 'media--1000']
]
: EMPTY_HEADER,

View File

@ -28,8 +28,8 @@ function Extrinsics ({ blockNumber, className = '', events, label, maxBlockWeigh
const header = useMemo<[React.ReactNode?, string?, number?][]>(
() => [
[label || t<string>('extrinsics'), 'start', 2],
[t('events'), 'start media--1000', 2],
[t('weight'), 'media--1400'],
[t<string>('events'), 'start media--1000', 2],
[t<string>('weight'), 'media--1400'],
[undefined, 'address media--1200']
],
[label, t]

View File

@ -40,7 +40,7 @@ function JustificationList ({ value }: Props): React.ReactElement<Props> | null
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('justifications'), 'start']
[t<string>('justifications'), 'start']
]);
const justifications = value.unwrapOr(null);

View File

@ -106,7 +106,7 @@ function Logs ({ value }: Props): React.ReactElement<Props> | null {
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('logs'), 'start']
[t<string>('logs'), 'start']
]);
return (

View File

@ -33,9 +33,9 @@ function Peers ({ className = '', peers }: Props): React.ReactElement<Props> {
const { t } = useTranslation();
const headerRef = useRef<([React.ReactNode?, string?, number?] | false)[]>([
[t('connected peers'), 'start', 2],
[t('best hash'), 'start'],
[t('best #'), 'number']
[t<string>('connected peers'), 'start', 2],
[t<string>('best hash'), 'start'],
[t<string>('best #'), 'number']
]);
const sorted = useMemo(

Some files were not shown because too many files have changed in this diff Show More