@vechain/connex-driver
Version:
Connex framework driver implementation
36 lines (35 loc) • 1.36 kB
TypeScript
import { DriverNoVendor } from './driver-no-vendor';
import { Net, Wallet } from './interfaces';
import { Transaction } from 'thor-devkit';
/** class fully implements DriverInterface */
export declare class Driver extends DriverNoVendor {
private readonly wallet?;
/**
* create driver instance
* it will fetch config(genesis, head) via net as construction params
* @param net
* @param wallet
*/
static connect(net: Net, wallet?: Wallet): Promise<Driver>;
/** handler to receive txs committed */
onTxCommit?: (txObj: TxObject) => void;
/** params for tx construction */
txParams: {
expiration: number;
gasPriceCoef: number;
maxPriorityFeePerGas: string | number;
txType: Transaction.Type;
};
constructor(net: Net, genesis: Connex.Thor.Block, initialHead?: Connex.Thor.Status['head'], wallet?: Wallet | undefined);
signTx(msg: Connex.Vendor.TxMessage, options: Connex.Signer.TxOptions): Promise<Connex.Vendor.TxResponse>;
signCert(msg: Connex.Vendor.CertMessage, options: Connex.Signer.CertOptions): Promise<Connex.Vendor.CertResponse>;
private findKey;
private sendTx;
private estimateGas;
}
export declare const TransactionType: typeof Transaction.Type;
export interface TxObject {
id: string;
raw: string;
resend(): Promise<void>;
}