/// <summary> /// Raw transaction data. /// </summary> /// <param name="wire">Iif true, include data size at the beginning.</param> /// <returns>Byte array with transaction data.</returns> public byte[] ToData(bool wire) { int txSize = 0; var txData = new NativeBuffer(TransactionNative.chain_transaction_to_data(nativeInstance_, wire? 1:0, ref txSize)); return(txData.CopyToManagedArray(txSize)); }
/// <summary> /// Raw script data /// </summary> /// <param name="prefix"> Tells whether to include script size in data </param> /// <returns> Byte array with script data </returns> public byte[] ToData(bool prefix) { int scriptSize = 0; var scriptData = new NativeBuffer(ScriptNative.chain_script_to_data(nativeInstance_, prefix? 1:0, ref scriptSize)); return(scriptData.CopyToManagedArray(scriptSize)); }
/// <summary> /// Raw block data. /// </summary> /// <param name="wire">if and only if true, include data size at the beginning.</param> /// <returns>Byte array with block data.</returns> public byte[] ToData(bool wire) { int blockSize = 0; var blockData = new NativeBuffer(BlockNative.chain_block_to_data(nativeInstance_, wire? 1:0, ref blockSize)); return(blockData.CopyToManagedArray(blockSize)); }