UNPKG

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