Skip to content

Instantly share code, notes, and snippets.

@wong2
Created July 26, 2022 06:15
Show Gist options
  • Save wong2/c0ef156131cbd29a0038d834b17a5bcb to your computer and use it in GitHub Desktop.
Save wong2/c0ef156131cbd29a0038d834b17a5bcb to your computer and use it in GitHub Desktop.
import HDWalletProvider from "@truffle/hdwallet-provider";
import { OpenSeaPort, Network } from "opensea-js";
import { PRIVATE_KEY } from "./consts.mjs";
const provider = new HDWalletProvider({
privateKeys: [PRIVATE_KEY],
providerOrUrl: "https://rpc.ankr.com/eth",
});
provider.engine.on("error", (err) => {
console.error("provider error", err);
});
const seaport = new OpenSeaPort(provider, {
networkName: Network.Main,
apiKey: "2f6f419a083c46de9d83ce3dbe7db601",
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment