mirror of
https://github.com/alexgo-io/alex-sdk.git
synced 2026-01-12 14:25:02 +08:00
fix: token price for STX
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export type Currency = `${string}.${string}` & {
|
||||
export type Currency = string & {
|
||||
readonly brand: unique symbol;
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user