Skip to content

Commit 1988ca6

Browse files
committed
fix(sdk-coin-flrp): enhance toBroadcastFormat to include checksum
TICKET: WIN-8445
1 parent e07eec5 commit 1988ca6

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/sdk-coin-flrp/src/lib/transaction.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,14 @@ export class Transaction extends BaseTransaction {
231231
return FlareUtils.bufferToHex(this._rawSignedBytes);
232232
}
233233
const unsignedTx = this._flareTransaction as UnsignedTx;
234-
// Always include credentials in the output with checksum (matching avaxp behavior)
235-
// This ensures unsigned transactions have empty signature slots for identification
236-
return FlareUtils.bufferToHex(utils.addChecksum(unsignedTx.getSignedTx().toBytes()));
234+
const signedTxBytes = unsignedTx.getSignedTx().toBytes();
235+
236+
// Both P-chain and C-chain transactions include checksum (matching avaxp behavior)
237+
// avaxp P-chain: transaction.ts uses addChecksum() explicitly
238+
// avaxp C-chain: deprecatedTransaction.ts uses Tx.toStringHex() which internally adds checksum
239+
const rawTx = FlareUtils.bufferToHex(utils.addChecksum(signedTxBytes));
240+
console.log('rawTx in toBroadcastFormat:', rawTx);
241+
return rawTx;
237242
}
238243

239244
toJson(): TxData {

0 commit comments

Comments
 (0)