-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add cow-sdk package * replace SupportedChainId with sdk chain and change xdai > gnosis_chain * update to latest sdk * leave commented out mod * legacy quote information types * add legacy types to price utils * use legacy types in price actions/reducer * add Legacy types * fix merge issues
- Loading branch information
Showing
18 changed files
with
239 additions
and
238 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { | ||
FeeInformation, | ||
FeeQuoteParams, | ||
PriceInformation, | ||
PriceQuoteParams, | ||
SupportedChainId as ChainId, | ||
} from '@cowprotocol/cow-sdk' | ||
import { GpPriceStrategy } from 'hooks/useGetGpPriceStrategy' | ||
|
||
export interface LegacyQuoteParams { | ||
quoteParams: LegacyFeeQuoteParams | ||
strategy: GpPriceStrategy | ||
fetchFee: boolean | ||
previousFee?: FeeInformation | ||
isPriceRefresh: boolean | ||
} | ||
|
||
export class LegacyPriceQuoteError extends Error { | ||
params: LegacyPriceQuoteParams | ||
results: PromiseSettledResult<any>[] | ||
|
||
constructor(message: string, params: LegacyPriceQuoteParams, results: PromiseSettledResult<any>[]) { | ||
super(message) | ||
this.params = params | ||
this.results = results | ||
} | ||
} | ||
|
||
export type LegacyFeeQuoteParams = FeeQuoteParams & { | ||
fromDecimals: number | ||
toDecimals: number | ||
chainId: ChainId | ||
priceQuality?: string | ||
isBestQuote?: boolean | ||
} | ||
|
||
export type LegacyPriceQuoteParams = Omit<LegacyFeeQuoteParams, 'sellToken' | 'buyToken'> & PriceQuoteParams | ||
|
||
export type LegacyPriceSource = 'gnosis-protocol' | 'paraswap' | 'matcha-0x' | ||
export type LegacyPriceInformationWithSource = PriceInformation & { source: LegacyPriceSource; data?: any } | ||
export type LegacyPromiseRejectedResultWithSource = PromiseRejectedResult & { source: LegacyPriceSource } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.