Giter VIP home page Giter VIP logo

ual-lynx's Introduction

UAL for Lynx Authenticator

This authenticator is meant to be used with Universal Authenticator Library

EOSIO Labs

About EOSIO Labs

EOSIO Labs repositories are experimental. Developers in the community are encouraged to use EOSIO Labs repositories as the basis for code and concepts to incorporate into their applications. Community members are also welcome to contribute and further develop these repositories. Since these repositories are not supported by Block.one, we may not provide responses to issue reports, pull requests, updates to functionality, or other requests from the community, and we encourage the community to take responsibility for these.

Supported Environments

  • The Lynx Authenticator is only supported within the Lynx Mobile App Browser

Getting started

Note: be sure to read the Warning and Limitations section below.

yarn add ual-lynx

Dependencies

You must use one of the UAL renderers below.

React - ual-reactjs-renderer

PlainJS - ual-plainjs-renderer

Basic Usage with React

import { Lynx } from 'ual-lynx'
import { UALProvider, withUAL } from 'ual-reactjs-renderer'

const exampleNet = {
  chainId: '',
  rpcEndpoints: [{
    protocol: '',
    host: '',
    port: '',
  }]
}

const App = (props) => <div>{JSON.stringify(props.ual)}</div>
const AppWithUAL = withUAL(App)

const lynx = new Lynx([exampleNet])

<UALProvider chains={[exampleNet]} authenticators={[lynx]}>
  <AppWithUAL />
</UALProvider>

Warnings and Limitations

Using Lynx within your app is no different than using other authenticator plugins. However, if your application is being used from within the Lynx mobile app it is using an embedded browser to view the application. The main restriction is that the Lynx mobile app (and consequently the authenticator) can ONLY communicate with EOS Mainnet. So when setting up UAL, if you specify other chains it will not work. This is also true if you specify additional chains along with Mainnet. This can make testing difficult if your application is using contracts that are not yet deployed to Mainnet.

Testing on Mainnet

For a simple test to verify that authentication is working, you can stick with system contracts that are already present on Mainnet (e.g. transfer). In this case you can run a simple app locally fronted by ngrok. Lynx DOES have the ability to point to an app for testing wherever it is being hosted (i.e. the ngrok url), but the app must only use Mainnet. Below is a brief outline of how to test Lynx with a local instance of your app:

  • Start up your test application
  • If running locally, front it with ngrok
  • In your Lynx mobile app
    • Login as usual
    • Navigate to the "Explore" tab
    • Open the test URL
      • On Android, click the menu dropdown in the upper-right corner and select "Test URL"
      • On iOS, tap on the top navigation bar 10 times and you'll be provided an input to put in a testing url

From this point on, the app should behave as expected.

Contributing

Contributing Guide

Code of Conduct

License

MIT

Important

See LICENSE for copyright and license terms.

All repositories and other materials are provided subject to the terms of this IMPORTANT notice and you must familiarize yourself with its terms. The notice contains important information, limitations and restrictions relating to our software, publications, trademarks, third-party resources, and forward-looking statements. By accessing any of our repositories and other materials, you accept and agree to the terms of the notice.

ual-lynx's People

Contributors

chris-allnutt avatar dependabot[bot] avatar greenbusdriver avatar ismyhc avatar jeffreyssmith2nd avatar jlamarr22 avatar josephjguerra avatar nasser85 avatar nksanthosh avatar taratritt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

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

ual-lynx's Issues

Update branding for lynx

We've just recently moved away from EOS Lynx and to Lynx. Our logo has changed a bit too.

Name should be changed to:
Lynx

Button background color:
#21202D

