Evm_node_lib_dev.Websocket_clientClient to communicate with an EVM node over websockets
type Tezos_base.TzPervasives.error += | No_response of Rpc_encodings.JSONRPC.request| Request_failed of Rpc_encodings.JSONRPC.request * Rpc_encodings.JSONRPC.error| Cannot_destruct of Evm_node_lib_dev_encoding.Ethereum_types.Subscription.kind
* Evm_node_lib_dev_encoding.Ethereum_types.Subscription.id
* stringtype 'a subscription = {stream : 'a Lwt_stream.t;The stream of events.
*)unsubscribe : unit -> bool Tezos_base.TzPervasives.tzresult Lwt.t;A function to unsubscribe from events notifications.
*)}Subscriptions returned by subscribe.
type (_, _) call = | Call : (module Rpc_encodings.METHOD
with type input = 'input
and type output = 'output)
* 'input -> ('input, 'output) callWrapper type for calling a JSONRPC method with an input
val create :
?monitoring:monitoring ->
?keep_alive:bool ->
Tezos_rpc_http.Media_type.t ->
Uri.t ->
tcreate ?monitoring ?keep_alive media uri creates an EVM node websocket client to an EVM node websocket server on uri, communication is either JSON or binary depending on media. If monitoring is provided, the connection is monitored with the given parameters. If keep_alive is true (the default), requests will be retried (and the connection reestablished) if the connection is dropped.
val client_id : t -> intA uniquely identifying id for a websocket client.
val connect : t -> unit Tezos_base.TzPervasives.tzresult Lwt.tconnect client establishes the websocket connection with client. NOTE: the connection is established automatically when sending a request.
val disconnect : t -> unit Lwt.tDisconnect the websocket client by sending a close frame and closing the connection.
val send_jsonrpc_request :
t ->
?timeout:timeout ->
Rpc_encodings.JSONRPC.request ->
Rpc_encodings.JSONRPC.value Lwt.tSend a raw JSON RPC request on the websocket.
val send_jsonrpc :
t ->
?timeout:timeout ->
('input, 'output) call ->
'output Tezos_base.TzPervasives.tzresult Lwt.tsend_jsonrpc client (Call ((module Method), input)) makes a JSONRPC request with the provided Method and input to the websocket client. It returns the corresponding response.
val subscribe :
t ->
?timeout:timeout ->
Rpc_encodings.Subscribe.input ->
(Transaction_object.t, Evm_node_lib_dev_encoding.Transaction_receipt.t)
Evm_node_lib_dev_encoding.Ethereum_types.Subscription.output
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe client kind creates a subscription of kind with the websocket client. It returns a stream with the notifications and a function to unsubscribe.
val subscribe_newHeads :
?timeout:timeout ->
t ->
Transaction_object.t Evm_node_lib_dev_encoding.Ethereum_types.block
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe_newHeads client is like subscribe but specialized for newHeads events.
val subscribe_newHeadNumbers :
?timeout:timeout ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.quantity
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe_newHeadNumbers client is like subscribe_newHeads but only parses numbers in blocks.
val subscribe_newPendingTransactions :
?timeout:timeout ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.hash
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe_newPendingTransactions client is like subscribe but specialized for newPendingTransactions events.
val subscribe_syncing :
?timeout:timeout ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.Subscription.sync_output
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe_syncing client is like subscribe but specialized for syncing events.
val subscribe_logs :
?address:Evm_node_lib_dev_encoding.Ethereum_types.Filter.filter_address ->
?topics:Evm_node_lib_dev_encoding.Ethereum_types.Filter.topic option list ->
?timeout:timeout ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.transaction_log
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tsubscribe_logs ?address ?topics client is like subscribe but specialized for logs events filtered by address and/or topics.
val subscribe_l1_l2_levels :
?start_l1_level:int32 ->
?timeout:timeout ->
t ->
Evm_node_lib_dev_encoding.Ethereum_types.Subscription.l1_l2_levels_output
Tezos_base.TzPervasives.tzresult
subscription
Tezos_base.TzPervasives.tzresult
Lwt.tSubscribe to L1/L2 levels associations.