예제 #1
0
        public iBanFirstClient(HttpClient httpClient,
                               string userName               = null,
                               string clientSecret           = null,
                               ILoggerFactory loggerFactory  = null,
                               TargetEnvironment environment = TargetEnvironment.SANDBOX)
            : base(httpClient, userName, clientSecret, loggerFactory)
        {
            SetBaseUri(environment == TargetEnvironment.PRODUCTION ? iBanFirstUrls.PRODUCTION : iBanFirstUrls.SANDBOX);

            _walletsClient              = new WalletsClient(this);
            _financialMovementsClient   = new FinancialMovementsClient(this);
            _externalBankAccountsClient = new ExternalBankAccountsClient(this);
            _paymentsClient             = new PaymentsClient(this);
            _tradesClient    = new TradesClient(this);
            _documentsClient = new DocumentsClient(this);
            _logsClient      = new LogsClient(this);
        }
        public static async IAsyncEnumerable <Wallet> GetWallets(this IWalletsClient walletsClient,
                                                                 string?currency = null, Pagination?pagination = null,
                                                                 [EnumeratorCancellation] CancellationToken cancellationToken = default)
        {
            pagination ??= Pagination.Default;
            var fetchPage = new Func <Pagination, Task <IPagedResponse <Wallet> > >(async p =>
            {
                var page = await walletsClient.GetWalletsAsync(currency, p?.Limit, p?.Before, p?.After, cancellationToken);
                return(page.Result);
            });

            await foreach (var wallet in pagination.EnumerateAsynchronously(fetchPage)
                           .WithCancellation(cancellationToken))
            {
                yield return(wallet);
            }
        }
예제 #3
0
 public WalletsClientTests(CoinbaseApiFixture apiFixture, ITestOutputHelper output) : base(apiFixture, output)
 {
     _walletsClient = ServiceProvider.GetRequiredService <IWalletsClient>();
 }