Skip to content

Commit 9ae0dbe

Browse files
authored
Merge pull request #79 from celo-tools/1.4.0
v1.4.0 - WalletConnect v1, cREAL, tokenlist, chart fixes
2 parents 13f4f49 + 5a892bb commit 9ae0dbe

57 files changed

Lines changed: 3295 additions & 2879 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

FAQ.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,4 @@ Note though that currently not all transactions can be parsed by the Celo Ledger
5555

5656
## Can feature X be added?
5757

58-
Maybe, let's chat about it! Please see the [wallet Discord channel](https://discord.com/channels/600834479145353243/783806028629934110) for open discussion.
58+
Maybe, let's chat about it! Please see the [wallet Discord channel](https://discord.gg/ht885KmG5A) for open discussion.

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ See the [FAQ](FAQ.md) for more details about common questions.
1414

1515
This wallet uses [Subresource Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity). Current bundle hashes:
1616

17-
* Main bundle: `bundle.js -> sha256-x9oGHUxFMH+grTV/yqpWYsWnVdmD00PPolTahdB4sUE=`
18-
* Optional Ledger bundle: `bundle-ledger.js -> sha256-ahGOG1h2KTAtylviHC6GYqCX9Pa2NUleoytU5knhB6E=`
19-
* Optional WalletConnect bundle: `bundle-walletconnect.js -> sha256-eGLzdWvYcl/9NmhqTvc7j8/jhWAwauOnaGL4wNMs44w=`
17+
* Main bundle: `bundle.js -> sha256-kVZnRwd7Qa095vApngR7IxDK53ZSFJB86RzMYRpfPSU=`
18+
* Optional Ledger bundle: `bundle-ledger.js -> sha256-pNndh3uDU7f3K3e4nu05OXTE3Bx3WRMeVtr95liXJTE=`
19+
* Optional WalletConnect v1 bundle: `bundle-walletconnectv1.js -> sha256-PImYY1hPF519ZjZx2Pei7QsZ7kJyMpdtJgRKHT52ekg=`
20+
* Optional WalletConnect v2 bundle: `bundle-walletconnectv2.js -> sha256-UHsf1l/tWhpHJk2NMbCH1l372Pm8JoGxLLQqCLnNaLI=`
2021

2122
Advanced users can verify the source integrity by comparing the hashes in their page source to these values.
2223

@@ -47,7 +48,7 @@ yarn electron:dev
4748
## Contributing
4849

4950
For small contributions such as bug fixes or style tweaks, please open a Pull Request.
50-
For new features, please create an issue to start a discussion on [Discord](https://discord.com/channels/600834479145353243/812471799585439794).
51+
For new features, please create an issue to start a discussion on [Discord](https://discord.gg/ht885KmG5A).
5152

5253
## License
5354

electron/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function setCspHeader() {
6767
...details.responseHeaders,
6868
// Should match header in /netlify/_headers and build.sh
6969
'Content-Security-Policy': [
70-
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://relay.walletconnect.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
70+
"default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://*.walletconnect.org https://api.github.com; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'",
7171
],
7272
},
7373
})

