MarketSDK
The core class for interacting with the SDK.
The Web3 instance used for all RPC calls.
An object containing all deployed contracts info.
Note: the
sdk.options
property is only available after a successful sdk.init()
call.Initializes the MarketSDK instance.
sdk.init()
must be called before accessing any SDK features.Parameters: none
Returns:
Promise<void>
import Web3 from "web3";
import { MarketSDK, MarketOptions } from "market-sdk";
const options: MarketOptions = {
poolDirectory: "SET_DIRECTORY_ADDRESS",
marketLens: "SET_MARKET_LENS_ADDRESS"
};
const web3 = new Web3("SET_RPC_OR_PROVIDER");
const sdk = new MarketSDK(web3);
await sdk.init(options);
// use sdk here
Creates and returns an initialized MarketSDK instance.
Parameters:
import Web3 from "web3";
import { MarketSDK, MarketOptions } from "market-sdk";
const options: MarketOptions = {
poolDirectory: "SET_DIRECTORY_ADDRESS",
marketLens: "SET_MARKET_LENS_ADDRESS"
};
const web3 = new Web3("SET_RPC_OR_PROVIDER");
const sdk = await MarketSDK.init(web3, options);
// use sdk here, no need to call sdk.init again
Last modified 1yr ago