Search code examples
nearprotocol

How can I see the my methods in deployed contract at near Protocol?


I am trying to find how can I see the available methods in my deployed contract at near protocol as I can see them at etherscan?


Solution

  • In order to do this by code, you can either use the near-contract-parser library, or try to parse the .wasm file deployed on the contract manually.

    First, we need to fetch the contract binary (the .wasm file as base64) using a HTTP request. Then the library will get the abstract syntax tree from the .wasm file, parse it, and filter all the exported method names.

    Here is a useful video for learning how the code owner of near-contract-parser parsed the binary file on the contract to read out the method names that exist on it.