Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,35 @@
# Lint policy for the Soroban contract. `-Dwarnings` keeps the build honest;
# the allows below cover lints that the contract cannot satisfy or that do not
# apply to it, rather than leaving CI red.
#
# clippy::nursery is deliberately absent: those lints are unstable by clippy's
# own definition and are not meant to gate CI.
[build]
rustflags = ["-Dwarnings", "-Wclippy::all", "-Wclippy::pedantic", "-Wclippy::nursery"]
rustflags = [
"-Dwarnings",
"-Wclippy::all",
"-Wclippy::pedantic",

# `#[contractimpl]` requires entrypoints to take Env and Address by value,
# and generates code that reads parameters an empty body ignores.
"-Aclippy::needless_pass_by_value",
"-Aclippy::used_underscore_binding",

# Contract results are consumed through the generated client, and their
# failure modes are enumerated once in the Error enum rather than repeated
# in an # Errors section on every entrypoint.
"-Aclippy::must_use_candidate",
"-Aclippy::missing_errors_doc",

# Doc comments name Stellar and Soroban identifiers that are not Rust items.
"-Aclippy::doc_markdown",

# Style-only lints over the test module.
"-Aclippy::too_many_lines",
"-Aclippy::similar_names",
"-Aclippy::single_match_else",
"-Aclippy::unreadable_literal",
"-Aclippy::uninlined_format_args",
"-Aclippy::map_unwrap_or",
"-Aclippy::ignore_without_reason",
]
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,42 @@ several usernames, the primary one is returned.
- `404 Not Found`: Username not found for this address.
- `500 Internal Server Error`: Database lookup failed.

### `GET /users/:username/activity`
Returns the caller's own activity trail: registrations, transfers,
unregistrations, webhook creation and deletion, and blocks applied to their
address.

Ownership is proven the same way the webhook endpoints prove it. Sign the
message `activity:<username>` with the account key and send the base64
signature:

```bash
curl "http://localhost:5000/users/ada*localhost/activity?limit=20" \
-H "X-Stellar-Signature: <base64 signature>" \
-H "X-Stellar-Signer: <G... public key>"
```

The signature may also be sent in the request body as `signature` /
`signerAddress`, matching `GET /webhooks`.

- **Query Parameters:**
- `page` (optional) - 1-based page number, default 1.
- `limit` (optional) - rows per page, default 10, capped at 100.
- `startDate` / `endDate` (optional) - inclusive bounds on `created_at`.
- **Returns:** `{ data, meta: { total, page, limit, totalPages } }`, newest
first. Each row carries `id`, `action`, `metadata`, `ip_address` and
`created_at`.
- **Status Codes:**
- `200 OK`: Trail returned.
- `400 Bad Request`: Missing signature, or an unparseable/inverted date range.
- `401 Unauthorized`: The signature does not belong to the account behind the
username.
- `404 Not Found`: Username not registered.

Actions are namespaced: `user.registered`, `user.unregistered`,
`user.transferred`, `user.blocked`, `webhook.created`, `webhook.deleted`. Rows
are removed with the user, so a purge does not leave a trail behind.

### `GET /health`
Aggregates the status of every external dependency: PostgreSQL (a `SELECT 1`
through Prisma), Redis (`PING`) and Stellar Horizon (an HTTP request to
Expand Down
Loading
Loading