File tree 1 file changed +13
-10
lines changed
packages/sol-swap/src/examples/jupiter
1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change 1
1
import getJupiterQuote from '@/lib/jupiter/getJupiterQuote'
2
+ import jupiterSwap from '@/lib/jupiter/jupiterSwap'
2
3
3
4
const getQuote = async ( ) => {
4
5
const inputMint = 'inputMint'
5
6
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 )
16
13
}
14
+
15
+ const run = async ( ) => {
16
+ await getQuote ( )
17
+ }
18
+
19
+ run ( )
You can’t perform that action at this time.
0 commit comments