Skip to content

Commit

Permalink
[Chore] fix query transfer evm token list
Browse files Browse the repository at this point in the history
  • Loading branch information
tamvb2391 committed Jun 11, 2024
1 parent 9fddcec commit 8986d13
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/app/core/services/token.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,11 @@ export class TokenService extends CommonService {
txHash?: string;
}): Observable<any> {
let queryName = 'ERC721Transfer';
let queryActionNotIn = payload.isNFTDetail
? ['']
: ['approval', 'instantiate', 'revoke', 'approve_all', 'revoke_all', ''];
const queryActionIn = ['transfer'];

const operationsDoc = `query ${queryName}(
$contractAddress: String = null
$actionNotIn: [String!] = null
$actionIn: [String!] = null
$idLte: Int = null
$idGte: Int = null
$receiver: String = null
Expand All @@ -567,7 +566,7 @@ export class TokenService extends CommonService {
$txHash: String = null) {
${this.envDB} {
erc721_activity(
where: {_or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}], erc721_contract: {evm_smart_contract: {address: {_eq: $contractAddress}}}, erc721_token: {token_id: {_eq: $tokenId}}, id: {_lte: $idLte, _gte: $idGte}, action: {_nin: $actionNotIn}, tx_hash: {_eq: $txHash}}
where: {_or: [{to: {_eq: $receiver}}, {from: {_eq: $sender}}], erc721_contract: {evm_smart_contract: {address: {_eq: $contractAddress}}}, erc721_token: {token_id: {_eq: $tokenId}}, id: {_lte: $idLte, _gte: $idGte}, action: {_in: $actionIn}, tx_hash: {_eq: $txHash}}
order_by: {id: desc}
) {
id
Expand Down Expand Up @@ -605,7 +604,7 @@ export class TokenService extends CommonService {
query: operationsDoc,
variables: {
contractAddress: payload.contractAddr?.toLowerCase(),
actionNotIn: queryActionNotIn,
actionIn: queryActionIn,
sender: payload.sender?.toLowerCase(),
receiver: payload.receiver?.toLowerCase(),
tokenId: payload.tokenId,
Expand Down

0 comments on commit 8986d13

Please sign in to comment.