UNPKG

2.92 kBTypeScriptView Raw
1import { decodeLedgerData } from './ledger-hashes';
2import { JsonObject } from './types/serialized-type';
3import { XrplDefinitionsBase, TRANSACTION_TYPES, DEFAULT_DEFINITIONS } from './enums';
4import { XrplDefinitions } from './enums/xrpl-definitions';
5import { coreTypes } from './types';
6/**
7 * Decode a transaction
8 *
9 * @param binary hex-string of the encoded transaction
10 * @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
11 * @returns the JSON representation of the transaction
12 */
13declare function decode(binary: string, definitions?: XrplDefinitionsBase): JsonObject;
14/**
15 * Encode a transaction
16 *
17 * @param json The JSON representation of a transaction
18 * @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
19 *
20 * @returns A hex-string of the encoded transaction
21 */
22declare function encode(json: object, definitions?: XrplDefinitionsBase): string;
23/**
24 * Encode a transaction and prepare for signing
25 *
26 * @param json JSON object representing the transaction
27 * @param signer string representing the account to sign the transaction with
28 * @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
29 * @returns a hex string of the encoded transaction
30 */
31declare function encodeForSigning(json: object, definitions?: XrplDefinitionsBase): string;
32/**
33 * Encode a transaction and prepare for signing with a claim
34 *
35 * @param json JSON object representing the transaction
36 * @param signer string representing the account to sign the transaction with
37 * @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
38 * @returns a hex string of the encoded transaction
39 */
40declare function encodeForSigningClaim(json: object): string;
41/**
42 * Encode a transaction and prepare for multi-signing
43 *
44 * @param json JSON object representing the transaction
45 * @param signer string representing the account to sign the transaction with
46 * @param definitions Custom rippled types to use instead of the default. Used for sidechains and amendments.
47 * @returns a hex string of the encoded transaction
48 */
49declare function encodeForMultisigning(json: object, signer: string, definitions?: XrplDefinitionsBase): string;
50/**
51 * Encode a quality value
52 *
53 * @param value string representation of a number
54 * @returns a hex-string representing the quality
55 */
56declare function encodeQuality(value: string): string;
57/**
58 * Decode a quality value
59 *
60 * @param value hex-string of a quality
61 * @returns a string representing the quality
62 */
63declare function decodeQuality(value: string): string;
64export { decode, encode, encodeForSigning, encodeForSigningClaim, encodeForMultisigning, encodeQuality, decodeQuality, decodeLedgerData, TRANSACTION_TYPES, XrplDefinitions, XrplDefinitionsBase, DEFAULT_DEFINITIONS, coreTypes, };