
software.crldev.elrondspringbootstarterreactive.interactor.account.ErdAccountInteractorImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of elrond-spring-boot-starter-reactive Show documentation
Show all versions of elrond-spring-boot-starter-reactive Show documentation
A SpringBoot Starter solution designed to ensure easy and efficient integration with the Elrond Network using a Reactive API layer.
The newest version!
package software.crldev.elrondspringbootstarterreactive.interactor.account;
import software.crldev.elrondspringbootstarterreactive.api.ApiResourceURI;
import software.crldev.elrondspringbootstarterreactive.api.model.*;
import software.crldev.elrondspringbootstarterreactive.client.ErdProxyClient;
import software.crldev.elrondspringbootstarterreactive.domain.account.Address;
import software.crldev.elrondspringbootstarterreactive.interactor.WrappedResponses;
import reactor.core.publisher.Mono;
import java.util.List;
import java.util.Map;
import static java.lang.String.format;
public class ErdAccountInteractorImpl implements ErdAccountInteractor {
private final ErdProxyClient client;
@Override
public Mono getAccountInfo(Address address) {
return client.get(String.format(ApiResourceURI.ACCOUNT_ON_NETWORK.getURI(), address.getBech32()), WrappedResponses.GetAccountWrapper.class).map(WrappedResponses.GetAccountWrapper::getAccount);
}
@Override
public Mono getBalance(Address address) {
return client.get(format(ApiResourceURI.ACCOUNT_BALANCE.getURI(), address.getBech32()), AccountBalance.class);
}
@Override
public Mono getNonce(Address address) {
return client.get(format(ApiResourceURI.ACCOUNT_NONCE.getURI(), address.getBech32()), AccountNonce.class);
}
@Override
public Mono> getTransactions(Address address) {
return client.get(format(ApiResourceURI.ADDRESS_TRANSACTIONS.getURI(), address.getBech32()), WrappedResponses.GetAccountTransactionsWrapper.class).map(WrappedResponses.GetAccountTransactionsWrapper::getList);
}
@Override
public Mono getStorageValue(Address address, String key) {
return client.get(format(ApiResourceURI.ACCOUNT_STORAGE_VALUE.getURI(), address.getBech32(), key), AccountStorageValue.class);
}
@Override
public Mono
© 2015 - 2025 Weber Informatics LLC | Privacy Policy