Universal blockchain ABI decoder — production-grade EVM event & call decoding
Project description
chaincodec (Python)
Universal blockchain ABI decoder — production-grade EVM event log and function call decoding, with 50+ built-in DeFi/NFT/bridge protocol schemas.
Install
pip install chaincodec
Prebuilt wheels for Linux (x64, arm64, musl), macOS (x64, arm64), and Windows (x64). No Rust toolchain required.
Quick Start
import asyncio
from chaincodec import EvmDecoder, MemoryRegistry
async def main():
# Load a schema
registry = MemoryRegistry()
registry.load_file("schemas/erc20.csdl")
decoder = EvmDecoder()
# Decode an ERC-20 Transfer event
raw_log = {
"address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"topics": [
"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
"0x000000000000000000000000d8da6bf26964af9d7eed9e03e53415d37aa96045",
"0x000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b",
],
"data": "0x000000000000000000000000000000000000000000000000000000003b9aca00",
}
fingerprint = "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"
schema = registry.get_by_fingerprint(fingerprint)
event = decoder.decode_event(raw_log, schema)
print(event)
# DecodedEvent(schema="ERC20Transfer", fields={"from": "0xd8dA...", "to": "0xAb58...", "value": 1000000000})
asyncio.run(main())
Decode Function Calls
from chaincodec import EvmCallDecoder, MemoryRegistry
registry = MemoryRegistry()
registry.load_file("schemas/uniswap-v3.csdl")
decoder = EvmCallDecoder()
call_data = bytes.fromhex("414bf389...") # exactInputSingle calldata
result = decoder.decode_call(call_data, registry)
print(result.function_name) # "exactInputSingle"
print(result.inputs) # [("tokenIn", "0x..."), ("amountIn", 1000000)]
Encode Function Calls
from chaincodec import EvmEncoder, MemoryRegistry
registry = MemoryRegistry()
registry.load_file("schemas/erc20.csdl")
encoder = EvmEncoder()
calldata = encoder.encode_call("transfer", ["0xRecipient...", 1_000_000], registry)
# b'\xa9\x05\x9c\xbb...'
Batch Decode
from chaincodec import EvmDecoder, MemoryRegistry
registry = MemoryRegistry()
registry.load_directory("schemas/") # loads all 50+ schemas
decoder = EvmDecoder()
events = decoder.decode_batch(raw_logs, registry)
# Parallel decode via Rayon — >1M events/sec
Built-in Schemas (53 protocols)
| Category | Protocols |
|---|---|
| Tokens | ERC-20, ERC-721, ERC-1155, WETH, ERC-4626, ENS, ERC-4337 |
| DEX | Uniswap V2/V3, SushiSwap, Curve, Balancer V2, Camelot, DODO, Bancor V3 |
| Lending | Aave V2/V3, Compound V2/V3, Morpho Blue, Spark |
| Derivatives | GMX, GMX V1, dYdX V4, Perpetual Protocol, Synthetix V3, Ribbon Finance |
| LSD/Staking | Lido, Rocket Pool, Frax Ether, Stader, EigenLayer, Convex, Yearn |
| Bridges | Wormhole, LayerZero V2, Hop, Celer, Stargate, Across |
| NFT | OpenSea, Blur, CryptoPunks, BAYC, LooksRare |
| Governance | Safe Multisig, Compound Governance |
| Oracle | Chainlink (Aggregator, VRF, CCIP) |
| Other | Pendle Finance, Maker DAO |
Links
- GitHub: https://github.com/DarshanKumar89/chainkit
- Rust crates: https://crates.io/crates/chaincodec-core
- npm (Node.js): https://www.npmjs.com/package/@chainfoundry/chaincodec
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 566.0 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
31a55a89f9afa954783e618f5cbc607915ed0da6a202a6c6f1dcbcd22064989e
|
|
| MD5 |
2d49aeaabb7b820b29e3f4ad03949d03
|
|
| BLAKE2b-256 |
17328c9950065cb4146496a6193a94bde4e96326af003a58b4988e6bd5515f85
|
Provenance
The following attestation bundles were made for chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl:
Publisher:
publish.yml on DarshanKumar89/chainkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chainfoundry_chaincodec-0.2.0-cp311-cp311-win_amd64.whl -
Subject digest:
31a55a89f9afa954783e618f5cbc607915ed0da6a202a6c6f1dcbcd22064989e - Sigstore transparency entry: 1060560686
- Sigstore integration time:
-
Permalink:
DarshanKumar89/chainkit@74ad734886840a2fe11aa19b69fed950744023b3 -
Branch / Tag:
refs/tags/chaincodec-v0.2.0 - Owner: https://github.com/DarshanKumar89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74ad734886840a2fe11aa19b69fed950744023b3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 654.9 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f21f9d77414cdc91e98da39e0945deccf94a9630141b670dbaad812ea8420e85
|
|
| MD5 |
3ef1e338a8c44c24bb327085dfeea223
|
|
| BLAKE2b-256 |
35c6dde7d23ad9cbcb861a1567b80f39b9e52368871ab48667427c2dbf48f788
|
Provenance
The following attestation bundles were made for chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl:
Publisher:
publish.yml on DarshanKumar89/chainkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_11_0_arm64.whl -
Subject digest:
f21f9d77414cdc91e98da39e0945deccf94a9630141b670dbaad812ea8420e85 - Sigstore transparency entry: 1060560854
- Sigstore integration time:
-
Permalink:
DarshanKumar89/chainkit@74ad734886840a2fe11aa19b69fed950744023b3 -
Branch / Tag:
refs/tags/chaincodec-v0.2.0 - Owner: https://github.com/DarshanKumar89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74ad734886840a2fe11aa19b69fed950744023b3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl.
File metadata
- Download URL: chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl
- Upload date:
- Size: 669.2 kB
- Tags: CPython 3.11, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad12044335f675b28ec8c4a57d8c35472afac9de4b019bf695230e0c5db4552d
|
|
| MD5 |
0f727832f45f942a2648067654f8d125
|
|
| BLAKE2b-256 |
55e581cb89e16e647b7ff8fa9f433380246c50617b53ca013f54453d03e1c43c
|
Provenance
The following attestation bundles were made for chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on DarshanKumar89/chainkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chainfoundry_chaincodec-0.2.0-cp311-cp311-macosx_10_12_x86_64.whl -
Subject digest:
ad12044335f675b28ec8c4a57d8c35472afac9de4b019bf695230e0c5db4552d - Sigstore transparency entry: 1060560772
- Sigstore integration time:
-
Permalink:
DarshanKumar89/chainkit@74ad734886840a2fe11aa19b69fed950744023b3 -
Branch / Tag:
refs/tags/chaincodec-v0.2.0 - Owner: https://github.com/DarshanKumar89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74ad734886840a2fe11aa19b69fed950744023b3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 752.9 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd64a26ff63329d5388a26614f1363b35e4ed46f22fa7ff059736e1342fbf94
|
|
| MD5 |
259046e8bf8658f401fcbeaab887552d
|
|
| BLAKE2b-256 |
0ca9839292fc2cbfa7877fbedb003cc8816ca2f056483e664d8b138be4ab9b4b
|
Provenance
The following attestation bundles were made for chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on DarshanKumar89/chainkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
1bd64a26ff63329d5388a26614f1363b35e4ed46f22fa7ff059736e1342fbf94 - Sigstore transparency entry: 1060560820
- Sigstore integration time:
-
Permalink:
DarshanKumar89/chainkit@74ad734886840a2fe11aa19b69fed950744023b3 -
Branch / Tag:
refs/tags/chaincodec-v0.2.0 - Owner: https://github.com/DarshanKumar89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74ad734886840a2fe11aa19b69fed950744023b3 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 727.3 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13db8faae31d9275ae4f9178c151e7bff205b627af31d65407fa90109e6d3efc
|
|
| MD5 |
a989cd8b29525d3ef159288323818ce2
|
|
| BLAKE2b-256 |
597f5801c1ee9ffbcd85907d8848b40ef14b9f4fd0aa0be257bc26ce43155f6e
|
Provenance
The following attestation bundles were made for chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on DarshanKumar89/chainkit
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chainfoundry_chaincodec-0.2.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
13db8faae31d9275ae4f9178c151e7bff205b627af31d65407fa90109e6d3efc - Sigstore transparency entry: 1060560730
- Sigstore integration time:
-
Permalink:
DarshanKumar89/chainkit@74ad734886840a2fe11aa19b69fed950744023b3 -
Branch / Tag:
refs/tags/chaincodec-v0.2.0 - Owner: https://github.com/DarshanKumar89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@74ad734886840a2fe11aa19b69fed950744023b3 -
Trigger Event:
workflow_dispatch
-
Statement type: