![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
rainbow-swap-sdk
Advanced tools
SDK for building applications on top of Rainbow.ag - Swap Aggregator on TON 💎.
This SDK is designed for building applications on top of Rainbow.ag - Swap Aggregator on TON blockchain 💎.
To receive your partnerId
, set custom fees, and enjoy a 50% revenue share, contact us in our Community Chat.
You can install the Rainbow Swap SDK using either npm or Yarn:
Using npm:
npm install rainbow-swap-sdk
Using Yarn:
yarn add rainbow-swap-sdk
import {getAssetsList, getBestRoute, toNano} from 'rainbow-swap-sdk';
// 1. Load the list of available tokens
const assetsList = await getAssetsList({
userAssets: [] // Array of asset addresses the user holds; see AssetsListParams for more details.
});
// Retrieve specific assets by their address
const inputAsset = assetsList.find(asset => asset.address === 'ton');
const outputAsset = assetsList.find(asset => asset.address === 'EQCxE6mUtQJKFnGfaROTKOt1lZbDiiX1kCixRv7Nw2Id_sDs');
// 2. Load the best swap route and swap messages
const bestRouteResponse = await getBestRoute({
inputAssetAmount: toNano('1.35', inputAsset.decimals).toString(), // Convert 1.35 TON to nano format
inputAssetAddress: inputAsset.address,
outputAssetAddress: outputAsset.address,
senderAddress: 'UQDGGjjuwhikx8ZPJsrLbKXGq7mx26D8pK_l8GqBejzB52Pa', // Optional user wallet address; if set, swap messages will be returned
partnerId: 'demo-partner' // Optional unique identifier in our App Developer Partnership program
});
// 3. Sign and send messages to the blockchain to execute the swap.
// This example uses the React UI client. For other frameworks, refer to https://docs.ton.org/develop/dapps/ton-connect/overview
import {useTonConnectUI} from '@tonconnect/ui-react';
const [tonConnectUI] = useTonConnectUI();
const result = await tonConnectUI.sendTransaction({
validUntil: Math.floor(Date.now() / 1000) + 60, // 60 seconds from now
messages: bestRouteResponse.swapMessages
});
You may want to check the status of your application to ensure everything is functioning correctly. For example, temporarily disable swaps if block production on TON is disrupted due to an external event like the DOGS listing.
import {getAppStatus} from 'rainbow-swap-sdk';
const {
isSwapsEnabled, // true if everything is working fine
message // Explanation of why swaps are disabled, if applicable
} = await getAppStatus();
For a live example of using the SDK, visit the Rainbow Swap 🌈 Repository.
For questions and suggestions, visit Community Chat.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
FAQs
SDK for building applications on top of Rainbow.ag - Swap Aggregator on TON 💎.
The npm package rainbow-swap-sdk receives a total of 4 weekly downloads. As such, rainbow-swap-sdk popularity was classified as not popular.
We found that rainbow-swap-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.