Skip to content

Doesn't show transaction window when extension is locked. #364

Description

@essedger

Hello everyone! I use this code for sending transaction:

const sendTransactionTron = async (toAddress: string, amountInTrx: number): Promise<void> => {
    if (window?.tronWeb) {
      try {
        await window?.tronWeb?.request({ method: 'tron_requestAccounts' });
        if (window?.tronWeb?.ready) {
          // Convert TRX to SUN. 1 TRX = 1,000,000 SUN
          const amountInSun = Math.floor(amountInTRX * 1e6).toString();
          await window.tronWeb?.trx?.sendTransaction(toAddress, amountInSun);
        }
      } catch (error) {
        console.error('Transaction failed or TronLink not available', error);
      }
    } else {
      console.warn('TronLink is not installed');
    }
  };

If you manually unlock TronLink extension, a transaction window appears and you can perform a transaction. How can I make it so that when the extension is locked, the password appears first, and after entering the password, the transaction window appears?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions