← 返回
开发者工具 中文

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 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
用于与 SushiSwap 聚合器及相关原语交互的 TypeScript SDK。该 SDK 是 SushiSwap API 的类型化包装,提供代币数量、价格、报价和交换交易生成的便捷帮助。 适用场景: - 开发 TypeScript 或 JavaScript 应用 - 需要强类型的代币、数量和分数原语 - 通过代码请求交换报价或可执行的交换交易 - 需要安全的算术、格式化和比较,避免浮点误差 - 更倾向于基于 SDK 的集成而非直接发送 HTTP 请求
0xmasayoshi 0xmasayoshi 来源
开发者工具 clawhub v0.1.0 1 版本 99943.7 Key: 无需
★ 0
Stars
📥 1,774
下载
💾 3
安装
1
版本
#latest

概述

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:

pnpm add sushi viem
npm add sushi viem
yarn add sushi viem
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:

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

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-03-28 20:25 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

professional

SushiSwap API

0xmasayoshi
利用 SushiSwap 聚合器提供 REST API,实现优化的代币兑换(含交易生成)、报价及定价。适用场景:获取 40+ EVM 网络的兑换报价、生成可执行交易数据、查询代币价格与元数据、探索支持的 AMM 流动性来源,以及通过 HTT
★ 0 📥 1,709
dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,821
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 72 📥 181,439