ABI fragments
Each constant is a viem ABI (parseAbi), for readContract, encodeFunctionData and decodeEventLog.
These fragments hold only what the SDK uses. For the full interface of each contract, see the contracts.
DSL registry
buildDslCommitCalldata
AnafiDslRegistry.commitDsl(commitment, validUntil, engineSig, adapter). Every account kind sends this same call; only the way it reaches the registry differs. Take commitment, engineSig, attestationValidUntilUnixSeconds and adapter from a staged value. The selector is 0x385971b5.
Stage payload
dslStagePayload is the plaintext that the stage seals under dslSealInfo(network, account). The first byte 0x02 tags a frame that names its parent. A null parent is version 0 and the zero hash. The adapter and the parent are framing only: the commitment stays keccak256(salt ‖ yaml). It throws for an invalid adapter, a negative or unsafe parent version, and a parent hash or salt that is not 32 bytes.
assertBytes32Hex throws unless value is a string of exactly 0x and 64 hex characters. It checks the text before any decode, so a 63-digit value cannot pass as 32 bytes.
Safe
Constants
SafeTransaction and SafeBatchLeg
Address prediction
proxyCreationCode is the answer of SafeProxyFactory.proxyCreationCode(). Read it from the chain; anafi.predictSafe(owner) does this for you. The deploy call is createProxyWithNonce(singleton, safeSetupInitializer(...), safeSaltNonce(owner)).
Transactions and legs
With
safeTxGas and gasPrice at 0, a failed inner call reverts the whole Safe transaction.
Typed data, digest and signatures
ERC20Allow calldata
The account sends each one as a plain transaction with no value.
ERC-20 transfer
transfer(to, amount). Send it to the token from the payer.
Gas credit
readGasCredit and buildClaimGasCreditCalldata are on activity and fees.
Relayed receipts
waitForRelayedTransaction(publicClient, txHash) is on Safe account.