Fee Estimator Streaming
Using this method, you can enable the fee estimation stream. For requesting fee estimates without streaming, use get_eth_estimated_fee_per_gas.
Parameter* = required | Type | Description |
---|---|---|
client_id* | integer | This ID can be used to access data (e.g. via http://localhost:7783/event-stream?id=1) |
coin* | string | The coin or token to enable the fee estimation stream for. |
Parameter* = required | Type | Description |
---|---|---|
streamer_id | string | Optional. An identifier for the data stream. This can be used later to disable streaming for the event with stream::disable. |
fee_estimator_enable
{
"userpass": "RPC_UserP@SSW0RD",
"method": "stream::fee_estimator::enable",
"mmrpc": "2.0",
"params": {
"client_id": 1,
"coin": "MATIC",
"config": {
"estimate_every": 33.4,
"estimator_type": "Provider"
}
}
}
Here is an example of the stream data you should be able to see in http://localhost:7783/event-stream?id=1 at each estimate interval:
data: {"_type":"FEE_ESTIMATION:MATIC","message":{"base_fee":"0.000000281","low":{"max_priority_fee_per_gas":"30","max_fee_per_gas":"30.000000309","min_wait_time":null,"max_wait_time":null},"medium":{"max_priority_fee_per_gas":"32.633147189","max_fee_per_gas":"32.633147519","min_wait_time":null,"max_wait_time":null},"high":{"max_priority_fee_per_gas":"38.9999999","max_fee_per_gas":"39.000000251","min_wait_time":null,"max_wait_time":null},"source":"simple","base_fee_trend":"","priority_fee_trend":"","units":"Gwei"}}
Parameter* = required | Type | Description |
---|---|---|
ClientAlreadyListening | string | Optional. The requested events are already being sent to the client_id |
CoinNotFound | string | Optional. The specified coin was not found or is not activated yet |
CoinNotSupported | string | Optional. Currently only EVM coins/tokens support fee estimation |
InvalidRequest | string | Optional. Error parsing request or invalid configuration parameters |
UnknownClient | string | Optional. No client has an open connection using this client_id |