See readme.md for general information about the project.
A module containing a spring boot starter for a ConsensusJ Bitcoin Core JSON-RPC API client.
The starter will automatically create an injectable BitcoinClient
bean:
org.tbk.bitcoin.jsonrpc:
enabled: true # whether auto-config should run - default is `true`
network: mainnet
rpchost: http://localhost
rpcport: 8332
rpcuser: myrpcuser
rpcpassword: 'myrpcpassword'
A module containing a spring boot starter for a Bitcoin Core ZeroMq API client.
The starter will automatically create injectable ZeroMqMessagePublisherFactory
beans for every zmq endpoint:
org.tbk.bitcoin.zeromq:
enabled: true # whether auto-config should run - default is `true`
network: mainnet
zmqpubrawblock: tcp://localhost:28332
zmqpubrawtx: tcp://localhost:28333
zmqpubhashblock: tcp://localhost:28334
zmqpubhashtx: tcp://localhost:28335
Also, if you have bitcoinj in the classpath, it will create a bean
of type BitcoinjTransactionPublisherFactory
and BitcoinjBlockPublisherFactory
which will emit bitcoinj
types for your convenience.
A module containing a spring boot starter for a CLN gRPC API client.
The starter will automatically create injectable NodeStub
, NodeFutureStub
and NodeBlockingStub
beans:
org.tbk.lightning.cln.grpc:
enabled: true # whether auto-config should run - default is `true`
host: localhost
port: 19935
ca-cert-file-path: '/home/user/.lightning/regtest/ca.pem'
client-cert-file-path: '/home/user/.lightning/regtest/client.pem'
client-key-file-path: '/home/user/.lightning/regtest/client-key.pem'
or
org.tbk.lightning.cln.grpc:
host: localhost
port: 19935
ca-cert-base64: '...yv66vg=='
client-cert-base64: '...yv66vg=='
client-key-base64: '...yv66vg=='
A module containing a spring boot starter for a LightningJ LND gRPC API client.
The starter will automatically create injectable AsynchronousLndAPI
and SynchronousLndAPI
beans:
org.tbk.lightning.lnd.grpc:
enabled: true # whether auto-config should run - default is `true`
host: localhost
port: 10009
macaroon-file-path: '/home/user/.lnd/data/chain/bitcoin/regtest/admin.macaroon'
cert-file-path: '/home/user/.lnd/tls.cert'
or
org.tbk.lightning.lnd.grpc:
host: localhost
port: 10009
macaroon-base64: '...yv66vg=='
cert-base64: '...yv66vg=='
A generalized and extensible interface of multiple Bitcoin Fee Recommendation APIs. The following providers are available out of the box:
- Bitcoin Core JSON-RPC Api (
estimatestmartfee
) - bitcoiner.live API
- Bitgo API
- Bitcore API
- Blockchain.info API (deprecated - will be removed as it is not compatible with "block target" recommendations)
- Blockchair API
- BlockCypher API
- Blockstream.info API
- BTC.com API
- earn.com API
- mempool.space API
A module containing a spring boot starter for automatically creating and configuring XChange beans! This starter makes it easy to fetch the current price of bitcoin, programmatically place orders, withdraw your bitcoin or manage your account!
org.tbk.xchange:
enabled: true # whether auto-config should run - default is `true`
specifications: # provide specifications for all exchange you want to use - default is empty (no beans created)
krakenExchange:
exchange-class: org.knowm.xchange.kraken.KrakenExchange
api-key: 'your-api-key' # change this value to your api key
secret-key: 'your-secret-key' # change this value to your secret key
Moved to a distinct repo: https://github.com/theborakompanioni/tor-spring-boot-starter
Contains a JSR354 compliant CurrentyUnit
implementation representing Bitcoin.
A module containing a spring boot starter for convenient handling of JSR354 beans.
This module creates an application context aware JSR354 Service Provider (javax.money.spi.ServiceProvider
)
that provides beans in the application context to be used by JSR354 factories (javax.money.Monetary
).
A module containing a spring boot starter for integrating XChange
in JSR354 currency conversions. Provides a
javax.money.convert.ExchangeRateProvider
implementation that uses org.knowm.xchange.Exchange
beans
to supply exchange rates from popular Bitcoin exchanges.
e.g.
CurrencyConversion btcToUsdConversion = MonetaryConversions.getConversion(ConversionQueryBuilder.of()
.setBaseCurrency(Monetary.getCurrency("BTC"))
.setTermCurrency(Monetary.getCurrency("USD"))
.build());
Money singleBitcoin = Money.of(BigDecimal.ONE, "BTC");
Money singleBitcoinInUsd = singleBitcoin.with(btcToUsdConversion);
log.info("{} equals {}", singleBitcoin, singleBitcoinInUsd);
// e.g. "BTC 1.00 equals USD 13806.90"
This module contains a fast and easy way to start one or multiple instances of external services within docker containers programmatically directly from your application. Please note, that these modules are intended to be used in regtest mode only.
Start and run:
- Bitcoin Core with
spring-testcontainer-bitcoind-starter
- cln with
spring-testcontainer-cln-starter
- lnd with
spring-testcontainer-lnd-starter
- ElectrumX with
spring-testcontainer-electrumx-starter
- Electrum Personal Server with
spring-testcontainer-electrum-personal-server-starter
- Electrum with
spring-testcontainer-electrum-daemon-starter
- Tor with
spring-testcontainer-tor-starter
Most of these spring boot starter modules contain a simple example application. They can be used in combination with other modules like bitcoin-jsonrpc-client, bitcoin-zeromq-client, lnd-grpc-client, etc.
A module containing spring boot starters for integration and regression testing your own application. It includes functionality to create and fund addresses, send transactions, mine blocks and much more.
This subproject is home to all almost-ready modules.
A module containing a spring boot starter for an Electrum daemon JSON-RPC API client. It can be used in combination with spring-testcontainer-electrum-daemon-starter!
The spring-lnurl module contains classes and spring security configurations for authentication with lnurl-auth.