@exodus/ethereum-api 1.0.3 → 1.0.5

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": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "author": "Exodus Movement, Inc.",
@@ -19,5 +19,5 @@
19
19
  "url-join": "4.0.0",
20
20
  "ws": "6.1.0"
21
21
  },
22
- "gitHead": "6bd81c072e44b09c85e19c95deb8246cb9a323a0"
22
+ "gitHead": "ace6ca81bd26454cbd7b04af05440ec0973574d3"
23
23
  }
@@ -12,8 +12,8 @@ export async function sendRawTransaction(data) {
12
12
  return txhash.slice(2)
13
13
  }
14
14
 
15
- export async function getTransactionCount(address) {
16
- return _request('eth_getTransactionCount', { address })
15
+ export async function getTransactionCount(address, tag = 'latest') {
16
+ return _request('eth_getTransactionCount', { address, tag })
17
17
  }
18
18
 
19
19
  export async function getTransactionReceipt(txhash) {
@@ -102,6 +102,10 @@ export function create(defaultURL) {
102
102
  return request('proxy', { method: 'eth_getBlockByNumber', number, isFullTransactions })
103
103
  },
104
104
 
105
+ async getLogs(params) {
106
+ return request('proxy', { method: 'eth_getLogs', ...params })
107
+ },
108
+
105
109
  async simulateRawTransaction(rawTransaction, applyPending = true) {
106
110
  rawTransaction = rawTransaction.replace('0x', '')
107
111
  return request('proxy', {
@@ -27,7 +27,7 @@ export async function isContract(assetName, address) {
27
27
  return code.length > 2
28
28
  }
29
29
 
30
- export async function getNonce({ asset, address }) {
30
+ export async function getNonce({ asset, address, tag = 'latest' }) {
31
31
  if (!['ethereum', 'ethereumclassic'].includes(asset.name)) return
32
32
 
33
33
  const _getNonce =
@@ -35,7 +35,7 @@ export async function getNonce({ asset, address }) {
35
35
  ? withFallback(etcServer.getTransactionCount, etcServer.getTransactionCount)
36
36
  : withFallback(ethServer.getTransactionCount, etherscan.getTransactionCount)
37
37
 
38
- const nonce = await _getNonce(address)
38
+ const nonce = await _getNonce(address, tag)
39
39
  return parseInt(nonce, 16)
40
40
  }
41
41