Skip to content

Commit 2ac75a8

Browse files
authored
unstake from vesting contract (#105)
* unstake from vesting contract * bump version
1 parent 6e908ca commit 2ac75a8

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kilnfi/sdk",
3-
"version": "2.17.1",
3+
"version": "2.17.2",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",

src/services/ton.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,28 @@ export class TonService extends Service {
130130
return data;
131131
}
132132

133+
/**
134+
* Craft TON unstake from a vesting contract tx
135+
* @param walletAddress sender of the transaction
136+
* @param vestingContractAddress vesting contract address
137+
* @param poolAddress the pool address to unstake from
138+
* @param amountTon the amount of TON to unstake
139+
*/
140+
async craftUnstakeFromVestingContractTx(
141+
walletAddress: string,
142+
vestingContractAddress: string,
143+
poolAddress: string,
144+
amountTon: number,
145+
): Promise<TonTx> {
146+
const { data } = await api.post<TonTx>(`/v1/ton/transaction/unstake-from-vesting-contract`, {
147+
wallet: walletAddress,
148+
vesting_contract_address: vestingContractAddress,
149+
pool_address: poolAddress,
150+
amount_nanoton: this.tonToNanoTon(amountTon.toString()),
151+
});
152+
return data;
153+
}
154+
133155
/**
134156
* Sign transaction with given integration
135157
* @param integration custody solution to sign with

0 commit comments

Comments
 (0)