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
14 changes: 7 additions & 7 deletions docs/core-concepts/data-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<!-- verification:
source_repo: ant-sdk
source_ref: main
source_commit: 4021000b552175394bcfe04f1c7712467887d539
verified_date: 2026-05-21
source_commit: 7a113b390522d76d28b8f3e5b4078f9c9418d46f
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->
<!-- verification:
source_repo: ant-client
source_ref: main
source_commit: 76763d686f6e2c27f3a4535146bbab8913190132
verified_date: 2026-05-21
source_commit: e67472424f94acd4b9188a342271210d4ab9f94d
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->
<!-- verification:
Expand Down Expand Up @@ -70,7 +70,7 @@ Public and private data are not two different low-level storage systems.
In the daemon APIs, you can see this difference clearly:

- `POST /v1/data/public` returns a public address
- `POST /v1/data/private` returns a serialized `DataMap`
- `POST /v1/data` returns a serialized `DataMap` (the DataMap is not stored on-network)

In both cases, the underlying content is still stored as chunks.

Expand Down Expand Up @@ -107,8 +107,8 @@ This is one of the main differences between public and private workflows.
The tooling maps cleanly onto these interfaces:

- use `POST /v1/data/public` or `client.data_put_public(...)` when you want the `DataMap` stored publicly and returned as an address
- use `POST /v1/data/private` or `client.data_put_private(...)` when you want the `DataMap` returned to you directly
- use `POST /v1/files/upload/public` or `ant file upload ... --public` when you want file content to be publicly retrievable
- use `POST /v1/data` or `client.data_put(...)` when you want the `DataMap` returned to you directly
- use `POST /v1/files/public` or `ant file upload ... --public` when you want file content to be publicly retrievable
- use `ant file upload ...` without `--public` when you want the CLI to keep the `.datamap` file locally instead

## Related pages
Expand Down
12 changes: 7 additions & 5 deletions docs/guides/build-read-only-features.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<!-- verification:
source_repo: ant-sdk
source_ref: main
source_commit: a3cf4e40052e3af8d1e8029ca0b3c97281d14108
verified_date: 2026-05-18
source_commit: 7a113b390522d76d28b8f3e5b4078f9c9418d46f
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->
<!-- verification:
source_repo: ant-client
source_ref: main
source_commit: 3df6764298b10dcc51287f43b1b5742a25785bff
verified_date: 2026-05-16
source_commit: e67472424f94acd4b9188a342271210d4ab9f94d
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->

Expand Down Expand Up @@ -77,7 +77,9 @@ curl http://localhost:8082/v1/data/public/<address>
Private retrieval through the daemon:

```bash
curl "http://localhost:8082/v1/data/private?data_map=<hex_encoded_datamap>"
curl -X POST http://localhost:8082/v1/data/get \
-H "Content-Type: application/json" \
-d '{"data_map":"<hex_encoded_datamap>"}'
```

