fee_estimator_enable
Using this method, you can enable the fee estimation stream. For requesting fee estimates without streaming, use get_eth_estimated_fee_per_gas.
Parameter | 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. |
{
"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"}}