This repository was archived by the owner on Jun 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
interface FeeInformation { | ||
expirationDate: string | ||
minimalFee: string | ||
feeRatio: number | ||
} | ||
|
||
// TODO: remove | ||
const ONE_WEEKS_MS = 604800000 | ||
const DEFAULT_BASIS_POINTS = 10 | ||
const DEFAULT_MINIMAL_FEE = '10' | ||
|
||
const MOCK_FEE_INFORMATION: FeeInformation = { | ||
get expirationDate() { | ||
return new Date(Date.now() + ONE_WEEKS_MS).toISOString() | ||
}, | ||
minimalFee: DEFAULT_MINIMAL_FEE, | ||
feeRatio: DEFAULT_BASIS_POINTS | ||
} | ||
|
||
/** | ||
* @name getFee | ||
* @param currencyId sellToken address as string | ||
* @description Consume fee endpoint | ||
*/ | ||
export const getFee = async (currencyId: string): Promise<FeeInformation> => { | ||
return new Promise(accept => { | ||
return setTimeout(() => { | ||
console.debug( | ||
`[MOCK] utils/price::getFee ==> https://protocol.dev.gnosisdev.com/api/v1/fee/${currencyId}`, | ||
MOCK_FEE_INFORMATION | ||
) | ||
accept(MOCK_FEE_INFORMATION) | ||
}, Math.floor(Math.random() * 1000)) | ||
}) | ||
} |