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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,6 @@ __marimo__/
# Docker volumes for Status
data/
*.bkp
# Status Backend builds
status-backend-bundle/
*/status-go
217 changes: 217 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
# Changelog

All notable changes to `status-python-sdk` will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2026-09-22

### Added

- Build and launch [status-go] locally / inside already existing Docker container. Requires [nix] and [git] set up.
- Download build and launch [status-go] locally / inside already existing Docker container.
- `class Account` has new property `status_go_commit_sha`

### Fixed

- Image RPC call for getting the current `profile_picture` returned `None` instead of an empty `list`.
- If no `commit` is passed to `launch_docker_container`, the latest commit from the `develop` branch is now used.

### Removed

- Remove `can_post` check when sending community messages, reducing RPC calls to [status-go] to prevent it from crashing under heavy use. A custom error is now raised instead if the user lacks privileges to send messages in the channel.

## [1.1.6] - 2026-09-09

### Fixed

- Real time
- `def listen_messages` monitors [status-go] property `messages` only instead of `messages` and `chats`
- Unfiltered messages will return `dict` only instead of `dict` or `list[dict]`

## [1.1.5] - 2026-09-09

### Fixed

- Real time
- `def listen_messages` returns a single `Message` with multiple images, instead of a `Message` per image
- Remove duplicated [status-go] signals that have already been yielded

## [1.1.4] - 2026-09-09

### Added

- Real time
- User removes the account from their contacts
- Listen for bridged messages
- `class Channel`
- move position up and down
- change current category
- add and delete member permissions
- Send bridged messages
- `class Account`
- `class GroupChat`
- `class Channel`

### Fixed

- `account.add_contact` accepting a friend request via `wakuext_addContact` no longer sends the user "Please add me to your contacts."
- Sending a reply to a message returns the ID of the sent message instead of the replied-to message's ID
- `docker-compose.yaml` ENV parameters match the ones used in `launch_docker_container`
- Data class `Message` supports bridged messages
- `listen_messages` would break if an unhandled `content_type` was found

### Removed

- `class Logger` has been deprecated. Logger config must be set outside of `status-sdk` with `logging.basicConfig`.

### Changed

- Property `state` in data class `CommunityRequest` has been replaced with boolean values `pending`, `reject`, `accept` and `cancel`.

## [1.1.3] - 2026-08-26

### Added

- Emoji Reactions
- `class Account`
- `class GroupChat`
- `class Channel`
- Real time
- Listen for message mentions
- Accepted contact requests

### Changed

- Real time listening will return custom `dataclass` instead of `dict`
- Internal `class Signal` can now listen for multiple signal types at once, or leave them unfiltered to listen for all

## [1.1.2] - 2026-08-18

### Added

- Block / Unblock contacts from `class Account`

### Changed

- Deleted messages would be flagged as deleted but not removed from the internal [status-go] database.
- `class Account` no longer logs out an already logged in account on initialization. Calling `def login` with the same account continues normally; calling it with a different account logs out the original one first.
- `get_messages` supports `str` in format `YYYY-MM-DD`

## [1.1.1] - 2026-08-12

### Added

- Send images
- `class Account`
- `class GroupChat`
- `class Channel`
- Listen for new contact requests in real time
- Swap Community Control Nodes between Status App and [status-go]
- New `launch_docker_container` property
- Add `data_folder` to `class Community`
- Get community collectables

### Fixed

- Centre `profile_picture` when setting the value

### Changed

- `login` functionality in `class Account` supports Keccak-256 hash if the `data` folder has been copied over from another Status instance ([status-go] or Status App)

will try to log in without a hashed password

## [1.1.0] - 2026-08-04

### Added

- Convert Chat Key (`compressed_key`) and URL (`url`) to Status App `public_key`
- Get and set current status of the logged in account
- Support async signal fetching
- Sync `status-im/status-python-sdk` with Status App via **Installation ID**
- Create `class GroupChat`
- Create chat
- Leave chat
- Edit chat name
- Edit Group Picture
- Add member
- Remove member
- Get current chat members
- Support messaging similar to `class Account`
- Create `class Community`
- Kick member
- Ban member
- Unban previously banned members
- Leave
- Accept new member
- Decline new member
- Get members
- Current channels (community chats)
- Create `class Channel`
- Create chat
- Delete chat
- Get messages
- Send messages
- Delete messages
- Properties
- Name - get and set
- Colour - get and set
- Description - get and set
- Emoji - get and set


### Removed

- `class Account` properties
- `community_members`

## [1.0.0] - 2026-07-15

### Added

