├── .editorconfig
├── .eslintrc.js
├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── custom.md
│ └── feature_request.md
├── .gitignore
├── .idea
├── .gitignore
├── SubConnect.iml
├── modules.xml
└── vcs.xml
├── .prettierignore
├── .prettierrc.cjs
├── .yarn
├── plugins
│ └── @yarnpkg
│ │ ├── plugin-interactive-tools.cjs
│ │ └── plugin-version.cjs
└── releases
│ └── yarn-3.2.0.cjs
├── .yarnrc.yml
├── LICENSE
├── README.md
├── babel.config.cjs
├── jest.config.cjs
├── package.json
├── packages
├── sub-connect
│ ├── .skip-build
│ ├── .skip-npm
│ ├── LICENSE
│ ├── package.json
│ ├── public
│ │ ├── KoniverseLogo.svg
│ │ ├── SubConnect.png
│ │ ├── favicon.ico
│ │ ├── fonts
│ │ │ ├── Lexend-Black.ttf
│ │ │ ├── Lexend-Bold.ttf
│ │ │ ├── Lexend-ExtraBold.ttf
│ │ │ ├── Lexend-ExtraLight.ttf
│ │ │ ├── Lexend-Light.ttf
│ │ │ ├── Lexend-Medium.ttf
│ │ │ ├── Lexend-Regular.ttf
│ │ │ ├── Lexend-SemiBold.ttf
│ │ │ ├── Lexend-Thin.ttf
│ │ │ └── lexend.css
│ │ ├── icon-128.png
│ │ ├── icon-16.png
│ │ ├── icon-32.png
│ │ ├── icon-48.png
│ │ ├── icon-64.png
│ │ ├── index.html
│ │ ├── manifest.json
│ │ └── robots.txt
│ ├── src
│ │ ├── App.scss
│ │ ├── App.tsx
│ │ ├── components
│ │ │ ├── AccountList.scss
│ │ │ ├── AccountList.tsx
│ │ │ ├── Layout.scss
│ │ │ ├── Layout.tsx
│ │ │ ├── SelectWallet.scss
│ │ │ ├── SelectWallet.tsx
│ │ │ ├── SelectWalletModal.tsx
│ │ │ ├── WalletHeader.scss
│ │ │ ├── WalletHeader.tsx
│ │ │ ├── WalletMetadata.scss
│ │ │ ├── WalletMetadata.tsx
│ │ │ ├── Welcome.scss
│ │ │ └── Welcome.tsx
│ │ ├── contexts
│ │ │ └── index.tsx
│ │ ├── hooks
│ │ │ ├── useLocalStorage.ts
│ │ │ └── useMobileDetect.ts
│ │ ├── index.scss
│ │ ├── index.tsx
│ │ ├── logo.svg
│ │ ├── new-wallet-example
│ │ │ ├── ExampleWallet.svg
│ │ │ ├── README.md
│ │ │ └── newWalletExample.ts
│ │ ├── pages
│ │ │ ├── EvmWalletInfo.scss
│ │ │ ├── EvmWalletInfo.tsx
│ │ │ ├── WalletInfo.scss
│ │ │ ├── WalletInfo.tsx
│ │ │ ├── evmChains.json
│ │ │ └── methods.ts
│ │ ├── providers
│ │ │ └── WalletContextProvider.tsx
│ │ ├── reportWebVitals.ts
│ │ ├── setupTests.ts
│ │ └── utils
│ │ │ └── window.ts
│ ├── tsconfig.build.json
│ ├── tsconfig.json
│ ├── webpack.config.cjs
│ ├── webpack.shared.cjs
│ └── webpack.watch.cjs
├── wagmi-connector
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── detectOther.ts
│ │ ├── detectPackage.ts
│ │ ├── env.d.ts
│ │ ├── index.ts
│ │ └── packageInfo.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── wallet-connect
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ │ ├── detectOther.ts
│ │ ├── detectPackage.ts
│ │ ├── dotsama
│ │ │ ├── BaseDotSamaWallet.ts
│ │ │ ├── predefinedWallet
│ │ │ │ ├── FearlessWalletLogo.svg
│ │ │ │ ├── NovaWalletLogo.svg
│ │ │ │ ├── PolkadotLogo.svg
│ │ │ │ ├── SubWalletLogo.svg
│ │ │ │ ├── TalismanLogo.svg
│ │ │ │ └── index.ts
│ │ │ ├── wallets.spec.ts
│ │ │ └── wallets.ts
│ │ ├── evm
│ │ │ ├── BaseEvmWallet.ts
│ │ │ ├── evmWallets.ts
│ │ │ └── predefinedWallet
│ │ │ │ ├── MetaMaskLogo.svg
│ │ │ │ ├── NovaWalletLogo.svg
│ │ │ │ ├── SubWalletLogo.svg
│ │ │ │ └── index.ts
│ │ ├── index.ts
│ │ ├── packageInfo.ts
│ │ └── types.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
└── web3-react-subwallet-connector-v6
│ ├── LICENSE
│ ├── README.md
│ ├── package.json
│ ├── src
│ ├── declarations.ts
│ ├── detectOther.ts
│ ├── detectPackage.ts
│ ├── index.ts
│ ├── packageInfo.ts
│ └── types.ts
│ ├── tsconfig.build.json
│ └── tsconfig.json
├── rollup.config.mjs
├── scripts
├── koni-ci-build-dev.mjs
├── koni-ci-ghact-build.mjs
└── koni-dev-build-ts.mjs
├── tsconfig.base.json
├── tsconfig.build.json
├── tsconfig.eslint.json
├── tsconfig.json
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | root = true
2 | [*]
3 | indent_style=space
4 | indent_size=2
5 | tab_width=2
6 | end_of_line=lf
7 | charset=utf-8
8 | trim_trailing_whitespace=true
9 | max_line_length=120
10 | insert_final_newline=true
11 |
--------------------------------------------------------------------------------
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | // Copyright 2017-2022 @subwallet/sub-connect authors & contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | const base = require('@polkadot/dev/config/eslint.cjs');
5 |
6 | module.exports = {
7 | ...base,
8 | ignorePatterns: [
9 | ...base.ignorePatterns,
10 | "webpack.*js",
11 | "koni*.mjs",
12 | "**/build/**.*",
13 | ],
14 | parserOptions: {
15 | ...base.parserOptions,
16 | project: [
17 | './tsconfig.eslint.json'
18 | ]
19 | },
20 | rules: {
21 | ...base.rules,
22 | 'header/header': [2, 'line', [
23 | { pattern: ' Copyright 20(17|18|19|20|21|22)(-2022)? (@polkadot|@subwallet)/' },
24 | ' SPDX-License-Identifier: Apache-2.0'
25 | ], 2],
26 | // this seems very broken atm, false positives
27 | '@typescript-eslint/unbound-method': 'off',
28 | '@typescript-eslint/ban-ts-comment': 'off',
29 | 'sort-keys': 'off'
30 | }
31 | };
32 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Describe the bug**
11 | A clear and concise description of what the bug is.
12 |
13 | **To Reproduce**
14 | Steps to reproduce the behavior:
15 | 1. Go to '...'
16 | 2. Click on '....'
17 | 3. Scroll down to '....'
18 | 4. See error
19 |
20 | **Expected behavior**
21 | A clear and concise description of what you expected to happen.
22 |
23 | **Screenshots**
24 | If applicable, add screenshots to help explain your problem.
25 |
26 | **Desktop (please complete the following information):**
27 | - OS: [e.g. iOS]
28 | - Browser [e.g. chrome, safari]
29 | - Version [e.g. 22]
30 |
31 | **Smartphone (please complete the following information):**
32 | - Device: [e.g. iPhone6]
33 | - OS: [e.g. iOS8.1]
34 | - Browser [e.g. stock browser, safari]
35 | - Version [e.g. 22]
36 |
37 | **Additional context**
38 | Add any other context about the problem here.
39 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/custom.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Custom issue template
3 | about: Describe this issue template's purpose here.
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | **Is your feature request related to a problem? Please describe.**
11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12 |
13 | **Describe the solution you'd like**
14 | A clear and concise description of what you want to happen.
15 |
16 | **Describe alternatives you've considered**
17 | A clear and concise description of any alternative solutions or features you've considered.
18 |
19 | **Additional context**
20 | Add any other context or screenshots about the feature request here.
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | _book/
2 | build/
3 | build-cjs/
4 | build-esm/
5 | build-docs/
6 | coverage/
7 | docs/.vuepress/dist/
8 | docs/substrate/*.md
9 | node_modules/
10 | tmp/
11 | NOTES.md
12 | .idea
13 | .DS_Store
14 | .env.local
15 | .env.development.local
16 | .env.test.local
17 | .env.production.local
18 | .npmrc
19 | .rpt2_cache
20 | .yarn/*
21 | !.yarn/releases
22 | !.yarn/plugins
23 | .pnp.*
24 | .vscode/
25 | cc-test-reporter
26 | lerna-debug.log*
27 | npm-debug.log*
28 | package-lock.json
29 | tsconfig*buildinfo
30 | yarn-debug.log*
31 | yarn-error.log*
32 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 | # Editor-based HTTP Client requests
5 | /httpRequests/
6 |
--------------------------------------------------------------------------------
/.idea/SubConnect.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | build
2 | coverage
3 | packages
4 |
--------------------------------------------------------------------------------
/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | // Copyright 2017-2022 @polkadot/api authors & contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module.exports = require('@polkadot/dev/config/prettier.cjs');
5 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | enableImmutableInstalls: false
2 |
3 | enableProgressBars: false
4 |
5 | nodeLinker: node-modules
6 |
7 | plugins:
8 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
9 | spec: "@yarnpkg/plugin-interactive-tools"
10 | - path: .yarn/plugins/@yarnpkg/plugin-version.cjs
11 | spec: "@yarnpkg/plugin-version"
12 |
13 | yarnPath: .yarn/releases/yarn-3.2.0.cjs
14 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # SubConnect
2 |
3 | Note: We have stopped further development of this version and replaced it with a new and more complete version here: https://github.com/Koniverse/SubConnect-v2
4 |
5 | Simple DApp used to test wallets in Dotsama Ecosystem.
6 |
7 | 
8 |
9 | This repository also connect with **SubWallet EVM provider** and **MetaMask provider** with idea from [this issue](https://github.com/Koniverse/SubWallet-Extension/issues/235)
10 |
11 | ## Requirement:
12 | This project require [nodejs](https://nodejs.org/en/) and [yarn](https://classic.yarnpkg.com/lang/en/docs/install/#windows-stable) before start.
13 |
14 | ## Available Scripts
15 | In the project directory, you can start work project with these commands:
16 |
17 | ### `yarn install`
18 | Run to install project dependencies. Wait until all done before use another command.
19 |
20 | ### `yarn start`
21 | Runs the app in the development mode.\
22 | Open [http://localhost:3333](http://localhost:3333) to view it in the browser.
23 |
24 | The page will reload if you make edits.\
25 | You will also see any lint errors in the console.
26 |
27 | ### `yarn build:ui`
28 | Build package to `sub-connect` to `packages/sub-connect/build`.
29 |
30 | ### `yarn build`
31 | Build `wallet-connect`, `web3-react-subwallet-connector-v6` packages.
32 |
33 | ## Documentations:
34 | You can find more information about this project with below link:
35 | - [How to integrate SubWallet to Substrate DApp](https://github.com/Koniverse/SubConnect/wiki/How-to-integrate-SubWallet-to-Substrate-DApp)
36 | - [Integrate SubWallet with EVM DApp](https://github.com/Koniverse/SubConnect/wiki/Integrate-SubWallet-with-EVM-DApp)
37 |
--------------------------------------------------------------------------------
/babel.config.cjs:
--------------------------------------------------------------------------------
1 | // Copyright 2019-2022 @subwallet/extension authors & contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | module.exports = require('@polkadot/dev/config/babel-config-cjs.cjs');
5 |
--------------------------------------------------------------------------------
/jest.config.cjs:
--------------------------------------------------------------------------------
1 | // Copyright 2019-2022 @subwallet/extension authors & contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | const config = require('@polkadot/dev/config/jest.cjs');
5 |
6 | module.exports = {
7 | ...config,
8 | modulePathIgnorePatterns: [
9 | ...config.modulePathIgnorePatterns
10 | ],
11 | moduleNameMapper: {
12 | '@subwallet/(wallet-connect|sub-connect)/(.*)$': '/packages/$1/src/$2',
13 | },
14 | transform: {
15 | ...config.transform,
16 | ".+\\.(svg|css|styl|less|sass|scss|png|jpg|ttf|woff|woff2)$": "jest-transform-stub"
17 | },
18 | testPathIgnorePatterns: [
19 | '/node_modules/*'
20 | ],
21 | testEnvironment: 'jsdom'
22 | };
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Koni Studio",
3 | "bugs": "https://github.com/Koniverse/SubConnect/issues",
4 | "homepage": "https://github.com/Koniverse/SubConnect#readme",
5 | "license": "Apache-2.0",
6 | "packageManager": "yarn@3.2.0",
7 | "private": true,
8 | "repository": {
9 | "type": "git",
10 | "url": "https://github.com/Koniverse/SubConnect.git"
11 | },
12 | "sideEffects": false,
13 | "version": "0.2.6-beta.1",
14 | "workspaces": [
15 | "packages/*"
16 | ],
17 | "bin": {
18 | "koni-ci-build-dev": "./scripts/koni-ci-build-dev.mjs",
19 | "koni-ci-ghact-build": "./scripts/koni-ci-ghact-build.mjs",
20 | "koni-dev-build-ts": "./scripts/koni-dev-build-ts.mjs"
21 | },
22 | "scripts": {
23 | "build": "koni-dev-build-ts",
24 | "build:ui": "yarn clean && cd packages/sub-connect && yarn polkadot-exec-webpack --config webpack.config.cjs --mode production",
25 | "clean": "polkadot-dev-clean-build",
26 | "deploy:ui": "yarn build:ui && gh-pages --dist 'packages/sub-connect/build' --branch 'gh-pages'",
27 | "lint": "polkadot-dev-run-lint",
28 | "start": "yarn watch",
29 | "test": "polkadot-dev-run-test --detectOpenHandles'",
30 | "watch": "cd packages/sub-connect && yarn webpack-dev-server --config webpack.watch.cjs --mode development"
31 | },
32 | "devDependencies": {
33 | "@polkadot/dev": "^0.66.28",
34 | "gh-pages": "^4.0.0",
35 | "jest-environment-jsdom": "^28.1.0",
36 | "jest-svg-transformer": "^1.0.0",
37 | "jest-transform-stub": "^2.0.0"
38 | },
39 | "resolutions": {
40 | "@babel/runtime": "^7.16.7",
41 | "@polkadot/api": "^10.9.1",
42 | "@polkadot/types": "^10.9.1",
43 | "@polkadot/util": "^10.1.2",
44 | "@types/node": "^16.7.13",
45 | "typescript": "^4.6.4"
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/packages/sub-connect/.skip-build:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/.skip-build
--------------------------------------------------------------------------------
/packages/sub-connect/.skip-npm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/.skip-npm
--------------------------------------------------------------------------------
/packages/sub-connect/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/packages/sub-connect/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Koni Studio",
3 | "bugs": "https://github.com/Koniverse/SubConnect/issues",
4 | "homepage": "https://github.com/Koniverse/SubConnect/tree/master/packages/sub-connect#readme",
5 | "license": "Apache-2.0",
6 | "name": "@subwallet/sub-connect",
7 | "private": true,
8 | "repository": {
9 | "directory": "packages/sub-connect",
10 | "type": "git",
11 | "url": "https://github.com/Koniverse/SubConnect.git"
12 | },
13 | "sideEffects": false,
14 | "type": "commonjs",
15 | "version": "0.2.6-beta.1",
16 | "dependencies": {
17 | "@ant-design/icons": "^4.7.0",
18 | "@ethersproject/keccak256": "^5.6.1",
19 | "@subwallet/wallet-connect": "^0.2.6-beta.1",
20 | "@testing-library/jest-dom": "^5.14.1",
21 | "@testing-library/react": "^12.0.0",
22 | "@testing-library/user-event": "^13.2.1",
23 | "@types/jest": "^27.0.1",
24 | "@types/node": "^16.7.13",
25 | "@types/react": "^17.0.20",
26 | "@types/react-dom": "^17.0.9",
27 | "antd": "^4.18.6",
28 | "react": "^17.0.2",
29 | "react-dom": "^17.0.2",
30 | "react-router-dom": "^6.2.1",
31 | "react-scripts": "5.0.0",
32 | "typescript": "^4.4.2",
33 | "web-vitals": "^2.1.0",
34 | "web3": "^1.7.3"
35 | },
36 | "devDependencies": {
37 | "@polkadot/dev": "^0.66.28",
38 | "assert": "^2.0.0",
39 | "babel-loader": "^8.2.3",
40 | "browser-resolve": "^2.0.0",
41 | "buffer": "^6.0.3",
42 | "copy-webpack-plugin": "^10.2.0",
43 | "crypto-browserify": "^3.12.0",
44 | "css-loader": "^6.7.1",
45 | "eth-sig-util": "^3.0.1",
46 | "extract-loader": "^5.1.0",
47 | "file-loader": "^6.2.0",
48 | "html-loader": "^3.1.0",
49 | "html-webpack-plugin": "^5.5.0",
50 | "https-browserify": "^1.0.0",
51 | "node-sass": "^9.0.0",
52 | "os-browserify": "^0.3.0",
53 | "path-browserify": "^1.0.1",
54 | "process": "^0.11.10",
55 | "sass-loader": "^13.0.0",
56 | "stream-browserify": "^3.0.0",
57 | "stream-http": "^3.2.0",
58 | "thread-loader": "^3.0.4",
59 | "url-loader": "^4.1.1",
60 | "webpack": "^5.65.0",
61 | "webpack-cli": "^4.9.1",
62 | "webpack-dev-server": "^4.9.0"
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/packages/sub-connect/public/SubConnect.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/SubConnect.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/favicon.ico
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Black.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Black.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Bold.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-ExtraBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-ExtraBold.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-ExtraLight.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-ExtraLight.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Light.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Light.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Medium.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Regular.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-SemiBold.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/Lexend-Thin.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/fonts/Lexend-Thin.ttf
--------------------------------------------------------------------------------
/packages/sub-connect/public/fonts/lexend.css:
--------------------------------------------------------------------------------
1 | /*@font-face {*/
2 | /* font-family: 'Lexend';*/
3 | /* src: url('./Lexend-Black.ttf'); !* IE9 Compat Modes *!*/
4 | /* font-weight: 900;*/
5 | /* font-style: normal;*/
6 | /*}*/
7 |
8 | /*@font-face {*/
9 | /* font-family: 'Lexend';*/
10 | /* src: url('./Lexend-ExtraBold.ttf'); !* IE9 Compat Modes *!*/
11 | /* font-weight: 800;*/
12 | /* font-style: normal;*/
13 | /*}*/
14 |
15 | @font-face {
16 | font-family: 'Lexend';
17 | src: url('./Lexend-SemiBold.ttf'); /* IE9 Compat Modes */
18 | font-weight: 700;
19 | font-style: normal;
20 | }
21 |
22 | @font-face {
23 | font-family: 'Lexend';
24 | src: url('./Lexend-Medium.ttf'); /* IE9 Compat Modes */
25 | font-weight: 600;
26 | font-style: normal;
27 | }
28 |
29 | @font-face {
30 | font-family: 'Lexend';
31 | src: url('./Lexend-Regular.ttf'); /* IE9 Compat Modes */
32 | font-weight: 500;
33 | font-style: normal;
34 | }
35 |
36 | @font-face {
37 | font-family: 'Lexend';
38 | src: url('./Lexend-Light.ttf'); /* IE9 Compat Modes */
39 | font-weight: 400;
40 | font-style: normal;
41 | }
42 |
43 | /*@font-face {*/
44 | /* font-family: 'Lexend';*/
45 | /* src: url('./Lexend-Light.ttf'); !* IE9 Compat Modes *!*/
46 | /* font-weight: 300;*/
47 | /* font-style: normal;*/
48 | /*}*/
49 |
50 | /*@font-face {*/
51 | /* font-family: 'Lexend';*/
52 | /* src: url('./Lexend-ExtraLight.ttf'); !* IE9 Compat Modes *!*/
53 | /* font-weight: 200;*/
54 | /* font-style: normal;*/
55 | /*}*/
56 |
57 | /*@font-face {*/
58 | /* font-family: 'Lexend';*/
59 | /* src: url('./Lexend-Thin.ttf'); !* IE9 Compat Modes *!*/
60 | /* font-weight: 100;*/
61 | /* font-style: normal;*/
62 | /*}*/
63 |
--------------------------------------------------------------------------------
/packages/sub-connect/public/icon-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/icon-128.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/icon-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/icon-16.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/icon-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/icon-32.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/icon-48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/icon-48.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/icon-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Koniverse/SubConnect/d8a53ce483204a0bb6bfc3d62c92625b49867a63/packages/sub-connect/public/icon-64.png
--------------------------------------------------------------------------------
/packages/sub-connect/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
13 |
14 |
18 |
19 | SubWallet Connect
20 |
21 |
22 |
23 |
24 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/packages/sub-connect/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "SubWallet Connect",
3 | "name": "SubWallet Connect Examples",
4 | "icons": [
5 | {
6 | "src": "favicon.ico",
7 | "sizes": "64x64 32x32 24x24 16x16",
8 | "type": "image/x-icon"
9 | },
10 | {
11 | "src": "icon-32.png",
12 | "type": "image/png",
13 | "sizes": "32x32"
14 | },
15 | {
16 | "src": "icon-64.png",
17 | "type": "image/png",
18 | "sizes": "64x64"
19 | },
20 | {
21 | "src": "icon-128.png",
22 | "type": "image/png",
23 | "sizes": "128x128"
24 | }
25 | ],
26 | "start_url": ".",
27 | "display": "standalone",
28 | "theme_color": "#000000",
29 | "background_color": "#ffffff"
30 | }
31 |
--------------------------------------------------------------------------------
/packages/sub-connect/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/packages/sub-connect/src/App.scss:
--------------------------------------------------------------------------------
1 | .App {
2 | height: 100vh;
3 | }
4 |
5 | .main-layout {
6 | height: 100%;
7 | }
8 |
9 | .main-content {
10 | height: 100%;
11 | position: relative;
12 | overflow: auto;
13 | }
14 |
15 | .main-content.-dark {
16 | background-color: #020412;
17 | color: #fff;
18 |
19 | .ant-input {
20 | background-color: #262C4A;
21 | border-color: rgba(128, 128, 128, 0.2);
22 | color: #ddd;
23 | }
24 |
25 | }
26 |
27 | .dark-theme {
28 | .ant-select .ant-select-selector, .ant-select:not(.ant-select-customize-input) .ant-select-selector {
29 | background-color: #262C4A;
30 | border-color: rgba(128, 128, 128, 0.2)!important;
31 | color: #ddd;
32 | }
33 |
34 | .ant-select-dropdown {
35 | background-color: #262C4A;
36 | color: #fff;
37 | border-color: rgba(128, 128, 128, 0.2);
38 |
39 | .ant-select-item {
40 | color: #fff;
41 | background-color: #262C4A;
42 |
43 | &.ant-select-item-option-selected, &:hover {
44 | background-color: rgba(128,128,128,0.2);
45 | }
46 | }
47 | }
48 |
49 | .ant-select-arrow {
50 | color: #ddd;
51 | }
52 | }
53 |
54 | .main-content.-light {
55 | background-color: #FFF;
56 | color: #444;
57 |
58 | .welcome-content__text, .wallet-title, .wallet-info-page__text, .account-item__title, .metadata-item__title {
59 | color: #020412;
60 | }
61 |
62 | .account-item__content, .metadata-item__content {
63 | color: #888;
64 | }
65 |
66 | .select-wallet-modal .ant-modal-content {
67 | background-color: #FFF;
68 | }
69 |
70 | .account-item, .metadata-item, .wallet-header-wrapper {
71 | border-color: #EEE;
72 | }
73 |
74 | .sub-wallet-sign-btn {
75 | background-color: #F0F4FF;
76 | }
77 |
78 | .sub-wallet-sign-btn > span {
79 | color: #004BFF;
80 | }
81 | }
82 |
83 | .boxed-container {
84 | padding-left: 16px;
85 | padding-right: 16px;
86 | margin-left: auto;
87 | margin-right: auto;
88 | overflow: auto;
89 | max-width: 618px;
90 | }
91 |
92 | .select-wallet-modal.-light {
93 | .ant-modal-content, .ant-modal-header {
94 | background-color: #FFF;
95 | }
96 |
97 | .ant-modal-header {
98 | border-bottom-color: #EEE;
99 | }
100 |
101 | .ant-modal-title, .ant-modal-close, .wallet-title {
102 | color: #020412;
103 | }
104 |
105 | .wallet-item {
106 | border-color: #EEE;
107 | }
108 |
109 | .wallet-item:hover {
110 | background-color: #EEE;
111 | }
112 |
113 | }
--------------------------------------------------------------------------------
/packages/sub-connect/src/App.tsx:
--------------------------------------------------------------------------------
1 | // Copyright 2019-2022 @subwallet/sub-connect authors & contributors
2 | // SPDX-License-Identifier: Apache-2.0
3 |
4 | import EvmWalletInfo from '@subwallet/sub-connect/pages/EvmWalletInfo';
5 | import { WalletContextProvider } from '@subwallet/sub-connect/providers/WalletContextProvider';
6 | import React from 'react';
7 | import { HashRouter, Route, Routes } from 'react-router-dom';
8 |
9 | import Layout from './components/Layout';
10 | import Welcome from './components/Welcome';
11 | import WalletInfo from './pages/WalletInfo';
12 |
13 | require('./App.scss');
14 |
15 | // Add new example wallet
16 | // doAddWallet();
17 |
18 | export function App () {
19 | return (
20 |
21 |
22 |
23 | }
25 | path='/'
26 | >
27 | }
29 | index
30 | />
31 | }
33 | path='/welcome'
34 | />
35 | }
37 | path='/wallet-info'
38 | />
39 | }
41 | path='/evm-wallet-info'
42 | />
43 |
44 |
45 |
46 |
47 | );
48 | }
49 |
--------------------------------------------------------------------------------
/packages/sub-connect/src/components/AccountList.scss:
--------------------------------------------------------------------------------
1 | .account-list {
2 | position: relative;
3 | }
4 |
5 | .account-item {
6 | padding: 16px 20px;
7 | border: 2px solid #151A30;
8 | border-radius: 8px;
9 | margin-bottom: 16px;
10 |
11 | .info {
12 | margin-bottom: 16px;
13 | }
14 | }
15 |
16 | .account-item-info {
17 | display: flex;
18 | flex-wrap: wrap;
19 | }
20 |
21 | .account-item__title {
22 | font-size: 15px;
23 | line-height: 26px;
24 | font-weight: 500;
25 | padding-right: 5px;
26 | }
27 |
28 | .account-item__content {
29 |
30 | font-size: 15px;
31 | line-height: 26px;
32 | color: #7B8098;
33 | text-overflow: ellipsis;
34 | overflow: hidden;
35 | }
--------------------------------------------------------------------------------
/packages/sub-connect/src/components/AccountList.tsx:
--------------------------------------------------------------------------------
1 | /* eslint-disable @typescript-eslint/no-floating-promises */
2 | // Copyright 2019-2022 @subwallet/sub-connect authors & contributors
3 | // SPDX-License-Identifier: Apache-2.0
4 |
5 | // eslint-disable-next-line header/header
6 | import { EditOutlined } from '@ant-design/icons';
7 | import { Button, message } from 'antd';
8 | import React, { useCallback, useContext } from 'react';
9 |
10 | import { WalletContext } from '../contexts';
11 |
12 | require('./AccountList.scss');
13 |
14 | function AccountList (): React.ReactElement {
15 | const walletContext = useContext(WalletContext);
16 |
17 | const signDummy = useCallback(
18 | (address: string) => {
19 | const signer = walletContext.wallet?.signer;
20 |
21 | if (signer && signer.signRaw) {
22 | const signPromise = signer.signRaw({ address, data: 'This is dummy message', type: 'bytes' });
23 | const key = 'sign-status';
24 |
25 | message.loading({ content: 'Signing', key });
26 | signPromise.then((rs: any) => {
27 | message.success({ content: 'Sign Successfully!', key });
28 | }).catch((error) => {
29 | console.error(error);
30 | message.warn({ content: 'Sign Failed or Cancelled!', key });
31 | });
32 | }
33 | },
34 | [walletContext.wallet?.signer]
35 | );
36 |
37 | const onSignClicked = useCallback(
38 | (address: string) => {
39 | return () => {
40 | signDummy(address);
41 | };
42 | },
43 | [signDummy]
44 | );
45 |
46 | return (