Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion skills/pancakeswap-v3-plugin/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "pancakeswap-v3",
"description": "Swap tokens and manage liquidity on PancakeSwap V3 on BNB Chain, Base, and Arbitrum",
"version": "1.0.4",
"version": "1.0.5",
"author": {"name": "GeoGu360", "github": "GeoGu360"},
"homepage": "https://github.com/okx/plugin-store/tree/main/skills/pancakeswap-v3",
"repository": "https://github.com/okx/plugin-store",
Expand Down
2 changes: 1 addition & 1 deletion skills/pancakeswap-v3-plugin/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion skills/pancakeswap-v3-plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pancakeswap-v3-plugin"
version = "1.0.4"
version = "1.0.5"
edition = "2021"

[[bin]]
Expand Down
13 changes: 8 additions & 5 deletions skills/pancakeswap-v3-plugin/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: pancakeswap-v3-plugin
description: "Swap tokens and manage liquidity on PancakeSwap V3 on Ethereum, BNB Chain, Base, Arbitrum, and Linea"
version: "1.0.4"
version: "1.0.5"
author: "GeoGu360"
tags:
- dex
Expand All @@ -25,7 +25,7 @@ tags:
# Check for skill updates (1-hour cache)
UPDATE_CACHE="$HOME/.plugin-store/update-cache/pancakeswap-v3-plugin"
CACHE_MAX=3600
LOCAL_VER="1.0.4"
LOCAL_VER="1.0.5"
DO_CHECK=true

if [ -f "$UPDATE_CACHE" ]; then
Expand Down Expand Up @@ -98,15 +98,15 @@ case "${OS}_${ARCH}" in
mingw*_aarch64|msys*_aarch64|cygwin*_aarch64) TARGET="aarch64-pc-windows-msvc"; EXT=".exe" ;;
esac
mkdir -p ~/.local/bin
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/pancakeswap-v3-plugin@1.0.4/pancakeswap-v3-plugin-${TARGET}${EXT}" -o ~/.local/bin/.pancakeswap-v3-plugin-core${EXT}
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/pancakeswap-v3-plugin@1.0.5/pancakeswap-v3-plugin-${TARGET}${EXT}" -o ~/.local/bin/.pancakeswap-v3-plugin-core${EXT}
chmod +x ~/.local/bin/.pancakeswap-v3-plugin-core${EXT}

# Symlink CLI name to universal launcher
ln -sf "$LAUNCHER" ~/.local/bin/pancakeswap-v3-plugin

