diff --git a/package.json b/package.json index d250541..f54af97 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bnc-notify", - "version": "1.5.0", + "version": "1.5.1", "description": "Show web3 users realtime transaction notifications", "keywords": [ "ethereum", diff --git a/src/transactions.ts b/src/transactions.ts index da67715..02576c0 100644 --- a/src/transactions.ts +++ b/src/transactions.ts @@ -32,9 +32,13 @@ export function handlePreFlightEvent( status } = preflightEvent - const contract = { - methodName: contractCall.methodName, - parameters: contractCall.params + let contract + + if (contractCall) { + contract = { + methodName: contractCall.methodName, + parameters: contractCall.params + } } blocknative.event({ @@ -42,14 +46,14 @@ export function handlePreFlightEvent( eventCode, transaction: txDetails, wallet: { balance }, - contract + contract: contractCall ? contract : undefined }) const transaction = { ...txDetails, eventCode, status, - contractCall + contractCall: contract ? contractCall : undefined } const emitterResult = emitter.emit(transaction) diff --git a/yarn.lock b/yarn.lock index 76a0628..80afc8d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2663,9 +2663,9 @@ object-keys@^1.0.11, object-keys@^1.0.12: integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== object-path@^0.11.4: - version "0.11.4" - resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.4.tgz#370ae752fbf37de3ea70a861c23bba8915691949" - integrity sha1-NwrnUvvzfePqcKhhwju6iRVpGUk= + version "0.11.5" + resolved "https://registry.yarnpkg.com/object-path/-/object-path-0.11.5.tgz#d4e3cf19601a5140a55a16ad712019a9c50b577a" + integrity sha512-jgSbThcoR/s+XumvGMTMf81QVBmah+/Q7K7YduKeKVWL7N111unR2d6pZZarSk6kY/caeNxUDyxOvMWyzoU2eg== object-resolve-path@^1.1.1: version "1.1.1"