Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
nsjames committed Aug 1, 2018
0 parents commit 548b355
Show file tree
Hide file tree
Showing 23 changed files with 57,026 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .babelrc
@@ -0,0 +1,8 @@
{
"presets": [["env", {
targets: { "node": true }
}], "stage-3"],
"plugins": [
"transform-runtime"
]
}
5 changes: 5 additions & 0 deletions .gitignore
@@ -0,0 +1,5 @@
.idea/
node_modules/
.env
.DS_Store
*.iml
5 changes: 5 additions & 0 deletions .npmignore
@@ -0,0 +1,5 @@
.*
**/webpack.config.js
node_modules
src
test
61 changes: 61 additions & 0 deletions README.md
@@ -0,0 +1,61 @@
# Scatter JS

This is an importable javascript library that allows web applications to directly interface with Scatter Desktop.

## Installation

```js
import scatter from 'scatter-js'

//or

const scatter = require('scatter-js');
```

You can also just drop the `scatter.min.js` bundle from the `dist/` directory here right into
your html file use it from there.

```html
<script src="path/to/scatter.min.js"></script>
```

#### CDN:

Coming soon.

## Usage

Setting this up is easy.

```js
let KEY = ``;

// This should be some getter for a private pairing key.
// You'll probably want to store this in a cookie or localstorage
// or perhaps something more secure as it validates that requests
// are coming from your application
function getter(){
return new Promise(resolve => resolve(KEY));
}

// This should be some setter if you are not pre-generating a
// RSA key used for the local socket's encryption.
// If you provide a `null` key from the getter initially this
// library will generate an RSA key for you.
function setter(x){
return new Promise(resolve => resolve(KEY = x));
}

// Creates a connection to Scatter Desktop and will prompt the user
// to authorize your application from within their Scatter.
scatter.connect("TestPage", getter, setter).then(connected => {
// Use `scatter` normally now.
})

```

See the [Developer Documentation](https://get-scatter.com/docs/dev/getting-started) to find out how to
interact with Scatter and various blockchains.

Scatter sits on top of [eosjs](https://github.com/EOSIO/eosjs) or [web3](https://github.com/ethereum/web3.js/),
so learn to use those depending on which blockchain you are interfacing with.

0 comments on commit 548b355

Please sign in to comment.