コード例 #1
0
        public ApiKeyCredentialsProvider(IOptions <FireblocksApiConfiguration> configuration,
                                         IDateTimeProvider dateTimeProvider)
        {
            _configuration    = configuration.Value;
            _dateTimeProvider = dateTimeProvider;

            _tokenSource    = new CancellationTokenSource();
            _encodingSecret = Convert.FromBase64String(_configuration.ApiSecret);
        }
コード例 #2
0
        public static IServiceCollection AddFireblocksClient(
            this IServiceCollection services, FireblocksApiConfiguration apiConfiguration)
        {
            var options = Options.Create(apiConfiguration);

            services.AddSingleton(options);

            AddCommonDependencies(services);

            return(services);
        }
コード例 #3
0
        public FireblocksApiFixture()
        {
            var configuration = new FireblocksApiConfiguration()
            {
                ApiKey    = Secrets.FireblocksApiKey,
                ApiSecret = Secrets.FireblocksApiSecret,
                BaseUrl   = "https://api.fireblocks.io"
            };

            var serviceCollection = new ServiceCollection();

            serviceCollection.AddSingleton(configuration);
            serviceCollection.AddFireblocksClient(configuration);

            ServiceProvider = serviceCollection.BuildServiceProvider();
        }