examples/headless-close.ts is the reference implementation for an integration. It closes a throwaway testnet account end to end with no browser or web UI.
It funds two accounts through Friendbot, adds a data entry, then runs getAccount, closePlan, closeTransactions, and submit through runClose, signing with an in-process keypair.
The part to copy
Before signing, the example decodes every transaction and checks it against its own inputs inexamples/verify.ts. It rejects any operation it does not recognize. This is the pattern to follow. See Verification.
The example’s verifier covers only what a simple account needs: data entries, empty trustlines, and open offers. A production integration needs a wider check.
Run it
Create an API key at lumenwipe.com, then, from the repository root:LUMENWIPE_API_URL overrides the default https://api.lumenwipe.com. The example runs on testnet only.