UNPKG

ripple-binary-codec

Version:
20 lines (19 loc) 816 B
import { BinaryParser } from '../serdes/binary-parser'; import { SerializedType } from './serialized-type'; /** * SerializedType for the XRPL Number type (12 bytes). */ export declare class SerializedNumber extends SerializedType { constructor(bytes: Uint8Array); /** * Creates a SerializedNumber from a string value. * Accepts only string input to avoid precision loss (as per XRPL and blockchain best practices). * Throws if a number or bigint is passed. * @param value string representing the number (decimal, integer, or scientific notation) * @returns SerializedNumber instance */ static from(value: string): SerializedNumber; static fromValue(val: string): SerializedNumber; static fromParser(parser: BinaryParser): SerializedNumber; toJSON(): string; }