Skip to content

Commit 79eb2b1

Browse files
committed
add example
1 parent b656c90 commit 79eb2b1

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
import getJupiterQuote from '@/lib/jupiter/getJupiterQuote'
2+
import jupiterSwap from '@/lib/jupiter/jupiterSwap'
23

34
const 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()

0 commit comments

Comments
 (0)