npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eos-scatter

v1.0.0

Published

EOS Wallet & Bridge

Downloads

5

Readme

Scatter - Chrome wallet

Scatter is a Chrome Extension Wallet for EOS which facilitates interaction between users and dapps.

The extension keeps a user's private keys inside of an encrypted storage in a background process attached to their browser that is inaccessible to the website it interacts with. A few secure methods are exposed to the website being visited via injected javascript that allow them to request the signing of transactions on the user's behalf, all of which must be manually approved by the user.

Streams from the website to the extension are encrypted with a randomized key for each session.

Trello board.

I've set up a Trello board for tracking issues and feature requests which is open to the public. Please be kind to the board.

If you would like to just download and install the plugin's current build you can do so here

Setting it up is simple.

  • Extract the contents of the zip-file to somewhere on your computer
  • Open up chrome://extensions/ in your browser
  • Click the Load unpacked extension... button and point it at the folder.

Important:

At the moment it is not recommended to use multi-account keypairs. If a key has multiple accounts associated with it, the first account in the array will be used for signing transactions regardless of it's authority.

Building:

Building is handled by webpack. To build into the ./build directory simply use npm run dev or webpack.

Then load the unpacked extension in chrome with the method described above.

Usage example for the interacting webpage

If you want typings and code completion for the web api you can head over to Scatterdapp.

// ScatterLoaded happens _after_ encryption syncs.
// window.scatter will be null until encryption occurs
---------------------------------------------------------
document.addEventListener('scatterLoaded', afterLoad)
---------------------------------------------------------
function afterLoad(){
    var scatter = window.scatter;
    //...
}

SETUP

You must define a network that your website uses. A user's accounts will be filtered by the network. Failure to set a network will disallow messaging the extension.

var network = new Network("Test Network 1", "testnet1.eos.io", 8888);
window.scatter.setNetwork(network);

USAGE

There's two ways to have a user sign a transaction.

If you already know the account your user uses, you can inject the scatter provider right into eosjs and not have to worry about any special methods:

let eos = Eos.Localnet({httpEndpoint:network.toEndpoint(), signProvider:window.scatter.provider});

Then, you can call transactions normally and it will prompt the user through the provider.

eos.transfer({from: 'testacc', to: 'inita', amount: 1, memo: ''}).then(result => {
    //..
})

Or even your own transaction

eos.contract('currency').then(currency => 
    currency.transaction(customTransaction)
        .then...
        .catch... )

That's all great, but in a lot of cases it just wont do since you wont know what accounts they have.

For that you can use a scatter method which will push a transaction up to the extension to be signed and sent. For it to work though we have to do a few things to our transaction object.

let transaction = {
    messages: [{
        code: 'currency',
        type: 'transfer',
        authorization: [], // Left out, will be calculated after
        data:{
            from:'[scatter]', // Left out, will be calculated after
            to:'inita',
            quantity:5
        }
    }],
    scope:['inita'], // Leave out the other
    signatures:[]
};

As you can see above you can send any transaction you want, and by adding [scatter] into a property's value it will autofill when the user selects an account.

Once you've prepared your transaction you can send it off to be signed inside of the extension.

window.scatter.signWithAnyAccount(transaction)
    .then...
    .catch...

Check out the eosjs repo for more information on how to use it to interact

with the EOS blockchain from javascript.