mirror of
https://github.com/orionprotocol/sdk.git
synced 2026-03-29 09:07:59 +03:00
feat: tickers schema was updated
This commit is contained in:
@@ -1,19 +1,12 @@
|
||||
import { z } from 'zod';
|
||||
import { SupportedChainId } from '../../../types';
|
||||
|
||||
const preprocessToEnum = (value: unknown) => {
|
||||
if (typeof value === 'number') {
|
||||
return String(value);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
|
||||
export const tickerSchema = z.object({
|
||||
pair: z.string(),
|
||||
volume24: z.number(),
|
||||
change24: z.number(),
|
||||
lastPrice: z.number(),
|
||||
networks: z.array(z.preprocess(preprocessToEnum, z.nativeEnum(SupportedChainId))),
|
||||
networks: z.array(z.nativeEnum(SupportedChainId)),
|
||||
});
|
||||
|
||||
export const tickersSchema = z.array(tickerSchema);
|
||||
|
||||
Reference in New Issue
Block a user