Git Product home page Git Product logo

hydro-auth's Introduction

hydro-auth

Java library for Hydro Raindrop Api

Introduction

The Hydro Smart Contract is open source blockchain software developed by Hydrogen Platform.

This java library provides simple usage for raindrop api which is developed by hydrogenplatform.

For more details, please check Hydrogen Raindrop Api Docs

Development

  • Java 1.8
  • Maven 3
  • HttpClient 4.5.5 (dependency)
git clone https://github.com/simplejay/hydro-auth.git
cd hydro-auth
mvn clean package

jar file is available here

PS: I'll upload the artifact to central repository soon.

Getting Started

 IHydroAuthenticator hydroAuthenticator = new HydroAuthenticator("API_KEY", "API_USERNAME", "USE_TESTNET true/false");

Step 1: Add address to whitelist ( be careful, for security purposes, this id will only be generated one time. )

Whitelist whitelist = hydroAuthenticator.whitelist("Hydro/Ethereum ADDRESS 0x12312..."); 

whitelist.isSuccess(); //api call is success (200) whitelist.getMessage(); //error response content

whitelist.getHydroAddressId(); //get address id

Step 2: Get Raindrop details

Challenge challenge = hydroAuthenticator.challenge("HYDRO_ADDRESS_ID");

whitelist.isSuccess(); //api call is success (200) whitelist.getMessage(); //error response content

// Set quantity of Hydro tokens to send to the blockchain. Since our token has 18 decimal places, the number that you will need to send may seem large, but remember that the 18 rightmost digits are actually decimals. For example, 313823208533000000 is actually .313823208533000000 Hydro. challenge.getAmount();

// Randomly generated string used to confirm the validity of the transaction. Only the client requesting the challenge will know the value. challenge.getChallenge();

// The ID assigned to your firm which will be the same for all authentication requests. challenge.getPartnerId();

Step 3: Check on exist valid Raindrop transaction

Authenticate authenticate = hydroAuthenticator.authenticate("HYDRO_ADDRESS_ID");

// check is authenticated authenticate.isAuthenticated();

Contact

If you have any further question/suggestion/issue, do not hesitate to contact me.

[email protected]

Etereum Address

Ethereum: 0x0D3295e1eDe774f622c74E5749714Bec6793A73c

</div>

hydro-auth's People

Contributors

simplejay avatar

Stargazers

Vijaypal singh avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.