myria-core-sdk
Version:
Latest version SDK
22 lines (21 loc) • 886 B
TypeScript
export declare const USDT_TOKEN: {
tokenAddress: string;
quantum: string;
};
export declare function convertAmountToQuantizedAmount(amount: number | string): number;
export declare function convertEthToWei(amount: string): string;
export declare function convertWeiToEth(amount: string): string;
/**
* Convert USDT amount to quantized amount
* Since USDT has 6 decimals and uses quantum of 10^6,
* we just need to multiply by 10^6 to get the quantized amount and then divide by 10^6 (quantum) to get the quantized amount
* @param amount USDT amount (e.g. 1.5 USDT)
* @returns quantized amount
*/
export declare function convertUsdtToQuantizedAmount(amount: number | string): number;
/**
* Convert USDT amount to base unit
* @param amount USDT amount (e.g. 1.5 USDT)
* @returns base unit amount
*/
export declare function convertUsdtToBaseUnit(amount: string): string;