javascriptalgorand

Algorand JS SDK - problems with get_obj_for_encoding


I'm trying to use algorand-js-sdk. Is there an alternative to calling the get_obj_for_encoding method? When passing a SignedTransaction to a backend API, the method gets stripped out. What can I do here?


Solution

  • Update: Resolved this.

    I modified the get_obj_for_encoding method to be a standalone function. In doing so, I had to convert the array objects back into Uint8Arrays and Buffers where needed. If there's a built-in or simpler way of achieving this, please comment.

    Source: https://github.com/algorand/js-algorand-sdk/blob/cfd5b88/src/transaction.ts#L534