import React from 'react'; import html2canvas from 'html2canvas'; import { addHexPrefix, toChecksumAddress } from 'ethereumjs-util'; import notesBg from 'assets/images/notes-bg.png'; import sidebarImg from 'assets/images/print-sidebar.png'; import { Identicon, QRCode } from 'components/ui'; import './index.scss'; interface Props { address: string; privateKey: string; } export default class PaperWallet extends React.Component { private container: HTMLElement | null; public render() { const { privateKey } = this.props; const address = toChecksumAddress(addHexPrefix(this.props.address)); return (
(this.container = el)}> MyCrypto Logo

YOUR ADDRESS

AMOUNT / NOTES

YOUR PRIVATE KEY

Your Address:
{address}

Your Private Key:
{privateKey}

Always look for this icon when sending to this wallet

); } public toPNG = async () => { if (!this.container) { return ''; } const canvas = await html2canvas(this.container); return canvas.toDataURL('image/png'); }; }