UNPKG

@zebec-network/exchange-card-sdk

Version:
36 lines (35 loc) 1.21 kB
import algosdk from "algosdk"; export declare function hashSHA256(input: string): string; /** * Convert ALGO to microAlgos * @param algos Amount in ALGO * @returns Amount in microAlgos */ export declare function parseAlgo(algos: number | string): bigint; /** * Convert microAlgos to ALGO * @param microAlgos Amount in microAlgos * @returns Amount in ALGO */ export declare function formatAlgo(microAlgos: number | bigint): string; /** * Convert Amount to micro-token amount (base units) * @param amount Amount in decimal units * @param decimals Number of decimals for the asset * @returns Amount in micro-token base units */ export declare function parseAlgorandAsset(amount: number | string, decimals: number): bigint; /** * Convert micro-token Amount to Amount * @param microAmount Amount in micro units * @param decimals Number of decimals for the asset * @returns Amount in decimal units */ export declare function formatAlgorandAsset(microAmount: number | bigint, decimals: number): string; /** * * @param client Algod Client * @param assetId asset index of Asset * @returns */ export declare function getAssetDecimals(client: algosdk.Algodv2, assetId: number): Promise<number>;