New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bnc-assist

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bnc-assist - npm Package Compare versions

Comparing version 0.9.5 to 0.9.6

2

package.json
{
"name": "bnc-assist",
"version": "0.9.5",
"version": "0.9.6",
"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.9.5.
The current version is 0.9.6.
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-9-5/assist.js"></script>
<script src="https://assist.blocknative.com/0-9-6/assist.js"></script>
<!-- OR... -->
<script src="https://assist.blocknative.com/0-9-5/assist.min.js"></script>
<script src="https://assist.blocknative.com/0-9-6/assist.min.js"></script>
```

@@ -59,0 +59,0 @@

@@ -99,4 +99,5 @@ import uuid from 'uuid/v4'

typeof last(allArgsCopy) === 'object' &&
(last(allArgsCopy).messages || last(allArgsCopy).clickHandlers) &&
takeLast(allArgsCopy)
(last(allArgsCopy).messages || last(allArgsCopy).clickHandlers)
? takeLast(allArgsCopy)
: {}

@@ -247,8 +248,10 @@ const callback =

export function handleError(handlers = {}) {
return errorObj => {
return (errorObj, receipt) => {
const { callback, reject, resolve, promiEvent } = handlers
if (promiEvent) {
promiEvent.emit('error', errorObj)
promiEvent.emit('error', errorObj, receipt)
promiEvent.reject(errorObj)
resolve()
return

@@ -255,0 +258,0 @@ }

@@ -223,4 +223,4 @@ import { state } from '~/js/helpers/state'

return waitForTransactionReceipt(hash).then(() => {
onTxReceipt(transactionId, categoryCode)
return waitForTransactionReceipt(hash).then(receipt => {
onTxReceipt(transactionId, categoryCode, receipt)
})

@@ -239,4 +239,4 @@ })

await tx.wait()
onTxReceipt(transactionId, categoryCode)
const receipt = await tx.wait()
onTxReceipt(transactionId, categoryCode, receipt)
})

@@ -248,30 +248,24 @@ .catch(errorObj => {

} else {
new Promise(confirmed => {
/* In web3 v1 instead of resolving the promise returned by sendTransaction
* we need to setup the promiEvent argument to mirror the behavior of the
* promiEvent returned by web3 when we call .send on the contract method.
*/
txPromise
.on('transactionHash', hash => {
promiEvent.emit('transactionHash', hash)
onTxHash(transactionId, hash, categoryCode)
callback && callback(null, hash)
})
.on('receipt', receipt => {
promiEvent.emit('receipt', receipt)
confirmed(receipt)
})
.once('confirmation', confirmed)
.on('confirmation', (confirmation, receipt) => {
promiEvent.emit('confirmation', confirmation, receipt)
})
.on('error', errorObj => {
promiEvent.emit('error', errorObj)
onTxError(transactionId, errorObj, categoryCode)
handleError({ resolve, reject, callback })(errorObj)
})
.then(promiEvent.resolve)
.catch(promiEvent.reject)
}).then(() => onTxReceipt(transactionId, categoryCode))
txPromise
.on('transactionHash', hash => {
promiEvent.emit('transactionHash', hash)
onTxHash(transactionId, hash, categoryCode)
callback && callback(null, hash)
})
.on('receipt', receipt => {
promiEvent.emit('receipt', receipt)
promiEvent.resolve(receipt)
resolve()
onTxReceipt(transactionId, categoryCode, receipt)
})
.on('confirmation', (confirmation, receipt) => {
promiEvent.emit('confirmation', confirmation, receipt)
})
.on('error', (errorObj, receipt) => {
onTxError(transactionId, errorObj, categoryCode)
handleError({ resolve, reject, callback, promiEvent })(
errorObj,
receipt
)
})
}

@@ -339,9 +333,9 @@ })

async function onTxReceipt(id, categoryCode) {
async function onTxReceipt(id, categoryCode, receipt) {
let txObj = getTxObjFromQueue(id)
if (txObj.transaction.status === 'confirmed') {
txObj = updateTransactionInQueue(id, { status: 'completed' })
txObj = updateTransactionInQueue(id, { status: 'completed', receipt })
} else {
txObj = updateTransactionInQueue(id, { status: 'confirmed' })
txObj = updateTransactionInQueue(id, { status: 'confirmed', receipt })
}

@@ -348,0 +342,0 @@

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc