We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For example CreateAssetTx.
The issue is that there is no consistent way to getInputs or serialize it using toBytes()
getInputs
toBytes()
This is how I currently read the inputs
const inputs: avaxSerial.TransferableInput[] = []; // @ts-ignore if (transaction.unsignedTx.inputs) { // @ts-ignore inputs.push(...transaction.unsignedTx.inputs); // @ts-ignore } else if (transaction.unsignedTx.baseTx.inputs) { // @ts-ignore inputs.push(...transaction.unsignedTx.baseTx.inputs); }
and this is how I serialize
export function serializeSignedTx(tx: avaxSerial.SignedTx): Buffer { if (tx.unsignedTx.vm) { return Buffer.from(tx.toBytes()); } else if (tx.unsignedTx._type.startsWith('avm.')) { return Buffer.from( utils.concatBytes( new Short(0).toBytes(), utils.getManagerForVM('AVM').codecs[0].PackPrefix(tx.unsignedTx), utils.getManagerForVM('AVM').codecs[0].PackPrefixList(tx.credentials), ), ); } else { return Buffer.from( utils.concatBytes( new Short(0).toBytes(), utils.getManagerForVM('PVM').codecs[0].PackPrefix(tx.unsignedTx), utils.getManagerForVM('PVM').codecs[0].PackPrefixList(tx.credentials), ), ); } }
is there better way?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
For example CreateAssetTx.
The issue is that there is no consistent way to
getInputs
or serialize it usingtoBytes()
This is how I currently read the inputs
and this is how I serialize
is there better way?
The text was updated successfully, but these errors were encountered: