chart-based route finding

This commit is contained in:
Tim
2024-02-27 22:20:23 -04:00
parent fc126955b6
commit 9a5d7a1ce5
12 changed files with 126 additions and 46 deletions

View File

@@ -57,7 +57,7 @@ function addSymbol(p, base, quote, inverted) {
const longExchange = ['Uniswap v2', 'Uniswap v3',][p.e]
const description = `${base.n} / ${quote.n}`
const type = 'swap'
_symbols[full_name] = {symbol, full_name, description, exchange, type, inverted,}
_symbols[full_name] = {symbol, full_name, description, exchange, type, inverted, base, quote}
indexes[full_name] = {
// key
id: full_name,
@@ -84,7 +84,6 @@ function addSymbol(p, base, quote, inverted) {
// }
async function getAllSymbols() {
if (_symbols===null) {
_symbols = {}
for (const t of metadata.t)
@@ -112,6 +111,10 @@ async function getAllSymbols() {
return _symbols
}
export function lookupSymbol(fullName) {
return _symbols[fullName]
}
export default {
onReady: (callback) => {
console.log('[onReady]: Method call');