pub struct PostageApi { /* private fields */ }Expand description
Handle exposing the postage endpoints. Cheap to clone.
Implementations§
Source§impl PostageApi
impl PostageApi
Sourcepub async fn get_postage_batches(&self) -> Result<Vec<PostageBatch>, Error>
pub async fn get_postage_batches(&self) -> Result<Vec<PostageBatch>, Error>
Every postage batch owned by this node — GET /stamps.
Sourcepub async fn get_postage_batch(
&self,
batch_id: &BatchId,
) -> Result<PostageBatch, Error>
pub async fn get_postage_batch( &self, batch_id: &BatchId, ) -> Result<PostageBatch, Error>
Single owned batch by id — GET /stamps/{id}.
Sourcepub async fn get_postage_batch_buckets(
&self,
batch_id: &BatchId,
) -> Result<PostageBatchBuckets, Error>
pub async fn get_postage_batch_buckets( &self, batch_id: &BatchId, ) -> Result<PostageBatchBuckets, Error>
Per-bucket collision stats — GET /stamps/{id}/buckets.
Sourcepub async fn get_global_postage_batches(
&self,
) -> Result<Vec<GlobalPostageBatch>, Error>
pub async fn get_global_postage_batches( &self, ) -> Result<Vec<GlobalPostageBatch>, Error>
Every chain-visible postage batch — GET /batches. Returns the
chain-wide view (no owner-only fields).
Sourcepub async fn create_postage_batch(
&self,
amount: &BigInt,
depth: u8,
label: Option<&str>,
) -> Result<BatchId, Error>
pub async fn create_postage_batch( &self, amount: &BigInt, depth: u8, label: Option<&str>, ) -> Result<BatchId, Error>
Buy a new postage batch — POST /stamps/{amount}/{depth}.
Returns the freshly-minted BatchId.
Sourcepub async fn create_postage_batch_with_options(
&self,
amount: &BigInt,
depth: u8,
opts: Option<&PostageBatchOptions>,
) -> Result<BatchId, Error>
pub async fn create_postage_batch_with_options( &self, amount: &BigInt, depth: u8, opts: Option<&PostageBatchOptions>, ) -> Result<BatchId, Error>
Buy a new postage batch with full options support. Mirrors
bee-js Bee.createPostageBatch and bee-go’s options-style
constructor — label and immutable map to query parameters,
gas_price / gas_limit map to Gas-Price / Gas-Limit headers.
Trait Implementations§
Source§impl Clone for PostageApi
impl Clone for PostageApi
Source§fn clone(&self) -> PostageApi
fn clone(&self) -> PostageApi
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PostageApi
impl !RefUnwindSafe for PostageApi
impl Send for PostageApi
impl Sync for PostageApi
impl Unpin for PostageApi
impl UnsafeUnpin for PostageApi
impl !UnwindSafe for PostageApi
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more