Skip to content

Convenience function to determine current size of transaction #2489

Closed
@jbair06

Description

@jbair06

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

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions