hashgraph / hedera-sdk-js

Hedera™ Hashgraph SDK for JavaScript/TypeScript
https://docs.hedera.com/guides/docs/sdks
Apache License 2.0
276 stars 145 forks source link

.toString() is not implemented #2301

Open pathornteng opened 6 months ago

pathornteng commented 6 months ago

Problem

Currently, our toString function on any object does not return a proper string; instead, it returns an object. We should implement an internal function that serializes a JSON object into a string.

The following code will print [object object]

const newAccount = await new AccountCreateTransaction()
    .setKey(newAccountPublicKey)
    .setInitialBalance(Hbar.from(1))
    .freezeWith(client);

  console.log(newAccount.toString());

Solution

Alternatives

No response

YuanBoXie commented 6 months ago

At the same time, is it best to maintain consistency in the field naming of SDK deserialization results in different languages?

svetoslav-nikol0v commented 6 months ago

Yes, it is. Where do you find a mismatch?

AbhiSharmaNIT commented 2 months ago

I want work on this issue pls assign it to me.

SimiHunjan commented 2 months ago

You got it! Assigned!

Jexsie commented 1 month ago

hey @hendrikebbers @SimiHunjan @AbhiSharmaNIT , i would like to take this forward

samswag commented 1 month ago

@AbhiSharmaNIT still working on this?