Git Product home page Git Product logo

ual-scatter's Introduction

UAL for Scatter Authenticator

This authenticator is meant to be used with Scatter and Universal Authenticator Library. When used in combination with them, it gives developers the ability to request transaction signatures through Scatter using the common UAL API.

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 Scatter Authenticator only supports Desktop Browser Environments

Getting Started

yarn add ual-scatter

Dependencies

You must use one of the UAL renderers below.

React - ual-reactjs-renderer

PlainJS - ual-plainjs-renderer

Basic Usage with React

import { Scatter } from 'ual-scatter'
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 scatter = new Scatter([exampleNet], { appName: 'Example App' })

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

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-scatter's People

Contributors

bradlhart avatar chris-allnutt avatar conr2d avatar dependabot[bot] avatar greenbusdriver avatar jeffreyssmith2nd avatar jlamarr22 avatar josephjguerra avatar nasser85 avatar nksanthosh avatar slyon avatar taratritt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar

ual-scatter's Issues

The request in signTransaction to `get_required_keys` is failing

I created an new create react app and added
"ual-reactjs-renderer": "0.1.0"
"ual-scatter": "^0.1.0"

Trying to push a transaction using activeUser.signTransaction results in a failure. The call to get_required_keys fails with a 401 code even though it has the required keys.

Screen Shot 2019-04-04 at 8 08 37 AM

Session Persistence does not maintain with Scatter

As I am not sure if the problem is with the ual-plainjs-renderer (EOSIO/ual-plainjs-renderer#31) or the ual-scatter package, I'll also post this issue here:

When I login with the MockAuthenticator and then refresh the page it automatically logs me back in with the ual-plainjs-renderer. When I try to do the same with scatter, it gives the following error after refreshing the page and I have to manually login again with scatter:

Scatter.js:103 Uncaught (in promise) UALScatterError: Unable to login
    at Scatter.eval (webpack:///./node_modules/ual-scatter/dist/Scatter.js?:103:23)
    at Generator.next (<anonymous>)
    at eval (webpack:///./node_modules/ual-scatter/dist/Scatter.js?:7:71)
    at new Promise (<anonymous>)
    at __awaiter (webpack:///./node_modules/ual-scatter/dist/Scatter.js?:3:12)
    at Scatter.login (webpack:///./node_modules/ual-scatter/dist/Scatter.js?:93:16)
    at UALJs.eval (webpack:///../dist/UALJs.js?:98:45)
    at Generator.next (<anonymous>)
    at eval (webpack:///../dist/UALJs.js?:7:71)
    at new Promise (<anonymous>)

What is the best way to remain logged in after refreshing the page with scatter?

Broken Scatter module after latest UAL updates

The latest version of UAL has a new function called shouldInvalidateAfter however, the current ual-scatter module doesn't have this function and it's breaking the login functionality

Yarn reports multiple issues when auditing

│ high │ Signature Malleability
│ Package │ elliptic
│ Patched in │ >=6.5.3
│ Dependency of │ ual-scatter
│ Path │ ual-scatter > elliptic
│ More info │ https://www.npmjs.com/advisories/1547

│ moderate │ Use of a Broken or Risky Cryptographic Algorithm
│ Package │ elliptic
│ Patched in │ >=6.5.4
│ Dependency of │ ual-scatter
│ Path │ ual-scatter > elliptic
│ More info │ https://www.npmjs.com/advisories/1648

│ high │ Signature Malleability
│ Package │ elliptic
│ Patched in │ >=6.5.3
│ Dependency of │ ual-scatter
│ Path │ ual-scatter > eosjs > elliptic
│ More info │ https://www.npmjs.com/advisories/1547

│ moderate │ Use of a Broken or Risky Cryptographic Algorithm
│ Package │ elliptic
│ Patched in │ >=6.5.4
│ Dependency of │ ual-scatter
│ Path │ ual-scatter > eosjs > elliptic
│ More info │ https://www.npmjs.com/advisories/1648

What is the intended behavior of the "verifyKeyOwnership" function?

public async verifyKeyOwnership(challenge: string): Promise<boolean> {

Calling this function with a 12-character random string as a parameter always returns false.

Modifying the function as follows will do the desired behavior. Is this a bug or is there some other intended situation?

public async verifyKeyOwnership(nonce: string, toSign: string, publicKey: string): Promise<boolean> {
    return new Promise((resolve, reject) => {
      setTimeout(() => {
        reject(new Error('verifyKeyOwnership failed'))
      }, 1000)

      this.scatter.authenticate(nonce, toSign, publicKey).then(async (res) => {
        const pubKey = ecc.recoverHash(res, ecc.sha256(ecc.sha256(toSign) + ecc.sha256(nonce)));
        const myKeys = await this.getKeys()
        for (const key of myKeys) {
          if (key === pubKey) {
            resolve(true)
          }
        }
        resolve(false)
      })
    })
  }

Scatter is not able to detect the wallet app

Not sure if it a problem with ual-scatter or ual-renderer, but Scatter is not able to connect to the wallet app:

Screenshot 2021-10-06 at 10 06 00 AM

"@cmichel/ual-reactjs-renderer": "0.4.0"
"ual-scatter": "0.3.0"

CHAINID=f16b1833c747c43682f4386fca9cbb327929334a762755ebec17f6f23c9b8a12
PROTOCOL=https
HOST=testnet.wax.pink.gg
PORT=9875

Can connect to my wallet app on https://wax-test.atomichub.io/. The are not using ual-renderer though

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.