From 746f56831d7f14c6430dfce4010d5964e625e535 Mon Sep 17 00:00:00 2001 From: Vincent Chau <99756290+vincentwschau@users.noreply.github.com> Date: Fri, 10 May 2024 16:10:01 -0400 Subject: [PATCH 1/2] Fix typo for fetching orders for parent subaccount. --- indexer/services/socks/__tests__/lib/subscriptions.test.ts | 4 ++-- indexer/services/socks/src/lib/subscription.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/indexer/services/socks/__tests__/lib/subscriptions.test.ts b/indexer/services/socks/__tests__/lib/subscriptions.test.ts index 5a375d7cc6..bb18536a3b 100644 --- a/indexer/services/socks/__tests__/lib/subscriptions.test.ts +++ b/indexer/services/socks/__tests__/lib/subscriptions.test.ts @@ -51,7 +51,7 @@ describe('Subscriptions', () => { const initialResponseUrlPatterns: Record = { [Channel.V4_ACCOUNTS]: [ '/v4/addresses/.+/subaccountNumber/.+', - '/v4/orders?.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', + '/v4/orders?.+subaccountNubmer.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', ], [Channel.V4_CANDLES]: ['/v4/candles/perpetualMarkets/.+?resolution=.+'], [Channel.V4_MARKETS]: ['/v4/perpetualMarkets'], @@ -59,7 +59,7 @@ describe('Subscriptions', () => { [Channel.V4_TRADES]: ['/v4/trades/perpetualMarket/.+'], [Channel.V4_PARENT_ACCOUNTS]: [ '/v4/addresses/.+/parentSubaccountNumber/.+', - '/v4/orders/parentSubaccountNumber?.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', + '/v4/orders/parentSubaccountNumber?.+parentSubaccountNumber.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', ], }; const initialMessage: Object = { a: 'b' }; diff --git a/indexer/services/socks/src/lib/subscription.ts b/indexer/services/socks/src/lib/subscription.ts index a89c4261d5..dd8c8ba25b 100644 --- a/indexer/services/socks/src/lib/subscription.ts +++ b/indexer/services/socks/src/lib/subscription.ts @@ -602,7 +602,7 @@ export class Subscriptions { // TODO(DEC-1462): Use the /active-orders endpoint once it's added. axiosRequest({ method: RequestMethod.GET, - url: `${COMLINK_URL}/v4/orders/parentSubaccountNumber?address=${address}&subaccountNumber=${subaccountNumber}&status=OPEN,UNTRIGGERED,BEST_EFFORT_OPENED`, + url: `${COMLINK_URL}/v4/orders/parentSubaccountNumber?address=${address}&parentSubaccountNumber=${subaccountNumber}&status=OPEN,UNTRIGGERED,BEST_EFFORT_OPENED`, timeout: config.INITIAL_GET_TIMEOUT_MS, headers: { 'cf-ipcountry': country, From bc12f9686c3bf2303c3412af9cdc792b2458bb7e Mon Sep 17 00:00:00 2001 From: Vincent Chau <99756290+vincentwschau@users.noreply.github.com> Date: Fri, 10 May 2024 16:51:43 -0400 Subject: [PATCH 2/2] Fix test. --- indexer/services/socks/__tests__/lib/subscriptions.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indexer/services/socks/__tests__/lib/subscriptions.test.ts b/indexer/services/socks/__tests__/lib/subscriptions.test.ts index bb18536a3b..95946f6e7b 100644 --- a/indexer/services/socks/__tests__/lib/subscriptions.test.ts +++ b/indexer/services/socks/__tests__/lib/subscriptions.test.ts @@ -51,7 +51,7 @@ describe('Subscriptions', () => { const initialResponseUrlPatterns: Record = { [Channel.V4_ACCOUNTS]: [ '/v4/addresses/.+/subaccountNumber/.+', - '/v4/orders?.+subaccountNubmer.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', + '/v4/orders?.+subaccountNumber.+OPEN,UNTRIGGERED,BEST_EFFORT_OPENED', ], [Channel.V4_CANDLES]: ['/v4/candles/perpetualMarkets/.+?resolution=.+'], [Channel.V4_MARKETS]: ['/v4/perpetualMarkets'],