diff --git a/packages/utils/src/constants/address.ts b/packages/utils/src/constants/address.ts new file mode 100644 index 0000000..beb1658 --- /dev/null +++ b/packages/utils/src/constants/address.ts @@ -0,0 +1,2 @@ +export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; +export const DEAD_ADDRESS = '0x000000000000000000000000000000000000dead'; diff --git a/packages/utils/src/constants/index.ts b/packages/utils/src/constants/index.ts new file mode 100644 index 0000000..cef1680 --- /dev/null +++ b/packages/utils/src/constants/index.ts @@ -0,0 +1 @@ +export * from './address'; diff --git a/packages/utils/src/index.ts b/packages/utils/src/index.ts index c864bc3..3198a64 100644 --- a/packages/utils/src/index.ts +++ b/packages/utils/src/index.ts @@ -1,4 +1,5 @@ export * from './types'; +export * from './constants'; export * from './functions'; export * from './queries'; export * from './format'; diff --git a/packages/utils/src/queries/filter.ts b/packages/utils/src/queries/filter.ts index 01b50b4..8bee051 100644 --- a/packages/utils/src/queries/filter.ts +++ b/packages/utils/src/queries/filter.ts @@ -12,6 +12,7 @@ import { NinFilter, Value, } from '../types/filter'; +import { ZERO_ADDRESS, DEAD_ADDRESS } from '../constants'; export function createLikeFilter( key: string, @@ -63,20 +64,17 @@ export function createNotNullAddressFilter( ): FieldFilter> | FieldFilter> { if (filterZeroAddress && filterDeadAddress) { return createField>(key, { - _nin: [ - '0x0000000000000000000000000000000000000000', - '0x000000000000000000000000000000000000dead', - ], + _nin: [ZERO_ADDRESS, DEAD_ADDRESS], }); } if (filterZeroAddress) { return createField>(key, { - _neq: '0x0000000000000000000000000000000000000000', + _neq: ZERO_ADDRESS, }); } if (filterDeadAddress) { return createField>(key, { - _neq: '0x000000000000000000000000000000000000dead', + _neq: DEAD_ADDRESS, }); } return {};