diff --git a/packages/whale-api-client/__tests__/api/prices.test.ts b/packages/whale-api-client/__tests__/api/prices.test.ts index d3f59afae2..c1bd065763 100644 --- a/packages/whale-api-client/__tests__/api/prices.test.ts +++ b/packages/whale-api-client/__tests__/api/prices.test.ts @@ -209,6 +209,23 @@ describe('oracles', () => { token: 'TA', currency: 'USD', weightage: expect.any(Number), + feed: { + id: expect.any(String), + key: expect.any(String), + sort: expect.any(String), + amount: expect.any(String), + currency: 'USD', + token: 'TA', + time: expect.any(Number), + oracleId: oracles[0].oracleId, + txid: expect.stringMatching(/[0-f]{64}/), + block: { + hash: expect.stringMatching(/[0-f]{64}/), + height: expect.any(Number), + medianTime: expect.any(Number), + time: expect.any(Number) + } + }, block: { hash: expect.stringMatching(/[0-f]{64}/), height: expect.any(Number), diff --git a/packages/whale-api-client/src/api/prices.ts b/packages/whale-api-client/src/api/prices.ts index 3309d5c89c..7fe9387f8e 100644 --- a/packages/whale-api-client/src/api/prices.ts +++ b/packages/whale-api-client/src/api/prices.ts @@ -1,5 +1,6 @@ import { WhaleApiClient } from '../whale.api.client' import { ApiPagedResponse } from '../whale.api.response' +import { OraclePriceFeed } from './oracles' /** * DeFi whale endpoint for price related services. @@ -68,6 +69,11 @@ export interface PriceOracle { oracleId: string weightage: number + /** + * Optional as OraclePriceFeed might not be available e.g. newly initialized Oracle + */ + feed?: OraclePriceFeed + block: { hash: string height: number