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

Commit

Permalink
Add a new request source type 'external-api:mobile'
Browse files Browse the repository at this point in the history
  • Loading branch information
rollingtumbling committed Jan 29, 2024
1 parent bd2356d commit a31be8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
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

0 comments on commit a31be8d

Please sign in to comment.