Skip to content
Closed
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/lido/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lido",
"description": "Stake ETH with Lido liquid staking protocol to receive stETH",
"version": "0.2.0",
"version": "0.2.1",
"author": {
"name": "GeoGu360",
"github": "GeoGu360"
Expand Down
2 changes: 1 addition & 1 deletion skills/lido/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/lido/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lido"
version = "0.2.0"
version = "0.2.1"
edition = "2021"

[[bin]]
Expand Down
6 changes: 3 additions & 3 deletions skills/lido/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: lido
description: Stake ETH with Lido liquid staking protocol to receive stETH, manage withdrawals, and track staking rewards. Supports staking, balance queries, withdrawal requests, withdrawal status, and claiming finalized withdrawals on Ethereum mainnet.
version: 0.2.0
version: 0.2.1
author: GeoGu360
---

Expand Down Expand Up @@ -42,7 +42,7 @@ if ! command -v lido >/dev/null 2>&1; then
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/lido@0.2.0/lido-${TARGET}${EXT}" -o ~/.local/bin/lido${EXT}
curl -fsSL "https://github.com/okx/plugin-store/releases/download/plugins/lido@0.2.1/lido-${TARGET}${EXT}" -o ~/.local/bin/lido${EXT}
chmod +x ~/.local/bin/lido${EXT}
fi
```
Expand All @@ -64,7 +64,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":"lido","version":"0.2.0"}' >/dev/null 2>&1 || true
-d '{"name":"lido","version":"0.2.1"}' >/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
2 changes: 1 addition & 1 deletion skills/lido/plugin.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema_version: 1
name: lido
version: "0.2.0"
version: "0.2.1"
description: "Stake ETH with Lido liquid staking protocol — stake, manage withdrawals, and track staking rewards on Ethereum mainnet"
author:
name: GeoGu360
Expand Down
4 changes: 2 additions & 2 deletions skills/lido/src/commands/balance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ pub async fn run(args: BalanceArgs) -> anyhow::Result<()> {
// balanceOf(address)
let balance_calldata = rpc::calldata_single_address(config::SEL_BALANCE_OF, &address);
let balance_result =
onchainos::eth_call(chain_id, config::STETH_ADDRESS, &balance_calldata)?;
onchainos::eth_call(chain_id, config::STETH_ADDRESS, &balance_calldata).await?;

// sharesOf(address)
let shares_calldata = rpc::calldata_single_address(config::SEL_SHARES_OF, &address);
let shares_result =
onchainos::eth_call(chain_id, config::STETH_ADDRESS, &shares_calldata)?;
onchainos::eth_call(chain_id, config::STETH_ADDRESS, &shares_calldata).await?;

println!("=== Lido stETH Balance ===");
println!("Address: {}", address);
Expand Down
4 changes: 2 additions & 2 deletions skills/lido/src/commands/claim_withdrawal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ pub async fn run(args: ClaimWithdrawalArgs) -> anyhow::Result<()> {
chain_id,
config::WITHDRAWAL_QUEUE_ADDRESS,
&checkpoint_calldata,
)?;
).await?;

let last_checkpoint = match rpc::extract_return_data(&checkpoint_result) {
Ok(hex) => rpc::decode_uint256(&hex).unwrap_or(1) as u64,
Expand All @@ -64,7 +64,7 @@ pub async fn run(args: ClaimWithdrawalArgs) -> anyhow::Result<()> {
chain_id,
config::WITHDRAWAL_QUEUE_ADDRESS,
&hints_calldata,
)?;
).await?;

let hints = match rpc::extract_return_data(&hints_result) {
Ok(hex) => rpc::decode_uint256_array(&hex).unwrap_or_default(),
Expand Down
4 changes: 2 additions & 2 deletions skills/lido/src/commands/get_withdrawals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pub async fn run(args: GetWithdrawalsArgs) -> anyhow::Result<()> {
chain_id,
config::WITHDRAWAL_QUEUE_ADDRESS,
&requests_calldata,
)?;
).await?;

let ids = match rpc::extract_return_data(&requests_result) {
Ok(hex) => rpc::decode_uint256_array(&hex).unwrap_or_default(),
Expand All @@ -51,7 +51,7 @@ pub async fn run(args: GetWithdrawalsArgs) -> anyhow::Result<()> {
chain_id,
config::WITHDRAWAL_QUEUE_ADDRESS,
&status_calldata,
)?;
).await?;

// Try to fetch estimated wait times from wq-api
let wait_times = fetch_wait_times(&ids).await;
Expand Down
2 changes: 1 addition & 1 deletion skills/lido/src/commands/stake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub async fn run(args: StakeArgs) -> anyhow::Result<()> {

// Pre-flight: check isStakingPaused()
let paused_calldata = format!("0x{}", config::SEL_IS_STAKING_PAUSED);
let paused_result = onchainos::eth_call(chain_id, config::STETH_ADDRESS, &paused_calldata)?;
let paused_result = onchainos::eth_call(chain_id, config::STETH_ADDRESS, &paused_calldata).await?;
if let Ok(return_data) = rpc::extract_return_data(&paused_result) {
let val = rpc::decode_uint256(&return_data).unwrap_or(0);
if val != 0 {
Expand Down
10 changes: 6 additions & 4 deletions skills/lido/src/onchainos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ pub async fn wallet_contract_call(

/// Read-only eth_call via direct JSON-RPC to public Ethereum RPC endpoint.
/// onchainos wallet contract-call does not support --read-only; use direct RPC instead.
pub fn eth_call(chain_id: u64, to: &str, input_data: &str) -> anyhow::Result<Value> {
pub async fn eth_call(chain_id: u64, to: &str, input_data: &str) -> anyhow::Result<Value> {
let rpc_url = match chain_id {
1 => "https://ethereum.publicnode.com",
_ => anyhow::bail!("Unsupported chain_id for eth_call: {}", chain_id),
Expand All @@ -82,12 +82,14 @@ pub fn eth_call(chain_id: u64, to: &str, input_data: &str) -> anyhow::Result<Val
],
"id": 1
});
let client = reqwest::blocking::Client::new();
let client = reqwest::Client::new();
let resp: Value = client
.post(rpc_url)
.json(&body)
.send()?
.json()?;
.send()
.await?
.json()
.await?;
if let Some(err) = resp.get("error") {
anyhow::bail!("eth_call RPC error: {}", err);
}
Expand Down
Loading