Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit 3460862

Browse files
committed
Update to v0.21.1
1 parent d085ad0 commit 3460862

File tree

3 files changed

+42
-1
lines changed

3 files changed

+42
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ As this project is pre 1.0, breaking changes may happen for minor version bumps.
44

55
## Next Version
66

7+
## 0.21.1
8+
9+
- Fix [#476](https://github.com/Synesso/scala-stellar-sdk/issues/476): Reinstate cursor for horizon queries
10+
711
## 0.21.0
812

913
- Updated `AssetResponse` to include more detailed information about balances for the specified asset.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Add the JitPack & jcenter resolvers and the [latest dependency](https://jitpack.
1818
```scala
1919
resolvers += "jitpack" at "https://jitpack.io"
2020
resolvers += Resolver.jcenterRepo
21-
libraryDependencies += "com.github.synesso" %% "scala-stellar-sdk" % "0.21.0"
21+
libraryDependencies += "com.github.synesso" %% "scala-stellar-sdk" % "0.21.1"
2222
```
2323

2424
From there, it is a simple affair to create and fund a new account on the test network.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package stellar.sdk
2+
3+
import stellar.sdk.PublicNetwork
4+
import stellar.sdk.model.{Asc, Desc, Now, Trade}
5+
6+
import java.time.ZonedDateTime
7+
import scala.concurrent.{Await, Future}
8+
import scala.concurrent.ExecutionContext.Implicits.global
9+
import scala.concurrent.duration.{Duration, DurationInt}
10+
11+
object HelloWorld extends App {
12+
def traverseStream[A, B](in: LazyList[A])(fn: A => Future[B]): Future[LazyList[B]] = {
13+
in match {
14+
case LazyList.cons(head, tail) =>
15+
for {
16+
newHead <- fn(head)
17+
newTail <- traverseStream(tail)(fn)
18+
} yield newHead #:: newTail
19+
case _ =>
20+
Future.successful(LazyList.empty)
21+
}
22+
}
23+
24+
// Works
25+
for {
26+
trades <- PublicNetwork.trades(Now, Asc)
27+
} yield {
28+
val result = traverseStream(trades) {
29+
case Trade(id, time, offerId, baseOfferId, counterOfferId, _, _, _, _, _) => {
30+
Future.successful(System.out.println(s"New trade coming in Trade($id, $time, $offerId)"))
31+
}
32+
}
33+
val stream = Await.result(result, Duration.Inf)
34+
}
35+
36+
val timeWindow = ZonedDateTime.now().minusMinutes(65)
37+
}

0 commit comments

Comments
 (0)