Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeAll(async () => {
let w = get()
if (isTrezor(w) && supportsBTC(w) && supportsETH(w))
wallet = w
else
fail('Wallet is not a Trezor')
})
beforeAll(async () => {
let w = get()
if (isKeepKey(w) && supportsBTC(w) && supportsETH(w))
wallet = w
else
fail('Wallet is not a KeepKey')
})
beforeAll(async () => {
let w = get()
if (isLedger(w) && supportsBTC(w) && supportsETH(w))
wallet = w
else
fail('Wallet is not a Ledger')
})
beforeAll(() => {
let w = get()
if (isPortis(w) && supportsETH(w))
wallet = w
else
fail('Wallet is not Portis')
})
$ethVerify.on('click', async (e) => {
e.preventDefault()
if (!wallet) { $ethResults.val("No wallet?"); return}
if (supportsETH(wallet)) {
let result = await wallet.ethVerifyMessage({
address: "0x2068dD92B6690255553141Dfcf00dF308281f763",
message: "Hello World",
signature: "61f1dda82e9c3800e960894396c9ce8164fd1526fccb136c71b88442405f7d09721725629915d10bc7cecfca2818fe76bc5816ed96a1b0cebee9b03b052980131b"
})
$ethResults.val(result ? '✅' : '❌')
} else {
let label = await wallet.getLabel()
$ethResults.val(label + " does not support ETH")
}
})
beforeAll(async () => {
const { wallet: w } = get()
if (supportsETH(w))
wallet = w
})