Skip to content

Commit

Permalink
Release/0.13.3 (#111)
Browse files Browse the repository at this point in the history
* 0.13.2-0.0.1: [fix] - Circle CI build (#108)

* Update CI node version

* Change node version CI

* Fix build issue by upping resources for yarn build in config.yml, small refactors to create a networks enum, es6 arrow func standards

* bump version

* fix naming of network enum file

* fix naming of network enum file

Co-authored-by: Adam Carpenter <Adam@blocknative.com>

* 0.13.2-0.0.2: [fix] - Increase resources for circleCI prod build (#109)

* Increase resources for circleCI prod build

* increment version

Co-authored-by: Adam Carpenter <Adam@blocknative.com>

* 0.13.2-0.0.3: [enhancement] - Add popular networks support, reformatting using prettier (#110)

* Added popular networks to enum

* Reformat code using prettier

* increment version

* Add Main tag to Eth network

* add returns to new blocks and remove consoleLog

Co-authored-by: Adam Carpenter <Adam@blocknative.com>

* Increase circleCI build resources, code enhancements

* 0.13.2-0.0.4: Depandabot - Bump tmpl from 1.0.4 to 1.0.5 (#107)

* Update CI node version

* Change node version CI

* Bump tmpl from 1.0.4 to 1.0.5

Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: Taylor Dawson <taylorjdawson@gmail.com>
Co-authored-by: Adam Carpenter <Adam@blocknative.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
  • Loading branch information
5 people authored Nov 30, 2021
1 parent fbe044c commit ec50718
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 44 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,19 @@ jobs:
deploy_stage:
docker:
- image: cimg/node:14.17.3
resource_class: medium+
steps:
- checkout
- run: rm yarn.lock && yarn install --network-concurrency 1
- run: yarn build-staging
- run: ssh -oStrictHostKeyChecking=no -v $EC2_PROD_USER@$EC2_PROD_IP "sh /home/ubuntu/remove.sh reactdemo-staging"
- run: scp -oStrictHostKeyChecking=no -v -r /home/circleci/project/build/* $EC2_PROD_USER@$EC2_PROD_IP:/home/ubuntu/reactdemo-staging/
- run: ssh -oStrictHostKeyChecking=no -v $EC2_PROD_USER@$EC2_PROD_IP "sh /home/ubuntu/move.sh reactdemo-staging"

deploy_prod:
docker:
- image: cimg/node:14.17.3
resource_class: medium+
steps:
- checkout
- run: yarn cache clean && yarn install --network-concurrency 1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onboard-notify-react",
"version": "0.13.2",
"version": "0.13.3",
"dependencies": {
"bnc-notify": "^1.9.1",
"bnc-notify-staging": "https://github.com/blocknative/notify#develop",
Expand Down
67 changes: 27 additions & 40 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import getSigner from './signer'
import { initOnboard, initNotify } from './services'
import { version, dependencies } from '../package.json'
import avatarPlaceholder from './avatar-placeholder.png'
import networkEnum from './networkEnum'

import './App.css'

Expand Down Expand Up @@ -34,7 +35,7 @@ const internalTransferABI = [

let internalTransferContract

function App() {
const App = () => {
const [address, setAddress] = useState(null)
const [ens, setEns] = useState(null)
const [network, setNetwork] = useState(null)
Expand Down Expand Up @@ -86,16 +87,15 @@ function App() {
}, [])

useEffect(() => {
const previouslySelectedWallet = window.localStorage.getItem(
'selectedWallet'
)
const previouslySelectedWallet =
window.localStorage.getItem('selectedWallet')

if (previouslySelectedWallet && onboard) {
onboard.walletSelect(previouslySelectedWallet)
}
}, [onboard])

async function readyToTransact() {
const readyToTransact = async () => {
if (!provider) {
const walletSelected = await onboard.walletSelect()
if (!walletSelected) return false
Expand All @@ -105,7 +105,7 @@ function App() {
return ready
}

async function sendHash() {
const sendHash = async () => {
if (!toAddress) {
alert('An Ethereum address to send Eth to is required.')
return
Expand Down Expand Up @@ -136,7 +136,7 @@ function App() {
emitter.on('txFailed', console.log)
}

async function sendInternalTransaction() {
const sendInternalTransaction = async () => {
if (!toAddress) {
alert('An Ethereum address to send Eth to is required.')
return
Expand All @@ -159,7 +159,7 @@ function App() {
emitter.on('txFailed', console.log)
}

async function sendTransaction() {
const sendTransaction = async () => {
if (!toAddress) {
alert('An Ethereum address to send Eth to is required.')
}
Expand All @@ -171,13 +171,15 @@ function App() {
value: 1000000000000000
}

const sendTransaction = () =>
signer.sendTransaction(txDetails).then(tx => tx.hash)
const sendTransaction = () => {
return signer.sendTransaction(txDetails).then(tx => tx.hash)
}

const gasPrice = () => provider.getGasPrice().then(res => res.toString())

const estimateGas = () =>
provider.estimateGas(txDetails).then(res => res.toString())
const estimateGas = () => {
return provider.estimateGas(txDetails).then(res => res.toString())
}

const { emitter } = await notify.transaction({
sendTransaction,
Expand All @@ -203,7 +205,9 @@ function App() {
emitter.on('txFailed', console.log)
}

return onboard && notify ? (
if (!onboard || !notify) return <div>Loading...</div>

return (
<main>
<header className="user-info">
{ens && ens.name ? (
Expand All @@ -213,9 +217,13 @@ function App() {
src={ens.avatar ? ens.avatar : avatarPlaceholder}
alt="avatar"
></img>
<div style={{
marginLeft: '10px'
}}>{ens.name}</div>
<div
style={{
marginLeft: '10px'
}}
>
{ens.name}
</div>
</span>
) : (
address && <span>{address}</span>
Expand All @@ -225,7 +233,9 @@ function App() {
{Number(balance) > 0 ? balance / 1000000000000000000 : balance} ETH
</span>
)}
{network && <span>{networkName(network)} network</span>}
{network && (
<span>{networkEnum?.[Number(network)] || 'local'} network</span>
)}
</header>
<section className="main">
<div className="container">
Expand Down Expand Up @@ -524,30 +534,7 @@ function App() {
</span>
</div>
</main>
) : (
<div>Loading...</div>
)
}

function networkName(id) {
switch (Number(id)) {
case 1:
return 'main'
case 3:
return 'ropsten'
case 4:
return 'rinkeby'
case 5:
return 'goerli'
case 42:
return 'kovan'
case 100:
return 'xdai'
case 'localhost':
return 'localhost'
default:
return 'local'
}
}

export default App
14 changes: 14 additions & 0 deletions src/networkEnum.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const networkEnum = Object.freeze({
1: 'Ethereum Main',
3: 'Ropsten',
4: 'Rinkeby',
5: 'Goerli',
25: 'Cronos',
42: 'Kovan',
56: 'BSC',
100: 'XDai',
137: 'Polygon',
250: 'Fantom',
localhost: 'localhost'
});
export default networkEnum;
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14391,9 +14391,9 @@ tmp@^0.0.33:
os-tmpdir "~1.0.2"

tmpl@1.0.x:
version "1.0.4"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1"
integrity sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==

to-arraybuffer@^1.0.0:
version "1.0.1"
Expand Down

0 comments on commit ec50718

Please sign in to comment.