| Crates.io | posemesh-domain-http |
| lib.rs | posemesh-domain-http |
| version | 1.5.1 |
| created_at | 2025-08-06 09:26:42.8635+00 |
| updated_at | 2026-01-13 01:54:05.871752+00 |
| description | HTTP client library for interacting with AukiLabs domain data services, supporting both native and WebAssembly targets. |
| homepage | |
| repository | https://github.com/aukilabs/posemesh/tree/main/core |
| max_upload_size | |
| id | 1783581 |
| size | 261,062 |
A cross-platform HTTP client library for interacting with posemesh domains on the Auki Network. Supports both native and WebAssembly (WASM) environments.
posemesh-domain-http supports multiple authentication methods, each providing different levels of access to domain data:
Key Features:
The client_id parameter must not be empty.
client_id.The purpose of client_id is to distinguish whether multiple accesses to a domain originate from the same client (for example, the same app instance on the same device). When this is the case, network credits will only be deducted once for repeated calls from the same client.
For more examples, check /src/domain_client.rs.
use posemesh_domain_http::{DomainClient, DownloadQuery, ListDomainsQuery};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = DomainClient::new_with_user_credential(
&api_url,
&dds_url,
&client_id,
&email,
&password,
true,
)?;
// List domains in the given organization, `all`, `own` or an organization id
let query = ListDomainsQuery { org: "own".to_string(), portal_id: None, portal_short_id: None };
let domains = client.list_domains(query)?;
println!("Domains: {:?}", domains);
// Download all data for a domain
let domain_id = "your-domain-id";
let download_query = DownloadQuery { ids: vec![], name: None, data_type: None };
let domain_data = client.download_domain_data(domain_id, download_query)?;
for data in domain_data {
println!("Data: {} ({} bytes)", data.metadata.name, data.metadata.size);
}
Ok(())
}
For more examples, check /bindings/python/tests/test_basic.py.
from auki_domain_client import DomainClient, DownloadQuery, ListDomainsQuery
import os
# Authenticate using user credentials (with password recall)
client = DomainClient.new_with_user_credential(
api_url, dds_url, client_id, email, password, True
)
# List domains in the given organization, `all`, `own` or an organization id
query = ListDomainsQuery(org="own", portal_id=None, portal_short_id=None)
response = client.list_domains(query)
print("Domains:", response.domains)
# Download domain data
domain_id = "your-domain-id"
download_query = DownloadQuery(
ids=[], # All data
name=None,
data_type=None,
)
domain_data = client.download_domain_data(domain_id, download_query)
for data in domain_data:
print(f"Name: {data.metadata['name']}, Size: {data.metadata['size']}")
For more examples, check /bindings/javascript/tests/basic.test.ts
import { DomainClient, DownloadQuery, ListDomainsQuery } from "@auki/domain-client";
// Authenticate using user credentials
const client = await DomainClient.new_with_user_credential(
apiUrl,
ddsUrl,
clientId,
email,
password,
true // remember password
);
// List domains in the given organization, `all`, `own` or an organization id
const response = await client.listDomains({org: "own"});
console.log("Domains:", response.domains);
// Download domain data
const domainId = "your-domain-id";
const domainData = await client.downloadDomainData(domainId, {ids:[]});
domainData.forEach((data) => {
console.log(`Name: ${data.metadata.name}, Size: ${data.metadata.size}`);
});
See CHANGELOG.md for a list of features, bug fixes, and breaking changes.
To build the domain-http crate locally for different platforms and for WebAssembly (WASM), follow these instructions:
From the repository root, run:
cargo build -p posemesh-domain-http --release
For cross-compiling, use cross. Install cross if you don't already have it:
cargo install cross
Then, build for your desired target. For example, to build for ARM64 Linux:
cross build -p posemesh-domain-http --release --target aarch64-unknown-linux-gnu
Replace aarch64-unknown-linux-gnu with the appropriate Rust target triple for your platform.
use the provided Makefile task:
make build-domain-http TARGET=wasm
This will produce the WASM package in domain-http/bindings/javascript/pkg.
make build-domain-http TARGET=python
This will produce the python package in domain-http/bindings/python/.venv/lib/auki_domain_client.
rustup target add wasm32-unknown-unknown
To run all tests (including both Rust and JS/WASM tests), use:
make unit-tests
This will run all unit and integration tests for both the Rust crate and the JavaScript/WASM package.
To publish a new version of this crate, follow these steps:
Update the Version in Cargo.toml
Cargo.toml to an unstable version suffix, such as:
1.5.0-alpha.11.5.0-beta.11.5.0-rc.11.5.0, with no - suffix) are published to crates.io by CI.1.5.0).README.md with the changes for the new release.Committing & PR
Publishing
Contributions are welcome! Please ensure that all tests pass before submitting a pull request.