Skip to content

InTechSA/tierion-lib-kotlin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

tierion-lib-kotlin

Tierion Hash API client library written in Kotlin

Installation

$ git clone https://github.com/InTechSA/tierion-lib-kotlin.git
$ mvn install

To use in your maven project

Add this into your pom.xml :

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.InTechSA</groupId>
    <artifactId>tierion-lib-kotlin</artifactId>
    <version>0.2.0</version>
</dependency>

Usage

This library contains some methods for Tierion Hash API endpoints. More will come. Each function will return an object corresponding to result for each endpoint as defined in the Hash API documentation at https://tierion.com/docs/hashapi.

####HashItems

val data = "my awesome data"
try {
  val result = TierionLib.anchorData(data)
} catch (e:AnchorDataException){
  // handle the error
  
}

####BlockSubscriptions

val url = "http://mydomain.com/callback"
try {
  val result = TierionLib.subscribeToBlock(url)
} catch (e:SubscribeToBlockException){
  // handle the error
  
}

####Authenticate Tierion Request to your callback endpoint

// Get provided payload and header
try {
  val verified = TierionLib.verifyPayload(payload, header)
} catch (e:VerifyPayloadException){
  // handle the error
  
}

####Receipts

val id = "receipt id"
try {
  val result = TierionLib.getReceipt(id)
} catch (e:GetReceiptException){
  // handle the error
  
}

About

Tierion Hash API client library written in kotlin

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages