@pioneer-platform/pioneer-discovery 0.0.10 → 0.0.12
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/lib/data.d.ts +0 -4
- package/lib/data.js +84 -106
- package/lib/generatedAssetData.json +6 -0
- package/package.json +2 -3
package/lib/data.d.ts
CHANGED
package/lib/data.js
CHANGED
|
@@ -1,29 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
14
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
15
|
-
if (ar || !(i in from)) {
|
|
16
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
17
|
-
ar[i] = from[i];
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
21
|
-
};
|
|
22
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
23
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
24
4
|
};
|
|
25
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.
|
|
6
|
+
exports.relatedAssets = exports.assetData = void 0;
|
|
27
7
|
/*
|
|
28
8
|
Asset Tools
|
|
29
9
|
|
|
@@ -32,11 +12,8 @@ exports.getAssets = exports.relatedAssets = exports.assetData = void 0;
|
|
|
32
12
|
*/
|
|
33
13
|
var TAG = ' | pioneer-discovery | ';
|
|
34
14
|
var log = require('@pioneer-platform/loggerdog')();
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
var pioneer_caip_1 = require("@pioneer-platform/pioneer-caip");
|
|
38
|
-
var router = require("@pioneer-platform/pioneer-router");
|
|
39
|
-
router.init();
|
|
15
|
+
// let router = require("@pioneer-platform/pioneer-router")
|
|
16
|
+
// router.init()
|
|
40
17
|
//dataByCaip
|
|
41
18
|
var generatedAssetData_json_1 = __importDefault(require("./generatedAssetData.json"));
|
|
42
19
|
exports.assetData = generatedAssetData_json_1.default;
|
|
@@ -44,83 +21,84 @@ var relatedAssetIndex_json_1 = __importDefault(require("./relatedAssetIndex.json
|
|
|
44
21
|
exports.relatedAssets = relatedAssetIndex_json_1.default;
|
|
45
22
|
var MEMOLESS_INTERGRATIONS = ['changelly', 'chainflip'];
|
|
46
23
|
//get assets
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
24
|
+
// export const getAssets = () => {
|
|
25
|
+
// const tag = `${TAG} | getAssets | `;
|
|
26
|
+
// try{
|
|
27
|
+
// let tokenMap = new Map();
|
|
28
|
+
// let chains = new Set();
|
|
29
|
+
// let chainTokenCounts = {};
|
|
30
|
+
// let allAssets:any = [];
|
|
31
|
+
// // Function to add tokens with their source list
|
|
32
|
+
// const addTokens = (tokens:any, sourceList:any) => {
|
|
33
|
+
// tokens.forEach((token:any) => {
|
|
34
|
+
// chains.add(token.chain);
|
|
35
|
+
// // @ts-ignore
|
|
36
|
+
// chainTokenCounts[token.chain] = (chainTokenCounts[token.chain] || 0) + 1;
|
|
37
|
+
// // console.log('*** token: ', token);
|
|
38
|
+
// let expandedInfo = tokenToCaip(token);
|
|
39
|
+
// if (expandedInfo.caip) {
|
|
40
|
+
// expandedInfo.sourceList = sourceList;
|
|
41
|
+
// let assetInfoKey = expandedInfo.caip.toLowerCase();
|
|
42
|
+
//
|
|
43
|
+
// let assetInfo =
|
|
44
|
+
// // @ts-ignore
|
|
45
|
+
// assetData[expandedInfo.caip] || assetData[expandedInfo.caip.toLowerCase()];
|
|
46
|
+
// if (assetInfo) {
|
|
47
|
+
// let combinedInfo = { ...expandedInfo, ...assetInfo, integrations: [] }; // Prepare integration array
|
|
48
|
+
// tokenMap.set(assetInfoKey, combinedInfo);
|
|
49
|
+
// allAssets.push(combinedInfo);
|
|
50
|
+
// } else {
|
|
51
|
+
// //TODO deal witht this at some point, generate caips on a the fly?
|
|
52
|
+
// // console.error('Missing assetData(PIONEER DATA) for: ', token);
|
|
53
|
+
// }
|
|
54
|
+
// } else {
|
|
55
|
+
// console.error('*** expandedInfo: ', expandedInfo);
|
|
56
|
+
// console.error('*** Failed to expand token: ', token);
|
|
57
|
+
// }
|
|
58
|
+
// });
|
|
59
|
+
// };
|
|
60
|
+
//
|
|
61
|
+
// // Add tokens from various lists with their source
|
|
62
|
+
// let primaryAssets = [NativeList, MayaList, PioneerList];
|
|
63
|
+
// let tokenAssets = [
|
|
64
|
+
// StargateARBList,
|
|
65
|
+
// SushiswapList,
|
|
66
|
+
// ThorchainList,
|
|
67
|
+
// TraderjoeList,
|
|
68
|
+
// UniswapList,
|
|
69
|
+
// WoofiList,
|
|
70
|
+
// CoinGeckoList,
|
|
71
|
+
// OneInchList,
|
|
72
|
+
// PancakeswapETHList,
|
|
73
|
+
// PancakeswapList,
|
|
74
|
+
// PangolinList,
|
|
75
|
+
// ];
|
|
76
|
+
// let tokenLists: any[] = [];
|
|
77
|
+
// tokenLists = [...tokenAssets, ...tokenLists];
|
|
78
|
+
// tokenLists.forEach((list: any) => addTokens(list.tokens, list.name));
|
|
79
|
+
//
|
|
80
|
+
// // Get integration support by asset and enrich the token map with this data
|
|
81
|
+
//
|
|
82
|
+
// let integrationSupport = router.assetSupport()
|
|
83
|
+
// integrationSupport = integrationSupport.data || {};
|
|
84
|
+
// //console.log('integrationSupport: ', integrationSupport);
|
|
85
|
+
//
|
|
86
|
+
// // Enrich tokenMap directly with integration support
|
|
87
|
+
// Object.keys(integrationSupport).forEach((key) => {
|
|
88
|
+
// integrationSupport[key].forEach((id:any) => {
|
|
89
|
+
// if (id) {
|
|
90
|
+
// let asset = tokenMap.get(id.toLowerCase());
|
|
91
|
+
// if (asset) {
|
|
92
|
+
// if (MEMOLESS_INTERGRATIONS.indexOf(key) > -1) asset.memoless = true;
|
|
93
|
+
// asset.integrations.push(key);
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
// });
|
|
97
|
+
// });
|
|
98
|
+
//
|
|
99
|
+
// return { tokenMap, allAssets };
|
|
100
|
+
// }catch(e){
|
|
101
|
+
// log.error("getAssets | e: ",e)
|
|
102
|
+
// throw e
|
|
103
|
+
// }
|
|
104
|
+
// }
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
"icon": "https://pioneers.dev/coins/zcash.png",
|
|
37
37
|
"explorer": "https://blockchair.com/zcash",
|
|
38
38
|
"explorerAddressLink": "https://blockchair.com/zcash/address/",
|
|
39
|
+
"explorerXpubLink": "https://zec1.trezor.io/xpub/",
|
|
39
40
|
"explorerTxLink": "https://blockchair.com/zcash/transaction/"
|
|
40
41
|
},
|
|
41
42
|
"cosmos:kaiyo-1/slip44:118": {
|
|
@@ -127,6 +128,7 @@
|
|
|
127
128
|
"icon": "https://assets.coincap.io/assets/icons/256/bch.png",
|
|
128
129
|
"explorer": "https://blockchair.com",
|
|
129
130
|
"explorerAddressLink": "https://blockchair.com/bitcoin-cash/address/",
|
|
131
|
+
"explorerXpubLink": "https://bch1.trezor.io/xpub/",
|
|
130
132
|
"explorerTxLink": "https://blockchair.com/bitcoin-cash/transaction/"
|
|
131
133
|
},
|
|
132
134
|
"bip122:000007d91d1254d60e2dd1ae58038307/slip44:5": {
|
|
@@ -140,6 +142,7 @@
|
|
|
140
142
|
"icon": "https://pioneers.dev/coins/base.png",
|
|
141
143
|
"explorer": "https://blockchair.com/dash",
|
|
142
144
|
"explorerAddressLink": "https://blockchair.com/dash/address/",
|
|
145
|
+
"explorerXpubLink": "https://dash1.trezor.io/xpub/",
|
|
143
146
|
"explorerTxLink": "https://blockchair.com/dash/transaction/"
|
|
144
147
|
},
|
|
145
148
|
"bip122:000000000019d6689c085ae165831e93/slip44:0": {
|
|
@@ -153,6 +156,7 @@
|
|
|
153
156
|
"icon": "https://assets.coincap.io/assets/icons/256/btc.png",
|
|
154
157
|
"explorer": "https://live.blockcypher.com",
|
|
155
158
|
"explorerAddressLink": "https://live.blockcypher.com/btc/address/",
|
|
159
|
+
"explorerXpubLink": "https://btc1.trezor.io/xpub/",
|
|
156
160
|
"explorerTxLink": "https://live.blockcypher.com/btc/tx/"
|
|
157
161
|
},
|
|
158
162
|
"bip122:00000000001a91e3dace36e2be3bf030/slip44:3": {
|
|
@@ -166,6 +170,7 @@
|
|
|
166
170
|
"icon": "https://assets.coincap.io/assets/icons/256/doge.png",
|
|
167
171
|
"explorer": "https://live.blockcypher.com",
|
|
168
172
|
"explorerAddressLink": "https://live.blockcypher.com/doge/address/",
|
|
173
|
+
"explorerXpubLink": "https://blockbook.doge-1.zelcore.io/xpub/",
|
|
169
174
|
"explorerTxLink": "https://live.blockcypher.com/doge/tx/"
|
|
170
175
|
},
|
|
171
176
|
"bip122:12a765e31ffd4059bada1e25190f6e98/slip44:2": {
|
|
@@ -179,6 +184,7 @@
|
|
|
179
184
|
"icon": "https://assets.coincap.io/assets/icons/256/ltc.png",
|
|
180
185
|
"explorer": "https://live.blockcypher.com",
|
|
181
186
|
"explorerAddressLink": "https://live.blockcypher.com/ltc/address/",
|
|
187
|
+
"explorerXpubLink": "https://ltc1.trezor.io/xpub/",
|
|
182
188
|
"explorerTxLink": "https://live.blockcypher.com/ltc/tx/"
|
|
183
189
|
},
|
|
184
190
|
"cosmos:cosmoshub-4/ibc:0025F8A87464A471E66B234C4F93AEC5B4DA3D42D7986451A059273426290DD5": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pioneer-platform/pioneer-discovery",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"types": "./lib/main.d.ts",
|
|
6
6
|
"_moduleAliases": {
|
|
@@ -25,7 +25,6 @@
|
|
|
25
25
|
"@coinmasters/tokens": "^3.7.33",
|
|
26
26
|
"@coinmasters/types": "^4.7.33",
|
|
27
27
|
"@pioneer-platform/loggerdog": "^8.3.1",
|
|
28
|
-
"@pioneer-platform/pioneer-caip": "^9.2.27"
|
|
29
|
-
"@pioneer-platform/pioneer-router": "^8.4.92"
|
|
28
|
+
"@pioneer-platform/pioneer-caip": "^9.2.27"
|
|
30
29
|
}
|
|
31
30
|
}
|