leather-io / extension

Leather browser extension
https://leather.io
MIT License
292 stars 140 forks source link

Don't show fee selection options when confirming a sponsored transaction. #5534

Open friedger opened 2 months ago

friedger commented 2 months ago

I try to create a sponsored tx and expect the fees to be 0 for the tx-sender. Later, the sponsored tx will be signed and broadcasted by a 3rd party.

In the code I set sponsored and fees of ContractCallOptions like this

if (useAssetForFees) {
     (options as any).sponsored = true;
      options.fee = 0;
   }

Is this use case supported? Where should I start investigating this issue?

Screenshot_20240611_190626

314159265359879 commented 2 months ago

Ow when I actually click the fee in that box it shows this, so the wallet does recognize it is a sponsored transaction: image

Signing it doesn't look like it is resulting in a broadcast.

friedger commented 2 months ago

That is good news.

We need the sponsor's signature before we can broadcast.

fbwoolf commented 2 months ago

This has been working for quite some time, so not sure if something broke here in the fee row ...but I do still see the code checking for isSponsored. It should hide the select and show a sponsored label in its place. We use this to determine: https://github.com/leather-wallet/extension/blob/5048be3be28c7b3dd5d3a2715a3d33385c913a70/src/app/common/transactions/stacks/transaction.utils.ts#L103

I can test on my end.

EDIT: Check to show the select is here: https://github.com/leather-wallet/extension/blob/5048be3be28c7b3dd5d3a2715a3d33385c913a70/src/app/components/fees-row/components/fees-row.layout.tsx#L40

314159265359879 commented 2 months ago

@fbwoolf Thanks for taking a look.

I am reopening this and renaming it. I think you are right that something changed that is causing the fee to show instead of hiding the "select fee" options. It is a P4 bug.

friedger commented 2 months ago

I see the fees when I use a localhost as network in my app in the requests to the extension as shown in the screenshot. This is reproducable.

I don't see the fees but the sponsor text when I use hiro api as network. I only change the url in the stacks network object, no other code changes.