@shapeshiftoss/caip 2.0.2 → 2.1.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,36 @@
|
|
|
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.CAIP19ToGemAssetId = exports.gemAssetIdToCAIP19 = void 0;
|
|
7
|
+
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
8
|
+
const CAIP19ToGemAssetIdMap = {
|
|
9
|
+
'bip122:000000000019d6689c085ae165831e93/slip44:0': 'bitcoin',
|
|
10
|
+
'eip155:1/slip44:60': 'ethereum',
|
|
11
|
+
'eip155:1/erc20:0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9': 'aave',
|
|
12
|
+
'eip155:1/erc20:0x0d8775f648430679a709e98d2b0cb6250d2887ef': 'basic-attention-token',
|
|
13
|
+
'eip155:1/erc20:0x4fabb145d64652a948d72533023f6e7a623c7c53': 'busd',
|
|
14
|
+
'eip155:1/erc20:0xc00e94cb662c3520282e6f5717214004a7f26888': 'compound-coin',
|
|
15
|
+
'eip155:1/erc20:0xd533a949740bb3306d119cc777fa900ba034cd52': 'curve-dao',
|
|
16
|
+
'eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f': 'dai',
|
|
17
|
+
'eip155:1/erc20:0x056fd409e1d7a124bd7017459dfea2f387b6d5cd': 'gemini-dollar',
|
|
18
|
+
'eip155:1/erc20:0x514910771af9ca656af840dff83e8264ecf986ca': 'chainlink',
|
|
19
|
+
'eip155:1/erc20:0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2': 'maker',
|
|
20
|
+
'eip155:1/erc20:0x75231f58b43240c9718dd58b4967c5114342a86c': 'okb',
|
|
21
|
+
'eip155:1/erc20:0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f': 'synthetix-network-token',
|
|
22
|
+
'eip155:1/erc20:0xa4bdb11dc0a2bec88d24a3aa1e6bb17201112ebe': 'usds',
|
|
23
|
+
'eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7': 'tether',
|
|
24
|
+
'eip155:1/erc20:0x04fa0d235c4abf4bcf4787af4cf447de572ef828': 'universal-market-access',
|
|
25
|
+
'eip155:1/erc20:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984': 'uniswap',
|
|
26
|
+
'eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48': 'usd-coin',
|
|
27
|
+
'eip155:1/erc20:0x2260fac5e5542a773aa44fbcfedf7c193bc2c599': 'wrapped-bitcoin',
|
|
28
|
+
'eip155:1/erc20:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2': 'weth',
|
|
29
|
+
'eip155:1/erc20:0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e': 'yearn-finance'
|
|
30
|
+
};
|
|
31
|
+
const invert = (data) => Object.entries(data).reduce((acc, [k, v]) => ((acc[v] = k), acc), {});
|
|
32
|
+
const gemAssetIdToCAIP19Map = invert(CAIP19ToGemAssetIdMap);
|
|
33
|
+
const gemAssetIdToCAIP19 = (id) => gemAssetIdToCAIP19Map[id];
|
|
34
|
+
exports.gemAssetIdToCAIP19 = gemAssetIdToCAIP19;
|
|
35
|
+
const CAIP19ToGemAssetId = (caip19) => CAIP19ToGemAssetIdMap[(0, toLower_1.default)(caip19)];
|
|
36
|
+
exports.CAIP19ToGemAssetId = CAIP19ToGemAssetId;
|
package/dist/adapters/index.d.ts
CHANGED
package/dist/adapters/index.js
CHANGED