diff --git a/websrc/utils.ts b/websrc/utils.ts new file mode 100644 index 0000000..3cb4ec3 --- /dev/null +++ b/websrc/utils.ts @@ -0,0 +1,12 @@ +import {CurrencyPair} from "./types"; + +export function symbolToPair(symbol: string): CurrencyPair { + const symbol_regex = "t(?[a-zA-Z]{3})(?[a-zA-Z]{3})" + + const match = symbol.match(symbol_regex) + + return { + base: match.groups.base, + quote: match.groups.quote + } +} \ No newline at end of file