1

What I am trying to achieve?

There is a smart-contract for swap between WEGLD and USDC. Address: erd1qqqqqqqqqqqqqpgqeel2kumf0r8ffyhth7pqdujjat9nx0862jpsg2pqaq

To find out the real amount of WEGLD and USCD that was swapped, I am using API to get the operations of the transaction, but sometimes the operations are missing.

Example with operations:

https://api.elrond.com/transactions/d133b4c6388b87191e430b11f499317d791529299cdeae4607f9cab18ff52402

without operations(but it is succeeded):

https://api.elrond.com/transactions/75a5af684d261123b817af89df4f5673ed32b285f2e131fbb45773d5096f6bc4

I was thinking to use gateway: https://docs.elrond.com/sdk-and-tools/rest-api/transactions/#get-transaction

But I don't know how I can extract the real amounts(in and out) from there.

If someone can help me with a solution.

KunLun
  • 3,109
  • 3
  • 18
  • 65

2 Answers2

0

As a solution I used this link

https://api.elrond.com/transactions?withOperations=true&hashes=...

Also my problem seems like was a problem with the API, which now is fixed.

KunLun
  • 3,109
  • 3
  • 18
  • 65
0

You might also want to check out the DEX sdk for JS if you want to simplify your programative work: https://github.com/ElrondNetwork/elrond-sdk-erdjs-dex

There are a handful of very useful scripts in there that are doing a lot of heavylifting on "decyphering" DEX transaction details.

Brother Jder
  • 415
  • 2
  • 9