fix: token price for STX

This commit is contained in:
Kyle Fang
2024-06-19 06:48:56 +00:00
parent 89e7bff91e
commit 7922bed64e
2 changed files with 7 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
export type Currency = `${string}.${string}` & {
export type Currency = string & {
readonly brand: unique symbol;
};

View File

@@ -32,6 +32,12 @@ export async function getPrices(mappings: TokenInfo[]): Promise<PriceData[]> {
.then((x: any) =>
x.data
.map((a: any): PriceData | null => {
if (a.contract_id === 'STX') {
return {
token: Currency.STX,
price: a.last_price_usd,
};
}
const token = mappings.find(
(b) => b.underlyingToken.split('::')[0] === a.contract_id
)?.id;