You are viewing a single comment's thread:

RE: Fetching Hive-Engine Liquidity Pools Just Got Better!

It was tougher, but after getting what the fetch_token_details function was doing (at first I was like: "before there were 2 requests, now there are 3... why? Help!!" šŸ¤£), I finally succeded in understading it!

Oc I didn't see any bugs - it's already enough if I understand how it works ahaha - but there's a question I'd like to ask you, if I can:

  • how did you built the call? For example, this one:
payload = {
            "jsonrpc": "2.0",
            "id": 1,
            "method": "find",
            "params": {
                "contract": "tokens",
                "table": "tokens",
                "query": {"symbol": symbol},
                "limit": 1
            }
        }

Is there some documentation in the Hive API I can read to find it out? Because untill now I thought one had always to use something like the block_api, or condenser_api, or something similar, but here I can't see them!

0.00431687 BEE
1 comments
(edited)

For quite a long time I wasn't able to find any good documentation on the Hive-Engine API calls, so I had to read the side-chain transactions via the HE-blockexplorer and then through trial and errors find out what works and what doesn't. But it all got a bit easier when I accidentally stumbled into the Hive Smart Contracts Wiki. It's frankly a treasure trove.

Hope it helps! :)

EDIT: I almost forgot, the call itself is a standard JSON call, you can learn about those in the Python documentation: json ā€” JSON encoder and decoder.
EDIT #2: This is a bit embarrassing. I wasn't strictly correct when I called the JSON part "standard JSON", because it's actually not JSON yet. It's a Python object (a library), that will eventually be converted into a JSON string by either json.dumps(), or the requests module like I did here. A little brain fart on my part I guess, stands to show I'm not a pro-coder yet.

!WINE

0E-8 BEE