Use sendTransaction to route a signed raw transaction through the Sudont firewall. If the
transaction violates Constitution policy, a structured SudontError is thrown — never a generic
revert string.
Send EVM Transaction
import { SudontClient } from '@sudont/sdk';import { Wallet, parseUnits } from 'ethers';const client = new SudontClient('http://localhost:8545', 'evm');// Sign your transaction as usual with ethersconst wallet = new Wallet(process.env.PRIVATE_KEY!, client.provider);const signedTx = await wallet.signTransaction({ to: '0x...', data: '0x...', // Uniswap V3 exactInputSingle calldata value: 0n, gasLimit: 200_000n,});try { const tx = await client.sendTransaction(signedTx); console.log('Approved and broadcast:', tx.hash);} catch (err) { // SudontError contains machine-readable diagnosis console.error('Blocked by firewall:', err.message); console.error('Reason code:', err.data?.sudont?.reason_code); // e.g. "SUDONT_SLIPPAGE_EXCEEDED"}
Use simulateSolanaTransaction to send a native Solana VersionedTransaction through the SVM firewall path. The SDK serializes the transaction into the JSON-RPC payload expected by the Rust sidecar.
When a transaction triggers a medium-risk signal — an unlimited approval, an unverified spender,
or a non-allowlisted destination — Sudont returns an INTERROGATE response instead of a hard block.
Your agent must handle this to complete the ReAct loop.
The response includes actionable_feedback: a structured, machine-readable instruction telling
the agent exactly what correction is required.
The adversarial record is written regardless of outcome. Every interrogation — including
successful self-corrections — is logged with the original request, the challenge issued, and
the agent’s response. Auditors can reconstruct the full correction sequence from the event
stream without access to the code.