How to use the trezor-connect.ethereumSignMessage function in trezor-connect

To help you get started, we’ve selected a few trezor-connect examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github joincivil / Civil / packages / utils / src / web3 / trezor.ts View on Github external
signMessage(data: string, account: any, cb: (err: any, res?: any) => any) {
      TrezorConnect.ethereumSignMessage(path, data, (result: any) => {
        const { payload, success } = result;

        if (!success) {
          cb(payload.error);
          return;
        }
        cb(undefined, payload.signature);
      });
    },
    async signTransaction(txData: any, cb: (err: any, res?: any) => any): Promise {
github AugurProject / augur / packages / augur-ui / src / modules / auth / helpers / trezor-signer.ts View on Github external
return new Promise(async (resolve, reject) => {
      const result = await TrezorConnect.ethereumSignMessage({
        path: this.path,
        message,
      });

      if (result.success) {
        resolve(result.payload.signature);
      }

      reject(result.payload.error);
    });
  }
github MyEtherWallet / MyEtherWallet / src / wallets / hardware / trezor / index.js View on Github external
const msgSigner = async msg => {
      const result = await Trezor.ethereumSignMessage({
        path: this.basePath + '/' + idx,
        message: Misc.toBuffer(msg).toString('hex'),
        hex: true
      });
      if (!result.success) throw new Error(result.payload.error);
      return getBufferFromHex(result.payload.signature);
    };
    const displayAddress = async () => {
github AdExNetwork / adex-platform / src / services / smart-contracts / signers / trezor.js View on Github external
signMessage = async (message, opts = {}) => {
		const { success, payload } = await TrezorConnect.ethereumSignMessage({
			path: this.path,
			message: message,
			hex: !!opts.hex,
		})

		if (success) {
			const res = {
				/*
				 * NOTE: SignatureTypes.GETH
				 * Current TrezorConnect window does not
				 * accept device with old firmware
				 */
				signature: '0x' + payload.signature,
				hash: message,
				mode: constants.SignatureModes.GETH,
				address: payload.address,
github MyEtherWallet / MyEtherWallet / src / wallets / hardware / trezor / index.js View on Github external
const msgSigner = async msg => {
      const result = await Trezor.ethereumSignMessage({
        path: this.basePath + '/' + idx,
        message: toBuffer(msg).toString('hex'),
        hex: true
      });
      if (!result.success) throw new Error(result.payload.error);
      return getBufferFromHex(result.payload.signature);
    };
    const displayAddress = async () => {