-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: withdrawable rewards should be available on Rosetta's account/b…
…alance endpoint for a given stake address.
- Loading branch information
Mateusz Czeladka
committed
Jan 31, 2025
1 parent
28bcfa6
commit 830ccda
Showing
24 changed files
with
632 additions
and
270 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
.../cardanofoundation/rosetta/api/account/mapper/StakeAccountInfoToAddressBalanceMapper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.cardanofoundation.rosetta.api.account.mapper; | ||
|
||
import org.cardanofoundation.rosetta.api.account.model.domain.AddressBalance; | ||
import org.cardanofoundation.rosetta.client.domain.StakeAccountInfo; | ||
|
||
public interface StakeAccountInfoToAddressBalanceMapper { | ||
|
||
AddressBalance convertToAddressBalance(StakeAccountInfo stakeAccountInfo, Long number); | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
...danofoundation/rosetta/api/account/mapper/StakeAccountInfoToAddressBalanceMapperImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.cardanofoundation.rosetta.api.account.mapper; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.cardanofoundation.rosetta.api.account.model.domain.AddressBalance; | ||
import org.cardanofoundation.rosetta.client.domain.StakeAccountInfo; | ||
import org.springframework.stereotype.Service; | ||
|
||
import static org.cardanofoundation.rosetta.common.util.Constants.LOVELACE; | ||
|
||
@Service | ||
@Slf4j | ||
public class StakeAccountInfoToAddressBalanceMapperImpl implements StakeAccountInfoToAddressBalanceMapper { | ||
|
||
@Override | ||
public AddressBalance convertToAddressBalance(StakeAccountInfo stakeAccountInfo, Long number) { | ||
return AddressBalance.builder() | ||
.address(stakeAccountInfo.getStakeAddress()) | ||
.unit(LOVELACE) | ||
.quantity(stakeAccountInfo.getWithdrawableAmount()) | ||
.number(number) | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
api/src/main/java/org/cardanofoundation/rosetta/client/YaciHttpGateway.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package org.cardanofoundation.rosetta.client; | ||
|
||
import org.cardanofoundation.rosetta.client.domain.StakeAccountInfo; | ||
|
||
public interface YaciHttpGateway { | ||
|
||
StakeAccountInfo getStakeAccountInfo(String stakeAddress); | ||
|
||
} |
Oops, something went wrong.