Skip to content

Commit 37108b0

Browse files
committed
Support for groupid filtering in SearchForTransactions, sync types with algod/indexer.
1 parent 54ee22e commit 37108b0

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

src/client/v2/indexer/searchForTransactions.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,26 @@ export default class SearchForTransactions extends JSONRequest<TransactionsRespo
106106
return this;
107107
}
108108

109+
/**
110+
* Lookup transactions by group ID.
111+
*
112+
* #### Example
113+
* ```typescript
114+
* const groupIdBase64Encoded = "A62qVigWtWo0laUzcE1iZY8+KXWzK1vSkgwN/eKgvjc=";
115+
* const txns = await indexerClient
116+
* .searchForTransactions()
117+
* .groupid(groupIdBase64Encoded)
118+
* .do();
119+
* ```
120+
*
121+
* @param groupid - base64 string or uint8array
122+
* @category query
123+
*/
124+
groupid(groupid: Uint8Array | string) {
125+
this.query['group-id'] = base64StringFunnel(groupid);
126+
return this;
127+
}
128+
109129
/**
110130
* Include results for the specified round.
111131
*

tests/cucumber/steps/steps.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2736,7 +2736,7 @@ module.exports = function getSteps(options) {
27362736
);
27372737

27382738
When(
2739-
'we make a Search For Transactions call with account {string} NotePrefix {string} TxType {string} SigType {string} txid {string} round {int} minRound {int} maxRound {int} limit {int} beforeTime {string} afterTime {string} currencyGreaterThan {int} currencyLessThan {int} assetIndex {int} addressRole {string} ExcluseCloseTo {string}',
2739+
'we make a Search For Transactions call with account {string} NotePrefix {string} TxType {string} SigType {string} txid {string} round {int} minRound {int} maxRound {int} limit {int} beforeTime {string} afterTime {string} currencyGreaterThan {int} currencyLessThan {int} assetIndex {int} addressRole {string} ExcluseCloseTo {string} groupid {string}',
27402740
async function (
27412741
account,
27422742
notePrefix,
@@ -2753,7 +2753,8 @@ module.exports = function getSteps(options) {
27532753
currencyLesser,
27542754
assetIndex,
27552755
addressRole,
2756-
excludeCloseToAsString
2756+
excludeCloseToAsString,
2757+
groupid
27572758
) {
27582759
let excludeCloseTo = false;
27592760
if (excludeCloseToAsString === 'true') {
@@ -2778,6 +2779,7 @@ module.exports = function getSteps(options) {
27782779
.txid(txid)
27792780
.txType(txType)
27802781
.excludeCloseTo(excludeCloseTo)
2782+
.groupid(groupid)
27812783
);
27822784
}
27832785
);

0 commit comments

Comments
 (0)