Skip to main content

Introduction

Tokens in the swap.coffee platform can have associated staking pools. The staking pool information is represented by the stakingPool object, which contains details about the staking pool, such as the address, name, APY, and other relevant information. Currently, we collect staking information for the following tokens: The API located at https://tokens.swap.coffee/docs For example, for stTON (Bemo), the staking pool object looks like this:

Fields Description

Transaction Builder API

swap.coffee provides API endpoints for building stake and unstake transactions for staked tokens. These functionality eliminate the need for users to manually construct transactions.

Stake Transactions

To build a transaction for staking TON tokens, use the following endpoint:
This endpoint returns a pre-built transaction for the given stake request. The transaction must be signed and sent by the sender via their wallet.

Request Parameters

The stake transaction endpoint requires a JSON request body with the following parameters:

Example Request

Response Structure

The endpoint returns a response with the following structure:

Example Response

Unstake Transactions

To build a transaction for unstaking TON tokens, use the following endpoint:
This endpoint returns a pre-built transaction for the given unstake request. The transaction must be signed and sent by the sender via their wallet.

Request Parameters

The unstake transaction endpoint requires a JSON request body with the following parameters:

Example Request

Response Structure

The endpoint returns a response with the following structure:

Example Response

Using the built message with TonConnect

This transaction information can be used with wallet providers like TonConnect to execute the stake or unstake operation. Here’s an example of how to use the response with TonConnect: