use latest jupiter

This commit is contained in:
tjs 2022-11-15 12:10:58 -05:00
parent 59b5570e35
commit 3baeda5f3e
4 changed files with 777 additions and 49 deletions

View File

@ -53,21 +53,12 @@ const TokenItem = ({
}) => {
const { address, symbol, logoURI, name } = token
const isDisabled =
(type === 'input' && useMargin && token.amountWithBorrow!.eq(0)) ||
(type === 'input' && !useMargin && token.amount!.eq(0))
return (
<div>
<button
key={address}
className={`default-transition flex w-full items-center justify-between rounded-md p-2 font-normal ${
isDisabled
? 'opacity-50'
: 'cursor-pointer focus:bg-th-bkg-3 focus:outline-none md:hover:bg-th-bkg-2'
}`}
className={`default-transition flex w-full cursor-pointer items-center justify-between rounded-md p-2 font-normal focus:bg-th-bkg-3 focus:outline-none md:hover:bg-th-bkg-2`}
onClick={() => onSubmit(address)}
disabled={isDisabled}
>
<div className="flex items-center">
<picture>

View File

@ -72,7 +72,7 @@ const useJupiter = ({
amount: JSBI.BigInt(
new Decimal(inputAmount).mul(10 ** inputTokenInfo.decimals)
),
slippage, // The slippage in % terms
slippageBps: Math.ceil(slippage * 100), // The slippage in % terms
filterTopNResult: 10,
onlyDirectRoutes: true,
})

View File

@ -15,7 +15,7 @@
"@blockworks-foundation/mango-v4": "https://tylersssss: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@github.com/blockworks-foundation/mango-v4.git#main",
"@headlessui/react": "^1.6.6",
"@heroicons/react": "^2.0.10",
"@jup-ag/core": "^2.0.0-beta.3",
"@jup-ag/core": "^3.0.0-beta.8",
"@project-serum/anchor": "0.25.0",
"@solana/wallet-adapter-base": "^0.9.17",
"@solana/wallet-adapter-react": "^0.15.18",

811
yarn.lock

File diff suppressed because it is too large Load Diff