@poap-xyz/poaps
Advanced tools
Comparing version 0.2.1-beta-v5 to 0.2.1-beta-v6
@@ -16,3 +16,4 @@ import { Order, Chain, PaginationInput } from '@poap-xyz/utils'; | ||
sortDir?: Order; | ||
filterByZeroAddress?: boolean; | ||
filterZeroAddress?: boolean; | ||
filterDeadAddress?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface WalletMintInput { |
@@ -16,3 +16,4 @@ import { Order, Chain, PaginationInput } from '@poap-xyz/utils'; | ||
sortDir?: Order; | ||
filterByZeroAddress?: boolean; | ||
filterZeroAddress?: boolean; | ||
filterDeadAddress?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface WalletMintInput { |
@@ -105,9 +105,20 @@ (function (global, factory) { | ||
} | ||
function createAddressFilter(key, filterZeroAddress, value) { | ||
return filterZeroAddress || value | ||
function createAddressFilter(key, value, filterZeroAddress, filterDeadAddress) { | ||
return filterZeroAddress || filterDeadAddress || value | ||
? { | ||
[key]: { | ||
...(filterZeroAddress | ||
...(filterZeroAddress && filterDeadAddress | ||
? { | ||
_nin: [ | ||
'0x0000000000000000000000000000000000000000', | ||
'0x000000000000000000000000000000000000dead', | ||
], | ||
} | ||
: {}), | ||
...(filterZeroAddress && !filterDeadAddress | ||
? { _neq: '0x0000000000000000000000000000000000000000' } | ||
: {}), | ||
...(!filterZeroAddress && filterDeadAddress | ||
? { _neq: '0x000000000000000000000000000000000000dead' } | ||
: {}), | ||
...(value ? { _eq: value.toLowerCase() } : {}), | ||
@@ -250,3 +261,3 @@ }, | ||
async fetch(input) { | ||
const { limit, offset, chain, collectorAddress, mintedDateFrom, mintedDateTo, ids, dropId, sortField, sortDir, filterByZeroAddress = true, } = input; | ||
const { limit, offset, chain, collectorAddress, mintedDateFrom, mintedDateTo, ids, dropId, sortField, sortDir, filterZeroAddress = true, filterDeadAddress = true, } = input; | ||
const variables = { | ||
@@ -257,3 +268,3 @@ limit, | ||
where: { | ||
...createAddressFilter('collector_address', filterByZeroAddress, collectorAddress), | ||
...createAddressFilter('collector_address', collectorAddress, filterZeroAddress, filterDeadAddress), | ||
...createEqFilter('chain', chain), | ||
@@ -260,0 +271,0 @@ ...createEqFilter('drop_id', dropId), |
@@ -16,3 +16,4 @@ import { Order, Chain, PaginationInput } from '@poap-xyz/utils'; | ||
sortDir?: Order; | ||
filterByZeroAddress?: boolean; | ||
filterZeroAddress?: boolean; | ||
filterDeadAddress?: boolean; | ||
} | ||
@@ -19,0 +20,0 @@ export interface WalletMintInput { |
{ | ||
"name": "@poap-xyz/poaps", | ||
"version": "0.2.1-beta-v5", | ||
"version": "0.2.1-beta-v6", | ||
"description": "Poaps module for the poap.js library", | ||
@@ -29,4 +29,4 @@ "main": "dist/cjs/index.cjs", | ||
"dependencies": { | ||
"@poap-xyz/providers": "0.2.1-beta-v5", | ||
"@poap-xyz/utils": "0.2.1-beta-v5" | ||
"@poap-xyz/providers": "0.2.1-beta-v6", | ||
"@poap-xyz/utils": "0.2.1-beta-v6" | ||
}, | ||
@@ -33,0 +33,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
229536
1564
+ Added@poap-xyz/providers@0.2.1-beta-v6(transitive)
+ Added@poap-xyz/utils@0.2.1-beta-v6(transitive)
- Removed@poap-xyz/providers@0.2.1-beta-v5(transitive)
- Removed@poap-xyz/utils@0.2.1-beta-v5(transitive)