Some formatting and fixes
This commit is contained in:
parent
6b67c04e0a
commit
b4186d5062
35
.jshintrc
Normal file
35
.jshintrc
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"predef": [
|
||||||
|
"global",
|
||||||
|
"Promise",
|
||||||
|
"require",
|
||||||
|
"process",
|
||||||
|
"module",
|
||||||
|
"exports"
|
||||||
|
],
|
||||||
|
"browser": false,
|
||||||
|
"boss": true,
|
||||||
|
"curly": true,
|
||||||
|
"debug": false,
|
||||||
|
"devel": true,
|
||||||
|
"eqeqeq": true,
|
||||||
|
"evil": true,
|
||||||
|
"forin": false,
|
||||||
|
"immed": false,
|
||||||
|
"laxbreak": false,
|
||||||
|
"newcap": true,
|
||||||
|
"noarg": true,
|
||||||
|
"noempty": false,
|
||||||
|
"nonew": false,
|
||||||
|
"nomen": false,
|
||||||
|
"onevar": false,
|
||||||
|
"plusplus": false,
|
||||||
|
"regexp": false,
|
||||||
|
"undef": true,
|
||||||
|
"sub": true,
|
||||||
|
"strict": false,
|
||||||
|
"white": false,
|
||||||
|
"eqnull": true,
|
||||||
|
"esnext": true,
|
||||||
|
"unused": true
|
||||||
|
}
|
12
index.js
12
index.js
@ -7,14 +7,9 @@
|
|||||||
// KREDITS_WALLET_PATH: Path to a etherum wallet JSON file
|
// KREDITS_WALLET_PATH: Path to a etherum wallet JSON file
|
||||||
// KREDITS_WALLET_PASSWORD: Wallet password
|
// KREDITS_WALLET_PASSWORD: Wallet password
|
||||||
//
|
//
|
||||||
// Authors:
|
const fs = require('fs');
|
||||||
// Sebastian Kippe <sebastian@kip.pe>
|
|
||||||
|
|
||||||
// const fs = require('fs');
|
|
||||||
//
|
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
const kreditsContracts = require('kredits-contracts');
|
const kreditsContracts = require('kredits-contracts');
|
||||||
const fs = require('fs');
|
|
||||||
const ProviderEngine = require('web3-provider-engine');
|
const ProviderEngine = require('web3-provider-engine');
|
||||||
const Wallet = require('ethereumjs-wallet');
|
const Wallet = require('ethereumjs-wallet');
|
||||||
const WalletSubprovider = require('ethereumjs-wallet/provider-engine');
|
const WalletSubprovider = require('ethereumjs-wallet/provider-engine');
|
||||||
@ -36,12 +31,11 @@ engine.start();
|
|||||||
let web3 = new Web3(engine);
|
let web3 = new Web3(engine);
|
||||||
let contracts = kreditsContracts(web3);
|
let contracts = kreditsContracts(web3);
|
||||||
let Kredits = contracts['Kredits'];
|
let Kredits = contracts['Kredits'];
|
||||||
let Token = contracts['Token'];
|
|
||||||
|
|
||||||
console.log('[HUBOT-KREDITS] wallet address: ' + hubotWalletAddress);
|
console.log('[HUBOT-KREDITS] wallet address: ' + hubotWalletAddress);
|
||||||
web3.eth.getBalance('eee2de74de31d2e3ef24cb0f6959fd88b59267bd', function (err, balance) {
|
web3.eth.getBalance(hubotWalletAddress, function (err, balance) {
|
||||||
if (err) { console.log('[HUBOT-KREDITS] error checking balance'); return; }
|
if (err) { console.log('[HUBOT-KREDITS] error checking balance'); return; }
|
||||||
if (!balance > 0) {
|
if (balance <= 0) {
|
||||||
console.log('[HUBOT-KREDITS] Hubot is broke. Please sond some eth to ' + hubotWalletAddress);
|
console.log('[HUBOT-KREDITS] Hubot is broke. Please sond some eth to ' + hubotWalletAddress);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -20,7 +20,11 @@
|
|||||||
"keywords": [
|
"keywords": [
|
||||||
"kosmos"
|
"kosmos"
|
||||||
],
|
],
|
||||||
"author": "Sebastian Kippe <sebastian@kip.pe>",
|
"author": "Kosmos Developers <mail@kosmos.org>",
|
||||||
|
"contributors": [
|
||||||
|
"Sebastian Kippe <sebastian@kip.pe>",
|
||||||
|
"Michael Bumann <hello@michaelbumann.com>"
|
||||||
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/67P/hubot-kredits/issues"
|
"url": "https://github.com/67P/hubot-kredits/issues"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user