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

Add further fields to swap endpoint #1815

Open
janmichek opened this issue Jun 19, 2024 · 9 comments
Open

Add further fields to swap endpoint #1815

janmichek opened this issue Jun 19, 2024 · 9 comments
Assignees

Comments

@janmichek
Copy link

Please add following fields to
/dex/swaps

action: [BUY | SELL | SWAP]
fromContract: [contractId]
toContract: [contractId]
fromAmount: [number]
toAmount: [number]
fromDecimals: [number]
toDecimals: [number]
microtime(of the tx): [time]
height (of the tx): [number]

also please document the API docs

@vatanasov
Copy link
Contributor

@janmichek can you elaborate on:

  1. What do you mean by the action field? Which swaps do you consider buy/sell?
  2. With fromContract and toContract do you mean the sender and receiver accountPK?

@janmichek
Copy link
Author

1. What do you mean by the `action` field? Which swaps do you consider buy/sell?

I think you will get it by the entrypoint swap_exact_ae_for_tokens in this case th_2MZcRcm9Rcjf6HFoxjtHgPVAQSLurLQSFqJ6zjZew5sk7jPU7u

2. With `fromContract` and `toContract` do you mean the sender and receiver accountPK?

By this I mean the token contract adresses

@janmichek
Copy link
Author

Ok, great, the response for general swaps looks complete.
But how its the response for swaps per token? eg https://testnet.aeternity.io/mdw/v3/dex/ct_BGSnJnxuCgQx9kz4PW3u3JcwrjVAZ4xLKv8Bfi9ce5xygVK7Q/swaps?limit=10
It was working before, but now it stopped working. So I am not sure what's in the response.

@janmichek
Copy link
Author

Ok, great, the response for general swaps looks complete. But how its the response for swaps per token? eg https://testnet.aeternity.io/mdw/v3/dex/ct_BGSnJnxuCgQx9kz4PW3u3JcwrjVAZ4xLKv8Bfi9ce5xygVK7Q/swaps?limit=10 It was working before, but now it stopped working. So I am not sure what's in the response.

Can you check this regression, please? It was working before.

@vatanasov
Copy link
Contributor

Yes, we are working on fixing it.

@janmichek
Copy link
Author

Hello, do you have any updates on this? @vatanasov

@vatanasov
Copy link
Contributor

@janmichek, some things will be improved in the next release (all the contracts in the v3/dex/swaps page should shall correctly their swaps on /v3/dex/<contract-id>/swaps page), but there are still some lingering issues we are working on.

@janmichek
Copy link
Author

It seems to work now. Or do you plan any changes?

@vatanasov
Copy link
Contributor

Ok, great, the response for general swaps looks complete. But how its the response for swaps per token? eg https://testnet.aeternity.io/mdw/v3/dex/ct_BGSnJnxuCgQx9kz4PW3u3JcwrjVAZ4xLKv8Bfi9ce5xygVK7Q/swaps?limit=10 It was working before, but now it stopped working. So I am not sure what's in the response.

Yes, there are more things to be done, the example you mentioned here isn't working yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants