diff --git a/package.json b/package.json index 77fcaf79..45d38a06 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "apollo-link-state": "^0.4.1", "apollo-upload-client": "^10.0.0", "apollo-utilities": "^1.0.21", + "bnc-notify": "^1.9.1", "bnc-onboard": "^1.34.1", "decimal.js": "^10.0.1", "es6-promisify": "^6.0.0", diff --git a/src/GlobalState.js b/src/GlobalState.js index 5a9e9c61..e9c628ab 100644 --- a/src/GlobalState.js +++ b/src/GlobalState.js @@ -4,6 +4,7 @@ import { withApollo } from 'react-apollo' import jwt from 'jsonwebtoken' import Web3 from 'web3' import Onboard from 'bnc-onboard' +import Notify from 'bnc-notify' import { track } from './api/analytics' import { @@ -134,6 +135,12 @@ class Provider extends Component { } }) this.setState({ onboard }) + + var notify = Notify({ + dappId: BLOCKNATIVE_DAPPID || testid, + networkId: parseInt(networkId) // [Integer] The Ethereum network ID your Dapp uses. + }) + this.setState({ notify }) } let result = { diff --git a/src/api/utils.js b/src/api/utils.js index 27aa9f3b..9bfb4617 100644 --- a/src/api/utils.js +++ b/src/api/utils.js @@ -1,5 +1,6 @@ import { events } from '@wearekickback/contracts' import { parseLog } from 'ethereum-event-logs' +import { getProvider } from '../GlobalState' export const extractNewPartyAddressFromTx = tx => { // coerce events into logs if available @@ -15,9 +16,14 @@ export const extractNewPartyAddressFromTx = tx => { } export function txHelper(web3TxObj) { - return new Promise(resolve => { - web3TxObj.on('transactionHash', hash => { - resolve(hash) + getProvider().then(provider => { + return new Promise(resolve => { + web3TxObj.on('transactionHash', hash => { + if (provider.state.notify) { + provider.state.notify.hash(hash) + } + resolve(hash) + }) }) }) } diff --git a/src/routes/Faq.js b/src/routes/Faq.js index 9c1c0fe4..41e21fe8 100644 --- a/src/routes/Faq.js +++ b/src/routes/Faq.js @@ -19,7 +19,11 @@ class FAQ extends Component { .

Can I cancel my registration?

-

No. The purpose of Kickback is to create an incentive for attendees to commit to plans, whilst simultaneously taking the risk off of event organisers and venues.

+

+ No. The purpose of Kickback is to create an incentive for attendees to + commit to plans, whilst simultaneously taking the risk off of event + organisers and venues. +

What happens if the event is canceled?

In case the event is canceled, all registered people can withdraw diff --git a/yarn.lock b/yarn.lock index 4bad7525..8db29f77 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7230,6 +7230,17 @@ bnb-javascript-sdk-nobroadcast@^2.16.14: uuid "^3.3.2" websocket-stream "^5.5.0" +bnc-notify@^1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/bnc-notify/-/bnc-notify-1.9.1.tgz#cd8ec8e5f5482cf78b6caea7de35288ee73d6b32" + integrity sha512-OWXI6KIOU/0CWhlFBiIStfbio3X5uUTeBjG6h4R7Ng6MABqZHMFRCNOgVQ50HdwwZiaFMuA3l23cZLxJjyaY0Q== + dependencies: + bignumber.js "^9.0.0" + bnc-sdk "^3.5.0" + lodash.debounce "^4.0.8" + regenerator-runtime "^0.13.3" + uuid "^3.3.3" + bnc-onboard@^1.34.1: version "1.34.1" resolved "https://registry.yarnpkg.com/bnc-onboard/-/bnc-onboard-1.34.1.tgz#51a47dd86e11e60b5360f3c50098f6930196b72c" @@ -7276,6 +7287,15 @@ bnc-sdk@^3.4.1: rxjs "^6.6.3" sturdy-websocket "^0.1.12" +bnc-sdk@^3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.5.0.tgz#b863a2d947857d87c56d53261bd43529f1a5c03e" + integrity sha512-4CSon8xRTjtD7YOUDJcyqZ/bKCNNwDc4sOPq6O19AlolYTsbbVvh+p5EOmYqL4Re30hI3lKQxN4sh12A6VnAPQ== + dependencies: + crypto-es "^1.2.2" + rxjs "^6.6.3" + sturdy-websocket "^0.1.12" + body-parser@1.19.0, body-parser@^1.16.0, body-parser@^1.18.3: version "1.19.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" @@ -12352,7 +12372,28 @@ fs.realpath@^1.0.0: resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= -fsevents@1.2.4, fsevents@2.3.2, fsevents@^1.2.3, fsevents@^1.2.7, fsevents@~2.1.2, fsevents@~2.3.1: +fsevents@1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.4.tgz#f41dcb1af2582af3692da36fc55cbd8e1041c426" + integrity sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg== + dependencies: + nan "^2.9.2" + node-pre-gyp "^0.10.0" + +fsevents@^1.2.3, fsevents@^1.2.7: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +fsevents@~2.3.1: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== @@ -17314,6 +17355,11 @@ nan@^2.12.1, nan@^2.13.2, nan@^2.14.0, nan@^2.14.2, nan@^2.2.1: resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== +nan@^2.9.2: + version "2.15.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.15.0.tgz#3f34a473ff18e15c1b5626b62903b5ad6e665fee" + integrity sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ== + nano-base32@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/nano-base32/-/nano-base32-1.0.1.tgz#ba548c879efcfb90da1c4d9e097db4a46c9255ef" @@ -17566,6 +17612,22 @@ node-notifier@^5.2.1: shellwords "^0.1.1" which "^1.3.0" +node-pre-gyp@^0.10.0: + version "0.10.3" + resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc" + integrity sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A== + dependencies: + detect-libc "^1.0.2" + mkdirp "^0.5.1" + needle "^2.2.1" + nopt "^4.0.1" + npm-packlist "^1.1.6" + npmlog "^4.0.2" + rc "^1.2.7" + rimraf "^2.6.1" + semver "^5.3.0" + tar "^4" + node-pre-gyp@^0.11.0: version "0.11.0" resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz#db1f33215272f692cd38f03238e3e9b47c5dd054" @@ -21217,6 +21279,11 @@ regenerator-runtime@^0.12.0: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de" integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg== +regenerator-runtime@^0.13.3: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + regenerator-runtime@^0.13.4, regenerator-runtime@^0.13.7: version "0.13.7" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz#cac2dacc8a1ea675feaabaeb8ae833898ae46f55" @@ -24469,7 +24536,7 @@ uuid@8.3.2, uuid@^8.0.0, uuid@^8.3.2: resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" integrity sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg== -uuid@^3.0.1, uuid@^3.1.0, uuid@^3.2.1, uuid@^3.3.2, uuid@^3.4.0: +uuid@^3.0.1, uuid@^3.1.0, uuid@^3.2.1, uuid@^3.3.2, uuid@^3.3.3, uuid@^3.4.0: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==