stacks-core icon indicating copy to clipboard operation
stacks-core copied to clipboard

Deprecate or remove (EDIT(jcnelson): or fix) the `/v2/fees/transfer` endpoint

Open diwakergupta opened this issue 9 months ago • 4 comments

Problem

Everyone should be using the /v2/fees/transaction for fee estimation. Unfortunately, not only does the /v2/fees/transfer endpoint still exist, it isn't even marked deprecated anywhere clearly (e.g. not in the openapi spec, not in this doc, not in the code )

This routinely confuses people, not least because looking at the endpoints alone (/v2/fees/transfer vs /v2/fees/transaction) it's impossible to tell the different without looking at the docs or code.

Desired solution

Deprecate or better yet, remove the outdated /v2/fees/transfer endpoint.

diwakergupta avatar May 06 '24 15:05 diwakergupta

How about, since people apparently use this endpoint, we instead fix /v2/fees/transfer to do what it's supposed to do?

jcnelson avatar May 06 '24 17:05 jcnelson

How about, since people apparently use this endpoint, we instead fix /v2/fees/transfer to do what it's supposed to do?

From being on the receiving end of a lot of questions / tech support requests around this, I'll just say one endpoint is better / less confusing than two.

diwakergupta avatar May 06 '24 17:05 diwakergupta

If you're seeing people query this endpoint, then I think it's safe to assume that the questions / tech support requests aren't going to go away if we just disable it. They'll just ask why it broke.

The endpoint is indeed broken insofar as it returns incorrect data. However, it's straightforward to make it return correct data, since it can rely on the same machinery that /v2/fees/transaction uses. Also, it's a lot less clunky than /v2/fees/transaction if you're just sending a token-transfer -- it'll give you a scalar fee in response to a body-less GET request, as opposed to requiring you to serialize and POST your transaction to the node and then parse a JSON response.

I'll go ahead and fix it.

jcnelson avatar May 06 '24 17:05 jcnelson

Fixed: https://github.com/stacks-network/stacks-core/pull/4754

jcnelson avatar May 06 '24 19:05 jcnelson

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

blockstack-devops avatar Oct 28 '24 00:10 blockstack-devops