- Create initial design of `class Account`
- Create account
- Log in
- Account recovery - load and create `.bkp` files
- Log out
- Send friend request
- Accept friend request - when the bot and the user have sent a friend request
- Decline friend request
- Send community join request
- Messaging
- Read messages from given start and end timestamps
- Read new messages in real time
- Send message
- Properties
- Overall account information
- Contacts the bot has seen
- Communities the bot has access to
- Chats the bot has access to
- Display Name - get and set
- Bio - get and set
- Profile Picture - get and set
- Wallet
- Get account balance
- Get market information
- Get transactions
- Send crypto
- Swap crypto
- ETH to ERC-20
- ERC-20 to ETH
- ERC-20 to ERC-20
- Launch [status-go] Docker container with Python instead of manual `docker compose up -d` setup.
- Custom library errors

[1.2.0]: https://github.com/status-im/status-python-sdk/releases/tag/1.2.0
[1.1.6]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.6
[1.1.5]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.5
[1.1.4]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.4
[1.1.3]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.3
[1.1.2]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.2
[1.1.1]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.1
[1.1.0]: https://github.com/status-im/status-python-sdk/releases/tag/1.1.0
[1.0.0]: https://github.com/status-im/status-python-sdk/releases/tag/1.0.0

[nix]: https://nixos.org/
[git]: https://git-scm.com/
[status-go]: https://github.com/status-im/status-go
[status-backend]: https://github.com/status-im/status-go
32 changes: 32 additions & 0 deletions docs/account.md
Original file line number Diff line number Diff line change
Expand Up @@ -1811,6 +1811,38 @@ account.logger.warning("This is a warning")
account.logger.error("Something went wrong")
```

### `status_go_commit_sha`

Which build of [`status-im/status-go`](https://github.com/status-im/status-go) the connected Status Backend is running. Use it when reporting an issue, and to confirm that the backend you are talking to is the commit you meant to launch.

Returns `str`. The value is read from the backend's health endpoint when the `Account` is created, so it describes the backend that was running **at that moment** - relaunching the backend on a different commit is not picked up until a new `Account` is created.

The exact shape depends on how the backend was launched:

| Launched with | Reported version | `status_go_commit_sha` |
|--------|--------|-------------|
| [`build_and_launch`](./utils.md#build_and_launchcommitnone-repo_dirnone-addresslocalhost8080-wait_seconds30-install_depstrue) / [`download_build_and_launch`](./utils.md#download_build_and_launchfile_namenone-repo_namestatus-imstatus-go-tagnone-tokennone-addresslocalhost8080-wait_seconds30) | `v10.35.0-48-g9f09f9027` | `9f09f9027` - the short SHA, taken out of the `git describe` version |
| [`launch_docker_container`](./utils.md#launch_docker_containercommitnone-wait_seconds5-platformlinuxamd64-data_foldernone) | `9f09f902762292fbe8264dd75a68e739ecd17444` | the same value, unchanged |

The two differ because a native build is compiled inside a git clone, so `status-go` embeds a `git describe` version that the SDK extracts the SHA from. The Docker image is built from a git **context** that carries no `.git` folder, so `docker-compose.yaml` injects the ref it was told to build instead - meaning the full SHA comes back as-is.

```python
from status_sdk import Account

account = Account()
print(f"status-go: {account.status_go_commit_sha}")
```

Include it, together with [`__version__`](./utils.md#__version__), when [reporting an issue](https://github.com/status-im/status-python-sdk/issues):

```python
import status_sdk
from status_sdk import Account

account = Account()
print(f"status-sdk {status_sdk.__version__} / status-go {account.status_go_commit_sha}")
```

### Chat

#### `contacts`
Expand Down
106 changes: 106 additions & 0 deletions docs/utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,112 @@ sudo chown -R $USER:$USER /path/to/status_sdk
sudo chmod -R a+rw /path/to/status_sdk
```

### `build_and_launch(commit=None, repo_dir=None, address="localhost:8080", wait_seconds=30, install_deps=True)`

