function initMatic() {
  if (!matic) {
    matic = new Matic({
      maticProvider: process.env.MATIC_PROVIDER,
      parentProvider: process.env.PARENT_PROVIDER,
      rootChainAddress: process.env.ROOTCHAIN_ADDRESS,
      maticWethAddress: process.env.MATIC_WETH_ADDRESS,
      syncerUrl: process.env.SYNCER_URL,
      watcherUrl: process.env.WATCHER_URL,
      withdrawManagerAddress: process.env.WITHDRAWMANAGER_ADDRESS,	
    })

    matic.wallet = '<private-key>' // your private key
  }
}
function initMatic() {
  if (!matic) {
    matic = new Matic({
      maticProvider: process.env.MATIC_PROVIDER,
      parentProvider: process.env.PARENT_PROVIDER,
      rootChainAddress: process.env.ROOTCHAIN_ADDRESS,
      maticWethAddress: process.env.MATIC_WETH_ADDRESS,
      syncerUrl: process.env.SYNCER_URL,
      watcherUrl: process.env.WATCHER_URL,
      withdrawManagerAddress: process.env.WITHDRAWMANAGER_ADDRESS,	
    })

    matic.wallet = '<private-key>' 
  }
}
function initMatic ( ) { if ( ! matic ) { matic = new Matic ( { maticProvider : process . env . MATIC_PROVIDER , parentProvider : process . env . PARENT_PROVIDER , rootChainAddress : process . env . ROOTCHAIN_ADDRESS , maticWethAddress : process . env . MATIC_WETH_ADDRESS , syncerUrl : process . env . SYNCER_URL , watcherUrl : process . env . WATCHER_URL , withdrawManagerAddress : process . env . WITHDRAWMANAGER_ADDRESS , } ) matic . wallet = '<private-key>' // your private key } }
Create sdk instance
Create sdk instance