algorand / js-algorand-sdk

The official JavaScript SDK for Algorand.
https://algorand.github.io/js-algorand-sdk/
MIT License
285 stars 204 forks source link

AlgodV2: Add disassemble/decompile function to correspond with new disassemble endpoint #621

Closed kael-shipman closed 1 year ago

kael-shipman commented 2 years ago

Problem

There was recently a new disassemble endpoint implemented on the node software to allow you to get human-readable TEAL code from bytecode: https://github.com/algorand/go-algorand/pull/3908. However, there is no corresponding function for the Javascript AlgodV2 client.

Solution

Add a function to correspond to this new endpoint. While I do not like the name, disassemble, used in the endpoint, I believe it's important to maintain consistency between the implementations, so I propose the following function signature:

interface AlgodV2Interface {
  //....
  disassemble(bytecodeHex: string): Promise<string>;
}

Dependencies

Figure out who needs to sign off on the proposed addition.

Urgency

Not urgent.

algochoi commented 1 year ago

https://github.com/algorand/js-algorand-sdk/pull/702 adds the disassemble endpoint and will be included in v2.1.0. Thank you for your patience.