Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ecf6482d2 | ||
|
|
5d2444c232 | ||
|
|
14d661a42c | ||
|
|
253c17a24b | ||
|
|
6a804535e6 | ||
|
|
e0d75e1237 | ||
|
|
57d9576790 | ||
|
|
72e31ec8da | ||
|
|
6bcc9de004 | ||
|
|
e141b02e00 | ||
|
|
65320a36d1 | ||
|
|
6b5b09464c | ||
|
|
2f0f56ea70 | ||
|
|
a307306cf6 | ||
|
|
88f51bd262 | ||
|
|
eb14742dfc | ||
|
|
de51c90a23 | ||
|
|
9f2bfabaac | ||
|
|
0ecb8093a5 | ||
|
|
2f8276b04c | ||
|
|
1752b051cd | ||
|
|
4d73b5e9c2 | ||
|
|
fda1826308 | ||
|
|
c66e4a3bf4 | ||
|
|
9adae7c2bf | ||
|
|
4f20237240 | ||
|
|
a7a3a559ea | ||
|
|
a7228422e4 | ||
|
|
6a13c62eab | ||
|
|
874a7f17ff | ||
|
|
b008094f30 | ||
|
|
5396b8f73f | ||
|
|
96b0470ee7 | ||
|
|
0a5bea1d4a | ||
|
|
573f92f00d | ||
|
|
d0bac4cfb1 | ||
|
|
e00e1b8d6d | ||
|
|
9705f1de4a | ||
|
|
bd849e317a | ||
|
|
69754474f2 | ||
|
|
994fdeed5d | ||
|
|
e1b7f8cdcd | ||
|
|
0b2e8e1bbe | ||
|
|
951a745d0f | ||
|
|
c9afdacb89 | ||
|
|
f909cf9bbf | ||
|
|
a1ea61688e | ||
|
|
a3b0e3607f | ||
|
|
c802f71617 | ||
|
|
525ace3f52 | ||
|
|
42f1b3a6c3 | ||
|
|
5ce56670d1 | ||
|
|
414392e69b | ||
|
|
ae5b64a75f | ||
|
|
f2077dcab2 | ||
|
|
75d03bb15a | ||
|
|
269ec7adb7 | ||
|
|
03e6974c25 | ||
|
|
a31c524878 | ||
|
|
a057f0c279 | ||
|
|
06dcc3bc5b | ||
|
|
fc3df455ef | ||
|
|
121715231d | ||
|
|
a35c1f98e8 | ||
|
|
fbaf440766 | ||
|
|
813c589752 | ||
|
|
806ae4fe42 | ||
|
|
75507c5fa7 | ||
|
|
d1c265130e | ||
|
|
0eb4663442 | ||
|
|
9e134ff95e | ||
|
|
c09d58bba1 | ||
|
|
fdc2b5011b | ||
|
|
420ad06a7e | ||
|
|
28988479c5 | ||
|
|
700b04e2ec | ||
|
|
b092fe8c6d | ||
|
|
b25f6e46d8 | ||
|
|
62e934dba7 | ||
|
|
cb073d755d | ||
|
|
c9cd6898fe | ||
|
|
106f2aac72 | ||
|
|
16dbecf0d2 | ||
|
|
dc023fe2c6 | ||
|
|
6c2d03a6c5 | ||
|
|
e4787f1b25 | ||
|
|
779fedd4ae | ||
|
|
08d71f0675 | ||
|
|
e598c7bb42 | ||
|
|
fb360420e5 | ||
|
|
2184bb5adc | ||
|
|
854e812ef3 | ||
|
|
cc17aa3fc3 | ||
|
|
d57a700d40 | ||
|
|
37c398b1a7 | ||
|
|
2f27f2bac9 | ||
|
|
090218d0b9 | ||
|
|
4799a69823 | ||
|
|
6548982bb5 | ||
|
|
d1fe833d0f | ||
|
|
60c6168307 | ||
|
|
d0b418f4c8 | ||
|
|
bce751eea1 |
-27
@@ -1,27 +0,0 @@
|
|||||||
2
|
|
||||||
0.57.20.57.3
|
|
||||||
0.66.2
|
|
||||||
0.66.3
|
|
||||||
0.71.2
|
|
||||||
0.71.3
|
|
||||||
|
|
||||||
0.84.2
|
|
||||||
0.84.3
|
|
||||||
0.85.2
|
|
||||||
0.85.3
|
|
||||||
0.85.4
|
|
||||||
0.85.5
|
|
||||||
0.86.2
|
|
||||||
0.86.3
|
|
||||||
0.86.4
|
|
||||||
0.86.5
|
|
||||||
0.86.6
|
|
||||||
0.86.7
|
|
||||||
0.87.2
|
|
||||||
0.87.3
|
|
||||||
0.87.4
|
|
||||||
0.87.5
|
|
||||||
0.87.6
|
|
||||||
0.87.7
|
|
||||||
0.89.2
|
|
||||||
0.89.3
|
|
||||||
@@ -7,6 +7,7 @@ module.exports = {
|
|||||||
...base,
|
...base,
|
||||||
ignorePatterns: [
|
ignorePatterns: [
|
||||||
...base.ignorePatterns,
|
...base.ignorePatterns,
|
||||||
|
'jest/**/*',
|
||||||
'**/*.d.ts'
|
'**/*.d.ts'
|
||||||
],
|
],
|
||||||
parserOptions: {
|
parserOptions: {
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<!--
|
||||||
|
|
||||||
|
For general support, howto, coding and bundling questions, please
|
||||||
|
use the Substrate & Polkadot StackExchange at
|
||||||
|
|
||||||
|
https://substrate.stackexchange.com/
|
||||||
|
|
||||||
|
and get other ecosystem developers involved. This issues in this
|
||||||
|
repository are meant for the tracking of feature requests and bug
|
||||||
|
reports.
|
||||||
|
|
||||||
|
While all issues are looked at non-bug and non-features would take
|
||||||
|
quite a bit longer to get to and may yield less than satisfactory
|
||||||
|
responses in this format.
|
||||||
|
|
||||||
|
Additionally, please ensure you have done a search on the existing
|
||||||
|
and closed issues before logging a new request. This saves time on
|
||||||
|
all sides.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
* **I'm submitting a ...**
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
REQUIRED:
|
||||||
|
|
||||||
|
Classify the type of report your are submitting
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
- [ ] Bug report
|
||||||
|
- [ ] Feature request
|
||||||
|
- [ ] Support request
|
||||||
|
- [ ] Other
|
||||||
|
|
||||||
|
|
||||||
|
* **What is the current behavior and expected behavior?**
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
REQUIRED:
|
||||||
|
|
||||||
|
If you're describing a bug, tell us what should happen. If you're
|
||||||
|
suggesting a change/improvement, tell us how it should work.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
* **What is the motivation for changing the behavior?**
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
OPTIONAL:
|
||||||
|
|
||||||
|
Suggest a motivation for the request or ideas how to implement the
|
||||||
|
addition or change
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
* **Please tell us about your environment:**
|
||||||
|
|
||||||
|
<!---
|
||||||
|
|
||||||
|
REQUIRED:
|
||||||
|
|
||||||
|
Include as many relevant details about the environment in which you
|
||||||
|
experienced the issue. Also ensure that you have tested against the
|
||||||
|
latest stable releases if you believe this to be a bug
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
- Version:
|
||||||
|
- Environment:
|
||||||
|
|
||||||
|
- [ ] Node.js
|
||||||
|
- [ ] Browser
|
||||||
|
- [ ] Other (limited support for other environments)
|
||||||
|
|
||||||
|
- Language:
|
||||||
|
|
||||||
|
- [ ] JavaScript
|
||||||
|
- [ ] TypeScript (include tsc --version)
|
||||||
|
- [ ] Other
|
||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
|
if: "! startsWith(github.event.head_commit.message, '[CI Skip]') && (!github.event.pull_request || github.event.pull_request.head.repo.full_name == github.repository)"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: jacogr/action-approve@master
|
- uses: jacogr/action-approve@9d6ce78d26f23ad29d009d034822cf773f2cb50e
|
||||||
with:
|
with:
|
||||||
authors: jacogr
|
authors: jacogr
|
||||||
labels: -auto
|
labels: -auto
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ jobs:
|
|||||||
merge:
|
merge:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: jacogr/action-merge@master
|
- uses: jacogr/action-merge@3b4b49af8a8644bf5cbb5409ee236abe04eeb1b0
|
||||||
with:
|
with:
|
||||||
checks: build,lint,test
|
checks: build,lint,test
|
||||||
labels: -auto
|
labels: -auto
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
YARN_ENABLE_SCRIPTS: false
|
YARN_ENABLE_SCRIPTS: false
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v2
|
- uses: dessant/lock-threads@f1a42f0f44eb83361d617a014663e1a76cf282d2
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GH_PAT_BOT }}
|
github-token: ${{ secrets.GH_PAT_BOT }}
|
||||||
issue-lock-inactive-days: '7'
|
issue-lock-inactive-days: '7'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
YARN_ENABLE_SCRIPTS: false
|
YARN_ENABLE_SCRIPTS: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
|
||||||
- name: ${{ matrix.step }}
|
- name: ${{ matrix.step }}
|
||||||
run: |
|
run: |
|
||||||
yarn install --immutable | grep -v 'YN0013'
|
yarn install --immutable | grep -v 'YN0013'
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ jobs:
|
|||||||
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
|
GH_RELEASE_GITHUB_API_TOKEN: ${{ secrets.GH_PAT }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
token: ${{ secrets.GH_PAT }}
|
token: ${{ secrets.GH_PAT }}
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
YARN_ENABLE_SCRIPTS: false
|
YARN_ENABLE_SCRIPTS: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e
|
||||||
- uses: returntocorp/semgrep-action@v1
|
- uses: returntocorp/semgrep-action@aeafd770072c4f48798b991e3449592bddc2c435
|
||||||
with:
|
with:
|
||||||
auditOn: push
|
auditOn: push
|
||||||
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
|
publishToken: ${{ secrets.SEMGREP_APP_TOKEN }}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
YARN_ENABLE_SCRIPTS: false
|
YARN_ENABLE_SCRIPTS: false
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/stale@v3
|
- uses: actions/stale@98ed4cb500039dbcccf4bd9bedada4d0187f2757
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GH_PAT_BOT }}
|
repo-token: ${{ secrets.GH_PAT_BOT }}
|
||||||
stale-issue-message: 'This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.'
|
stale-issue-message: 'This issue has been open for 21 days with no activity and is not labelled as an enhancement. It will be closed in 7 days.'
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
build/
|
build/
|
||||||
build-docs/
|
build-*/
|
||||||
coverage/
|
coverage/
|
||||||
node_modules/
|
node_modules/
|
||||||
tmp/
|
tmp/
|
||||||
|
|||||||
+195
@@ -1,5 +1,200 @@
|
|||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 2.9.12 Oct 18, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.11
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.11 Oct 7, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.10
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.10 Sep 24, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.9
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.9 Sep 17, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.8
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.8 Sep 2, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.7
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.7 Aug 24, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.6
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.6 Aug 21, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Use webpack packages from `@polkadot/dev`
|
||||||
|
- Bump to `@polkadot/util` 10.1.5
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.5 Aug 13, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.4
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.4 Aug 6, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.3
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.3 Jul 30, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.2
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.2 Jul 24, 2022
|
||||||
|
|
||||||
|
Contributed:
|
||||||
|
|
||||||
|
- Adjust vue-identicon with no props/data duplication (Thanks to https://github.com/vikiival)
|
||||||
|
|
||||||
|
|
||||||
|
## 2.9.1 Jul 21, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.1.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.8.2 Jul 10, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.0.2
|
||||||
|
|
||||||
|
|
||||||
|
## 2.8.1 Jul 9, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util` 10.0.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.7.2 Jul 4, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Bump to `@polkadot/util-crypto` 9.7.2 (w/ `@polkadot/wasm-crypto` 6.2.2)
|
||||||
|
|
||||||
|
|
||||||
|
## 2.7.1 Jul 1, 2022
|
||||||
|
|
||||||
|
Contributed:
|
||||||
|
|
||||||
|
- Remove extra div wrappers in `vue-identicon` (Thanks to https://github.com/dcolley)
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.7.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.6.2 Jun 25, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.6.2
|
||||||
|
|
||||||
|
|
||||||
|
## 2.6.1 Jun 23, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.6.1
|
||||||
|
- Upgrade libs to latest stable versions
|
||||||
|
|
||||||
|
|
||||||
|
## 2.5.1 Jun 19, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.5.1
|
||||||
|
- Upgrade libs to latest stable versions
|
||||||
|
|
||||||
|
|
||||||
|
## 2.4.1 Jun 4, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.4.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.3.1 May 30, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.3.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.2.1 May 14, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.2.1
|
||||||
|
|
||||||
|
|
||||||
|
## 2.1.1 Apr 30, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.1.1
|
||||||
|
- Adjust Jest test init for latest `@polkadot/dev`
|
||||||
|
|
||||||
|
|
||||||
|
## 2.0.1 Apr 9, 2022
|
||||||
|
|
||||||
|
- **Breaking change** In this major version the commonjs outputs are moved to a sub-folder. Since the export map and main field in package.json does reflect this change, there should be no usage changes. However the packages here will all need to be on the same version for internal linkage.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Adjust Polkadot icon generation with lazy init
|
||||||
|
- Output commonjs files under the `cjs/**` root
|
||||||
|
- Upgrade to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 9.0.1
|
||||||
|
|
||||||
|
|
||||||
|
## 1.4.1 Mar 27, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Updated to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 8.7.1
|
||||||
|
|
||||||
|
|
||||||
|
## 1.3.1 Mar 19, 2022
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
|
||||||
|
- Updated to `@polkadot/{hw-ledger, keyring, util, util-crypto}` 8.6.1
|
||||||
|
- Additional workaround for Vite bundling
|
||||||
|
|
||||||
|
|
||||||
## 1.2.1 Mar 12, 2022
|
## 1.2.1 Mar 12, 2022
|
||||||
|
|
||||||
Changes:
|
Changes:
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,4 @@
|
|||||||
597 Jaco 1.2.1 (#624)
|
647 Jaco 2.9.12 (#686)
|
||||||
7 YJ fix #224: decrease frame size to 1024, set multipart bool (#225)
|
7 YJ fix #224: decrease frame size to 1024, set multipart bool (#225)
|
||||||
4 Antoine Estienne Refactor logic to better use prefix (#491)
|
4 Antoine Estienne Refactor logic to better use prefix (#491)
|
||||||
4 kwingram25 fix ff api url issue (#289)
|
4 kwingram25 fix ff api url issue (#289)
|
||||||
@@ -18,6 +18,7 @@
|
|||||||
1 Axel Chalon Simplify KeyringAddress interface (#144)
|
1 Axel Chalon Simplify KeyringAddress interface (#144)
|
||||||
1 Cameron Franz react-native example app port (#223)
|
1 Cameron Franz react-native example app port (#223)
|
||||||
1 carumusan Add kulupu (#342)
|
1 carumusan Add kulupu (#342)
|
||||||
|
1 Derek Colley Remove redundant `div` wrappers in vue-identicon (#643)
|
||||||
1 Harry Liu Update README.md (#166)
|
1 Harry Liu Update README.md (#166)
|
||||||
1 Jake Naviasky Add Edgeware chain prefix to settings. (#317)
|
1 Jake Naviasky Add Edgeware chain prefix to settings. (#317)
|
||||||
1 Logan Saether Propose W3F node (#188)
|
1 Logan Saether Propose W3F node (#188)
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
1 Nantian fix bigint type (#510)
|
1 Nantian fix bigint type (#510)
|
||||||
1 Nikhil Ranjan Updated to valid javascript (#271)
|
1 Nikhil Ranjan Updated to valid javascript (#271)
|
||||||
1 Shawn Tabrizi Add a new `notification` setting (#498)
|
1 Shawn Tabrizi Add a new `notification` setting (#498)
|
||||||
|
1 Viki Val :bug: identicon has isAlternative both as data and prop (#668)
|
||||||
1 Wei Tang Add Kulupu to the network selection list (#254)
|
1 Wei Tang Add Kulupu to the network selection list (#254)
|
||||||
1 WoeOm add darwinia ss58 (#379)
|
1 WoeOm add darwinia ss58 (#379)
|
||||||
1 yuhui1208 [Stores] make FileStroe read key safely (#338)
|
1 yuhui1208 [Stores] make FileStroe read key safely (#338)
|
||||||
|
|||||||
@@ -12,5 +12,6 @@ module.exports = {
|
|||||||
'\\.(css|less)$': 'empty/object',
|
'\\.(css|less)$': 'empty/object',
|
||||||
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object'
|
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': 'empty/object'
|
||||||
},
|
},
|
||||||
|
setupFilesAfterEnv: ['<rootDir>/jest/setupEnv.js'],
|
||||||
testEnvironment: 'jsdom'
|
testEnvironment: 'jsdom'
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// Copyright 2017-2022 @polkadot/ui authors & contributors
|
||||||
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
const nodeCrypto = require('crypto');
|
||||||
|
|
||||||
|
window.crypto = {
|
||||||
|
getRandomValues: function (buffer) {
|
||||||
|
return nodeCrypto.randomFillSync(buffer);
|
||||||
|
}
|
||||||
|
};
|
||||||
+20
-18
@@ -10,7 +10,12 @@
|
|||||||
"url": "https://github.com/polkadot-js/ui.git"
|
"url": "https://github.com/polkadot-js/ui.git"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"version": "1.2.1",
|
"type": "module",
|
||||||
|
"version": "2.9.12",
|
||||||
|
"versions": {
|
||||||
|
"git": "2.9.12",
|
||||||
|
"npm": "2.9.12"
|
||||||
|
},
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"packages/*"
|
"packages/*"
|
||||||
],
|
],
|
||||||
@@ -19,34 +24,31 @@
|
|||||||
"build:release": "polkadot-ci-ghact-build",
|
"build:release": "polkadot-ci-ghact-build",
|
||||||
"build:rollup": "polkadot-exec-rollup --config",
|
"build:rollup": "polkadot-exec-rollup --config",
|
||||||
"clean": "polkadot-dev-clean-build",
|
"clean": "polkadot-dev-clean-build",
|
||||||
"example:react": "yarn build && cd packages/example-react && webpack --config webpack.config.cjs",
|
"example:react": "yarn build && cd packages/example-react && yarn polkadot-exec-webpack --config webpack.config.cjs",
|
||||||
"example:vue": "yarn build && cd packages/example-vue && webpack --config webpack.config.cjs",
|
"example:vue": "yarn build && cd packages/example-vue && yarn polkadot-exec-webpack --config webpack.config.cjs",
|
||||||
"lint": "polkadot-dev-run-lint",
|
"lint": "polkadot-dev-run-lint",
|
||||||
"postinstall": "polkadot-dev-yarn-only",
|
"postinstall": "polkadot-dev-yarn-only",
|
||||||
"test": "polkadot-dev-run-test --coverage --runInBand",
|
"test": "polkadot-dev-run-test --coverage --runInBand",
|
||||||
"test:one": "polkadot-dev-run-test"
|
"test:one": "polkadot-dev-run-test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@babel/core": "^7.17.5",
|
"@babel/core": "^7.19.3",
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/dev": "^0.65.87",
|
"@polkadot/dev": "^0.67.145",
|
||||||
"@polkadot/x-bundle": "^8.5.1",
|
"@polkadot/x-bundle": "^10.1.11",
|
||||||
"@types/jest": "^27.4.1",
|
"@types/jest": "^29.2.0",
|
||||||
"babel-loader": "^8.2.3",
|
"babel-loader": "^8.2.5",
|
||||||
"babel-plugin-transform-vue-template": "^0.4.2",
|
"babel-plugin-transform-vue-template": "^0.4.2",
|
||||||
"empty": "^0.10.1",
|
"empty": "^0.10.1",
|
||||||
"process": "^0.11.10",
|
"process": "^0.11.10",
|
||||||
"react": "^17.0.2",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^17.0.2",
|
"react-dom": "^18.2.0",
|
||||||
"react-is": "^17.0.2",
|
"react-is": "^18.2.0",
|
||||||
"react-native": "^0.67.3",
|
"react-native": "^0.70.3",
|
||||||
"stream-browserify": "^3.0.0",
|
"stream-browserify": "^3.0.0",
|
||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.7.13"
|
||||||
"webpack": "^5.70.0",
|
|
||||||
"webpack-cli": "^4.9.2",
|
|
||||||
"webpack-serve": "^4.0.0"
|
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"typescript": "^4.6.2"
|
"typescript": "^4.8.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
"url": "https://github.com/polkadot-js/ui.git"
|
"url": "https://github.com/polkadot-js/ui.git"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2"
|
"@babel/runtime": "^7.19.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/example-react', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/example-react', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -43,8 +43,7 @@ module.exports = {
|
|||||||
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/build'),
|
'@polkadot/react-identicon': path.resolve(__dirname, '../react-identicon/build'),
|
||||||
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
|
'@polkadot/ui-keyring': path.resolve(__dirname, '../ui-keyring/build'),
|
||||||
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
|
'@polkadot/ui-settings': path.resolve(__dirname, '../ui-settings/build'),
|
||||||
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build'),
|
'@polkadot/ui-shared': path.resolve(__dirname, '../ui-shared/build')
|
||||||
'react/jsx-runtime': require.resolve('react/jsx-runtime')
|
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.ts', '.tsx'],
|
extensions: ['.js', '.ts', '.tsx'],
|
||||||
fallback: {}
|
fallback: {}
|
||||||
|
|||||||
@@ -14,9 +14,9 @@
|
|||||||
"url": "https://github.com/polkadot-js/ui.git"
|
"url": "https://github.com/polkadot-js/ui.git"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2"
|
"@babel/runtime": "^7.19.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/example-vue', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/example-vue', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -17,26 +17,26 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/keyring": "^8.5.1",
|
"@polkadot/keyring": "^10.1.11",
|
||||||
"@polkadot/ui-settings": "1.2.1",
|
"@polkadot/ui-settings": "2.9.12",
|
||||||
"@polkadot/ui-shared": "1.2.1",
|
"@polkadot/ui-shared": "2.9.12",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"color": "^3.2.1",
|
"color": "^3.2.1",
|
||||||
"ethereum-blockies-base64": "^1.0.2",
|
"ethereum-blockies-base64": "^1.0.2",
|
||||||
"jdenticon": "3.1.1",
|
"jdenticon": "3.1.1",
|
||||||
"react-copy-to-clipboard": "^5.0.4",
|
"react-copy-to-clipboard": "^5.1.0",
|
||||||
"styled-components": "^5.3.3"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-copy-to-clipboard": "^5.0.2",
|
"@types/react-copy-to-clipboard": "^5.0.4",
|
||||||
"@types/react-dom": "^17.0.13",
|
"@types/react-dom": "^18.0.6",
|
||||||
"@types/styled-components": "^5.1.24",
|
"@types/styled-components": "^5.1.26",
|
||||||
"styled-components": "^5.3.3",
|
"styled-components": "^5.3.6",
|
||||||
"xmlserializer": "^0.6.1"
|
"xmlserializer": "^0.6.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -4,15 +4,18 @@
|
|||||||
import type { Props } from '../types';
|
import type { Props } from '../types';
|
||||||
|
|
||||||
import * as jdenticon from 'jdenticon';
|
import * as jdenticon from 'jdenticon';
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
function Identicon ({ className = '', publicKey, size, style }: Props): React.ReactElement<Props> {
|
function Identicon ({ className = '', publicKey, size, style }: Props): React.ReactElement<Props> {
|
||||||
|
const html = useMemo(
|
||||||
|
() => ({ __html: jdenticon.toSvg(publicKey.substr(2), size) }),
|
||||||
|
[publicKey, size]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={className}
|
className={className}
|
||||||
dangerouslySetInnerHTML={{
|
dangerouslySetInnerHTML={html}
|
||||||
__html: jdenticon.toSvg(publicKey.substr(2), size)
|
|
||||||
}}
|
|
||||||
style={style}
|
style={style}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
import type { Circle } from '@polkadot/ui-shared/icons/types';
|
import type { Circle } from '@polkadot/ui-shared/icons/types';
|
||||||
import type { Props } from '../types';
|
import type { Props } from '../types';
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
|
|
||||||
import { polkadotIcon } from '@polkadot/ui-shared';
|
import { polkadotIcon } from '@polkadot/ui-shared';
|
||||||
|
|
||||||
@@ -36,6 +36,11 @@ function renderCircle ({ cx, cy, fill, r }: Circle, key: number): React.ReactNod
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Identicon ({ address, className = '', isAlternative = false, size, style }: Props): React.ReactElement<Props> {
|
function Identicon ({ address, className = '', isAlternative = false, size, style }: Props): React.ReactElement<Props> {
|
||||||
|
const circles = useMemo(
|
||||||
|
() => polkadotIcon(address, { isAlternative }),
|
||||||
|
[address, isAlternative]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<svg
|
<svg
|
||||||
className={className}
|
className={className}
|
||||||
@@ -46,7 +51,7 @@ function Identicon ({ address, className = '', isAlternative = false, size, styl
|
|||||||
viewBox='0 0 64 64'
|
viewBox='0 0 64 64'
|
||||||
width={size}
|
width={size}
|
||||||
>
|
>
|
||||||
{polkadotIcon(address, { isAlternative }).map(renderCircle)}
|
{circles.map(renderCircle)}
|
||||||
</svg>
|
</svg>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/react-identicon', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/react-identicon', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -17,20 +17,20 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/ui-settings": "1.2.1",
|
"@polkadot/ui-settings": "2.9.12",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"qrcode-generator": "^1.4.4",
|
"qrcode-generator": "^1.4.4",
|
||||||
"react-qr-reader": "^2.2.1",
|
"react-qr-reader": "^2.2.1",
|
||||||
"styled-components": "^5.3.3"
|
"styled-components": "^5.3.6"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-qr-reader": "^2.1.4",
|
"@types/react-qr-reader": "^2.1.4",
|
||||||
"@types/styled-components": "^5.1.24"
|
"@types/styled-components": "^5.1.26"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@polkadot/util": "*",
|
"@polkadot/util": "*",
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/react-qr', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/react-qr', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -17,17 +17,17 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/ui-shared": "1.2.1",
|
"@polkadot/ui-shared": "2.9.12",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"react-native-svg": "^12.3.0"
|
"react-native-svg": "^12.4.4"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/react-native": "^0.67.2"
|
"@types/react-native": "^0.70.5"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@polkadot/util": "*",
|
"@polkadot/util": "*",
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import type { Circle as CircleType } from '@polkadot/ui-shared/icons/types';
|
import type { Circle as CircleType } from '@polkadot/ui-shared/icons/types';
|
||||||
import type { Props } from '../types';
|
import type { Props } from '../types';
|
||||||
|
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { View } from 'react-native';
|
import { View } from 'react-native';
|
||||||
import Svg, { Circle as SvgCircle } from 'react-native-svg';
|
import Svg, { Circle as SvgCircle } from 'react-native-svg';
|
||||||
|
|
||||||
@@ -23,6 +23,11 @@ function renderCircle ({ cx, cy, fill, r }: CircleType, key: number): React.Reac
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default function Identicon ({ address, isAlternative = false, size }: Props): React.ReactElement<Props> {
|
export default function Identicon ({ address, isAlternative = false, size }: Props): React.ReactElement<Props> {
|
||||||
|
const circles = useMemo(
|
||||||
|
() => polkadotIcon(address, { isAlternative }),
|
||||||
|
[address, isAlternative]
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<Svg
|
<Svg
|
||||||
@@ -31,7 +36,7 @@ export default function Identicon ({ address, isAlternative = false, size }: Pro
|
|||||||
viewBox='0 0 64 64'
|
viewBox='0 0 64 64'
|
||||||
width={size}
|
width={size}
|
||||||
>
|
>
|
||||||
{polkadotIcon(address, { isAlternative }).map(renderCircle)}
|
{circles.map(renderCircle)}
|
||||||
</Svg>
|
</Svg>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/reactnative-identicon', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/reactnative-identicon', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -13,10 +13,10 @@
|
|||||||
"url": "https://github.com/polkadot-js/ui.git"
|
"url": "https://github.com/polkadot-js/ui.git"
|
||||||
},
|
},
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/util": "^8.5.1"
|
"@polkadot/util": "^10.1.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright 2017-2022 @polkadot/ui-assets authors & contributors
|
// Copyright 2017-2022 @polkadot/ui-assets authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
// empty
|
export {};
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/ui-assets', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/ui-assets', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -16,16 +16,16 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/keyring": "^8.5.1",
|
"@polkadot/keyring": "^10.1.11",
|
||||||
"@polkadot/ui-settings": "1.2.1",
|
"@polkadot/ui-settings": "2.9.12",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"mkdirp": "^1.0.4",
|
"mkdirp": "^1.0.4",
|
||||||
"rxjs": "^7.5.5",
|
"rxjs": "^7.5.7",
|
||||||
"store": "^2.0.12"
|
"store": "^2.0.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/ui-keyring', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/ui-keyring', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -6,24 +6,23 @@ import type { KeyringJson, KeyringStore } from '../types';
|
|||||||
import store from 'store';
|
import store from 'store';
|
||||||
|
|
||||||
export class BrowserStore implements KeyringStore {
|
export class BrowserStore implements KeyringStore {
|
||||||
public all (cb: (key: string, value: KeyringJson) => void): void {
|
public all (fn: (key: string, value: KeyringJson) => void): void {
|
||||||
store.each((value: KeyringJson, key: string): void => {
|
store.each((value: KeyringJson, key: string): void => {
|
||||||
cb(key, value);
|
fn(key, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public get (key: string, cb: (value: KeyringJson) => void): void {
|
public get (key: string, fn: (value: KeyringJson) => void): void {
|
||||||
// eslint-disable-next-line node/no-callback-literal
|
fn(store.get(key) as KeyringJson);
|
||||||
cb(store.get(key) as KeyringJson);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public remove (key: string, cb?: () => void): void {
|
public remove (key: string, fn?: () => void): void {
|
||||||
store.remove(key);
|
store.remove(key);
|
||||||
cb && cb();
|
fn && fn();
|
||||||
}
|
}
|
||||||
|
|
||||||
public set (key: string, value: KeyringJson, cb?: () => void): void {
|
public set (key: string, value: KeyringJson, fn?: () => void): void {
|
||||||
store.set(key, value);
|
store.set(key, value);
|
||||||
cb && cb();
|
fn && fn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,33 +21,33 @@ export class FileStore implements KeyringStore {
|
|||||||
this.#path = path;
|
this.#path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public all (cb: (key: string, value: KeyringJson) => void): void {
|
public all (fn: (key: string, value: KeyringJson) => void): void {
|
||||||
fs
|
fs
|
||||||
.readdirSync(this.#path)
|
.readdirSync(this.#path)
|
||||||
.filter((key): boolean => !['.', '..', '.DS_Store'].includes(key))
|
.filter((key): boolean => !['.', '..', '.DS_Store'].includes(key))
|
||||||
.forEach((key): void => {
|
.forEach((key): void => {
|
||||||
const value = this._readKey(key);
|
const value = this._readKey(key);
|
||||||
|
|
||||||
value?.address && cb(key, value);
|
value?.address && fn(key, value);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public get (key: string, cb: (value: KeyringJson) => void): void {
|
public get (key: string, fn: (value: KeyringJson) => void): void {
|
||||||
const value = this._readKey(key);
|
const value = this._readKey(key);
|
||||||
|
|
||||||
assert(value?.address, `Invalid JSON found for ${key}`);
|
assert(value?.address, `Invalid JSON found for ${key}`);
|
||||||
|
|
||||||
cb(value);
|
fn(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public remove (key: string, cb?: () => void): void {
|
public remove (key: string, fn?: () => void): void {
|
||||||
fs.unlinkSync(this._getPath(key));
|
fs.unlinkSync(this._getPath(key));
|
||||||
cb && cb();
|
fn && fn();
|
||||||
}
|
}
|
||||||
|
|
||||||
public set (key: string, value: KeyringJson, cb?: () => void): void {
|
public set (key: string, value: KeyringJson, fn?: () => void): void {
|
||||||
fs.writeFileSync(this._getPath(key), Buffer.from(JSON.stringify(value), 'utf-8'));
|
fs.writeFileSync(this._getPath(key), Buffer.from(JSON.stringify(value), 'utf-8'));
|
||||||
cb && cb();
|
fn && fn();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _getPath (key: string): string {
|
private _getPath (key: string): string {
|
||||||
|
|||||||
@@ -17,12 +17,12 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/networks": "^8.5.1",
|
"@polkadot/networks": "^10.1.11",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"eventemitter3": "^4.0.7",
|
"eventemitter3": "^4.0.7",
|
||||||
"store": "^2.0.12"
|
"store": "^2.0.12"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/ui-settings', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/ui-settings', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -17,17 +17,17 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"color": "^3.2.1"
|
"color": "^3.2.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"@types/color": "^3.0.3",
|
"@types/color": "^3.0.3",
|
||||||
"@types/xmlserializer": "^0.6.2",
|
"@types/xmlserializer": "^0.6.3",
|
||||||
"xmlserializer": "^0.6.1"
|
"xmlserializer": "^0.6.1"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ describe('identicon', (): void => {
|
|||||||
it('generates a basic [0,..,0] identicon', (): void => {
|
it('generates a basic [0,..,0] identicon', (): void => {
|
||||||
expect(
|
expect(
|
||||||
xmlserializer.serializeToString(
|
xmlserializer.serializeToString(
|
||||||
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 256 })
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 256 }) as any
|
||||||
)
|
)
|
||||||
).toEqual(
|
).toEqual(
|
||||||
'<div xmlns="http://www.w3.org/1999/xhtml" class="" style="background: white; border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="256" height="256"><circle cx="128" cy="140.8" r="128" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="128" cy="153.6" r="102.4" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="128" cy="166.4" r="76.8" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="128" cy="179.2" r="51.2" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="128" cy="192" r="25.6" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
|
'<div xmlns="http://www.w3.org/1999/xhtml" class="" style="background: white; border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 128px; display: inline-block; height: 256px; margin: 0px; overflow: hidden; padding: 0px; width: 256px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="256" height="256"><circle cx="128" cy="140.8" r="128" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="128" cy="153.6" r="102.4" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="128" cy="166.4" r="76.8" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="128" cy="179.2" r="51.2" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="128" cy="192" r="25.6" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
|
||||||
@@ -19,7 +20,8 @@ describe('identicon', (): void => {
|
|||||||
it('allows overrides', (): void => {
|
it('allows overrides', (): void => {
|
||||||
expect(
|
expect(
|
||||||
xmlserializer.serializeToString(
|
xmlserializer.serializeToString(
|
||||||
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 100 }, 'testClass', { display: 'block' })
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
beachballIcon(new Uint8Array(32), { isAlternative: false, size: 100 }, 'testClass', { display: 'block' }) as any
|
||||||
)
|
)
|
||||||
).toEqual(
|
).toEqual(
|
||||||
'<div xmlns="http://www.w3.org/1999/xhtml" class="testClass" style="background: white; border-radius: 50px; display: block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 50px; display: inline-block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100" height="100"><circle cx="50" cy="55" r="50" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="50" cy="60" r="40" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="50" cy="65" r="30" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="50" cy="70" r="20" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="50" cy="75" r="10" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
|
'<div xmlns="http://www.w3.org/1999/xhtml" class="testClass" style="background: white; border-radius: 50px; display: block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><div class="" style="background: rgb(20, 20, 20); border-radius: 50px; display: inline-block; height: 100px; margin: 0px; overflow: hidden; padding: 0px; width: 100px;"><svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="100" height="100"><circle cx="50" cy="55" r="50" fill="hsl(212.10000000000002, 65.6%, 55.5%)"/><circle cx="50" cy="60" r="40" fill="hsl(9.800000000000011, 90.7%, 57.6%)"/><circle cx="50" cy="65" r="30" fill="hsl(345, 85.7%, 86.3%)"/><circle cx="50" cy="70" r="20" fill="hsl(261.9, 100%, 87.3%)"/><circle cx="50" cy="75" r="10" fill="hsl(345, 100%, 25.1%)"/></svg></div></div>'
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ describe('circle', (): void => {
|
|||||||
it('creates a circle shape', (): void => {
|
it('creates a circle shape', (): void => {
|
||||||
expect(
|
expect(
|
||||||
xmlserializer.serializeToString(
|
xmlserializer.serializeToString(
|
||||||
circle(seeder(), 'blue', 50, 2)
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
circle(seeder(), 'blue', 50, 2) as any
|
||||||
)
|
)
|
||||||
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="25" cy="32.5" r="15" fill="blue"/>');
|
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="25" cy="32.5" r="15" fill="blue"/>');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ describe('circle', (): void => {
|
|||||||
it('creates a basic SVG circle element', (): void => {
|
it('creates a basic SVG circle element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
serializeToString(
|
||||||
circle(123, 12, 34)
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
circle(123, 12, 34) as any
|
||||||
)
|
)
|
||||||
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="12" cy="34" r="123"/>');
|
).toEqual('<circle xmlns="http://www.w3.org/2000/svg" cx="12" cy="34" r="123"/>');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ describe('element', (): void => {
|
|||||||
it('creates a basic SVG element', (): void => {
|
it('creates a basic SVG element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
serializeToString(
|
||||||
element(123)
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
element(123) as any
|
||||||
)
|
)
|
||||||
).toEqual('<svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123"/>');
|
).toEqual('<svg xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123"/>');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ describe('rect', (): void => {
|
|||||||
it('creates a basic SVG rect element', (): void => {
|
it('creates a basic SVG rect element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
serializeToString(
|
||||||
rect(123)
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
rect(123) as any
|
||||||
)
|
)
|
||||||
).toEqual('<rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123" rx="7.6875" ry="7.6875"/>');
|
).toEqual('<rect xmlns="http://www.w3.org/2000/svg" x="0" y="0" width="123" height="123" rx="7.6875" ry="7.6875"/>');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ describe('svg', (): void => {
|
|||||||
it('creates a basic SVG element', (): void => {
|
it('creates a basic SVG element', (): void => {
|
||||||
expect(
|
expect(
|
||||||
serializeToString(
|
serializeToString(
|
||||||
svg('rect')
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument,@typescript-eslint/no-explicit-any
|
||||||
|
svg('rect') as any
|
||||||
)
|
)
|
||||||
).toEqual('<rect xmlns="http://www.w3.org/2000/svg"/>');
|
).toEqual('<rect xmlns="http://www.w3.org/2000/svg"/>');
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ const blake2 = (value: Uint8Array): Uint8Array =>
|
|||||||
const S = 64;
|
const S = 64;
|
||||||
const C = S / 2;
|
const C = S / 2;
|
||||||
const Z = S / 64 * 5;
|
const Z = S / 64 * 5;
|
||||||
const ZERO = blake2(new Uint8Array(32));
|
|
||||||
|
|
||||||
/* eslint-disable sort-keys */
|
/* eslint-disable sort-keys */
|
||||||
const SCHEMA: { [index: string]: Scheme } = {
|
const SCHEMA: { [index: string]: Scheme } = {
|
||||||
@@ -43,6 +42,8 @@ const OUTER_CIRCLE: Circle = {
|
|||||||
r: C
|
r: C
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let zeroHash: Uint8Array = new Uint8Array();
|
||||||
|
|
||||||
function getRotation (isSixPoint: boolean): { r: number; ro2: number; r3o4: number; ro4: number; rroot3o2: number; rroot3o4: number } {
|
function getRotation (isSixPoint: boolean): { r: number; ro2: number; r3o4: number; ro4: number; rroot3o2: number; rroot3o4: number } {
|
||||||
const r = isSixPoint
|
const r = isSixPoint
|
||||||
? (C / 8 * 5)
|
? (C / 8 * 5)
|
||||||
@@ -98,7 +99,11 @@ function findScheme (d: number): Scheme {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function addressToId (address: string): Uint8Array {
|
function addressToId (address: string): Uint8Array {
|
||||||
return blake2(decodeAddress(address)).map((x, i): number => (x + 256 - ZERO[i]) % 256);
|
if (!zeroHash.length) {
|
||||||
|
zeroHash = blake2(new Uint8Array(32));
|
||||||
|
}
|
||||||
|
|
||||||
|
return blake2(decodeAddress(address)).map((x, i) => (x + 256 - zeroHash[i]) % 256);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getColors (address: string): string[] {
|
function getColors (address: string): string[] {
|
||||||
@@ -132,10 +137,19 @@ function getColors (address: string): string[] {
|
|||||||
* @description Generate a array of the circles that make up an identicon
|
* @description Generate a array of the circles that make up an identicon
|
||||||
*/
|
*/
|
||||||
export function polkadotIcon (address: string, { isAlternative }: Options): Circle[] {
|
export function polkadotIcon (address: string, { isAlternative }: Options): Circle[] {
|
||||||
const colors = getColors(address);
|
const xy = getCircleXY(isAlternative);
|
||||||
|
let colors: string[];
|
||||||
|
|
||||||
|
try {
|
||||||
|
// in some cases, e.g. RN where crypto may not be initialized, chaos can
|
||||||
|
// happen when hashing, in these cases we just fill with a placeholder
|
||||||
|
colors = getColors(address);
|
||||||
|
} catch {
|
||||||
|
colors = new Array<string>(xy.length).fill('#ddd');
|
||||||
|
}
|
||||||
|
|
||||||
return [OUTER_CIRCLE].concat(
|
return [OUTER_CIRCLE].concat(
|
||||||
getCircleXY(isAlternative).map(([cx, cy], index): Circle => ({
|
xy.map(([cx, cy], index): Circle => ({
|
||||||
cx, cy, fill: colors[index], r: Z
|
cx, cy, fill: colors[index], r: Z
|
||||||
}))
|
}))
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/ui-shared', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/ui-shared', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
@@ -17,17 +17,17 @@
|
|||||||
"./detectPackage.cjs"
|
"./detectPackage.cjs"
|
||||||
],
|
],
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "1.2.1",
|
"version": "2.9.12",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/runtime": "^7.17.2",
|
"@babel/runtime": "^7.19.4",
|
||||||
"@polkadot/ui-shared": "1.2.1",
|
"@polkadot/ui-shared": "2.9.12",
|
||||||
"@polkadot/util": "^8.5.1",
|
"@polkadot/util": "^10.1.11",
|
||||||
"@polkadot/util-crypto": "^8.5.1",
|
"@polkadot/util-crypto": "^10.1.11",
|
||||||
"jdenticon": "3.1.1"
|
"jdenticon": "3.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vue": "^2.6.14"
|
"vue": "^2.7.13"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@polkadot/util": "*",
|
"@polkadot/util": "*",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
import type { Prefix } from '@polkadot/util-crypto/address/types';
|
import type { Prefix } from '@polkadot/util-crypto/address/types';
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue, { VNode } from 'vue';
|
||||||
|
|
||||||
import { isHex, isU8a, u8aToHex } from '@polkadot/util';
|
import { isHex, isU8a, u8aToHex } from '@polkadot/util';
|
||||||
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
|
import { decodeAddress, encodeAddress } from '@polkadot/util-crypto';
|
||||||
@@ -18,6 +18,7 @@ interface Account {
|
|||||||
interface Data {
|
interface Data {
|
||||||
address: string;
|
address: string;
|
||||||
iconSize: number;
|
iconSize: number;
|
||||||
|
isAlternativeIcon: boolean;
|
||||||
publicKey: string;
|
publicKey: string;
|
||||||
type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
|
type: 'beachball' | 'empty' | 'jdenticon' | 'polkadot' | 'substrate';
|
||||||
}
|
}
|
||||||
@@ -59,6 +60,7 @@ export const Identicon = Vue.extend({
|
|||||||
return {
|
return {
|
||||||
address: '',
|
address: '',
|
||||||
iconSize: DEFAULT_SIZE,
|
iconSize: DEFAULT_SIZE,
|
||||||
|
isAlternativeIcon: false,
|
||||||
publicKey: '0x',
|
publicKey: '0x',
|
||||||
type: 'empty'
|
type: 'empty'
|
||||||
};
|
};
|
||||||
@@ -67,7 +69,7 @@ export const Identicon = Vue.extend({
|
|||||||
createData: function (): void {
|
createData: function (): void {
|
||||||
this.iconSize = this.size as number || DEFAULT_SIZE;
|
this.iconSize = this.size as number || DEFAULT_SIZE;
|
||||||
this.type = this.theme as 'empty';
|
this.type = this.theme as 'empty';
|
||||||
|
this.isAlternativeIcon = this.isAlternative as boolean || false;
|
||||||
this.recodeAddress();
|
this.recodeAddress();
|
||||||
},
|
},
|
||||||
recodeAddress: function (): void {
|
recodeAddress: function (): void {
|
||||||
@@ -78,22 +80,21 @@ export const Identicon = Vue.extend({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
|
props: ['prefix', 'isAlternative', 'size', 'theme', 'value'],
|
||||||
// FIXME These nested divs are not correct, would like a different way
|
render (h): VNode {
|
||||||
// here so we don't create a div wrapped for the div wrapper of the icon
|
const { address, iconSize, isAlternativeIcon, publicKey, type } = this.$data as Data;
|
||||||
template: `
|
|
||||||
<div v-if="type === 'empty' || address === ''">
|
if (type === 'empty') {
|
||||||
<Empty :key="address" :size="iconSize" />
|
return h('Empty', { attrs: { key: address, size: iconSize } }, []);
|
||||||
</div>
|
} else if (type === 'jdenticon') {
|
||||||
<div v-else-if="type === 'beachball'">
|
return h('Jdenticon', { attrs: { key: address, publicKey, size: iconSize } }, []);
|
||||||
<Beachball :key="address" :address="address" :size="iconSize" />
|
} else {
|
||||||
</div>
|
// handles: beachball and polkadot
|
||||||
<div v-else-if="type === 'polkadot'">
|
// TODO: substrate
|
||||||
<Polkadot :key="address" :address="address" :isAlternative="isAlternative" :size="iconSize" />
|
const cmp = type.charAt(0).toUpperCase() + type.slice(1);
|
||||||
</div>
|
|
||||||
<div v-else>
|
return h(cmp, { attrs: { address, isAlternative: isAlternativeIcon, key: address, size: iconSize } }, []);
|
||||||
<Jdenticon :key="address" :publicKey="publicKey" :size="iconSize" />
|
}
|
||||||
</div>
|
},
|
||||||
`,
|
|
||||||
watch: {
|
watch: {
|
||||||
value: function (): void {
|
value: function (): void {
|
||||||
this.recodeAddress();
|
this.recodeAddress();
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
|
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import type { Options } from '@polkadot/ui-shared/icons/types';
|
import Vue, { VNode } from 'vue';
|
||||||
|
|
||||||
import Vue from 'vue';
|
|
||||||
|
|
||||||
import { beachballIcon } from '@polkadot/ui-shared';
|
import { beachballIcon } from '@polkadot/ui-shared';
|
||||||
|
|
||||||
interface Data {
|
type propsType = {
|
||||||
html: string;
|
address: string;
|
||||||
|
size: number;
|
||||||
|
isAlternative: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,21 +16,12 @@ interface Data {
|
|||||||
* @description The Beachball identicon
|
* @description The Beachball identicon
|
||||||
*/
|
*/
|
||||||
export const Beachball = Vue.extend({
|
export const Beachball = Vue.extend({
|
||||||
created: function (): void {
|
props: ['address', 'size', 'isAlternative'],
|
||||||
this.createHtml();
|
|
||||||
},
|
|
||||||
data: function (): Data {
|
|
||||||
return {
|
|
||||||
// eslint-disable-next-line quotes
|
|
||||||
html: `<div />`
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
createHtml: function (): void {
|
|
||||||
this.html = beachballIcon(this.address as string, this.size as Options).outerHTML;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: ['address', 'size'],
|
|
||||||
// eslint-disable-next-line quotes
|
// eslint-disable-next-line quotes
|
||||||
template: `<div v-html="html" />`
|
render (h): VNode {
|
||||||
|
const { address, isAlternative, size } = this.$props as propsType;
|
||||||
|
const bb = beachballIcon(address, { isAlternative, size });
|
||||||
|
|
||||||
|
return h(Vue.component('VCBeachball', { template: bb.outerHTML }));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,10 +2,11 @@
|
|||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import * as jdenticon from 'jdenticon';
|
import * as jdenticon from 'jdenticon';
|
||||||
import Vue from 'vue';
|
import Vue, { VNode } from 'vue';
|
||||||
|
|
||||||
interface Data {
|
type propsType = {
|
||||||
svgHtml: string;
|
publicKey: string,
|
||||||
|
size: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -13,21 +14,12 @@ interface Data {
|
|||||||
* @description The substrate default via Jdenticon
|
* @description The substrate default via Jdenticon
|
||||||
*/
|
*/
|
||||||
export const Jdenticon = Vue.extend({
|
export const Jdenticon = Vue.extend({
|
||||||
created: function (): void {
|
|
||||||
this.createSvgHtml();
|
|
||||||
},
|
|
||||||
data: function (): Data {
|
|
||||||
return {
|
|
||||||
// eslint-disable-next-line quotes
|
|
||||||
svgHtml: `<svg viewBox="0 0 64 64" />`
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
createSvgHtml: function (): void {
|
|
||||||
this.svgHtml = jdenticon.toSvg((this.publicKey as string).substr(2), this.size as number);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: ['publicKey', 'size'],
|
props: ['publicKey', 'size'],
|
||||||
// eslint-disable-next-line quotes
|
// eslint-disable-next-line quotes
|
||||||
template: `<div v-html="svgHtml" />`
|
render (h): VNode {
|
||||||
|
const { publicKey, size } = this.$props as propsType;
|
||||||
|
const cmp = Vue.component('CJdenticon', { template: jdenticon.toSvg(publicKey.substring(2), size) });
|
||||||
|
|
||||||
|
return h(cmp);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,17 +1,14 @@
|
|||||||
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
|
// Copyright 2017-2022 @polkadot/vue-identicon authors & contributors
|
||||||
// SPDX-License-Identifier: Apache-2.0
|
// SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue, { VNode } from 'vue';
|
||||||
|
|
||||||
import { polkadotIcon } from '@polkadot/ui-shared';
|
import { polkadotIcon } from '@polkadot/ui-shared';
|
||||||
|
|
||||||
interface Data {
|
type propsType = {
|
||||||
svgHtml: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface This {
|
|
||||||
address: string;
|
address: string;
|
||||||
isAlternative?: boolean;
|
isAlternative: boolean;
|
||||||
|
size: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -19,25 +16,20 @@ interface This {
|
|||||||
* @description The Polkadot default identicon
|
* @description The Polkadot default identicon
|
||||||
*/
|
*/
|
||||||
export const Polkadot = Vue.extend({
|
export const Polkadot = Vue.extend({
|
||||||
created: function (): void {
|
|
||||||
this.createSvgHtml();
|
|
||||||
},
|
|
||||||
data: function (): Data {
|
|
||||||
return {
|
|
||||||
// eslint-disable-next-line quotes
|
|
||||||
svgHtml: `<svg viewBox="0 0 64 64" />`
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
createSvgHtml: function (): void {
|
|
||||||
const circles = polkadotIcon(this.address as string, { isAlternative: (this as This).isAlternative || false }).map(({ cx, cy, fill, r }) =>
|
|
||||||
`<circle cx=${cx} cy=${cy} fill="${fill}" r=${r} />`
|
|
||||||
).join('');
|
|
||||||
|
|
||||||
this.svgHtml = `<svg height=${this.size as number} viewBox='0 0 64 64' width=${this.size as number}>${circles}</svg>`;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
props: ['address', 'isAlternative', 'size'],
|
props: ['address', 'isAlternative', 'size'],
|
||||||
// eslint-disable-next-line quotes
|
// eslint-disable-next-line quotes
|
||||||
template: `<div v-html="svgHtml" />`
|
render (h): VNode {
|
||||||
|
const { address, isAlternative, size } = this.$props as propsType;
|
||||||
|
const circles = polkadotIcon(address, {
|
||||||
|
isAlternative: isAlternative || false
|
||||||
|
}).map(({ cx,
|
||||||
|
cy,
|
||||||
|
fill,
|
||||||
|
r }) => {
|
||||||
|
return h('circle', { attrs: { cx, cy, fill, r } }, []);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return h('svg', { attrs: { height: size, viewBox: '0 0 64 64', width: size } }, circles);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
|
|
||||||
// Do not edit, auto-generated by @polkadot/dev
|
// Do not edit, auto-generated by @polkadot/dev
|
||||||
|
|
||||||
export const packageInfo = { name: '@polkadot/vue-identicon', path: 'auto', type: 'auto', version: '1.2.1' };
|
export const packageInfo = { name: '@polkadot/vue-identicon', path: 'auto', type: 'auto', version: '2.9.12' };
|
||||||
|
|||||||
Reference in New Issue
Block a user