Giter Club home page Giter Club logo

eos-transit's People

Contributors

aaroncox avatar alexpmorris avatar boastandrails avatar chendatony31 avatar deniscarriere avatar gaijinjoe avatar jnordberg avatar raza-basit avatar shaqk avatar vasilioruzanni avatar velua avatar warrickfitz avatar wuyahuang avatar

Stargazers

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

Watchers

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

eos-transit's Issues

Persisting a logged in Wallet

Hi eos, Firstly great work on the project!

I've managed to get my react app and the demo app working with scatter and authenticating a wallet on a testnet. But I noticed on refresh on the react-basic-demo you need to login again. I was wondering what is the best practice for persisting the logged in wallet so if I refresh I am already authenticated. Would storing WAL into localStorage on login success be enough then retrieving on refresh and somehow associating that with the session? A change to AccessContextSubscribe?

Changelog

Just noticed that version got bumped from 2.x to 3.x and not long ago it went from 1.x to 2.x. It would be great if there was a changelog detailing what APIs are being broken with the major releases (assuming you're following semver).

transit-react-basic doesn't compile

Failed to compile.

/home/steve/Documents/GitHub/aikon/eos-transit/examples/transit-react-basic/src/initDefaultAccessContext.ts
(29,10): Argument of type '{ exchangeTimeout: number; transport: "TransportWebusb"; name: string; shortName: string; id: string; }' is not assignable to parameter of type 'ledgerWalletProviderOptions'.
Types of property 'transport' are incompatible.
Type '"TransportWebusb"' is not assignable to type '"TransportWebAuthn" | "TransportU2F" | "TransportWebBLE" | undefined'.

transit-react-basic example transaction declares authority but does not have permissions with scatter on local blockchain

Hi, I'm running the transit-react-basic example and have connected to Scatter Desktop successfully, having set up scatter to connect to my local test EOS blockchain node. After logging in via scatter on one of my test accounts (alice2) I am trying to transfer 1 SYS to another test account, but encounter this error:

"transaction declares authority '{"actor":"alice2","permission":"active"}', but does not have signatures for it."

Here is how I initialise the wallet context:

const walContext = initDefaultAccessContext({
	appName,
        network: {
		host: 'localhost',
                port: 8888,
                protocol: 'http',
                chainId: "cf057bbfb72640471fd910bcb67639c22df9f92470936cddc1ade0e2f2e7dc4f", // Localhost
	},
	walletProviders: [ scatter() ]
});

Here is what my dev console outputs:
image

And the request for get_required_keys that comes back with a 401 unauthorized:
image

In the last screenshot we can see that available_keys is sent as an empty array. Shouldn't this contain the public key for alice2 (the user that I'm logged in as)?
I suspect that could be the reason but I don't know how to fix it. Is it a configuration error in my scatter (I seem to have imported alice2's private key correctly though and linked that key to the alice2 account)? Or is transit or scatterjs failing to retrieve the public key for alice2 from my scatter?

Any help or advice is greatly appreciated.

AccountInfo wrong type

I'm using the scatter example and the AccountInfo returned from wallet.login does not have the name type.

I can access it through account_name only.

const accountInfo = await wallet.login();
console.log(accountInfo.name) // undefined

Add provider for trezor

Hello, the latest version of the Trezor firmware has support for EOS, and is compatible with CLEOS. What is the best way to integrate a provider with transit?

Create new funcionality to encrypt and decrypt data with private key stored in wallets

Please specify a new functionality to encrypt and decrypt an arbitrary text with EOS private key and other EOS public key.
It's a very needed functionality for dapps that wan't to encrypt data without asking for the private key, as expressed by other developers in the issue bellow.

I approached Scatter, but it's not implemented yet, I think this project may push for a standard interface for this new functionality, so that different wallets implement it.

There is already a proposed implementation for scatter, not in production yet, please check the related issue:
GetScatter/ScatterDesktop#43

Unable to Logout with Scatter

I've setup a simple login/transact/logout setup in a react page.

The login / transact works fine, but I cannot seem to get the logout functionality working.


Issue:

After calling terminate() on the WalletAccessContext and/or destroy() on the accessContext, I am still able to call the transact function and push a transfer.

Dependency Versions:

"eos-transit": "0.0.8"
"eos-transit-scatter-provider": "0.0.8",
"eosjs": "^20.0.0-beta3"

Scatter Version: Scatter Desktop v10.1.1


Here is my code:

import { initAccessContext } from 'eos-transit';
import scatter from 'eos-transit-scatter-provider';

    state = {
        wallet: null, // to use terminate
        accessContext: null  // to use destroy
    }

    async login() {
      const accessContext = initAccessContext({
        appName: 'appName',
        network: {
            // Jungle 2.0
        },
        walletProviders: [
          scatter()
        ]
      });
      const walletProviders = accessContext.getWalletProviders();
      const selectedProvider = walletProviders[0];
      const wallet = accessContext.initWallet(selectedProvider);
      await wallet.connect().then(() => {
        console.log('Successfully connected!');
      });
      await wallet.login().then(() => {
        console.log(`Successfully logged in as ${wallet.auth.accountName}!`);
      });
      this.setState({wallet: wallet}) // to use terminate
      this.setState({accessContext: accessContext}) // to use destroy
    }

    async logout() {
        this.state.accessContext.destroy();  
        // tried logoutAll, disconnectAll, terminateAll
        await this.state.wallet.terminate().then(() => {
            console.log(`Successfully terminated!`);
        });
        // tried logout, disconnect, terminate
        // after calling still allows transact function below
    }

    transact = () => {
       // transact logic for .0001 EOS transfer, broadcast: false
    }

I've tried calling destroy/terminate within my login function as well before setting state, yet I'm still able to transact under all circumstances. I've also placed the transact logic within the login function to see if that made a difference, but I was still able to transact.

Any help would be appreciated, thank you and great tool!

Provide example for eos-transit-anchorlink-provider

It's unclear without looking at code that you need to provide a "session id" to anchor's constructor when setting up the access context's wallet providers. Nor does anchor() throw any errors if you don't specify the session id. You just get an obscure error if you don't.

e.g.

        walletProviders: [
            anchor(`discussions`),
            scatter()
        ]

Add Parent Permission to discovery results

The discovery feature is very helpful. But it would be ideal if the discover results also included the parent permission of each discovered permission/authority. This could enable other use cases like keeping a cache of the permissions and keys stored across different wallets. This data could be discovered by querying the public chain - it is public info after all, but it would be great if it could be returned with the results of discover.

Can't run the react example

When I try to run the reactjs example it fails.

transit-hw-wallet

It's on the ledger module.
node_modules/@ledgerhq/hw-transport-u2f/lib/TransportU2F.js:123

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.