Example #1
0
        private void FetchMerkleBlockByHash(byte[] blockHash, Action <ErrorCode, MerkleBlock, UInt64> handler)
        {
            var managedHash = new hash_t
            {
                hash = blockHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.chain_fetch_merkle_block_by_hash(nativeInstance_, contextPtr, managedHash, internalMerkleBlockFetchHandlerByHash_);
        }
Example #2
0
        private void FetchTransactionPosition(byte[] txHash, bool requireConfirmed, Action <ErrorCode, UInt64, UInt64> handler)
        {
            var managedHash = new hash_t
            {
                hash = txHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.chain_fetch_transaction_position(nativeInstance_, contextPtr, managedHash, requireConfirmed ? 1 : 0, internalFetchTransactionPositionHandler_);
        }
Example #3
0
        private void FetchBlockHeaderByHash(byte[] blockHash, Action <ErrorCode, Header, UInt64> handler)
        {
            var managedHash = new hash_t
            {
                hash = blockHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.chain_fetch_block_header_by_hash(nativeInstance_, contextPtr, managedHash, internalFetchBlockHeaderHandlerByHash_);
        }
Example #4
0
        private void FetchBlockHeaderByHashTxSizes(byte[] blockHash, FetchBlockHeaderByHashTxsSizeHandler handler)
        {
            var managedHash = new hash_t
            {
                hash = blockHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.chain_fetch_block_header_by_hash_txs_size(nativeInstance_, contextPtr, managedHash, internalFetchBlockHeaderByHashTxsSizeHandler_);
        }
Example #5
0
        private void GetBlockHeight(byte[] blockHash, Action <ErrorCode, UInt64> handler)
        {
            var managedHash = new hash_t
            {
                hash = blockHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.kth_chain_async_block_height(nativeInstance_, contextPtr, managedHash, internalGetBlockHeightHandler_);
        }
Example #6
0
        private void GetTransactionPosition(byte[] txHash, bool requireConfirmed, Action <ErrorCode, UInt64, UInt64> handler)
        {
            var managedHash = new hash_t
            {
                hash = txHash
            };
            IntPtr contextPtr = CreateContext(handler, managedHash);

            ChainNative.kth_chain_async_transaction_position(nativeInstance_, contextPtr, managedHash, Helper.BoolToC(requireConfirmed), internalGetTransactionPositionHandler_);
        }
Example #7
0
        public INativeList <ITransaction> GetMempoolTransactions(INativeList <PaymentAddress> addresses, bool useTestnetRules)
        {
            IntPtr txs = ChainNative.chain_get_mempool_transactions_from_wallets
                         (
                nativeInstance_,
                addresses.NativeInstance,
                useTestnetRules? 1 : 0
                         );

            return(new TransactionList(txs));
        }
Example #8
0
        /// <summary>
        /// Get metadata on potential payment transactions by stealth filter. Given a filter and a
        /// height in the chain, it queries the chain for transactions matching the given filter.
        /// </summary>
        /// <param name="filter"> Must be at least 8 bits in length. example "10101010" </param>
        /// <param name="fromHeight"> Starting height in the chain to search for transactions </param>

        /* public async Task<DisposableApiCallResult<INativeList<IStealthCompact>>> FetchStealthAsync(Binary filter, UInt64 fromHeight)
         * {
         *  return await TaskHelper.ToTask<DisposableApiCallResult<INativeList<IStealthCompact>>>(tcs =>
         *  {
         *
         *      FetchStealth(filter, fromHeight, (code, list) =>
         *      {
         *          tcs.TrySetResult(new DisposableApiCallResult<INativeList<IStealthCompact>>()
         *          {
         *              ErrorCode = code,
         *              Result = list
         *          });
         *
         *      });
         *
         *  });
         * }*/

        private void FetchStealth(Binary filter, UInt64 fromHeight, Action <ErrorCode, StealthCompactList> handler)
        {
            IntPtr contextPtr = CreateContext(handler, filter);

            ChainNative.chain_fetch_stealth(nativeInstance_, contextPtr, filter.NativeInstance, fromHeight, internalFetchStealthHandler_);
        }
Example #9
0
        private void FetchSpend(OutputPoint outputPoint, Action <ErrorCode, Point> handler)
        {
            IntPtr contextPtr = CreateContext(handler, outputPoint);

            ChainNative.chain_fetch_spend(nativeInstance_, contextPtr, outputPoint.NativeInstance, internalFetchSpendHandler_);
        }
Example #10
0
        private void GetSpend(OutputPoint outputPoint, Action <ErrorCode, Point> handler)
        {
            IntPtr contextPtr = CreateContext(handler, outputPoint);

            ChainNative.kth_chain_async_spend(nativeInstance_, contextPtr, outputPoint.NativeInstance, internalGetSpendHandler_);
        }