UNPKG

@bithomp/xrpl-api

Version:

A Bithomp JavaScript/TypeScript library for interacting with the XRP Ledger

34 lines (33 loc) 1.9 kB
import { Node, TransactionMetadata } from "xrpl"; import { IssuedCurrencyAmount, FormattedIssuedCurrencyAmount, FormattedIssuedMPTAmount } from "../types"; type NormalizedNode = { diffType: string; entryType: string; ledgerIndex: string; newFields: { [field: string]: unknown; }; finalFields: { [field: string]: unknown; }; previousFields: { [field: string]: unknown; }; PreviousTxnID?: string; PreviousTxnLgrSeq?: number; }; declare function adjustQualityForXRP(quality: string, takerGetsCurrency: string, takerPaysCurrency: string): string; declare function parseQuality(quality?: number | null): number | undefined; declare function parseTimestamp(rippleTime?: number | null): string | undefined; declare function isPartialPayment(tx: any): boolean; declare function removeGenericCounterparty(amount: IssuedCurrencyAmount | FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount, address: string): FormattedIssuedCurrencyAmount | FormattedIssuedMPTAmount; declare function normalizeNode(affectedNode: Node): NormalizedNode; declare function normalizeNodes(metadata: TransactionMetadata): NormalizedNode[]; declare function hexToString(hex: string | undefined): string | undefined; declare function decodeHexData(data?: string): string | undefined; declare function stringToHex(value: string | undefined): string | undefined; declare function bytesToHex(value: Uint8Array | ArrayBufferLike): string; declare function hexToBytes(value: string): Uint8Array; declare function parseUint32(buf: Buffer, cur: number): string; declare function parseUint64(buf: Buffer, cur: number): string; export { NormalizedNode, parseQuality, parseTimestamp, adjustQualityForXRP, isPartialPayment, removeGenericCounterparty, normalizeNodes, normalizeNode, hexToString, decodeHexData, stringToHex, bytesToHex, hexToBytes, parseUint32, parseUint64, };