{"id":"7e468283-32b3-4311-8c13-09d3bd183a85","entityType":"agent","slug":"clawhub-agentswapx-atxswap","name":"ATXSwap","canonicalUrl":"https://www.xpersona.co/agent/clawhub-agentswapx-atxswap","canonicalPath":"/agent/clawhub-agentswapx-atxswap","generatedAt":"2026-10-10T15:52:05.101Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":null},"description":"Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 trans...","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1.4K downloads reported by the source. Last updated 10/10/2026.","installCommand":"clawhub skill install s17dmcmzd5ve77tjfb48rfpvxh84fqgh:atxswap","sourceUrl":"https://clawhub.ai/agentswapx/atxswap","homepage":"https://clawhub.ai/agentswapx/skills/atxswap","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/agentswapx/atxswap","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/agentswapx/skills/atxswap","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":63,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"ATXSwap technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":null},"stars":null,"forks":null,"downloads":1417,"packageName":null,"latestVersion":"0.0.31","tractionLabel":"1.4K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":null},"lastUpdatedAt":"2026-10-10T13:17:15.976Z","lastCrawledAt":"2026-10-10T13:17:15.976Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-11T13:17:15.976Z","lastVerifiedAt":null,"highlights":[{"version":"0.0.31","createdAt":"2026-05-14T15:02:37.784Z","changelog":"0.0.31: Require live chain queries for balances/positions; transfer intent recap and no duplicate sends after txHash; llms.txt references updated.","fileCount":16,"zipByteSize":36221},{"version":"0.0.30","createdAt":"2026-05-06T06:57:32.292Z","changelog":"ClawHub republish; llms.txt synced to registry latest 0.0.30.","fileCount":15,"zipByteSize":32106},{"version":"0.0.29","createdAt":"2026-04-28T16:21:36.588Z","changelog":"- Bump version to 0.0.29. - Documentation updates in SKILL.md, README.md, and README.zh.md. - Updated package dependencies in package.json and package-lock.json. - Minor code and script improvements, including scripts/query.js.","fileCount":15,"zipByteSize":31408},{"version":"0.0.28","createdAt":"2026-04-28T15:21:27.944Z","changelog":"0.0.28: feePercent in query positions; bundle atxswap-sdk ^0.0.15; SKILL prefers fee % for users.","fileCount":15,"zipByteSize":30424},{"version":"0.0.27","createdAt":"2026-04-28T15:05:58.145Z","changelog":"0.0.27: bundle atxswap-sdk ^0.0.15; principalAtx/Usdt in query positions; SKILL/readmes LP vs wallet.","fileCount":15,"zipByteSize":29909},{"version":"0.0.25","createdAt":"2026-04-28T14:12:52.641Z","changelog":"0.0.25: English SKILL.md; holdings reply spec (tokens, NFT id, range, pending fees); jsonStringify scripts; bundle atxswap-sdk ^0.0.14.","fileCount":14,"zipByteSize":28185},{"version":"0.0.24","createdAt":"2026-04-28T13:58:35.675Z","changelog":"0.0.24: BigInt-safe JSON in skill scripts (jsonStringify); bundle atxswap-sdk ^0.0.14.","fileCount":14,"zipByteSize":27632},{"version":"0.0.23","createdAt":"2026-04-27T15:45:07.800Z","changelog":"0.0.23: SKILL.md keystore channel rule (English); bundle atxswap-sdk ^0.0.14.","fileCount":14,"zipByteSize":27541}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s17dmcmzd5ve77tjfb48rfpvxh84fqgh:atxswap","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s17dmcmzd5ve77tjfb48rfpvxh84fqgh:atxswap` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/agentswapx/atxswap before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-10T15:52:05.097Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-agentswapx-atxswap/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":null},"readme":"Skill: ATXSwap\n\nOwner: agentswapx\n\nSummary: Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 trans...\n\nTags: atx:0.0.31, atxswap:0.0.31, bsc:0.0.31, latest:0.0.31, pancakeswap:0.0.10, trading:0.0.31\n\nVersion history:\n\nv0.0.31 | 2026-05-14T15:02:37.784Z | user\n\n0.0.31: Require live chain queries for balances/positions; transfer intent recap and no duplicate sends after txHash; llms.txt references updated.\n\nv0.0.30 | 2026-05-06T06:57:32.292Z | user\n\nClawHub republish; llms.txt synced to registry latest 0.0.30.\n\nv0.0.29 | 2026-04-28T16:21:36.588Z | auto\n\n- Bump version to 0.0.29.\n- Documentation updates in SKILL.md, README.md, and README.zh.md.\n- Updated package dependencies in package.json and package-lock.json.\n- Minor code and script improvements, including scripts/query.js.\n\nv0.0.28 | 2026-04-28T15:21:27.944Z | user\n\n0.0.28: feePercent in query positions; bundle atxswap-sdk ^0.0.15; SKILL prefers fee % for users.\n\nv0.0.27 | 2026-04-28T15:05:58.145Z | user\n\n0.0.27: bundle atxswap-sdk ^0.0.15; principalAtx/Usdt in query positions; SKILL/readmes LP vs wallet.\n\nv0.0.25 | 2026-04-28T14:12:52.641Z | user\n\n0.0.25: English SKILL.md; holdings reply spec (tokens, NFT id, range, pending fees); jsonStringify scripts; bundle atxswap-sdk ^0.0.14.\n\nv0.0.24 | 2026-04-28T13:58:35.675Z | user\n\n0.0.24: BigInt-safe JSON in skill scripts (jsonStringify); bundle atxswap-sdk ^0.0.14.\n\nv0.0.23 | 2026-04-27T15:45:07.800Z | user\n\n0.0.23: SKILL.md keystore channel rule (English); bundle atxswap-sdk ^0.0.14.\n\nv0.0.22 | 2026-04-27T15:29:21.123Z | user\n\nClawHub publish 0.0.22; bundle atxswap-sdk ^0.0.14.\n\nv0.0.21 | 2026-04-27T14:54:33.338Z | user\n\nClawHub publish 0.0.21; bundle atxswap-sdk ^0.0.14.\n\nv0.0.20 | 2026-04-27T14:14:40.589Z | user\n\nClawHub publish 0.0.20; bundle atxswap-sdk ^0.0.14.\n\nv0.0.19 | 2026-04-27T13:26:54.404Z | user\n\nBundle atxswap-sdk ^0.0.14 (npm 0.0.14).\n\nv0.0.18 | 2026-04-26T15:13:03.408Z | user\n\n0.0.18: registry tarball bundles atxswap-sdk ^0.0.13 (npm 0.0.13).\n\nv0.0.17 | 2026-04-26T14:07:00.630Z | user\n\n0.0.17: registry tarball bundles atxswap-sdk ^0.0.12 (npm 0.0.12).\n\nv0.0.16 | 2026-04-26T13:37:48.041Z | user\n\n0.0.16: ClawHub publish; same skill bundle as 0.0.15 (atxswap-sdk ^0.0.11).\n\nv0.0.15 | 2026-04-26T11:01:32.112Z | user\n\nadd: concentrated liquidity (USDT/ATX min-max price, tick range), optional slippage-bps; align package.json to 0.0.15\n\nv0.0.14 | 2026-04-26T04:28:33.799Z | user\n\nBumped atxswap-sdk to ^0.0.11; BSC default RPC list is 6 endpoints with bsc-dataseed.bnbchain.org first.\n\nv0.0.13 | 2026-04-25T15:27:10.876Z | user\n\nBumped atxswap-sdk to ^0.0.10; default slippage when omitted is 1% (100 bps).\n\nv0.0.12 | 2026-04-25T14:05:11.521Z | user\n\nBump atxswap-sdk to ^0.0.9; add docs team links in README and SKILL.\n\nv0.0.11 | 2026-04-25T12:45:37.912Z | user\n\nBumped atxswap-sdk to ^0.0.8. Maintenance release.\n\nv0.0.10 | 2026-04-25T08:44:10.901Z | user\n\nATX on BSC: wallet, price/balance, PancakeSwap V3 swap & liquidity, transfers. atxswap-sdk@^0.0.7. Wallet list shows balanceError on RPC failure (no silent zeros).\n\nv0.0.9 | 2026-04-25T06:14:25.932Z | auto\n\n- Keystore export is now explicitly described as MetaMask-compatible, clarifying wallet interoperability.\n- Documentation updated for accuracy on keystore export and compatibility details.\n- No major changes to scripts or core functionality in this version.\n\nv0.0.8 | 2026-04-25T05:31:53.998Z | auto\n\natxswap v0.0.8\n\n- Clarified and strengthened wallet password recovery and keystore export safety rules.\n- Added guidance on explaining encrypted password storage and refusal to reveal passwords or private keys in chat, even with user confirmation.\n- Now requires explicit reminder and backup/export confirmation before wallet deletion or removal of key material.\n- Documentation updated to reflect additional user protections and stricter safety flows.\n\nv0.0.7 | 2026-04-25T04:41:49.902Z | auto\n\natxswap v0.0.7\n\n- Updated version to 0.0.7 in SKILL.md and package files.\n- No functional commands or usage changes in scripts or documentation.\n- Maintenance update; mainly version bump for dependency or packaging alignment.\n\nv0.0.6 | 2026-04-24T15:37:06.895Z | auto\n\natxswap 0.0.6\n\n- Bumped package version to 0.0.6.\n- Updated SKILL.md metadata to match the new version.\n- No functional code changes; documentation and meta updates only.\n\nv0.0.4 | 2026-04-24T13:42:44.540Z | user\n\n0.0.4: removed wallet.js import (and the SDK importPrivateKey API). wallet.js export now emits the encrypted Keystore V3 JSON instead of the raw private key, and supports --out <file>. Bumped atxswap-sdk dependency to ^0.0.3.\n\nv0.0.3 | 2026-04-24T09:04:36.550Z | user\n\nUse atxswap-sdk@^0.0.2: built-in 8-endpoint BSC RPC fallback (replaced bare infura URL with bsc-rpc.publicnode.com), and BSC_RPC_URL now accepts a comma-separated list parsed as rpcUrls.\n\nv0.0.2 | 2026-04-19T16:49:56.745Z | user\n\nSwitch SDK dependency from github:agentswapx/atxswap-sdk to atxswap-sdk@^0.0.1 on npm. Cuts first-time install from ~1 min to ~16s.\n\nv0.0.1 | 2026-04-19T16:19:16.531Z | auto\n\nInitial release of atxswap skill for managing ATX on BSC:\n\n- Provides wallet creation/import, password storage, and keystore management.\n- Supports querying ATX/USDT price, balances, LP positions, and token info.\n- Enables ATX buy/sell swaps, PancakeSwap V3 liquidity management, and BNB/ERC20 transfers.\n- Enforces strong password and safety rules: previews, confirmations, and privacy protection.\n- Requires Node.js 18+, npm, and BSC RPC access.\n\nArchive index:\n\nArchive v0.0.31: 16 files, 36221 bytes\n\nFiles: CHANGELOG.md (6655b), package-lock.json (7346b), package.json (424b), PUBLISH.md (2847b), README.md (6969b), README.zh.md (6940b), scripts/_helpers.js (5234b), scripts/_v3math.js (1840b), scripts/liquidity.js (21209b), scripts/query.js (6421b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), skill-card.md (2981b), SKILL.md (23039b), _meta.json (127b)\n\nFile v0.0.31:SKILL.md\n\n---\nname: atxswap\ndescription: >-\n  Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap\n  V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 transfers.\n  Use when the user mentions ATX, BSC, PancakeSwap V3, wallet creation, price checks,\n  buying, selling, liquidity, fees, holdings, LP positions, or token transfers.\nversion: \"0.0.31\"\ncompatibility: Requires Node.js 18+ and npm. Network access to BSC RPC required.\ninject:\n  - bash: echo \"${CLAUDE_SKILL_DIR:-$(cd \"$(dirname \"$0\")/..\" && pwd)}\"\n    as: SKILL_DIR\nmetadata:\n  author: agentswapx\n  openclaw:\n    requires:\n      bins:\n        - node\n        - npm\n    homepage: https://github.com/agentswapx/skills/tree/main/atxswap\n    os:\n      - linux\n      - macos\n---\n\n# ATXSwap Skill\n\nExecute ATX trading and wallet workflows on BSC. This skill is designed for\nagents that need safe, repeatable commands for wallet management, ATX/USDT\nquotes, swaps, V3 liquidity actions, and transfers.\n\n- **SDK**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk) on npm ([source](https://github.com/agentswapx/atxswap-sdk))\n- **Docs (team / project)**: [Team introduction (EN)](https://docs.atxswap.com/guide/team) · [Team introduction (ZH)](https://docs.atxswap.com/zh/guide/team)\n- **Keystore dir**: `~/.config/atxswap/keystore` (fixed, not configurable)\n- **Secrets dir**: `~/.config/atxswap/` (master.key + secrets.json)\n\n## Use This Skill For\n\n- Create the single wallet used by this skill instance (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions (see **Required agent reply for holdings** under `query.js`), quotes, and arbitrary ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Add liquidity (full range or a custom **price range in USDT per ATX** or **tick** bounds), remove liquidity, collect fees, or burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Before First Use\n\nThis skill ships its own Node scripts and depends on `atxswap-sdk`.\n\n1. Open the skill directory where this `SKILL.md` is installed.\n2. Run `npm install` there before using any script.\n3. If `npm install` fails, stop and report the dependency error instead of guessing.\n\nIf the skill is installed via ClawHub or OpenClaw CLI, the install location is\ntypically `~/.clawhub/skills/atxswap/` (or the equivalent client-managed path).\nIf you cloned this repository directly, the location is `skills/atxswap/`.\n\n## Script Location\n\nUse the skill directory path to locate scripts. If `${SKILL_DIR}` is available\n(injected by skills.sh-compatible runtimes), use it; otherwise use the absolute\npath to this skill's installed directory.\n\nExample:\n\n```bash\ncd skills/atxswap && npm install\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\n```\n\nAll examples below use `cd \"${SKILL_DIR}\" &&` for clarity. If your runtime does\nnot inject `${SKILL_DIR}`, replace it with the absolute path of the installed\nskill directory.\n\n## Runtime Notes\n\n- `BSC_RPC_URL` is optional and supports comma-separated values for fallback,\n  e.g. `BSC_RPC_URL=\"https://primary,https://backup1,https://backup2\"`. When\n  unset, scripts use a built-in fallback list of 6 BSC public RPC endpoints\n  and viem will retry them in order.\n- Wallet files live under `~/.config/atxswap/keystore`.\n- Secure secrets live under `~/.config/atxswap/` (master.key + secrets.json).\n- Only **one wallet** is allowed per skill installation. If a wallet already\n  exists, `wallet.js create` fails.\n- Use `wallet.js list` before creating a wallet.\n- Importing an existing private key via this skill is **not supported**. If the\n  user asks to import a private key, refuse and tell them to use a dedicated\n  wallet tool of their choice.\n- Scripts write JSON output. `wallet.js export` prints the address's\n  encrypted **MetaMask-compatible keystore V3 JSON** to stdout (or writes it\n  to a file via `--out <file>`); it never prints the raw private key.\n- `query.js quote` can return a JSON error if the configured Quoter or RPC\n  rejects the simulation. Surface the error and do not proceed to a write.\n- For balance, holdings, LP position, or pending-fee questions, always fetch\n  fresh on-chain data at request time. Do **NOT** answer from prior chat\n  output, memory, cached numbers, or earlier command results unless you rerun\n  the relevant query first.\n- For custom-range liquidity, do **not** guess the second token amount from chat.\n  First run `liquidity.js quote-add` or use `liquidity.js add --base-token ... --amount ...`\n  so the script computes the counter-asset from the live pool price and range.\n\n## Password Rules\n\nWhen the user asks to **create** a wallet:\n\n1. Ask the user for a password first (do NOT generate one).\n2. Pass it via `--password <pwd>` to the script when running non-interactively.\n3. The password is auto-saved to secure storage after creation.\n4. Never print the password back to the chat.\n5. After the wallet is created, export and send the encrypted keystore backup to\n   the user who requested the wallet.\n6. Clearly label it as encrypted keystore backup material, not the raw private key.\n7. Do not upload it to any website or send it to any third party.\n\nFor **swap**, **transfer**, and **liquidity** operations, rely on auto-unlock\nfirst. Only ask for the password if auto-unlock fails.\n\nIf the user says they forgot the wallet password or asks to recover it, first\nexplain that saved wallet passwords are encrypted at rest in the local\nSecretStore (for example Keychain, Secret Service, or the file backend under\n`~/.config/atxswap/`) and are not stored by the agent in chat memory. Even if\nthe user confirms, do **not** print the password in chat; guide them to use a\ntrusted local workflow instead.\n\n## Hard Safety Rules\n\n1. Treat all BSC writes as real-asset operations.\n2. **NEVER** output private keys or passwords in chat.\n3. **ALWAYS** run a preview before write actions: query price, quote, balance,\n   or positions as appropriate.\n4. **ALWAYS** show the preview to the user and wait for explicit confirmation\n   before swap, transfer, or liquidity writes.\n5. **NEVER** execute large trades without the user saying \"yes\" or \"confirm\".\n6. `wallet.js export` only emits the **encrypted MetaMask-compatible keystore\n   JSON**, never the raw private key. There is no command that prints the\n   unencrypted private key, and the agent must not attempt to derive or display\n   one.\n7. Prefer `wallet.js export <address> --out <file>` and tell the user the file\n   path. Avoid pasting the keystore JSON itself into chat unless the user\n   explicitly asks for it.\n8. Before deleting a wallet, keystore file, or any private-key-bearing wallet\n   material, **ALWAYS** remind the user to export and back up the encrypted\n   keystore first. Do not delete anything until the user explicitly confirms\n   that the keystore backup has been completed.\n9. Wallet deletion requires a second explicit confirmation: after backup is\n   confirmed, require the user to send the exact phrase `force delete wallet` before\n   running any delete command.\n10. If the user asks to delete a wallet, do **NOT** send the keystore\n    immediately. First ask whether they want to receive the encrypted keystore\n    backup. Only after the user agrees may you export and send the keystore to\n    the user.\n11. If the user explicitly asks to back up or export the wallet, export and\n    send the encrypted keystore backup to the user who requested the wallet,\n    and clearly label it as keystore backup material.\n12. The encrypted keystore may only be sent to the user who owns the current\n    session request. **NEVER** send the keystore through any channel that is not\n    under that user's own control.\n    It may only be sent to the user personally, and must not be pasted into any\n    external form or sent to any other person, group, agent, or service.\n13. After `wallet.js create` succeeds, export and send the encrypted keystore\n    to the user who requested the wallet. Treat this as part of the wallet\n    creation handoff, but only to that user.\n14. If the user asks to recover or reveal a saved wallet password, remind them\n   that the password is encrypted in local secure storage and must not be\n   disclosed in chat. Do not attempt to print, derive, or expose the password\n   even after user confirmation.\n15. If the user asks to recover, reveal, print, or paste the wallet private key,\n    refuse. Offer `wallet.js export <address> --out <file>` as the only\n    supported backup path, because it exports an encrypted keystore instead of\n    exposing the raw private key.\n16. For every transfer, treat the tuple `(asset, from, to, amount)` as a single\n    transfer intent. Repeat that exact tuple back to the user before execution.\n17. After a transfer command returns a `txHash`, consider that transfer intent\n    **already sent**. Do **NOT** send the same transfer again unless the user\n    explicitly asks to send it again.\n18. If a transfer write ends in an ambiguous state (for example RPC timeout,\n    dropped connection, or partial output after signing/submission), do **NOT**\n    retry blindly. First check chain state or wallet state, summarize what is\n    known, and ask the user whether to retry.\n19. If the same transfer tuple appears again in the same conversation after a\n    successful or ambiguous prior attempt, pause and ask whether the user means\n    a new transfer or is referring to the earlier one.\n20. For any user question about **current** balances, holdings, LP positions,\n    pending fees, or wallet assets, rerun the matching read command against the\n    chain first. Never rely on previously displayed numbers as if they were\n    still current.\n\n## Required Preview Flow\n\nBefore every write action:\n\n1. Query the price, quote, balance, or positions that match the requested action.\n2. Summarize the preview in plain language.\n3. Ask the user to confirm.\n4. Execute the write command only after confirmation.\n5. Return the transaction hash and the key result fields.\n\nFor transfers, the summary in step 2 must explicitly include:\n\n- asset\n- source wallet\n- destination address\n- amount\n\nAfter step 5, if a `txHash` is available, treat the transfer as executed and do\nnot issue the same write again unless the user clearly requests a second send.\n\nFor read-only asset questions:\n\n1. Run the relevant live query first (`query.js balance`, `query.js positions`,\n   `query.js price`, or `query.js quote` as appropriate).\n2. Answer from that fresh output only.\n3. If the RPC or query fails, say the data could not be refreshed instead of\n   reusing older numbers.\n\n## High-Value Workflows\n\n### Check market state\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\n### Preview before swap\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\n```\n\n### Execute after confirmation\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\n```\n\n## Command Reference\n\n### `wallet.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js create [name] --password <pwd>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\ncd \"${SKILL_DIR}\" && node scripts/wallet.js export <address> [--out <file>]\ncd \"${SKILL_DIR}\" && node scripts/wallet.js has-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js forget-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nAfter `wallet.js create`:\n\n1. Return the created wallet address.\n2. Run `wallet.js export <address> [--out <file>]`.\n3. Send the encrypted keystore only to the user who requested the wallet.\n4. Do not upload it to any website or send it to any third party.\n5. Explain that it is encrypted keystore backup material, not the raw private key.\n\nBefore `wallet.js delete`:\n\n1. Ask whether the user wants the encrypted keystore sent to them for backup.\n2. After the user agrees, export and send the encrypted keystore to the user only.\n3. Do not upload it to any website or send it to any third party.\n4. Require the user to explicitly confirm that the backup is complete.\n5. Require the user to send the exact phrase `force delete wallet`.\n6. Only then run `wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"`.\n\nIf the user asks to back up the wallet:\n\n1. Run `wallet.js export <address> [--out <file>]`.\n2. Send the encrypted keystore only to the user.\n3. Do not upload it to any website or send it to any third party.\n4. Explain that this is encrypted keystore backup material, not the raw private key.\n\n### `query.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/query.js token-info <tokenAddress>\n```\n\n`query.js positions` includes **principal token amounts** in the position (`principalAtx`,\n`principalUsdt`, `principal0`, `principal1`) computed from V3 `liquidity` (L), ticks (internal),\nand the pool’s current `sqrtPriceX96` (same `getAmountsForLiquidity` math as the web app). It emits\nhuman **USDT-per-ATX** bounds as **`priceRangeUsdtPerAtx.min` / `.max`**, **`currentPriceUsdtPerAtx`**,\nand **`currentPriceInRange`** (whether the pool tick lies inside that position). It includes\n**`pendingFees.atx`** and **`pendingFees.usdt`** as the simulated collect notionals (`collectable*`),\nplus raw `tokensOwed0`/`1` and `collectable0`/`1` for debugging. Use `collectable*` / `pendingFees`\nto decide whether a fee harvest is worth executing. Each object also includes **`feePercent`**\n(e.g. `\"0.25%\"`) for the pool’s swap-fee tier; raw **`fee`** stays the on-chain code\n(`100` / `500` / `2500` / `10000`). **Tick indices are not included** in the JSON — quote\nUSDT/ATX prices and in-range state instead.\n\nWhen the user asks \"how much do I have now\", \"what is my current balance\", \"what\npositions are left\", \"how much ATX is still in the LP\", or similar present-tense\nquestions, rerun `query.js balance` and/or `query.js positions` immediately.\nDo not answer from previously captured JSON.\n\n**Required agent reply for holdings** when the user asks about their positions, LP NFTs, or liquidity holdings (per position):\n\nRun `query.js positions <address>` (omit `tokenId` to list all ATX/USDT V3 NFTs). The CLI prints\n**one JSON object per NFT**; include **every** position. For each position, the answer **must**\naddress the topics below (label them in the user’s language when replying). **Do not** show raw\nV3 tick numbers to the user — use **USDT per 1 ATX** from the JSON below.\n\n| Topic | What to include | CLI JSON fields |\n|-------|-----------------|-----------------|\n| **Tokens in the position** | **In-range liquidity** as ATX and USDT notionals — always cite **`principalAtx`** and **`principalUsdt`** (and optionally `principal0` / `principal1` in pool token0/token1 order). These are computed at the **current pool price**. Mention `liquidity` only as the raw **L** scalar if explaining detail. Do **not** treat **`query.js balance`** as LP “position tokens”: wallet ATX/USDT/BNB balances are unrelated to NFT principal — if shown, label them distinctly (e.g. “Wallet balances, separate from this LP NFT”). |\n| **NFT token ID** | The V3 LP NFT id | `tokenId` |\n| **Pool swap fee tier** | The pool’s trading fee as a **percentage** for end users | Prefer **`feePercent`** (e.g. `\"0.25%\"`). If you show the raw tier code, pair it with **`feePercent`** (e.g. `2500` + `0.25%`). |\n| **Price range & spot** | Configured **min/max USDT per 1 ATX** for the position, and current pool price in the same unit | **`priceRangeUsdtPerAtx.min`**, **`priceRangeUsdtPerAtx.max`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`** (confirm “in range” / “out of range” in natural language). |\n| **Pending fees** | Uncollected fees (both tokens) | Always show **`pendingFees.atx`** and **`pendingFees.usdt`** explicitly. Prefer these over quoting only one asset. Optionally reference `collectableAtx`/`collectableUsdt` synonyms. State fees stay **pending** until `liquidity.js collect`. |\n\nDo not answer with only raw pool indices (ticks). If there are no positions, relay `No ATX/USDT positions found.` exactly.\n\nMinor mismatch vs on-chain bookkeeping can occur because `principal*` uses the same float-based\ntick→√P path as other tooling (~wei-level); values are intended for humans and routing, not audits.\n\n### `swap.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/swap.js sell <atxAmount> [--from address] [--slippage bps] [--password <pwd>]\n```\n\n### `liquidity.js`\n\n**`add` — price / tick range** (same USDT/ATX semantics as the web app; default full range = full-width liquidity):\n\n- Default: no extra flags means **full range** (same as before).\n- `--full-range`: explicit full range (do not combine with the two groups below).\n- `--min-price` / `--max-price`: band in **USDT per 1 ATX**; the script reads pool `token0` and maps to `tickLower` / `tickUpper` like the app (`token1/token0` + `tickSpacing`). **Both** prices are required.\n- `--range-percent`: band around **current ATX price** as a percentage; e.g. `20` means about `-20%` to `+20%` of the current price.\n- `--tick-lower` / `--tick-upper`: raw V3 ticks (**both** required; script uses the smaller as lower, larger as upper, clamped to valid V3 bounds).\n- `quote-add <atx|usdt> <amount>`: given live price and range, estimate the other leg — use before a write.\n- `add --base-token <atx|usdt> --amount <n>`: single-sided notional; script computes the other leg and executes the add.\n\nOptional: `--slippage-bps` (0–10000; default from SDK).\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add <atx|usdt> <amount> [range opts]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js remove <tokenId> <percent> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js burn <tokenId> [--from address] [--password <pwd>]\n```\n\n`liquidity.js remove` already uses a single `multicall`:\n`decreaseLiquidity` -> `collect` -> and when `percent = 100`, `burn`.\nThat means a full removal automatically collects withdrawable funds and destroys the LP NFT in the same transaction, so\nrunning `collect` again for the same `tokenId` is expected to fail because the position no longer exists.\n\nBefore `collect`, preview the target position with:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\nPrefer `pendingFees` / `collectableAtx` / `collectableUsdt` over relying on `tokensOwed0/1` alone when deciding whether\nfees are available, because the raw `tokensOwed` fields may stay at zero while\n`collect()` can still succeed.\n\nExample (not full-range; align the range with the user using `query.js price` before writes):\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --min-price 0.05 --max-price 0.15\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --tick-lower -20000 --tick-upper 1000\n```\n\nMapping user phrasing to commands:\n\n- If the user asks to add **0.1 USDT** of liquidity with a **±20%** range around spot, first run\n  `quote-add usdt 0.1 --range-percent 20`.\n- Show the returned `estimatedAmounts` (or equivalent summary) and wait for confirmation.\n- After confirmation, run\n  `add --base-token usdt --amount 0.1 --range-percent 20 --from <address>`.\n\n### `transfer.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/transfer.js bnb <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js usdt <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js token <tokenAddress> <to> <amount> [--from address] [--password <pwd>]\n```\n\nTransfer anti-duplication checklist:\n\n1. Preview balances first.\n2. Restate the exact transfer tuple `(asset, from, to, amount)` to the user.\n3. Wait for explicit confirmation for that exact tuple.\n4. Run `transfer.js` once.\n5. Return the `txHash`.\n6. If the user repeats the same request, do not run the transfer again until\n   you clarify whether they want a second transfer.\n7. If the command may have submitted but the final result is unclear, do not\n   rerun it automatically; inspect chain state or ask the user how to proceed.\n\n## When To Refuse Or Pause\n\n- Missing wallet but the user requests a write action\n- Missing confirmation for swap, transfer, or liquidity writes\n- User asks to delete a wallet, keystore file, or private-key-bearing wallet\n  material before confirming that the encrypted keystore has been backed up\n- User asks to delete a wallet but has not agreed to receive the keystore backup first\n- User asks to delete a wallet but has not explicitly sent `force delete wallet`\n- User asks to send or upload a keystore through a channel not under their own\n  control, or to anyone other than the user\n- User asks to recover or reveal a saved wallet password in chat\n- User asks to recover, reveal, print, or paste a wallet private key in chat\n- `npm install` has not been run successfully in the skill directory\n- RPC, dependency, or wallet-unlock errors that make the state unclear\n\n## Standard Workflow\n\nFor any write action:\n\n1. Query current price, quote, balance, or positions as needed.\n2. Summarize the preview for the user.\n3. Wait for explicit confirmation.\n4. Execute the write command.\n5. Report the transaction hash and result.\n\nFile v0.0.31:README.md\n\n# ATXSwap Skill\n\nA skill bundle for the ATXSwap decentralized agent exchange protocol on BSC. A single `SKILL.md`\nworks across clients represented by **Claude Code** and **OpenClaw**, so you do\nnot need separate directories for different clients.\n\n[**中文文档**](./README.zh.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK on npm**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK source / docs**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\nFor project background and a short [team introduction](https://docs.atxswap.com/guide/team) ([中文](https://docs.atxswap.com/zh/guide/team)), see the ATXSwap documentation site. This README describes the skill’s scope and scripts.\n\n## What This Skill Covers\n\n- Create the single wallet used by the skill (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions, and ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Preview custom-range liquidity, add liquidity, remove liquidity, collect fees, and burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Directory Layout\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## Install\n\n### OpenClaw Install\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code Install\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\nBy default the skill uses a built-in fallback list of 6 BSC public RPC\nendpoints. To override, set `BSC_RPC_URL` to a single URL or to a\ncomma-separated list (priority left to right):\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## Common Commands\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\nWhen invoked through a `${SKILL_DIR}`-aware runtime, `cd \"${SKILL_DIR}\"` is\npreferred so the skill works regardless of where the client installed it.\n\n## Liquidity Preview\n\nFor custom-range liquidity, do not guess the second token amount from chat.\nPreview first, then write:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\nSupported custom range modes:\n\n- `--range-percent <n>`: expands around the current ATX price, e.g. `20` means `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`: explicit `USDT per 1 ATX`\n- `--tick-lower <n> --tick-upper <n>`: raw V3 ticks\n\nRecommended flow:\n\n1. Run `query.js price` or `liquidity.js quote-add`\n2. Show the returned `estimatedAmounts` to the user\n3. Wait for confirmation\n4. Execute `liquidity.js add`\n\n## Fee Harvest Preview\n\nBefore collecting fees, preview the position first:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` returns **principal** notionals (**`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`) from liquidity L and spot (`getAmountsForLiquidity`); human **USDT-per-ATX** band **`priceRangeUsdtPerAtx`**, spot **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; plus raw `tokensOwed*` / `collectable*` for debugging. Prefer **`principal*`** when explaining tokens in-range; **`pendingFees`** / **`collectable*`** before fee harvest — do **not** surface raw tick indices to users.\n\n`liquidity.js remove <tokenId> <percent>` already performs a single on-chain `multicall`:\n`decreaseLiquidity` -> `collect` -> and when `percent = 100`, `burn`.\nSo a full removal already collects withdrawable funds before burning the NFT. After a successful `remove ... 100`,\nrunning `collect` again for the same `tokenId` is expected to fail because the position NFT no longer exists.\n\n## Security Rules\n\n1. Never expose private keys or passwords in chat output.\n2. Always preview price, quote, balance, or positions before write actions.\n3. Always wait for explicit user confirmation before swap, transfer, or liquidity writes.\n4. Treat all write actions as mainnet asset operations.\n5. Before deleting a wallet, require the user to export and back up the encrypted keystore first.\n6. Wallet deletion requires a second confirmation: the user must explicitly send `force delete wallet`.\n7. For transfers, always treat `(asset, from, to, amount)` as one unique transfer intent and restate it before execution.\n8. Once a transfer command returns a `txHash`, treat that transfer as already sent; do not automatically send the same transfer again unless the user explicitly asks for another send.\n9. If transfer submission status is ambiguous due to timeout, RPC failure, or interrupted output, do not retry blindly; first inspect chain state or wallet state, then ask the user whether to retry.\n10. For present-tense questions about balances, holdings, LP positions, pending fees, or remaining assets, always refresh from live on-chain queries first; never answer from earlier chat output, memory, or cached values alone.\n\n## Duplicate-Transfer Guard\n\nUse this minimum flow to avoid duplicate transfers:\n\n1. Preview balances or wallet state first\n2. Restate `(asset, from, to, amount)`\n3. Wait for explicit confirmation for that exact tuple\n4. Run the transfer command once\n5. Return the `txHash`\n6. If the same transfer request appears again, clarify whether the user wants a second transfer or is referring to the earlier one\n\n## Live Query Requirement\n\nFor these questions, rerun a live query before answering:\n\n- wallet balances\n- ATX / USDT holdings\n- LP NFT positions\n- `principalAtx` / `principalUsdt`\n- pending fees\n- current pool price or quotes\n\nRecommended mapping:\n\n1. Use `query.js balance` for balances\n2. Use `query.js positions` for LP holdings and principals\n3. Use `query.js price` for current pool price\n4. Use `query.js quote` for swap quotes\n5. If the refresh fails, say the latest on-chain data could not be refreshed instead of reusing older values\n\n## Wallet Deletion\n\nDelete a wallet only after both confirmations are complete:\n\n1. The user confirms the encrypted keystore backup is done\n2. The user explicitly sends `force delete wallet`\n\nThen run:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.31:_meta.json\n\n{\n  \"ownerId\": \"kn7b4v7fs97tk2t9cd0z2zef0s84e311\",\n  \"slug\": \"atxswap\",\n  \"version\": \"0.0.31\",\n  \"publishedAt\": 1778770957784\n}\n\nFile v0.0.31:CHANGELOG.md\n\n# Changelog\n\n## 0.0.31\n\n- ClawHub republish; registry tarball unchanged (`atxswap-sdk` **`^0.0.15`**). `SKILL.md` / `README*` — require fresh on-chain reads for balances/positions; transfer intent recap, no duplicate sends after `txHash`, no blind retries on ambiguous RPC/signing.; `frontend`/`docs-site` `llms.txt` reference **`0.0.31`**.\n\n## 0.0.30\n\n- ClawHub republish; registry tarball unchanged (`atxswap-sdk` **`^0.0.15`**). Docs: `llms.txt` updated to reference latest **`0.0.30`**.\n\n## 0.0.29\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: emits **`priceRangeUsdtPerAtx`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; **`tickLower`/`tickUpper`** removed from printed JSON. `SKILL.md` / `README*` updated.\n\n## 0.0.28\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: add **`feePercent`** (human-readable pool swap fee, e.g. `\"0.25%\"`; raw **`fee`** remains the on-chain tier code such as `2500`). `SKILL.md` instructs agents to prefer **`feePercent`** in user-facing summaries.\n\n## 0.0.27\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**); includes **`principalAtx`/`principalUsdt`** in `query.js positions`, `_v3math.js`, and updated `SKILL.md`/`README*` for LP-vs-wallet semantics.\n\n## 0.0.26\n\n- `query.js positions` outputs **`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`: in-range token amounts computed from `liquidity` + ticks + spot `sqrtPriceX96` (`getAmountsForLiquidity`), using SDK-provided `principal*` when present (future `atxswap-sdk` versions) to avoid an extra `getPrice()` call. `SKILL.md` updated: distinguish LP principal from **`query.js balance`** (wallet); warns agents not to substitute wallet balances for position tokens; table row fully English. `README.md` / `README.zh.md` fee section documents `principal*` vs `collectable*`.\n\n## 0.0.25\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14). `SKILL.md` is English-only; documents required agent reply for LP holdings (tokens, NFT id, price range, pending fees); `liquidity.js` narrative translated to English.\n\n## 0.0.24\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); skill scripts use shared `jsonStringify` for BigInt-safe JSON output.\n\n## 0.0.23\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); `SKILL.md` hard-safety keystore channel wording (English).\n\n## 0.0.22\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.21\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.20\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.19\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.18\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.13` (npm 0.0.13).\n\n## 0.0.17\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.12` (npm 0.0.12).\n\n## 0.0.16\n\n- ClawHub registry publish (no functional change from 0.0.15 bundle).\n\n## 0.0.14\n\n- Bumped bundled `atxswap-sdk` to `^0.0.11` (BSC `DEFAULT_RPC_URLS`: 6 endpoints, `bsc-dataseed.bnbchain.org` first).\n\n## 0.0.13\n\n- Bumped bundled `atxswap-sdk` to `^0.0.10` (default slippage when omitted is now **1%** / `100` bps, was 3%).\n\n## 0.0.12\n\n- Bumped bundled `atxswap-sdk` to `^0.0.9` (npm README / docs links).\n- `README` / `README.zh` / `SKILL.md`: link to ATXSwap documentation [team introduction](https://docs.atxswap.com/guide/team) pages.\n\n## 0.0.11\n\n- Bumped bundled `atxswap-sdk` to `^0.0.8` (npm maintenance release).\n\n## 0.0.9\n\n- Bumped `atxswap-sdk` to `^0.0.7` so `wallet.js export` emits\n  MetaMask-compatible encrypted keystore V3 JSON. SDK 0.0.7 uses the standard\n  Web3 Secret Storage MAC (`keccak256`) and can re-export legacy SDK keystores\n  without exposing raw private keys.\n\n## 0.0.8\n\n- Tightened `SKILL.md` safety guidance: before deleting a wallet/keystore, remind\n  the user to back up the encrypted keystore and wait for explicit confirmation\n  of backup. On forgotten-password and recovery requests, explain local\n  encrypted storage and **never** print passwords in chat. Refuse to reveal\n  or paste private keys; point users to `wallet.js export` (encrypted\n  keystore) only.\n\n## 0.0.7\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.6` so the skill uses the\n  cron/headless SecretStore fixes from SDK 0.0.6. Cron, SSH, and other\n  non-desktop Linux environments now fall back to the encrypted file backend\n  instead of failing on `secret-tool store`.\n- `wallet.js create` now includes `passwordSaved` and optional\n  `passwordSaveError` in its JSON output, making password persistence failures\n  visible without treating them as wallet-creation failures.\n\n## 0.0.6\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.5` so the skill picks up\n  the corrected `DEFAULT_CONTRACTS` (production ATX token + ATX/USDT pool\n  addresses on BSC mainnet). Required because npm semver treats `^0.0.x` as\n  pinned to that exact patch, so older dependency ranges would never have\n  resolved to `0.0.5`.\n- Version `0.0.5` was intentionally skipped to keep the skill release line\n  distinct from the SDK release line going forward.\n\n## 0.0.4\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.3` (required for the new\n  `WalletManager.exportKeystore()` API used by `wallet.js export`).\n- Removed `wallet.js import <privateKey>` and the public\n  `WalletManager.importPrivateKey()` SDK method. Importing an existing private\n  key is no longer supported through this skill or the underlying SDK; the only\n  way to provision a wallet for this skill instance is `wallet.js create`.\n- Replaced `wallet.js export <address>` raw private-key output with **keystore\n  V3 JSON** export. The `WalletManager.exportPrivateKey()` SDK method has been\n  removed and superseded by `WalletManager.exportKeystore(address)`, which\n  returns the on-disk encrypted keystore. `wallet.js export` now also supports\n  `--out <file>` to write the keystore to disk instead of printing to stdout.\n  The skill no longer has any path that exposes the unencrypted private key.\n\n## 0.0.1\n\n- Initial OpenClaw and ClawHub skill bundle for ATX trading on BSC\n- Added self-contained scripts for wallet, query, swap, liquidity, and transfer flows\n- Added OpenClaw-oriented `SKILL.md`, publish notes, and localized README files\n- Normalized runtime failures to compact JSON errors for cleaner agent output\n\nFile v0.0.31:PUBLISH.md\n\n# Publish Notes\n\nThis directory is published to **ClawHub** as a single skill bundle that also\nworks as a standalone `skills.sh`-compatible package (Claude / Cursor / Codex\nCLI). The same `SKILL.md` frontmatter declares both conventions, so a single\nsource of truth covers all clients. After publish, the skill is installable via\nboth `clawhub install atxswap` and `openclaw skills install atxswap` (OpenClaw\npulls from the same ClawHub registry).\n\n> Heads up: the OpenClaw CLI itself does **not** have `skills publish` or\n> `skills validate` subcommands. All publishing flows through the dedicated\n> `clawhub` CLI (`npm install -g clawhub`).\n\n## Pre-publish checklist\n\n1. Bump versions consistently:\n   - `SKILL.md` frontmatter `version`\n   - `package.json` `version`\n   - These two MUST match — `clawhub publish --version` overrides them at\n     upload time but mismatched local values confuse `skills.sh` consumers.\n2. Install dependencies inside this directory (`npm install`) so the SDK\n   builds cleanly.\n3. Run the local read-only checks:\n   - `node scripts/wallet.js list`\n   - `node scripts/query.js price`\n   - `node scripts/query.js quote buy 1`\n4. Confirm the folder does not include secrets, keystore files, or\n   `node_modules/`. (`.clawhubignore` already excludes `node_modules/`,\n   `.clawhub/`, `.clawdhub/`, `.DS_Store`, `*.log`.)\n5. Make sure the parent submodule (`agentswapx/skills`) is committed and\n   pushed — the published `homepage` URL points at GitHub.\n\n## Authenticate with ClawHub\n\n```bash\n# Browser flow (opens a token-grant page)\nclawhub login\n\n# Or token flow (no browser)\nclawhub login --token <YOUR_TOKEN> --no-browser\n\n# Verify\nclawhub whoami\n```\n\n## Publish\n\n```bash\nclawhub publish ./skills/atxswap \\\n  --slug atxswap \\\n  --name \"ATXSwap\" \\\n  --version 0.0.1 \\\n  --tags latest,atxswap,atx,bsc,trading\n```\n\nAfter upload there is a brief security-scan window during which `clawhub\ninspect atxswap` returns \"Skill is hidden while security scan is pending\".\n\nOnce the scan completes, ClawHub will flag this skill as \"suspicious\" because\nVirusTotal Code Insight detects crypto-key / external-API patterns — that is\nexpected for any wallet SDK and not a real warning. Users must pass `--force`\nin non-interactive contexts:\n\n```bash\nclawhub install atxswap --force\n```\n\n## Verify the published skill\n\n```bash\n# Registry round-trip\nclawhub inspect atxswap\n\n# End-user simulation in a clean directory\nTEST=$(mktemp -d)\ncd \"$TEST\" && clawhub install atxswap --force\ncd skills/atxswap && npm install   # pulls atxswap-sdk from npm (~15s)\nnode scripts/query.js              # should print usage\n```\n\n## Suggested changelog\n\n```text\nInitial ClawHub release for ATX wallet, query, swap, liquidity, and transfer\nworkflows on BSC. Compatible with both ClawHub/OpenClaw clients and the\nstandalone skills.sh runtime.\n```\n\nFile v0.0.31:README.zh.md\n\n# ATXSwap 技能\n\nBSC 上 **ATXSwap** 智能体去中心化交换协议的技能包。同一份 `SKILL.md` 同时兼容以\n**Claude Code** 和 **OpenClaw** 为代表的客户端，无需为不同客户端维护多份目录。\n\n[**English**](./README.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK (npm)**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK 源码 / 文档**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\n项目背景与简要[团队介绍](https://docs.atxswap.com/zh/guide/team)见 ATXSwap 文档站（[English](https://docs.atxswap.com/guide/team)）。本文档说明技能能力与脚本用法。\n\n## 能力范围\n\n- 为当前技能实例创建单个钱包（**不支持导入已有私钥**）\n- 查询 ATX 价格、余额、LP 仓位和 ERC20 代币信息\n- 在 PancakeSwap V3 上买卖 ATX/USDT\n- 预估自定义区间流动性、添加流动性、减仓、收手续费、销毁空仓位 NFT\n- 转账 BNB、ATX、USDT 或任意 ERC20 代币\n\n## 目录结构\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## 安装\n\n### OpenClaw 安装\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code 安装\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\n默认会使用内置的 6 个 BSC 公共 RPC 端点做 fallback。如需覆盖，可将\n`BSC_RPC_URL` 设为单个地址或逗号分隔的多个地址（按从左到右的优先级回退）：\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## 常用命令\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\n在支持 `${SKILL_DIR}` 注入的运行时中，建议使用 `cd \"${SKILL_DIR}\"`，以便技能\n能在客户端管理的任意安装目录下正常运行。\n\n## 流动性预估\n\n做自定义区间流动性时，不要在对话里直接猜另一边代币数量。建议先预估，再执行写入：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\n支持的区间模式：\n\n- `--range-percent <n>`：以当前 ATX 价格为中心展开，例如 `20` 表示 `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`：显式指定 `1 ATX = 多少 USDT`\n- `--tick-lower <n> --tick-upper <n>`：直接指定 V3 tick\n\n推荐流程：\n\n1. 先执行 `query.js price` 或 `liquidity.js quote-add`\n2. 把返回的 `estimatedAmounts` 展示给用户\n3. 等用户确认\n4. 再执行 `liquidity.js add`\n\n## 手续费预览\n\n收手续费前，先预览目标仓位：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` 会根据流动性 L、价格区间与当前池价计算 **仓内代币约数**（**`principalAtx`** / **`principalUsdt`**、`principal0`/`principal1`，与前端 `getAmountsForLiquidity` 同源）；并给出 **`priceRangeUsdtPerAtx`**（区间内 USDT/ATX）、**`currentPriceUsdtPerAtx`**、**`currentPriceInRange`**；待收 **`pendingFees`**（`atx`、`usdt`），以及链上 `tokensOwed*` 与 `collectable*`。说明「头寸里有多少币」时请引用 **`principal*`**；说明区间与现价用价格字段而非 tick；判断是否值得收割时优先看 **`pendingFees`** / **`collectable*`**。\n\n`liquidity.js remove <tokenId> <percent>` 现在本身就会发起一笔链上 `multicall`：\n`decreaseLiquidity` -> `collect` -> 且当 `percent = 100` 时再 `burn`。\n也就是说，100% 移除会在销毁 NFT 前自动收走当前可提取资金。若 `remove ... 100` 已成功，再对同一个\n`tokenId` 执行 `collect` 报错是预期行为，因为该头寸 NFT 已不存在。\n\n## 安全规则\n\n1. 不要在聊天输出中暴露私钥或密码。\n2. 所有写操作前，必须先预览价格、报价、余额或仓位。\n3. 交换、转账、流动性操作前，必须等待用户明确确认。\n4. 所有写操作都按主网真实资产处理。\n5. 删除钱包前，必须先要求用户导出并备份加密 keystore。\n6. 删除钱包还需要第二次确认：用户必须明确发送 `force delete wallet`。\n7. 转账时，必须把 `(资产, from, to, amount)` 作为一笔唯一转账意图来处理，并在执行前完整复述给用户确认。\n8. 一旦转账命令已经返回 `txHash`，就视为这笔转账已经发出；除非用户明确要求“再转一次”，否则不能对同一笔转账自动重复发送。\n9. 如果转账执行处于不确定状态，例如 RPC 超时、网络中断、命令输出不完整但可能已经签名/广播，不能盲目重试；必须先查链上状态或余额变化，再让用户确认是否重试。\n10. 用户询问“当前余额”“现在还有多少币”“当前 LP 持仓”“待收手续费”“还剩多少 ATX”这类现时状态时，必须先重新查询链上最新数据，不能直接复用聊天里之前的结果、缓存值或记忆中的数字。\n\n## 防重复转账\n\n为避免重复转账，建议固定执行下面的最小流程：\n\n1. 先查余额或钱包状态\n2. 明确展示 `(资产, from, to, amount)`\n3. 等用户对这组参数明确确认\n4. 只执行一次转账命令\n5. 返回 `txHash`\n6. 如果用户再次发出相同请求，先确认他们是否真的要再转一笔，而不是引用上一次结果\n\n## 实时查询约束\n\n涉及下面这些问题时，必须先查链上再回答：\n\n- 钱包余额\n- ATX / USDT 持仓\n- LP NFT 仓位\n- 仓位里的 `principalAtx` / `principalUsdt`\n- 待收手续费\n- 当前池价、报价\n\n推荐约束：\n\n1. 余额问题先跑 `query.js balance`\n2. LP / 持仓问题先跑 `query.js positions`\n3. 价格问题先跑 `query.js price`\n4. 报价问题先跑 `query.js quote`\n5. 如果查询失败，要明确说明“本次未能刷新链上最新数据”，不能拿旧结果顶替\n\n## 删除钱包\n\n只有在以下两个条件都满足后，才能删除钱包：\n\n1. 用户已明确确认加密 keystore 备份完成\n2. 用户已明确发送 `force delete wallet`\n\n然后再执行：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.31:skill-card.md\n\n## Description:\n\nManage ATX on BSC with wallet creation, price and balance queries, PancakeSwap V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 transfers.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[agentswapx](https://clawhub.ai/user/agentswapx)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and agents use this skill to manage an ATX wallet on BSC, refresh current balances and LP positions, preview ATX/USDT swaps or liquidity changes, and execute confirmed transfers or DeFi transactions.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can manage a BSC wallet with real assets and submit swaps, transfers, and liquidity transactions.\n\nMitigation: Keep wallet balances limited, inspect each preview, and require explicit user confirmation before any write transaction.\n\nRisk: Wallet credentials and encrypted keystore backups are sensitive even when the raw private key is not exposed.\n\nMitigation: Use a strong unique wallet password, prefer writing protected keystore exports to local files, and avoid sharing keystore material through uncontrolled channels.\n\nRisk: Passing wallet passwords through non-interactive command-line arguments can expose them through shell history or process listings.\n\nMitigation: Use interactive password entry or protected local secret storage when available, and avoid placing wallet passwords in command-line arguments.\n\nRisk: Network or RPC ambiguity during transfer submission could lead to duplicate sends if retried blindly.\n\nMitigation: After a transaction hash or ambiguous submission, inspect chain or wallet state before retrying and confirm whether the user intends a new transfer.\n\n## Reference(s):\n\n- [ATXSwap skill source](https://github.com/agentswapx/skills/tree/main/atxswap)\n- [ATXSwap SDK on npm](https://www.npmjs.com/package/atxswap-sdk)\n- [ATXSwap SDK source and docs](https://github.com/agentswapx/atxswap-sdk)\n- [ATXSwap team introduction](https://docs.atxswap.com/guide/team)\n- [ATXSwap team introduction (ZH)](https://docs.atxswap.com/zh/guide/team)\n- [ClawHub skill page](https://clawhub.ai/agentswapx/skills/atxswap)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown guidance with shell commands and JSON command outputs]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Outputs may include live on-chain query summaries, transaction hashes, wallet metadata, and encrypted keystore backup material when explicitly requested by the user.]\n\n## Skill Version(s):\n\n0.0.31 (source: frontmatter, package.json, CHANGELOG, release evidence)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nFile v0.0.31:package-lock.json\n\n{\n  \"name\": \"atxswap\",\n  \"version\": \"0.0.31\",\n  \"lockfileVersion\": 3,\n  \"requires\": true,\n  \"packages\": {\n    \"\": {\n      \"name\": \"atxswap\",\n      \"version\": \"0.0.31\",\n      \"dependencies\": {\n        \"atxswap-sdk\": \"^0.0.15\"\n      }\n    },\n    \"node_modules/@adraffy/ens-normalize\": {\n      \"version\": \"1.11.1\",\n      \"resolved\": \"https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz\",\n      \"integrity\": \"sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/@noble/ciphers\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz\",\n      \"integrity\": \"sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/curves\": {\n      \"version\": \"1.9.1\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz\",\n      \"integrity\": \"sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/hashes\": \"1.8.0\"\n      },\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/hashes\": {\n      \"version\": \"1.8.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz\",\n      \"integrity\": \"sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/base\": {\n      \"version\": \"1.2.6\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz\",\n      \"integrity\": \"sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==\",\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/bip32\": {\n      \"version\": \"1.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz\",\n      \"integrity\": \"sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/curves\": \"~1.9.0\",\n        \"@noble/hashes\": \"~1.8.0\",\n        \"@scure/base\": \"~1.2.5\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/bip39\": {\n      \"version\": \"1.6.0\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz\",\n      \"integrity\": \"sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/hashes\": \"~1.8.0\",\n        \"@scure/base\": \"~1.2.5\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/abitype\": {\n      \"version\": \"1.2.3\",\n      \"resolved\": \"https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz\",\n      \"integrity\": \"sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==\",\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/wevm\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.0.4\",\n        \"zod\": \"^3.22.0 || ^4.0.0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        },\n        \"zod\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/atxswap-sdk\": {\n      \"version\": \"0.0.15\",\n      \"resolved\": \"https://registry.npmjs.org/atxswap-sdk/-/atxswap-sdk-0.0.15.tgz\",\n      \"integrity\": \"sha512-XreDhbbl17BIcSK+TF8heTN/vAWvB54CiljuQiYT8pWUl5Lvm1n3B/IaSFNw3Y5z1m0UyCiYNjCz8paEBg3Y8w==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"viem\": \"^2.31.3\"\n      },\n      \"engines\": {\n        \"node\": \">=18.0.0\"\n      }\n    },\n    \"node_modules/eventemitter3\": {\n      \"version\": \"5.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz\",\n      \"integrity\": \"sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/isows\": {\n      \"version\": \"1.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/isows/-/isows-1.0.7.tgz\",\n      \"integrity\": \"sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"peerDependencies\": {\n        \"ws\": \"*\"\n      }\n    },\n    \"node_modules/ox\": {\n      \"version\": \"0.14.20\",\n      \"resolved\": \"https://registry.npmjs.org/ox/-/ox-0.14.20.tgz\",\n      \"integrity\": \"sha512-rby38C3nDn8eQkf29Zgw4hkCZJ64Qqi0zRPWL8ENUQ7JVuoITqrVtwWQgM/He19SCMUEc7hS/Sjw0jIOSLJhOw==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@adraffy/ens-normalize\": \"^1.11.0\",\n        \"@noble/ciphers\": \"^1.3.0\",\n        \"@noble/curves\": \"1.9.1\",\n        \"@noble/hashes\": \"^1.8.0\",\n        \"@scure/bip32\": \"^1.7.0\",\n        \"@scure/bip39\": \"^1.6.0\",\n        \"abitype\": \"^1.2.3\",\n        \"eventemitter3\": \"5.0.1\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.4.0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/viem\": {\n      \"version\": \"2.48.4\",\n      \"resolved\": \"https://registry.npmjs.org/viem/-/viem-2.48.4.tgz\",\n      \"integrity\": \"sha512-mReP/rgY2P+WeeRSG4sUvccCLKfyAW1C73Y3KkobAqgzYmVna9qyUMNE44xIUkDtfvRuC33r24UhF4baBYovsg==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/curves\": \"1.9.1\",\n        \"@noble/hashes\": \"1.8.0\",\n        \"@scure/bip32\": \"1.7.0\",\n        \"@scure/bip39\": \"1.6.0\",\n        \"abitype\": \"1.2.3\",\n        \"isows\": \"1.0.7\",\n        \"ox\": \"0.14.20\",\n        \"ws\": \"8.18.3\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.0.4\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/ws\": {\n      \"version\": \"8.18.3\",\n      \"resolved\": \"https://registry.npmjs.org/ws/-/ws-8.18.3.tgz\",\n      \"integrity\": \"sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \">=10.0.0\"\n      },\n      \"peerDependencies\": {\n        \"bufferutil\": \"^4.0.1\",\n        \"utf-8-validate\": \">=5.0.2\"\n      },\n      \"peerDependenciesMeta\": {\n        \"bufferutil\": {\n          \"optional\": true\n        },\n        \"utf-8-validate\": {\n          \"optional\": true\n        }\n      }\n    }\n  }\n}\n\nFile v0.0.31:package.json\n\n{\n  \"name\": \"atxswap\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"version\": \"0.0.31\",\n  \"description\": \"Standalone skills.sh-oriented ATX trading skill for BSC wallet, query, swap, liquidity, and transfer workflows\",\n  \"scripts\": {\n    \"bootstrap\": \"npm install\",\n    \"check:price\": \"node scripts/query.js price\",\n    \"check:wallets\": \"node scripts/wallet.js list\"\n  },\n  \"dependencies\": {\n    \"atxswap-sdk\": \"^0.0.15\"\n  }\n}\n\nArchive v0.0.30: 15 files, 32106 bytes\n\nFiles: CHANGELOG.md (6324b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (5287b), README.zh.md (5226b), scripts/_helpers.js (5234b), scripts/_v3math.js (1840b), scripts/liquidity.js (21209b), scripts/query.js (6421b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (20269b), _meta.json (127b)\n\nFile v0.0.30:SKILL.md\n\n---\nname: atxswap\ndescription: >-\n  Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap\n  V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 transfers.\n  Use when the user mentions ATX, BSC, PancakeSwap V3, wallet creation, price checks,\n  buying, selling, liquidity, fees, holdings, LP positions, or token transfers.\nversion: \"0.0.30\"\ncompatibility: Requires Node.js 18+ and npm. Network access to BSC RPC required.\ninject:\n  - bash: echo \"${CLAUDE_SKILL_DIR:-$(cd \"$(dirname \"$0\")/..\" && pwd)}\"\n    as: SKILL_DIR\nmetadata:\n  author: agentswapx\n  openclaw:\n    requires:\n      bins:\n        - node\n        - npm\n    homepage: https://github.com/agentswapx/skills/tree/main/atxswap\n    os:\n      - linux\n      - macos\n---\n\n# ATXSwap Skill\n\nExecute ATX trading and wallet workflows on BSC. This skill is designed for\nagents that need safe, repeatable commands for wallet management, ATX/USDT\nquotes, swaps, V3 liquidity actions, and transfers.\n\n- **SDK**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk) on npm ([source](https://github.com/agentswapx/atxswap-sdk))\n- **Docs (team / project)**: [Team introduction (EN)](https://docs.atxswap.com/guide/team) · [Team introduction (ZH)](https://docs.atxswap.com/zh/guide/team)\n- **Keystore dir**: `~/.config/atxswap/keystore` (fixed, not configurable)\n- **Secrets dir**: `~/.config/atxswap/` (master.key + secrets.json)\n\n## Use This Skill For\n\n- Create the single wallet used by this skill instance (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions (see **Required agent reply for holdings** under `query.js`), quotes, and arbitrary ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Add liquidity (full range or a custom **price range in USDT per ATX** or **tick** bounds), remove liquidity, collect fees, or burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Before First Use\n\nThis skill ships its own Node scripts and depends on `atxswap-sdk`.\n\n1. Open the skill directory where this `SKILL.md` is installed.\n2. Run `npm install` there before using any script.\n3. If `npm install` fails, stop and report the dependency error instead of guessing.\n\nIf the skill is installed via ClawHub or OpenClaw CLI, the install location is\ntypically `~/.clawhub/skills/atxswap/` (or the equivalent client-managed path).\nIf you cloned this repository directly, the location is `skills/atxswap/`.\n\n## Script Location\n\nUse the skill directory path to locate scripts. If `${SKILL_DIR}` is available\n(injected by skills.sh-compatible runtimes), use it; otherwise use the absolute\npath to this skill's installed directory.\n\nExample:\n\n```bash\ncd skills/atxswap && npm install\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\n```\n\nAll examples below use `cd \"${SKILL_DIR}\" &&` for clarity. If your runtime does\nnot inject `${SKILL_DIR}`, replace it with the absolute path of the installed\nskill directory.\n\n## Runtime Notes\n\n- `BSC_RPC_URL` is optional and supports comma-separated values for fallback,\n  e.g. `BSC_RPC_URL=\"https://primary,https://backup1,https://backup2\"`. When\n  unset, scripts use a built-in fallback list of 6 BSC public RPC endpoints\n  and viem will retry them in order.\n- Wallet files live under `~/.config/atxswap/keystore`.\n- Secure secrets live under `~/.config/atxswap/` (master.key + secrets.json).\n- Only **one wallet** is allowed per skill installation. If a wallet already\n  exists, `wallet.js create` fails.\n- Use `wallet.js list` before creating a wallet.\n- Importing an existing private key via this skill is **not supported**. If the\n  user asks to import a private key, refuse and tell them to use a dedicated\n  wallet tool of their choice.\n- Scripts write JSON output. `wallet.js export` prints the address's\n  encrypted **MetaMask-compatible keystore V3 JSON** to stdout (or writes it\n  to a file via `--out <file>`); it never prints the raw private key.\n- `query.js quote` can return a JSON error if the configured Quoter or RPC\n  rejects the simulation. Surface the error and do not proceed to a write.\n- For custom-range liquidity, do **not** guess the second token amount from chat.\n  First run `liquidity.js quote-add` or use `liquidity.js add --base-token ... --amount ...`\n  so the script computes the counter-asset from the live pool price and range.\n\n## Password Rules\n\nWhen the user asks to **create** a wallet:\n\n1. Ask the user for a password first (do NOT generate one).\n2. Pass it via `--password <pwd>` to the script when running non-interactively.\n3. The password is auto-saved to secure storage after creation.\n4. Never print the password back to the chat.\n5. After the wallet is created, export and send the encrypted keystore backup to\n   the user who requested the wallet.\n6. Clearly label it as encrypted keystore backup material, not the raw private key.\n7. Do not upload it to any website or send it to any third party.\n\nFor **swap**, **transfer**, and **liquidity** operations, rely on auto-unlock\nfirst. Only ask for the password if auto-unlock fails.\n\nIf the user says they forgot the wallet password or asks to recover it, first\nexplain that saved wallet passwords are encrypted at rest in the local\nSecretStore (for example Keychain, Secret Service, or the file backend under\n`~/.config/atxswap/`) and are not stored by the agent in chat memory. Even if\nthe user confirms, do **not** print the password in chat; guide them to use a\ntrusted local workflow instead.\n\n## Hard Safety Rules\n\n1. Treat all BSC writes as real-asset operations.\n2. **NEVER** output private keys or passwords in chat.\n3. **ALWAYS** run a preview before write actions: query price, quote, balance,\n   or positions as appropriate.\n4. **ALWAYS** show the preview to the user and wait for explicit confirmation\n   before swap, transfer, or liquidity writes.\n5. **NEVER** execute large trades without the user saying \"yes\" or \"confirm\".\n6. `wallet.js export` only emits the **encrypted MetaMask-compatible keystore\n   JSON**, never the raw private key. There is no command that prints the\n   unencrypted private key, and the agent must not attempt to derive or display\n   one.\n7. Prefer `wallet.js export <address> --out <file>` and tell the user the file\n   path. Avoid pasting the keystore JSON itself into chat unless the user\n   explicitly asks for it.\n8. Before deleting a wallet, keystore file, or any private-key-bearing wallet\n   material, **ALWAYS** remind the user to export and back up the encrypted\n   keystore first. Do not delete anything until the user explicitly confirms\n   that the keystore backup has been completed.\n9. Wallet deletion requires a second explicit confirmation: after backup is\n   confirmed, require the user to send the exact phrase `force delete wallet` before\n   running any delete command.\n10. If the user asks to delete a wallet, do **NOT** send the keystore\n    immediately. First ask whether they want to receive the encrypted keystore\n    backup. Only after the user agrees may you export and send the keystore to\n    the user.\n11. If the user explicitly asks to back up or export the wallet, export and\n    send the encrypted keystore backup to the user who requested the wallet,\n    and clearly label it as keystore backup material.\n12. The encrypted keystore may only be sent to the user who owns the current\n    session request. **NEVER** send the keystore through any channel that is not\n    under that user's own control.\n    It may only be sent to the user personally, and must not be pasted into any\n    external form or sent to any other person, group, agent, or service.\n13. After `wallet.js create` succeeds, export and send the encrypted keystore\n    to the user who requested the wallet. Treat this as part of the wallet\n    creation handoff, but only to that user.\n14. If the user asks to recover or reveal a saved wallet password, remind them\n   that the password is encrypted in local secure storage and must not be\n   disclosed in chat. Do not attempt to print, derive, or expose the password\n   even after user confirmation.\n15. If the user asks to recover, reveal, print, or paste the wallet private key,\n    refuse. Offer `wallet.js export <address> --out <file>` as the only\n    supported backup path, because it exports an encrypted keystore instead of\n    exposing the raw private key.\n\n## Required Preview Flow\n\nBefore every write action:\n\n1. Query the price, quote, balance, or positions that match the requested action.\n2. Summarize the preview in plain language.\n3. Ask the user to confirm.\n4. Execute the write command only after confirmation.\n5. Return the transaction hash and the key result fields.\n\n## High-Value Workflows\n\n### Check market state\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\n### Preview before swap\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\n```\n\n### Execute after confirmation\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\n```\n\n## Command Reference\n\n### `wallet.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js create [name] --password <pwd>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\ncd \"${SKILL_DIR}\" && node scripts/wallet.js export <address> [--out <file>]\ncd \"${SKILL_DIR}\" && node scripts/wallet.js has-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js forget-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nAfter `wallet.js create`:\n\n1. Return the created wallet address.\n2. Run `wallet.js export <address> [--out <file>]`.\n3. Send the encrypted keystore only to the user who requested the wallet.\n4. Do not upload it to any website or send it to any third party.\n5. Explain that it is encrypted keystore backup material, not the raw private key.\n\nBefore `wallet.js delete`:\n\n1. Ask whether the user wants the encrypted keystore sent to them for backup.\n2. After the user agrees, export and send the encrypted keystore to the user only.\n3. Do not upload it to any website or send it to any third party.\n4. Require the user to explicitly confirm that the backup is complete.\n5. Require the user to send the exact phrase `force delete wallet`.\n6. Only then run `wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"`.\n\nIf the user asks to back up the wallet:\n\n1. Run `wallet.js export <address> [--out <file>]`.\n2. Send the encrypted keystore only to the user.\n3. Do not upload it to any website or send it to any third party.\n4. Explain that this is encrypted keystore backup material, not the raw private key.\n\n### `query.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/query.js token-info <tokenAddress>\n```\n\n`query.js positions` includes **principal token amounts** in the position (`principalAtx`,\n`principalUsdt`, `principal0`, `principal1`) computed from V3 `liquidity` (L), ticks (internal),\nand the pool’s current `sqrtPriceX96` (same `getAmountsForLiquidity` math as the web app). It emits\nhuman **USDT-per-ATX** bounds as **`priceRangeUsdtPerAtx.min` / `.max`**, **`currentPriceUsdtPerAtx`**,\nand **`currentPriceInRange`** (whether the pool tick lies inside that position). It includes\n**`pendingFees.atx`** and **`pendingFees.usdt`** as the simulated collect notionals (`collectable*`),\nplus raw `tokensOwed0`/`1` and `collectable0`/`1` for debugging. Use `collectable*` / `pendingFees`\nto decide whether a fee harvest is worth executing. Each object also includes **`feePercent`**\n(e.g. `\"0.25%\"`) for the pool’s swap-fee tier; raw **`fee`** stays the on-chain code\n(`100` / `500` / `2500` / `10000`). **Tick indices are not included** in the JSON — quote USDT/ATX\nprices and in-range state instead.\n\n**Required agent reply for holdings** when the user asks about their positions, LP NFTs, or liquidity holdings (per position):\n\nRun `query.js positions <address>` (omit `tokenId` to list all ATX/USDT V3 NFTs). The CLI prints\n**one JSON object per NFT**; include **every** position. For each position, the answer **must**\naddress the topics below (label them in the user’s language when replying). **Do not** show raw\nV3 tick numbers to the user — use **USDT per 1 ATX** from the JSON below.\n\n| Topic | What to include | CLI JSON fields |\n|-------|-----------------|-----------------|\n| **Tokens in the position** | **In-range liquidity** as ATX and USDT notionals — always cite **`principalAtx`** and **`principalUsdt`** (and optionally `principal0` / `principal1` in pool token0/token1 order). These are computed at the **current pool price**. Mention `liquidity` only as the raw **L** scalar if explaining detail. Do **not** treat **`query.js balance`** as LP “position tokens”: wallet ATX/USDT/BNB balances are unrelated to NFT principal — if shown, label them distinctly (e.g. “Wallet balances, separate from this LP NFT”). |\n| **NFT token ID** | The V3 LP NFT id | `tokenId` |\n| **Pool swap fee tier** | The pool’s trading fee as a **percentage** for end users | Prefer **`feePercent`** (e.g. `\"0.25%\"`). If you show the raw tier code, pair it with **`feePercent`** (e.g. `2500` + `0.25%`). |\n| **Price range & spot** | Configured **min/max USDT per 1 ATX** for the position, and current pool price in the same unit | **`priceRangeUsdtPerAtx.min`**, **`priceRangeUsdtPerAtx.max`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`** (confirm “in range” / “out of range” in natural language). |\n| **Pending fees** | Uncollected fees (both tokens) | Always show **`pendingFees.atx`** and **`pendingFees.usdt`** explicitly. Prefer these over quoting only one asset. Optionally reference `collectableAtx`/`collectableUsdt` synonyms. State fees stay **pending** until `liquidity.js collect`. |\n\nDo not answer with only raw pool indices (ticks). If there are no positions, relay `No ATX/USDT positions found.` exactly.\n\nMinor mismatch vs on-chain bookkeeping can occur because `principal*` uses the same float-based\ntick→√P path as other tooling (~wei-level); values are intended for humans and routing, not audits.\n\n### `swap.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/swap.js sell <atxAmount> [--from address] [--slippage bps] [--password <pwd>]\n```\n\n### `liquidity.js`\n\n**`add` — price / tick range** (same USDT/ATX semantics as the web app; default full range = full-width liquidity):\n\n- Default: no extra flags means **full range** (same as before).\n- `--full-range`: explicit full range (do not combine with the two groups below).\n- `--min-price` / `--max-price`: band in **USDT per 1 ATX**; the script reads pool `token0` and maps to `tickLower` / `tickUpper` like the app (`token1/token0` + `tickSpacing`). **Both** prices are required.\n- `--range-percent`: band around **current ATX price** as a percentage; e.g. `20` means about `-20%` to `+20%` of the current price.\n- `--tick-lower` / `--tick-upper`: raw V3 ticks (**both** required; script uses the smaller as lower, larger as upper, clamped to valid V3 bounds).\n- `quote-add <atx|usdt> <amount>`: given live price and range, estimate the other leg — use before a write.\n- `add --base-token <atx|usdt> --amount <n>`: single-sided notional; script computes the other leg and executes the add.\n\nOptional: `--slippage-bps` (0–10000; default from SDK).\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add <atx|usdt> <amount> [range opts]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js remove <tokenId> <percent> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js burn <tokenId> [--from address] [--password <pwd>]\n```\n\n`liquidity.js remove` already uses a single `multicall`:\n`decreaseLiquidity` -> `collect` -> and when `percent = 100`, `burn`.\nThat means a full removal automatically collects withdrawable funds and destroys the LP NFT in the same transaction, so\nrunning `collect` again for the same `tokenId` is expected to fail because the position no longer exists.\n\nBefore `collect`, preview the target position with:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\nPrefer `pendingFees` / `collectableAtx` / `collectableUsdt` over relying on `tokensOwed0/1` alone when deciding whether\nfees are available, because the raw `tokensOwed` fields may stay at zero while\n`collect()` can still succeed.\n\nExample (not full-range; align the range with the user using `query.js price` before writes):\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --min-price 0.05 --max-price 0.15\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --tick-lower -20000 --tick-upper 1000\n```\n\nMapping user phrasing to commands:\n\n- If the user asks to add **0.1 USDT** of liquidity with a **±20%** range around spot, first run\n  `quote-add usdt 0.1 --range-percent 20`.\n- Show the returned `estimatedAmounts` (or equivalent summary) and wait for confirmation.\n- After confirmation, run\n  `add --base-token usdt --amount 0.1 --range-percent 20 --from <address>`.\n\n### `transfer.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/transfer.js bnb <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js usdt <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js token <tokenAddress> <to> <amount> [--from address] [--password <pwd>]\n```\n\n## When To Refuse Or Pause\n\n- Missing wallet but the user requests a write action\n- Missing confirmation for swap, transfer, or liquidity writes\n- User asks to delete a wallet, keystore file, or private-key-bearing wallet\n  material before confirming that the encrypted keystore has been backed up\n- User asks to delete a wallet but has not agreed to receive the keystore backup first\n- User asks to delete a wallet but has not explicitly sent `force delete wallet`\n- User asks to send or upload a keystore through a channel not under their own\n  control, or to anyone other than the user\n- User asks to recover or reveal a saved wallet password in chat\n- User asks to recover, reveal, print, or paste a wallet private key in chat\n- `npm install` has not been run successfully in the skill directory\n- RPC, dependency, or wallet-unlock errors that make the state unclear\n\n## Standard Workflow\n\nFor any write action:\n\n1. Query current price, quote, balance, or positions as needed.\n2. Summarize the preview for the user.\n3. Wait for explicit confirmation.\n4. Execute the write command.\n5. Report the transaction hash and result.\n\nFile v0.0.30:README.md\n\n# ATXSwap Skill\n\nA skill bundle for the ATXSwap decentralized agent exchange protocol on BSC. A single `SKILL.md`\nworks across clients represented by **Claude Code** and **OpenClaw**, so you do\nnot need separate directories for different clients.\n\n[**中文文档**](./README.zh.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK on npm**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK source / docs**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\nFor project background and a short [team introduction](https://docs.atxswap.com/guide/team) ([中文](https://docs.atxswap.com/zh/guide/team)), see the ATXSwap documentation site. This README describes the skill’s scope and scripts.\n\n## What This Skill Covers\n\n- Create the single wallet used by the skill (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions, and ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Preview custom-range liquidity, add liquidity, remove liquidity, collect fees, and burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Directory Layout\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## Install\n\n### OpenClaw Install\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code Install\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\nBy default the skill uses a built-in fallback list of 6 BSC public RPC\nendpoints. To override, set `BSC_RPC_URL` to a single URL or to a\ncomma-separated list (priority left to right):\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## Common Commands\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\nWhen invoked through a `${SKILL_DIR}`-aware runtime, `cd \"${SKILL_DIR}\"` is\npreferred so the skill works regardless of where the client installed it.\n\n## Liquidity Preview\n\nFor custom-range liquidity, do not guess the second token amount from chat.\nPreview first, then write:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\nSupported custom range modes:\n\n- `--range-percent <n>`: expands around the current ATX price, e.g. `20` means `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`: explicit `USDT per 1 ATX`\n- `--tick-lower <n> --tick-upper <n>`: raw V3 ticks\n\nRecommended flow:\n\n1. Run `query.js price` or `liquidity.js quote-add`\n2. Show the returned `estimatedAmounts` to the user\n3. Wait for confirmation\n4. Execute `liquidity.js add`\n\n## Fee Harvest Preview\n\nBefore collecting fees, preview the position first:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` returns **principal** notionals (**`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`) from liquidity L and spot (`getAmountsForLiquidity`); human **USDT-per-ATX** band **`priceRangeUsdtPerAtx`**, spot **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; plus raw `tokensOwed*` / `collectable*` for debugging. Prefer **`principal*`** when explaining tokens in-range; **`pendingFees`** / **`collectable*`** before fee harvest — do **not** surface raw tick indices to users.\n\n`liquidity.js remove <tokenId> <percent>` already performs a single on-chain `multicall`:\n`decreaseLiquidity` -> `collect` -> and when `percent = 100`, `burn`.\nSo a full removal already collects withdrawable funds before burning the NFT. After a successful `remove ... 100`,\nrunning `collect` again for the same `tokenId` is expected to fail because the position NFT no longer exists.\n\n## Security Rules\n\n1. Never expose private keys or passwords in chat output.\n2. Always preview price, quote, balance, or positions before write actions.\n3. Always wait for explicit user confirmation before swap, transfer, or liquidity writes.\n4. Treat all write actions as mainnet asset operations.\n5. Before deleting a wallet, require the user to export and back up the encrypted keystore first.\n6. Wallet deletion requires a second confirmation: the user must explicitly send `force delete wallet`.\n\n## Wallet Deletion\n\nDelete a wallet only after both confirmations are complete:\n\n1. The user confirms the encrypted keystore backup is done\n2. The user explicitly sends `force delete wallet`\n\nThen run:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.30:_meta.json\n\n{\n  \"ownerId\": \"kn7b4v7fs97tk2t9cd0z2zef0s84e311\",\n  \"slug\": \"atxswap\",\n  \"version\": \"0.0.30\",\n  \"publishedAt\": 1778050652292\n}\n\nFile v0.0.30:CHANGELOG.md\n\n# Changelog\n\n## 0.0.30\n\n- ClawHub republish; registry tarball unchanged (`atxswap-sdk` **`^0.0.15`**). Docs: `llms.txt` updated to reference latest **`0.0.30`**.\n\n## 0.0.29\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: emits **`priceRangeUsdtPerAtx`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; **`tickLower`/`tickUpper`** removed from printed JSON. `SKILL.md` / `README*` updated.\n\n## 0.0.28\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: add **`feePercent`** (human-readable pool swap fee, e.g. `\"0.25%\"`; raw **`fee`** remains the on-chain tier code such as `2500`). `SKILL.md` instructs agents to prefer **`feePercent`** in user-facing summaries.\n\n## 0.0.27\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**); includes **`principalAtx`/`principalUsdt`** in `query.js positions`, `_v3math.js`, and updated `SKILL.md`/`README*` for LP-vs-wallet semantics.\n\n## 0.0.26\n\n- `query.js positions` outputs **`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`: in-range token amounts computed from `liquidity` + ticks + spot `sqrtPriceX96` (`getAmountsForLiquidity`), using SDK-provided `principal*` when present (future `atxswap-sdk` versions) to avoid an extra `getPrice()` call. `SKILL.md` updated: distinguish LP principal from **`query.js balance`** (wallet); warns agents not to substitute wallet balances for position tokens; table row fully English. `README.md` / `README.zh.md` fee section documents `principal*` vs `collectable*`.\n\n## 0.0.25\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14). `SKILL.md` is English-only; documents required agent reply for LP holdings (tokens, NFT id, price range, pending fees); `liquidity.js` narrative translated to English.\n\n## 0.0.24\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); skill scripts use shared `jsonStringify` for BigInt-safe JSON output.\n\n## 0.0.23\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); `SKILL.md` hard-safety keystore channel wording (English).\n\n## 0.0.22\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.21\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.20\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.19\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.18\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.13` (npm 0.0.13).\n\n## 0.0.17\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.12` (npm 0.0.12).\n\n## 0.0.16\n\n- ClawHub registry publish (no functional change from 0.0.15 bundle).\n\n## 0.0.14\n\n- Bumped bundled `atxswap-sdk` to `^0.0.11` (BSC `DEFAULT_RPC_URLS`: 6 endpoints, `bsc-dataseed.bnbchain.org` first).\n\n## 0.0.13\n\n- Bumped bundled `atxswap-sdk` to `^0.0.10` (default slippage when omitted is now **1%** / `100` bps, was 3%).\n\n## 0.0.12\n\n- Bumped bundled `atxswap-sdk` to `^0.0.9` (npm README / docs links).\n- `README` / `README.zh` / `SKILL.md`: link to ATXSwap documentation [team introduction](https://docs.atxswap.com/guide/team) pages.\n\n## 0.0.11\n\n- Bumped bundled `atxswap-sdk` to `^0.0.8` (npm maintenance release).\n\n## 0.0.9\n\n- Bumped `atxswap-sdk` to `^0.0.7` so `wallet.js export` emits\n  MetaMask-compatible encrypted keystore V3 JSON. SDK 0.0.7 uses the standard\n  Web3 Secret Storage MAC (`keccak256`) and can re-export legacy SDK keystores\n  without exposing raw private keys.\n\n## 0.0.8\n\n- Tightened `SKILL.md` safety guidance: before deleting a wallet/keystore, remind\n  the user to back up the encrypted keystore and wait for explicit confirmation\n  of backup. On forgotten-password and recovery requests, explain local\n  encrypted storage and **never** print passwords in chat. Refuse to reveal\n  or paste private keys; point users to `wallet.js export` (encrypted\n  keystore) only.\n\n## 0.0.7\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.6` so the skill uses the\n  cron/headless SecretStore fixes from SDK 0.0.6. Cron, SSH, and other\n  non-desktop Linux environments now fall back to the encrypted file backend\n  instead of failing on `secret-tool store`.\n- `wallet.js create` now includes `passwordSaved` and optional\n  `passwordSaveError` in its JSON output, making password persistence failures\n  visible without treating them as wallet-creation failures.\n\n## 0.0.6\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.5` so the skill picks up\n  the corrected `DEFAULT_CONTRACTS` (production ATX token + ATX/USDT pool\n  addresses on BSC mainnet). Required because npm semver treats `^0.0.x` as\n  pinned to that exact patch, so older dependency ranges would never have\n  resolved to `0.0.5`.\n- Version `0.0.5` was intentionally skipped to keep the skill release line\n  distinct from the SDK release line going forward.\n\n## 0.0.4\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.3` (required for the new\n  `WalletManager.exportKeystore()` API used by `wallet.js export`).\n- Removed `wallet.js import <privateKey>` and the public\n  `WalletManager.importPrivateKey()` SDK method. Importing an existing private\n  key is no longer supported through this skill or the underlying SDK; the only\n  way to provision a wallet for this skill instance is `wallet.js create`.\n- Replaced `wallet.js export <address>` raw private-key output with **keystore\n  V3 JSON** export. The `WalletManager.exportPrivateKey()` SDK method has been\n  removed and superseded by `WalletManager.exportKeystore(address)`, which\n  returns the on-disk encrypted keystore. `wallet.js export` now also supports\n  `--out <file>` to write the keystore to disk instead of printing to stdout.\n  The skill no longer has any path that exposes the unencrypted private key.\n\n## 0.0.1\n\n- Initial OpenClaw and ClawHub skill bundle for ATX trading on BSC\n- Added self-contained scripts for wallet, query, swap, liquidity, and transfer flows\n- Added OpenClaw-oriented `SKILL.md`, publish notes, and localized README files\n- Normalized runtime failures to compact JSON errors for cleaner agent output\n\nFile v0.0.30:PUBLISH.md\n\n# Publish Notes\n\nThis directory is published to **ClawHub** as a single skill bundle that also\nworks as a standalone `skills.sh`-compatible package (Claude / Cursor / Codex\nCLI). The same `SKILL.md` frontmatter declares both conventions, so a single\nsource of truth covers all clients. After publish, the skill is installable via\nboth `clawhub install atxswap` and `openclaw skills install atxswap` (OpenClaw\npulls from the same ClawHub registry).\n\n> Heads up: the OpenClaw CLI itself does **not** have `skills publish` or\n> `skills validate` subcommands. All publishing flows through the dedicated\n> `clawhub` CLI (`npm install -g clawhub`).\n\n## Pre-publish checklist\n\n1. Bump versions consistently:\n   - `SKILL.md` frontmatter `version`\n   - `package.json` `version`\n   - These two MUST match — `clawhub publish --version` overrides them at\n     upload time but mismatched local values confuse `skills.sh` consumers.\n2. Install dependencies inside this directory (`npm install`) so the SDK\n   builds cleanly.\n3. Run the local read-only checks:\n   - `node scripts/wallet.js list`\n   - `node scripts/query.js price`\n   - `node scripts/query.js quote buy 1`\n4. Confirm the folder does not include secrets, keystore files, or\n   `node_modules/`. (`.clawhubignore` already excludes `node_modules/`,\n   `.clawhub/`, `.clawdhub/`, `.DS_Store`, `*.log`.)\n5. Make sure the parent submodule (`agentswapx/skills`) is committed and\n   pushed — the published `homepage` URL points at GitHub.\n\n## Authenticate with ClawHub\n\n```bash\n# Browser flow (opens a token-grant page)\nclawhub login\n\n# Or token flow (no browser)\nclawhub login --token <YOUR_TOKEN> --no-browser\n\n# Verify\nclawhub whoami\n```\n\n## Publish\n\n```bash\nclawhub publish ./skills/atxswap \\\n  --slug atxswap \\\n  --name \"ATXSwap\" \\\n  --version 0.0.1 \\\n  --tags latest,atxswap,atx,bsc,trading\n```\n\nAfter upload there is a brief security-scan window during which `clawhub\ninspect atxswap` returns \"Skill is hidden while security scan is pending\".\n\nOnce the scan completes, ClawHub will flag this skill as \"suspicious\" because\nVirusTotal Code Insight detects crypto-key / external-API patterns — that is\nexpected for any wallet SDK and not a real warning. Users must pass `--force`\nin non-interactive contexts:\n\n```bash\nclawhub install atxswap --force\n```\n\n## Verify the published skill\n\n```bash\n# Registry round-trip\nclawhub inspect atxswap\n\n# End-user simulation in a clean directory\nTEST=$(mktemp -d)\ncd \"$TEST\" && clawhub install atxswap --force\ncd skills/atxswap && npm install   # pulls atxswap-sdk from npm (~15s)\nnode scripts/query.js              # should print usage\n```\n\n## Suggested changelog\n\n```text\nInitial ClawHub release for ATX wallet, query, swap, liquidity, and transfer\nworkflows on BSC. Compatible with both ClawHub/OpenClaw clients and the\nstandalone skills.sh runtime.\n```\n\nFile v0.0.30:README.zh.md\n\n# ATXSwap 技能\n\nBSC 上 **ATXSwap** 智能体去中心化交换协议的技能包。同一份 `SKILL.md` 同时兼容以\n**Claude Code** 和 **OpenClaw** 为代表的客户端，无需为不同客户端维护多份目录。\n\n[**English**](./README.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK (npm)**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK 源码 / 文档**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\n项目背景与简要[团队介绍](https://docs.atxswap.com/zh/guide/team)见 ATXSwap 文档站（[English](https://docs.atxswap.com/guide/team)）。本文档说明技能能力与脚本用法。\n\n## 能力范围\n\n- 为当前技能实例创建单个钱包（**不支持导入已有私钥**）\n- 查询 ATX 价格、余额、LP 仓位和 ERC20 代币信息\n- 在 PancakeSwap V3 上买卖 ATX/USDT\n- 预估自定义区间流动性、添加流动性、减仓、收手续费、销毁空仓位 NFT\n- 转账 BNB、ATX、USDT 或任意 ERC20 代币\n\n## 目录结构\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## 安装\n\n### OpenClaw 安装\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code 安装\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\n默认会使用内置的 6 个 BSC 公共 RPC 端点做 fallback。如需覆盖，可将\n`BSC_RPC_URL` 设为单个地址或逗号分隔的多个地址（按从左到右的优先级回退）：\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## 常用命令\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\n在支持 `${SKILL_DIR}` 注入的运行时中，建议使用 `cd \"${SKILL_DIR}\"`，以便技能\n能在客户端管理的任意安装目录下正常运行。\n\n## 流动性预估\n\n做自定义区间流动性时，不要在对话里直接猜另一边代币数量。建议先预估，再执行写入：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\n支持的区间模式：\n\n- `--range-percent <n>`：以当前 ATX 价格为中心展开，例如 `20` 表示 `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`：显式指定 `1 ATX = 多少 USDT`\n- `--tick-lower <n> --tick-upper <n>`：直接指定 V3 tick\n\n推荐流程：\n\n1. 先执行 `query.js price` 或 `liquidity.js quote-add`\n2. 把返回的 `estimatedAmounts` 展示给用户\n3. 等用户确认\n4. 再执行 `liquidity.js add`\n\n## 手续费预览\n\n收手续费前，先预览目标仓位：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` 会根据流动性 L、价格区间与当前池价计算 **仓内代币约数**（**`principalAtx`** / **`principalUsdt`**、`principal0`/`principal1`，与前端 `getAmountsForLiquidity` 同源）；并给出 **`priceRangeUsdtPerAtx`**（区间内 USDT/ATX）、**`currentPriceUsdtPerAtx`**、**`currentPriceInRange`**；待收 **`pendingFees`**（`atx`、`usdt`），以及链上 `tokensOwed*` 与 `collectable*`。说明「头寸里有多少币」时请引用 **`principal*`**；说明区间与现价用价格字段而非 tick；判断是否值得收割时优先看 **`pendingFees`** / **`collectable*`**。\n\n`liquidity.js remove <tokenId> <percent>` 现在本身就会发起一笔链上 `multicall`：\n`decreaseLiquidity` -> `collect` -> 且当 `percent = 100` 时再 `burn`。\n也就是说，100% 移除会在销毁 NFT 前自动收走当前可提取资金。若 `remove ... 100` 已成功，再对同一个\n`tokenId` 执行 `collect` 报错是预期行为，因为该头寸 NFT 已不存在。\n\n## 安全规则\n\n1. 不要在聊天输出中暴露私钥或密码。\n2. 所有写操作前，必须先预览价格、报价、余额或仓位。\n3. 交换、转账、流动性操作前，必须等待用户明确确认。\n4. 所有写操作都按主网真实资产处理。\n5. 删除钱包前，必须先要求用户导出并备份加密 keystore。\n6. 删除钱包还需要第二次确认：用户必须明确发送 `force delete wallet`。\n\n## 删除钱包\n\n只有在以下两个条件都满足后，才能删除钱包：\n\n1. 用户已明确确认加密 keystore 备份完成\n2. 用户已明确发送 `force delete wallet`\n\n然后再执行：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.30:package-lock.json\n\n{\n  \"name\": \"atxswap\",\n  \"version\": \"0.0.30\",\n  \"lockfileVersion\": 3,\n  \"requires\": true,\n  \"packages\": {\n    \"\": {\n      \"name\": \"atxswap\",\n      \"version\": \"0.0.30\",\n      \"dependencies\": {\n        \"atxswap-sdk\": \"^0.0.15\"\n      }\n    },\n    \"node_modules/@adraffy/ens-normalize\": {\n      \"version\": \"1.11.1\",\n      \"resolved\": \"https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz\",\n      \"integrity\": \"sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/@noble/ciphers\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz\",\n      \"integrity\": \"sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/curves\": {\n      \"version\": \"1.9.1\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz\",\n      \"integrity\": \"sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/hashes\": \"1.8.0\"\n      },\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/hashes\": {\n      \"version\": \"1.8.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz\",\n      \"integrity\": \"sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/base\": {\n      \"version\": \"1.2.6\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz\",\n      \"integrity\": \"sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==\",\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/bip32\": {\n      \"version\": \"1.7.0\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz\",\n      \"integrity\": \"sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/curves\": \"~1.9.0\",\n        \"@noble/hashes\": \"~1.8.0\",\n        \"@scure/base\": \"~1.2.5\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/bip39\": {\n      \"version\": \"1.6.0\",\n      \"resolved\": \"https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz\",\n      \"integrity\": \"sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/hashes\": \"~1.8.0\",\n        \"@scure/base\": \"~1.2.5\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/abitype\": {\n      \"version\": \"1.2.3\",\n      \"resolved\": \"https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz\",\n      \"integrity\": \"sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==\",\n      \"license\": \"MIT\",\n      \"funding\": {\n        \"url\": \"https://github.com/sponsors/wevm\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.0.4\",\n        \"zod\": \"^3.22.0 || ^4.0.0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        },\n        \"zod\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/atxswap-sdk\": {\n      \"version\": \"0.0.15\",\n      \"resolved\": \"https://registry.npmjs.org/atxswap-sdk/-/atxswap-sdk-0.0.15.tgz\",\n      \"integrity\": \"sha512-XreDhbbl17BIcSK+TF8heTN/vAWvB54CiljuQiYT8pWUl5Lvm1n3B/IaSFNw3Y5z1m0UyCiYNjCz8paEBg3Y8w==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"viem\": \"^2.31.3\"\n      },\n      \"engines\": {\n        \"node\": \">=18.0.0\"\n      }\n    },\n    \"node_modules/eventemitter3\": {\n      \"version\": \"5.0.1\",\n      \"resolved\": \"https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz\",\n      \"integrity\": \"sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/isows\": {\n      \"version\": \"1.0.7\",\n      \"resolved\": \"https://registry.npmjs.org/isows/-/isows-1.0.7.tgz\",\n      \"integrity\": \"sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"peerDependencies\": {\n        \"ws\": \"*\"\n      }\n    },\n    \"node_modules/ox\": {\n      \"version\": \"0.14.20\",\n      \"resolved\": \"https://registry.npmjs.org/ox/-/ox-0.14.20.tgz\",\n      \"integrity\": \"sha512-rby38C3nDn8eQkf29Zgw4hkCZJ64Qqi0zRPWL8ENUQ7JVuoITqrVtwWQgM/He19SCMUEc7hS/Sjw0jIOSLJhOw==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@adraffy/ens-normalize\": \"^1.11.0\",\n        \"@noble/ciphers\": \"^1.3.0\",\n        \"@noble/curves\": \"1.9.1\",\n        \"@noble/hashes\": \"^1.8.0\",\n        \"@scure/bip32\": \"^1.7.0\",\n        \"@scure/bip39\": \"^1.6.0\",\n        \"abitype\": \"^1.2.3\",\n        \"eventemitter3\": \"5.0.1\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.4.0\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/viem\": {\n      \"version\": \"2.48.4\",\n      \"resolved\": \"https://registry.npmjs.org/viem/-/viem-2.48.4.tgz\",\n      \"integrity\": \"sha512-mReP/rgY2P+WeeRSG4sUvccCLKfyAW1C73Y3KkobAqgzYmVna9qyUMNE44xIUkDtfvRuC33r24UhF4baBYovsg==\",\n      \"funding\": [\n        {\n          \"type\": \"github\",\n          \"url\": \"https://github.com/sponsors/wevm\"\n        }\n      ],\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/curves\": \"1.9.1\",\n        \"@noble/hashes\": \"1.8.0\",\n        \"@scure/bip32\": \"1.7.0\",\n        \"@scure/bip39\": \"1.6.0\",\n        \"abitype\": \"1.2.3\",\n        \"isows\": \"1.0.7\",\n        \"ox\": \"0.14.20\",\n        \"ws\": \"8.18.3\"\n      },\n      \"peerDependencies\": {\n        \"typescript\": \">=5.0.4\"\n      },\n      \"peerDependenciesMeta\": {\n        \"typescript\": {\n          \"optional\": true\n        }\n      }\n    },\n    \"node_modules/ws\": {\n      \"version\": \"8.18.3\",\n      \"resolved\": \"https://registry.npmjs.org/ws/-/ws-8.18.3.tgz\",\n      \"integrity\": \"sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==\",\n      \"license\": \"MIT\",\n      \"peer\": true,\n      \"engines\": {\n        \"node\": \">=10.0.0\"\n      },\n      \"peerDependencies\": {\n        \"bufferutil\": \"^4.0.1\",\n        \"utf-8-validate\": \">=5.0.2\"\n      },\n      \"peerDependenciesMeta\": {\n        \"bufferutil\": {\n          \"optional\": true\n        },\n        \"utf-8-validate\": {\n          \"optional\": true\n        }\n      }\n    }\n  }\n}\n\nFile v0.0.30:package.json\n\n{\n  \"name\": \"atxswap\",\n  \"private\": true,\n  \"type\": \"module\",\n  \"version\": \"0.0.30\",\n  \"description\": \"Standalone skills.sh-oriented ATX trading skill for BSC wallet, query, swap, liquidity, and transfer workflows\",\n  \"scripts\": {\n    \"bootstrap\": \"npm install\",\n    \"check:price\": \"node scripts/query.js price\",\n    \"check:wallets\": \"node scripts/wallet.js list\"\n  },\n  \"dependencies\": {\n    \"atxswap-sdk\": \"^0.0.15\"\n  }\n}\n\nArchive v0.0.29: 15 files, 31408 bytes\n\nFiles: CHANGELOG.md (6263b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4901b), README.zh.md (4837b), scripts/_helpers.js (5234b), scripts/_v3math.js (1840b), scripts/liquidity.js (20595b), scripts/query.js (6421b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (19915b), _meta.json (127b)\n\nFile v0.0.29:SKILL.md\n\n---\nname: atxswap\ndescription: >-\n  Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap\n  V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 transfers.\n  Use when the user mentions ATX, BSC, PancakeSwap V3, wallet creation, price checks,\n  buying, selling, liquidity, fees, holdings, LP positions, or token transfers.\nversion: \"0.0.29\"\ncompatibility: Requires Node.js 18+ and npm. Network access to BSC RPC required.\ninject:\n  - bash: echo \"${CLAUDE_SKILL_DIR:-$(cd \"$(dirname \"$0\")/..\" && pwd)}\"\n    as: SKILL_DIR\nmetadata:\n  author: agentswapx\n  openclaw:\n    requires:\n      bins:\n        - node\n        - npm\n    homepage: https://github.com/agentswapx/skills/tree/main/atxswap\n    os:\n      - linux\n      - macos\n---\n\n# ATXSwap Skill\n\nExecute ATX trading and wallet workflows on BSC. This skill is designed for\nagents that need safe, repeatable commands for wallet management, ATX/USDT\nquotes, swaps, V3 liquidity actions, and transfers.\n\n- **SDK**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk) on npm ([source](https://github.com/agentswapx/atxswap-sdk))\n- **Docs (team / project)**: [Team introduction (EN)](https://docs.atxswap.com/guide/team) · [Team introduction (ZH)](https://docs.atxswap.com/zh/guide/team)\n- **Keystore dir**: `~/.config/atxswap/keystore` (fixed, not configurable)\n- **Secrets dir**: `~/.config/atxswap/` (master.key + secrets.json)\n\n## Use This Skill For\n\n- Create the single wallet used by this skill instance (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions (see **Required agent reply for holdings** under `query.js`), quotes, and arbitrary ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Add liquidity (full range or a custom **price range in USDT per ATX** or **tick** bounds), remove liquidity, collect fees, or burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Before First Use\n\nThis skill ships its own Node scripts and depends on `atxswap-sdk`.\n\n1. Open the skill directory where this `SKILL.md` is installed.\n2. Run `npm install` there before using any script.\n3. If `npm install` fails, stop and report the dependency error instead of guessing.\n\nIf the skill is installed via ClawHub or OpenClaw CLI, the install location is\ntypically `~/.clawhub/skills/atxswap/` (or the equivalent client-managed path).\nIf you cloned this repository directly, the location is `skills/atxswap/`.\n\n## Script Location\n\nUse the skill directory path to locate scripts. If `${SKILL_DIR}` is available\n(injected by skills.sh-compatible runtimes), use it; otherwise use the absolute\npath to this skill's installed directory.\n\nExample:\n\n```bash\ncd skills/atxswap && npm install\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\n```\n\nAll examples below use `cd \"${SKILL_DIR}\" &&` for clarity. If your runtime does\nnot inject `${SKILL_DIR}`, replace it with the absolute path of the installed\nskill directory.\n\n## Runtime Notes\n\n- `BSC_RPC_URL` is optional and supports comma-separated values for fallback,\n  e.g. `BSC_RPC_URL=\"https://primary,https://backup1,https://backup2\"`. When\n  unset, scripts use a built-in fallback list of 6 BSC public RPC endpoints\n  and viem will retry them in order.\n- Wallet files live under `~/.config/atxswap/keystore`.\n- Secure secrets live under `~/.config/atxswap/` (master.key + secrets.json).\n- Only **one wallet** is allowed per skill installation. If a wallet already\n  exists, `wallet.js create` fails.\n- Use `wallet.js list` before creating a wallet.\n- Importing an existing private key via this skill is **not supported**. If the\n  user asks to import a private key, refuse and tell them to use a dedicated\n  wallet tool of their choice.\n- Scripts write JSON output. `wallet.js export` prints the address's\n  encrypted **MetaMask-compatible keystore V3 JSON** to stdout (or writes it\n  to a file via `--out <file>`); it never prints the raw private key.\n- `query.js quote` can return a JSON error if the configured Quoter or RPC\n  rejects the simulation. Surface the error and do not proceed to a write.\n- For custom-range liquidity, do **not** guess the second token amount from chat.\n  First run `liquidity.js quote-add` or use `liquidity.js add --base-token ... --amount ...`\n  so the script computes the counter-asset from the live pool price and range.\n\n## Password Rules\n\nWhen the user asks to **create** a wallet:\n\n1. Ask the user for a password first (do NOT generate one).\n2. Pass it via `--password <pwd>` to the script when running non-interactively.\n3. The password is auto-saved to secure storage after creation.\n4. Never print the password back to the chat.\n5. After the wallet is created, export and send the encrypted keystore backup to\n   the user who requested the wallet.\n6. Clearly label it as encrypted keystore backup material, not the raw private key.\n7. Do not upload it to any website or send it to any third party.\n\nFor **swap**, **transfer**, and **liquidity** operations, rely on auto-unlock\nfirst. Only ask for the password if auto-unlock fails.\n\nIf the user says they forgot the wallet password or asks to recover it, first\nexplain that saved wallet passwords are encrypted at rest in the local\nSecretStore (for example Keychain, Secret Service, or the file backend under\n`~/.config/atxswap/`) and are not stored by the agent in chat memory. Even if\nthe user confirms, do **not** print the password in chat; guide them to use a\ntrusted local workflow instead.\n\n## Hard Safety Rules\n\n1. Treat all BSC writes as real-asset operations.\n2. **NEVER** output private keys or passwords in chat.\n3. **ALWAYS** run a preview before write actions: query price, quote, balance,\n   or positions as appropriate.\n4. **ALWAYS** show the preview to the user and wait for explicit confirmation\n   before swap, transfer, or liquidity writes.\n5. **NEVER** execute large trades without the user saying \"yes\" or \"confirm\".\n6. `wallet.js export` only emits the **encrypted MetaMask-compatible keystore\n   JSON**, never the raw private key. There is no command that prints the\n   unencrypted private key, and the agent must not attempt to derive or display\n   one.\n7. Prefer `wallet.js export <address> --out <file>` and tell the user the file\n   path. Avoid pasting the keystore JSON itself into chat unless the user\n   explicitly asks for it.\n8. Before deleting a wallet, keystore file, or any private-key-bearing wallet\n   material, **ALWAYS** remind the user to export and back up the encrypted\n   keystore first. Do not delete anything until the user explicitly confirms\n   that the keystore backup has been completed.\n9. Wallet deletion requires a second explicit confirmation: after backup is\n   confirmed, require the user to send the exact phrase `force delete wallet` before\n   running any delete command.\n10. If the user asks to delete a wallet, do **NOT** send the keystore\n    immediately. First ask whether they want to receive the encrypted keystore\n    backup. Only after the user agrees may you export and send the keystore to\n    the user.\n11. If the user explicitly asks to back up or export the wallet, export and\n    send the encrypted keystore backup to the user who requested the wallet,\n    and clearly label it as keystore backup material.\n12. The encrypted keystore may only be sent to the user who owns the current\n    session request. **NEVER** send the keystore through any channel that is not\n    under that user's own control.\n    It may only be sent to the user personally, and must not be pasted into any\n    external form or sent to any other person, group, agent, or service.\n13. After `wallet.js create` succeeds, export and send the encrypted keystore\n    to the user who requested the wallet. Treat this as part of the wallet\n    creation handoff, but only to that user.\n14. If the user asks to recover or reveal a saved wallet password, remind them\n   that the password is encrypted in local secure storage and must not be\n   disclosed in chat. Do not attempt to print, derive, or expose the password\n   even after user confirmation.\n15. If the user asks to recover, reveal, print, or paste the wallet private key,\n    refuse. Offer `wallet.js export <address> --out <file>` as the only\n    supported backup path, because it exports an encrypted keystore instead of\n    exposing the raw private key.\n\n## Required Preview Flow\n\nBefore every write action:\n\n1. Query the price, quote, balance, or positions that match the requested action.\n2. Summarize the preview in plain language.\n3. Ask the user to confirm.\n4. Execute the write command only after confirmation.\n5. Return the transaction hash and the key result fields.\n\n## High-Value Workflows\n\n### Check market state\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\n### Preview before swap\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\n```\n\n### Execute after confirmation\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\n```\n\n## Command Reference\n\n### `wallet.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js create [name] --password <pwd>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\ncd \"${SKILL_DIR}\" && node scripts/wallet.js export <address> [--out <file>]\ncd \"${SKILL_DIR}\" && node scripts/wallet.js has-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js forget-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nAfter `wallet.js create`:\n\n1. Return the created wallet address.\n2. Run `wallet.js export <address> [--out <file>]`.\n3. Send the encrypted keystore only to the user who requested the wallet.\n4. Do not upload it to any website or send it to any third party.\n5. Explain that it is encrypted keystore backup material, not the raw private key.\n\nBefore `wallet.js delete`:\n\n1. Ask whether the user wants the encrypted keystore sent to them for backup.\n2. After the user agrees, export and send the encrypted keystore to the user only.\n3. Do not upload it to any website or send it to any third party.\n4. Require the user to explicitly confirm that the backup is complete.\n5. Require the user to send the exact phrase `force delete wallet`.\n6. Only then run `wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"`.\n\nIf the user asks to back up the wallet:\n\n1. Run `wallet.js export <address> [--out <file>]`.\n2. Send the encrypted keystore only to the user.\n3. Do not upload it to any website or send it to any third party.\n4. Explain that this is encrypted keystore backup material, not the raw private key.\n\n### `query.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/query.js token-info <tokenAddress>\n```\n\n`query.js positions` includes **principal token amounts** in the position (`principalAtx`,\n`principalUsdt`, `principal0`, `principal1`) computed from V3 `liquidity` (L), ticks (internal),\nand the pool’s current `sqrtPriceX96` (same `getAmountsForLiquidity` math as the web app). It emits\nhuman **USDT-per-ATX** bounds as **`priceRangeUsdtPerAtx.min` / `.max`**, **`currentPriceUsdtPerAtx`**,\nand **`currentPriceInRange`** (whether the pool tick lies inside that position). It includes\n**`pendingFees.atx`** and **`pendingFees.usdt`** as the simulated collect notionals (`collectable*`),\nplus raw `tokensOwed0`/`1` and `collectable0`/`1` for debugging. Use `collectable*` / `pendingFees`\nto decide whether a fee harvest is worth executing. Each object also includes **`feePercent`**\n(e.g. `\"0.25%\"`) for the pool’s swap-fee tier; raw **`fee`** stays the on-chain code\n(`100` / `500` / `2500` / `10000`). **Tick indices are not included** in the JSON — quote USDT/ATX\nprices and in-range state instead.\n\n**Required agent reply for holdings** when the user asks about their positions, LP NFTs, or liquidity holdings (per position):\n\nRun `query.js positions <address>` (omit `tokenId` to list all ATX/USDT V3 NFTs). The CLI prints\n**one JSON object per NFT**; include **every** position. For each position, the answer **must**\naddress the topics below (label them in the user’s language when replying). **Do not** show raw\nV3 tick numbers to the user — use **USDT per 1 ATX** from the JSON below.\n\n| Topic | What to include | CLI JSON fields |\n|-------|-----------------|-----------------|\n| **Tokens in the position** | **In-range liquidity** as ATX and USDT notionals — always cite **`principalAtx`** and **`principalUsdt`** (and optionally `principal0` / `principal1` in pool token0/token1 order). These are computed at the **current pool price**. Mention `liquidity` only as the raw **L** scalar if explaining detail. Do **not** treat **`query.js balance`** as LP “position tokens”: wallet ATX/USDT/BNB balances are unrelated to NFT principal — if shown, label them distinctly (e.g. “Wallet balances, separate from this LP NFT”). |\n| **NFT token ID** | The V3 LP NFT id | `tokenId` |\n| **Pool swap fee tier** | The pool’s trading fee as a **percentage** for end users | Prefer **`feePercent`** (e.g. `\"0.25%\"`). If you show the raw tier code, pair it with **`feePercent`** (e.g. `2500` + `0.25%`). |\n| **Price range & spot** | Configured **min/max USDT per 1 ATX** for the position, and current pool price in the same unit | **`priceRangeUsdtPerAtx.min`**, **`priceRangeUsdtPerAtx.max`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`** (confirm “in range” / “out of range” in natural language). |\n| **Pending fees** | Uncollected fees (both tokens) | Always show **`pendingFees.atx`** and **`pendingFees.usdt`** explicitly. Prefer these over quoting only one asset. Optionally reference `collectableAtx`/`collectableUsdt` synonyms. State fees stay **pending** until `liquidity.js collect`. |\n\nDo not answer with only raw pool indices (ticks). If there are no positions, relay `No ATX/USDT positions found.` exactly.\n\nMinor mismatch vs on-chain bookkeeping can occur because `principal*` uses the same float-based\ntick→√P path as other tooling (~wei-level); values are intended for humans and routing, not audits.\n\n### `swap.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/swap.js sell <atxAmount> [--from address] [--slippage bps] [--password <pwd>]\n```\n\n### `liquidity.js`\n\n**`add` — price / tick range** (same USDT/ATX semantics as the web app; default full range = full-width liquidity):\n\n- Default: no extra flags means **full range** (same as before).\n- `--full-range`: explicit full range (do not combine with the two groups below).\n- `--min-price` / `--max-price`: band in **USDT per 1 ATX**; the script reads pool `token0` and maps to `tickLower` / `tickUpper` like the app (`token1/token0` + `tickSpacing`). **Both** prices are required.\n- `--range-percent`: band around **current ATX price** as a percentage; e.g. `20` means about `-20%` to `+20%` of the current price.\n- `--tick-lower` / `--tick-upper`: raw V3 ticks (**both** required; script uses the smaller as lower, larger as upper, clamped to valid V3 bounds).\n- `quote-add <atx|usdt> <amount>`: given live price and range, estimate the other leg — use before a write.\n- `add --base-token <atx|usdt> --amount <n>`: single-sided notional; script computes the other leg and executes the add.\n\nOptional: `--slippage-bps` (0–10000; default from SDK).\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add <atx|usdt> <amount> [range opts]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js remove <tokenId> <percent> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js burn <tokenId> [--from address] [--password <pwd>]\n```\n\nBefore `collect`, preview the target position with:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\n```\n\nPrefer `pendingFees` / `collectableAtx` / `collectableUsdt` over relying on `tokensOwed0/1` alone when deciding whether\nfees are available, because the raw `tokensOwed` fields may stay at zero while\n`collect()` can still succeed.\n\nExample (not full-range; align the range with the user using `query.js price` before writes):\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --min-price 0.05 --max-price 0.15\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add 10 1 --tick-lower -20000 --tick-upper 1000\n```\n\nMapping user phrasing to commands:\n\n- If the user asks to add **0.1 USDT** of liquidity with a **±20%** range around spot, first run\n  `quote-add usdt 0.1 --range-percent 20`.\n- Show the returned `estimatedAmounts` (or equivalent summary) and wait for confirmation.\n- After confirmation, run\n  `add --base-token usdt --amount 0.1 --range-percent 20 --from <address>`.\n\n### `transfer.js`\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/transfer.js bnb <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js usdt <to> <amount> [--from address] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js token <tokenAddress> <to> <amount> [--from address] [--password <pwd>]\n```\n\n## When To Refuse Or Pause\n\n- Missing wallet but the user requests a write action\n- Missing confirmation for swap, transfer, or liquidity writes\n- User asks to delete a wallet, keystore file, or private-key-bearing wallet\n  material before confirming that the encrypted keystore has been backed up\n- User asks to delete a wallet but has not agreed to receive the keystore backup first\n- User asks to delete a wallet but has not explicitly sent `force delete wallet`\n- User asks to send or upload a keystore through a channel not under their own\n  control, or to anyone other than the user\n- User asks to recover or reveal a saved wallet password in chat\n- User asks to recover, reveal, print, or paste a wallet private key in chat\n- `npm install` has not been run successfully in the skill directory\n- RPC, dependency, or wallet-unlock errors that make the state unclear\n\n## Standard Workflow\n\nFor any write action:\n\n1. Query current price, quote, balance, or positions as needed.\n2. Summarize the preview for the user.\n3. Wait for explicit confirmation.\n4. Execute the write command.\n5. Report the transaction hash and result.\n\nFile v0.0.29:README.md\n\n# ATXSwap Skill\n\nA skill bundle for the ATXSwap decentralized agent exchange protocol on BSC. A single `SKILL.md`\nworks across clients represented by **Claude Code** and **OpenClaw**, so you do\nnot need separate directories for different clients.\n\n[**中文文档**](./README.zh.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK on npm**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK source / docs**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\nFor project background and a short [team introduction](https://docs.atxswap.com/guide/team) ([中文](https://docs.atxswap.com/zh/guide/team)), see the ATXSwap documentation site. This README describes the skill’s scope and scripts.\n\n## What This Skill Covers\n\n- Create the single wallet used by the skill (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions, and ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Preview custom-range liquidity, add liquidity, remove liquidity, collect fees, and burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Directory Layout\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## Install\n\n### OpenClaw Install\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code Install\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\nBy default the skill uses a built-in fallback list of 6 BSC public RPC\nendpoints. To override, set `BSC_RPC_URL` to a single URL or to a\ncomma-separated list (priority left to right):\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## Common Commands\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\nWhen invoked through a `${SKILL_DIR}`-aware runtime, `cd \"${SKILL_DIR}\"` is\npreferred so the skill works regardless of where the client installed it.\n\n## Liquidity Preview\n\nFor custom-range liquidity, do not guess the second token amount from chat.\nPreview first, then write:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\nSupported custom range modes:\n\n- `--range-percent <n>`: expands around the current ATX price, e.g. `20` means `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`: explicit `USDT per 1 ATX`\n- `--tick-lower <n> --tick-upper <n>`: raw V3 ticks\n\nRecommended flow:\n\n1. Run `query.js price` or `liquidity.js quote-add`\n2. Show the returned `estimatedAmounts` to the user\n3. Wait for confirmation\n4. Execute `liquidity.js add`\n\n## Fee Harvest Preview\n\nBefore collecting fees, preview the position first:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` returns **principal** notionals (**`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`) from liquidity L and spot (`getAmountsForLiquidity`); human **USDT-per-ATX** band **`priceRangeUsdtPerAtx`**, spot **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; plus raw `tokensOwed*` / `collectable*` for debugging. Prefer **`principal*`** when explaining tokens in-range; **`pendingFees`** / **`collectable*`** before fee harvest — do **not** surface raw tick indices to users.\n\n## Security Rules\n\n1. Never expose private keys or passwords in chat output.\n2. Always preview price, quote, balance, or positions before write actions.\n3. Always wait for explicit user confirmation before swap, transfer, or liquidity writes.\n4. Treat all write actions as mainnet asset operations.\n5. Before deleting a wallet, require the user to export and back up the encrypted keystore first.\n6. Wallet deletion requires a second confirmation: the user must explicitly send `force delete wallet`.\n\n## Wallet Deletion\n\nDelete a wallet only after both confirmations are complete:\n\n1. The user confirms the encrypted keystore backup is done\n2. The user explicitly sends `force delete wallet`\n\nThen run:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.29:_meta.json\n\n{\n  \"ownerId\": \"kn7b4v7fs97tk2t9cd0z2zef0s84e311\",\n  \"slug\": \"atxswap\",\n  \"version\": \"0.0.29\",\n  \"publishedAt\": 1777393296588\n}\n\nFile v0.0.29:CHANGELOG.md\n\n# Changelog\n\n## 0.0.29\n\n- `query.js positions`: emits **`priceRangeUsdtPerAtx`** (min/max strings, USDT per 1 ATX), **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, and **`pendingFees`** `{ atx, usdt }` (mirrors collectable notionals). Drops **`tickLower`/`tickUpper`** from printed JSON so agents answer in **price** terms only. `SKILL.md` updated: no tick spam in user replies; both fee assets must appear in pending-fee summaries.\n\n## 0.0.28\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: add **`feePercent`** (human-readable pool swap fee, e.g. `\"0.25%\"`; raw **`fee`** remains the on-chain tier code such as `2500`). `SKILL.md` instructs agents to prefer **`feePercent`** in user-facing summaries.\n\n## 0.0.27\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**); includes **`principalAtx`/`principalUsdt`** in `query.js positions`, `_v3math.js`, and updated `SKILL.md`/`README*` for LP-vs-wallet semantics.\n\n## 0.0.26\n\n- `query.js positions` outputs **`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`: in-range token amounts computed from `liquidity` + ticks + spot `sqrtPriceX96` (`getAmountsForLiquidity`), using SDK-provided `principal*` when present (future `atxswap-sdk` versions) to avoid an extra `getPrice()` call. `SKILL.md` updated: distinguish LP principal from **`query.js balance`** (wallet); warns agents not to substitute wallet balances for position tokens; table row fully English. `README.md` / `README.zh.md` fee section documents `principal*` vs `collectable*`.\n\n## 0.0.25\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14). `SKILL.md` is English-only; documents required agent reply for LP holdings (tokens, NFT id, price range, pending fees); `liquidity.js` narrative translated to English.\n\n## 0.0.24\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); skill scripts use shared `jsonStringify` for BigInt-safe JSON output.\n\n## 0.0.23\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); `SKILL.md` hard-safety keystore channel wording (English).\n\n## 0.0.22\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.21\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.20\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.19\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.18\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.13` (npm 0.0.13).\n\n## 0.0.17\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.12` (npm 0.0.12).\n\n## 0.0.16\n\n- ClawHub registry publish (no functional change from 0.0.15 bundle).\n\n## 0.0.14\n\n- Bumped bundled `atxswap-sdk` to `^0.0.11` (BSC `DEFAULT_RPC_URLS`: 6 endpoints, `bsc-dataseed.bnbchain.org` first).\n\n## 0.0.13\n\n- Bumped bundled `atxswap-sdk` to `^0.0.10` (default slippage when omitted is now **1%** / `100` bps, was 3%).\n\n## 0.0.12\n\n- Bumped bundled `atxswap-sdk` to `^0.0.9` (npm README / docs links).\n- `README` / `README.zh` / `SKILL.md`: link to ATXSwap documentation [team introduction](https://docs.atxswap.com/guide/team) pages.\n\n## 0.0.11\n\n- Bumped bundled `atxswap-sdk` to `^0.0.8` (npm maintenance release).\n\n## 0.0.9\n\n- Bumped `atxswap-sdk` to `^0.0.7` so `wallet.js export` emits\n  MetaMask-compatible encrypted keystore V3 JSON. SDK 0.0.7 uses the standard\n  Web3 Secret Storage MAC (`keccak256`) and can re-export legacy SDK keystores\n  without exposing raw private keys.\n\n## 0.0.8\n\n- Tightened `SKILL.md` safety guidance: before deleting a wallet/keystore, remind\n  the user to back up the encrypted keystore and wait for explicit confirmation\n  of backup. On forgotten-password and recovery requests, explain local\n  encrypted storage and **never** print passwords in chat. Refuse to reveal\n  or paste private keys; point users to `wallet.js export` (encrypted\n  keystore) only.\n\n## 0.0.7\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.6` so the skill uses the\n  cron/headless SecretStore fixes from SDK 0.0.6. Cron, SSH, and other\n  non-desktop Linux environments now fall back to the encrypted file backend\n  instead of failing on `secret-tool store`.\n- `wallet.js create` now includes `passwordSaved` and optional\n  `passwordSaveError` in its JSON output, making password persistence failures\n  visible without treating them as wallet-creation failures.\n\n## 0.0.6\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.5` so the skill picks up\n  the corrected `DEFAULT_CONTRACTS` (production ATX token + ATX/USDT pool\n  addresses on BSC mainnet). Required because npm semver treats `^0.0.x` as\n  pinned to that exact patch, so older dependency ranges would never have\n  resolved to `0.0.5`.\n- Version `0.0.5` was intentionally skipped to keep the skill release line\n  distinct from the SDK release line going forward.\n\n## 0.0.4\n\n- Bumped the bundled `atxswap-sdk` dependency to `^0.0.3` (required for the new\n  `WalletManager.exportKeystore()` API used by `wallet.js export`).\n- Removed `wallet.js import <privateKey>` and the public\n  `WalletManager.importPrivateKey()` SDK method. Importing an existing private\n  key is no longer supported through this skill or the underlying SDK; the only\n  way to provision a wallet for this skill instance is `wallet.js create`.\n- Replaced `wallet.js export <address>` raw private-key output with **keystore\n  V3 JSON** export. The `WalletManager.exportPrivateKey()` SDK method has been\n  removed and superseded by `WalletManager.exportKeystore(address)`, which\n  returns the on-disk encrypted keystore. `wallet.js export` now also supports\n  `--out <file>` to write the keystore to disk instead of printing to stdout.\n  The skill no longer has any path that exposes the unencrypted private key.\n\n## 0.0.1\n\n- Initial OpenClaw and ClawHub skill bundle for ATX trading on BSC\n- Added self-contained scripts for wallet, query, swap, liquidity, and transfer flows\n- Added OpenClaw-oriented `SKILL.md`, publish notes, and localized README files\n- Normalized runtime failures to compact JSON errors for cleaner agent output\n\nFile v0.0.29:PUBLISH.md\n\n# Publish Notes\n\nThis directory is published to **ClawHub** as a single skill bundle that also\nworks as a standalone `skills.sh`-compatible package (Claude / Cursor / Codex\nCLI). The same `SKILL.md` frontmatter declares both conventions, so a single\nsource of truth covers all clients. After publish, the skill is installable via\nboth `clawhub install atxswap` and `openclaw skills install atxswap` (OpenClaw\npulls from the same ClawHub registry).\n\n> Heads up: the OpenClaw CLI itself does **not** have `skills publish` or\n> `skills validate` subcommands. All publishing flows through the dedicated\n> `clawhub` CLI (`npm install -g clawhub`).\n\n## Pre-publish checklist\n\n1. Bump versions consistently:\n   - `SKILL.md` frontmatter `version`\n   - `package.json` `version`\n   - These two MUST match — `clawhub publish --version` overrides them at\n     upload time but mismatched local values confuse `skills.sh` consumers.\n2. Install dependencies inside this directory (`npm install`) so the SDK\n   builds cleanly.\n3. Run the local read-only checks:\n   - `node scripts/wallet.js list`\n   - `node scripts/query.js price`\n   - `node scripts/query.js quote buy 1`\n4. Confirm the folder does not include secrets, keystore files, or\n   `node_modules/`. (`.clawhubignore` already excludes `node_modules/`,\n   `.clawhub/`, `.clawdhub/`, `.DS_Store`, `*.log`.)\n5. Make sure the parent submodule (`agentswapx/skills`) is committed and\n   pushed — the published `homepage` URL points at GitHub.\n\n## Authenticate with ClawHub\n\n```bash\n# Browser flow (opens a token-grant page)\nclawhub login\n\n# Or token flow (no browser)\nclawhub login --token <YOUR_TOKEN> --no-browser\n\n# Verify\nclawhub whoami\n```\n\n## Publish\n\n```bash\nclawhub publish ./skills/atxswap \\\n  --slug atxswap \\\n  --name \"ATXSwap\" \\\n  --version 0.0.1 \\\n  --tags latest,atxswap,atx,bsc,trading\n```\n\nAfter upload there is a brief security-scan window during which `clawhub\ninspect atxswap` returns \"Skill is hidden while security scan is pending\".\n\nOnce the scan completes, ClawHub will flag this skill as \"suspicious\" because\nVirusTotal Code Insight detects crypto-key / external-API patterns — that is\nexpected for any wallet SDK and not a real warning. Users must pass `--force`\nin non-interactive contexts:\n\n```bash\nclawhub install atxswap --force\n```\n\n## Verify the published skill\n\n```bash\n# Registry round-trip\nclawhub inspect atxswap\n\n# End-user simulation in a clean directory\nTEST=$(mktemp -d)\ncd \"$TEST\" && clawhub install atxswap --force\ncd skills/atxswap && npm install   # pulls atxswap-sdk from npm (~15s)\nnode scripts/query.js              # should print usage\n```\n\n## Suggested changelog\n\n```text\nInitial ClawHub release for ATX wallet, query, swap, liquidity, and transfer\nworkflows on BSC. Compatible with both ClawHub/OpenClaw clients and the\nstandalone skills.sh runtime.\n```\n\nFile v0.0.29:README.zh.md\n\n# ATXSwap 技能\n\nBSC 上 **ATXSwap** 智能体去中心化交换协议的技能包。同一份 `SKILL.md` 同时兼容以\n**Claude Code** 和 **OpenClaw** 为代表的客户端，无需为不同客户端维护多份目录。\n\n[**English**](./README.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK (npm)**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK 源码 / 文档**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\n项目背景与简要[团队介绍](https://docs.atxswap.com/zh/guide/team)见 ATXSwap 文档站（[English](https://docs.atxswap.com/guide/team)）。本文档说明技能能力与脚本用法。\n\n## 能力范围\n\n- 为当前技能实例创建单个钱包（**不支持导入已有私钥**）\n- 查询 ATX 价格、余额、LP 仓位和 ERC20 代币信息\n- 在 PancakeSwap V3 上买卖 ATX/USDT\n- 预估自定义区间流动性、添加流动性、减仓、收手续费、销毁空仓位 NFT\n- 转账 BNB、ATX、USDT 或任意 ERC20 代币\n\n## 目录结构\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## 安装\n\n### OpenClaw 安装\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code 安装\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\n默认会使用内置的 6 个 BSC 公共 RPC 端点做 fallback。如需覆盖，可将\n`BSC_RPC_URL` 设为单个地址或逗号分隔的多个地址（按从左到右的优先级回退）：\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## 常用命令\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\n在支持 `${SKILL_DIR}` 注入的运行时中，建议使用 `cd \"${SKILL_DIR}\"`，以便技能\n能在客户端管理的任意安装目录下正常运行。\n\n## 流动性预估\n\n做自定义区间流动性时，不要在对话里直接猜另一边代币数量。建议先预估，再执行写入：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\n支持的区间模式：\n\n- `--range-percent <n>`：以当前 ATX 价格为中心展开，例如 `20` 表示 `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`：显式指定 `1 ATX = 多少 USDT`\n- `--tick-lower <n> --tick-upper <n>`：直接指定 V3 tick\n\n推荐流程：\n\n1. 先执行 `query.js price` 或 `liquidity.js quote-add`\n2. 把返回的 `estimatedAmounts` 展示给用户\n3. 等用户确认\n4. 再执行 `liquidity.js add`\n\n## 手续费预览\n\n收手续费前，先预览目标仓位：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js collect <tokenId> --from <address>\n```\n\n`query.js positions` 会根据流动性 L、价格区间与当前池价计算 **仓内代币约数**（**`principalAtx`** / **`principalUsdt`**、`principal0`/`principal1`，与前端 `getAmountsForLiquidity` 同源）；并给出 **`priceRangeUsdtPerAtx`**（区间内 USDT/ATX）、**`currentPriceUsdtPerAtx`**、**`currentPriceInRange`**；待收 **`pendingFees`**（`atx`、`usdt`），以及链上 `tokensOwed*` 与 `collectable*`。说明「头寸里有多少币」时请引用 **`principal*`**；说明区间与现价用价格字段而非 tick；判断是否值得收割时优先看 **`pendingFees`** / **`collectable*`**。\n\n## 安全规则\n\n1. 不要在聊天输出中暴露私钥或密码。\n2. 所有写操作前，必须先预览价格、报价、余额或仓位。\n3. 交换、转账、流动性操作前，必须等待用户明确确认。\n4. 所有写操作都按主网真实资产处理。\n5. 删除钱包前，必须先要求用户导出并备份加密 keystore。\n6. 删除钱包还需要第二次确认：用户必须明确发送 `force delete wallet`。\n\n## 删除钱包\n\n只有在以下两个条件都满足后，才能删除钱包：\n\n1. 用户已明确确认加密 keystore 备份完成\n2. 用户已明确发送 `force delete wallet`\n\n然后再执行：\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\"\n```\n\nFile v0.0.29:package-lock.json\n\n{\n  \"name\": \"atxswap\",\n  \"version\": \"0.0.29\",\n  \"lockfileVersion\": 3,\n  \"requires\": true,\n  \"packages\": {\n    \"\": {\n      \"name\": \"atxswap\",\n      \"version\": \"0.0.29\",\n      \"dependencies\": {\n        \"atxswap-sdk\": \"^0.0.15\"\n      }\n    },\n    \"node_modules/@adraffy/ens-normalize\": {\n      \"version\": \"1.11.1\",\n      \"resolved\": \"https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz\",\n      \"integrity\": \"sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==\",\n      \"license\": \"MIT\"\n    },\n    \"node_modules/@noble/ciphers\": {\n      \"version\": \"1.3.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz\",\n      \"integrity\": \"sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/curves\": {\n      \"version\": \"1.9.1\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz\",\n      \"integrity\": \"sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==\",\n      \"license\": \"MIT\",\n      \"dependencies\": {\n        \"@noble/hashes\": \"1.8.0\"\n      },\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@noble/hashes\": {\n      \"version\": \"1.8.0\",\n      \"resolved\": \"https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz\",\n      \"integrity\": \"sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==\",\n      \"license\": \"MIT\",\n      \"engines\": {\n        \"node\": \"^14.21.3 || >=16\"\n      },\n      \"funding\": {\n        \"url\": \"https://paulmillr.com/funding/\"\n      }\n    },\n    \"node_modules/@scure/base\": {\n      \"version\": \"1.2.6\",\n      \"resolved\": \"https://regi\n\nArchive v0.0.28: 15 files, 30424 bytes\n\nFiles: CHANGELOG.md (5833b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4800b), README.zh.md (4704b), scripts/_helpers.js (5234b), scripts/_v3math.js (1840b), scripts/liquidity.js (20595b), scripts/query.js (4591b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (19553b), _meta.json (127b)\n\nArchive v0.0.27: 15 files, 29909 bytes\n\nFiles: CHANGELOG.md (5494b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4800b), README.zh.md (4704b), scripts/_helpers.js (4856b), scripts/_v3math.js (1840b), scripts/liquidity.js (20595b), scripts/query.js (4512b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (19140b), _meta.json (127b)\n\nArchive v0.0.25: 14 files, 28185 bytes\n\nFiles: CHANGELOG.md (4655b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4597b), README.zh.md (4456b), scripts/_helpers.js (4856b), scripts/liquidity.js (20595b), scripts/query.js (3624b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (18728b), _meta.json (127b)\n\nArchive v0.0.24: 14 files, 27632 bytes\n\nFiles: CHANGELOG.md (4393b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4597b), README.zh.md (4456b), scripts/_helpers.js (4856b), scripts/liquidity.js (20595b), scripts/query.js (3624b), scripts/swap.js (1385b), scripts/transfer.js (2381b), scripts/wallet.js (4299b), SKILL.md (16703b), _meta.json (127b)\n\nArchive v0.0.23: 14 files, 27541 bytes\n\nFiles: CHANGELOG.md (4229b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4597b), README.zh.md (4456b), scripts/_helpers.js (4670b), scripts/liquidity.js (20654b), scripts/query.js (3644b), scripts/swap.js (1384b), scripts/transfer.js (2394b), scripts/wallet.js (4338b), SKILL.md (16703b), _meta.json (127b)\n\nArchive v0.0.22: 14 files, 27475 bytes\n\nFiles: CHANGELOG.md (4076b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4597b), README.zh.md (4456b), scripts/_helpers.js (4670b), scripts/liquidity.js (20654b), scripts/query.js (3644b), scripts/swap.js (1384b), scripts/transfer.js (2394b), scripts/wallet.js (4338b), SKILL.md (16662b), _meta.json (127b)\n\nArchive v0.0.21: 14 files, 27285 bytes\n\nFiles: CHANGELOG.md (3982b), package-lock.json (7366b), package.json (424b), PUBLISH.md (2847b), README.md (4597b), README.zh.md (4456b), scripts/_helpers.js (4670b), scripts/liquidity.js (20654b), scripts/query.js (3644b), scripts/swap.js (1384b), scripts/transfer.js (2394b), scripts/wallet.js (4338b), SKILL.md (15737b), _meta.json (127b)","readmeExcerpt":"Skill: ATXSwap Owner: agentswapx Summary: Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 trans... Tags: atx:0.0.31, atxswap:0.0.31, bsc:0.0.31, latest:0.0.31, pancakeswap:0.0.10, trading:0.0.31 Version history: v0.0.31 | 2026-05-14T15:02:37.784Z | user 0.0.31: Require live chain queries for balances/positions; tra","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"cd skills/atxswap && npm install\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list"},{"language":"bash","snippet":"cd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>"},{"language":"bash","snippet":"cd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>"},{"language":"bash","snippet":"cd \"${SKILL_DIR}\" && node scripts/swap.js buy <usdtAmount> [--from address] [--slippage bps] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add <atxAmount> <usdtAmount> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token <atx|usdt> --amount <n> [range opts] [--from address] [--slippage-bps n] [--password <pwd>]\ncd \"${SKILL_DIR}\" && node scripts/transfer.js atx <to> <amount> [--from address] [--password <pwd>]"},{"language":"bash","snippet":"cd \"${SKILL_DIR}\" && node scripts/wallet.js create [name] --password <pwd>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\ncd \"${SKILL_DIR}\" && node scripts/wallet.js export <address> [--out <file>]\ncd \"${SKILL_DIR}\" && node scripts/wallet.js has-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js forget-password <address>\ncd \"${SKILL_DIR}\" && node scripts/wallet.js delete <address> --backup-confirmed yes --force-phrase \"force delete wallet\""},{"language":"bash","snippet":"cd \"${SKILL_DIR}\" && node scripts/query.js price\ncd \"${SKILL_DIR}\" && node scripts/query.js balance <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js quote <buy|sell> <amount>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address>\ncd \"${SKILL_DIR}\" && node scripts/query.js positions <address> <tokenId>\ncd \"${SKILL_DIR}\" && node scripts/query.js token-info <tokenAddress>"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: atxswap\ndescription: >-\n  Manage ATX on BSC with wallet creation, price and balance queries, PancakeSwap\n  V3 swaps, liquidity operations, LP positions and holdings, and BNB/ERC20 transfers.\n  Use when the user mentions ATX, BSC, PancakeSwap V3, wallet creation, price checks,\n  buying, selling, liquidity, fees, holdings, LP positions, or token transfers.\nversion: \"0.0.31\"\ncompatibility: Requires Node.js 18+ and npm. Network access to BSC RPC required.\ninject:\n  - bash: echo \"${CLAUDE_SKILL_DIR:-$(cd \"$(dirname \"$0\")/..\" && pwd)}\"\n    as: SKILL_DIR\nmetadata:\n  author: agentswapx\n  openclaw:\n    requires:\n      bins:\n        - node\n        - npm\n    homepage: https://github.com/agentswapx/skills/tree/main/atxswap\n    os:\n      - linux\n      - macos\n---\n\n# ATXSwap Skill\n\nExecute ATX trading and wallet workflows on BSC. This skill is designed for\nagents that need safe, repeatable commands for wallet management, ATX/USDT\nquotes, swaps, V3 liquidity actions, and transfers.\n\n- **SDK**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk) on npm ([source](https://github.com/agentswapx/atxswap-sdk))\n- **Docs (team / project)**: [Team introduction (EN)](https://docs.atxswap.com/guide/team) · [Team introduction (ZH)](https://docs.atxswap.com/zh/guide/team)\n- **Keystore dir**: `~/.config/atxswap/keystore` (fixed, not configurable)\n- **Secrets dir**: `~/.config/atxswap/` (master.key + secrets.json)\n\n## Use This Skill For\n\n- Create the single wallet used by this skill instance (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions (see **Required agent reply for holdings** under `query.js`), quotes, and arbitrary ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Add liquidity (full range or a custom **price range in USDT per ATX** or **tick** bounds), remove liquidity, collect fees, or burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Before First Use\n\nThis skill ships its own Node scripts and depends on `atxswap-sdk`.\n\n1. Open the skill directory where this `SKILL.md` is installed.\n2. Run `npm install` there before using any script.\n3. If `npm install` fails, stop and report the dependency error instead of guessing.\n\nIf the skill is installed via ClawHub or OpenClaw CLI, the install location is\ntypically `~/.clawhub/skills/atxswap/` (or the equivalent client-managed path).\nIf you cloned this repository directly, the location is `skills/atxswap/`.\n\n## Script Location\n\nUse the skill directory path to locate scripts. If `${SKILL_DIR}` is available\n(injected by skills.sh-compatible runtimes), use it; otherwise use the absolute\npath to this skill's installed directory.\n\nExample:\n\n```bash\ncd skills/atxswap && npm install\ncd \"${SKILL_DIR}\" && node scripts/wallet.js list\n```\n\nAll examples below use `cd \"${SKILL_DIR}\" &&` for clarity. If your runtime does\nnot inject `${SKILL_DIR}`, replace it with the absolute path of the installed\nskill directory.\n\n## Runtime Notes\n\n- "},{"path":"README.md","content":"# ATXSwap Skill\n\nA skill bundle for the ATXSwap decentralized agent exchange protocol on BSC. A single `SKILL.md`\nworks across clients represented by **Claude Code** and **OpenClaw**, so you do\nnot need separate directories for different clients.\n\n[**中文文档**](./README.zh.md)\n\n- **GitHub**: https://github.com/agentswapx/skills\n- **SDK on npm**: [`atxswap-sdk`](https://www.npmjs.com/package/atxswap-sdk)\n- **SDK source / docs**: [agentswapx/atxswap-sdk](https://github.com/agentswapx/atxswap-sdk)\n\nFor project background and a short [team introduction](https://docs.atxswap.com/guide/team) ([中文](https://docs.atxswap.com/zh/guide/team)), see the ATXSwap documentation site. This README describes the skill’s scope and scripts.\n\n## What This Skill Covers\n\n- Create the single wallet used by the skill (importing an existing private key is not supported)\n- Query ATX price, balances, LP positions, and ERC20 token info\n- Buy or sell ATX against USDT on PancakeSwap V3\n- Preview custom-range liquidity, add liquidity, remove liquidity, collect fees, and burn empty LP NFTs\n- Transfer BNB, ATX, USDT, or arbitrary ERC20 tokens\n\n## Directory Layout\n\n```text\natxswap/\n├── SKILL.md\n├── README.md\n├── README.zh.md\n├── PUBLISH.md\n├── CHANGELOG.md\n├── .clawhubignore\n├── .gitignore\n├── package.json\n└── scripts/\n    ├── _helpers.js\n    ├── wallet.js\n    ├── query.js\n    ├── swap.js\n    ├── liquidity.js\n    └── transfer.js\n```\n\n## Install\n\n### OpenClaw Install\n\n```bash\nopenclaw skills install atxswap\n```\n\n### Claude Code Install\n\n```bash\ngit clone https://github.com/agentswapx/skills.git\ncd skills/atxswap && npm install\n```\n\nBy default the skill uses a built-in fallback list of 6 BSC public RPC\nendpoints. To override, set `BSC_RPC_URL` to a single URL or to a\ncomma-separated list (priority left to right):\n\n```bash\nexport BSC_RPC_URL=\"https://my-private-rpc.example.com,https://bsc-dataseed.bnbchain.org\"\n```\n\n## Common Commands\n\n```bash\ncd skills/atxswap && node scripts/wallet.js list\ncd skills/atxswap && node scripts/query.js price\ncd skills/atxswap && node scripts/query.js quote buy 1\ncd skills/atxswap && node scripts/query.js positions <address> <tokenId>\ncd skills/atxswap && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\n```\n\nWhen invoked through a `${SKILL_DIR}`-aware runtime, `cd \"${SKILL_DIR}\"` is\npreferred so the skill works regardless of where the client installed it.\n\n## Liquidity Preview\n\nFor custom-range liquidity, do not guess the second token amount from chat.\nPreview first, then write:\n\n```bash\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js quote-add usdt 0.1 --range-percent 20\ncd \"${SKILL_DIR}\" && node scripts/liquidity.js add --base-token usdt --amount 0.1 --range-percent 20 --from <address>\n```\n\nSupported custom range modes:\n\n- `--range-percent <n>`: expands around the current ATX price, e.g. `20` means `-20% ~ +20%`\n- `--min-price <p> --max-price <p>`: explicit `USDT per 1 ATX`\n- `--tick-lower <n> --tick-upper <n>`: raw V3 ticks\n\nRecommended flo"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7b4v7fs97tk2t9cd0z2zef0s84e311\",\n  \"slug\": \"atxswap\",\n  \"version\": \"0.0.31\",\n  \"publishedAt\": 1778770957784\n}"},{"path":"CHANGELOG.md","content":"# Changelog\n\n## 0.0.31\n\n- ClawHub republish; registry tarball unchanged (`atxswap-sdk` **`^0.0.15`**). `SKILL.md` / `README*` — require fresh on-chain reads for balances/positions; transfer intent recap, no duplicate sends after `txHash`, no blind retries on ambiguous RPC/signing.; `frontend`/`docs-site` `llms.txt` reference **`0.0.31`**.\n\n## 0.0.30\n\n- ClawHub republish; registry tarball unchanged (`atxswap-sdk` **`^0.0.15`**). Docs: `llms.txt` updated to reference latest **`0.0.30`**.\n\n## 0.0.29\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: emits **`priceRangeUsdtPerAtx`**, **`currentPriceUsdtPerAtx`**, **`currentPriceInRange`**, **`pendingFees`** `{ atx, usdt }`; **`tickLower`/`tickUpper`** removed from printed JSON. `SKILL.md` / `README*` updated.\n\n## 0.0.28\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**).\n- `query.js positions`: add **`feePercent`** (human-readable pool swap fee, e.g. `\"0.25%\"`; raw **`fee`** remains the on-chain tier code such as `2500`). `SKILL.md` instructs agents to prefer **`feePercent`** in user-facing summaries.\n\n## 0.0.27\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` **`^0.0.15`** (npm **`0.0.15`**); includes **`principalAtx`/`principalUsdt`** in `query.js positions`, `_v3math.js`, and updated `SKILL.md`/`README*` for LP-vs-wallet semantics.\n\n## 0.0.26\n\n- `query.js positions` outputs **`principalAtx`**, **`principalUsdt`**, `principal0`/`principal1`: in-range token amounts computed from `liquidity` + ticks + spot `sqrtPriceX96` (`getAmountsForLiquidity`), using SDK-provided `principal*` when present (future `atxswap-sdk` versions) to avoid an extra `getPrice()` call. `SKILL.md` updated: distinguish LP principal from **`query.js balance`** (wallet); warns agents not to substitute wallet balances for position tokens; table row fully English. `README.md` / `README.zh.md` fee section documents `principal*` vs `collectable*`.\n\n## 0.0.25\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14). `SKILL.md` is English-only; documents required agent reply for LP holdings (tokens, NFT id, price range, pending fees); `liquidity.js` narrative translated to English.\n\n## 0.0.24\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); skill scripts use shared `jsonStringify` for BigInt-safe JSON output.\n\n## 0.0.23\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14); `SKILL.md` hard-safety keystore channel wording (English).\n\n## 0.0.22\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.21\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.20\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.19\n\n- ClawHub publish: registry tarball bundles `atxswap-sdk` `^0.0.14` (npm 0.0.14).\n\n## 0.0.18\n\n- ClawHub publish: regi"},{"path":"PUBLISH.md","content":"# Publish Notes\n\nThis directory is published to **ClawHub** as a single skill bundle that also\nworks as a standalone `skills.sh`-compatible package (Claude / Cursor / Codex\nCLI). The same `SKILL.md` frontmatter declares both conventions, so a single\nsource of truth covers all clients. After publish, the skill is installable via\nboth `clawhub install atxswap` and `openclaw skills install atxswap` (OpenClaw\npulls from the same ClawHub registry).\n\n> Heads up: the OpenClaw CLI itself does **not** have `skills publish` or\n> `skills validate` subcommands. All publishing flows through the dedicated\n> `clawhub` CLI (`npm install -g clawhub`).\n\n## Pre-publish checklist\n\n1. Bump versions consistently:\n   - `SKILL.md` frontmatter `version`\n   - `package.json` `version`\n   - These two MUST match — `clawhub publish --version` overrides them at\n     upload time but mismatched local values confuse `skills.sh` consumers.\n2. Install dependencies inside this directory (`npm install`) so the SDK\n   builds cleanly.\n3. Run the local read-only checks:\n   - `node scripts/wallet.js list`\n   - `node scripts/query.js price`\n   - `node scripts/query.js quote buy 1`\n4. Confirm the folder does not include secrets, keystore files, or\n   `node_modules/`. (`.clawhubignore` already excludes `node_modules/`,\n   `.clawhub/`, `.clawdhub/`, `.DS_Store`, `*.log`.)\n5. Make sure the parent submodule (`agentswapx/skills`) is committed and\n   pushed — the published `homepage` URL points at GitHub.\n\n## Authenticate with ClawHub\n\n```bash\n# Browser flow (opens a token-grant page)\nclawhub login\n\n# Or token flow (no browser)\nclawhub login --token <YOUR_TOKEN> --no-browser\n\n# Verify\nclawhub whoami\n```\n\n## Publish\n\n```bash\nclawhub publish ./skills/atxswap \\\n  --slug atxswap \\\n  --name \"ATXSwap\" \\\n  --version 0.0.1 \\\n  --tags latest,atxswap,atx,bsc,trading\n```\n\nAfter upload there is a brief security-scan window during which `clawhub\ninspect atxswap` returns \"Skill is hidden while security scan is pending\".\n\nOnce the scan completes, ClawHub will flag this skill as \"suspicious\" because\nVirusTotal Code Insight detects crypto-key / external-API patterns — that is\nexpected for any wallet SDK and not a real warning. Users must pass `--force`\nin non-interactive contexts:\n\n```bash\nclawhub install atxswap --force\n```\n\n## Verify the published skill\n\n```bash\n# Registry round-trip\nclawhub inspect atxswap\n\n# End-user simulation in a clean directory\nTEST=$(mktemp -d)\ncd \"$TEST\" && clawhub install atxswap --force\ncd skills/atxswap && npm install   # pulls atxswap-sdk from npm (~15s)\nnode scripts/query.js              # should print usage\n```\n\n## Suggested changelog\n\n```text\nInitial ClawHub release for ATX wallet, query, swap, liquidity, and transfer\nworkflows on BSC. Compatible with both ClawHub/OpenClaw clients and the\nstandalone skills.sh runtime.\n```"}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1808,"uniquenessScore":42,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-10T13:17:15.976Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-10T15:52:05.101Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}