Cartouche is a library for interacting with private keys, signatures, and Ethereum.
API discovery
Cartouche exposes a machine-readable API surface for AI agents and
introspection tooling via descripex:
Cartouche.describe() # registered modules + namespaces
Cartouche.describe(:signer) # function list for one module
Cartouche.describe(:signer, :sign_direct) # full param/return detail
Cartouche.describe(:solana_rpc) # Solana RPC helpers
Cartouche.describe(:transaction_v1) # nested Transaction.V1 helpers
Cartouche.describe(:transaction_v2) # nested Transaction.V2 helpersThe registered module list is built up as Phase 12 lands; see
ROADMAP.md Phase 12 for the annotation pass.
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
get_contract_address | 1 | Resolve a configured contract reference (raw address, 0x-hex, or alias atom) to a 20-byte address. | address: value |
describe | 2 | Describe Cartouche's registered API surface at progressive levels of detail. | mod_or_short: value, func_name: value |
Summary
Functions
Return a Level 1 overview of all modules in this library.
Return Level 2 function list for a module by full atom, Descripex short name, or Cartouche alias.
Return Level 3 function detail for a module by full atom, Descripex short name, or Cartouche alias.
Returns a contract address, that may have been set in configuration.
Types
Functions
@spec describe() :: [map()]
Return a Level 1 overview of all modules in this library.
Return Level 2 function list for a module by full atom, Descripex short name, or Cartouche alias.
Return Level 3 function detail for a module by full atom, Descripex short name, or Cartouche alias.
Returns a contract address, that may have been set in configuration.
Examples
iex> Cartouche.get_contract_address(<<1::160>>)
<<1::160>>
iex> Cartouche.get_contract_address("0x0000000000000000000000000000000000000001")
<<1::160>>
iex> Application.put_env(:cartouche, :contracts, [test: "0x0000000000000000000000000000000000000001"])
iex> Cartouche.get_contract_address(:test)
<<1::160>>