Browse Source

Directory cleanup

Leszek Wiesner 4 years ago
parent
commit
18dba8532d
100 changed files with 1 additions and 8497 deletions
  1. 1 11
      package.json
  2. 0 4
      pioneer/.eslintignore
  3. 0 0
      pioneer/packages/joy-settings/.skip-build
  4. 0 201
      pioneer/packages/joy-settings/LICENSE
  5. 0 36
      pioneer/packages/joy-settings/README.md
  6. 0 16
      pioneer/packages/joy-settings/package.json
  7. 0 180
      pioneer/packages/joy-settings/src/Settings.ts
  8. 0 18
      pioneer/packages/joy-settings/src/defaults/crypto.ts
  9. 0 75
      pioneer/packages/joy-settings/src/defaults/endpoints.ts
  10. 0 74
      pioneer/packages/joy-settings/src/defaults/index.ts
  11. 0 25
      pioneer/packages/joy-settings/src/defaults/ledger.ts
  12. 0 32
      pioneer/packages/joy-settings/src/defaults/ss58.ts
  13. 0 6
      pioneer/packages/joy-settings/src/defaults/type.ts
  14. 0 81
      pioneer/packages/joy-settings/src/defaults/ui.ts
  15. 0 12
      pioneer/packages/joy-settings/src/index.ts
  16. 0 22
      pioneer/packages/joy-settings/src/types.ts
  17. 0 0
      pioneer/packages/joy-utils-old/.skip-build
  18. 0 41
      pioneer/packages/joy-utils-old/src/AccountSelector.tsx
  19. 0 5
      pioneer/packages/joy-utils-old/src/IdLike.ts
  20. 0 53
      pioneer/packages/joy-utils-old/src/LinkedMapEntry.ts
  21. 0 284
      pioneer/packages/joy-utils-old/src/MyAccount.tsx
  22. 0 55
      pioneer/packages/joy-utils-old/src/TextArea.tsx
  23. 0 202
      pioneer/packages/joy-utils-old/src/index.ts
  24. 0 7
      pioneer/packages/joy-utils-old/src/memo/Memo.css
  25. 0 78
      pioneer/packages/joy-utils-old/src/memo/MemoEdit.tsx
  26. 0 73
      pioneer/packages/joy-utils-old/src/memo/MemoView.tsx
  27. 0 3
      pioneer/packages/joy-utils-old/src/react/hooks/index.tsx
  28. 0 0
      pioneer/packages/old-apps/.skip-build
  29. 0 201
      pioneer/packages/old-apps/app-accounts/LICENSE
  30. 0 5
      pioneer/packages/old-apps/app-accounts/README.md
  31. 0 23
      pioneer/packages/old-apps/app-accounts/package.json
  32. 0 26
      pioneer/packages/old-apps/app-accounts/scripts/vanitygen.js
  33. 0 227
      pioneer/packages/old-apps/app-accounts/src/Account.tsx
  34. 0 105
      pioneer/packages/old-apps/app-accounts/src/Banner.tsx
  35. 0 50
      pioneer/packages/old-apps/app-accounts/src/MemoForm.tsx
  36. 0 110
      pioneer/packages/old-apps/app-accounts/src/Overview.tsx
  37. 0 104
      pioneer/packages/old-apps/app-accounts/src/Vanity/Match.tsx
  38. 0 337
      pioneer/packages/old-apps/app-accounts/src/Vanity/index.tsx
  39. 0 7
      pioneer/packages/old-apps/app-accounts/src/Vanity/translate.ts
  40. 0 26
      pioneer/packages/old-apps/app-accounts/src/bipWorker.ts
  41. 0 85
      pioneer/packages/old-apps/app-accounts/src/index.tsx
  42. 0 44
      pioneer/packages/old-apps/app-accounts/src/md/basic.md
  43. 0 144
      pioneer/packages/old-apps/app-accounts/src/modals/Backup.tsx
  44. 0 183
      pioneer/packages/old-apps/app-accounts/src/modals/ChangePass.tsx
  45. 0 193
      pioneer/packages/old-apps/app-accounts/src/modals/Create.tsx
  46. 0 60
      pioneer/packages/old-apps/app-accounts/src/modals/CreateConfirmation.tsx
  47. 0 240
      pioneer/packages/old-apps/app-accounts/src/modals/Derive.tsx
  48. 0 180
      pioneer/packages/old-apps/app-accounts/src/modals/Import.tsx
  49. 0 119
      pioneer/packages/old-apps/app-accounts/src/modals/Qr.tsx
  50. 0 178
      pioneer/packages/old-apps/app-accounts/src/modals/Transfer.tsx
  51. 0 7
      pioneer/packages/old-apps/app-accounts/src/translate.ts
  52. 0 29
      pioneer/packages/old-apps/app-accounts/src/types.ts
  53. 0 66
      pioneer/packages/old-apps/app-accounts/src/vanitygen/calculate.ts
  54. 0 133
      pioneer/packages/old-apps/app-accounts/src/vanitygen/cli.ts
  55. 0 31
      pioneer/packages/old-apps/app-accounts/src/vanitygen/generate.ts
  56. 0 23
      pioneer/packages/old-apps/app-accounts/src/vanitygen/index.ts
  57. 0 7
      pioneer/packages/old-apps/app-accounts/src/vanitygen/regex.ts
  58. 0 31
      pioneer/packages/old-apps/app-accounts/src/vanitygen/sort.ts
  59. 0 33
      pioneer/packages/old-apps/app-accounts/src/vanitygen/types.d.ts
  60. 0 201
      pioneer/packages/old-apps/app-address-book/LICENSE
  61. 0 1
      pioneer/packages/old-apps/app-address-book/README.md
  62. 0 16
      pioneer/packages/old-apps/app-address-book/package.json
  63. 0 153
      pioneer/packages/old-apps/app-address-book/src/Address.tsx
  64. 0 61
      pioneer/packages/old-apps/app-address-book/src/MemoByAccount.tsx
  65. 0 70
      pioneer/packages/old-apps/app-address-book/src/Overview.tsx
  66. 0 73
      pioneer/packages/old-apps/app-address-book/src/index.tsx
  67. 0 6
      pioneer/packages/old-apps/app-address-book/src/md/basic.md
  68. 0 135
      pioneer/packages/old-apps/app-address-book/src/modals/Create.tsx
  69. 0 7
      pioneer/packages/old-apps/app-address-book/src/translate.ts
  70. 0 15
      pioneer/packages/old-apps/app-address-book/src/types.ts
  71. 0 201
      pioneer/packages/old-apps/app-contracts/LICENSE
  72. 0 3
      pioneer/packages/old-apps/app-contracts/README.md
  73. 0 17
      pioneer/packages/old-apps/app-contracts/package.json
  74. 0 196
      pioneer/packages/old-apps/app-contracts/src/ABI.tsx
  75. 0 113
      pioneer/packages/old-apps/app-contracts/src/Codes/Add.tsx
  76. 0 208
      pioneer/packages/old-apps/app-contracts/src/Codes/Code.tsx
  77. 0 130
      pioneer/packages/old-apps/app-contracts/src/Codes/Upload.tsx
  78. 0 76
      pioneer/packages/old-apps/app-contracts/src/Codes/ValidateCode.tsx
  79. 0 98
      pioneer/packages/old-apps/app-contracts/src/Codes/index.tsx
  80. 0 135
      pioneer/packages/old-apps/app-contracts/src/Contracts/Add.tsx
  81. 0 273
      pioneer/packages/old-apps/app-contracts/src/Contracts/Call.tsx
  82. 0 117
      pioneer/packages/old-apps/app-contracts/src/Contracts/Contract.tsx
  83. 0 104
      pioneer/packages/old-apps/app-contracts/src/Contracts/Outcome.tsx
  84. 0 67
      pioneer/packages/old-apps/app-contracts/src/Contracts/ValidateAddr.tsx
  85. 0 133
      pioneer/packages/old-apps/app-contracts/src/Contracts/index.tsx
  86. 0 49
      pioneer/packages/old-apps/app-contracts/src/Contracts/util.tsx
  87. 0 330
      pioneer/packages/old-apps/app-contracts/src/Deploy.tsx
  88. 0 221
      pioneer/packages/old-apps/app-contracts/src/Modal.tsx
  89. 0 49
      pioneer/packages/old-apps/app-contracts/src/Params.tsx
  90. 0 64
      pioneer/packages/old-apps/app-contracts/src/RemoveABI.tsx
  91. 0 10
      pioneer/packages/old-apps/app-contracts/src/constants.ts
  92. 0 152
      pioneer/packages/old-apps/app-contracts/src/index.tsx
  93. 0 17
      pioneer/packages/old-apps/app-contracts/src/md/intro.md
  94. 0 101
      pioneer/packages/old-apps/app-contracts/src/store.ts
  95. 0 7
      pioneer/packages/old-apps/app-contracts/src/translate.ts
  96. 0 37
      pioneer/packages/old-apps/app-contracts/src/types.ts
  97. 0 201
      pioneer/packages/old-apps/app-explorer/LICENSE
  98. 0 1
      pioneer/packages/old-apps/app-explorer/README.md
  99. 0 16
      pioneer/packages/old-apps/app-explorer/package.json
  100. 0 32
      pioneer/packages/old-apps/app-explorer/src/BestHash.tsx

+ 1 - 11
package.json

@@ -20,17 +20,7 @@
     "devops/eslint-config",
     "devops/prettier-config",
     "pioneer",
-    "pioneer/packages/apps*",
-    "pioneer/packages/page*",
-    "pioneer/packages/react*",
-    "pioneer/packages/joy-utils",
-    "pioneer/packages/joy-members",
-    "pioneer/packages/joy-pages",
-    "pioneer/packages/joy-election",
-    "pioneer/packages/joy-proposals",
-    "pioneer/packages/joy-roles",
-    "pioneer/packages/joy-media",
-    "pioneer/packages/joy-forum",
+    "pioneer/packages/*",
     "utils/api-examples"
   ],
   "resolutions": {

+ 0 - 4
pioneer/.eslintignore

@@ -1,9 +1,5 @@
 **/build/*
 **/coverage/*
 **/node_modules/*
-packages/old-apps/*
-packages/joy-help/*
-packages/joy-settings/*
-packages/joy-utils-old/*
 .eslintrc.js
 i18next-scanner.config.js

+ 0 - 0
pioneer/packages/joy-settings/.skip-build


+ 0 - 201
pioneer/packages/joy-settings/LICENSE

@@ -1,201 +0,0 @@
-                              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.

+ 0 - 36
pioneer/packages/joy-settings/README.md

@@ -1,36 +0,0 @@
-# @polkadot/ui-settings
-
-Manages app settings including endpoints, themes and prefixes
-
-### Usage Example
-User preferences are set as a settings object in the browser's local storage.
-```
-import settings from '@polkadot/ui-settings';
-
-render () {
-  // get api endpoint for the selected chain
-  const WS_URL = settings.apiUrl();
-
-  // get the selected il8n language
-  const language = settings.il8nLang();
-
-  // get all available il8n languages
-  const languages = settings.availableLanguages();
-
-  // update settings
-  const updatedSettings = {
-    ...settings,
-    i18nLang: 'Arabic'
-  }
-  settings.set(updatedSettings);
-
-  // NOTE: API currently does not handle hot reconnecting properly,
-  so you need to manually reload the page after updating settings.
-  window.location.reload();
-}
-```
-
-### Used by
-Apps that currently use the settings package
-* [polkadot-js/apps]('https://www.github.com/polkadot-js/apps')
-* [paritytech/substrate-light-ui](https://github.com/paritytech/substrate-light-ui)

+ 0 - 16
pioneer/packages/joy-settings/package.json

@@ -1,16 +0,0 @@
-{
-  "name": "@polkadot/joy-settings",
-  "version": "1.0.0",
-  "description": "Manages app settings",
-  "main": "index.js",
-  "author": "Jaco Greeff <jacogr@gmail.com>",
-  "maintainers": [
-    "Jaco Greeff <jacogr@gmail.com>"
-  ],
-  "license": "Apache-2.0",
-  "dependencies": {
-    "@babel/runtime": "^7.7.1",
-    "@types/store": "^2.0.1",
-    "store": "^2.0.12"
-  }
-}

+ 0 - 180
pioneer/packages/joy-settings/src/Settings.ts

@@ -1,180 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 EventEmitter from 'eventemitter3';
-import store from 'store';
-import { isUndefined } from '@polkadot/util';
-
-import { CRYPTOS, ENDPOINT_DEFAULT, ENDPOINTS, ICON_DEFAULT, ICONS, LANGUAGE_DEFAULT, LANGUAGES, LEDGER_CONN, LEDGER_CONN_DEFAULT, LOCKING_DEFAULT, LOCKING, PREFIX_DEFAULT, PREFIXES, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES, CAMERA, CAMERA_DEFAULT } from './defaults';
-import { Option, SettingsStruct } from './types';
-
-type ChangeCallback = (settings: SettingsStruct) => void;
-type OnTypes = 'change';
-
-export class Settings implements SettingsStruct {
-  private _apiUrl: string;
-
-  private _emitter: EventEmitter;
-
-  private _i18nLang: string;
-
-  private _icon: string;
-
-  private _ledgerConn: string;
-
-  private _locking: string;
-
-  private _prefix: number;
-
-  private _uiMode: string;
-
-  private _uiTheme: string;
-
-  private _camera: string;
-
-  public constructor () {
-    const settings = store.get('settings') || {};
-
-    this._emitter = new EventEmitter();
-
-    // Transition from acropolis - since visitors are coming to the same domain they most likely
-    // have the endpoint url saved in local storage. Replace it with new rome default endpoint.
-    if (settings.apiUrl === 'wss://testnet.joystream.org/acropolis/rpc/') {
-      this._apiUrl = process.env.WS_URL || ENDPOINT_DEFAULT || 'wss://rome-rpc-endpoint.joystream.org:9944/';
-    } else {
-      this._apiUrl = settings.apiUrl || process.env.WS_URL || ENDPOINT_DEFAULT;
-    }
-
-    this._ledgerConn = settings.ledgerConn || LEDGER_CONN_DEFAULT;
-    this._i18nLang = settings.i18nLang || LANGUAGE_DEFAULT;
-    this._icon = settings.icon || ICON_DEFAULT;
-    this._locking = settings.locking || LOCKING_DEFAULT;
-    this._prefix = isUndefined(settings.prefix) ? PREFIX_DEFAULT : settings.prefix;
-    this._uiMode = settings.uiMode || UIMODE_DEFAULT;
-    this._uiTheme = settings.uiTheme || UITHEME_DEFAULT;
-    this._camera = settings.camera || CAMERA_DEFAULT;
-  }
-
-  public get apiUrl (): string {
-    return this._apiUrl;
-  }
-
-  public get i18nLang (): string {
-    return this._i18nLang;
-  }
-
-  public get icon (): string {
-    return this._icon;
-  }
-
-  public get ledgerConn (): string {
-    return this._ledgerConn;
-  }
-
-  public get locking (): string {
-    return this._locking;
-  }
-
-  public get prefix (): number {
-    return this._prefix;
-  }
-
-  public get uiMode (): string {
-    return this._uiMode;
-  }
-
-  get isBasicMode (): boolean {
-    return this._uiMode === 'light';
-  }
-
-  get isFullMode (): boolean {
-    return this._uiMode === 'full';
-  }
-
-  public get uiTheme (): string {
-    return this._uiTheme;
-  }
-
-  public get availableCryptos (): Option[] {
-    return CRYPTOS;
-  }
-
-  public get availableIcons (): Option[] {
-    return ICONS;
-  }
-
-  public get availableLanguages (): Option[] {
-    return LANGUAGES;
-  }
-
-  public get availableLedgerConn (): Option[] {
-    return LEDGER_CONN;
-  }
-
-  public get availableLocking (): Option[] {
-    return LOCKING;
-  }
-
-  public get availableNodes (): Option[] {
-    return ENDPOINTS;
-  }
-
-  public get availablePrefixes (): Option[] {
-    return PREFIXES;
-  }
-
-  public get availableUIModes (): Option[] {
-    return UIMODES;
-  }
-
-  public get availableUIThemes (): Option[] {
-    return UITHEMES;
-  }
-
-  public get camera (): string {
-    return this._camera;
-  }
-
-  public get availableCamera (): Option[] {
-    return CAMERA;
-  }
-
-  public get (): SettingsStruct {
-    return {
-      apiUrl: this._apiUrl,
-      i18nLang: this._i18nLang,
-      icon: this._icon,
-      ledgerConn: this._ledgerConn,
-      locking: this._locking,
-      prefix: this._prefix,
-      uiMode: this._uiMode,
-      uiTheme: this._uiTheme,
-      camera: this._camera
-    };
-  }
-
-  public set (settings: Partial<SettingsStruct>): void {
-    this._apiUrl = settings.apiUrl || this._apiUrl;
-    this._ledgerConn = settings.ledgerConn || this._ledgerConn;
-    this._i18nLang = settings.i18nLang || this._i18nLang;
-    this._icon = settings.icon || this._icon;
-    this._locking = settings.locking || this._locking;
-    this._prefix = isUndefined(settings.prefix) ? this._prefix : settings.prefix;
-    this._uiMode = settings.uiMode || this._uiMode;
-    this._uiTheme = settings.uiTheme || this._uiTheme;
-
-    const newValues = this.get();
-
-    store.set('settings', newValues);
-    this._emitter.emit('change', newValues);
-  }
-
-  public on (type: OnTypes, cb: ChangeCallback): void {
-    this._emitter.on(type, cb);
-  }
-}
-
-const settings = new Settings();
-
-export default settings;

+ 0 - 18
pioneer/packages/joy-settings/src/defaults/crypto.ts

@@ -1,18 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-export const CRYPTOS: Option[] = [
-  {
-    info: 'ed25519',
-    text: 'Edwards (ed25519)',
-    value: 'ed25519'
-  },
-  {
-    info: 'sr25519',
-    text: 'Schnorrkel (sr25519)',
-    value: 'sr25519'
-  }
-];

+ 0 - 75
pioneer/packages/joy-settings/src/defaults/endpoints.ts

@@ -1,75 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-// type ChainName = 'alexander' | 'edgeware' | 'edgewareTest' | 'flamingFir' | 'kusama';
-type ChainName = 'testnet';
-
-interface ChainData {
-  chainDisplay: string;
-  logo: 'joystream';
-  type: string;
-}
-
-// type ProviderName = 'commonwealth' | 'parity' | 'unfrastructure' | 'w3f';
-type ProviderName = 'joystream_org';
-
-interface PoviderData {
-  providerDisplay: string;
-  nodes: Partial<Record<ChainName, string>>;
-}
-
-// we use this to give an ordering to the chains available
-const ORDER_CHAINS: ChainName[] = ['testnet'];
-
-// we use this to order the providers inside the chains
-const ORDER_PROVIDERS: ProviderName[] = ['joystream_org'];
-
-// some suplementary info on a per-chain basis
-const CHAIN_INFO: Record<ChainName, ChainData> = {
-  testnet: {
-    chainDisplay: 'Joystream',
-    logo: 'joystream',
-    type: 'Current Testnet'
-  }
-};
-
-// the actual providers with all  the nodes they provide
-const PROVIDERS: Record<ProviderName, PoviderData> = {
-  joystream_org: {
-    providerDisplay: 'Joystream.org',
-    nodes: {
-      testnet: 'wss://rome-rpc-endpoint.joystream.org:9944/'
-    }
-  }
-};
-
-export const ENDPOINT_DEFAULT = PROVIDERS.joystream_org.nodes.testnet;
-
-export const ENDPOINTS: Option[] = ORDER_CHAINS.reduce((endpoints: Option[], chainName): Option[] => {
-  const { chainDisplay, logo, type } = CHAIN_INFO[chainName];
-
-  return ORDER_PROVIDERS.reduce((endpoints: Option[], providerName): Option[] => {
-    const { providerDisplay, nodes } = PROVIDERS[providerName];
-    const wssUrl = nodes[chainName];
-
-    if (wssUrl) {
-      endpoints.push({
-        info: logo,
-        text: `${chainDisplay} (${type}, hosted by ${providerDisplay})`,
-        value: wssUrl
-      });
-    }
-
-    return endpoints;
-  }, endpoints);
-}, []);
-
-// add a local node right at the end
-ENDPOINTS.push({
-  info: 'local',
-  text: 'Local Node (Own, 127.0.0.1:9944)',
-  value: 'ws://127.0.0.1:9944/'
-});

+ 0 - 74
pioneer/packages/joy-settings/src/defaults/index.ts

@@ -1,74 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-import { CRYPTOS } from './crypto';
-import { ENDPOINTS, ENDPOINT_DEFAULT } from './endpoints';
-import { LEDGER_CONN, LEDGER_CONN_DEFAULT } from './ledger';
-import { PREFIXES, PREFIX_DEFAULT } from './ss58';
-import { ICON_DEFAULT, ICON_DEFAULT_HOST, ICONS, UIMODE_DEFAULT, UIMODES, UITHEME_DEFAULT, UITHEMES } from './ui';
-
-const LANGUAGE_DEFAULT = 'default';
-
-const LANGUAGES: Option[] = [
-  {
-    info: 'detect',
-    text: 'Default browser language (auto-detect)',
-    value: LANGUAGE_DEFAULT
-  }
-];
-
-const LOCKING_DEFAULT = 'session';
-
-const LOCKING: Option[] = [
-  {
-    info: 'session',
-    text: 'Once per session',
-    value: 'session'
-  },
-  {
-    info: 'tx',
-    text: 'On each transaction',
-    value: 'tx'
-  }
-];
-
-const CAMERA_DEFAULT = 'on';
-
-const CAMERA: Option[] = [
-  {
-    info: 'on',
-    text: 'Allow camera access',
-    value: 'on'
-  },
-  {
-    info: 'off',
-    text: 'Do not allow camera access',
-    value: 'off'
-  }
-];
-
-export {
-  CRYPTOS,
-  ENDPOINT_DEFAULT,
-  ENDPOINTS,
-  ICON_DEFAULT,
-  ICON_DEFAULT_HOST,
-  ICONS,
-  LANGUAGE_DEFAULT,
-  LANGUAGES,
-  LEDGER_CONN_DEFAULT,
-  LEDGER_CONN,
-  LOCKING_DEFAULT,
-  LOCKING,
-  PREFIX_DEFAULT,
-  PREFIXES,
-  UIMODE_DEFAULT,
-  UIMODES,
-  UITHEME_DEFAULT,
-  UITHEMES,
-  CAMERA,
-  CAMERA_DEFAULT
-};

+ 0 - 25
pioneer/packages/joy-settings/src/defaults/ledger.ts

@@ -1,25 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-export const LEDGER_CONN_DEFAULT = 'none';
-
-export const LEDGER_CONN: Option[] = [
-  {
-    info: 'none',
-    text: 'Do not attach Ledger devices',
-    value: 'none'
-  },
-  {
-    info: 'u2f',
-    text: 'Attach Ledger via U2F',
-    value: 'u2f'
-  },
-  {
-    info: 'webusb',
-    text: 'Attach Ledger via WebUSB',
-    value: 'webusb'
-  }
-];

+ 0 - 32
pioneer/packages/joy-settings/src/defaults/ss58.ts

@@ -1,32 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-export const PREFIX_DEFAULT = -1;
-
-export const PREFIXES: Option[] = [
-  {
-    info: 'default',
-    text: 'Default for the connected node',
-    value: -1
-  },
-  {
-    info: 'substrate',
-    text: 'Substrate (development)',
-    value: 42
-  }
-  /*
-  {
-    info: 'kusama',
-    text: 'Kusama (canary)',
-    value: 2
-  },
-  {
-    info: 'polkadot',
-    text: 'Polkadot (live)',
-    value: 0
-  }
-  */
-];

+ 0 - 6
pioneer/packages/joy-settings/src/defaults/type.ts

@@ -1,6 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-// matches https://polkadot.js.org & https://*.polkadot.io
-export const isPolkadot = typeof window !== 'undefined' && window.location.host.includes('polkadot');

+ 0 - 81
pioneer/packages/joy-settings/src/defaults/ui.ts

@@ -1,81 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 { Option } from '../types';
-
-import { isPolkadot } from './type';
-
-const LANGUAGE_DEFAULT = 'default';
-
-const UIMODE_DEFAULT = 'light';
-
-const UIMODES: Option[] = [
-  {
-    info: 'full',
-    text: 'Fully featured',
-    value: 'full'
-  },
-  {
-    info: 'light',
-    text: 'Basic features only',
-    value: 'light'
-  }
-];
-
-const UITHEME_DEFAULT = isPolkadot
-  ? 'polkadot'
-  : 'substrate';
-
-const UITHEMES: Option[] = [
-  {
-    info: 'polkadot',
-    text: 'Polkadot',
-    value: 'polkadot'
-  },
-  {
-    info: 'substrate',
-    text: 'Substrate',
-    value: 'substrate'
-  }
-];
-
-const ICON_DEFAULT = 'default';
-
-const ICON_DEFAULT_HOST = isPolkadot
-  ? 'polkadot'
-  : 'substrate';
-
-const ICONS: Option[] = [
-  {
-    info: 'default',
-    text: 'Default for the connected node',
-    value: 'default'
-  },
-  {
-    info: 'polkadot',
-    text: 'Polkadot',
-    value: 'polkadot'
-  },
-  {
-    info: 'substrate',
-    text: 'Substrate',
-    value: 'substrate'
-  },
-  {
-    info: 'beachball',
-    text: 'Beachball',
-    value: 'beachball'
-  }
-];
-
-export {
-  ICON_DEFAULT,
-  ICON_DEFAULT_HOST,
-  ICONS,
-  LANGUAGE_DEFAULT,
-  UIMODE_DEFAULT,
-  UIMODES,
-  UITHEME_DEFAULT,
-  UITHEMES
-};

+ 0 - 12
pioneer/packages/joy-settings/src/index.ts

@@ -1,12 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings 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 settings, { Settings } from './Settings';
-export { ENDPOINT_DEFAULT, ICON_DEFAULT, ICON_DEFAULT_HOST, LANGUAGE_DEFAULT, LOCKING_DEFAULT, PREFIX_DEFAULT, UIMODE_DEFAULT, UITHEME_DEFAULT, CAMERA, CAMERA_DEFAULT } from './defaults';
-
-export default settings;
-
-export {
-  Settings
-};

+ 0 - 22
pioneer/packages/joy-settings/src/types.ts

@@ -1,22 +0,0 @@
-// Copyright 2017-2019 @polkadot/ui-settings authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-export type Option = {
-  disabled?: boolean;
-  info: string;
-  text: string;
-  value: string | number;
-}
-
-export interface SettingsStruct {
-  apiUrl: string;
-  i18nLang: string;
-  icon: string;
-  ledgerConn: string;
-  locking: string;
-  prefix: number;
-  uiMode: string;
-  uiTheme: string;
-  camera: string;
-}

+ 0 - 0
pioneer/packages/joy-utils-old/.skip-build


+ 0 - 41
pioneer/packages/joy-utils-old/src/AccountSelector.tsx

@@ -1,41 +0,0 @@
-import React from 'react';
-import { Bubble, InputAddress, Labelled, Balance, Nonce } from '@polkadot/react-components/index';
-
-type Props = {
-  label?: string;
-  onChange: (accountId?: string | null) => void;
-};
-
-type State = {
-  accountId?: string | null;
-};
-
-export default class AccountSelector extends React.PureComponent<Props, State> {
-  state: State = {};
-
-  render () {
-    const { label } = this.props;
-    const { accountId } = this.state;
-
-    return <section>
-      <InputAddress
-        label={ label || 'My account' }
-        onChange={this.onChange}
-        type='account'
-      />
-      <Labelled>
-        <Bubble label='Balance'>
-          <Balance params={accountId} />
-        </Bubble>
-        <Bubble label='Transactions'>
-          <Nonce params={accountId} />
-        </Bubble>
-      </Labelled>
-    </section>;
-  }
-
-  private onChange = (accountId: string | null): void => {
-    const { onChange } = this.props;
-    this.setState({ accountId }, () => onChange(accountId));
-  }
-}

+ 0 - 5
pioneer/packages/joy-utils-old/src/IdLike.ts

@@ -1,5 +0,0 @@
-export type IdLike = { toString: () => string } | number
-
-export type HasId = { id: IdLike }
-
-export type MayHaveId = { id?: IdLike }

