JS SDK TxObject.fromString How to call a method

Hi, I don’t know how to use JSSDK when I use it

I introduced it statically

<script type="text/javascript" src="./ae-sdk.js"></script>

But I want to call

TxObject.fromString("")

How should it be used? I’ve been looking for a long time without finding a specific way to call it

@milenradkov.chain I guess you know the answer, man

have you checked the documentation? https://github.com/aeternity/aepp-sdk-js/blob/develop/docs/guides/import-script-tag.md

The way I’m referencing it is fine, I just can’t figure out how to call this method, okay
TxObject.fromString("")

What is the goal to use this api? Where did you find it documented?

As seen here,
I think the purpose of using it is to get the TX information, parse it and show it to the user
Tx is returned by the back end to the front end, which is taken to tX for analytical display

data:
tx_+F4MAaEBXojXIiRilc7+wxQ9LPIhI0eqyWDQs+pKvgP7qGzg3C6hARnSsmChDXB7PhOaZw0EClNI9L/vtuPHGJFbExne3e6YiAFjRXhdigAAhg9jfpbwAIMFEEOCAr2AYguNBA==

I don’t think the TxObject is exposed in the browser-script.

Can it be made public? Because I need it for my needs

Hey, I’m using unpackTx function for getting transaction data from encoded transaction string. Maybe try using that?

3 Likes

Thank you. The method you provided is available. Solved my problem

2 Likes

Just to draw more attention to the new official JS doc - things can be found here: https://aeternity-js-sdk.readthedocs.io/en/latest/api/tx/builder/#exportsunpacktxencodedtx-fromrlpbinary-prefix-object

1 Like