@nadohq/indexer-client 0.1.0-alpha.30 → 0.1.0-alpha.32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -407,12 +407,12 @@ export class IndexerBaseClient {
407
407
  })();
408
408
 
409
409
  const baseResponse = await this.query('events', {
410
- subaccount: params.subaccount
411
- ? subaccountToHex({
412
- subaccountOwner: params.subaccount.subaccountOwner,
413
- subaccountName: params.subaccount.subaccountName,
414
- })
415
- : undefined,
410
+ subaccounts: params.subaccounts?.map((subaccount) =>
411
+ subaccountToHex({
412
+ subaccountOwner: subaccount.subaccountOwner,
413
+ subaccountName: subaccount.subaccountName,
414
+ }),
415
+ ),
416
416
  product_ids: params.productIds,
417
417
  isolated: params.isolated,
418
418
  event_types: params.eventTypes,
@@ -442,12 +442,12 @@ export class IndexerBaseClient {
442
442
  params: GetIndexerOrdersParams,
443
443
  ): Promise<GetIndexerOrdersResponse> {
444
444
  const baseResponse = await this.query('orders', {
445
- subaccount: params.subaccount
446
- ? subaccountToHex({
447
- subaccountOwner: params.subaccount.subaccountOwner,
448
- subaccountName: params.subaccount.subaccountName,
449
- })
450
- : undefined,
445
+ subaccounts: params?.subaccounts?.map((subaccount) =>
446
+ subaccountToHex({
447
+ subaccountOwner: subaccount.subaccountOwner,
448
+ subaccountName: subaccount.subaccountName,
449
+ }),
450
+ ),
451
451
  product_ids: params.productIds,
452
452
  trigger_types: params.triggerTypes,
453
453
  isolated: params.isolated,
@@ -470,12 +470,12 @@ export class IndexerBaseClient {
470
470
  params: GetIndexerMatchEventsParams,
471
471
  ): Promise<GetIndexerMatchEventsResponse> {
472
472
  const baseResponse = await this.query('matches', {
473
- subaccount: params.subaccount
474
- ? subaccountToHex({
475
- subaccountOwner: params.subaccount.subaccountOwner,
476
- subaccountName: params.subaccount.subaccountName,
477
- })
478
- : undefined,
473
+ subaccounts: params?.subaccounts?.map((subaccount) =>
474
+ subaccountToHex({
475
+ subaccountOwner: subaccount.subaccountOwner,
476
+ subaccountName: subaccount.subaccountName,
477
+ }),
478
+ ),
479
479
  product_ids: params.productIds,
480
480
  isolated: params.isolated,
481
481
  max_time: params.maxTimestampInclusive,
@@ -59,7 +59,7 @@ export class IndexerClient extends IndexerBaseClient {
59
59
  startCursor,
60
60
  maxTimestampInclusive,
61
61
  limit,
62
- subaccount: { subaccountName, subaccountOwner },
62
+ subaccounts: [{ subaccountName, subaccountOwner }],
63
63
  productIds,
64
64
  isolated,
65
65
  });
@@ -88,7 +88,7 @@ export class IndexerClient extends IndexerBaseClient {
88
88
  type: 'txs',
89
89
  value: limit,
90
90
  },
91
- subaccount: { subaccountName, subaccountOwner },
91
+ subaccounts: [{ subaccountName, subaccountOwner }],
92
92
  });
93
93
 
94
94
  // Now aggregate results by the submission index, use map to maintain insertion order
@@ -159,7 +159,7 @@ export class IndexerClient extends IndexerBaseClient {
159
159
  type: 'txs',
160
160
  value: limit,
161
161
  },
162
- subaccount: { subaccountName, subaccountOwner },
162
+ subaccounts: [{ subaccountName, subaccountOwner }],
163
163
  isolated,
164
164
  });
165
165
 
@@ -204,7 +204,7 @@ export class IndexerClient extends IndexerBaseClient {
204
204
  const baseResponse = await this.getOrders({
205
205
  startCursor,
206
206
  maxTimestampInclusive,
207
- subaccount: { subaccountName, subaccountOwner },
207
+ subaccounts: [{ subaccountName, subaccountOwner }],
208
208
  limit,
209
209
  productIds,
210
210
  triggerTypes,
@@ -244,7 +244,7 @@ export class IndexerClient extends IndexerBaseClient {
244
244
  type: 'txs',
245
245
  value: limit,
246
246
  },
247
- subaccount: { subaccountName, subaccountOwner },
247
+ subaccounts: [{ subaccountName, subaccountOwner }],
248
248
  });
249
249
 
250
250
  const events = baseResponse
@@ -298,7 +298,7 @@ export class IndexerClient extends IndexerBaseClient {
298
298
  type: 'txs',
299
299
  value: limit,
300
300
  },
301
- subaccount: { subaccountName, subaccountOwner },
301
+ subaccounts: [{ subaccountName, subaccountOwner }],
302
302
  });
303
303
 
304
304
  // Now aggregate results by the submission index, use map to maintain insertion order
@@ -315,7 +315,7 @@ export type GetIndexerEventsLimitType = 'events' | 'txs';
315
315
  export interface GetIndexerEventsParams {
316
316
  // Max submission index, inclusive
317
317
  startCursor?: string;
318
- subaccount?: Subaccount;
318
+ subaccounts?: Subaccount[];
319
319
  productIds?: number[];
320
320
  // If not given, will return both isolated & non-iso events
321
321
  isolated?: boolean;
@@ -338,7 +338,7 @@ export type GetIndexerEventsResponse = IndexerEventWithTx[];
338
338
  export interface GetIndexerOrdersParams {
339
339
  // Max submission index, inclusive
340
340
  startCursor?: string;
341
- subaccount?: Subaccount;
341
+ subaccounts?: Subaccount[];
342
342
  minTimestampInclusive?: number;
343
343
  maxTimestampInclusive?: number;
344
344
  limit?: number;
@@ -378,7 +378,7 @@ export type GetIndexerOrdersResponse = IndexerOrder[];
378
378
 
379
379
  export interface GetIndexerMatchEventsParams {
380
380
  // When not given, will return all maker events
381
- subaccount?: Subaccount;
381
+ subaccounts?: Subaccount[];
382
382
  productIds?: number[];
383
383
  // If not given, will return both isolated & non-iso events
384
384
  isolated?: boolean;
@@ -93,7 +93,7 @@ export interface IndexerServerMultiProductsParams {
93
93
  }
94
94
 
95
95
  export interface IndexerServerEventsParams {
96
- subaccount?: string;
96
+ subaccounts?: string[];
97
97
  product_ids?: number[];
98
98
  // If not given, will return both isolated & non-iso events
99
99
  isolated?: boolean;
@@ -118,7 +118,7 @@ export type IndexerServerTriggerTypeFilter =
118
118
  | 'time_trigger';
119
119
 
120
120
  export interface IndexerServerOrdersParams {
121
- subaccount?: string;
121
+ subaccounts?: string[];
122
122
  product_ids?: number[];
123
123
  trigger_types?: IndexerServerTriggerTypeFilter[];
124
124
  digests?: string[];
@@ -131,7 +131,7 @@ export interface IndexerServerOrdersParams {
131
131
  }
132
132
 
133
133
  export interface IndexerServerMatchEventsParams {
134
- subaccount?: string;
134
+ subaccounts?: string[];
135
135
  product_ids?: number[];
136
136
  // If not given, will return both isolated & non-iso events
137
137
  isolated?: boolean;