# Register version
mkdir -p "$HOME/.plugin-store/managed"
echo "1.0.4" > "$HOME/.plugin-store/managed/pancakeswap-v3-plugin"
echo "1.0.5" > "$HOME/.plugin-store/managed/pancakeswap-v3-plugin"
```

### Report install (auto-injected, runs once)
Expand All @@ -126,7 +126,7 @@ if [ ! -f "$REPORT_FLAG" ]; then
# Report to Vercel stats
curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
-H "Content-Type: application/json" \
-d '{"name":"pancakeswap-v3-plugin","version":"1.0.4"}' >/dev/null 2>&1 || true
-d '{"name":"pancakeswap-v3-plugin","version":"1.0.5"}' >/dev/null 2>&1 || true
# Report to OKX API (with HMAC-signed device token)
curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
-H "Content-Type: application/json" \
Expand Down Expand Up @@ -474,6 +474,9 @@ This command is read-only — no transactions, no gas. Default chain is BNB Chai

## Changelog

### v1.0.5
- **fix**: `eth_call` / `eth_call_with_gas` now return an explicit error when the RPC response is missing the `result` field. Previously, malformed responses were silently coerced to `"0x"` and decoded as zero, which produced misleading zero balances / zero ticks when an RPC node misbehaved (EVM-012).

### v1.0.4
- **feat**: Add `quickstart` command — checks BNB/USDT/USDC balances and LP positions on BNB Chain, returns `about` + `onboarding_steps` + `next_command` for 5 user states (active/ready/needs_gas/needs_funds/no_funds).
- **fix**: Add `ethereum-rpc.publicnode.com` and `linea-rpc.publicnode.com` to `plugin.yaml` `api_calls` — both chains were supported since v1.0.0 but their RPC domains were missing from the CI security whitelist.
Expand Down
20 changes: 10 additions & 10 deletions skills/pancakeswap-v3-plugin/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
**Overview**
## Overview

PancakeSwap V3 is a concentrated liquidity DEX. This skill lets you get swap quotes, swap tokens via SmartRouter, browse pools across fee tiers, and manage concentrated liquidity positions (add, view, remove) on BNB Chain, Base, and Arbitrum.

**Prerequisites**
## Prerequisites
- onchainos CLI installed and logged in
- Gas token on the target chain: BNB on BSC (chain 56, default), ETH on Base (8453) or Arbitrum (42161)
- Tokens to swap or provide as liquidity (e.g. WBNB / USDT / USDC / WETH)

**Quick Start**
1. Check your BNB Chain state and get a guided next step: `pancakeswap-v3 quickstart`
## Quick Start
1. Check your BNB Chain state and get a guided next step: `pancakeswap-v3-plugin quickstart`
2. If you see `status: no_funds` / `needs_gas` / `needs_funds` — fund the wallet address shown in the output (BNB for gas + USDT/USDC to trade)
3. Get a swap quote (read-only, no gas): `pancakeswap-v3 quote --from WBNB --to USDT --amount 0.1 --chain 56`
4. Execute a swap (preview first without `--confirm`, then re-run with it): `pancakeswap-v3 swap --from WBNB --to USDT --amount 0.1 --chain 56 --confirm`
5. Browse pools for a pair across all fee tiers: `pancakeswap-v3 pools --token0 WBNB --token1 USDT --chain 56`
6. Provide concentrated liquidity (auto ±10% range if ticks omitted): `pancakeswap-v3 add-liquidity --token-a WBNB --token-b USDT --fee 500 --amount-a 0.1 --amount-b 60 --chain 56`
7. If `status: active` — review your LP positions: `pancakeswap-v3 positions --owner <YOUR_ADDR> --chain 56`
8. Remove liquidity and collect accrued fees: `pancakeswap-v3 remove-liquidity --token-id <TOKEN_ID> --chain 56`
3. Get a swap quote (read-only, no gas): `pancakeswap-v3-plugin quote --from WBNB --to USDT --amount 0.1 --chain 56`
4. Execute a swap (preview first without `--confirm`, then re-run with it): `pancakeswap-v3-plugin swap --from WBNB --to USDT --amount 0.1 --chain 56 --confirm`
5. Browse pools for a pair across all fee tiers: `pancakeswap-v3-plugin pools --token0 WBNB --token1 USDT --chain 56`
6. Provide concentrated liquidity (auto ±10% range if ticks omitted): `pancakeswap-v3-plugin add-liquidity --token-a WBNB --token-b USDT --fee 500 --amount-a 0.1 --amount-b 60 --chain 56`
7. If `status: active` — review your LP positions: `pancakeswap-v3-plugin positions --owner <YOUR_ADDR> --chain 56`
8. Remove liquidity and collect accrued fees: `pancakeswap-v3-plugin remove-liquidity --token-id <TOKEN_ID> --chain 56`
2 changes: 1 addition & 1 deletion skills/pancakeswap-v3-plugin/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: 1
name: pancakeswap-v3-plugin
version: "1.0.4"
version: "1.0.5"
description: "Swap tokens and manage concentrated liquidity on PancakeSwap V3 on BNB Chain, Base, and Arbitrum"
author:
name: GeoGu360
Expand Down
10 changes: 8 additions & 2 deletions skills/pancakeswap-v3-plugin/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ pub async fn eth_call(to: &str, data: &str, rpc_url: &str) -> Result<String> {
anyhow::bail!("eth_call error: {}", decode_rpc_error(err));
}

Ok(resp["result"].as_str().unwrap_or("0x").to_string())
let result = resp["result"].as_str().ok_or_else(|| {
anyhow::anyhow!("eth_call: malformed RPC response (missing 'result' field): {}", resp)
})?;
Ok(result.to_string())
}

/// Execute an eth_call with an explicit gas limit (needed for QuoterV2 simulation).
Expand All @@ -62,7 +65,10 @@ pub async fn eth_call_with_gas(to: &str, data: &str, rpc_url: &str, gas: &str) -
anyhow::bail!("eth_call error: {}", decode_rpc_error(err));
}

Ok(resp["result"].as_str().unwrap_or("0x").to_string())
let result = resp["result"].as_str().ok_or_else(|| {
anyhow::anyhow!("eth_call_with_gas: malformed RPC response (missing 'result' field): {}", resp)
})?;
Ok(result.to_string())
}

// ── Hex decode helpers ────────────────────────────────────────────────────────
Expand Down
Loading