question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to access the return value using the API

See original GitHub issue

When we make a function call to the Smart Contract using the @polkadot/api-contract, we are returned with a result object if the transaction was successful. I have a function which is supposed to return a variable string. Below is the mentioned value of the result object. But I cannot see any data regarding the returned string. Also, how should I access a triggered event from the API?

Result is :  {
  "dispatchInfo": {
    "weight": 150000000,
    "class": "Normal",
    "paysFee": "Yes"
  },
  "events": [
    {
      "phase": {
        "ApplyExtrinsic": 1
      },
      "event": {
        "index": "0x0000",
        "data": [
          {
            "weight": 150000000,
            "class": "Normal",
            "paysFee": "Yes"
          }
        ]
      },
      "topics": []
    }
  ],
  "status": {
    "Finalized": "0x3159371db6098be8c0c9552664aa7aa2c792e6c0c7d67ebbb08aef8a0a2eb193"
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JeremyConnorcommented, Nov 10, 2020

Okay, got it. Thanks for clearing it out!

0reactions
polkadot-js-botcommented, Jun 3, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found