+ 0 - 53
pioneer/packages/joy-utils-old/src/LinkedMapEntry.ts

@@ -1,53 +0,0 @@
-import { Tuple, Vec } from '@polkadot/types';
-import { Codec, Constructor } from '@polkadot/types/types';
-import Linkage from '@polkadot/types/codec/Linkage';
-
-export class SingleLinkedMapEntry<T extends Codec> extends Tuple {
-  constructor (Type: Constructor<T>, value?: any) {
-    super({
-      value: Type,
-      linkage: Linkage.withKey(Type)
-    }, value);
-  }
-
-  static withType<O extends Codec> (Type: Constructor<O>): Constructor<SingleLinkedMapEntry<O>> {
-    return class extends SingleLinkedMapEntry<O> {
-      constructor (value?: Constructor<O>) {
-        super(Type, value);
-      }
-    };
-  }
-
-  get value (): T {
-    return this[0] as unknown as T;
-  }
-
-  get linkage (): Linkage<T> {
-    return this[1] as unknown as Linkage<T>;
-  }
-}
-
-export class MultipleLinkedMapEntry<K extends Codec, V extends Codec> extends Tuple {
-  constructor (KeyType: Constructor<K>, ValueType: Constructor<V>, value?: any) {
-    super({
-      keys: Vec.with(KeyType),
-      values: Vec.with(ValueType)
-    }, value);
-  }
-
-  static withType<O extends Codec> (Type: Constructor<O>): Constructor<SingleLinkedMapEntry<O>> {
-    return class extends SingleLinkedMapEntry<O> {
-      constructor (value?: any) {
-        super(Type, value);
-      }
-    };
-  }
-
-  get linked_keys (): Vec<K> {
-    return this[0] as unknown as Vec<K>;
-  }
-
-  get linked_values (): Vec<V> {
-    return this[1] as unknown as Vec<V>;
-  }
-}

+ 0 - 284
pioneer/packages/joy-utils-old/src/MyAccount.tsx

