'Problem authenticating via the OpenSea JDK

I am trying to authenticate my wallet against OpenSea using the SDK, but fail doing so.

Here's my code snippet:

const walletSubprovider = new MnemonicWalletSubprovider({
    mnemonic: MNEMONIC,
    baseDerivationPath: `44'/60'/0'/0`,
  })

const rpcSubprovider = new RPCSubprovider(RPC_URL)
const providerEngine = new Web3ProviderEngine()
providerEngine.addProvider(walletSubprovider)
providerEngine.addProvider(rpcSubprovider)
providerEngine.start()

const seaport = new OpenSeaPort(
    providerEngine,
    {
        networkName: Network.Main,
        apiKey: API_KEY,
    },
    (arg) => console.log(arg)
  );

I am using those versions:

@0x/[email protected]
[email protected]

This is the stack trace:

ReferenceError: Headers is not defined
    at RPCSubprovider.<anonymous> (XXX\node_modules\@0x\subproviders\src\subproviders\rpc_subprovider.ts:40:25)
    at Generator.next (<anonymous>)
    at XXX\node_modules\@0x\subproviders\lib\src\subproviders\rpc_subprovider.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (XXX\node_modules\@0x\subproviders\lib\src\subproviders\rpc_subprovider.js:4:12)
    at RPCSubprovider.handleRequest (XXX\node_modules\@0x\subproviders\lib\src\subproviders\rpc_subprovider.js:44:16)
    at next (XXX\node_modules\web3-provider-engine\index.js:116:18)
    at MnemonicWalletSubprovider.<anonymous> (XXX\node_modules\@0x\subproviders\src\subproviders\base_wallet_subprovider.ts:111:17)
    at Generator.next (<anonymous>)
    at XXX\node_modules\@0x\subproviders\lib\src\subproviders\base_wallet_subprovider.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (XXX\node_modules\@0x\subproviders\lib\src\subproviders\base_wallet_subprovider.js:4:12)
    at MnemonicWalletSubprovider.handleRequest (XXX\node_modules\@0x\subproviders\lib\src\subproviders\base_wallet_subprovider.js:39:16)
    at next (XXX\node_modules\web3-provider-engine\index.js:116:18)
    at Web3ProviderEngine._handleAsync (XXX\node_modules\web3-provider-engine\index.js:103:3)
    at EthQuery.sendAsync (XXX\node_modules\eth-query\index.js:66:24)
    at EthQuery.getBlockByNumber (XXX\node_modules\eth-query\index.js:80:10)
    at XXX\node_modules\pify\index.js:29:7
    at new Promise (<anonymous>)
    at EthQuery.<anonymous> (XXX\node_modules\pify\index.js:12:10)
    at EthQuery.ret (XXX\node_modules\pify\index.js:56:34)
    at RpcBlockTracker._fetchLatestBlock (XXX\node_modules\eth-block-tracker\src\index.js:195:47)

Does anyone have an idea what the problem might be?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source