ston-fi / sdk

SDK for building applications on STON.fi protocol

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TON to Jetton swap not working

slyofzero opened this issue · comments

While following the code on the TON to Jetton swap guide using proxy TON, I keep getting the error.

Error occurred - Rate limit exceeded: 1 per 1 second

The code I am testing only has the wallet address changed and nothing else.

Same here.
You need to use an api key to make it work:

const provider = new TonWeb.HttpProvider('https://toncenter.com/api/v2/jsonRPC', {apiKey: 'mycode'});

TonWeb, by default, uses toncenter API with a rate limit of 1 request per second

You can obtain higher limits by:

  • requesting an API key from toncenter with a 10 request per minute limit
  • use open TON API instance, for example, from ORBS
  • found a paid instance of TON API with suitable rate limits for your case
  • selfhost an instance of TON API