@shapeshiftoss/swapper 15.5.0 → 15.5.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.
|
@@ -9,19 +9,9 @@ const chain_adapters_1 = require("@shapeshiftoss/chain-adapters");
|
|
|
9
9
|
const axios_1 = __importDefault(require("axios"));
|
|
10
10
|
const lodash_1 = require("lodash");
|
|
11
11
|
const api_1 = require("../../../api");
|
|
12
|
-
const utils_1 = require("../../../utils");
|
|
13
12
|
const bignumber_1 = require("../../utils/bignumber");
|
|
14
13
|
const constants_1 = require("./constants");
|
|
15
|
-
|
|
16
|
-
const cache = (0, utils_1.createCache)(3000, ['/osmosis/gamm/v1beta1/pools/']);
|
|
17
|
-
const osmoPoolsService = axios_1.default.create({
|
|
18
|
-
timeout: 10000,
|
|
19
|
-
headers: {
|
|
20
|
-
Accept: 'application/json',
|
|
21
|
-
'Content-Type': 'application/json',
|
|
22
|
-
},
|
|
23
|
-
adapter: cache.adapter,
|
|
24
|
-
});
|
|
14
|
+
const osmoService_1 = require("./osmoService");
|
|
25
15
|
exports.symbolDenomMapping = {
|
|
26
16
|
OSMO: 'uosmo',
|
|
27
17
|
ATOM: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2',
|
|
@@ -116,7 +106,7 @@ const findPool = async (sellAssetSymbol, buyAssetSymbol, osmoUrl) => {
|
|
|
116
106
|
const poolsUrl = osmoUrl + '/osmosis/gamm/v1beta1/pools?pagination.limit=1000';
|
|
117
107
|
const poolsResponse = await (async () => {
|
|
118
108
|
try {
|
|
119
|
-
return
|
|
109
|
+
return osmoService_1.osmoService.get(poolsUrl);
|
|
120
110
|
}
|
|
121
111
|
catch (e) {
|
|
122
112
|
throw new api_1.SwapError('failed to get pool', {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const osmoService: import("axios").AxiosInstance;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.osmoService = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const utils_1 = require("../../../utils");
|
|
9
|
+
const maxAge = 3 * 1000; // 3 seconds
|
|
10
|
+
const cachedUrls = ['/osmosis/gamm/v1beta1/pools'];
|
|
11
|
+
const cache = (0, utils_1.createCache)(maxAge, cachedUrls);
|
|
12
|
+
const axiosConfig = {
|
|
13
|
+
timeout: 10000,
|
|
14
|
+
headers: {
|
|
15
|
+
Accept: 'application/json',
|
|
16
|
+
'Content-Type': 'application/json',
|
|
17
|
+
},
|
|
18
|
+
adapter: cache.adapter,
|
|
19
|
+
};
|
|
20
|
+
exports.osmoService = axios_1.default.create(axiosConfig);
|
|
@@ -106,7 +106,7 @@ exports.RUNE = {
|
|
|
106
106
|
precision: 8,
|
|
107
107
|
color: '#33FF99',
|
|
108
108
|
icon: 'https://assets.coincap.io/assets/icons/rune@2x.png',
|
|
109
|
-
explorer: 'https://
|
|
110
|
-
explorerAddressLink: 'https://
|
|
111
|
-
explorerTxLink: 'https://
|
|
109
|
+
explorer: 'https://viewblock.io/thorchain',
|
|
110
|
+
explorerAddressLink: 'https://viewblock.io/thorchain/address/',
|
|
111
|
+
explorerTxLink: 'https://viewblock.io/thorchain/tx/',
|
|
112
112
|
};
|
package/package.json
CHANGED