@exodus/ethereum-api 1.0.4 → 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.4",
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": "4c5c8dd13119abc494f7536e08112926d6306c81"
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) {
@@ -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