Example #1
0
        /// <summary>
        /// Requests a quote for an exchange without exchanging.
        /// </summary>
        /// <param name="Pair">Coin pair to exchange between.</param>
        /// <param name="Amount">Amount of coin to be sent to withdrawal address.</param>
        /// <returns>Quote for exchange information.</returns>
        internal static async Task <QuoteRequest> RequestAsync(string Pair, double Amount)
        {
            Uri    uri      = GetUri();
            string data     = CreateData(Pair, Amount);
            string response = await RestServices.GetPostResponseAsync(uri, data).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Example #2
0
        /// <summary>
        /// Sends Shift request.
        /// </summary>
        /// <param name="Withdrawal">Address for resulting coins to be sent to.</param>
        /// <param name="Pair">Currency pair for exchange.</param>
        /// <param name="Return">Address to return coins to if exchange fails.</param>
        /// <param name="RippleTag">Destination tag that you want appended to a Ripple payment to you.</param>
        /// <param name="NXTRsAddress">For new NXT accounts to be funded, you supply this on NXT payment to you.</param>
        /// <param name="APIKey">Your affiliate PUBLIC KEY, for volume tracking, affiliate payments, split-shifts, etc...</param>
        /// <returns>Result of Shift request.</returns>
        internal static async Task <ShiftResult> ShiftAsync(string Withdrawal, string Pair, string Return = "", string RippleTag = "", string NXTRsAddress = "", string APIKey = "")
        {
            Uri    uri      = GetUri();
            string data     = CreateData(Withdrawal, Pair, Return, RippleTag, NXTRsAddress, APIKey);
            string response = await RestServices.GetPostResponseAsync(uri, data).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Example #3
0
        /// <summary>
        /// Gets information on pending exchange.
        /// </summary>
        /// <param name="Amount">Amount to be sent to withdrawal address.</param>
        /// <param name="Address">The withdrawal address.</param>
        /// <param name="Pair">The coin pair.</param>
        /// <param name="ReturnAddress">Address to return coins to if exchange fails.</param>
        /// <param name="RippleTag">Destination tag that you want appended to a Ripple payment to you.</param>
        /// <param name="NXTRsAddress">For new NXT accounts to be funded, supply this on NXT payment to you.</param>
        /// <param name="APIKey">Your affiliate PUBLIC KEY, for volume tracking, affiliate payments, split-shifts, etc...</param>
        /// <returns>Information on pending exchange.</returns>
        internal static async Task <SendAmountRequest> RequestAsync(double Amount, string Address, string Pair, string ReturnAddress = "", string RippleTag = "", string NXTRsAddress = "", string APIKey = "")
        {
            Uri    uri      = GetUri();
            string data     = CreateData(Amount, Address, Pair, ReturnAddress, RippleTag, NXTRsAddress, APIKey);
            string response = await RestServices.GetPostResponseAsync(uri, data).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Example #4
0
        /// <summary>
        /// Attempts to cancel pending exchange
        /// </summary>
        /// <param name="Address">The deposit address associated with the pending transaction.</param>
        /// <returns>Result of cancel operation.</returns>
        internal static async Task <CancelResult> CancelAsync(string Address)
        {
            //Get URI for POST request
            Uri uri = GetUri();
            //Generate JSON data string
            string data = CreateData(Address);
            //Send POST request
            string response = await RestServices.GetPostResponseAsync(uri, data).ConfigureAwait(false);

            //Parse response for results
            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Example #5
0
        /// <summary>
        /// Requests a receipt for transaction to be sent via email.
        /// </summary>
        /// <param name="Email">Email address to send receipt to.</param>
        /// <param name="TxID">Transaction ID of the transaction sent to the user.</param>
        /// <returns>Result of receipt request.</returns>
        internal static async Task <EmailReceipt> RequestAsync(string Email, string TxID)
        {
            //Get URI for POST request
            Uri uri = GetUri();
            //Generate JSON data as string to send
            string data = CreateData(Email, TxID);
            //Send POST request and awaits response
            string response = await RestServices.GetPostResponseAsync(uri, data).ConfigureAwait(false);

            //Parse response for results
            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }