From da4eb7bdbee4fecf2cb53de678ababb47ce4bd9a Mon Sep 17 00:00:00 2001 From: Dmitry Novotochinov Date: Tue, 20 Aug 2019 22:58:06 +0300 Subject: [PATCH] add root address and public key to generateAndLoadKey() response --- .../main/java/im/status/ethereum/keycard/SmartCard.java | 2 ++ docs/usage.md | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/im/status/ethereum/keycard/SmartCard.java b/android/src/main/java/im/status/ethereum/keycard/SmartCard.java index d6a7bb8..b246636 100644 --- a/android/src/main/java/im/status/ethereum/keycard/SmartCard.java +++ b/android/src/main/java/im/status/ethereum/keycard/SmartCard.java @@ -368,6 +368,8 @@ public class SmartCard extends BroadcastReceiver implements CardListener { ApplicationInfo info = new ApplicationInfo(cmdSet.select().checkOK().getData()); WritableMap data = Arguments.createMap(); + data.putString("address", Hex.toHexString(keyPair.toEthereumAddress())); + data.putString("public-key", Hex.toHexString(keyPair.getPublicKey())); data.putString("wallet-address", Hex.toHexString(walletKeyPair.toEthereumAddress())); data.putString("wallet-public-key", Hex.toHexString(walletKeyPair.getPublicKey())); data.putString("whisper-address", Hex.toHexString(whisperKeyPair.toEthereumAddress())); diff --git a/docs/usage.md b/docs/usage.md index de586b1..913f093 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -124,7 +124,9 @@ Keycard.generateAndLoadKey(mnemonic, pairing, pin).then(data => console.log(data `data` object returned: ```javascript -{"wallet-address": "9726cbc67d170307dd80af6416ebe844e7b8eb1c", +{"address": "b19a57f4d3241e6a123ea332241d6f03790075b4", +"public-key": "0427cc3998d0e0b8d56b64fad4d1f025914b8cb72558810c74dd34454fcd6907f6f7429a0726dceec9b93c9060103ff8b2e7daa1cb9a4dd62b7ae1ba2232709555", +"wallet-address": "9726cbc67d170307dd80af6416ebe844e7b8eb1c", "wallet-public-key": "04065670509d295cb8330e02a688eafe83dbbb317486062482725ba1036dba396d635e91afd9a9e7087c0dfeaccf30d2004d092ed250d62b5c75f8bb4c9326d409", "whisper-address": "438e576b638bff08b2872dd708cf0240811d79af", "whisper-public-key": "04add221cb97dde8afbf3be27b0bfb3b6842071cb1052abfc3c34d45eba944dc10dcba5d4823fe69148ae17b12ed459237124365c2f46c2b46be9537ce6efa93c8", @@ -134,6 +136,10 @@ Keycard.generateAndLoadKey(mnemonic, pairing, pin).then(data => console.log(data "key-uid":"a88d46499e5690c6ad637e243e83cf51be3e2c67e48324b2b2def3e6a0492576"} ``` +`address` is an address of root key + +`public-key` is public key of root key + `wallet-address` is ethereum address of key with derivation path `m/44'/60'/0'/0/0` `whisper-address` is ethereum address of key with derivation path `m/43'/60'/1581'/0'/0`