Implement Clear Signing with ERC-7730 descriptor maps
mainMicro-eth-signer supports Clear Signing via ERC-7730 descriptor maps. These maps allow raw transaction data to be decoded into human-readable 'intents'.
Descriptor Map Options
CLEARSIG_REPO: The base repository containing generic ERC interfaces, curated contracts (Uniswap, etc.), and a built-in token registry.addTokens(repo, tokens): Extends a repository with custom token metadata (address, symbol, decimals). This also automatically binds ERC-2612 permit interfaces to those tokens.CLEARSIG_REPO_FULL: A large (approx. 500KB) repository containing every descriptor from the upstream registry. Import this via the specific subpathmicro-eth-signer/clearsig/repo-full.jsonly when needed.
import { CLEARSIG_REPO, addTokens } from 'micro-eth-signer/abi.js';
import { CLEARSIG_REPO_FULL } from 'micro-eth-signer/clearsig/repo-full.js';
const base = CLEARSIG_REPO;
const mine = addTokens(CLEARSIG_REPO, {
'0x00000000000000000000000000000000000000123': {
abi: 'ERC20',
symbol: 'MTK',
decimals: 18,
},
});
const full = { ...CLEARSIG_REPO, ...CLEARSIG_REPO_FULL };