In-browser signing support (#3231)

* Signer RAW confirmations

* Returning address book as eth_accounts

* UI support for in-browser signing

* Post review fixes

* Adding new methods to jsonrpc

* Fixing eth_accounts

* Deterministic accounts ordering
This commit is contained in:
Tomasz Drwięga
2016-11-10 11:27:05 +01:00
committed by Gav Wood
parent 90ff810e36
commit 2f98169539
21 changed files with 447 additions and 43 deletions

View File

@@ -93,6 +93,10 @@ export function inFilter (options) {
}
export function inHex (str) {
if (str && str.toString) {
str = str.toString(16);
}
if (str && str.substr(0, 2) === '0x') {
return str.toLowerCase();
}

View File

@@ -181,6 +181,12 @@ export default class Parity {
.then(outAddress);
}
nextNonce (account) {
return this._transport
.execute('parity_nextNonce', inAddress(account))
.then(outNumber);
}
nodeName () {
return this._transport
.execute('parity_nodeName');

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 { inNumber16 } from '../../format/input';
import { inNumber16, inData } from '../../format/input';
import { outSignerRequest } from '../../format/output';
export default class Signer {
@@ -27,6 +27,11 @@ export default class Signer {
.execute('signer_confirmRequest', inNumber16(requestId), options, password);
}
confirmRequestRaw (requestId, data) {
return this._transport
.execute('signer_confirmRequestRaw', inNumber16(requestId), inData(data));
}
generateAuthorizationToken () {
return this._transport
.execute('signer_generateAuthorizationToken');