import * as transaction_message_pb from './generated/transaction.message_pb'; import { DataMapper } from './Publisher'; import { AnyAddress, BlockInfo, Blockchain, ConvertCommon, SingleAddress } from './typesCommon'; import { MessageFactory } from './typesConvert'; export declare enum Direction { RECEIVE = 0, SEND = 1 } export declare enum ChangeType { CHANGE = 0, FEE = 1 } export interface GetTransactionsRequest { blockchain: Blockchain; address: AnyAddress; cursor?: string; limit?: number; /** For Bitcoin, allows to query all unspent transactions to that address */ onlyUnspent?: boolean; /** * Get transactions is Descending order, i.e., start from the newest and go backwards. * Default: false (i.e., Ascending, from oldest to newest) */ descending?: boolean; } export interface SubscribeTransactionsRequest { blockchain: Blockchain; address: AnyAddress; } export interface AddressTransaction { blockchain: Blockchain; /** self address */ address: SingleAddress; /** index of address in xpub if xpub has been requested */ xpubIndex?: number; txId: string; /** N/A for mempool */ block?: BlockInfo; mempool: boolean; /** N/A for mempool and last blocks (unconfirmed) */ cursor?: string; /** True if transaction is removed from blockchain */ removed: boolean; /** True if transaction is failed */ failed: boolean; changes: Change[]; } export interface AddressAmount { address?: SingleAddress; /** unsigned amount */ amount: string; } export interface Change { direction: Direction; /** change address if detected, could be empty */ address?: SingleAddress; /** unsigned amount */ amount: string; type: ChangeType; /** ERC-20 token address, optional, undefined for blockchain native token */ contractAddress?: string; /** index of address in xpub if detected */ xpubIndex?: number; } export declare class ConvertTransaction { private readonly factory; private readonly common; constructor(factory: MessageFactory, common?: ConvertCommon); getTransactionsRequest(req: GetTransactionsRequest): transaction_message_pb.GetTransactionsRequest; subscribeTransactionsRequest(req: SubscribeTransactionsRequest): transaction_message_pb.SubscribeTransactionsRequest; private static change; addressTransaction(): DataMapper; }