An alternative path for adding F3 awareness is to adopt /v2 APIs. See đź”§ Migration from V1 to V2 APIs and you can get a high-level overview of the differences between /v1 and /v2 at Introduction.
The V2 APIs introduce three key finality tags that automatically leverage F3:
"finalized" - Returns the most recent F3-finalized tipset (typically 3-5 minutes old), assuming F3-finalization isn’t behind EC. See Understanding finalized TipSets for more info."safe" - Balances recency with stability (max 200 epochs behind latest). Assuming F3 isn’t stalled thought, then this effectively returns “finalized”. See Understanding safe TipSets for more info."latest" - Returns the most recent tipset (lowest finality guarantee)Get the latest finalized tipset:
{
"jsonrpc": "2.0",
"method": "Filecoin.ChainGetTipSet",
"params": [
{
"tag": "finalized"
}
],
"id": 1
}
Get a safe tipset (balanced approach):
{
"jsonrpc": "2.0",
"method": "Filecoin.ChainGetTipSet",
"params": [
{
"tag": "safe"
}
],
"id": 1
}
Check balance at finalized state:
{
"jsonrpc": "2.0",
"method": "Filecoin.StateGetActor",
"params": [
"f1your-address-here",
{
"tag": "finalized"
}
],
"id": 1
}
Same as /v1 : 2. Ethereum APIs with F3 Awareness
Same as /v1 : Recommended Patterns for Exchanges
Filecoin.ChainGetTipSet instead of ChainGetFinalizedTipSet.