@web3auth/torus-wallet-connector-plugin

1 . Nomodel SDK what login adapter want use like (google,Jwt)
For this i have tried this with with out any login
in name option you tell "Your app name " (which app ). web3auth dashboard which app name i have to give plug and play or torus wallet . i have given Torus wallet and plug and play both and checked
var openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId, //Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
network: “testnet”, // Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
uxMode: “popup”,
whiteLabel: {
name: “Lazyminter_Live_3”,
logoLight: “”,
logoDark: “”,
defaultLanguage: “en”,
dark: true, // whether to enable dark mode. defaultValue: false
},
},
});
this my Openlogin adapter
2. after inject login adapter the we init web3auth . For torus the after finishing both we inject TorusWalletConnectorPlugin

  1. Error: Provider does not have a request or send method to use.

var clientId = “BJY6haMjr9VElhzELmZa1A-4WdX35cOzHbuhhzQ-Vzqst4fh2kiZ8KCUOhH72IZXXnYRALMKU0RRw10wVeqTkd0”
try {
var web3auth = new Web3AuthNoModal({
clientId: “BJY6haMjr9VElhzELmZa1A-4WdX35cOzHbuhhzQ-Vzqst4fh2kiZ8KCUOhH72IZXXnYRALMKU0RRw10wVeqTkd0”,
web3AuthNetwork: “testnet”,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x13881”,
rpcTarget: “https://matic-mumbai.chainstacklabs.com”,
displayName: “Polygon Mumbai Testnet”,
blockExplorer: “https://mumbai.polygonscan.com/”,
ticker: “MATIC”,
tickerName: “Matic”,
},
});
console.log(“qweqweqweqweqweq”, web3auth);
var openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId, //Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
network: “testnet”, // Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
uxMode: “popup”,
whiteLabel: {
name: “Lazyminter_Live_3”,
logoLight: “”,
logoDark: “”,
defaultLanguage: “en”,
dark: true, // whether to enable dark mode. defaultValue: false
},
},
});
if (web3auth) {
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
}
} catch (e) {
console.log(“asdwaeqwereqew”, e);
}

try {
  var torusPlugin = new TorusWalletConnectorPlugin({
    torusWalletOpts: {
      buttonPosition: "bottom-left",
    },
    walletInitOptions: {
      whiteLabel: {
        theme: { isDark: true, colors: { primary: "#00a8ff" } },
        logoDark: "",
        logoLight: "",
      },
      useWalletConnect: true,
      enableLogging: true,
    },
  });

  console.log("qwewekowefioewr", torusPlugin);
  if (torusPlugin) {
    console.log("qweqjiqjoeqwirqri", torusPlugin);
    await web3auth.addPlugin(torusPlugin);
  }
} catch (e) {
  console.log("dafnwjdsjvnosdfsdkf", e);
}
console.log("asijwieioroweri", web3auth); 

i have attached screenshot

Hello @akashswamy,

I noticed that both web3auth and torusWalletConnectorPlugin have been properly initialized. However, could you kindly provide me with the code snippets from the useWallet.js file, specifically around lines 76, 1075, and 1077? This will assist me in gaining a better understanding of the issue at hand.

Thank you.

Hi @shahbaz

i have shared my full code

  try {
    var clientId = "BJY6haMjr9V******mZa1A-4WdX****zHbuhhzQ-Vzqst4fh2ki********XXnYRALM******w10wVeqTkd0"
      var web3auth = new Web3AuthNoModal({
        clientId: "BJY6haMjr******LmZa1A-4Wd*****HbuhhzQ-Vzqst4fh2kiZ8KCUO***********MKU0RRw10wVeqTkd0",
        web3AuthNetwork: "testnet",
        chainConfig: {
          chainNamespace: "eip155",
          chainId: "0x13881",
          rpcTarget: "https://matic-mumbai.chainstacklabs.com",
          displayName: "Polygon Mumbai Testnet",
          blockExplorer: "https://mumbai.polygonscan.com/",
          ticker: "MATIC",
          tickerName: "Matic",
        },
      });
      console.log("qweqweqweqweqweq", web3auth);
      var openloginAdapter = new OpenloginAdapter({
        adapterSettings: {
          clientId, //Optional - Provide only if you haven't provided it in the Web3Auth Instantiation Code
          network: "testnet", // Optional - Provide only if you haven't provided it in the Web3Auth Instantiation Code
          uxMode: "popup",
          whiteLabel: {
            name: "Lazyminter_Live_3",
            logoLight: "",
            logoDark: "",
            defaultLanguage: "en",
            dark: true, // whether to enable dark mode. defaultValue: false
          },
        },
      });
      if (web3auth) {
        web3auth.configureAdapter(openloginAdapter);
        await web3auth.init();
      }


 
      var torusPlugin = new TorusWalletConnectorPlugin({
        torusWalletOpts: {
          buttonPosition: "bottom-left",
        },
        walletInitOptions: {
          whiteLabel: {
            theme: { isDark: true, colors: { primary: "#00a8ff" } },
            logoDark: "",
            logoLight: "",
          },
          useWalletConnect: true,
          enableLogging: true,
        },
      });

      console.log("qwewekowefioewr", torusPlugin);
      if (torusPlugin) {
        console.log("qweqjiqjoeqwirqri", torusPlugin);
        await web3auth.addPlugin(torusPlugin);
      }
       console.log("asijwieioroweri", web3auth);

    if (!web3auth) {
      console.log("web3auth not initialized yet");
      return;
    }
    console.log("dfgjojfkadoeerr", web3auth);
    console.log("web3authProvider", web3auth);
 console.log("web3web3 for Torus", web3);
    const accounts = await web3.eth.getAccounts();
    console.log("accountssss", accounts);
    const account = accounts[0].toString().toLowerCase();
    localStorage.setItem("Provider", web3)
    localStorage.setItem("accountInfo", account)
    localStorage.setItem('walletConnectType', type)
    var weboe = {
      web3: web3,
      web3auth: web3auth
    }
    return weboe


  } catch (error) {
    console.log("Catch error in Web3Auth", error);
 console.log("logOutFun", localStorage.web3auth);
}

