@@ -22,6 +22,12 @@ public class JsonRpcClient : HttpWebClientProtocol, IClient
2222 private static readonly string LIST_MARKET_CATALOGUE_METHOD = "SportsAPING/v1.0/listMarketCatalogue" ;
2323 private static readonly string LIST_MARKET_BOOK_METHOD = "SportsAPING/v1.0/listMarketBook" ;
2424 private static readonly string PLACE_ORDERS_METHOD = "SportsAPING/v1.0/placeOrders" ;
25+ private static readonly string LIST_MARKET_PROFIT_AND_LOST_METHOD = "SportsAPING/v1.0/listMarketProfitAndLoss" ;
26+ private static readonly string LIST_CURRENT_ORDERS_METHOD = "SportsAPING/v1.0/listCurrentOrders" ;
27+ private static readonly string LIST_CLEARED_ORDERS_METHOD = "SportsAPING/v1.0/listClearedOrders" ;
28+ private static readonly string CANCEL_ORDERS_METHOD = "SportsAPING/v1.0/cancelOrders" ;
29+ private static readonly string REPLACE_ORDERS_METHOD = "SportsAPING/v1.0/replaceOrders" ;
30+ private static readonly string UPDATE_ORDERS_METHOD = "SportsAPING/v1.0/updateOrders" ;
2531 private static readonly String FILTER = "filter" ;
2632 private static readonly String LOCALE = "locale" ;
2733 private static readonly String CURRENCY_CODE = "currencyCode" ;
@@ -35,6 +41,23 @@ public class JsonRpcClient : HttpWebClientProtocol, IClient
3541 private static readonly String MARKET_ID = "marketId" ;
3642 private static readonly String INSTRUCTIONS = "instructions" ;
3743 private static readonly String CUSTOMER_REFERENCE = "customerRef" ;
44+ private static readonly String INCLUDE_SETTLED_BETS = "includeSettledBets" ;
45+ private static readonly String INCLUDE_BSP_BETS = "includeBspBets" ;
46+ private static readonly String NET_OF_COMMISSION = "netOfCommission" ;
47+ private static readonly String BET_IDS = "betIds" ;
48+ private static readonly String PLACED_DATE_RANGE = "placedDateRange" ;
49+ private static readonly String ORDER_BY = "orderBy" ;
50+ private static readonly String SORT_DIR = "sortDir" ;
51+ private static readonly String FROM_RECORD = "fromRecord" ;
52+ private static readonly String RECORD_COUNT = "recordCount" ;
53+ private static readonly string BET_STATUS = "betStatus" ;
54+ private static readonly string EVENT_TYPE_IDS = "eventTypeIds" ;
55+ private static readonly string EVENT_IDS = "eventIds" ;
56+ private static readonly string RUNNER_IDS = "runnerIds" ;
57+ private static readonly string SIDE = "side" ;
58+ private static readonly string SETTLED_DATE_RANGE = "settledDateRange" ;
59+ private static readonly string GROUP_BY = "groupBy" ;
60+ private static readonly string INCLUDE_ITEM_DESCRIPTION = "includeItemDescription" ;
3861
3962 public JsonRpcClient ( string endPoint , string appKey , string sessionToken )
4063 {
@@ -153,5 +176,82 @@ private static System.Exception ReconstituteException(Api_ng_sample_code.TO.Exce
153176 var exceptionData = data . Property ( exceptionName ) . Value . ToString ( ) ;
154177 return JsonConvert . Deserialize < APINGException > ( exceptionData ) ;
155178 }
179+
180+ public IList < MarketProfitAndLoss > listMarketProfitAndLoss ( IList < string > marketIds , bool includeSettledBets = false , bool includeBspBets = false , bool netOfCommission = false )
181+ {
182+ var args = new Dictionary < string , object > ( ) ;
183+ args [ MARKET_IDS ] = marketIds ;
184+ args [ INCLUDE_SETTLED_BETS ] = includeSettledBets ;
185+ args [ INCLUDE_BSP_BETS ] = includeBspBets ;
186+ args [ NET_OF_COMMISSION ] = netOfCommission ;
187+ return Invoke < List < MarketProfitAndLoss > > ( LIST_MARKET_PROFIT_AND_LOST_METHOD , args ) ;
188+ }
189+
190+ public CurrentOrderSummaryReport listCurrentOrders ( ISet < String > betIds , ISet < String > marketIds , OrderProjection ? orderProjection = null , TimeRange placedDateRange = null , OrderBy ? orderBy = null , SortDir ? sortDir = null , int ? fromRecord = null , int ? recordCount = null )
191+ {
192+ var args = new Dictionary < string , object > ( ) ;
193+ args [ BET_IDS ] = betIds ;
194+ args [ MARKET_IDS ] = marketIds ;
195+ args [ ORDER_PROJECTION ] = orderProjection ;
196+ args [ PLACED_DATE_RANGE ] = placedDateRange ;
197+ args [ ORDER_BY ] = orderBy ;
198+ args [ SORT_DIR ] = sortDir ;
199+ args [ FROM_RECORD ] = fromRecord ;
200+ args [ RECORD_COUNT ] = recordCount ;
201+
202+ return Invoke < CurrentOrderSummaryReport > ( LIST_CURRENT_ORDERS_METHOD , args ) ;
203+ }
204+
205+ public ClearedOrderSummaryReport listClearedOrders ( BetStatus betStatus , ISet < string > eventTypeIds = null , ISet < string > eventIds = null , ISet < string > marketIds = null , ISet < RunnerId > runnerIds = null , ISet < string > betIds = null , Side ? side = null , TimeRange settledDateRange = null , GroupBy ? groupBy = null , bool ? includeItemDescription = null , String locale = null , int ? fromRecord = null , int ? recordCount = null )
206+ {
207+ var args = new Dictionary < string , object > ( ) ;
208+ args [ BET_STATUS ] = betStatus ;
209+ args [ EVENT_TYPE_IDS ] = eventTypeIds ;
210+ args [ EVENT_IDS ] = eventIds ;
211+ args [ MARKET_IDS ] = marketIds ;
212+ args [ RUNNER_IDS ] = runnerIds ;
213+ args [ BET_IDS ] = betIds ;
214+ args [ SIDE ] = side ;
215+ args [ SETTLED_DATE_RANGE ] = settledDateRange ;
216+ args [ GROUP_BY ] = groupBy ;
217+ args [ INCLUDE_ITEM_DESCRIPTION ] = includeItemDescription ;
218+ args [ LOCALE ] = locale ;
219+ args [ FROM_RECORD ] = fromRecord ;
220+ args [ RECORD_COUNT ] = recordCount ;
221+
222+ return Invoke < ClearedOrderSummaryReport > ( LIST_CLEARED_ORDERS_METHOD , args ) ;
223+ }
224+
225+
226+ public CancelExecutionReport cancelOrders ( string marketId , IList < CancelInstruction > instructions , string customerRef )
227+ {
228+ var args = new Dictionary < string , object > ( ) ;
229+ args [ MARKET_ID ] = marketId ;
230+ args [ INSTRUCTIONS ] = instructions ;
231+ args [ CUSTOMER_REFERENCE ] = customerRef ;
232+
233+ return Invoke < CancelExecutionReport > ( CANCEL_ORDERS_METHOD , args ) ;
234+ }
235+
236+ public ReplaceExecutionReport replaceOrders ( String marketId , IList < ReplaceInstruction > instructions , String customerRef )
237+ {
238+ var args = new Dictionary < string , object > ( ) ;
239+ args [ MARKET_ID ] = marketId ;
240+ args [ INSTRUCTIONS ] = instructions ;
241+ args [ CUSTOMER_REFERENCE ] = customerRef ;
242+
243+ return Invoke < ReplaceExecutionReport > ( REPLACE_ORDERS_METHOD , args ) ;
244+ }
245+
246+ public UpdateExecutionReport updateOrders ( String marketId , IList < UpdateInstruction > instructions , String customerRef )
247+ {
248+ var args = new Dictionary < string , object > ( ) ;
249+ args [ MARKET_ID ] = marketId ;
250+ args [ INSTRUCTIONS ] = instructions ;
251+ args [ CUSTOMER_REFERENCE ] = customerRef ;
252+
253+ return Invoke < UpdateExecutionReport > ( UPDATE_ORDERS_METHOD , args ) ;
254+ }
255+
156256 }
157257}
0 commit comments