Search in sources :

Example 1 with FeignTransactionClient

use of com.github.rosklyar.client.transaction.FeignTransactionClient in project nem-library by rosklyar.

the class DefaultNemClientFactory method createTransactionClient.

@Override
public TransactionClient createTransactionClient(String configurationPrefix, Network network, MosaicClient mosaicClient, AccountClient accountClient, NodeClient nodeClient) {
    FeignTransactionClient feignTransactionClient = builder().client(RibbonClient.create()).encoder(new JacksonEncoder()).decoder(new JacksonDecoder()).target(FeignTransactionClient.class, format("http://%s", configurationPrefix));
    HexConverter hexConverter = new DefaultHexConverter();
    ByteSerializer byteSerializer = new DefaultByteSerializer(hexConverter);
    TransactionEncoder transactionEncoder = new ByteArrayTransactionEncoder(byteSerializer, hexConverter);
    VersionProvider versionProvider = new DefaultVersionProvider();
    FeeCalculator feeCalculator = new DefaultFeeCalculator(mosaicClient, accountClient);
    return new SecureTransactionClient(network, feignTransactionClient, transactionEncoder, hexConverter, versionProvider, feeCalculator, nodeClient);
}
Also used : DefaultFeeCalculator(com.github.rosklyar.client.transaction.fee.DefaultFeeCalculator) JacksonEncoder(feign.jackson.JacksonEncoder) DefaultVersionProvider(com.github.rosklyar.client.transaction.version.DefaultVersionProvider) VersionProvider(com.github.rosklyar.client.transaction.version.VersionProvider) JacksonDecoder(feign.jackson.JacksonDecoder) FeeCalculator(com.github.rosklyar.client.transaction.fee.FeeCalculator) DefaultFeeCalculator(com.github.rosklyar.client.transaction.fee.DefaultFeeCalculator) SecureTransactionClient(com.github.rosklyar.client.transaction.SecureTransactionClient) DefaultVersionProvider(com.github.rosklyar.client.transaction.version.DefaultVersionProvider) FeignTransactionClient(com.github.rosklyar.client.transaction.FeignTransactionClient)

Example 2 with FeignTransactionClient

use of com.github.rosklyar.client.transaction.FeignTransactionClient in project nem-library by rosklyar.

the class DefaultNemClientFactory method simpleTransactionClient.

@Override
public TransactionClient simpleTransactionClient(String url, Network network) {
    FeignTransactionClient feignTransactionClient = Feign.builder().encoder(new JacksonEncoder()).decoder(new JacksonDecoder()).target(FeignTransactionClient.class, url);
    HexConverter hexConverter = new DefaultHexConverter();
    ByteSerializer byteSerializer = new DefaultByteSerializer(hexConverter);
    TransactionEncoder transactionEncoder = new ByteArrayTransactionEncoder(byteSerializer, hexConverter);
    VersionProvider versionProvider = new DefaultVersionProvider();
    FeeCalculator feeCalculator = new DefaultFeeCalculator(simpleMosaicClient(url), simpleAccountClient(url));
    return new SecureTransactionClient(network, feignTransactionClient, transactionEncoder, hexConverter, versionProvider, feeCalculator, simpleNodeClient(url));
}
Also used : DefaultFeeCalculator(com.github.rosklyar.client.transaction.fee.DefaultFeeCalculator) JacksonEncoder(feign.jackson.JacksonEncoder) DefaultVersionProvider(com.github.rosklyar.client.transaction.version.DefaultVersionProvider) VersionProvider(com.github.rosklyar.client.transaction.version.VersionProvider) JacksonDecoder(feign.jackson.JacksonDecoder) FeeCalculator(com.github.rosklyar.client.transaction.fee.FeeCalculator) DefaultFeeCalculator(com.github.rosklyar.client.transaction.fee.DefaultFeeCalculator) SecureTransactionClient(com.github.rosklyar.client.transaction.SecureTransactionClient) DefaultVersionProvider(com.github.rosklyar.client.transaction.version.DefaultVersionProvider) FeignTransactionClient(com.github.rosklyar.client.transaction.FeignTransactionClient)

Aggregations

FeignTransactionClient (com.github.rosklyar.client.transaction.FeignTransactionClient)2 SecureTransactionClient (com.github.rosklyar.client.transaction.SecureTransactionClient)2 DefaultFeeCalculator (com.github.rosklyar.client.transaction.fee.DefaultFeeCalculator)2 FeeCalculator (com.github.rosklyar.client.transaction.fee.FeeCalculator)2 DefaultVersionProvider (com.github.rosklyar.client.transaction.version.DefaultVersionProvider)2 VersionProvider (com.github.rosklyar.client.transaction.version.VersionProvider)2 JacksonDecoder (feign.jackson.JacksonDecoder)2 JacksonEncoder (feign.jackson.JacksonEncoder)2