types/subscription
types/subscription
Section titled “types/subscription”Enumerations
Section titled “Enumerations”BalanceChangeRole
Section titled “BalanceChangeRole”Defined in: src/types/subscription.ts:212
The role that an account was playing for a given balance change.
Enumeration Members
Section titled “Enumeration Members”| Enumeration Member | Value | Description | Defined in |
|---|---|---|---|
AssetCreator | "AssetCreator" | Account was creating an asset and holds the full asset supply | src/types/subscription.ts:220 |
AssetDestroyer | "AssetDestroyer" | Account was destroying an asset and has removed the full asset supply from circulation. A balance change with this role will always have a 0 amount and use the asset manager address. | src/types/subscription.ts:224 |
CloseTo | "CloseTo" | Account was having an asset amount closed to it | src/types/subscription.ts:218 |
Receiver | "Receiver" | Account was receiving a transaction | src/types/subscription.ts:216 |
Sender | "Sender" | Account was sending a transaction (sending asset and/or spending fee if asset 0) | src/types/subscription.ts:214 |
Classes
Section titled “Classes”SubscribedTransaction
Section titled “SubscribedTransaction”Defined in: src/types/subscription.ts:163
The common model used to expose a transaction that is returned from a subscription.
Substantively, based on the Indexer TransactionResult model format with some modifications to:
- Add the
parentTransactionIdfield so inner transactions have a reference to their parent - Override the type of
inner-txnsto beSubscribedTransaction[]so inner transactions (recursively) get these extra fields too - Add emitted ARC-28 events via
arc28Events - Balance changes in algo or assets
Extends
Section titled “Extends”Transaction
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SubscribedTransaction(
__namedParameters):SubscribedTransaction
Defined in: src/types/subscription.ts:178
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters | Omit<SubscribedTransaction, "getEncodingSchema" | "toEncodingData"> |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”algosdk.indexerModels.Transaction.constructor
Properties
Section titled “Properties”| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
applicationTransaction? | TransactionApplication | Fields for application transactions. Definition: data/transactions/application.go : ApplicationCallTxnFields | - | algosdk.indexerModels.Transaction.applicationTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2176 |
arc28Events? | EmittedArc28Event[] | Any ARC-28 events emitted from an app call. | - | - | src/types/subscription.ts:172 |
assetConfigTransaction? | TransactionAssetConfig | Fields for asset allocation, re-configuration, and destruction. A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction. Definition: data/transactions/asset.go : AssetConfigTxnFields | - | algosdk.indexerModels.Transaction.assetConfigTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2184 |
assetFreezeTransaction? | TransactionAssetFreeze | Fields for an asset freeze transaction. Definition: data/transactions/asset.go : AssetFreezeTxnFields | - | algosdk.indexerModels.Transaction.assetFreezeTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2190 |
assetTransferTransaction? | TransactionAssetTransfer | Fields for an asset transfer transaction. Definition: data/transactions/asset.go : AssetTransferTxnFields | - | algosdk.indexerModels.Transaction.assetTransferTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2196 |
authAddr? | Address | (sgnr) this is included with signed transactions when the signing address does not equal the sender. The backend can use this to ensure that auth addr is equal to the accounts auth addr. | - | algosdk.indexerModels.Transaction.authAddr | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2202 |
balanceChanges? | BalanceChange[] | The balance changes in the transaction. | - | - | src/types/subscription.ts:176 |
closeRewards? | bigint | (rc) rewards applied to close-remainder-to account. | - | algosdk.indexerModels.Transaction.closeRewards | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2206 |
closingAmount? | bigint | (ca) closing amount for transaction. | - | algosdk.indexerModels.Transaction.closingAmount | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2210 |
confirmedRound? | bigint | Round when the transaction was confirmed. | - | algosdk.indexerModels.Transaction.confirmedRound | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2214 |
createdApplicationIndex? | bigint | Specifies an application index (ID) if an application was created with this transaction. | - | algosdk.indexerModels.Transaction.createdApplicationIndex | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2219 |
createdAssetIndex? | bigint | Specifies an asset index (ID) if an asset was created with this transaction. | - | algosdk.indexerModels.Transaction.createdAssetIndex | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2223 |
fee | bigint | (fee) Transaction fee. | - | algosdk.indexerModels.Transaction.fee | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2158 |
filtersMatched? | string[] | The names of any filters that matched the given transaction to result in it being ‘subscribed’. | - | - | src/types/subscription.ts:174 |
firstValid | bigint | (fv) First valid round for this transaction. | - | algosdk.indexerModels.Transaction.firstValid | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2162 |
genesisHash? | Uint8Array | (gh) Hash of genesis block. | - | algosdk.indexerModels.Transaction.genesisHash | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2227 |
genesisId? | string | (gen) genesis block ID. | - | algosdk.indexerModels.Transaction.genesisId | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2231 |
globalStateDelta? | EvalDeltaKeyValue[] | (gd) Global state key/value changes for the application being executed by this transaction. | - | algosdk.indexerModels.Transaction.globalStateDelta | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2236 |
group? | Uint8Array | (grp) Base64 encoded byte array of a sha512/256 digest. When present indicates that this transaction is part of a transaction group and the value is the sha512/256 hash of the transactions in that group. | - | algosdk.indexerModels.Transaction.group | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2242 |
heartbeatTransaction? | TransactionHeartbeat | Fields for a heartbeat transaction. Definition: data/transactions/heartbeat.go : HeartbeatTxnFields | - | algosdk.indexerModels.Transaction.heartbeatTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2248 |
id | string | Transaction ID | algosdk.indexerModels.Transaction.id | - | src/types/subscription.ts:164 |
innerTxns? | SubscribedTransaction[] | Inner transactions produced by application execution. | algosdk.indexerModels.Transaction.innerTxns | - | src/types/subscription.ts:170 |
intraRoundOffset? | number | Offset into the round where this transaction was confirmed. | - | algosdk.indexerModels.Transaction.intraRoundOffset | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2260 |
keyregTransaction? | TransactionKeyreg | Fields for a keyreg transaction. Definition: data/transactions/keyreg.go : KeyregTxnFields | - | algosdk.indexerModels.Transaction.keyregTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2266 |
lastValid | bigint | (lv) Last valid round for this transaction. | - | algosdk.indexerModels.Transaction.lastValid | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2166 |
lease? | Uint8Array | (lx) Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions. If this field is nonzero, then once the transaction is confirmed, it acquires the lease identified by the (Sender, Lease) pair of the transaction until the LastValid round passes. While this transaction possesses the lease, no other transaction specifying this lease can be confirmed. | - | algosdk.indexerModels.Transaction.lease | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2274 |
localStateDelta? | AccountStateDelta[] | (ld) Local state key/value changes for the application being executed by this transaction. | - | algosdk.indexerModels.Transaction.localStateDelta | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2279 |
logs? | Uint8Array[] | (lg) Logs for the application being executed by this transaction. | - | algosdk.indexerModels.Transaction.logs | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2283 |
note? | Uint8Array | (note) Free form data. | - | algosdk.indexerModels.Transaction.note | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2287 |
parentIntraRoundOffset? | number | The intra-round offset of the parent of this transaction (if it’s an inner transaction). | - | - | src/types/subscription.ts:166 |
parentTransactionId? | string | The transaction ID of the parent of this transaction (if it’s an inner transaction). | - | - | src/types/subscription.ts:168 |
paymentTransaction? | TransactionPayment | Fields for a payment transaction. Definition: data/transactions/payment.go : PaymentTxnFields | - | algosdk.indexerModels.Transaction.paymentTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2293 |
receiverRewards? | bigint | (rr) rewards applied to receiver account. | - | algosdk.indexerModels.Transaction.receiverRewards | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2297 |
rekeyTo? | Address | (rekey) when included in a valid transaction, the accounts auth addr will be updated with this value and future signatures must be signed with the key represented by this address. | - | algosdk.indexerModels.Transaction.rekeyTo | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2303 |
roundTime? | number | Time when the block this transaction is in was confirmed. | - | algosdk.indexerModels.Transaction.roundTime | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2307 |
sender | string | (snd) Sender’s address. | - | algosdk.indexerModels.Transaction.sender | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2170 |
senderRewards? | bigint | (rs) rewards applied to sender account. | - | algosdk.indexerModels.Transaction.senderRewards | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2311 |
signature? | TransactionSignature | Validation signature associated with some data. Only one of the signatures should be provided. | - | algosdk.indexerModels.Transaction.signature | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2316 |
stateProofTransaction? | TransactionStateProof | Fields for a state proof transaction. Definition: data/transactions/stateproof.go : StateProofTxnFields | - | algosdk.indexerModels.Transaction.stateProofTransaction | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2322 |
txType? | string | (type) Indicates what type of transaction this is. Different types have different fields. Valid types, and where their fields are stored: _ (pay) payment-transaction _ (keyreg) keyreg-transaction _ (acfg) asset-config-transaction _ (axfer) asset-transfer-transaction _ (afrz) asset-freeze-transaction _ (appl) application-transaction _ (stpf) state-proof-transaction _ (hb) heartbeat-transaction | - | algosdk.indexerModels.Transaction.txType | node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2336 |
Accessors
Section titled “Accessors”encodingSchema
Section titled “encodingSchema”Get Signature
Section titled “Get Signature”get
staticencodingSchema():Schema
Defined in: node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2154
Returns
Section titled “Returns”Schema
Inherited from
Section titled “Inherited from”algosdk.indexerModels.Transaction.encodingSchema
Methods
Section titled “Methods”getEncodingSchema()
Section titled “getEncodingSchema()”getEncodingSchema():
Schema
Defined in: node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2454
Get the encoding Schema for this object, used to prepare the encoding data for msgpack and JSON.
Returns
Section titled “Returns”Schema
Inherited from
Section titled “Inherited from”algosdk.indexerModels.Transaction.getEncodingSchema
toEncodingData()
Section titled “toEncodingData()”toEncodingData():
Map<string,unknown>
Defined in: node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2455
Extract the encoding data for this object. This data, after being prepared by the encoding Schema, can be encoded to msgpack or JSON.
Returns
Section titled “Returns”Map<string, unknown>
Inherited from
Section titled “Inherited from”algosdk.indexerModels.Transaction.toEncodingData
fromEncodingData()
Section titled “fromEncodingData()”
staticfromEncodingData(data):Transaction
Defined in: node_modules/algosdk/dist/types/client/v2/indexer/models/types.d.ts:2456
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
data | unknown |
Returns
Section titled “Returns”Transaction
Inherited from
Section titled “Inherited from”algosdk.indexerModels.Transaction.fromEncodingData
Interfaces
Section titled “Interfaces”AlgorandSubscriberConfig
Section titled “AlgorandSubscriberConfig”Defined in: src/types/subscription.ts:386
Configuration for an AlgorandSubscriber.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
arc28Events? | Arc28EventGroup[] | Any ARC-28 event definitions to process from app call logs | - | CoreTransactionSubscriptionParams.arc28Events | src/types/subscription.ts:260 |
filters | SubscriberConfigFilter<unknown>[] | The set of filters to subscribe to / emit events for, along with optional data mappers. | CoreTransactionSubscriptionParams.filters | - | src/types/subscription.ts:388 |
frequencyInSeconds? | number | The frequency to poll for new blocks in seconds; defaults to 1s | - | - | src/types/subscription.ts:390 |
maxIndexerRoundsToSync? | number | The maximum number of rounds to sync from indexer when using `syncBehaviour: ‘catchup-with-indexer’. By default there is no limit and it will paginate through all of the rounds. Sometimes this can result in an incredibly long catchup time that may break the service due to execution and memory constraints, particularly for filters that result in a large number of transactions. Instead, this allows indexer catchup to be split into multiple polls, each with a transactionally consistent boundary based on the number of rounds specified here. | - | CoreTransactionSubscriptionParams.maxIndexerRoundsToSync | src/types/subscription.ts:280 |
maxRoundsToSync? | number | The maximum number of rounds to sync from algod for each subscription pull/poll. Defaults to 500. This gives you control over how many rounds you wait for at a time, your staleness tolerance when using skip-sync-newest or fail, and your catchup speed when using sync-oldest. | - | CoreTransactionSubscriptionParams.maxRoundsToSync | src/types/subscription.ts:269 |
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. | - | CoreTransactionSubscriptionParams.syncBehaviour | src/types/subscription.ts:298 |
waitForBlockWhenAtTip? | boolean | Whether to wait via algod /status/wait-for-block-after endpoint when at the tip of the chain; reduces latency of subscription | - | - | src/types/subscription.ts:392 |
watermarkPersistence | object | Methods to retrieve and persist the current watermark so syncing is resilient and maintains its position in the chain | - | - | src/types/subscription.ts:395 |
watermarkPersistence.get | () => Promise<bigint> | Returns the current watermark that syncing has previously been processed to | - | - | src/types/subscription.ts:397 |
watermarkPersistence.set | (newWatermark) => Promise<void> | Persist the new watermark that has been processed | - | - | src/types/subscription.ts:399 |
BalanceChange
Section titled “BalanceChange”Defined in: src/types/subscription.ts:200
Represents a balance change effect for a transaction.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
address | string | The address that the balance change is for. | src/types/subscription.ts:202 |
amount | bigint | The amount of the balance change in smallest divisible unit or microAlgos. | src/types/subscription.ts:206 |
assetId | bigint | The asset ID of the balance change, or 0 for Algos. | src/types/subscription.ts:204 |
roles | BalanceChangeRole[] | The roles the account was playing that led to the balance change | src/types/subscription.ts:208 |
BeforePollMetadata
Section titled “BeforePollMetadata”Defined in: src/types/subscription.ts:228
Metadata about an impending subscription poll.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
currentRound | bigint | The current round of algod | src/types/subscription.ts:232 |
watermark | bigint | The current watermark of the subscriber | src/types/subscription.ts:230 |
BlockMetadata
Section titled “BlockMetadata”Defined in: src/types/subscription.ts:33
Metadata about a block that was retrieved from algod.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
fullTransactionCount | number | Full count of transactions and inner transactions (recursively) in this block. | src/types/subscription.ts:53 |
genesisHash | string | The base64 genesis hash of the chain. | src/types/subscription.ts:43 |
genesisId | string | The genesis ID of the chain. | src/types/subscription.ts:41 |
hash? | string | The base64 block hash. | src/types/subscription.ts:35 |
parentTransactionCount | number | Count of parent transactions in this block | src/types/subscription.ts:51 |
participationUpdates? | ParticipationUpdates | Participation account data that needs to be checked/acted on by the network. | src/types/subscription.ts:68 |
previousBlockHash? | string | The base64 previous block hash. | src/types/subscription.ts:45 |
proposer? | string | Address of the proposer of this block | src/types/subscription.ts:70 |
rewards? | BlockRewards | Fields relating to rewards | src/types/subscription.ts:49 |
round | bigint | The round of the block. | src/types/subscription.ts:37 |
seed | string | The base64 seed of the block. | src/types/subscription.ts:47 |
stateProofTracking? | BlockStateProofTracking[] | Tracks the status of state proofs. | src/types/subscription.ts:64 |
timestamp | number | Block creation timestamp in seconds since epoch | src/types/subscription.ts:39 |
transactionsRoot | string | TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it’s the root of a merkle tree whose leaves are the block’s Txids, in lexicographic order. For the empty block, it’s 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot. Pattern : ”^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$“ | src/types/subscription.ts:58 |
transactionsRootSha256 | string | TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists. | src/types/subscription.ts:60 |
txnCounter | bigint | Number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported). | src/types/subscription.ts:55 |
upgradeState? | BlockUpgradeState | Fields relating to a protocol upgrade. | src/types/subscription.ts:62 |
upgradeVote? | BlockUpgradeVote | Fields relating to voting for a protocol upgrade. | src/types/subscription.ts:66 |
BlockRewards
Section titled “BlockRewards”Defined in: src/types/subscription.ts:73
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
feeSink | string | FeeSink is an address that accepts transaction fees, it can only spend to the incentive pool. | src/types/subscription.ts:75 |
rewardsCalculationRound | bigint | The number of leftover MicroAlgos after the distribution of rewards-rate MicroAlgos for every reward unit in the next round. | src/types/subscription.ts:77 |
rewardsLevel | bigint | How many rewards, in MicroAlgos, have been distributed to each RewardUnit of MicroAlgos since genesis. | src/types/subscription.ts:79 |
rewardsPool | string | RewardsPool is an address that accepts periodic injections from the fee-sink and continually redistributes them as rewards. | src/types/subscription.ts:81 |
rewardsRate | bigint | Number of new MicroAlgos added to the participation stake from rewards at the next round. | src/types/subscription.ts:83 |
rewardsResidue | bigint | Number of leftover MicroAlgos after the distribution of RewardsRate/rewardUnits MicroAlgos for every reward unit in the next round. | src/types/subscription.ts:85 |
BlockStateProofTracking
Section titled “BlockStateProofTracking”Defined in: src/types/subscription.ts:101
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
nextRound? | bigint | (n) Next round for which we will accept a state proof transaction. | src/types/subscription.ts:105 |
onlineTotalWeight? | bigint | (t) The total number of microalgos held by the online accounts during the StateProof round. | src/types/subscription.ts:111 |
type? | number | State Proof Type. Note the raw object uses map with this as key. | src/types/subscription.ts:116 |
votersCommitment? | string | (v) Root of a vector commitment containing online accounts that will help sign the proof. | src/types/subscription.ts:122 |
BlockUpgradeState
Section titled “BlockUpgradeState”Defined in: src/types/subscription.ts:88
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
currentProtocol | string | Current protocol version | src/types/subscription.ts:90 |
nextProtocol? | string | The next proposed protocol version. | src/types/subscription.ts:92 |
nextProtocolApprovals? | bigint | Number of blocks which approved the protocol upgrade. | src/types/subscription.ts:94 |
nextProtocolSwitchOn? | bigint | Round on which the protocol upgrade will take effect. | src/types/subscription.ts:98 |
nextProtocolVoteBefore? | bigint | Deadline round for this protocol upgrade (No votes will be consider after this round). | src/types/subscription.ts:96 |
BlockUpgradeVote
Section titled “BlockUpgradeVote”Defined in: src/types/subscription.ts:125
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
upgradeApprove? | boolean | (upgradeyes) Indicates a yes vote for the current proposal. | src/types/subscription.ts:129 |
upgradeDelay? | bigint | (upgradedelay) Indicates the time between acceptance and execution. | src/types/subscription.ts:134 |
upgradePropose? | string | (upgradeprop) Indicates a proposed upgrade. | src/types/subscription.ts:139 |
CoreTransactionSubscriptionParams
Section titled “CoreTransactionSubscriptionParams”Defined in: src/types/subscription.ts:236
Common parameters to control a single subscription pull/poll for both AlgorandSubscriber and getSubscribedTransactions.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
arc28Events? | Arc28EventGroup[] | Any ARC-28 event definitions to process from app call logs | src/types/subscription.ts:260 |
filters | NamedTransactionFilter[] | The filter(s) to apply to find transactions of interest. A list of filters with corresponding names. Example filter: [{ name: 'asset-transfers', filter: { type: TransactionType.axfer, //... } }, { name: 'payments', filter: { type: TransactionType.pay, //... } }] | src/types/subscription.ts:258 |
maxIndexerRoundsToSync? | number | The maximum number of rounds to sync from indexer when using `syncBehaviour: ‘catchup-with-indexer’. By default there is no limit and it will paginate through all of the rounds. Sometimes this can result in an incredibly long catchup time that may break the service due to execution and memory constraints, particularly for filters that result in a large number of transactions. Instead, this allows indexer catchup to be split into multiple polls, each with a transactionally consistent boundary based on the number of rounds specified here. | src/types/subscription.ts:280 |
maxRoundsToSync? | number | The maximum number of rounds to sync from algod for each subscription pull/poll. Defaults to 500. This gives you control over how many rounds you wait for at a time, your staleness tolerance when using skip-sync-newest or fail, and your catchup speed when using sync-oldest. | src/types/subscription.ts:269 |
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. | src/types/subscription.ts:298 |
NamedTransactionFilter
Section titled “NamedTransactionFilter”Defined in: src/types/subscription.ts:302
Specify a named filter to apply to find transactions of interest.
Extended by
Section titled “Extended by”Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
filter | TransactionFilter | The filter itself. | src/types/subscription.ts:306 |
name | string | The name to give the filter. | src/types/subscription.ts:304 |
ParticipationUpdates
Section titled “ParticipationUpdates”Defined in: src/types/subscription.ts:142
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
absentParticipationAccounts? | string[] | (partupabs) a list of online accounts that need to be suspended. | src/types/subscription.ts:146 |
expiredParticipationAccounts? | string[] | (partupdrmv) a list of online accounts that needs to be converted to offline since their participation key expired. | src/types/subscription.ts:152 |
SubscriberConfigFilter
Section titled “SubscriberConfigFilter”Defined in: src/types/subscription.ts:404
A single event to subscribe to / emit.
Extends
Section titled “Extends”Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Properties
Section titled “Properties”| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
filter | TransactionFilter | The filter itself. | NamedTransactionFilter.filter | src/types/subscription.ts:306 |
mapper? | (transaction) => Promise<T[]> | An optional data mapper if you want the event data to take a certain shape when subscribing to events with this filter name. If not specified, then the event will simply receive a SubscribedTransaction. Note: if you provide multiple filters with the same name then only the mapper of the first matching filter will be used | - | src/types/subscription.ts:411 |
name | string | The name to give the filter. | NamedTransactionFilter.name | src/types/subscription.ts:304 |
TransactionFilter
Section titled “TransactionFilter”Defined in: src/types/subscription.ts:310
Specify a filter to apply to find transactions of interest.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
appCallArgumentsMatch? | (appCallArguments?) => boolean | Filter to app transactions that meet the given app arguments predicate. | src/types/subscription.ts:339 |
appCreate? | boolean | Filter to transactions that are creating an app. | src/types/subscription.ts:322 |
appId? | bigint | bigint[] | Filter to transactions against the app with the given ID(s). | src/types/subscription.ts:320 |
appOnComplete? | ApplicationOnComplete | ApplicationOnComplete[] | Filter to transactions that have given on complete(s). | src/types/subscription.ts:324 |
arc28Events? | object[] | Filter to app transactions that emit the given ARC-28 events. Note: the definitions for these events must be passed in to the subscription config via arc28Events. | src/types/subscription.ts:343 |
assetCreate? | boolean | Filter to transactions that are creating an asset. | src/types/subscription.ts:328 |
assetId? | bigint | bigint[] | Filter to transactions against the asset with the given ID(s). | src/types/subscription.ts:326 |
balanceChanges? | object[] | Filter to transactions that result in balance changes that match one or more of the given set of balance changes. | src/types/subscription.ts:345 |
customFilter? | (transaction) => boolean | Catch-all custom filter to filter for things that the rest of the filters don’t provide. | src/types/subscription.ts:362 |
maxAmount? | number | bigint | Filter to transactions where the amount being transferred is less than or equal to the given maximum (microAlgos or decimal units of an ASA if type: axfer). | src/types/subscription.ts:334 |
methodSignature? | string | string[] | Filter to app transactions that have the given ARC-0004 method selector(s) for the given method signature as the first app argument. | src/types/subscription.ts:337 |
minAmount? | number | bigint | Filter to transactions where the amount being transferred is greater than or equal to the given minimum (microAlgos or decimal units of an ASA if type: axfer). | src/types/subscription.ts:331 |
notePrefix? | string | Filter to transactions with a note having the given prefix. | src/types/subscription.ts:318 |
receiver? | string | string[] | Filter to transactions being received by the specified address(es). | src/types/subscription.ts:316 |
sender? | string | string[] | Filter to transactions sent from the specified address(es). | src/types/subscription.ts:314 |
type? | TransactionType | TransactionType[] | Filter based on the given transaction type(s). | src/types/subscription.ts:312 |
TransactionSubscriptionParams
Section titled “TransactionSubscriptionParams”Defined in: src/types/subscription.ts:366
Parameters to control a single subscription pull/poll.
Extends
Section titled “Extends”Properties
Section titled “Properties”| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
arc28Events? | Arc28EventGroup[] | Any ARC-28 event definitions to process from app call logs | CoreTransactionSubscriptionParams.arc28Events | src/types/subscription.ts:260 |
currentRound? | bigint | The current tip of the configured Algorand blockchain. If not provided, it will be resolved on demand. | - | src/types/subscription.ts:382 |
filters | NamedTransactionFilter[] | The filter(s) to apply to find transactions of interest. A list of filters with corresponding names. Example filter: [{ name: 'asset-transfers', filter: { type: TransactionType.axfer, //... } }, { name: 'payments', filter: { type: TransactionType.pay, //... } }] | CoreTransactionSubscriptionParams.filters | src/types/subscription.ts:258 |
maxIndexerRoundsToSync? | number | The maximum number of rounds to sync from indexer when using `syncBehaviour: ‘catchup-with-indexer’. By default there is no limit and it will paginate through all of the rounds. Sometimes this can result in an incredibly long catchup time that may break the service due to execution and memory constraints, particularly for filters that result in a large number of transactions. Instead, this allows indexer catchup to be split into multiple polls, each with a transactionally consistent boundary based on the number of rounds specified here. | CoreTransactionSubscriptionParams.maxIndexerRoundsToSync | src/types/subscription.ts:280 |
maxRoundsToSync? | number | The maximum number of rounds to sync from algod for each subscription pull/poll. Defaults to 500. This gives you control over how many rounds you wait for at a time, your staleness tolerance when using skip-sync-newest or fail, and your catchup speed when using sync-oldest. | CoreTransactionSubscriptionParams.maxRoundsToSync | src/types/subscription.ts:269 |
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. | CoreTransactionSubscriptionParams.syncBehaviour | src/types/subscription.ts:298 |
watermark | bigint | The current round watermark that transactions have previously been synced to. Persist this value as you process transactions processed from this method to allow for resilient and incremental syncing. Syncing will start from watermark + 1. Start from 0 if you want to start from the beginning of time, noting that will be slow if onMaxRounds is sync-oldest. | - | src/types/subscription.ts:377 |
TransactionSubscriptionResult
Section titled “TransactionSubscriptionResult”Defined in: src/types/subscription.ts:7
The result of a single subscription pull/poll.
Properties
Section titled “Properties”| Property | Type | Description | Defined in |
|---|---|---|---|
blockMetadata? | BlockMetadata[] | The metadata about any blocks that were retrieved from algod as part of the subscription poll. | src/types/subscription.ts:29 |
currentRound | bigint | The current detected tip of the configured Algorand blockchain. | src/types/subscription.ts:11 |
newWatermark | bigint | The new watermark value to persist for the next call to getSubscribedTransactions to continue the sync. Will be equal to syncedRoundRange[1]. Only persist this after processing (or in the same atomic transaction as) subscribed transactions to keep it reliable. | src/types/subscription.ts:19 |
startingWatermark | bigint | The watermark value that was retrieved at the start of the subscription poll. | src/types/subscription.ts:13 |
subscribedTransactions | SubscribedTransaction[] | Any transactions that matched the given filter within the synced round range. This substantively uses the indexer transaction format to represent the data with some additional fields. | src/types/subscription.ts:25 |
syncedRoundRange | [bigint, bigint] | The round range that was synced from/to | src/types/subscription.ts:9 |
Type Aliases
Section titled “Type Aliases”ErrorListener()
Section titled “ErrorListener()”ErrorListener = (
error) =>Promise<void> |void
Defined in: src/types/subscription.ts:416
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
error | unknown |
Returns
Section titled “Returns”Promise<void> | void
TypedAsyncEventListener()
Section titled “TypedAsyncEventListener()”TypedAsyncEventListener<
T> = (event,eventName) =>Promise<void> |void
Defined in: src/types/subscription.ts:414
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
event | T |
eventName | string | symbol |
Returns
Section titled “Returns”Promise<void> | void