Pricing.Chain.Events
Pricing.Chain.Events provides a set of events described below that can be emitted by Pricing.Chain.Stream
Pricing.Chain.Events.Add
The Add event is emitted when a new constituent is added to the streaming chain.
Pricing.Chain.OnAdd Callback Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
constituent | The new added constituent | string | - | - |
index | The index of the added constituent in the record | number | - | - |
stream | The Pricing.Chain.Stream object that emitted the event | Pricing.Chain.Stream | - | - |
Pricing.Chain.Events.Update
The Update event is emitted when a constituent is updated in the streaming chain.
Pricing.Chain.OnUpdate Callback Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
newConstituent | The new added constituent | string | - | - |
oldConstituent | the old constituent | string | - | - |
index | the updated constituent index in the record | number | - | - |
stream | The Pricing.Chain.Stream object that emitted the event | Pricing.Chain.Stream | - | - |
Pricing.Chain.Events.Remove
The Remove event is emitted when a constituent is removed from the streaming chain.
Pricing.Chain.OnRemove Callback Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
constituent | The removed constituent | string | - | - |
index | The index of the removed constituent in the record | number | - | - |
stream | The Pricing.Chain.Stream object that emitted the event | Pricing.Chain.Stream | - | - |
Pricing.Chain.Events.Complete
The Complete event is emitted when the streaming chain completes receiving data.
Pricing.Chain.OnComplete Callback Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
constituents | All the constituents in the record | string[] | - | - |
stream | The Pricing.Chain.Stream object that emitted the event | Pricing.Chain.Stream | - | - |
Pricing.Chain.Events.Error
The Error event is emitted when the streaming chain receives an error message.
Pricing.Chain.OnError Callback Parameters
Value | Description | Data type | Optional | Default value |
---|---|---|---|---|
error | Error object received from the stream | Error | - | - |
stream | The Pricing.Chain.Stream object that emitted the event | Pricing.Chain.Stream | - | - |