import { Provider, TransactionRequest, TransactionResponse } from "@hethers/abstract-provider"; import { BigNumber, BigNumberish } from "@ethersproject/bignumber"; import { Bytes, BytesLike } from "@ethersproject/bytes"; import { Deferrable } from "@ethersproject/properties"; import { Account } from "@hethers/address"; import { SigningKey } from "@hethers/signing-key"; export interface TypedDataDomain { name?: string; version?: string; chainId?: BigNumberish; verifyingContract?: string; salt?: BytesLike; } export interface TypedDataField { name: string; type: string; } export interface ExternallyOwnedAccount { readonly address?: string; readonly account?: Account; readonly alias?: string; readonly privateKey: string; readonly isED25519Type?: boolean; } export interface TypedDataSigner { _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; } export declare abstract class Signer { readonly provider?: Provider; readonly _signingKey: () => SigningKey; readonly isED25519Type?: boolean; abstract getAddress(): Promise; abstract signMessage(message: Bytes | string): Promise; /** * Signs a transaction with the key given upon creation. * The transaction can be: * - FileCreate - when there is only `fileChunk` field in the `transaction.customData` object * - FileAppend - when there is both `fileChunk` and a `fileId` fields * - ContractCreate - when there is a `bytecodeFileId` field * - ContractCall - when there is a `to` field present. Ignores the other fields * * @param transaction - the transaction to be signed. */ abstract signTransaction(transaction: TransactionRequest): Promise; abstract connect(provider: Provider): Signer; /** * Creates an account for the specified public key and sets initial balance. * @param pubKey * @param initialBalance */ abstract createAccount(pubKey: BytesLike, initialBalance?: BigInt): Promise; readonly _isSigner: boolean; constructor(); getGasPrice(): Promise; getBalance(): Promise; estimateGas(transaction: Deferrable): Promise; call(txRequest: Deferrable): Promise; /** * Composes a transaction which is signed and sent to the provider's network. * @param transaction - the actual tx */ sendTransaction(transaction: Deferrable): Promise; getChainId(): Promise; /** * Checks if the given transaction is usable. * Properties - `from`, `nodeId`, `gasLimit` * @param transaction - the tx to be checked */ checkTransaction(transaction: Deferrable): Deferrable; /** * Populates any missing properties in a transaction request. * Properties affected - `to`, `chainId` * @param transaction */ populateTransaction(transaction: Deferrable): Promise; _checkProvider(operation?: string): void; static isSigner(value: any): value is Signer; } export declare class VoidSigner extends Signer implements TypedDataSigner { readonly address: string; constructor(address: string, provider?: Provider); getAddress(): Promise; _fail(message: string, operation: string): Promise; signMessage(message: Bytes | string): Promise; signTransaction(transaction: Deferrable): Promise; createAccount(pubKey: BytesLike, initialBalance?: BigInt): Promise; _signTypedData(domain: TypedDataDomain, types: Record>, value: Record): Promise; connect(provider: Provider): VoidSigner; } //# sourceMappingURL=index.d.ts.map