import { hyperEvmUSDC } from "@daimo/sdk/common";
import { encodeFunctionData } from "viem";
const HYPERCORE_DEPOSIT_ADAPTER = "0x3Df610B9168472EfC3CD37ed5005c0e78946c308";
const calldata = encodeFunctionData({
abi: [
{
name: "deposit",
type: "function",
inputs: [
{ name: "recipient", type: "address" },
{ name: "destinationDex", type: "uint32" },
],
outputs: [],
stateMutability: "nonpayable",
},
],
functionName: "deposit",
args: [
"0xRecipientAddress", // Hypercore recipient
0, // 0 = perps, 0xFFFFFFFF = spot
],
});
const res = await fetch("https://api.daimo.com/v1/sessions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: "Bearer YOUR_API_KEY",
},
body: JSON.stringify({
destination: {
type: "evm",
address: HYPERCORE_DEPOSIT_ADAPTER,
chainId: hyperEvmUSDC.chainId,
tokenAddress: hyperEvmUSDC.token,
amountUnits: "10",
calldata,
},
display: { title: "Deposit to Hyperliquid", verb: "Deposit" }
}),
});