Skip to content

internet-court/internet-court-skill / vendored/okx/okx-agentic-wallet

okx-agentic-wallet

Unverified

OKX Agentic Wallet — the single skill for the user's wallet and on-chain execution. Use it whenever the user wants to operate their wallet or execute an on-chain action, including: login & accounts, balance / holdings, wallet address / deposit / receive, send / transfer, contract calls (approve / deposit / withdraw), transaction history & status, message signing, wallet export & policy; pay gas with a stablecoin (Gas Station, Solana); swap / trade / buy / sell / convert, get a quote; cross-chain bridge & track arrival; limit orders (buy dip / take profit / stop loss / buy above) plus cancel / list / resume them; broadcast / gas / simulate / track a transaction; look up any public address's holdings; security scanning (token / honeypot 蜜罐 / 貔貅, DApp phishing, tx & signature checks, approvals); audit log. Once matched, follow this skill's Intent Routing to dispatch to the exact action.

references/swap-troubleshooting.md

View on GitHub
# DEX Swap — Troubleshooting

Load on a swap failure or edge case. Items in the swap.md Risk Controls table (honeypot, price impact, tax, new tokens, insufficient liquidity, no quote) are not repeated here.

## Error Retry (after `swap execute` returns an error)

**Chain not support (`81104`) — evaluate FIRST, before every rule below.** On code `81104`: display the fixed reminder "⚠️ This chain does not currently support swap. Please try a different chain." and stop.

Otherwise, the error may be caused by a preceding approval tx not yet confirmed on-chain:

1. **Wait** by chain block time before retrying: Ethereum ~15s · BSC ~5s · Arbitrum / Base ~3s · XLayer ~3s · other EVM ~10s.
2. **Inform the user**, e.g. "Swap failed, possibly due to a pending approval — waiting for on-chain confirmation before retrying."
3. **Non-recoverable (82000, 51006)**: token is dead / rugged / no liquidity — retrying may not help. Do NOT retry after 5 consecutive errors for the same `(wallet, fromToken, toToken)`. Run `token advanced-info`; warn if `devRugPullTokenCount > 0` or `tokenTags` contains `lowLiquidity`.
4. **Risk warning (81362)**: backend flagged the broadcast as potentially dangerous (possible honeypot / poisoned contract). Do NOT auto-retry. Explicitly warn the user that forcing execution may cause fund loss; only if they confirm, re-run the **same** `swap execute` with `--force` (passes `skipWarning: true`). Never add `--force` without explicit confirmation.
5. **All other errors**: retry once; if it fails again, surface the error.

## Failure Diagnostics

When a swap fails (broadcast error, on-chain revert, or timeout), produce a diagnostic summary before reporting:

```
Diagnostic Summary:
  txHash:        <hash or "simulation failed">
  chain:         <chain name (chainIndex)>
  errorCode:     <API or on-chain error code>
  errorMessage:  <human-readable error>
  tokenPair:     <fromToken symbol> → <toToken symbol>
  amount:        <amount in UI units>
  slippage:      <value used, or "auto">
  mevProtection: <on|off>
  walletAddress: <address>
  timestamp:     <ISO 8601>
  cliVersion:    <onchainos --version>
```

## Edge Cases

- **Insufficient balance**: check balance first, show current balance, suggest adjusting the amount.
- **Network error**: retry once, then produce the diagnostic summary and prompt the user.
- **Region restriction (error code 50125 or 80001)**: do NOT show the raw code. Display: "⚠️ Service is not available in your region. Please switch to a supported region and try again."
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall