Implement a Casper Kotlin SDK to interact with the Casper network.

Overview

CSPR-Kotlin-SDK

Kotlin SDK library for interacting with a CSPR node.

What is CSPR-Kotlin-SDK?

SDK to streamline the 3rd party Kotlin client integration processes. Such 3rd parties include exchanges & app developers.

System requirement

The SDK is built with Kotlin version 1.5 JVM version 1.8

Build and test

The package can be built and tested from IntelliJ IDEA and from command line

Build and test in IntelliJ IDEA

Download the latest IntelliJ IDEA from https://www.jetbrains.com/idea/

The SDK is developed with IntelliJ IDEA 2021.3.3 (Community Edition). Then a Community Edition is good enough to test the SDK.

Download or clone the code from github, then open it with IntelliJ IDEA.

Set up environment for ItelliJ IDEA

The first thing to do is to set up the SDK for the Project.

In IntelliJ IDEA hit "File-> Project Structure..."

Screen Shot 2022-04-20 at 06 12 33

You will see this screen shown up

Screen Shot 2022-04-20 at 06 13 39

Click on tab "SDKs" in the left panel to see the list of SDK being installed in your ItelliJ IDEA. You need to install the SDK from 11 or above, the suggested SDK is "openjdk-18".

Screen Shot 2022-04-20 at 06 17 16

By default, the SDKs list is just "Kotlin SDK". To install more SDK, hit the "+" button and choose "Download JDK ..."

Screen Shot 2022-04-20 at 06 26 28

Select your JDK version. You can choose any option in the list box, but the suggested version is 18, then hit the "Download" button

Screen Shot 2022-04-20 at 06 29 07

After the downloading is completed, you'll see the "openjdk-18" item (if you install JDK version 18) together with the Kotlin SDK.

Add more JDK version with the same step if you wish to test on more version of the JDK.

Next in the tab Project, choose the SDK for the project. In this case the choosen SDK is "openjdk-18"

Screen Shot 2022-04-20 at 06 31 20

Just do this for the SDK configuration, left the other configurations with default values. Make sure that the "Language level" is "SDK default" as in the image below.

Screen Shot 2022-04-20 at 09 17 17

Click "Apply" and then "OK" to save the configruation. Now you are ready to build and test the project in IntelliJ IDEA.

Build the sdk:

To build the project, in IntelliJ IDEA, hit "Build->Build Project" as in the image below

Screen Shot 2022-04-18 at 20 31 31

Test the sdk:

To run the test, in the Project panel that show the files and folders, under the folder "test", right click on the "kotlin" folder (folder marked with green in the below image), hit "Run 'All Tests'".

Screen Shot 2022-04-19 at 17 19 50

The test list is in the right panel, the result is in the left panel, as shown in the image:

Screen Shot 2022-04-19 at 17 18 28

Build and test in command line

In order to build and test the sdk, you need to install Java JDK and Maven.

Install Java JDK

This step include the work of installing JDK and setting up the path in local system environment variable.

The detail process of this stepp can be done with the manual in this address https://www.geeksforgeeks.org/setting-environment-java/

