@exodus/ethereum-api 5.0.11 → 5.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "5.0.11",
3
+ "version": "5.0.12",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -36,5 +36,5 @@
36
36
  "devDependencies": {
37
37
  "@exodus/models": "^8.10.4"
38
38
  },
39
- "gitHead": "b34adcc696b2e7f67c8e556f3d0ed31cc481ed4d"
39
+ "gitHead": "509412d2c1113a4fdabc89727484f6a95353491b"
40
40
  }
@@ -82,10 +82,14 @@ export default class ClarityServer extends EventEmitter {
82
82
  const cursor = await this.getTransactions({
83
83
  ...params,
84
84
  onChunk: (isPending, chunk) => {
85
+ const mapped = chunk.map((serverTx) => ({
86
+ ...serverTx,
87
+ gasPrice: serverTx.gasPriceEffective || serverTx.gasPrice,
88
+ }))
85
89
  if (isPending) {
86
- transactions.pending.push(...chunk)
90
+ transactions.pending.push(...mapped)
87
91
  } else {
88
- transactions.confirmed.push(...chunk)
92
+ transactions.confirmed.push(...mapped)
89
93
  }
90
94
  },
91
95
  })
@@ -103,7 +107,7 @@ export default class ClarityServer extends EventEmitter {
103
107
  const timeout = setTimeout(() => reject(new Error('Transactions Timeout')), 300000)
104
108
  socket.emit('getTransactions', cursor, (nextCursor) => {
105
109
  clearTimeout(timeout)
106
- resolve(nextCursor)
110
+ resolve(Buffer.from(nextCursor))
107
111
  })
108
112
  })
109
113
  .catch((error) => console.error(error))
@@ -60,7 +60,7 @@ export default function getLogItemsFromServerTx({
60
60
  coinAmount,
61
61
  coinName: asset.name,
62
62
  data: {
63
- data: serverTx.data || '0x',
63
+ data: serverTx.input || '0x',
64
64
  nonce,
65
65
  gasLimit,
66
66
  },
@@ -1,6 +1,6 @@
1
1
  import BN from 'bn.js'
2
2
  import { getServer } from '@exodus/ethereum-api'
3
- import { CHAIN_DATA } from '@exodus/ethereum-lib'
3
+ import { DEFAULT_SERVER_URLS } from '@exodus/ethereum-lib'
4
4
  import { Tx } from '@exodus/models'
5
5
 
6
6
  import { getDeriveDataNeededForTick, getDeriveTransactionsToCheck } from './monitor-utils'
@@ -26,7 +26,7 @@ export class EthereumNoHistoryMonitor extends BaseMonitor {
26
26
 
27
27
  setServer(config) {
28
28
  if (!config?.server) {
29
- this.server.setURI(CHAIN_DATA[this.asset.name].serverUrl)
29
+ this.server.setURI(DEFAULT_SERVER_URLS[this.asset.name])
30
30
  return
31
31
  }
32
32
  if (config.server === this.server.uri) return