Development
Learn how to set up your development environment for Onton Finance
Prerequisite You should have installed Node.js (version 18.10.0 or higher).
Step 1: Install the Onton SDK:
Step 2: Import the required libraries in your project:
Step 3: Define a helper function to wait for the sequence number to change:
Step 4: Create the main function to initialize the Onton SDK and perform operations:
Step 5: Retrieve deposit liquidity transaction messages:
Step 6: Initialize TonWeb and the wallet:
Step 7: Perform the first transfer:
Step 8: Wait for the sequence number to change:
Step 9: Perform the second transfer:
Step 10: Execute the main function:
Replace the following environment variables with your actual values:
API_KEY
WALLET_ADDRESS
TOKEN0_JETTON_ADDRESS
TOKEN1_JETTON_ADDRESS
TOKEN0_AMOUNT
TOKEN1_AMOUNT
MNEMONIC
REFERRAL_ADDRESS
Example Usage
Here’s an example of how to use the Onton SDK to perform a token swap with a referral address:
Replace the following variables with your actual values:
YOUR_SEND_JETTON_ADDRESS
YOUR_RECEIVE_JETTON_ADDRESS
YOUR_REFERRAL_ADDRESS
Onton SDK Versions
Make sure to use the latest version of the Onton SDK to access the most recent features and improvements.
Deployment
Onton Finance is built on the TON blockchain, ensuring fast and secure transactions.
When you deploy your application using the Onton SDK, it interacts directly with the TON blockchain. There’s no need for additional deployment steps.
Troubleshooting
Here are some common issues you might encounter while working with the Onton SDK and how to resolve them.
If you encounter any other issues or have questions, please reach out to our support team or consult the Onton Finance community forums for assistance.
For the latest updates and changes to the Onton SDK, refer to the SDK changelog.