Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nathan James
committed
Aug 30, 2018
1 parent
d6efc55
commit 0f18cb9
Showing
35 changed files
with
13,803 additions
and
6,862 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,42 @@ | ||
import ScatterJS from 'scatterjs-core' | ||
import Eos from 'eosjs' | ||
import ScatterJS from '../../packages/core/dist/index'; | ||
import ScatterEosjs from '../../packages/plugin-eosjs/dist/index' | ||
|
||
class Main { | ||
const network = { | ||
blockchain:'eos', | ||
chainId:'038f4b0fc8ff18a4f0842a8f0564611f6e96e8535901dd45e43ac8691a1c4dca', | ||
host:'dev.cryptolions.io', | ||
port:18888, | ||
protocol:'http' | ||
}; | ||
|
||
constructor(){ | ||
console.log('hi', ScatterJS) | ||
} | ||
|
||
} | ||
ScatterJS.plugins( new ScatterEosjs() ); | ||
let scatter = null; | ||
|
||
module.exports = new Main(); | ||
ScatterJS.scatter.connect('LernaTest').then(connected => { | ||
if(!connected) return false; | ||
scatter = ScatterJS.scatter; | ||
console.log('sc', scatter); | ||
}); | ||
|
||
window.login = () => { | ||
scatter.getIdentity({accounts:[network]}).then(id => { | ||
console.log('id', id); | ||
}) | ||
}; | ||
|
||
window.logout = () => { | ||
scatter.forgetIdentity(); | ||
}; | ||
|
||
window.transfer = () => { | ||
const eos = scatter.eos(network, Eos); | ||
const account = scatter.identity.accounts.find(x => x.blockchain === 'eos'); | ||
const opts = { authorization:[`${account.name}@${account.authority}`] }; | ||
eos.transfer(account.name, 'test', '1.0000 EOS', '', opts).then(trx => { | ||
console.log('trx', trx); | ||
}).catch(err => { | ||
console.error(err); | ||
}) | ||
}; |
Oops, something went wrong.