# Official wallet and operation recovery

Project explanations do not require wallet installation or login. For production operations, use one of these paths:

- **Wallet ready:** Continue if the official Skill and `baw` CLI are installed, the wallet is logged in with Developer Mode enabled, and it has an eligible Agent ID and enough BNB for fees and the intended operation.
- **Wallet setup needed:** Read the [official Binance Agentic Wallet Skill](https://github.com/binance/binance-skills-hub/blob/main/skills/binance-web3/binance-agentic-wallet/SKILL.md). Follow its current instructions for CLI installation, login and Developer Mode. Ensure the wallet has an eligible Agent ID and BNB for fees and the intended operation, then return to AgenticPad. Install the [complete official Skill directory](https://github.com/binance/binance-skills-hub/tree/main/skills/binance-web3/binance-agentic-wallet) with its references. Downloading only `SKILL.md` omits required supporting instructions.

Production signing uses official `baw contract-call preview` / `execute` through the kit adapter. Follow existing user authorization and the official Skill's preview review and signing requirements. The kit does not log in or alter wallet policy. Its configured address, if present, must match the official connected wallet. Keep credentials in the wallet; never request a private key.

The operation JSON and wallet journal (default `.agenticpad/baw-state.json`, relative to the working directory) are both needed for recovery. Set `wallet.stateFile` to a stable absolute path in your deployment config when switching directories. Do not edit prepared transaction payloads or remove submission records.

| Step state | Action |
| --- | --- |
| `prepared` | Review the saved wallet preview; execute under user authorization. |
| `submitted` | A hash exists; run status for its RPC receipt. |
| `pending` | Check the same App order. If it has no hash, obtain that order's hash and resolve it. |
| `unknown` | The request may have reached the wallet. Inspect the same App order/journal; do not resubmit. |
| `confirmed` | Receipt succeeded; let the kit parse events and continue to the next step. |
| `rejected`, `expired`, `reverted` | Inspect the stated reason and prior confirmed steps before preparing the remaining action. An expired preview alone does not cancel an existing App order. |

An App confirmation response can contain `orderId` with `txHash:null`. The currently integrated official CLI has no `contract-call result` command. `sign-message result` and aggregate market orders do not resolve this contract-call order. Wallet transaction history does not link its transactions to this order ID. Do not infer a match from time or asset changes.

After the user supplies the hash from that App order:

```sh
node bin/agenticpad.cjs resolve --config /absolute/deployment.json --operation /absolute/action.operation.json --hash 0xACTUAL_TRANSACTION_HASH
node bin/agenticpad.cjs status --config /absolute/deployment.json --operation /absolute/action.operation.json
```

The adapter checks chain, sender, destination, calldata, value, nonce lower bound, and submission block. If the hash is not yet visible to RPC, retry resolve with the **same hash** later. Timeout, unlock prompts, or elapsed time do not establish rejection. Keep pending/unknown state until there is evidence from the same order.

Do not run two processes on the same operation. A crashed process may leave `OPERATION.lock` or a wallet execute lock. Check the operation, wallet journal, and App order before removing a stale lock. Removing a lock does not authorize a fresh submission.

Local signing uses `mode:"local"`, `wallet.type:"local"`, a loopback RPC, and a named test-only key environment variable. It validates package behavior; it is separate from real baw/App confirmation acceptance.

Public BSC testnet signing uses `mode:"testnet"`, `chainId:97`, `wallet.type:"testnet"` and a dedicated `AGENT_KIT_TESTNET_*` key environment variable. It supports remote testnet RPCs and checks the live chain ID before signing. It saves the hash and returns immediately; continue with status on the same operation. See [testnet setup](../../../docs/TESTNET.md).
