Authorization

Use increased rate limits with our SDK

We currently allow up to 1k requests every 10 seconds. If you're looking for higher limits, please get in touch via Telegram, Discord, or X

Authorization

Requesting increased rate limits

If you need to obtain increased rate limits for our SDK, visit our Discord and open a ticket with your respective request.

In the request you should include your public Sui address, as well as the SDK calls you desire to have increased rate limits for as well as your anticipated rate limits. Here is a template body you can fill in for your ticket:

sui-address: `<your-sui-address>`
rate-limit-requests: [`<sdk-call>`: `<desired-rate-limit>`]

Getting started

Once you have been granted increased rate limits, you will then need to begin authorizing your requests in order to take advantage of these higher limits.

Signing with a private key

Below is an example flow of how you can authorize your requests.

// initialize sdk
const af = new Aftermath("MAINNET");
await af.init();

// load keypair associated with rate limits
const keypair = Helpers.keypairFromPrivateKey(
	"suiprivkey1lkfhaslkd5fnf7836fg833j43o48ri9y34j3hg9809fjhsdsdhf8f987asd"
);

// initialize auth
const stopAuth = await af.Auth().init({
	signMessageCallback: async ({ message }) => {
		const { signature } = await keypair.signPersonalMessage(message);
		return { signature };
	},
	walletAddress: keypair.toSuiAddress(),
});

// use sdk to make requests
const pools = await af.Pools().getAllPools();

// ...

// call the returned function to stop any background requests
stopAuth();

Signing with a sui.keystore

If you use a sui.keystore file to store your private key, you can authorize your requests through the following flow.

// initialize sdk
const af = new Aftermath("MAINNET");
await af.init();

// initialize auth from sui keystore
const stopAuth = await af.Auth().initFromSuiKeystore({
	walletAddress: keypair.toSuiAddress(),
	// optional path to sui.keystore, otherwise will look in  ~/.sui/sui_config/sui.keystore
	// path: string,
});

// use sdk to make requests
const pools = await af.Pools().getAllPools();

// ...

// call the returned function to stop any background requests
stopAuth();

Last updated