Integrate widget of swap.coffee aggregator in a couple of minutes.
Swap Widget for integration swap.coffee DEX aggregator into your web application
JavaScript/TypeScript
, use the following npm package:
TON
blockchain into your application. It provides a user-friendly interface for connecting and interacting with TON-compatible wallets, allowing users to perform transactions. With TonConnect, you can securely handle wallet connections within the Swap Widget
, enhancing the user experience for token swaps.TON
wallet. It enables decentralized applications to confirm wallet ownership, ensuring trusted interactions for access control, voting, or other features requiring user validation.You can learn more about TonConnect or X-Verify(Ton Proof) and its features here (TonConnect, X-Verify(TonProof)).
light
- a light-themed interface designed for bright environments, providing a clean and minimalist appearance.dark
- a dark-themed interface suitable for low-light environments, offering a sleek, modern look.coffee
- a coffee-themed interface with a warm, earthy color scheme that provides a unique and cozy aesthetic.zh
: Chineseua
: Ukrainianru
: Russianen
: Englishes
: Spanishfr
: Frenchfa
: PersiancreateSwapWidget
function. This function is a core part of our SDK and is responsible for creating an instance of the Swap Widget within your application.
Function Overview
createSwapWidget
- initializes the Swap Widget and integrates it into your application. It takes a container element selector and a configuration object to customize the widget’s appearance and behavior.createSwapWidget
You can import the createSwapWidget
function from our SDK package as follows:
swap.coffee widget
offers two methods for connecting your application to our platform, tailored to different use cases and levels of complexity:
The TonConnect method is the simpler and more streamlined way to connect. If your application already supports TonConnectUI library, this is the recommended approach as it allows seamless integration with minimal configuration. TonConnect handles wallet authentication and transaction signing, making it ideal for projects that prioritize ease of use and compatibility with existing TON
ecosystem wallets.
For scenarios where TonConnect is unavailable or unsupported, theswap.coffee widget
provides an alternative connection method through a custompayload
mechanism. This approach eliminates the dependency on TonConnect, offering greater flexibility and ensuring compatibility in diverse environments. While slightly more complex, thepayload
method gives developers full control over authentication and transaction processes.
Swap Widget
in the way that best suits your application’s needs.