Contract Calls
Every call to a contract function, with its arguments already parsed from Clarity, from block 1.
$curl "$SECONDLAYER_API_URL/v1/index/contract-calls?contract_id=SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token&function_name=transfer&from_height=9340000&limit=1" \
-H "Authorization: Bearer sk-sl_…"
import { Index } from "@secondlayer/sdk";
const index = new Index();
const page = await index.contractCalls.list({
contractId: "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token",
functionName: "transfer",
fromHeight: 9340000,
limit: 1,
});
{
"contract_calls": [
{
"cursor": "9341326:0",
"block_height": 9341326,
"block_time": "2026-10-28T00:52:36.000Z",
"tx_id": "0x385726bb0fe44cac3c127096a28ddd3c5aba20e45e7bb7d09cbba15b9b579d9e",
"tx_index": 0,
"contract_id": "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token",
"function_name": "transfer",
"sender": "SP2X2S5J0DXXRBR786CVVT15SWZT9T6E5D5YYXXF1",
"status": "success",
"args": ["10514538", "SP2X2S5J0DXXRBR786CVVT15SWZT9T6E5D5YYXXF1", "SP1SYS7ZHE8Z05WGJYF7EHXCYCXSJY0FW75MT7M9Z", null],
"result": { "ok": true },
"result_hex": "0x0703"
}
],
"next_cursor": "9341326:0",
"tip": { "block_height": 9348931, "finalized_height": 9348069, "lag_seconds": 18 },
"reorgs": []
}
args holds the arguments in order, one entry per parameter, as plain JSON. Read the names from the contract's ABI: transfer takes the amount, sender, recipient, then an optional memo.
| Narrow by | Param |
|---|---|
| One function | functionName |
| Who called it | sender |
| Several contracts | contractId as a list (max 20) |
| Every contract of a standard | trait, instead of contractId |
| A block range | fromHeight, toHeight |
- There is no
statusfilter: failed calls come back too, so check each row'sstatus. - Only calls a transaction makes directly are listed. Calls between contracts are on Contract State.
- Reads run oldest first; there is no
orderparameter on this feed.
A read with no fromHeight or cursor covers only the last 17,280 blocks, and a busy function means many rows, so narrow by height before you page (Cursors and Pages). Every filter and the response schema: Decoded contract-call transactions.