Skip to content

Commit

Permalink
added feed?: OraclePriceFeed in PriceOracle (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Aug 5, 2021
1 parent 2f47cac commit 2446c18
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions packages/whale-api-client/__tests__/api/prices.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
6 changes: 6 additions & 0 deletions packages/whale-api-client/src/api/prices.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2446c18

Please sign in to comment.