public SingleAssetRequestHandler(RequestAssetSingle request, RequestController requestController)
        {
            if (VERBOSE)
            {
                Debug.Log($"SingleAssetRequestHandler: ({GetHashCode()}) {request.requestId} created");
            }

            this.request           = request;
            this.requestController = requestController;
            schedulableHandler.SetReadyToBeScheduled(this);
        }
예제 #2
0
        public RequestBase <SingleAssetResponse> FetchSingleNFT(string contractAddress, string tokenId)
        {
            if (cacheSingleAssetResponses.TryGetValue(RequestAssetSingle.GetId(contractAddress, tokenId), out RequestBase <SingleAssetResponse> request))
            {
                return(request);
            }

            var newRequest = new RequestAssetSingle(contractAddress, tokenId);

            AddToCache(newRequest);

            newRequest.OnFail += OnRequestFailed;

            var requestHandler = new SingleAssetRequestHandler(newRequest, this);

            requestScheduler.EnqueueRequest(requestHandler);

            return(newRequest);
        }