import { BaseUtils } from '@bitgo/sdk-core'; import { BaseCoin } from '@bitgo/statics'; import * as xrpl from 'xrpl'; import { Amount, IssuedCurrencyAmount, MPTAmount } from 'xrpl'; import { Address, SignerDetails } from './iface'; declare class Utils implements BaseUtils { isValidAddress(address: string): boolean; isValidTransactionId(txId: string): boolean; isValidPublicKey(key: string): boolean; isValidPrivateKey(key: string): boolean; isValidSignature(signature: string): boolean; isValidBlockId(hash: string): boolean; isValidHex(hex: string): boolean; /** * Parse an address string into address and destination tag */ getAddressDetails(address: string): Address; /** * Construct a full, normalized address from an address and destination tag */ normalizeAddress({ address, destinationTag }: Address): string; /** * @param message hex encoded string * @param privateKey * return hex encoded signature string, throws if any of the inputs are invalid */ signString(message: string, privateKey: string): string; /** * @param message hex encoded string * @param signature hex encooded signature string * @param publicKey * return boolean, throws if any of the inputs are invalid */ verifySignature(message: string, signature: string, publicKey: string): boolean; /** * Check the raw transaction has a valid format in the blockchain context, throw otherwise. * * @param {string} rawTransaction - Transaction in hex string format */ validateRawTransaction(rawTransaction: string): void; /** * Checks if raw transaction can be deserialized * * @param {string} rawTransaction - transaction in base64 string format * @returns {boolean} - the validation result */ isValidRawTransaction(rawTransaction: string): boolean; validateAccountSetFlag(setFlag: number): void; validateSigner(signer: SignerDetails): void; /** * Determines if the provided `amount` is a trust-line token payment amount (IssuedCurrencyAmount). */ isIssuedCurrencyAmount(amount: Amount | MPTAmount): amount is IssuedCurrencyAmount; /** * Determines if the provided `amount` is an MPT payment amount. */ isMPTAmount(amount: Amount | MPTAmount): amount is MPTAmount; /** * Returns true when the Payment `tfPartialPayment` flag is set on a transaction's Flags * field. When set, the delivered amount is in `meta.delivered_amount`, not `tx.Amount`. */ isPartialPayment(flags: number | undefined): boolean; /** * Extracts the numeric/string delivered amount value from XRP transaction metadata. * `meta.delivered_amount` is an `Amount | 'unavailable'`: * - string → XRP drops (or the literal 'unavailable' for pre-2014 txs) * - IssuedCurrencyAmount → `{ currency, issuer, value }` * Returns undefined when metadata is missing, the field is 'unavailable', or the shape * is unexpected — callers must fall back to `tx.Amount` in that case and surface the * partial-payment flag so consumers know the value is requested, not delivered. */ getDeliveredAmountValue(meta?: xrpl.TransactionMetadata): string | undefined; /** * Get the associated XRP Currency details from token name. Throws an error if token is unsupported * @param {string} tokenName - The token name */ getXrpCurrencyFromTokenName(tokenName: string): xrpl.IssuedCurrency; /** * Decodes a serialized XRPL transaction. * * @param {string} txHex - The serialized transaction in hex. * @returns {Object} - Decoded transaction object. * @throws {Error} - If decoding fails or input is invalid. */ decodeTransaction(txHex: string): Record; /** * Get the statics coin object matching a given Xrp token issuer address and currency code if it exists * * @param issuerAddress The token issuer address to match against * @param currencyCode The token currency code to match against * @returns statics BaseCoin object for the matching token */ getXrpToken(issuerAddress: any, currencyCode: any): Readonly | undefined; } declare const utils: Utils; export default utils; //# sourceMappingURL=utils.d.ts.map