Exemple #1
0
        /// <summary>
        /// Gets market info for specific currency pair.
        /// </summary>
        /// <param name="Pair">Pair to get information for.</param>
        /// <returns>Market Information.</returns>
        internal static async Task <TradingMarketInfo> GetMarketInfoAsync(string Pair)
        {
            Uri    uri      = GetUri(Pair);
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Exemple #2
0
        /// <summary>
        /// Validates address belongs to specified currency.
        /// </summary>
        /// <param name="Address">Address to check.</param>
        /// <param name="Symbol">Ticker symbol for currency to check.</param>
        /// <returns>Validation results.</returns>
        internal static async Task <ValidateAddress> ValidateAsync(string Address, string Symbol)
        {
            Uri    uri      = GetUri(Address, Symbol);
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Exemple #3
0
        /*url: shapeshift.io/txbyaddress/[address]/[apiKey]
         * method: GET
         *
         * [address] the address that output coin was sent to for the shift
         * [apiKey] is the affiliate's PRIVATE api key.
         *
         * Success Output:
         *
         *  [
         *      {
         *          inputTXID: [Transaction ID of the input coin going into shapeshift],
         *          inputAddress: [Address that the input coin was paid to for this shift],
         *          inputCurrency: [Currency type of the input coin],
         *          inputAmount: [Amount of input coin that was paid in on this shift],
         *          outputTXID: [Transaction ID of the output coin going out to user],
         *          outputAddress: [Address that the output coin was sent to for this shift],
         *          outputCurrency: [Currency type of the output coin],
         *          outputAmount: [Amount of output coin that was paid out on this shift],
         *          shiftRate: [The effective rate the user got on this shift.],
         *          status: [status of the shift]
         *      }
         *      (one listing per transaction returned)
         *  ]
         *
         * The status can be  "received", "complete", "returned", "failed".
         */

        /// <summary>
        /// Finds all transactions sent to specified address.
        /// </summary>
        /// <param name="Address">The address that output coin was sent to for the shift.</param>
        /// <param name="APIKey">The affiliate's PRIVATE api key.</param>
        /// <returns>List of transactions.</returns>
        internal static async Task <List <Tx> > GetTransactionsByAddressAsync(string Address, string APIKey)
        {
            Uri    uri      = GetAddressUri(Address, APIKey);
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Exemple #4
0
        /// <summary>
        /// Gets status of transaction (to be) deposited to supplied address.
        /// </summary>
        /// <param name="Address">Deposit address.</param>
        /// <returns>Transaction status.</returns>
        internal static async Task <TxStatus> GetStatusAsync(string Address)
        {
            Uri    uri      = GetUri(Address);
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Exemple #5
0
        /// <summary>
        /// Provides information on all currencies supported by ShapeShift.
        /// </summary>
        /// <returns>List of all supported currencies.</returns>
        internal static async Task <List <SupportedCoin> > GetCoinsAsync()
        {
            Uri    uri      = GetUri();
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }
Exemple #6
0
        /// <summary>
        /// Gets information on recent transactions completed by ShapeShift.
        /// </summary>
        /// <param name="Max">Maximum number of transactions to return. Must be betweeen 1 and 50, inclusive.</param>
        /// <returns>List of recent transactions.</returns>
        internal static async Task <List <RecentTx> > GetRecentTransactionsAsync(int Max)
        {
            if (Max < 1 || Max > 50)
            {
                throw new InvalidOperationException();
            }
            Uri    uri      = GetUri(Max);
            string response = await RestServices.GetResponseAsync(uri).ConfigureAwait(false);

            return(await ParseResponseAsync(response).ConfigureAwait(false));
        }