Coder Social home page Coder Social logo

getscatter / scatterwebextension Goto Github PK

View Code? Open in Web Editor NEW
367.0 34.0 127.0 100.33 MB

Extension that allows you to sign transactions with your private keys securely from within the browser without ever exposing them.

License: MIT License

JavaScript 66.85% Vue 31.93% HTML 0.23% CSS 0.99%
eosio eosjs identity signature blockchain

scatterwebextension's Introduction

Scatter Classic

Scatter is a browser extension that allows you to sign transactions for multiple blockchains and provide personal information to web applications without ever exposing your keys or filling out forms.

NOTICE: Scatter Classic is DEPRECATED!

Do not build apps only for Scatter Classic ( Extension ).

Visit https://get-scatter.com/docs/dev/setting-up-for-web-apps to find out how to make dapps that support Classic, Desktop and Mobile all at once.

If you want more information about this decision please read this article: https://medium.com/@nsjames/the-blockchain-isnt-just-for-web-applications-silly-rabbit-926a4ea5ccd1

scatterwebextension's People

Contributors

amih avatar breedlov3r avatar deniscarriere avatar gnumarcelo avatar javierjmc avatar jordigoyanes avatar jvr0x avatar leordev avatar nsjames avatar petervalencic avatar ramijames avatar soleone 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  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  avatar  avatar  avatar  avatar  avatar

scatterwebextension's Issues

App/Scatter Event System

There should be an event system that can inform the scatterdapp instance on the application of events such as:

  • Locked
  • Identity Disabled
  • Identity relevant account changed

Extension locks up when trying to connect to Jungle Testnet

Create a key pair in Scatter.
Go to identities, I already have identities which are not linked to any key
Open one of the identities to edit and go to the account section
Choose EOS:159.65.161.248:8888 as the network under account
Choose the key pair you just create
Click Import
Get an error message 'No account found'
This is the error behaviour

Choose EOS:dev.cryptolions.io:8888 as the network under account
Choose the same key pair as before
Click Import
Nothing happens - the import button greys out but not error message stays in that state forever.
Obviously incorrect behaviour

I am able to reproduce the same behaviour running my own private testnet, build from dawn4 source code

Make default action button in top right corner more obvious

When adding a new network, after a ip/hostname and port are provided possibly make the submit checkbox more obvious by making it green or something.

  • Imported manually from Trello card.
  • Tagged as User Experience Suggestions in Trello.
  • Originally created on 2018-02-08

@Soleone said:

Yes! Very easy to miss this in the top right corner.

A similar issue exists in the same place when trying to save your address, it took me a few attempts of carefully looking around to finally save the address.

Seems worthwhile to prioritize for ensuring new user experience is least frustrating as possible.

Only the first promise of multiple failing scatter calls gives an error

console.log("suggesting network"); 
scatter.suggestNetwork().catch(error => { 
     console.log("error suggesting network");
 });

console.log("requesting identity"); 
const requirements = ['account'];
scatter.getIdentity(requirements).then(identity => { 
    console.log("got identity"); 
}).catch(error => { 
     console.log("error in getIdentity"); 
});

The call to getIdentity will print nothing neither got identity nor error in getIdentity if scatter is locked. But if the call to suggestNetwork is removed

the console log is:
requesting identity
error suggesting network

i would expect this console log:
requesting identity
error suggesting network
error in getIdentity

It is probably not good to call these methods in this progression anyway. It is though a bit confusing to get neither an error nor a success on this getIdentity call. Like the title suggest what scatter methods are called does not actually matter. Two calls to getIdentity would also do then the second call would be silent.

Allow for boolean options, such as "user is over 18" or "user lives in USA"

  • Imported manually from Trello card.
  • Tagged as User Experience Suggestions in Trello.
  • Originally created on 2018-03-06

@Soleone said:

This issue might benefit from a better description.

Seems like you would be able to get the age from the identity information's birth date.