netlify/_headers

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configure Netlify custom headers
22
# CSP header should match electron copy in /electron/main.js
33
/*
4-
Content-Security-Policy: default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://relay.walletconnect.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'
4+
Content-Security-Policy: default-src 'self'; script-src 'self' 'sha256-a0xx6QQjQFEl3BVHxY4soTXMFurPf9rWKnRLQLOkzg4='; connect-src 'self' https://*.celowallet.app https://*.celo.org wss://walletconnect.celo.org wss://*.walletconnect.org; img-src 'self' data:; style-src 'self' 'unsafe-inline'; font-src 'self' data:; base-uri 'self'; form-action 'self'
55
X-Frame-Options: DENY
66
X-Content-Type-Options: nosniff

package-electron.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.3.7",
3+
"version": "1.4.0",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"main": "main.js",
66
"keywords": [
@@ -15,7 +15,7 @@
1515
"homepage": "https://celowallet.app",
1616
"license": "MIT",
1717
"dependencies": {
18-
"electron-updater": "^4.3.9",
18+
"electron-updater": "^4.6.1",
1919
"@ledgerhq/hw-transport-node-hid-noevents": "^5.51.1"
2020
}
2121
}

package.json

Lines changed: 53 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "celo-web-wallet",
3-
"version": "1.3.7",
3+
"version": "1.4.0",
44
"description": "A lightweight web and desktop wallet for the Celo network",
55
"keywords": [
66
"Celo",
@@ -20,7 +20,7 @@
2020
"build:staging": "./scripts/build.sh -n Alfajores",
2121
"build:prod": "./scripts/build.sh -n Mainnet",
2222
"clean": "rm -rf dist dist-electron",
23-
"lint": "eslint src/**/*.ts src/**/*.tsx",
23+
"lint": "eslint src",
2424
"test": "NODE_ENV=test jasmine",
2525
"electron:postinstall": "electron-builder install-app-deps",
2626
"electron:build": "./scripts/build.sh -n Mainnet -e",
@@ -29,73 +29,79 @@
2929
"electron:prod": "yarn electron:build && DEBUG=electron-builder electron-builder --publish never"
3030
},
3131
"dependencies": {
32-
"@celo-tools/celo-ethers-wrapper": "^0.0.5",
33-
"@emotion/react": "^11.4.1",
32+
"@celo-tools/celo-ethers-wrapper": "^0.1.0",
33+
"@emotion/react": "^11.7.0",
3434
"@ledgerhq/hw-app-eth": "^5.51.1",
3535
"@ledgerhq/hw-transport-node-hid-noevents": "^5.51.1",
3636
"@ledgerhq/hw-transport-u2f": "5.36.0-deprecated",
3737
"@ledgerhq/hw-transport-webhid": "^5.51.1",
3838
"@ledgerhq/hw-transport-webusb": "^5.51.1",
3939
"@metamask/jazzicon": "https://github.com/jmrossy/jazzicon#7a8df28",
40-
"@reduxjs/toolkit": "^1.6.1",
41-
"@walletconnect/client": "2.0.0-beta.19",
40+
"@reduxjs/toolkit": "^1.6.2",
4241
"buffer": "^6.0.3",
43-
"electron-updater": "^4.3.9",
44-
"ethers": "^5.3.0",
42+
"electron-updater": "^4.6.1",
43+
"ethers": "^5.5.1",
4544
"frappe-charts": "^1.6.2",
46-
"history": "^5.0.1",
47-
"idb-keyval": "^6.0.1",
45+
"history": "^5.1.0",
46+
"idb-keyval": "^6.0.3",
4847
"react": "^17.0.2",
4948
"react-dom": "^17.0.2",
50-
"react-redux": "^7.2.5",
51-
"react-router": "^6.0.0-beta.4",
52-
"react-router-dom": "^6.0.0-beta.4",
49+
"react-redux": "^7.2.6",
50+
"react-router": "^6.0.2",
51+
"react-router-dom": "^6.0.2",
5352
"react-window": "^1.8.6",
5453
"redux-persist": "^6.0.0",
5554
"redux-saga": "^1.1.3",
56-
"typed-redux-saga": "^1.3.1"
55+
"typed-redux-saga": "^1.3.1",
56+
"wcv1/client": "npm:@walletconnect/client@1.6.6",
57+
"wcv2/client": "npm:@walletconnect/client@2.0.0-beta.20.3",
58+
"wcv2/types": "npm:@walletconnect/types@2.0.0-beta.20.3",
59+
"wcv2/utils": "npm:@walletconnect/utils@2.0.0-beta.20.3"
5760
},
5861
"devDependencies": {
59-
"@babel/core": "^7.15.5",
60-
"@babel/plugin-transform-runtime": "^7.15.0",
61-
"@babel/preset-env": "^7.15.6",
62-
"@babel/preset-react": "^7.14.5",
63-
"@babel/preset-typescript": "^7.15.0",
64-
"@babel/register": "^7.15.3",
62+
"@babel/core": "^7.16.0",
63+
"@babel/plugin-transform-runtime": "^7.16.4",
64+
"@babel/preset-env": "^7.16.4",
65+
"@babel/preset-react": "^7.16.0",
66+
"@babel/preset-typescript": "^7.16.0",
67+
"@babel/register": "^7.16.0",
6568
"@emotion/babel-plugin": "^11.3.0",
66-
"@testing-library/react": "^12.1.0",
67-
"@types/jasmine": "^3.9.1",
68-
"@types/react": "^17.0.21",
69-
"@types/react-dom": "^17.0.9",
70-
"@types/react-redux": "^7.1.18",
69+
"@types/jasmine": "^3.10.2",
70+
"@types/react": "^17.0.37",
71+
"@types/react-dom": "^17.0.11",
72+
"@types/react-redux": "^7.1.20",
7173
"@types/react-window": "^1.8.5",
7274
"@types/redux-mock-store": "^1.0.3",
73-
"@typescript-eslint/eslint-plugin": "^4.31.1",
74-
"@typescript-eslint/parser": "^4.31.1",
75-
"babel-loader": "^8.2.2",
75+
"@typescript-eslint/eslint-plugin": "^5.4.0",
76+
"@typescript-eslint/parser": "^5.4.0",
77+
"babel-loader": "^8.2.3",
7678
"babel-plugin-module-name-mapper": "^1.2.0",
77-
"copy-webpack-plugin": "^9.0.1",
78-
"css-loader": "^6.2.0",
79-
"electron": "^14.0.1",
80-
"electron-builder": "^22.11.7",
79+
"copy-webpack-plugin": "^10.0.0",
80+
"css-loader": "^6.5.1",
81+
"electron": "^16.0.2",
82+
"electron-builder": "^22.14.5",
8183
"electron-notarize": "^1.1.1",
82-
"eslint": "^7.32.0",
83-
"eslint-loader": "^4.0.2",
84-
"eslint-plugin-import": "^2.24.2",
85-
"eslint-plugin-react": "^7.25.1",
86-
"jasmine": "^3.9.0",
87-
"jsdom": "^17.0.0",
88-
"node-fetch": "^2.6.5",
89-
"prettier": "^2.4.1",
84+
"eslint": "^8.3.0",
85+
"eslint-plugin-import": "^2.25.3",
86+
"eslint-plugin-react": "^7.27.1",
87+
"eslint-webpack-plugin": "^3.1.1",
88+
"jasmine": "^3.10.0",
89+
"node-fetch": "^2.6.6",
90+
"prettier": "^2.5.0",
9091
"redux-mock-store": "^1.5.4",
91-
"style-loader": "^3.2.1",
92-
"ts-loader": "^9.2.5",
93-
"typescript": "^4.4.3",
94-
"webpack": "^5.53.0",
95-
"webpack-cli": "^4.8.0",
96-
"webpack-dev-server": "^4.2.1"
92+
"style-loader": "^3.3.1",
93+
"ts-loader": "^9.2.6",
94+
"typescript": "^4.5.2",
95+
"webpack": "^5.64.4",
96+
"webpack-cli": "^4.9.1",
97+
"webpack-dev-server": "^4.6.0"
9798
},
9899
"resolutions": {
99-
"pbkdf2": "^3.1.2"
100+
"pbkdf2": "^3.1.2",
101+
"wcv2/client": "npm:@walletconnect/client@2.0.0-beta.20.3",
102+
"wcv2/types": "npm:@walletconnect/types@2.0.0-beta.20.3",
103+
"wcv2/utils": "npm:@walletconnect/utils@2.0.0-beta.20.3",
104+
"wcv2/**/@walletconnect/types": "npm:@walletconnect/types@2.0.0-beta.20.3",
105+
"wcv2/**/@walletconnect/utils": "npm:@walletconnect/utils@2.0.0-beta.20.3"
100106
}
101107
}

