Encodes an OracleJob definition into a binary format
OracleJob definition in various formats:
Serialized OracleJob as Buffer
If validation or encoding fails
// From JSON stringconst encoded1 = encodeOracleJob(`{ "tasks": [ {"httpTask": {"url": "https://api.coinbase.com/v2/prices/BTC-USD/spot"}} ]}`);// From plain objectconst encoded2 = encodeOracleJob({ tasks: [ {httpTask: {url: "https://api.coinbase.com/v2/prices/BTC-USD/spot"}} ]}); Copy
// From JSON stringconst encoded1 = encodeOracleJob(`{ "tasks": [ {"httpTask": {"url": "https://api.coinbase.com/v2/prices/BTC-USD/spot"}} ]}`);// From plain objectconst encoded2 = encodeOracleJob({ tasks: [ {httpTask: {url: "https://api.coinbase.com/v2/prices/BTC-USD/spot"}} ]});
Encodes an OracleJob definition into a binary format