Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion indexer/src/kadena-server/config/graphql-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,6 @@ export type QueryTransactionsArgs = {
before?: InputMaybe<Scalars['String']['input']>;
blockHash?: InputMaybe<Scalars['String']['input']>;
chainId?: InputMaybe<Scalars['String']['input']>;
code?: InputMaybe<Scalars['String']['input']>;
first?: InputMaybe<Scalars['Int']['input']>;
fungibleName?: InputMaybe<Scalars['String']['input']>;
isCoinbase?: InputMaybe<Scalars['Boolean']['input']>;
Expand Down
1 change: 0 additions & 1 deletion indexer/src/kadena-server/config/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ type Query {
minimumDepth: Int
requestKey: String
isCoinbase: Boolean
code: String
): QueryTransactionsConnection! @complexity(value: 1, multipliers: ["first", "last"])

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export interface GetTransactionsCountParams {
hasTokenId?: boolean | null;
/** Filter by coinbase */
isCoinbase?: boolean | null;
/** Filter by transaction code */
transactionCode?: string | null;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const schema = zod.object({
minimumDepth: zod.number().nullable().optional(),
requestKey: zod.string().nullable().optional(),
isCoinbase: zod.boolean().nullable().optional(),
transactionCode: zod.string().nullable().optional(),
});

/**
Expand All @@ -44,13 +43,8 @@ export const totalCountQueryTransactionsConnectionResolver: QueryTransactionsCon
fungibleName,
requestKey,
isCoinbase,
transactionCode,
} = schema.parse(parent);

if (transactionCode) {
throw new Error('Total count is not supported for transactions with code.');
}

const output = await context.transactionRepository.getTransactionsCount({
accountName,
blockHash,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,21 +60,6 @@ export const transactionsQueryResolver: QueryResolvers<ResolverContext>['transac
isCoinbase,
} = args;

const hasNoParamsSet = Object.values({
accountName,
blockHash,
chainId,
fungibleName,
requestKey,
maxHeight,
minHeight,
minimumDepth,
isCoinbase,
}).every(v => isNullOrUndefined(v));
if (args.code && !hasNoParamsSet) {
throw new Error('Code parameter cannot be composed with other filters');
}

// Call the repository layer to retrieve the filtered and paginated transactions
// Pass all parameters through to maintain complete filtering flexibility
const output = await context.transactionRepository.getTransactions({
Expand All @@ -87,7 +72,6 @@ export const transactionsQueryResolver: QueryResolvers<ResolverContext>['transac
minHeight,
minimumDepth,
isCoinbase,
transactionCode: args.code,
first,
last,
before,
Expand Down Expand Up @@ -122,6 +106,5 @@ export const transactionsQueryResolver: QueryResolvers<ResolverContext>['transac
isCoinbase,
fungibleName,
requestKey,
transactionCode: args.code,
};
};