Exemplo n.º 1
0
 public static Task <ApiResponse <PublicVolumeResponse> > GetPublicVolumeAsync(IPublicVolumeProvider provider, PublicVolumesContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetPublicVolumeAsync(context), nameof(GetPublicVolume), provider, context, r =>
     {
         var s = new VolumeSource(provider, typeof(IPublicVolumeProvider));
         r.Volume.ForEach(x => x.Source = s);
     }));
 }
Exemplo n.º 2
0
        public static Task <ApiResponse <WalletAddresses> > GetAllDepositAddressesAsync(IDepositProvider provider, WalletAddressContext context)
        {
            // TODO: review
            //if (provider.CanGenerateDepositAddress && !provider.CanPeekDepositAddress)
            //    throw new Exception($"{provider.Title} cannot 'peek' deposit addresses.");

            return(ApiHelpers.WrapExceptionAsync(() => provider.GetAddressesAsync(context), nameof(GetDepositAddresses), provider, context));
        }
Exemplo n.º 3
0
 public static Task <ApiResponse <PublicVolumeResponse> > GetAggVolumeDataAsync(IAggVolumeDataProvider provider, AggVolumeDataContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetAggVolumeDataAsync(context), nameof(GetAggVolumeData), provider, context));
 }
Exemplo n.º 4
0
 public static Task <ApiResponse <AggregatedAssetPairData> > GetCoinSnapshotAsync(ICoinSnapshotAggregationProvider provider, AssetPairDataContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetCoinSnapshotAsync(context), nameof(GetCoinSnapshot), provider, context));
 }
Exemplo n.º 5
0
 public static Task <ApiResponse <List <AssetInfo> > > GetCoinInformationAsync(ICoinInformationProvider provider, NetworkProviderContext context = null)
 {
     context = context ?? new NetworkProviderContext();
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetCoinInformationAsync(context), nameof(GetCoinInformation), provider, context));
 }
Exemplo n.º 6
0
 public static Task <ApiResponse <BalanceResults> > GetBalancesAsync(IBalanceProvider provider, NetworkProviderPrivateContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => CheckedBalancesAsync(provider, context), nameof(GetBalances), provider, context));
 }
Exemplo n.º 7
0
 public static Task <ApiResponse <TransferSuspensions> > GetTransferSuspensionsAsync(IDepositProvider provider, NetworkProviderContext context = null)
 {
     context = context ?? new NetworkProviderContext();
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetTransferSuspensionsAsync(context), nameof(GetTransferSuspensions), provider, context));
 }
Exemplo n.º 8
0
 public static Task <ApiResponse <OhlcData> > GetOhlcAsync(IOhlcProvider provider, OhlcContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetOhlcAsync(context), nameof(GetOhlc), provider, context));
 }
Exemplo n.º 9
0
        public static Task <ApiResponse <AssetPairs> > GetAssetPairsAsync(IAssetPairsProvider provider, NetworkProviderContext context = null)
        {
            context = context ?? new NetworkProviderContext();

            return(AssetPairCache.I.TryAsync(provider, () => ApiHelpers.WrapExceptionAsync(() => provider.GetAssetPairsAsync(context), nameof(GetAssetPairs), provider, context)));
        }
Exemplo n.º 10
0
 public static Task <ApiResponse <bool> > TestApiAsync(INetworkProviderPrivate provider, ApiPrivateTestContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.TestPrivateApiAsync(context), nameof(TestApi), provider, context));
 }
Exemplo n.º 11
0
 public static Task <ApiResponse <MarketPrices> > GetPricingAsync(IPublicPricingProvider provider, PublicPricesContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetPricingAsync(context), nameof(GetPricing), provider, context));
 }
Exemplo n.º 12
0
 public static Task <ApiResponse <OrderBook> > GetOrderBookAsync(IOrderBookProvider provider, OrderBookContext context)
 {
     return(ApiHelpers.WrapExceptionAsync(() => provider.GetOrderBookAsync(context), nameof(GetOrderBook), provider, context));
 }