getLinearMessagePackerInstructionPlan
Creates a MessagePackerInstructionPlan that packs instructions
such that each instruction consumes as many bytes as possible from the given
totalLength
while still being able to fit into the given transaction messages.
This is particularly useful for instructions that write data to accounts and must span multiple transactions due to their size limit.
This message packer will first call getInstruction
with a length of zero to
determine the base size of the instruction before figuring out how many
additional bytes can be packed into the transaction message. That remaining space
will then be used to call getInstruction
again with the appropriate length.
Parameters
Parameter | Type |
---|---|
__namedParameters | { getInstruction : (offset , length ) => Instruction ; totalLength : number ; } |
__namedParameters.getInstruction | (offset , length ) => Instruction |
__namedParameters.totalLength | number |