Readonly
onReadonly
removeReadonly
waitHelper to promisify waiting for an emitted event
event name
timeout in milliseconds
Handles a JSON-RPC request
JSON-RPC request payload
A promise with a response
RpcError with error codes defined in RpcErrorCode and ProviderRpcErrorCode
Returns the current status of the provider.
'connected' if the provider is connected, 'connecting' if trying to connect, 'disconnected' otherwise.
Web3 provider that implements EIP-1193.
The provider automatically connects to Fordefi when a new instance is constructed, and emits a
connect
event once bothchainId
andaddress
were verified: chain is supported and address is managed by the given API user.on('eventName', callbackFn)
.waitForEmittedEvent('eventName')
.NOTICE: Make sure to subscribe to 'connect' immediately after creating a new instance, and before initiating any other async operations, to avoid a race condition where the event is emitted before the listener is attached.
For example:
Emitted events:
connect
- provider becomes connected.disconnect
- provider becomes disconnected.chainChanged
- emitted once during connection with thechainId
you provided.accountsChanged
- emitted once during connection with theaddress
you provided.Interfaces of each event callback are described in EIP1193EventCallbackParams and EIP1193EventMap.