hypesdk
Version:
A powerful SDK for interacting with the Hype blockchain, featuring advanced routing and token swap capabilities
117 lines (116 loc) • 2.6 kB
TypeScript
export interface RouteAllocation {
tokenIn: string;
tokenOut: string;
routerIndex: number;
fee: number;
amountIn: string;
stable: boolean;
routerName?: string;
percentage?: number;
}
export interface RouteHop {
tokenIn: string;
tokenOut: string;
hopAmountIn: string;
allocations: RouteAllocation[];
}
export interface TokenInfo {
address: string;
symbol: string;
decimals: number;
}
export interface TokenBalance {
token: string;
balance: string;
name: string;
symbol: string;
decimals: number;
}
export interface WalletBalancesResponse {
success: boolean;
data: {
wallet: string;
tokens: TokenBalance[];
count: number;
limitedCount: number;
};
}
export interface DeployedToken {
address: string;
name: string;
symbol: string;
initialSupply: string;
decimals: number;
owner: string;
transactionHash: string;
}
export interface ApiResponse {
success: boolean;
data: {
status: string;
tokenInfo: {
tokenIn: TokenInfo;
tokenOut: TokenInfo;
amountIn: string;
};
bestPath: {
hop: RouteHop[];
amountOut: string;
};
};
}
export interface RouteResponse {
success: boolean;
data: {
bestPath: {
path: string[];
estimatedAmountOut: string;
amountIn: string;
priceImpact: string;
hop: RouteHop[];
tokenInfo: {
tokenIn: TokenInfo;
tokenOut: TokenInfo;
intermediate?: TokenInfo;
};
};
};
}
export interface GasSettings {
gasLimit: number;
maxFeePerGas: bigint;
maxPriorityFeePerGas: bigint;
}
export interface TokenHolder {
address: string;
value: string;
formattedValue: string;
}
export interface TokenHoldersResponse {
holders: TokenHolder[];
totalHolders: number;
}
export interface AddressInfo {
hash: string;
name: string | null;
is_contract: boolean;
is_verified: boolean;
}
export interface TransactionInfo {
hash: string;
result: string;
priority_fee: string;
max_fee_per_gas: string;
max_priority_fee_per_gas: string;
transaction_burnt_fee: string;
confirmations: number;
confirmation_duration: [number, number];
revert_reason: string | null;
from: AddressInfo;
to: AddressInfo;
}
export interface RawTransactionInfo {
data: TransactionInfo;
success: boolean;
error?: string;
}