Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could you please give me an example how to use the sdk? #26

Open
wade-liwei opened this issue May 16, 2024 · 2 comments
Open

Could you please give me an example how to use the sdk? #26

wade-liwei opened this issue May 16, 2024 · 2 comments

Comments

@wade-liwei
Copy link

Could you please give me an example how to use the sdk?

@jfbloom22
Copy link

Which SDK you looking for?

@chilljello
Copy link


function trade_universal(recipient: string) {
    const slippageTolerance = new Percent(1, 100)
    const options = { slippageTolerance, recipient }


    
    const routerTrade = new RouterTrade({ v2Routes, v3Routes, mixedRoutes, tradeType: TradeType.EXACT_INPUT })
    // Use the raw calldata and value returned to call into Universal Swap Router contracts
    const { calldata, value } = SwapRouter.swapCallParameters(routerTrade, options)

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants