Ejemplo n.º 1
0
        public static ApiResponse <object> Send(CheckPartnerKycRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created   = EpochUtils.getEpoch(),
                AppHandle = AppHandle,
                Crypto    = "ETH",
                Reference = UuidUtils.GetUuid(),
                Version   = "0.2"
            });
            body.Add("query_app_handle", request.QueryAppHandle);
            body.Add("query_user_handle", request.QueryUserHandle);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <CheckPartnerKycResponse>(response));
        }
Ejemplo n.º 2
0
        public static ApiResponse <object> Send(GetTransactionsRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("message", "get_transactions_msg");
            body.Add("search_filters", request.SearchFilters);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <GetTransactionsResponse>(response));
        }
Ejemplo n.º 3
0
        public static ApiResponse <object> Send(RegisterRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                UserHandle = request.UserHandle,
                Version    = "0.2"
            });
            body.Add("message", "entity_msg");
            body.Add("address", request.Address);
            body.Add("identity", request.Identity);
            body.Add("contact", request.Contact);
            body.Add("crypto_entry", request.CryptoEntry);
            body.Add("entity", request.Entity);
            body.Add("device", request.Device);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <RegisterResponse>(response));
        }
Ejemplo n.º 4
0
        public static ApiResponse <object> Send(LinkAccountRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("account_name", request.AccountName);
            body.Add("account_number", request.AccountNumber);
            body.Add("routing_number", request.RoutingNumber);
            body.Add("account_type", request.AccountType);
            body.Add("plaid_token", request.PlaidToken);
            body.Add("selected_account_id", request.SelectedAccountId);
            body.Add("plaid_token_type", request.PlaidTokenType);

            string serializedBody = SerializationUtil.Serialize(body);

            Console.WriteLine(serializedBody);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);
            headers = HeaderUtils.SetUserSignature(headers, serializedBody, request.UserPrivateKey);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <LinkAccountResponse>(response));
        }
Ejemplo n.º 5
0
        public static ApiResponse <object> Send(UpdateAccountRequest request)
        {
            Dictionary <string, object> body = new Dictionary <string, object>();

            body.Add("header", new Header
            {
                Created    = EpochUtils.getEpoch(),
                AppHandle  = AppHandle,
                UserHandle = request.UserHandle,
                Crypto     = "ETH",
                Reference  = UuidUtils.GetUuid(),
                Version    = "0.2"
            });
            body.Add("account_name", request.AccountName);
            body.Add("new_account_name", request.NewAccountName);

            string serializedBody = SerializationUtil.Serialize(body);

            Dictionary <string, string> headers = new Dictionary <string, string>();

            headers = HeaderUtils.SetAuthSignature(headers, serializedBody);
            headers = HeaderUtils.SetUserSignature(headers, serializedBody, request.UserPrivateKey);

            IRestResponse response = (IRestResponse)ApiClient.CallApi(endpoint, RestSharp.Method.POST, serializedBody, headers, "application/json");

            return(ResponseUtils.PrepareResponse <UpdateAccountResponse>(response));
        }