diff --git a/package.json b/package.json index 75d8209..e038a2b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bnc-notify", - "version": "1.6.2", + "version": "1.7.0", "description": "Show web3 users realtime transaction notifications", "keywords": [ "ethereum", @@ -50,7 +50,7 @@ }, "dependencies": { "bignumber.js": "^9.0.0", - "bnc-sdk": "^3.3.4", + "bnc-sdk": "^3.4.1", "lodash.debounce": "^4.0.8", "regenerator-runtime": "^0.13.3", "uuid": "^3.3.3" diff --git a/src/notify.ts b/src/notify.ts index 2cccd19..919db33 100644 --- a/src/notify.ts +++ b/src/notify.ts @@ -67,11 +67,13 @@ import { createEmitter } from './utilities' import { version } from '../package.json' let notify: any +let blocknative function init(options: InitOptions): API { if (notify) { console.warn('notify has already been initialized') notify.$destroy() + blocknative && blocknative.destroy() } validateInit(options) @@ -85,8 +87,6 @@ function init(options: InitOptions): API { transactionHandlers.push(transactionHandler) } - let blocknative - if (dappId) { blocknative = new BlocknativeSdk({ dappId, diff --git a/yarn.lock b/yarn.lock index 14c8f99..dcb7fbc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1274,10 +1274,10 @@ bindings@^1.5.0: dependencies: file-uri-to-path "1.0.0" -bnc-sdk@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.3.0.tgz#a690abe7570a43745936a308006fa52c1d806017" - integrity sha512-5MaL1uhKQn3dY3uBfW5HujXCS988/vMX0MY7LtkDjmA396a3DSbGcGySsHVsJZCBVopUupl0geI5w28+p8PG9g== +bnc-sdk@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/bnc-sdk/-/bnc-sdk-3.4.1.tgz#fca070656a6efbfc489889ed0404e1b6289c17ff" + integrity sha512-GrZzN3zyqVOmtk++tvq/X1zchO+Bt9TIzw39xv7UkMLEUcs43pwj6XWphLRbqkrrILNSrLwOI0S8opyjffDFAA== dependencies: crypto-es "^1.2.2" rxjs "^6.6.3"