import { BinaryWriter } from '../BinaryWriter' ; import { UInt256 } from '../common' ; export type SerializeWire = ( ) => Buffer ; export interface SerializableWire { readonly serializeWireBase : ( writer : BinaryWriter ) => void ; readonly serializeWire : SerializeWire ; } export const createSerializeWire = ( serializeWireBase ) : SerializeWire => ( ) => { const writer = new BinaryWriter ( ) ; serializeWireBase ( writer ) ; return writer . toBuffer ( ) ; } ; export interface SerializableJSON < TJSON > { readonly serializeJSON : ( ) => TJSON ; } export const getSignData = ( hash , network ) => { const writer = new BinaryWriter ( ) ; writer . writeUInt32LE ( network ) ; writer . writeUInt256 ( hash ) ; return writer . toBuffer ( ) ; } ;