Skip to main content
Bumped by Community user
added 243 characters in body; edited title
Source Link

How to broadcast a signed transaction and cover gas?

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_FUNDS error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case

I don't have wallet private key, and everything is handled in the backend, aka cannot get user wallet signer from browser, I don't have access to wallet provider or signer. In this case, how to broadcast a signed transaction and cover gas?

How to broadcast signed transaction and cover gas?

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_FUNDS error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case

How to broadcast a signed transaction and cover gas?

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_FUNDS error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case

I don't have wallet private key, and everything is handled in the backend, aka cannot get user wallet signer from browser, I don't have access to wallet provider or signer. In this case, how to broadcast a signed transaction and cover gas?

deleted 2 characters in body
Source Link

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_BALANCEINSUFFICIENT_FUNDS error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_BALANCE error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_FUNDS error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case
Source Link

How to broadcast signed transaction and cover gas?

I'm providing a custodial wallet API solution and everything is handled through APIs. The flow looks like this:

1. Client request (tx payload) => MyServerAPI.sendTransaction(tx payload)
2. Where sendTransaction includes two steps:
      a. MyServer => WalletVendorAPI.signTransaction => signedTx => MyServer
      b. MyServer.broadcastSignedTransaction(signedTx)

The wallet balance is 0, how can I cover the gas fee for MyServer.broadcastSignedTransaction?

Potential solutions I tried:

  1. using a provider such as Infura or Alchemy to broadcast signed transaction like provider.sendTransaction(signedTx) but got INSUFFICIENT_BALANCE error since the wallet balance is 0
  2. using OpenZepplin Defender Relayer relayer.sendTransaction({to:"", data:"", ...}), but it only sends the original transaction, doesn't include transaction signing process. I don't have the wallet private key, so I cannot sign the transaction
  3. Also explored meta transaction following example https://docs.openzeppelin.com/defender/guide-metatx, not sure how to plug in a signed transaction string into the meta-tx process. Also, the transaction is signed and broadcasted on my server in one API call, correct me if I'm wrong, but I feel that forwarder is not necessary in my case