getDataFeed

Get data feed by oracle(s)

Spec

getDataFeed(oracles: string | string[], feedName: string, otherParams?: DataFeedParams);

interface DataFeedParams {
    feed_value?: string | number | boolean;
    min_mci?: number;
    ifseveral?: 'abort' | 'last';
    what?: 'unit' | 'value';
    type?: 'string' | 'auto';
    ifnone?: string | number | boolean;
}

*Oracles supports type string, but it's syntactic sugar, the response won't change

Example

await Cleint.getDataFeed(['OPNUXBRSSQQGHKQNEPD2GLWQYEUY5XLD'], 'timestamp', {
  // feed_value?: string | number | boolean;
  // min_mci?: number;
  // ifseveral?: 'abort' | 'last';
  // what?: 'unit' | 'value';
  // type?: 'string' | 'auto';
  // ifnone?: string | number | boolean;
});

Response

1711582481537

Last updated