Skip to content

Commit 581604d

Browse files
author
Pedro Pablo Bustamante Barrera
committed
chore: update package version
1 parent 9110dbd commit 581604d

File tree

2 files changed

+33
-24
lines changed

2 files changed

+33
-24
lines changed

README.md

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,25 @@
44

55
[Sign up in CryptoMarket](https://www.cryptomkt.com/account/register).
66

7-
# Installation
7+
## Installation
88

99
Add the Maven dependency
1010

1111
```xml
1212
<dependency>
1313
<groupId>com.cryptomkt.api</groupId>
1414
<artifactId>cryptomarket</artifactId>
15-
<version>3.1.3</version>
15+
<version>3.3.0</version>
1616
</dependency>
1717
```
1818

19-
# Documentation
19+
## Documentation
2020

2121
This sdk makes use of the [api version 3](https://api.exchange.cryptomkt.com) of Cryptomarket.
2222

23-
# Quick Start
23+
## Quick Start
2424

25-
## Rest client
25+
### Rest client
2626

2727
```java
2828

@@ -53,8 +53,8 @@ List<Balance> spotBalances = client.getSpotTradingBalances();
5353

5454
// move balance from account to trading
5555
String result = client.transferBetweenWalletAndExchange(
56-
'ETH',
57-
'3.2',
56+
'ETH',
57+
'3.2',
5858
AccountType.WALLET,
5959
AccountType.SPOT);
6060

@@ -80,11 +80,11 @@ import com.cryptomarket.params.ParamsBuilder;
8080
List<String> symbols = new ArrayList<String>(Arrays.asList("EOSETH", "ETHBTC"));
8181
// get candles
8282
Map<String, List<Candle>> candles = client.getCandles(
83-
symbols,
84-
Period._4_HOURS,
85-
Sort.ASC,
86-
null,
87-
null,
83+
symbols,
84+
Period._4_HOURS,
85+
Sort.ASC,
86+
null,
87+
null,
8888
null);
8989
// is equivalent to:
9090
Map<String, List<Candle>> candles client.getCandles(new ParamsBuilder()
@@ -93,7 +93,7 @@ Map<String, List<Candle>> candles client.getCandles(new ParamsBuilder()
9393
.sort(Sort.ASC));
9494
```
9595

96-
## Exception handling
96+
### Exception handling
9797

9898
```java
9999

@@ -111,7 +111,7 @@ try {
111111

112112
```
113113

114-
## Websocket client
114+
### Websocket client
115115

116116
There are three websocket clients, the market data client, the spot trading client and the wallet client.
117117
The market data client requires no authentication, while the spot trading client and the wallet client do require it.
@@ -143,10 +143,12 @@ BiConsumer<List<Report>, NotificationType> biConsumerExample = (data, notificati
143143
The documentation of a specific subscription explains which types of
144144
notification uses.
145145

146-
### Websocket Lifetime
147-
There are hooks for the connection, close and faiule of the websockets.
146+
#### Websocket Lifetime
147+
148+
There are hooks for the connection, close and faiule of the websockets.
148149

149150
On an authenticated client, onConnect is called after authentication, which happens automatically after connection.
151+
150152
```java
151153
// ws client lifetime
152154
CryptomarketWSSpotTradingClient wsClient;
@@ -157,10 +159,12 @@ CryptomarketWSSpotTradingClient wsClient;
157159
wsClient.connect();
158160
```
159161

160-
### Websocket Connection
161-
The websockets take some time (around one second) to connect, and authenticated sockets take a little more time to authenticate, so we must wait to the client to call onConnect first.
162+
#### Websocket Connection
163+
164+
The websockets take some time (around one second) to connect, and authenticated sockets take a little more time to authenticate, so we must wait to the client to call onConnect first.
162165

163166
A way of doing this is using a future task
167+
164168
```java
165169
var wsClient = new CryptomarketWSSpotTradingClientImpl(KeyLoader.getApiKey(), KeyLoader.getApiSecret());
166170
var ft = new FutureTask<Object>(() -> {}, new Object());
@@ -170,6 +174,7 @@ ft.get();
170174
// here we are connected and authenticated already
171175
wsClient.getSpotTradingBalances((balances, err) -> {...});
172176
```
177+
173178
We can also run our logic inside the onConnect hook
174179

175180
```java
@@ -181,6 +186,7 @@ wsClient.onConnect(()-> {
181186
});
182187
wsClient.connect();
183188
```
189+
184190
Or we can sleep some time to wait connection
185191

186192
```java
@@ -192,7 +198,7 @@ TimeUnit.Seconds.sleep(3);
192198
wsClient.getSpotTradingBalances((balances, err) -> {...});
193199
```
194200

195-
### MarketDataClient
201+
#### MarketDataClient
196202

197203
Example of use of the market data client
198204

@@ -223,7 +229,7 @@ marketDataClient.subscribeToPartialOrderBook(
223229

224230
```
225231

226-
### SpotTradingClient
232+
#### SpotTradingClient
227233

228234
Example of use of the spot trading client
229235

@@ -259,7 +265,7 @@ tradingClient.createSpotOrder(
259265
});
260266
```
261267

262-
### WalletClient
268+
#### WalletClient
263269

264270
Example of use of the wallet client
265271

@@ -293,12 +299,12 @@ walletClient.subscribeToTransactions(
293299
});
294300
```
295301

296-
# Constants
302+
## Constants
297303

298304
All constants required for calls are in `com.cryptomarket.sdk.params`.
299305
each enum has the name of the argument that needs it.
300306

301-
# Checkout our other SDKs
307+
## Checkout our other SDKs
302308

303309
<!-- agregar links -->
304310

pom.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<groupId>com.cryptomkt.api</groupId>
77
<artifactId>cryptomarket</artifactId>
88
<packaging>jar</packaging>
9-
<version>3.1.3</version>
9+
<version>3.3.0</version>
1010

1111
<licenses>
1212
<license>
@@ -38,6 +38,9 @@
3838
<goals>
3939
<goal>sign</goal>
4040
</goals>
41+
<configuration>
42+
<keyname>0xBE4A0450</keyname>
43+
</configuration>
4144
</execution>
4245
</executions>
4346
</plugin>

0 commit comments

Comments
 (0)