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

Commit

Permalink
feat(unified-routing-api): support uniswap-extension request source (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
jsy1218 authored Jun 27, 2024
1 parent 0c8b6b6 commit 03d5925
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 @@ -62,6 +62,7 @@ export enum RequestSource {
UNISWAP_WEB = 'uniswap-web',
EXTERNAL_API = 'external-api',
EXTERNAL_API_MOBILE = 'external-api:mobile',
UNISWAP_EXTENSION = 'uniswap-extension',
}

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 @@ -332,6 +332,10 @@ describe('QuoteHandler', () => {
requestSource = quoteHandler.getQuoteRequestSource(headers);
expect(requestSource).toBe(RequestSource.UNKNOWN);

headers = {'x-request-source': 'uniswap-extension'};
requestSource = quoteHandler.getQuoteRequestSource(headers);
expect(requestSource).toBe(RequestSource.UNISWAP_EXTENSION);

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

0 comments on commit 03d5925

Please sign in to comment.