File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
packages/sol-swap/src/examples/jupiter Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 11import getJupiterQuote from '@/lib/jupiter/getJupiterQuote'
2+ import jupiterSwap from '@/lib/jupiter/jupiterSwap'
23
34const getQuote = async ( ) => {
45 const inputMint = 'inputMint'
56 const outputMint = 'outputMint'
6- const inputAmountLamport = 100
7- const platformFeeBps = 0
8- const swapMode = 'ExactIn'
9- const quote = await getJupiterQuote (
10- inputMint ,
11- outputMint ,
12- inputAmountLamport ,
13- platformFeeBps ,
14- swapMode ,
15- )
7+ const inputAmountLamport = 1000000000
8+ const quote = await getJupiterQuote ( inputMint , outputMint , inputAmountLamport )
9+ if ( typeof quote === 'string' ) {
10+ throw new Error ( quote )
11+ }
12+ await jupiterSwap ( quote )
1613}
14+
15+ const run = async ( ) => {
16+ await getQuote ( )
17+ }
18+
19+ run ( )
You can’t perform that action at this time.
0 commit comments