Skip to content

Commit 58a5a70

Browse files
committed
Update README with detailed documentation and adjust project group ID
- Rewrote README with comprehensive documentation for surf-transaction, including features, core concepts, installation, and example usage. - Updated `build.gradle.kts` to reflect a new group ID (`dev.slne.surf.transaction`) for better project organization.
1 parent 587ccc0 commit 58a5a70

File tree

2 files changed

+62
-3
lines changed

2 files changed

+62
-3
lines changed

README.md

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,62 @@
1-
# SURF-TRANSACTION
1+
# surf-transaction
22

3-
Unfinished project port of the old transaction api.
3+
**surf-transaction** is a modular transaction system for the Surf ecosystem.
4+
It provides a structured API for managing accounts, currencies, and transactions and is designed for
5+
asynchronous use in plugins and modules.
6+
7+
## Features
8+
9+
* Account-based transaction system
10+
* Support for multiple currencies with configurable scaling
11+
* Deposits, withdrawals, and transfers
12+
* User- and account-centric API design
13+
* Extensible transaction metadata
14+
* Clear separation between public API and internal implementation
15+
16+
## Installation
17+
18+
### Gradle (Kotlin DSL)
19+
20+
```kotlin
21+
dependencies {
22+
implementation("dev.slne.surf.transaction:surf-transaction-api:<version>")
23+
}
24+
```
25+
26+
## Core Concepts
27+
28+
The API is built around a small set of core abstractions:
29+
30+
* **TransactionUser**
31+
Entry point for user-scoped transactions and account access.
32+
33+
* **Account**
34+
Accounts that hold balances in one or more currencies.
35+
36+
* **Currency**
37+
Defines currencies including symbol, scale, and minimum amount.
38+
39+
* **Transaction**
40+
Immutable representation of a completed transaction.
41+
42+
## Example
43+
44+
```kotlin
45+
val user = TransactionUser.byUuid(userUuid)
46+
47+
user.deposit(
48+
amount = BigDecimal("100"),
49+
currency = Currency.default()
50+
)
51+
52+
val balance = user.balance(Currency.default())
53+
```
54+
55+
All transaction operations return a `TransactionResult`, which can be used to evaluate success or
56+
failure.
57+
58+
## Internal APIs
59+
60+
APIs annotated with `@InternalTransactionApi` are **not part of the public API** and must not be
61+
used.
62+
They may change or be removed at any time without notice.

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ buildscript {
99
}
1010

1111
allprojects {
12-
group = "dev.slne.surf"
12+
group = "dev.slne.surf.transaction"
1313
version = findProperty("version") as String
1414
}

0 commit comments

Comments
 (0)