Rhino.fi Swidge Overview
Overview of the @rhino.fi/wdk-protocol-swidge-rhinofi module for Rhino.fi cross-chain routes.
The Rhino.fi Swidge module lets WDK EVM accounts quote and execute cross-chain swaps and bridges through Rhino.fi using the shared SwidgeProtocol interface.
Use this module when an app needs authenticated Rhino.fi quotes, EVM source-chain execution, live token discovery, status polling, and WDK-standard fee and status shapes.
Features
- Unified route interface: Implements
quoteSwidge(),swidge(),getSwidgeStatus(),getSupportedChains(), andgetSupportedTokens(). - Rhino.fi routing: Quotes and executes cross-chain swap and bridge routes supported by Rhino.fi.
- EVM source support: Signs source-chain deposits through
@tetherto/wdk-wallet-evmaccounts, including ERC-4337 accounts. - Authenticated API calls: Uses a Rhino.fi API key for quotes, execution, discovery, and status.
- Config caching: Caches Rhino.fi chain and token config to reduce repeated API calls.
- Fee controls: Applies optional
maxNetworkFeeBpsandmaxProtocolFeeBpslimits before execution. - Status mapping: Maps Rhino.fi operation states into canonical WDK
SwidgeStatusvalues. - Typed errors: Exposes module-specific errors for configuration, unsupported routes, fee limits, unknown operations, and execution failures.
Supported Routes
Call getSupportedChains() and getSupportedTokens() at runtime because Rhino.fi controls the live route set. Use the provider-maintained Supported Chains page as route-support context before exposing routes in production UIs.
| Ecosystem | Source-chain support | Notes |
|---|---|---|
| EVM | Supported | Uses WDK EVM accounts to sign deposits. |
| Solana | Planned | Destination support depends on Rhino.fi route availability. |
| TON | Planned | Destination support depends on Rhino.fi route availability. |
| Tron | Planned | Destination support depends on Rhino.fi route availability. |
Execution Model
swidge() submits the source-chain deposit after any required ERC-20 approval. It resolves when the deposit transaction is broadcast, while cross-chain settlement continues asynchronously.
Use getSwidgeStatus(result.id) to track the route to completion.
swidge() can approve tokens and submit an EVM deposit transaction. Show the quote, fee breakdown, recipient, source token, destination token, and destination chain before calling it.
Next Steps
Configuration
Configure API authentication, fee caps, API base URL, and config caching.
Usage
Install the package, discover support, quote a route, execute a route, and poll status.
API Reference
Review constructor options, methods, config fields, status mapping, fee mapping, and errors.