Build `status-backend` **natively** from a local clone of [`status-im/status-go`](https://github.com/status-im/status-go), then run it as a normal process on your machine. This is the **alternative to [`launch_docker_container`](./utils.md#launch_docker_containercommitnone-wait_seconds5-platformlinuxamd64-data_foldernone)** for setups without Docker. Everything else in the SDK works the same afterwards - [`Account`](./account.md) talks to the backend over HTTP either way.

| | [`launch_docker_container`](./utils.md#launch_docker_containercommitnone-wait_seconds5-platformlinuxamd64-data_foldernone) | `build_and_launch` |
|---|---|---|
| Needs | Docker (and WSL on Windows) | Nix and `git` |
| Windows | Supported | **Not supported** - use Docker, or run from inside WSL |
| Backend runs as | A container | A process on your machine |
| Stopping it | `docker compose down` | Terminate the returned process |

The build runs inside the repository's **Nix dev shell**, so the Go toolchain and every build dependency come from Nix rather than your system - nothing has to be installed by hand beyond Nix itself.

| Name | Type | Required | Description |
|-----|-----|-----|-------------|
| `commit` | `str` | No | The `status-im/status-go` git commit SHA,. When omitted, the latest `develop` branch is built. |
| `repo_dir` | `str` | No | Local folder to clone `status-go` into, and reuse on later calls. Defaults to a `status-go` folder next to this package's installation. When the folder does not already hold a clone, the repository is fetched from GitHub. |
| `address` | `str` | No | The `host:port` to run `status-backend` on. Defaults to `localhost:8080`, which matches the defaults of [`Account`](./account.md#accountdomainlocalhost-backend_port8080-media_port9000-is_securefalse-backup_foldernone-volume_foldernone). If you change it, pass the matching `domain` and `backend_port` when creating the `Account`. |
| `wait_seconds` | `int` | No | How long to poll the backend's `/health` endpoint before giving up, in seconds. Defaults to `30`. **The build itself is not subject to this timeout** - only the startup that follows it. |
| `install_deps` | `bool` | No | Whether to run `make status-go-deps` before building. This also runs `go clean -cache` and `go clean -modcache`, which throws away every cached Go build on your machine and makes the next build much slower. Only needed on a first build or after a Go toolchain upgrade. |

```python
from status_sdk import build_and_launch, Account

# First run clones status-go and builds it - this takes a while
process = build_and_launch()

account = Account()
params = {
"name": "status-app-bot",
"password": "SNTPUMP"
}
account.login(**params)

print(account.info["public_key"])

# Stop the backend when you are done
process.terminate()
```

Build a specific ref into a folder of your choosing:

```python
from status_sdk import build_and_launch

build_and_launch(
commit="2bee8b6a38cdc8f92d74e2dbb8c4e77fbbeea149",
repo_dir="/home/thedatabro/src/status-go"
)
```

Run on a different port, and point the `Account` at it:

```python
from status_sdk import build_and_launch, Account

build_and_launch(address="localhost:9500", wait_seconds=60)
account = Account(backend_port=9500)
```

### `download_build_and_launch(file_name=None, repo_name="status-im/status-go", tag=None, token=None, address="localhost:8080", wait_seconds=30)`

Download a prebuilt `status-backend` bundle from a GitHub release and launch it. This is an **alternative to [`build_and_launch`](./utils.md#build_and_launchcommitnone-repo_dirnone-addresslocalhost8080-wait_seconds30-install_depstrue)** for setups that do not want to build [`status-im/status-go`](https://github.com/status-im/status-go) from source.

| Name | Type | Required | Description |
|-----|-----|-----|-------------|
| `file_name` | `str` | No | The release asset to download, exactly as it appears on the release page. When omitted, the asset matching this machine is picked using the pattern `status-backend_{platform}_{arch}_{version}`, e.g. `status-backend_linux_x86_64_2.34.0`. |
| `repo_name` | `str` | No | The `owner/name` of the repository to pull the release from. Defaults to `status-im/status-go`. |
| `tag` | `str` | No | A release tag. When omitted, the latest release is used. |
| `token` | `str` | No | A GitHub token. Required for private repositories. |
| `address` | `str` | No | The `host:port` to run `status-backend` on. Defaults to `localhost:8080`, which matches the defaults of [`Account`](./account.md#accountdomainlocalhost-backend_port8080-media_port9000-is_securefalse-backup_foldernone-volume_foldernone). If you change it, pass the matching `domain` and `backend_port` when creating the `Account`. |
| `wait_seconds` | `int` | No | How long to poll the backend's `/health` endpoint before giving up, in seconds. Defaults to `30`. **Downloading itself is not subject to this timeout** - only the startup that follows it. |

The bundle is extracted into a `status-backend-bundle` folder in the current working directory, and reused on later calls instead of downloading again.

```python
from status_sdk import download_build_and_launch, Account

# Downloads the latest release's asset matching this machine
download_build_and_launch()

account = Account()
params = {
"name": "status-app-bot",
"password": "SNTPUMP"
}
account.login(**params)

print(account.info["public_key"])

# Stop the backend when you are done
process.terminate()
```

Download a specific release tag from a private repository:

```python
from status_sdk import download_build_and_launch

download_build_and_launch(
repo_name="status-im/status-go",
tag="v2.34.0",
token="ghp_xxxxxxxxxxxxxxxxxxxx"
)
```

## Properties

### `__version__`
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "status-sdk"
version = "1.1.6"
version = "1.2.0"
description = "Private chat. Communities. Multi-chain wallet. Browser. dApps all in one app, powered by SNT."
readme = "README.md"
requires-python = ">=3.11"
Expand Down
2 changes: 1 addition & 1 deletion status_sdk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .account import Account
from .group_chat import GroupChat
from .community.base import Community, Channel
from .utils import launch_docker_container
from .utils import launch_docker_container, build_and_launch, download_build_and_launch
from . import exceptions, models

try:
Expand Down
Loading
Loading