Skip to content

Commit

Permalink
Fix senders filter (#1156)
Browse files Browse the repository at this point in the history
* fix senders filter

* remove console.log
  • Loading branch information
cfaur09 authored Dec 4, 2023
1 parent c7f1b47 commit 4bf70d9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/endpoints/tokens/token.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export class TokenController {
@Param('identifier', ParseTokenPipe) identifier: string,
@Query('from', new DefaultValuePipe(0), ParseIntPipe) from: number,
@Query('size', new DefaultValuePipe(25), ParseIntPipe) size: number,
@Query('sender', ParseAddressPipe) sender?: string,
@Query('sender', ParseAddressArrayPipe) sender?: string[],
@Query('receiver', ParseAddressArrayPipe) receiver?: string[],
@Query('senderShard', ParseIntPipe) senderShard?: number,
@Query('receiverShard', ParseIntPipe) receiverShard?: number,
Expand All @@ -393,9 +393,8 @@ export class TokenController {
}

const options = TransactionQueryOptions.applyDefaultOptions(size, { withScamInfo, withUsername, withBlockInfo });

return await this.transferService.getTransfers(new TransactionFilter({
sender,
senders: sender,
receivers: receiver,
token: identifier,
functions,
Expand Down Expand Up @@ -429,7 +428,7 @@ export class TokenController {
@ApiQuery({ name: 'after', description: 'After timestamp', required: false })
async getTokenTransfersCount(
@Param('identifier', ParseTokenPipe) identifier: string,
@Query('sender', ParseAddressPipe) sender?: string,
@Query('sender', ParseAddressArrayPipe) sender?: string[],
@Query('receiver', ParseAddressArrayPipe) receiver?: string[],
@Query('senderShard', ParseIntPipe) senderShard?: number,
@Query('receiverShard', ParseIntPipe) receiverShard?: number,
Expand All @@ -450,7 +449,7 @@ export class TokenController {
}

return await this.transferService.getTransfersCount(new TransactionFilter({
sender,
senders: sender,
receivers: receiver,
token: identifier,
functions,
Expand All @@ -468,7 +467,7 @@ export class TokenController {
@ApiExcludeEndpoint()
async getAccountTransfersCountAlternative(
@Param('identifier', ParseTokenPipe) identifier: string,
@Query('sender', ParseAddressPipe) sender?: string,
@Query('sender', ParseAddressArrayPipe) sender?: string[],
@Query('receiver', ParseAddressArrayPipe) receiver?: string[],
@Query('senderShard', ParseIntPipe) senderShard?: number,
@Query('receiverShard', ParseIntPipe) receiverShard?: number,
Expand All @@ -489,7 +488,7 @@ export class TokenController {
}

return await this.transferService.getTransfersCount(new TransactionFilter({
sender,
senders: sender,
receivers: receiver,
token: identifier,
functions,
Expand Down

0 comments on commit 4bf70d9

Please sign in to comment.