Quick start

1. Sandbox

2. Getting started

2.1. Prerequisites

Before getting started, ensure that you have the following installed on your system:

- Node.js version 18 or higher

- NPM (Node.js package manager)

2.2. Start a new project

In this section, we will show you how to set up and call the different methods of the SDK in JS app.

You can reach the following open-source GitHub project, clone it and start from there.

You can find the project here.

2.3. Basic installation

Install @iexec/iexec-oracle-factory-wrapper.

npm install @iexec/iexec-oracle-factory-wrapper

This package is an ESM package. Your project needs to be ESM too. Read more.

If you use it with Webpack, you need the latest Webpack version and ensure you configure it correctly for ESM.

2.4. Instantiate SDK

Import and initialize the Oracle Factory SDK in your application.

Instantiate the SDK in your frontend project:

2.4.1. Basic Instantiation

import { IExecOracleFactory } from "@iexec/iexec-oracle-factory-wrapper";

const web3Provider = window.ethereum;
// instantiate
const factory = new IExecOracleFactory(web3Provider);

2.5. Instantiate only IExecOracleReader

Import and initialize the IExecOracleReader from the Oracle Factory SDK in your application.

Instantiate the SDK in your frontend project:

2.5.1. Basic Instantiation

import { IExecOracleReader } from '@iexec/iexec-oracle-factory-wrapper';

// instantiate
const mainnetBlockchainReader = new IExecOracleReader('mainnet');

You can initialize the IExecOracleReader with the blockchain name or the chain id or even your custom blockchain Endpoint.

Supported blockchains:

blockchain namechainID

mainnet

1

bellecour

134

polygon

137

mumbai

80001

Last updated