Skip to content

Commit

Permalink
fix(activity/index.ts): set default duration to '5m' for consistency …
Browse files Browse the repository at this point in the history
…in data handling

fix(activity/index.ts): update priceChange5m assignment to default to 0 when not provided for better error handling
  • Loading branch information
Dan Cryptoscan committed Jan 10, 2025
1 parent 808b2af commit 44eb099
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/projects/activity/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ export async function handler(data: Record<string, any>) {
symbol: result.symbol.replace('#', '') || '',
contract: result.contract || '',
change: new BigNumber(result.priceChange5m || result.change || 0).toNumber(),
duration: result.duration || '',
duration: result.duration || '5m',
exchange: result.exchange || '',
priceChange5m: new BigNumber(result.priceChange5m || result.change || 0).toNumber(),
priceChange5m: new BigNumber(result.priceChange5m || 0).toNumber(),
priceChange6h: new BigNumber(result.priceChange6h || 0).toNumber(),
priceChange24h: new BigNumber(result.priceChange24h || 0).toNumber(),
liquidity: new BigNumber(result.liquidity || 0).toNumber(),
Expand Down

0 comments on commit 44eb099

Please sign in to comment.