예제 #1
0
파일: Chain.cs 프로젝트: k-nuth/cs-api
        /// <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>>> GetStealthAsync(Binary filter, UInt64 fromHeight) {
         *  return await TaskHelper.ToTask<DisposableApiCallResult<INativeList<IStealthCompact>>>(tcs => {
         *
         *      GetStealth(filter, fromHeight, (code, list) => {
         *          tcs.TrySetResult(new DisposableApiCallResult<INativeList<IStealthCompact>>()
         *          {
         *              ErrorCode = code,
         *              Result = list
         *          });
         *
         *      });
         *
         *  });
         * }*/

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

            ChainNative.kth_chain_async_stealth(nativeInstance_, contextPtr, filter.NativeInstance, fromHeight, internalGetStealthHandler_);
        }