Deploying HIP-1 and HIP-2 assets
The API for deploying HIP-1 and HIP-2 assets is a five-step process which involves sending the 5 variants of the enum in the order below.
type SpotDeployAction =
| RegisterToken2
| UserGenesis
| Genesis
| RegisterSpot
| RegisterHyperliquidity;
interface RegisterToken2 {
type: "registerToken2";
spec: TokenSpec;
maxGas: number;
}
interface TokenSpec {
name: string,
szDecimals: number,
weiDecimals: number,
}
/**
* 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).
*/
interface UserGenesis {
type: "userGenesis";
token: number;
userAndWei: Array<[string, string]>;
existingTokenAndWei: Array<[number, string]>;
}
/**
* Genesis denotes the initial creation of a token with a maximum supply.
* @param maxSupply - Checksum ensureing all calls to UserGenesis succeeded
*/
interface Genesis {
type: "genesis";
token: number;
maxSupply: string;
}
/**
* @param tokens - [base index, quote index]
*/
interface RegisterSpot {
type: "registerSpot";
tokens: Array<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.
*/
interface RegisterHyperliquidity {
type: "registerHyperliquidity";
spot: number;
startPx: number;
orderSz: number;
nOrders: number;
}
Last updated