import BigNumber from 'bignumber.js'; import { BaseCoin as CoinConfig } from '@bitgo/statics'; import { BaseAddress, BaseKey, BaseTransactionBuilder } from '@bitgo/sdk-core'; import { Transaction } from './transaction'; import { KeyPair } from './keyPair'; import { Fee, CasperModuleBytesTransaction, CasperTransferTransaction, CasperDelegateTransaction, SignatureData } from './ifaces'; export declare const DEFAULT_M = 3; export declare const DEFAULT_N = 2; export declare abstract class TransactionBuilder extends BaseTransactionBuilder { protected _source: BaseAddress; protected _fee: Fee; private _transaction; protected _session: CasperTransferTransaction | CasperModuleBytesTransaction | CasperDelegateTransaction; protected _expiration: number; protected _multiSignerKeyPairs: KeyPair[]; protected _signatures: SignatureData[]; protected _chainName: string; constructor(_coinConfig: Readonly); /** @inheritdoc */ protected buildImplementation(): Promise; /** @inheritdoc */ protected fromImplementation(rawTransaction: string): Transaction; /** @inheritdoc */ protected signImplementation(key: BaseKey): Transaction; /** * Initialize the transaction builder fields using the decoded transaction data * * @param {Transaction} tx the transaction data */ initBuilder(tx: Transaction): void; /** * Set the transaction fees * * @param {BaseFee} fee The maximum gas to pay * @returns {TransactionBuilder} This transaction builder */ fee(fee: Fee): this; /** * Set the transaction source * * @param {BaseAddress} address The source account * @returns {TransactionBuilder} This transaction builder */ source(address: BaseAddress): this; /** * Set the transaction expirationTime * * @param {string} expirationTime The transaction expirationTime * @returns {TransactionBuilder} This transaction builder */ expiration(expirationTime: number): this; /** * Set an external transaction signature * * @param {string} signature Hex encoded signature string * @param {KeyPair} keyPair The public key keypair that was used to create the signature * @returns {TransactionBuilder} This transaction builder */ signature(signature: string, keyPair: KeyPair): this; nodeChainName(chainName: string): this; /** @inheritdoc */ validateAddress(address: BaseAddress): void; /** @inheritdoc */ validateKey(key: BaseKey): void; /** @inheritdoc */ validateRawTransaction(rawTransaction: string): void; /** @inheritdoc */ validateTransaction(transaction?: Transaction): void; /** @inheritdoc */ validateValue(value: BigNumber): void; /** * Validates that the mandatory fields are defined */ validateMandatoryFields(): void; /** * Validates that the fee field is defined */ private validateFee; /** * Validates that the source field is defined */ private validateSource; /** * Validates that the given key is not already in this._multiSignerKeyPairs * * @param {BaseKey} key - The key to check */ private checkDuplicatedKeys; /** @inheritdoc */ protected get transaction(): Transaction; /** @inheritdoc */ protected set transaction(transaction: Transaction); /** * Get the chain name for the coin environment */ get chainName(): string; /** * Generate a DeployParams instance with the transaction data * * @returns {DeployUtil.DeployParams} */ private getDeployParams; /** * Generate the session for the Deploy according to the transactionType. * * @returns {DeployUtil.ExecutableDeployItem} */ private getSession; /** * Checks whether the transaction has the owner signature * * @param {string} pub - public key of the signer * @returns {boolean} true if the pub key already signed th transaction * @private */ private isTransactionSignedByPub; /** * Add signatures to the transaction * * @private */ private processSigning; } //# sourceMappingURL=transactionBuilder.d.ts.map