Pricing.Definition
Summary
Pricing.Definition objects are used to define the Pricing data your application needs to retrieve.
Definition objects describe the universe (list of instruments), the fields and other parameters that will be requested to the data platform.
Once the data is described, your application just needs to call the getStream()
method of the Definition to create a Pricing.Stream object for the defined data.
Methods
Definition(universe: string)
Allows you to create a short definition for the Pricing content object.
Parameters:
Name | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
universe | No | - | string | A single instrument name (e.g. 'EUR=') |
Returned value: a Definition object
Definition(universe: string[ ])
Allows you to create a short definition for the Pricing content object.
Parameters:
Name | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
universe | No | - | string [] | Multiple instruments name (e.g. ['EUR=', 'CAD=', 'UAH=']) |
Returned value: a Definition object
Definition(params: Pricing.Params)
Allows you to create a full definition for the Pricing content object.
Pricing.Param properties:
Property | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
universe | No | - | string | string[] |
fields | Yes | - | string[] | Specifies the specific fields to be delivered when messages arrive |
service | Yes | - | string | Offers the ability to use specific service to manage the realtime streaming data |
extendedParams | Yes | - | {[key: string]: any} | Specifies the parameters that will be merged with the request |
Returned value: a Definition object
getStream(session: Session.Session, api?: string)
Allows you to create a Pricing.Stream object for the defined data.
Parameters:
Name | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
session | No | - | Session | Session instance |
api | Yes | 'pricing/main' | string | API path in the configuration file to build a streaming url |
Returned value: Pricing.Stream
Examples of usage:
Definition example
// Definition example
const params1 = 'EUR=';
// or
const params2 = ['EUR=', 'CAD=', 'UAH='];
// or
const params3 = {
universe: 'EUR=',
fields: ['DSPLY_NAME', 'BID_NET_CH']
};
// or
const params4 = {
universe: ['EUR=', 'CAD=', 'UAH='],
fields: ['DSPLY_NAME', 'BID_NET_CH'],
service: 'some_service',
extendedParams: {
filter: 'FILTER',
}
}
const pricingDefinition: PricingDefinition = Pricing.Definition(params);
getStream example
// getStream example
const stream = Pricing.Definition('EUR=').getStream(session);