Oracle.getOracleObject is not a function

Using the SDK in Javascript, I want to connect the app to a simple Oracle (The greeter one). Following the documentation it should be something like this:

import Oracle from '@aeternity/aepp-sdk/es/ae/oracle';

const oracleId = 'ok_jD64frs6xNBgsGFdAbhYfzk2fwuWqMbkSKj77ukGkDZay7mfW';

Oracle.getOracleObject(oracleId)
.then(console.log)
.catch(console.error);

but it doesnt work: TypeError: Oracle.getOracleObject is not a function

Im using node v12.16.3, @aeternity/aepp-sdk ^7.6.0 and esm (something to run the es5, to use import) ^3.2.25

You have to call the getOracleObject function on an initialized aeternity client. Maybe this will help you https://github.com/thepiwo/ae-oracle-pricefeed/blob/master/src/priceFeedOracle.js#L28

3 Likes

@philipp.chain Thanks, that work

1 Like