API Overview
Both the Python and TypeScript SDKs expose the same five methods. Python usessnake_case, TypeScript uses camelCase.
Methods
| Method | Python | TypeScript | Returns |
|---|---|---|---|
| Emit event | tp.emit(event_type, actor_id, ...) | tp.emit({ eventType, actorId, ... }) | TrailEvent |
| Query events | tp.query(event_type, actor_id, ...) | tp.query({ eventType, actorId, ... }) | QueryResult |
| Verify chain | tp.verify() | tp.verify() | VerifyResult |
| Get by trace | tp.get_trace(trace_id) | tp.getTrace(traceId) | TrailEvent[] |
| Flush to disk | tp.flush() | tp.flush() | void |
SDK Parity
Both SDKs are functionally identical:- Same canonical JSON algorithm
- Same SHA-256 hash chain
- Same genesis hash (
"0" x 64) - Same HMAC-SHA256 signing
- Same error types
- Same store interface
- Shared test vectors ensure byte-for-byte hash parity
The only differences between SDKs are language conventions:
snake_case vs camelCase for method and field names, keyword arguments vs options objects for parameters.