Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 6 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-0.0.2",
"version": "0.13.2-0.0.3",
"dependencies": {
"bnc-notify": "^1.9.1",
"bnc-notify-staging": "https://github.com/blocknative/notify#develop",
Expand Down
16 changes: 9 additions & 7 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,13 +171,15 @@ const App = () => {
value: 1000000000000000
}

const sendTransaction = () =>
signer.sendTransaction(txDetails).then(tx => tx.hash)
const sendTransaction = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function needs to return the result from the call to signer.sendTransaction

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh yeah whoops! Good catch!! Ill make sure my formatter on this machine is doin wonky stuff like this in the future.

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 = () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also needs to return the result of the call to estimateGas

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

const { emitter } = await notify.transaction({
sendTransaction,
Expand All @@ -203,7 +205,9 @@ const 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 Down Expand Up @@ -530,8 +534,6 @@ const App = () => {
</span>
</div>
</main>
) : (
<div>Loading...</div>
)
}

Expand Down
20 changes: 12 additions & 8 deletions src/networkEnum.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
const networkEnum = Object.freeze({
1: 'main',
3: 'ropsten',
4: 'rinkeby',
5: 'goerli',
42: 'kovan',
100: 'xdai',
'localhost': 'localhost'
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;
export default networkEnum;