@exodus/ethereum-api 2.1.1 → 2.1.2
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 +3 -3
- package/src/exodus-eth-server/api.js +13 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"access": "restricted"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@exodus/ethereum-lib": "^2.
|
|
13
|
+
"@exodus/ethereum-lib": "^2.2.0",
|
|
14
14
|
"@exodus/simple-retry": "^0.0.6",
|
|
15
15
|
"fetchival": "0.3.3",
|
|
16
16
|
"lodash": "^4.17.11",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"url-join": "4.0.0",
|
|
21
21
|
"ws": "6.1.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "956ac273cee5a8979824a68127a6d400ac711e48"
|
|
24
24
|
}
|
|
@@ -16,8 +16,8 @@ export function create(defaultURL) {
|
|
|
16
16
|
return url.format(obj)
|
|
17
17
|
})
|
|
18
18
|
|
|
19
|
-
async function request(module, params = {}) {
|
|
20
|
-
const url = urlJoin(API_URL, module)
|
|
19
|
+
async function request(module, params = {}, version = 'v1') {
|
|
20
|
+
const url = urlJoin(version === 'v1' ? API_URL : API_URL.replace('v1', version), module)
|
|
21
21
|
try {
|
|
22
22
|
return await fetchival(url, { timeout: ms('15s') }).get(params)
|
|
23
23
|
} catch (err) {
|
|
@@ -69,6 +69,17 @@ export function create(defaultURL) {
|
|
|
69
69
|
})
|
|
70
70
|
},
|
|
71
71
|
|
|
72
|
+
async getHistoryV2(address, opts = {}) {
|
|
73
|
+
return requestWithRetry(
|
|
74
|
+
'history',
|
|
75
|
+
{
|
|
76
|
+
address,
|
|
77
|
+
...opts,
|
|
78
|
+
},
|
|
79
|
+
'v2'
|
|
80
|
+
)
|
|
81
|
+
},
|
|
82
|
+
|
|
72
83
|
async gasPrice() {
|
|
73
84
|
return requestWithRetry('proxy', { method: 'eth_gasPrice' })
|
|
74
85
|
},
|