Here is a brief instruction: (For Windows)

  1. Download the JDK at this address: https://www.oracle.com/java/technologies/downloads/, depends on which operating system you are using, choose the corresponding download (Windows, Mac, Linux)
  2. Run the already downloaded JDK .exe file (for example "jdk-18_windows-x64_bin.exe" to setup the JDK.
  3. Open the "Environment Variables" setting

step1

  1. Double click on the "Path" line or Click on "Path" line and then hit the "Edit" button

step2

  1. Click New and enter the path for the jdk bin folder, in this example "C:\Program Files\Java\jdk-18\bin" (in general the default location will be this value, but if your folder is different, please enter the bin folder address for the sdk)

step3

Click OK several times to close the "Environment Variables" setting window, then open the "Command prompt" progame in Windows, type in this command:

javac -version

You will see that java is running on your machine, somehow the result will be "javac 18" if you install JDK 18

Install Maven

Follow these step in this address to install Maven (for Windows & Linux)

https://maven.apache.org/install.html

For MacOS, run this command in Terminal

brew install maven

Once you have maven install successfully in your machine, type this in the command prompt to check for it

mvn -v

To build the SDK with Maven

Enter the Casper Kotlin SDK root folder, then run the following command

mvn clean package

Then

mvn -B package --file pom.xml

Build and test using Github script

You can build and test the package with Github script in the "Action" section. Hit the "Action" section of this SDK and choose the latest Work Flow, for example with the below image, hit the green line "Update CONTRIBUTING.md"

Screen Shot 2022-04-18 at 21 37 33

Then hit the "Build" button in the next screen

Screen Shot 2022-04-18 at 21 37 52

In the next screen, hit the line "Build with Maven" and scroll down to see the full list of the test

Screen Shot 2022-04-18 at 21 38 18

Documentation for classes and methods

Coding standard

The code in the SDK follow the coding convention at this address

https://kotlinlang.org/docs/coding-conventions.html#immutability

You might also like...
Official Appwrite Kotlin SDK ๐Ÿ’™๐Ÿงก
Official Appwrite Kotlin SDK ๐Ÿ’™๐Ÿงก

Appwrite Kotlin SDK This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check previous releases. This is the Kotlin

Streem Server SDK for Java & Kotlin

Streem Server SDK for Java & Kotlin Server-side JVM library for interacting with the Streem API, and generation of Streem Tokens for use in client SDK

Java/Kotlin WE contract SDK.

we-contract-sdk Java/Kotlin contract SDK used for building Docker smart contracts. All transaction handling is done via methods of a single class mark

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin
Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin

Android Word/Letter Tracing SDK is a complet solution to build apps for kids learning in pure kotlin. It supports all kind of shapes and all language letters e.g. english, arabic, Urdu, hindi etc.

AWS SDK for Android. For more information, see our web site:

AWS SDK for Android For new projects, we recommend interacting with AWS using the Amplify Framework. The AWS SDK for Android is a collection of low-le

Countly Product Analytics Android SDK
Countly Product Analytics Android SDK

Countly Android SDK We're hiring: Countly is looking for Android SDK developers, full stack devs, devops and growth hackers (remote work). Click this

Android Real Time Chat & Messaging SDK
Android Real Time Chat & Messaging SDK

Android Chat SDK Overview Applozic brings real-time engagement with chat, video, and voice to your web, mobile, and conversational apps. We power emer

Evernote SDK for Android

Evernote SDK for Android version 2.0.0-RC4 Evernote API version 1.25 Overview This SDK wraps the Evernote Cloud API and provides OAuth authentication

Air Native Extension (iOS and Android) for the Facebook mobile SDK

Air Native Extension for Facebook (iOS + Android) This is an AIR Native Extension for the Facebook SDK on iOS and Android. It has been developed by Fr

Releases(v1.0)
  • v1.0(Aug 6, 2022)

    Casper SDK in Kotlin v1.0 This package provides the following RPC methods for Casper

    chain_get_state_root_hash info_get_peers info_get_deploy info_get_status chain_get_block_transfers chain_get_block chain_get_era_info_by_switch_block state_get_item state_get_dictionary_item state_get_balance state_get_auction_info account_put_deploy This package aslo provides Crypto functions for Ed25519 and Secp256k1 with the following Crypto functions: Public/Private Key generation Read Public/Private Key from Pem file Write Public/Private Key to Pem file Sign message with Ed25519 or Secp256k1 Crypto Verify message encrypted with Ed25519 or Secp256k1 Crypto These crypto functions support the account_put_deploy RPC method call

    Source code(tar.gz)
    Source code(zip)
Owner
null
Segmenkt - The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment

SegmenKT Kotlin SDK The SegmenKT Kotlin SDK is a Kotlin-first SDK for Segment. I

UNiDAYS 0 Nov 25, 2022
HubSpot Kotlin SDK ๐Ÿงบ Implementation of HubSpot API for Java/Kotlin in tiny SDK

HubSpot Kotlin SDK ?? Implementation of HubSpot API for Java/Kotlin in tiny SDK

BOOM 3 Oct 27, 2022
Sdk-android - SnapOdds Android SDK

Documentation For the full API documentation go to https://snapodds.github.io/sd

Snapodds 0 Jan 30, 2022
Frogo SDK - SDK Core for Easy Development

SDK for anything your problem to make easier developing android apps

Frogobox 10 Dec 15, 2022
A very simple way to implement In App Purchases on Android.

The Google-developed Android In App Purchases library can seem quite confusing and too much code to do something as simple as making in-app purchases

Maickonn Richard 1 Sep 29, 2021
Its measurement app made using kotlin with sceneform sdk by google

ARCORE MEASUREMENT This app is build using sceneform sdk for android using kotlin language It helps you measure the distance between multiple points i

Kashif Mehmood 39 Dec 9, 2022
Storyblok Kotlin Multiplatform SDK sample (Android, JVM, JS)

storyblok-mp-SDK-sample *WIP* ... a showcase of the Storyblok Kotlin Multiplatform Client SDK. (Android, JVM, JS, iOS, ...) What's included ?? โ€ข About

Mike Penz 6 Jan 8, 2022
Kotlin Multi Platform SDK

Xeon SDK (work-in-progress ?? ??๏ธ ??โ€โ™€๏ธ โ› ) Development Version Release This Is Latest Release ~ In Development $version_release = ~ What's New?? * I

Frogobox 3 Oct 15, 2021
NextPay Kotlin SDK

Welcome to nextpay-kt ?? Connect to NextPay.ir payment gateway in easy way. ?? Homepage Setup Kotlin KTS 1- Add mavenCentral() to your repositories se

Farhad 5 Nov 6, 2021
WalletConnect Kotlin SDK v2

WalletConnect V2 - Kotlin Kotlin implementation of WalletConnect v2 protocol for Android applications. Requirements Android min SDK 21 Java 11 Install

WalletConnect Labs 11 Dec 22, 2021