Skip to content

JsonRpcSchemaWallet

JsonRpcSchemaWallet: object

Type declaration

eth_accounts

eth_accounts: object

Description

Returns a list of addresses owned by this client

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_accounts' })
// => ['0x0fB69...']

eth_accounts.Method

eth_accounts.Method: "eth_accounts"

eth_accounts.Parameters?

optional eth_accounts.Parameters: undefined

eth_accounts.ReturnType

eth_accounts.ReturnType: Address[]

eth_chainId

eth_chainId: object

Description

Returns the current chain ID associated with the wallet.

Example

provider.request({ method: 'eth_chainId' })
// => '1'

eth_chainId.Method

eth_chainId.Method: "eth_chainId"

eth_chainId.Parameters?

optional eth_chainId.Parameters: undefined

eth_chainId.ReturnType

eth_chainId.ReturnType: Quantity

eth_estimateGas

eth_estimateGas: object

Description

Estimates the gas necessary to complete a transaction without submitting it to the network

Example

provider.request({
method: 'eth_estimateGas',
params: [{ from: '0x...', to: '0x...', value: '0x...' }]
})
// => '0x5208'

eth_estimateGas.Method

eth_estimateGas.Method: "eth_estimateGas"

eth_estimateGas.Parameters

eth_estimateGas.Parameters: [TransactionRequest] | [TransactionRequest, BlockNumber | BlockTag]

eth_estimateGas.ReturnType

eth_estimateGas.ReturnType: Quantity

eth_requestAccounts

eth_requestAccounts: object

Description

Requests that the user provides an Ethereum address to be identified by. Typically causes a browser extension popup to appear.

https://eips.ethereum.org/EIPS/eip-1102

Example

provider.request({ method: 'eth_requestAccounts' }] })
// => ['0x...', '0x...']

eth_requestAccounts.Method

eth_requestAccounts.Method: "eth_requestAccounts"

eth_requestAccounts.Parameters?

optional eth_requestAccounts.Parameters: undefined

eth_requestAccounts.ReturnType

eth_requestAccounts.ReturnType: Address[]

eth_sendRawTransaction

eth_sendRawTransaction: object

Description

Sends and already-signed transaction to the network

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_sendRawTransaction', params: ['0x...'] })
// => '0x...'

eth_sendRawTransaction.Method

eth_sendRawTransaction.Method: "eth_sendRawTransaction"

eth_sendRawTransaction.Parameters

eth_sendRawTransaction.Parameters: [Hex]

eth_sendRawTransaction.ReturnType

eth_sendRawTransaction.ReturnType: Hash

eth_sendTransaction

eth_sendTransaction: object

Description

Creates, signs, and sends a new transaction to the network

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_sendTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
// => '0x...'

eth_sendTransaction.Method

eth_sendTransaction.Method: "eth_sendTransaction"

eth_sendTransaction.Parameters

eth_sendTransaction.Parameters: [TransactionRequest]

eth_sendTransaction.ReturnType

eth_sendTransaction.ReturnType: Hash

eth_sign

eth_sign: object

Description

Calculates an Ethereum-specific signature in the form of keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_sign', params: ['0x...', '0x...'] })
// => '0x...'

eth_sign.Method

eth_sign.Method: "eth_sign"

eth_sign.Parameters

eth_sign.Parameters: [Address, Hex]

eth_sign.ReturnType

eth_sign.ReturnType: Hex

eth_signTransaction

eth_signTransaction: object

Description

Signs a transaction that can be submitted to the network at a later time using with eth_sendRawTransaction

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_signTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
// => '0x...'

eth_signTransaction.Method

eth_signTransaction.Method: "eth_signTransaction"

eth_signTransaction.Parameters

eth_signTransaction.Parameters: [TransactionRequest]

eth_signTransaction.ReturnType

eth_signTransaction.ReturnType: Hex

eth_signTypedData_v4

eth_signTypedData_v4: object

Description

Calculates an Ethereum-specific signature in the form of keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_signTypedData_v4', params: [{ from: '0x...', data: [{ type: 'string', name: 'message', value: 'hello world' }] }] })
// => '0x...'

eth_signTypedData_v4.Method

