Constructor
Construct an SDK object to access the methods.
The constructor requires an
Auth
object. const auth = new Auth({
projectId: process.env.INFURA_API_KEY,
secretId: process.env.INFURA_API_KEY_SECRET,
privateKey: process.env.WALLET_PRIVATE_KEY,
rpcUrl: process.env.EVM_RPC_URL,
chainId: 5, // Goerli
});
rpcUrl
is optional if you provide the chainId
and the projectId.
You can use the
dotenv
JavaScript package to load environment variables from a .env
file into the process.env
variables.Create an instance of the SDK as follows:
const sdk = new SDK(auth);
Last modified 1mo ago