Example #1
0
        /// <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.kth_chain_block_to_data(nativeInstance_, wire? 1:0, ref blockSize));

            return(blockData.CopyToManagedArray(blockSize));
        }
Example #2
0
        public byte[] PushData(bool wire)
        {
            int size = 0;
            var data = new NativeBuffer(DoubleSpendProofSpenderNative.kth_chain_double_spend_proof_spender_push_data(nativeInstance_, ref size));

            return(data.CopyToManagedArray(size));
        }
Example #3
0
        /// <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.kth_chain_script_to_data(nativeInstance_, prefix? 1:0, ref scriptSize));

            return(scriptData.CopyToManagedArray(scriptSize));
        }
Example #4
0
        /// <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.kth_chain_transaction_to_data(nativeInstance_, wire? 1:0, ref txSize));

            return(txData.CopyToManagedArray(txSize));
        }