Created
December 1, 2025 17:04
-
-
Save alpinevm/61b9b676a3a8a5deb4299d0b54701195 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import { describe, expect, it } from "bun:test"; | |
| describe.skipIf(SKIP)("Aerodrome SDK Direct - Integration", () => { | |
| const SDK_TIMEOUT = 60_000; | |
| it("calls getQuoteForSwap directly for USDC -> WETH", async () => { | |
| const { getDefaultConfig, getQuoteForSwap, base } = await import("@dromos-labs/sdk.js"); | |
| const config = getDefaultConfig({ | |
| chains: [ | |
| { | |
| chain: base, | |
| rpcUrl: process.env.BASE_RPC_URL!, | |
| }, | |
| ], | |
| }); | |
| const fromToken = { | |
| chainId: 8453, | |
| address: TOKENS.USDC_BASE.toLowerCase() as `0x${string}`, | |
| symbol: "USDC", | |
| listed: true, | |
| decimals: 6, | |
| balance: 0n, | |
| price: 0n, | |
| balanceValue: 0n, | |
| }; | |
| const toToken = { | |
| chainId: 8453, | |
| address: TOKENS.WETH_BASE.toLowerCase() as `0x${string}`, | |
| symbol: "WETH", | |
| listed: true, | |
| decimals: 18, | |
| balance: 0n, | |
| price: 0n, | |
| balanceValue: 0n, | |
| }; | |
| console.log("[SDK Direct] Calling getQuoteForSwap..."); | |
| const startTime = Date.now(); | |
| const quote = await getQuoteForSwap({ | |
| config, | |
| fromToken, | |
| toToken, | |
| amountIn: BigInt("1000000000"), // 1000 USDC | |
| }); | |
| const duration = Date.now() - startTime; | |
| console.log(`[SDK Direct] Quote completed in ${duration}ms`); | |
| expect(quote).not.toBeNull(); | |
| expect(quote?.amountOut).toBeGreaterThan(0n); | |
| console.log("[SDK Direct] USDC -> WETH quote:", { | |
| amountIn: quote?.amount.toString(), | |
| amountOut: quote?.amountOut.toString(), | |
| priceImpact: quote?.priceImpact.toString(), | |
| pathNodes: quote?.path.nodes.length, | |
| }); | |
| }, SDK_TIMEOUT); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment