@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.
- package/dist/IndexerBaseClient.cjs +18 -12
- package/dist/IndexerBaseClient.cjs.map +1 -1
- package/dist/IndexerBaseClient.js +18 -12
- package/dist/IndexerBaseClient.js.map +1 -1
- package/dist/IndexerClient.cjs +6 -6
- package/dist/IndexerClient.cjs.map +1 -1
- package/dist/IndexerClient.js +6 -6
- package/dist/IndexerClient.js.map +1 -1
- package/dist/types/clientTypes.cjs.map +1 -1
- package/dist/types/clientTypes.d.cts +3 -3
- package/dist/types/clientTypes.d.ts +3 -3
- package/dist/types/serverTypes.cjs.map +1 -1
- package/dist/types/serverTypes.d.cts +3 -3
- package/dist/types/serverTypes.d.ts +3 -3
- package/package.json +8 -4
- package/src/IndexerBaseClient.ts +18 -18
- package/src/IndexerClient.ts +6 -6
- package/src/types/clientTypes.ts +3 -3
- package/src/types/serverTypes.ts +3 -3
package/src/IndexerBaseClient.ts
CHANGED
|
@@ -407,12 +407,12 @@ export class IndexerBaseClient {
|
|
|
407
407
|
})();
|
|
408
408
|
|
|
409
409
|
const baseResponse = await this.query('events', {
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
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
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
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,
|
package/src/IndexerClient.ts
CHANGED
|
@@ -59,7 +59,7 @@ export class IndexerClient extends IndexerBaseClient {
|
|
|
59
59
|
startCursor,
|
|
60
60
|
maxTimestampInclusive,
|
|
61
61
|
limit,
|
|
62
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
301
|
+
subaccounts: [{ subaccountName, subaccountOwner }],
|
|
302
302
|
});
|
|
303
303
|
|
|
304
304
|
// Now aggregate results by the submission index, use map to maintain insertion order
|
package/src/types/clientTypes.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
381
|
+
subaccounts?: Subaccount[];
|
|
382
382
|
productIds?: number[];
|
|
383
383
|
// If not given, will return both isolated & non-iso events
|
|
384
384
|
isolated?: boolean;
|
package/src/types/serverTypes.ts
CHANGED
|
@@ -93,7 +93,7 @@ export interface IndexerServerMultiProductsParams {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
export interface IndexerServerEventsParams {
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
|
|
134
|
+
subaccounts?: string[];
|
|
135
135
|
product_ids?: number[];
|
|
136
136
|
// If not given, will return both isolated & non-iso events
|
|
137
137
|
isolated?: boolean;
|