Maybe there could be a checkbox on one of the addresses to mark it as "legal residence" for e.g. KYC purposes to help with the "user lives in USA" part.

Create new funcionality to encrypt and decrypt a text with private key

Please create a new functionality to encrypt and decrypt an arbitrary text with EOS private key and other EOS public key.

Methods signatures (example):

object EncryptText(string text, key publicKey)
Encrypts the text with the current Scatter Wallet EOS private key and the passed publicKey and returns the encrypted text.

object DecryptText(string encryptedText, key publicKey)
Decrypts the encryptedText with the current Scatter Wallet EOS private key and the passed publicKey and returns the decrypted text.

Please check this example with EOS js API and local keys, should be simple, like include this code inside scatter js lib:
https://github.com/b-mail/Documentation/blob/master/javascript-encrypt.md

Extension Migrations

Now that the extension is up on the chrome store it needs a migration service which can take a given model structure from a version and apply any changes towards the next version, otherwise the json will become invalid over time.

eos.contract doesn't work, account_missing error

eos : dawn4.2
scatter : 4.0.3

when I call eos.contract, it gives account_missing error.
I think code is correct...
and I set all scatter things correctly. (identity, key pair, account...)
Is it just version missmatch problem?
or should I modify the code?

code :

const eosOptions = {};
const eos = scatter.eos( network, Eos.Localnet, eosOptions );
scatter.getIdentity({ accounts:[network] }).then(id => {
  const account = id.accounts.find(account => account.blockchain === 'eos');
  const options = {
                          authorization: [
                              `${account.name}@${account.authority}`,
                          ]
                      };

  eos.contract(MY_CONTRACT).then(contract => {
      contract.myAction(...args, options);
  })
})

error :

{type: "account_missing", message: "Missing required accounts, repull the identity", code: 402, isError: true} code : 402 isError : true message : "Missing required accounts, repull the identity" type : "account_missing"

Allow for shipping information to be pre-selected and used to calculate shipping prices before issuing a signature request

  • Imported manually from Trello card.
  • Tagged as Feature Requests in Trello.
  • Originally created on 2018-03-08

Originally created by @Soleone:

To clarify, the problem is that during checkouts on stores you usually provide your address first, and only then are you offered shipping rates. Picking the shipping rate will then adjust the price accordingly so only then can we send the payment transaction.

Ability to sign information and send hash and pub key in transactions using eid smart cards

  • Imported manually from Trello card.
  • Tagged as Feature Requests in Trello.
  • Originally created on 2018-02-08

Mário Silva (not sure what Github username if any) created this ticket originally:

Is possible to use NativeMessagingAPI from chorme extensions to access smart cards and use eid cards features.

You can check a lot of work was made here: https://github.com/open-eid/chrome-token-signing

The idea is to add the ability to send inside a transaction for a smart-contract some information signed with eid RSA public key.

For example for voting this could be sent:

arg0: "I vote for producer A"
arg1: "{hash from signing eid John}"
arg2: "RSA public key from John"
arg3: "Country" -- dunno if is need

Then the RSA keys could be checked with the sent country to cross-check if RSA was issued from a valid CA. Also you can reduce duplicates.

Do you think this is enough to add identity to smart-contracts using scatter?

Add https support

We need to support https for security, so we hope to get support soon.

Creating First Identity Screen no scrollbar

OS: OSX High Sierra 10.13.3
Chrome: Version 63.0.3239.132 (Official Build) (64-bit)
Situation: Inside the "creating first identity" screen (see below) I can't see the submit button and there's no scrollbar.

image

Load from Backup not closing after selecting file

Hi : )

I was using Scatter in Chrome and now I'm trying it on Firefox. I exported by backup in Chrome and it successfully generated my .keychain file.

However, on Firefox, when I click Load from Backup, then Select File, then actually select the .keychain file and click Open, Scatter windows closes and no import is successful. I don't even get the chance to click Import Keychain

