Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 00cb8ad

Browse files
authored
Merge pull request #406 from iotaledger/feat/indexer-client-add-native-tokens
Add query for native tokens to indexer client and fix alias query parameters
2 parents e9b6552 + 06b61a7 commit 00cb8ad

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

nodeclient/indexer_models.go

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,24 @@ type IndexerStorageDepositParas struct {
6464
StorageDepositReturnAddressBech32 string `qs:"storageDepositReturnAddress,omitempty"`
6565
}
6666

67+
// IndexerNativeTokenParas define native token based query parameters.
68+
type IndexerNativeTokenParas struct {
69+
// Filters outputs based on the presence of native tokens in the output.
70+
HasNativeTokens *bool `qs:"hasNativeTokens,omitempty"`
71+
// Filter outputs that have at least an amount of native tokens.
72+
MinNativeTokenCount *uint32 `qs:"minNativeTokenCount,omitempty"`
73+
// Filter outputs that have at the most an amount of native tokens.
74+
MaxNativeTokenCount *uint32 `qs:"maxNativeTokenCount,omitempty"`
75+
}
76+
6777
// BasicOutputsQuery defines parameters for an basic outputs query.
6878
type BasicOutputsQuery struct {
6979
IndexerCursorParas
7080
IndexerTimelockParas
7181
IndexerExpirationParas
7282
IndexerCreationParas
7383
IndexerStorageDepositParas
84+
IndexerNativeTokenParas
7485

7586
// Bech32-encoded address that should be searched for.
7687
AddressBech32 string `qs:"address,omitempty"`
@@ -95,6 +106,9 @@ func (query *BasicOutputsQuery) URLParas() (string, error) {
95106
// AliasesQuery defines parameters for an alias outputs query.
96107
type AliasesQuery struct {
97108
IndexerCursorParas
109+
IndexerCreationParas
110+
IndexerNativeTokenParas
111+
98112
// Bech32-encoded state controller address that should be searched for.
99113
StateControllerBech32 string `qs:"stateController,omitempty"`
100114
// Bech32-encoded governor address that should be searched for.
@@ -103,8 +117,6 @@ type AliasesQuery struct {
103117
SenderBech32 string `qs:"sender,omitempty"`
104118
// Filters outputs based on the presence of validated issuer.
105119
IssuerBech32 string `qs:"issuer,omitempty"`
106-
// Filters outputs based on matching tag feature.
107-
Tag string `qs:"tag,omitempty"`
108120
}
109121

110122
func (query *AliasesQuery) OutputType() iotago.OutputType {
@@ -123,6 +135,8 @@ func (query *AliasesQuery) URLParas() (string, error) {
123135
type FoundriesQuery struct {
124136
IndexerCursorParas
125137
IndexerCreationParas
138+
IndexerNativeTokenParas
139+
126140
// Bech32-encoded address that should be searched for.
127141
AliasAddressBech32 string `qs:"aliasAddress,omitempty"`
128142
}
@@ -145,6 +159,7 @@ type NFTsQuery struct {
145159
IndexerTimelockParas
146160
IndexerExpirationParas
147161
IndexerStorageDepositParas
162+
IndexerNativeTokenParas
148163
IndexerCreationParas
149164

150165
// Bech32-encoded address that should be searched for.

0 commit comments

Comments
 (0)