Skip to content

Commit 0df9a3d

Browse files
authored
Fix ada withdraw rewards (#60)
* fix ada withdraw rewards signature * bump version
1 parent 8da8c5b commit 0df9a3d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
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.0.1",
3+
"version": "2.0.2",
44
"autor": "Kiln <[email protected]> (https://kiln.fi)",
55
"license": "BUSL-1.1",
66
"description": "JavaScript sdk for Kiln API",

src/services/ada.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ export class AdaService extends Service {
4646
/**
4747
* Craft ada withdraw rewards transaction
4848
* @param walletAddress wallet delegating that will receive the rewards
49-
* @param amountLovelace amount of rewards to withdraw in lovelace, if not provided all rewards are withdrawn
49+
* @param amountAda amount of rewards to withdraw in ADA, if not provided all rewards are withdrawn
5050
*/
5151
async craftWithdrawRewardsTx(
5252
walletAddress: string,
53-
amountLovelace?: string,
53+
amountAda?: number,
5454
): Promise<AdaTx> {
5555
try {
5656
const { data } = await api.post<AdaTx>(
5757
`/v1/ada/transaction/withdraw-rewards`,
5858
{
5959
wallet: walletAddress,
60-
amount_lovelace: amountLovelace,
60+
amount_lovelace: amountAda ? this.adaToLovelace(amountAda.toString()) : undefined,
6161
});
6262
return data;
6363
} catch (err: any) {

0 commit comments

Comments
 (0)