Skip to content

Commit

Permalink
Update and modify files for the project
Browse files Browse the repository at this point in the history
- Updated files:
  - pdm.lock
  - src/bee_py/bee.py
  • Loading branch information
Aviksaikat committed Jan 10, 2024
1 parent 28834de commit 0949406
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions src/bee_py/bee.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
JsonFeedOptions,
NumberString,
Pin,
PostageBatch,
PostageBatchOptions,
PssMessageHandler,
PssSubscription,
Expand Down Expand Up @@ -1536,6 +1537,33 @@ def is_connected(self, options: Optional[BeeRequestOptions] = None) -> bool:
return False
return True

def get_postage_batch(
self,
postage_batch_id: Union[BatchId, str],
options: Optional[Union[BeeRequestOptions, dict]] = None,
) -> PostageBatch:
"""Retrieves details for a specific postage batch.
Args:
postage_batch_id: The ID of the batch to retrieve.
options: Optional request options to customize the request.
Returns:
The details of the postage batch.
Raises:
ValueError: If the batch ID is invalid.
See Also:
- Bee docs: https://docs.ethswarm.org/docs/access-the-swarm/keep-your-data-alive
- Bee Debug API reference: https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{id}/get
"""

assert_request_options(options)
assert_batch_id(postage_batch_id)

return stamps.get_postage_batch(self.__get_request_options_for_call(options), postage_batch_id) # type: ignore

def wait_for_usable_postage_stamp(self, batch_id: Union[BatchId, str], timeout: int = 120_000) -> None:
"""Waits for a postage stamp with the given batch ID to become usable.
Expand Down

0 comments on commit 0949406

Please sign in to comment.