@exodus/ethereum-api 6.2.31 → 6.2.32

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": "6.2.31",
3
+ "version": "6.2.32",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -18,7 +18,7 @@
18
18
  "@exodus/crypto": "^1.0.0-rc.0",
19
19
  "@exodus/ethereum-lib": "^3.3.21",
20
20
  "@exodus/ethereumjs-util": "^7.1.0-exodus.6",
21
- "@exodus/fetch": "^1.2.1",
21
+ "@exodus/fetch": "^1.3.0-beta.3",
22
22
  "@exodus/simple-retry": "^0.0.6",
23
23
  "@exodus/solidity-contract": "^1.1.3",
24
24
  "bn.js": "^5.2.1",
@@ -29,11 +29,10 @@
29
29
  "minimalistic-assert": "^1.0.1",
30
30
  "ms": "^2.1.1",
31
31
  "socket.io-client": "2.1.1",
32
- "url-join": "4.0.0",
33
32
  "ws": "^6.1.0"
34
33
  },
35
34
  "devDependencies": {
36
35
  "@exodus/models": "^8.10.4"
37
36
  },
38
- "gitHead": "65a1ec4e430d8f10eff751d3e3bf0716b7c1cdcb"
37
+ "gitHead": "a3707d54d31f2a5a141c1e66b829e5bb69ad3723"
39
38
  }
@@ -140,6 +140,10 @@ export default class ApiCoinNodesServer extends EventEmitter {
140
140
  return this.sendRequest(request)
141
141
  }
142
142
 
143
+ async getBalanceProxied(...params) {
144
+ return this.getBalance(...params)
145
+ }
146
+
143
147
  async gasPrice(...params) {
144
148
  const request = this.gasPriceRequest(...params)
145
149
  return this.sendRequest(request)
@@ -1,8 +1,7 @@
1
- import urlJoin from 'url-join'
2
1
  import ms from 'ms'
3
2
  import BN from 'bn.js'
4
3
  import createWebSocket from './ws'
5
- import { fetchival } from '@exodus/fetch'
4
+ import fetchival from '@exodus/fetch/experimental/fetchival'
6
5
  import { retry } from '@exodus/simple-retry'
7
6
  import SolidityContract from '@exodus/solidity-contract'
8
7
  import { bufferToHex } from '@exodus/ethereumjs-util'
@@ -18,10 +17,13 @@ export function create(defaultURL, ensAssetName) {
18
17
  return `${obj}`
19
18
  })
20
19
 
20
+ function baseUrl(version = 'v1') {
21
+ return new URL(version === 'v1' ? API_URL : API_URL.replace('v1', version))
22
+ }
23
+
21
24
  async function request(module, params = {}, { version = 'v1', method = 'get' } = {}) {
22
- const url = urlJoin(version === 'v1' ? API_URL : API_URL.replace('v1', version), module)
23
25
  try {
24
- return await fetchival(url, { timeout: ms('15s') })[method](params)
26
+ return await fetchival(baseUrl(version), { timeout: ms('15s') })(module)[method](params)
25
27
  } catch (err) {
26
28
  let nerr = err
27
29
  if (err.response && err.response.status === 500) {