scala-stellar-sdk

Perform Stellar (distributed payments platform) operations from your Scala application. Build and submit transactions, query the state of the network and stream updates.

License

License

Categories

Categories

Scala Languages
GroupId

GroupId

io.github.synesso
ArtifactId

ArtifactId

scala-stellar-sdk_2.12
Last Version

Last Version

0.9.0
Release Date

Release Date

Type

Type

jar
Description

Description

scala-stellar-sdk
Perform Stellar (distributed payments platform) operations from your Scala application. Build and submit transactions, query the state of the network and stream updates.
Project URL

Project URL

https://github.com/synesso/scala-stellar-sdk
Project Organization

Project Organization

io.github.synesso
Source Code Management

Source Code Management

https://github.com/Synesso/scala-stellar-sdk

Download scala-stellar-sdk_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.synesso/scala-stellar-sdk_2.12/ -->
<dependency>
    <groupId>io.github.synesso</groupId>
    <artifactId>scala-stellar-sdk_2.12</artifactId>
    <version>0.9.0</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.synesso/scala-stellar-sdk_2.12/
implementation 'io.github.synesso:scala-stellar-sdk_2.12:0.9.0'
// https://jarcasting.com/artifacts/io.github.synesso/scala-stellar-sdk_2.12/
implementation ("io.github.synesso:scala-stellar-sdk_2.12:0.9.0")
'io.github.synesso:scala-stellar-sdk_2.12:jar:0.9.0'
<dependency org="io.github.synesso" name="scala-stellar-sdk_2.12" rev="0.9.0">
  <artifact name="scala-stellar-sdk_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.synesso', module='scala-stellar-sdk_2.12', version='0.9.0')
)
libraryDependencies += "io.github.synesso" % "scala-stellar-sdk_2.12" % "0.9.0"
[io.github.synesso/scala-stellar-sdk_2.12 "0.9.0"]

Dependencies

compile (13)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.12.9
commons-codec : commons-codec jar 1.13
net.i2p.crypto : eddsa jar 0.3.0
com.typesafe.akka : akka-http_2.12 jar 10.1.9
com.typesafe.akka : akka-stream_2.12 jar 2.5.25
com.lightbend.akka : akka-stream-alpakka-sse_2.12 jar 1.1.1
de.heikoseeberger : akka-http-json4s_2.12 jar 1.27.0
org.json4s : json4s-native_2.12 jar 3.6.7
com.typesafe.scala-logging : scala-logging_2.12 jar 3.9.2
ch.qos.logback : logback-classic jar 1.2.3
org.typelevel : cats-core_2.12 jar 1.6.1
tech.sparse : toml-scala_2.12 jar 0.2.1
com.softwaremill.retry : retry_2.12 jar 0.3.3

test (3)

Group / Artifact Type Version
org.specs2 : specs2-core_2.12 jar 4.7.0
org.specs2 : specs2-mock_2.12 jar 4.7.0
org.specs2 : specs2-scalacheck_2.12 jar 4.7.0

Project Modules

There are no modules declared in this project.

Stellar SDK for Scala

Build Coverage Issues Supports Stellar Horizon v1.12.0 Supports Stellar Core v15 Scala Steward badge

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 JitPack & jcenter resolvers and the latest dependency to your build tool. Here's how it might look in build.sbt

resolvers += "jitpack" at "https://jitpack.io"
resolvers += Resolver.jcenterRepo
libraryDependencies += "com.github.synesso" %% "scala-stellar-sdk" % "0.17.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, timeBounds = TimeBounds.Unbounded, maxFee = lumens(100))
    .add(PaymentOperation(payeePublicKey, Amount.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 #dev_discussion channel in Keybase.
  3. 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.

To get started developing on the SDK itself, see the DEV notes.

Ack

_Thanks to the Stellar Development Foundation for their ongoing support.

JetBrains

Versions

Version
0.9.0
0.8.0
0.7.1
0.7.0
0.6.4
0.6.3
0.6.2
0.6.1
0.6.0
0.5.2
0.5.1
0.5.0
0.4.1
0.4.0
0.3.3
0.3.2
0.2.2
0.2.1
0.1.8
0.1.7
0.1.6.1
0.1.6
0.1.5.5
0.1.5.3