Skip to content
This repository was archived by the owner on Sep 4, 2024. It is now read-only.

Add a new request source type 'external-api:mobile' #339

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/entities/request/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export enum RequestSource {
UNISWAP_ANDROID = 'uniswap-android',
UNISWAP_WEB = 'uniswap-web',
EXTERNAL_API = 'external-api',
EXTERNAL_API_MOBILE = 'external-api:mobile',
}

export interface QuoteRequest {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/lib/handlers/quote/handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,10 @@ describe('QuoteHandler', () => {
requestSource = quoteHandler.getQuoteRequestSource(headers);
expect(requestSource).toBe(RequestSource.EXTERNAL_API);

headers = { 'x-request-source': 'external-api:mobile' };
requestSource = quoteHandler.getQuoteRequestSource(headers);
expect(requestSource).toBe(RequestSource.EXTERNAL_API_MOBILE);

headers = { 'x-request-source': 'lonely-planet' };
requestSource = quoteHandler.getQuoteRequestSource(headers);
expect(requestSource).toBe(RequestSource.UNKNOWN);
Expand Down
Loading