Polymarket / clob-client

Typescript client for the Polymarket CLOB
MIT License
32 stars 7 forks source link

Error on approving allowance example #97

Open ondrejmaly1 opened 1 year ago

ondrejmaly1 commented 1 year ago

I am getting an error when running an example adjusting allowance. All other examples seems to be running fine

  const wallet = getWallet(isMainnet);
  const chainId = parseInt(`${process.env.CHAIN_ID || Chain.MUMBAI}`) as Chain;
  console.log(`Address: ${await wallet.getAddress()}, chainId: ${chainId}`);

  const contracts = getContracts(isMainnet ? 137 : 80001);
  const usdc = getUsdcContract(isMainnet, wallet);
  const ctf = getCtfContract(isMainnet, wallet);

--> const usdcAllowanceCtf = (await usdc.allowance(wallet.address, ctf.address)) as BigNumber;

Uncaught Error Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.1) at Logger.makeError (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/logger/lib/index.js:238:21) at Logger.throwError (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/logger/lib/index.js:247:20) at (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:609:54) at step (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23) at (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53) at rejected (file:///C:/Work/Polymarket/clob-client/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65) at processTicksAndRejections (node:internal/process/task_queues:95:5)

Ragnoraks commented 3 weeks ago

I have the same error