@liskhq/lisk-api-client
Version:
An API client for the Lisk network
35 lines (34 loc) • 3.48 kB
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import { Schema } from '@liskhq/lisk-codec';
import { Block, BlockAsset, BlockAssetJSON, BlockHeader, BlockJSON, DecodedBlock, DecodedBlockAsset, DecodedBlockAssetJSON, DecodedBlockJSON, DecodedEventJSON, DecodedTransaction, DecodedTransactionJSON, EventJSON, ModuleMetadata, RegisteredSchemas, Transaction, TransactionJSON } from './types';
export declare const getTransactionParamsSchema: (transaction: {
module: string;
command: string;
}, metadata: ModuleMetadata[]) => Schema;
export declare const getEventDataSchema: (event: {
module: string;
name: string;
}, metadata: ModuleMetadata[]) => Schema | undefined;
export declare const getAssetDataSchema: (blockVersion: number, asset: {
module: string;
}, metadata: ModuleMetadata[]) => Schema;
export declare const decodeTransactionParams: <T>(transaction: Transaction | DecodedTransaction<T>, metadata: ModuleMetadata[]) => DecodedTransaction<T>;
export declare const decodeEventData: (event: EventJSON, metadata: ModuleMetadata[]) => DecodedEventJSON;
export declare const decodeTransaction: <T = Record<string, unknown>>(encodedTransaction: Buffer, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedTransaction<T>;
export declare const encodeTransaction: (transaction: DecodedTransaction | Transaction, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => Buffer;
export declare const fromTransactionJSON: <T = Record<string, unknown>>(transaction: TransactionJSON | DecodedTransactionJSON, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedTransaction<T>;
export declare const toTransactionJSON: <T = Record<string, unknown>>(transaction: Transaction | DecodedTransaction<T>, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedTransactionJSON<T>;
export declare const decodeAssets: (blockVersion: number, encodedAssets: Buffer[], registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlockAsset[];
export declare const encodeAssets: (blockVersion: number, assets: (DecodedBlockAsset | BlockAsset)[], registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => Buffer[];
export declare const fromBlockAssetJSON: <T = Record<string, unknown>>(blockVersion: number, asset: BlockAssetJSON | DecodedBlockAssetJSON, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlockAsset<T>;
export declare const toBlockAssetJSON: <T = Record<string, unknown>>(blockVersion: number, asset: BlockAsset | DecodedBlockAsset, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlockAssetJSON<T>;
export declare const decodeBlock: (encodedBlock: Buffer, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlock;
export declare const encodeBlock: (block: {
header: BlockHeader;
transactions: (DecodedTransaction | Transaction)[];
assets: (DecodedBlockAsset | BlockAsset)[];
}, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => Buffer;
export declare const fromBlockJSON: (block: BlockJSON | DecodedBlockJSON, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlock;
export declare const toBlockJSON: (block: DecodedBlock | Block, registeredSchema: RegisteredSchemas, metadata: ModuleMetadata[]) => DecodedBlockJSON;
export declare const decodeBlockJSON: (block: BlockJSON, metadata: ModuleMetadata[]) => DecodedBlockJSON;