-
Notifications
You must be signed in to change notification settings - Fork 113
Feat/degen mode #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Feat/degen mode #226
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| import { API_URL } from '../../constants'; | ||
| import { constructSearchString } from '../../helpers/misc'; | ||
| import type { ConstructFetchInput, RequestParameters } from '../../types'; | ||
| import { DeltaAuctionOrder, DeltaAuction } from './helpers/types'; | ||
|
|
||
|
|
@@ -21,7 +22,9 @@ export type DeltaOrderToPost = { | |
| excludeAgents?: string[]; | ||
| }; | ||
|
|
||
| export type PostDeltaOrderParams = Omit<DeltaOrderToPost, 'chainId'>; | ||
| export type PostDeltaOrderParams = Omit<DeltaOrderToPost, 'chainId'> & { | ||
| degenMode?: boolean; | ||
| }; | ||
|
|
||
| export type DeltaOrderApiResponse = Omit<DeltaAuction, 'transactions'> & { | ||
| orderVersion: string; // "2.0.0" | ||
|
|
@@ -45,11 +48,17 @@ export const constructPostDeltaOrder = ({ | |
| }: ConstructFetchInput): PostDeltaOrderFunctions => { | ||
| const postOrderUrl = `${apiURL}/delta/orders` as const; | ||
|
|
||
| const postDeltaOrder: PostDeltaOrder = (postData, requestParams) => { | ||
| const postDeltaOrder: PostDeltaOrder = (_postData, requestParams) => { | ||
| const { degenMode, ...postData } = _postData; | ||
| const deltaOrderToPost: DeltaOrderToPost = { ...postData, chainId }; | ||
|
|
||
| const search = constructSearchString<{ degenMode?: boolean }>({ | ||
| degenMode, | ||
| }); | ||
| const fetchURL = `${postOrderUrl}/${search}` as const; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing slash changes POST URL for all ordersHigh Severity The URL template
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sometimes we do |
||
|
|
||
| return fetcher<DeltaOrderApiResponse>({ | ||
| url: postOrderUrl, | ||
| url: fetchURL, | ||
| method: 'POST', | ||
| data: deltaOrderToPost, | ||
| requestParams, | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add
maxUSDImpact. It's present in other price endpoints