AptosAptos Network's breakthrough technology and seamless user experience are now available on QuickNode.
Start building today!Like all of the Index API methods, the index.getLastAccepted method is available across the Avalanche C-Chain, X-Chain, and P-Chain. Refer to the following list of endpoints for each chain that this method can be used on.
For more information, see the Index API homepage.
The API credit value for this method is 1 . To learn more about API credits and each method's value, visit the API Credits page.
Parameters:
Returns:
Code Examples:
The following examples are calling the index.getLastAccepted method on the X-Chain Transactions endpoint: /ext/index/X/tx. To call this method on Avalanche’s other endpoints, replace the /ext/index/X/tx with any of the above listed endpoints in your code.
from web3 import Web3, HTTPProvider w3 = Web3(HTTPProvider('http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/index/X/tx')) params = { "encoding":"hex" } request = w3.provider.make_request('index.getLastAccepted', [params]) print(request)
const ethers = require("ethers"); (async () => { const provider = new ethers.providers.JsonRpcProvider( "http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/index/X/tx" ); const params = { "encoding": "hex", }; const result = await provider.send("index.getLastAccepted", params); console.log(result); })();
curl --location --request POST http://sample-endpoint-name.network.quiknode.pro/token-goes-here/ext/index/X/tx \ --data-raw '{ "jsonrpc":"2.0", "id" :1, "method" :"index.getLastAccepted", "params": { "encoding":"hex" } }'