diff --git a/package.json b/package.json
index 4409d61..dab0561 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"@project-serum/anchor": "^0.5.1-beta.2",
"@project-serum/serum": "^0.13.34",
"@project-serum/sol-wallet-adapter": "^0.2.0",
- "@project-serum/swap": "^0.1.0-alpha.4",
+ "@project-serum/swap": "^0.1.0-alpha.5",
"@solana/spl-token": "^0.1.4",
"@solana/spl-token-registry": "^0.2.86",
"@solana/web3.js": "^1.10.1",
diff --git a/src/swap/components/Info.tsx b/src/swap/components/Info.tsx
index c7ccd81..197218f 100644
--- a/src/swap/components/Info.tsx
+++ b/src/swap/components/Info.tsx
@@ -108,6 +108,7 @@ function InfoDetails() {
{ ticker: fromMintTicker, mint: fromMint },
{ ticker: toMintTicker, mint: toMint },
];
+ const route = swapClient.route(fromMint, toMint);
return (
@@ -117,9 +118,13 @@ function InfoDetails() {
>
Trade Route
- {swapClient.route(fromMint, toMint).map((market: PublicKey) => {
- return ;
- })}
+ {route ? (
+ route.map((market: PublicKey) => {
+ return ;
+ })
+ ) : (
+ Route not found
+ )}
{
if (!fromMintInfo || !toMintInfo) {
@@ -307,7 +307,9 @@ function SwapButton() {
variant="contained"
className={styles.swapButton}
onClick={sendSwapTransaction}
- disabled={swapClient.program.provider.wallet.publicKey === null}
+ disabled={
+ swapClient.program.provider.wallet.publicKey === null || route === null
+ }
>
Swap
diff --git a/src/swap/components/TokenDialog.tsx b/src/swap/components/TokenDialog.tsx
index 3b71c82..3e889ce 100644
--- a/src/swap/components/TokenDialog.tsx
+++ b/src/swap/components/TokenDialog.tsx
@@ -40,7 +40,12 @@ export default function TokenDialog({
const styles = useStyles();
const { swapClient } = useDexContext();
const tokens = useMemo(() => {
- return swapClient.tokens().concat([USDC_MINT, USDT_MINT]);
+ return swapClient
+ .tokens()
+ .concat([USDC_MINT, USDT_MINT])
+ .filter(
+ (t) => t.toString() !== "So11111111111111111111111111111111111111112"
+ );
}, [swapClient]);
return (