scripts/build.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,10 @@ export BUNDLE_HASH=`shasum -b -a 256 dist/bundle.js | awk '{ print $1 }' | xxd -
4242
echo "Bundle hash ${BUNDLE_HASH}"
4343
export LEDGER_BUNDLE_HASH=`shasum -b -a 256 dist/bundle-ledger.js | awk '{ print $1 }' | xxd -r -p | base64`
4444
echo "Ledger bundle hash ${LEDGER_BUNDLE_HASH}"
45-
export WC_BUNDLE_HASH=`shasum -b -a 256 dist/bundle-walletconnect.js | awk '{ print $1 }' | xxd -r -p | base64`
46-
echo "WalletConnect bundle hash ${WC_BUNDLE_HASH}"
45+
export WC1_BUNDLE_HASH=`shasum -b -a 256 dist/bundle-walletconnectv1.js | awk '{ print $1 }' | xxd -r -p | base64`
46+
echo "WalletConnect v1 bundle hash ${WC1_BUNDLE_HASH}"
47+
export WC2_BUNDLE_HASH=`shasum -b -a 256 dist/bundle-walletconnectv2.js | awk '{ print $1 }' | xxd -r -p | base64`
48+
echo "WalletConnect v2 bundle hash ${WC2_BUNDLE_HASH}"
4749

4850
echo "Updating index.html bundle hash"
4951
xplat_sed "s|sha256-%BUNDLE_HASH%|sha256-${BUNDLE_HASH}|g" dist/index.html
@@ -56,7 +58,8 @@ if [ "$ELECTRON" = false ]; then
5658
echo "Updating Readme"
5759
xplat_sed "s|bundle.js -> sha256-.*\`|bundle.js -> sha256-${BUNDLE_HASH}\`|g" README.md
5860
xplat_sed "s|bundle-ledger.js -> sha256-.*\`|bundle-ledger.js -> sha256-${LEDGER_BUNDLE_HASH}\`|g" README.md
59-
xplat_sed "s|bundle-walletconnect.js -> sha256-.*\`|bundle-walletconnect.js -> sha256-${WC_BUNDLE_HASH}\`|g" README.md
61+
xplat_sed "s|bundle-walletconnectv1.js -> sha256-.*\`|bundle-walletconnectv1.js -> sha256-${WC1_BUNDLE_HASH}\`|g" README.md
62+
xplat_sed "s|bundle-walletconnectv2.js -> sha256-.*\`|bundle-walletconnectv2.js -> sha256-${WC2_BUNDLE_HASH}\`|g" README.md
6063
else
6164
echo "Prepping index.html for electron"
6265
# Trim title down

spec/helpers/global.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,18 @@ global.__DEBUG__ = true
22
global.__IS_ELECTRON__ = false
33
global.__VERSION__ = '1.0.0'
44
global.fetch = require('node-fetch')
5+
6+
var localStorage = {}
7+
localStorage.setItem = function (key, val) {
8+
this[key] = val + ''
9+
}
10+
localStorage.getItem = function (key) {
11+
return this[key]
12+
}
13+
Object.defineProperty(localStorage, 'length', {
14+
get: function () {
15+
return Object.keys(this).length - 2
16+
},
17+
})
18+
global.localStorage = localStorage
19+
global.navigator = {}

spec/helpers/jsdom.js

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/blockchain/contracts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ function getContractAbi(c: CeloContract) {
4848
return EscrowAbi
4949
case CeloContract.Exchange:
5050
case CeloContract.ExchangeEUR:
51+
case CeloContract.ExchangeBRL:
5152
return ExchangeAbi
5253
case CeloContract.GoldToken:
5354
return GoldTokenAbi
@@ -59,6 +60,7 @@ function getContractAbi(c: CeloContract) {
5960
return SortedOraclesAbi
6061
case CeloContract.StableToken:
6162
case CeloContract.StableTokenEUR:
63+
case CeloContract.StableTokenBRL:
6264
return StableTokenAbi
6365
case CeloContract.Validators:
6466
return ValidatorsAbi

0 commit comments

Comments
 (0)