Skip to content

statementAsWire

statementAsWire(statement): StealthTransferStatement

Defined in: ootle/src/stealth/instruction.ts:104

Carry a StealthTransferStatement into an instruction as a byte-exact raw JSON fragment.

The statement’s u64 amounts are bare JSON numbers that routinely exceed 2^53; JSON.parse would round them and break the signed proofs. We therefore embed the canonical StealthTransferStatement.toCompactJson string verbatim under RAW_JSON_FRAGMENT and let serializeUnsignedTx splice it into the serialized transaction at signing / sealing / hashing time — never round-tripping it through a JS number. The engine still deserialises statement as a struct (not a string); the splice produces exactly that.

Nothing reads the statement object structurally after it is set (the serializers stringify it wholesale and patchStealthStatement replaces the whole field), so the documented cast to the binding’s structured type is sound.

StealthTransferStatement

StealthTransferStatement