Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unstake from vesting contract #105

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kilnfi/sdk",
"version": "2.17.1",
"version": "2.17.2",
"autor": "Kiln <[email protected]> (https://kiln.fi)",
"license": "BUSL-1.1",
"description": "JavaScript sdk for Kiln API",
Expand Down
22 changes: 22 additions & 0 deletions src/services/ton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<TonTx> {
const { data } = await api.post<TonTx>(`/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
Expand Down
Loading