diff --git a/builders/ethereum/json-rpc/moonbeam-custom-api.md b/builders/ethereum/json-rpc/moonbeam-custom-api.md index 45c705b34..3b67cd7b1 100644 --- a/builders/ethereum/json-rpc/moonbeam-custom-api.md +++ b/builders/ethereum/json-rpc/moonbeam-custom-api.md @@ -7,7 +7,13 @@ description: Discover Moonbeam's specialized API endpoints, featuring custom JSO ## Introduction {: #introduction } -Moonbeam nodes include support for two custom JSON-RPC endpoints: `moon_isBlockFinalized` and `moon_isTxFinalized`. These endpoints provide valuable functionality for checking the finality of on-chain events. +Moonbeam nodes include support for custom JSON-RPC endpoints: + +- `moon_isBlockFinalized` +- `moon_isTxFinalized` +- `moon_getLatestSyncedBlock` + +These endpoints provide valuable functionality for checking the finality of on-chain events. To begin exploring Moonbeam's custom JSON-RPC endpoints, you can try out the provided curl examples below. These examples demonstrate how to query the public RPC endpoint of Moonbase Alpha. However, you can easily modify them to use with your own Moonbeam or Moonriver endpoint by changing the URL and API key. If you haven't already, you can obtain your endpoint and API key from one of our supported [Endpoint Providers](/builders/get-started/endpoints/){target=\_blank}. @@ -58,3 +64,30 @@ To begin exploring Moonbeam's custom JSON-RPC endpoints, you can try out the pro "params": ["INSERT_TRANSACTION_HASH"] }' {{ networks.moonbase.rpc_url }} ``` + +???+ function "moon_getLatestSyncedBlock" + + Returns the latest synced block number. + + === "Parameters" + + None + + === "Returns" + + Returns an integer: the latest synced block from Frontier's backend + + === "Example" + + ```bash + curl -H "Content-Type: application/json" -X POST --data '{ + "jsonrpc": "2.0", + "id": "1", + "method": "moon_getLatestSyncedBlock", + "params": [] + }' {{ networks.moonbase.rpc_url }} + ``` + + + + \ No newline at end of file