I want to transfer tokens in torus but i dont want to show the button of torusplugin. Instead i waana use custom button with metamask iam able to do it but with torus it is giving JSON rpc error

Please provide the following details too when asking for help in this category:

  • SDK Version: “@web3auth/modal”: “^6.1.1”,

@ankit.thakur Thanks for your question.

Your request has been forwarded to our team and we will get back with further updates once more information becomes available.

Can you share your implementation code?

try {
const web3auth = new Web3Auth({
clientId: envs.CLIENT_ID || “”, // Get your Client ID from Web3Auth Dashboard
web3AuthNetwork: envs.WEB3_AUTH_NETWORK || “testnet”,
uiConfig: {
appName: “W3A”, // ← Your dApp Name
appLogo: “”, // Your dApp Logo URL
theme: “dark”, // “light” | “dark” | “auto”
loginMethodsOrder: [
“google”,
“facebook”,
“apple”,
“twitter”,
“github”,
“linkedin”,
“twitch”,
“discord”,
],
defaultLanguage: “en”, // en, de, ja, ko, zh, es, fr, pt, nl
loginGridCol: 3, // 2 | 3
primaryButton: “externalLogin”, // “externalLogin” | “socialLogin” | “emailLogin”
},
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: envs.CHAIN_ID || “0x5”, // Please use 0x5 for Goerli Testnet
rpcTarget:envs.Rpc
},
});
const torusWalletAdapter = new TorusWalletAdapter({
initParams: {
// type WhiteLabelParams
whiteLabel: {
theme: {
isDark: true,
colors: { torusBrand1: “#FFA500” },
},
logoDark: “”,
logoLight: “”,
topupHide: true,
featuredBillboardHide: true,
disclaimerHide: true,
defaultLanguage: “en”,
},
},
});
web3auth.configureAdapter(torusWalletAdapter);

const torusPlugin = new TorusWalletConnectorPlugin({
  torusWalletOpts: {},
  walletInitOptions: {
    whiteLabel: {
      theme: { isDark: true, colors: { primary: "#00a8ff" } },
      logoDark: "https://web3auth.io/images/w3a-L-Favicon-1.svg",
      logoLight: "https://web3auth.io/images/w3a-D-Favicon-1.svg",
    },
    showTorusButton : true,
    useWalletConnect: true,
    enableLogging: true,
  },
});
await web3auth.addPlugin(torusPlugin);

console.log(torusPlugin,web3auth, "klllll");


const openloginAdapter = new OpenloginAdapter({
  loginSettings: {
    mfaLevel: "none", // Pass on the mfa level of your choice: default, optional, mandatory, none
  },
});
web3auth.configureAdapter(openloginAdapter);
dispatch(setweb3auth(web3auth));
await web3auth.initModal();
dispatch(setProvider((torusPlugin?.proxyProvider as SafeEventEmitterProvider) ||web3auth.provider));

The thing is that i wanna transfer money directly by using sendTransaction function. In metamask the payment is getting successful, but via torus login it is giving JSON RPC error.

async customPayment(): Promise {
const web3 = new Web3(this.provider as any);
const fromAddress = (await web3.eth.getAccounts())[0];
debugger
const recipientAddress = ‘0x3FDB2aAC64B842F48D149301147842275737dc19’;
const valueToSend = Web3.utils.toWei(‘0.1’, ‘ether’);
const gasPrice = Web3.utils.toWei(‘50’, ‘gwei’);
debugger
const gasLimit = 21000;
const txObject = {
fromAddress,
to: recipientAddress,
value: valueToSend,
gasPrice: gasPrice,
gas: gasLimit,
};

try {
  const senderPrivateKey = await this.getPrivateKey();
  debugger
  const signedTx:any = await web3.eth.accounts.signTransaction(txObject, senderPrivateKey);

debugger
const txReceipt = await web3.eth.sendSignedTransaction(signedTx.rawTransaction);
console.log('Transaction receipt:', txReceipt);
} catch (error) {
  debugger
  return error as string;
}

}

iam trying with private key also but no luck.