eth_signTypedData_v4.Method: "eth_signTypedData_v4"

eth_signTypedData_v4.Parameters

eth_signTypedData_v4.Parameters: [Address, string]

eth_signTypedData_v4.ReturnType

eth_signTypedData_v4.ReturnType: Hex

eth_syncing

eth_syncing: object

Description

Returns information about the status of this client’s network synchronization

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'eth_syncing' })
// => { startingBlock: '0x...', currentBlock: '0x...', highestBlock: '0x...' }

eth_syncing.Method

eth_syncing.Method: "eth_syncing"

eth_syncing.Parameters?

optional eth_syncing.Parameters: undefined

eth_syncing.ReturnType

eth_syncing.ReturnType: NetworkSync | false

personal_sign

personal_sign: object

Description

Calculates an Ethereum-specific signature in the form of keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))

https://eips.ethereum.org/EIPS/eip-1474

Example

provider.request({ method: 'personal_sign', params: ['0x...', '0x...'] })
// => '0x...'

personal_sign.Method

personal_sign.Method: "personal_sign"

personal_sign.Parameters

personal_sign.Parameters: [Hex, Address]

personal_sign.ReturnType

personal_sign.ReturnType: Hex

wallet_addEthereumChain

wallet_addEthereumChain: object

Description

Add an Ethereum chain to the wallet.

https://eips.ethereum.org/EIPS/eip-3085

Example

provider.request({ method: 'wallet_addEthereumChain', params: [{ chainId: 1, rpcUrl: 'https://mainnet.infura.io/v3/...' }] })
// => { ... }

wallet_addEthereumChain.Method

wallet_addEthereumChain.Method: "wallet_addEthereumChain"

wallet_addEthereumChain.Parameters

wallet_addEthereumChain.Parameters: [AddEthereumChainParameter]

wallet_addEthereumChain.ReturnType

wallet_addEthereumChain.ReturnType: null

wallet_getPermissions

wallet_getPermissions: object

Description

Gets the wallets current permissions.

https://eips.ethereum.org/EIPS/eip-2255

Example

provider.request({ method: 'wallet_getPermissions' })
// => { ... }

wallet_getPermissions.Method

wallet_getPermissions.Method: "wallet_getPermissions"

wallet_getPermissions.Parameters?

optional wallet_getPermissions.Parameters: undefined

wallet_getPermissions.ReturnType

wallet_getPermissions.ReturnType: WalletPermission[]

wallet_requestPermissions

wallet_requestPermissions: object

Description

Requests the given permissions from the user.

https://eips.ethereum.org/EIPS/eip-2255

Example

provider.request({ method: 'wallet_requestPermissions', params: [{ eth_accounts: {} }] })
// => { ... }

wallet_requestPermissions.Method

wallet_requestPermissions.Method: "wallet_requestPermissions"

wallet_requestPermissions.Parameters

wallet_requestPermissions.Parameters: [object]

wallet_requestPermissions.ReturnType

wallet_requestPermissions.ReturnType: WalletPermission[]

wallet_switchEthereumChain

wallet_switchEthereumChain: object

Description

Switch the wallet to the given Ethereum chain.

https://eips.ethereum.org/EIPS/eip-3326

Example

provider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xf00' }] })
// => { ... }

wallet_switchEthereumChain.Method

wallet_switchEthereumChain.Method: "wallet_switchEthereumChain"

wallet_switchEthereumChain.Parameters

wallet_switchEthereumChain.Parameters: [object]

wallet_switchEthereumChain.ReturnType

wallet_switchEthereumChain.ReturnType: null

wallet_watchAsset

wallet_watchAsset: object

Description

Requests that the user tracks the token in their wallet. Returns a boolean indicating if the token was successfully added.

https://eips.ethereum.org/EIPS/eip-747

Example

provider.request({ method: 'wallet_watchAsset' }] })
// => true

wallet_watchAsset.Method

wallet_watchAsset.Method: "wallet_watchAsset"

wallet_watchAsset.Parameters

wallet_watchAsset.Parameters: WatchAssetParams

wallet_watchAsset.ReturnType

wallet_watchAsset.ReturnType: boolean

Defined in

eip1193/JsonRpcSchemaWallet.ts:14