mirror of https://github.com/lukechilds/Agama.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
742 B
31 lines
742 B
module.exports = (shepherd) => {
|
|
/*
|
|
* type: GET
|
|
*
|
|
*/
|
|
shepherd.get('/InstantDEX/allcoins', (req, res, next) => {
|
|
let successObj;
|
|
let nativeCoindList = [];
|
|
let electrumCoinsList = [];
|
|
|
|
for (let key in shepherd.electrumCoins) {
|
|
if (key !== 'auth') {
|
|
electrumCoinsList.push(shepherd.electrumCoins[key].abbr);
|
|
}
|
|
}
|
|
|
|
for (let key in shepherd.coindInstanceRegistry) {
|
|
nativeCoindList.push(key === 'komodod' ? 'KMD' : key);
|
|
}
|
|
|
|
successObj = {
|
|
native: nativeCoindList,
|
|
spv: electrumCoinsList,
|
|
total: Object.keys(shepherd.electrumCoins).length - 1 + Object.keys(nativeCoindList).length,
|
|
};
|
|
|
|
res.end(JSON.stringify(successObj));
|
|
});
|
|
|
|
return shepherd;
|
|
};
|