Personal
Eth Personal allows you to interact with the Ethereum node’s accounts.
Hierarchy
-
Web3Context
<EthPersonalAPI
>↳
Personal
Accessors
BatchRequest
• get
BatchRequest(): Object
Will return the Web3BatchRequest constructor.
Returns
Object
Inherited from
Web3Context.BatchRequest
Defined in
web3-core/lib/commonjs/web3_context.d.ts:158
blockHeaderTimeout
• get
blockHeaderTimeout(): number
The blockHeaderTimeout is used over socket-based connections. This option defines the amount seconds it should wait for 'newBlockHeaders'
event before falling back to polling to fetch transaction receipt.
Default is 10
seconds.
Returns
number
Inherited from
Web3Context.blockHeaderTimeout
Defined in
web3-core/lib/commonjs/web3_config.d.ts:166
• set
blockHeaderTimeout(val
): void
Will set the blockHeaderTimeout
Parameters
Name | Type |
---|---|
val | number |
Returns
void
Inherited from
Web3Context.blockHeaderTimeout
Defined in
web3-core/lib/commonjs/web3_config.d.ts:170
contractDataInputFill
• get
contractDataInputFill(): "data"
| "input"
| "both"
The contractDataInputFill
options property will allow you to set the hash of the method signature and encoded parameters to the property
either data
, input
or both within your contract.
This will affect the contracts send, call and estimateGas methods
Default is input
.
Returns
"data"
| "input"
| "both"
Inherited from
Web3Context.contractDataInputFill
Defined in
web3-core/lib/commonjs/web3_config.d.ts:67
• set
contractDataInputFill(val
): void
Will set the contractDataInputFill
Parameters
Name | Type |
---|---|
val | "data" | "input" | "both" |
Returns
void
Inherited from
Web3Context.contractDataInputFill
Defined in
web3-core/lib/commonjs/web3_config.d.ts:71
currentProvider
• get
currentProvider(): undefined
| Web3BaseProvider
<API
>
Will return the current provider. (The same as provider
)
Returns
undefined
| Web3BaseProvider
<API
>
Returns the current provider
Example
const web3Context = new Web3Context("http://localhost:8545");
console.log(web3Context.provider);
> HttpProvider {
clientUrl: 'http://localhost:8545',
httpProviderOptions: undefined
}
Inherited from
Web3Context.currentProvider
Defined in
web3-core/lib/commonjs/web3_context.d.ts:122
• set
currentProvider(provider
): void
Will set the current provider. (The same as provider
)
Parameters
Name | Type | Description |
---|---|---|
provider | undefined | string | SupportedProviders <API > | SupportedProviders The provider to set |
Returns
void
Example
const web3Context = new Web3Context("http://localhost:8545");
web3Context.currentProvider = "ws://localhost:8545";
console.log(web3Context.provider);
> WebSocketProvider {
_eventEmitter: EventEmitter {
_events: [Object: null prototype] {},
_eventsCount: 0,
...
}
Inherited from
Web3Context.currentProvider
Defined in
web3-core/lib/commonjs/web3_context.d.ts:141
defaultAccount
• get
defaultAccount(): undefined
| string
This default address is used as the default from
property, if no from
property is specified in for the following methods:
- web3.eth.sendTransaction()
- web3.eth.call()
- myContract.methods.myMethod().call()
- myContract.methods.myMethod().send()
Returns
undefined
| string
Inherited from
Web3Context.defaultAccount
Defined in
web3-core/lib/commonjs/web3_config.d.ts:79
• set
defaultAccount(val
): void
Will set the default account.
Parameters
Name | Type |
---|---|
val | undefined | string |
Returns
void
Inherited from
Web3Context.defaultAccount
Defined in
web3-core/lib/commonjs/web3_config.d.ts:83
defaultBlock
• get
defaultBlock(): BlockNumberOrTag
The default block is used for certain methods. You can override it by passing in the defaultBlock as last parameter. The default value is "latest"
.
- web3.eth.getBalance()
- web3.eth.getCode()
- web3.eth.getTransactionCount()
- web3.eth.getStorageAt()
- web3.eth.call()
- myContract.methods.myMethod().call()
Returns
BlockNumberOrTag
Inherited from
Web3Context.defaultBlock
Defined in
web3-core/lib/commonjs/web3_config.d.ts:93
• set
defaultBlock(val
): void
Will set the default block.
- A block number
"earliest"
- String: The genesis block"latest"
- String: The latest block (current head of the blockchain)"pending"
- String: The currently mined block (including pending transactions)"finalized"
- String: (For POS networks) The finalized block is one which has been accepted as canonical by greater than 2/3 of validators"safe"
- String: (For POS networks) The safe head block is one which under normal network conditions, is expected to be included in the canonical chain. Under normal network conditions the safe head and the actual tip of the chain will be equivalent (with safe head trailing only by a few seconds). Safe heads will be less likely to be reorged than the proof of work network`s latest blocks.
Parameters
Name | Type |
---|---|
val | BlockNumberOrTag |
Returns
void
Inherited from
Web3Context.defaultBlock
Defined in
web3-core/lib/commonjs/web3_config.d.ts:104
defaultCommon
• get
defaultCommon(): undefined
| Common
Will get the default common property The default common property does contain the following Common object:
customChain
-Object
: The custom chain propertiesname
-string
: (optional) The name of the chainnetworkId
-number
: Network ID of the custom chainchainId
-number
: Chain ID of the custom chain
baseChain
-string
: (optional) mainnet, goerli, kovan, rinkeby, or ropstenhardfork
-string
: (optional) chainstart, homestead, dao, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, istanbul, berlin, or london Default isundefined
.
Returns
undefined
| Common
Inherited from
Web3Context.defaultCommon