Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
a6f82070
Commit
a6f82070
authored
Apr 08, 2016
by
Alex Beregszaszi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add newAccount() method to universal-dapp for creating a new account
parent
26c4a968
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
universal-dapp.js
src/universal-dapp.js
+9
-0
No files found.
src/universal-dapp.js
View file @
a6f82070
...
...
@@ -7,6 +7,7 @@ var ethJSABI = require('ethereumjs-abi');
var
EthJSBlock
=
require
(
'ethereumjs-block'
);
var
BN
=
ethJSUtil
.
BN
;
var
EventManager
=
require
(
'./lib/eventManager'
);
var
crypto
=
require
(
'crypto'
);
/*
trigger debugRequested
...
...
@@ -49,6 +50,14 @@ UniversalDApp.prototype.reset = function (contracts, getAddress, getValue, getGa
}
};
UniversalDApp
.
prototype
.
newAccount
=
function
()
{
var
privateKey
;
do
{
privateKey
=
crypto
.
randomBytes
(
32
);
}
while
(
!
ethJSUtil
.
isValidPrivate
(
privateKey
));
this
.
_addAccount
(
privateKey
);
};
UniversalDApp
.
prototype
.
addAccount
=
function
(
privateKey
,
balance
)
{
var
self
=
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment