Skip to content

Commit

Permalink
Merge pull request #76 from blocknative/develop
Browse files Browse the repository at this point in the history
Release 2.1.2
lnbc1QWFyb24 authored May 5, 2020
2 parents 0a5c573 + fdf618c commit a25d201
Showing 2 changed files with 23 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bnc-sdk",
"version": "2.1.1",
"version": "2.1.2",
"description": "SDK to connect to the blocknative backend via a websocket connection",
"keywords": [
"ethereum",
24 changes: 22 additions & 2 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -41,17 +41,20 @@ export interface TransactionData {
originalHash?: string
counterparty?: string
direction?: string
system?: System
}

export interface TransactionEvent {
emitterResult: void | boolean | NotificationObject
transaction: TransactionData
}

export type System = 'bitcoin' | 'ethereum'

export interface InitializationOptions {
networkId: number
dappId: string
system?: string
system?: System
name?: string
transactionHandlers?: TransactionHandler[]
apiUrl?: string
@@ -74,10 +77,27 @@ export interface Emitter {
listeners: {
[key: string]: EmitterListener
}
on: (eventCode: string, listener: EmitterListener) => void
on: (eventCode: TransactionEventCode, listener: EmitterListener) => void
emit: (state: TransactionData) => boolean | void | NotificationObject
}

export type TransactionEventCode =
| 'txSent'
| 'txPool'
| 'txConfirmed'
| 'txSpeedUp'
| 'txCancel'
| 'txFailed'
| 'txRequest'
| 'nsfFail'
| 'txRepeat'
| 'txAwaitingApproval'
| 'txConfirmReminder'
| 'txSendFail'
| 'txError'
| 'txUnderPriced'
| 'all'

export interface Ac {
address: string
emitters: Emitter[]

0 comments on commit a25d201

Please sign in to comment.