hedera-sdk-js icon indicating copy to clipboard operation
hedera-sdk-js copied to clipboard

Convenience function to determine current size of transaction

Open jbair06 opened this issue 1 year ago • 0 comments

Problem

In order to determine the size of the transaction to ensure it is within the size limits, a few steps needs to be taken. Currently, the most accurate way to do this looks similar to this: const request = await transaction._makeRequestAsync(); proto.Transaction.encode(request).finish().length

Especially for new developers, a method on the transaction that returns this value would be very helpful for client side apps.

Solution

Add a convenience function that will return the protobuf size of the transaction that will actually be received by the network.

Alternatives

No response

jbair06 avatar Aug 26 '24 16:08 jbair06