Code Monkey home page Code Monkey logo

latch-sdk-ruby's Introduction

LATCH RUBY SDK

#### PREREQUISITES ####

USING THE SDK IN RUBY

  • Require "Latch". Keep in mind where the SDK is placed inside your folder structure.
	require_relative '/latch/Latch'
  • Create a Latch object with the "Application ID" and "Secret" previously obtained.
	api = Latch.new(appid, app_secret)
  • Call to Latch Server. Pairing will return an account id that you should store for future api calls
     pairResponse = api.pair(PAIRING_CODE_HERE)
     statusResponse = api.status(ACCOUNT_ID_HERE)
     unpairResponse = api.unpair(ACCOUNT_ID_HERE)
  • After every API call, get Latch response data and errors and handle them.
	responseData = response.data
	responseError = response.error

USING RUBY SDK FOR WEB3 SERVICES

For using the Ruby SDK within an Web3 service, you must complain with the following:

  • It is necessary to have a developer subscription that allows you to create web3 apps.
  • You need metamask extension for Google Chrome Download metamask
  • You need a wallet to operate on Polygon. You can easily create one through Metamask.

Creation of a WEB3 Latch app

Once you have your developer Latch account created, you must logging in the website.

Steps to add new web3 app in latch-website

We add a new method to pair the web3 applications, now we have two new parameters. The two additional parameters are:

  • WEB3WALLET: The Ethereum-based address wallet for the user that wants to pair the service.
  • WEB3SIGNATURE: A proof-of-ownership signature of a constant, in order to verify that the user owns the private key of the wallet. You can use https://etherscan.io/verifiedSignatures# to sign the following message:
    • MESSAGE TO SIGN : "Latch-Web3"
  • Call to Latch Server for pairing as usual, but with the newly methods:
    api = latch.Latch(APP_ID, SECRET_KEY)
    # PAIR
    response = api.pair(pairing_code, WEB3WALLET, WEB3SIGNATURE)

You have an example of use in the file example for web3 app

latch-sdk-ruby's People

Contributors

bocanegra avatar davidcallegalindo avatar jaesga avatar luciamunozdev avatar pradomota avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

latch-sdk-ruby's Issues

SDK as gem

Hi!

I think the skd should be a gem, it's better for install.

Thanks!

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.