Following this guide (code), I am attempting a basic trade operation. I have made modifications to some functions in the code to accommodate parameters such as:
- Token in
- Token out
- Amount in
The following is my customized createTrade
function:
export async function createTrade(
tin: Token,
tout: Token,
amountIn: number,
): Promise<TokenTrade> {
// Code implementation here...
}
This is how my custom executeTrade
function looks like:
export async function executeTrade(
trade: TokenTrade,
tin: Token,
): Promise<TransactionState> {
// Code execution logic goes here...
}
Here's how I invoke these functions in practice:
// Implementation of calling functions here...
However, upon executing this specific line, an error occurs which states:
Error: Could not parse fraction
at Function.tryParseFraction (c:\Users\DixSon\Desktop\Frog\periscope\node_modules\.pnpm\@<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="7d0813140e0a1c0d560e1916501e120f183d49534d534b">[email protected]</a>\node_modules\@uniswap\sdk-core\dist\sdk-core.cjs.development.js:317:11)
// Further error details listed here...