UNPKG

@provenanceio/wallet-utils

Version:

Typescript Utilities for Provenance Blockchain Wallet

44 lines (43 loc) 1.8 kB
import { CoinAsObject } from '../../types'; declare type GasPrice = { gasPrice: number; gasPriceDenom: string; }; declare type AmountList = CoinAsObject[]; export declare const displayCapitalizedString: (fieldValue: any) => string; /** * Displays a wallet address by trimming length to 11. */ export declare const displayAddress: (fieldValue?: string) => string; /** * amountList is an array of objects: amountList: [{ denom: 'a', amount: '1' }, {...}] * Note: If the denom is nhash, autoconvert to hash */ export declare const displayAmountList: (fieldValue: AmountList) => string[]; /** * Hash is fixed to 5 dec points by default. */ export declare const displayHashFormat: (fieldValue: string, toFixed?: number) => string; /** * Amount be a CoinAsObject or an amount. Automatically convert nhash to hash. * For other denoms, defaults to display a capital case of the denom. */ export declare const displayCoinAsObject: (fieldValue: string | number | CoinAsObject) => string; export declare const displayGasPrice: (fieldValue: GasPrice) => string; export declare const displayDateAndTime: (fieldValue: string) => string; /** * Deduce the formatting function based on the field and/or value. Value * is formatted below, otherwise it may be an array/object which is * recursively unpacked message-service and passed through the formatting * function again. * */ export declare const formatSingleValue: (value: any) => string; /** * Deduce the formatting function based on the field and/or value. Value * is formatted below, otherwise it may be an array/object which is * recursively unpacked message-service and passed through the formatting * function again. */ export declare const formatCustomObj: (key: string, value: any) => string | string[] | null; export {};