@cityofzion/bs-neo3 1.6.1 → 1.7.0
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.
|
@@ -17,6 +17,12 @@
|
|
|
17
17
|
"hash": "0xf0151f528127558851b39c2cd8aa47da7418ab28",
|
|
18
18
|
"decimals": 8
|
|
19
19
|
},
|
|
20
|
+
{
|
|
21
|
+
"symbol": "CAKE",
|
|
22
|
+
"hash": "0x570c27653683788177f05740257d88fed76bf74b",
|
|
23
|
+
"decimals": 18,
|
|
24
|
+
"name": "CAKE"
|
|
25
|
+
},
|
|
20
26
|
{
|
|
21
27
|
"symbol": "fCAKE",
|
|
22
28
|
"name": "fCAKE",
|
|
@@ -26,15 +32,33 @@
|
|
|
26
32
|
{
|
|
27
33
|
"symbol": "WING",
|
|
28
34
|
"name": "WING",
|
|
29
|
-
"hash": "
|
|
35
|
+
"hash": "0x948a60635d1f7921063d04be8f6cb35c741df566",
|
|
30
36
|
"decimals": 9
|
|
31
37
|
},
|
|
38
|
+
{
|
|
39
|
+
"symbol": "pWING",
|
|
40
|
+
"hash": "0xeeccd60ed722111f8400434dac3ba42c14d8beb1",
|
|
41
|
+
"decimals": 9,
|
|
42
|
+
"name": "pWING"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"symbol": "WETH",
|
|
46
|
+
"hash": "0xd3a41b53888a733b549f5d4146e7a98d3285fa21",
|
|
47
|
+
"decimals": 18,
|
|
48
|
+
"name": "WETH"
|
|
49
|
+
},
|
|
32
50
|
{
|
|
33
51
|
"symbol": "fWETH",
|
|
34
52
|
"name": "fWETH",
|
|
35
53
|
"hash": "0xc14b601252aa5dfa6166cf35fe5ccd2e35f3fdf5",
|
|
36
54
|
"decimals": 18
|
|
37
55
|
},
|
|
56
|
+
{
|
|
57
|
+
"symbol": "WBTC",
|
|
58
|
+
"hash": "0x4548a3bcb3c2b5ce42bf0559b1cf2f1ec97a51d0",
|
|
59
|
+
"decimals": 8,
|
|
60
|
+
"name": "WBTC"
|
|
61
|
+
},
|
|
38
62
|
{
|
|
39
63
|
"symbol": "fWBTC",
|
|
40
64
|
"name": "fWBTC",
|
|
@@ -47,12 +71,24 @@
|
|
|
47
71
|
"hash": "0x78e1330db47634afdb5ea455302ba2d12b8d549f",
|
|
48
72
|
"decimals": 8
|
|
49
73
|
},
|
|
74
|
+
{
|
|
75
|
+
"symbol": "ONT",
|
|
76
|
+
"hash": "0x0a1328bffb804ad7bb342673da82a972cc7af86c",
|
|
77
|
+
"decimals": 9,
|
|
78
|
+
"name": "ONT"
|
|
79
|
+
},
|
|
50
80
|
{
|
|
51
81
|
"symbol": "pONT",
|
|
52
82
|
"name": "pONT",
|
|
53
83
|
"hash": "0x8122bc2212ec971690a044b37a6f52a9349b702b",
|
|
54
84
|
"decimals": 9
|
|
55
85
|
},
|
|
86
|
+
{
|
|
87
|
+
"symbol": "USDT",
|
|
88
|
+
"name": "USDT",
|
|
89
|
+
"hash": "0x68b938cc42b6a2d54fb9040f5facf4290ebb8c5f",
|
|
90
|
+
"decimals": 6
|
|
91
|
+
},
|
|
56
92
|
{
|
|
57
93
|
"symbol": "fUSDT",
|
|
58
94
|
"name": "fUSDT",
|
|
@@ -112,5 +148,29 @@
|
|
|
112
148
|
"hash": "0x48c40d4666f93408be1bef038b6722404d9a4c2a",
|
|
113
149
|
"decimals": 8,
|
|
114
150
|
"name": "BurgerNEO"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"symbol": "BNB",
|
|
154
|
+
"hash": "0x00fb9575f220727f71a1537f75e83af9387628ff",
|
|
155
|
+
"decimals": 18,
|
|
156
|
+
"name": "BNB"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"symbol": "fBNB",
|
|
160
|
+
"hash": "0xb56f0fba45cc57a948b342186274dfd863996bb3",
|
|
161
|
+
"decimals": 18,
|
|
162
|
+
"name": "fBNB"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"symbol": "FUSD",
|
|
166
|
+
"hash": "0x1005d400bcc2a56b7352f09e273be3f9933a5fb1",
|
|
167
|
+
"decimals": 8,
|
|
168
|
+
"name": "FUSD"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"symbol": "FDE",
|
|
172
|
+
"hash": "0x9770f4d78a19d1a6fa94b472bcedffcc06b56c49",
|
|
173
|
+
"decimals": 8,
|
|
174
|
+
"name": "FDE"
|
|
115
175
|
}
|
|
116
176
|
]
|
|
@@ -22,7 +22,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
22
22
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
23
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
24
|
};
|
|
25
|
-
var _FlamingoEDSNeo3_network, _FlamingoEDSNeo3_axiosInstance;
|
|
25
|
+
var _FlamingoEDSNeo3_BASE_URL, _FlamingoEDSNeo3_network, _FlamingoEDSNeo3_axiosInstance;
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
27
|
exports.FlamingoEDSNeo3 = void 0;
|
|
28
28
|
const blockchain_service_1 = require("@cityofzion/blockchain-service");
|
|
@@ -31,27 +31,34 @@ const BSNeo3Helper_1 = require("../../helpers/BSNeo3Helper");
|
|
|
31
31
|
class FlamingoEDSNeo3 extends blockchain_service_1.CryptoCompareEDS {
|
|
32
32
|
constructor(network) {
|
|
33
33
|
super();
|
|
34
|
+
_FlamingoEDSNeo3_BASE_URL.set(this, 'https://neo-api.b-cdn.net/flamingo');
|
|
34
35
|
_FlamingoEDSNeo3_network.set(this, void 0);
|
|
35
36
|
_FlamingoEDSNeo3_axiosInstance.set(this, void 0);
|
|
36
37
|
__classPrivateFieldSet(this, _FlamingoEDSNeo3_network, network, "f");
|
|
37
|
-
__classPrivateFieldSet(this, _FlamingoEDSNeo3_axiosInstance, axios_1.default.create({ baseURL:
|
|
38
|
+
__classPrivateFieldSet(this, _FlamingoEDSNeo3_axiosInstance, axios_1.default.create({ baseURL: __classPrivateFieldGet(this, _FlamingoEDSNeo3_BASE_URL, "f") }), "f");
|
|
38
39
|
}
|
|
39
40
|
getTokenPrices(params) {
|
|
40
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
42
|
if (!BSNeo3Helper_1.BSNeo3Helper.isMainnet(__classPrivateFieldGet(this, _FlamingoEDSNeo3_network, "f")))
|
|
42
43
|
throw new Error('Exchange is only available on mainnet');
|
|
43
|
-
const { data } = yield __classPrivateFieldGet(this, _FlamingoEDSNeo3_axiosInstance, "f").get('/
|
|
44
|
-
const prices =
|
|
44
|
+
const { data } = yield __classPrivateFieldGet(this, _FlamingoEDSNeo3_axiosInstance, "f").get('/live-data/prices/latest');
|
|
45
|
+
const prices = new Map();
|
|
46
|
+
const { tokens } = params;
|
|
47
|
+
const neoSymbol = 'NEO';
|
|
45
48
|
data.forEach(item => {
|
|
46
|
-
const token =
|
|
49
|
+
const token = tokens.find(({ hash }) => BSNeo3Helper_1.BSNeo3Helper.normalizeHash(hash) === BSNeo3Helper_1.BSNeo3Helper.normalizeHash(item.hash));
|
|
47
50
|
if (!token)
|
|
48
51
|
return;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
const { symbol } = token;
|
|
53
|
+
const usdPrice = item.usd_price;
|
|
54
|
+
if (symbol === 'bNEO') {
|
|
55
|
+
const neoToken = tokens.find(token => token.symbol === neoSymbol);
|
|
56
|
+
if (neoToken)
|
|
57
|
+
prices.set(neoSymbol, { usdPrice, token: neoToken });
|
|
58
|
+
}
|
|
59
|
+
prices.set(symbol, { usdPrice, token });
|
|
53
60
|
});
|
|
54
|
-
return prices;
|
|
61
|
+
return [...prices.values()];
|
|
55
62
|
});
|
|
56
63
|
}
|
|
57
64
|
getTokenPriceHistory(params) {
|
|
@@ -66,4 +73,4 @@ class FlamingoEDSNeo3 extends blockchain_service_1.CryptoCompareEDS {
|
|
|
66
73
|
}
|
|
67
74
|
}
|
|
68
75
|
exports.FlamingoEDSNeo3 = FlamingoEDSNeo3;
|
|
69
|
-
_FlamingoEDSNeo3_network = new WeakMap(), _FlamingoEDSNeo3_axiosInstance = new WeakMap();
|
|
76
|
+
_FlamingoEDSNeo3_BASE_URL = new WeakMap(), _FlamingoEDSNeo3_network = new WeakMap(), _FlamingoEDSNeo3_axiosInstance = new WeakMap();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cityofzion/bs-neo3",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"repository": "https://github.com/CityOfZion/blockchain-services",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"bignumber.js": "^9.1.2",
|
|
21
21
|
"isomorphic-ws": "^5.0.0",
|
|
22
22
|
"lodash.clonedeep": "^4.5.0",
|
|
23
|
-
"@cityofzion/
|
|
24
|
-
"@cityofzion/
|
|
23
|
+
"@cityofzion/blockchain-service": "1.7.0",
|
|
24
|
+
"@cityofzion/bs-asteroid-sdk": "0.9.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@cityofzion/neon-dappkit-types": "~0.3.1",
|