@layerzerolabs/hyperliquid-composer
Version:
LayerZero Labs reference EVM OmniChain Fungible Token (OFT) implementation for Hyperliquid
811 lines (788 loc) • 30.3 kB
text/typescript
import { TypedDataDomain, TypedDataField } from 'ethers-v6';
import { Wallet } from 'ethers';
import { Hex } from '@layerzerolabs/lz-utilities';
import { LogLevel, Logger } from '@layerzerolabs/io-devtools';
import dotenv from 'dotenv';
/**
* Signature result with r, s, v components
*/
interface SignatureComponents {
r: string;
s: string;
v: number;
}
/**
* Abstract signer interface for signing EIP-712 typed data
* Can be implemented by various signing providers (Ethers, Fordefi, etc.)
*/
interface IHyperliquidSigner {
/**
* Get the address of this signer
*/
getAddress(): Promise<string>;
/**
* Sign EIP-712 typed data
* @param domain - EIP-712 domain
* @param types - EIP-712 types
* @param value - Message to sign
* @returns Signature string (0x-prefixed hex)
*/
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, unknown>): Promise<string>;
}
/**
* Configuration for Fordefi signer
*/
interface FordefiConfig {
/**
* Fordefi API base URL (e.g., https://api.fordefi.com)
* Optional - defaults to https://api.fordefi.com
*/
apiUrl?: string;
/**
* API access token for authentication
*/
accessToken: string;
/**
* API User private key for request signing (PEM format)
* Required for sensitive operations like creating transactions
*/
privateKey: string;
/**
* Vault ID to use for signing
*/
vaultId: string;
/**
* EVM chain identifier (e.g., 'ethereum_mainnet', 'arbitrum_one')
*/
chain: string;
/**
* Optional: Timeout in milliseconds for waiting for signature (default: 300000 = 5 minutes)
*/
signatureTimeout?: number;
/**
* Optional: Polling interval in milliseconds for checking transaction status (default: 2000)
*/
pollingInterval?: number;
}
/**
* Configuration for Fireblocks signer
*/
interface FireblocksConfig {
/**
* Fireblocks API base URL (e.g., https://api.fireblocks.io)
* Optional - defaults to https://api.fireblocks.io
*/
apiUrl?: string;
/**
* API Key for authentication
*/
apiKey: string;
/**
* API Secret key for JWT signing (PEM format RSA private key)
* Should be the content of the fireblocks_secret.key file
*/
secretKey: string;
/**
* Vault Account ID to use for signing
*/
vaultAccountId: string;
/**
* Optional: Address index to use (default: 0 for first address)
* Useful if you have multiple addresses in your vault
*/
addressIndex?: number;
/**
* Optional: Timeout in milliseconds for waiting for signature (default: 300000 = 5 minutes)
*/
signatureTimeout?: number;
/**
* Optional: Polling interval in milliseconds for checking transaction status (default: 2000)
*/
pollingInterval?: number;
}
interface BaseInfoRequest {
type: string;
[key: string]: unknown;
}
/** Base structure for exchange requests. */
interface BaseExchangeRequest {
/** Action to perform. */
action: {
/** Type of action. */
type: string;
/** Additional action parameters. */
[key: string]: unknown;
};
/** Unique request identifier (recommended current timestamp in ms). */
nonce: number;
/** Cryptographic signature. */
signature: {
r: Hex;
s: Hex;
v: number;
};
}
/** Base structure for exchange responses. */
interface BaseExchangeResponse {
/** Response status */
status: 'ok' | 'err';
/** Error message or success data */
response: string | {
/** Type of response. */
type: string;
/** Specific data for the operation. */
data?: unknown;
};
}
interface Signature {
r: string;
s: string;
v: number;
}
type ValueType = number | bigint | string | boolean | null | Uint8Array | readonly ValueType[] | ValueMap | BaseInfoRequest;
interface ValueMap {
[key: string]: ValueType;
}
declare const HYPERLIQUID_URLS: {
MAINNET: string;
TESTNET: string;
};
declare const RPC_URLS: {
MAINNET: string;
TESTNET: string;
};
declare const CHAIN_IDS: {
MAINNET: number;
TESTNET: number;
};
declare const ENDPOINTS: {
INFO: string;
EXCHANGE: string;
};
declare const HYPE_INDEX: {
readonly MAINNET: 150;
readonly TESTNET: 1105;
};
declare const MAX_HYPERCORE_SUPPLY: bigint;
/**
* Standard quote tokens available on HyperLiquid Core, indexed by network.
* These token IDs can be reproduced by querying the entire spotMeta:
* curl -X POST "https://api.hyperliquid.xyz/info" -H "Content-Type: application/json" -d '{"type": "spotMeta"}' > spotOut.json
*/
declare const QUOTE_TOKENS: {
readonly MAINNET: readonly [{
readonly tokenId: 0;
readonly name: "USDC";
}, {
readonly tokenId: 235;
readonly name: "USDe";
}, {
readonly tokenId: 268;
readonly name: "USDT0";
}, {
readonly tokenId: 360;
readonly name: "USDH";
}];
readonly TESTNET: readonly [{
readonly tokenId: 0;
readonly name: "USDC";
}, {
readonly tokenId: 1204;
readonly name: "USDT0";
}, {
readonly tokenId: 1452;
readonly name: "USDH";
}];
};
declare function toAssetBridgeAddress(tokenIndex: number): string;
interface CoreSpotMetaData {
name: string;
szDecimals: number;
weiDecimals: number;
index: number;
tokenId: string;
isCanonical: boolean;
evmContract: null | {
address: string;
evm_extra_wei_decimals: number;
};
fullName: string | null;
deployerTradingFeeShare: string;
freezePrivilegeEnabled?: boolean;
quoteAssetEnabled?: boolean;
}
interface TxData {
from: string;
txHash: string;
nonce: number;
weiDiff: number;
assetBridgeAddress: string;
connected: boolean;
}
interface UserGenesis$1 {
userAndWei: Array<{
address: string;
wei: string;
}>;
existingTokenAndWei: Array<{
token: number;
wei: string;
}>;
blacklistUsers: string[];
}
interface CoreSpotDeployment {
coreSpot: CoreSpotMetaData;
txData: TxData;
userGenesis: UserGenesis$1;
}
interface SpotMeta {
tokens: CoreSpotMetaData[];
}
type SpotInfoBalance = [address: string, balance: string];
interface SpotInfo {
name: string;
maxSupply: string;
totalSupply: string;
circulatingSupply: string;
szDecimals: number;
weiDecimals: number;
midPx: string;
markPx: string;
prevDayPx: string;
genesis: {
userBalances: SpotInfoBalance[];
existingTokenBalances: SpotInfoBalance[];
};
deployer: string;
deployGas: string;
deployTime: string;
seededUsdc: string;
nonCirculatingUserBalances: SpotInfoBalance[];
futureEmissions: string;
}
interface DeployState {
token: number;
spec: {
name: string;
szDecimals: number;
weiDecimals: number;
};
fullName: string | null;
spots: number[];
maxSupply: string;
hyperliquidityGenesisBalance: string;
totalGenesisBalanceWei: string;
userGenesisBalances: [string, string][];
existingTokenGenesisBalances: [number, string][];
}
interface GasAuction {
startTimeSeconds: number;
durationSeconds: number;
startGas: string;
currentGas: string | null;
endGas: string;
}
interface SpotDeployStates {
states: DeployState[];
gasAuction: GasAuction;
}
interface SpotBalance {
coin: string;
token: number;
total: string;
hold: string;
entryNtl: string;
}
interface SpotBalancesResponse {
balances: SpotBalance[];
}
interface SpotPair {
tokens: number[];
name: string;
index: number;
isCanonical: boolean;
}
interface SpotMetaUniverse {
universe: SpotPair[];
tokens: CoreSpotMetaData[];
}
interface SpotPairsWithMetadata {
pairs: SpotPair[];
tokens: CoreSpotMetaData[];
}
interface SpotPairDeployAuctionStatus {
startTimeSeconds: number;
durationSeconds: number;
startGas: string;
currentGas: string;
endGas: string | null;
}
/**
* This is an optional action that can be performed at any time after
* RegisterToken2. While the fee share defaults to 100%, this action
* can be resent multiple times as long as the fee share is not increasing.
* @param token - The token
* @param share - The deployer trading fee share. Range: ["0%", "100%"]. Examples: "0.012%", "99.4%"
*/
interface SetDeployerTradingFeeShare {
token: number;
share: string;
}
/**
* UserGenesis can be called multiple times
* @param token - The token involved in the genesis.
* @param userAndWei - A list of tuples of user address and genesis amount (wei).
* @param existingTokenAndWei - A list of tuples of existing token and total genesis amount for holders of that token (wei).
* @param blacklistUsers - A list of tuples of users and blacklist status (True if blacklist, False to remove existing blacklisted user).
*/
interface UserGenesis {
token: number;
userAndWei: Array<[string, string]>;
existingTokenAndWei: Array<[number, string]>;
blacklistUsers?: Array<[string, boolean]>;
}
/**
* Genesis denotes the initial creation of a token with a maximum supply.
* @param maxSupply - Checksum ensureing all calls to UserGenesis succeeded
* @param noHyperliquidity - Set hyperliquidity balance to 0.
*/
interface Genesis {
token: number;
maxSupply: string;
noHyperliquidity: boolean;
}
/**
* @param tokens - [base token index, quote token index]
* @dev The base token index is the token index of the token that will be used as the base for the spot.
* @dev The quote token index is the token index of the token that will be used as the quote for the spot - this is the token that will be used to pay the trading fee like USDC.
*/
interface RegisterSpot {
tokens: [number, number];
}
/**
* @param spot - The spot index (different from base token index)
* @param startPx - The starting price.
* @param orderSz - The size of each order (float, not wei)
* @param nOrders - The number of orders. If "noHyperliquidity" was set to True, then this must be 0.
* @param nSeededLevels - The number of levels the deployer wishes to seed with usdc instead of tokens.
*/
interface RegisterHyperliquidity {
spot: number;
startPx: string;
orderSz: string;
nOrders: number;
nSeededLevels?: number;
}
/**
* Enables freeze privilege for a token, allowing the deployer to freeze/unfreeze users
* @param token - The token index
*/
interface EnableFreezePrivilege {
token: number;
}
/**
* Freezes or unfreezes a specific user for a token
* @param token - The token index
* @param user - The user address to freeze/unfreeze
* @param freeze - True to freeze, false to unfreeze
*/
interface FreezeUser {
token: number;
user: string;
freeze: boolean;
}
/**
* Revokes freeze privilege for a token, permanently disabling the ability to freeze users
* @param token - The token index
*/
interface RevokeFreezePrivilege {
token: number;
}
/**
* Enables a token to be used as a quote asset in trading pairs
* @param token - The token index
*/
interface EnableQuoteToken {
token: number;
}
/**
* Enables a token to be used as an aligned quote asset in trading pairs.
* Aligned quote tokens have special properties and requirements.
* @param token - The token index
*/
interface EnableAlignedQuoteToken {
token: number;
}
interface EvmUserModifyRequest extends BaseExchangeRequest {
action: {
type: 'evmUserModify';
usingBigBlocks: boolean;
};
}
interface EvmSpotDeploy extends BaseExchangeRequest {
action: {
type: 'spotDeploy';
requestEvmContract: {
token: number;
address: string;
evmExtraWeiDecimals: number;
};
};
}
interface FinalizeEvmContract extends BaseExchangeRequest {
action: {
type: 'finalizeEvmContract';
token: number;
input: {
create: {
nonce: number;
};
};
};
}
interface SpotDeployAction extends BaseExchangeRequest {
action: {
type: 'spotDeploy';
setDeployerTradingFeeShare: SetDeployerTradingFeeShare;
} | {
type: 'spotDeploy';
userGenesis: UserGenesis;
} | {
type: 'spotDeploy';
genesis: Genesis;
} | {
type: 'spotDeploy';
registerSpot: RegisterSpot;
} | {
type: 'spotDeploy';
registerHyperliquidity: RegisterHyperliquidity;
} | {
type: 'spotDeploy';
enableFreezePrivilege: EnableFreezePrivilege;
} | {
type: 'spotDeploy';
freezeUser: FreezeUser;
} | {
type: 'spotDeploy';
revokeFreezePrivilege: RevokeFreezePrivilege;
} | {
type: 'spotDeploy';
enableQuoteToken: EnableQuoteToken;
} | {
type: 'spotDeploy';
enableAlignedQuoteToken: EnableAlignedQuoteToken;
};
}
interface SpotClearinghouseState extends BaseExchangeRequest {
action: {
type: 'spotClearinghouseState';
user: string;
};
}
/**
* Type definitions for CLI command arguments
* These replace the `any` types used throughout the command functions
*/
interface BaseArgs {
network: 'mainnet' | 'testnet';
logLevel: LogLevel;
}
interface TokenIndexArgs extends BaseArgs {
tokenIndex: string;
}
interface PrivateKeyArgs extends BaseArgs {
privateKey?: string;
}
interface FordefiArgs extends BaseArgs {
fordefiApiUrl?: string;
fordefiAccessToken?: string;
fordefiVaultId?: string;
fordefiChain?: string;
}
interface UserArgs extends BaseArgs {
user: string;
}
interface SetBlockArgs extends PrivateKeyArgs {
size: 'big' | 'small';
ci?: boolean;
}
interface CoreSpotDeploymentArgs extends TokenIndexArgs {
action: 'create' | 'get';
}
interface UserGenesisArgs extends TokenIndexArgs, PrivateKeyArgs {
action: '*' | 'userAndWei' | 'existingTokenAndWei' | 'blacklistUsers';
}
interface TradingFeeArgs extends TokenIndexArgs, PrivateKeyArgs {
share: string;
}
interface FreezeUserArgs extends TokenIndexArgs, PrivateKeyArgs {
userAddress: string;
freeze: 'true' | 'false';
}
interface SpotDeployStateArgs extends TokenIndexArgs {
deployerAddress?: string;
}
interface GetCoreBalancesArgs extends UserArgs {
showZero: boolean;
}
interface ListQuoteAssetArgs extends BaseArgs {
filterTokenIndex?: string;
}
interface GenesisArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface CreateSpotDeploymentArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface RegisterTradingSpotArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface EnableTokenFreezePrivilegeArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface RevokeTokenFreezePrivilegeArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface EnableTokenQuoteAssetArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface EnableTokenAlignedQuoteAssetArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface RequestEvmContractArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface FinalizeEvmContractArgs extends TokenIndexArgs, PrivateKeyArgs {
}
interface FinalizeEvmContractCorewriterArgs extends TokenIndexArgs {
nonce: string;
}
/**
* @dev Creates a keccak hash based on the packed action, nonce, and vault address.
* @dev I just ripped off - https://github.com/hyperliquid-dex/hyperliquid-python-sdk/blob/master/hyperliquid/utils/signing.py#L137-L145
*
* @param action - The action data to be packed with MessagePack.
* @param vaultAddress - The vault address as a hex string or null.
* @param nonce - A numeric nonce.
*
* @returns The keccak hash as a hex string.
*/
declare function computeL1ActionHash(action: ValueType, nonce: number, vaultAddress: string | null): string;
/**
* Sign an L1 action.
*
* @dev Signature generation depends on the order of the action keys.
* @dev I just ripped off - https://github.com/hyperliquid-dex/hyperliquid-python-sdk/blob/master/hyperliquid/utils/signing.py#L152-L177
*
* @param args.signer - Signer to sign the action.
* @param args.action - The action to be signed.
* @param args.nonce - Unique request identifier (recommended current timestamp in ms).
* @param args.isTestnet - Indicates if the action is for the testnet. Default is `false`.
* @param args.vaultAddress - Optional vault address used in the action.
*
* @returns The signature components r, s, and v.
*/
declare function signL1Action(args: {
signer: IHyperliquidSigner;
action: ValueType;
nonce: number;
isTestnet?: boolean;
vaultAddress: Hex | null;
}): Promise<{
r: Hex;
s: Hex;
v: number;
}>;
declare function getTimestampMs(): number;
/**
* Get a Hyperliquid signer from environment variables or CLI args.
* Supports private key (Ethers), Fordefi, and Fireblocks signing.
*
* Priority:
* 1. Fordefi config (if provided via args or env)
* 2. Fireblocks config (if provided via args or env)
* 3. Private key (if provided via args or env)
*
* @param privateKey - Optional private key override
* @param fordefiConfig - Optional Fordefi configuration override
* @param fireblocksConfig - Optional Fireblocks configuration override
* @returns IHyperliquidSigner implementation
*/
declare function getHyperliquidSigner(privateKey?: string, fordefiConfig?: FordefiConfig, fireblocksConfig?: FireblocksConfig): Promise<IHyperliquidSigner>;
/**
* @deprecated Use getHyperliquidSigner instead. This is kept for backward compatibility.
*/
declare function getHyperliquidWallet(privateKey?: string): Promise<Wallet>;
declare class HyperliquidClient {
private readonly client;
private readonly baseUrl;
private readonly isTestnet;
private readonly logger;
private readonly skipPrompt;
constructor(isTestnet: boolean, logLevel: string, skipPrompt?: boolean);
submitHyperliquidAction(endpoint: string, signer: IHyperliquidSigner | null, action: ValueType): Promise<any>;
}
/**
* Signer implementation wrapping ethers.js Wallet
*/
declare class EthersSigner implements IHyperliquidSigner {
private wallet;
constructor(privateKeyOrWallet: string | Wallet);
/**
* Get the address of this signer
*/
getAddress(): Promise<string>;
/**
* Sign EIP-712 typed data using ethers.js
*/
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, unknown>): Promise<string>;
}
/**
* Signer implementation using Fordefi API for signing
*/
declare class FordefiSigner implements IHyperliquidSigner {
private config;
private address;
constructor(config: FordefiConfig);
/**
* Sign a request according to Fordefi's authentication requirements
* Signs: ${path}|${timestamp}|${requestBody}
* Using ECDSA signature scheme over the NIST P-256 curve
*/
private signRequest;
/**
* Get the address associated with this vault
*/
getAddress(): Promise<string>;
/**
* Sign EIP-712 typed data using Fordefi API
*/
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, unknown>): Promise<string>;
/**
* Poll Fordefi API until signature is complete
*/
private waitForSignature;
}
/**
* Signer implementation using Fireblocks API for signing
*/
declare class FireblocksSigner implements IHyperliquidSigner {
private config;
private address;
constructor(config: FireblocksConfig);
/**
* Generate a JWT token for Fireblocks API authentication
*/
private generateJWT;
/**
* Get the address associated with this vault account
*/
getAddress(): Promise<string>;
/**
* Sign EIP-712 typed data using Fireblocks API
*/
signTypedData(domain: TypedDataDomain, types: Record<string, Array<TypedDataField>>, value: Record<string, unknown>): Promise<string>;
/**
* Poll Fireblocks API until signature is complete
*/
private waitForSignature;
}
declare function useBigBlock(signer: IHyperliquidSigner, isTestnet: boolean, logLevel: string, skipPrompt?: boolean): Promise<any>;
declare function useSmallBlock(signer: IHyperliquidSigner, isTestnet: boolean, logLevel: string, skipPrompt?: boolean): Promise<any>;
declare function getSpotMeta(signer: IHyperliquidSigner | null, isTestnet: boolean, logLevel: string, tokenIndex: string): Promise<CoreSpotMetaData>;
declare function getHipTokenInfo(signer: IHyperliquidSigner | null, isTestnet: boolean, logLevel: string, tokenAddress: string): Promise<SpotInfo>;
declare function getSpotDeployState(deployerAddres: string, isTestnet: boolean, logLevel: string): Promise<SpotDeployStates>;
/**
* Gets all spot trading pairs for a given coreSpot token index.
* This function fetches the complete spotMeta universe and filters for pairs
* that include the specified token index.
*
* @param isTestnet Whether to query testnet or mainnet
* @param tokenIndex The token index to find pairs for
* @param logLevel Logging level for the client
* @returns Array of spot pairs that include the specified token
*/
declare function getSpotPairs(isTestnet: boolean, tokenIndex: number, logLevel: string): Promise<SpotPair[]>;
/**
* Gets all spot trading pairs for a given coreSpot token index along with token metadata.
* This function fetches both the pairs and token metadata for name resolution.
*
* @param isTestnet Whether to query testnet or mainnet
* @param tokenIndex The token index to find pairs for
* @param logLevel Logging level for the client
* @returns Object containing filtered pairs and token metadata
*/
declare function getSpotPairsWithMetadata(isTestnet: boolean, tokenIndex: number, logLevel: string): Promise<SpotPairsWithMetadata>;
/**
* Gets the current spot pair deploy auction status.
* This shows information about the ongoing auction for spot pair deployments.
*
* @param isTestnet Whether to query testnet or mainnet
* @param logLevel Logging level for the client
* @returns Current auction status information
*/
declare function getSpotPairDeployAuctionStatus(isTestnet: boolean, logLevel: string): Promise<SpotPairDeployAuctionStatus>;
/**
* Gets the quote tokens that a given core spot token is already paired with.
* This is useful to check what trading pairs already exist before deploying new ones.
*
* @param isTestnet Whether to query testnet or mainnet
* @param tokenIndex The token index to check existing pairs for
* @param logLevel Logging level for the client
* @returns Array of quote token indices that the token is already paired with
*/
declare function getExistingQuoteTokens(isTestnet: boolean, tokenIndex: number, logLevel: string): Promise<number[]>;
/**
* Checks if a token is a quote asset by looking at HYPE trading pairs.
* When any core spot is promoted to a quote asset (fee token), the Hyperliquid protocol
* automatically deploys a new spot market for HYPE/QUOTE_ASSET.
*
* @param isTestnet Whether to query testnet or mainnet
* @param tokenIndex The token index to check (optional - if not provided, returns all quote assets)
* @param logLevel Logging level for the client
* @returns Object containing isQuoteAsset boolean and tokenName string
*/
declare function isQuoteAsset(isTestnet: boolean, tokenIndex: number | null, logLevel: string): Promise<{
isQuoteAsset: boolean;
tokenName: string;
allQuoteAssets?: Array<{
index: number;
name: string;
}>;
}>;
declare function setTradingFeeShare(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, share: string, logLevel: string): Promise<any>;
declare function setUserGenesis(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, action: string, logLevel: string): Promise<{
responseForUserGenesis: {};
responseForBlacklistUsers: {};
}>;
declare function setGenesis(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function setNoHyperliquidity(signer: IHyperliquidSigner, isTestnet: boolean, tokenIndex: number, logLevel: string): Promise<any>;
declare function registerSpot(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function enableFreezePrivilege(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function freezeUser(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, userAddress: string, freeze: boolean, logLevel: string): Promise<any>;
declare function revokeFreezePrivilege(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function enableQuoteToken(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function enableAlignedQuoteToken(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function setRequestEvmContract(signer: IHyperliquidSigner, isTestnet: boolean, evmSpotTokenAddress: string, evmExtraWeiDecimals: number, coreSpotTokenId: number, logLevel: string): Promise<any>;
declare function setFinalizeEvmContract(signer: IHyperliquidSigner, isTestnet: boolean, coreSpotTokenId: number, nonce: number, logLevel: string): Promise<any>;
declare function spotClearinghouseState(user: string, isTestnet: boolean, logLevel: string): Promise<SpotBalancesResponse>;
declare function getCoreSpotDeployment(index: string | number, isTestnet: boolean, logger?: Logger): CoreSpotDeployment;
declare function writeCoreSpotDeployment(index: string | number, isTestnet: boolean, coreSpotDeployment: CoreSpotDeployment, logger?: Logger): void;
declare function writeUpdatedCoreSpotDeployment(index: string | number, isTestnet: boolean, tokenFullName: string, tokenAddress: string, txData: TxData, logger?: Logger): void;
declare function writeNativeSpotConnected(index: string | number, isTestnet: boolean, connected: boolean, weiDiff: number, logger?: Logger): void;
declare function updateFreezePrivilegeStatus(index: string | number, isTestnet: boolean, enabled: boolean, logger?: Logger): void;
declare function updateQuoteTokenStatus(index: string | number, isTestnet: boolean, enabled: boolean, logger?: Logger): void;
declare function updateUserFreezeStatus(index: string | number, isTestnet: boolean, userAddress: string, frozen: boolean, logger?: Logger): void;
declare function getHyperEVMOAppDeployment(oapp_config: string, network: string, logger?: Logger): Promise<{
contractName: string;
deployment: string;
}>;
declare function getERC20abi(): Promise<any>;
declare function loadEnv(): dotenv.DotenvParseOutput;
/**
* Load Fordefi configuration from environment variables
* Required env vars: FORDEFI_ACCESS_TOKEN, FORDEFI_PRIVATE_KEY, FORDEFI_VAULT_ID, FORDEFI_CHAIN
* Optional: FORDEFI_API_URL (defaults to https://api.fordefi.com), FORDEFI_SIGNATURE_TIMEOUT, FORDEFI_POLLING_INTERVAL
*/
declare function loadFordefiConfig(): FordefiConfig | null;
/**
* Load Fireblocks configuration from environment variables
* Required env vars: FIREBLOCKS_API_KEY, FIREBLOCKS_SECRET_KEY, FIREBLOCKS_VAULT_ACCOUNT_ID
* Optional: FIREBLOCKS_API_URL (defaults to https://api.fireblocks.io), FIREBLOCKS_ADDRESS_INDEX, FIREBLOCKS_SIGNATURE_TIMEOUT, FIREBLOCKS_POLLING_INTERVAL
*/
declare function loadFireblocksConfig(): FireblocksConfig | null;
declare function formatBalancesTable(balances: SpotBalancesResponse, showZeroBalances: boolean): string;
declare function formatSpotPairsTable(data: SpotPairsWithMetadata, tokenIndex: number): string;
export { type BaseArgs, type BaseExchangeRequest, type BaseExchangeResponse, type BaseInfoRequest, CHAIN_IDS, type CoreSpotDeployment, type CoreSpotDeploymentArgs, type CoreSpotMetaData, type CreateSpotDeploymentArgs, type DeployState, ENDPOINTS, type EnableTokenAlignedQuoteAssetArgs, type EnableTokenFreezePrivilegeArgs, type EnableTokenQuoteAssetArgs, EthersSigner, type EvmSpotDeploy, type EvmUserModifyRequest, type FinalizeEvmContract, type FinalizeEvmContractArgs, type FinalizeEvmContractCorewriterArgs, type FireblocksConfig, FireblocksSigner, type FordefiArgs, type FordefiConfig, FordefiSigner, type FreezeUserArgs, type GasAuction, type GenesisArgs, type GetCoreBalancesArgs, HYPERLIQUID_URLS, HYPE_INDEX, HyperliquidClient, type IHyperliquidSigner, type ListQuoteAssetArgs, MAX_HYPERCORE_SUPPLY, type PrivateKeyArgs, QUOTE_TOKENS, RPC_URLS, type RegisterTradingSpotArgs, type RequestEvmContractArgs, type RevokeTokenFreezePrivilegeArgs, type SetBlockArgs, type Signature, type SignatureComponents, type SpotBalance, type SpotBalancesResponse, type SpotClearinghouseState, type SpotDeployAction, type SpotDeployStateArgs, type SpotDeployStates, type SpotInfo, type SpotInfoBalance, type SpotMeta, type SpotMetaUniverse, type SpotPair, type SpotPairDeployAuctionStatus, type SpotPairsWithMetadata, type TokenIndexArgs, type TradingFeeArgs, type TxData, type UserArgs, type UserGenesis$1 as UserGenesis, type UserGenesisArgs, type ValueMap, type ValueType, computeL1ActionHash, enableAlignedQuoteToken, enableFreezePrivilege, enableQuoteToken, formatBalancesTable, formatSpotPairsTable, freezeUser, getCoreSpotDeployment, getERC20abi, getExistingQuoteTokens, getHipTokenInfo, getHyperEVMOAppDeployment, getHyperliquidSigner, getHyperliquidWallet, getSpotDeployState, getSpotMeta, getSpotPairDeployAuctionStatus, getSpotPairs, getSpotPairsWithMetadata, getTimestampMs, isQuoteAsset, loadEnv, loadFireblocksConfig, loadFordefiConfig, registerSpot, revokeFreezePrivilege, setFinalizeEvmContract, setGenesis, setNoHyperliquidity, setRequestEvmContract, setTradingFeeShare, setUserGenesis, signL1Action, spotClearinghouseState, toAssetBridgeAddress, updateFreezePrivilegeStatus, updateQuoteTokenStatus, updateUserFreezeStatus, useBigBlock, useSmallBlock, writeCoreSpotDeployment, writeNativeSpotConnected, writeUpdatedCoreSpotDeployment };