I'm using Firefox 60.0.1, with Scatter 4.0.3 (on both browsers) and macOS 10.13.4.

Unable to create new identity

When I create a new scatter the default identity is not there. When I try to create a new identity and click save the app freezes on the create identity page.

Clarify use of proprietary code

Reading the doc and looking at the dependencies of this project, it seems it is using some proprietary code Extension-Streams.
As there are no details on the license of this dependency, it is a legal liability for any user of this project.
Could we either clarify the license of this dependency or replace it?

Adding language: French

Happy to contribute with a French translation.

Will use the more conventional (and mostly used by apps) "you" (vous) as opposed to the more personal "you" (tu).

chainId issues

In version 4.0.3, if you enter a chainId in the network, it will be OK to register the identity, but you can not get the value from the getIdentity () function. The chainId value is the same as the hard-coded value 706a7ddd808de9fc2b8879904f3b392256c83104c1d544b38302cc07d9fca477 at [email protected]. If you do not put a chainId value, it works fine.

Can I send transactions without requirement of identity?

I know identity is convenient in some situations, but sometimes i just want to send a transaction. So some questions:

  1. Why Scatter introduced the concept of Identity? Can I send transactions whihout requirement of identity?
  2. The identity is created for users who have more than one account or have accounts on different chains, right?

Account not being saved/attached to Identity

Dear,

I'm trying to attach a new account to a identity (tested with a new one and editing an existing one). On the identity screen, I can select the network and the account, then I click Import and next Save. However no account is actually saved/attached to the identity.

I'm using Firefox 60.0.1, with Scatter 4.0.3 (on Chrome and Firefox) and macOS 10.13.4.

No error is displayed. Any clue abouy what I might be doing wrong?

Add back token displays

Token displays was removed in 3.0 because of a change with the eosio.token contract.

  • Add EOS token
  • Add arbitrary tokens defined in Settings mapped to blockchains

EOS networks don't support HTTPS endpoints

Eosjs requests routed through Scatter do not support HTTPS. The httpEndpoint config option is automatically prefixed with http://

https://github.com/EOSEssentials/Scatter/blob/27316e762fb03ef35267daa07a0ac08f40aa443b/src/plugins/defaults/eos.js#L44

Using an HTTPS endpoint would require supporting a protocol option for networks so it could be used like:

var network = {
    blockchain: 'eos',
    protocol: "https",
    host: "bp.libertyblock.io",
    port: 8890,
    chainId: "a628a5a6123d6ed60242560f23354c557f4a02826e223bb38aad79ddeb9afbca"
}

Why I can't get the eos account name from the identity?

My Env:
Scatter 4.0.3
Dawn 4.2

Here is there trace log of print the identy.
Get the identity:{"hash":"3a79e2913e3e456ea0d6d1e33d444048b6f3e32058f24f6e8f7e58138fc2f301","publicKey":"EOS53orukiWJhuu8jN6pkpvKUw6sQRPB7AjjAXWQAsFPHRsdfCpCV","name":"RandomRabbit5986286","kyc":false,"personal":{"email":"[email protected]"}}

Why the name is "RandomRabbit5986286", but the the eos account name i create in EOS wallet.

binaryen option not supported for setcode operation

The binaryen option is required by eosjs for the setcode operation and it appears that this option cannot be passed to the Scatter eos instance due to the way options are stringified.

This seems to be the line of code causing the issue in the EOS plugin class:

_eos(Object.assign(JSON.stringify(_options), {httpEndpoint, signProvider}))[method](...args)

Save state of the popup to avoid navigating again when closing and reopening

It's annoying to be pushed back to the main menu every time you open Scatter. It should save your last location and start there when you re-open the extension if not logged out by the auto timer.

  • Imported manually from Trello card.
  • Tagged as User Experience Suggestions in Trello.
  • Originally created on 2018-02-09

@leordev said:

(thinking about it yesterday! :P)

@Soleone said:

Yes, please! As a newcomer to the extension when trying to set it up this was very irritating.

