Skip to content

Commit

Permalink
algokit_subscriber_py -> algokit_subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
joe-p committed Oct 2, 2024
1 parent 1934627 commit 5bf87fe
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions docs/api.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# API Reference

```{py:module} algokit_subscriber_py
```{py:module} algokit_subscriber
:no-index:
```

```{autodoc2-docstring} algokit_subscriber_py
```{autodoc2-docstring} algokit_subscriber
:allowtitles:
```

Expand All @@ -14,5 +14,5 @@
:titlesonly:
:maxdepth: 2
apidocs/algokit_subscriber_py/algokit_subscriber_py
apidocs/algokit_subscriber/algokit_subscriber
```
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
# -- Options for autodoc2
autodoc2_packages = [
{
"path": "../src/algokit_subscriber_py",
"path": "../src/algokit_subscriber",
"auto_mode": True,
},
]
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

```{testcode}
# Import necessary modules
from algokit_subscriber_py import AlgorandSubscriber
from algokit_subscriber import AlgorandSubscriber
from algosdk.v2client import algod
from algokit_utils import get_algod_client, get_algonode_config
Expand Down
2 changes: 1 addition & 1 deletion docs/subscriber.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ If you call `on_batch` it will be called first, with the full set of transaction
The default type that will be received is a `SubscribedTransaction`, which can be imported like so:

```python
from algokit_subscriber_py import SubscribedTransaction
from algokit_subscriber import SubscribedTransaction
```

See the [detail about this type](subscriptions.md#subscribedtransaction).
Expand Down
8 changes: 4 additions & 4 deletions docs/subscriptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ class BlockMetadata(TypedDict):
The common model used to expose a transaction that is returned from a subscription is a `SubscribedTransaction`, which can be imported like so:

```python
from algokit_subscriber_py import SubscribedTransaction
from algokit_subscriber import SubscribedTransaction
```

This type is substantively, based on the Indexer [`TransactionResult`](/~https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/types/indexer.ts#L77) [model](https://developer.algorand.org/docs/rest-apis/indexer/#transaction) format. While the indexer type is used, the subscriber itself doesn't have to use indexer - any transactions it retrieves from algod are transformed to this common model type. Beyond the indexer type it has some modifications to:
Expand Down Expand Up @@ -389,7 +389,7 @@ If you ran the following code on a cron schedule of (say) every 5 seconds it wou
it would drop old records and restart notifications from the new tip.

```python
from algokit_subscriber_py import AlgorandSubscriber, SubscribedTransaction
from algokit_subscriber import AlgorandSubscriber, SubscribedTransaction
from algokit_utils.beta.algorand_client import AlgorandClient

algorand = AlgorandClient.test_net()
Expand Down Expand Up @@ -434,7 +434,7 @@ If you ran the following code on a cron schedule of (say) every 5 seconds it wou
it would pick up where it left off and catch up using algod (note: you need to connect it to a archival node).

```python
from algokit_subscriber_py import AlgorandSubscriber, SubscribedTransaction
from algokit_subscriber import AlgorandSubscriber, SubscribedTransaction
from algokit_utils.beta.algorand_client import AlgorandClient

algorand = AlgorandClient.test_net()
Expand Down Expand Up @@ -478,7 +478,7 @@ subscriber.start()
If you ran the following code on a cron schedule of (say) every 30 - 60 seconds it would create a cached index of all assets created by the account (in this case the Data History Museum TestNet account `ER7AMZRPD5KDVFWTUUVOADSOWM4RQKEEV2EDYRVSA757UHXOIEKGMBQIVU`). Given it uses indexer to catch up you can deploy this into a fresh environment with an empty database and it will catch up in seconds rather than days.

```python
from algokit_subscriber_py import AlgorandSubscriber, SubscribedTransaction
from algokit_subscriber import AlgorandSubscriber, SubscribedTransaction
from algokit_utils.beta.algorand_client import AlgorandClient

algorand = AlgorandClient.test_net()
Expand Down

0 comments on commit 5bf87fe

Please sign in to comment.