Call
Call invokes an arbitrary, network-specific procedure call with network-specific parameters. The guidance for what this endpoint should or could do is purposely left vague. In Ethereum, this could be used to invoke eth_call
to implement an entire Ada-Index API interface for some smart contract that is not parsed by the implementation creator (like a DEX). This endpoint could also be used to provide access to data that does not map to any Ada-Index models instead of requiring an integrator to use some network-specific SDK and call some network-specific endpoint (like surfacing staking parameters). Call is NOT a replacement for implementing Ada-Index API endpoints or mapping network-specific data to Ada-Index models. Rather, it enables developers to build additional Ada-Index API interfaces for things they care about without introducing complexity into a base-level Ada-Index implementation. Simply put, imagine that the average integrator will use layered Ada-Index API implementations that each surfaces unique data.
CallRequest is the input to the /call
endpoint.
Method is some network-specific procedure call. This method could map to a network-specific RPC endpoint, a method in an SDK generated from a smart contract, or some hybrid of the two. The implementation must define all available methods in the Allow object. However, it is up to the caller to determine which parameters to provide when invoking /call
.
eth_call
Parameters is some network-specific argument for a method. It is up to the caller to determine which parameters to provide when invoking /call
.
{"block_number":23,"address":"0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"}
POST /call HTTP/1.1
Host: ada-index.nownodes.io
api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 291
{
"network_identifier": {
"blockchain": "cardano",
"network": "mainnet",
"sub_network_identifier": {
"network": "shard 1",
"metadata": {
"producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
}
}
},
"method": "eth_call",
"parameters": {
"block_number": 23,
"address": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
}
}
{
"result": {
"count": 1000
},
"idempotent": true
}