Transaction Logs & Events
Transactional audit system withTransactionLogService, custom events, and TxRecord.Builder.
TransactionLogService
Singleton service for recording transactions to daily JSON + MySQL.TxType
Enum with all supported transaction types:TxRecord.Builder
extra and metadata are Map<String, Object> and serialize freely to JSON.
Listening to Events
Vault firesTransactionEvent events through the EventBus channel.
TransactionEvent
Register in Plugin
Specific Event Types
Example: Tax on Transfer
History Queries (TransactionLogService)
Consistency
- The
TransactionEventis before persistence. Canceling prevents writing to the log. tx.record()is asynchronous, non-blocking.- Daily JSON is written to
plugins/Vault/logs/yyyy-MM-dd.json. - MySQL stores in the
vault_transactionstable (ifuse_mysql: true).