Adding Language: chinese

I 'm from ZWZM, one of the best Chinese blockchain translating community which is dedicated to translating valuable blockchain books and articles into Chinese. Some top Chinese blockchain leaders and evangelists ,such as James Gong , Dr. Bin Lu etc. are our community advisors.

I 'd like to translate it into Chinese

Add ability to complete forms by clicking enter within input fields

  • Imported manually from Trello card.
  • Tagged as Burned in Trello.
  • Originally created on 2018-02-08

@leordev said:

Fix for password unlock and new entry! :) - the other complex forms in the prompt and addresses forms is still in a button fashion, but I think it's ok because forces the user to scroll up and down to review all the inputs and click to confirm -- let me know if any other form is needed though! :)

unsatisfied_authorization - provided keys, permissions, and delays do not satisfy declared authorization

I am trying to write a voting application. Since Monday this has been failing with the above error message. I suspect this is related to the change to Dawn 4.2. I am connected the Jungle Testnet and am using scatter from the Google Chrome store. This reports itself as version 4.0.3.

The code

function vote_now(e) {
    const network = {
        blockchain:'eos',
        host: chain_addr, 
        port: chain_port, 
    }

    const requiredFields = {
        accounts:[ network ],
    };

    scatter.suggestNetwork(network).then((result) => {
        scatter.getIdentity(requiredFields).then(identity => {
            const eosOptions = {};
            eos = scatter.eos( network, eosjs.Localnet, eosOptions );
             
            eos.contract('eosio', {accounts:[{blockchain:'eos', host:chain_addr, port:chain_port}, ]
            }).then(c => {
                    c.voteproducer({'voter': scatter.identity.accounts[0].name, 'proxy': proxy_name, 'producers': proxy_name != '' ? [] : votes},
                                   { authorization: [scatter.identity.accounts[0].name]} )
                        .then((result) => {
                            alert('Your vote was cast successfully');
                            confirming_vote = false;
                            redrawAll();
                        })
                        .catch((error) => {
                            console.error('voteproducer error=', error);
                            alert('eosio.voteproducer returned an error\nmessage:' + error.message);
                        })

.....

The full error message

{
   "code":500,"message":"Internal Service Error",
   "error":{"code":3090003,
        "name":"unsatisfied_authorization",
        "what":"provided keys, permissions, and delays do not satisfy declared authorizations",
        "details":[
              {"message":"transaction declares authority '{\"actor\":\"alloalloallo\",\"permission\":\"active\"}', but does not have signatures for it under a provided delay of 0 ms",
               "file":"authorization_manager.cpp","line_number":405,"method":"check_authorization"}
         ]
    }
}

Any ideas?

Support for Photo Identity + Age verification.

The ability to upload photo ID's - Driving licence - passport, Some sites may request that you need to upload a photo to verify the identity you give them permission to see is real. saving time on multiple websites.

I think a lot of dapps/companys will benefit from this especially in the CryptoVerse when more regulations are hedging towards Transparency for the reason they deem fit.

IF company's can access you're identity with you're permission and see you're photo ID - this could make things a lot easier some companys/dapps may not want to store you're ID but only want to verify you say who you are.

Just my 2 cents. opinions wc

Network in port 81

My network is in port 81, perhaps Scatter should allow to host the network in any port.

screen shot 2018-02-16 at 15 57 59

UX ideas

Hi guys! just want to give some feedback, I really love Scatter as you all know and I am integrating it at the moment :) I am not an expert in UI/UX, but these are things that I find problems.

  • Identities could be sorted with the newest first (or at least the actives first)

  • Networks droplist should also be sorted by the latest that you added.

  • Networks in the first menu? It also took me some time to figure out that I need to go to Settings to add networks. (Not super strong about it)

  • When you are adding a new identity, the "check" to save appears and disappears in a random way, I spent some time blocked looking for a place to save my identity until I realise that the button was not appearing.

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.