UNPKG

@parifi/sdk

Version:

Parifi SDK with common utility functions

1 lines 1.2 kB
{"version":3,"sources":["../../src/pyth/pythMapper.ts"],"sourcesContent":["import { PythPriceResponse } from '../interfaces/subgraphTypes';\n\n// Function to map the pyth latest price response to interface\nexport const mapPythPriceResponseToInterface = (response: any[]): PythPriceResponse[] => {\n return response.map((item) => ({\n id: item.id || '',\n price: {\n price: item.price.price || '0',\n conf: item.price.conf || '0',\n expo: item.price.expo || 0,\n publish_time: item.price.publish_time || 0,\n },\n ema_price: {\n price: item.ema_price.price || '0',\n conf: item.ema_price.conf || '0',\n expo: item.ema_price.expo || 0,\n publish_time: item.ema_price.publish_time || 0,\n },\n }));\n};\n"],"mappings":";AAGO,IAAM,kCAAkC,CAAC,aAAyC;AACvF,SAAO,SAAS,IAAI,CAAC,UAAU;AAAA,IAC7B,IAAI,KAAK,MAAM;AAAA,IACf,OAAO;AAAA,MACL,OAAO,KAAK,MAAM,SAAS;AAAA,MAC3B,MAAM,KAAK,MAAM,QAAQ;AAAA,MACzB,MAAM,KAAK,MAAM,QAAQ;AAAA,MACzB,cAAc,KAAK,MAAM,gBAAgB;AAAA,IAC3C;AAAA,IACA,WAAW;AAAA,MACT,OAAO,KAAK,UAAU,SAAS;AAAA,MAC/B,MAAM,KAAK,UAAU,QAAQ;AAAA,MAC7B,MAAM,KAAK,UAAU,QAAQ;AAAA,MAC7B,cAAc,KAAK,UAAU,gBAAgB;AAAA,IAC/C;AAAA,EACF,EAAE;AACJ;","names":[]}