{"slug":"api-duoleads-com-v1-chain-selector-4d63bf","title":"Compute the Keccak-256 hash of a Solidity function or event signature and derive","host":"api.duoleads.com","method":"GET","resource":"https://api.duoleads.com/v1/chain/selector","category":"code","description":"Compute the Keccak-256 hash of a Solidity function or event signature and derive the 4-byte function selector and the 32-byte event topic. Normalises the signature first — strips parameter names, expands uint to uint256 and the other aliases, flattens tuples — so a signature copied from source code ","price_listed":0.05,"price_asked":null,"state":"effects","state_label":"Not tested: has real-world effects","checks_7d":0,"answered_7d":0,"latency_ms_median":null,"reported_calls_30d":1,"reported_payers_30d":1,"networks":["eip155:8453"],"badge":"unverified","paid_checks_7d":0,"paid_ok_7d":0,"example_input":{"method":"GET","queryParams":{"signature":"transfer(address,uint256)"},"type":"http"},"output_schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","properties":{"input":{"additionalProperties":false,"properties":{"method":{"enum":["GET"],"type":"string"},"queryParams":{"properties":{"data":{"description":"Alternative to signature: raw data to Keccak-256 hash.","maxLength":8192,"type":"string"},"encoding":{"default":"utf8","description":"Encoding of data: utf8 (default) or hex.","enum":["utf8","hex"],"maxLength":64,"type":"string"},"kind":{"default":"function","description":"function (default), event or error.","enum":["function","event","error"],"maxLength":64,"type":"string"},"signature":{"description":"Solidity function, event or error signature, e.g. transfer(address to, uint amount).","maxLength":1024,"type":"string"}},"required":[],"type":"object"},"type":{"const":"http","type":"string"}},"required":["type","method"],"type":"object"},"output":{"properties":{"example":{"properties":{"data":{"type":"object"},"meta":{"properties":{"computed_at":{"type":"string"},"deterministic":{"type":"boolean"},"disclaimer":{"type":"string"},"price_usd":{"type":"string"},"request_id":{"type":"string"},"sources":{"type":"array"}},"required":["request_id","computed_at","price_usd","deterministic","disclaimer"],"type":"object"},"ok":{"const":true,"type":"boolean"},"route":{"type":"string"},"version":{"type":"string"}},"required":["ok","route","version","data","meta"],"type":"object"},"type":{"type":"string"}},"required":["type"],"type":"object"}},"required":["input"],"type":"object"},"history":[],"description_full":"Compute the Keccak-256 hash of a Solidity function or event signature and derive the 4-byte function selector and the 32-byte event topic. Normalises the signature first — strips parameter names, expands uint to uint256 and the other aliases, flattens tuples — so a signature copied from source code produces the same selector as the canonical form. Also hashes arbitrary text or hex bytes with Keccak-256.","last_updated":"2026-09-28T23:39:24.538Z","schemes":["exact"]}