Caplin Trader 5.1.0

Interface: module:ct-trading/trademodel/TradeChannelMapper

module:ct-trading/trademodel/TradeChannelMapper

Provides the trading channel name that Liberator uses to send messages on.

An implementation can use emitr to trigger the `channel-added` event passing in the newly added channel as an argument. This is for when an implementation might have trade channels registered to it after the `TradeMessageService` that uses the `TradeChannelMapper` has been constructed.

Super constructor for the base TradeChannelMapper implementations

Methods

getChannel(oTrade) → {String}

Parameters:
Name Type Description
oTrade module:ct-trading/trademodel/Trade
Returns:

the name of the channel that the specified Trade should have its messages sent on.

Type
String

getObjectList() → {String}

Returns:

a space separated list of subjects that Streamlink should subscribe to, in order to allow the channels to work.

Type
String

mapTradeChannel(tradeChannel) → {String}

The trade channel gets mapped to /PRIVATE/username/TRADE-OR-ORDER/FX on the backend, and the permissions are based around that mapped subject, so we need to apply the same mapping when we check permissions.

Parameters:
Name Type Description
tradeChannel String
Returns:

the mapped trade channel.

Type
String