STON.fi
Search
K

LpWallet

This section contains op codes of the lp wallet contract as well as corresponding SDK methods
This is a standard Jetton token wallet for holding liquidity tokens. Only specific modifications for this implementation will be described.

User message handlers

burn (0x595f07bc)

Burn an amount of liquidity tokens.

TL-B

burn#595f07bc query_id:uint64 amount:Grams response_destination:MsgAddress custom_payload:Maybe ^Cell = InternalMsgBody;

Message body

Name
Type
Description
op
uint32
Operation code is equal to burn
query_id
uint64
Query id
amount
coins
Amount of coins to burn (in basic token units)
response_destination
address
Address of a user

Outgoing messages

Sends a message with burn_notification op code to the router contract with the amount of token burnt.

Build transaction

Build burn transaction.
TypeScript
async buildBurnTxParams(params: {
amount: AmountType;
responseAddress: AddressType;
queryId?: QueryIdType;
}): Promise<MessageData>

params structure

Key
Type
Description
amount
AmountType
Amount of lp tokens to burn (in basic token units)
responseAddress
AddressType
Address of a user
queryId
QueryIdType | undefined
Optional; query id

MessageData structure

Name
Type
Description
to
Address
Address of the lp wallet of a user, returned by getPoolWalletAddress
payload
Cell
Payload created by createBurnBody
gasAmount
BN
Recommended amount of $TON (in nanoTons) sent as gas
Notes:
  • the default value for gasAmount is equal to 1.1 $TON

Create payload

Create a payload to initiate a burn transaction; params structure is the same a the tx builder.
TypeScript
async createBurnBody(params: {
amount: AmountType;
responseAddress: AddressType;
queryId?: QueryIdType;
}): Promise<Cell>