Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
POPPIN-FUMI committed Oct 7, 2024
1 parent b656c90 commit 79eb2b1
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions packages/sol-swap/src/examples/jupiter/getQuote.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
import getJupiterQuote from '@/lib/jupiter/getJupiterQuote'
import jupiterSwap from '@/lib/jupiter/jupiterSwap'

const getQuote = async () => {
const inputMint = 'inputMint'
const outputMint = 'outputMint'
const inputAmountLamport = 100
const platformFeeBps = 0
const swapMode = 'ExactIn'
const quote = await getJupiterQuote(
inputMint,
outputMint,
inputAmountLamport,
platformFeeBps,
swapMode,
)
const inputAmountLamport = 1000000000
const quote = await getJupiterQuote(inputMint, outputMint, inputAmountLamport)
if (typeof quote === 'string') {
throw new Error(quote)
}
await jupiterSwap(quote)
}

const run = async () => {
await getQuote()
}

run()

0 comments on commit 79eb2b1

Please sign in to comment.