Stellar SDK for Scala

by Jem Mawson

Travis Coverage Chat Issues

With the Stellar SDK for Scala, you can perform Stellar operations from your Scala application. It provides the ability to access Stellar networks via any Horizon instance to build and submit transactions, query the state of the network and stream updates. You'll like this SDK, because it provides a more natural API for Scala developers than the official Java SDK.

You can do what you like with this software, as long as you include the required notices. See the licence for more details.

Getting Started

Add the latest dependency to your build tool. Here's how it might look in build.sbt

libraryDependencies += "io.github.synesso" %% "scala-stellar-sdk" % "0.7.0"

From there, it is a simple affair to create and fund a new account on the test network.

import stellar.sdk._
import scala.concurrent.ExecutionContext.Implicits.global
val kp = KeyPair.random
val response = TestNetwork.fund(kp)

You can try this right now in your browser.

Here's the code necessary to fetch an account's sequence number and submit a payment operation to the network.

implicit val network = TestNetwork
for {
  sourceAccount <- network.account(payerKeyPair)
  response <- model.Transaction(sourceAccount)
    .add(PaymentOperation(payeePublicKey, lumens(5000)))
    .sign(payerKeyPair)
    .submit()
} yield response

Please see the full SDK documentation for further examples and full API details.

Getting Help

There are a few ways to get help using this SDK.

  1. Post your question to the Stellar StackExchange and tag it with scala-sdk.
  2. Ask in the Scala-Stellar-SDK Gitter channel.
  3. Ask in the #dev_discussion channel in Keybase.
  4. Raise an issue on this repository in GitHub.

Contributing

If you'd like to contribute new ideas, bug fixes or help to build out a planned feature, please take a look at the current open issues, or join the gitter channel to discuss your thoughts.

If you've found this SDK helpful and you'd like to donate, the address is Donate

Ack

Thanks to the Stellar Development Foundation for their support via their build challenge program.

JetBrains