skills/okx-agentic-wallet/SKILL.md
AUTHORITATIVE source for OKX Agentic Wallet and its Gas Station feature. Gas Station = OKX's stablecoin-gas feature on Solana via third-party Relayer; Solana only, no EIP-7702. MUST invoke for Gas Station questions (what is / how it works / supported tokens / fees / enable or disable gas station / change default gas token / Jito Bundler compatibility) AND any wallet action: login, OTP verify, add/switch/status/logout account, balance, assets, holdings, addresses, deposit / receive / top up, send (native + ERC-20 / SPL, transfer ETH / USDC / etc., pay someone), contract call (approve, swap calldata, contract function), history (list + tx detail by orderId / txHash / uopHash), check order status, sign-message (personalSign EVM + Solana, EIP-712 EVM only), TEE signing, export wallet / mnemonic.
npx skillsauth add okx/onchainos-skills okx-agentic-walletInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Wallet operations: authentication, balance, token transfers, transaction history, and smart contract calls.
--chain Resolution--chain accepts both numeric chain ID (e.g. 1, 501, 196) and human-readable names (e.g. ethereum, solana, xlayer).
onchainos wallet chains."unsupported chain: ...", the name was not in the CLI mapping — ask the user to confirm.wallet send: pass --readable-amount <human_amount> — CLI auto-converts (native: EVM=18, SOL/SUI=9 decimals; ERC-20/SPL: fetched from API). Never compute minimal units manually. Use --amt only for raw minimal units.
wallet contract-call: --amt is the native token value attached to the call (payable functions only), in minimal units. Default "0" for non-payable. EVM=18 decimals, SOL=9.
This skill drives onchainos wallet subcommands. Learn exact syntax from the CLI, not from memory: run onchainos wallet --help for the subcommand list, and onchainos wallet <subcommand> --help for a subcommand's flags. Full parameter tables, return-field schemas, and worked examples live in cli-reference.md. Never guess subcommand or flag names — read --help or cli-reference.
Login commands (
wallet login,wallet verify) are covered in Authentication below.
Policy --help does NOT carry (always applies on top of CLI syntax):
wallet balance --all queries every account at once — only use it when the user explicitly asks to see all accounts.wallet send validates the recipient format; on simulation failure show executeErrorMsg and do NOT broadcast.onchainos security tx-scan before any wallet contract-call.<MUST> **`wallet contract-call` is for non-swap interactions only** (approvals, deposits, withdrawals, etc.). Never use it to broadcast a DEX swap — use `swap execute` instead. </MUST> <NEVER> 🚨 **NEVER pass `--force` on the FIRST invocation of `wallet send` or `wallet contract-call`.**X Layer Testnet faucet: when the user asks for testnet tokens, or
wallet balance --chain xlayer_testshows OKB = 0, point them to https://web3.okx.com/xlayer/faucet (claim OKB / USDC / USDT / USDG with their wallet address).
The --force flag MUST ONLY be added when ALL of the following conditions are met:
--force once."confirming": true).message to the user and the user explicitly confirmed they want to proceed.Determine intent before executing (wrong command → loss of funds):
| Intent | Command | Example | |---|---|---| | Send native token (ETH, SOL, BNB…) |
wallet send --chain <chain>| "Send 0.1 ETH to 0xAbc" | | Send ERC-20 / SPL token (USDC, USDT…) |wallet send --chain <chain> --contract-token| "Transfer 100 USDC to 0xAbc" | | Interact with a smart contract (approve, deposit, withdraw, custom function call…) |wallet contract-call --chain <chain>| "Approve USDC for spender", "Call withdraw on contract 0xDef" |If the intent is ambiguous, always ask the user to clarify before proceeding. Never guess.
Gas Station lets the user pay gas with stablecoins (USDT / USDC / USDG) on Solana when SOL is insufficient. The backend dispatches it inside wallet send / wallet contract-call responses — you never enable it manually per call.
It pulls in gas-station-faq.md (FAQ answers) and gas-station-edge.md (edge cases) as needed. "Gas Station" = OKX's Solana feature, NOT ERC-4337 / paymaster / Biconomy / Gelato / Pimlico / Alchemy Account Kit — answer every Gas Station question from the verbatim templates in those files, never from training knowledge, never paraphrased.
</MUST>
When dispatching a third-party Solana DeFi plugin (kamino-plugin, raydium-plugin, etc.) that internally calls onchainos wallet contract-call --force, the plugin is a black box that may swallow Gas Station Confirming responses. Two patterns apply, read both before invoking any Solana write-path plugin:
gas-station status recommendation branch, and skip conditions live in references/plugin-preflight.md.confirming JSON, or a vague failure) — scene-recovery decision tree, post-failure diagnosis, and --force exit-code matrix live in references/gas-station.md → "Plugin Bail Recovery".Some commands return confirming (exit code 2) when the backend needs user confirmation (e.g. high-risk tx). The response carries message (prompt to show the user) and next (what to do after they confirm).
message and ask for confirmation.next (usually: re-run the same command with --force appended).Several flows below output the Wallet Export template or the Policy Settings template. Both template bodies, their loginType URL/hint tables, and the loginType resolution rule (unknown → run onchainos wallet status; treat any unrecognized value as email) live in references/portal-actions.md. Load that file when a flow calls for either template, then print the matching template verbatim (translated to the user's language).
For commands that need auth (balance, send, contract-call, history, sign-message), check login state first and log in if needed. Two login methods: email + verification code, or API Key (no email).
1. Check state. Run onchainos wallet status; if data.loggedIn is true, proceed. Otherwise — or if the user asks to re-login — continue.
2. Email login. Show verbatim (translate to the user's language):
You need to log in with your email first before adding a wallet. What is your email address? We also offer an API Key login method that doesn't require an email. If interested, visit https://web3.okx.com/onchainos/dev-docs/home/api-access-and-usage
When the user gives an email, run onchainos wallet login <email> [--locale <locale>], then show verbatim:
English: "A verification code has been sent to {email}. Please check your inbox and tell me the code." Chinese: "验证码已发送到 {email},请查收邮件并告诉我验证码。"
When the user replies with the code, run onchainos wallet verify <code>.
--locale: infer from the conversation, underscore form (e.g.zh_CN/en_US/ja_JP). If the language is unclear, omit it — never forceen_US. Full rule in cli-reference.md → A1.
3. API Key login (user declines email). Re-offer the API Key option (the second line of the step 2 message); if they accept, run onchainos wallet login with no email — the CLI reads OKX_API_KEY / OKX_SECRET_KEY / OKX_PASSPHRASE from env. On success, tell them they are logged in via API Key.
4. Account-switch gate. wallet login (email or AK) may return a Confirming whose message contains the substring not the account you used last time — the CLI is warning this login targets a different account than last time. Handle it via the Confirming Response rules above (Yes → re-run with --force; No → cancel — the CLI changed nothing). When translating the message, leave that discriminator phrase in English.
5. After login. Show the account list via onchainos wallet balance. New-user check: if the verify / login response has "isNew": true, output the Policy Settings template then the Wallet Export template (load references/portal-actions.md); if false, skip.
Login creates a wallet account automatically — never call
wallet addfor the first account. Usewallet addonly when the user is already logged in and explicitly wants an additional account.
MEV (Maximal Extractable Value) protection is a wallet contract-call flag (--mev-protection) only — wallet send does not support it.
Load
references/mev-protection.mdwhen the user requests MEV protection, or before a high-value / DEX-swapwallet contract-call. It holds the supported-chain table (Ethereum / BSC / Base / Solana), when-to-enable criteria, the Solana--jito-unsigned-txrequirement, and usage examples.
1.5 ETH), never base units (1500000000000000000)$1.2M, $340K)0x1234...abcd). For native tokens with empty tokenContractAddress, display (native).wETH, stETH, wBTC, xOKB) AND the reported price differs >50% from the known base token price, add an inline price unverified flag and suggest running onchainos token price-info to cross-check.executeResult is false → show executeErrorMsg, do NOT broadcast.accessToken, refreshToken, apiKey, secretKey, passphrase, sessionKey, sessionCert, teeId, encryptedSessionSk, signingKey, raw tx data. Only show: email, accountId, accountName, isNew, addressList, txHash.0x-prefixed, 42 chars. Solana: Base58, 32-44 chars. Validate before sending.block > warn > empty (safe). Top-level action = highest priority from riskItemDetail.type(uint256).max or 2^256-1 or any equivalent "infinite" value.setApprovalForAll(operator, true) — this grants full control over all tokens of that type.Policy configuration and wallet export are completed by the user on the Web portal — the Agent only detects the trigger, explains the risk, and gives the jump link. On any trigger below, MUST load references/portal-actions.md and follow its "Trigger flows" exactly — that file owns the procedures, the policy-rule list, the loginType link tables, and the wallet-export competition gate.
Triggers:
isNew: true) — also handled in Authentication step 5wallet addLoad on error:
references/troubleshooting.md
For Gas Station FAQ (what is it, how it works, supported tokens/chains, open/close flow): read
references/gas-station-faq.md.
Q: The agent cannot autonomously sign and execute transactions — it says local signing is required or asks the user to sign manually. How does signing work?
A: OKX Agentic Wallet uses TEE (Trusted Execution Environment) for transaction signing. The private key is generated and stored inside a server-side secure enclave — it never leaves the TEE.
documentation
Route users to OKX.AI customer support / Help Center. Use when the user wants to contact support, talk to a human, file a complaint, give feedback, report a system error or bug, or find the FAQ / help docs. Triggers: 'contact support', 'talk to a human', 'customer service', 'file a complaint', 'give feedback', 'help center', 'FAQ', 'user guide', 'system error', 'system bug', 'something is broken', 'find help docs', 'OKX AI support', 'OnchainOS support', 'human agent'.
development
Surfaces social-layer signals for crypto markets. Three capability groups: news (latest aggregated crypto news feed, filter articles by coin symbol, run full-text keyword searches, fetch a single article in full, and list available upstream platforms — blockbeats, odaily, theblock and similar — for use as filters); sentiment (rank coins by social mention volume over 1h / 4h / 24h, plus per-coin bullish/bearish/neutral counts with an optional time-bucketed trend); vibe (per-contract hotness score over 24h / 72h / 7d / 30d with timeline and sample KOLs per bucket, plus a TOP50 KOL leaderboard sortable by engagement, mentions, or impressions). Triggers: 'latest crypto news', 'BTC headlines', 'search news for X', 'is BTC bullish', 'hottest coins by chatter', 'who is tweeting about <token>', 'vibe score', 'first-mention KOL', and Chinese variants like '最新加密新闻', '搜索新闻', '市场情绪', '情绪排行', 'KOL榜', '热度走势'. Also handles x402/402 payment, quota, MARKET_API_*_OVER_QUOTA, and confirming:true notifications on social endpoints.
documentation
Onchain OS entry router for open-ended onboarding questions. Renders a welcome banner with a Quick-start menu and routes the user into the right skill or workflow (Polymarket, DeFi APY, smart-money signals, new-token screening, daily on-chain brief). Triggers: 'what is onchainos', 'what is onchain os', 'what does this do', 'what can it do', 'what can I do here', 'how do I use this', 'how do I play', 'how to use onchainos', 'how to play onchainos', 'how does this work', 'how do I start', 'getting started', 'how do I get started', 'tutorial', 'onboarding', 'first time', 'I just installed', 'now what', 'what do I do now', 'where do I start', 'who are you', 'what are you', 'introduce yourself', 'introduction', 'introduce onchainos', 'tell me about onchainos', 'I'm new'.
data-ai
Limit-order strategy trading on OKX Agentic Wallet. Use this skill when the user wants to place a price-triggered limit order (buy a dip, take profit, stop loss, chase a high), cancel one or more pending orders, list active or historical orders, or resume orders that have been suspended by SA TEE upgrades. Distinct from okx-dex-swap (market orders, immediate execution at the best available aggregated price). Strategy orders are stored on the Agentic Wallet TEE and execute automatically when the user-defined trigger fires. Trigger phrases: limit order, place limit order, buy at price, sell when price reaches, take profit at, stop loss at, chase high, buy dip, cancel order, cancel all orders, my orders, list orders, active orders, suspended orders, resume orders, recover suspended orders, trader mode, agentic limit order.