Chain.Definition
Summary
This method allos you to create a Chain Definition object that contains methods to work with streaming API.
Once the data is described, your application just needs to call the getStream()
method of the Definition to create a Chain.Stream object for the defined data.
Methods
Definition(name: string)
Allows you to create a short Definition object for the Chain content object.
Parameters:
Name | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
name | No | - | string | Single instrument name |
Returned value: a Definition object
Definition(params: Chain.Params)
Allows you to create a full Definition object for the Chain content object.
Chain.Params properties:
Property | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
name | No | - | string | - |
service | Yes | - | string | - |
skipEmpty | Yes | - | boolean | - |
overrideSummaryLinks | Yes | - | number | - |
skipSummaryLinks | Yes | - | boolean | - |
nameGuessingQuantity | Yes | - | number | - |
extendedParams | Yes | - | {[key:string]:any} |
Specifies the parameters that will be merged with the request |
Returned value: a Definition object
getStream(session: Session, api?: string)
Description: Creates a Chain.StreamingChain object for the defined data.
Parameters:
Name | Is Optional | Default Value | Type | Description |
---|---|---|---|---|
session | No | - | Session | Session instance |
api | Yes | 'pricing/main' | string | - |
Returned value: a Chain.StreamingChain
Example of usage
const stream1 = Pricing.Chain.Definition('.AV.HSI').getStream(session);
// or
const stream2 = Pricing.Chain.Definition({
name: '.AV.HSI',
skipEmpty: true,
nameGuessingQuantity: 8
}).getStream(session, 'some/api/main');