@shapeshiftoss/caip 5.4.0 → 6.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.
- package/dist/adapters/banxa/index.d.ts +1 -1
- package/dist/adapters/banxa/index.js +3 -3
- package/dist/adapters/coinbase/generate.d.ts +1 -0
- package/dist/adapters/coinbase/generate.js +11 -0
- package/dist/adapters/coinbase/generated/adapter.json +153 -0
- package/dist/adapters/coinbase/generated/index.d.ts +2 -0
- package/dist/adapters/coinbase/generated/index.js +8 -0
- package/dist/adapters/coinbase/index.d.ts +3 -0
- package/dist/adapters/coinbase/index.js +16 -0
- package/dist/adapters/coinbase/utils.d.ts +12 -0
- package/dist/adapters/coinbase/utils.js +58 -0
- package/dist/adapters/coingecko/index.d.ts +11 -0
- package/dist/adapters/coingecko/index.js +57 -1
- package/dist/adapters/gem/index.d.ts +2 -2
- package/dist/adapters/gem/index.js +5 -5
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.js +1 -0
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const banxaTickerToAssetId: (id: string) => string | undefined;
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const assetIdToBanxaTicker: (assetId: string) => string | undefined;
|
|
3
3
|
export declare const getSupportedBanxaAssets: () => {
|
|
4
4
|
assetId: string;
|
|
5
5
|
ticker: string;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getBanxaBlockchainFromBanxaAssetTicker = exports.getSupportedBanxaAssets = exports.
|
|
6
|
+
exports.getBanxaBlockchainFromBanxaAssetTicker = exports.getSupportedBanxaAssets = exports.assetIdToBanxaTicker = exports.banxaTickerToAssetId = void 0;
|
|
7
7
|
const entries_1 = __importDefault(require("lodash/entries"));
|
|
8
8
|
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
9
9
|
const assetId_1 = require("../../assetId/assetId");
|
|
@@ -41,8 +41,8 @@ const invert = (data) => Object.entries(data).reduce((acc, [k, v]) => ((acc[v] =
|
|
|
41
41
|
const banxaTickerToAssetIdMap = invert(AssetIdToBanxaTickerMap);
|
|
42
42
|
const banxaTickerToAssetId = (id) => banxaTickerToAssetIdMap[id];
|
|
43
43
|
exports.banxaTickerToAssetId = banxaTickerToAssetId;
|
|
44
|
-
const
|
|
45
|
-
exports.
|
|
44
|
+
const assetIdToBanxaTicker = (assetId) => AssetIdToBanxaTickerMap[(0, toLower_1.default)(assetId)];
|
|
45
|
+
exports.assetIdToBanxaTicker = assetIdToBanxaTicker;
|
|
46
46
|
const getSupportedBanxaAssets = () => (0, entries_1.default)(AssetIdToBanxaTickerMap).map(([assetId, ticker]) => ({
|
|
47
47
|
assetId,
|
|
48
48
|
ticker
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("./utils");
|
|
4
|
+
// To run, install ts-node globally `npm i -g ts-node`
|
|
5
|
+
// From the caip package root. Run `ts-node ./src/adapters/coinbase/generate.ts`
|
|
6
|
+
const main = async () => {
|
|
7
|
+
const coinbaseCurrencies = await (0, utils_1.getData)();
|
|
8
|
+
const output = (0, utils_1.parseData)(coinbaseCurrencies);
|
|
9
|
+
await (0, utils_1.writeFiles)(output);
|
|
10
|
+
};
|
|
11
|
+
main();
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{
|
|
2
|
+
"eip155:1/erc20:0x8290333cef9e6d528dd5618fb97a76f268f3edd4": "ANKR",
|
|
3
|
+
"eip155:1/erc20:0x33349b282065b0284d756f0577fb39c158f935e6": "MPL",
|
|
4
|
+
"eip155:1/erc20:0x41e5560054824ea6b0732e656e3ad64e20e94e45": "CVC",
|
|
5
|
+
"eip155:1/erc20:0x9992ec3cf6a55b00978cddf2b27bc6882d88d1ec": "POLY",
|
|
6
|
+
"eip155:1/erc20:0x09a3ecafa817268f77be1283176b946c4ff2e608": "MIR",
|
|
7
|
+
"eip155:1/erc20:0xf1f955016ecbcd7321c7266bccfb96c68ea5e49b": "RLY",
|
|
8
|
+
"eip155:1/erc20:0x2260fac5e5542a773aa44fbcfedf7c193bc2c599": "WBTC",
|
|
9
|
+
"eip155:1/erc20:0xdbdb4d16eda451d0503b854cf79d55697f90c8df": "ALCX",
|
|
10
|
+
"eip155:1/erc20:0x5732046a883704404f284ce41ffadd5b007fd668": "BLZ",
|
|
11
|
+
"eip155:1/erc20:0x6b175474e89094c44da98b954eedeac495271d0f": "DAI",
|
|
12
|
+
"eip155:1/erc20:0x7dd9c5cba05e151c895fde1cf355c9a1d5da6429": "GLM",
|
|
13
|
+
"eip155:1/erc20:0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce": "SHIB",
|
|
14
|
+
"eip155:1/erc20:0x408e41876cccdc0f92210600ef50372656052a38": "REN",
|
|
15
|
+
"eip155:1/erc20:0x6fb3e0a217407efff7ca062d46c26e5d60a14d69": "IOTX",
|
|
16
|
+
"eip155:1/erc20:0xdac17f958d2ee523a2206206994597c13d831ec7": "USDT",
|
|
17
|
+
"eip155:1/erc20:0xdd974d5c2e2928dea5f71b9825b8b646686bd200": "KNC",
|
|
18
|
+
"eip155:1/erc20:0x41d5d79431a913c4ae7d69a668ecdfe5ff9dfb68": "INV",
|
|
19
|
+
"eip155:1/erc20:0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2": "MKR",
|
|
20
|
+
"eip155:1/erc20:0xc18360217d8f7ab5e7c516566761ea12ce7f9d72": "ENS",
|
|
21
|
+
"eip155:1/erc20:0xd8912c10681d8b21fd3742244f44658dba12264e": "PLU",
|
|
22
|
+
"eip155:1/erc20:0x3a4f40631a4f906c2bad353ed06de7a5d3fcb430": "PLA",
|
|
23
|
+
"eip155:1/erc20:0x6de037ef9ad2725eb40118bb1702ebb27e4aeb24": "RNDR",
|
|
24
|
+
"eip155:1/erc20:0x55296f69f40ea6d20e478533c15a6b08b654e758": "XYO",
|
|
25
|
+
"eip155:1/erc20:0xdab396ccf3d84cf2d07c4454e10c8a6f5b008d2b": "GFI",
|
|
26
|
+
"eip155:1/erc20:0x4575f41308ec1483f3d399aa9a2826d74da13deb": "OXT",
|
|
27
|
+
"eip155:1/erc20:0xd2877702675e6ceb975b4a1dff9fb7baf4c91ea9": "WLUNA",
|
|
28
|
+
"eip155:1/erc20:0x0954906da0bf32d5479e25f46056d22f08464cab": "INDEX",
|
|
29
|
+
"eip155:1/erc20:0xff20817765cb7f73d4bde2e66e067e58d11095c2": "AMP",
|
|
30
|
+
"eip155:1/erc20:0xaea46a60368a7bd060eec7df8cba43b7ef41ad85": "FET",
|
|
31
|
+
"eip155:1/erc20:0x4fe83213d56308330ec302a8bd641f1d0113a4cc": "NU",
|
|
32
|
+
"eip155:1/erc20:0x7f08962d948c5c59cac284035748be21134ebc2b": "UMA",
|
|
33
|
+
"eip155:1/erc20:0x3d658390460295fb963f54dc0899cfb1c30776df": "COVAL",
|
|
34
|
+
"eip155:1/erc20:0xfc98e825a2264d890f9a1e68ed50e1526abccacd": "MCO2",
|
|
35
|
+
"eip155:1/erc20:0x799ebfabe77a6e34311eeee9825190b9ece32824": "BTRST",
|
|
36
|
+
"eip155:1/erc20:0x0d67f3e4bcbd2d6b7a90150c73bdf9ffc6b6de9b": "GRT",
|
|
37
|
+
"eip155:1/erc20:0x5faa989af96af85384b8a938c2ede4a7378d9875": "GAL",
|
|
38
|
+
"eip155:1/erc20:0x8f8221afbb33998d8584a2b05749ba73c37a938a": "REQ",
|
|
39
|
+
"eip155:1/erc20:0xd26114cd6ee289accf82350c8d8487fedb8a0c07": "OMG",
|
|
40
|
+
"eip155:1/erc20:0x91af0fbb28aba7e31403cb457106ce79397fd4e6": "AERGO",
|
|
41
|
+
"eip155:1/erc20:0x321c2fe4446c7c963dc41dd58879af648838f98d": "CTX",
|
|
42
|
+
"eip155:1/erc20:0xccc8cb5229b0ac8069c51fd58367fd1e622afd97": "GODS",
|
|
43
|
+
"eip155:1/erc20:0x6dea81c8171d0ba574754ef6f8b412f2ed88c54d": "LQTY",
|
|
44
|
+
"eip155:1/erc20:0x9e46a38f5daabe8683e10793b06749eef7d733d1": "NCT",
|
|
45
|
+
"eip155:1/erc20:0x8e870d67f660d95d5be530380d0ec0bd388289e1": "PAX",
|
|
46
|
+
"eip155:1/erc20:0x6b3595068778dd592e39a122f4f5a5cf09c90fe2": "SUSHI",
|
|
47
|
+
"eip155:1/erc20:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48": "USDC",
|
|
48
|
+
"eip155:1/erc20:0xec67005c4e498ec7f55e092bd1d35cbc47c91892": "MLN",
|
|
49
|
+
"eip155:1/erc20:0xd291e7a03283640fdc51b121ac401383a46cc623": "RGT",
|
|
50
|
+
"eip155:1/erc20:0x99ea4db9ee77acd40b119bd1dc4e33e1c070b80d": "QSP",
|
|
51
|
+
"eip155:1/erc20:0x090185f2135308bad17527004364ebcc2d37e5f6": "SPELL",
|
|
52
|
+
"eip155:1/erc20:0xf17e65822b568b3903685a7c9f496cf7656cc6c2": "BICO",
|
|
53
|
+
"eip155:1/erc20:0x0d8775f648430679a709e98d2b0cb6250d2887ef": "BAT",
|
|
54
|
+
"eip155:1/erc20:0x037a54aab062628c9bbae1fdb1583c195585fe41": "LCX",
|
|
55
|
+
"eip155:1/erc20:0x3c4b6e6e1ea3d4863700d7f76b36b7f3d3f13e3d": "VGX",
|
|
56
|
+
"eip155:1/erc20:0x514910771af9ca656af840dff83e8264ecf986ca": "LINK",
|
|
57
|
+
"eip155:1/erc20:0x744d70fdbe2ba4cf95131626614a1763df805b9e": "SNT",
|
|
58
|
+
"eip155:1/erc20:0xaa7a9ca87d3694b5755f213b5d04094b8d0f0a6f": "TRAC",
|
|
59
|
+
"eip155:1/erc20:0x4c19596f5aaff459fa38b0f7ed92f11ae6543784": "TRU",
|
|
60
|
+
"eip155:1/erc20:0xed04915c23f00a313a544955524eb7dbd823143d": "ACH",
|
|
61
|
+
"eip155:1/erc20:0x1776e1f26f98b1a5df9cd347953a26dd3cb46671": "NMR",
|
|
62
|
+
"eip155:1/erc20:0x00c83aecc790e8a4453e5dd3b0b4b3680501a7a7": "SKL",
|
|
63
|
+
"eip155:1/erc20:0x03ab458634910aad20ef5f1c8ee96f1d6ac54919": "RAI",
|
|
64
|
+
"eip155:1/erc20:0x32353a6c91143bfd6c7d363b546e62a9a2489a20": "AGLD",
|
|
65
|
+
"eip155:1/erc20:0x5cf04716ba20127f1e2297addcf4b5035000c9eb": "NKN",
|
|
66
|
+
"eip155:1/erc20:0x4a220e6096b25eadb88358cb44068a3248254675": "QNT",
|
|
67
|
+
"eip155:1/erc20:0x88df592f8eb5d7bd38bfef7deb0fbc02cf3778a0": "TRB",
|
|
68
|
+
"eip155:1/erc20:0x85eee30c52b0b379b046fb0f85f4f3dc3009afec": "KEEP",
|
|
69
|
+
"eip155:1/erc20:0x8207c1ffc5b6804f6024322ccf34f29c3541ae26": "OGN",
|
|
70
|
+
"eip155:1/erc20:0xbc396689893d065f41bc2c6ecbee5e0085233447": "PERP",
|
|
71
|
+
"eip155:1/erc20:0x0abdace70d3790235af448c88547603b945604ea": "DNT",
|
|
72
|
+
"eip155:1/erc20:0x111111111117dc0aa78b770fa6a738034120c302": "1INCH",
|
|
73
|
+
"cosmos:cosmoshub-4/slip44:118": "ATOM",
|
|
74
|
+
"eip155:1/erc20:0xa1d0e215a23d7030842fc67ce582a6afa3ccab83": "YFII",
|
|
75
|
+
"eip155:1/erc20:0x15d4c048f83bd7e37d49ea4c83a07267ec4203da": "GALA",
|
|
76
|
+
"eip155:1/erc20:0x31c8eacbffdd875c74b94b077895bd78cf1e64a3": "RAD",
|
|
77
|
+
"eip155:1/erc20:0x6123b0049f904d730db3c36a31167d9d4121fa6b": "RBN",
|
|
78
|
+
"eip155:1/erc20:0x1f9840a85d5af5bf1d1762f925bdaddc4201f984": "UNI",
|
|
79
|
+
"eip155:1/erc20:0x3472a5a71965499acd81997a54bba8d852c6e53d": "BADGER",
|
|
80
|
+
"eip155:1/erc20:0xddb3422497e61e13543bea06989c0789117555c5": "COTI",
|
|
81
|
+
"eip155:1/erc20:0x7d1afa7b718fb893db30a3abc0cfc608aacfebb0": "MATIC",
|
|
82
|
+
"eip155:1/erc20:0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e": "YFI",
|
|
83
|
+
"eip155:1/erc20:0xc011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f": "SNX",
|
|
84
|
+
"eip155:1/erc20:0xba50933c268f567bdc86e1ac131be072c6b0b71a": "ARPA",
|
|
85
|
+
"eip155:1/erc20:0xde30da39c46104798bb5aa3fe8b9e0e1f348163f": "GTC",
|
|
86
|
+
"eip155:1/erc20:0xa0246c9032bc3a600820415ae600c6388619a14d": "FARM",
|
|
87
|
+
"eip155:1/erc20:0xc08512927d12348f6620a698105e1baac6ecd911": "GYEN",
|
|
88
|
+
"eip155:1/erc20:0x814e0908b12a99fecf5bc101bb5d0b8b5cdf7d26": "MDT",
|
|
89
|
+
"eip155:1/erc20:0x70d2b7c19352bb76e4409858ff5746e500f2b67c": "UPI",
|
|
90
|
+
"eip155:1/erc20:0x7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9": "AAVE",
|
|
91
|
+
"eip155:1/erc20:0x4d224452801aced8b2f0aebe155379bb5d594381": "APE",
|
|
92
|
+
"eip155:1/erc20:0x58b6a8a3302369daec383334672404ee733ab239": "LPT",
|
|
93
|
+
"eip155:1/erc20:0xedb171c18ce90b633db442f2a6f72874093b49ef": "WAMPL",
|
|
94
|
+
"eip155:1/erc20:0xc00e94cb662c3520282e6f5717214004a7f26888": "COMP",
|
|
95
|
+
"eip155:1/erc20:0x226bb599a12c826476e3a771454697ea52e9e220": "PRO",
|
|
96
|
+
"eip155:1/erc20:0xb64ef51c888972c908cfacf59b47c1afbc0ab8ac": "STORJ",
|
|
97
|
+
"eip155:1/erc20:0x464ebe77c293e473b48cfe96ddcf88fcf7bfdac0": "KRL",
|
|
98
|
+
"eip155:1/erc20:0x8daebade922df735c38c80c7ebd708af50815faa": "TBTC",
|
|
99
|
+
"eip155:1/erc20:0xe2f2a5c287993345a840db3b0845fbc70f5935a5": "MUSD",
|
|
100
|
+
"eip155:1/erc20:0xbb0e17ef65f82ab018d8edd776e8dd940327b28b": "AXS",
|
|
101
|
+
"eip155:1/erc20:0x80c62fe4487e1351b47ba49809ebd60ed085bf52": "CLV",
|
|
102
|
+
"eip155:1/erc20:0xac51066d7bec65dc4589368da368b212745d63e8": "ALICE",
|
|
103
|
+
"eip155:1/erc20:0x7420b4b9a0110cdc71fb720908340c03f9bc03ec": "JASMY",
|
|
104
|
+
"eip155:1/erc20:0x83e6f1e41cdd28eaceb20cb649155049fac3d5aa": "POLS",
|
|
105
|
+
"eip155:1/erc20:0x441761326490cacf7af299725b6292597ee822c2": "UNFI",
|
|
106
|
+
"bip122:000000000019d6689c085ae165831e93/slip44:0": "BTC",
|
|
107
|
+
"eip155:1/erc20:0x84ca8bc7997272c7cfb4d0cd3d55cd942b3c9419": "DIA",
|
|
108
|
+
"eip155:1/erc20:0x626e8036deb333b408be468f951bdb42433cbf18": "AIOZ",
|
|
109
|
+
"eip155:1/erc20:0xd533a949740bb3306d119cc777fa900ba034cd52": "CRV",
|
|
110
|
+
"eip155:1/erc20:0xba11d00c5f74255f56a5e366f4f77f5a186d7f55": "BAND",
|
|
111
|
+
"eip155:1/erc20:0x8c15ef5b4b21951d50e53e4fbda8298ffad25057": "FX",
|
|
112
|
+
"eip155:1/erc20:0x6c28aef8977c9b773996d0e8376d2ee379446f2f": "QUICK",
|
|
113
|
+
"eip155:1/erc20:0x4fabb145d64652a948d72533023f6e7a623c7c53": "BUSD",
|
|
114
|
+
"eip155:1/erc20:0xf57e7e7c23978c3caec3c3548e3d615c346e79ff": "IMX",
|
|
115
|
+
"eip155:1/erc20:0x42476f744292107e34519f9c357927074ea3f75d": "LOOM",
|
|
116
|
+
"eip155:1/erc20:0xc7283b66eb1eb5fb86327f08e1b5816b0720212b": "TRIBE",
|
|
117
|
+
"eip155:1/erc20:0x0b38210ea11411557c13457d4da7dc6ea731b88a": "API3",
|
|
118
|
+
"eip155:1/erc20:0x0d88ed6e74bbfd96b831231638b66c05571e824f": "AVT",
|
|
119
|
+
"eip155:1/erc20:0x0f5d2fb29fb7d3cfee444a200298f468908cc942": "MANA",
|
|
120
|
+
"eip155:1/slip44:60": "ETH",
|
|
121
|
+
"eip155:1/erc20:0xc770eefad204b5180df6a14ee197d99d808ee52d": "FOX",
|
|
122
|
+
"eip155:1/erc20:0x71ab77b7dbb4fa7e017bc15090b2163221420282": "HIGH",
|
|
123
|
+
"eip155:1/erc20:0x1985365e9f78359a9b6ad760e32412f4a445e862": "REP",
|
|
124
|
+
"eip155:1/erc20:0x0763fdccf1ae541a5961815c0872a8c5bc6de4d7": "SUKU",
|
|
125
|
+
"eip155:1/erc20:0x2565ae0385659badcada1031db704442e1b69982": "ASM",
|
|
126
|
+
"eip155:1/erc20:0x607f4c5bb672230e8672085532f7e901544a7375": "RLC",
|
|
127
|
+
"eip155:1/erc20:0x081131434f93063751813c619ecca9c4dc7862a3": "DAR",
|
|
128
|
+
"eip155:1/erc20:0x0391d2021f89dc339f60fff84546ea23e337750f": "BOND",
|
|
129
|
+
"eip155:1/erc20:0x491604c0fdf08347dd1fa4ee062a822a5dd06b5d": "CTSI",
|
|
130
|
+
"eip155:1/erc20:0xc221b7e65ffc80de234bbb6667abdd46593d34f0": "WCFG",
|
|
131
|
+
"eip155:1/erc20:0x3506424f91fd33084466f402d5d97f05f8e3b4af": "CHZ",
|
|
132
|
+
"eip155:1/erc20:0x1f573d6fb3f13d689ff844b4ce37794d79a7ff1c": "BNT",
|
|
133
|
+
"eip155:1/erc20:0x3a880652f47bfaa771908c07dd8673a787daed3a": "DDX",
|
|
134
|
+
"eip155:1/erc20:0xbbc2ae13b23d715c30720f079fcd9b4a74093505": "ERN",
|
|
135
|
+
"eip155:1/erc20:0x69af81e73a73b40adf4f3d4223cd9b1ece623074": "MASK",
|
|
136
|
+
"eip155:1/erc20:0x0f2d719407fdbeff09d87557abb7232601fd9f29": "SYN",
|
|
137
|
+
"eip155:1/erc20:0xa47c8bf37f92abed4a126bda807a7b7498661acd": "UST",
|
|
138
|
+
"eip155:1/erc20:0xba100000625a3754423978a60c9317c58a424e3d": "BAL",
|
|
139
|
+
"eip155:1/erc20:0xa74476443119a942de498590fe1f2454d7d4ac0d": "GNT",
|
|
140
|
+
"eip155:1/erc20:0x0258f474786ddfd37abce6df6bbb1dd5dfc4434a": "ORN",
|
|
141
|
+
"eip155:1/erc20:0xfca59cd816ab1ead66534d82bc21e7515ce441cf": "RARI",
|
|
142
|
+
"eip155:1/erc20:0xe53ec727dbdeb9e2d5456c3be40cff031ab40a55": "SUPER",
|
|
143
|
+
"eip155:1/erc20:0xa9b1eb5908cfc3cdf91f9b8b3a74108598009096": "AUCTION",
|
|
144
|
+
"eip155:1/erc20:0xb705268213d593b8fd88d3fdeff93aff5cbdcfae": "IDEX",
|
|
145
|
+
"eip155:1/erc20:0x595832f8fc6bf59c85c527fec3740a1b7a361269": "POWR",
|
|
146
|
+
"eip155:1/erc20:0xe41d2489571d322189246dafa5ebde1f4699f498": "ZRX",
|
|
147
|
+
"eip155:1/erc20:0xa0b73e1ff0b80914ab6fe0444e65848c4c34450b": "CRO",
|
|
148
|
+
"eip155:1/erc20:0x08389495d7456e1951ddf7c3a1314a4bfb646d8b": "CRPT",
|
|
149
|
+
"eip155:1/erc20:0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c": "ENJ",
|
|
150
|
+
"eip155:1/erc20:0x77fba179c79de5b7653f68b5039af940ada60ce0": "FORTH",
|
|
151
|
+
"eip155:1/erc20:0xbbbbca6a901c926f240b89eacb641d8aec7aeafd": "LRC",
|
|
152
|
+
"eip155:1/erc20:0x7c84e62859d0715eb77d1b1c4154ecd6abb21bec": "SHPING"
|
|
153
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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.tickerMap = void 0;
|
|
7
|
+
const adapter_json_1 = __importDefault(require("./adapter.json"));
|
|
8
|
+
exports.tickerMap = adapter_json_1.default;
|
|
@@ -0,0 +1,16 @@
|
|
|
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.assetIdToCoinbaseTicker = exports.coinbaseTickerToAssetId = void 0;
|
|
7
|
+
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
8
|
+
const generated_1 = require("./generated");
|
|
9
|
+
// As of 2022/06/13 (ETH/BTC/COSMOS assets)
|
|
10
|
+
const assetIdToCoinbaseTickerMap = generated_1.tickerMap;
|
|
11
|
+
const invert = (data) => Object.entries(data).reduce((acc, [k, v]) => ((acc[v] = k), acc), {});
|
|
12
|
+
const coinbaseAssetIdToAssetIdMap = invert(assetIdToCoinbaseTickerMap);
|
|
13
|
+
const coinbaseTickerToAssetId = (id) => coinbaseAssetIdToAssetIdMap[id];
|
|
14
|
+
exports.coinbaseTickerToAssetId = coinbaseTickerToAssetId;
|
|
15
|
+
const assetIdToCoinbaseTicker = (assetId) => assetIdToCoinbaseTickerMap[(0, toLower_1.default)(assetId)];
|
|
16
|
+
exports.assetIdToCoinbaseTicker = assetIdToCoinbaseTicker;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AssetId } from '../../index';
|
|
2
|
+
declare type CoinbaseCurrency = {
|
|
3
|
+
id: string;
|
|
4
|
+
details: {
|
|
5
|
+
crypto_address_link: string | null;
|
|
6
|
+
};
|
|
7
|
+
default_network: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function parseData(data: CoinbaseCurrency[]): Record<AssetId, string>;
|
|
10
|
+
export declare function getData(): Promise<CoinbaseCurrency[]>;
|
|
11
|
+
export declare const writeFiles: (data: Record<AssetId, string>) => Promise<void>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,58 @@
|
|
|
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.writeFiles = exports.getData = exports.parseData = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
10
|
+
function coinbaseCurrencyToAssetId(currency) {
|
|
11
|
+
var _a;
|
|
12
|
+
if (currency.id === 'BTC')
|
|
13
|
+
return 'bip122:000000000019d6689c085ae165831e93/slip44:0';
|
|
14
|
+
if (currency.id === 'ATOM')
|
|
15
|
+
return 'cosmos:cosmoshub-4/slip44:118';
|
|
16
|
+
if (currency.id === 'OSMO')
|
|
17
|
+
return 'cosmos:osmosis-1/slip44:118';
|
|
18
|
+
if (currency.id === 'ETH')
|
|
19
|
+
return 'eip155:1/slip44:60';
|
|
20
|
+
if (currency.default_network === 'ethereum') {
|
|
21
|
+
const addressQuery = (_a = currency.details.crypto_address_link) === null || _a === void 0 ? void 0 : _a.split('token/')[1];
|
|
22
|
+
const address = addressQuery === null || addressQuery === void 0 ? void 0 : addressQuery.split('?a')[0];
|
|
23
|
+
return `eip155:1/erc20:${(0, toLower_1.default)(address)}`;
|
|
24
|
+
}
|
|
25
|
+
console.info(`Could not create assetId from coinbase asset ${currency.id}`);
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
function parseData(data) {
|
|
29
|
+
return data.reduce((acc, current) => {
|
|
30
|
+
const assetId = coinbaseCurrencyToAssetId(current);
|
|
31
|
+
if (!assetId)
|
|
32
|
+
return acc;
|
|
33
|
+
acc[assetId] = current.id;
|
|
34
|
+
return acc;
|
|
35
|
+
}, {});
|
|
36
|
+
}
|
|
37
|
+
exports.parseData = parseData;
|
|
38
|
+
async function getData() {
|
|
39
|
+
try {
|
|
40
|
+
const { data } = await axios_1.default.get('https://api.pro.coinbase.com/currencies');
|
|
41
|
+
return data;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
console.error('Get supported coins (coinbase-pay) failed');
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.getData = getData;
|
|
49
|
+
const writeFile = async (data) => {
|
|
50
|
+
const path = './src/adapters/coinbase/generated/';
|
|
51
|
+
const file = 'adapter.json';
|
|
52
|
+
await fs_1.default.promises.writeFile(`${path}${file}`, JSON.stringify(data, null, 2));
|
|
53
|
+
};
|
|
54
|
+
const writeFiles = async (data) => {
|
|
55
|
+
await writeFile(data);
|
|
56
|
+
console.info('Generated Coinbase AssetId adapter data.');
|
|
57
|
+
};
|
|
58
|
+
exports.writeFiles = writeFiles;
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
import { ChainId } from '../../chainId/chainId';
|
|
2
|
+
export declare enum CoingeckoAssetPlatform {
|
|
3
|
+
Ethereum = "ethereum",
|
|
4
|
+
Cosmos = "cosmos",
|
|
5
|
+
Osmosis = "osmosis",
|
|
6
|
+
Avalanche = "avalanche"
|
|
7
|
+
}
|
|
8
|
+
export declare const coingeckoBaseUrl = "http://api.coingecko.com/api/v3";
|
|
9
|
+
export declare const coingeckoProBaseUrl = "http://pro-api.coingecko.com/api/v3";
|
|
1
10
|
export declare const coingeckoUrl = "https://api.coingecko.com/api/v3/coins/list?include_platform=true";
|
|
2
11
|
export declare const coingeckoToAssetId: (id: string) => string | undefined;
|
|
3
12
|
export declare const assetIdToCoingecko: (assetId: string) => string | undefined;
|
|
13
|
+
export declare const chainIdToCoingeckoAssetPlatform: (chainId: ChainId) => string;
|
|
14
|
+
export declare const makeCoingeckoAssetUrl: (assetId: string, apiKey?: string | undefined) => string;
|
|
@@ -26,9 +26,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.assetIdToCoingecko = exports.coingeckoToAssetId = exports.coingeckoUrl = void 0;
|
|
29
|
+
exports.makeCoingeckoAssetUrl = exports.chainIdToCoingeckoAssetPlatform = exports.assetIdToCoingecko = exports.coingeckoToAssetId = exports.coingeckoUrl = exports.coingeckoProBaseUrl = exports.coingeckoBaseUrl = exports.CoingeckoAssetPlatform = void 0;
|
|
30
30
|
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
31
|
+
const assetId_1 = require("../../assetId/assetId");
|
|
32
|
+
const chainId_1 = require("../../chainId/chainId");
|
|
33
|
+
const constants_1 = require("../../constants");
|
|
31
34
|
const adapters = __importStar(require("./generated"));
|
|
35
|
+
// https://api.coingecko.com/api/v3/asset_platforms
|
|
36
|
+
var CoingeckoAssetPlatform;
|
|
37
|
+
(function (CoingeckoAssetPlatform) {
|
|
38
|
+
CoingeckoAssetPlatform["Ethereum"] = "ethereum";
|
|
39
|
+
CoingeckoAssetPlatform["Cosmos"] = "cosmos";
|
|
40
|
+
CoingeckoAssetPlatform["Osmosis"] = "osmosis";
|
|
41
|
+
CoingeckoAssetPlatform["Avalanche"] = "avalanche";
|
|
42
|
+
})(CoingeckoAssetPlatform = exports.CoingeckoAssetPlatform || (exports.CoingeckoAssetPlatform = {}));
|
|
43
|
+
exports.coingeckoBaseUrl = 'http://api.coingecko.com/api/v3';
|
|
44
|
+
exports.coingeckoProBaseUrl = 'http://pro-api.coingecko.com/api/v3';
|
|
32
45
|
exports.coingeckoUrl = 'https://api.coingecko.com/api/v3/coins/list?include_platform=true';
|
|
33
46
|
const generatedAssetIdToCoingeckoMap = Object.values(adapters).reduce((acc, cur) => ({
|
|
34
47
|
...acc,
|
|
@@ -40,3 +53,46 @@ const coingeckoToAssetId = (id) => generatedCoingeckoToAssetIdMap[id];
|
|
|
40
53
|
exports.coingeckoToAssetId = coingeckoToAssetId;
|
|
41
54
|
const assetIdToCoingecko = (assetId) => generatedAssetIdToCoingeckoMap[(0, toLower_1.default)(assetId)];
|
|
42
55
|
exports.assetIdToCoingecko = assetIdToCoingecko;
|
|
56
|
+
// https://www.coingecko.com/en/api/documentation - See asset_platforms
|
|
57
|
+
const chainIdToCoingeckoAssetPlatform = (chainId) => {
|
|
58
|
+
const { chainNamespace, chainReference } = (0, chainId_1.fromChainId)(chainId);
|
|
59
|
+
switch (chainNamespace) {
|
|
60
|
+
case constants_1.CHAIN_NAMESPACE.Ethereum:
|
|
61
|
+
switch (chainReference) {
|
|
62
|
+
case constants_1.CHAIN_REFERENCE.EthereumMainnet:
|
|
63
|
+
return CoingeckoAssetPlatform.Ethereum;
|
|
64
|
+
case constants_1.CHAIN_REFERENCE.AvalancheCChain:
|
|
65
|
+
return CoingeckoAssetPlatform.Avalanche;
|
|
66
|
+
default:
|
|
67
|
+
throw new Error(`chainNamespace ${chainNamespace}, chainReference ${chainReference} not supported.`);
|
|
68
|
+
}
|
|
69
|
+
case constants_1.CHAIN_NAMESPACE.Cosmos:
|
|
70
|
+
switch (chainReference) {
|
|
71
|
+
case constants_1.CHAIN_REFERENCE.CosmosHubMainnet:
|
|
72
|
+
return CoingeckoAssetPlatform.Cosmos;
|
|
73
|
+
case constants_1.CHAIN_REFERENCE.OsmosisMainnet:
|
|
74
|
+
return CoingeckoAssetPlatform.Osmosis;
|
|
75
|
+
default:
|
|
76
|
+
throw new Error(`chainNamespace ${chainNamespace}, chainReference ${chainReference} not supported.`);
|
|
77
|
+
}
|
|
78
|
+
// Bitcoin is not a valid asset platform: https://api.coingecko.com/api/v3/asset_platforms
|
|
79
|
+
case constants_1.CHAIN_NAMESPACE.Bitcoin:
|
|
80
|
+
default:
|
|
81
|
+
throw new Error(`chainNamespace ${chainNamespace}, chainReference ${chainReference} not supported.`);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
exports.chainIdToCoingeckoAssetPlatform = chainIdToCoingeckoAssetPlatform;
|
|
85
|
+
const makeCoingeckoAssetUrl = (assetId, apiKey) => {
|
|
86
|
+
const id = (0, exports.assetIdToCoingecko)(assetId);
|
|
87
|
+
if (!id)
|
|
88
|
+
throw new Error(`no coingecko asset for assetId: ${assetId}`);
|
|
89
|
+
const baseUrl = apiKey ? exports.coingeckoProBaseUrl : exports.coingeckoBaseUrl;
|
|
90
|
+
const maybeApiKey = apiKey ? `&x_cg_pro_api_key=${apiKey}` : '';
|
|
91
|
+
const { chainNamespace, chainReference, assetNamespace, assetReference } = (0, assetId_1.fromAssetId)(assetId);
|
|
92
|
+
if (assetNamespace === 'erc20') {
|
|
93
|
+
const assetPlatform = (0, exports.chainIdToCoingeckoAssetPlatform)((0, chainId_1.toChainId)({ chainNamespace, chainReference }));
|
|
94
|
+
return `${baseUrl}/coins/${assetPlatform}/contract/${assetReference}${maybeApiKey}`;
|
|
95
|
+
}
|
|
96
|
+
return `${baseUrl}/coins/${id}${maybeApiKey}`;
|
|
97
|
+
};
|
|
98
|
+
exports.makeCoingeckoAssetUrl = makeCoingeckoAssetUrl;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const gemTickerToAssetId: (id: string) => string | undefined;
|
|
2
|
+
export declare const assetIdToGemTicker: (assetId: string) => string | undefined;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.assetIdToGemTicker = exports.gemTickerToAssetId = void 0;
|
|
7
7
|
const toLower_1 = __importDefault(require("lodash/toLower"));
|
|
8
8
|
const assetIdToGemAssetIdMap = {
|
|
9
9
|
'bip122:000000000019d6689c085ae165831e93/slip44:0': 'bitcoin',
|
|
@@ -30,7 +30,7 @@ const assetIdToGemAssetIdMap = {
|
|
|
30
30
|
};
|
|
31
31
|
const invert = (data) => Object.entries(data).reduce((acc, [k, v]) => ((acc[v] = k), acc), {});
|
|
32
32
|
const gemAssetIdToAssetIdMap = invert(assetIdToGemAssetIdMap);
|
|
33
|
-
const
|
|
34
|
-
exports.
|
|
35
|
-
const
|
|
36
|
-
exports.
|
|
33
|
+
const gemTickerToAssetId = (id) => gemAssetIdToAssetIdMap[id];
|
|
34
|
+
exports.gemTickerToAssetId = gemTickerToAssetId;
|
|
35
|
+
const assetIdToGemTicker = (assetId) => assetIdToGemAssetIdMap[(0, toLower_1.default)(assetId)];
|
|
36
|
+
exports.assetIdToGemTicker = assetIdToGemTicker;
|
package/dist/adapters/index.d.ts
CHANGED
package/dist/adapters/index.js
CHANGED
|
@@ -20,4 +20,5 @@ __exportStar(require("./yearn"), exports);
|
|
|
20
20
|
__exportStar(require("./osmosis"), exports);
|
|
21
21
|
__exportStar(require("./gem"), exports);
|
|
22
22
|
__exportStar(require("./banxa"), exports);
|
|
23
|
+
__exportStar(require("./coinbase"), exports);
|
|
23
24
|
__exportStar(require("./thortrading"), exports);
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.js
CHANGED