BurakBey
BurakBey

Reputation: 55

How to Prepare a Transaction Object for Sending USDT on Avalanche C-Chain Without Access to Private Key?

I am using a hardware wallet and do not have access to my private key or mnemonic phrase. However, I am able to sign any data without any issues.

I am trying to programmatically prepare a transaction object and get its digest so I can sign the digest using my hardware wallet and broadcast the signed transaction to the network. The problem I am facing is creating the transaction object itself. I am unsure which parameters are required and how to construct it properly.

I am an experienced TypeScript developer but relatively new to the cryptocurrency space. My ability is limited to signing data, and most example codes I have seen involve using private keys directly, which I do not have access to.

Here is a sample code snippet using the ethers library, which typically requires a private key:

import * as ethers from 'ethers';

(async () => {
  const wallet = new ethers.Wallet("<private_key>");
  const tx = await wallet.sendTransaction({
    // properties
  });

  console.log('Transaction sent! Waiting for confirmation...');

  await tx.wait();

  console.log('Confirmed!');
})();

As you can see, the ethers library requires my private key, and as I mentioned earlier, I do not have access to it.

As an example, I want to send 10 Tether (USDT) on the Avalanche C-Chain to a specific address. Can someone guide me on how to prepare a transaction object with the required parameters for this scenario?

Upvotes: 0

Views: 128

Answers (0)

Related Questions