Add import of raw private key RPCs (#2942)

* Importing an account from raw secret

* Add jsapi & jsonrpc for personal_newAccountFromSecret
This commit is contained in:
Jaco Greeff
2016-10-28 16:46:25 +02:00
committed by Gav Wood
parent 6abd08f5b2
commit 8d66fc50e2
4 changed files with 45 additions and 3 deletions

View File

@@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
import { inAddress, inNumber10, inNumber16, inOptions } from '../../format/input';
import { inAddress, inHex, inNumber10, inNumber16, inOptions } from '../../format/input';
import { outAccountInfo, outAddress, outSignerRequest } from '../../format/output';
export default class Personal {
@@ -73,6 +73,12 @@ export default class Personal {
.then(outAddress);
}
newAccountFromSecret (secret, password) {
return this._transport
.execute('personal_newAccountFromSecret', inHex(secret), password)
.then(outAddress);
}
newAccountFromWallet (json, password) {
return this._transport
.execute('personal_newAccountFromWallet', json, password)