Skip to main content

Documentation

Welcome to the Ring Swap SDK docs. To begin, we recommend looking at the

Structured reference
TOC available

Ring Swap SDK

Welcome to the Ring Swap SDK docs. To begin, we recommend looking at the Guides. The current source of truth for the SDK lives in the sdks monorepo.

Ring Swap SDK

Use @ring-protocol/v2-sdk for normal Ring Swap integrations. The package name reflects the v2-style constant-product contract family that Ring Swap is compatible with; it should not be read as a separate Ring product generation.

npm version npm bundle size (scoped version)

@ring-protocol/v2-sdk is the FEW-aware Ring Swap SDK layer. It includes helper APIs for deriving and recognizing FewToken addresses.

Use @ring-protocol/uniswap-v2-sdk only when you explicitly want the lower-level v2-compatible primitives rather than the higher-level Ring integration layer.

FewToken Address Resolution

For Ring Swap integrations, derive FewToken addresses from the original ERC-20 with the official SDK or resolve them from the official FewFactory. A FewToken address is supported when FewFactory.getWrappedToken(underlying) returns that address; symbol and name are display metadata.

Approval spender selection depends on the integration path:

  • Official router flow: approve only the official Ring Router, Universal Router, or Permit2 address for the chain.
  • Manual wrap flow: approve only the canonical FewToken returned by FewFactory.