Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/web3/packages/web3-eth/types/index.d.ts>Eth

Deno / TypeScript to Ethereum Connector
Latest
class Eth
import { Eth } from "https://deno.land/x/web3@v0.11.1/packages/web3-eth/types/index.d.ts";

Constructors

new
Eth()
new
Eth(provider: provider)
new
Eth(provider: provider, net: net.Socket)

Properties

accounts: Accounts
BatchRequest: new () => BatchRequest
Contract: new (
jsonInterface: AbiItem[] | AbiItem,
address?: string,
options?: ContractOptions,
) => Contract
readonly
currentProvider: provider
defaultAccount: string | null
defaultBlock: BlockNumber
defaultChain: chain
defaultCommon: Common
defaultHardfork: hardfork
ens: Ens
readonly
givenProvider: any
handleRevert: boolean
Iban: new (iban: string) => Iban
net: Network
personal: Personal
transactionBlockTimeout: number
transactionConfirmationBlocks: number
transactionPollingTimeout: number

Methods

call(transactionConfig: TransactionConfig): Promise<string>
call(transactionConfig: TransactionConfig, defaultBlock?: BlockNumber): Promise<string>
call(transactionConfig: TransactionConfig, callback?: (error: Error, data: string) => void): Promise<string>
call(
transactionConfig: TransactionConfig,
defaultBlock: BlockNumber,
callback: (error: Error, data: string) => void,
): Promise<string>
clearSubscriptions(callback: (error: Error, result: boolean) => void): void
estimateGas(transactionConfig: TransactionConfig, callback?: (error: Error, gas: number) => void): Promise<number>
extend(extension: Extension): any
getAccounts(callback?: (error: Error, accounts: string[]) => void): Promise<string[]>
getBalance(address: string): Promise<string>
getBalance(address: string, defaultBlock: BlockNumber): Promise<string>
getBalance(address: string, callback?: (error: Error, balance: string) => void): Promise<string>
getBalance(
address: string,
defaultBlock: BlockNumber,
callback?: (error: Error, balance: string) => void,
): Promise<string>
getBlock(blockHashOrBlockNumber: BlockNumber | string): Promise<BlockTransactionString>
getBlock(blockHashOrBlockNumber: BlockNumber | string, returnTransactionObjects: boolean): Promise<BlockTransactionObject>
getBlock(blockHashOrBlockNumber: BlockNumber | string, callback?: (error: Error, block: BlockTransactionString) => void): Promise<BlockTransactionString>
getBlock(
blockHashOrBlockNumber: BlockNumber | string,
returnTransactionObjects: boolean,
callback?: (error: Error, block: BlockTransactionObject) => void,
): Promise<BlockTransactionObject>
getBlockNumber(callback?: (error: Error, blockNumber: number) => void): Promise<number>
getBlockTransactionCount(blockHashOrBlockNumber: BlockNumber | string, callback?: (error: Error, numberOfTransactions: number) => void): Promise<number>
getBlockUncleCount(blockHashOrBlockNumber: BlockNumber | string, callback?: (error: Error, numberOfTransactions: number) => void): Promise<number>
getChainId(callback?: (error: Error, version: number) => void): Promise<number>
getCode(address: string): Promise<string>
getCode(address: string, defaultBlock: BlockNumber): Promise<string>
getCode(address: string, callback?: (error: Error, code: string) => void): Promise<string>
getCode(
address: string,
defaultBlock: BlockNumber,
callback?: (error: Error, code: string) => void,
): Promise<string>
getCoinbase(callback?: (error: Error, coinbaseAddress: string) => void): Promise<string>
getFeeHistory(
blockCount:
| number
| BN
| string
,
lastBlock:
| number
| BN
| string
,
rewardPercentiles: number[],
callback?: (error: Error, feeHistory: FeeHistoryResult) => void,
): Promise<FeeHistoryResult>
getGasPrice(callback?: (error: Error, gasPrice: string) => void): Promise<string>
getHashrate(callback?: (error: Error, hashes: number) => void): Promise<number>
getNodeInfo(callback?: (error: Error, version: string) => void): Promise<string>
getPastLogs(options: PastLogsOptions, callback?: (error: Error, logs: Log[]) => void): Promise<Log[]>
getPendingTransactions(callback?: (error: Error, result: Transaction[]) => void): Promise<Transaction[]>
getProof(
address: string,
storageKey:
| number[]
| BN[]
| string[]
,
blockNumber: BlockNumber,
callback?: (error: Error, result: GetProof) => void,
): Promise<GetProof>
getProof(
address: string,
storageKey:
| number[]
| BN[]
| string[]
,
blockNumber: BlockNumber,
): Promise<GetProof>
getProtocolVersion(callback?: (error: Error, protocolVersion: string) => void): Promise<string>
getStorageAt(address: string, position:
| number
| BN
| string
): Promise<string>
getStorageAt(
address: string,
position:
| number
| BN
| string
,
defaultBlock: BlockNumber,
): Promise<string>
getStorageAt(
address: string,
position:
| number
| BN
| string
,
callback?: (error: Error, storageAt: string) => void,
): Promise<string>
getStorageAt(
address: string,
position:
| number
| BN
| string
,
defaultBlock: BlockNumber,
callback?: (error: Error, storageAt: string) => void,
): Promise<string>
getTransaction(transactionHash: string, callback?: (error: Error, transaction: Transaction) => void): Promise<Transaction>
getTransactionCount(address: string): Promise<number>
getTransactionCount(address: string, defaultBlock: BlockNumber): Promise<number>
getTransactionCount(address: string, callback?: (error: Error, count: number) => void): Promise<number>
getTransactionCount(
address: string,
defaultBlock: BlockNumber,
callback?: (error: Error, count: number) => void,
): Promise<number>
getTransactionFromBlock(
blockHashOrBlockNumber: BlockNumber | string,
indexNumber: number | string | BN,
callback?: (error: Error, transaction: Transaction) => void,
): Promise<Transaction>
getTransactionReceipt(hash: string, callback?: (error: Error, transactionReceipt: TransactionReceipt) => void): Promise<TransactionReceipt>
getUncle(blockHashOrBlockNumber: BlockNumber | string, uncleIndex: number | string | BN): Promise<BlockTransactionString>
getUncle(
blockHashOrBlockNumber: BlockNumber | string,
uncleIndex: number | string | BN,
returnTransactionObjects: boolean,
): Promise<BlockTransactionObject>
getUncle(
blockHashOrBlockNumber: BlockNumber | string,
uncleIndex: number | string | BN,
callback?: (error: Error, uncle: any) => void,
): Promise<BlockTransactionString>
getUncle(
blockHashOrBlockNumber: BlockNumber | string,
uncleIndex: number | string | BN,
returnTransactionObjects: boolean,
callback?: (error: Error, uncle: any) => void,
): Promise<BlockTransactionObject>
getWork(callback?: (error: Error, result: string[]) => void): Promise<string[]>
isMining(callback?: (error: Error, mining: boolean) => void): Promise<boolean>
isSyncing(callback?: (error: Error, syncing: Syncing) => void): Promise<Syncing | boolean>
requestAccounts(): Promise<string[]>
requestAccounts(callback: (error: Error, result: string[]) => void): Promise<string[]>
sendSignedTransaction(signedTransactionData: string, callback?: (error: Error, hash: string) => void): PromiEvent<TransactionReceipt>
sendTransaction(transactionConfig: TransactionConfig, callback?: (error: Error, hash: string) => void): PromiEvent<TransactionReceipt>
setProvider(provider: provider): boolean
sign(
dataToSign: string,
address: string | number,
callback?: (error: Error, signature: string) => void,
): Promise<string>
signTransaction(transactionConfig: TransactionConfig, callback?: (error: Error, signedTransaction: RLPEncodedTransaction) => void): Promise<RLPEncodedTransaction>
signTransaction(transactionConfig: TransactionConfig, address: string): Promise<RLPEncodedTransaction>
signTransaction(
transactionConfig: TransactionConfig,
address: string,
callback: (error: Error, signedTransaction: RLPEncodedTransaction) => void,
): Promise<RLPEncodedTransaction>
submitWork(data: [string, string, string], callback?: (error: Error, result: boolean) => void): Promise<boolean>
subscribe(
type: "logs",
options: LogsOptions,
callback?: (error: Error, log: Log) => void,
): Subscription<Log>
subscribe(type: "syncing", callback?: (error: Error, result: Syncing) => void): Subscription<Syncing>
subscribe(type: "newBlockHeaders", callback?: (error: Error, blockHeader: BlockHeader) => void): Subscription<BlockHeader>
subscribe(type: "pendingTransactions", callback?: (error: Error, transactionHash: string) => void): Subscription<string>

Static Properties

readonly
givenProvider: any
readonly
providers: Providers