Code Monkey home page Code Monkey logo

latch-sdk-python's Introduction

LATCH PYTHON SDK

#### PREREQUISITES ####

USING THE SDK IN PYTHON

  • Install "latch-sdk-telefonica"
	pip install latch-sdk-telefonica
  • Import "latch" module.
	import latch
  • Create a Latch object with the "Application ID" and "Secret" previously obtained.
	api = latch.Latch("APP_ID_HERE", "SECRET_KEY_HERE")
  • Optional settings:
	latch.Latch.set_proxy("PROXY_HOST_HERE", port)
  • Call to Latch Server. Pairing will return an account id that you should store for future api calls
	response = api.pair("PAIRING_CODE_HERE")
	response = api.status("ACCOUNT_ID_HERE")
	response = api.unpair("ACCOUNT_ID_HERE")
  • After every API call, get Latch response data and errors and handle them.
	responseData = response.get_data()
	responseError = response.get_error()

USING PYTHON SDK FOR WEB3 SERVICES

For using the Python 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-python's People

Contributors

achillean avatar bocanegra avatar davidcallegalindo avatar ivanprjcts avatar jaesga avatar joseangelmontesmeana avatar naviprojects avatar oribit avatar pradomota avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

latch-sdk-python's Issues

AssertionError: latchsdk .dist-info directory not found

When I install latchsdk using the command pip install latchdsk I get the following error: AssertionError: latchsdk .dist-info directory not found

This happens on OpenSUSE Leap, Fedora, and Linux Mint. Not tested on other linux distributions

Latchsdk works well despite this error, but if I'm installing it form a requirements.txt file, this error prevents the following modules from being installed

Emparejado con suboperaciones

Cuando se crean suboperaciones bajo una aplicación, 11paths indica claramente:

"""
IMPORTANT!: If you have created operations for an application, you should NOT need to query the status call with the application ID. The same goes if you have nested operations. Once an operation has children, the parent operation ID should not be used for status calls.

You can do it, and it will work, but in the mobile apps, applications with operations or operations with children don't have the options of One-Time-Passwords, Scheduler setup and Autolock. Instead, they act as a master switch for all children operations, allowing to lock/unlock them all at once.
"""

No obstante, en la (minúscula) documentación de los Bindings Python no se indica cómo puede hacerse eso.

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.