openclaw 网盘下载
OpenClaw

技能详情(站内镜像,无评论)

首页 > 技能库 > SushiSwap SDK

TypeScript SDK for interacting with the SushiSwap Aggregator and related primitives. This SDK is a typed wrapper over the SushiSwap API, providing ergonomic helpers for token amounts, prices, quotes, and swap transaction generation. USE THIS SKILL WHEN: - Building TypeScript o…

开发与 DevOps

许可证:MIT-0

MIT-0 ·免费使用、修改和重新分发。无需归因。

版本:v0.1.0

统计:⭐ 0 · 1.2k · 3 current installs · 3 all-time installs

0

安装量(当前) 3

🛡 VirusTotal :可疑 · OpenClaw :可疑

Package:0xmasayoshi/sushiswap-sdk

安全扫描(ClawHub)

  • VirusTotal :可疑
  • OpenClaw :可疑

OpenClaw 评估

The skill's instructions match a SushiSwap SDK, but the runtime examples access a PRIVATE_KEY environment variable without declaring it and the package provenance is unknown — this mismatch and missing origin information are concerning.

目的

The name/description (TypeScript SDK for SushiSwap aggregator) aligns with the SKILL.md content: examples show getQuote/getSwap, use of viem for RPC/wallet clients, and guidance about referrer and fee splits. The requested npm packages (sushi, viem) are consistent with the stated purpose.

说明范围

The reference example instructs reading process.env.PRIVATE_KEY and using it to create/send transactions. That is sensitive I/O and is not reflected in the declared requirements. The SKILL.md otherwise stays within the SDK's scope, but the example explicitly demonstrates accessing and using a private key, which the skill metadata fails to surface.

安装机制

There is no install spec (instruction-only) and the SKILL.md simply recommends installing 'sushi' and 'viem' via common package managers. This is low-risk in itself, but because the skill has unknown provenance, installing packages from the registry should be done cautiously.

证书

The skill metadata declares no required environment variables, yet the reference code reads process.env.PRIVATE_KEY to sign/send transactions. Asking for a private key (or demonstrating its use) is a high-sensitivity action and should be explicitly declared and justified. There is also a mandatory 'referrer' parameter (for affiliate/fee attribution), which may have economic implications but is not a secret; however the private key usage is not…

持久

The skill is not always-enabled (always:false) and is user-invocable. Autonomous invocation is allowed by default, which is normal. Because the skill can generate executable swap data and (per examples) request signing via an env private key, an agent invoking this skill autonomously could attempt to execute on-chain transactions if given credentials — users should be cautious about granting signing credentials to autonomous agents.

安装(复制给龙虾 AI)

将下方整段复制到龙虾中文库对话中,由龙虾按 SKILL.md 完成安装。

请把本段交给龙虾中文库(龙虾 AI)执行:为本机安装 OpenClaw 技能「SushiSwap SDK」。简介:TypeScript SDK for interacting with the SushiSwap Aggregator and related primit…。
请 fetch 以下地址读取 SKILL.md 并按文档完成安装:https://raw.githubusercontent.com/openclaw/skills/refs/heads/main/skills/0xmasayoshi/sushiswap-sdk/SKILL.md
(来源:yingzhi8.cn 技能库)

SKILL.md

打开原始 SKILL.md(GitHub raw)

---
name: sushiswap-sdk
description: >
  TypeScript SDK for interacting with the SushiSwap Aggregator and related
  primitives. This SDK is a typed wrapper over the SushiSwap API, providing
  ergonomic helpers for token amounts, prices, quotes, and swap transaction
  generation.
  
  USE THIS SKILL WHEN:
  - Building TypeScript or JavaScript applications
  - You want strongly typed token, amount, and fraction primitives
  - You need to request swap quotes or executable swap transactions via code
  - You want safer arithmetic, formatting, and comparisons without floating point errors
  - You prefer SDK-based integration over raw HTTP requests
---

# SushiSwap SDK Integration

The SushiSwap SDK is a **TypeScript wrapper** around the SushiSwap API.
It provides **strongly typed primitives** and utilities for working with
tokens, prices, swap quotes, and transaction generation.

This SDK does **not** replace the API — it builds on top of it with safer,
more expressive abstractions.

---

## Installation

Install the required packages using your package manager of choice:

```bash
pnpm add sushi viem
```

```bash
npm add sushi viem
```

```bash
yarn add sushi viem
```

```bash
bun add sushi viem
```

---

## How To Use

1. Import the appropriate SushiSwap SDK helpers from `sushi/evm`
2. Select the correct SDK method based on user intent:
    - Swap quote → `getQuote()`
    - Swap execution → `getSwap()`
3. Provide all required parameters exactly as defined by the SDK types
4. **Always include a valid `referrer` value**
5. Validate inputs (chainId, token addresses, amount, slippage) before execution
6. Use returned transaction data exactly as provided for simulation or execution

The SDK is a thin wrapper over the SushiSwap REST API — all routing, pricing, and calldata generation is still performed by the API.

---

## Supported Networks

The SushiSwap SDK exposes the list of supported swap networks via:

```ts
import { SWAP_API_SUPPORTED_CHAIN_IDS } from 'sushi/evm'
```

- Agents and integrators should always check this list before attempting to:
    - Fetch a quote
    - Generate swap transaction data
- If a requested chainId is not included:
    - The agent must fail early or prompt the user to select a supported network
    - Agents must not attempt to guess or hardcode supported chains

This list reflects the networks currently supported by the SushiSwap Aggregator API. The supported networks may change over time and should not be cached indefinitely.

--

## Mandatory `referrer` Parameter

- The `referrer` parameter **must be specified** when calling `getQuote()` or `getSwap()`
- The agent or integrator **must identify themselves** using this field
- Swap-related SDK calls must not be executed without a `referrer` value
- The SDK must not auto-generate or omit this value on behalf of the integrator

---

## Fee Customization

The SushiSwap SDK supports customized swap fees when using `getQuote()` or `getSwap()`.

### Default fee model

- Swap-related requests follow an **80/20 fee split by default**
    - **80%** to the integrator (referrer)
    - **20%** to SushiSwap
- This split applies unless explicitly overridden by SushiSwap

### Custom fee splits

- Alternative fee splits require a **partnership** with SushiSwap
- Agents and integrators should not assume custom splits are available. If users request alternative fee splits, agents should direct them to the SushiSwap
team rather than attempting to modify request parameters.

---

## Additional Reference

For detailed SDK examples & execution flow, see:

[references/REFERENCE.md](references/REFERENCE.md)