diff --git a/package.json b/package.json index a65b599..ca08909 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kilnfi/sdk", - "version": "2.17.1", + "version": "2.17.2", "autor": "Kiln (https://kiln.fi)", "license": "BUSL-1.1", "description": "JavaScript sdk for Kiln API", diff --git a/src/services/ton.ts b/src/services/ton.ts index dbf3e2b..fec36e5 100644 --- a/src/services/ton.ts +++ b/src/services/ton.ts @@ -130,6 +130,28 @@ export class TonService extends Service { return data; } + /** + * Craft TON unstake from a vesting contract tx + * @param walletAddress sender of the transaction + * @param vestingContractAddress vesting contract address + * @param poolAddress the pool address to unstake from + * @param amountTon the amount of TON to unstake + */ + async craftUnstakeFromVestingContractTx( + walletAddress: string, + vestingContractAddress: string, + poolAddress: string, + amountTon: number, + ): Promise { + const { data } = await api.post(`/v1/ton/transaction/unstake-from-vesting-contract`, { + wallet: walletAddress, + vesting_contract_address: vestingContractAddress, + pool_address: poolAddress, + amount_nanoton: this.tonToNanoTon(amountTon.toString()), + }); + return data; + } + /** * Sign transaction with given integration * @param integration custody solution to sign with