@shapeshiftoss/caip 2.0.2 → 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.
@@ -0,0 +1,2 @@
1
+ export declare const gemAssetIdToCAIP19: (id: string) => string | undefined;
2
+ export declare const CAIP19ToGemAssetId: (caip19: string) => string | undefined;
@@ -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;
@@ -2,3 +2,4 @@ export * from './coingecko';
2
2
  export * from './coincap';
3
3
  export * from './yearn';
4
4
  export * from './osmosis';
5
+ export * from './gem';
@@ -18,3 +18,4 @@ __exportStar(require("./coingecko"), exports);
18
18
  __exportStar(require("./coincap"), exports);
19
19
  __exportStar(require("./yearn"), exports);
20
20
  __exportStar(require("./osmosis"), exports);
21
+ __exportStar(require("./gem"), exports);
@@ -14,7 +14,7 @@ const caip2_1 = require("../../caip2/caip2");
14
14
  const caip19_1 = require("../../caip19/caip19");
15
15
  const network = 1; // 1 for mainnet
16
16
  const provider = new providers_1.JsonRpcProvider(process.env.REACT_APP_ETHEREUM_NODE_URL);
17
- const yearnSdk = new sdk_1.Yearn(network, { provider, disableAllowlist: true });
17
+ const yearnSdk = new sdk_1.Yearn(network, { provider });
18
18
  const writeFiles = async (data) => {
19
19
  const path = './src/adapters/yearn/generated/';
20
20
  const file = '/adapter.json';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/caip",
3
- "version": "2.0.2",
3
+ "version": "2.1.2",
4
4
  "description": "CAIP Implementation",
5
5
  "homepage": "",
6
6
  "license": "MIT",
@@ -35,6 +35,6 @@
35
35
  "devDependencies": {
36
36
  "@shapeshiftoss/types": "^2.1.0",
37
37
  "@yfi/sdk": "^1.0.30",
38
- "axios": "^0.26.0"
38
+ "axios": "^0.26.1"
39
39
  }
40
40
  }