返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
s

sushiswap-sdk

>

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 0.1.0
安全检测
已通过
1,296
下载量
0
收藏
概述
安装方式
版本历史

sushiswap-sdk

# 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)

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 sushiswap-sdk-1776361400 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 sushiswap-sdk-1776361400 技能

通过命令行安装

skillhub install sushiswap-sdk-1776361400

下载 Zip 包

⬇ 下载 sushiswap-sdk v0.1.0

文件大小: 3.19 KB | 发布时间: 2026-4-17 14:01

v0.1.0 最新 2026-4-17 14:01
- Initial release of the SushiSwap TypeScript SDK.
- Provides typed wrappers over the SushiSwap API for tokens, prices, quotes, and swap transaction generation.
- Introduces ergonomic helpers for safer arithmetic, formatting, and comparisons.
- Supports integration with TypeScript/JavaScript applications using strongly typed primitives.
- Requires a mandatory `referrer` parameter for all swap-related calls.
- Exposes a list of supported swap networks and clarifies fee handling and customization policies.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部