Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async run() {
const result = await TrezorConnect.getPublicKey({
path: this.bip32Path,
coin: this.trezorCoin,
crossChain: true,
});
if (!result.success) {
throw new Error(result.payload.error);
}
return result.payload;
}
getXPubKey(assetSymbol: string, derivationPath: string): Promise {
return TrezorConnect.getPublicKey(log.debugInline('TrezorConnect.getPublicKey', {
coin: assetSymbol.toLowerCase(),
path: derivationPath,
})).then(handleResult)
}
getPublicKey (path, cb) {
TrezorConnect.getPublicKey({ device: this.device, path }).then(res => {
if (!res.success) return cb(new Error(res.payload.error))
cb(null, res.payload)
}).catch(err => cb(err))
}