UNPKG

@onekeyfe/blockchain-libs

Version:
76 lines (75 loc) 2.21 kB
/// <reference types="node" /> import { Address, AnyTransaction, EncodedTransaction, TransactionParams, TransactionType } from './types'; export declare const ALGORAND_MIN_TX_FEE = 1000; /** * A modified version of the transaction params. Represents the internal structure that the Transaction class uses * to store inputted transaction objects. */ interface TransactionStorageStructure extends Omit<TransactionParams, 'from' | 'to' | 'genesisHash' | 'closeRemainderTo' | 'assetRevocationTarget' | 'suggestedParams' | 'reKeyTo'> { from: string | Address; to: string | Address; fee: number; amount: number | bigint; firstRound: number; lastRound: number; note?: Uint8Array; genesisID: string; genesisHash: string | Buffer; lease?: Uint8Array; closeRemainderTo?: string | Address; assetIndex: number; assetRevocationTarget?: string | Address; type?: TransactionType; flatFee: boolean; reKeyTo?: string | Address; nonParticipation?: boolean; group?: Buffer; extraPages?: number; } /** * Transaction enables construction of Algorand transactions * */ export declare class Transaction implements TransactionStorageStructure { name: string; tag: Buffer; from: Address; to: Address; fee: number; amount: number | bigint; firstRound: number; lastRound: number; note: Uint8Array; genesisID: string; genesisHash: Buffer; lease: Uint8Array; closeRemainderTo?: Address; assetIndex: number; assetRevocationTarget?: Address; type?: TransactionType; flatFee: boolean; reKeyTo?: Address; nonParticipation?: boolean; group?: Buffer; extraPages?: number; constructor({ ...transaction }: AnyTransaction); get_obj_for_encoding(): EncodedTransaction | undefined; estimateSize(): number; bytesToSign(): Buffer; toByte(): Uint8Array; rawTxID(): Buffer; txID(): string; } /** * Object representing a transaction with a signature */ export interface SignedTransaction { /** * Transaction signature */ sig?: Buffer; /** * The transaction that was signed */ txn: Transaction; } export default Transaction;