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

Problem with send transaction logged with maiar app #201

Closed
joansala13 opened this issue Apr 26, 2022 · 6 comments
Closed

Problem with send transaction logged with maiar app #201

joansala13 opened this issue Apr 26, 2022 · 6 comments
Assignees

Comments

@joansala13
Copy link

When i login in my Dapp with web wallet, i can send transactions and can query smart contract with no problems, but when i logged with maiar app, when i try to send transaction to my smart contract the console show me:
Uncaught (in promise) TypeError: transaction.send is not a function
at WalletConnectProvider. (walletConnectProvider.ts:137:1)

I send the transaction with provider like:
provider.sendTransaction(tx);

I use erjs 10.1.0 for my Dapp, but i have this problem... any idea or help?

@andreibancioiu andreibancioiu self-assigned this Apr 26, 2022
@andreibancioiu
Copy link
Contributor

Hello @joansala13!

Indeed, the Transaction object does not have the send() function anymore. Furthermore, walletConnectProvider does not have the function sendTransaction (it has been removed).

I assume you are using dapp-core (which currently references erdjs v9.x), and offers you an instance of a previous version of the signing provider.

Please broadcast the transaction directly to the API - or use one of the default Network Providers, as depicted here:

https://docs.elrond.com/sdk-and-tools/erdjs/erdjs-cookbook/#broadcasting-transactions

That is, do not use the wallet connect provider to broadcast the transaction.

Does this resolve your issue?

@joansala13
Copy link
Author

Thanks for the answer @andreibancioiu ,

I try the solution mentioned, i inspired i elrond dapp template in ping transaction, i do copy&paste of the transaction, change the contractAddress in my config (equal of dapp-tempalte, in this in local, transaction work) and in my code say:
error signing transaction TypeError: elrondnetwork_erdjs__WEBPACK_IMPORTED_MODULE_1_.Nonce is not a constructor

the only difference i see is the version of erdjs in my package.json... i need the downgrade for this?

thanks!

@andreibancioiu
Copy link
Contributor

Hello @joansala13!

Indeed, an option would be to downgrade the erdjs reference until dapp-template is updated to use erdjs v10, as well.

However, do you think you can post the code snippet that triggers the error? It's true that new Nonce() isn't available anymore in erdjs 10: https://docs.elrond.com/sdk-and-tools/erdjs/erdjs-migration-guides/#nonce-gas-limit-gas-price-chain-id

@joansala13
Copy link
Author

sure @andreibancioiu , this is a function i call from onClick button ->

  const handleStakeItem = async () => {
    const pingTransaction = {
      value: "1000000000000000000",
      data: "ping",
      receiver:
        "erd1qqqqqqqqqqqqqpgquvt728n40ssd8n2qns9jrlqpwq2jc4rj4cysfuj3ad",
    };
    await refreshAccount();

    const { sessionId /*, error*/ } = await sendTransactions({
      transactions: pingTransaction,
      transactionsDisplayInfo: {
        processingMessage: "Processing Ping transaction",
        errorMessage: "An error has occured during Ping",
        successMessage: "Ping transaction successful",
      },
      redirectAfterSign: false,
    });
    console.log({ sessionId });
  };

the log of sessionId always is null, what did I comment to you after your answer, i try with the example "ping" of dapp-template

@andreibancioiu
Copy link
Contributor

Thank you for the details 🙏

Do you think you can downgrade the erdjs reference, until dapp-template is updated to use erdjs v10?

@ccorcoveanu
Copy link
Contributor

Both dapp-template and dapp-core were upgraded to erdjs v10, I will close this issue. If the issue still persists, feel free to re-open

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

3 participants