Skip to content

Commit

Permalink
build: Fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
robdmoore committed Dec 4, 2023
1 parent 9cd89fb commit 8df0511
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 38 deletions.
32 changes: 15 additions & 17 deletions docs/code/interfaces/types_subscription.SubscriptionConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The set of events to subscribe to / emit

[types/subscription.ts:106](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L106)

---
___

### frequencyInSeconds

Expand All @@ -40,7 +40,7 @@ The frequency to poll for new blocks in seconds

[types/subscription.ts:102](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L102)

---
___

### maxRoundsToSync

Expand All @@ -52,29 +52,27 @@ The maximum number of rounds to sync at a time.

[types/subscription.ts:104](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L104)

---
___

### syncBehaviour

**syncBehaviour**: `"skip-sync-newest"` \| `"sync-oldest"` \| `"sync-oldest-start-now"` \| `"catchup-with-indexer"`
**syncBehaviour**: ``"skip-sync-newest"`` \| ``"sync-oldest"`` \| ``"sync-oldest-start-now"`` \| ``"catchup-with-indexer"``

The behaviour when the number of rounds to sync is greater than `maxRoundsToSync`:
* `skip-sync-newest`: Discard old rounds
* `sync-oldest`: Sync from the oldest records up to `maxRoundsToSync` rounds.

- `skip-sync-newest`: Discard old rounds
- `sync-oldest`: Sync from the oldest records up to `maxRoundsToSync` rounds.

**Note:** will be slow to catch up if sync is significantly behind the tip of the chain

- `sync-oldest-start-now`: Sync from the oldest records up to `maxRoundsToSync` rounds, unless
current watermark is `0` in which case it will start `maxRoundsToSync` back from the tip of the chain.
- `catchup-with-indexer`: Will catch up to `tipOfTheChain - maxRoundsToSync` using indexer (fast) and then
continue with algod.
**Note:** will be slow to catch up if sync is significantly behind the tip of the chain
* `sync-oldest-start-now`: Sync from the oldest records up to `maxRoundsToSync` rounds, unless
current watermark is `0` in which case it will start `maxRoundsToSync` back from the tip of the chain.
* `catchup-with-indexer`: Will catch up to `tipOfTheChain - maxRoundsToSync` using indexer (fast) and then
continue with algod.

#### Defined in

[types/subscription.ts:117](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L117)

---
___

### watermarkPersistence

Expand All @@ -85,9 +83,9 @@ its position in the chain.

#### Type declaration

| Name | Type |
| :---- | :------------------------------------------------ |
| `get` | () => `Promise`\<`number`\> |
| Name | Type |
| :------ | :------ |
| `get` | () => `Promise`\<`number`\> |
| `set` | (`newWatermark`: `number`) => `Promise`\<`void`\> |

#### Defined in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The filter to apply to find transactions of interest.

[types/subscription.ts:7](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L7)

---
___

### maxRoundsToSync

Expand All @@ -43,35 +43,34 @@ your catchup speed when using `sync-oldest`.

[types/subscription.ts:25](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L25)

---
___

### syncBehaviour

**syncBehaviour**: `"skip-sync-newest"` \| `"sync-oldest"` \| `"sync-oldest-start-now"` \| `"catchup-with-indexer"` \| `"fail"`
**syncBehaviour**: ``"skip-sync-newest"`` \| ``"sync-oldest"`` \| ``"sync-oldest-start-now"`` \| ``"catchup-with-indexer"`` \| ``"fail"``

If the current tip of the configured Algorand blockchain is more than `maxRoundsToSync`
past `watermark` then how should that be handled:

- `skip-sync-newest`: Discard old blocks/transactions and sync the newest; useful
for real-time notification scenarios where you don't care about history and
are happy to lose old transactions.
- `sync-oldest`: Sync from the oldest rounds forward `maxRoundsToSync` rounds
using algod; note: this will be slow if you are starting from 0 and requires
an archival node.
- `sync-oldest-start-now`: Same as `sync-oldest`, but if the `watermark` is `0`
then start at the current round i.e. don't sync historical records, but once
subscribing starts sync everything; note: if it falls behind it requires an
archival node.
- `catchup-with-indexer`: Sync to round `currentRound - maxRoundsToSync + 1`
using indexer (much faster than using algod for long time periods) and then
use algod from there.
- `fail`: Throw an error.
* `skip-sync-newest`: Discard old blocks/transactions and sync the newest; useful
for real-time notification scenarios where you don't care about history and
are happy to lose old transactions.
* `sync-oldest`: Sync from the oldest rounds forward `maxRoundsToSync` rounds
using algod; note: this will be slow if you are starting from 0 and requires
an archival node.
* `sync-oldest-start-now`: Same as `sync-oldest`, but if the `watermark` is `0`
then start at the current round i.e. don't sync historical records, but once
subscribing starts sync everything; note: if it falls behind it requires an
archival node.
* `catchup-with-indexer`: Sync to round `currentRound - maxRoundsToSync + 1`
using indexer (much faster than using algod for long time periods) and then
use algod from there.
* `fail`: Throw an error.

#### Defined in

[types/subscription.ts:43](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/types/subscription.ts#L43)

---
___

### watermark

Expand Down
2 changes: 1 addition & 1 deletion docs/code/modules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ The blocks

#### Defined in

[subscriptions.ts:261](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/subscriptions.ts#L261)
[subscriptions.ts:262](https://github.com/algorandfoundation/algokit-subscriber-ts/blob/main/src/subscriptions.ts#L262)

___

Expand Down
2 changes: 1 addition & 1 deletion examples/xgov-voting/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ async function getXGovSubscriber() {
// eslint-disable-next-line no-console
subscriber.on('xgov-vote', (event) => {
const abiUint64Array = new ABIArrayDynamicType(new ABIUintType(64))
const votes = abiUint64Array.decode(Buffer.from(event['application-transaction']['application-args'][4], 'base64'))
const votes = abiUint64Array.decode(Buffer.from(event!['application-transaction']!['application-args']![4], 'base64'))
// eslint-disable-next-line no-console
console.log(`${event.sender} voted with txn ${event.id} with votes:`, votes)
})
Expand Down

0 comments on commit 8df0511

Please sign in to comment.