Skip to content

Commit

Permalink
Merge pull request #151 from blocknative/release/3.6.0
Browse files Browse the repository at this point in the history
Release 3.6.0
  • Loading branch information
lnbc1QWFyb24 committed Oct 6, 2021
2 parents 8c5e011 + 6b8c6a3 commit d6baa95
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 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": "3.5.0",
"version": "3.6.0",
"description": "SDK to connect to the blocknative backend via a websocket connection",
"keywords": [
"ethereum",
Expand Down
9 changes: 7 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class Blocknative {

constructor(options: InitializationOptions) {
validateOptions(options)

const {
dappId,
system = DEFAULT_SYSTEM,
Expand All @@ -87,13 +88,17 @@ class Blocknative {
onclose
} = options

// override default timeout to allow for slow connections
const timeout = { connectTimeout: 10000 }

const socket = new SturdyWebSocket(
apiUrl || 'wss://api.blocknative.com/v0',
ws
? {
wsConstructor: ws
wsConstructor: ws,
...timeout
}
: {}
: { ...timeout }
)

socket.onopen = onOpen.bind(this, onopen)
Expand Down
22 changes: 11 additions & 11 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export interface NotificationObject {
}

export interface ContractCall {
contractType?: string
contractAddress?: string
methodName: string
params: Record<string, unknown>
contractAddress?: string
contractType?: string
contractDecimals: number
contractName: string
decimalValue: string
contractDecimals?: number
decimalValue?: string
}

export interface CommonTransactionData {
Expand All @@ -42,22 +42,22 @@ export interface BitcoinTransactionData extends CommonTransactionData {
export interface EthereumTransactionData extends CommonTransactionData {
hash: string
asset: string
blockHash: string
blockNumber: number
contractCall: ContractCall
internalTransactions: InternalTransaction[]
netBalanceChanges: NetBalanceChange[]
blockHash: string | null
blockNumber: number | null
contractCall?: ContractCall
internalTransactions?: InternalTransaction[]
netBalanceChanges?: NetBalanceChange[]
to: string
from: string
gas: string
gas: number
gasPrice: string
gasUsed?: string
input: string
nonce: number
v: string
r: string
s: string
transactionIndex: number
transactionIndex?: number
value: string
startTime?: number
timePending?: string
Expand Down

0 comments on commit d6baa95

Please sign in to comment.