@keystonehq/metamask-airgapped-keyring
Advanced tools
Comparing version 0.2.2 to 0.2.5-alpha.0
@@ -1,1 +0,1 @@ | ||
export { MetaMaskKeyring } from './MetaMaskKeyring'; | ||
export { MetaMaskKeyring } from "./MetaMaskKeyring"; |
@@ -26,15 +26,15 @@ 'use strict'; | ||
}); | ||
this.on('keystone-sync_success-hdkey', cbor => { | ||
const cryptoHDKey = bcUrRegistryEth.CryptoHDKey.fromCBOR(Buffer.from(cbor, 'hex')); | ||
this.on("keystone-sync_success-hdkey", cbor => { | ||
const cryptoHDKey = bcUrRegistryEth.CryptoHDKey.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
resolve(cryptoHDKey); | ||
}); | ||
this.on('keystone-sync_success-account', cbor => { | ||
const cryptoAccount = bcUrRegistryEth.CryptoAccount.fromCBOR(Buffer.from(cbor, 'hex')); | ||
this.on("keystone-sync_success-account", cbor => { | ||
const cryptoAccount = bcUrRegistryEth.CryptoAccount.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
resolve(cryptoAccount); | ||
}); | ||
this.on('keystone-sync_cancel', () => { | ||
this.on("keystone-sync_cancel", () => { | ||
this.resetState(); | ||
reject(new Error('KeystoneError#sync_cancel. Sync process canceled, please retry')); | ||
reject(new Error("KeystoneError#sync_cancel. Sync process canceled, please retry")); | ||
}); | ||
@@ -45,11 +45,11 @@ }); | ||
this.submitCryptoHDKey = cbor => { | ||
this.emit('keystone-sync_success-hdkey', cbor); | ||
this.emit("keystone-sync_success-hdkey", cbor); | ||
}; | ||
this.submitCryptoAccount = cbor => { | ||
this.emit('keystone-sync_success-account', cbor); | ||
this.emit("keystone-sync_success-account", cbor); | ||
}; | ||
this.cancelSync = () => { | ||
this.emit('keystone-sync_cancel'); | ||
this.emit("keystone-sync_cancel"); | ||
}; | ||
@@ -66,3 +66,3 @@ | ||
type: ur.type, | ||
cbor: ur.cbor.toString('hex') | ||
cbor: ur.cbor.toString("hex") | ||
}, | ||
@@ -78,3 +78,3 @@ title: requestTitle, | ||
this.once(`${requestId}-signed`, cbor => { | ||
const ethSignature = bcUrRegistryEth.ETHSignature.fromCBOR(Buffer.from(cbor, 'hex')); | ||
const ethSignature = bcUrRegistryEth.ETHSignature.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
@@ -85,3 +85,3 @@ resolve(ethSignature); | ||
this.resetState(); | ||
reject(new Error('KeystoneError#Tx_canceled. Signing canceled, please retry')); | ||
reject(new Error("KeystoneError#Tx_canceled. Signing canceled, please retry")); | ||
}); | ||
@@ -160,8 +160,8 @@ }); | ||
this.currentAccount = 0; | ||
this.name = 'QR Hardware'; | ||
this.name = "QR Hardware"; | ||
this.initialized = false; //hd props; | ||
this.xfp = ''; | ||
this.xpub = ''; | ||
this.hdPath = ''; | ||
this.xfp = ""; | ||
this.xpub = ""; | ||
this.hdPath = ""; | ||
this.indexes = {}; | ||
@@ -205,3 +205,3 @@ this.hdk = undefined; //pubkey props; | ||
v | ||
} = await this.requestSignature(requestId, ethSignRequest, 'Scan with your Keystone', 'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'); | ||
} = await this.requestSignature(requestId, ethSignRequest, "Scan with your Keystone", 'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'); | ||
const txJson = tx$1.toJSON(); | ||
@@ -208,0 +208,0 @@ txJson.v = v; |
@@ -20,15 +20,15 @@ import { BaseKeyring } from '@keystonehq/base-eth-keyring'; | ||
}); | ||
this.on('keystone-sync_success-hdkey', cbor => { | ||
const cryptoHDKey = CryptoHDKey.fromCBOR(Buffer.from(cbor, 'hex')); | ||
this.on("keystone-sync_success-hdkey", cbor => { | ||
const cryptoHDKey = CryptoHDKey.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
resolve(cryptoHDKey); | ||
}); | ||
this.on('keystone-sync_success-account', cbor => { | ||
const cryptoAccount = CryptoAccount.fromCBOR(Buffer.from(cbor, 'hex')); | ||
this.on("keystone-sync_success-account", cbor => { | ||
const cryptoAccount = CryptoAccount.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
resolve(cryptoAccount); | ||
}); | ||
this.on('keystone-sync_cancel', () => { | ||
this.on("keystone-sync_cancel", () => { | ||
this.resetState(); | ||
reject(new Error('KeystoneError#sync_cancel. Sync process canceled, please retry')); | ||
reject(new Error("KeystoneError#sync_cancel. Sync process canceled, please retry")); | ||
}); | ||
@@ -39,11 +39,11 @@ }); | ||
this.submitCryptoHDKey = cbor => { | ||
this.emit('keystone-sync_success-hdkey', cbor); | ||
this.emit("keystone-sync_success-hdkey", cbor); | ||
}; | ||
this.submitCryptoAccount = cbor => { | ||
this.emit('keystone-sync_success-account', cbor); | ||
this.emit("keystone-sync_success-account", cbor); | ||
}; | ||
this.cancelSync = () => { | ||
this.emit('keystone-sync_cancel'); | ||
this.emit("keystone-sync_cancel"); | ||
}; | ||
@@ -60,3 +60,3 @@ | ||
type: ur.type, | ||
cbor: ur.cbor.toString('hex') | ||
cbor: ur.cbor.toString("hex") | ||
}, | ||
@@ -72,3 +72,3 @@ title: requestTitle, | ||
this.once(`${requestId}-signed`, cbor => { | ||
const ethSignature = ETHSignature.fromCBOR(Buffer.from(cbor, 'hex')); | ||
const ethSignature = ETHSignature.fromCBOR(Buffer.from(cbor, "hex")); | ||
this.resetState(); | ||
@@ -79,3 +79,3 @@ resolve(ethSignature); | ||
this.resetState(); | ||
reject(new Error('KeystoneError#Tx_canceled. Signing canceled, please retry')); | ||
reject(new Error("KeystoneError#Tx_canceled. Signing canceled, please retry")); | ||
}); | ||
@@ -154,8 +154,8 @@ }); | ||
this.currentAccount = 0; | ||
this.name = 'QR Hardware'; | ||
this.name = "QR Hardware"; | ||
this.initialized = false; //hd props; | ||
this.xfp = ''; | ||
this.xpub = ''; | ||
this.hdPath = ''; | ||
this.xfp = ""; | ||
this.xpub = ""; | ||
this.hdPath = ""; | ||
this.indexes = {}; | ||
@@ -199,3 +199,3 @@ this.hdk = undefined; //pubkey props; | ||
v | ||
} = await this.requestSignature(requestId, ethSignRequest, 'Scan with your Keystone', 'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'); | ||
} = await this.requestSignature(requestId, ethSignRequest, "Scan with your Keystone", 'After your Keystone has signed the transaction, click on "Scan Keystone" to receive the signature'); | ||
const txJson = tx.toJSON(); | ||
@@ -202,0 +202,0 @@ txJson.v = v; |
/// <reference types="node" /> | ||
import { InteractionProvider } from '@keystonehq/base-eth-keyring'; | ||
import { EventEmitter } from 'events'; | ||
import { ObservableStore } from '@metamask/obs-store'; | ||
import { EthSignRequest, ETHSignature, CryptoHDKey, CryptoAccount } from '@keystonehq/bc-ur-registry-eth'; | ||
import { InteractionProvider } from "@keystonehq/base-eth-keyring"; | ||
import { EventEmitter } from "events"; | ||
import { ObservableStore } from "@metamask/obs-store"; | ||
import { EthSignRequest, ETHSignature, CryptoHDKey, CryptoAccount } from "@keystonehq/bc-ur-registry-eth"; | ||
export declare class MetamaskInteractionProvider extends EventEmitter implements InteractionProvider { | ||
@@ -7,0 +7,0 @@ static instance: MetamaskInteractionProvider; |
@@ -1,3 +0,3 @@ | ||
import { BaseKeyring, StoredKeyring } from '@keystonehq/base-eth-keyring'; | ||
import { MetamaskInteractionProvider } from './MetaMaskInteractionProvider'; | ||
import { BaseKeyring, StoredKeyring } from "@keystonehq/base-eth-keyring"; | ||
import { MetamaskInteractionProvider } from "./MetaMaskInteractionProvider"; | ||
export declare class MetaMaskKeyring extends BaseKeyring { | ||
@@ -4,0 +4,0 @@ static type: string; |
{ | ||
"name": "@keystonehq/metamask-airgapped-keyring", | ||
"version": "0.2.2", | ||
"version": "0.2.5-alpha.0", | ||
"description": "airgapped eth keyring for metamask", | ||
@@ -30,4 +30,4 @@ "author": "aaronisme <aarondongchen@gmail.com>", | ||
"@ethereumjs/tx": "^3.3.0", | ||
"@keystonehq/base-eth-keyring": "^0.3.2", | ||
"@keystonehq/bc-ur-registry-eth": "^0.7.7", | ||
"@keystonehq/base-eth-keyring": "^0.3.5-alpha.0", | ||
"@keystonehq/bc-ur-registry-eth": "^0.8.1-alpha.0", | ||
"@metamask/obs-store": "^7.0.0", | ||
@@ -39,3 +39,4 @@ "rlp": "^2.2.6", | ||
"@babel/preset-typescript": "^7.15.0", | ||
"tsdx": "^0.14.1" | ||
"tsdx": "^0.14.1", | ||
"typescript": "^4.6.2" | ||
}, | ||
@@ -45,3 +46,3 @@ "bugs": { | ||
}, | ||
"gitHead": "3da553401363b9c96830abc58ce5a5f2f76188f7" | ||
"gitHead": "d0e30b4cc7bd2b1490302068a83adcd8bd394d6b" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
58854
3
+ Added@keystonehq/base-eth-keyring@0.3.5-alpha.0(transitive)
+ Added@keystonehq/bc-ur-registry@0.5.5(transitive)
+ Added@keystonehq/bc-ur-registry-eth@0.8.1-alpha.0(transitive)
- Removed@keystonehq/base-eth-keyring@0.3.2(transitive)
- Removed@keystonehq/bc-ur-registry@0.4.4(transitive)
- Removed@keystonehq/bc-ur-registry-eth@0.7.7(transitive)
- Removedbase-x@1.1.0(transitive)
- Removedbase58check@2.0.0(transitive)
- Removedbs58@3.1.0(transitive)