@@ -1,284 +0,0 @@
-import React from 'react';
-import { Message } from 'semantic-ui-react';
-import { Link } from 'react-router-dom';
-
-import { AccountId } from '@polkadot/types/interfaces';
-import { Vec, GenericAccountId, Option } from '@polkadot/types';
-import accountObservable from '@polkadot/ui-keyring/observable/accounts';
-import { withCalls, withMulti, withObservable } from '@polkadot/react-api/index';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-
-import { MemberId, Membership } from '@joystream/types/members';
-import { CuratorId, LeadId, Lead, CurationActor, Curator } from '@joystream/types/content-working-group';
-
-import { queryMembershipToProp } from '@polkadot/joy-members/utils';
-import { useMyAccount } from '@polkadot/joy-utils/MyAccountContext';
-import { queryToProp, MultipleLinkedMapEntry, SingleLinkedMapEntry } from '@polkadot/joy-utils/index';
-import { useMyMembership } from './MyMembershipContext';
-
-import { componentName } from '@polkadot/joy-utils/react/helpers';
-
-export type MyAddressProps = {
-  myAddress?: string;
-};
-
-export type MyAccountProps = MyAddressProps & {
-  myAccountId?: AccountId;
-  myMemberId?: MemberId;
-  memberIdsByRootAccountId?: Vec<MemberId>;
-  memberIdsByControllerAccountId?: Vec<MemberId>;
-  myMemberIdChecked?: boolean;
-  iAmMember?: boolean;
-  myMembership?: Membership | null;
-
-  // Content Working Group
-  curatorEntries?: any; // entire linked_map: CuratorId => Curator
-  isLeadSet?: Option<LeadId>;
-  contentLeadId?: LeadId;
-  contentLeadEntry?: any; // linked_map value
-
-  curationActor?: any;
-  allAccounts?: SubjectInfo;
-};
-
-function withMyAddress<P extends MyAccountProps> (Component: React.ComponentType<P>) {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const {
-      state: { address }
-    } = useMyAccount();
-    const myAccountId = address ? new GenericAccountId(address) : undefined;
-    return <Component myAddress={address} myAccountId={myAccountId} {...props} />;
-  };
-  ResultComponent.displayName = `withMyAddress(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-const withMyMemberIds = withCalls<MyAccountProps>(
-  queryMembershipToProp('memberIdsByRootAccountId', 'myAddress'),
-  queryMembershipToProp('memberIdsByControllerAccountId', 'myAddress')
-);
-
-function withMyMembership<P extends MyAccountProps> (Component: React.ComponentType<P>) {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const { memberIdsByRootAccountId, memberIdsByControllerAccountId } = props;
-
-    const myMemberIdChecked = memberIdsByRootAccountId && memberIdsByControllerAccountId;
-
-    let myMemberId: MemberId | undefined;
-    if (memberIdsByRootAccountId && memberIdsByControllerAccountId) {
-      memberIdsByRootAccountId.concat(memberIdsByControllerAccountId);
-      if (memberIdsByRootAccountId.length) {
-        myMemberId = memberIdsByRootAccountId[0];
-      }
-    }
-
-    const iAmMember = myMemberId !== undefined;
-
-    const newProps = {
-      myMemberIdChecked,
-      myMemberId,
-      iAmMember
-    };
-
-    return <Component {...props} {...newProps} />;
-  };
-  ResultComponent.displayName = `withMyMembership(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-function resolveMyProfile<P extends { myMembership?: Membership | null }> (Component: React.ComponentType<P>) {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    let { myMembership } = props;
-    myMembership = (!myMembership || myMembership.handle.isEmpty) ? null : myMembership;
-    return <Component {...props} myMembership={ myMembership } />;
-  };
-  ResultComponent.displayName = `resolveMyProfile(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-const withMyProfileCall = withCalls<MyAccountProps>(queryMembershipToProp('membershipById', {
-  paramName: 'myMemberId',
-  propName: 'myMembership'
-}));
-
-const withMyProfile = <P extends MyAccountProps>(Component: React.ComponentType<P>) =>
-  withMulti(Component, withMyProfileCall, resolveMyProfile);
-
-const withContentWorkingGroupDetails = withCalls<MyAccountProps>(
-  queryToProp('query.contentWorkingGroup.currentLeadId', { propName: 'isLeadSet' }),
-  queryToProp('query.contentWorkingGroup.curatorById', { propName: 'curatorEntries' })
-);
-
-function resolveLead<P extends MyAccountProps> (Component: React.ComponentType<P>) {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const { isLeadSet } = props;
-
-    let contentLeadId;
-
-    if (isLeadSet && isLeadSet.isSome) {
-      contentLeadId = isLeadSet.unwrap();
-    }
-
-    const newProps = {
-      contentLeadId
-    };
-
-    return <Component {...props} {...newProps} />;
-  };
-  ResultComponent.displayName = `resolveLead(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-const resolveLeadEntry = withCalls<MyAccountProps>(
-  queryToProp('query.contentWorkingGroup.leadById', { propName: 'contentLeadEntry', paramName: 'contentLeadId' })
-);
-
-const withContentWorkingGroup = <P extends MyAccountProps>(Component: React.ComponentType<P>) =>
-  withMulti(Component, withContentWorkingGroupDetails, resolveLead, resolveLeadEntry);
-
-function withCurationActor<P extends MyAccountProps> (Component: React.ComponentType<P>) {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const {
-      myAccountId,
-      isLeadSet,
-      contentLeadEntry,
-      curatorEntries,
-      allAccounts
-    } = props;
-
-    if (!myAccountId || !isLeadSet || !contentLeadEntry || !curatorEntries || !allAccounts) {
-      return <Component {...props} />;
-    }
-
-    let lead = isLeadSet.isSome
-      ? new SingleLinkedMapEntry<Lead>(Lead, contentLeadEntry).value
-      : null;
-
-    // Ignore lead if he's not active
-    // TODO: Does if ever happen if we query currentLeadById?
-    if (!(lead?.stage.isOfType('Active'))) {
-      lead = null;
-    }
-
-    const curators = new MultipleLinkedMapEntry(CuratorId, Curator, curatorEntries);
-
-    const curationActorByAccount = (accountId: AccountId | string) => {
-      if (lead && lead.role_account.toString() === accountId.toString()) {
-        return new CurationActor({ Lead: null });
-      }
-
-      const matchingCuratorIndex = curators.linked_values.findIndex(curator =>
-        curator.is_active && accountId.toString() === curator.role_account.toString()
-      );
-
-      return matchingCuratorIndex >= 0
-        ? new CurationActor({
-          Curator: curators.linked_keys[matchingCuratorIndex]
-        })
-        : null;
-    };
-
-    // First priority - currently selected account
-    let actor = curationActorByAccount(myAccountId);
-    let actorKey: AccountId | null = myAccountId;
-    // Second priority - check other keys and find best role
-    // TODO: Prioritize current member?
-    // TODO: Perhaps just don't do that at all and force the user to select the correct key to avoid confision?
-    if (!actor) {
-      const allActorsWithKeys = Object.keys(allAccounts).map(accKey => ({
-        actor: curationActorByAccount(allAccounts[accKey].json.address),
-        key: new GenericAccountId(allAccounts[accKey].json.address)
-      }));
-      let actorWithKey = allActorsWithKeys.find(({ actor }) => actor?.isOfType('Lead'));
-      if (!actorWithKey) {
-        actorWithKey = allActorsWithKeys.find(({ actor }) => actor?.isOfType('Curator'));
-      }
-      actor = actorWithKey?.actor || null;
-      actorKey = actorWithKey?.key || null;
-    }
-
-    if (actor && actorKey) {
-      return <Component {...props} curationActor={[actor, actorKey]} />;
-    } else {
-      // we don't have any key that can fulfill a curation action
-      return <Component {...props} />;
-    }
-  };
-  ResultComponent.displayName = `withCurationActor(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-export const withMyAccount = <P extends MyAccountProps>(Component: React.ComponentType<P>) =>
-  withMulti(
-    Component,
-    withObservable(accountObservable.subject, { propName: 'allAccounts' }),
-    withMyAddress,
-    withMyMemberIds,
-    withMyMembership,
-    withMyProfile,
-    withContentWorkingGroup,
-    withCurationActor
-  );
-
-export function MembershipRequired<P extends {}> (Component: React.ComponentType<P>): React.ComponentType<P> {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const { myMemberIdChecked, iAmMember } = useMyMembership();
-
-    if (!myMemberIdChecked) {
-      return <em>Loading...</em>;
-    } else if (iAmMember) {
-      return <Component {...props} />;
-    }
-
-    return (
-      <Message warning className="JoyMainStatus">
-        <Message.Header>Only members can access this functionality.</Message.Header>
-        <div style={{ marginTop: '1rem' }}>
-          <Link to={'/members/edit'} className="ui button orange">
-            Register here
-          </Link>
-          <span style={{ margin: '0 .5rem' }}> or </span>
-          <Link to={'/accounts'} className="ui button">
-            Change key
-          </Link>
-        </div>
-      </Message>
-    );
-  };
-  ResultComponent.displayName = `MembershipRequired(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-export function AccountRequired<P extends {}> (Component: React.ComponentType<P>): React.ComponentType<P> {
-  const ResultComponent: React.FunctionComponent<P> = (props: P) => {
-    const { allAccounts } = useMyMembership();
-
-    if (allAccounts && !Object.keys(allAccounts).length) {
-      return (
-        <Message warning className="JoyMainStatus">
-          <Message.Header>Please create a key to get started.</Message.Header>
-          <div style={{ marginTop: '1rem' }}>
-            <Link to={'/accounts'} className="ui button orange">
-              Create key
-            </Link>
-          </div>
-        </Message>
-      );
-    }
-
-    return <Component {...props} />;
-  };
-  ResultComponent.displayName = `AccountRequired(${componentName(Component)})`;
-  return ResultComponent;
-}
-
-// TODO: We could probably use withAccountRequired, which wouldn't pass any addiotional props, just like withMembershipRequired.
-// Just need to make sure those passed props are not used in the extended components (they probably aren't).
-export const withOnlyAccounts = <P extends MyAccountProps>(Component: React.ComponentType<P>): React.ComponentType<P> =>
-  withMulti(Component, withMyAccount, AccountRequired);
-
-export const withMembershipRequired = <P extends {}> (Component: React.ComponentType<P>): React.ComponentType<P> =>
-  withMulti(Component, AccountRequired, MembershipRequired);
-
-export const withOnlyMembers = <P extends MyAccountProps>(Component: React.ComponentType<P>): React.ComponentType<P> =>
-  withMulti(Component, withMyAccount, withMembershipRequired);

+ 0 - 55
pioneer/packages/joy-utils-old/src/TextArea.tsx

@@ -1,55 +0,0 @@
-import React from 'react';
-import { TextArea } from 'semantic-ui-react';
-import { Labelled } from '@polkadot/react-components/index';
-
-type Props = {
-  // TextArea
-  as?: any;
-  autoHeight?: boolean;
-  rows?: number | string;
-  style?: Record<string, any>;
-  value?: number | string;
-  placeholder?: string;
-
-  // Label
-  onChange?: (value: string) => void;
-  labelClass?: string;
-  labelStyle?: {
-    [index: string]: any;
-  };
-  label?: string;
-  withLabel?: boolean;
-};
-
-export default class Component extends React.PureComponent<Props> {
-  render () {
-    const { as, autoHeight, rows, style, value, label, labelClass, labelStyle, withLabel = true, onChange, ...otherProps } = this.props;
-    return (
-      <Labelled
-        className={labelClass}
-        style={labelStyle}
-        label={label}
-        withLabel={withLabel}
-      >
-        <div className='ui form'>
-          <TextArea
-            {...otherProps}
-            as={as}
-            autoHeight={autoHeight}
-            rows={rows}
-            style={style}
-            value={value}
-            onChange={this.onChange}
-          />
-        </div>
-      </Labelled>
-    );
-  }
-
-  private onChange = (event: React.SyntheticEvent<Element>): void => {
-    const { onChange } = this.props;
-    const { value } = event.target as HTMLInputElement;
-
-    onChange && onChange(value);
-  }
-}

+ 0 - 202
pioneer/packages/joy-utils-old/src/index.ts

@@ -1,202 +0,0 @@
-import BN from 'bn.js';
-import { Text, Option } from '@polkadot/types';
-import { OptionalText } from '@joystream/types/content-working-group';
-
-import keyring from '@polkadot/ui-keyring';
-
-// Joystream Stake utils
-// --------------------------------------
-
-import { ElectionStake, Backer } from '@joystream/types/council';
-
-// Substrate/Polkadot API utils
-// --------------------------------------
-
-import { Options as QueryOptions } from '@polkadot/react-api/with/types';
-
-import { APIQueryCache } from './APIQueryCache';
-
-// Parse URLs
-// --------------------------------------
-
-import queryString from 'query-string';
-
-// Business logic middleware
-// --------------------------------------
-import { MultipleLinkedMapEntry, SingleLinkedMapEntry } from './LinkedMapEntry';
-
-// Business logic middleware
-// --------------------------------------
-
-import { Controller } from './Controller';
-import { Loadable } from './Loadable';
-import { Observable } from './Observable';
-import { Observer, Subscribable, Subscription } from './Subscribable';
-import { Transport } from './Transport';
-import { View, ViewComponent, Params } from './View';
-
-// Memoization
-// --------------------------------------
-
-import { memoize } from './memoize';
-
-// Substrate events
-// --------------------------------------
-
-import { SubmittableResult } from '@polkadot/api';
-import { Codec } from '@polkadot/types/types';
-
-export const ZERO = new BN(0);
-
-export function bnToStr (bn?: BN, dflt = ''): string {
-  return bn ? bn.toString() : dflt;
-}
-
-// String, Numbers, Object
-// --------------------------------------
-
-export const notDefined = (x: any): boolean =>
-  x === null || typeof x === 'undefined';
-
-export const isDefined = (x: any): boolean =>
-  !notDefined(x);
-
-export const isDef = isDefined;
-
-export const notDef = notDefined;
-
-export const isObj = (x: any): boolean =>
-  x !== null && typeof x === 'object';
-
-export const isStr = (x: any): boolean =>
-  typeof x === 'string';
-
-export const isNum = (x: any): boolean =>
-  typeof x === 'number';
-
-export const isEmptyStr = (x: any): boolean =>
-  notDefined(x) || (isStr(x) && x.trim().length === 0);
-
-export const nonEmptyStr = (x?: any) =>
-  isStr(x) && x.trim().length > 0;
-
-export const parseNumStr = (num: string): number | undefined => {
-  try {
-    return parseInt(num, undefined);
-  } catch (err) {
-    return undefined;
-  }
-};
-
-export const nonEmptyArr = (x: any): boolean =>
-  Array.isArray(x) && x.length > 0;
-
-export const isEmptyArr = (x: any): boolean =>
-  !nonEmptyArr(x);
-
-export function findNameByAddress (address: string): string | undefined {
-  let keyring_address;
-  try {
-    keyring_address = keyring.getAccount(address);
-  } catch (error) {
-    try {
-      keyring_address = keyring.getAddress(address);
-    } catch (error) {
-      // do nothing
-    }
-  }
-  return keyring_address ? keyring_address.meta.name : undefined;
-}
-
-export function isKnownAddress (address: string): boolean {
-  return isDefined(findNameByAddress(address));
-}
-
-export function newOptionalText (str?: string): OptionalText {
-  const text = isEmptyStr(str) ? null : str;
-  return new Option(Text, text);
-}
-
-export function calcTotalStake (stakes: ElectionStake | ElectionStake[] | undefined): BN {
-  if (typeof stakes === 'undefined') {
-    return ZERO;
-  }
-  const total = (stake: ElectionStake) => stake.new.add(stake.transferred);
-  try {
-    if (Array.isArray(stakes)) {
-      return stakes.reduce((accum, stake) => {
-        return accum.add(total(stake));
-      }, ZERO);
-    } else {
-      return total(stakes);
-    }
-  } catch (err) {
-    console.log('Failed to calculate a total stake', stakes, err);
-    return ZERO;
-  }
-}
-
-export function calcBackersStake (backers: Backer[]): BN {
-  return backers.map(b => b.stake).reduce((accum, stake) => {
-    return accum.add(stake);
-  }, ZERO);
-}
-
-/** Example of apiQuery: 'query.councilElection.round' */
-export function queryToProp (
-  apiQuery: string,
-  paramNameOrOpts?: string | QueryOptions
-): [string, QueryOptions] {
-  let paramName: string | undefined;
-  let propName: string | undefined;
-
-  if (typeof paramNameOrOpts === 'string') {
-    paramName = paramNameOrOpts;
-  } else if (paramNameOrOpts) {
-    paramName = paramNameOrOpts.paramName;
-    propName = paramNameOrOpts.propName;
-  }
-
-  // If prop name is still undefined, derive it from the name of storage item:
-  if (!propName) {
-    propName = apiQuery.split('.').slice(-1)[0];
-  }
-
-  return [apiQuery, { paramName, propName }];
-}
-export { APIQueryCache };
-
-export function getUrlParam (location: Location, paramName: string, deflt: string | null = null): string | null {
-  const params = queryString.parse(location.search);
-  return params[paramName] ? params[paramName] as string : deflt;
-}
-export { MultipleLinkedMapEntry, SingleLinkedMapEntry };
-
-export {
-  Controller,
-  Loadable,
-  Observer, Observable,
-  Subscribable, Subscription,
-  Transport,
-  View, ViewComponent, Params
-};
-export { memoize };
-
-export function filterSubstrateEventsAndExtractData (txResult: SubmittableResult, eventName: string): Codec[][] {
-  const res: Codec[][] = [];
-  txResult.events.forEach((event) => {
-    const { event: { method, data } } = event;
-    if (method === eventName) {
-      res.push(data.toArray());
-    }
-  });
-  return res;
-}
-
-export function findFirstParamOfSubstrateEvent<T extends Codec> (txResult: SubmittableResult, eventName: string): T | undefined {
-  const data = filterSubstrateEventsAndExtractData(txResult, eventName);
-  if (data && data.length) {
-    return data[0][0] as T;
-  }
-  return undefined;
-}

+ 0 - 7
pioneer/packages/joy-utils-old/src/memo/Memo.css

@@ -1,7 +0,0 @@
-.JoyMemo--preview {
-  margin-right: .5rem;
-}
-
-.JoyMemo--empty {
-  color: #999;
-}

+ 0 - 78
pioneer/packages/joy-utils-old/src/memo/MemoEdit.tsx

@@ -1,78 +0,0 @@
-import BN from 'bn.js';
-import React from 'react';
-
-import { withCalls } from '@polkadot/react-api/with';
-
-import { nonEmptyStr } from '../index';
-import TextArea from '../TextArea';
-
-type Props = {
-  accountId: string;
-  onChange: (memo: string) => void;
-  onReset: (memo: string) => void;
-  maxLen?: BN;
-  storedMemo?: Text;
-};
-
-type State = {
-  memo: string;
-  loadedMemo: boolean;
-};
-
-class Component extends React.PureComponent<Props, State> {
-  static getDerivedStateFromProps (props: Props, currentState: State) {
-    const { storedMemo } = props;
-    const { memo, loadedMemo } = currentState;
-    if (storedMemo && !memo && !loadedMemo) {
-      // only set loaded memo once
-      return {
-        memo: storedMemo.toString(),
-        loadedMemo: true
-      };
-    }
-    return null;
-  }
-
-  state: State = {
-    memo: '',
-    loadedMemo: false
-  };
-
-  render () {
-    const { memo } = this.state;
-    return (
-      <TextArea
-        rows={3}
-        autoHeight={true}
-        label='Memo (supports Markdown):'
-        placeholder='Here you can type any public information relevant to your account.'
-        value={memo}
-        onChange={this.onChange}
-      />
-    );
-  }
-
-  private onChange = (memo: string) => {
-    const { maxLen, onChange, onReset, storedMemo } = this.props;
-    if (maxLen && nonEmptyStr(memo)) {
-      memo = memo.substring(0, maxLen.toNumber());
-    }
-    this.setState({ memo });
-
-    if (storedMemo && memo === storedMemo.toString()) {
-      if (onReset) {
-        onReset(memo);
-      }
-    } else {
-      if (onChange) {
-        onChange(memo);
-      }
-    }
-  }
-}
-
-// inject the actual API calls automatically into props
-export default withCalls<Props>(
-  ['query.memo.maxMemoLength', { propName: 'maxLen' }],
-  ['query.memo.memo', { paramName: 'accountId', propName: 'storedMemo' }]
-)(Component);

+ 0 - 73
pioneer/packages/joy-utils-old/src/memo/MemoView.tsx

@@ -1,73 +0,0 @@
-import React from 'react';
-import ReactMarkdown from 'react-markdown';
-import { truncate } from 'lodash';
-
-import { withCalls } from '@polkadot/react-api/index';
-
-import { nonEmptyStr } from '../index';
-import './Memo.css';
-import { Link } from 'react-router-dom';
-
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-const remark = require('remark');
-// eslint-disable-next-line @typescript-eslint/no-var-requires
-const strip = require('strip-markdown');
-const mdStripper = remark().use(strip);
-
-type Props = {
-  accountId: string;
-  memo?: Text;
-  preview?: boolean;
-  showEmpty?: boolean;
-  className?: string;
-  style?: any;
-};
-
-class Component extends React.PureComponent<Props> {
-  private mdToPlainText = (md: string): string => {
-    if (nonEmptyStr(md)) {
-      try {
-        return mdStripper.processSync(md).toString().trim();
-      } catch (err) {
-        console.log('Failed to convert markdown to plain text', err);
-      }
-    }
-    return md;
-  }
-
-  private isMemoEmpty (): boolean {
-    const { memo } = this.props;
-    return !memo;
-  }
-
-  renderMemo () {
-    const { memo, preview = true, accountId } = this.props;
-    if (this.isMemoEmpty()) {
-      return <em className='JoyMemo--empty'>Memo is empty.</em>;
-    } else {
-      const md = memo ? memo.toString().trim() : '';
-      if (preview) {
-        const plainText = this.mdToPlainText(md);
-        const previewText = truncate(plainText, { length: 80, omission: '…' });
-        return (
-          <span className='JoyMemo--preview'>
-            {previewText}
-            <Link to={`/addressbook/memo/${accountId}`}>{' view full memo'}</Link>
-          </span>
-        );
-      } else {
-        return <ReactMarkdown className='JoyViewMD' source={md} linkTarget='_blank' />;
-      }
-    }
-  }
-
-  render () {
-    const { showEmpty = true, className, style } = this.props;
-    return this.isMemoEmpty() && !showEmpty ? null : <div className={className} style={style}>{this.renderMemo()}</div>;
-  }
-}
-
-export default withCalls<Props>(
-  ['query.memo.memo',
-    { paramName: 'accountId', propName: 'memo' }]
-)(Component);

+ 0 - 3
pioneer/packages/joy-utils-old/src/react/hooks/index.tsx

@@ -1,3 +0,0 @@
-export { default as usePromise } from './usePromise';
-export { default as useTransport } from './useTransport';
-export { default as useProposalSubscription } from './proposals/useProposalSubscription';

+ 0 - 0
pioneer/packages/old-apps/.skip-build


+ 0 - 201
pioneer/packages/old-apps/app-accounts/LICENSE

@@ -1,201 +0,0 @@
-                              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.

+ 0 - 5
pioneer/packages/old-apps/app-accounts/README.md

@@ -1,5 +0,0 @@
-# @polkadot/app-accounts
-
-## vanity
-
-Running `yarn run vanitygen --match <string>` runs the generator as a Node CLI app. (Orders of a magnitude faster due to the use of libsoldium bindings)

+ 0 - 23
pioneer/packages/old-apps/app-accounts/package.json

@@ -1,23 +0,0 @@
-{
-  "name": "@polkadot/app-accounts",
-  "version": "0.37.0-beta.63",
-  "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.7.1",
-    "@polkadot/react-components": "^0.37.0-beta.63",
-    "@polkadot/react-qr": "^0.47.0-beta.3",
-    "@types/file-saver": "^2.0.0",
-    "@types/yargs": "^13.0.2",
-    "babel-plugin-module-resolver": "^3.1.1",
-    "detect-browser": "^4.8.0",
-    "file-saver": "^2.0.0",
-    "yargs": "^14.2.0"
-  }
-}

+ 0 - 26
pioneer/packages/old-apps/app-accounts/scripts/vanitygen.js

@@ -1,26 +0,0 @@
-#!/usr/bin/env node
-/* eslint-disable @typescript-eslint/no-var-requires */
-// Copyright 2017-2019 @polkadot/app-accounts authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-const fs = require('fs');
-const path = require('path');
-
-const [compiled] = ['../vanitygen/cli.js']
-  .map((file) => path.join(__dirname, file))
-  .filter((file) => fs.existsSync(file));
-
-if (compiled) {
-  require(compiled);
-} else {
-  require('@babel/register')({
-    extensions: ['.js', '.ts'],
-    plugins: [
-      ['module-resolver', {
-        alias: {}
-      }]
-    ]
-  });
-  require('../src/vanitygen/cli.ts');
-}

+ 0 - 227
pioneer/packages/old-apps/app-accounts/src/Account.tsx

@@ -1,227 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { I18nProps } from '@polkadot/react-components/types';
-
-import React, { useState, useEffect } from 'react';
-import { Popup } from 'semantic-ui-react';
-import styled from 'styled-components';
-import { AddressCard, AddressInfo, Button, ChainLock, Forget, Menu } from '@polkadot/react-components';
-import keyring from '@polkadot/ui-keyring';
-
-import Backup from './modals/Backup';
-import ChangePass from './modals/ChangePass';
-import Derive from './modals/Derive';
-import Transfer from './modals/Transfer';
-import translate from './translate';
-
-interface Props extends I18nProps {
-  address: string;
-  className?: string;
-}
-
-function Account ({ address, className, t }: Props): React.ReactElement<Props> {
-  const [genesisHash, setGenesisHash] = useState<string | null>(null);
-  const [isBackupOpen, setIsBackupOpen] = useState(false);
-  const [{ isDevelopment, isEditable, isExternal }, setFlags] = useState({ isDevelopment: false, isEditable: false, isExternal: false });
-  const [isDeriveOpen, setIsDeriveOpen] = useState(false);
-  const [isForgetOpen, setIsForgetOpen] = useState(false);
-  const [isPasswordOpen, setIsPasswordOpen] = useState(false);
-  const [isSettingPopupOpen, setIsSettingPopupOpen] = useState(false);
-  const [isTransferOpen, setIsTransferOpen] = useState(false);
-
-  useEffect((): void => {
-    const account = keyring.getAccount(address);
-
-    setGenesisHash((account && account.meta.genesisHash) || null);
-    setFlags({
-      isDevelopment: (account && account.meta.isTesting) || false,
-      isEditable: (account && !(account.meta.isInjected || account.meta.isHardware)) || false,
-      isExternal: (account && account.meta.isExternal) || false
-    });
-  }, [address]);
-
-  const _toggleBackup = (): void => setIsBackupOpen(!isBackupOpen);
-  const _toggleDerive = (): void => setIsDeriveOpen(!isDeriveOpen);
-  const _toggleForget = (): void => setIsForgetOpen(!isForgetOpen);
-  const _togglePass = (): void => setIsPasswordOpen(!isPasswordOpen);
-  const _toggleTransfer = (): void => setIsTransferOpen(!isTransferOpen);
-  const _toggleSettingPopup = (): void => setIsSettingPopupOpen(!isSettingPopupOpen);
-  const _onForget = (): void => {
-    if (!address) {
-      return;
-    }
-
-    const status: Partial<ActionStatus> = {
-      account: address,
-      action: 'forget'
-    };
-
-    try {
-      keyring.forgetAccount(address);
-      status.status = 'success';
-      status.message = t('account forgotten');
-    } catch (error) {
-      status.status = 'error';
-      status.message = error.message;
-    }
-  };
-  const _onGenesisChange = (genesisHash: string | null): void => {
-    const account = keyring.getPair(address);
-
-    account && keyring.saveAccountMeta(account, { ...account.meta, genesisHash });
-
-    setGenesisHash(genesisHash);
-  };
-
-  // FIXME It is a bit heavy-handled switching of being editable here completely
-  // (and removing the tags, however the keyring cannot save these)
-  return (
-    <AddressCard
-      buttons={
-        <div className='accounts--Account-buttons buttons'>
-          <div className='actions'>
-            {isEditable && !isDevelopment && (
-              <Button
-                isNegative
-                onClick={_toggleForget}
-                icon='trash'
-                size='small'
-                tooltip={t('Forget this account')}
-              />
-            )}
-            {isEditable && !isExternal && !isDevelopment && (
-              <>
-                <Button
-                  icon='cloud download'
-                  isPrimary
-                  onClick={_toggleBackup}
-                  size='small'
-                  tooltip={t('Create a backup file for this account')}
-                />
-                <Button
-                  icon='key'
-                  isPrimary
-                  onClick={_togglePass}
-                  size='small'
-                  tooltip={t("Change this account's password")}
-                />
-              </>
-            )}
-            <Button
-              icon='paper plane'
-              isPrimary
-              label={t('send')}
-              onClick={_toggleTransfer}
-              size='small'
-              tooltip={t('Send funds from this account')}
-            />
-            {isEditable && !isExternal && (
-              <Popup
-                onClose={_toggleSettingPopup}
-                open={isSettingPopupOpen}
-                position='bottom left'
-                trigger={
-                  <Button
-                    icon='setting'
-                    onClick={_toggleSettingPopup}
-                    size='small'
-                  />
-                }
-              >
-                <Menu
-                  vertical
-                  text
-                  onClick={_toggleSettingPopup}
-                >
-                  <Menu.Item onClick={_toggleDerive}>
-                    {t('Derive account from source')}
-                  </Menu.Item>
-                  <Menu.Item disabled>
-                    {t('Change on-chain nickname')}
-                  </Menu.Item>
-                </Menu>
-              </Popup>
-            )}
-          </div>
-          {isEditable && !isExternal && (
-            <div className='others'>
-              <ChainLock
-                genesisHash={genesisHash}
-                onChange={_onGenesisChange}
-              />
-            </div>
-          )}
-        </div>
-      }
-      className={className}
-      isEditable={isEditable}
-      type='account'
-      value={address}
-      withExplorer
-      withIndexOrAddress={false}
-      withTags
-    >
-      {address && (
-        <>
-          {isBackupOpen && (
-            <Backup
-              address={address}
-              key='modal-backup-account'
-              onClose={_toggleBackup}
-            />
-          )}
-          {isDeriveOpen && (
-            <Derive
-              from={address}
-              key='modal-derive-account'
-              onClose={_toggleDerive}
-            />
-          )}
-          {isForgetOpen && (
-            <Forget
-              address={address}
-              onForget={_onForget}
-              key='modal-forget-account'
-              onClose={_toggleForget}
-            />
-          )}
-          {isPasswordOpen && (
-            <ChangePass
-              address={address}
-              key='modal-change-pass'
-              onClose={_togglePass}
-            />
-          )}
-          {isTransferOpen && (
-            <Transfer
-              key='modal-transfer'
-              onClose={_toggleTransfer}
-              senderId={address}
-            />
-          )}
-        </>
-      )}
-      <AddressInfo
-        address={address}
-        withBalance
-        withExtended
-      />
-    </AddressCard>
-  );
-}
-
-export default translate(
-  styled(Account)`
-    .accounts--Account-buttons {
-      text-align: right;
-
-      .others {
-        margin-right: 0.125rem;
-        margin-top: 0.25rem;
-      }
-    }
-  `
-);

+ 0 - 105
pioneer/packages/old-apps/app-accounts/src/Banner.tsx

@@ -1,105 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import { detect } from 'detect-browser';
-import React from 'react';
-import styled from 'styled-components';
-import { isWeb3Injected } from '@polkadot/extension-dapp';
-import { stringUpperFirst } from '@polkadot/util';
-
-import translate from './translate';
-
-// it would have been really good to import this from detect, however... not exported
-type Browser = 'chrome' | 'firefox';
-
-interface Extension {
-  desc: string;
-  link: string;
-  name: string;
-}
-
-interface Props extends I18nProps {
-  className?: string;
-}
-
-const available: Record<Browser, Extension[]> = {
-  chrome: [],
-  firefox: []
-};
-
-[
-  {
-    browsers: {
-      chrome: 'https://chrome.google.com/webstore/detail/polkadot%7Bjs%7D-extension/mopnmbcafieddcagagdcbnhejhlodfdd',
-      firefox: 'https://addons.mozilla.org/en-US/firefox/addon/polkadot-js-extension/'
-    },
-    desc: 'Basic account injection and signer',
-    name: 'polkadot-js extension'
-  }
-].forEach(({ browsers, desc, name }): void => {
-  Object.entries(browsers).forEach(([browser, link]): void => {
-    available[browser as Browser].push({ link, desc, name });
-  });
-});
-
-const browserInfo = detect();
-const browserName: Browser | null = (browserInfo && (browserInfo.name as Browser)) || null;
-const isSupported = browserName && Object.keys(available).includes(browserName);
-
-function Banner ({ className, t }: Props): React.ReactElement<Props> | null {
-  if (isWeb3Injected || !isSupported || !browserName) {
-    return null;
-  }
-
-  return (
-    <div className={className}>
-      <div className='box'>
-        <div className='info'>
-          <p>{t('It is recommended that you create/store your accounts securely and externally from the app. On {{yourBrowser}} the following browser extensions are available for use -', {
-            replace: {
-              yourBrowser: stringUpperFirst(browserName)
-            }
-          })}</p>
-          <ul>{available[browserName].map(({ desc, name, link }): React.ReactNode => (
-            <li key={name}>
-              <a
-                href={link}
-                rel='noopener noreferrer'
-                target='_blank'
-              >
-                {name}
-              </a> ({desc})
-            </li>
-          ))
-          }</ul>
-          <p>{t('Accounts injected from any of these extensions will appear in this application and be available for use. The above list is updated as more extensions with external signing capability become available.')}&nbsp;<a
-            href='https://github.com/polkadot-js/extension'
-            rel='noopener noreferrer'
-            target='_blank'
-          >{t('Learn more...')}</a></p>
-        </div>
-      </div>
-    </div>
-  );
-}
-
-export default translate(
-  styled(Banner)`
-    padding: 0 0.5rem 0.5rem;
-
-    .box {
-      background: #fff6e5;
-      border-left: 0.25rem solid darkorange;
-      border-radius: 0 0.25rem 0.25rem 0;
-      box-sizing: border-box;
-      padding: 1rem 1.5rem;
-
-      .info {
-        max-width: 50rem;
-      }
-    }
-  `
-);

+ 0 - 50
pioneer/packages/old-apps/app-accounts/src/MemoForm.tsx

@@ -1,50 +0,0 @@
-import React from 'react';
-import { Labelled } from '@polkadot/react-components/index';
-
-import MemoEdit from '@polkadot/joy-utils/memo/MemoEdit';
-import TxButton from '@polkadot/joy-utils/TxButton';
-import { withMyAccount, MyAccountProps } from '@polkadot/joy-utils/MyAccount';
-import { Text } from '@polkadot/types';
-
-type Props = MyAccountProps & {};
-
-type State = {
-  memo: string;
-  modified: boolean;
-};
-
-class Component extends React.PureComponent<Props, State> {
-  state: State = {
-    memo: '',
-    modified: false
-  };
-
-  render () {
-    const { myAddress } = this.props;
-    const { memo, modified } = this.state;
-    return (
-      <>
-        <MemoEdit accountId={myAddress || ''} onChange={this.onChangeMemo} onReset={this.onResetMemo} />
-        <Labelled style={{ marginTop: '.5rem' }}>
-          <TxButton
-            size='large'
-            isDisabled={!modified}
-            label='Update memo'
-            params={[new Text(memo)]}
-            tx='memo.updateMemo'
-          />
-        </Labelled>
-      </>
-    );
-  }
-
-  onChangeMemo = (memo: string): void => {
-    this.setState({ memo, modified: true });
-  }
-
-  onResetMemo = (memo: string): void => {
-    this.setState({ memo, modified: false });
-  }
-}
-
-export default withMyAccount(Component);

+ 0 - 110
pioneer/packages/old-apps/app-accounts/src/Overview.tsx

@@ -1,110 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { I18nProps } from '@polkadot/react-components/types';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-import { ComponentProps } from './types';
-
-import React, { useState } from 'react';
-import { Link, useLocation } from 'react-router-dom';
-import { Button as SUIButton } from 'semantic-ui-react';
-import keyring from '@polkadot/ui-keyring';
-import accountObservable from '@polkadot/ui-keyring/observable/accounts';
-import { getLedger, isLedger, withMulti, withObservable } from '@polkadot/react-api';
-import { Button, CardGrid } from '@polkadot/react-components';
-
-import CreateModal from './modals/Create';
-import ImportModal from './modals/Import';
-import Account from './Account';
-import translate from './translate';
-
-interface Props extends ComponentProps, I18nProps {
-  accounts?: SubjectInfo[];
-}
-
-// query the ledger for the address, adding it to the keyring
-async function queryLedger (): Promise<void> {
-  const ledger = getLedger();
-
-  try {
-    const { address } = await ledger.getAddress();
-
-    keyring.addHardware(address, 'ledger', { name: 'ledger' });
-  } catch (error) {
-    console.error(error);
-  }
-}
-
-function Overview ({ accounts, onStatusChange, t }: Props): React.ReactElement<Props> {
-  const { pathname } = useLocation();
-  const [isCreateOpen, setIsCreateOpen] = useState(false);
-  const [isImportOpen, setIsImportOpen] = useState(false);
-  const emptyScreen = !(isCreateOpen || isImportOpen) && accounts && (Object.keys(accounts).length === 0);
-
-  const _toggleCreate = (): void => setIsCreateOpen(!isCreateOpen);
-  const _toggleImport = (): void => setIsImportOpen(!isImportOpen);
-
-  return (
-    <CardGrid
-      topButtons={
-        !emptyScreen && <SUIButton as={Link} to={`${pathname}/vanity`}>Generate a vanity address</SUIButton>
-      }
-      buttons={
-        <Button.Group>
-          <Button
-            icon='add'
-            isPrimary
-            label={t('Add account')}
-            onClick={_toggleCreate}
-          />
-          <Button.Or />
-          <Button
-            icon='sync'
-            isPrimary
-            label={t('Restore JSON')}
-            onClick={_toggleImport}
-          />
-          {isLedger() && (
-            <>
-              <Button.Or />
-              <Button
-                icon='question'
-                isPrimary
-                label={t('Query Ledger')}
-                onClick={queryLedger}
-              />
-            </>
-          )}
-        </Button.Group>
-      }
-      isEmpty={emptyScreen}
-      emptyText={t('No account yet?')}
-    >
-      {isCreateOpen && (
-        <CreateModal
-          onClose={_toggleCreate}
-          onStatusChange={onStatusChange}
-        />
-      )}
-      {isImportOpen && (
-        <ImportModal
-          onClose={_toggleImport}
-          onStatusChange={onStatusChange}
-        />
-      )}
-      {accounts && Object.keys(accounts).map((address): React.ReactNode => (
-        <Account
-          address={address}
-          key={address}
-        />
-      ))}
-    </CardGrid>
-  );
-}
-
-export default withMulti(
-  Overview,
-  translate,
-  withObservable(accountObservable.subject, { propName: 'accounts' })
-);

+ 0 - 104
pioneer/packages/old-apps/app-accounts/src/Vanity/Match.tsx

@@ -1,104 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { BareProps } from '@polkadot/react-components/types';
-
-import React, { useEffect, useState } from 'react';
-import styled from 'styled-components';
-import { Button, IdentityIcon } from '@polkadot/react-components';
-import { u8aToHex } from '@polkadot/util';
-
-interface Props extends BareProps {
-  address: string;
-  count: number;
-  offset: number;
-  onCreateToggle: (seed: string) => void;
-  onRemove: (address: string) => void;
-  seed: Uint8Array;
-}
-
-function Match ({ address, className, count, offset, onCreateToggle, onRemove, seed }: Props): React.ReactElement<Props> {
-  const [hexSeed, setHexSeed] = useState('');
-  const _onCreate = (): void => onCreateToggle(hexSeed);
-  const _onRemove = (): void => onRemove(address);
-
-  useEffect((): void => {
-    setHexSeed(u8aToHex(seed));
-  }, [seed]);
-
-  return (
-    <div className={className}>
-      <div className='vanity--Match-item'>
-        <IdentityIcon
-          className='vanity--Match-icon'
-          size={48}
-          value={address}
-        />
-        <div className='vanity--Match-data'>
-          <div className='vanity--Match-addr'>
-            <span className='no'>{address.slice(0, offset)}</span><span className='yes'>{address.slice(offset, count + offset)}</span><span className='no'>{address.slice(count + offset)}</span>
-          </div>
-          <div className='vanity--Match-seed'>
-            {hexSeed}
-          </div>
-        </div>
-        <div className='vanity--Match-buttons'>
-          <Button
-            icon='plus'
-            isPrimary
-            onClick={_onCreate}
-            size='tiny'
-          />
-          <Button
-            icon='close'
-            isNegative
-            onClick={_onRemove}
-            size='tiny'
-          />
-        </div>
-      </div>
-    </div>
-  );
-}
-
-export default styled(Match)`
-  text-align: center;
-
-  &:hover {
-    background: #f9f9f9;
-  }
-
-  .vanity--Match-addr {
-    font-size: 1.5rem;
-    padding: 0 1rem;
-
-    .no {
-      color: inherit;
-    }
-
-    .yes {
-      color: red;
-    }
-  }
-
-  .vanity--Match-buttons,
-  .vanity--Match-data,
-  .vanity--Match-icon {
-    display: inline-block;
-    vertical-align: middle;
-  }
-
-  .vanity--Match-item {
-    display: inline-block;
-    font-family: monospace;
-    margin: 0 auto;
-    padding: 0.5em;
-    position: relative;
-  }
-
-  .vanity--Match-seed {
-    opacity: 0.45;
-    padding: 0 1rem;
-  }
-`;

+ 0 - 337
pioneer/packages/old-apps/app-accounts/src/Vanity/index.tsx

@@ -1,337 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-import { KeypairType } from '@polkadot/util-crypto/types';
-import { GeneratorMatches, GeneratorMatch, GeneratorResult } from '../vanitygen/types';
-import { ComponentProps } from '../types';
-
-import React from 'react';
-import styled from 'styled-components';
-import { Button, Dropdown, Input, TxComponent } from '@polkadot/react-components';
-import uiSettings from '@polkadot/ui-settings';
-
-import CreateModal from '../modals/Create';
-import generator from '../vanitygen';
-import matchRegex from '../vanitygen/regex';
-import generatorSort from '../vanitygen/sort';
-import Match from './Match';
-import translate from './translate';
-import Section from '@polkadot/joy-utils/Section';
-
-interface Props extends ComponentProps, I18nProps {}
-
-interface State {
-  createSeed: string | null;
-  elapsed: number;
-  isMatchValid: boolean;
-  isRunning: boolean;
-  keyCount: 0;
-  keyTime: 0;
-  match: string;
-  matches: GeneratorMatches;
-  startAt: number;
-  type: KeypairType;
-  withCase: boolean;
-  withHex: boolean;
-}
-
-const DEFAULT_MATCH = 'Some';
-const BOOL_OPTIONS = [
-  { text: 'No', value: false },
-  { text: 'Yes', value: true }
-];
-
-const SectionContentWrapper = styled.div`
-  margin-left: -2rem;
-`;
-
-class VanityApp extends TxComponent<Props, State> {
-  private results: GeneratorResult[] = [];
-
-  public state: State = {
-    createSeed: null,
-    elapsed: 0,
-    isMatchValid: true,
-    isRunning: false,
-    keyCount: 0,
-    keyTime: 0,
-    match: DEFAULT_MATCH,
-    matches: [],
-    startAt: 0,
-    type: 'ed25519',
-    withCase: true,
-    withHex: true
-  };
-
-  private _isActive = false;
-
-  public componentWillUnmount (): void {
-    this._isActive = false;
-  }
-
-  public render (): React.ReactNode {
-    const { className, onStatusChange } = this.props;
-    const { createSeed, type } = this.state;
-
-    return (
-      <div className={className}>
-        <Section title="Generate a vanity address">
-          <SectionContentWrapper>
-            {this.renderOptions()}
-            {this.renderButtons()}
-            {this.renderStats()}
-            {this.renderMatches()}
-            {createSeed && (
-              <CreateModal
-                onClose={this.closeCreate}
-                onStatusChange={onStatusChange}
-                seed={createSeed}
-                type={type}
-              />
-            )}
-          </SectionContentWrapper>
-        </Section>
-      </div>
-    );
-  }
-
-  private renderButtons (): React.ReactNode {
-    const { t } = this.props;
-    const { isMatchValid, isRunning } = this.state;
-
-    return (
-      <Button.Group>
-        <Button
-          icon={
-            isRunning
-              ? 'stop'
-              : 'sign-in'
-          }
-          isDisabled={!isMatchValid}
-          isPrimary={!isRunning}
-          onClick={this.toggleStart}
-          label={
-            isRunning
-              ? t('Stop generation')
-              : t('Start generation')
-          }
-          ref={this.button}
-        />
-      </Button.Group>
-    );
-  }
-
-  private renderMatches (): React.ReactNode {
-    const { matches } = this.state;
-
-    return (
-      <div className='vanity--App-matches'>
-        {matches.map((match): React.ReactNode => (
-          <Match
-            {...match}
-            key={match.address}
-            onCreateToggle={this.onCreateToggle}
-            onRemove={this.onRemove}
-          />
-        ))}
-      </div>
-    );
-  }
-
-  private renderOptions (): React.ReactNode {
-    const { t } = this.props;
-    const { isMatchValid, isRunning, match, type, withCase } = this.state;
-
-    return (
-      <>
-        <div className='ui--row'>
-          <Input
-            autoFocus
-            className='medium'
-            help={t('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.')}
-            isDisabled={isRunning}
-            isError={!isMatchValid}
-            label={t('Search for')}
-            onChange={this.onChangeMatch}
-            onEnter={this.submit}
-            value={match}
-          />
-          <Dropdown
-            className='medium'
-            help={t('Should the search be case sensitive, e.g if you select "no" your search for "Some" may return addresses containing "somE" or "sOme"...')}
-            isDisabled={isRunning}
-            label={t('case sensitive')}
-            options={BOOL_OPTIONS}
-            onChange={this.onChangeCase}
-            value={withCase}
-          />
-        </div>
-        <div className='ui--row'>
-          <Dropdown
-            className='medium'
-            defaultValue={type}
-            help={t('Determines what cryptography will be used to create this account. Note that to validate on Polkadot, the session account must use "ed25519".')}
-            label={t('keypair crypto type')}
-            onChange={this.onChangeType}
-            options={uiSettings.availableCryptos}
-          />
-        </div>
-      </>
-    );
-  }
-
-  private renderStats (): React.ReactNode {
-    const { t } = this.props;
-    const { elapsed, keyCount } = this.state;
-
-    if (!keyCount) {
-      return null;
-    }
-
-    const secs = elapsed / 1000;
-
-    return (
-      <div className='vanity--App-stats'>
-        {t('Evaluated {{count}} keys in {{elapsed}}s ({{avg}} keys/s)', {
-          replace: {
-            avg: (keyCount / secs).toFixed(3),
-            count: keyCount,
-            elapsed: secs.toFixed(2)
-          }
-        })}
-      </div>
-    );
-  }
-
-  private checkMatches (): void {
-    const results = this.results;
-
-    this.results = [];
-
-    if (results.length === 0 || !this._isActive) {
-      return;
-    }
-
-    this.setState(
-      ({ keyCount, keyTime, matches, startAt }: State): Pick<State, never> => {
-        let newKeyCount = keyCount;
-        let newKeyTime = keyTime;
-        const newMatches = results
-          .reduce((result, { elapsed, found }): GeneratorMatch[] => {
-            newKeyCount += found.length;
-            newKeyTime += elapsed;
-
-            return result.concat(found);
-          }, matches)
-          .sort(generatorSort)
-          .slice(0, 25);
-        const elapsed = Date.now() - startAt;
-
-        return {
-          elapsed,
-          matches: newMatches,
-          keyCount: newKeyCount,
-          keyTime: newKeyTime
-        };
-      }
-    );
-  }
-
-  private executeGeneration = (): void => {
-    if (!this.state.isRunning) {
-      this.checkMatches();
-
-      return;
-    }
-
-    setTimeout((): void => {
-      if (this._isActive) {
-        if (this.results.length === 25) {
-          this.checkMatches();
-        }
-
-        const { match, type, withCase, withHex } = this.state;
-
-        this.results.push(
-          generator({
-            match,
-            runs: 10,
-            type,
-            withCase,
-            withHex
-          })
-        );
-
-        this.executeGeneration();
-      }
-    }, 0);
-  }
-
-  private onCreateToggle = (createSeed: string): void => {
-    this.setState({ createSeed });
-  }
-
-  private onChangeCase = (withCase: boolean): void => {
-    this.setState({ withCase });
-  }
-
-  private onChangeMatch = (match: string): void => {
-    this.setState({
-      isMatchValid:
-        matchRegex.test(match) &&
-        (match.length !== 0) &&
-        (match.length < 31),
-      match
-    });
-  }
-
-  private onChangeType = (type: KeypairType): void => {
-    this.setState({ type });
-  }
-
-  private onRemove = (address: string): void => {
-    this.setState(
-      ({ matches }: State): Pick<State, never> => ({
-        matches: matches.filter((item): boolean =>
-          item.address !== address
-        )
-      })
-    );
-  }
-
-  private toggleStart = (): void => {
-    this.setState(
-      ({ isRunning, keyCount, keyTime, startAt }: State): Pick<State, never> => {
-        this._isActive = !isRunning;
-
-        return {
-          isRunning: this._isActive,
-          keyCount: this._isActive ? 0 : keyCount,
-          keyTime: this._isActive ? 0 : keyTime,
-          startAt: this._isActive ? Date.now() : startAt
-        };
-      },
-      this.executeGeneration
-    );
-  }
-
-  private closeCreate = (): void => {
-    this.setState({ createSeed: null });
-  }
-}
-
-export default translate(
-  styled(VanityApp)`
-    .vanity--App-matches {
-      padding: 1em 0;
-    }
-
-    .vanity--App-stats {
-      padding: 1em 0 0 0;
-      opacity: 0.45;
-      text-align: center;
-    }
-  `
-);

+ 0 - 7
pioneer/packages/old-apps/app-accounts/src/Vanity/translate.ts

@@ -1,7 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { withTranslation } from 'react-i18next';
-
-export default withTranslation(['app-accounts']);

+ 0 - 26
pioneer/packages/old-apps/app-accounts/src/bipWorker.ts

@@ -1,26 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { cryptoWaitReady, mnemonicGenerate, mnemonicToMiniSecret, naclKeypairFromSeed, schnorrkelKeypairFromSeed } from '@polkadot/util-crypto';
-
-const ctx: Worker = self as unknown as Worker;
-
-cryptoWaitReady().catch((): void => {
-  // ignore
-});
-
-ctx.onmessage = async ({ data: { pairType } }): Promise<void> => {
-  await cryptoWaitReady();
-
-  const seed = mnemonicGenerate();
-  const miniSecret = mnemonicToMiniSecret(seed);
-  const { publicKey } = pairType === 'sr25519'
-    ? schnorrkelKeypairFromSeed(miniSecret)
-    : naclKeypairFromSeed(miniSecret);
-
-  ctx.postMessage({
-    publicKey,
-    seed
-  });
-};

+ 0 - 85
pioneer/packages/old-apps/app-accounts/src/index.tsx

@@ -1,85 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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, I18nProps } from '@polkadot/react-components/types';
-import { ComponentProps, LocationProps } from './types';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-
-import React, { useEffect, useState } from 'react';
-import { Route, Switch } from 'react-router';
-import accountObservable from '@polkadot/ui-keyring/observable/accounts';
-import { HelpOverlay, Tabs } from '@polkadot/react-components';
-import { withMulti, withObservable } from '@polkadot/react-api';
-
-import basicMd from './md/basic.md';
-import Overview from './Overview';
-import translate from './translate';
-import Vanity from './Vanity';
-
-import MemoForm from './MemoForm';
-
-interface Props extends AppProps, I18nProps {
-  allAccounts?: SubjectInfo;
-  location: any;
-}
-
-function AccountsApp ({ allAccounts = {}, basePath, location, onStatusChange, t }: Props): React.ReactElement<Props> {
-  const [hidden, setHidden] = useState<string[]>(['vanity']);
-
-  useEffect((): void => {
-    setHidden(
-      Object.keys(allAccounts).length !== 0
-        ? []
-        : ['vanity']
-    );
-  }, [allAccounts]);
-
-  const _renderComponent = (Component: React.ComponentType<ComponentProps>): (props: LocationProps) => React.ReactNode => {
-    // eslint-disable-next-line react/display-name
-    return ({ match }: LocationProps): React.ReactNode => {
-      return (
-        <Component
-          basePath={basePath}
-          location={location}
-          match={match}
-          onStatusChange={onStatusChange}
-        />
-      );
-    };
-  };
-
-  return (
-    <main className='accounts--App'>
-      <HelpOverlay md={basicMd} />
-      <header>
-        <Tabs
-          basePath={basePath}
-          hidden={hidden}
-          items={[
-            {
-              isRoot: true,
-              name: 'overview',
-              text: t('My accounts')
-            },
-            {
-              name: 'memo',
-              text: t('My memo')
-            }
-          ]}
-        />
-      </header>
-      <Switch>
-        <Route path={`${basePath}/vanity`} render={_renderComponent(Vanity)} />
-        <Route path={`${basePath}/memo`} component={MemoForm} />
-        <Route render={_renderComponent(Overview)} />
-      </Switch>
-    </main>
-  );
-}
-
-export default withMulti(
-  AccountsApp,
-  translate,
-  withObservable(accountObservable.subject, { propName: 'allAccounts' })
-);

+ 0 - 44
pioneer/packages/old-apps/app-accounts/src/md/basic.md

@@ -1,44 +0,0 @@
-# Account
-
-An account is identified by its public address on the network. It is totally fine to give away this address, this is also the only information needed to receive funds. The network will **not** know about the name you give to this account in this application.
-
-# Balances
-
-The balances for each account is broken down into a number of areas, giving an overview of the totals, transferable and bonded funds as well as the funds currently being unbonded or redeemable. These are -
-
-- **total**: The overall amount of funds in the account, this includes the vested balance, available for transfer and locked.
-- **available**: The funds that can be transferred or bonded, i.e. the funds that are available for any transaction.
-- **bonded**: The funds bonded for validating or nominating. They are locked and cannot be transferred, although it can be unlocked for future actions.
-- **redeemable**: The funds that can get redeemed, e.g made available for withdrawal, by clicking on the "lock" icon.
-- **unbonding**: The funds that are being unbonded. The funds will be redeemable after the bonding period has passed. These funds can still be slashed. The information icon tells the amount of blocks left before the funds can be redeemed.
-
-# Security
-
-The public address is generated from a private key, itself generated from a seed or a mnemonic phrase. The seed or the mnemonic phrase should **never be shared with anybody** as they give access to your funds. It must be stored securely.
-The password needed to create an account is used to encrypt your private key. You must choose a strong and unique password.
-This password is also used to encrypt the private key in the backup file downloaded upon account creation. Thanks to this file together with your account password, you can recover your account.
-
-# Account recovery
-
-You can recover an account from its:
-- seed or mnemonic:
-  Click on the "Add account" button, type your seed or mnemonic in the associated field.
-
-- backup file (also called JSON keystore file) and the account's password:
-  Click on "Restore JSON" button. Upload your backup file and type in the password associated.
-
-# Minimum allowed balance
-
-Accounts with a balance lower than the minimal amount, 100 milliUnits (miliDOTs for Polkadot) as of writing are considered as nonexistent for the network. If an account's balance ever drops below this amount, it is removed from the network. In this application, it will still be visible, but with a balance of 0.
-
-For a fund transfer to a **new account** (read an account with a balance of 0), if the amount transferred is less than the minimum allowed balance, then the transfer will "succeed" but the destination account will not be created (read its balance will remain 0); this essentially burns the transfer balance from the sender, because the receiver's balance never exceed the minimum allowed balance.
-
-If the receiver already exists (read it has a balance greater than 0), it is perfectly possible to transfer very low amounts.
-
-# Cryptography
-
-Substrate and Polkadot use Schnorrkel/Ristretto x25519 ("sr25519") as its key derivation and signing algorithm.
-
-Sr25519 is based on the same underlying Curve25519 as its EdDSA counterpart, Ed25519. However, it uses Schnorr signatures instead of the EdDSA scheme. Schnorr signatures bring some noticeable benefits over the ECDSA/EdDSA schemes. For one, it is more efficient and still retains the same feature set and security assumptions. Additionally, it allows for native multisignature through signature aggregation.
-
-If you wish to validate, the `session` account needs to use "ed25519" cryptography.

+ 0 - 144
pioneer/packages/old-apps/app-accounts/src/modals/Backup.tsx

@@ -1,144 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import FileSaver from 'file-saver';
-import React from 'react';
-import { AddressRow, Button, Modal, Password, TxComponent } from '@polkadot/react-components';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import keyring from '@polkadot/ui-keyring';
-import { isPasswordValid } from '@polkadot/joy-utils/accounts';
-
-import translate from '../translate';
-
-interface Props extends I18nProps {
-  onClose: () => void;
-  address: string;
-}
-
-interface State {
-  isPassValid: boolean;
-  password: string;
-}
-
-class Backup extends TxComponent<Props, State> {
-  public state: State = {
-    isPassValid: true,
-    password: ''
-  };
-
-  public render (): React.ReactNode {
-    const { t } = this.props;
-
-    return (
-      <Modal
-        className='app--accounts-Modal'
-        dimmer='inverted'
-        open
-      >
-        <Modal.Header>{t('Backup account')}</Modal.Header>
-        {this.renderContent()}
-        {this.renderButtons()}
-      </Modal>
-    );
-  }
-
-  private renderButtons (): React.ReactNode {
-    const { onClose, t } = this.props;
-    const { isPassValid } = this.state;
-
-    return (
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <Button
-            icon='download'
-            isDisabled={!isPassValid}
-            label={t('Download')}
-            onClick={this.doBackup}
-            ref={this.button}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    );
-  }
-
-  private renderContent (): React.ReactNode {
-    const { address, t } = this.props;
-    const { isPassValid, password } = this.state;
-
-    return (
-      <Modal.Content>
-        <AddressRow
-          isInline
-          value={address}
-        >
-          <p>{t('An encrypted backup file will be created once you have pressed the "Download" button. This can be used to re-import your account on any other machine.')}</p>
-          <p>{t('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.')}</p>
-          <div>
-            <Password
-              help={t('The account password as specified when creating the account. This is used to encrypt the backup file and subsequently decrypt it when restoring the account.')}
-              isError={!isPassValid}
-              label={t('password')}
-              onChange={this.onChangePass}
-              onEnter={this.submit}
-              tabIndex={0}
-              value={password}
-            />
-          </div>
-        </AddressRow>
-      </Modal.Content>
-    );
-  }
-
-  private doBackup = (): void => {
-    const { onClose, address, t } = this.props;
-    const { password } = this.state;
-
-    if (!address) {
-      return;
-    }
-
-    const status: Partial<ActionStatus> = {
-      action: 'backup'
-    };
-
-    try {
-      const addressKeyring = address && keyring.getPair(address);
-      const json = addressKeyring && keyring.backupAccount(addressKeyring, password);
-      const blob = new Blob([JSON.stringify(json)], { type: 'application/json; charset=utf-8' });
-
-      status.account = address;
-      status.status = blob ? 'success' : 'error';
-      status.message = t('account backed up');
-
-      FileSaver.saveAs(blob, `${address}.json`);
-    } catch (error) {
-      this.setState({ isPassValid: true });
-      console.error(error);
-
-      status.status = 'error';
-      status.message = error.message;
-      return;
-    }
-
-    onClose();
-  }
-
-  private onChangePass = (password: string): void => {
-    this.setState({
-      isPassValid: isPasswordValid(password),
-      password
-    });
-  }
-}
-
-export default translate(Backup);

+ 0 - 183
pioneer/packages/old-apps/app-accounts/src/modals/ChangePass.tsx

@@ -1,183 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import React from 'react';
-import { AddressRow, Button, Modal, Password, TxComponent } from '@polkadot/react-components';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import keyring from '@polkadot/ui-keyring';
-import { isPasswordValid } from '@polkadot/joy-utils/accounts';
-
-import translate from '../translate';
-
-interface Props extends I18nProps {
-  address: string;
-  onClose: () => void;
-}
-
-interface State {
-  isNewValid: boolean;
-  isOldValid: boolean;
-  newPass: string;
-  oldPass: string;
-}
-
-class ChangePass extends TxComponent<Props, State> {
-  public state: State = {
-    isNewValid: false,
-    isOldValid: false,
-    newPass: '',
-    oldPass: ''
-  };
-
-  public render (): React.ReactNode {
-    const { t } = this.props;
-
-    return (
-      <Modal
-        className='app--accounts-Modal'
-        dimmer='inverted'
-        open
-      >
-        <Modal.Header>{t('Change account password')}</Modal.Header>
-        {this.renderContent()}
-        {this.renderButtons()}
-      </Modal>
-    );
-  }
-
-  private renderButtons (): React.ReactNode {
-    const { onClose, t } = this.props;
-    const { isNewValid, isOldValid } = this.state;
-
-    return (
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <Button
-            icon='sign-in'
-            isDisabled={!isNewValid || !isOldValid}
-            isPrimary
-            label={t('Change')}
-            onClick={this.doChange}
-            ref={this.button}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    );
-  }
-
-  private renderContent (): React.ReactNode {
-    const { address, t } = this.props;
-    const { isNewValid, isOldValid, newPass, oldPass } = this.state;
-
-    return (
-      <Modal.Content>
-        <AddressRow
-          isInline
-          value={address}
-        >
-          <p>{t('This will apply to any future use of this account as stored on this browser. Ensure that you securely store this new password and that it is strong and unique to the account.')}</p>
-          <div>
-            <Password
-              autoFocus
-              help={t('The existing account password as specified when this account was created or when it was last changed.')}
-              isError={!isOldValid}
-              label={t('your current password')}
-              onChange={this.onChangeOld}
-              tabIndex={1}
-              value={oldPass}
-            />
-            <Password
-              help={t('The new account password. Once set, all future account unlocks will be performed with this new password.')}
-              isError={!isNewValid}
-              label={t('your new password')}
-              onChange={this.onChangeNew}
-              onEnter={this.submit}
-              tabIndex={2}
-              value={newPass}
-            />
-          </div>
-        </AddressRow>
-      </Modal.Content>
-    );
-  }
-
-  private doChange = (): void => {
-    const { address, onClose, t } = this.props;
-    const { newPass, oldPass } = this.state;
-    const status: Partial<ActionStatus> = {
-      action: 'changePassword'
-    };
-
-    try {
-      const account = address && keyring.getPair(address);
-
-      if (!account) {
-        status.message = t(`No keypair found for this address ${address}`);
-
-        return;
-      }
-
-      try {
-        if (!account.isLocked) {
-          account.lock();
-        }
-
-        account.decodePkcs8(oldPass);
-      } catch (error) {
-        this.setState({ isOldValid: false });
-        status.message = error.message;
-
-        return;
-      }
-
-      try {
-        keyring.encryptAccount(account, newPass);
-        status.account = address;
-        status.status = 'success';
-        status.message = t('password changed');
-      } catch (error) {
-        this.setState({ isNewValid: false });
-        status.status = 'error';
-        status.message = error.message;
-
-        return;
-      }
-    } catch (error) {
-      status.message = error.message;
-
-      return;
-    }
-
-    onClose();
-  }
-
-  private onChangeNew = (newPass: string): void => {
-    this.setState({
-      isNewValid: this.validatePass(newPass),
-      newPass
-    });
-  }
-
-  private onChangeOld = (oldPass: string): void => {
-    this.setState({
-      isOldValid: this.validatePass(oldPass),
-      oldPass
-    });
-  }
-
-  private validatePass (password: string): boolean {
-    return isPasswordValid(password);
-  }
-}
-
-export default translate(ChangePass);

+ 0 - 193
pioneer/packages/old-apps/app-accounts/src/modals/Create.tsx

@@ -1,193 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-import { KeypairType } from '@polkadot/util-crypto/types';
-import { ModalProps } from '../types';
-
-import { useMyAccount } from '@polkadot/joy-utils/MyAccountContext';
-import { generateSeed, updateAddress, createAccount, isPasswordValid, AddressState, SeedType } from '@polkadot/joy-utils/accounts';
-import React, { useContext, useState } from 'react';
-import styled from 'styled-components';
-import { ApiContext } from '@polkadot/react-api';
-import { AddressRow, Button, Dropdown, Input, Modal, Password } from '@polkadot/react-components';
-import uiSettings from '@polkadot/ui-settings';
-
-import translate from '../translate';
-import CreateConfirmation from './CreateConfirmation';
-
-interface Props extends ModalProps, I18nProps {
-  seed?: string;
-  type?: KeypairType;
-}
-
-function Create ({ className, onClose, onStatusChange, seed: propsSeed, t, type: propsType }: Props): React.ReactElement<Props> {
-  const { isDevelopment } = useContext(ApiContext);
-  const [{ address, deriveError, derivePath, isSeedValid, pairType, seed, seedType }, setAddress] = useState<AddressState>(generateSeed(propsSeed, '', propsSeed ? 'raw' : 'bip', propsType));
-  const [isConfirmationOpen, setIsConfirmationOpen] = useState(false);
-  const [{ isNameValid, name }, setName] = useState({ isNameValid: false, name: '' });
-  const [{ isPassValid, password }, setPassword] = useState({ isPassValid: false, password: '' });
-  const isValid = !!address && !deriveError && isNameValid && isPassValid && isSeedValid;
-
-  const _onChangePass = (password: string): void =>
-    setPassword({ isPassValid: isPasswordValid(password), password });
-  const _onChangeDerive = (newDerivePath: string): void =>
-    setAddress(updateAddress(seed, newDerivePath, seedType, pairType));
-  const _onChangeSeed = (newSeed: string): void =>
-    setAddress(updateAddress(newSeed, derivePath, seedType, pairType));
-  const _onChangePairType = (newPairType: KeypairType): void =>
-    setAddress(updateAddress(seed, derivePath, seedType, newPairType));
-  const _selectSeedType = (newSeedType: SeedType): void => {
-    if (newSeedType !== seedType) {
-      setAddress(generateSeed(null, derivePath, newSeedType, pairType));
-    }
-  };
-  const _onChangeName = (name: string): void => setName({ isNameValid: !!name.trim(), name });
-  const _toggleConfirmation = (): void => setIsConfirmationOpen(!isConfirmationOpen);
-  const context = useMyAccount();
-
-  const _onCommit = (): void => {
-    if (!isValid) {
-      return;
-    }
-
-    const status = createAccount(`${seed}${derivePath}`, pairType, name, password, t('created account'));
-    context.set(status.account as string);
-
-    _toggleConfirmation();
-    onStatusChange(status);
-    onClose();
-  };
-
-  return (
-    <Modal
-      className={className}
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>{t('Add an account via seed')}</Modal.Header>
-      {address && isConfirmationOpen && (
-        <CreateConfirmation
-          address={address}
-          name={name}
-          onCommit={_onCommit}
-          onClose={_toggleConfirmation}
-        />
-      )}
-      <Modal.Content>
-        <AddressRow
-          defaultName={name}
-          noDefaultNameOpacity
-          value={isSeedValid ? address : ''}
-        >
-          <Input
-            autoFocus
-            className='full'
-            help={t('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".')}
-            isError={!isNameValid}
-            label={t('name')}
-            onChange={_onChangeName}
-            onEnter={_onCommit}
-            placeholder={t('new account')}
-            value={name}
-          />
-          <Input
-            className='full'
-            help={t('The private key for your account is derived from this seed. This seed must be kept secret as anyone in its possession has access to the funds of this account. If you validate, use the seed of the session account as the "--key" parameter of your node.')}
-            isAction
-            isError={!isSeedValid}
-            isReadOnly={seedType === 'dev'}
-            label={
-              seedType === 'bip'
-                ? t('mnemonic seed')
-                : seedType === 'dev'
-                  ? t('development seed')
-                  : t('seed (hex or string)')
-            }
-            onChange={_onChangeSeed}
-            onEnter={_onCommit}
-            value={seed}
-          >
-            <Dropdown
-              isButton
-              defaultValue={seedType}
-              onChange={_selectSeedType}
-              options={
-                (
-                  isDevelopment
-                    ? [{ value: 'dev', text: t('Development') }]
-                    : []
-                ).concat(
-                  { value: 'bip', text: t('Mnemonic') },
-                  { value: 'raw', text: t('Raw seed') }
-                )
-              }
-            />
-          </Input>
-          <Password
-            className='full'
-            help={t('This password is used to encrypt your private key. It must be strong and unique! You will need it to sign transactions with this account. You can recover this account using this password together with the backup file (generated in the next step).')}
-            isError={!isPassValid}
-            label={t('password')}
-            onChange={_onChangePass}
-            onEnter={_onCommit}
-            value={password}
-          />
-          <details
-            className='accounts--Creator-advanced'
-            open
-          >
-            <summary>{t('Advanced creation options')}</summary>
-            <Dropdown
-              defaultValue={pairType}
-              help={t('Determines what cryptography will be used to create this account. Note that to validate on Polkadot, the session account must use "ed25519".')}
-              label={t('keypair crypto type')}
-              onChange={_onChangePairType}
-              options={uiSettings.availableCryptos}
-            />
-            <Input
-              className='full'
-              help={t('You can set a custom derivation path for this account using the following syntax "/<soft-key>//<hard-key>///<password>". The "/<soft-key>" and "//<hard-key>" may be repeated and mixed`. The "///password" is optional and should only occur once.')}
-              isError={!!deriveError}
-              label={t('secret derivation path')}
-              onChange={_onChangeDerive}
-              onEnter={_onCommit}
-              placeholder={t('//hard/soft///password')}
-              value={derivePath}
-            />
-            {deriveError && (
-              <article className='error'>{deriveError}</article>
-            )}
-          </details>
-        </AddressRow>
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <Button
-            icon='plus'
-            isDisabled={!isValid}
-            isPrimary
-            label={t('Save')}
-            onClick={_toggleConfirmation}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(
-  styled(Create)`
-    .accounts--Creator-advanced {
-      margin-top: 1rem;
-    }
-  `
-);

+ 0 - 60
pioneer/packages/old-apps/app-accounts/src/modals/CreateConfirmation.tsx

@@ -1,60 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import React from 'react';
-import { AddressRow, Button, Modal } from '@polkadot/react-components';
-
-import translate from '../translate';
-
-interface Props extends I18nProps {
-  address: string;
-  name: string;
-  onClose: () => void;
-  onCommit: () => void;
-}
-
-function CreateConfirmation ({ address, name, onClose, onCommit, t }: Props): React.ReactElement<Props> | null {
-  return (
-    <Modal
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>
-        {t('Important notice')}
-      </Modal.Header>
-      <Modal.Content>
-        <AddressRow
-          defaultName={name}
-          isInline
-          noDefaultNameOpacity
-          value={address}
-        >
-          <p>{t('We will provide you with a generated backup file after your account is created. As long as you have access to your account you can always download this file later by clicking on "Backup" button from the Accounts section.')}</p>
-          <p>{t('Please make sure to save this file in a secure location as it is required, together with your password, to restore your account.')}</p>
-        </AddressRow>
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <Button
-            icon='plus'
-            isPrimary
-            label={t('Create and backup account')}
-            onClick={onCommit}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(CreateConfirmation);

+ 0 - 240
pioneer/packages/old-apps/app-accounts/src/modals/Derive.tsx

@@ -1,240 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { KeyringPair } from '@polkadot/keyring/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import { I18nProps } from '@polkadot/react-components/types';
-import { KeypairType } from '@polkadot/util-crypto/types';
-
-import React, { useContext, useEffect, useState } from 'react';
-import { AddressRow, Button, Input, InputAddress, Modal, Password, StatusContext } from '@polkadot/react-components';
-import { useDebounce } from '@polkadot/react-components/hooks';
-import keyring from '@polkadot/ui-keyring';
-import { isPasswordValid, downloadAccount } from '@polkadot/joy-utils/accounts';
-import { keyExtractPath } from '@polkadot/util-crypto';
-
-import { useMyAccount } from '@polkadot/joy-utils/MyAccountContext';
-
-import translate from '../translate';
-
-import CreateConfirmation from './CreateConfirmation';
-
-interface Props extends I18nProps {
-  from: string;
-  onClose: () => void;
-}
-
-interface DerivedAddress {
-  address: string | null;
-  deriveError: string | null;
-}
-
-function deriveValidate (suri: string, pairType: KeypairType): string | null {
-  try {
-    const { path } = keyExtractPath(suri);
-
-    // we don't allow soft for ed25519
-    if (pairType === 'ed25519' && path.some(({ isSoft }): boolean => isSoft)) {
-      return 'Soft derivation paths are not allowed on ed25519';
-    }
-  } catch (error) {
-    return error.message;
-  }
-
-  return null;
-}
-
-function createAccount (source: KeyringPair, suri: string, name: string, password: string, success: string): ActionStatus {
-  // we will fill in all the details below
-  const status = { action: 'create' } as ActionStatus;
-
-  try {
-    const derived = source.derive(suri);
-
-    derived.setMeta({ ...derived.meta, name, tags: [] });
-
-    const result = keyring.addPair(derived, password || '');
-    const { address } = result.pair;
-
-    status.account = address;
-    status.status = 'success';
-    status.message = success;
-
-    downloadAccount(result);
-  } catch (error) {
-    status.status = 'error';
-    status.message = error.message;
-  }
-
-  return status;
-}
-
-function Derive ({ className, from, onClose, t }: Props): React.ReactElement {
-  const { queueAction } = useContext(StatusContext);
-  const [source] = useState(keyring.getPair(from));
-  const [{ address, deriveError }, setDerived] = useState<DerivedAddress>({ address: null, deriveError: null });
-  const [isConfirmationOpen, setIsConfirmationOpen] = useState(false);
-  const [isLocked, setIsLocked] = useState(source.isLocked);
-  const [{ isNameValid, name }, setName] = useState({ isNameValid: false, name: '' });
-  const [{ isPassValid, password }, setPassword] = useState({ isPassValid: true, password: '' });
-  const [rootPass, setRootPass] = useState('');
-  const [suri, setSuri] = useState('');
-  const debouncedSuri = useDebounce(suri);
-  const isValid = !!address && !deriveError && isNameValid && isPassValid;
-  const context = useMyAccount();
-
-  useEffect((): void => {
-    setIsLocked(source.isLocked);
-  }, [source]);
-
-  useEffect((): void => {
-    setDerived((): DerivedAddress => {
-      let address: string | null = null;
-      const deriveError = deriveValidate(debouncedSuri, source.type);
-
-      if (!deriveError) {
-        const result = source.derive(suri);
-
-        address = result.address;
-      }
-
-      return { address, deriveError };
-    });
-  }, [debouncedSuri]);
-
-  const _onChangeName = (name: string): void => setName({ isNameValid: !!name.trim(), name });
-  const _onChangePass = (password: string): void => setPassword({ isPassValid: isPasswordValid(password), password });
-  const _toggleConfirmation = (): void => setIsConfirmationOpen(!isConfirmationOpen);
-  const _onUnlock = (): void => {
-    try {
-      source.decodePkcs8(rootPass);
-    } catch (error) {
-      console.error(error);
-    }
-
-    setIsLocked(source.isLocked);
-  };
-
-  const _onCommit = (): void => {
-    if (!isValid) {
-      return;
-    }
-
-    const status = createAccount(source, suri, name, password, t('created account'));
-    context.set(status.account as string);
-
-    _toggleConfirmation();
-    queueAction(status);
-    onClose();
-  };
-
-  const sourceStatic = (
-    <InputAddress
-      help={t('The selected account to perform the derivation on.')}
-      isDisabled
-      label={t('derive root account')}
-      value={from}
-    />
-  );
-
-  return (
-    <Modal
-      className={className}
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>{t('Derive account from pair')}</Modal.Header>
-      {address && isConfirmationOpen && (
-        <CreateConfirmation
-          address={address}
-          name={name}
-          onCommit={_onCommit}
-          onClose={_toggleConfirmation}
-        />
-      )}
-      <Modal.Content>
-        {isLocked && (
-          <>
-            {sourceStatic}
-            <Password
-              autoFocus
-              help={t('The password to unlock the selected account.')}
-              label={t('password')}
-              onChange={setRootPass}
-              value={rootPass}
-            />
-          </>
-        )}
-        {!isLocked && (
-          <AddressRow
-            defaultName={name}
-            noDefaultNameOpacity
-            value={deriveError ? '' : address}
-          >
-            {sourceStatic}
-            <Input
-              autoFocus
-              help={t('You can set a custom derivation path for this account using the following syntax "/<soft-key>//<hard-key>///<password>". The "/<soft-key>" and "//<hard-key>" may be repeated and mixed`. The "///password" is optional and should only occur once.')}
-              label={t('derivation path')}
-              onChange={setSuri}
-              placeholder={t('//hard/soft')}
-            />
-            <Input
-              className='full'
-              help={t('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".')}
-              isError={!isNameValid}
-              label={t('name')}
-              onChange={_onChangeName}
-              onEnter={_onCommit}
-              placeholder={t('new account')}
-              value={name}
-            />
-            <Password
-              className='full'
-              help={t('This password is used to encrypt your private key. It must be strong and unique! You will need it to sign transactions with this account. You can recover this account using this password together with the backup file (generated in the next step).')}
-              isError={!isPassValid}
-              label={t('password')}
-              onChange={_onChangePass}
-              onEnter={_onCommit}
-              value={password}
-            />
-          </AddressRow>
-        )}
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          {isLocked
-            ? (
-              <Button
-                icon='lock'
-                isDisabled={!rootPass}
-                isPrimary
-                label={t('Unlock')}
-                onClick={_onUnlock}
-              />
-            )
-            : (
-              <Button
-                icon='plus'
-                isDisabled={!isValid}
-                isPrimary
-                label={t('Save')}
-                onClick={_toggleConfirmation}
-              />
-            )
-          }
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(Derive);

+ 0 - 180
pioneer/packages/old-apps/app-accounts/src/modals/Import.tsx

@@ -1,180 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { KeyringPair$Json } from '@polkadot/keyring/types';
-import { I18nProps } from '@polkadot/react-components/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import { ModalProps } from '../types';
-
-import React from 'react';
-import { MyAccountContext } from '@polkadot/joy-utils/MyAccountContext';
-import { isPasswordValid } from '@polkadot/joy-utils/accounts';
-import { AddressRow, Button, InputAddress, InputFile, Modal, Password, TxComponent } from '@polkadot/react-components';
-import { isHex, isObject, u8aToString } from '@polkadot/util';
-import keyring from '@polkadot/ui-keyring';
-
-import translate from '../translate';
-
-interface Props extends ModalProps, I18nProps {}
-
-interface State {
-  address: string | null;
-  isFileValid: boolean;
-  isPassValid: boolean;
-  json: KeyringPair$Json | null;
-  password: string;
-}
-
-class Import extends TxComponent<Props, State> {
-  static contextType = MyAccountContext;
-  context!: React.ContextType<typeof MyAccountContext>;
-
-  public state: State = {
-    address: null,
-    isFileValid: false,
-    isPassValid: true,
-    json: null,
-    password: ''
-  };
-
-  public render (): React.ReactNode {
-    const { onClose, t } = this.props;
-    const { isFileValid, isPassValid } = this.state;
-
-    return (
-      <Modal
-        dimmer='inverted'
-        open
-      >
-        <Modal.Header>{t('Add via backup file')}</Modal.Header>
-        {this.renderInput()}
-        <Modal.Actions>
-          <Button.Group>
-            <Button
-              icon='cancel'
-              isNegative
-              label={t('Cancel')}
-              onClick={onClose}
-            />
-            <Button.Or />
-            <Button
-              icon='sync'
-              isDisabled={!isFileValid || !isPassValid}
-              isPrimary
-              onClick={this.onSave}
-              label={t('Restore')}
-              ref={this.button}
-            />
-          </Button.Group>
-        </Modal.Actions>
-      </Modal>
-    );
-  }
-
-  private renderInput (): React.ReactNode {
-    const { t } = this.props;
-    const { address, isFileValid, isPassValid, json, password } = this.state;
-    const acceptedFormats = ['application/json', 'text/plain'].join(', ');
-
-    return (
-      <Modal.Content>
-        <AddressRow
-          defaultName={isFileValid && json ? json.meta.name : null}
-          noDefaultNameOpacity
-          value={isFileValid && address ? address : null}
-        >
-          <InputFile
-            accept={acceptedFormats}
-            className='full'
-            help={t('Select the JSON key file that was downloaded when you created the account. This JSON file contains your private key encrypted with your password.')}
-            isError={!isFileValid}
-            label={t('backup file')}
-            onChange={this.onChangeFile}
-            withLabel
-          />
-          <Password
-            autoFocus
-            className='full'
-            help={t('Type the password chosen at the account creation. It was used to encrypt your account\'s private key in the backup file.')}
-            isError={!isPassValid}
-            label={t('password')}
-            onChange={this.onChangePass}
-            onEnter={this.submit}
-            value={password}
-          />
-        </AddressRow>
-      </Modal.Content>
-    );
-  }
-
-  private onChangeFile = (file: Uint8Array): void => {
-    try {
-      const json = JSON.parse(u8aToString(file));
-      const publicKey = keyring.decodeAddress(json.address, true);
-      const address = keyring.encodeAddress(publicKey);
-      const isFileValid = publicKey.length === 32 && isHex(json.encoded) && isObject(json.meta) && (
-        Array.isArray(json.encoding.content)
-          ? json.encoding.content[0] === 'pkcs8'
-          : json.encoding.content === 'pkcs8'
-      );
-
-      this.setState({
-        address,
-        isFileValid,
-        json
-      });
-    } catch (error) {
-      this.setState({
-        address: null,
-        isFileValid: false,
-        json: null
-      });
-      console.error(error);
-    }
-  }
-
-  private onChangePass = (password: string): void => {
-    this.setState({
-      isPassValid: isPasswordValid(password),
-      password
-    });
-  }
-
-  private onSave = (): void => {
-    const { onClose, onStatusChange, t } = this.props;
-    const { json, password } = this.state;
-
-    if (!json) {
-      return;
-    }
-
-    const status: Partial<ActionStatus> = { action: 'restore' };
-
-    try {
-      const pair = keyring.restoreAccount(json, password);
-      const { address } = pair;
-
-      status.status = pair ? 'success' : 'error';
-      status.account = address;
-      status.message = t('account restored');
-
-      InputAddress.setLastValue('account', address);
-      this.context.set(address);
-    } catch (error) {
-      this.setState({ isPassValid: true });
-
-      status.status = 'error';
-      status.message = error.message;
-      console.error(error);
-    }
-
-    onStatusChange(status as ActionStatus);
-
-    if (status.status !== 'error') {
-      onClose();
-    }
-  }
-}
-
-export default translate(Import);

+ 0 - 119
pioneer/packages/old-apps/app-accounts/src/modals/Qr.tsx

@@ -1,119 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-import { ModalProps } from '../types';
-
-import React, { useState } from 'react';
-import styled from 'styled-components';
-import { AddressRow, Button, Input, InputAddress, Modal } from '@polkadot/react-components';
-import { QrScanAddress } from '@polkadot/react-qr';
-import keyring from '@polkadot/ui-keyring';
-
-import { useMyAccount } from '@polkadot/joy-utils/MyAccountContext';
-
-import translate from '../translate';
-
-interface Scanned {
-  address: string;
-  genesisHash: string;
-}
-
-interface Props extends I18nProps, ModalProps {
-  className?: string;
-}
-
-function QrModal ({ className, onClose, onStatusChange, t }: Props): React.ReactElement<Props> {
-  const [{ isNameValid, name }, setName] = useState({ isNameValid: false, name: '' });
-  const [scanned, setScanned] = useState<Scanned | null>(null);
-  const context = useMyAccount();
-
-  const _onNameChange = (name: string): void => setName({ isNameValid: !!name.trim(), name });
-
-  const _onSave = (): void => {
-    if (!scanned || !isNameValid) {
-      return;
-    }
-
-    const { address, genesisHash } = scanned;
-
-    keyring.addExternal(address, { genesisHash, name: name.trim() });
-    InputAddress.setLastValue('account', address);
-    context.set(address);
-
-    onStatusChange({
-      account: address,
-      action: 'create',
-      message: t('created account'),
-      status: 'success'
-    });
-    onClose();
-  };
-
-  return (
-    <Modal
-      className={className}
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>{t('Add account via Qr')}</Modal.Header>
-      <Modal.Content>
-        {
-          scanned
-            ? (
-              <>
-                <AddressRow
-                  defaultName={name}
-                  noDefaultNameOpacity
-                  value={scanned.address}
-                />
-                <Input
-                  autoFocus
-                  className='full'
-                  help={t('Name given to this account. You can change it at any point in the future.')}
-                  isError={!isNameValid}
-                  label={t('name')}
-                  onChange={_onNameChange}
-                  onEnter={_onSave}
-                  value={name}
-                />
-              </>
-            )
-            : (
-              <div className='qr-wrapper'>
-                <QrScanAddress onScan={setScanned} />
-              </div>
-            )
-        }
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <Button
-            icon='sign-in'
-            isDisabled={!scanned || !isNameValid}
-            isPrimary
-            onClick={_onSave}
-            label={t('Create')}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(
-  styled(QrModal)`
-    .qr-wrapper {
-      margin: 0 auto;
-      max-width: 30rem;
-    }
-  `
-);

+ 0 - 178
pioneer/packages/old-apps/app-accounts/src/modals/Transfer.tsx

@@ -1,178 +0,0 @@
-/* eslint-disable @typescript-eslint/camelcase */
-// Copyright 2017-2019 @polkadot/app-accounts 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 { SubmittableExtrinsic } from '@polkadot/api/promise/types';
-import { DerivedFees } from '@polkadot/api-derive/types';
-import { I18nProps } from '@polkadot/react-components/types';
-
-import BN from 'bn.js';
-import React, { useContext, useEffect, useState } from 'react';
-import styled from 'styled-components';
-import { Button, InputAddress, InputBalance, Modal, TxButton } from '@polkadot/react-components';
-import { Available } from '@polkadot/react-query';
-import Checks from '@polkadot/react-signer/Checks';
-import { ApiContext } from '@polkadot/react-api';
-
-import translate from '../translate';
-
-interface Props extends I18nProps {
-  balances_fees?: DerivedFees;
-  className?: string;
-  onClose: () => void;
-  recipientId?: string;
-  senderId?: string;
-}
-
-const ZERO = new BN(0);
-
-// TODO Re-enable when we have proper fee calculation (incl. weights)
-// async function calcMax (api: ApiPromise, balances_fees: DerivedFees | undefined, senderId: string, recipientId: string): Promise<BN> {
-//   let maxBalance = new BN(1);
-
-//   if (!balances_fees) {
-//     return maxBalance;
-//   }
-
-//   const { transferFee, transactionBaseFee, transactionByteFee, creationFee } = balances_fees;
-
-//   const [senderNonce, senderBalances, recipientBalances] = await Promise.all([
-//     api.query.system.accountNonce<Index>(senderId),
-//     api.derive.balances.all(senderId),
-//     api.derive.balances.all(recipientId)
-//   ]);
-
-//   let prevMax = new BN(0);
-
-//   // something goes screwy here when we move this out of the component :(
-//   let extrinsic: any;
-
-//   while (!prevMax.eq(maxBalance)) {
-//     prevMax = maxBalance;
-//     extrinsic = api.tx.balances.transfer(senderNonce, prevMax);
-
-//     const txLength = calcTxLength(extrinsic, senderNonce);
-//     const fees = transactionBaseFee
-//       .add(transactionByteFee.mul(txLength))
-//       .add(transferFee)
-//       .add(recipientBalances.availableBalance.isZero() ? creationFee : ZERO);
-
-//     maxBalance = bnMax(senderBalances.availableBalance.sub(fees), ZERO);
-//   }
-
-//   return maxBalance;
-// }
-
-function Transfer ({ className, onClose, recipientId: propRecipientId, senderId: propSenderId, t }: Props): React.ReactElement<Props> {
-  const { api } = useContext(ApiContext);
-  const [amount, setAmount] = useState<BN | undefined>(new BN(0));
-  const [extrinsic, setExtrinsic] = useState<SubmittableExtrinsic | null>(null);
-  const [hasAvailable, setHasAvailable] = useState(true);
-  const [maxBalance] = useState(new BN(0));
-  const [recipientId, setRecipientId] = useState<string | null>(propRecipientId || null);
-  const [senderId, setSenderId] = useState<string | null>(propSenderId || null);
-
-  useEffect((): void => {
-    if (senderId && recipientId) {
-      setExtrinsic(api.tx.balances.transfer(recipientId, amount || ZERO));
-
-      // We currently have not enabled the max functionality - we don't take care of weights
-      // calcMax(api, balances_fees, senderId, recipientId)
-      //   .then(([maxBalance]): void => setMaxBalance(maxBalance))
-      //   .catch((error: Error): void => console.error(error));
-    }
-  }, [amount, recipientId, senderId]);
-
-  const transferrable = <span className='label'>{t('transferrable ')}</span>;
-
-  return (
-    <Modal
-      className='app--accounts-Modal'
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>{t('Send funds')}</Modal.Header>
-      <Modal.Content>
-        <div className={className}>
-          <InputAddress
-            defaultValue={propSenderId}
-            help={t('The account you will send funds from.')}
-            isDisabled={!!propSenderId}
-            label={t('send from account')}
-            labelExtra={<Available label={transferrable} params={senderId} />}
-            onChange={setSenderId}
-            type='account'
-          />
-          <InputAddress
-            defaultValue={propRecipientId}
-            help={t('Select a contact or paste the address you want to send funds to.')}
-            isDisabled={!!propRecipientId}
-            label={t('send to address')}
-            labelExtra={<Available label={transferrable} params={recipientId} />}
-            onChange={setRecipientId}
-            type='allPlus'
-          />
-          <InputBalance
-            help={t('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.')}
-            isError={!hasAvailable}
-            label={t('amount')}
-            maxValue={maxBalance}
-            onChange={setAmount}
-            withMax
-          />
-          <Checks
-            accountId={senderId}
-            extrinsic={extrinsic}
-            isSendable
-            onChange={setHasAvailable}
-          />
-        </div>
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            label={t('Cancel')}
-            onClick={onClose}
-          />
-          <Button.Or />
-          <TxButton
-            accountId={senderId}
-            extrinsic={extrinsic}
-            icon='send'
-            isDisabled={!hasAvailable}
-            isPrimary
-            label={t('Make Transfer')}
-            onStart={onClose}
-            withSpinner={false}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(
-  styled(Transfer)`
-    article.padded {
-      box-shadow: none;
-      margin-left: 2rem;
-    }
-
-    .balance {
-      margin-bottom: 0.5rem;
-      text-align: right;
-      padding-right: 1rem;
-
-      .label {
-        opacity: 0.7;
-      }
-    }
-
-    label.with-help {
-      flex-basis: 10rem;
-    }
-  `
-);

+ 0 - 7
pioneer/packages/old-apps/app-accounts/src/translate.ts

@@ -1,7 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { withTranslation } from 'react-i18next';
-
-export default withTranslation(['app-accounts']);

+ 0 - 29
pioneer/packages/old-apps/app-accounts/src/types.ts

@@ -1,29 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 } from '@polkadot/react-components/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-
-import { WithTranslation } from 'react-i18next';
-
-export interface LocationProps {
-  location: any;
-  match: {
-    params: Record<string, string>;
-  };
-}
-
-export interface BareProps {
-  className?: string;
-  style?: Record<string, any>;
-}
-
-export type I18nProps = BareProps & WithTranslation;
-
-export type ComponentProps = AppProps & LocationProps;
-
-export interface ModalProps {
-  onClose: () => void;
-  onStatusChange: (status: ActionStatus) => void;
-}

+ 0 - 66
pioneer/packages/old-apps/app-accounts/src/vanitygen/calculate.ts

@@ -1,66 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { GeneratorCalculation, GeneratorOptions } from './types';
-
-const MAX_OFFSET = 5;
-
-function calculateAtOne (atOffset: number, test: string[], address: string): GeneratorCalculation {
-  return {
-    count: test.reduce((count, c, index): number => {
-      if (index === count) {
-        count += (c === '?' || c === address.charAt(index + atOffset)) ? 1 : 0;
-      }
-
-      return count;
-    }, 0),
-    offset: atOffset
-  };
-}
-
-function calculateAt (atOffset: number, test: string[][], address: string): GeneratorCalculation {
-  let bestCount = 0;
-  let bestOffset = 1;
-
-  for (let i = 0; i < test.length; i++) {
-    const { count, offset } = calculateAtOne(atOffset, test[i], address);
-
-    if (count > bestCount) {
-      bestCount = count;
-      bestOffset = offset;
-    }
-  }
-
-  return {
-    count: bestCount,
-    offset: bestOffset
-  };
-}
-
-export default function calculate (test: string[][], _address: string, { atOffset = -1, withCase = false }: GeneratorOptions): GeneratorCalculation {
-  const address = withCase
-    ? _address
-    : _address.toLowerCase();
-
-  if (atOffset > 0) {
-    return calculateAt(atOffset, test, address);
-  }
-
-  let bestCount = 0;
-  let bestOffset = 1;
-
-  for (let index = 0; index < MAX_OFFSET; index++) {
-    const { count, offset } = calculateAt(index, test, address);
-
-    if (count > bestCount) {
-      bestCount = count;
-      bestOffset = offset;
-    }
-  }
-
-  return {
-    count: bestCount,
-    offset: bestOffset
-  };
-}

+ 0 - 133
pioneer/packages/old-apps/app-accounts/src/vanitygen/cli.ts

@@ -1,133 +0,0 @@
-#!/usr/bin/env node
-// Copyright 2017-2019 @polkadot/app-accounts 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 { KeypairType } from '@polkadot/util-crypto/types';
-import { GeneratorOptions } from './types';
-
-import yargs from 'yargs';
-import chalk from 'chalk';
-import { u8aToHex } from '@polkadot/util';
-import { cryptoWaitReady, setSS58Format } from '@polkadot/util-crypto';
-
-import generator from '.';
-import matchRegex from './regex';
-
-interface Best {
-  address: string;
-  count: number;
-  mnemonic?: string;
-  offset: number;
-  seed?: Uint8Array;
-  withCase?: boolean;
-}
-
-const { match, mnemonic, network, type, withCase } = yargs
-  .option('match', {
-    default: 'Test',
-    type: 'string'
-  })
-  .option('mnemonic', {
-    default: false,
-    type: 'boolean'
-  })
-  .option('network', {
-    choices: ['substrate', 'polkadot', 'kusama'],
-    default: 'substrate'
-  })
-  .option('type', {
-    choices: ['ed25519', 'sr25519'],
-    default: 'sr25519'
-  })
-  .option('withCase', {
-    default: false,
-    type: 'boolean'
-  })
-  .argv;
-
-const INDICATORS = ['|', '/', '-', '\\'];
-const NUMBER_REGEX = new RegExp('(\\d+?)(?=(\\d{3})+(?!\\d)|$)', 'g');
-
-const options: GeneratorOptions = {
-  match,
-  network,
-  runs: 50,
-  type: type as KeypairType,
-  withCase,
-  withHex: !mnemonic
-};
-const startAt = Date.now();
-let best: Best = {
-  address: '',
-  count: -1,
-  offset: 65536
-};
-let total = 0;
-let indicator = -1;
-const tests = options.match.split(',');
-
-tests.forEach((test): void => {
-  if (!matchRegex.test(test)) {
-    console.error("Invalid character found in match string, allowed is '1-9' (no '0'), 'A-H, J-N & P-Z' (no 'I' or 'O'), 'a-k & m-z' (no 'l') and '?' (wildcard)");
-    process.exit(-1);
-  }
-});
-
-switch (network) {
-  case 'kusama':
-    setSS58Format(2);
-    break;
-
-  case 'polkadot':
-    setSS58Format(0);
-    break;
-
-  default:
-    setSS58Format(42);
-    break;
-}
-
-console.log(options);
-
-function showProgress (): void {
-  const elapsed = (Date.now() - startAt) / 1000;
-
-  indicator++;
-
-  if (indicator === INDICATORS.length) {
-    indicator = 0;
-  }
-
-  process.stdout.write(`\r[${INDICATORS[indicator]}] ${(total.toString().match(NUMBER_REGEX) || []).join(',')} keys in ${(elapsed).toFixed(2)}s (${(total / elapsed).toFixed(0)} keys/s)`);
-}
-
-function showBest (): void {
-  const { address, count, mnemonic, offset, seed } = best;
-
-  console.log(`\r::: ${address.slice(0, offset)}${chalk.cyan(address.slice(offset, count + offset))}${address.slice(count + offset)} <= ${u8aToHex(seed)} (count=${count}, offset=${offset})${mnemonic ? '\n                                                        ' + mnemonic : ''}`);
-}
-
-cryptoWaitReady()
-  .then((): void => {
-    while (true) {
-      const nextBest = generator(options).found.reduce((best, match): Best => {
-        if ((match.count > best.count) || ((match.count === best.count) && (match.offset <= best.offset))) {
-          return match;
-        }
-
-        return best;
-      }, best);
-
-      total += options.runs;
-
-      if (nextBest.address !== best.address) {
-        best = nextBest;
-        showBest();
-        showProgress();
-      } else if ((total % (options.withHex ? 1000 : 100)) === 0) {
-        showProgress();
-      }
-    }
-  })
-  .catch((error: Error): void => console.error(error));

+ 0 - 31
pioneer/packages/old-apps/app-accounts/src/vanitygen/generate.ts

@@ -1,31 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { GeneratorMatch, GeneratorOptions } from './types';
-
-import { encodeAddress, mnemonicGenerate, naclKeypairFromSeed, randomAsU8a, schnorrkelKeypairFromSeed, mnemonicToMiniSecret } from '@polkadot/util-crypto';
-
-import calculate from './calculate';
-
-export default function generator (test: string[][], options: GeneratorOptions): GeneratorMatch {
-  const mnemonic = options.withHex
-    ? undefined
-    : mnemonicGenerate(12);
-  const seed = mnemonic
-    ? mnemonicToMiniSecret(mnemonic)
-    : randomAsU8a();
-  const pair = options.type === 'sr25519'
-    ? schnorrkelKeypairFromSeed(seed)
-    : naclKeypairFromSeed(seed);
-  const address = encodeAddress(pair.publicKey);
-  const { count, offset } = calculate(test, address, options);
-
-  return {
-    address,
-    count,
-    mnemonic,
-    offset,
-    seed
-  };
-}

+ 0 - 23
pioneer/packages/old-apps/app-accounts/src/vanitygen/index.ts

@@ -1,23 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { GeneratorMatches, GeneratorResult, GeneratorOptions } from './types';
-
-import generate from './generate';
-
-export default function generator (options: GeneratorOptions): GeneratorResult {
-  const { match, runs = 10, withCase = false } = options;
-  const test = (withCase ? match : match.toLowerCase()).split(',').map((c): string[] => c.split(''));
-  const startAt = Date.now();
-  const found: GeneratorMatches = [];
-
-  while (found.length !== runs) {
-    found.push(generate(test, options));
-  }
-
-  return {
-    elapsed: Date.now() - startAt,
-    found
-  };
-}

+ 0 - 7
pioneer/packages/old-apps/app-accounts/src/vanitygen/regex.ts

@@ -1,7 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-const regex = new RegExp('^[1-9A-HJ-NP-Za-km-z]*$', '');
-
-export default regex;

+ 0 - 31
pioneer/packages/old-apps/app-accounts/src/vanitygen/sort.ts

@@ -1,31 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { GeneratorMatch } from './types';
-
-function numberSort (a: number, b: number): number {
-  if (a > b) {
-    return -1;
-  } else if (a < b) {
-    return 1;
-  }
-
-  return 0;
-}
-
-export default function sort (a: GeneratorMatch, b: GeneratorMatch): number {
-  const countResult = numberSort(a.count, b.count);
-
-  if (countResult !== 0) {
-    return countResult;
-  }
-
-  const positionResult = numberSort(b.offset, a.offset);
-
-  if (positionResult !== 0) {
-    return positionResult;
-  }
-
-  return a.address.localeCompare(b.address);
-}

+ 0 - 33
pioneer/packages/old-apps/app-accounts/src/vanitygen/types.d.ts

@@ -1,33 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { KeypairType } from '@polkadot/util-crypto/types';
-
-export interface GeneratorCalculation {
-  count: number;
-  offset: number;
-}
-
-export interface GeneratorMatch extends GeneratorCalculation {
-  address: string;
-  mnemonic?: string;
-  seed: Uint8Array;
-}
-
-export type GeneratorMatches = GeneratorMatch[];
-
-export interface GeneratorOptions {
-  atOffset?: number;
-  match: string;
-  network?: string;
-  runs: number;
-  type: KeypairType;
-  withCase?: boolean;
-  withHex?: boolean;
-}
-
-export interface GeneratorResult {
-  elapsed: number;
-  found: GeneratorMatches;
-}

+ 0 - 201
pioneer/packages/old-apps/app-address-book/LICENSE

@@ -1,201 +0,0 @@
-                              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.

+ 0 - 1
pioneer/packages/old-apps/app-address-book/README.md

@@ -1 +0,0 @@
-# @polkadot/app-address-book

+ 0 - 16
pioneer/packages/old-apps/app-address-book/package.json

@@ -1,16 +0,0 @@
-{
-  "name": "@polkadot/app-address-book",
-  "version": "0.37.0-beta.63",
-  "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.7.1",
-    "@polkadot/react-components": "^0.37.0-beta.63"
-  }
-}

+ 0 - 153
pioneer/packages/old-apps/app-address-book/src/Address.tsx

@@ -1,153 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { KeyringAddress } from '@polkadot/ui-keyring/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import { I18nProps } from '@polkadot/react-components/types';
-
-import React, { useEffect, useState } from 'react';
-import styled from 'styled-components';
-import { AddressCard, AddressInfo, Button, ChainLock, Forget } from '@polkadot/react-components';
-import keyring from '@polkadot/ui-keyring';
-
-import Transfer from '@polkadot/app-accounts/modals/Transfer';
-
-import translate from './translate';
-
-interface Props extends I18nProps {
-  address: string;
-  className?: string;
-}
-
-const WITH_BALANCE = { available: true, bonded: true, free: true, locked: true, reserved: true, total: true };
-const WITH_EXTENDED = { nonce: true };
-
-const isEditable = true;
-
-function Address ({ address, className, t }: Props): React.ReactElement<Props> {
-  const [current, setCurrent] = useState<KeyringAddress | null>(null);
-  const [genesisHash, setGenesisHash] = useState<string | null>(null);
-  const [isForgetOpen, setIsForgetOpen] = useState(false);
-  const [isTransferOpen, setIsTransferOpen] = useState(false);
-
-  useEffect((): void => {
-    const current = keyring.getAddress(address);
-
-    setCurrent(current || null);
-    setGenesisHash((current && current.meta.genesisHash) || null);
-  }, []);
-
-  const _toggleForget = (): void => setIsForgetOpen(!isForgetOpen);
-  const _toggleTransfer = (): void => setIsTransferOpen(!isTransferOpen);
-  const _onForget = (): void => {
-    if (address) {
-      const status: Partial<ActionStatus> = {
-        account: address,
-        action: 'forget'
-      };
-
-      try {
-        keyring.forgetAddress(address);
-        status.status = 'success';
-        status.message = t('address forgotten');
-      } catch (error) {
-        status.status = 'error';
-        status.message = error.message;
-      }
-    }
-  };
-  const _onGenesisChange = (genesisHash: string | null): void => {
-    setGenesisHash(genesisHash);
-
-    const account = keyring.getAddress(address);
-
-    account && keyring.saveAddress(address, { ...account.meta, genesisHash });
-
-    setGenesisHash(genesisHash);
-  };
-
-  return (
-    <AddressCard
-      buttons={
-        <div className='addresses--Address-buttons buttons'>
-          <div className='actions'>
-            {isEditable && (
-              <Button
-                isNegative
-                onClick={_toggleForget}
-                icon='trash'
-                key='forget'
-                size='small'
-                tooltip={t('Forget this address')}
-              />
-            )}
-            <Button
-              icon='paper plane'
-              isPrimary
-              key='deposit'
-              label={t('deposit')}
-              onClick={_toggleTransfer}
-              size='small'
-              tooltip={t('Send funds to this address')}
-            />
-          </div>
-          {isEditable && (
-            <div className='others'>
-              <ChainLock
-                genesisHash={genesisHash}
-                onChange={_onGenesisChange}
-              />
-            </div>
-          )}
-        </div>
-      }
-      className={className}
-      isEditable={isEditable}
-      type='address'
-      value={address}
-      withExplorer
-      withIndexOrAddress={false}
-      withTags
-    >
-      {address && current && (
-        <>
-          {isForgetOpen && (
-            <Forget
-              address={current.address}
-              onForget={_onForget}
-              key='modal-forget-account'
-              mode='address'
-              onClose={_toggleForget}
-            />
-          )}
-          {isTransferOpen && (
-            <Transfer
-              key='modal-transfer'
-              onClose={_toggleTransfer}
-              recipientId={address}
-            />
-          )}
-        </>
-      )}
-      <AddressInfo
-        address={address}
-        withBalance={WITH_BALANCE}
-        withExtended={WITH_EXTENDED}
-      />
-    </AddressCard>
-  );
-}
-
-export default translate(
-  styled(Address)`
-    .addresses--Address-buttons {
-      text-align: right;
-
-      .others {
-        margin-right: 0.125rem;
-        margin-top: 0.25rem;
-      }
-    }
-  `
-);

+ 0 - 61
pioneer/packages/old-apps/app-address-book/src/MemoByAccount.tsx

@@ -1,61 +0,0 @@
-import React from 'react';
-import { Form } from 'semantic-ui-react';
-import { History } from 'history';
-
-import MemoView from '@polkadot/joy-utils/memo/MemoView';
-import { RouteComponentProps } from 'react-router';
-
-type Props = RouteComponentProps & {
-  history: History;
-  match: {
-    params: {
-      accountId?: string;
-    };
-  };
-};
-
-type State = {
-  loaded: boolean;
-  accountInput?: string;
-};
-
-export default class Component extends React.PureComponent<Props, State> {
-  static getDerivedStateFromProps (props: Props, currentState: State): State | null {
-    const { match: { params: { accountId } } } = props;
-    const { loaded } = currentState;
-    // console.log('getDerivedStateFromProps', props);
-    if (!loaded && accountId) {
-      return { loaded: true, accountInput: accountId };
-    }
-    return null;
-  }
-
-  state: State = {
-    loaded: false,
-    accountInput: ''
-  };
-
-  render () {
-    const { match: { params: { accountId } } } = this.props;
-    const { accountInput } = this.state;
-    return <>
-      <Form onSubmit={this.findMemo}>
-        <Form.Input
-          value={accountInput}
-          placeholder='Key address'
-          onChange={e => this.onChangeAccount(e.target.value)}
-          action={{ icon: 'search', content: 'Find memo', onClick: this.findMemo }}
-        />
-      </Form>
-      {accountId && <MemoView accountId={accountId} preview={false} style={{ marginTop: '1rem' }} />}
-    </>;
-  }
-
-  private onChangeAccount = (accountInput: string): void => {
-    this.setState({ accountInput });
-  }
-
-  private findMemo = () => {
-    this.props.history.push('/addressbook/memo/' + this.state.accountInput);
-  }
-}

+ 0 - 70
pioneer/packages/old-apps/app-address-book/src/Overview.tsx

@@ -1,70 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-address-book 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 { I18nProps } from '@polkadot/react-components/types';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-import { ComponentProps } from './types';
-
-import React, { useState } from 'react';
-import { Link, useLocation } from 'react-router-dom';
-import { Button, CardGrid } from '@polkadot/react-components';
-import { Button as SUIButton, Icon } from 'semantic-ui-react';
-import addressObservable from '@polkadot/ui-keyring/observable/addresses';
-import { withMulti, withObservable } from '@polkadot/react-api';
-
-import CreateModal from './modals/Create';
-import Address from './Address';
-import translate from './translate';
-
-interface Props extends ComponentProps, I18nProps {
-  addresses?: SubjectInfo[];
-}
-
-function Overview ({ addresses, onStatusChange, t }: Props): React.ReactElement<Props> {
-  const { pathname } = useLocation();
-  const [isCreateOpen, setIsCreateOpen] = useState(false);
-  const emptyScreen = !isCreateOpen && (!addresses || Object.keys(addresses).length === 0);
-
-  const _toggleCreate = (): void => setIsCreateOpen(!isCreateOpen);
-
-  return (
-    <CardGrid
-      topButtons={
-        <SUIButton as={Link} to={`${pathname}/memo`}>
-          <Icon name="search" />
-          View memo
-        </SUIButton>
-      }
-      buttons={
-        <Button
-          icon='add'
-          isPrimary
-          label={t('Add contact')}
-          onClick={_toggleCreate}
-        />
-      }
-      isEmpty={emptyScreen}
-      emptyText={t('No contacts found.')}
-    >
-      {isCreateOpen && (
-        <CreateModal
-          onClose={_toggleCreate}
-          onStatusChange={onStatusChange}
-        />
-      )}
-      {addresses && Object.keys(addresses).map((address): React.ReactNode => (
-        <Address
-          address={address}
-          key={address}
-        />
-      ))}
-    </CardGrid>
-  );
-}
-
-export default withMulti(
-  Overview,
-  translate,
-  withObservable(addressObservable.subject, { propName: 'addresses' })
-);

+ 0 - 73
pioneer/packages/old-apps/app-address-book/src/index.tsx

@@ -1,73 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-address-book 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, I18nProps } from '@polkadot/react-components/types';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-import { ComponentProps } from './types';
-
-import React from 'react';
-import { Route, Switch } from 'react-router';
-import { Link } from 'react-router-dom';
-import styled from 'styled-components';
-import { Breadcrumb } from 'semantic-ui-react';
-import { HelpOverlay } from '@polkadot/react-components';
-
-import basicMd from './md/basic.md';
-import Overview from './Overview';
-import translate from './translate';
-import MemoByAccount from './MemoByAccount';
-
-interface Props extends AppProps, I18nProps {
-  allAddresses?: SubjectInfo;
-  location: any;
-}
-
-const StyledHeader = styled.header`
-  text-align: left;
-
-  .ui.breadcrumb {
-    padding: 1.4rem 0 0 .4rem;
-    font-size: 1.4rem;
-  }
-`;
-
-function AddressBookApp ({ basePath, onStatusChange }: Props): React.ReactElement<Props> {
-  const _renderComponent = (Component: React.ComponentType<ComponentProps>): () => React.ReactNode => {
-    // eslint-disable-next-line react/display-name
-    return (): React.ReactNode =>
-      <Component
-        basePath={basePath}
-        location={location}
-        onStatusChange={onStatusChange}
-      />;
-  };
-
-  const viewMemoPath = `${basePath}/memo/:accountId?`;
-
-  return (
-    <main className='address-book--App'>
-      <HelpOverlay md={basicMd} />
-      <StyledHeader>
-        <Breadcrumb>
-          <Switch>
-            <Route path={viewMemoPath}>
-              <Breadcrumb.Section link as={Link} to={basePath}>Contacts</Breadcrumb.Section>
-              <Breadcrumb.Divider icon="right angle" />
-              <Breadcrumb.Section active>View memo</Breadcrumb.Section>
-            </Route>
-            <Route>
-              <Breadcrumb.Section active>Contacts</Breadcrumb.Section>
-            </Route>
-          </Switch>
-        </Breadcrumb>
-      </StyledHeader>
-      <Switch>
-        <Route path={viewMemoPath} component={MemoByAccount} />
-        <Route render={_renderComponent(Overview)} />
-      </Switch>
-    </main>
-  );
-}
-
-export default translate(AddressBookApp);

+ 0 - 6
pioneer/packages/old-apps/app-address-book/src/md/basic.md

@@ -1,6 +0,0 @@
-# Address book
-
-You can store and get quick access to the most commonly used address, such as a friends' account.
-Any contact you create in this interface will be reflected in the application.
-
-You can edit the name of a contact by clicking on it. To remove a contact from the list, click on the trash icon to "Forget" it.

+ 0 - 135
pioneer/packages/old-apps/app-address-book/src/modals/Create.tsx

@@ -1,135 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-address-book 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 { I18nProps } from '@polkadot/react-components/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-import { ModalProps } from '../types';
-
-import React, { useState } from 'react';
-
-import { AddressRow, Button, Input, InputAddress, Modal } from '@polkadot/react-components';
-import keyring from '@polkadot/ui-keyring';
-
-import translate from '../translate';
-
-interface Props extends ModalProps, I18nProps {}
-
-function Create ({ onClose, onStatusChange, t }: Props): React.ReactElement<Props> {
-  const [{ isNameValid, name }, setName] = useState<{ isNameValid: boolean; name: string }>({ isNameValid: false, name: '' });
-  const [{ address, isAddressExisting, isAddressValid }, setAddress] = useState<{ address: string; isAddressExisting: boolean; isAddressValid: boolean }>({ address: '', isAddressExisting: false, isAddressValid: false });
-  const isValid = isAddressValid && isNameValid;
-
-  const _onChangeAddress = (input: string): void => {
-    let address = '';
-    let isAddressValid = true;
-    let isAddressExisting = false;
-
-    try {
-      address = keyring.encodeAddress(
-        keyring.decodeAddress(input)
-      );
-      isAddressValid = keyring.isAvailable(address);
-
-      if (!isAddressValid) {
-        const old = keyring.getAddress(address);
-
-        if (old) {
-          const newName = old.meta.name || name;
-
-          isAddressExisting = true;
-          isAddressValid = true;
-
-          setName({ isNameValid: !!(newName || '').trim(), name: newName });
-        }
-      }
-    } catch (error) {
-      isAddressValid = false;
-    }
-
-    setAddress({ address: address || input, isAddressExisting, isAddressValid });
-  };
-  const _onChangeName = (name: string): void => setName({ isNameValid: !!name.trim(), name });
-  const _onCommit = (): void => {
-    const status = { action: 'create' } as ActionStatus;
-
-    if (!isValid) {
-      return;
-    }
-
-    try {
-      keyring.saveAddress(address, { name: name.trim(), genesisHash: keyring.genesisHash, tags: [] });
-
-      status.account = address;
-      status.status = address ? 'success' : 'error';
-      status.message = isAddressExisting
-        ? t('address edited')
-        : t('address created');
-
-      InputAddress.setLastValue('address', address);
-    } catch (error) {
-      status.status = 'error';
-      status.message = error.message;
-    }
-
-    onStatusChange(status);
-    onClose();
-  };
-
-  return (
-    <Modal
-      dimmer='inverted'
-      open
-    >
-      <Modal.Header>{t('Add an address')}</Modal.Header>
-      <Modal.Content>
-        <AddressRow
-          defaultName={name}
-          noDefaultNameOpacity
-          value={address}
-        >
-          <Input
-            autoFocus
-            className='full'
-            help={t('Paste here the address of the contact you want to add to your address book.')}
-            isError={!isAddressValid}
-            label={t('address')}
-            onChange={_onChangeAddress}
-            onEnter={_onCommit}
-            placeholder={t('new address')}
-            value={address}
-          />
-          <Input
-            className='full'
-            help={t('Type the name of your contact. This name will be used across all the apps. It can be edited later on.')}
-            isError={!isNameValid}
-            label={t('name')}
-            onChange={_onChangeName}
-            onEnter={_onCommit}
-            value={name}
-          />
-        </AddressRow>
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            onClick={onClose}
-            label={t('Cancel')}
-          />
-          <Button.Or />
-          <Button
-            icon='save'
-            isDisabled={!isValid}
-            isPrimary
-            onClick={_onCommit}
-            label={t('Save')}
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(Create);

+ 0 - 7
pioneer/packages/old-apps/app-address-book/src/translate.ts

@@ -1,7 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-address-book 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 { withTranslation } from 'react-i18next';
-
-export default withTranslation(['app-address-book']);

+ 0 - 15
pioneer/packages/old-apps/app-address-book/src/types.ts

@@ -1,15 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-address-book 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 } from '@polkadot/react-components/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-
-export interface ComponentProps extends AppProps {
-  location: any;
-}
-
-export interface ModalProps {
-  onClose: () => void;
-  onStatusChange: (status: ActionStatus) => void;
-}

+ 0 - 201
pioneer/packages/old-apps/app-contracts/LICENSE

@@ -1,201 +0,0 @@
-                              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.

+ 0 - 3
pioneer/packages/old-apps/app-contracts/README.md

@@ -1,3 +0,0 @@
-# @polkadot/app-contracts
-
-Substrate contracts - code deployment, instance creation and messages.

+ 0 - 17
pioneer/packages/old-apps/app-contracts/package.json

@@ -1,17 +0,0 @@
-{
-  "name": "@polkadot/app-contracts",
-  "version": "0.37.0-beta.63",
-  "description": "Deployment and management of substrate contracts",
-  "main": "index.js",
-  "scripts": {},
-  "author": "Jaco Greeff <jacogr@gmail.com>",
-  "maintainers": [
-    "Jaco Greeff <jacogr@gmail.com>"
-  ],
-  "license": "Apache-2.0",
-  "dependencies": {
-    "@babel/runtime": "^7.7.1",
-    "@polkadot/api-contract": "^0.96.1",
-    "@polkadot/react-components": "^0.37.0-beta.63"
-  }
-}

+ 0 - 196
pioneer/packages/old-apps/app-contracts/src/ABI.tsx

@@ -1,196 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import React from 'react';
-import styled from 'styled-components';
-import { Abi } from '@polkadot/api-contract';
-import { InputFile, Labelled, Messages } from '@polkadot/react-components';
-import { u8aToString } from '@polkadot/util';
-
-import translate from './translate';
-
-interface Props extends I18nProps {
-  className?: string;
-  contractAbi?: Abi | null;
-  errorText?: string | null;
-  help?: React.ReactNode;
-  isError?: boolean;
-  isDisabled?: boolean;
-  isRequired?: boolean;
-  label?: React.ReactNode;
-  onChange: (json: string | null, contractAbi: Abi | null) => void;
-  onRemove?: () => void;
-  onRemoved?: () => void;
-  onSelect?: () => void;
-  onSelectConstructor?: (constructorIndex?: number) => void;
-}
-
-interface State {
-  contractAbi: Abi | null;
-  errorText: string | null;
-  isAbiValid: boolean;
-  isEmpty: boolean;
-  isError: boolean;
-}
-
-class ABI extends React.PureComponent<Props, State> {
-  public state: State = {
-    contractAbi: null,
-    errorText: null,
-    isAbiValid: false,
-    isEmpty: true,
-    isError: false
-  };
-
-  constructor (props: Props) {
-    super(props);
-
-    const { contractAbi, isError, isRequired } = this.props;
-    const isAbiValid = !!contractAbi;
-
-    this.state = {
-      contractAbi: contractAbi || null,
-      errorText: null,
-      isAbiValid,
-      isEmpty: !isAbiValid,
-      isError: isError || (isRequired && !isAbiValid) || false
-    };
-  }
-
-  public static getDerivedStateFromProps ({ contractAbi }: Props): Pick<State, never> | null {
-    if (contractAbi) {
-      return {
-        contractAbi,
-        isAbiValid: true,
-        isError: false
-      };
-    }
-    return null;
-  }
-
-  public render (): React.ReactNode {
-    const { className } = this.props;
-    const { contractAbi, isAbiValid } = this.state;
-
-    return (
-      <div className={className}>
-        {
-          (contractAbi && isAbiValid)
-            ? this.renderMessages()
-            : this.renderInputFile()
-        }
-      </div>
-    );
-  }
-
-  private renderInputFile (): React.ReactNode {
-    const { className, help, isDisabled, isRequired, label, t } = this.props;
-    const { isAbiValid, isEmpty, isError, errorText } = this.state;
-
-    return (
-      <div className={className}>
-        <InputFile
-          help={help}
-          isDisabled={isDisabled}
-          isError={!isAbiValid && (isRequired || isError)}
-          label={label}
-          onChange={this.onChange}
-          placeholder={
-            !isEmpty && !isAbiValid
-              ? (
-                <>
-                  {t('invalid ABI file selected')}
-                  {!!errorText && (
-                    <>
-                      {' — '}
-                      {t(errorText)}
-                    </>
-                  )}
-                </>
-              )
-              : t('click to select or drag and drop a JSON ABI file')
-          }
-        />
-      </div>
-    );
-  }
-
-  private renderMessages (): React.ReactNode {
-    const { help, isDisabled, label, onRemove, onSelectConstructor } = this.props;
-    const { contractAbi } = this.state;
-
-    if (!contractAbi) {
-      return null;
-    }
-
-    return (
-      <Labelled
-        label={label}
-        help={help}
-        withLabel={!!label}
-      >
-        <Messages
-          contractAbi={contractAbi}
-          onRemove={onRemove || this.onRemove}
-          isLabelled={!!label}
-          isRemovable={!isDisabled}
-          onSelectConstructor={onSelectConstructor}
-          withConstructors
-        />
-      </Labelled>
-    );
-  }
-
-  private onChange = (u8a: Uint8Array): void => {
-    const { onChange, t } = this.props;
-    const json = u8aToString(u8a);
-    try {
-      const abi = JSON.parse(json);
-
-      if (abi.deploy || abi.messages) {
-        throw new Error(t('You are using an ABI with an outdated format. Please generate a new one.'));
-      }
-
-      const contractAbi = new Abi(abi);
-
-      this.setState({
-        contractAbi,
-        isAbiValid: true,
-        isEmpty: false,
-        isError: false
-      }, (): void => onChange(json, contractAbi));
-    } catch (error) {
-      console.error(error);
-
-      this.setState({
-        isAbiValid: false,
-        isEmpty: false,
-        isError: true,
-        errorText: error
-      }, (): void => onChange(null, null));
-    }
-  }
-
-  private onRemove = (): void => {
-    const { onChange, onRemoved } = this.props;
-
-    this.setState(
-      {
-        contractAbi: null,
-        isAbiValid: false,
-        isEmpty: true
-      },
-      (): void => {
-        onChange(null, null);
-        onRemoved && onRemoved();
-      }
-    );
-  }
-}
-
-export default translate(styled(ABI as React.ComponentClass<Props, State>)`
-  min-height: 4rem;
-`);

+ 0 - 113
pioneer/packages/old-apps/app-contracts/src/Codes/Add.tsx

@@ -1,113 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 React from 'react';
-import { createType } from '@polkadot/types';
-import { Button, Input } from '@polkadot/react-components';
-
-import ContractModal, { ContractModalProps as Props, ContractModalState } from '../Modal';
-import ValidateCode from './ValidateCode';
-import store from '../store';
-import translate from '../translate';
-
-interface State extends ContractModalState {
-  codeHash: string;
-  isBusy: boolean;
-  isCodeValid: boolean;
-}
-
-class Add extends ContractModal<Props, State> {
-  constructor (props: Props) {
-    super(props);
-    this.defaultState = {
-      ...this.defaultState,
-      codeHash: '',
-      isBusy: false,
-      isCodeValid: false
-    };
-    this.state = this.defaultState;
-    this.headerText = props.t('Add an existing code hash');
-  }
-
-  protected renderContent = (): React.ReactNode => {
-    const { t } = this.props;
-    const { codeHash, isBusy, isCodeValid } = this.state;
-
-    return (
-      <>
-        <Input
-          autoFocus
-          help={t('The code hash for the on-chain deployed code.')}
-          isDisabled={isBusy}
-          isError={!isCodeValid}
-          label={t('code hash')}
-          onChange={this.onChangeHash}
-          onEnter={this.submit}
-          value={codeHash}
-        />
-        <ValidateCode
-          codeHash={codeHash}
-          onChange={this.onValidateCode}
-        />
-        {this.renderInputName()}
-        {this.renderInputAbi()}
-      </>
-    );
-  }
-
-  protected renderButtons = (): React.ReactNode => {
-    const { t } = this.props;
-    const { isBusy, isCodeValid, isNameValid } = this.state;
-    const isValid = !isBusy && isCodeValid && isNameValid;
-
-    return (
-      <Button.Group>
-        {this.renderCancelButton()}
-        <Button
-          icon='save'
-          isDisabled={!isValid}
-          isPrimary
-          label={t('Save')}
-          onClick={this.onSave}
-          ref={this.button}
-        />
-      </Button.Group>
-    );
-  }
-
-  private onChangeHash = (codeHash: string): void => {
-    this.setState({ codeHash, isCodeValid: false });
-  }
-
-  private onValidateCode = (isCodeValid: boolean): void => {
-    this.setState({ isCodeValid });
-  }
-
-  private onSave = (): void => {
-    const { abi, codeHash, name, tags } = this.state;
-
-    if (!codeHash || !name) {
-      return;
-    }
-
-    this.setState({ isBusy: true }, (): void => {
-      store
-        .saveCode(createType('Hash', codeHash), { abi, name, tags })
-        .then((): void => {
-          this.setState(
-            { isBusy: false },
-            (): void => this.onClose()
-          );
-        })
-        .catch((error): void => {
-          console.error('Unable to save code', error);
-          this.setState({ isBusy: false });
-        });
-    });
-
-    // this.redirect();
-  }
-}
-
-export default translate(Add);

+ 0 - 208
pioneer/packages/old-apps/app-contracts/src/Codes/Code.tsx

@@ -1,208 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { I18nProps } from '@polkadot/react-components/types';
-import { CodeStored } from '../types';
-
-import React from 'react';
-import styled from 'styled-components';
-import { RouteComponentProps } from 'react-router';
-import { withRouter } from 'react-router-dom';
-import { Button, Card, CodeRow, Forget } from '@polkadot/react-components';
-
-import ABI from '../ABI';
-import RemoveABI from '../RemoveABI';
-
-import contracts from '../store';
-import translate from '../translate';
-
-interface Props extends I18nProps, RouteComponentProps<{}> {
-  code: CodeStored;
-  showDeploy: (codeHash?: string, constructorIndex?: number) => () => void;
-}
-
-interface State {
-  isAbiOpen: boolean;
-  isForgetOpen: boolean;
-  isRemoveABIOpen: boolean;
-}
-
-const CodeCard = styled(Card)`
-  && {
-    max-width: 100%;
-    min-width: 100%;
-  }
-`;
-
-class Code extends React.PureComponent<Props, State> {
-  public state: State = {
-    isAbiOpen: false,
-    isForgetOpen: false,
-    isRemoveABIOpen: false
-  };
-
-  public render (): React.ReactNode {
-    const { code, code: { contractAbi }, t } = this.props;
-    const { isAbiOpen } = this.state;
-
-    const abi = (
-      <ABI
-        contractAbi={contractAbi}
-        onChange={this.onChangeABI}
-        onRemove={this.toggleRemoveABI}
-        onSelectConstructor={this.onDeployConstructor}
-      />
-    );
-
-    return (
-      <CodeCard>
-        {this.renderModals()}
-        <CodeRow
-          buttons={this.renderButtons()}
-          code={code}
-          isEditable
-          withTags
-        >
-          {contractAbi
-            ? (
-              <details
-                onClick={this.toggleAbi}
-                open={isAbiOpen}
-              >
-                <summary>{t('ABI')}</summary>
-                {abi}
-              </details>
-            )
-            : abi
-          }
-        </CodeRow>
-      </CodeCard>
-    );
-  }
-
-  private renderButtons (): React.ReactNode {
-    const { code: { json: { codeHash } }, showDeploy, t } = this.props;
-
-    return (
-      <>
-        <Button
-          isNegative
-          onClick={this.toggleForget}
-          icon='trash'
-          size='small'
-          tooltip={t('Forget this code hash')}
-        />
-        <Button
-          icon='cloud upload'
-          isPrimary
-          label={t('deploy')}
-          onClick={showDeploy(codeHash)}
-          size='small'
-          tooltip={t('Deploy this code hash as a smart contract')}
-        />
-      </>
-    );
-  }
-
-  private renderModals (): React.ReactNode {
-    const { code } = this.props;
-    const { isForgetOpen, isRemoveABIOpen } = this.state;
-
-    if (!code) {
-      return null;
-    }
-
-    const modals = [];
-
-    if (isForgetOpen) {
-      modals.push(
-        <Forget
-          code={code}
-          key='modal-forget-account'
-          mode='code'
-          onClose={this.toggleForget}
-          onForget={this.onForget}
-        />
-      );
-    }
-
-    if (isRemoveABIOpen) {
-      modals.push(
-        <RemoveABI
-          code={code}
-          key='modal-remove-abi'
-          onClose={this.toggleRemoveABI}
-          onRemove={this.onChangeABI}
-        />
-      );
-    }
-
-    return modals;
-  }
-
-  private toggleAbi = (event: React.MouseEvent): () => void => {
-    return (): void => {
-      event.preventDefault();
-      const { isAbiOpen } = this.state;
-
-      this.setState({
-        isAbiOpen: !isAbiOpen
-      });
-    };
-  }
-
-  private toggleForget = (): void => {
-    const { isForgetOpen } = this.state;
-
-    this.setState({
-      isForgetOpen: !isForgetOpen
-    });
-  }
-
-  private toggleRemoveABI = (): void => {
-    const { isRemoveABIOpen } = this.state;
-
-    this.setState({
-      isRemoveABIOpen: !isRemoveABIOpen
-    });
-  }
-
-  private onDeployConstructor = (constructorIndex = 0): void => {
-    const { code: { json: { codeHash } }, showDeploy } = this.props;
-
-    codeHash && showDeploy && showDeploy(codeHash, constructorIndex)();
-  }
-
-  private onForget = (): void => {
-    const { code: { json: { codeHash } } } = this.props;
-
-    if (!codeHash) {
-      return;
-    }
-
-    try {
-      contracts.forgetCode(codeHash);
-    } catch (error) {
-      console.error(error);
-    } finally {
-      this.toggleForget();
-    }
-  }
-
-  private onChangeABI = (abi: string | null = null): void => {
-    const { code: { json: { codeHash } } } = this.props;
-
-    this.setState(
-      { isAbiOpen: true },
-      (): void => {
-        contracts.saveCode(
-          codeHash,
-          { abi }
-        );
-      }
-    );
-  }
-}
-
-export default translate(withRouter(Code));

+ 0 - 130
pioneer/packages/old-apps/app-contracts/src/Codes/Upload.tsx

@@ -1,130 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { Hash } from '@polkadot/types/interfaces';
-import { ApiProps } from '@polkadot/react-api/types';
-
-import BN from 'bn.js';
-import React from 'react';
-import { SubmittableResult } from '@polkadot/api';
-import { withApi, withMulti } from '@polkadot/react-api';
-import { Button, InputFile, TxButton } from '@polkadot/react-components';
-import { compactAddLength } from '@polkadot/util';
-
-import ContractModal, { ContractModalProps, ContractModalState } from '../Modal';
-import store from '../store';
-import translate from '../translate';
-import { GAS_LIMIT } from '../constants';
-
-interface Props extends ContractModalProps, ApiProps {}
-
-interface State extends ContractModalState {
-  gasLimit: BN;
-  isWasmValid: boolean;
-  wasm?: Uint8Array | null;
-}
-
-class Upload extends ContractModal<Props, State> {
-  constructor (props: Props) {
-    super(props);
-
-    this.defaultState = {
-      ...this.defaultState,
-      gasLimit: new BN(GAS_LIMIT),
-      isWasmValid: false,
-      wasm: null
-    };
-    this.state = this.defaultState;
-    this.headerText = props.t('Upload WASM');
-  }
-
-  protected renderContent = (): React.ReactNode => {
-    const { t } = this.props;
-    const { isBusy, isWasmValid, wasm } = this.state;
-
-    return (
-      <>
-        {this.renderInputAccount()}
-        <InputFile
-          help={t('The compiled WASM for the contract that you wish to deploy. Each unique code blob will be attached with a code hash that can be used to create new instances.')}
-          isDisabled={isBusy}
-          isError={!isWasmValid}
-          label={t('compiled contract WASM')}
-          onChange={this.onAddWasm}
-          placeholder={
-            wasm && !isWasmValid
-              ? t('The code is not recognized as being in valid WASM format')
-              : null
-          }
-        />
-        {this.renderInputName()}
-        {this.renderInputAbi()}
-        {this.renderInputGas()}
-      </>
-    );
-  }
-
-  protected renderButtons = (): React.ReactNode => {
-    const { api, t } = this.props;
-    const { accountId, gasLimit, isBusy, isNameValid, isWasmValid, wasm } = this.state;
-    const isValid = !isBusy && accountId && isNameValid && isWasmValid && !gasLimit.isZero() && !!accountId;
-
-    return (
-      <Button.Group>
-        {this.renderCancelButton()}
-        <TxButton
-          accountId={accountId}
-          icon='upload'
-          isDisabled={!isValid}
-          isPrimary
-          label={t('Upload')}
-          onClick={this.toggleBusy(true)}
-          onSuccess={this.onSuccess}
-          onFailed={this.toggleBusy(false)}
-          params={[gasLimit, wasm]}
-          tx={api.tx.contracts ? 'contracts.putCode' : 'contract.putCode'}
-          ref={this.button}
-        />
-      </Button.Group>
-    );
-  }
-
-  private onAddWasm = (wasm: Uint8Array, name: string): void => {
-    const isWasmValid = wasm.subarray(0, 4).toString() === '0,97,115,109'; // '\0asm'
-
-    this.setState({ wasm: compactAddLength(wasm), isWasmValid });
-    this.onChangeName(name);
-  }
-
-  private onSuccess = (result: SubmittableResult): void => {
-    const { api } = this.props;
-
-    this.setState(({ abi, name, tags }): Pick<State, never> | null => {
-      const section = api.tx.contracts ? 'contracts' : 'contract';
-      const record = result.findRecord(section, 'CodeStored');
-
-      if (record) {
-        const codeHash = record.event.data[0];
-
-        if (!codeHash || !name) {
-          return null;
-        }
-
-        store.saveCode(codeHash as Hash, { abi, name, tags })
-          .then((): void => this.onClose())
-          .catch((error: any): void => {
-            console.error('Unable to save code', error);
-          });
-      }
-
-      return { isBusy: false };
-    });
-  }
-}
-
-export default withMulti(
-  Upload,
-  translate,
-  withApi
-);

+ 0 - 76
pioneer/packages/old-apps/app-contracts/src/Codes/ValidateCode.tsx

@@ -1,76 +0,0 @@
-/* eslint-disable @typescript-eslint/camelcase */
-// Copyright 2017-2019 @polkadot/app-contracts 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 { PrefabWasmModule } from '@polkadot/types/interfaces';
-import { I18nProps } from '@polkadot/react-components/types';
-import { ApiProps } from '@polkadot/react-api/types';
-
-import React from 'react';
-import { Option } from '@polkadot/types';
-import { withCalls } from '@polkadot/react-api';
-import { InfoForInput } from '@polkadot/react-components';
-import { isHex } from '@polkadot/util';
-
-import translate from '../translate';
-
-interface Props extends ApiProps, I18nProps {
-  codeHash?: string | null;
-  contracts_codeStorage?: Option<PrefabWasmModule>;
-  onChange: (isValid: boolean) => void;
-}
-
-interface State {
-  isStored: boolean;
-  isValidHex: boolean;
-  isValid: boolean;
-}
-
-class ValidateCode extends React.PureComponent<Props, State> {
-  public state: State = {
-    isStored: false,
-    isValidHex: false,
-    isValid: false
-  };
-
-  public static getDerivedStateFromProps ({ codeHash, contracts_codeStorage, onChange }: Props): State {
-    const isValidHex = !!codeHash && isHex(codeHash) && codeHash.length === 66;
-    const isStored = !!contracts_codeStorage && contracts_codeStorage.isSome;
-    const isValid = isValidHex && isStored;
-
-    // FIXME Really not convinced this is the correct place to do this type of callback?
-    onChange(isValid);
-
-    return {
-      isStored,
-      isValidHex,
-      isValid
-    };
-  }
-
-  public render (): React.ReactNode {
-    const { t } = this.props;
-    const { isValid, isValidHex } = this.state;
-
-    if (isValid || !isValidHex) {
-      return null;
-    }
-
-    return (
-      <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')
-        }
-      </InfoForInput>
-    );
-  }
-}
-
-export default translate(
-  withCalls<Props>(
-    ['query.contracts.codeStorage', { fallbacks: ['query.contract.codeStorage'], paramName: 'codeHash' }]
-  )(ValidateCode)
-);

+ 0 - 98
pioneer/packages/old-apps/app-contracts/src/Codes/index.tsx

@@ -1,98 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { I18nProps } from '@polkadot/react-components/types';
-import { ComponentProps } from '../types';
-
-import React from 'react';
-import { Button, CardGrid } from '@polkadot/react-components';
-
-import contracts from '../store';
-import translate from '../translate';
-
-import Code from './Code';
-import Upload from './Upload';
-import Add from './Add';
-
-interface Props extends ComponentProps, I18nProps {}
-
-interface State {
-  isAddOpen: boolean;
-  isUploadOpen: boolean;
-}
-
-class Codes extends React.PureComponent<Props, State> {
-  public state: State = {
-    isAddOpen: false,
-    isUploadOpen: false
-  };
-
-  public render (): React.ReactNode {
-    const { basePath, showDeploy, t } = this.props;
-    const { isAddOpen, isUploadOpen } = this.state;
-
-    return (
-      <>
-        <CardGrid
-          emptyText={t('No code hashes available')}
-          buttons={
-            <Button.Group>
-              <Button
-                icon='upload'
-                isPrimary
-                label={t('Upload WASM')}
-                onClick={this.showUpload}
-              />
-              <Button.Or />
-              <Button
-                icon='add'
-                label={t('Add an existing code hash')}
-                onClick={this.showAdd}
-              />
-            </Button.Group>
-          }
-        >
-          {contracts.getAllCode().map((code): React.ReactNode => {
-            return (
-              <Code
-                key={code.json.codeHash}
-                code={code}
-                showDeploy={showDeploy}
-              />
-            );
-          })}
-        </CardGrid>
-        <Upload
-          basePath={basePath}
-          isNew
-          onClose={this.hideUpload}
-          isOpen={isUploadOpen}
-        />
-        <Add
-          basePath={basePath}
-          onClose={this.hideAdd}
-          isOpen={isAddOpen}
-        />
-      </>
-    );
-  }
-
-  private showUpload = (): void => {
-    this.setState({ isUploadOpen: true });
-  }
-
-  private hideUpload = (): void => {
-    this.setState({ isUploadOpen: false });
-  }
-
-  private showAdd = (): void => {
-    this.setState({ isAddOpen: true });
-  }
-
-  private hideAdd = (): void => {
-    this.setState({ isAddOpen: false });
-  }
-}
-
-export default translate(Codes);

+ 0 - 135
pioneer/packages/old-apps/app-contracts/src/Contracts/Add.tsx

@@ -1,135 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ApiProps } from '@polkadot/react-api/types';
-import { I18nProps } from '@polkadot/react-components/types';
-import { ActionStatus } from '@polkadot/react-components/Status/types';
-
-import React from 'react';
-import { withApi } from '@polkadot/react-api';
-import { AddressRow, Button, Input } from '@polkadot/react-components';
-import keyring from '@polkadot/ui-keyring';
-
-import ContractModal, { ContractModalProps, ContractModalState } from '../Modal';
-import ValidateAddr from './ValidateAddr';
-
-import translate from '../translate';
-
-interface Props extends ContractModalProps, ApiProps, I18nProps {}
-
-interface State extends ContractModalState {
-  address?: string | null;
-  isAddressValid: boolean;
-}
-
-class Add extends ContractModal<Props, State> {
-  constructor (props: Props) {
-    super(props);
-    this.defaultState = {
-      ...this.defaultState,
-      address: null,
-      name: 'New Contract',
-      isAddressValid: false,
-      isNameValid: true
-    };
-    this.state = this.defaultState;
-    this.headerText = props.t('Add an existing contract');
-  }
-
-  public isContract = true;
-
-  protected renderContent = (): React.ReactNode => {
-    const { t } = this.props;
-    const { address, isAddressValid, isBusy, name } = this.state;
-
-    return (
-      <AddressRow
-        defaultName={name}
-        isValid
-        value={address || null}
-      >
-        <Input
-          autoFocus
-          help={t('The address for the deployed contract instance.')}
-          isDisabled={isBusy}
-          isError={!isAddressValid}
-          label={t('contract address')}
-          onChange={this.onChangeAddress}
-          onEnter={this.submit}
-          value={address || ''}
-        />
-        <ValidateAddr
-          address={address}
-          onChange={this.onValidateAddr}
-        />
-        {this.renderInputName()}
-        {this.renderInputAbi()}
-      </AddressRow>
-    );
-  }
-
-  protected renderButtons = (): React.ReactNode => {
-    const { t } = this.props;
-    const { isAddressValid, isAbiValid, isNameValid } = this.state;
-    const isValid = isNameValid && isAddressValid && isAbiValid;
-
-    return (
-      <Button.Group>
-        {this.renderCancelButton()}
-        <Button
-          icon='save'
-          isDisabled={!isValid}
-          isPrimary
-          label={t('Save')}
-          onClick={this.onAdd}
-          ref={this.button}
-        />
-      </Button.Group>
-    );
-  }
-
-  private onChangeAddress = (address: string): void => {
-    this.setState({ address, isAddressValid: false });
-  }
-
-  private onValidateAddr = (isAddressValid: boolean): void => {
-    this.setState({ isAddressValid });
-  }
-
-  private onAdd = (): void => {
-    const { api } = this.props;
-    const status: Partial<ActionStatus> = { action: 'create' };
-    const { address, abi, name, tags } = this.state;
-
-    if (!address || !abi || !name) {
-      return;
-    }
-
-    try {
-      const json = {
-        name,
-        tags,
-        contract: {
-          abi,
-          genesisHash: api.genesisHash.toHex()
-        }
-      };
-
-      keyring.saveContract(address, json);
-
-      status.account = address;
-      status.status = address ? 'success' : 'error';
-      status.message = 'contract added';
-
-      this.onClose();
-    } catch (error) {
-      console.error(error);
-
-      status.status = 'error';
-      status.message = error.message;
-    }
-  }
-}
-
-export default translate(withApi(Add));

+ 0 - 273
pioneer/packages/old-apps/app-contracts/src/Contracts/Call.tsx

@@ -1,273 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ContractCallOutcome } from '@polkadot/api-contract/types';
-import { ApiProps } from '@polkadot/react-api/types';
-import { BareProps, I18nProps, StringOrNull } from '@polkadot/react-components/types';
-import { ContractExecResult } from '@polkadot/types/interfaces/contracts';
-
-import BN from 'bn.js';
-import React, { useState, useEffect } from 'react';
-import styled from 'styled-components';
-import { Button, Dropdown, IconLink, InputAddress, InputBalance, InputNumber, Modal, Toggle, TxButton } from '@polkadot/react-components';
-import { PromiseContract as ApiContract } from '@polkadot/api-contract';
-import { withApi, withMulti } from '@polkadot/react-api';
-import { createValue } from '@polkadot/react-params/values';
-import { isNull } from '@polkadot/util';
-
-import Params from '../Params';
-import Outcome from './Outcome';
-
-import translate from '../translate';
-import { GAS_LIMIT } from '../constants';
-import { getCallMessageOptions } from './util';
-
-interface Props extends BareProps, I18nProps, ApiProps {
-  callContract: ApiContract | null;
-  callMessageIndex: number | null;
-  callResults: ContractExecResult[];
-  isOpen: boolean;
-  onChangeCallContractAddress: (callContractAddress: StringOrNull) => void;
-  onChangeCallMessageIndex: (callMessageIndex: number) => void;
-  onClose: () => void;
-}
-
-function Call (props: Props): React.ReactElement<Props> | null {
-  const { className, isOpen, callContract, callMessageIndex, onChangeCallContractAddress, onChangeCallMessageIndex, onClose, api, t } = props;
-
-  if (isNull(callContract) || isNull(callMessageIndex)) {
-    return null;
-  }
-
-  const hasRpc = api.rpc.contracts && api.rpc.contracts.call;
-  let callMessage = callContract.getMessage(callMessageIndex);
-
-  const [accountId, setAccountId] = useState<StringOrNull>(null);
-  const [endowment, setEndowment] = useState<BN>(new BN(0));
-  const [gasLimit, setGasLimit] = useState<BN>(new BN(GAS_LIMIT));
-  const [isBusy, setIsBusy] = useState(false);
-  const [outcomes, setOutcomes] = useState<ContractCallOutcome[]>([]);
-  const [params, setParams] = useState<any[]>(callMessage ? callMessage.def.args.map(({ type }): any => createValue({ type })) : []);
-  const [useRpc, setUseRpc] = useState(callMessage && !callMessage.def.mutates);
-
-  useEffect((): void => {
-    callMessage = callContract.getMessage(callMessageIndex);
-
-    setParams(callMessage ? callMessage.def.args.map(({ type }): any => createValue({ type })) : []);
-    if (!callMessage || callMessage.def.mutates) {
-      setUseRpc(false);
-    } else {
-      setUseRpc(true);
-    }
-  }, [callContract, callMessageIndex]);
-
-  useEffect((): void => {
-    setOutcomes([]);
-  }, [callContract]);
-
-  const _onChangeAccountId = (accountId: StringOrNull): void => setAccountId(accountId);
-
-  const _onChangeCallMessageIndexString = (callMessageIndexString: string): void => {
-    onChangeCallMessageIndex && onChangeCallMessageIndex(
-      parseInt(callMessageIndexString, 10) || 0
-    );
-  };
-
-  const _onChangeEndowment = (endowment?: BN): void => endowment && setEndowment(endowment);
-  const _onChangeGasLimit = (gasLimit?: BN): void => gasLimit && setGasLimit(gasLimit);
-
-  const _onChangeParams = (params: any[]): void => setParams(params);
-  const _toggleBusy = (): void => setIsBusy(!isBusy);
-
-  const _constructTx = (): any[] => {
-    if (!accountId || !callMessage || !callMessage.fn || !callContract || !callContract.address) {
-      return [];
-    }
-
-    return [callContract.address.toString(), endowment, gasLimit, callMessage.fn(...params)];
-  };
-
-  const _onSubmitRpc = (): void => {
-    if (!accountId) return;
-
-    callContract
-      .call('rpc', callMessage.def.name, endowment, gasLimit, ...params)
-      .send(accountId)
-      .then(
-        (outcome: ContractCallOutcome): void => {
-          setOutcomes([outcome, ...outcomes]);
-        }
-      );
-  };
-
-  const _onClearOutcomes = (): void => setOutcomes([]);
-  const _onClearOutcome = (outcomeIndex: number) => (): void => {
-    setOutcomes(outcomes.slice(0, outcomeIndex).concat(outcomes.slice(outcomeIndex + 1)));
-  };
-
-  const isEndowmentValid = true;
-  const isGasValid = !gasLimit.isZero();
-  const isValid = !!accountId && isEndowmentValid && isGasValid && callContract && callContract.address && callContract.abi;
-
-  return (
-    <Modal
-      className={[className || '', 'app--contracts-Modal'].join(' ')}
-      dimmer='inverted'
-      onClose={onClose}
-      open={isOpen}
-    >
-      <Modal.Header>
-        {t('Call a contract')}
-      </Modal.Header>
-      <Modal.Content>
-        {callContract && (
-          <div className='contracts--CallControls'>
-            <InputAddress
-              defaultValue={accountId}
-              help={t('Specify the user account to use for this contract call. And fees will be deducted from this account.')}
-              isDisabled={isBusy}
-              label={t('call from account')}
-              onChange={_onChangeAccountId}
-              type='account'
-              value={accountId}
-            />
-            <InputAddress
-              help={t('A deployed contract that has either been deployed or attached. The address and ABI are used to construct the parameters.')}
-              isDisabled={isBusy}
-              label={t('contract to use')}
-              onChange={onChangeCallContractAddress}
-              type='contract'
-              value={callContract.address.toString()}
-            />
-            {callMessageIndex !== null && (
-              <>
-                <Dropdown
-                  defaultValue={`${callMessage.index}`}
-                  help={t('The message to send to this contract. Parameters are adjusted based on the ABI provided.')}
-                  isDisabled={isBusy}
-                  isError={callMessage === null}
-                  label={t('message to send')}
-                  onChange={_onChangeCallMessageIndexString}
-                  options={getCallMessageOptions(callContract)}
-                  value={`${callMessage.index}`}
-                />
-                <Params
-                  isDisabled={isBusy}
-                  onChange={_onChangeParams}
-                  params={
-                    callMessage
-                      ? callMessage.def.args
-                      : undefined
-                  }
-                />
-              </>
-            )}
-            <InputBalance
-              help={t('The allotted value for this contract, i.e. the amount transferred to the contract as part of this call.')}
-              isDisabled={isBusy}
-              isError={!isEndowmentValid}
-              label={t('value')}
-              onChange={_onChangeEndowment}
-              value={endowment}
-            />
-            <InputNumber
-              defaultValue={gasLimit}
-              help={t('The maximum amount of gas that can be used by this call. If the code requires more, the call will fail.')}
-              isDisabled={isBusy}
-              isError={!isGasValid}
-              label={t('maximum gas allowed')}
-              onChange={_onChangeGasLimit}
-              value={gasLimit}
-            />
-          </div>
-        )}
-        {hasRpc && (
-          <Toggle
-            className='rpc-toggle'
-            isDisabled={!!callMessage && callMessage.def.mutates}
-            label={
-              useRpc
-                ? t('send as RPC call')
-                : t('send as transaction')
-            }
-            onChange={setUseRpc}
-            value={useRpc || false}
-          />
-        )}
-        <Button.Group>
-          <Button
-            icon='cancel'
-            isNegative
-            onClick={onClose}
-            label={t('Cancel')}
-          />
-          <Button.Or />
-          {useRpc
-            ? (
-              <Button
-                icon='sign-in'
-                isDisabled={!isValid}
-                isPrimary
-                label={t('Call')}
-                onClick={_onSubmitRpc}
-              />
-            )
-            : (
-              <TxButton
-                accountId={accountId}
-                icon='sign-in'
-                isDisabled={!isValid}
-                isPrimary
-                label={t('Call')}
-                onClick={_toggleBusy}
-                onFailed={_toggleBusy}
-                onSuccess={_toggleBusy}
-                params={_constructTx}
-                tx={api.tx.contracts ? 'contracts.call' : 'contract.call'}
-              />
-            )
-          }
-        </Button.Group>
-        {outcomes.length > 0 && (
-          <>
-            <h3>
-              {t('Call results')}
-              <IconLink
-                className='clear-all'
-                icon='close'
-                label={t('Clear all')}
-                onClick={_onClearOutcomes}
-              />
-            </h3>
-            <div>
-              {outcomes.map((outcome, index): React.ReactNode => (
-                <Outcome
-                  key={`outcome-${index}`}
-                  onClear={_onClearOutcome(index)}
-                  outcome={outcome}
-                />
-              ))}
-            </div>
-          </>
-        )}
-      </Modal.Content>
-    </Modal>
-  );
-}
-
-export default withMulti(
-  styled(Call)`
-    .rpc-toggle {
-      margin-top: 1rem;
-      display: flex;
-      justify-content: flex-end;
-    }
-
-    .clear-all {
-      float: right;
-    }
-  `,
-  translate,
-  withApi
-);

+ 0 - 117
pioneer/packages/old-apps/app-contracts/src/Contracts/Contract.tsx

@@ -1,117 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { I18nProps } from '@polkadot/react-components/types';
-
-import React, { useState } from 'react';
-import styled from 'styled-components';
-import { RouteComponentProps } from 'react-router';
-import { withRouter } from 'react-router-dom';
-import keyring from '@polkadot/ui-keyring';
-import { PromiseContract as ApiContract } from '@polkadot/api-contract';
-import { AddressRow, Button, Card, Forget, Messages } from '@polkadot/react-components';
-
-import translate from '../translate';
-
-interface Props extends I18nProps, RouteComponentProps {
-  basePath: string;
-  contract: ApiContract;
-  onCall: (_?: number) => () => void;
-}
-
-const ContractCard = styled(Card)`
-  && {
-    min-width: 100%;
-    max-width: 100%;
-  }
-`;
-
-function Contract (props: Props): React.ReactElement<Props> | null {
-  const { contract: { abi, address }, onCall, t } = props;
-
-  if (!address || !abi) {
-    return null;
-  }
-
-  const [isForgetOpen, setIsForgetOpen] = useState(false);
-
-  const _toggleForget = (): void => setIsForgetOpen(!isForgetOpen);
-  const _onForget = (): void => {
-    if (!address) {
-      return;
-    }
-
-    const status: Partial<ActionStatus> = {
-      account: address,
-      action: 'forget'
-    };
-
-    try {
-      keyring.forgetContract(address.toString());
-      status.status = 'success';
-      status.message = t('address forgotten');
-    } catch (error) {
-      status.status = 'error';
-      status.message = error.message;
-    }
-    _toggleForget();
-  };
-
-  return (
-    <ContractCard>
-      {
-        isForgetOpen && (
-          <Forget
-            address={address.toString()}
-            mode='contract'
-            onForget={_onForget}
-            key='modal-forget-contract'
-            onClose={_toggleForget}
-          />
-        )
-      }
-      <AddressRow
-        buttons={
-          <div className='contracts--Contract-buttons'>
-            <Button
-              icon='trash'
-              isNegative
-              onClick={_toggleForget}
-              size='small'
-              tooltip={t('Forget this contract')}
-            />
-            <Button
-              icon='play'
-              isPrimary
-              label={t('execute')}
-              onClick={onCall()}
-              size='small'
-              tooltip={t('Call a method on this contract')}
-            />
-          </div>
-        }
-        isContract
-        isEditable
-        type='contract'
-        value={address}
-        withBalance={false}
-        withNonce={false}
-        withTags
-      >
-        <details>
-          <summary>{t('Messages')}</summary>
-          <Messages
-            address={address.toString()}
-            contractAbi={abi}
-            isRemovable={false}
-            onSelect={onCall}
-          />
-        </details>
-      </AddressRow>
-    </ContractCard>
-  );
-}
-
-export default translate(withRouter(Contract));

+ 0 - 104
pioneer/packages/old-apps/app-contracts/src/Contracts/Outcome.tsx

@@ -1,104 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ContractCallOutcome } from '@polkadot/api-contract/types';
-
-import React from 'react';
-import styled from 'styled-components';
-import { AddressMini, Button, MessageSignature, Output } from '@polkadot/react-components';
-
-interface Props {
-  className?: string;
-  onClear?: () => void;
-  outcome: ContractCallOutcome;
-}
-
-function Outcome (props: Props): React.ReactElement<Props> | null {
-  const { className, onClear, outcome: { message, origin, output, params, isSuccess, time } } = props;
-  const dateTime = new Date(time);
-
-  return (
-    <div className={className}>
-      <div className='info'>
-        <AddressMini
-          className='origin'
-          value={origin}
-          withAddress={false}
-          isPadded={false}
-        />
-        <MessageSignature
-          message={message}
-          params={params}
-        />
-        <span className='date-time'>
-          {dateTime.toLocaleDateString()}
-          {' '}
-          {dateTime.toLocaleTimeString()}
-        </span>
-        <Button
-          className='icon-button clear-btn'
-          icon='close'
-          size='mini'
-          isPrimary
-          onClick={onClear}
-        />
-      </div>
-      <Output
-        isError={!isSuccess}
-        className='output'
-        value={(output || '()').toString()}
-        withCopy
-        withLabel={false}
-      />
-    </div>
-  );
-}
-
-export default styled(Outcome)`
-  & {
-    .info {
-      display: inline-flex;
-      justify-content: center;
-      align-items: center;
-      padding: 0.5rem;
-
-      & > *:not(:first-child) {
-        padding-left: 1.5rem !important;
-      }
-    }
-
-    .clear-btn {
-      opacity: 0;
-    }
-
-    .date-time {
-      color: #aaa;
-      white-space: nowrap;
-    }
-
-    .origin {
-      padding-left: 0 !important;
-
-      * {
-        margin-left: 0 !important;
-      }
-    }
-
-    .output {
-      font-family: monospace;
-      margin-left: 3.5rem;
-
-      .ui--output {
-        border-color: #aaa;
-        margin: 0;
-      }
-    }
-
-    &:hover {
-      .clear-btn {
-        opacity: 1;
-      }
-    }
-  }
-`;

+ 0 - 67
pioneer/packages/old-apps/app-contracts/src/Contracts/ValidateAddr.tsx

@@ -1,67 +0,0 @@
-/* eslint-disable @typescript-eslint/camelcase */
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ContractInfo } from '@polkadot/types/interfaces';
-import { I18nProps } from '@polkadot/react-components/types';
-import { ApiProps } from '@polkadot/react-api/types';
-
-import React, { useEffect, useState } from 'react';
-import { Option } from '@polkadot/types';
-import { withCalls } from '@polkadot/react-api';
-import { InfoForInput } from '@polkadot/react-components';
-import keyring from '@polkadot/ui-keyring';
-
-import translate from '../translate';
-
-interface Props extends ApiProps, I18nProps {
-  address?: string | null;
-  contracts_contractInfoOf?: Option<ContractInfo>;
-  onChange: (isValid: boolean) => void;
-}
-
-function ValidateAddr ({ address, contracts_contractInfoOf, onChange, t }: Props): React.ReactElement<Props> | null {
-  const [isAddress, setIsAddress] = useState(false);
-  const [isStored, setIsStored] = useState(false);
-
-  useEffect((): void => {
-    try {
-      keyring.decodeAddress(address || '');
-      setIsAddress(true);
-    } catch (error) {
-      setIsAddress(false);
-    }
-  }, [address]);
-
-  useEffect((): void => {
-    setIsStored(!!contracts_contractInfoOf && contracts_contractInfoOf.isSome);
-  }, [contracts_contractInfoOf]);
-
-  useEffect((): void => {
-    onChange(isAddress && isStored);
-  }, [isAddress, isStored]);
-
-  if (isStored || !isAddress) {
-    return null;
-  }
-
-  return (
-    <InfoForInput type='error'>
-      {
-        isAddress
-          ? t('Unable to find deployed contract code at the specified address')
-          : t('The value is not in a valid address format')
-      }
-    </InfoForInput>
-  );
-}
-
-export default translate(
-  withCalls<Props>(
-    ['query.contracts.contractInfoOf', {
-      fallbacks: ['query.contract.contractInfoOf'],
-      paramName: 'address'
-    }]
-  )(ValidateAddr)
-);

+ 0 - 133
pioneer/packages/old-apps/app-contracts/src/Contracts/index.tsx

@@ -1,133 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking 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 { ApiProps } from '@polkadot/react-api/types';
-import { I18nProps, StringOrNull } from '@polkadot/react-components/types';
-import { ComponentProps } from '../types';
-
-import React, { useState, useEffect } from 'react';
-import { PromiseContract as ApiContract } from '@polkadot/api-contract';
-import { withApi, withMulti } from '@polkadot/react-api';
-import { Button, CardGrid } from '@polkadot/react-components';
-
-import translate from '../translate';
-import Add from './Add';
-import ContractCard from './Contract';
-import Call from './Call';
-import { getContractForAddress } from './util';
-
-interface Props extends ComponentProps, I18nProps, ApiProps {}
-
-function filterContracts ({ api, accounts, contracts: keyringContracts }: Props): ApiContract[] {
-  return accounts && keyringContracts && Object.keys(keyringContracts)
-    .map((address): ApiContract | null => getContractForAddress(api, address))
-    .filter((contract: ApiContract | null): boolean => !!contract) as ApiContract[];
-}
-
-function Contracts (props: Props): React.ReactElement<Props> {
-  const { accounts, basePath, contracts: keyringContracts, hasCode, showDeploy, t } = props;
-  // const { callAddress, callMessage, isAddOpen, isCallOpen } = this.state;
-
-  const [contracts, setContracts] = useState<ApiContract[]>(filterContracts(props));
-  const [callContractIndex, setCallContractIndex] = useState<number>(0);
-  const [callMessageIndex, setCallMessageIndex] = useState<number>(0);
-  const [isAddOpen, setIsAddOpen] = useState(false);
-  const [isCallOpen, setIsCallOpen] = useState(false);
-
-  useEffect((): void => {
-    setContracts(filterContracts(props));
-  }, [accounts, keyringContracts]);
-
-  let callContract = contracts[callContractIndex] || null;
-
-  useEffect((): void => {
-    callContract = contracts[callContractIndex];
-  }, [callContractIndex]);
-
-  const _toggleAdd = (): void => setIsAddOpen(!isAddOpen);
-  const _toggleCall = (): void => setIsCallOpen(!isCallOpen);
-
-  const _onChangeCallContractAddress = (newCallContractAddress: StringOrNull): void => {
-    const index = contracts.findIndex(({ address }: ApiContract): boolean => newCallContractAddress === address.toString());
-
-    if (index > -1) {
-      index !== callContractIndex && setCallMessageIndex(0);
-      setCallContractIndex(index);
-    }
-  };
-
-  const _onChangeCallMessageIndex = (callMessageIndex: number): void => {
-    !!callContract && setCallMessageIndex(callMessageIndex);
-  };
-
-  const _onCall = (callContractIndex: number): (_?: number) => () => void => {
-    return function (callMessageIndex?: number): () => void {
-      return function (): void {
-        setCallContractIndex(callContractIndex);
-        setCallMessageIndex(callMessageIndex || 0);
-        setIsCallOpen(true);
-      };
-    };
-  };
-
-  return (
-    <>
-      <CardGrid
-        emptyText={t('No contracts available')}
-        buttons={
-          <Button.Group>
-            {hasCode && (
-              <>
-                <Button
-                  icon='cloud upload'
-                  isPrimary
-                  label={t('Deploy a code hash')}
-                  onClick={showDeploy()}
-                />
-                <Button.Or />
-              </>
-            )}
-            <Button
-              icon='add'
-              isPrimary
-              label={t('Add an existing contract')}
-              onClick={_toggleAdd}
-            />
-          </Button.Group>
-        }
-      >
-        {contracts
-          .map((contract: ApiContract, index): React.ReactNode => {
-            return (
-              <ContractCard
-                basePath={basePath}
-                contract={contract}
-                key={contract.address.toString()}
-                onCall={_onCall(index)}
-              />
-            );
-          })}
-      </CardGrid>
-      <Add
-        basePath={basePath}
-        isOpen={isAddOpen}
-        onClose={_toggleAdd}
-      />
-      <Call
-        callContract={callContract}
-        callMessageIndex={callMessageIndex}
-        isOpen={isCallOpen}
-        onChangeCallContractAddress={_onChangeCallContractAddress}
-        onChangeCallMessageIndex={_onChangeCallMessageIndex}
-        onClose={_toggleCall}
-      />
-    </>
-  );
-}
-
-export default withMulti(
-  Contracts,
-  translate,
-  withApi
-);

+ 0 - 49
pioneer/packages/old-apps/app-contracts/src/Contracts/util.tsx

@@ -1,49 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ContractABIFn, ContractABIMessage } from '@polkadot/api-contract/types';
-import { StringOrNull } from '@polkadot/react-components/types';
-
-import React from 'react';
-import { ApiPromise } from '@polkadot/api';
-import { PromiseContract as Contract } from '@polkadot/api-contract';
-import { MessageSignature } from '@polkadot/react-components';
-import { getContractAbi } from '@polkadot/react-components/util';
-
-export function findCallMethod (callContract: Contract | null, callMethodIndex = 0): ContractABIMessage | null {
-  const message = callContract && callContract.abi.abi.contract.messages[callMethodIndex];
-
-  return message || null;
-}
-
-export function getContractMethodFn (callContract: Contract | null, callMethodIndex: number | null): ContractABIFn | null {
-  const fn = callContract && callContract.abi && callMethodIndex !== null && callContract.abi.messages[callMethodIndex];
-
-  return fn || null;
-}
-
-export function getContractForAddress (api: ApiPromise, address: StringOrNull): Contract | null {
-  if (!address) {
-    return null;
-  } else {
-    const abi = getContractAbi(address);
-    return abi
-      ? new Contract(api, abi, address)
-      : null;
-  }
-}
-
-export function getCallMessageOptions (callContract: Contract | null): any[] {
-  return callContract
-    ? callContract.messages.map(({ def: message, def: { name }, index }): { key: string; text: React.ReactNode; value: string } => {
-      return {
-        key: name,
-        text: (
-          <MessageSignature message={message} />
-        ),
-        value: `${index}`
-      };
-    })
-    : [];
-}

+ 0 - 330
pioneer/packages/old-apps/app-contracts/src/Deploy.tsx

@@ -1,330 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { AccountId } from '@polkadot/types/interfaces';
-import { ApiProps } from '@polkadot/react-api/types';
-import { I18nProps } from '@polkadot/react-components/types';
-
-import BN from 'bn.js';
-import React from 'react';
-import { RouteComponentProps } from 'react-router';
-import { withRouter } from 'react-router-dom';
-import { SubmittableResult } from '@polkadot/api';
-import { Abi } from '@polkadot/api-contract';
-import { withApi, withMulti } from '@polkadot/react-api';
-import keyring from '@polkadot/ui-keyring';
-import { Button, Dropdown, InputBalance, MessageSignature, TxButton } from '@polkadot/react-components';
-import createValues from '@polkadot/react-params/values';
-
-import ContractModal, { ContractModalProps, ContractModalState } from './Modal';
-import Params from './Params';
-import store from './store';
-import translate from './translate';
-import { GAS_LIMIT } from './constants';
-
-type ConstructOptions = { key: string; text: React.ReactNode; value: string }[];
-
-interface Props extends ContractModalProps, ApiProps, I18nProps, RouteComponentProps {
-  codeHash?: string;
-  constructorIndex?: number;
-}
-
-interface State extends ContractModalState {
-  codeHash?: string;
-  constructorIndex: number;
-  constructOptions: ConstructOptions;
-  endowment: BN;
-  isHashValid: boolean;
-  params: any[];
-}
-
-class Deploy extends ContractModal<Props, State> {
-  protected headerText = 'Deploy a new contract';
-
-  public isContract = true;
-
-  constructor (props: Props) {
-    super(props);
-
-    this.defaultState = {
-      ...this.defaultState,
-      constructorIndex: -1,
-      constructOptions: [],
-      endowment: new BN(0),
-      gasLimit: new BN(GAS_LIMIT),
-      isHashValid: false,
-      params: [],
-      ...Deploy.getCodeState(props.codeHash)
-    };
-    this.state = this.defaultState;
-  }
-
-  public static getDerivedStateFromProps (props: Props, state: State): Pick<State, never> {
-    if (props.codeHash && (!state.codeHash || state.codeHash !== props.codeHash)) {
-      return Deploy.getCodeState(props.codeHash, Math.max(props.constructorIndex || 0));
-    }
-
-    return {};
-  }
-
-  private static getContractAbiState = (abi: string | null | undefined, contractAbi: Abi | null = null, constructorIndex = 0): Partial<State> => {
-    if (contractAbi) {
-      return {
-        abi,
-        constructorIndex,
-        contractAbi,
-        isAbiValid: !!contractAbi,
-        ...Deploy.getConstructorState(contractAbi, Math.max(constructorIndex, 0))
-      };
-    } else {
-      return {
-        constructorIndex: -1,
-        constructOptions: [] as ConstructOptions,
-        abi: null,
-        contractAbi: null,
-        isAbiSupplied: false,
-        isAbiValid: false,
-        ...Deploy.getConstructorState()
-      };
-    }
-  }
-
-  private static getCodeState = (codeHash: string | null = null, constructorIndex = 0): Pick<State, never> => {
-    if (codeHash) {
-      const code = store.getCode(codeHash);
-
-      if (code) {
-        const { contractAbi, json } = code;
-
-        return {
-          codeHash,
-          isAbiSupplied: !!contractAbi,
-          name: `${json.name} (instance)`,
-          isHashValid: true,
-          isNameValid: true,
-          ...Deploy.getContractAbiState(json.abi, contractAbi, Math.max(constructorIndex, 0))
-        };
-      }
-    }
-
-    return {};
-  }
-
-  private static getConstructorState = (contractAbi: Abi | null = null, ci = 0): Pick<State, never> => {
-    const constructorIndex = Math.max(ci, 0);
-    if (!contractAbi || constructorIndex < 0 || constructorIndex >= contractAbi.constructors.length) {
-      return {
-        constructorIndex: -1,
-        constructOptions: [],
-        params: []
-      };
-    }
-
-    const { abi: { contract: { constructors } } } = contractAbi;
-    const constructor = constructors[constructorIndex];
-    const constructOptions: ConstructOptions = constructors.map(
-      (constr, index) => {
-        return {
-          key: `${index}`,
-          text: (
-            <MessageSignature
-              asConstructor
-              message={constr}
-            />
-          ),
-          value: `${index}`
-        };
-      });
-
-    return {
-      constructorIndex,
-      constructOptions,
-      params: createValues(constructor.args)
-    };
-  }
-
-  protected renderContent = (): React.ReactNode => {
-    const { t } = this.props;
-    const { codeHash, constructorIndex, constructOptions, contractAbi, endowment, isAbiSupplied, isBusy, isHashValid } = this.state;
-
-    const codeOptions = store.getAllCode().map(({ json: { codeHash, name } }): { text: string; value: string } => ({
-      text: `${name} (${codeHash})`,
-      value: codeHash
-    }));
-
-    const defaultCode = codeOptions.length
-      ? codeOptions[codeOptions.length - 1].value
-      : undefined;
-
-    return (
-      <>
-        {this.renderInputAccount()}
-        <Dropdown
-          defaultValue={defaultCode}
-          help={t('The contract WASM previously deployed. Internally this is identified by the hash of the code, as either created or attached.')}
-          isDisabled={isBusy}
-          isError={!isHashValid}
-          label={t('code for this contract')}
-          onChange={this.onChangeCode}
-          options={codeOptions}
-          value={codeHash}
-        />
-        {this.renderInputName()}
-        {
-          isAbiSupplied
-            ? null
-            : this.renderInputAbi()
-        }
-        {
-          contractAbi
-            ? (
-              <Dropdown
-                help={t('The deployment constructor information for this contract, as provided by the ABI.')}
-                isDisabled={contractAbi.abi.contract.constructors.length <= 1}
-                label={t('constructor ')}
-                onChange={this.onChangeConstructorIndex}
-                options={constructOptions}
-                style={{ fontFamily: 'monospace' }}
-                value={`${constructorIndex}`}
-                withLabel
-              />
-            )
-            : null
-        }
-        <Params
-          isDisabled={isBusy}
-          onChange={this.onChangeParams}
-          onEnter={this.sendTx}
-          params={
-            contractAbi && constructorIndex >= 0
-              ? contractAbi.abi.contract.constructors[constructorIndex].args
-              : []
-          }
-        />
-        <InputBalance
-          help={t('The allotted endowment for this contract, i.e. the amount transferred to the contract upon instantiation.')}
-          isDisabled={isBusy}
-          isError={endowment.isZero()}
-          label={t('endowment')}
-          onChange={this.onChangeEndowment}
-          onEnter={this.sendTx}
-          value={endowment}
-        />
-        {this.renderInputGas()}
-      </>
-    );
-  }
-
-  protected renderButtons = (): React.ReactNode => {
-    const { api, t } = this.props;
-    const { accountId, endowment, gasLimit, isAbiValid, isHashValid, isNameValid } = this.state;
-    const isEndowValid = !endowment.isZero();
-    const isGasValid = !gasLimit.isZero();
-    const isValid = isAbiValid && isHashValid && isEndowValid && isGasValid && !!accountId && isNameValid;
-
-    return (
-      <Button.Group>
-        {this.renderCancelButton()}
-        <TxButton
-          accountId={accountId}
-          icon='cloud upload'
-          isDisabled={!isValid}
-          isPrimary
-          label={t('Deploy')}
-          onClick={this.toggleBusy(true)}
-          onFailed={this.toggleBusy(false)}
-          onSuccess={this.onSuccess}
-          params={this.constructCall}
-          tx={
-            api.tx.contracts
-              ? api.tx.contracts.instantiate
-                ? 'contracts.instantiate' // V2 (new)
-                : 'contracts.create' // V2 (old)
-              : 'contract.create' // V1
-          }
-          ref={this.button}
-        />
-      </Button.Group>
-    );
-  }
-
-  private constructCall = (): any[] => {
-    const { codeHash, constructorIndex, contractAbi, endowment, gasLimit, params } = this.state;
-
-    if (!contractAbi || constructorIndex < 0) {
-      return [];
-    }
-
-    return [endowment, gasLimit, codeHash, contractAbi.constructors[constructorIndex](...params)];
-  }
-
-  protected onAddAbi = (abi: string | null | undefined, contractAbi?: Abi | null): void => {
-    this.setState({
-      ...(Deploy.getContractAbiState(abi, contractAbi) as State)
-    });
-  }
-
-  private onChangeCode = (codeHash: string): void => {
-    this.setState(
-      Deploy.getCodeState(codeHash)
-    );
-  }
-
-  private onChangeConstructorIndex = (constructorIndexString: string): void => {
-    const { contractAbi } = this.state;
-    const constructorIndex = Math.max(0, parseInt(constructorIndexString, 10) || 0);
-
-    this.setState(
-      Deploy.getConstructorState(contractAbi, constructorIndex)
-    );
-  };
-
-  private onChangeEndowment = (endowment?: BN | null): void => {
-    this.setState({ endowment: endowment || new BN(0) });
-  }
-
-  private onChangeParams = (params: any[]): void => {
-    this.setState({ params });
-  }
-
-  private onSuccess = (result: SubmittableResult): void => {
-    const { api, history } = this.props;
-
-    const section = api.tx.contracts ? 'contracts' : 'contract';
-    const records = result.filterRecords(section, 'Instantiated');
-
-    if (records.length) {
-      // find the last EventRecord (in the case of multiple contracts deployed - we should really be
-      // more clever here to find the exact contract deployed, this works for eg. Delegator)
-      const address = records[records.length - 1].event.data[1] as unknown as AccountId;
-
-      this.setState(({ abi, name, tags }): Pick<State, never> | unknown => {
-        if (!abi || !name) {
-          return;
-        }
-
-        keyring.saveContract(address.toString(), {
-          name,
-          contract: {
-            abi,
-            genesisHash: api.genesisHash.toHex()
-          },
-          tags
-        });
-
-        history.push(this.props.basePath);
-
-        this.onClose();
-
-        return { isBusy: false };
-      });
-    }
-  }
-}
-
-export default withMulti(
-  withRouter(Deploy),
-  translate,
-  withApi
-);

+ 0 - 221
pioneer/packages/old-apps/app-contracts/src/Modal.tsx

@@ -1,221 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { I18nProps } from '@polkadot/react-components/types';
-
-import BN from 'bn.js';
-import React from 'react';
-import { Abi } from '@polkadot/api-contract';
-import { Button, Input, InputAddress, InputNumber, Modal, TxComponent } from '@polkadot/react-components';
-
-import ABI from './ABI';
-
-export interface ContractModalProps extends I18nProps {
-  basePath: string;
-  isNew?: boolean;
-  isOpen: boolean;
-  onClose?: () => void;
-}
-
-export interface ContractModalState {
-  abi?: string | null;
-  accountId?: string | null;
-  contractAbi?: Abi | null;
-  gasLimit: BN;
-  isAbiSupplied: boolean;
-  isAbiValid: boolean;
-  isBusy: boolean;
-  isNameValid: boolean;
-  name?: string | null;
-  tags: string[];
-}
-
-class ContractModal<P extends ContractModalProps, S extends ContractModalState> extends TxComponent<P, S> {
-  // horrible :(
-  protected defaultState: S = {
-    accountId: null,
-    gasLimit: new BN(0),
-    isAbiSupplied: false,
-    isAbiValid: false,
-    isBusy: false,
-    isNameValid: false,
-    name: null,
-    tags: [] as string[]
-  } as S;
-
-  public state: S = this.defaultState;
-
-  protected isContract?: boolean;
-
-  public render (): React.ReactNode {
-    const { isOpen, t } = this.props;
-
-    return (
-      <Modal
-        className='app--contracts-Modal'
-        dimmer='inverted'
-        onClose={this.onClose}
-        open={isOpen}
-      >
-        <Modal.Header>
-          {t(this.headerText)}
-        </Modal.Header>
-        <Modal.Content>
-          {this.renderContent()}
-        </Modal.Content>
-        <Modal.Actions>
-          {this.renderButtons()}
-        </Modal.Actions>
-      </Modal>
-    );
-  }
-
-  protected headerText = '';
-
-  protected renderContent: () => React.ReactNode | null = (): React.ReactNode => null;
-
-  protected renderButtons: () => React.ReactNode | null = (): React.ReactNode => null;
-
-  protected renderInputAbi (): React.ReactNode {
-    const { t } = this.props;
-    const { isBusy } = this.state;
-
-    return (
-      <ABI
-        help={t(
-          this.isContract
-            ? 'The ABI for the WASM code. Since we will be making a call into the code, the ABI is required and stored for future operations such as sending messages.'
-            : 'The ABI for the WASM code. In this step it is optional, but setting it here simplifies the setup of contract instances.'
-        )}
-        label={t(
-          this.isContract
-            ? 'contract ABI'
-            : 'contract ABI (optional)'
-        )}
-        onChange={this.onAddAbi}
-        isDisabled={isBusy}
-        isRequired={this.isContract}
-      />
-    );
-  }
-
-  protected renderInputAccount (): React.ReactNode {
-    const { t } = this.props;
-    const { accountId, isBusy } = this.state;
-
-    return (
-      <InputAddress
-        help={t('Specify the user account to use for this deployment. And fees will be deducted from this account.')}
-        isDisabled={isBusy}
-        isInput={false}
-        label={t('deployment account')}
-        onChange={this.onChangeAccount}
-        type='account'
-        value={accountId}
-      />
-    );
-  }
-
-  protected renderInputName (): React.ReactNode {
-    const { isNew, t } = this.props;
-    const { isBusy, isNameValid, name } = this.state;
-
-    return (
-      <Input
-        help={t(
-          this.isContract
-            ? 'A name for the deployed contract to help users distinguish. Only used for display purposes.'
-            : 'A name for this WASM code to help users distinguish. Only used for display purposes.'
-        )}
-        isDisabled={isBusy}
-        isError={!isNameValid}
-        label={t(
-          this.isContract
-            ? 'contract name'
-            : 'code bundle name'
-        )}
-        onChange={this.onChangeName}
-        onEnter={this[isNew ? 'sendTx' : 'submit']}
-        value={name || ''}
-      />
-    );
-  }
-
-  protected renderInputGas (): React.ReactNode {
-    const { t } = this.props;
-    const { gasLimit, isBusy } = this.state;
-    const isGasValid = !gasLimit.isZero();
-
-    return (
-      <InputNumber
-        help={t('The maximum amount of gas that can be used by this deployment, if the code requires more, the deployment will fail.')}
-        isDisabled={isBusy}
-        isError={!isGasValid}
-        label={t('maximum gas allowed')}
-        onChange={this.onChangeGas}
-        onEnter={this.sendTx}
-        value={gasLimit || ''}
-      />
-    );
-  }
-
-  protected renderCancelButton (): React.ReactNode {
-    const { t } = this.props;
-
-    return (
-      <>
-        <Button
-          icon='cancel'
-          isNegative
-          onClick={this.onClose}
-          label={t('Cancel')}
-        />
-        <Button.Or />
-      </>
-    );
-  }
-
-  protected reset = (): void => {
-    this.setState(
-      this.defaultState
-    );
-  }
-
-  protected toggleBusy = (isBusy?: boolean): () => void =>
-    (): void => {
-      this.setState((state: S): S => {
-        return {
-          isBusy: isBusy === undefined ? !state.isBusy : isBusy
-        } as unknown as S;
-      });
-    }
-
-  protected onClose = (): void => {
-    const { onClose } = this.props;
-    const { isBusy } = this.state;
-
-    onClose && onClose();
-    if (!isBusy) {
-      this.reset();
-    }
-  }
-
-  protected onAddAbi = (abi: string | null | undefined, contractAbi: Abi | null = null, isAbiSupplied = false): void => {
-    this.setState({ abi, contractAbi, isAbiSupplied, isAbiValid: !!abi });
-  }
-
-  protected onChangeAccount = (accountId: string | null): void => {
-    this.setState({ accountId });
-  }
-
-  protected onChangeName = (name: string): void => {
-    this.setState({ name, isNameValid: name.length !== 0 });
-  }
-
-  protected onChangeGas = (gasLimit: BN | undefined): void => {
-    this.setState({ gasLimit: gasLimit || new BN(0) });
-  }
-}
-
-export default ContractModal;

+ 0 - 49
pioneer/packages/old-apps/app-contracts/src/Params.tsx

@@ -1,49 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { ContractABIFnArg } from '@polkadot/api-contract/types';
-import { TypeDef } from '@polkadot/types/types';
-import { RawParams } from '@polkadot/react-params/types';
-
-import React, { useEffect, useState } from 'react';
-import UIParams from '@polkadot/react-params';
-
-interface Props {
-  isDisabled?: boolean;
-  params?: ContractABIFnArg[];
-  onChange: (values: any[]) => void;
-  onEnter?: () => void;
-}
-
-interface ParamDef {
-  name: string;
-  type: TypeDef;
-}
-
-export default function Params ({ isDisabled, onChange, onEnter, params: propParams }: Props): React.ReactElement<Props> | null {
-  const [params, setParams] = useState<ParamDef[]>([]);
-
-  useEffect((): void => {
-    if (propParams) {
-      setParams(propParams);
-    }
-  }, [propParams]);
-
-  if (!params.length) {
-    return null;
-  }
-
-  const _onChange = (values: RawParams): void => {
-    onChange(values.map(({ value }): any => value));
-  };
-
-  return (
-    <UIParams
-      isDisabled={isDisabled}
-      onChange={_onChange}
-      onEnter={onEnter}
-      params={params}
-    />
-  );
-}

+ 0 - 64
pioneer/packages/old-apps/app-contracts/src/RemoveABI.tsx

@@ -1,64 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-accounts 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 { I18nProps } from '@polkadot/react-components/types';
-import { CodeStored } from '@polkadot/app-contracts/types';
-
-import React from 'react';
-import { Button, CodeRow, Modal } from '@polkadot/react-components';
-
-import translate from './translate';
-
-interface Props extends I18nProps {
-  code: CodeStored;
-  onClose: () => void;
-  onRemove: () => void;
-}
-
-function RemoveABI ({ code, onClose, onRemove, t }: Props): React.ReactElement<Props> {
-  const _onRemove = (): void => {
-    onClose && onClose();
-    onRemove();
-  };
-  return (
-    <Modal
-      className='app--accounts-Modal'
-      dimmer='inverted'
-      onClose={onClose}
-      open
-    >
-      <Modal.Header>
-        {t('Confirm ABI removal')}
-      </Modal.Header>
-      <Modal.Content>
-        <CodeRow
-          code={code}
-          isInline
-        >
-          <p>{t('You are about to remove this code\'s ABI. Once completed, should you need to access it again, you will have to manually re-upload it.')}</p>
-          <p>{t('This operation does not impact the associated on-chain code or any of its contracts.')}</p>
-        </CodeRow>
-      </Modal.Content>
-      <Modal.Actions>
-        <Button.Group>
-          <Button
-            isNegative
-            onClick={onClose}
-            label={t('Cancel')}
-            icon='cancel'
-          />
-          <Button.Or />
-          <Button
-            isPrimary
-            onClick={_onRemove}
-            label={t('Remove')}
-            icon='trash'
-          />
-        </Button.Group>
-      </Modal.Actions>
-    </Modal>
-  );
-}
-
-export default translate(RemoveABI);

+ 0 - 10
pioneer/packages/old-apps/app-contracts/src/constants.ts

@@ -1,10 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-staking authors & contributors
-// This software may be modified and distributed under the terms
-// of the Apache-2.0 license. See the LICENSE file for details.
-
-export const ENDOWMENT = 1000;
-export const GAS_LIMIT = 500000;
-export const CONTRACT_NULL = {
-  abi: null,
-  address: null
-};

+ 0 - 152
pioneer/packages/old-apps/app-contracts/src/index.tsx

@@ -1,152 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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, I18nProps } from '@polkadot/react-components/types';
-import { TabItem } from '@polkadot/react-components/Tabs';
-import { ComponentProps } from './types';
-
-import React from 'react';
-import { Route, Switch, RouteComponentProps } from 'react-router';
-import { withRouter } from 'react-router-dom';
-import { HelpOverlay, Tabs } from '@polkadot/react-components';
-import { withMulti, withObservable } from '@polkadot/react-api';
-import keyring from '@polkadot/ui-keyring';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-
-import introMd from './md/intro.md';
-import store from './store';
-import translate from './translate';
-import Contracts from './Contracts';
-import Codes from './Codes';
-import Deploy from './Deploy';
-
-interface Props extends AppProps, I18nProps, RouteComponentProps {
-  accounts: SubjectInfo[];
-  contracts: SubjectInfo[];
-}
-
-interface State {
-  codeHash?: string;
-  constructorIndex: number;
-  hasContracts: boolean;
-  isDeployOpen: boolean;
-  updated: number;
-}
-
-class App extends React.PureComponent<Props, State> {
-  public state: State = {
-    constructorIndex: 0,
-    hasContracts: false,
-    isDeployOpen: false,
-    updated: 0
-  };
-
-  constructor (props: Props) {
-    super(props);
-
-    store.on('new-code', this.triggerUpdate);
-    store.on('removed-code', this.triggerUpdate);
-
-    // since we have a dep on the async API, we load here
-    store.loadAll().catch((): void => {
-      // noop, handled internally
-    });
-  }
-
-  public static getDerivedStateFromProps ({ contracts }: Props): Pick<State, never> {
-    const hasContracts = !!contracts && Object.keys(contracts).length >= 1;
-
-    return {
-      hasContracts
-    };
-  }
-
-  public render (): React.ReactNode {
-    const { basePath, t } = this.props;
-    const { codeHash, constructorIndex, isDeployOpen } = this.state;
-    const hidden: string[] = [];
-
-    return (
-      <main className='contracts--App'>
-        <HelpOverlay md={introMd} />
-        <header>
-          <Tabs
-            basePath={basePath}
-            hidden={hidden}
-            items={[
-              {
-                name: 'code',
-                text: 'Code'
-              },
-              {
-                isRoot: true,
-                name: 'contracts',
-                text: 'Contracts'
-              }
-            ].map((tab): TabItem => ({ ...tab, text: t(tab.text) }))
-            }
-          />
-        </header>
-        <Switch>
-          <Route path={`${basePath}/code`} render={this.renderComponent(Codes)} />
-          <Route render={this.renderComponent(Contracts)} exact />
-        </Switch>
-        <Deploy
-          basePath={basePath}
-          codeHash={codeHash}
-          constructorIndex={constructorIndex}
-          isOpen={isDeployOpen}
-          onClose={this.hideDeploy}
-        />
-      </main>
-    );
-  }
-
-  private renderComponent (Component: React.ComponentType<ComponentProps>): () => React.ReactNode {
-    return (): React.ReactNode => {
-      const { accounts, basePath, contracts, onStatusChange } = this.props;
-      const { updated } = this.state;
-
-      if (!contracts) {
-        return null;
-      }
-
-      return (
-        <Component
-          accounts={accounts}
-          basePath={basePath}
-          contracts={contracts}
-          hasCode={store.hasCode}
-          onStatusChange={onStatusChange}
-          showDeploy={this.showDeploy}
-          updated={updated}
-        />
-      );
-    };
-  }
-
-  private showDeploy = (codeHash?: string, constructorIndex = 0): () => void =>
-    (): void => {
-      this.setState({
-        codeHash: codeHash || undefined,
-        constructorIndex,
-        isDeployOpen: true
-      });
-    }
-
-  private hideDeploy = (): void => {
-    this.setState({ isDeployOpen: false });
-  }
-
-  private triggerUpdate = (): void => {
-    this.setState({ updated: Date.now() });
-  }
-}
-
-export default withMulti(
-  withRouter(App),
-  translate,
-  withObservable(keyring.accounts.subject, { propName: 'accounts' }),
-  withObservable(keyring.contracts.subject, { propName: 'contracts' })
-);

+ 0 - 17
pioneer/packages/old-apps/app-contracts/src/md/intro.md

@@ -1,17 +0,0 @@
-# contracts
-
-This contract management interface allows you to deploy WASM code for contracts, deploy contracts based on on-chain code and allows you to interact with contracts by sending messages.
-
-## warning
-
-Please be aware that this interface is very new and has not been thoroughly tested against all kinds of combinations of inputs - there are no doubt bugs lurking inside these sections. Additionally, the substrate contracts ABI is a very recent addition, and while stabilizing there may be changes and or-breakages while using this UI to interact.
-
-With all that said - if you do find issues, please log them.
-
-## basic operations
-
-The interface has 3 main areas -
-
-- **Code** This allows you to deploy WASM code on-chain or attach on-chain code into your local registry. Each code blob is identified by a unique hash, when deploying this will be saved, when attaching you would need to know the unique hash. From these bundles you can then move to the next step,
-- **Instance** This allows you to create contract instances using on-chain WASM code. Select the code to use, attach the ABI, specify the contract values and the contract can be deployed. As with the Code section, you can also attach on-chain instances when you know the address.
-- **Call** This allows you to send messages to contracts, via the address and attached ABIs.

+ 0 - 101
pioneer/packages/old-apps/app-contracts/src/store.ts

@@ -1,101 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { Hash } from '@polkadot/types/interfaces';
-import { CodeJson, CodeStored } from './types';
-
-import EventEmitter from 'eventemitter3';
-import store from 'store';
-import { Abi } from '@polkadot/api-contract';
-import { createType } from '@polkadot/types';
-import { api } from '@polkadot/react-api';
-
-const KEY_CODE = 'code:';
-
-class Store extends EventEmitter {
-  private allCode: Record<string, CodeStored> = {};
-
-  public get hasCode (): boolean {
-    return Object.keys(this.allCode).length !== 0;
-  }
-
-  public getAllCode (): CodeStored[] {
-    return Object.values(this.allCode);
-  }
-
-  public getCode (codeHash: string): CodeStored {
-    return this.allCode[codeHash];
-  }
-
-  // eslint-disable-next-line @typescript-eslint/require-await
-  public async saveCode (codeHash: string | Hash, partial: Partial<CodeJson>): Promise<void> {
-    const hex = (typeof codeHash === 'string' ? createType('Hash', codeHash) : codeHash).toHex();
-
-    const existing = this.getCode(hex);
-
-    const json = {
-      ...(existing ? existing.json : {}),
-      ...partial,
-      codeHash: hex,
-      genesisHash: api.genesisHash.toHex()
-    };
-
-    store.set(`${KEY_CODE}${json.codeHash}`, json);
-
-    this.addCode(json as CodeJson);
-  }
-
-  public forgetCode (codeHash: string): void {
-    store.remove(`${KEY_CODE}${codeHash}`);
-
-    this.removeCode(codeHash);
-  }
-
-  public async loadAll (): Promise<void> {
-    try {
-      await api.isReady;
-
-      const genesisHash = api.genesisHash.toHex();
-
-      store.each((json: CodeJson, key: string): void => {
-        if (json && json.genesisHash !== genesisHash) {
-          return;
-        }
-
-        if (key.startsWith(KEY_CODE)) {
-          this.addCode(json);
-        }
-      });
-    } catch (error) {
-      console.error('Unable to load code', error);
-    }
-  }
-
-  private addCode (json: CodeJson): void {
-    try {
-      const abi = json.abi ? JSON.parse(json.abi) : null;
-      this.allCode[json.codeHash] = {
-        json,
-        contractAbi: abi
-          ? new Abi(abi)
-          : undefined
-      };
-
-      this.emit('new-code');
-    } catch (error) {
-      console.error(error);
-    }
-  }
-
-  private removeCode (codeHash: string): void {
-    try {
-      delete this.allCode[codeHash];
-      this.emit('removed-code');
-    } catch (error) {
-      console.error(error);
-    }
-  }
-}
-
-export default new Store();

+ 0 - 7
pioneer/packages/old-apps/app-contracts/src/translate.ts

@@ -1,7 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { withTranslation } from 'react-i18next';
-
-export default withTranslation(['app-contracts']);

+ 0 - 37
pioneer/packages/old-apps/app-contracts/src/types.ts

@@ -1,37 +0,0 @@
-// Copyright 2017-2019 @polkadot/app-contracts 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 { Abi } from '@polkadot/api-contract';
-import { AppProps } from '@polkadot/react-components/types';
-import { SubjectInfo } from '@polkadot/ui-keyring/observable/types';
-
-// export interface LocationProps extends RouteComponentProps {}
-
-export interface ComponentProps extends AppProps {
-  accounts: SubjectInfo[];
-  contracts: SubjectInfo[];
-  hasCode: boolean;
-  showDeploy: (codeHash?: string, constructorIndex?: number) => () => void;
-  updated: number;
-}
-
-export interface CodeJson {
-  abi?: string | null;
-  codeHash: string;
-  name: string;
-  genesisHash: string;
-  tags: string[];
-}
-
-export interface CodeStored {
-  json: CodeJson;
-  contractAbi?: Abi;
-}
-
-export interface ContractJsonOld {
-  genesisHash: string;
-  abi: string;
-  address: string;
-  name: string;
-}

+ 0 - 201
pioneer/packages/old-apps/app-explorer/LICENSE

@@ -1,201 +0,0 @@
-                              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.

+ 0 - 1
pioneer/packages/old-apps/app-explorer/README.md

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

+ 0 - 16
pioneer/packages/old-apps/app-explorer/package.json

@@ -1,16 +0,0 @@
-{
-  "name": "@polkadot/app-explorer",
-  "version": "0.37.0-beta.63",
-  "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.7.1",
-    "@polkadot/react-components": "^0.37.0-beta.63"
-  }
-}

+ 0 - 32
pioneer/packages/old-apps/app-explorer/src/BestHash.tsx

@@ -1,32 +0,0 @@
-/* eslint-disable @typescript-eslint/camelcase */
-// Copyright 2017-2019 @polkadot/react-query 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 { Header } from '@polkadot/types/interfaces';
-import { BareProps, CallProps } from '@polkadot/react-api/types';
-
-import React from 'react';
-import { withCalls } from '@polkadot/react-api';
-
-interface Props extends BareProps, CallProps {
-  label?: string;
-  chain_subscribeNewHeads?: Header;
-}
-
-function BestHash ({ className, label = '', style, chain_subscribeNewHeads }: Props): React.ReactElement<Props> {
-  return (
-    <div
-      className={className}
-      style={style}
-    >
-      {label}{
-        chain_subscribeNewHeads
-          ? chain_subscribeNewHeads.hash.toHex()
-          : undefined
-      }
-    </div>
-  );
-}
-
-export default withCalls<Props>('rpc.chain.subscribeNewHeads')(BestHash);

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