Skip to content

Commit

Permalink
Merge pull request #4 from dsrvlabs/feature/execute-swap-uniswap-pool
Browse files Browse the repository at this point in the history
uniswap sdk 를 통한 swap 기능 구현
  • Loading branch information
doocho authored Sep 30, 2024
2 parents 7ebdfd3 + 1f25f79 commit df67774
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/common/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export interface ExampleConfig {
// Example Configuration
export const CurrentConfig: ExampleConfig = {
tokens: {
in: SSV_TOKEN,
out: USDC_TOKEN
in: USDC_TOKEN,
out: SSV_TOKEN
}
};

Expand Down
8 changes: 4 additions & 4 deletions src/lib/utils/routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export enum TransactionState {
// Transacting with a wallet extension via a Web3 Provider
async function sendTransactionViaExtension(wallet: ethers.providers.Web3Provider, transaction: ethers.providers.TransactionRequest): Promise<TransactionState> {
try {
const receipt = await wallet.send('eth_sendTransaction', [transaction]);
const receipt = await wallet.getSigner()?.sendTransaction(transaction);
if (receipt) {
return TransactionState.Sent;
} else {
Expand All @@ -42,9 +42,9 @@ export async function generateRoute(provider: ethers.providers.JsonRpcProvider,
};

const route = await router.route(
CurrencyAmount.fromRawAmount(CurrentConfig.tokens.in, fromReadableAmount(amount, CurrentConfig.tokens.in.decimals).toString()),
CurrentConfig.tokens.out,
TradeType.EXACT_INPUT,
CurrencyAmount.fromRawAmount(CurrentConfig.tokens.out, fromReadableAmount(amount, CurrentConfig.tokens.out.decimals).toString()),
CurrentConfig.tokens.in,
TradeType.EXACT_OUTPUT,
options
);

Expand Down

0 comments on commit df67774

Please sign in to comment.