Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions src/icons/Chains/HYPEREVM.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,21 @@ function HYPEREVM() {
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<rect width="36" height="36" rx="6" fill="#102623" />
<path
d="M30.8719 17.7967C30.8911 19.8653 30.4763 21.8338 29.6488 23.6972C28.3966 26.5456 25.3291 28.8099 22.521 26.4588C20.2299 24.5266 19.8271 20.5229 16.6299 19.925C11.9846 19.4215 11.8719 24.5459 9.39618 25.1436C6.57025 25.8258 5.69346 20.4228 5.74034 17.9194C5.78723 15.416 6.43635 12.0808 9.23295 12.0808C12.421 12.0808 12.6226 16.8851 16.0669 16.6053C19.4691 16.3254 19.5435 11.3117 22.6625 9.15239C24.9952 7.2877 27.7066 8.64506 29.0012 10.8943C30.1893 12.9722 30.8335 15.4096 30.8591 17.8002L30.8719 17.7967Z"
fill="#AFF9E5"
/>
<g clipPath="url(#clip0_8823_13578)">
<rect width="36" height="36" fill="white" />
<path
d="M32 17.9414C32 27.1983 26.3351 30.1686 23.3503 27.5238C20.8934 25.3672 20.1624 20.81 16.467 20.3421C11.7766 19.7521 11.3706 25.998 8.28427 25.998C4.69036 25.998 4 20.7693 4 18.0838C4 15.3372 4.77157 11.5938 7.83756 11.5938C11.4112 11.5938 11.6142 16.9445 16.0812 16.6596C20.5279 16.3545 20.6091 10.78 23.4925 8.3996C26.0101 6.34475 32 8.56235 32 17.9414Z"
fill="#072723"
/>
</g>
<defs>
<clipPath id="clip0_8823_13578">
<path
d="M0 18C0 8.05887 8.05887 0 18 0V0C27.9411 0 36 8.05887 36 18V18C36 27.9411 27.9411 36 18 36V36C8.05887 36 0 27.9411 0 18V18Z"
fill="white"
/>
</clipPath>
</defs>
</svg>
);
}
Expand Down
22 changes: 14 additions & 8 deletions src/routes/mayan/MayanRouteBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ export class MayanRouteBase<N extends Network> extends routes.AutomaticRoute<
// Uncomment and use this when we want to support HyperCore USDC deposits on SOL
// const solanaOptions = {
// allowSwapperOffCurve: true,
// ...(usdcPermitSignature ? { usdcPermitSignature } : {}),
// usdcPermitSignature,
// };

const { instructions, signers, lookupTables } =
Expand Down Expand Up @@ -732,13 +732,19 @@ export class MayanRouteBase<N extends Network> extends routes.AutomaticRoute<
quote.params.amount,
);

const options: ComposableSuiMoveCallsOptions | undefined =
builtTransaction
? {
builtTransaction,
inputCoin: { result: remainingAmountCoin },
}
: undefined;
const txPartCallsOptions = builtTransaction && {
builtTransaction,
inputCoin: { result: remainingAmountCoin },
};

const permitPartCallsOptions = usdcPermitSignature && {
usdcPermitSignature,
};

const options: ComposableSuiMoveCallsOptions = {
...txPartCallsOptions,
...permitPartCallsOptions,
};

const tx = await (this.isTestnetRequest(request)
? createSwapFromSuiMoveCallsTestnet(
Expand Down
15 changes: 10 additions & 5 deletions src/utils/hypercore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import type {
} from '../routes/mayan/types';
import { TransferWallet } from 'utils/wallet';
import type { WormholeConnectWalletProvider } from 'utils/wallet/types';
import { isEvmChain } from './evm';
import { getWormholeContextV2 } from 'config';
import { isEvmChain } from './evm';

// Note: Hyperliquid bridge = Arbitrum bridge + custom payload for USDC deposit to Hyperliquid

Expand Down Expand Up @@ -63,13 +63,14 @@ export function validateHyperCoreTransfer<N extends Network>(
};
}

// Temporary restriction to EVM for now; SOL and SUI are coming soon
if (!isEvmChain(fromChain.chain)) {
if (!(isEvmChain(fromChain.chain) || fromChain.chain === 'Sui')) {
// Uncomment and use this when we want to support HyperCore USDC deposits on SOL
// || fromChain.chain === 'Solana')
return {
valid: false,
params,
error: new routes.UnavailableError(
new Error('HyperCore only supports EVM source chains'),
new Error('HyperCore only supports EVM or Sui source chains'),
),
};
}
Expand Down Expand Up @@ -134,7 +135,11 @@ export async function maybeGetHyperCorePermitSignature<N extends Network>(
throw new Error('No wallet provider available for HyperCore permit');
}

const wallet = walletProvider.getWallet(ARBITRUM, TransferWallet.SENDING) as
const walletToSwitch = isEvmChain(request.fromChain.chain)
? TransferWallet.SENDING
: TransferWallet.RECEIVING;

const wallet = walletProvider.getWallet(ARBITRUM, walletToSwitch) as
| Eip6963Wallet
| undefined;

Expand Down
Loading