line 1075 and 1077 is catch console
line 76 is were trigger this function

Hello @akashswamy,

To ensure proper sharing of code snippets, please utilize the provided wrapper.

    ```typescript
       {all your code}
    ```

hey @akashswamy

From what I can tell, the console logs seem to be functioning properly and there are no apparent errors from the web3auth side or its implementations.

There might be a logic problem with these lines.

No error from web3auth side.

Hi @shahbaz

there is no issue of var weboe = {
web3: web3,
web3auth: web3auth
}
return weboe

this because i just return the web3auth and web3 (web3Auth injected web3) .there is no problem of this

I am was not able to get the address from web3auth web3 get accounts

you can see the console its coming web3Auth catch error

And web3auth console wallet is in ready not change to connected

export const TorusWalletConnect1 = async (type, configchainid) => {
try {
var clientId = “BJY6haMjr9VElhzELmZa1A-4WdX35cOzHbuhhzQ-Vzqst4fh2kiZ8KCUOhH72IZXXnYRALMKU0RRw10wVeqTkd0”
var web3auth = new Web3AuthNoModal({
clientId: “BJY6haMjr9VElhzELmZa1A-4WdX35cOzHbuhhzQ-Vzqst4fh2kiZ8KCUOhH72IZXXnYRALMKU0RRw10wVeqTkd0”,
web3AuthNetwork: “testnet”,
chainConfig: {
chainNamespace: “eip155”,
chainId: “0x13881”,
rpcTarget: “https://matic-mumbai.chainstacklabs.com”,
displayName: “Polygon Mumbai Testnet”,
blockExplorer: “https://mumbai.polygonscan.com/”,
ticker: “MATIC”,
tickerName: “Matic”,
},
});
var openloginAdapter = new OpenloginAdapter({
adapterSettings: {
clientId, //Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
network: “testnet”, // Optional - Provide only if you haven’t provided it in the Web3Auth Instantiation Code
uxMode: “popup”,
whiteLabel: {
name: “Lazyminter_Live_3”,
logoLight: “”,
logoDark: “”,
defaultLanguage: “en”,
dark: true, // whether to enable dark mode. defaultValue: false
},
},
});
if (web3auth) {
web3auth.configureAdapter(openloginAdapter);
await web3auth.init();
}

  var torusPlugin = new TorusWalletConnectorPlugin({
    torusWalletOpts: {
      buttonPosition: "bottom-left",
    },
    walletInitOptions: {
      whiteLabel: {
        theme: { isDark: true, colors: { primary: "#00a8ff" } },
        logoDark: "",
        logoLight: "",
      },
      useWalletConnect: true,
      enableLogging: true,
    },
  });

  console.log("torusPlugin", torusPlugin);
  if (torusPlugin) {
    await web3auth.addPlugin(torusPlugin);
  }
console.log("web3auth Plugin", web3auth);

if (!web3auth) {
  console.log("web3auth not initialized yet");
  return;
}
console.log("", web3auth);
console.log("web3authProvider", web3auth);
var web3 = new Web3(web3auth);

console.log(“web3web3 for Torus”, web3);
const accounts = await web3.eth.getAccounts();
console.log(“accountssss”, accounts);
const account = accounts[0].toString().toLowerCase();
// var web2uhh = web3
localStorage.setItem(“Provider”, web3)
localStorage.setItem(“accountInfo”, account)
localStorage.setItem(‘walletConnectType’, type)
var weboe = {
web3: web3,
web3auth: web3auth
}
return weboe

} catch (error) {
console.log(“Catch error in Web3Auth”, error);
}
}

I understand. But the concern is why it’s going to catch block when things are working fine in the try block. It may be helpful to review your code and check for any errors, as it appears that web3auth is functioning properly.

yes when i inject web3auth into web3 then i can use web3.eth.getaccounts

i am not getting my accounts

web3Auth status was not changed connected it was still in ready

this console was before injecting into web3

Hi @shahbaz

web3auth/torus-wallet-connector-plugin Which client id i have to use Plug and play clientId or Torus wallet client

@shahbaz when web3auth wallet connected status changed to ready to connect the i can i injected into web3 and i can get my address

For me its ready status not changed to connect . So i am facing issue

status changed to connect i can get my address right

its not changing to connecting

Hey,

You can use plug and play client id.

Okay, let me report it to the team and get back to you on this issue.

Hi @shahbaz

this my Web3auth No model sdk with custom JWT

here its status is changing to connect why its not changing in web3auth/torus-wallet-connector-plugin

you can see the console of web3auth custon Jwt screenshot

you can see here its chaning to connected

why? its not changing for web3auth/torus-wallet-connector-plugin

@shahbaz could you advise us? thanks

Hi @shahbaz

We completed the integration of web3auth Wallet with No-Model with custom JWT and have moved the project to the mainnet. However, we are still encountering an issue that I have mentioned above. We would greatly appreciate it if we could schedule a call to discuss and resolve this matter. It is crucial for us to address this issue as soon as possible since the project is already live. We eagerly await your response.

Thank you.

Yes, really need Web3Auth advise and help

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.