@@ -27,12 +27,14 @@ export class AtomService extends Service {
2727 * @param pubkey wallet pubkey, this is different from the wallet address
2828 * @param validatorAddress validator address to delegate to
2929 * @param amountAtom how many tokens to stake in ATOM
30+ * @param restakeRewards If enabled, the rewards will be automatically restaked
3031 */
3132 async craftStakeTx (
3233 accountId : string ,
3334 pubkey : string ,
3435 validatorAddress : string ,
3536 amountAtom : number ,
37+ restakeRewards : boolean = false ,
3638 ) : Promise < CosmosTx > {
3739
3840 const { data } = await api . post < CosmosTx > (
@@ -42,6 +44,7 @@ export class AtomService extends Service {
4244 pubkey : pubkey ,
4345 validator : validatorAddress ,
4446 amount_uatom : this . atomToUatom ( amountAtom . toString ( ) ) ,
47+ restake_rewards : restakeRewards ,
4548 } ) ;
4649 return data ;
4750
@@ -75,15 +78,13 @@ export class AtomService extends Service {
7578 */
7679 async craftRestakeRewardsTx (
7780 pubkey : string ,
78- validatorAccount : string ,
7981 validatorAddress : string ,
8082 ) : Promise < CosmosTx > {
8183
8284 const { data } = await api . post < CosmosTx > (
8385 `/v1/atom/transaction/restake-rewards` ,
8486 {
8587 pubkey : pubkey ,
86- validator_account : validatorAccount ,
8788 validator_address : validatorAddress ,
8889 } ) ;
8990 return data ;
0 commit comments