UNPKG

hypesdk

Version:

A powerful SDK for interacting with the Hype blockchain, featuring advanced routing and token swap capabilities

121 lines (120 loc) 4.73 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MULTICALL_ABI = exports.FEE_PERCENTAGE = exports.FEE_COLLECTOR_ADDRESS = exports.HYPE_DISTRIBUTOR_ABI = exports.HYPE_DISTRIBUTOR_ADDRESS = exports.AIRDROP_ABI = exports.AIRDROP_CONTRACT_ADDRESS = exports.CUSTOM_TOKEN_ABI = exports.TOKEN_DEPLOYER_ADDRESS = exports.TOKEN_DEPLOYER_ABI = exports.ERC20_ABI = exports.ROUTER_ABI = exports.ROUTER_ADDRESS = exports.WRAPPED_TOKEN_ADDRESS = exports.NATIVE_TOKEN = exports.RPC_URL = void 0; exports.RPC_URL = "https://rpc.hyperliquid.xyz/evm"; exports.NATIVE_TOKEN = "0x000000000000000000000000000000000000dEaD"; // NATIVE_HYPE address exports.WRAPPED_TOKEN_ADDRESS = "0x5555555555555555555555555555555555555555"; // Wrapped TOKEN exports.ROUTER_ADDRESS = "0x744489ee3d540777a66f2cf297479745e0852f7a"; exports.ROUTER_ABI = [ "function executeMultiHopSwap(address[] calldata tokens, uint256 amountIn, uint256 minAmountOut, tuple(address tokenIn, address tokenOut, uint8 routerIndex, uint24 fee, uint256 amountIn, bool stable)[][] calldata hopSwaps) external payable returns (uint256 totalAmountOut)", "function executeSwap(tuple(address tokenIn, address tokenOut, uint8 routerIndex, uint24 fee, uint256 amountIn, bool stable)[] swaps, uint256 amountIn, uint256 minAmountOut) external payable returns (uint256 totalAmountOut)", ]; exports.ERC20_ABI = [ "function decimals() view returns (uint8)", "function balanceOf(address) view returns (uint256)", "function symbol() view returns (string)", "function approve(address,uint256) returns (bool)", "function transfer(address,uint256) returns (bool)", "function allowance(address,address) view returns (uint256)", ]; // TokenDeployer contract ABI exports.TOKEN_DEPLOYER_ABI = [ "function deployToken(string memory name, string memory symbol, uint256 initialSupply) external returns (address)", "event TokenDeployed(address tokenAddress, address owner, string name, string symbol, uint256 supply)", ]; // TokenDeployer contract address exports.TOKEN_DEPLOYER_ADDRESS = "0x1dBb617Fdd65eAD33866c17058e2EFff6963f53b"; // CustomToken ABI exports.CUSTOM_TOKEN_ABI = [ "function mint(address to, uint256 amount)", "function burn(uint256 amount)", "function transfer(address to, uint256 amount) returns (bool)", "function balanceOf(address account) view returns (uint256)", "function decimals() view returns (uint8)", "function name() view returns (string memory)", "function symbol() view returns (string memory)", "function totalSupply() view returns (uint256)", ]; exports.AIRDROP_CONTRACT_ADDRESS = "0x8B1047171497c98BBAe8ABCBcA98d93E8708f8b1"; exports.AIRDROP_ABI = [ { inputs: [ { internalType: "address", name: "token", type: "address", }, { internalType: "address[]", name: "recipients", type: "address[]", }, { internalType: "uint256[]", name: "amounts", type: "uint256[]", }, ], name: "airdropToken", outputs: [], stateMutability: "payable", type: "function", }, { inputs: [], name: "FEE", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; exports.HYPE_DISTRIBUTOR_ADDRESS = "0x03423126F0561965899C4E46d9DB25a10B49C3A5"; exports.HYPE_DISTRIBUTOR_ABI = [ { inputs: [ { internalType: "address[]", name: "recipients", type: "address[]", }, { internalType: "uint256[]", name: "amounts", type: "uint256[]", }, ], name: "distribute", outputs: [], stateMutability: "payable", type: "function", }, ]; exports.FEE_COLLECTOR_ADDRESS = "0x5cdF958e39073166710aC8A477daF4B49a755609"; // Replace with actual fee collector address exports.FEE_PERCENTAGE = 0.003; // 0.3% exports.MULTICALL_ABI = [ { inputs: [ { internalType: "bytes[]", name: "data", type: "bytes[]", }, ], name: "multicall", outputs: [ { internalType: "bytes[]", name: "results", type: "bytes[]", }, ], stateMutability: "payable", type: "function", }, ];