Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve OfferId / serialized Offer / Offer details information interplay #457

Closed
TheCharlatan opened this issue Jun 1, 2022 · 1 comment · Fixed by #496
Closed

Improve OfferId / serialized Offer / Offer details information interplay #457

TheCharlatan opened this issue Jun 1, 2022 · 1 comment · Fixed by #496
Assignees
Labels
enhancement New feature or request mainnet priority This should be prioritized

Comments

@TheCharlatan
Copy link
Member

The OfferId is currently difficult to retrieve from the API. At the same time I question the utility that the OfferId may provide a user. The Offer itself is already a fairly short string. The main utility I can think of is that the OfferId can be more easily visually compared to another, than a full serialized Offer.

The current API also lacks an endpoint to retrieve de-serialized information from a Offer.

I see two options to improve the current situation:

  1. Dropping the use of the OfferId in the API altogether and working only with either the serialized offer strings, or deserialized representations of the Offer. Have the following endpoints
    • make returns the full offer
    • list-offers lists all offers
    • offer-info <Offer> deserializes an offer
    • cancel <Offer> cancels an offer
  2. Add an endpoint for going from Offer to OfferId and vice-versa. make
    • make returns the full offer and offer id
    • list-offers [OfferId] lists all offers and alternatively all offers with a certain Id
    • offer-info [OfferId] [Offer] deserialies an offer with a certain OfferId or a raw Offer
    • cancel <OfferId> cancels an offer

I prefer the first option.

@h4sh3d
Copy link
Member

h4sh3d commented Jun 8, 2022

I think the first option is better for now. But I'd introduced later an ID again, but this time just a standard UUID generated when offer is created instead of using a hash to derive the id. This allows:

  • manipulating public offer ids when it is more convenient
  • allows two identical offers or more in parallel (we may want twice the same trade with two different counter-party)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request mainnet priority This should be prioritized
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants