@shapeshiftoss/caip 2.1.2 → 2.2.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.
|
@@ -0,0 +1,49 @@
|
|
|
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.getSupportedBanxaAssets = exports.CAIP19ToBanxaTicker = exports.banxaTickerToCAIP19 = void 0;
|
|
7
|
+
const entries_1 = __importDefault(require("lodash/entries"));
|
|
8
|
+
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
9
|
+
const CAIP19ToBanxaTickerMap = {
|
|
10
|
+
'bip122:000000000019d6689c085ae165831e93/slip44:0': 'btc',
|
|
11
|
+
'cosmos:cosmoshub-4/slip44:118': 'atom',
|
|
12
|
+
'eip155:1/slip44:60': 'eth',
|
|
13
|
+
'eip155:1/erc20:0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9': 'aave',
|
|
14
|
+
'eip155:1/erc20:0xbb0e17ef65f82ab018d8edd776e8dd940327b28b': 'axs',
|
|
15
|
+
'eip155:1/erc20:0x4d224452801aced8b2f0aebe155379bb5d594381': 'ape',
|
|
16
|
+
'eip155:1/erc20:0x0d8775f648430679a709e98d2b0cb6250d2887ef': 'bat',
|
|
17
|
+
'eip155:1/erc20:0x4fabb145d64652a948d72533023f6e7a623c7c53': 'busd',
|
|
18
|
+
'eip155:1/erc20:0x3506424f91fd33084466f402d5d97f05f8e3b4af': 'chz',
|
|
19
|
+
'eip155:1/erc20:0x41e5560054824ea6b0732e656e3ad64e20e94e45': 'cvc',
|
|
20
|
+
'eip155:1/erc20:0xc00e94cb662c3520282e6f5717214004a7f26888': 'comp',
|
|
21
|
+
'eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f': 'dai',
|
|
22
|
+
'eip155:1/erc20:0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c': 'enj',
|
|
23
|
+
'eip155:1/erc20:0x4e15361fd6b4bb609fa63c81a2be19d873717870': 'ftm',
|
|
24
|
+
'eip155:1/erc20:0x165440036ce972c5f8ebef667086707e48b2623e': 'grt',
|
|
25
|
+
'eip155:1/erc20:0xf57e7e7c23978c3caec3c3548e3d615c346e79ff': 'imx',
|
|
26
|
+
'eip155:1/erc20:0x514910771af9ca656af840dff83e8264ecf986ca': 'link',
|
|
27
|
+
'eip155:1/erc20:0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2': 'mkr',
|
|
28
|
+
'eip155:1/erc20:0x0f5d2fb29fb7d3cfee444a200298f468908cc942': 'mana',
|
|
29
|
+
'eip155:1/erc20:0xd26114cd6ee289accf82350c8d8487fedb8a0c07': 'omg',
|
|
30
|
+
'eip155:1/erc20:0x57ab1ec28d129707052df4df418d58a2d46d5f51': 'susd',
|
|
31
|
+
'eip155:1/erc20:0x6b3595068778dd592e39a122f4f5a5cf09c90fe2': 'sushi',
|
|
32
|
+
'eip155:1/erc20:0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': 'snx',
|
|
33
|
+
'eip155:1/erc20:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984': 'uni',
|
|
34
|
+
'eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': 'usdc',
|
|
35
|
+
'eip155:1/erc20:0x8e870d67f660d95d5be530380d0ec0bd388289e1': 'usdp',
|
|
36
|
+
'eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7': 'usdt',
|
|
37
|
+
'eip155:1/erc20:0x2260fac5e5542a773aa44fbcfedf7c193bc2c599': 'wbtc'
|
|
38
|
+
};
|
|
39
|
+
const invert = (data) => Object.entries(data).reduce((acc, [k, v]) => ((acc[v] = k), acc), {});
|
|
40
|
+
const banxaTickerToCAIP19Map = invert(CAIP19ToBanxaTickerMap);
|
|
41
|
+
const banxaTickerToCAIP19 = (id) => banxaTickerToCAIP19Map[id];
|
|
42
|
+
exports.banxaTickerToCAIP19 = banxaTickerToCAIP19;
|
|
43
|
+
const CAIP19ToBanxaTicker = (caip19) => CAIP19ToBanxaTickerMap[(0, toLower_1.default)(caip19)];
|
|
44
|
+
exports.CAIP19ToBanxaTicker = CAIP19ToBanxaTicker;
|
|
45
|
+
const getSupportedBanxaAssets = () => (0, entries_1.default)(CAIP19ToBanxaTickerMap).map(([CAIP19, ticker]) => ({
|
|
46
|
+
CAIP19,
|
|
47
|
+
ticker
|
|
48
|
+
}));
|
|
49
|
+
exports.getSupportedBanxaAssets = getSupportedBanxaAssets;
|
package/dist/adapters/index.d.ts
CHANGED
package/dist/adapters/index.js
CHANGED