Skip to content

Commit

Permalink
bump sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
codingki committed May 14, 2024
1 parent 7c2ba78 commit 444435c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 11 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tooltip": "^1.0.7",
"@sentry/nextjs": "^7.99.0",
"@skip-router/core": "^2.4.4",
"@skip-router/core": "^3.0.0",
"@solana/spl-token": "^0.4.1",
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-wallets": "^0.19.31",
Expand Down
15 changes: 11 additions & 4 deletions src/components/PreviewRoute/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,22 @@ export const PreviewRoute = ({
if (!allAddressFilled) throw new Error("All addresses must be filled");
const historyId = randomId();

const userAddresses: Record<string, string> = {};
const userAddresses: { chainID: string; address: string }[] = [];
route.chainIDs.forEach((chainID, index) => {
if (chainID !== chainAddresses[index]?.chainID) {
throw new Error("chainID does not match with chainAddresses's chainID");
}
const chainAddress = chainAddresses[index];
if (chainID === chainAddress?.chainID && chainAddress?.address) {
userAddresses[chainID] = chainAddress?.address;
if (!chainAddress || !chainAddress?.address) {
throw new Error("Chain address not found");
}
userAddresses.push({
chainID: chainAddress.chainID,
address: chainAddress.address,
});
});

const isAddressError = route.chainIDs.some((chainID) => !userAddresses[chainID]);
const isAddressError = route.chainIDs.some((chainID, i) => !userAddresses[i]);

if (isAddressError) {
throw new Error("All addresses must be filled");
Expand Down

0 comments on commit 444435c

Please sign in to comment.