bnc-assist
Advanced tools
Comparing version 0.10.2 to 0.10.3
{ | ||
"name": "bnc-assist", | ||
"version": "0.10.2", | ||
"version": "0.10.3", | ||
"description": "Blocknative Assist js library for Dapp developers", | ||
@@ -5,0 +5,0 @@ "main": "lib/assist.min.js", |
@@ -46,3 +46,3 @@ # Assist.js | ||
The library uses [semantic versioning](https://semver.org/spec/v2.0.0.html). | ||
The current version is 0.10.2. | ||
The current version is 0.10.3. | ||
There are minified and non-minified versions. | ||
@@ -52,7 +52,7 @@ Put this script at the top of your `<head>` | ||
```html | ||
<script src="https://assist.blocknative.com/0-10-2/assist.js"></script> | ||
<script src="https://assist.blocknative.com/0-10-3/assist.js"></script> | ||
<!-- OR... --> | ||
<script src="https://assist.blocknative.com/0-10-2/assist.min.js"></script> | ||
<script src="https://assist.blocknative.com/0-10-3/assist.min.js"></script> | ||
``` | ||
@@ -199,2 +199,4 @@ | ||
txSendFail: Function, // Transaction failed to be sent to the network | ||
txUnderpriced: Function, // Transaction gas limit was set too low | ||
txError: Function, // An unknown MetaMask / JSON RPC error occurred when trying to send the transaction | ||
txStallPending: Function, // Transaction was sent to the network but has not been detected in the txPool | ||
@@ -201,0 +203,0 @@ txStallConfirmed: Function, // Transaction has been detected in the mempool but hasn't been confirmed |
@@ -134,4 +134,4 @@ import uuid from 'uuid/v4' | ||
export function extractMessageFromError(message) { | ||
if (!message) { | ||
export function extractMessageFromError(error) { | ||
if (!error.stack || !error.message) { | ||
return { | ||
@@ -143,2 +143,4 @@ eventCode: 'txError', | ||
const message = error.stack || error.message | ||
if (message.includes('User denied transaction signature')) { | ||
@@ -182,2 +184,3 @@ return { | ||
case 'txUnderpriced': | ||
case 'txError': | ||
case 'error': | ||
@@ -184,0 +187,0 @@ return 'failed' |
@@ -389,3 +389,3 @@ import { state } from '~/js/helpers/state' | ||
function onTxError(id, error, categoryCode) { | ||
const { errorMsg, eventCode } = extractMessageFromError(error.message) | ||
const { errorMsg, eventCode } = extractMessageFromError(error) | ||
@@ -392,0 +392,0 @@ let txObj = getTxObjFromQueue(id) |
@@ -384,3 +384,5 @@ import { state } from '~/js/helpers/state' | ||
txUnderpriced: () => | ||
'The gas price for your transaction is too low, try again with a higher gas price' | ||
'The gas price for your transaction is too low, try again with a higher gas price', | ||
txError: () => | ||
'An unknown error has occurred with your transaction, please try again' | ||
} |
@@ -82,3 +82,4 @@ import { state } from '~/js/helpers/state' | ||
txCancel: notificationsUI, | ||
txUnderpriced: notificationsUI | ||
txUnderpriced: notificationsUI, | ||
txError: notificationsUI | ||
}, | ||
@@ -99,3 +100,4 @@ activeContract: { | ||
txCancel: notificationsUI, | ||
txUnderpriced: notificationsUI | ||
txUnderpriced: notificationsUI, | ||
txError: notificationsUI | ||
}, | ||
@@ -102,0 +104,0 @@ userInitiatedNotify: { |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2615592
13126
814