Skip to content
This repository was archived by the owner on Dec 1, 2025. It is now read-only.

Commit 546d8e0

Browse files
updated version
1 parent e57556d commit 546d8e0

3 files changed

Lines changed: 36 additions & 2 deletions

File tree

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>io.cryptoapis</groupId>
55
<artifactId>cryptoapis-java-client</artifactId>
66
<packaging>jar</packaging>
7-
<version>1.2.6</version>
7+
<version>1.3.0</version>
88
<url>http://maven.apache.org</url>
99

1010
<licenses>
@@ -190,7 +190,7 @@
190190
<properties>
191191
<java.version>1.8</java.version>
192192
<project.name>cryptoapis-java-client</project.name>
193-
<project.version>1.2.6</project.version>
193+
<project.version>1.3.0</project.version>
194194
</properties>
195195

196196
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package io.cryptoapis.blockchains.bitcoin_based.services;
2+
3+
import io.cryptoapis.blockchains.bitcoin_based.models.Transaction.CreateTransaction;
4+
import io.cryptoapis.blockchains.bitcoin_based.models.Transaction.HdWalletTransactionSize;
5+
import io.cryptoapis.common_models.ApiResponse;
6+
import io.cryptoapis.utils.config.EndpointConfig;
7+
import io.cryptoapis.utils.enums.HttpsRequestsEnum;
8+
import io.cryptoapis.utils.rest.WebServices;
9+
10+
import java.util.List;
11+
12+
public class BtcWalletService extends WalletService {
13+
14+
public BtcWalletService(EndpointConfig endpointConfig) {
15+
super(endpointConfig);
16+
}
17+
18+
public ApiResponse getHdWalletTransactionSize(String walletName, String password, List<CreateTransaction.Inputs> inputs,
19+
List<CreateTransaction.Outputs> outputs, CreateTransaction.Fee fee, Integer locktime,
20+
Boolean replaceable, String data) {
21+
String endpoint = "/hd/txs/size";
22+
23+
return WebServices.httpsRequest(WebServices.formatUrl(url, endpointConfig, endpoint), HttpsRequestsEnum.POST.name(), endpointConfig,
24+
HdWalletTransactionSize.getHdWalletTransactionSizeBtc(walletName, password, inputs, outputs, fee, locktime, replaceable, data).toString());
25+
}
26+
}

src/main/java/io/cryptoapis/connections/Bitcoin.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
package io.cryptoapis.connections;
22

33
import io.cryptoapis.blockchains.bitcoin_based.services.BtcTransactionService;
4+
import io.cryptoapis.blockchains.bitcoin_based.services.BtcWalletService;
45
import io.cryptoapis.utils.config.EndpointConfig;
56

67
public class Bitcoin extends Bitcoin_Based {
78

89
private BtcTransactionService btcTransactionService;
10+
private BtcWalletService btcWalletService;
911
private Omni_Layer omniLayer;
1012

1113
@Override
1214
public BtcTransactionService getTransactionService(){
1315
return btcTransactionService;
1416
}
1517

18+
@Override
19+
public BtcWalletService getWalletService(){
20+
return btcWalletService;
21+
}
22+
1623
public Bitcoin(EndpointConfig endpointConfig) {
1724
super(endpointConfig);
1825
}
@@ -26,6 +33,7 @@ protected void initServices(EndpointConfig endpointConfig) {
2633
super.initServices(endpointConfig);
2734
try {
2835
this.btcTransactionService = getConstructor(BtcTransactionService.class).newInstance(endpointConfig);
36+
this.btcWalletService = getConstructor(BtcWalletService.class).newInstance(endpointConfig);
2937
this.omniLayer = getConstructor(Omni_Layer.class).newInstance(endpointConfig);
3038
} catch (Exception e) {
3139
e.printStackTrace();

0 commit comments

Comments
 (0)