import { HexString, Signature, Hash, Address } from './helpers/types'; import { BigNumber } from 'ethers/utils'; import { SumMerkleProof } from './merkle'; import { Segment } from './segment'; import { StateUpdate, PredicatesManager } from './StateUpdate'; import { IState } from './state/BaseStateManager'; /** * SignedTransaction is the transaction and its signatures */ export declare class SignedTransaction { stateUpdates: StateUpdate[]; transactionWitness: Signature[]; constructor(stateUpdates: StateUpdate[]); withRawSignatures(sigs: Signature[]): SignedTransaction; getStateUpdate(stateIndex: number): StateUpdate; getStateUpdates(): StateUpdate[]; /** * sign * @param pkey is hex string of private key */ sign(pkey: string): void; justSign(pkey: string): string; getTxBytes(): string; hash(): string; getTxHash(): string; getSegments(): Segment[]; /** * * @description txs[txIndex].getOutputs(outputIndex) */ getIndex(segment: Segment): any; getTransactionWitness(): string; getSigners(): Address[]; serialize(): { states: string[]; tw: string[]; }; static deserialize(data: any): SignedTransaction; } /** * SignedTransactionWithProof is the transaction and its signatures and proof */ export declare class SignedTransactionWithProof implements IState { signedTx: SignedTransaction; stateIndex: number; proofs: SumMerkleProof[]; superRoot: Hash; root: Hash; timestamp: BigNumber; blkNum: BigNumber; confSigs: Signature[]; stateUpdate: StateUpdate; verifiedFlag: boolean; constructor(tx: SignedTransaction, stateIndex: number, superRoot: Hash, root: Hash, timestamp: BigNumber, proofs: SumMerkleProof[], blkNum: BigNumber, stateUpdate?: StateUpdate); checkVerified(verifiedFlag: boolean): this; getSignedTx(): SignedTransaction; getTxBytes(): HexString; getTxHash(): Hash; getStateBytes(): string; getStateHash(): string; getRawState(): string; verifyDeprecation(hash: Hash, newStateUpdate: StateUpdate, deprecationWitness: string, predicatesManager: PredicatesManager): boolean; getSubStateUpdate(newSegment: Segment): StateUpdate; getRemainingState(stateUpdate: StateUpdate): IState[]; getSegment(): Segment; getOriginalSegment(): Segment; getSuperRoot(): string; getTimestamp(): BigNumber; getRoot(): string; getProof(): SumMerkleProof; /** * this.txIndex should be 0 or 1 */ private getTxOffset; private getTxSize; isDeposit(): boolean; /** * @description header structure * numTx 2 bytes * txIndex 2 bytes * merkle root 32 bytes * timestamp 8 bytes * numNodes 2 bytes * proofs * txOffset 2 bytes * txSize 2 bytes * segment 32 bytes * sig 65 bytes * range 8 bytes * proof body n * 41 bytes */ getProofAsHex(): HexString; getSignatures(): string; getTransactionWitness(): HexString; getOutput(): StateUpdate; merkleHash(): Hash; confirmMerkleProofs(pkey: string): void; checkInclusion(): boolean; serialize(): { tx: { states: string[]; tw: string[]; }; i: number; sr: string; r: string; ts: string; proofs: { numTokens: number; index: number; segment: string[]; leaf: string; proof: string; }[]; blkNum: string; confSigs: string[]; stateUpdate: string; v: boolean; }; static deserialize(data: any): SignedTransactionWithProof; }