Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction signing with walletconnect-tron #4378

Open
KrashheR opened this issue Mar 29, 2024 Discussed in #4377 · 1 comment
Open

Transaction signing with walletconnect-tron #4378

KrashheR opened this issue Mar 29, 2024 Discussed in #4377 · 1 comment

Comments

@KrashheR
Copy link

KrashheR commented Mar 29, 2024

Hello everyone!
I have a problem with transactionsigning when using walletConnect-TRON through the adapter from TronWeb @tronweb3/walletconnect-tron

This is an example of code in which the provider is initialized and then used to sign the transaction:

const provider = new WalletConnectWallet({
      network: WalletConnectChainID.Mainnet,
      options: {
        relayUrl: 'wss://relay.walletconnect.com',
        projectId: WALLET_CONNECT_PROJECT_ID,
      },
      web3ModalConfig: {
        themeVariables: {
          '--w3m-z-index': 2000,
          '--w3m-font-family': 'Roboto, Arial, Helvetica, sans-serif',
          '--w3m-accent-color': '#00C26F',
        },
      },
    });

const response = await axios.post("https://api.trongrid.io/wallet/createtransaction?apiKey=${apiKey}", {
        to_address: to,
        owner_address: from,
        amount: sunValue,
        visible: true,
      });
const unSignedTransaction = response.data;

const signedTransaction = await provider.signTransaction(unSignedTransaction);
console.log('signedTransaction', signedTransaction.data);

const broadcastResult = await tronWeb.trx.sendRawTransaction(signedTransaction);

When I try to submit a transaction using the adapter for signature, the notification from walletconnect to the mobile app doesn't always come, and if it does, nothing happens after confirmation. In addition, the following error appears in the console:

{context: 'client'} 'No matching key. keychain: {someKeyChain}' at vt.get (index.es.js:1:16678) at It.getSymKey (index.es.js:1:19474) at It.decode (index.es.js:1:18740) at EventEmitter.<anonymous> (index.es.js:1:25051) at EventEmitter.emit (events.js:158:1) at Ot.onMessageEvent (index.es.js:1:37303)

Has anyone encountered this error? And how did you fix it?
Maybe there are other ways to confirm transaction via walletconnect for tron?

Any help would be greatly appreciated, thank you!

Copy link

linear bot commented Mar 29, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant