1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! Postage batch CRUD + stamp metadata. Mirrors `pkg/postage` in
//! bee-go.
//!
//! The endpoint methods live on [`PostageApi`] (get one from
//! [`crate::Client::postage`]). Pure stamp math — `get_stamp_cost`,
//! `get_stamp_effective_bytes`, etc. — is exposed as free functions
//! since it has no I/O.
//!
//! # Batch-usability delay
//!
//! A batch is not usable for uploads immediately after
//! [`PostageApi::create_postage_batch`] returns. Bee waits for N
//! confirmations of the purchase transaction (typically 8) before
//! flipping [`PostageBatch::usable`] to `true`. On Gnosis (5-second
//! blocks) this is ~40 s; on Sepolia (12-second blocks) it can be 2-3
//! minutes and occasionally longer.
//!
//! Poll [`PostageApi::get_postage_batch`] in a loop until `usable` is
//! true, or supply the batch via an environment variable so tests can
//! reuse a known-good batch. Uploading against a not-yet-usable batch
//! returns HTTP 422 "stamp not usable", surfaced as
//! [`crate::Error::Response`] with `status = 422`.
//!
//! # Dilute is one-way
//!
//! [`PostageApi::dilute_batch`] only allows depth to grow. Once a
//! batch's depth is increased its previously-issued stamps remain
//! valid; there is no way to shrink depth and reclaim funds.
use Arc;
use crateInner;
pub use ;
pub use ;
pub use ;
/// Handle exposing the postage endpoints. Cheap to clone.