Split RPC (dejavu) into own nav item (#3494)
* Split RPC (dejavu) into own nav item * RPC/Extrinsics icons * Split addressbook app * Update create path
This commit is contained in:
parent
6129427bd0
commit
12508224ac
20
packages/apps-routing/src/addresses.ts
Normal file
20
packages/apps-routing/src/addresses.ts
Normal file
@ -0,0 +1,20 @@
|
||||
// Copyright 2017-2020 @polkadot/apps-routing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Route } from './types';
|
||||
|
||||
import Component from '@polkadot/app-addresses';
|
||||
|
||||
export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
|
||||
return {
|
||||
Component,
|
||||
display: {
|
||||
needsApi: []
|
||||
},
|
||||
group: 'accounts',
|
||||
icon: 'address-card',
|
||||
name: 'addresses',
|
||||
text: t<string>('nav.addresses', 'Address book', { ns: 'apps-routing' })
|
||||
};
|
||||
}
|
||||
@ -14,7 +14,7 @@ export default function create (t: <T = string> (key: string, text: string, opti
|
||||
needsApi: []
|
||||
},
|
||||
group: 'developer',
|
||||
icon: 'sync',
|
||||
icon: 'envelope-open-text',
|
||||
name: 'extrinsics',
|
||||
text: t<string>('nav.extrinsics', 'Extrinsics', { ns: 'apps-routing' })
|
||||
};
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
import { Routes } from './types';
|
||||
|
||||
import accounts from './accounts';
|
||||
import addresses from './addresses';
|
||||
import claims from './claims';
|
||||
import contracts from './contracts';
|
||||
import council from './council';
|
||||
@ -16,13 +17,14 @@ import genericAsset from './generic-asset';
|
||||
import js from './js';
|
||||
import parachains from './parachains';
|
||||
import poll from './poll';
|
||||
import rpc from './rpc';
|
||||
import settings from './settings';
|
||||
import signing from './signing';
|
||||
import society from './society';
|
||||
import staking from './staking';
|
||||
import storage from './storage';
|
||||
import sudo from './sudo';
|
||||
import techcomm from './techcomm';
|
||||
import toolbox from './toolbox';
|
||||
import transfer from './transfer';
|
||||
import treasury from './treasury';
|
||||
|
||||
@ -30,6 +32,7 @@ export default function create (t: <T = string> (key: string, text: string, opti
|
||||
return [
|
||||
// dashboard(t),
|
||||
accounts(t),
|
||||
addresses(t),
|
||||
explorer(t),
|
||||
claims(t),
|
||||
poll(t),
|
||||
@ -45,9 +48,10 @@ export default function create (t: <T = string> (key: string, text: string, opti
|
||||
contracts(t),
|
||||
storage(t),
|
||||
extrinsics(t),
|
||||
rpc(t),
|
||||
signing(t),
|
||||
sudo(t),
|
||||
settings(t),
|
||||
toolbox(t),
|
||||
js(t)
|
||||
js(t),
|
||||
settings(t)
|
||||
];
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
|
||||
import { Route } from './types';
|
||||
|
||||
import Component from '@polkadot/app-toolbox';
|
||||
import Component from '@polkadot/app-rpc';
|
||||
|
||||
export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
|
||||
return {
|
||||
@ -13,8 +13,8 @@ export default function create (t: <T = string> (key: string, text: string, opti
|
||||
needsApi: []
|
||||
},
|
||||
group: 'developer',
|
||||
icon: 'tools',
|
||||
name: 'toolbox',
|
||||
text: t<string>('nav.toolbox', 'Toolbox', { ns: 'apps-routing' })
|
||||
icon: 'network-wired',
|
||||
name: 'rpc',
|
||||
text: t<string>('nav.rpc', 'RPC calls', { ns: 'apps-routing' })
|
||||
};
|
||||
}
|
||||
21
packages/apps-routing/src/signing.ts
Normal file
21
packages/apps-routing/src/signing.ts
Normal file
@ -0,0 +1,21 @@
|
||||
// Copyright 2017-2020 @polkadot/apps-routing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { Route } from './types';
|
||||
|
||||
import Component from '@polkadot/app-signing';
|
||||
|
||||
export default function create (t: <T = string> (key: string, text: string, options: { ns: string }) => T): Route {
|
||||
return {
|
||||
Component,
|
||||
display: {
|
||||
needsAccounts: true,
|
||||
needsApi: []
|
||||
},
|
||||
group: 'developer',
|
||||
icon: 'signature',
|
||||
name: 'signing',
|
||||
text: t<string>('nav.signing', 'Sign and verify', { ns: 'apps-routing' })
|
||||
};
|
||||
}
|
||||
@ -1024,6 +1024,7 @@
|
||||
"nav.i18n": "I18n مترجم",
|
||||
"nav.js": "جافا سكريبت",
|
||||
"nav.parachains": "السلاسل الموازية",
|
||||
"nav.rpc": "استدعاء إجراء مكالمة عن بُعد",
|
||||
"nav.settings": "الإعدادات",
|
||||
"nav.society": "المجتمع",
|
||||
"nav.staking": "الرهان",
|
||||
|
||||
@ -11,8 +11,6 @@
|
||||
"Add account": "Add account",
|
||||
"Add account via Qr": "Add account via Qr",
|
||||
"Add an account via seed": "Add an account via seed",
|
||||
"Add an address": "Add an address",
|
||||
"Add contact": "Add contact",
|
||||
"Add identity judgment": "Add identity judgment",
|
||||
"Add multisig": "Add multisig",
|
||||
"Add proxied account": "Add proxied account",
|
||||
@ -43,9 +41,7 @@
|
||||
"Create a backup file for this account": "Create a backup file for this account",
|
||||
"Create and backup account": "Create and backup account",
|
||||
"Delegate": "Delegate",
|
||||
"Delegate democracy vote": "Delegate democracy vote",
|
||||
"Delegate democracy votes": "Delegate democracy votes",
|
||||
"Deposit": "Deposit",
|
||||
"Derive account from pair": "Derive account from pair",
|
||||
"Derive account via derivation path": "Derive account via derivation path",
|
||||
"Determines what cryptography will be used to create this account. Note that to validate on Polkadot, the session account must use \"ed25519\".": "Determines what cryptography will be used to create this account. Note that to validate on Polkadot, the session account must use \"ed25519\".",
|
||||
@ -61,7 +57,6 @@
|
||||
"For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.": "For approvals outstanding approvers will be shown, for hashes that should be cancelled the first approver is required.",
|
||||
"For final approvals, the actual full call data is required to execute the transaction": "For final approvals, the actual full call data is required to execute the transaction",
|
||||
"Forget this account": "Forget this account",
|
||||
"Forget this address": "Forget this address",
|
||||
"Full Legal Name": "Full Legal Name",
|
||||
"Future versions of the web-only interface will drop support for non-external accounts, much like the IPFS version.": "Future versions of the web-only interface will drop support for non-external accounts, much like the IPFS version.",
|
||||
"If the delegated account is currently voting in a referendum, the delegating vote and conviction will be added.": "If the delegated account is currently voting in a referendum, the delegating vote and conviction will be added.",
|
||||
@ -88,7 +83,6 @@
|
||||
"Multisig message with call (for final approval)": "Multisig message with call (for final approval)",
|
||||
"My On-Chain Name": "My On-Chain Name",
|
||||
"My accounts": "My accounts",
|
||||
"My contacts": "My contacts",
|
||||
"Name given to this account. You can change it at any point in the future.": "Name given to this account. You can change it at any point in the future.",
|
||||
"Name given to this account. You can edit it. To use the account to validate or nominate, it is a good practice to append the function of the account in the name, e.g \"name_you_want - stash\".": "Name given to this account. You can edit it. To use the account to validate or nominate, it is a good practice to append the function of the account in the name, e.g \"name_you_want - stash\".",
|
||||
"Name given to this multisig. You can edit it at any later point in time.": "Name given to this multisig. You can edit it at any later point in time.",
|
||||
@ -98,7 +92,6 @@
|
||||
"No sub identities set.": "No sub identities set.",
|
||||
"One of more extensions has been detected in your browser, however no accounts has been injected.": "One of more extensions has been detected in your browser, however no accounts has been injected.",
|
||||
"Owned": "Owned",
|
||||
"Paste here the address of the contact you want to add to your address book.": "Paste here the address of the contact you want to add to your address book.",
|
||||
"Pending call hashes": "Pending call hashes",
|
||||
"Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.": "Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.",
|
||||
"Provide judgement": "Provide judgement",
|
||||
@ -119,15 +112,12 @@
|
||||
"Save": "Save",
|
||||
"Save delegation": "Save delegation",
|
||||
"Save this backup file in a secure location. Additionally, the password associated with this account is needed together with this backup file in order to restore your account.": "Save this backup file in a secure location. Additionally, the password associated with this account is needed together with this backup file in order to restore your account.",
|
||||
"Saved": "Saved",
|
||||
"Search for": "Search for",
|
||||
"Select a contact or paste the address you want to send funds to.": "Select a contact or paste the address you want to send funds to.",
|
||||
"Select the JSON key file that was downloaded when you created the account. This JSON file contains your private key encrypted with your password.": "Select the JSON key file that was downloaded when you created the account. This JSON file contains your private key encrypted with your password.",
|
||||
"Select the account you wish to recover into this account.": "Select the account you wish to recover into this account.",
|
||||
"Send": "Send",
|
||||
"Send funds": "Send funds",
|
||||
"Send funds from this account": "Send funds from this account",
|
||||
"Send funds to this address": "Send funds to this address",
|
||||
"Set Identity": "Set Identity",
|
||||
"Set Subs": "Set Subs",
|
||||
"Set on-chain identity": "Set on-chain identity",
|
||||
@ -195,7 +185,6 @@
|
||||
"Total amount of fund that will be reserved. These funds are returned when the identity is cleared": "Total amount of fund that will be reserved. These funds are returned when the identity is cleared",
|
||||
"Type here what you would like your address to contain. This tool will generate the keys and show the associated addresses that best match your search. You can use \"?\" as a wildcard for a character.": "Type here what you would like your address to contain. This tool will generate the keys and show the associated addresses that best match your search. You can use \"?\" as a wildcard for a character.",
|
||||
"Type the amount you want to transfer. Note that you can select the unit on the right e.g sending 1 milli is equivalent to sending 0.001.": "Type the amount you want to transfer. Note that you can select the unit on the right e.g sending 1 milli is equivalent to sending 0.001.",
|
||||
"Type the name of your contact. This name will be used across all the apps. It can be edited later on.": "Type the name of your contact. This name will be used across all the apps. It can be edited later on.",
|
||||
"Type the password chosen at the account creation. It was used to encrypt your account's private key in the backup file.": "Type the password chosen at the account creation. It was used to encrypt your account's private key in the backup file.",
|
||||
"Undelegate": "Undelegate",
|
||||
"Unlock": "Unlock",
|
||||
@ -214,10 +203,6 @@
|
||||
"account restored": "account restored",
|
||||
"accounts": "accounts",
|
||||
"added proxy": "added proxy",
|
||||
"address": "address",
|
||||
"address created": "address created",
|
||||
"address edited": "address edited",
|
||||
"address forgotten": "address forgotten",
|
||||
"address {{index}}": "address {{index}}",
|
||||
"amount": "amount",
|
||||
"approval type": "approval type",
|
||||
@ -228,7 +213,6 @@
|
||||
"balances": "balances",
|
||||
"call data for final approval": "call data for final approval",
|
||||
"case sensitive": "case sensitive",
|
||||
"contacts": "contacts",
|
||||
"conviction": "conviction",
|
||||
"created account": "created account",
|
||||
"created multisig": "created multisig",
|
||||
@ -237,7 +221,6 @@
|
||||
"delegated account": "delegated account",
|
||||
"delegating account": "delegating account",
|
||||
"delegating amount": "delegating amount",
|
||||
"delegation": "delegation",
|
||||
"democracy vote delegation": "democracy vote delegation",
|
||||
"deposit": "deposit",
|
||||
"derivation path": "derivation path",
|
||||
@ -245,13 +228,11 @@
|
||||
"development seed": "development seed",
|
||||
"display name": "display name",
|
||||
"email": "email",
|
||||
"exclude value": "exclude value",
|
||||
"existential deposit": "existential deposit",
|
||||
"filter by name or tags": "filter by name or tags",
|
||||
"https://example.com": "https://example.com",
|
||||
"identity": "identity",
|
||||
"include field": "include field",
|
||||
"include value": "include value",
|
||||
"invalid/unknown registrar account": "invalid/unknown registrar account",
|
||||
"judgement": "judgement",
|
||||
"keypair crypto type": "keypair crypto type",
|
||||
@ -262,10 +243,6 @@
|
||||
"multisig name": "multisig name",
|
||||
"name": "name",
|
||||
"new account": "new account",
|
||||
"new address": "new address",
|
||||
"no accounts yet, create or import an existing": "no accounts yet, create or import an existing",
|
||||
"no addresses saved yet, add any existing address": "no addresses saved yet, add any existing address",
|
||||
"no tags": "no tags",
|
||||
"parent": "parent",
|
||||
"password": "password",
|
||||
"password (repeat)": "password (repeat)",
|
||||
|
||||
22
packages/apps/public/locales/en/app-addresses.json
Normal file
22
packages/apps/public/locales/en/app-addresses.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"Add an address": "Add an address",
|
||||
"Add contact": "Add contact",
|
||||
"Forget this address": "Forget this address",
|
||||
"My contacts": "My contacts",
|
||||
"Paste here the address of the contact you want to add to your address book.": "Paste here the address of the contact you want to add to your address book.",
|
||||
"Save": "Save",
|
||||
"Type the name of your contact. This name will be used across all the apps. It can be edited later on.": "Type the name of your contact. This name will be used across all the apps. It can be edited later on.",
|
||||
"address": "address",
|
||||
"address created": "address created",
|
||||
"address edited": "address edited",
|
||||
"address forgotten": "address forgotten",
|
||||
"balances": "balances",
|
||||
"contacts": "contacts",
|
||||
"filter by name or tags": "filter by name or tags",
|
||||
"name": "name",
|
||||
"new address": "new address",
|
||||
"no addresses saved yet, add any existing address": "no addresses saved yet, add any existing address",
|
||||
"send": "send",
|
||||
"tags": "tags",
|
||||
"transactions": "transactions"
|
||||
}
|
||||
8
packages/apps/public/locales/en/app-rpc.json
Normal file
8
packages/apps/public/locales/en/app-rpc.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"RPC calls": "RPC calls",
|
||||
"Submit RPC call": "Submit RPC call",
|
||||
"The actual JSONRPC module and function to make a call to.": "The actual JSONRPC module and function to make a call to.",
|
||||
"call the selected endpoint": "call the selected endpoint",
|
||||
"sign data from account": "sign data from account",
|
||||
"with an index of": "with an index of"
|
||||
}
|
||||
@ -4,12 +4,9 @@
|
||||
"Detection on the input string to determine if it is hex or non-hex.": "Detection on the input string to determine if it is hex or non-hex.",
|
||||
"Hash data": "Hash data",
|
||||
"No": "No",
|
||||
"RPC calls": "RPC calls",
|
||||
"Sign message": "Sign message",
|
||||
"Submit RPC call": "Submit RPC call",
|
||||
"The account that signed the input": "The account that signed the input",
|
||||
"The account's password specified at the creation of this account.": "The account's password specified at the creation of this account.",
|
||||
"The actual JSONRPC module and function to make a call to.": "The actual JSONRPC module and function to make a call to.",
|
||||
"The blake2b 256-bit hash of the actual input data.": "The blake2b 256-bit hash of the actual input data.",
|
||||
"The data that was signed. This is used in combination with the signature for the verification. It can either be hex or a string.": "The data that was signed. This is used in combination with the signature for the verification. It can either be hex or a string.",
|
||||
"The input data to hash. This can be either specified as a hex value (0x-prefix) or as a string.": "The input data to hash. This can be either specified as a hex value (0x-prefix) or as a string.",
|
||||
@ -27,18 +24,15 @@
|
||||
"Yes": "Yes",
|
||||
"You need to unlock this account to be able to sign data.": "You need to unlock this account to be able to sign data.",
|
||||
"account": "account",
|
||||
"call the selected endpoint": "call the selected endpoint",
|
||||
"from the following data": "from the following data",
|
||||
"hex input data": "hex input data",
|
||||
"password": "password",
|
||||
"select the account you wish to sign data with": "select the account you wish to sign data with",
|
||||
"sign data from account": "sign data from account",
|
||||
"sign the following data": "sign the following data",
|
||||
"signature crypto type": "signature crypto type",
|
||||
"signature of supplied data": "signature of supplied data",
|
||||
"the resulting hash is": "the resulting hash is",
|
||||
"the supplied signature": "the supplied signature",
|
||||
"using the following data": "using the following data",
|
||||
"verify using address": "verify using address",
|
||||
"with an index of": "with an index of"
|
||||
"verify using address": "verify using address"
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
[
|
||||
"app-accounts.json",
|
||||
"app-addresses.json",
|
||||
"app-claims.json",
|
||||
"app-contracts.json",
|
||||
"app-council.json",
|
||||
@ -10,13 +11,14 @@
|
||||
"app-js.json",
|
||||
"app-parachains.json",
|
||||
"app-poll.json",
|
||||
"app-rpc.json",
|
||||
"app-settings.json",
|
||||
"app-signing.json",
|
||||
"app-society.json",
|
||||
"app-staking.json",
|
||||
"app-storage.json",
|
||||
"app-sudo.json",
|
||||
"app-tech-comm.json",
|
||||
"app-toolbox.json",
|
||||
"app-treasury.json",
|
||||
"apps-config.json",
|
||||
"apps-routing.json",
|
||||
|
||||
@ -866,6 +866,7 @@
|
||||
"nav.i18n": "Traductor I18n",
|
||||
"nav.js": "Javascript",
|
||||
"nav.parachains": "Parachains",
|
||||
"nav.rpc": "llamadas RPC",
|
||||
"nav.settings": "Ajustes",
|
||||
"nav.society": "Sociedad",
|
||||
"nav.staking": "Participación",
|
||||
|
||||
@ -459,6 +459,7 @@
|
||||
"nav.i18n": "I18n Translator",
|
||||
"nav.js": "Javascript",
|
||||
"nav.parachains": "パラチェーン",
|
||||
"nav.rpc": "RPCコール",
|
||||
"nav.settings": "設定",
|
||||
"nav.society": "ソサエティー",
|
||||
"nav.staking": "ステイキング",
|
||||
|
||||
@ -871,6 +871,7 @@
|
||||
"nav.i18n": "Tradutor I18n",
|
||||
"nav.js": "Javascript",
|
||||
"nav.parachains": "Parachains",
|
||||
"nav.rpc": "Chamadas RPC",
|
||||
"nav.settings": "Configurações",
|
||||
"nav.society": "Sociedade",
|
||||
"nav.staking": "Participação",
|
||||
|
||||
@ -883,6 +883,7 @@
|
||||
"nav.i18n": "I18n Переводчик",
|
||||
"nav.js": "javascript",
|
||||
"nav.parachains": "Парачейны",
|
||||
"nav.rpc": "RPC вызовы",
|
||||
"nav.settings": "Настройки",
|
||||
"nav.society": "Общество",
|
||||
"nav.staking": "Стейкинг",
|
||||
|
||||
@ -13,7 +13,6 @@ import basicMd from './md/basic.md';
|
||||
import { useTranslation } from './translate';
|
||||
import useCounter from './useCounter';
|
||||
import Accounts from './Accounts';
|
||||
import Contacts from './Contacts';
|
||||
import Vanity from './Vanity';
|
||||
|
||||
export { useCounter };
|
||||
@ -31,10 +30,6 @@ function AccountsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
|
||||
name: 'overview',
|
||||
text: t<string>('My accounts')
|
||||
},
|
||||
{
|
||||
name: 'contacts',
|
||||
text: t<string>('My contacts')
|
||||
},
|
||||
{
|
||||
name: 'vanity',
|
||||
text: t<string>('Vanity generator')
|
||||
@ -52,12 +47,6 @@ function AccountsApp ({ basePath, onStatusChange }: Props): React.ReactElement<P
|
||||
/>
|
||||
</header>
|
||||
<Switch>
|
||||
<Route path={`${basePath}/contacts`}>
|
||||
<Contacts
|
||||
basePath={basePath}
|
||||
onStatusChange={onStatusChange}
|
||||
/>
|
||||
</Route>
|
||||
<Route path={`${basePath}/vanity`}>
|
||||
<Vanity
|
||||
basePath={basePath}
|
||||
|
||||
1
packages/page-addresses/README.md
Normal file
1
packages/page-addresses/README.md
Normal file
@ -0,0 +1 @@
|
||||
# @polkadot/app-addresses
|
||||
24
packages/page-addresses/package.json
Normal file
24
packages/page-addresses/package.json
Normal file
@ -0,0 +1,24 @@
|
||||
{
|
||||
"name": "@polkadot/app-addresses",
|
||||
"private": true,
|
||||
"version": "0.55.0-beta.54",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/polkadot-js/apps.git",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [
|
||||
"Jaco Greeff <jacogr@gmail.com>"
|
||||
],
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/react-components": "0.55.0-beta.54",
|
||||
"@polkadot/vanitygen": "^0.20.0-beta.1",
|
||||
"detect-browser": "^5.1.1",
|
||||
"file-saver": "^2.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^10.4.8",
|
||||
"testcontainers": "^2.17.0"
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-accounts authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -8,12 +8,12 @@ import { ActionStatus } from '@polkadot/react-components/Status/types';
|
||||
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import Transfer from '@polkadot/app-accounts/Accounts/modals/Transfer';
|
||||
import { AddressSmall, AddressInfo, Button, ChainLock, Icon, LinkExternal, Forget, Menu, Popup, Tags } from '@polkadot/react-components';
|
||||
import { useApi, useCall } from '@polkadot/react-hooks';
|
||||
import keyring from '@polkadot/ui-keyring';
|
||||
import { BN_ZERO, formatNumber } from '@polkadot/util';
|
||||
|
||||
import Transfer from '../Accounts/modals/Transfer';
|
||||
import { useTranslation } from '../translate';
|
||||
|
||||
interface Props {
|
||||
@ -195,12 +195,14 @@ function Address ({ address, className = '', filter, isFavorite, toggleFavorite
|
||||
/>
|
||||
</td>
|
||||
<td className='button'>
|
||||
<Button
|
||||
icon='paper-plane'
|
||||
key='send'
|
||||
label={t<string>('send')}
|
||||
onClick={_toggleTransfer}
|
||||
/>
|
||||
{api.api.tx.balances?.transfer && (
|
||||
<Button
|
||||
icon='paper-plane'
|
||||
key='send'
|
||||
label={t<string>('send')}
|
||||
onClick={_toggleTransfer}
|
||||
/>
|
||||
)}
|
||||
<Popup
|
||||
className='theme--default'
|
||||
isOpen={isSettingPopupOpen}
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-accounts authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -9,9 +9,9 @@ import styled from 'styled-components';
|
||||
import { Button, Input, Table } from '@polkadot/react-components';
|
||||
import { useAddresses, useFavorites, useLoadingDelay, useToggle } from '@polkadot/react-hooks';
|
||||
|
||||
import { useTranslation } from '../translate';
|
||||
import CreateModal from './modals/Create';
|
||||
import Address from './Address';
|
||||
import { useTranslation } from '../translate';
|
||||
|
||||
type SortedAddress = { address: string; isFavorite: boolean };
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-accounts authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
45
packages/page-addresses/src/index.tsx
Normal file
45
packages/page-addresses/src/index.tsx
Normal file
@ -0,0 +1,45 @@
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { AppProps as Props } from '@polkadot/react-components/types';
|
||||
|
||||
import React, { useRef } from 'react';
|
||||
import { Route, Switch } from 'react-router';
|
||||
import { Tabs } from '@polkadot/react-components';
|
||||
|
||||
import { useTranslation } from './translate';
|
||||
import Contacts from './Contacts';
|
||||
|
||||
function AddressesApp ({ basePath, onStatusChange }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const itemsRef = useRef([
|
||||
{
|
||||
isRoot: true,
|
||||
name: 'contacts',
|
||||
text: t<string>('My contacts')
|
||||
}
|
||||
]);
|
||||
|
||||
return (
|
||||
<main>
|
||||
<header>
|
||||
<Tabs
|
||||
basePath={basePath}
|
||||
items={itemsRef.current}
|
||||
/>
|
||||
</header>
|
||||
<Switch>
|
||||
<Route>
|
||||
<Contacts
|
||||
basePath={basePath}
|
||||
onStatusChange={onStatusChange}
|
||||
/>
|
||||
</Route>
|
||||
</Switch>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(AddressesApp);
|
||||
9
packages/page-addresses/src/translate.ts
Normal file
9
packages/page-addresses/src/translate.ts
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { useTranslation as useTranslationBase, UseTranslationResponse } from 'react-i18next';
|
||||
|
||||
export function useTranslation (): UseTranslationResponse {
|
||||
return useTranslationBase('app-addresses');
|
||||
}
|
||||
35
packages/page-addresses/src/types.ts
Normal file
35
packages/page-addresses/src/types.ts
Normal file
@ -0,0 +1,35 @@
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { ActionStatus } from '@polkadot/react-components/Status/types';
|
||||
import { Balance, Conviction } from '@polkadot/types/interfaces';
|
||||
import { KeyringAddress } from '@polkadot/ui-keyring/types';
|
||||
|
||||
import { WithTranslation } from 'react-i18next';
|
||||
|
||||
export { AppProps as ComponentProps } from '@polkadot/react-components/types';
|
||||
|
||||
export interface BareProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export interface I18nProps extends BareProps, WithTranslation {}
|
||||
|
||||
export interface ModalProps {
|
||||
onClose: () => void;
|
||||
onStatusChange: (status: ActionStatus) => void;
|
||||
}
|
||||
|
||||
export interface Delegation {
|
||||
accountDelegated: string
|
||||
amount: Balance
|
||||
conviction: Conviction
|
||||
}
|
||||
|
||||
export interface SortedAccount {
|
||||
account: KeyringAddress;
|
||||
children: SortedAccount[];
|
||||
delegation?: Delegation;
|
||||
isFavorite: boolean;
|
||||
}
|
||||
65
packages/page-addresses/src/util.tsx
Normal file
65
packages/page-addresses/src/util.tsx
Normal file
@ -0,0 +1,65 @@
|
||||
// Copyright 2017-2020 @polkadot/app-addresses authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { SortedAccount } from './types';
|
||||
|
||||
import React from 'react';
|
||||
import { Menu } from '@polkadot/react-components';
|
||||
import keyring from '@polkadot/ui-keyring';
|
||||
import { KeyringAddress } from '@polkadot/ui-keyring/types';
|
||||
|
||||
export function createMenuGroup (items: (React.ReactNode | false | undefined | null)[]): React.ReactNode | null {
|
||||
const filtered = items.filter((item): item is React.ReactNode => !!item);
|
||||
|
||||
return filtered.length
|
||||
? <>{filtered}<Menu.Divider /></>
|
||||
: null;
|
||||
}
|
||||
|
||||
function expandList (mapped: SortedAccount[], entry: SortedAccount): SortedAccount[] {
|
||||
mapped.push(entry);
|
||||
|
||||
entry.children.forEach((entry): void => {
|
||||
expandList(mapped, entry);
|
||||
});
|
||||
|
||||
return mapped;
|
||||
}
|
||||
|
||||
export function sortAccounts (addresses: string[], favorites: string[]): SortedAccount[] {
|
||||
const mapped = addresses
|
||||
.map((address) => keyring.getAccount(address))
|
||||
.filter((account): account is KeyringAddress => !!account)
|
||||
.map((account): SortedAccount => ({
|
||||
account,
|
||||
children: [],
|
||||
isFavorite: favorites.includes(account.address)
|
||||
}))
|
||||
.sort((a, b) => (a.account.meta.whenCreated || 0) - (b.account.meta.whenCreated || 0));
|
||||
|
||||
return mapped
|
||||
.filter((entry): boolean => {
|
||||
const parentAddress = entry.account.meta.parentAddress;
|
||||
|
||||
if (parentAddress) {
|
||||
const parent = mapped.find(({ account: { address } }) => address === parentAddress);
|
||||
|
||||
if (parent) {
|
||||
parent.children.push(entry);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
.reduce(expandList, [])
|
||||
.sort((a, b): number =>
|
||||
a.isFavorite === b.isFavorite
|
||||
? 0
|
||||
: b.isFavorite
|
||||
? 1
|
||||
: -1
|
||||
);
|
||||
}
|
||||
0
packages/page-rpc/.skip-build
Normal file
0
packages/page-rpc/.skip-build
Normal file
0
packages/page-rpc/.skip-npm
Normal file
0
packages/page-rpc/.skip-npm
Normal file
201
packages/page-rpc/LICENSE
Normal file
201
packages/page-rpc/LICENSE
Normal 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.
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@polkadot/app-toolbox",
|
||||
"name": "@polkadot/app-rpc",
|
||||
"private": true,
|
||||
"version": "0.55.0-beta.54",
|
||||
"main": "index.js",
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
40
packages/page-rpc/src/index.tsx
Normal file
40
packages/page-rpc/src/index.tsx
Normal file
@ -0,0 +1,40 @@
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { AppProps as Props } from '@polkadot/react-components/types';
|
||||
|
||||
import React, { useRef } from 'react';
|
||||
import { Route, Switch } from 'react-router';
|
||||
import Tabs from '@polkadot/react-components/Tabs';
|
||||
|
||||
import Rpc from './Rpc';
|
||||
import { useTranslation } from './translate';
|
||||
|
||||
function RpcApp ({ basePath }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const itemsRef = useRef([
|
||||
{
|
||||
isRoot: true,
|
||||
name: 'rpc',
|
||||
text: t<string>('RPC calls')
|
||||
}
|
||||
]);
|
||||
|
||||
return (
|
||||
<main className='toolbox--App'>
|
||||
<header>
|
||||
<Tabs
|
||||
basePath={basePath}
|
||||
items={itemsRef.current}
|
||||
/>
|
||||
</header>
|
||||
<Switch>
|
||||
<Route><Rpc /></Route>
|
||||
</Switch>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(RpcApp);
|
||||
9
packages/page-rpc/src/translate.ts
Normal file
9
packages/page-rpc/src/translate.ts
Normal file
@ -0,0 +1,9 @@
|
||||
// Copyright 2017-2020 @polkadot/app-rpc authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { useTranslation as useTranslationBase, UseTranslationResponse } from 'react-i18next';
|
||||
|
||||
export function useTranslation (): UseTranslationResponse {
|
||||
return useTranslationBase('app-rpc');
|
||||
}
|
||||
0
packages/page-signing/.skip-build
Normal file
0
packages/page-signing/.skip-build
Normal file
0
packages/page-signing/.skip-npm
Normal file
0
packages/page-signing/.skip-npm
Normal file
201
packages/page-signing/LICENSE
Normal file
201
packages/page-signing/LICENSE
Normal 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.
|
||||
1
packages/page-signing/README.md
Normal file
1
packages/page-signing/README.md
Normal file
@ -0,0 +1 @@
|
||||
# @polkadot/app-toolbox
|
||||
17
packages/page-signing/package.json
Normal file
17
packages/page-signing/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "@polkadot/app-signing",
|
||||
"private": true,
|
||||
"version": "0.55.0-beta.54",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/polkadot-js/apps.git",
|
||||
"author": "Jaco Greeff <jacogr@gmail.com>",
|
||||
"maintainers": [
|
||||
"Jaco Greeff <jacogr@gmail.com>"
|
||||
],
|
||||
"contributors": [],
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.11.2",
|
||||
"@polkadot/react-components": "0.55.0-beta.54"
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
@ -7,37 +7,28 @@ import { AppProps as Props } from '@polkadot/react-components/types';
|
||||
import React, { useRef } from 'react';
|
||||
import { Route, Switch } from 'react-router';
|
||||
import Tabs from '@polkadot/react-components/Tabs';
|
||||
import { useAccounts } from '@polkadot/react-hooks';
|
||||
|
||||
import Hash from './Hash';
|
||||
import Rpc from './Rpc';
|
||||
import Sign from './Sign';
|
||||
import Verify from './Verify';
|
||||
import { useTranslation } from './translate';
|
||||
|
||||
const HIDDEN_ACC = ['sign', 'verify'];
|
||||
|
||||
function ToolboxApp ({ basePath }: Props): React.ReactElement<Props> {
|
||||
function SigningApp ({ basePath }: Props): React.ReactElement<Props> {
|
||||
const { t } = useTranslation();
|
||||
const { hasAccounts } = useAccounts();
|
||||
|
||||
const itemsRef = useRef([
|
||||
{
|
||||
isRoot: true,
|
||||
name: 'rpc',
|
||||
text: t<string>('RPC calls')
|
||||
},
|
||||
{
|
||||
name: 'hash',
|
||||
text: t<string>('Hash data')
|
||||
},
|
||||
{
|
||||
name: 'sign',
|
||||
text: t<string>('Sign message')
|
||||
},
|
||||
{
|
||||
name: 'verify',
|
||||
text: t<string>('Verify signature')
|
||||
},
|
||||
{
|
||||
name: 'hash',
|
||||
text: t<string>('Hash data')
|
||||
}
|
||||
]);
|
||||
|
||||
@ -46,18 +37,16 @@ function ToolboxApp ({ basePath }: Props): React.ReactElement<Props> {
|
||||
<header>
|
||||
<Tabs
|
||||
basePath={basePath}
|
||||
hidden={hasAccounts ? undefined : HIDDEN_ACC}
|
||||
items={itemsRef.current}
|
||||
/>
|
||||
</header>
|
||||
<Switch>
|
||||
<Route path={`${basePath}/hash`}><Hash /></Route>
|
||||
<Route path={`${basePath}/sign`}><Sign /></Route>
|
||||
<Route path={`${basePath}/verify`}><Verify /></Route>
|
||||
<Route><Rpc /></Route>
|
||||
<Route><Sign /></Route>
|
||||
</Switch>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
||||
export default React.memo(ToolboxApp);
|
||||
export default React.memo(SigningApp);
|
||||
@ -1,9 +1,9 @@
|
||||
// Copyright 2017-2020 @polkadot/app-toolbox authors & contributors
|
||||
// Copyright 2017-2020 @polkadot/app-signing authors & contributors
|
||||
// This software may be modified and distributed under the terms
|
||||
// of the Apache-2.0 license. See the LICENSE file for details.
|
||||
|
||||
import { useTranslation as useTranslationBase, UseTranslationResponse } from 'react-i18next';
|
||||
|
||||
export function useTranslation (): UseTranslationResponse {
|
||||
return useTranslationBase('app-toolbox');
|
||||
return useTranslationBase('app-signing');
|
||||
}
|
||||
@ -55,13 +55,14 @@ i18next
|
||||
'app-js',
|
||||
'app-parachains',
|
||||
'app-poll',
|
||||
'app-rpc',
|
||||
'app-settings',
|
||||
'app-signing',
|
||||
'app-society',
|
||||
'app-staking',
|
||||
'app-storage',
|
||||
'app-sudo',
|
||||
'app-tech-comm',
|
||||
'app-toolbox',
|
||||
'app-treasury',
|
||||
'react-api',
|
||||
'react-components',
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
"@polkadot/apps-routing/*": [ "packages/apps-routing/src/*" ],
|
||||
"@polkadot/app-accounts": [ "packages/page-accounts/src" ],
|
||||
"@polkadot/app-accounts/*": [ "packages/page-accounts/src/*" ],
|
||||
"@polkadot/app-addresses": [ "packages/page-addresses/src" ],
|
||||
"@polkadot/app-addresses/*": [ "packages/page-addresses/src/*" ],
|
||||
"@polkadot/app-claims": [ "packages/page-claims/src" ],
|
||||
"@polkadot/app-claims/*": [ "packages/page-claims/src/*" ],
|
||||
"@polkadot/app-contracts": [ "packages/page-contracts/src" ],
|
||||
@ -39,8 +41,12 @@
|
||||
"@polkadot/app-parachains/*": [ "packages/page-parachains/src/*" ],
|
||||
"@polkadot/app-poll": [ "packages/page-poll/src" ],
|
||||
"@polkadot/app-poll/*": [ "packages/page-poll/src/*" ],
|
||||
"@polkadot/app-rpc": [ "packages/page-rpc/src" ],
|
||||
"@polkadot/app-rpc/*": [ "packages/page-rpc/src/*" ],
|
||||
"@polkadot/app-settings": [ "packages/page-settings/src" ],
|
||||
"@polkadot/app-settings/*": [ "packages/page-settings/src/*" ],
|
||||
"@polkadot/app-signing": [ "packages/page-signing/src" ],
|
||||
"@polkadot/app-signing/*": [ "packages/page-signing/src/*" ],
|
||||
"@polkadot/app-society": [ "packages/page-society/src" ],
|
||||
"@polkadot/app-society/*": [ "packages/page-society/src/*" ],
|
||||
"@polkadot/app-staking": [ "packages/page-staking/src" ],
|
||||
@ -51,8 +57,6 @@
|
||||
"@polkadot/app-sudo/*": [ "packages/page-sudo/src/*" ],
|
||||
"@polkadot/app-tech-comm": [ "packages/page-tech-comm/src" ],
|
||||
"@polkadot/app-tech-comm/*": [ "packages/page-tech-comm/src/*" ],
|
||||
"@polkadot/app-toolbox": [ "packages/page-toolbox/src" ],
|
||||
"@polkadot/app-toolbox/*": [ "packages/page-toolbox/src/*" ],
|
||||
"@polkadot/app-treasury": [ "packages/page-treasury/src" ],
|
||||
"@polkadot/app-treasury/*": [ "packages/page-treasury/src/*" ],
|
||||
"@polkadot/react-api": [ "packages/react-api/src" ],
|
||||
|
||||
41
yarn.lock
41
yarn.lock
@ -3116,6 +3116,20 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-addresses@workspace:packages/page-addresses":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-addresses@workspace:packages/page-addresses"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.11.2
|
||||
"@polkadot/react-components": 0.55.0-beta.54
|
||||
"@polkadot/vanitygen": ^0.20.0-beta.1
|
||||
"@testing-library/react": ^10.4.8
|
||||
detect-browser: ^5.1.1
|
||||
file-saver: ^2.0.2
|
||||
testcontainers: ^2.17.0
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-claims@workspace:packages/page-claims":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-claims@workspace:packages/page-claims"
|
||||
@ -3222,6 +3236,15 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-rpc@workspace:packages/page-rpc":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-rpc@workspace:packages/page-rpc"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.11.2
|
||||
"@polkadot/react-components": 0.55.0-beta.54
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-settings@workspace:packages/page-settings":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-settings@workspace:packages/page-settings"
|
||||
@ -3234,6 +3257,15 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-signing@workspace:packages/page-signing":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-signing@workspace:packages/page-signing"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.11.2
|
||||
"@polkadot/react-components": 0.55.0-beta.54
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-society@workspace:packages/page-society":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-society@workspace:packages/page-society"
|
||||
@ -3283,15 +3315,6 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-toolbox@workspace:packages/page-toolbox":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-toolbox@workspace:packages/page-toolbox"
|
||||
dependencies:
|
||||
"@babel/runtime": ^7.11.2
|
||||
"@polkadot/react-components": 0.55.0-beta.54
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"@polkadot/app-treasury@workspace:packages/page-treasury":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "@polkadot/app-treasury@workspace:packages/page-treasury"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user