The private retrieval response is JSON with the content returned as base64 in the `data` field.
Expand Down
20 changes: 11 additions & 9 deletions docs/guides/estimate-costs-and-handle-upload-payments.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!-- verification:
source_repo: ant-sdk
source_ref: main
source_commit: a3cf4e40052e3af8d1e8029ca0b3c97281d14108
verified_date: 2026-05-18
source_commit: 7a113b390522d76d28b8f3e5b4078f9c9418d46f
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->
<!-- verification:
Expand Down Expand Up @@ -196,14 +196,16 @@ main().catch((error) => {
{% endtab %}
{% tab title="Rust" %}
```rust
use antd_client::{Client, DEFAULT_BASE_URL};
use antd_client::{Client, DEFAULT_BASE_URL, PaymentMode};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(DEFAULT_BASE_URL);
let cost = client.data_cost(b"Hello, Autonomi!").await?;
let cost = client
.data_cost(b"Hello, Autonomi!", PaymentMode::Auto)
.await?;

println!("{}", cost);
println!("{}", cost.cost);
Ok(())
}
```
Expand Down Expand Up @@ -238,10 +240,10 @@ curl -X POST http://localhost:8082/v1/data/public \
{% endtab %}
{% tab title="Python" %}
```python
from antd import AntdClient
from antd import AntdClient, PaymentMode

client = AntdClient()
result = client.data_put_public(b"Hello, Autonomi!", payment_mode="merkle")
result = client.data_put_public(b"Hello, Autonomi!", payment_mode=PaymentMode.MERKLE)

print(result.address)
```
Expand All @@ -266,13 +268,13 @@ main().catch((error) => {
{% endtab %}
{% tab title="Rust" %}
```rust
use antd_client::{Client, DEFAULT_BASE_URL};
use antd_client::{Client, DEFAULT_BASE_URL, PaymentMode};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new(DEFAULT_BASE_URL);
let result = client
.data_put_public(b"Hello, Autonomi!", Some("merkle"))
.data_put_public(b"Hello, Autonomi!", PaymentMode::Merkle)
.await?;

println!("{}", result.address);
Expand Down
18 changes: 13 additions & 5 deletions docs/guides/test-your-application.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!-- verification:
source_repo: ant-sdk
source_ref: main
source_commit: a3cf4e40052e3af8d1e8029ca0b3c97281d14108
verified_date: 2026-05-18
source_commit: 7a113b390522d76d28b8f3e5b4078f9c9418d46f
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->
<!-- verification:
Expand Down Expand Up @@ -43,11 +43,15 @@ Mock the daemon client or direct-network wrapper at your application boundary.
{% tab title="Python" %}
```python
from unittest.mock import MagicMock
from antd import PutResult
from antd import DataPutPublicResult

def test_store_data():
mock_client = MagicMock()
mock_client.data_put_public.return_value = PutResult(cost="1", address="abc123")
mock_client.data_put_public.return_value = DataPutPublicResult(
address="abc123",
chunks_stored=1,
payment_mode_used="auto",
)

result = mock_client.data_put_public(b"test data")
assert result.address == "abc123"
Expand All @@ -60,7 +64,11 @@ import { describe, expect, it, vi } from "vitest";
describe("store data", () => {
it("returns an address", async () => {
const mockClient = {
dataPutPublic: vi.fn().mockResolvedValue({ cost: "1", address: "abc123" }),
dataPutPublic: vi.fn().mockResolvedValue({
address: "abc123",
chunksStored: 1,
paymentModeUsed: "auto",
}),
};

const result = await mockClient.dataPutPublic(Buffer.from("test data"));
Expand Down
19 changes: 10 additions & 9 deletions docs/mcp/mcp-server-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<!-- verification:
source_repo: ant-sdk
source_ref: main
source_commit: 4021000b552175394bcfe04f1c7712467887d539
verified_date: 2026-05-21
source_commit: 7a113b390522d76d28b8f3e5b4078f9c9418d46f
verified_date: 2026-05-26
verification_mode: current-merged-truth
-->

Expand Down Expand Up @@ -94,21 +94,21 @@ Retrieves text from the network by address or DataMap.

### Upload a File

**Tool:** `upload_file(path, payment_mode="auto")`
**Tool:** `upload_file(path, private=False, payment_mode="auto")`

Uploads a local file as public content.
Uploads a local file to the network. When `private=True`, the returned `address` is the caller-held DataMap and is not stored on-network. When `private=False` (default), the DataMap is stored on-network and `address` is the public retrieval address.

### Download a File

**Tool:** `download_file(address, dest_path)`
**Tool:** `download_file(address, dest_path, private=False)`

Downloads a public file to a local path.
Downloads a file to a local path. Pass the on-network address when `private=False` (default) or the caller-held DataMap when `private=True`.

### Estimate Cost

**Tool:** `get_cost(text=None, file_path=None)`
**Tool:** `get_cost(text=None, file_path=None, payment_mode="auto")`

Estimates storage cost for text or a local file path.
Estimates storage cost for text or a local file path. Pass `payment_mode` to reflect the cost of a specific payment strategy.

Provide exactly one of `text` or `file_path`.

Expand Down Expand Up @@ -248,7 +248,8 @@ Example `store_data` response:
```json
{
"address": "abc123...",
"cost": "1000000",
"chunks_stored": 1,
"payment_mode_used": "auto",
"network": "local"
}
```
Expand Down
Loading
Loading