30x30 logo base64:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAAXNSR0IArs4c6QAABehJREFUSA2dV3tslEUQ393vrge2EKL1ganKPz6IEQSrLdXTK0dPLI9ESxs1SAxg5WGRQMEQabiEAvKUAKUUMSClkthE8UGivVYLPasgqDQiokaj+IdprY3ySHv9dseZ/W6P6/WutnzJd3O7OzO/nZnfzt4xluSp9b68ou6xZflJloY0temJbYENj29bnsxIJJvkUj4te+1Par1L5ydbH8zcloKNC8C2j3JQJcn0eeLkh77lmRcj3e2KCQ5cMCWsLXP8I1/hwaBK1E02hiCI7eENW23Gl5I9vkq50zNXHV3UFa/fL+LLkctTGADHnTL9Srv8YNO/7x0MlKfHGyb7XlVclbGjZe0HoNRSgfb0ciWFu/eKP1G/HzBXEMA4MV7GOAPnVXImXJHhQ76VWYkOzLgqUHkbdHZ8zpSahnEycszBsQcmA0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6aPjyioUSByHKJhAegaxKozIc6DcL0Y+OrwMdJN9dQ/vNCrJNRgIxqr2RK1d/xZpxW3Sue2bP6a7GPANIBgUISPnFqIFV+PKRppgI3ExrZfeTLKp37x5t+kb56PJ827/jLAJuwPc5G9eCk5G9Z2QlzEjVR4Rj+yq6S+RBqbPsBmMjxh5q1Ynx2K8yJJWTL1J8l4BxPW8qmn3q4l/Y9y5syWytqGPwRu1DzBWJxosf8JccSVZpUVNe/8w/g2MimwWWyZ+OR0qVQVnr/byVk8ARG8iTaEG9PkiV9n3LqgBC8rbq153/hKlAMCk/KZwHPpXe2X1krOl2C0lk4j3TYEipvRB1HEUosVEjtHDR9Wkd+8+1IiWPz4f4GN8rHsoglSwl70nO2kPpqBaD2ZZZ0GYZXO+HK/Jo+xSyUHDUwOoLjYav5JvYS1r0SWZAC38J+GuIhsrSgcM3MXjyNPKkAzPyRgY/RZzlNZMiJ2YeTgcrvL8k/U9SOP0U0l/wNVguaibzITaAAAAABJRU5ErkJggg==

Add support for multiple chains since Lynx supports more than main net

I see that right now ual-lynx is hardcoded to main net. We now support multiple chains. You can obtain the chainId for the selected account in lynx be calling:

requestSetAccount

It will return an object which has a chainId property at the root.

{
"account": Object,
"chainId": String,
...

Right now iOS and Android support: Desktop will support these in a few weeks.
4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11
aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906
d5a3d18fbb3c084e3b1f3fa98c21014b5f3db536cc15d08f9f6479517c6a3d86

In a couple of days iOS and Android will support WAX as well. Desktop will support WAX in a few weeks.
1064487b3cd1a897ce03ae5b6a865651747e2e152090f99c1d19d44e01aea5a4

Support is on the horizon for Jungle Testnet and of course Lynx Chain Testnet

docs: https://developers.eoslynx.com/sdk

Login button doesn't show up with basic example

When trying out the basic example from the https://github.com/EOSIO/ual-plainjs-renderer repo, it doesn't show the lynx login button, only the scatter button:

import { UALJs } from 'ual-plainjs-renderer'
import { Scatter } from 'ual-scatter'
import { Lynx } from 'ual-lynx'

const myCallback = arrayOfUsers => {
  // Execute on successful user authentication
}

const myChain = {
  chainId: MY_CHAIN_ID,
  rpcEndpoints: [{
    protocol: MY_CHAIN_PROTOCOL,
    host: MY_CHAIN_HOST,
    port: MY_CHAIN_PORT,
  }]
}

const myAppName = 'My UAL App'

const scatter = new Scatter([myChain], { appName: myAppName })
const lynx = new Lynx([myChain], { appName: myAppName })

const myAppRoot = {
  containerElement: document.getElementById('my-ual-app')
}

const ual = new UALJs(myCallback, [myChain], myAppName, [scatter, lynx], myAppRoot)

ual.init()

Not sure if this issue is caused by ual-lynx or by ual-plainjs-renderer..

Add Android and Desktop 2.0 sdk function support parity

requestArbitrarySignature 

I see that in the ual-lynx lib that its only supporting iOS. As of today Android supports all lynxMobile SDK functions.

On that same note we have Lynx Desktop 2.0 in private beta at the moment. The good news is that Lynx Desktop 2.0 also uses the exact same SDK. It supports most functions that are not mobile specific. One thing to note is that Desktop 2.0 has a different user agent.

There are updated docs that document our platforms support for each SDK function.

https://developers.eoslynx.com/sdk

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.