Day Three: Proof of Brain for Eccency

You can find my fifrst commit on Github here
https://github.com/steemfiles/ecency-vision/tree/POB-vision

I've spent the day porting in code from Nitrous. It turns out that the config.ts file should be for private information that must not go to the front end. So, I imported a client_config.ts file from nitrous.

Although there is documentation for asking for table data by name, there is no description on the Hive Engine website of what the tables themselves are. I decided I'd better dig into Nitrous and pull stuff from there. client_config.ts was the first of these files.

image.png

I started to port the relevant parts but I find that everything is so connected to the rest of the source code of Nitrous, but the more I got into it, the more I found dependencies and dependencies. From the code I can figure out how Nitrous is interacting with Hive Engine and learn about these tables on the Hive Engine server so I can get the interactive information.

There are the Hive Engine API URLs. Looking through for porting from Nitrous I found these:

https://accounts.hive-engine.com/accountHistory
https://api.hive-engine.com/rpc
https://scot-api.hive-engine.com/config?token=POB

This seems to be the most relevant parts in Nitrous that we can crib and add to Ecency:

    const bridgeAccountObject = await getAccount(account, useHive);

    const hiveEngine = HIVE_ENGINE;
    const engineApi = hiveEngine ? hiveSsc : ssc;
    const [
        tokenBalances,
        tokenUnstakes,
        tokenStatuses,
        transferHistory,
        tokenDelegations,
        accountObject,
    ] = await Promise.all([
        // modified to get all tokens. - by anpigon
        engineApi.find('tokens', 'balances', {
            account,
        }),
        engineApi.find('tokens', 'pendingUnstakes', {
            account,
            symbol: LIQUID_TOKEN_UPPERCASE,
        }),
        getScotAccountDataAsync(account),
        getSteemEngineAccountHistoryAsync(account, hiveEngine),
        engineApi.find('tokens', 'delegations', {
            $or: [{ from: account }, { to: account }],
            symbol: LIQUID_TOKEN_UPPERCASE,
        }),
        await getAccountFromNodeApi(account, useHive),

H2
H3
H4
3 columns
2 columns
1 column
9 Comments
Ecency