diff --git a/carbonmark-api/src/.generated/mocks/icr.mocks.ts b/carbonmark-api/src/.generated/mocks/icr.mocks.ts new file mode 100644 index 0000000000..0317d8f3f2 --- /dev/null +++ b/carbonmark-api/src/.generated/mocks/icr.mocks.ts @@ -0,0 +1,1070 @@ +//@ts-nocheck +import { BlockChangedFilter, Block_Height, Cancellation, Cancellation_Filter, ExAnte, ExAnteHolder, ExAnteHolder_Filter, ExAnte_Filter, ExPost, ExPostHolder, ExPostHolder_Filter, ExPost_Filter, Holder, Holder_Filter, Project, Project_Filter, Query, RetirementCertificate, RetirementCertificate_Filter, Subscription, _Block_, _Meta_, Cancellation_OrderBy, ExAnteHolder_OrderBy, ExAnte_OrderBy, ExPostHolder_OrderBy, ExPost_OrderBy, Holder_OrderBy, OrderDirection, Project_OrderBy, RetirementCertificate_OrderBy, _SubgraphErrorPolicy_ } from '../types/icr.types'; + +export const aBlockChangedFilter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): BlockChangedFilter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('BlockChangedFilter'); + return { + number_gte: overrides && overrides.hasOwnProperty('number_gte') ? overrides.number_gte! : 4175, + }; +}; + +export const aBlock_Height = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Block_Height => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Block_Height'); + return { + hash: overrides && overrides.hasOwnProperty('hash') ? overrides.hash! : 'ut', + number: overrides && overrides.hasOwnProperty('number') ? overrides.number! : 6885, + number_gte: overrides && overrides.hasOwnProperty('number_gte') ? overrides.number_gte! : 5347, + }; +}; + +export const aCancellation = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Cancellation => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Cancellation'); + return { + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + cancelledBy: overrides && overrides.hasOwnProperty('cancelledBy') ? overrides.cancelledBy! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'cumque', + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'blanditiis', + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'magni', + }; +}; + +export const aCancellation_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Cancellation_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Cancellation_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + amount_gt: overrides && overrides.hasOwnProperty('amount_gt') ? overrides.amount_gt! : '100000000000000000000', + amount_gte: overrides && overrides.hasOwnProperty('amount_gte') ? overrides.amount_gte! : '100000000000000000000', + amount_in: overrides && overrides.hasOwnProperty('amount_in') ? overrides.amount_in! : ['100000000000000000000'], + amount_lt: overrides && overrides.hasOwnProperty('amount_lt') ? overrides.amount_lt! : '100000000000000000000', + amount_lte: overrides && overrides.hasOwnProperty('amount_lte') ? overrides.amount_lte! : '100000000000000000000', + amount_not: overrides && overrides.hasOwnProperty('amount_not') ? overrides.amount_not! : '100000000000000000000', + amount_not_in: overrides && overrides.hasOwnProperty('amount_not_in') ? overrides.amount_not_in! : ['100000000000000000000'], + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('Cancellation_Filter') ? {} as Cancellation_Filter : aCancellation_Filter({}, relationshipsToOmit)], + cancelledBy: overrides && overrides.hasOwnProperty('cancelledBy') ? overrides.cancelledBy! : 'aut', + cancelledBy_: overrides && overrides.hasOwnProperty('cancelledBy_') ? overrides.cancelledBy_! : relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit), + cancelledBy_contains: overrides && overrides.hasOwnProperty('cancelledBy_contains') ? overrides.cancelledBy_contains! : 'qui', + cancelledBy_contains_nocase: overrides && overrides.hasOwnProperty('cancelledBy_contains_nocase') ? overrides.cancelledBy_contains_nocase! : 'dolore', + cancelledBy_ends_with: overrides && overrides.hasOwnProperty('cancelledBy_ends_with') ? overrides.cancelledBy_ends_with! : 'qui', + cancelledBy_ends_with_nocase: overrides && overrides.hasOwnProperty('cancelledBy_ends_with_nocase') ? overrides.cancelledBy_ends_with_nocase! : 'autem', + cancelledBy_gt: overrides && overrides.hasOwnProperty('cancelledBy_gt') ? overrides.cancelledBy_gt! : 'repudiandae', + cancelledBy_gte: overrides && overrides.hasOwnProperty('cancelledBy_gte') ? overrides.cancelledBy_gte! : 'eligendi', + cancelledBy_in: overrides && overrides.hasOwnProperty('cancelledBy_in') ? overrides.cancelledBy_in! : ['nulla'], + cancelledBy_lt: overrides && overrides.hasOwnProperty('cancelledBy_lt') ? overrides.cancelledBy_lt! : 'necessitatibus', + cancelledBy_lte: overrides && overrides.hasOwnProperty('cancelledBy_lte') ? overrides.cancelledBy_lte! : 'ullam', + cancelledBy_not: overrides && overrides.hasOwnProperty('cancelledBy_not') ? overrides.cancelledBy_not! : 'laudantium', + cancelledBy_not_contains: overrides && overrides.hasOwnProperty('cancelledBy_not_contains') ? overrides.cancelledBy_not_contains! : 'laudantium', + cancelledBy_not_contains_nocase: overrides && overrides.hasOwnProperty('cancelledBy_not_contains_nocase') ? overrides.cancelledBy_not_contains_nocase! : 'minus', + cancelledBy_not_ends_with: overrides && overrides.hasOwnProperty('cancelledBy_not_ends_with') ? overrides.cancelledBy_not_ends_with! : 'ducimus', + cancelledBy_not_ends_with_nocase: overrides && overrides.hasOwnProperty('cancelledBy_not_ends_with_nocase') ? overrides.cancelledBy_not_ends_with_nocase! : 'ut', + cancelledBy_not_in: overrides && overrides.hasOwnProperty('cancelledBy_not_in') ? overrides.cancelledBy_not_in! : ['et'], + cancelledBy_not_starts_with: overrides && overrides.hasOwnProperty('cancelledBy_not_starts_with') ? overrides.cancelledBy_not_starts_with! : 'in', + cancelledBy_not_starts_with_nocase: overrides && overrides.hasOwnProperty('cancelledBy_not_starts_with_nocase') ? overrides.cancelledBy_not_starts_with_nocase! : 'quidem', + cancelledBy_starts_with: overrides && overrides.hasOwnProperty('cancelledBy_starts_with') ? overrides.cancelledBy_starts_with! : 'consequatur', + cancelledBy_starts_with_nocase: overrides && overrides.hasOwnProperty('cancelledBy_starts_with_nocase') ? overrides.cancelledBy_starts_with_nocase! : 'sint', + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + createdAt_gt: overrides && overrides.hasOwnProperty('createdAt_gt') ? overrides.createdAt_gt! : '100000000000000000000', + createdAt_gte: overrides && overrides.hasOwnProperty('createdAt_gte') ? overrides.createdAt_gte! : '100000000000000000000', + createdAt_in: overrides && overrides.hasOwnProperty('createdAt_in') ? overrides.createdAt_in! : ['100000000000000000000'], + createdAt_lt: overrides && overrides.hasOwnProperty('createdAt_lt') ? overrides.createdAt_lt! : '100000000000000000000', + createdAt_lte: overrides && overrides.hasOwnProperty('createdAt_lte') ? overrides.createdAt_lte! : '100000000000000000000', + createdAt_not: overrides && overrides.hasOwnProperty('createdAt_not') ? overrides.createdAt_not! : '100000000000000000000', + createdAt_not_in: overrides && overrides.hasOwnProperty('createdAt_not_in') ? overrides.createdAt_not_in! : ['100000000000000000000'], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : 'ut', + exPost_: overrides && overrides.hasOwnProperty('exPost_') ? overrides.exPost_! : relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit), + exPost_contains: overrides && overrides.hasOwnProperty('exPost_contains') ? overrides.exPost_contains! : 'omnis', + exPost_contains_nocase: overrides && overrides.hasOwnProperty('exPost_contains_nocase') ? overrides.exPost_contains_nocase! : 'qui', + exPost_ends_with: overrides && overrides.hasOwnProperty('exPost_ends_with') ? overrides.exPost_ends_with! : 'dolores', + exPost_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_ends_with_nocase') ? overrides.exPost_ends_with_nocase! : 'magnam', + exPost_gt: overrides && overrides.hasOwnProperty('exPost_gt') ? overrides.exPost_gt! : 'cupiditate', + exPost_gte: overrides && overrides.hasOwnProperty('exPost_gte') ? overrides.exPost_gte! : 'mollitia', + exPost_in: overrides && overrides.hasOwnProperty('exPost_in') ? overrides.exPost_in! : ['nesciunt'], + exPost_lt: overrides && overrides.hasOwnProperty('exPost_lt') ? overrides.exPost_lt! : 'consectetur', + exPost_lte: overrides && overrides.hasOwnProperty('exPost_lte') ? overrides.exPost_lte! : 'sunt', + exPost_not: overrides && overrides.hasOwnProperty('exPost_not') ? overrides.exPost_not! : 'dolor', + exPost_not_contains: overrides && overrides.hasOwnProperty('exPost_not_contains') ? overrides.exPost_not_contains! : 'facilis', + exPost_not_contains_nocase: overrides && overrides.hasOwnProperty('exPost_not_contains_nocase') ? overrides.exPost_not_contains_nocase! : 'quaerat', + exPost_not_ends_with: overrides && overrides.hasOwnProperty('exPost_not_ends_with') ? overrides.exPost_not_ends_with! : 'eveniet', + exPost_not_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_ends_with_nocase') ? overrides.exPost_not_ends_with_nocase! : 'quisquam', + exPost_not_in: overrides && overrides.hasOwnProperty('exPost_not_in') ? overrides.exPost_not_in! : ['nisi'], + exPost_not_starts_with: overrides && overrides.hasOwnProperty('exPost_not_starts_with') ? overrides.exPost_not_starts_with! : 'nam', + exPost_not_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_starts_with_nocase') ? overrides.exPost_not_starts_with_nocase! : 'quis', + exPost_starts_with: overrides && overrides.hasOwnProperty('exPost_starts_with') ? overrides.exPost_starts_with! : 'accusamus', + exPost_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_starts_with_nocase') ? overrides.exPost_starts_with_nocase! : 'doloribus', + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'exercitationem', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'necessitatibus', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'autem', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'enim', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['possimus'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'fugit', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'quia', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'repellendus', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'itaque', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['in'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('Cancellation_Filter') ? {} as Cancellation_Filter : aCancellation_Filter({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : 'quis', + project_: overrides && overrides.hasOwnProperty('project_') ? overrides.project_! : relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit), + project_contains: overrides && overrides.hasOwnProperty('project_contains') ? overrides.project_contains! : 'dolorem', + project_contains_nocase: overrides && overrides.hasOwnProperty('project_contains_nocase') ? overrides.project_contains_nocase! : 'excepturi', + project_ends_with: overrides && overrides.hasOwnProperty('project_ends_with') ? overrides.project_ends_with! : 'aliquid', + project_ends_with_nocase: overrides && overrides.hasOwnProperty('project_ends_with_nocase') ? overrides.project_ends_with_nocase! : 'maxime', + project_gt: overrides && overrides.hasOwnProperty('project_gt') ? overrides.project_gt! : 'blanditiis', + project_gte: overrides && overrides.hasOwnProperty('project_gte') ? overrides.project_gte! : 'minima', + project_in: overrides && overrides.hasOwnProperty('project_in') ? overrides.project_in! : ['quisquam'], + project_lt: overrides && overrides.hasOwnProperty('project_lt') ? overrides.project_lt! : 'dolorum', + project_lte: overrides && overrides.hasOwnProperty('project_lte') ? overrides.project_lte! : 'tenetur', + project_not: overrides && overrides.hasOwnProperty('project_not') ? overrides.project_not! : 'consequatur', + project_not_contains: overrides && overrides.hasOwnProperty('project_not_contains') ? overrides.project_not_contains! : 'harum', + project_not_contains_nocase: overrides && overrides.hasOwnProperty('project_not_contains_nocase') ? overrides.project_not_contains_nocase! : 'voluptatem', + project_not_ends_with: overrides && overrides.hasOwnProperty('project_not_ends_with') ? overrides.project_not_ends_with! : 'ipsum', + project_not_ends_with_nocase: overrides && overrides.hasOwnProperty('project_not_ends_with_nocase') ? overrides.project_not_ends_with_nocase! : 'amet', + project_not_in: overrides && overrides.hasOwnProperty('project_not_in') ? overrides.project_not_in! : ['voluptates'], + project_not_starts_with: overrides && overrides.hasOwnProperty('project_not_starts_with') ? overrides.project_not_starts_with! : 'numquam', + project_not_starts_with_nocase: overrides && overrides.hasOwnProperty('project_not_starts_with_nocase') ? overrides.project_not_starts_with_nocase! : 'aut', + project_starts_with: overrides && overrides.hasOwnProperty('project_starts_with') ? overrides.project_starts_with! : 'velit', + project_starts_with_nocase: overrides && overrides.hasOwnProperty('project_starts_with_nocase') ? overrides.project_starts_with_nocase! : 'in', + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'est', + serialization_contains: overrides && overrides.hasOwnProperty('serialization_contains') ? overrides.serialization_contains! : 'ut', + serialization_contains_nocase: overrides && overrides.hasOwnProperty('serialization_contains_nocase') ? overrides.serialization_contains_nocase! : 'non', + serialization_ends_with: overrides && overrides.hasOwnProperty('serialization_ends_with') ? overrides.serialization_ends_with! : 'nemo', + serialization_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_ends_with_nocase') ? overrides.serialization_ends_with_nocase! : 'ea', + serialization_gt: overrides && overrides.hasOwnProperty('serialization_gt') ? overrides.serialization_gt! : 'corrupti', + serialization_gte: overrides && overrides.hasOwnProperty('serialization_gte') ? overrides.serialization_gte! : 'fugiat', + serialization_in: overrides && overrides.hasOwnProperty('serialization_in') ? overrides.serialization_in! : ['atque'], + serialization_lt: overrides && overrides.hasOwnProperty('serialization_lt') ? overrides.serialization_lt! : 'neque', + serialization_lte: overrides && overrides.hasOwnProperty('serialization_lte') ? overrides.serialization_lte! : 'voluptas', + serialization_not: overrides && overrides.hasOwnProperty('serialization_not') ? overrides.serialization_not! : 'officia', + serialization_not_contains: overrides && overrides.hasOwnProperty('serialization_not_contains') ? overrides.serialization_not_contains! : 'eligendi', + serialization_not_contains_nocase: overrides && overrides.hasOwnProperty('serialization_not_contains_nocase') ? overrides.serialization_not_contains_nocase! : 'unde', + serialization_not_ends_with: overrides && overrides.hasOwnProperty('serialization_not_ends_with') ? overrides.serialization_not_ends_with! : 'ut', + serialization_not_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_ends_with_nocase') ? overrides.serialization_not_ends_with_nocase! : 'qui', + serialization_not_in: overrides && overrides.hasOwnProperty('serialization_not_in') ? overrides.serialization_not_in! : ['quia'], + serialization_not_starts_with: overrides && overrides.hasOwnProperty('serialization_not_starts_with') ? overrides.serialization_not_starts_with! : 'harum', + serialization_not_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_starts_with_nocase') ? overrides.serialization_not_starts_with_nocase! : 'et', + serialization_starts_with: overrides && overrides.hasOwnProperty('serialization_starts_with') ? overrides.serialization_starts_with! : 'similique', + serialization_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_starts_with_nocase') ? overrides.serialization_starts_with_nocase! : 'voluptatem', + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'maiores', + transactionHash_contains: overrides && overrides.hasOwnProperty('transactionHash_contains') ? overrides.transactionHash_contains! : 'quasi', + transactionHash_gt: overrides && overrides.hasOwnProperty('transactionHash_gt') ? overrides.transactionHash_gt! : 'ad', + transactionHash_gte: overrides && overrides.hasOwnProperty('transactionHash_gte') ? overrides.transactionHash_gte! : 'dolorem', + transactionHash_in: overrides && overrides.hasOwnProperty('transactionHash_in') ? overrides.transactionHash_in! : ['facilis'], + transactionHash_lt: overrides && overrides.hasOwnProperty('transactionHash_lt') ? overrides.transactionHash_lt! : 'autem', + transactionHash_lte: overrides && overrides.hasOwnProperty('transactionHash_lte') ? overrides.transactionHash_lte! : 'quae', + transactionHash_not: overrides && overrides.hasOwnProperty('transactionHash_not') ? overrides.transactionHash_not! : 'sit', + transactionHash_not_contains: overrides && overrides.hasOwnProperty('transactionHash_not_contains') ? overrides.transactionHash_not_contains! : 'eum', + transactionHash_not_in: overrides && overrides.hasOwnProperty('transactionHash_not_in') ? overrides.transactionHash_not_in! : ['similique'], + }; +}; + +export const anExAnte = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExAnte => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExAnte'); + return { + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + holders: overrides && overrides.hasOwnProperty('holders') ? overrides.holders! : [relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit)], + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'et', + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'laudantium', + supply: overrides && overrides.hasOwnProperty('supply') ? overrides.supply! : '100000000000000000000', + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + }; +}; + +export const anExAnteHolder = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExAnteHolder => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExAnteHolder'); + return { + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + exAnte: overrides && overrides.hasOwnProperty('exAnte') ? overrides.exAnte! : relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit), + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'id', + updatedAt: overrides && overrides.hasOwnProperty('updatedAt') ? overrides.updatedAt! : '100000000000000000000', + }; +}; + +export const anExAnteHolder_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExAnteHolder_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExAnteHolder_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + amount_gt: overrides && overrides.hasOwnProperty('amount_gt') ? overrides.amount_gt! : '100000000000000000000', + amount_gte: overrides && overrides.hasOwnProperty('amount_gte') ? overrides.amount_gte! : '100000000000000000000', + amount_in: overrides && overrides.hasOwnProperty('amount_in') ? overrides.amount_in! : ['100000000000000000000'], + amount_lt: overrides && overrides.hasOwnProperty('amount_lt') ? overrides.amount_lt! : '100000000000000000000', + amount_lte: overrides && overrides.hasOwnProperty('amount_lte') ? overrides.amount_lte! : '100000000000000000000', + amount_not: overrides && overrides.hasOwnProperty('amount_not') ? overrides.amount_not! : '100000000000000000000', + amount_not_in: overrides && overrides.hasOwnProperty('amount_not_in') ? overrides.amount_not_in! : ['100000000000000000000'], + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('ExAnteHolder_Filter') ? {} as ExAnteHolder_Filter : anExAnteHolder_Filter({}, relationshipsToOmit)], + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + createdAt_gt: overrides && overrides.hasOwnProperty('createdAt_gt') ? overrides.createdAt_gt! : '100000000000000000000', + createdAt_gte: overrides && overrides.hasOwnProperty('createdAt_gte') ? overrides.createdAt_gte! : '100000000000000000000', + createdAt_in: overrides && overrides.hasOwnProperty('createdAt_in') ? overrides.createdAt_in! : ['100000000000000000000'], + createdAt_lt: overrides && overrides.hasOwnProperty('createdAt_lt') ? overrides.createdAt_lt! : '100000000000000000000', + createdAt_lte: overrides && overrides.hasOwnProperty('createdAt_lte') ? overrides.createdAt_lte! : '100000000000000000000', + createdAt_not: overrides && overrides.hasOwnProperty('createdAt_not') ? overrides.createdAt_not! : '100000000000000000000', + createdAt_not_in: overrides && overrides.hasOwnProperty('createdAt_not_in') ? overrides.createdAt_not_in! : ['100000000000000000000'], + exAnte: overrides && overrides.hasOwnProperty('exAnte') ? overrides.exAnte! : 'similique', + exAnte_: overrides && overrides.hasOwnProperty('exAnte_') ? overrides.exAnte_! : relationshipsToOmit.has('ExAnte_Filter') ? {} as ExAnte_Filter : anExAnte_Filter({}, relationshipsToOmit), + exAnte_contains: overrides && overrides.hasOwnProperty('exAnte_contains') ? overrides.exAnte_contains! : 'id', + exAnte_contains_nocase: overrides && overrides.hasOwnProperty('exAnte_contains_nocase') ? overrides.exAnte_contains_nocase! : 'dicta', + exAnte_ends_with: overrides && overrides.hasOwnProperty('exAnte_ends_with') ? overrides.exAnte_ends_with! : 'deserunt', + exAnte_ends_with_nocase: overrides && overrides.hasOwnProperty('exAnte_ends_with_nocase') ? overrides.exAnte_ends_with_nocase! : 'aut', + exAnte_gt: overrides && overrides.hasOwnProperty('exAnte_gt') ? overrides.exAnte_gt! : 'quo', + exAnte_gte: overrides && overrides.hasOwnProperty('exAnte_gte') ? overrides.exAnte_gte! : 'sit', + exAnte_in: overrides && overrides.hasOwnProperty('exAnte_in') ? overrides.exAnte_in! : ['facilis'], + exAnte_lt: overrides && overrides.hasOwnProperty('exAnte_lt') ? overrides.exAnte_lt! : 'ipsam', + exAnte_lte: overrides && overrides.hasOwnProperty('exAnte_lte') ? overrides.exAnte_lte! : 'consectetur', + exAnte_not: overrides && overrides.hasOwnProperty('exAnte_not') ? overrides.exAnte_not! : 'est', + exAnte_not_contains: overrides && overrides.hasOwnProperty('exAnte_not_contains') ? overrides.exAnte_not_contains! : 'iste', + exAnte_not_contains_nocase: overrides && overrides.hasOwnProperty('exAnte_not_contains_nocase') ? overrides.exAnte_not_contains_nocase! : 'quam', + exAnte_not_ends_with: overrides && overrides.hasOwnProperty('exAnte_not_ends_with') ? overrides.exAnte_not_ends_with! : 'nulla', + exAnte_not_ends_with_nocase: overrides && overrides.hasOwnProperty('exAnte_not_ends_with_nocase') ? overrides.exAnte_not_ends_with_nocase! : 'quos', + exAnte_not_in: overrides && overrides.hasOwnProperty('exAnte_not_in') ? overrides.exAnte_not_in! : ['reprehenderit'], + exAnte_not_starts_with: overrides && overrides.hasOwnProperty('exAnte_not_starts_with') ? overrides.exAnte_not_starts_with! : 'maiores', + exAnte_not_starts_with_nocase: overrides && overrides.hasOwnProperty('exAnte_not_starts_with_nocase') ? overrides.exAnte_not_starts_with_nocase! : 'eum', + exAnte_starts_with: overrides && overrides.hasOwnProperty('exAnte_starts_with') ? overrides.exAnte_starts_with! : 'non', + exAnte_starts_with_nocase: overrides && overrides.hasOwnProperty('exAnte_starts_with_nocase') ? overrides.exAnte_starts_with_nocase! : 'dicta', + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : 'qui', + holder_: overrides && overrides.hasOwnProperty('holder_') ? overrides.holder_! : relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit), + holder_contains: overrides && overrides.hasOwnProperty('holder_contains') ? overrides.holder_contains! : 'aut', + holder_contains_nocase: overrides && overrides.hasOwnProperty('holder_contains_nocase') ? overrides.holder_contains_nocase! : 'molestiae', + holder_ends_with: overrides && overrides.hasOwnProperty('holder_ends_with') ? overrides.holder_ends_with! : 'est', + holder_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_ends_with_nocase') ? overrides.holder_ends_with_nocase! : 'consequatur', + holder_gt: overrides && overrides.hasOwnProperty('holder_gt') ? overrides.holder_gt! : 'similique', + holder_gte: overrides && overrides.hasOwnProperty('holder_gte') ? overrides.holder_gte! : 'nemo', + holder_in: overrides && overrides.hasOwnProperty('holder_in') ? overrides.holder_in! : ['repellat'], + holder_lt: overrides && overrides.hasOwnProperty('holder_lt') ? overrides.holder_lt! : 'reiciendis', + holder_lte: overrides && overrides.hasOwnProperty('holder_lte') ? overrides.holder_lte! : 'vel', + holder_not: overrides && overrides.hasOwnProperty('holder_not') ? overrides.holder_not! : 'explicabo', + holder_not_contains: overrides && overrides.hasOwnProperty('holder_not_contains') ? overrides.holder_not_contains! : 'eaque', + holder_not_contains_nocase: overrides && overrides.hasOwnProperty('holder_not_contains_nocase') ? overrides.holder_not_contains_nocase! : 'quisquam', + holder_not_ends_with: overrides && overrides.hasOwnProperty('holder_not_ends_with') ? overrides.holder_not_ends_with! : 'omnis', + holder_not_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_not_ends_with_nocase') ? overrides.holder_not_ends_with_nocase! : 'soluta', + holder_not_in: overrides && overrides.hasOwnProperty('holder_not_in') ? overrides.holder_not_in! : ['eius'], + holder_not_starts_with: overrides && overrides.hasOwnProperty('holder_not_starts_with') ? overrides.holder_not_starts_with! : 'sunt', + holder_not_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_not_starts_with_nocase') ? overrides.holder_not_starts_with_nocase! : 'provident', + holder_starts_with: overrides && overrides.hasOwnProperty('holder_starts_with') ? overrides.holder_starts_with! : 'impedit', + holder_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_starts_with_nocase') ? overrides.holder_starts_with_nocase! : 'quo', + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'recusandae', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'recusandae', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'ea', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'et', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['optio'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'et', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'laborum', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'optio', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'eius', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['totam'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('ExAnteHolder_Filter') ? {} as ExAnteHolder_Filter : anExAnteHolder_Filter({}, relationshipsToOmit)], + updatedAt: overrides && overrides.hasOwnProperty('updatedAt') ? overrides.updatedAt! : '100000000000000000000', + updatedAt_gt: overrides && overrides.hasOwnProperty('updatedAt_gt') ? overrides.updatedAt_gt! : '100000000000000000000', + updatedAt_gte: overrides && overrides.hasOwnProperty('updatedAt_gte') ? overrides.updatedAt_gte! : '100000000000000000000', + updatedAt_in: overrides && overrides.hasOwnProperty('updatedAt_in') ? overrides.updatedAt_in! : ['100000000000000000000'], + updatedAt_lt: overrides && overrides.hasOwnProperty('updatedAt_lt') ? overrides.updatedAt_lt! : '100000000000000000000', + updatedAt_lte: overrides && overrides.hasOwnProperty('updatedAt_lte') ? overrides.updatedAt_lte! : '100000000000000000000', + updatedAt_not: overrides && overrides.hasOwnProperty('updatedAt_not') ? overrides.updatedAt_not! : '100000000000000000000', + updatedAt_not_in: overrides && overrides.hasOwnProperty('updatedAt_not_in') ? overrides.updatedAt_not_in! : ['100000000000000000000'], + }; +}; + +export const anExAnte_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExAnte_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExAnte_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('ExAnte_Filter') ? {} as ExAnte_Filter : anExAnte_Filter({}, relationshipsToOmit)], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : 'omnis', + exPost_: overrides && overrides.hasOwnProperty('exPost_') ? overrides.exPost_! : relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit), + exPost_contains: overrides && overrides.hasOwnProperty('exPost_contains') ? overrides.exPost_contains! : 'sunt', + exPost_contains_nocase: overrides && overrides.hasOwnProperty('exPost_contains_nocase') ? overrides.exPost_contains_nocase! : 'commodi', + exPost_ends_with: overrides && overrides.hasOwnProperty('exPost_ends_with') ? overrides.exPost_ends_with! : 'modi', + exPost_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_ends_with_nocase') ? overrides.exPost_ends_with_nocase! : 'aut', + exPost_gt: overrides && overrides.hasOwnProperty('exPost_gt') ? overrides.exPost_gt! : 'unde', + exPost_gte: overrides && overrides.hasOwnProperty('exPost_gte') ? overrides.exPost_gte! : 'omnis', + exPost_in: overrides && overrides.hasOwnProperty('exPost_in') ? overrides.exPost_in! : ['aut'], + exPost_lt: overrides && overrides.hasOwnProperty('exPost_lt') ? overrides.exPost_lt! : 'quisquam', + exPost_lte: overrides && overrides.hasOwnProperty('exPost_lte') ? overrides.exPost_lte! : 'vel', + exPost_not: overrides && overrides.hasOwnProperty('exPost_not') ? overrides.exPost_not! : 'porro', + exPost_not_contains: overrides && overrides.hasOwnProperty('exPost_not_contains') ? overrides.exPost_not_contains! : 'reiciendis', + exPost_not_contains_nocase: overrides && overrides.hasOwnProperty('exPost_not_contains_nocase') ? overrides.exPost_not_contains_nocase! : 'ratione', + exPost_not_ends_with: overrides && overrides.hasOwnProperty('exPost_not_ends_with') ? overrides.exPost_not_ends_with! : 'odio', + exPost_not_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_ends_with_nocase') ? overrides.exPost_not_ends_with_nocase! : 'enim', + exPost_not_in: overrides && overrides.hasOwnProperty('exPost_not_in') ? overrides.exPost_not_in! : ['cum'], + exPost_not_starts_with: overrides && overrides.hasOwnProperty('exPost_not_starts_with') ? overrides.exPost_not_starts_with! : 'ea', + exPost_not_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_starts_with_nocase') ? overrides.exPost_not_starts_with_nocase! : 'hic', + exPost_starts_with: overrides && overrides.hasOwnProperty('exPost_starts_with') ? overrides.exPost_starts_with! : 'corrupti', + exPost_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_starts_with_nocase') ? overrides.exPost_starts_with_nocase! : 'aut', + holders_: overrides && overrides.hasOwnProperty('holders_') ? overrides.holders_! : relationshipsToOmit.has('ExAnteHolder_Filter') ? {} as ExAnteHolder_Filter : anExAnteHolder_Filter({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'molestiae', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'maiores', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'provident', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'voluptas', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['ut'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'voluptas', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'dolore', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'dolores', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'molestiae', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['molestiae'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('ExAnte_Filter') ? {} as ExAnte_Filter : anExAnte_Filter({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : 'id', + project_: overrides && overrides.hasOwnProperty('project_') ? overrides.project_! : relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit), + project_contains: overrides && overrides.hasOwnProperty('project_contains') ? overrides.project_contains! : 'nihil', + project_contains_nocase: overrides && overrides.hasOwnProperty('project_contains_nocase') ? overrides.project_contains_nocase! : 'dolores', + project_ends_with: overrides && overrides.hasOwnProperty('project_ends_with') ? overrides.project_ends_with! : 'tenetur', + project_ends_with_nocase: overrides && overrides.hasOwnProperty('project_ends_with_nocase') ? overrides.project_ends_with_nocase! : 'commodi', + project_gt: overrides && overrides.hasOwnProperty('project_gt') ? overrides.project_gt! : 'qui', + project_gte: overrides && overrides.hasOwnProperty('project_gte') ? overrides.project_gte! : 'distinctio', + project_in: overrides && overrides.hasOwnProperty('project_in') ? overrides.project_in! : ['omnis'], + project_lt: overrides && overrides.hasOwnProperty('project_lt') ? overrides.project_lt! : 'distinctio', + project_lte: overrides && overrides.hasOwnProperty('project_lte') ? overrides.project_lte! : 'voluptatem', + project_not: overrides && overrides.hasOwnProperty('project_not') ? overrides.project_not! : 'sed', + project_not_contains: overrides && overrides.hasOwnProperty('project_not_contains') ? overrides.project_not_contains! : 'esse', + project_not_contains_nocase: overrides && overrides.hasOwnProperty('project_not_contains_nocase') ? overrides.project_not_contains_nocase! : 'quos', + project_not_ends_with: overrides && overrides.hasOwnProperty('project_not_ends_with') ? overrides.project_not_ends_with! : 'maxime', + project_not_ends_with_nocase: overrides && overrides.hasOwnProperty('project_not_ends_with_nocase') ? overrides.project_not_ends_with_nocase! : 'corrupti', + project_not_in: overrides && overrides.hasOwnProperty('project_not_in') ? overrides.project_not_in! : ['minus'], + project_not_starts_with: overrides && overrides.hasOwnProperty('project_not_starts_with') ? overrides.project_not_starts_with! : 'consequatur', + project_not_starts_with_nocase: overrides && overrides.hasOwnProperty('project_not_starts_with_nocase') ? overrides.project_not_starts_with_nocase! : 'ut', + project_starts_with: overrides && overrides.hasOwnProperty('project_starts_with') ? overrides.project_starts_with! : 'exercitationem', + project_starts_with_nocase: overrides && overrides.hasOwnProperty('project_starts_with_nocase') ? overrides.project_starts_with_nocase! : 'corrupti', + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'temporibus', + serialization_contains: overrides && overrides.hasOwnProperty('serialization_contains') ? overrides.serialization_contains! : 'quos', + serialization_contains_nocase: overrides && overrides.hasOwnProperty('serialization_contains_nocase') ? overrides.serialization_contains_nocase! : 'dicta', + serialization_ends_with: overrides && overrides.hasOwnProperty('serialization_ends_with') ? overrides.serialization_ends_with! : 'sint', + serialization_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_ends_with_nocase') ? overrides.serialization_ends_with_nocase! : 'est', + serialization_gt: overrides && overrides.hasOwnProperty('serialization_gt') ? overrides.serialization_gt! : 'eos', + serialization_gte: overrides && overrides.hasOwnProperty('serialization_gte') ? overrides.serialization_gte! : 'qui', + serialization_in: overrides && overrides.hasOwnProperty('serialization_in') ? overrides.serialization_in! : ['illum'], + serialization_lt: overrides && overrides.hasOwnProperty('serialization_lt') ? overrides.serialization_lt! : 'commodi', + serialization_lte: overrides && overrides.hasOwnProperty('serialization_lte') ? overrides.serialization_lte! : 'et', + serialization_not: overrides && overrides.hasOwnProperty('serialization_not') ? overrides.serialization_not! : 'velit', + serialization_not_contains: overrides && overrides.hasOwnProperty('serialization_not_contains') ? overrides.serialization_not_contains! : 'tempore', + serialization_not_contains_nocase: overrides && overrides.hasOwnProperty('serialization_not_contains_nocase') ? overrides.serialization_not_contains_nocase! : 'voluptatum', + serialization_not_ends_with: overrides && overrides.hasOwnProperty('serialization_not_ends_with') ? overrides.serialization_not_ends_with! : 'aliquam', + serialization_not_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_ends_with_nocase') ? overrides.serialization_not_ends_with_nocase! : 'fuga', + serialization_not_in: overrides && overrides.hasOwnProperty('serialization_not_in') ? overrides.serialization_not_in! : ['tenetur'], + serialization_not_starts_with: overrides && overrides.hasOwnProperty('serialization_not_starts_with') ? overrides.serialization_not_starts_with! : 'dolores', + serialization_not_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_starts_with_nocase') ? overrides.serialization_not_starts_with_nocase! : 'blanditiis', + serialization_starts_with: overrides && overrides.hasOwnProperty('serialization_starts_with') ? overrides.serialization_starts_with! : 'quibusdam', + serialization_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_starts_with_nocase') ? overrides.serialization_starts_with_nocase! : 'dolor', + supply: overrides && overrides.hasOwnProperty('supply') ? overrides.supply! : '100000000000000000000', + supply_gt: overrides && overrides.hasOwnProperty('supply_gt') ? overrides.supply_gt! : '100000000000000000000', + supply_gte: overrides && overrides.hasOwnProperty('supply_gte') ? overrides.supply_gte! : '100000000000000000000', + supply_in: overrides && overrides.hasOwnProperty('supply_in') ? overrides.supply_in! : ['100000000000000000000'], + supply_lt: overrides && overrides.hasOwnProperty('supply_lt') ? overrides.supply_lt! : '100000000000000000000', + supply_lte: overrides && overrides.hasOwnProperty('supply_lte') ? overrides.supply_lte! : '100000000000000000000', + supply_not: overrides && overrides.hasOwnProperty('supply_not') ? overrides.supply_not! : '100000000000000000000', + supply_not_in: overrides && overrides.hasOwnProperty('supply_not_in') ? overrides.supply_not_in! : ['100000000000000000000'], + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + tokenId_gt: overrides && overrides.hasOwnProperty('tokenId_gt') ? overrides.tokenId_gt! : '100000000000000000000', + tokenId_gte: overrides && overrides.hasOwnProperty('tokenId_gte') ? overrides.tokenId_gte! : '100000000000000000000', + tokenId_in: overrides && overrides.hasOwnProperty('tokenId_in') ? overrides.tokenId_in! : ['100000000000000000000'], + tokenId_lt: overrides && overrides.hasOwnProperty('tokenId_lt') ? overrides.tokenId_lt! : '100000000000000000000', + tokenId_lte: overrides && overrides.hasOwnProperty('tokenId_lte') ? overrides.tokenId_lte! : '100000000000000000000', + tokenId_not: overrides && overrides.hasOwnProperty('tokenId_not') ? overrides.tokenId_not! : '100000000000000000000', + tokenId_not_in: overrides && overrides.hasOwnProperty('tokenId_not_in') ? overrides.tokenId_not_in! : ['100000000000000000000'], + }; +}; + +export const anExPost = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExPost => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExPost'); + return { + cancellations: overrides && overrides.hasOwnProperty('cancellations') ? overrides.cancellations! : [relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit)], + cancelledAmount: overrides && overrides.hasOwnProperty('cancelledAmount') ? overrides.cancelledAmount! : '100000000000000000000', + estimatedAmount: overrides && overrides.hasOwnProperty('estimatedAmount') ? overrides.estimatedAmount! : '100000000000000000000', + exAnte: overrides && overrides.hasOwnProperty('exAnte') ? overrides.exAnte! : relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit), + holders: overrides && overrides.hasOwnProperty('holders') ? overrides.holders! : [relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit)], + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'ab', + lastVerificationTimestamp: overrides && overrides.hasOwnProperty('lastVerificationTimestamp') ? overrides.lastVerificationTimestamp! : '100000000000000000000', + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + retirementCertificates: overrides && overrides.hasOwnProperty('retirementCertificates') ? overrides.retirementCertificates! : [relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit)], + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'in', + supply: overrides && overrides.hasOwnProperty('supply') ? overrides.supply! : '100000000000000000000', + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + verificationPeriodEnd: overrides && overrides.hasOwnProperty('verificationPeriodEnd') ? overrides.verificationPeriodEnd! : '100000000000000000000', + verificationPeriodStart: overrides && overrides.hasOwnProperty('verificationPeriodStart') ? overrides.verificationPeriodStart! : '100000000000000000000', + vintage: overrides && overrides.hasOwnProperty('vintage') ? overrides.vintage! : 'at', + }; +}; + +export const anExPostHolder = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExPostHolder => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExPostHolder'); + return { + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'doloribus', + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + updatedAt: overrides && overrides.hasOwnProperty('updatedAt') ? overrides.updatedAt! : '100000000000000000000', + }; +}; + +export const anExPostHolder_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExPostHolder_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExPostHolder_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + amount_gt: overrides && overrides.hasOwnProperty('amount_gt') ? overrides.amount_gt! : '100000000000000000000', + amount_gte: overrides && overrides.hasOwnProperty('amount_gte') ? overrides.amount_gte! : '100000000000000000000', + amount_in: overrides && overrides.hasOwnProperty('amount_in') ? overrides.amount_in! : ['100000000000000000000'], + amount_lt: overrides && overrides.hasOwnProperty('amount_lt') ? overrides.amount_lt! : '100000000000000000000', + amount_lte: overrides && overrides.hasOwnProperty('amount_lte') ? overrides.amount_lte! : '100000000000000000000', + amount_not: overrides && overrides.hasOwnProperty('amount_not') ? overrides.amount_not! : '100000000000000000000', + amount_not_in: overrides && overrides.hasOwnProperty('amount_not_in') ? overrides.amount_not_in! : ['100000000000000000000'], + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('ExPostHolder_Filter') ? {} as ExPostHolder_Filter : anExPostHolder_Filter({}, relationshipsToOmit)], + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + createdAt_gt: overrides && overrides.hasOwnProperty('createdAt_gt') ? overrides.createdAt_gt! : '100000000000000000000', + createdAt_gte: overrides && overrides.hasOwnProperty('createdAt_gte') ? overrides.createdAt_gte! : '100000000000000000000', + createdAt_in: overrides && overrides.hasOwnProperty('createdAt_in') ? overrides.createdAt_in! : ['100000000000000000000'], + createdAt_lt: overrides && overrides.hasOwnProperty('createdAt_lt') ? overrides.createdAt_lt! : '100000000000000000000', + createdAt_lte: overrides && overrides.hasOwnProperty('createdAt_lte') ? overrides.createdAt_lte! : '100000000000000000000', + createdAt_not: overrides && overrides.hasOwnProperty('createdAt_not') ? overrides.createdAt_not! : '100000000000000000000', + createdAt_not_in: overrides && overrides.hasOwnProperty('createdAt_not_in') ? overrides.createdAt_not_in! : ['100000000000000000000'], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : 'dolor', + exPost_: overrides && overrides.hasOwnProperty('exPost_') ? overrides.exPost_! : relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit), + exPost_contains: overrides && overrides.hasOwnProperty('exPost_contains') ? overrides.exPost_contains! : 'expedita', + exPost_contains_nocase: overrides && overrides.hasOwnProperty('exPost_contains_nocase') ? overrides.exPost_contains_nocase! : 'ut', + exPost_ends_with: overrides && overrides.hasOwnProperty('exPost_ends_with') ? overrides.exPost_ends_with! : 'voluptate', + exPost_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_ends_with_nocase') ? overrides.exPost_ends_with_nocase! : 'fugit', + exPost_gt: overrides && overrides.hasOwnProperty('exPost_gt') ? overrides.exPost_gt! : 'occaecati', + exPost_gte: overrides && overrides.hasOwnProperty('exPost_gte') ? overrides.exPost_gte! : 'quas', + exPost_in: overrides && overrides.hasOwnProperty('exPost_in') ? overrides.exPost_in! : ['eaque'], + exPost_lt: overrides && overrides.hasOwnProperty('exPost_lt') ? overrides.exPost_lt! : 'incidunt', + exPost_lte: overrides && overrides.hasOwnProperty('exPost_lte') ? overrides.exPost_lte! : 'dolorem', + exPost_not: overrides && overrides.hasOwnProperty('exPost_not') ? overrides.exPost_not! : 'velit', + exPost_not_contains: overrides && overrides.hasOwnProperty('exPost_not_contains') ? overrides.exPost_not_contains! : 'numquam', + exPost_not_contains_nocase: overrides && overrides.hasOwnProperty('exPost_not_contains_nocase') ? overrides.exPost_not_contains_nocase! : 'eius', + exPost_not_ends_with: overrides && overrides.hasOwnProperty('exPost_not_ends_with') ? overrides.exPost_not_ends_with! : 'ut', + exPost_not_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_ends_with_nocase') ? overrides.exPost_not_ends_with_nocase! : 'mollitia', + exPost_not_in: overrides && overrides.hasOwnProperty('exPost_not_in') ? overrides.exPost_not_in! : ['voluptatibus'], + exPost_not_starts_with: overrides && overrides.hasOwnProperty('exPost_not_starts_with') ? overrides.exPost_not_starts_with! : 'qui', + exPost_not_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_starts_with_nocase') ? overrides.exPost_not_starts_with_nocase! : 'fugit', + exPost_starts_with: overrides && overrides.hasOwnProperty('exPost_starts_with') ? overrides.exPost_starts_with! : 'necessitatibus', + exPost_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_starts_with_nocase') ? overrides.exPost_starts_with_nocase! : 'possimus', + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : 'sequi', + holder_: overrides && overrides.hasOwnProperty('holder_') ? overrides.holder_! : relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit), + holder_contains: overrides && overrides.hasOwnProperty('holder_contains') ? overrides.holder_contains! : 'in', + holder_contains_nocase: overrides && overrides.hasOwnProperty('holder_contains_nocase') ? overrides.holder_contains_nocase! : 'sit', + holder_ends_with: overrides && overrides.hasOwnProperty('holder_ends_with') ? overrides.holder_ends_with! : 'dolor', + holder_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_ends_with_nocase') ? overrides.holder_ends_with_nocase! : 'architecto', + holder_gt: overrides && overrides.hasOwnProperty('holder_gt') ? overrides.holder_gt! : 'unde', + holder_gte: overrides && overrides.hasOwnProperty('holder_gte') ? overrides.holder_gte! : 'ipsa', + holder_in: overrides && overrides.hasOwnProperty('holder_in') ? overrides.holder_in! : ['iure'], + holder_lt: overrides && overrides.hasOwnProperty('holder_lt') ? overrides.holder_lt! : 'nisi', + holder_lte: overrides && overrides.hasOwnProperty('holder_lte') ? overrides.holder_lte! : 'necessitatibus', + holder_not: overrides && overrides.hasOwnProperty('holder_not') ? overrides.holder_not! : 'explicabo', + holder_not_contains: overrides && overrides.hasOwnProperty('holder_not_contains') ? overrides.holder_not_contains! : 'ab', + holder_not_contains_nocase: overrides && overrides.hasOwnProperty('holder_not_contains_nocase') ? overrides.holder_not_contains_nocase! : 'voluptatum', + holder_not_ends_with: overrides && overrides.hasOwnProperty('holder_not_ends_with') ? overrides.holder_not_ends_with! : 'et', + holder_not_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_not_ends_with_nocase') ? overrides.holder_not_ends_with_nocase! : 'et', + holder_not_in: overrides && overrides.hasOwnProperty('holder_not_in') ? overrides.holder_not_in! : ['vitae'], + holder_not_starts_with: overrides && overrides.hasOwnProperty('holder_not_starts_with') ? overrides.holder_not_starts_with! : 'optio', + holder_not_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_not_starts_with_nocase') ? overrides.holder_not_starts_with_nocase! : 'quaerat', + holder_starts_with: overrides && overrides.hasOwnProperty('holder_starts_with') ? overrides.holder_starts_with! : 'aut', + holder_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_starts_with_nocase') ? overrides.holder_starts_with_nocase! : 'facilis', + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'rerum', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'quam', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'ipsa', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'ut', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['aut'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'et', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'qui', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'similique', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'ut', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['illum'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('ExPostHolder_Filter') ? {} as ExPostHolder_Filter : anExPostHolder_Filter({}, relationshipsToOmit)], + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + retiredAmount_gt: overrides && overrides.hasOwnProperty('retiredAmount_gt') ? overrides.retiredAmount_gt! : '100000000000000000000', + retiredAmount_gte: overrides && overrides.hasOwnProperty('retiredAmount_gte') ? overrides.retiredAmount_gte! : '100000000000000000000', + retiredAmount_in: overrides && overrides.hasOwnProperty('retiredAmount_in') ? overrides.retiredAmount_in! : ['100000000000000000000'], + retiredAmount_lt: overrides && overrides.hasOwnProperty('retiredAmount_lt') ? overrides.retiredAmount_lt! : '100000000000000000000', + retiredAmount_lte: overrides && overrides.hasOwnProperty('retiredAmount_lte') ? overrides.retiredAmount_lte! : '100000000000000000000', + retiredAmount_not: overrides && overrides.hasOwnProperty('retiredAmount_not') ? overrides.retiredAmount_not! : '100000000000000000000', + retiredAmount_not_in: overrides && overrides.hasOwnProperty('retiredAmount_not_in') ? overrides.retiredAmount_not_in! : ['100000000000000000000'], + updatedAt: overrides && overrides.hasOwnProperty('updatedAt') ? overrides.updatedAt! : '100000000000000000000', + updatedAt_gt: overrides && overrides.hasOwnProperty('updatedAt_gt') ? overrides.updatedAt_gt! : '100000000000000000000', + updatedAt_gte: overrides && overrides.hasOwnProperty('updatedAt_gte') ? overrides.updatedAt_gte! : '100000000000000000000', + updatedAt_in: overrides && overrides.hasOwnProperty('updatedAt_in') ? overrides.updatedAt_in! : ['100000000000000000000'], + updatedAt_lt: overrides && overrides.hasOwnProperty('updatedAt_lt') ? overrides.updatedAt_lt! : '100000000000000000000', + updatedAt_lte: overrides && overrides.hasOwnProperty('updatedAt_lte') ? overrides.updatedAt_lte! : '100000000000000000000', + updatedAt_not: overrides && overrides.hasOwnProperty('updatedAt_not') ? overrides.updatedAt_not! : '100000000000000000000', + updatedAt_not_in: overrides && overrides.hasOwnProperty('updatedAt_not_in') ? overrides.updatedAt_not_in! : ['100000000000000000000'], + }; +}; + +export const anExPost_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): ExPost_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('ExPost_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit)], + cancellations_: overrides && overrides.hasOwnProperty('cancellations_') ? overrides.cancellations_! : relationshipsToOmit.has('Cancellation_Filter') ? {} as Cancellation_Filter : aCancellation_Filter({}, relationshipsToOmit), + cancelledAmount: overrides && overrides.hasOwnProperty('cancelledAmount') ? overrides.cancelledAmount! : '100000000000000000000', + cancelledAmount_gt: overrides && overrides.hasOwnProperty('cancelledAmount_gt') ? overrides.cancelledAmount_gt! : '100000000000000000000', + cancelledAmount_gte: overrides && overrides.hasOwnProperty('cancelledAmount_gte') ? overrides.cancelledAmount_gte! : '100000000000000000000', + cancelledAmount_in: overrides && overrides.hasOwnProperty('cancelledAmount_in') ? overrides.cancelledAmount_in! : ['100000000000000000000'], + cancelledAmount_lt: overrides && overrides.hasOwnProperty('cancelledAmount_lt') ? overrides.cancelledAmount_lt! : '100000000000000000000', + cancelledAmount_lte: overrides && overrides.hasOwnProperty('cancelledAmount_lte') ? overrides.cancelledAmount_lte! : '100000000000000000000', + cancelledAmount_not: overrides && overrides.hasOwnProperty('cancelledAmount_not') ? overrides.cancelledAmount_not! : '100000000000000000000', + cancelledAmount_not_in: overrides && overrides.hasOwnProperty('cancelledAmount_not_in') ? overrides.cancelledAmount_not_in! : ['100000000000000000000'], + estimatedAmount: overrides && overrides.hasOwnProperty('estimatedAmount') ? overrides.estimatedAmount! : '100000000000000000000', + estimatedAmount_gt: overrides && overrides.hasOwnProperty('estimatedAmount_gt') ? overrides.estimatedAmount_gt! : '100000000000000000000', + estimatedAmount_gte: overrides && overrides.hasOwnProperty('estimatedAmount_gte') ? overrides.estimatedAmount_gte! : '100000000000000000000', + estimatedAmount_in: overrides && overrides.hasOwnProperty('estimatedAmount_in') ? overrides.estimatedAmount_in! : ['100000000000000000000'], + estimatedAmount_lt: overrides && overrides.hasOwnProperty('estimatedAmount_lt') ? overrides.estimatedAmount_lt! : '100000000000000000000', + estimatedAmount_lte: overrides && overrides.hasOwnProperty('estimatedAmount_lte') ? overrides.estimatedAmount_lte! : '100000000000000000000', + estimatedAmount_not: overrides && overrides.hasOwnProperty('estimatedAmount_not') ? overrides.estimatedAmount_not! : '100000000000000000000', + estimatedAmount_not_in: overrides && overrides.hasOwnProperty('estimatedAmount_not_in') ? overrides.estimatedAmount_not_in! : ['100000000000000000000'], + exAnte_: overrides && overrides.hasOwnProperty('exAnte_') ? overrides.exAnte_! : relationshipsToOmit.has('ExAnte_Filter') ? {} as ExAnte_Filter : anExAnte_Filter({}, relationshipsToOmit), + holders_: overrides && overrides.hasOwnProperty('holders_') ? overrides.holders_! : relationshipsToOmit.has('ExPostHolder_Filter') ? {} as ExPostHolder_Filter : anExPostHolder_Filter({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'ab', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'repellat', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'commodi', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'natus', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['occaecati'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'iure', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'velit', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'beatae', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'cum', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['sint'], + lastVerificationTimestamp: overrides && overrides.hasOwnProperty('lastVerificationTimestamp') ? overrides.lastVerificationTimestamp! : '100000000000000000000', + lastVerificationTimestamp_gt: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_gt') ? overrides.lastVerificationTimestamp_gt! : '100000000000000000000', + lastVerificationTimestamp_gte: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_gte') ? overrides.lastVerificationTimestamp_gte! : '100000000000000000000', + lastVerificationTimestamp_in: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_in') ? overrides.lastVerificationTimestamp_in! : ['100000000000000000000'], + lastVerificationTimestamp_lt: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_lt') ? overrides.lastVerificationTimestamp_lt! : '100000000000000000000', + lastVerificationTimestamp_lte: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_lte') ? overrides.lastVerificationTimestamp_lte! : '100000000000000000000', + lastVerificationTimestamp_not: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_not') ? overrides.lastVerificationTimestamp_not! : '100000000000000000000', + lastVerificationTimestamp_not_in: overrides && overrides.hasOwnProperty('lastVerificationTimestamp_not_in') ? overrides.lastVerificationTimestamp_not_in! : ['100000000000000000000'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : 'minus', + project_: overrides && overrides.hasOwnProperty('project_') ? overrides.project_! : relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit), + project_contains: overrides && overrides.hasOwnProperty('project_contains') ? overrides.project_contains! : 'temporibus', + project_contains_nocase: overrides && overrides.hasOwnProperty('project_contains_nocase') ? overrides.project_contains_nocase! : 'illum', + project_ends_with: overrides && overrides.hasOwnProperty('project_ends_with') ? overrides.project_ends_with! : 'tempora', + project_ends_with_nocase: overrides && overrides.hasOwnProperty('project_ends_with_nocase') ? overrides.project_ends_with_nocase! : 'enim', + project_gt: overrides && overrides.hasOwnProperty('project_gt') ? overrides.project_gt! : 'et', + project_gte: overrides && overrides.hasOwnProperty('project_gte') ? overrides.project_gte! : 'suscipit', + project_in: overrides && overrides.hasOwnProperty('project_in') ? overrides.project_in! : ['unde'], + project_lt: overrides && overrides.hasOwnProperty('project_lt') ? overrides.project_lt! : 'sunt', + project_lte: overrides && overrides.hasOwnProperty('project_lte') ? overrides.project_lte! : 'quae', + project_not: overrides && overrides.hasOwnProperty('project_not') ? overrides.project_not! : 'molestiae', + project_not_contains: overrides && overrides.hasOwnProperty('project_not_contains') ? overrides.project_not_contains! : 'et', + project_not_contains_nocase: overrides && overrides.hasOwnProperty('project_not_contains_nocase') ? overrides.project_not_contains_nocase! : 'quidem', + project_not_ends_with: overrides && overrides.hasOwnProperty('project_not_ends_with') ? overrides.project_not_ends_with! : 'consequatur', + project_not_ends_with_nocase: overrides && overrides.hasOwnProperty('project_not_ends_with_nocase') ? overrides.project_not_ends_with_nocase! : 'eius', + project_not_in: overrides && overrides.hasOwnProperty('project_not_in') ? overrides.project_not_in! : ['quis'], + project_not_starts_with: overrides && overrides.hasOwnProperty('project_not_starts_with') ? overrides.project_not_starts_with! : 'velit', + project_not_starts_with_nocase: overrides && overrides.hasOwnProperty('project_not_starts_with_nocase') ? overrides.project_not_starts_with_nocase! : 'qui', + project_starts_with: overrides && overrides.hasOwnProperty('project_starts_with') ? overrides.project_starts_with! : 'iure', + project_starts_with_nocase: overrides && overrides.hasOwnProperty('project_starts_with_nocase') ? overrides.project_starts_with_nocase! : 'reprehenderit', + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + retiredAmount_gt: overrides && overrides.hasOwnProperty('retiredAmount_gt') ? overrides.retiredAmount_gt! : '100000000000000000000', + retiredAmount_gte: overrides && overrides.hasOwnProperty('retiredAmount_gte') ? overrides.retiredAmount_gte! : '100000000000000000000', + retiredAmount_in: overrides && overrides.hasOwnProperty('retiredAmount_in') ? overrides.retiredAmount_in! : ['100000000000000000000'], + retiredAmount_lt: overrides && overrides.hasOwnProperty('retiredAmount_lt') ? overrides.retiredAmount_lt! : '100000000000000000000', + retiredAmount_lte: overrides && overrides.hasOwnProperty('retiredAmount_lte') ? overrides.retiredAmount_lte! : '100000000000000000000', + retiredAmount_not: overrides && overrides.hasOwnProperty('retiredAmount_not') ? overrides.retiredAmount_not! : '100000000000000000000', + retiredAmount_not_in: overrides && overrides.hasOwnProperty('retiredAmount_not_in') ? overrides.retiredAmount_not_in! : ['100000000000000000000'], + retirementCertificates_: overrides && overrides.hasOwnProperty('retirementCertificates_') ? overrides.retirementCertificates_! : relationshipsToOmit.has('RetirementCertificate_Filter') ? {} as RetirementCertificate_Filter : aRetirementCertificate_Filter({}, relationshipsToOmit), + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'optio', + serialization_contains: overrides && overrides.hasOwnProperty('serialization_contains') ? overrides.serialization_contains! : 'et', + serialization_contains_nocase: overrides && overrides.hasOwnProperty('serialization_contains_nocase') ? overrides.serialization_contains_nocase! : 'suscipit', + serialization_ends_with: overrides && overrides.hasOwnProperty('serialization_ends_with') ? overrides.serialization_ends_with! : 'autem', + serialization_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_ends_with_nocase') ? overrides.serialization_ends_with_nocase! : 'iste', + serialization_gt: overrides && overrides.hasOwnProperty('serialization_gt') ? overrides.serialization_gt! : 'soluta', + serialization_gte: overrides && overrides.hasOwnProperty('serialization_gte') ? overrides.serialization_gte! : 'quisquam', + serialization_in: overrides && overrides.hasOwnProperty('serialization_in') ? overrides.serialization_in! : ['deserunt'], + serialization_lt: overrides && overrides.hasOwnProperty('serialization_lt') ? overrides.serialization_lt! : 'vero', + serialization_lte: overrides && overrides.hasOwnProperty('serialization_lte') ? overrides.serialization_lte! : 'fuga', + serialization_not: overrides && overrides.hasOwnProperty('serialization_not') ? overrides.serialization_not! : 'voluptas', + serialization_not_contains: overrides && overrides.hasOwnProperty('serialization_not_contains') ? overrides.serialization_not_contains! : 'ipsa', + serialization_not_contains_nocase: overrides && overrides.hasOwnProperty('serialization_not_contains_nocase') ? overrides.serialization_not_contains_nocase! : 'tempore', + serialization_not_ends_with: overrides && overrides.hasOwnProperty('serialization_not_ends_with') ? overrides.serialization_not_ends_with! : 'et', + serialization_not_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_ends_with_nocase') ? overrides.serialization_not_ends_with_nocase! : 'aut', + serialization_not_in: overrides && overrides.hasOwnProperty('serialization_not_in') ? overrides.serialization_not_in! : ['eveniet'], + serialization_not_starts_with: overrides && overrides.hasOwnProperty('serialization_not_starts_with') ? overrides.serialization_not_starts_with! : 'perspiciatis', + serialization_not_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_starts_with_nocase') ? overrides.serialization_not_starts_with_nocase! : 'voluptatum', + serialization_starts_with: overrides && overrides.hasOwnProperty('serialization_starts_with') ? overrides.serialization_starts_with! : 'quia', + serialization_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_starts_with_nocase') ? overrides.serialization_starts_with_nocase! : 'repudiandae', + supply: overrides && overrides.hasOwnProperty('supply') ? overrides.supply! : '100000000000000000000', + supply_gt: overrides && overrides.hasOwnProperty('supply_gt') ? overrides.supply_gt! : '100000000000000000000', + supply_gte: overrides && overrides.hasOwnProperty('supply_gte') ? overrides.supply_gte! : '100000000000000000000', + supply_in: overrides && overrides.hasOwnProperty('supply_in') ? overrides.supply_in! : ['100000000000000000000'], + supply_lt: overrides && overrides.hasOwnProperty('supply_lt') ? overrides.supply_lt! : '100000000000000000000', + supply_lte: overrides && overrides.hasOwnProperty('supply_lte') ? overrides.supply_lte! : '100000000000000000000', + supply_not: overrides && overrides.hasOwnProperty('supply_not') ? overrides.supply_not! : '100000000000000000000', + supply_not_in: overrides && overrides.hasOwnProperty('supply_not_in') ? overrides.supply_not_in! : ['100000000000000000000'], + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + tokenId_gt: overrides && overrides.hasOwnProperty('tokenId_gt') ? overrides.tokenId_gt! : '100000000000000000000', + tokenId_gte: overrides && overrides.hasOwnProperty('tokenId_gte') ? overrides.tokenId_gte! : '100000000000000000000', + tokenId_in: overrides && overrides.hasOwnProperty('tokenId_in') ? overrides.tokenId_in! : ['100000000000000000000'], + tokenId_lt: overrides && overrides.hasOwnProperty('tokenId_lt') ? overrides.tokenId_lt! : '100000000000000000000', + tokenId_lte: overrides && overrides.hasOwnProperty('tokenId_lte') ? overrides.tokenId_lte! : '100000000000000000000', + tokenId_not: overrides && overrides.hasOwnProperty('tokenId_not') ? overrides.tokenId_not! : '100000000000000000000', + tokenId_not_in: overrides && overrides.hasOwnProperty('tokenId_not_in') ? overrides.tokenId_not_in! : ['100000000000000000000'], + verificationPeriodEnd: overrides && overrides.hasOwnProperty('verificationPeriodEnd') ? overrides.verificationPeriodEnd! : '100000000000000000000', + verificationPeriodEnd_gt: overrides && overrides.hasOwnProperty('verificationPeriodEnd_gt') ? overrides.verificationPeriodEnd_gt! : '100000000000000000000', + verificationPeriodEnd_gte: overrides && overrides.hasOwnProperty('verificationPeriodEnd_gte') ? overrides.verificationPeriodEnd_gte! : '100000000000000000000', + verificationPeriodEnd_in: overrides && overrides.hasOwnProperty('verificationPeriodEnd_in') ? overrides.verificationPeriodEnd_in! : ['100000000000000000000'], + verificationPeriodEnd_lt: overrides && overrides.hasOwnProperty('verificationPeriodEnd_lt') ? overrides.verificationPeriodEnd_lt! : '100000000000000000000', + verificationPeriodEnd_lte: overrides && overrides.hasOwnProperty('verificationPeriodEnd_lte') ? overrides.verificationPeriodEnd_lte! : '100000000000000000000', + verificationPeriodEnd_not: overrides && overrides.hasOwnProperty('verificationPeriodEnd_not') ? overrides.verificationPeriodEnd_not! : '100000000000000000000', + verificationPeriodEnd_not_in: overrides && overrides.hasOwnProperty('verificationPeriodEnd_not_in') ? overrides.verificationPeriodEnd_not_in! : ['100000000000000000000'], + verificationPeriodStart: overrides && overrides.hasOwnProperty('verificationPeriodStart') ? overrides.verificationPeriodStart! : '100000000000000000000', + verificationPeriodStart_gt: overrides && overrides.hasOwnProperty('verificationPeriodStart_gt') ? overrides.verificationPeriodStart_gt! : '100000000000000000000', + verificationPeriodStart_gte: overrides && overrides.hasOwnProperty('verificationPeriodStart_gte') ? overrides.verificationPeriodStart_gte! : '100000000000000000000', + verificationPeriodStart_in: overrides && overrides.hasOwnProperty('verificationPeriodStart_in') ? overrides.verificationPeriodStart_in! : ['100000000000000000000'], + verificationPeriodStart_lt: overrides && overrides.hasOwnProperty('verificationPeriodStart_lt') ? overrides.verificationPeriodStart_lt! : '100000000000000000000', + verificationPeriodStart_lte: overrides && overrides.hasOwnProperty('verificationPeriodStart_lte') ? overrides.verificationPeriodStart_lte! : '100000000000000000000', + verificationPeriodStart_not: overrides && overrides.hasOwnProperty('verificationPeriodStart_not') ? overrides.verificationPeriodStart_not! : '100000000000000000000', + verificationPeriodStart_not_in: overrides && overrides.hasOwnProperty('verificationPeriodStart_not_in') ? overrides.verificationPeriodStart_not_in! : ['100000000000000000000'], + vintage: overrides && overrides.hasOwnProperty('vintage') ? overrides.vintage! : 'debitis', + vintage_contains: overrides && overrides.hasOwnProperty('vintage_contains') ? overrides.vintage_contains! : 'ut', + vintage_contains_nocase: overrides && overrides.hasOwnProperty('vintage_contains_nocase') ? overrides.vintage_contains_nocase! : 'dignissimos', + vintage_ends_with: overrides && overrides.hasOwnProperty('vintage_ends_with') ? overrides.vintage_ends_with! : 'et', + vintage_ends_with_nocase: overrides && overrides.hasOwnProperty('vintage_ends_with_nocase') ? overrides.vintage_ends_with_nocase! : 'voluptatem', + vintage_gt: overrides && overrides.hasOwnProperty('vintage_gt') ? overrides.vintage_gt! : 'quod', + vintage_gte: overrides && overrides.hasOwnProperty('vintage_gte') ? overrides.vintage_gte! : 'est', + vintage_in: overrides && overrides.hasOwnProperty('vintage_in') ? overrides.vintage_in! : ['dolorem'], + vintage_lt: overrides && overrides.hasOwnProperty('vintage_lt') ? overrides.vintage_lt! : 'reprehenderit', + vintage_lte: overrides && overrides.hasOwnProperty('vintage_lte') ? overrides.vintage_lte! : 'occaecati', + vintage_not: overrides && overrides.hasOwnProperty('vintage_not') ? overrides.vintage_not! : 'quos', + vintage_not_contains: overrides && overrides.hasOwnProperty('vintage_not_contains') ? overrides.vintage_not_contains! : 'voluptatibus', + vintage_not_contains_nocase: overrides && overrides.hasOwnProperty('vintage_not_contains_nocase') ? overrides.vintage_not_contains_nocase! : 'animi', + vintage_not_ends_with: overrides && overrides.hasOwnProperty('vintage_not_ends_with') ? overrides.vintage_not_ends_with! : 'porro', + vintage_not_ends_with_nocase: overrides && overrides.hasOwnProperty('vintage_not_ends_with_nocase') ? overrides.vintage_not_ends_with_nocase! : 'error', + vintage_not_in: overrides && overrides.hasOwnProperty('vintage_not_in') ? overrides.vintage_not_in! : ['nisi'], + vintage_not_starts_with: overrides && overrides.hasOwnProperty('vintage_not_starts_with') ? overrides.vintage_not_starts_with! : 'sapiente', + vintage_not_starts_with_nocase: overrides && overrides.hasOwnProperty('vintage_not_starts_with_nocase') ? overrides.vintage_not_starts_with_nocase! : 'reprehenderit', + vintage_starts_with: overrides && overrides.hasOwnProperty('vintage_starts_with') ? overrides.vintage_starts_with! : 'eaque', + vintage_starts_with_nocase: overrides && overrides.hasOwnProperty('vintage_starts_with_nocase') ? overrides.vintage_starts_with_nocase! : 'perferendis', + }; +}; + +export const aHolder = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Holder => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Holder'); + return { + address: overrides && overrides.hasOwnProperty('address') ? overrides.address! : 'provident', + cancellations: overrides && overrides.hasOwnProperty('cancellations') ? overrides.cancellations! : [relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit)], + cancelledAmount: overrides && overrides.hasOwnProperty('cancelledAmount') ? overrides.cancelledAmount! : '100000000000000000000', + exAnteAmounts: overrides && overrides.hasOwnProperty('exAnteAmounts') ? overrides.exAnteAmounts! : [relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit)], + exPostAmounts: overrides && overrides.hasOwnProperty('exPostAmounts') ? overrides.exPostAmounts! : [relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit)], + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'natus', + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + retirementCertificates: overrides && overrides.hasOwnProperty('retirementCertificates') ? overrides.retirementCertificates! : [relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit)], + }; +}; + +export const aHolder_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Holder_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Holder_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + address: overrides && overrides.hasOwnProperty('address') ? overrides.address! : 'qui', + address_contains: overrides && overrides.hasOwnProperty('address_contains') ? overrides.address_contains! : 'ea', + address_gt: overrides && overrides.hasOwnProperty('address_gt') ? overrides.address_gt! : 'labore', + address_gte: overrides && overrides.hasOwnProperty('address_gte') ? overrides.address_gte! : 'voluptatem', + address_in: overrides && overrides.hasOwnProperty('address_in') ? overrides.address_in! : ['dolores'], + address_lt: overrides && overrides.hasOwnProperty('address_lt') ? overrides.address_lt! : 'facere', + address_lte: overrides && overrides.hasOwnProperty('address_lte') ? overrides.address_lte! : 'quo', + address_not: overrides && overrides.hasOwnProperty('address_not') ? overrides.address_not! : 'et', + address_not_contains: overrides && overrides.hasOwnProperty('address_not_contains') ? overrides.address_not_contains! : 'voluptates', + address_not_in: overrides && overrides.hasOwnProperty('address_not_in') ? overrides.address_not_in! : ['voluptatum'], + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit)], + cancellations_: overrides && overrides.hasOwnProperty('cancellations_') ? overrides.cancellations_! : relationshipsToOmit.has('Cancellation_Filter') ? {} as Cancellation_Filter : aCancellation_Filter({}, relationshipsToOmit), + cancelledAmount: overrides && overrides.hasOwnProperty('cancelledAmount') ? overrides.cancelledAmount! : '100000000000000000000', + cancelledAmount_gt: overrides && overrides.hasOwnProperty('cancelledAmount_gt') ? overrides.cancelledAmount_gt! : '100000000000000000000', + cancelledAmount_gte: overrides && overrides.hasOwnProperty('cancelledAmount_gte') ? overrides.cancelledAmount_gte! : '100000000000000000000', + cancelledAmount_in: overrides && overrides.hasOwnProperty('cancelledAmount_in') ? overrides.cancelledAmount_in! : ['100000000000000000000'], + cancelledAmount_lt: overrides && overrides.hasOwnProperty('cancelledAmount_lt') ? overrides.cancelledAmount_lt! : '100000000000000000000', + cancelledAmount_lte: overrides && overrides.hasOwnProperty('cancelledAmount_lte') ? overrides.cancelledAmount_lte! : '100000000000000000000', + cancelledAmount_not: overrides && overrides.hasOwnProperty('cancelledAmount_not') ? overrides.cancelledAmount_not! : '100000000000000000000', + cancelledAmount_not_in: overrides && overrides.hasOwnProperty('cancelledAmount_not_in') ? overrides.cancelledAmount_not_in! : ['100000000000000000000'], + exAnteAmounts_: overrides && overrides.hasOwnProperty('exAnteAmounts_') ? overrides.exAnteAmounts_! : relationshipsToOmit.has('ExAnteHolder_Filter') ? {} as ExAnteHolder_Filter : anExAnteHolder_Filter({}, relationshipsToOmit), + exPostAmounts_: overrides && overrides.hasOwnProperty('exPostAmounts_') ? overrides.exPostAmounts_! : relationshipsToOmit.has('ExPostHolder_Filter') ? {} as ExPostHolder_Filter : anExPostHolder_Filter({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'sapiente', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'atque', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'excepturi', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'reiciendis', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['tempora'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'aut', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'minus', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'dolor', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'doloribus', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['veritatis'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit)], + retiredAmount: overrides && overrides.hasOwnProperty('retiredAmount') ? overrides.retiredAmount! : '100000000000000000000', + retiredAmount_gt: overrides && overrides.hasOwnProperty('retiredAmount_gt') ? overrides.retiredAmount_gt! : '100000000000000000000', + retiredAmount_gte: overrides && overrides.hasOwnProperty('retiredAmount_gte') ? overrides.retiredAmount_gte! : '100000000000000000000', + retiredAmount_in: overrides && overrides.hasOwnProperty('retiredAmount_in') ? overrides.retiredAmount_in! : ['100000000000000000000'], + retiredAmount_lt: overrides && overrides.hasOwnProperty('retiredAmount_lt') ? overrides.retiredAmount_lt! : '100000000000000000000', + retiredAmount_lte: overrides && overrides.hasOwnProperty('retiredAmount_lte') ? overrides.retiredAmount_lte! : '100000000000000000000', + retiredAmount_not: overrides && overrides.hasOwnProperty('retiredAmount_not') ? overrides.retiredAmount_not! : '100000000000000000000', + retiredAmount_not_in: overrides && overrides.hasOwnProperty('retiredAmount_not_in') ? overrides.retiredAmount_not_in! : ['100000000000000000000'], + retirementCertificates_: overrides && overrides.hasOwnProperty('retirementCertificates_') ? overrides.retirementCertificates_! : relationshipsToOmit.has('RetirementCertificate_Filter') ? {} as RetirementCertificate_Filter : aRetirementCertificate_Filter({}, relationshipsToOmit), + }; +}; + +export const aProject = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Project => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Project'); + return { + blockNumber: overrides && overrides.hasOwnProperty('blockNumber') ? overrides.blockNumber! : '100000000000000000000', + blockTimestamp: overrides && overrides.hasOwnProperty('blockTimestamp') ? overrides.blockTimestamp! : '100000000000000000000', + cancellations: overrides && overrides.hasOwnProperty('cancellations') ? overrides.cancellations! : [relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit)], + exAntes: overrides && overrides.hasOwnProperty('exAntes') ? overrides.exAntes! : [relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit)], + exPosts: overrides && overrides.hasOwnProperty('exPosts') ? overrides.exPosts! : [relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit)], + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'dolor', + projectAddress: overrides && overrides.hasOwnProperty('projectAddress') ? overrides.projectAddress! : 'consequatur', + projectId: overrides && overrides.hasOwnProperty('projectId') ? overrides.projectId! : '100000000000000000000', + projectName: overrides && overrides.hasOwnProperty('projectName') ? overrides.projectName! : 'tenetur', + retirementCertificates: overrides && overrides.hasOwnProperty('retirementCertificates') ? overrides.retirementCertificates! : [relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit)], + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'illo', + }; +}; + +export const aProject_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Project_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Project_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit)], + blockNumber: overrides && overrides.hasOwnProperty('blockNumber') ? overrides.blockNumber! : '100000000000000000000', + blockNumber_gt: overrides && overrides.hasOwnProperty('blockNumber_gt') ? overrides.blockNumber_gt! : '100000000000000000000', + blockNumber_gte: overrides && overrides.hasOwnProperty('blockNumber_gte') ? overrides.blockNumber_gte! : '100000000000000000000', + blockNumber_in: overrides && overrides.hasOwnProperty('blockNumber_in') ? overrides.blockNumber_in! : ['100000000000000000000'], + blockNumber_lt: overrides && overrides.hasOwnProperty('blockNumber_lt') ? overrides.blockNumber_lt! : '100000000000000000000', + blockNumber_lte: overrides && overrides.hasOwnProperty('blockNumber_lte') ? overrides.blockNumber_lte! : '100000000000000000000', + blockNumber_not: overrides && overrides.hasOwnProperty('blockNumber_not') ? overrides.blockNumber_not! : '100000000000000000000', + blockNumber_not_in: overrides && overrides.hasOwnProperty('blockNumber_not_in') ? overrides.blockNumber_not_in! : ['100000000000000000000'], + blockTimestamp: overrides && overrides.hasOwnProperty('blockTimestamp') ? overrides.blockTimestamp! : '100000000000000000000', + blockTimestamp_gt: overrides && overrides.hasOwnProperty('blockTimestamp_gt') ? overrides.blockTimestamp_gt! : '100000000000000000000', + blockTimestamp_gte: overrides && overrides.hasOwnProperty('blockTimestamp_gte') ? overrides.blockTimestamp_gte! : '100000000000000000000', + blockTimestamp_in: overrides && overrides.hasOwnProperty('blockTimestamp_in') ? overrides.blockTimestamp_in! : ['100000000000000000000'], + blockTimestamp_lt: overrides && overrides.hasOwnProperty('blockTimestamp_lt') ? overrides.blockTimestamp_lt! : '100000000000000000000', + blockTimestamp_lte: overrides && overrides.hasOwnProperty('blockTimestamp_lte') ? overrides.blockTimestamp_lte! : '100000000000000000000', + blockTimestamp_not: overrides && overrides.hasOwnProperty('blockTimestamp_not') ? overrides.blockTimestamp_not! : '100000000000000000000', + blockTimestamp_not_in: overrides && overrides.hasOwnProperty('blockTimestamp_not_in') ? overrides.blockTimestamp_not_in! : ['100000000000000000000'], + cancellations_: overrides && overrides.hasOwnProperty('cancellations_') ? overrides.cancellations_! : relationshipsToOmit.has('Cancellation_Filter') ? {} as Cancellation_Filter : aCancellation_Filter({}, relationshipsToOmit), + exAntes_: overrides && overrides.hasOwnProperty('exAntes_') ? overrides.exAntes_! : relationshipsToOmit.has('ExAnte_Filter') ? {} as ExAnte_Filter : anExAnte_Filter({}, relationshipsToOmit), + exPosts_: overrides && overrides.hasOwnProperty('exPosts_') ? overrides.exPosts_! : relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'molestiae', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'accusamus', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'id', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'perspiciatis', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['qui'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'sapiente', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'soluta', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'occaecati', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'et', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['ab'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit)], + projectAddress: overrides && overrides.hasOwnProperty('projectAddress') ? overrides.projectAddress! : 'nam', + projectAddress_contains: overrides && overrides.hasOwnProperty('projectAddress_contains') ? overrides.projectAddress_contains! : 'a', + projectAddress_gt: overrides && overrides.hasOwnProperty('projectAddress_gt') ? overrides.projectAddress_gt! : 'nam', + projectAddress_gte: overrides && overrides.hasOwnProperty('projectAddress_gte') ? overrides.projectAddress_gte! : 'ut', + projectAddress_in: overrides && overrides.hasOwnProperty('projectAddress_in') ? overrides.projectAddress_in! : ['at'], + projectAddress_lt: overrides && overrides.hasOwnProperty('projectAddress_lt') ? overrides.projectAddress_lt! : 'ut', + projectAddress_lte: overrides && overrides.hasOwnProperty('projectAddress_lte') ? overrides.projectAddress_lte! : 'aut', + projectAddress_not: overrides && overrides.hasOwnProperty('projectAddress_not') ? overrides.projectAddress_not! : 'perspiciatis', + projectAddress_not_contains: overrides && overrides.hasOwnProperty('projectAddress_not_contains') ? overrides.projectAddress_not_contains! : 'autem', + projectAddress_not_in: overrides && overrides.hasOwnProperty('projectAddress_not_in') ? overrides.projectAddress_not_in! : ['sed'], + projectId: overrides && overrides.hasOwnProperty('projectId') ? overrides.projectId! : '100000000000000000000', + projectId_gt: overrides && overrides.hasOwnProperty('projectId_gt') ? overrides.projectId_gt! : '100000000000000000000', + projectId_gte: overrides && overrides.hasOwnProperty('projectId_gte') ? overrides.projectId_gte! : '100000000000000000000', + projectId_in: overrides && overrides.hasOwnProperty('projectId_in') ? overrides.projectId_in! : ['100000000000000000000'], + projectId_lt: overrides && overrides.hasOwnProperty('projectId_lt') ? overrides.projectId_lt! : '100000000000000000000', + projectId_lte: overrides && overrides.hasOwnProperty('projectId_lte') ? overrides.projectId_lte! : '100000000000000000000', + projectId_not: overrides && overrides.hasOwnProperty('projectId_not') ? overrides.projectId_not! : '100000000000000000000', + projectId_not_in: overrides && overrides.hasOwnProperty('projectId_not_in') ? overrides.projectId_not_in! : ['100000000000000000000'], + projectName: overrides && overrides.hasOwnProperty('projectName') ? overrides.projectName! : 'natus', + projectName_contains: overrides && overrides.hasOwnProperty('projectName_contains') ? overrides.projectName_contains! : 'dolores', + projectName_contains_nocase: overrides && overrides.hasOwnProperty('projectName_contains_nocase') ? overrides.projectName_contains_nocase! : 'tempore', + projectName_ends_with: overrides && overrides.hasOwnProperty('projectName_ends_with') ? overrides.projectName_ends_with! : 'atque', + projectName_ends_with_nocase: overrides && overrides.hasOwnProperty('projectName_ends_with_nocase') ? overrides.projectName_ends_with_nocase! : 'recusandae', + projectName_gt: overrides && overrides.hasOwnProperty('projectName_gt') ? overrides.projectName_gt! : 'nam', + projectName_gte: overrides && overrides.hasOwnProperty('projectName_gte') ? overrides.projectName_gte! : 'rerum', + projectName_in: overrides && overrides.hasOwnProperty('projectName_in') ? overrides.projectName_in! : ['qui'], + projectName_lt: overrides && overrides.hasOwnProperty('projectName_lt') ? overrides.projectName_lt! : 'id', + projectName_lte: overrides && overrides.hasOwnProperty('projectName_lte') ? overrides.projectName_lte! : 'quia', + projectName_not: overrides && overrides.hasOwnProperty('projectName_not') ? overrides.projectName_not! : 'et', + projectName_not_contains: overrides && overrides.hasOwnProperty('projectName_not_contains') ? overrides.projectName_not_contains! : 'vero', + projectName_not_contains_nocase: overrides && overrides.hasOwnProperty('projectName_not_contains_nocase') ? overrides.projectName_not_contains_nocase! : 'tenetur', + projectName_not_ends_with: overrides && overrides.hasOwnProperty('projectName_not_ends_with') ? overrides.projectName_not_ends_with! : 'laboriosam', + projectName_not_ends_with_nocase: overrides && overrides.hasOwnProperty('projectName_not_ends_with_nocase') ? overrides.projectName_not_ends_with_nocase! : 'pariatur', + projectName_not_in: overrides && overrides.hasOwnProperty('projectName_not_in') ? overrides.projectName_not_in! : ['quis'], + projectName_not_starts_with: overrides && overrides.hasOwnProperty('projectName_not_starts_with') ? overrides.projectName_not_starts_with! : 'ut', + projectName_not_starts_with_nocase: overrides && overrides.hasOwnProperty('projectName_not_starts_with_nocase') ? overrides.projectName_not_starts_with_nocase! : 'est', + projectName_starts_with: overrides && overrides.hasOwnProperty('projectName_starts_with') ? overrides.projectName_starts_with! : 'incidunt', + projectName_starts_with_nocase: overrides && overrides.hasOwnProperty('projectName_starts_with_nocase') ? overrides.projectName_starts_with_nocase! : 'impedit', + retirementCertificates_: overrides && overrides.hasOwnProperty('retirementCertificates_') ? overrides.retirementCertificates_! : relationshipsToOmit.has('RetirementCertificate_Filter') ? {} as RetirementCertificate_Filter : aRetirementCertificate_Filter({}, relationshipsToOmit), + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'et', + transactionHash_contains: overrides && overrides.hasOwnProperty('transactionHash_contains') ? overrides.transactionHash_contains! : 'velit', + transactionHash_gt: overrides && overrides.hasOwnProperty('transactionHash_gt') ? overrides.transactionHash_gt! : 'ipsa', + transactionHash_gte: overrides && overrides.hasOwnProperty('transactionHash_gte') ? overrides.transactionHash_gte! : 'sed', + transactionHash_in: overrides && overrides.hasOwnProperty('transactionHash_in') ? overrides.transactionHash_in! : ['qui'], + transactionHash_lt: overrides && overrides.hasOwnProperty('transactionHash_lt') ? overrides.transactionHash_lt! : 'porro', + transactionHash_lte: overrides && overrides.hasOwnProperty('transactionHash_lte') ? overrides.transactionHash_lte! : 'eveniet', + transactionHash_not: overrides && overrides.hasOwnProperty('transactionHash_not') ? overrides.transactionHash_not! : 'consequatur', + transactionHash_not_contains: overrides && overrides.hasOwnProperty('transactionHash_not_contains') ? overrides.transactionHash_not_contains! : 'quo', + transactionHash_not_in: overrides && overrides.hasOwnProperty('transactionHash_not_in') ? overrides.transactionHash_not_in! : ['autem'], + }; +}; + +export const aQuery = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Query => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Query'); + return { + _meta: overrides && overrides.hasOwnProperty('_meta') ? overrides._meta! : relationshipsToOmit.has('_Meta_') ? {} as _Meta_ : a_Meta_({}, relationshipsToOmit), + cancellation: overrides && overrides.hasOwnProperty('cancellation') ? overrides.cancellation! : relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit), + cancellations: overrides && overrides.hasOwnProperty('cancellations') ? overrides.cancellations! : [relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit)], + exAnte: overrides && overrides.hasOwnProperty('exAnte') ? overrides.exAnte! : relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit), + exAnteHolder: overrides && overrides.hasOwnProperty('exAnteHolder') ? overrides.exAnteHolder! : relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit), + exAnteHolders: overrides && overrides.hasOwnProperty('exAnteHolders') ? overrides.exAnteHolders! : [relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit)], + exAntes: overrides && overrides.hasOwnProperty('exAntes') ? overrides.exAntes! : [relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit)], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + exPostHolder: overrides && overrides.hasOwnProperty('exPostHolder') ? overrides.exPostHolder! : relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit), + exPostHolders: overrides && overrides.hasOwnProperty('exPostHolders') ? overrides.exPostHolders! : [relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit)], + exPosts: overrides && overrides.hasOwnProperty('exPosts') ? overrides.exPosts! : [relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit)], + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + holders: overrides && overrides.hasOwnProperty('holders') ? overrides.holders! : [relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + projects: overrides && overrides.hasOwnProperty('projects') ? overrides.projects! : [relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit)], + retirementCertificate: overrides && overrides.hasOwnProperty('retirementCertificate') ? overrides.retirementCertificate! : relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit), + retirementCertificates: overrides && overrides.hasOwnProperty('retirementCertificates') ? overrides.retirementCertificates! : [relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit)], + }; +}; + +export const aRetirementCertificate = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): RetirementCertificate => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('RetirementCertificate'); + return { + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'ipsam', + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + retiree: overrides && overrides.hasOwnProperty('retiree') ? overrides.retiree! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'voluptates', + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'quia', + }; +}; + +export const aRetirementCertificate_Filter = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): RetirementCertificate_Filter => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('RetirementCertificate_Filter'); + return { + _change_block: overrides && overrides.hasOwnProperty('_change_block') ? overrides._change_block! : relationshipsToOmit.has('BlockChangedFilter') ? {} as BlockChangedFilter : aBlockChangedFilter({}, relationshipsToOmit), + amount: overrides && overrides.hasOwnProperty('amount') ? overrides.amount! : '100000000000000000000', + amount_gt: overrides && overrides.hasOwnProperty('amount_gt') ? overrides.amount_gt! : '100000000000000000000', + amount_gte: overrides && overrides.hasOwnProperty('amount_gte') ? overrides.amount_gte! : '100000000000000000000', + amount_in: overrides && overrides.hasOwnProperty('amount_in') ? overrides.amount_in! : ['100000000000000000000'], + amount_lt: overrides && overrides.hasOwnProperty('amount_lt') ? overrides.amount_lt! : '100000000000000000000', + amount_lte: overrides && overrides.hasOwnProperty('amount_lte') ? overrides.amount_lte! : '100000000000000000000', + amount_not: overrides && overrides.hasOwnProperty('amount_not') ? overrides.amount_not! : '100000000000000000000', + amount_not_in: overrides && overrides.hasOwnProperty('amount_not_in') ? overrides.amount_not_in! : ['100000000000000000000'], + and: overrides && overrides.hasOwnProperty('and') ? overrides.and! : [relationshipsToOmit.has('RetirementCertificate_Filter') ? {} as RetirementCertificate_Filter : aRetirementCertificate_Filter({}, relationshipsToOmit)], + createdAt: overrides && overrides.hasOwnProperty('createdAt') ? overrides.createdAt! : '100000000000000000000', + createdAt_gt: overrides && overrides.hasOwnProperty('createdAt_gt') ? overrides.createdAt_gt! : '100000000000000000000', + createdAt_gte: overrides && overrides.hasOwnProperty('createdAt_gte') ? overrides.createdAt_gte! : '100000000000000000000', + createdAt_in: overrides && overrides.hasOwnProperty('createdAt_in') ? overrides.createdAt_in! : ['100000000000000000000'], + createdAt_lt: overrides && overrides.hasOwnProperty('createdAt_lt') ? overrides.createdAt_lt! : '100000000000000000000', + createdAt_lte: overrides && overrides.hasOwnProperty('createdAt_lte') ? overrides.createdAt_lte! : '100000000000000000000', + createdAt_not: overrides && overrides.hasOwnProperty('createdAt_not') ? overrides.createdAt_not! : '100000000000000000000', + createdAt_not_in: overrides && overrides.hasOwnProperty('createdAt_not_in') ? overrides.createdAt_not_in! : ['100000000000000000000'], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : 'id', + exPost_: overrides && overrides.hasOwnProperty('exPost_') ? overrides.exPost_! : relationshipsToOmit.has('ExPost_Filter') ? {} as ExPost_Filter : anExPost_Filter({}, relationshipsToOmit), + exPost_contains: overrides && overrides.hasOwnProperty('exPost_contains') ? overrides.exPost_contains! : 'impedit', + exPost_contains_nocase: overrides && overrides.hasOwnProperty('exPost_contains_nocase') ? overrides.exPost_contains_nocase! : 'nulla', + exPost_ends_with: overrides && overrides.hasOwnProperty('exPost_ends_with') ? overrides.exPost_ends_with! : 'hic', + exPost_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_ends_with_nocase') ? overrides.exPost_ends_with_nocase! : 'quia', + exPost_gt: overrides && overrides.hasOwnProperty('exPost_gt') ? overrides.exPost_gt! : 'dolores', + exPost_gte: overrides && overrides.hasOwnProperty('exPost_gte') ? overrides.exPost_gte! : 'praesentium', + exPost_in: overrides && overrides.hasOwnProperty('exPost_in') ? overrides.exPost_in! : ['officia'], + exPost_lt: overrides && overrides.hasOwnProperty('exPost_lt') ? overrides.exPost_lt! : 'exercitationem', + exPost_lte: overrides && overrides.hasOwnProperty('exPost_lte') ? overrides.exPost_lte! : 'autem', + exPost_not: overrides && overrides.hasOwnProperty('exPost_not') ? overrides.exPost_not! : 'mollitia', + exPost_not_contains: overrides && overrides.hasOwnProperty('exPost_not_contains') ? overrides.exPost_not_contains! : 'voluptatem', + exPost_not_contains_nocase: overrides && overrides.hasOwnProperty('exPost_not_contains_nocase') ? overrides.exPost_not_contains_nocase! : 'facilis', + exPost_not_ends_with: overrides && overrides.hasOwnProperty('exPost_not_ends_with') ? overrides.exPost_not_ends_with! : 'iste', + exPost_not_ends_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_ends_with_nocase') ? overrides.exPost_not_ends_with_nocase! : 'ut', + exPost_not_in: overrides && overrides.hasOwnProperty('exPost_not_in') ? overrides.exPost_not_in! : ['qui'], + exPost_not_starts_with: overrides && overrides.hasOwnProperty('exPost_not_starts_with') ? overrides.exPost_not_starts_with! : 'aut', + exPost_not_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_not_starts_with_nocase') ? overrides.exPost_not_starts_with_nocase! : 'debitis', + exPost_starts_with: overrides && overrides.hasOwnProperty('exPost_starts_with') ? overrides.exPost_starts_with! : 'cupiditate', + exPost_starts_with_nocase: overrides && overrides.hasOwnProperty('exPost_starts_with_nocase') ? overrides.exPost_starts_with_nocase! : 'voluptatem', + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : 'consequuntur', + holder_: overrides && overrides.hasOwnProperty('holder_') ? overrides.holder_! : relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit), + holder_contains: overrides && overrides.hasOwnProperty('holder_contains') ? overrides.holder_contains! : 'commodi', + holder_contains_nocase: overrides && overrides.hasOwnProperty('holder_contains_nocase') ? overrides.holder_contains_nocase! : 'laborum', + holder_ends_with: overrides && overrides.hasOwnProperty('holder_ends_with') ? overrides.holder_ends_with! : 'quasi', + holder_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_ends_with_nocase') ? overrides.holder_ends_with_nocase! : 'hic', + holder_gt: overrides && overrides.hasOwnProperty('holder_gt') ? overrides.holder_gt! : 'similique', + holder_gte: overrides && overrides.hasOwnProperty('holder_gte') ? overrides.holder_gte! : 'architecto', + holder_in: overrides && overrides.hasOwnProperty('holder_in') ? overrides.holder_in! : ['aut'], + holder_lt: overrides && overrides.hasOwnProperty('holder_lt') ? overrides.holder_lt! : 'voluptas', + holder_lte: overrides && overrides.hasOwnProperty('holder_lte') ? overrides.holder_lte! : 'unde', + holder_not: overrides && overrides.hasOwnProperty('holder_not') ? overrides.holder_not! : 'laudantium', + holder_not_contains: overrides && overrides.hasOwnProperty('holder_not_contains') ? overrides.holder_not_contains! : 'impedit', + holder_not_contains_nocase: overrides && overrides.hasOwnProperty('holder_not_contains_nocase') ? overrides.holder_not_contains_nocase! : 'praesentium', + holder_not_ends_with: overrides && overrides.hasOwnProperty('holder_not_ends_with') ? overrides.holder_not_ends_with! : 'non', + holder_not_ends_with_nocase: overrides && overrides.hasOwnProperty('holder_not_ends_with_nocase') ? overrides.holder_not_ends_with_nocase! : 'ut', + holder_not_in: overrides && overrides.hasOwnProperty('holder_not_in') ? overrides.holder_not_in! : ['eum'], + holder_not_starts_with: overrides && overrides.hasOwnProperty('holder_not_starts_with') ? overrides.holder_not_starts_with! : 'ut', + holder_not_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_not_starts_with_nocase') ? overrides.holder_not_starts_with_nocase! : 'iste', + holder_starts_with: overrides && overrides.hasOwnProperty('holder_starts_with') ? overrides.holder_starts_with! : 'consequatur', + holder_starts_with_nocase: overrides && overrides.hasOwnProperty('holder_starts_with_nocase') ? overrides.holder_starts_with_nocase! : 'dicta', + id: overrides && overrides.hasOwnProperty('id') ? overrides.id! : 'omnis', + id_contains: overrides && overrides.hasOwnProperty('id_contains') ? overrides.id_contains! : 'perferendis', + id_gt: overrides && overrides.hasOwnProperty('id_gt') ? overrides.id_gt! : 'iure', + id_gte: overrides && overrides.hasOwnProperty('id_gte') ? overrides.id_gte! : 'quas', + id_in: overrides && overrides.hasOwnProperty('id_in') ? overrides.id_in! : ['nostrum'], + id_lt: overrides && overrides.hasOwnProperty('id_lt') ? overrides.id_lt! : 'hic', + id_lte: overrides && overrides.hasOwnProperty('id_lte') ? overrides.id_lte! : 'vitae', + id_not: overrides && overrides.hasOwnProperty('id_not') ? overrides.id_not! : 'quis', + id_not_contains: overrides && overrides.hasOwnProperty('id_not_contains') ? overrides.id_not_contains! : 'veritatis', + id_not_in: overrides && overrides.hasOwnProperty('id_not_in') ? overrides.id_not_in! : ['eveniet'], + or: overrides && overrides.hasOwnProperty('or') ? overrides.or! : [relationshipsToOmit.has('RetirementCertificate_Filter') ? {} as RetirementCertificate_Filter : aRetirementCertificate_Filter({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : 'praesentium', + project_: overrides && overrides.hasOwnProperty('project_') ? overrides.project_! : relationshipsToOmit.has('Project_Filter') ? {} as Project_Filter : aProject_Filter({}, relationshipsToOmit), + project_contains: overrides && overrides.hasOwnProperty('project_contains') ? overrides.project_contains! : 'dolores', + project_contains_nocase: overrides && overrides.hasOwnProperty('project_contains_nocase') ? overrides.project_contains_nocase! : 'est', + project_ends_with: overrides && overrides.hasOwnProperty('project_ends_with') ? overrides.project_ends_with! : 'qui', + project_ends_with_nocase: overrides && overrides.hasOwnProperty('project_ends_with_nocase') ? overrides.project_ends_with_nocase! : 'commodi', + project_gt: overrides && overrides.hasOwnProperty('project_gt') ? overrides.project_gt! : 'quo', + project_gte: overrides && overrides.hasOwnProperty('project_gte') ? overrides.project_gte! : 'est', + project_in: overrides && overrides.hasOwnProperty('project_in') ? overrides.project_in! : ['est'], + project_lt: overrides && overrides.hasOwnProperty('project_lt') ? overrides.project_lt! : 'eligendi', + project_lte: overrides && overrides.hasOwnProperty('project_lte') ? overrides.project_lte! : 'itaque', + project_not: overrides && overrides.hasOwnProperty('project_not') ? overrides.project_not! : 'consequatur', + project_not_contains: overrides && overrides.hasOwnProperty('project_not_contains') ? overrides.project_not_contains! : 'asperiores', + project_not_contains_nocase: overrides && overrides.hasOwnProperty('project_not_contains_nocase') ? overrides.project_not_contains_nocase! : 'reprehenderit', + project_not_ends_with: overrides && overrides.hasOwnProperty('project_not_ends_with') ? overrides.project_not_ends_with! : 'ut', + project_not_ends_with_nocase: overrides && overrides.hasOwnProperty('project_not_ends_with_nocase') ? overrides.project_not_ends_with_nocase! : 'occaecati', + project_not_in: overrides && overrides.hasOwnProperty('project_not_in') ? overrides.project_not_in! : ['quidem'], + project_not_starts_with: overrides && overrides.hasOwnProperty('project_not_starts_with') ? overrides.project_not_starts_with! : 'pariatur', + project_not_starts_with_nocase: overrides && overrides.hasOwnProperty('project_not_starts_with_nocase') ? overrides.project_not_starts_with_nocase! : 'qui', + project_starts_with: overrides && overrides.hasOwnProperty('project_starts_with') ? overrides.project_starts_with! : 'sapiente', + project_starts_with_nocase: overrides && overrides.hasOwnProperty('project_starts_with_nocase') ? overrides.project_starts_with_nocase! : 'rerum', + retiree: overrides && overrides.hasOwnProperty('retiree') ? overrides.retiree! : 'nisi', + retiree_: overrides && overrides.hasOwnProperty('retiree_') ? overrides.retiree_! : relationshipsToOmit.has('Holder_Filter') ? {} as Holder_Filter : aHolder_Filter({}, relationshipsToOmit), + retiree_contains: overrides && overrides.hasOwnProperty('retiree_contains') ? overrides.retiree_contains! : 'nisi', + retiree_contains_nocase: overrides && overrides.hasOwnProperty('retiree_contains_nocase') ? overrides.retiree_contains_nocase! : 'ratione', + retiree_ends_with: overrides && overrides.hasOwnProperty('retiree_ends_with') ? overrides.retiree_ends_with! : 'commodi', + retiree_ends_with_nocase: overrides && overrides.hasOwnProperty('retiree_ends_with_nocase') ? overrides.retiree_ends_with_nocase! : 'nesciunt', + retiree_gt: overrides && overrides.hasOwnProperty('retiree_gt') ? overrides.retiree_gt! : 'qui', + retiree_gte: overrides && overrides.hasOwnProperty('retiree_gte') ? overrides.retiree_gte! : 'aut', + retiree_in: overrides && overrides.hasOwnProperty('retiree_in') ? overrides.retiree_in! : ['sapiente'], + retiree_lt: overrides && overrides.hasOwnProperty('retiree_lt') ? overrides.retiree_lt! : 'quia', + retiree_lte: overrides && overrides.hasOwnProperty('retiree_lte') ? overrides.retiree_lte! : 'laborum', + retiree_not: overrides && overrides.hasOwnProperty('retiree_not') ? overrides.retiree_not! : 'odio', + retiree_not_contains: overrides && overrides.hasOwnProperty('retiree_not_contains') ? overrides.retiree_not_contains! : 'quo', + retiree_not_contains_nocase: overrides && overrides.hasOwnProperty('retiree_not_contains_nocase') ? overrides.retiree_not_contains_nocase! : 'explicabo', + retiree_not_ends_with: overrides && overrides.hasOwnProperty('retiree_not_ends_with') ? overrides.retiree_not_ends_with! : 'velit', + retiree_not_ends_with_nocase: overrides && overrides.hasOwnProperty('retiree_not_ends_with_nocase') ? overrides.retiree_not_ends_with_nocase! : 'nesciunt', + retiree_not_in: overrides && overrides.hasOwnProperty('retiree_not_in') ? overrides.retiree_not_in! : ['commodi'], + retiree_not_starts_with: overrides && overrides.hasOwnProperty('retiree_not_starts_with') ? overrides.retiree_not_starts_with! : 'aperiam', + retiree_not_starts_with_nocase: overrides && overrides.hasOwnProperty('retiree_not_starts_with_nocase') ? overrides.retiree_not_starts_with_nocase! : 'nobis', + retiree_starts_with: overrides && overrides.hasOwnProperty('retiree_starts_with') ? overrides.retiree_starts_with! : 'qui', + retiree_starts_with_nocase: overrides && overrides.hasOwnProperty('retiree_starts_with_nocase') ? overrides.retiree_starts_with_nocase! : 'accusantium', + serialization: overrides && overrides.hasOwnProperty('serialization') ? overrides.serialization! : 'voluptatibus', + serialization_contains: overrides && overrides.hasOwnProperty('serialization_contains') ? overrides.serialization_contains! : 'commodi', + serialization_contains_nocase: overrides && overrides.hasOwnProperty('serialization_contains_nocase') ? overrides.serialization_contains_nocase! : 'quod', + serialization_ends_with: overrides && overrides.hasOwnProperty('serialization_ends_with') ? overrides.serialization_ends_with! : 'labore', + serialization_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_ends_with_nocase') ? overrides.serialization_ends_with_nocase! : 'consequuntur', + serialization_gt: overrides && overrides.hasOwnProperty('serialization_gt') ? overrides.serialization_gt! : 'ea', + serialization_gte: overrides && overrides.hasOwnProperty('serialization_gte') ? overrides.serialization_gte! : 'neque', + serialization_in: overrides && overrides.hasOwnProperty('serialization_in') ? overrides.serialization_in! : ['quibusdam'], + serialization_lt: overrides && overrides.hasOwnProperty('serialization_lt') ? overrides.serialization_lt! : 'vel', + serialization_lte: overrides && overrides.hasOwnProperty('serialization_lte') ? overrides.serialization_lte! : 'non', + serialization_not: overrides && overrides.hasOwnProperty('serialization_not') ? overrides.serialization_not! : 'odio', + serialization_not_contains: overrides && overrides.hasOwnProperty('serialization_not_contains') ? overrides.serialization_not_contains! : 'nesciunt', + serialization_not_contains_nocase: overrides && overrides.hasOwnProperty('serialization_not_contains_nocase') ? overrides.serialization_not_contains_nocase! : 'fugiat', + serialization_not_ends_with: overrides && overrides.hasOwnProperty('serialization_not_ends_with') ? overrides.serialization_not_ends_with! : 'et', + serialization_not_ends_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_ends_with_nocase') ? overrides.serialization_not_ends_with_nocase! : 'nesciunt', + serialization_not_in: overrides && overrides.hasOwnProperty('serialization_not_in') ? overrides.serialization_not_in! : ['voluptas'], + serialization_not_starts_with: overrides && overrides.hasOwnProperty('serialization_not_starts_with') ? overrides.serialization_not_starts_with! : 'soluta', + serialization_not_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_not_starts_with_nocase') ? overrides.serialization_not_starts_with_nocase! : 'tempora', + serialization_starts_with: overrides && overrides.hasOwnProperty('serialization_starts_with') ? overrides.serialization_starts_with! : 'minus', + serialization_starts_with_nocase: overrides && overrides.hasOwnProperty('serialization_starts_with_nocase') ? overrides.serialization_starts_with_nocase! : 'corporis', + tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000', + tokenId_gt: overrides && overrides.hasOwnProperty('tokenId_gt') ? overrides.tokenId_gt! : '100000000000000000000', + tokenId_gte: overrides && overrides.hasOwnProperty('tokenId_gte') ? overrides.tokenId_gte! : '100000000000000000000', + tokenId_in: overrides && overrides.hasOwnProperty('tokenId_in') ? overrides.tokenId_in! : ['100000000000000000000'], + tokenId_lt: overrides && overrides.hasOwnProperty('tokenId_lt') ? overrides.tokenId_lt! : '100000000000000000000', + tokenId_lte: overrides && overrides.hasOwnProperty('tokenId_lte') ? overrides.tokenId_lte! : '100000000000000000000', + tokenId_not: overrides && overrides.hasOwnProperty('tokenId_not') ? overrides.tokenId_not! : '100000000000000000000', + tokenId_not_in: overrides && overrides.hasOwnProperty('tokenId_not_in') ? overrides.tokenId_not_in! : ['100000000000000000000'], + transactionHash: overrides && overrides.hasOwnProperty('transactionHash') ? overrides.transactionHash! : 'porro', + transactionHash_contains: overrides && overrides.hasOwnProperty('transactionHash_contains') ? overrides.transactionHash_contains! : 'ducimus', + transactionHash_gt: overrides && overrides.hasOwnProperty('transactionHash_gt') ? overrides.transactionHash_gt! : 'voluptas', + transactionHash_gte: overrides && overrides.hasOwnProperty('transactionHash_gte') ? overrides.transactionHash_gte! : 'culpa', + transactionHash_in: overrides && overrides.hasOwnProperty('transactionHash_in') ? overrides.transactionHash_in! : ['id'], + transactionHash_lt: overrides && overrides.hasOwnProperty('transactionHash_lt') ? overrides.transactionHash_lt! : 'autem', + transactionHash_lte: overrides && overrides.hasOwnProperty('transactionHash_lte') ? overrides.transactionHash_lte! : 'veritatis', + transactionHash_not: overrides && overrides.hasOwnProperty('transactionHash_not') ? overrides.transactionHash_not! : 'omnis', + transactionHash_not_contains: overrides && overrides.hasOwnProperty('transactionHash_not_contains') ? overrides.transactionHash_not_contains! : 'sit', + transactionHash_not_in: overrides && overrides.hasOwnProperty('transactionHash_not_in') ? overrides.transactionHash_not_in! : ['reiciendis'], + }; +}; + +export const aSubscription = (overrides?: Partial, _relationshipsToOmit: Set = new Set()): Subscription => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('Subscription'); + return { + _meta: overrides && overrides.hasOwnProperty('_meta') ? overrides._meta! : relationshipsToOmit.has('_Meta_') ? {} as _Meta_ : a_Meta_({}, relationshipsToOmit), + cancellation: overrides && overrides.hasOwnProperty('cancellation') ? overrides.cancellation! : relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit), + cancellations: overrides && overrides.hasOwnProperty('cancellations') ? overrides.cancellations! : [relationshipsToOmit.has('Cancellation') ? {} as Cancellation : aCancellation({}, relationshipsToOmit)], + exAnte: overrides && overrides.hasOwnProperty('exAnte') ? overrides.exAnte! : relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit), + exAnteHolder: overrides && overrides.hasOwnProperty('exAnteHolder') ? overrides.exAnteHolder! : relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit), + exAnteHolders: overrides && overrides.hasOwnProperty('exAnteHolders') ? overrides.exAnteHolders! : [relationshipsToOmit.has('ExAnteHolder') ? {} as ExAnteHolder : anExAnteHolder({}, relationshipsToOmit)], + exAntes: overrides && overrides.hasOwnProperty('exAntes') ? overrides.exAntes! : [relationshipsToOmit.has('ExAnte') ? {} as ExAnte : anExAnte({}, relationshipsToOmit)], + exPost: overrides && overrides.hasOwnProperty('exPost') ? overrides.exPost! : relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit), + exPostHolder: overrides && overrides.hasOwnProperty('exPostHolder') ? overrides.exPostHolder! : relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit), + exPostHolders: overrides && overrides.hasOwnProperty('exPostHolders') ? overrides.exPostHolders! : [relationshipsToOmit.has('ExPostHolder') ? {} as ExPostHolder : anExPostHolder({}, relationshipsToOmit)], + exPosts: overrides && overrides.hasOwnProperty('exPosts') ? overrides.exPosts! : [relationshipsToOmit.has('ExPost') ? {} as ExPost : anExPost({}, relationshipsToOmit)], + holder: overrides && overrides.hasOwnProperty('holder') ? overrides.holder! : relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit), + holders: overrides && overrides.hasOwnProperty('holders') ? overrides.holders! : [relationshipsToOmit.has('Holder') ? {} as Holder : aHolder({}, relationshipsToOmit)], + project: overrides && overrides.hasOwnProperty('project') ? overrides.project! : relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit), + projects: overrides && overrides.hasOwnProperty('projects') ? overrides.projects! : [relationshipsToOmit.has('Project') ? {} as Project : aProject({}, relationshipsToOmit)], + retirementCertificate: overrides && overrides.hasOwnProperty('retirementCertificate') ? overrides.retirementCertificate! : relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit), + retirementCertificates: overrides && overrides.hasOwnProperty('retirementCertificates') ? overrides.retirementCertificates! : [relationshipsToOmit.has('RetirementCertificate') ? {} as RetirementCertificate : aRetirementCertificate({}, relationshipsToOmit)], + }; +}; + +export const a_Block_ = (overrides?: Partial<_Block_>, _relationshipsToOmit: Set = new Set()): _Block_ => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('_Block_'); + return { + hash: overrides && overrides.hasOwnProperty('hash') ? overrides.hash! : 'ex', + number: overrides && overrides.hasOwnProperty('number') ? overrides.number! : 1599, + timestamp: overrides && overrides.hasOwnProperty('timestamp') ? overrides.timestamp! : 1310, + }; +}; + +export const a_Meta_ = (overrides?: Partial<_Meta_>, _relationshipsToOmit: Set = new Set()): _Meta_ => { + const relationshipsToOmit: Set = new Set(_relationshipsToOmit); + relationshipsToOmit.add('_Meta_'); + return { + block: overrides && overrides.hasOwnProperty('block') ? overrides.block! : relationshipsToOmit.has('_Block_') ? {} as _Block_ : a_Block_({}, relationshipsToOmit), + deployment: overrides && overrides.hasOwnProperty('deployment') ? overrides.deployment! : 'ut', + hasIndexingErrors: overrides && overrides.hasOwnProperty('hasIndexingErrors') ? overrides.hasIndexingErrors! : false, + }; +}; diff --git a/carbonmark-api/src/.generated/types/icr.types.ts b/carbonmark-api/src/.generated/types/icr.types.ts new file mode 100644 index 0000000000..3a83f10558 --- /dev/null +++ b/carbonmark-api/src/.generated/types/icr.types.ts @@ -0,0 +1,1742 @@ +import { GraphQLClient } from 'graphql-request'; +import { GraphQLClientRequestHeaders } from 'graphql-request/build/cjs/types'; +import gql from 'graphql-tag'; +export type Maybe = T | null; +export type InputMaybe = Maybe; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +/** All built-in and custom scalars, mapped to their actual values */ +export type Scalars = { + ID: string; + String: string; + Boolean: boolean; + Int: number; + Float: number; + BigDecimal: any; + BigInt: string; + Bytes: any; + Int8: any; +}; + +export type BlockChangedFilter = { + number_gte: Scalars['Int']; +}; + +export type Block_Height = { + hash: InputMaybe; + number: InputMaybe; + number_gte: InputMaybe; +}; + +export type Cancellation = { + __typename?: 'Cancellation'; + amount: Scalars['BigInt']; + cancelledBy: Holder; + createdAt: Scalars['BigInt']; + exPost: ExPost; + id: Scalars['Bytes']; + project: Project; + serialization: Scalars['String']; + transactionHash: Scalars['Bytes']; +}; + +export type Cancellation_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + cancelledBy: InputMaybe; + cancelledBy_: InputMaybe; + cancelledBy_contains: InputMaybe; + cancelledBy_contains_nocase: InputMaybe; + cancelledBy_ends_with: InputMaybe; + cancelledBy_ends_with_nocase: InputMaybe; + cancelledBy_gt: InputMaybe; + cancelledBy_gte: InputMaybe; + cancelledBy_in: InputMaybe>; + cancelledBy_lt: InputMaybe; + cancelledBy_lte: InputMaybe; + cancelledBy_not: InputMaybe; + cancelledBy_not_contains: InputMaybe; + cancelledBy_not_contains_nocase: InputMaybe; + cancelledBy_not_ends_with: InputMaybe; + cancelledBy_not_ends_with_nocase: InputMaybe; + cancelledBy_not_in: InputMaybe>; + cancelledBy_not_starts_with: InputMaybe; + cancelledBy_not_starts_with_nocase: InputMaybe; + cancelledBy_starts_with: InputMaybe; + cancelledBy_starts_with_nocase: InputMaybe; + createdAt: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_in: InputMaybe>; + exPost: InputMaybe; + exPost_: InputMaybe; + exPost_contains: InputMaybe; + exPost_contains_nocase: InputMaybe; + exPost_ends_with: InputMaybe; + exPost_ends_with_nocase: InputMaybe; + exPost_gt: InputMaybe; + exPost_gte: InputMaybe; + exPost_in: InputMaybe>; + exPost_lt: InputMaybe; + exPost_lte: InputMaybe; + exPost_not: InputMaybe; + exPost_not_contains: InputMaybe; + exPost_not_contains_nocase: InputMaybe; + exPost_not_ends_with: InputMaybe; + exPost_not_ends_with_nocase: InputMaybe; + exPost_not_in: InputMaybe>; + exPost_not_starts_with: InputMaybe; + exPost_not_starts_with_nocase: InputMaybe; + exPost_starts_with: InputMaybe; + exPost_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + project: InputMaybe; + project_: InputMaybe; + project_contains: InputMaybe; + project_contains_nocase: InputMaybe; + project_ends_with: InputMaybe; + project_ends_with_nocase: InputMaybe; + project_gt: InputMaybe; + project_gte: InputMaybe; + project_in: InputMaybe>; + project_lt: InputMaybe; + project_lte: InputMaybe; + project_not: InputMaybe; + project_not_contains: InputMaybe; + project_not_contains_nocase: InputMaybe; + project_not_ends_with: InputMaybe; + project_not_ends_with_nocase: InputMaybe; + project_not_in: InputMaybe>; + project_not_starts_with: InputMaybe; + project_not_starts_with_nocase: InputMaybe; + project_starts_with: InputMaybe; + project_starts_with_nocase: InputMaybe; + serialization: InputMaybe; + serialization_contains: InputMaybe; + serialization_contains_nocase: InputMaybe; + serialization_ends_with: InputMaybe; + serialization_ends_with_nocase: InputMaybe; + serialization_gt: InputMaybe; + serialization_gte: InputMaybe; + serialization_in: InputMaybe>; + serialization_lt: InputMaybe; + serialization_lte: InputMaybe; + serialization_not: InputMaybe; + serialization_not_contains: InputMaybe; + serialization_not_contains_nocase: InputMaybe; + serialization_not_ends_with: InputMaybe; + serialization_not_ends_with_nocase: InputMaybe; + serialization_not_in: InputMaybe>; + serialization_not_starts_with: InputMaybe; + serialization_not_starts_with_nocase: InputMaybe; + serialization_starts_with: InputMaybe; + serialization_starts_with_nocase: InputMaybe; + transactionHash: InputMaybe; + transactionHash_contains: InputMaybe; + transactionHash_gt: InputMaybe; + transactionHash_gte: InputMaybe; + transactionHash_in: InputMaybe>; + transactionHash_lt: InputMaybe; + transactionHash_lte: InputMaybe; + transactionHash_not: InputMaybe; + transactionHash_not_contains: InputMaybe; + transactionHash_not_in: InputMaybe>; +}; + +export enum Cancellation_OrderBy { + Amount = 'amount', + CancelledBy = 'cancelledBy', + CancelledByAddress = 'cancelledBy__address', + CancelledByCancelledAmount = 'cancelledBy__cancelledAmount', + CancelledById = 'cancelledBy__id', + CancelledByRetiredAmount = 'cancelledBy__retiredAmount', + CreatedAt = 'createdAt', + ExPost = 'exPost', + ExPostCancelledAmount = 'exPost__cancelledAmount', + ExPostEstimatedAmount = 'exPost__estimatedAmount', + ExPostId = 'exPost__id', + ExPostLastVerificationTimestamp = 'exPost__lastVerificationTimestamp', + ExPostRetiredAmount = 'exPost__retiredAmount', + ExPostSerialization = 'exPost__serialization', + ExPostSupply = 'exPost__supply', + ExPostTokenId = 'exPost__tokenId', + ExPostVerificationPeriodEnd = 'exPost__verificationPeriodEnd', + ExPostVerificationPeriodStart = 'exPost__verificationPeriodStart', + ExPostVintage = 'exPost__vintage', + Id = 'id', + Project = 'project', + ProjectBlockNumber = 'project__blockNumber', + ProjectBlockTimestamp = 'project__blockTimestamp', + ProjectId = 'project__id', + ProjectProjectAddress = 'project__projectAddress', + ProjectProjectId = 'project__projectId', + ProjectProjectName = 'project__projectName', + ProjectTransactionHash = 'project__transactionHash', + Serialization = 'serialization', + TransactionHash = 'transactionHash' +} + +export type ExAnte = { + __typename?: 'ExAnte'; + exPost: ExPost; + holders: Array; + id: Scalars['Bytes']; + project: Project; + serialization: Scalars['String']; + supply: Scalars['BigInt']; + tokenId: Scalars['BigInt']; +}; + + +export type ExAnteHoldersArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + +export type ExAnteHolder = { + __typename?: 'ExAnteHolder'; + amount: Scalars['BigInt']; + createdAt: Scalars['BigInt']; + exAnte: ExAnte; + holder: Holder; + id: Scalars['Bytes']; + updatedAt: Scalars['BigInt']; +}; + +export type ExAnteHolder_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + createdAt: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_in: InputMaybe>; + exAnte: InputMaybe; + exAnte_: InputMaybe; + exAnte_contains: InputMaybe; + exAnte_contains_nocase: InputMaybe; + exAnte_ends_with: InputMaybe; + exAnte_ends_with_nocase: InputMaybe; + exAnte_gt: InputMaybe; + exAnte_gte: InputMaybe; + exAnte_in: InputMaybe>; + exAnte_lt: InputMaybe; + exAnte_lte: InputMaybe; + exAnte_not: InputMaybe; + exAnte_not_contains: InputMaybe; + exAnte_not_contains_nocase: InputMaybe; + exAnte_not_ends_with: InputMaybe; + exAnte_not_ends_with_nocase: InputMaybe; + exAnte_not_in: InputMaybe>; + exAnte_not_starts_with: InputMaybe; + exAnte_not_starts_with_nocase: InputMaybe; + exAnte_starts_with: InputMaybe; + exAnte_starts_with_nocase: InputMaybe; + holder: InputMaybe; + holder_: InputMaybe; + holder_contains: InputMaybe; + holder_contains_nocase: InputMaybe; + holder_ends_with: InputMaybe; + holder_ends_with_nocase: InputMaybe; + holder_gt: InputMaybe; + holder_gte: InputMaybe; + holder_in: InputMaybe>; + holder_lt: InputMaybe; + holder_lte: InputMaybe; + holder_not: InputMaybe; + holder_not_contains: InputMaybe; + holder_not_contains_nocase: InputMaybe; + holder_not_ends_with: InputMaybe; + holder_not_ends_with_nocase: InputMaybe; + holder_not_in: InputMaybe>; + holder_not_starts_with: InputMaybe; + holder_not_starts_with_nocase: InputMaybe; + holder_starts_with: InputMaybe; + holder_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + updatedAt: InputMaybe; + updatedAt_gt: InputMaybe; + updatedAt_gte: InputMaybe; + updatedAt_in: InputMaybe>; + updatedAt_lt: InputMaybe; + updatedAt_lte: InputMaybe; + updatedAt_not: InputMaybe; + updatedAt_not_in: InputMaybe>; +}; + +export enum ExAnteHolder_OrderBy { + Amount = 'amount', + CreatedAt = 'createdAt', + ExAnte = 'exAnte', + ExAnteId = 'exAnte__id', + ExAnteSerialization = 'exAnte__serialization', + ExAnteSupply = 'exAnte__supply', + ExAnteTokenId = 'exAnte__tokenId', + Holder = 'holder', + HolderAddress = 'holder__address', + HolderCancelledAmount = 'holder__cancelledAmount', + HolderId = 'holder__id', + HolderRetiredAmount = 'holder__retiredAmount', + Id = 'id', + UpdatedAt = 'updatedAt' +} + +export type ExAnte_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + and: InputMaybe>>; + exPost: InputMaybe; + exPost_: InputMaybe; + exPost_contains: InputMaybe; + exPost_contains_nocase: InputMaybe; + exPost_ends_with: InputMaybe; + exPost_ends_with_nocase: InputMaybe; + exPost_gt: InputMaybe; + exPost_gte: InputMaybe; + exPost_in: InputMaybe>; + exPost_lt: InputMaybe; + exPost_lte: InputMaybe; + exPost_not: InputMaybe; + exPost_not_contains: InputMaybe; + exPost_not_contains_nocase: InputMaybe; + exPost_not_ends_with: InputMaybe; + exPost_not_ends_with_nocase: InputMaybe; + exPost_not_in: InputMaybe>; + exPost_not_starts_with: InputMaybe; + exPost_not_starts_with_nocase: InputMaybe; + exPost_starts_with: InputMaybe; + exPost_starts_with_nocase: InputMaybe; + holders_: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + project: InputMaybe; + project_: InputMaybe; + project_contains: InputMaybe; + project_contains_nocase: InputMaybe; + project_ends_with: InputMaybe; + project_ends_with_nocase: InputMaybe; + project_gt: InputMaybe; + project_gte: InputMaybe; + project_in: InputMaybe>; + project_lt: InputMaybe; + project_lte: InputMaybe; + project_not: InputMaybe; + project_not_contains: InputMaybe; + project_not_contains_nocase: InputMaybe; + project_not_ends_with: InputMaybe; + project_not_ends_with_nocase: InputMaybe; + project_not_in: InputMaybe>; + project_not_starts_with: InputMaybe; + project_not_starts_with_nocase: InputMaybe; + project_starts_with: InputMaybe; + project_starts_with_nocase: InputMaybe; + serialization: InputMaybe; + serialization_contains: InputMaybe; + serialization_contains_nocase: InputMaybe; + serialization_ends_with: InputMaybe; + serialization_ends_with_nocase: InputMaybe; + serialization_gt: InputMaybe; + serialization_gte: InputMaybe; + serialization_in: InputMaybe>; + serialization_lt: InputMaybe; + serialization_lte: InputMaybe; + serialization_not: InputMaybe; + serialization_not_contains: InputMaybe; + serialization_not_contains_nocase: InputMaybe; + serialization_not_ends_with: InputMaybe; + serialization_not_ends_with_nocase: InputMaybe; + serialization_not_in: InputMaybe>; + serialization_not_starts_with: InputMaybe; + serialization_not_starts_with_nocase: InputMaybe; + serialization_starts_with: InputMaybe; + serialization_starts_with_nocase: InputMaybe; + supply: InputMaybe; + supply_gt: InputMaybe; + supply_gte: InputMaybe; + supply_in: InputMaybe>; + supply_lt: InputMaybe; + supply_lte: InputMaybe; + supply_not: InputMaybe; + supply_not_in: InputMaybe>; + tokenId: InputMaybe; + tokenId_gt: InputMaybe; + tokenId_gte: InputMaybe; + tokenId_in: InputMaybe>; + tokenId_lt: InputMaybe; + tokenId_lte: InputMaybe; + tokenId_not: InputMaybe; + tokenId_not_in: InputMaybe>; +}; + +export enum ExAnte_OrderBy { + ExPost = 'exPost', + ExPostCancelledAmount = 'exPost__cancelledAmount', + ExPostEstimatedAmount = 'exPost__estimatedAmount', + ExPostId = 'exPost__id', + ExPostLastVerificationTimestamp = 'exPost__lastVerificationTimestamp', + ExPostRetiredAmount = 'exPost__retiredAmount', + ExPostSerialization = 'exPost__serialization', + ExPostSupply = 'exPost__supply', + ExPostTokenId = 'exPost__tokenId', + ExPostVerificationPeriodEnd = 'exPost__verificationPeriodEnd', + ExPostVerificationPeriodStart = 'exPost__verificationPeriodStart', + ExPostVintage = 'exPost__vintage', + Holders = 'holders', + Id = 'id', + Project = 'project', + ProjectBlockNumber = 'project__blockNumber', + ProjectBlockTimestamp = 'project__blockTimestamp', + ProjectId = 'project__id', + ProjectProjectAddress = 'project__projectAddress', + ProjectProjectId = 'project__projectId', + ProjectProjectName = 'project__projectName', + ProjectTransactionHash = 'project__transactionHash', + Serialization = 'serialization', + Supply = 'supply', + TokenId = 'tokenId' +} + +export type ExPost = { + __typename?: 'ExPost'; + cancellations: Array; + cancelledAmount: Scalars['BigInt']; + estimatedAmount: Scalars['BigInt']; + exAnte: Maybe; + holders: Array; + id: Scalars['Bytes']; + lastVerificationTimestamp: Scalars['BigInt']; + project: Project; + retiredAmount: Scalars['BigInt']; + retirementCertificates: Array; + serialization: Scalars['String']; + supply: Scalars['BigInt']; + tokenId: Scalars['BigInt']; + verificationPeriodEnd: Scalars['BigInt']; + verificationPeriodStart: Scalars['BigInt']; + vintage: Scalars['String']; +}; + + +export type ExPostCancellationsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type ExPostHoldersArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type ExPostRetirementCertificatesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + +export type ExPostHolder = { + __typename?: 'ExPostHolder'; + amount: Scalars['BigInt']; + createdAt: Scalars['BigInt']; + exPost: ExPost; + holder: Holder; + id: Scalars['Bytes']; + retiredAmount: Scalars['BigInt']; + updatedAt: Scalars['BigInt']; +}; + +export type ExPostHolder_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + createdAt: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_in: InputMaybe>; + exPost: InputMaybe; + exPost_: InputMaybe; + exPost_contains: InputMaybe; + exPost_contains_nocase: InputMaybe; + exPost_ends_with: InputMaybe; + exPost_ends_with_nocase: InputMaybe; + exPost_gt: InputMaybe; + exPost_gte: InputMaybe; + exPost_in: InputMaybe>; + exPost_lt: InputMaybe; + exPost_lte: InputMaybe; + exPost_not: InputMaybe; + exPost_not_contains: InputMaybe; + exPost_not_contains_nocase: InputMaybe; + exPost_not_ends_with: InputMaybe; + exPost_not_ends_with_nocase: InputMaybe; + exPost_not_in: InputMaybe>; + exPost_not_starts_with: InputMaybe; + exPost_not_starts_with_nocase: InputMaybe; + exPost_starts_with: InputMaybe; + exPost_starts_with_nocase: InputMaybe; + holder: InputMaybe; + holder_: InputMaybe; + holder_contains: InputMaybe; + holder_contains_nocase: InputMaybe; + holder_ends_with: InputMaybe; + holder_ends_with_nocase: InputMaybe; + holder_gt: InputMaybe; + holder_gte: InputMaybe; + holder_in: InputMaybe>; + holder_lt: InputMaybe; + holder_lte: InputMaybe; + holder_not: InputMaybe; + holder_not_contains: InputMaybe; + holder_not_contains_nocase: InputMaybe; + holder_not_ends_with: InputMaybe; + holder_not_ends_with_nocase: InputMaybe; + holder_not_in: InputMaybe>; + holder_not_starts_with: InputMaybe; + holder_not_starts_with_nocase: InputMaybe; + holder_starts_with: InputMaybe; + holder_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + retiredAmount: InputMaybe; + retiredAmount_gt: InputMaybe; + retiredAmount_gte: InputMaybe; + retiredAmount_in: InputMaybe>; + retiredAmount_lt: InputMaybe; + retiredAmount_lte: InputMaybe; + retiredAmount_not: InputMaybe; + retiredAmount_not_in: InputMaybe>; + updatedAt: InputMaybe; + updatedAt_gt: InputMaybe; + updatedAt_gte: InputMaybe; + updatedAt_in: InputMaybe>; + updatedAt_lt: InputMaybe; + updatedAt_lte: InputMaybe; + updatedAt_not: InputMaybe; + updatedAt_not_in: InputMaybe>; +}; + +export enum ExPostHolder_OrderBy { + Amount = 'amount', + CreatedAt = 'createdAt', + ExPost = 'exPost', + ExPostCancelledAmount = 'exPost__cancelledAmount', + ExPostEstimatedAmount = 'exPost__estimatedAmount', + ExPostId = 'exPost__id', + ExPostLastVerificationTimestamp = 'exPost__lastVerificationTimestamp', + ExPostRetiredAmount = 'exPost__retiredAmount', + ExPostSerialization = 'exPost__serialization', + ExPostSupply = 'exPost__supply', + ExPostTokenId = 'exPost__tokenId', + ExPostVerificationPeriodEnd = 'exPost__verificationPeriodEnd', + ExPostVerificationPeriodStart = 'exPost__verificationPeriodStart', + ExPostVintage = 'exPost__vintage', + Holder = 'holder', + HolderAddress = 'holder__address', + HolderCancelledAmount = 'holder__cancelledAmount', + HolderId = 'holder__id', + HolderRetiredAmount = 'holder__retiredAmount', + Id = 'id', + RetiredAmount = 'retiredAmount', + UpdatedAt = 'updatedAt' +} + +export type ExPost_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + and: InputMaybe>>; + cancellations_: InputMaybe; + cancelledAmount: InputMaybe; + cancelledAmount_gt: InputMaybe; + cancelledAmount_gte: InputMaybe; + cancelledAmount_in: InputMaybe>; + cancelledAmount_lt: InputMaybe; + cancelledAmount_lte: InputMaybe; + cancelledAmount_not: InputMaybe; + cancelledAmount_not_in: InputMaybe>; + estimatedAmount: InputMaybe; + estimatedAmount_gt: InputMaybe; + estimatedAmount_gte: InputMaybe; + estimatedAmount_in: InputMaybe>; + estimatedAmount_lt: InputMaybe; + estimatedAmount_lte: InputMaybe; + estimatedAmount_not: InputMaybe; + estimatedAmount_not_in: InputMaybe>; + exAnte_: InputMaybe; + holders_: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + lastVerificationTimestamp: InputMaybe; + lastVerificationTimestamp_gt: InputMaybe; + lastVerificationTimestamp_gte: InputMaybe; + lastVerificationTimestamp_in: InputMaybe>; + lastVerificationTimestamp_lt: InputMaybe; + lastVerificationTimestamp_lte: InputMaybe; + lastVerificationTimestamp_not: InputMaybe; + lastVerificationTimestamp_not_in: InputMaybe>; + or: InputMaybe>>; + project: InputMaybe; + project_: InputMaybe; + project_contains: InputMaybe; + project_contains_nocase: InputMaybe; + project_ends_with: InputMaybe; + project_ends_with_nocase: InputMaybe; + project_gt: InputMaybe; + project_gte: InputMaybe; + project_in: InputMaybe>; + project_lt: InputMaybe; + project_lte: InputMaybe; + project_not: InputMaybe; + project_not_contains: InputMaybe; + project_not_contains_nocase: InputMaybe; + project_not_ends_with: InputMaybe; + project_not_ends_with_nocase: InputMaybe; + project_not_in: InputMaybe>; + project_not_starts_with: InputMaybe; + project_not_starts_with_nocase: InputMaybe; + project_starts_with: InputMaybe; + project_starts_with_nocase: InputMaybe; + retiredAmount: InputMaybe; + retiredAmount_gt: InputMaybe; + retiredAmount_gte: InputMaybe; + retiredAmount_in: InputMaybe>; + retiredAmount_lt: InputMaybe; + retiredAmount_lte: InputMaybe; + retiredAmount_not: InputMaybe; + retiredAmount_not_in: InputMaybe>; + retirementCertificates_: InputMaybe; + serialization: InputMaybe; + serialization_contains: InputMaybe; + serialization_contains_nocase: InputMaybe; + serialization_ends_with: InputMaybe; + serialization_ends_with_nocase: InputMaybe; + serialization_gt: InputMaybe; + serialization_gte: InputMaybe; + serialization_in: InputMaybe>; + serialization_lt: InputMaybe; + serialization_lte: InputMaybe; + serialization_not: InputMaybe; + serialization_not_contains: InputMaybe; + serialization_not_contains_nocase: InputMaybe; + serialization_not_ends_with: InputMaybe; + serialization_not_ends_with_nocase: InputMaybe; + serialization_not_in: InputMaybe>; + serialization_not_starts_with: InputMaybe; + serialization_not_starts_with_nocase: InputMaybe; + serialization_starts_with: InputMaybe; + serialization_starts_with_nocase: InputMaybe; + supply: InputMaybe; + supply_gt: InputMaybe; + supply_gte: InputMaybe; + supply_in: InputMaybe>; + supply_lt: InputMaybe; + supply_lte: InputMaybe; + supply_not: InputMaybe; + supply_not_in: InputMaybe>; + tokenId: InputMaybe; + tokenId_gt: InputMaybe; + tokenId_gte: InputMaybe; + tokenId_in: InputMaybe>; + tokenId_lt: InputMaybe; + tokenId_lte: InputMaybe; + tokenId_not: InputMaybe; + tokenId_not_in: InputMaybe>; + verificationPeriodEnd: InputMaybe; + verificationPeriodEnd_gt: InputMaybe; + verificationPeriodEnd_gte: InputMaybe; + verificationPeriodEnd_in: InputMaybe>; + verificationPeriodEnd_lt: InputMaybe; + verificationPeriodEnd_lte: InputMaybe; + verificationPeriodEnd_not: InputMaybe; + verificationPeriodEnd_not_in: InputMaybe>; + verificationPeriodStart: InputMaybe; + verificationPeriodStart_gt: InputMaybe; + verificationPeriodStart_gte: InputMaybe; + verificationPeriodStart_in: InputMaybe>; + verificationPeriodStart_lt: InputMaybe; + verificationPeriodStart_lte: InputMaybe; + verificationPeriodStart_not: InputMaybe; + verificationPeriodStart_not_in: InputMaybe>; + vintage: InputMaybe; + vintage_contains: InputMaybe; + vintage_contains_nocase: InputMaybe; + vintage_ends_with: InputMaybe; + vintage_ends_with_nocase: InputMaybe; + vintage_gt: InputMaybe; + vintage_gte: InputMaybe; + vintage_in: InputMaybe>; + vintage_lt: InputMaybe; + vintage_lte: InputMaybe; + vintage_not: InputMaybe; + vintage_not_contains: InputMaybe; + vintage_not_contains_nocase: InputMaybe; + vintage_not_ends_with: InputMaybe; + vintage_not_ends_with_nocase: InputMaybe; + vintage_not_in: InputMaybe>; + vintage_not_starts_with: InputMaybe; + vintage_not_starts_with_nocase: InputMaybe; + vintage_starts_with: InputMaybe; + vintage_starts_with_nocase: InputMaybe; +}; + +export enum ExPost_OrderBy { + Cancellations = 'cancellations', + CancelledAmount = 'cancelledAmount', + EstimatedAmount = 'estimatedAmount', + ExAnte = 'exAnte', + ExAnteId = 'exAnte__id', + ExAnteSerialization = 'exAnte__serialization', + ExAnteSupply = 'exAnte__supply', + ExAnteTokenId = 'exAnte__tokenId', + Holders = 'holders', + Id = 'id', + LastVerificationTimestamp = 'lastVerificationTimestamp', + Project = 'project', + ProjectBlockNumber = 'project__blockNumber', + ProjectBlockTimestamp = 'project__blockTimestamp', + ProjectId = 'project__id', + ProjectProjectAddress = 'project__projectAddress', + ProjectProjectId = 'project__projectId', + ProjectProjectName = 'project__projectName', + ProjectTransactionHash = 'project__transactionHash', + RetiredAmount = 'retiredAmount', + RetirementCertificates = 'retirementCertificates', + Serialization = 'serialization', + Supply = 'supply', + TokenId = 'tokenId', + VerificationPeriodEnd = 'verificationPeriodEnd', + VerificationPeriodStart = 'verificationPeriodStart', + Vintage = 'vintage' +} + +export type Holder = { + __typename?: 'Holder'; + address: Scalars['Bytes']; + cancellations: Array; + cancelledAmount: Scalars['BigInt']; + exAnteAmounts: Array; + exPostAmounts: Array; + id: Scalars['Bytes']; + retiredAmount: Scalars['BigInt']; + retirementCertificates: Array; +}; + + +export type HolderCancellationsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type HolderExAnteAmountsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type HolderExPostAmountsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type HolderRetirementCertificatesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + +export type Holder_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + address: InputMaybe; + address_contains: InputMaybe; + address_gt: InputMaybe; + address_gte: InputMaybe; + address_in: InputMaybe>; + address_lt: InputMaybe; + address_lte: InputMaybe; + address_not: InputMaybe; + address_not_contains: InputMaybe; + address_not_in: InputMaybe>; + and: InputMaybe>>; + cancellations_: InputMaybe; + cancelledAmount: InputMaybe; + cancelledAmount_gt: InputMaybe; + cancelledAmount_gte: InputMaybe; + cancelledAmount_in: InputMaybe>; + cancelledAmount_lt: InputMaybe; + cancelledAmount_lte: InputMaybe; + cancelledAmount_not: InputMaybe; + cancelledAmount_not_in: InputMaybe>; + exAnteAmounts_: InputMaybe; + exPostAmounts_: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + retiredAmount: InputMaybe; + retiredAmount_gt: InputMaybe; + retiredAmount_gte: InputMaybe; + retiredAmount_in: InputMaybe>; + retiredAmount_lt: InputMaybe; + retiredAmount_lte: InputMaybe; + retiredAmount_not: InputMaybe; + retiredAmount_not_in: InputMaybe>; + retirementCertificates_: InputMaybe; +}; + +export enum Holder_OrderBy { + Address = 'address', + Cancellations = 'cancellations', + CancelledAmount = 'cancelledAmount', + ExAnteAmounts = 'exAnteAmounts', + ExPostAmounts = 'exPostAmounts', + Id = 'id', + RetiredAmount = 'retiredAmount', + RetirementCertificates = 'retirementCertificates' +} + +/** Defines the order direction, either ascending or descending */ +export enum OrderDirection { + Asc = 'asc', + Desc = 'desc' +} + +export type Project = { + __typename?: 'Project'; + blockNumber: Scalars['BigInt']; + blockTimestamp: Scalars['BigInt']; + cancellations: Array; + exAntes: Array; + exPosts: Array; + id: Scalars['Bytes']; + projectAddress: Scalars['Bytes']; + projectId: Scalars['BigInt']; + projectName: Scalars['String']; + retirementCertificates: Array; + transactionHash: Scalars['Bytes']; +}; + + +export type ProjectCancellationsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type ProjectExAntesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type ProjectExPostsArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + + +export type ProjectRetirementCertificatesArgs = { + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + where: InputMaybe; +}; + +export type Project_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + and: InputMaybe>>; + blockNumber: InputMaybe; + blockNumber_gt: InputMaybe; + blockNumber_gte: InputMaybe; + blockNumber_in: InputMaybe>; + blockNumber_lt: InputMaybe; + blockNumber_lte: InputMaybe; + blockNumber_not: InputMaybe; + blockNumber_not_in: InputMaybe>; + blockTimestamp: InputMaybe; + blockTimestamp_gt: InputMaybe; + blockTimestamp_gte: InputMaybe; + blockTimestamp_in: InputMaybe>; + blockTimestamp_lt: InputMaybe; + blockTimestamp_lte: InputMaybe; + blockTimestamp_not: InputMaybe; + blockTimestamp_not_in: InputMaybe>; + cancellations_: InputMaybe; + exAntes_: InputMaybe; + exPosts_: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + projectAddress: InputMaybe; + projectAddress_contains: InputMaybe; + projectAddress_gt: InputMaybe; + projectAddress_gte: InputMaybe; + projectAddress_in: InputMaybe>; + projectAddress_lt: InputMaybe; + projectAddress_lte: InputMaybe; + projectAddress_not: InputMaybe; + projectAddress_not_contains: InputMaybe; + projectAddress_not_in: InputMaybe>; + projectId: InputMaybe; + projectId_gt: InputMaybe; + projectId_gte: InputMaybe; + projectId_in: InputMaybe>; + projectId_lt: InputMaybe; + projectId_lte: InputMaybe; + projectId_not: InputMaybe; + projectId_not_in: InputMaybe>; + projectName: InputMaybe; + projectName_contains: InputMaybe; + projectName_contains_nocase: InputMaybe; + projectName_ends_with: InputMaybe; + projectName_ends_with_nocase: InputMaybe; + projectName_gt: InputMaybe; + projectName_gte: InputMaybe; + projectName_in: InputMaybe>; + projectName_lt: InputMaybe; + projectName_lte: InputMaybe; + projectName_not: InputMaybe; + projectName_not_contains: InputMaybe; + projectName_not_contains_nocase: InputMaybe; + projectName_not_ends_with: InputMaybe; + projectName_not_ends_with_nocase: InputMaybe; + projectName_not_in: InputMaybe>; + projectName_not_starts_with: InputMaybe; + projectName_not_starts_with_nocase: InputMaybe; + projectName_starts_with: InputMaybe; + projectName_starts_with_nocase: InputMaybe; + retirementCertificates_: InputMaybe; + transactionHash: InputMaybe; + transactionHash_contains: InputMaybe; + transactionHash_gt: InputMaybe; + transactionHash_gte: InputMaybe; + transactionHash_in: InputMaybe>; + transactionHash_lt: InputMaybe; + transactionHash_lte: InputMaybe; + transactionHash_not: InputMaybe; + transactionHash_not_contains: InputMaybe; + transactionHash_not_in: InputMaybe>; +}; + +export enum Project_OrderBy { + BlockNumber = 'blockNumber', + BlockTimestamp = 'blockTimestamp', + Cancellations = 'cancellations', + ExAntes = 'exAntes', + ExPosts = 'exPosts', + Id = 'id', + ProjectAddress = 'projectAddress', + ProjectId = 'projectId', + ProjectName = 'projectName', + RetirementCertificates = 'retirementCertificates', + TransactionHash = 'transactionHash' +} + +export type Query = { + __typename?: 'Query'; + /** Access to subgraph metadata */ + _meta: Maybe<_Meta_>; + cancellation: Maybe; + cancellations: Array; + exAnte: Maybe; + exAnteHolder: Maybe; + exAnteHolders: Array; + exAntes: Array; + exPost: Maybe; + exPostHolder: Maybe; + exPostHolders: Array; + exPosts: Array; + holder: Maybe; + holders: Array; + project: Maybe; + projects: Array; + retirementCertificate: Maybe; + retirementCertificates: Array; +}; + + +export type Query_MetaArgs = { + block: InputMaybe; +}; + + +export type QueryCancellationArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryCancellationsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryExAnteArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryExAnteHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryExAnteHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryExAntesArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryExPostArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryExPostHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryExPostHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryExPostsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryProjectArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryProjectsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type QueryRetirementCertificateArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type QueryRetirementCertificatesArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + +export type RetirementCertificate = { + __typename?: 'RetirementCertificate'; + amount: Scalars['BigInt']; + createdAt: Scalars['BigInt']; + exPost: ExPost; + holder: Holder; + id: Scalars['Bytes']; + project: Project; + retiree: Holder; + serialization: Scalars['String']; + tokenId: Scalars['BigInt']; + transactionHash: Scalars['Bytes']; +}; + +export type RetirementCertificate_Filter = { + /** Filter for the block changed event. */ + _change_block: InputMaybe; + amount: InputMaybe; + amount_gt: InputMaybe; + amount_gte: InputMaybe; + amount_in: InputMaybe>; + amount_lt: InputMaybe; + amount_lte: InputMaybe; + amount_not: InputMaybe; + amount_not_in: InputMaybe>; + and: InputMaybe>>; + createdAt: InputMaybe; + createdAt_gt: InputMaybe; + createdAt_gte: InputMaybe; + createdAt_in: InputMaybe>; + createdAt_lt: InputMaybe; + createdAt_lte: InputMaybe; + createdAt_not: InputMaybe; + createdAt_not_in: InputMaybe>; + exPost: InputMaybe; + exPost_: InputMaybe; + exPost_contains: InputMaybe; + exPost_contains_nocase: InputMaybe; + exPost_ends_with: InputMaybe; + exPost_ends_with_nocase: InputMaybe; + exPost_gt: InputMaybe; + exPost_gte: InputMaybe; + exPost_in: InputMaybe>; + exPost_lt: InputMaybe; + exPost_lte: InputMaybe; + exPost_not: InputMaybe; + exPost_not_contains: InputMaybe; + exPost_not_contains_nocase: InputMaybe; + exPost_not_ends_with: InputMaybe; + exPost_not_ends_with_nocase: InputMaybe; + exPost_not_in: InputMaybe>; + exPost_not_starts_with: InputMaybe; + exPost_not_starts_with_nocase: InputMaybe; + exPost_starts_with: InputMaybe; + exPost_starts_with_nocase: InputMaybe; + holder: InputMaybe; + holder_: InputMaybe; + holder_contains: InputMaybe; + holder_contains_nocase: InputMaybe; + holder_ends_with: InputMaybe; + holder_ends_with_nocase: InputMaybe; + holder_gt: InputMaybe; + holder_gte: InputMaybe; + holder_in: InputMaybe>; + holder_lt: InputMaybe; + holder_lte: InputMaybe; + holder_not: InputMaybe; + holder_not_contains: InputMaybe; + holder_not_contains_nocase: InputMaybe; + holder_not_ends_with: InputMaybe; + holder_not_ends_with_nocase: InputMaybe; + holder_not_in: InputMaybe>; + holder_not_starts_with: InputMaybe; + holder_not_starts_with_nocase: InputMaybe; + holder_starts_with: InputMaybe; + holder_starts_with_nocase: InputMaybe; + id: InputMaybe; + id_contains: InputMaybe; + id_gt: InputMaybe; + id_gte: InputMaybe; + id_in: InputMaybe>; + id_lt: InputMaybe; + id_lte: InputMaybe; + id_not: InputMaybe; + id_not_contains: InputMaybe; + id_not_in: InputMaybe>; + or: InputMaybe>>; + project: InputMaybe; + project_: InputMaybe; + project_contains: InputMaybe; + project_contains_nocase: InputMaybe; + project_ends_with: InputMaybe; + project_ends_with_nocase: InputMaybe; + project_gt: InputMaybe; + project_gte: InputMaybe; + project_in: InputMaybe>; + project_lt: InputMaybe; + project_lte: InputMaybe; + project_not: InputMaybe; + project_not_contains: InputMaybe; + project_not_contains_nocase: InputMaybe; + project_not_ends_with: InputMaybe; + project_not_ends_with_nocase: InputMaybe; + project_not_in: InputMaybe>; + project_not_starts_with: InputMaybe; + project_not_starts_with_nocase: InputMaybe; + project_starts_with: InputMaybe; + project_starts_with_nocase: InputMaybe; + retiree: InputMaybe; + retiree_: InputMaybe; + retiree_contains: InputMaybe; + retiree_contains_nocase: InputMaybe; + retiree_ends_with: InputMaybe; + retiree_ends_with_nocase: InputMaybe; + retiree_gt: InputMaybe; + retiree_gte: InputMaybe; + retiree_in: InputMaybe>; + retiree_lt: InputMaybe; + retiree_lte: InputMaybe; + retiree_not: InputMaybe; + retiree_not_contains: InputMaybe; + retiree_not_contains_nocase: InputMaybe; + retiree_not_ends_with: InputMaybe; + retiree_not_ends_with_nocase: InputMaybe; + retiree_not_in: InputMaybe>; + retiree_not_starts_with: InputMaybe; + retiree_not_starts_with_nocase: InputMaybe; + retiree_starts_with: InputMaybe; + retiree_starts_with_nocase: InputMaybe; + serialization: InputMaybe; + serialization_contains: InputMaybe; + serialization_contains_nocase: InputMaybe; + serialization_ends_with: InputMaybe; + serialization_ends_with_nocase: InputMaybe; + serialization_gt: InputMaybe; + serialization_gte: InputMaybe; + serialization_in: InputMaybe>; + serialization_lt: InputMaybe; + serialization_lte: InputMaybe; + serialization_not: InputMaybe; + serialization_not_contains: InputMaybe; + serialization_not_contains_nocase: InputMaybe; + serialization_not_ends_with: InputMaybe; + serialization_not_ends_with_nocase: InputMaybe; + serialization_not_in: InputMaybe>; + serialization_not_starts_with: InputMaybe; + serialization_not_starts_with_nocase: InputMaybe; + serialization_starts_with: InputMaybe; + serialization_starts_with_nocase: InputMaybe; + tokenId: InputMaybe; + tokenId_gt: InputMaybe; + tokenId_gte: InputMaybe; + tokenId_in: InputMaybe>; + tokenId_lt: InputMaybe; + tokenId_lte: InputMaybe; + tokenId_not: InputMaybe; + tokenId_not_in: InputMaybe>; + transactionHash: InputMaybe; + transactionHash_contains: InputMaybe; + transactionHash_gt: InputMaybe; + transactionHash_gte: InputMaybe; + transactionHash_in: InputMaybe>; + transactionHash_lt: InputMaybe; + transactionHash_lte: InputMaybe; + transactionHash_not: InputMaybe; + transactionHash_not_contains: InputMaybe; + transactionHash_not_in: InputMaybe>; +}; + +export enum RetirementCertificate_OrderBy { + Amount = 'amount', + CreatedAt = 'createdAt', + ExPost = 'exPost', + ExPostCancelledAmount = 'exPost__cancelledAmount', + ExPostEstimatedAmount = 'exPost__estimatedAmount', + ExPostId = 'exPost__id', + ExPostLastVerificationTimestamp = 'exPost__lastVerificationTimestamp', + ExPostRetiredAmount = 'exPost__retiredAmount', + ExPostSerialization = 'exPost__serialization', + ExPostSupply = 'exPost__supply', + ExPostTokenId = 'exPost__tokenId', + ExPostVerificationPeriodEnd = 'exPost__verificationPeriodEnd', + ExPostVerificationPeriodStart = 'exPost__verificationPeriodStart', + ExPostVintage = 'exPost__vintage', + Holder = 'holder', + HolderAddress = 'holder__address', + HolderCancelledAmount = 'holder__cancelledAmount', + HolderId = 'holder__id', + HolderRetiredAmount = 'holder__retiredAmount', + Id = 'id', + Project = 'project', + ProjectBlockNumber = 'project__blockNumber', + ProjectBlockTimestamp = 'project__blockTimestamp', + ProjectId = 'project__id', + ProjectProjectAddress = 'project__projectAddress', + ProjectProjectId = 'project__projectId', + ProjectProjectName = 'project__projectName', + ProjectTransactionHash = 'project__transactionHash', + Retiree = 'retiree', + RetireeAddress = 'retiree__address', + RetireeCancelledAmount = 'retiree__cancelledAmount', + RetireeId = 'retiree__id', + RetireeRetiredAmount = 'retiree__retiredAmount', + Serialization = 'serialization', + TokenId = 'tokenId', + TransactionHash = 'transactionHash' +} + +export type Subscription = { + __typename?: 'Subscription'; + /** Access to subgraph metadata */ + _meta: Maybe<_Meta_>; + cancellation: Maybe; + cancellations: Array; + exAnte: Maybe; + exAnteHolder: Maybe; + exAnteHolders: Array; + exAntes: Array; + exPost: Maybe; + exPostHolder: Maybe; + exPostHolders: Array; + exPosts: Array; + holder: Maybe; + holders: Array; + project: Maybe; + projects: Array; + retirementCertificate: Maybe; + retirementCertificates: Array; +}; + + +export type Subscription_MetaArgs = { + block: InputMaybe; +}; + + +export type SubscriptionCancellationArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionCancellationsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionExAnteArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionExAnteHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionExAnteHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionExAntesArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionExPostArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionExPostHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionExPostHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionExPostsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionHolderArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionHoldersArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionProjectArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionProjectsArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + + +export type SubscriptionRetirementCertificateArgs = { + block: InputMaybe; + id: Scalars['ID']; + subgraphError?: _SubgraphErrorPolicy_; +}; + + +export type SubscriptionRetirementCertificatesArgs = { + block: InputMaybe; + first?: InputMaybe; + orderBy: InputMaybe; + orderDirection: InputMaybe; + skip?: InputMaybe; + subgraphError?: _SubgraphErrorPolicy_; + where: InputMaybe; +}; + +export type _Block_ = { + __typename?: '_Block_'; + /** The hash of the block */ + hash: Maybe; + /** The block number */ + number: Scalars['Int']; + /** Integer representation of the timestamp stored in blocks for the chain */ + timestamp: Maybe; +}; + +/** The type for the top-level _meta field */ +export type _Meta_ = { + __typename?: '_Meta_'; + /** + * Information about a specific subgraph block. The hash of the block + * will be null if the _meta field has a block constraint that asks for + * a block number. It will be filled if the _meta field has no block constraint + * and therefore asks for the latest block + * + */ + block: _Block_; + /** The deployment ID */ + deployment: Scalars['String']; + /** If `true`, the subgraph encountered indexing errors at some past block */ + hasIndexingErrors: Scalars['Boolean']; +}; + +export enum _SubgraphErrorPolicy_ { + /** Data will be returned even if the subgraph has indexing errors */ + Allow = 'allow', + /** If the subgraph has indexing errors, data will be omitted. The default. */ + Deny = 'deny' +} + +export type IcrProjectFragmentFragment = { __typename?: 'Project', id: any, projectAddress: any, projectName: string, transactionHash: any }; + +export type ExPostAmountsFragmentFragment = { __typename?: 'ExPostHolder', id: any, amount: string, updatedAt: string, retiredAmount: string, exPost: { __typename?: 'ExPost', tokenId: string, vintage: string, serialization: string, project: { __typename?: 'Project', id: any, projectName: string } } }; + +export type GetExPostInfoViaSerializationQueryVariables = Exact<{ + serialization: Scalars['String']; +}>; + + +export type GetExPostInfoViaSerializationQuery = { __typename?: 'Query', exPosts: Array<{ __typename?: 'ExPost', serialization: string, supply: string, retiredAmount: string, estimatedAmount: string, cancelledAmount: string, id: any, lastVerificationTimestamp: string, tokenId: string, verificationPeriodEnd: string, verificationPeriodStart: string, vintage: string, project: { __typename?: 'Project', id: any, projectAddress: any, projectName: string, transactionHash: any } }> }; + +export type GetHoldingsByAddressQueryVariables = Exact<{ + id: Scalars['ID']; +}>; + + +export type GetHoldingsByAddressQuery = { __typename?: 'Query', holder: { __typename?: 'Holder', id: any, exPostAmounts: Array<{ __typename?: 'ExPostHolder', id: any, amount: string, updatedAt: string, retiredAmount: string, exPost: { __typename?: 'ExPost', tokenId: string, vintage: string, serialization: string, project: { __typename?: 'Project', id: any, projectName: string } } }> } | null }; + +export const IcrProjectFragmentFragmentDoc = gql` + fragment ICRProjectFragment on Project { + id + projectAddress + projectName + transactionHash +} + `; +export const ExPostAmountsFragmentFragmentDoc = gql` + fragment exPostAmountsFragment on ExPostHolder { + id + amount + updatedAt + retiredAmount + exPost { + tokenId + vintage + serialization + project { + id + projectName + } + } +} + `; +export const GetExPostInfoViaSerializationDocument = gql` + query getExPostInfoViaSerialization($serialization: String!) { + exPosts(where: {serialization: $serialization}) { + serialization + supply + retiredAmount + estimatedAmount + cancelledAmount + id + lastVerificationTimestamp + project { + ...ICRProjectFragment + } + tokenId + verificationPeriodEnd + verificationPeriodStart + vintage + } +} + ${IcrProjectFragmentFragmentDoc}`; +export const GetHoldingsByAddressDocument = gql` + query getHoldingsByAddress($id: ID!) { + holder(id: $id) { + id + exPostAmounts { + ...exPostAmountsFragment + } + } +} + ${ExPostAmountsFragmentFragmentDoc}`; + +export type SdkFunctionWrapper = (action: (requestHeaders?:Record) => Promise, operationName: string, operationType?: string) => Promise; + + +const defaultWrapper: SdkFunctionWrapper = (action, _operationName, _operationType) => action(); + +export function getSdk(client: GraphQLClient, withWrapper: SdkFunctionWrapper = defaultWrapper) { + return { + getExPostInfoViaSerialization(variables: GetExPostInfoViaSerializationQueryVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { + return withWrapper((wrappedRequestHeaders) => client.request(GetExPostInfoViaSerializationDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getExPostInfoViaSerialization', 'query'); + }, + getHoldingsByAddress(variables: GetHoldingsByAddressQueryVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise { + return withWrapper((wrappedRequestHeaders) => client.request(GetHoldingsByAddressDocument, variables, {...requestHeaders, ...wrappedRequestHeaders}), 'getHoldingsByAddress', 'query'); + } + }; +} +export type Sdk = ReturnType; \ No newline at end of file diff --git a/carbonmark-api/src/app.constants.ts b/carbonmark-api/src/app.constants.ts index 4d3f9353cb..694aad5239 100644 --- a/carbonmark-api/src/app.constants.ts +++ b/carbonmark-api/src/app.constants.ts @@ -10,16 +10,31 @@ const GRAPH_API_ROOT_ID = "https://api.thegraph.com/subgraphs/id"; * This is also the case for SANITY_URLS */ const POLYGON_URLS = { - marketplace: `${GRAPH_API_ROOT_ID}/QmTfM5TvokuyKXCGWL3wTLZ1z4TqRtQ7PdVfQRVU39ovUC`, + // production below + // marketplace: `${GRAPH_API_ROOT_ID}/QmTfM5TvokuyKXCGWL3wTLZ1z4TqRtQ7PdVfQRVU39ovUC`, + // testing with test marketplace + marketplace: + "https://api.thegraph.com/subgraphs/name/psparacino/carbonmark--testing-only", assets: `${GRAPH_API_ROOT}/cujowolf/klima-refi-current-holdings`, offsets: `${GRAPH_API_ROOT}/klimadao/polygon-bridged-carbon`, tokens: `${GRAPH_API_ROOT}/klimadao/klimadao-pairs`, - digitalCarbon: `${GRAPH_API_ROOT}/klimadao/polygon-digital-carbon`, + // production below + // digitalCarbon: `${GRAPH_API_ROOT}/klimadao/polygon-digital-carbon`, + // testing + digitalCarbon: + "https://api.thegraph.com/subgraphs/name/psparacino/digital-carbon", + // producion below + // icr: `${GRAPH_API_ROOT}/skjaldbaka17/carbon-registry-polygon`, + // Mainnet testing only + icr: `${GRAPH_API_ROOT}/skjaldbaka17/carbon-registry-main-test`, }; const MUMBAI_URLS = { ...POLYGON_URLS, - marketplace: `${GRAPH_API_ROOT_ID}/QmdrYranfueu9Ann3kYCkEKTmTRReusybzFZ2nYz8YM6WF`, + // testing + digitalCarbon: `${GRAPH_API_ROOT}/psparacino/digital-carbon`, + marketplace: `${GRAPH_API_ROOT_ID}/QmUUnZTeRnfsJsQaTwLeiHmAQ5xvtk2jBW7VeP3AEW5bnv`, + icr: `${GRAPH_API_ROOT}/skjaldbaka17/carbon-registry-test`, }; /** Sanity URLS */ @@ -57,6 +72,26 @@ export const TOKEN_ADDRESSES = { }, }; -export const RPC_URLS = { +export const URLS = { polygonTestnetRpc: "https://rpc-mumbai.maticvigil.com", }; + +/** Definitions of available registries */ +export const REGISTRIES = { + Verra: { + id: "VCS", + title: "Verra", + url: "https://registry.verra.org", + api: "https://registry.verra.org/uiapi", + }, + GoldStandard: { + id: "GS", + title: "Gold Standard", + url: "https://registry.goldstandard.org", + }, + ICR: { + id: "ICR", + title: "International Carbon Registry", + url: "https://www.carbonregistry.com", + }, +}; diff --git a/carbonmark-api/src/graphql/icr.fragments.gql b/carbonmark-api/src/graphql/icr.fragments.gql new file mode 100644 index 0000000000..a37b4f9011 --- /dev/null +++ b/carbonmark-api/src/graphql/icr.fragments.gql @@ -0,0 +1,22 @@ +fragment ICRProjectFragment on Project { + id + projectAddress + projectName + transactionHash +} + +fragment exPostAmountsFragment on ExPostHolder { + id + amount + updatedAt + retiredAmount + exPost { + tokenId + vintage + serialization + project { + id + projectName + } + } +} diff --git a/carbonmark-api/src/graphql/icr.gql b/carbonmark-api/src/graphql/icr.gql new file mode 100644 index 0000000000..ed82dd7bdb --- /dev/null +++ b/carbonmark-api/src/graphql/icr.gql @@ -0,0 +1,27 @@ +query getExPostInfoViaSerialization($serialization: String!) { + exPosts(where: { serialization: $serialization }) { + serialization + supply + retiredAmount + estimatedAmount + cancelledAmount + id + lastVerificationTimestamp + project { + ...ICRProjectFragment + } + tokenId + verificationPeriodEnd + verificationPeriodStart + vintage + } +} + +query getHoldingsByAddress($id: ID!) { + holder(id: $id) { + id + exPostAmounts { + ...exPostAmountsFragment + } + } +} diff --git a/carbonmark-api/src/models/Asset.model.ts b/carbonmark-api/src/models/Asset.model.ts index 46739b78ec..637a44d764 100644 --- a/carbonmark-api/src/models/Asset.model.ts +++ b/carbonmark-api/src/models/Asset.model.ts @@ -7,6 +7,7 @@ export const AssetModel = Type.Object({ name: Type.String(), symbol: Type.String(), decimals: Type.Number(), + tokenId: Type.Optional(Type.String()), }), amount: Type.String(), }); diff --git a/carbonmark-api/src/models/DetailedProject.model.ts b/carbonmark-api/src/models/DetailedProject.model.ts index 20a251b38b..e0f99959b1 100644 --- a/carbonmark-api/src/models/DetailedProject.model.ts +++ b/carbonmark-api/src/models/DetailedProject.model.ts @@ -26,6 +26,8 @@ export const DetailedProjectModel = Type.Object({ listings: Type.Array(ListingModel), price: Type.String(), vintage: Type.String(), + serialization: Nullable(Type.String()), + tokenId: Nullable(Type.String()), }); export type DetailedProject = Static; diff --git a/carbonmark-api/src/models/Project.model.ts b/carbonmark-api/src/models/Project.model.ts index 5e39279e93..e5996eebdc 100644 --- a/carbonmark-api/src/models/Project.model.ts +++ b/carbonmark-api/src/models/Project.model.ts @@ -29,6 +29,7 @@ export const ProjectModel = Type.Object({ }) ) ), + serialization: Type.Optional(Type.String()), }); export type Project = Static; diff --git a/carbonmark-api/src/models/Purchase.model.ts b/carbonmark-api/src/models/Purchase.model.ts index ca8ad50a45..afe73319e7 100644 --- a/carbonmark-api/src/models/Purchase.model.ts +++ b/carbonmark-api/src/models/Purchase.model.ts @@ -43,6 +43,9 @@ export const PurchaseModel = Type.Object({ vintage: Type.String({ examples: ["2008"], }), + serialization: Type.Optional( + Type.String({ examples: ["ICR-ISL-354-78040-14-R-0-2021"] }) + ), }), }), price: Type.String({ diff --git a/carbonmark-api/src/routes/activities/get.ts b/carbonmark-api/src/routes/activities/get.ts index 81299e2239..8549f07a70 100644 --- a/carbonmark-api/src/routes/activities/get.ts +++ b/carbonmark-api/src/routes/activities/get.ts @@ -17,9 +17,10 @@ const handler = (fastify: FastifyInstance) => }>, reply: FastifyReply ): Promise { + const network = request.query.network ?? "polygon"; return asResponse( reply, - await getActivities(fastify, request.query, request.query.network) + await getActivities(fastify, request.query, network) ); }; diff --git a/carbonmark-api/src/routes/countries/get.ts b/carbonmark-api/src/routes/countries/get.ts index 84429afa8b..728db3e4a8 100644 --- a/carbonmark-api/src/routes/countries/get.ts +++ b/carbonmark-api/src/routes/countries/get.ts @@ -9,9 +9,10 @@ const handler = ( ): RouteHandler<{ Querystring: Static }> => async function (request, reply) { let response; - const sdk = gql_sdk(request.query.network); + const network = request.query.network ?? "polygon"; + const sdk = gql_sdk(network); try { - response = await getAllCountries(sdk, fastify); + response = await getAllCountries(sdk, fastify, network); } catch (error) { //Return bad gateway and pass the error console.error(error); diff --git a/carbonmark-api/src/routes/projects/[id]/activity/get.ts b/carbonmark-api/src/routes/projects/[id]/activity/get.ts index 3f86d26872..5749121b56 100644 --- a/carbonmark-api/src/routes/projects/[id]/activity/get.ts +++ b/carbonmark-api/src/routes/projects/[id]/activity/get.ts @@ -19,9 +19,11 @@ const handler = (fastify: FastifyInstance) => reply: FastifyReply ): Promise { request.query.projectId = [request.params.id]; + + const network = request.query.network ?? "polygon"; return asResponse( reply, - await getActivities(fastify, request.query, request.query.network) + await getActivities(fastify, request.query, network) ); }; diff --git a/carbonmark-api/src/routes/projects/[id]/get.ts b/carbonmark-api/src/routes/projects/[id]/get.ts index b41879d8f3..9f60c6c8d1 100644 --- a/carbonmark-api/src/routes/projects/[id]/get.ts +++ b/carbonmark-api/src/routes/projects/[id]/get.ts @@ -1,13 +1,21 @@ import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; import { compact, concat, min } from "lodash"; import { mapValues, pipe, trim, uniq } from "lodash/fp"; +import { REGISTRIES } from "../../../app.constants"; import { DetailedProject } from "../../../models/DetailedProject.model"; import { CreditId } from "../../../utils/CreditId"; import { gql_sdk } from "../../../utils/gqlSdk"; -import { fetchCarbonProject } from "../../../utils/helpers/cms.utils"; +import { + fetchCarbonProject, + type FetchCarbonProjectArgs, + type FetchCarbonProjectMethod, + type ProjectImage, +} from "../../../utils/helpers/cms.utils"; + import { fetchMarketplaceListings } from "../../../utils/helpers/fetchMarketplaceListings"; import { fetchPoolPricesAndStats } from "../../../utils/helpers/fetchPoolPricesAndStats"; import { toGeoJSON } from "../get.utils"; +import { ICR_API } from "./../../../../src/utils/ICR/ICR_API_endpoints"; import { Params, Querystring, schema } from "./get.schema"; // Handler function for the "/projects/:id" route @@ -20,20 +28,52 @@ const handler = (fastify: FastifyInstance) => reply: FastifyReply ) { const { id } = request.params; - const sdk = gql_sdk(request.query.network); + + const network = request.query.network ?? "polygon"; + + const sdk = gql_sdk(network); + const { vintage, standard: registry, registryProjectId, projectId: key, } = new CreditId(id); + + let fetchCarbonProjectMethod: FetchCarbonProjectMethod; + let fetchCarbonProjectArgs: FetchCarbonProjectArgs; + let icrSerialization: string | undefined; + + switch (registry) { + case REGISTRIES["ICR"].id: { + const { ICR_API_URL } = ICR_API(network); + fetchCarbonProjectMethod = ICR_API_URL; + fetchCarbonProjectArgs = { + serialization: id, + network: network, + }; + icrSerialization = id; + break; + } + default: + fetchCarbonProjectMethod = sdk; + fetchCarbonProjectArgs = { + registry, + registryProjectId, + network: network, + }; + break; + } + let poolPrices, stats, listings, projectDetails; + try { [[poolPrices, stats], [listings], projectDetails] = await Promise.all([ fetchPoolPricesAndStats(sdk, { key, vintage, network: request.query.network || "polygon", + icrSerialization, }), fetchMarketplaceListings(sdk, { key, @@ -41,16 +81,12 @@ const handler = (fastify: FastifyInstance) => fastify, expiresAfter: request.query.expiresAfter, }), - fetchCarbonProject(sdk, { - registry, - registryProjectId, - }), + fetchCarbonProject(fetchCarbonProjectMethod, fetchCarbonProjectArgs), ]); } catch (error) { console.error(error); throw error; } - if (!projectDetails) { // only render pages if project details exist (render even if there are no listings!) return reply.notFound(); @@ -83,13 +119,17 @@ const handler = (fastify: FastifyInstance) => price: String(bestPrice ?? 0), // remove trailing zeros prices: poolPrices, images: - projectDetails?.images?.map((image) => ({ - caption: image?.asset?.altText, - url: image?.asset?.url, - })) ?? [], + projectDetails?.images + ?.filter((image): image is ProjectImage => !!image) + .map((image: ProjectImage) => ({ + caption: image?.asset?.altText || "", + url: image?.asset?.url || "", + })) ?? [], listings, vintage, stats, + serialization: icrSerialization, + tokenId: projectDetails.tokenId, }; return reply .header("Content-Type", "application/json; charset=utf-8") diff --git a/carbonmark-api/src/routes/projects/get.ts b/carbonmark-api/src/routes/projects/get.ts index fb3dc4c0f6..adbbdc850d 100644 --- a/carbonmark-api/src/routes/projects/get.ts +++ b/carbonmark-api/src/routes/projects/get.ts @@ -3,6 +3,7 @@ import { mapValues, omit, sortBy } from "lodash"; import { split } from "lodash/fp"; import { Project } from "../../models/Project.model"; import { CreditId } from "../../utils/CreditId"; +import { fetchAllICRProjects } from "../../utils/ICR/icr.utils"; import { gql_sdk } from "../../utils/gqlSdk"; import { fetchAllCarbonProjects } from "../../utils/helpers/cms.utils"; import { fetchAllPoolPrices } from "../../utils/helpers/fetchAllPoolPrices"; @@ -35,7 +36,9 @@ const handler = (fastify: FastifyInstance) => request: FastifyRequest<{ Querystring: Querystring }>, reply: FastifyReply ): Promise { - const sdk = gql_sdk(request.query.network); + const network = request.query.network ?? "polygon"; + + const sdk = gql_sdk(network); //Transform the list params (category, country etc) provided so as to be an array of strings const args = mapValues( omit(request.query, "search", "expiresAfter"), @@ -43,32 +46,41 @@ const handler = (fastify: FastifyInstance) => ); //Get the default args to return all results unless specified - const allOptions = await getDefaultQueryArgs(sdk, fastify); + const allOptions = await getDefaultQueryArgs(sdk, fastify, network); + + const [ + marketplaceProjectsData, + poolProjectsData, + cmsProjects, + poolPrices, + IcrListProjects, + ] = await Promise.all([ + sdk.marketplace.getProjects({ + search: request.query.search ?? "", + category: args.category ?? allOptions.category, + country: args.country ?? allOptions.country, + vintage: args.vintage ?? allOptions.vintage, + expiresAfter: request.query.expiresAfter ?? allOptions.expiresAfter, + }), + sdk.digital_carbon.findDigitalCarbonProjects({ + search: request.query.search ?? "", + category: args.category ?? allOptions.category, + country: args.country ?? allOptions.country, + vintage: (args.vintage ?? allOptions.vintage).map(Number), + }), + fetchAllCarbonProjects(sdk), + fetchAllPoolPrices(sdk), + fetchAllICRProjects(network), + ]); - const [marketplaceProjectsData, poolProjectsData, cmsProjects, poolPrices] = - await Promise.all([ - sdk.marketplace.getProjects({ - search: request.query.search ?? "", - category: args.category ?? allOptions.category, - country: args.country ?? allOptions.country, - vintage: args.vintage ?? allOptions.vintage, - expiresAfter: request.query.expiresAfter ?? allOptions.expiresAfter, - }), - sdk.digital_carbon.findDigitalCarbonProjects({ - search: request.query.search ?? "", - category: args.category ?? allOptions.category, - country: args.country ?? allOptions.country, - vintage: (args.vintage ?? allOptions.vintage).map(Number), - }), - fetchAllCarbonProjects(sdk), - fetchAllPoolPrices(sdk), - ]); const CMSDataMap: CMSDataMap = new Map(); const ProjectMap: ProjectDataMap = new Map(); cmsProjects.forEach((project) => { if (!CreditId.isValidProjectId(project.id)) return; + const [standard, registryProjectId] = CreditId.splitProjectId(project.id); // type guard and capitalize + CMSDataMap.set(`${standard}-${registryProjectId}`, project); }); @@ -123,7 +135,12 @@ const handler = (fastify: FastifyInstance) => }); }); /** Compose all the data together to unique entries (unsorted) */ - const entries = composeProjectEntries(ProjectMap, CMSDataMap, poolPrices); + const entries = composeProjectEntries( + ProjectMap, + CMSDataMap, + poolPrices, + IcrListProjects + ); const sortedEntries = sortBy(entries, (e) => Number(e.price)); // Send the transformed projects array as a JSON string in the response diff --git a/carbonmark-api/src/routes/projects/get.utils.ts b/carbonmark-api/src/routes/projects/get.utils.ts index 0dcf02bd10..2773e31ac1 100644 --- a/carbonmark-api/src/routes/projects/get.utils.ts +++ b/carbonmark-api/src/routes/projects/get.utils.ts @@ -1,7 +1,13 @@ import { FastifyInstance } from "fastify"; -import { compact, isNil, max, maxBy, minBy, sortBy } from "lodash"; +import { compact, isArray, isNil, max, maxBy, minBy, sortBy } from "lodash"; import { map, mapValues, toLower, trim } from "lodash/fp"; +import fetch from "node-fetch"; import { FindDigitalCarbonProjectsQuery } from "src/.generated/types/digitalCarbon.types"; +import type { NetworkParam } from "src/models/NetworkParam.model"; +import type { IcrProject } from "src/utils/ICR/icr.types"; +import { ICR_API } from "../../../src/utils/ICR/ICR_API_endpoints"; +import { convertIcrCountryCodeToName } from "../../../src/utils/ICR/icr.utils"; +import { getCategoryFromMethodology } from "../../../src/utils/getCategoryFromMethodoloy"; import { Geopoint } from "../../.generated/types/cms.types"; import { GetProjectsQuery } from "../../.generated/types/marketplace.types"; import { Project } from "../../models/Project.model"; @@ -23,7 +29,6 @@ import { } from "../../utils/helpers/utils"; import { formatListing } from "../../utils/marketplace.utils"; import { POOL_INFO } from "./get.constants"; - /** * Build a default FindProjectsQueryVariables object for searching * via findProjects @@ -34,15 +39,45 @@ import { POOL_INFO } from "./get.constants"; * # this will cause a silent error. GQL Resolver needs to be updated to allow null search params * # to return all possible values */ + +export const fetchIcrData = async (network: NetworkParam) => { + const { ICR_API_URL, ICR_API_KEY } = ICR_API(network); + + const url = `${ICR_API_URL}/public/projects/filters`; + + const IcrResponse = await fetch(url, { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${ICR_API_KEY}`, + }, + }); + + const { vintages: IcrVintages, countryCodes: IcrCountryCodes } = + await IcrResponse.json(); + + if (!isArray(IcrCountryCodes) || !isArray(IcrVintages)) { + throw new Error("Response from server did not match schema definition"); + } + + const countryNames = await Promise.all( + IcrCountryCodes.map((countryCode: string) => + convertIcrCountryCodeToName(countryCode) + ) + ); + + return { IcrVintages, countryNames }; +}; + export const getDefaultQueryArgs = async ( sdk: GQL_SDK, - fastify: FastifyInstance + fastify: FastifyInstance, + network: NetworkParam ) => { - //Fetch all possible parameter values const [category, country, vintage] = await Promise.all([ getAllCategories(sdk, fastify).then(map(extract("id"))), - getAllCountries(sdk, fastify).then(map(extract("id"))), - getAllVintages(sdk, fastify), + getAllCountries(sdk, fastify, network).then(map(extract("id"))), + getAllVintages(sdk, fastify, network), ]); return { @@ -222,10 +257,15 @@ const pickUpdatedAt = (data: ProjectData): string => { const pickBestPrice = ( data: ProjectData, poolPrices: Record -): string | undefined => { - const listings = compact(data.marketplaceProjectData?.listings); +): string => { + const listings = compact(data.marketplaceProjectData?.listings || []); + // Careful, singleUnitPrice is a bigint string - const cheapestListing = minBy(listings, (l) => BigInt(l.singleUnitPrice)); + const cheapestListing = minBy( + listings, + (l) => !!l.active && !l.deleted && BigInt(l.singleUnitPrice) + ); + const cheapestListingUSDC = cheapestListing?.singleUnitPrice && formatUSDC(cheapestListing.singleUnitPrice); @@ -240,7 +280,7 @@ const pickBestPrice = ( Number(cheapestPoolPrice), ])?.toString(); - return bestPrice; + return bestPrice || "0"; }; /** @@ -250,7 +290,8 @@ const pickBestPrice = ( export const composeProjectEntries = ( projectDataMap: ProjectDataMap, cmsDataMap: CMSDataMap, - poolPrices: Record + poolPrices: Record, + IcrListProjects: IcrProject[] ): Project[] => { const entries: Project[] = []; projectDataMap.forEach((data) => { @@ -262,6 +303,57 @@ export const composeProjectEntries = ( standard: registry, registryProjectId, } = new CreditId(data.key); + + // @todo create alternate construction function for ICR + if (registry === "ICR") { + const icrProject = IcrListProjects.find( + (project) => project.num === Number(registryProjectId) + ); + + if (!icrProject) { + throw new Error( + `Could not find ICR project with num ${registryProjectId}` + ); + } + + const IcrEntry: Project = { + methodologies: [ + { + id: icrProject.methodology?.id, + name: icrProject.methodology?.title, + category: getCategoryFromMethodology(icrProject.methodology?.id), + }, + ], + description: icrProject?.shortDescription ?? null, + short_description: icrProject.shortDescription ?? null, + name: icrProject.fullName ?? "", + location: toGeoJSON(icrProject?.geoLocation), + country: { + id: convertIcrCountryCodeToName(icrProject.countryCode) ?? "", + }, + images: + icrProject.media?.map((img) => ({ + url: img.uri ?? "", + caption: img?.description ?? "", + })) ?? [], + key: projectId, + registry, + region: icrProject.geographicalRegion?.id ?? "", + projectID: registryProjectId, + vintage: market?.vintage ?? "", + creditTokenAddress: icrProject.projectContracts?.[0].address ?? "", + updatedAt: pickUpdatedAt(data), + price: pickBestPrice(data, poolPrices) || "0", + listings: market?.listings?.map(formatListing) || null, + serialization: + icrProject?.carbonCredits.find( + (credit) => credit.vintage === market?.vintage + )?.serialization ?? undefined, + }; + + entries.push(IcrEntry); + } + const carbonProject = cmsDataMap.get(projectId); /** If there are no prices hide this project */ const price = pickBestPrice(data, poolPrices); @@ -298,5 +390,6 @@ export const composeProjectEntries = ( entries.push(entry); }); + return entries; }; diff --git a/carbonmark-api/src/routes/purchases/[id]/get.ts b/carbonmark-api/src/routes/purchases/[id]/get.ts index f2de8ac3a1..a39c4b8481 100644 --- a/carbonmark-api/src/routes/purchases/[id]/get.ts +++ b/carbonmark-api/src/routes/purchases/[id]/get.ts @@ -1,10 +1,16 @@ import { utils } from "ethers"; import { FastifyInstance, FastifyReply, FastifyRequest } from "fastify"; import { isNil } from "lodash"; +import { + fetchCarbonProject, + type FetchCarbonProjectArgs, + type FetchCarbonProjectMethod, +} from "../../../../src/utils/helpers/cms.utils"; +import { REGISTRIES } from "../../../app.constants"; import { Purchase } from "../../../models/Purchase.model"; import { CreditId } from "../../../utils/CreditId"; import { gql_sdk } from "../../../utils/gqlSdk"; -import { fetchCarbonProject } from "../../../utils/helpers/cms.utils"; +import { ICR_API } from "./../../../../src/utils/ICR/ICR_API_endpoints"; import { Params, Querystring, schema } from "./get.schema"; import { isValidPurchaseId } from "./get.utils"; @@ -18,9 +24,11 @@ const handler = async ( if (!isValidPurchaseId(request.params.id)) { return reply.badRequest("Invalid purchase id: " + request.params.id); } - const sdk = gql_sdk(request.query.network); - const { purchase } = await sdk.marketplace.getPurchaseById(request.params); + const network = request.query.network ?? "polygon"; + + const sdk = gql_sdk(network); + const { purchase } = await sdk.marketplace.getPurchaseById(request.params); /** Handle the not found case */ if (isNil(purchase)) { return reply.status(404).send({ error: "Purchase not found" }); @@ -29,14 +37,42 @@ const handler = async ( const [standard, registryProjectId] = CreditId.splitProjectId( purchase.listing.project.key ); - const project = await fetchCarbonProject(sdk, { - registry: standard, - registryProjectId, - }); + let fetchCarbonProjectMethod: FetchCarbonProjectMethod; + let fetchCarbonProjectArgs: FetchCarbonProjectArgs; + + switch (standard) { + case REGISTRIES["ICR"].id: { + const { ICR_API_URL } = ICR_API(network); + fetchCarbonProjectMethod = ICR_API_URL; + fetchCarbonProjectArgs = { + // @todo use tokenAddress in place of the serialization for purchases as the serialization is not available on marketplace subgraph + contractAddress: purchase.listing.tokenAddress, + vintage: purchase.listing.project.vintage, + network: network, + }; + break; + } + default: + fetchCarbonProjectMethod = sdk; + fetchCarbonProjectArgs = { + registry: standard, + registryProjectId, + network: network, + }; + break; + } + const project = await fetchCarbonProject( + fetchCarbonProjectMethod, + fetchCarbonProjectArgs + ); + + const amount = purchase.listing.project.key.startsWith("ICR") + ? purchase.amount + : utils.formatUnits(purchase.amount, 18); const response: Purchase = { id: purchase.id, - amount: utils.formatUnits(purchase.amount, 18), + amount: amount, price: utils.formatUnits(purchase.price, 6), listing: { id: purchase.listing.id, @@ -47,10 +83,11 @@ const handler = async ( project: { key: purchase.listing.project.key, vintage: purchase.listing.project.vintage, - methodology: project.methodologies?.[0]?.id ?? "", - name: project.name ?? "", + methodology: project?.methodologies?.[0]?.id ?? "", + name: project?.name ?? "", projectID: registryProjectId, - country: project.country ?? "", + country: project?.country ?? "", + serialization: project?.key ?? undefined, }, }, }; diff --git a/carbonmark-api/src/routes/users/[walletOrHandle]/get.ts b/carbonmark-api/src/routes/users/[walletOrHandle]/get.ts index 12ae47a392..72b5153864 100644 --- a/carbonmark-api/src/routes/users/[walletOrHandle]/get.ts +++ b/carbonmark-api/src/routes/users/[walletOrHandle]/get.ts @@ -29,6 +29,7 @@ const handler = (fastify: FastifyInstance) => try { const { query, params } = request; + const network = query.network ?? "polygon"; const walletOrHandle = params.walletOrHandle.toLowerCase(); // Fetch the firebase UserProfile first @@ -52,12 +53,12 @@ const handler = (fastify: FastifyInstance) => const [user, assets] = await Promise.all([ getUserByWallet({ address: profile.address, - network: query.network, + network: network, expiresAfter: query.expiresAfter, }), getHoldingsByWallet({ address: profile.address, - network: query.network, + network: network, }), ]); @@ -82,9 +83,13 @@ const handler = (fastify: FastifyInstance) => }; return { ...a, - amount: utils.formatUnits(a.amount || "0", 18), + amount: a.project.key.startsWith("ICR") + ? a.amount + : utils.formatUnits(a.amount || "0", 18), price: utils.formatUnits(a.price || "0", 6), - previousAmount: utils.formatUnits(a.previousAmount || "0", 18), + previousAmount: a.project.key.startsWith("ICR") + ? a.previousAmount + : utils.formatUnits(a.previousAmount || "0", 18), previousPrice: utils.formatUnits(a.previousPrice || "0", 6), buyer: buyer || null, seller: seller || null, diff --git a/carbonmark-api/src/routes/users/[walletOrHandle]/get.utils.ts b/carbonmark-api/src/routes/users/[walletOrHandle]/get.utils.ts index 1e76f7cfc3..72d1149105 100644 --- a/carbonmark-api/src/routes/users/[walletOrHandle]/get.utils.ts +++ b/carbonmark-api/src/routes/users/[walletOrHandle]/get.utils.ts @@ -2,11 +2,13 @@ import { Contract, providers, utils } from "ethers"; import { compact, sortBy, sortedUniq } from "lodash"; import { pipe } from "lodash/fp"; import ERC20 from "../../../abis/ERC20.json"; -import { RPC_URLS } from "../../../app.constants"; +import { URLS } from "../../../app.constants"; import { NetworkParam } from "../../../models/NetworkParam.model"; import { Holding } from "../../../types/assets.types"; import { gql_sdk } from "../../../utils/gqlSdk"; +type MultipleTokenStandardType = Holding & { token: { tokenId?: string } }; + const formatHolding = (h: Holding): Holding => { return { ...h, @@ -19,12 +21,13 @@ const formatHolding = (h: Holding): Holding => { const fetchTestnetHoldings = async (params: { address: string; }): Promise => { - const provider = new providers.JsonRpcProvider(RPC_URLS.polygonTestnetRpc); + const provider = new providers.JsonRpcProvider(URLS.polygonTestnetRpc); + const sdk = gql_sdk("mumbai"); // we hardcode known testnet tokens here const TOKEN_INFO = [ { symbol: "TCO2-VCS-981-2017", - address: "0xeCF4A1B92a463C843CDcB7cb7A2F2DdFe07651BB", + address: "0xecf4a1b92a463c843cdcb7cb7a2f2ddfe07651bb", decimals: 18, }, { @@ -43,23 +46,55 @@ const fetchTestnetHoldings = async (params: { decimals: 18, }, ]; + const balancePromises = TOKEN_INFO.map((tco2) => new Contract(tco2.address, ERC20, provider).balanceOf(params.address) ); - const tco2Balances: bigint[] = await Promise.all(balancePromises); - const holdings: Holding[] = tco2Balances.map((balance, i) => { - return { - amount: balance.toString(), - id: `0x_mock_holding_id_${i}`, + + const fetchTco2Balances = Promise.all(balancePromises); + const fetchIcrHoldings = sdk.icr.getHoldingsByAddress({ + id: params.address, + }); + + const [tco2Balances, IcrBalances] = await Promise.all([ + fetchTco2Balances, + fetchIcrHoldings, + ]); + + const tco2Holdings: MultipleTokenStandardType[] = tco2Balances.map( + (balance, i) => { + return { + amount: balance.toString(), + id: `0x_mock_holding_id_${i}`, + token: { + decimals: 18, + id: TOKEN_INFO.at(i)?.address ?? "", + name: TOKEN_INFO.at(i)?.symbol ?? "", + symbol: TOKEN_INFO.at(i)?.symbol ?? "", + }, + }; + } + ); + + let icrHoldings: MultipleTokenStandardType[] = []; + if (IcrBalances.holder?.exPostAmounts) { + icrHoldings = IcrBalances.holder.exPostAmounts.map((item) => ({ + amount: utils.parseUnits(item.amount, 18).toString(), + id: item.exPost.serialization, token: { decimals: 18, - id: TOKEN_INFO.at(i)?.address ?? "", - name: TOKEN_INFO.at(i)?.symbol ?? "", - symbol: TOKEN_INFO.at(i)?.symbol ?? "", + id: item.exPost.project.id, + name: item.exPost.project.projectName, + symbol: item.exPost.serialization, + tokenId: item.exPost.tokenId, }, - }; - }); - return holdings.map(formatHolding).filter((h) => Number(h.amount) > 0); + })); + } + + const combinedHoldings = [...tco2Holdings, ...icrHoldings]; + return combinedHoldings + .map(formatHolding) + .filter((h) => Number(h.amount) > 0); }; /** Network-aware fetcher for marketplace user data (listings and activities) */ @@ -89,12 +124,47 @@ export const getHoldingsByWallet = async (params: { address: params.address, }); } + const sdk = gql_sdk(params.network); - // TODO: should be `polygon-digital-carbon` instead of `assets` subgraph - const { accounts } = await sdk.assets.getHoldingsByWallet({ - wallet: params.address, - }); - return accounts.at(0)?.holdings.map(formatHolding) ?? []; + // @todo : should be `polygon-digital-carbon` instead of `assets` subgraph + try { + const holdingsPromise = sdk.assets.getHoldingsByWallet({ + wallet: params.address, + }); + // @todo need to have ICR fetch for mainnet + const icrHoldingsPromise = sdk.icr.getHoldingsByAddress({ + id: params.address, + }); + + const [holdingsResponse, IcrHoldingsResponse] = await Promise.all([ + holdingsPromise, + icrHoldingsPromise, + ]); + + let icrHoldings: MultipleTokenStandardType[] = []; + + if (IcrHoldingsResponse.holder?.exPostAmounts) { + icrHoldings = IcrHoldingsResponse.holder.exPostAmounts.map((item) => ({ + amount: item.amount, + id: item.exPost.serialization, + token: { + decimals: 0, + id: item.exPost.project.id, + name: item.exPost.project.projectName, + symbol: item.exPost.serialization, + tokenId: item.exPost.tokenId, + }, + })); + } + const assetsHoldings = holdingsResponse.accounts.at(0)?.holdings ?? []; + + const allHoldings = [...assetsHoldings, ...icrHoldings]; + + return allHoldings.map(formatHolding) ?? []; + } catch (error) { + console.error("Error fetching holdings:", error); + return []; + } }; /** Reduce an array of activities into a deduplicated sorted array of buyer and seller address strings. */ diff --git a/carbonmark-api/src/routes/vintages/get.ts b/carbonmark-api/src/routes/vintages/get.ts index 6d9de816c2..d7363397f6 100644 --- a/carbonmark-api/src/routes/vintages/get.ts +++ b/carbonmark-api/src/routes/vintages/get.ts @@ -10,9 +10,10 @@ const handler = (fastify: FastifyInstance) => reply: FastifyReply ) { let response: Vintage[]; - const sdk = gql_sdk(request.query.network); + const network = request.query.network ?? "polygon"; + const sdk = gql_sdk(network); try { - response = await getAllVintages(sdk, fastify); + response = await getAllVintages(sdk, fastify, network); } catch (error) { //Return bad gateway and pass the error console.error(error); diff --git a/carbonmark-api/src/utils/CreditId.ts b/carbonmark-api/src/utils/CreditId.ts index e6c136ee80..9cd9b46c0e 100644 --- a/carbonmark-api/src/utils/CreditId.ts +++ b/carbonmark-api/src/utils/CreditId.ts @@ -1,6 +1,6 @@ import { includes } from "lodash"; -const standards = ["VCS", "PURO", "ICR"] as const; +const standards = ["VCS", "PURO", "ICR", "GS"] as const; /** Known supported standards on-chain */ export type Standard = (typeof standards)[number]; @@ -34,7 +34,8 @@ export class CreditId { creditId: CreditIdentifier; public static ValidCreditIdRegex = - /^(VCS|PURO|ICR|GS)-\d+-(19\d{2}|20\d{2})$/i; + /^(VCS|PURO|GS|ICR)-\d+-(19\d{2}|20\d{2})$|^ICR-(?:[A-Z]+-\d+-(\d+-)?\d+-[A-Z]-\d+-(19\d{2}|20\d{2})|[A-Z]+-\d+-\d+-\d+-[A-Z]-\d+-\d+)$/i; + public static ValidProjectIdRegex = /^(VCS|PURO|ICR|GS)-\d+$/i; // case insensitive constructor(params: UntypedParams); @@ -77,14 +78,34 @@ export class CreditId { static isValidProjectId = (id: unknown): id is `${string}-${string}` => CreditId.ValidProjectIdRegex.test(String(id)); + /** Case insensitive type-guard @example isValidStandard("ICR") // true */ + static isValidStandard(value: string): value is Standard { + return standards.some((standard) => standard === value); + } + /* eslint-disable @typescript-eslint/consistent-type-assertions -- type guards */ /** Validates, splits and capitalizes a CreditIdentifier string */ static splitCreditId( creditId: string ): [Standard, RegistryProjectId, Vintage] { if (!this.isValidCreditId(creditId)) throw new Error("Invalid CreditId"); - const [standard, registryProjectId, vintage] = creditId.split("-"); - return [standard.toUpperCase() as Standard, registryProjectId, vintage]; + + const parts = creditId.split("-"); + const standard = parts[0].toUpperCase(); + + if (!CreditId.isValidStandard(standard)) { + throw new Error("Invalid Standard"); + } + // handle ICR serialization case + if (standard === "ICR" && parts.length > 3) { + const registryProjectId = parts[3]; + const vintage = parts[parts.length - 1]; + return [standard, registryProjectId, vintage]; + } else { + const registryProjectId = parts[1]; + const vintage = parts[2]; + return [standard, registryProjectId, vintage]; + } } /** Validates, splits and capitalizes a ProjectIdentifier string */ diff --git a/carbonmark-api/src/utils/ICR/ICR_API_endpoints.ts b/carbonmark-api/src/utils/ICR/ICR_API_endpoints.ts new file mode 100644 index 0000000000..4478b74bac --- /dev/null +++ b/carbonmark-api/src/utils/ICR/ICR_API_endpoints.ts @@ -0,0 +1,36 @@ +// import { ICR_CONFIG } from "../../app.constants"; +import { NetworkParam } from "../../models/NetworkParam.model"; + +const ICR_CONFIG = { + polygon: { + url: "https://api.carbonregistry.com/v0", + apiKey: process.env.ICR_MAINNET_API_KEY, + }, + mumbai: { + url: "https://gaia-api-dev.mojoflower.io/v0", + apiKey: process.env.ICR_MUMBAI_API_KEY, + }, +}; + +export const ICR_API = ( + network?: "polygon" | "mumbai" +): { ICR_API_URL: string; ICR_API_KEY: string } => { + const validatedNetwork: NetworkParam = + network === "polygon" || network === "mumbai" ? network : "polygon"; + + const apiConfig = ICR_CONFIG[validatedNetwork]; + + if (!apiConfig.apiKey) { + throw new Error( + `ICR api key is undefined for network: ${validatedNetwork}` + ); + } + + if (!apiConfig.url) { + throw new Error( + `ICR api url is undefined for network: ${validatedNetwork}` + ); + } + + return { ICR_API_URL: apiConfig.url, ICR_API_KEY: apiConfig.apiKey }; +}; diff --git a/carbonmark-api/src/utils/ICR/icr.types.ts b/carbonmark-api/src/utils/ICR/icr.types.ts new file mode 100644 index 0000000000..59aa89ed19 --- /dev/null +++ b/carbonmark-api/src/utils/ICR/icr.types.ts @@ -0,0 +1,200 @@ +export type IcrProject = { + acceptedTerms: boolean; + _id: string; + additionalLevels: AdditionalLevel[]; + areaSpan: any[]; + carbonCredits: CarbonCredit[]; + city: string | null; + projectStatus: { id: string; title: string }; + contactPerson: ContactPerson[]; + countryCode: string; + createdAt: string; + creditingPeriodNumYears: number; + creditingPeriodRenewal: boolean; + creditingPeriodStartDate: string; + startDate: string; + icrDocuments: icrDocument[]; + email: string | null; + estimatedAnnualMitigations: EstimatedAnnualMitigation[]; + fullName: string; + gallery: GalleryItem[]; + geographicalRegion: GeographicalRegion | null; + geoLocation: GeoLocation; + ghgProgram: GHGProgram; + headline: string; + isCriteriaForValidation: boolean; + isCriteriaForVerification: boolean; + isDeviatesFromMethodology: boolean; + isGroupedProject: boolean; + isHostCountryApproval: boolean; + isInformationUpdatedRegularly: boolean; + isInReview: boolean; + isMethodology: boolean; + isSpanArea: boolean; + isTransitioningFromOtherGHGProgram: boolean; + linkToProject: string | null; + media: MediaItem[]; + methodology: Methodology; + methodologyDeviationDescription: string | null; + mrvCycle: any | null; + num: number; + onChainId: string; + otherBenefits: OtherBenefit[]; + owner: Owner; + participants: any[]; + projectContracts: ProjectContract[]; + projectType: ProjectType; + sector: Sector; + sequestrationPermanenceInYears: number; + shortDescription: string; + state: string | null; + statusState: string; + streetName: string | null; + updatedAt: string; + status: string; + validationCriteria: any[]; + verificationCriteria: any[]; + website: string; + zip: string | null; +}; + +export type CarbonCredit = { + serialization: string; + tokenId: string; + ticker: string; + type: string; + vintage: string; +}; + +type GeographicalRegion = { + id: string; + title: string; + content: null; + extraTitle: null; +}; + +type AdditionalLevel = { + title: string; + checked: boolean; + description: string; + additionalityId: number; +}; + +type ContactPerson = { + email: string; + fullName: string; + roles: any[]; + userRef: any; +}; + +type icrDocument = { + _id: string; + createdAt: string; + description: string; + fileName: string; + fileSize: number; + fileType: string; + isPublic: boolean; + mimetype: string; + type: string; + updatedAt: string; + fileRef: any; + uri: string; +}; + +type EstimatedAnnualMitigation = { + date: string; + vintage: string; + estimatedMitigation: number; +}; + +type GalleryItem = { + _id: string; + createdAt: string; + description: string | null; + fileName: string; + fileSize: number; + fileType: string; + isPublic: boolean; + mimetype: string; + updatedAt: string; + fileRef: any; + uri: string; +}; + +type GeoLocation = { + lat: number; + lng: number; +}; + +type GHGProgram = { + id: string; + title: string; + content: string; + extraTitle: string | null; +}; + +type MediaItem = { + _id: string; + createdAt: string; + description: string | null; + fileName: string; + fileSize: number; + fileType: string; + isPublic: boolean; + mimetype: string; + updatedAt: string; + fileRef: any; + uri: string; +}; + +type Methodology = { + id: string; + title: string; +}; + +type OtherBenefit = { + title: string; + checked: boolean; + benefitId: number; + description: string; +}; + +type Owner = { + fullName: string; + ref: OwnerRef; +}; + +type OwnerRef = { + type: any[]; + termsAccepted: boolean; + _id: string; + id: string; + city: string; + website: string; + isPublic: boolean; + companyLogo: any; + companyType: string; + countryCode: string; + fullName: string; + physicalAddress: string; + registrationNumber: string; +}; + +type ProjectContract = { + address: string; + chainId: string; + projectId: string; +}; + +type ProjectType = { + id: string; + title: string; + content: string; + extraTitle: string | null; +}; + +type Sector = { + id: number; + title: string; +}; diff --git a/carbonmark-api/src/utils/ICR/icr.utils.ts b/carbonmark-api/src/utils/ICR/icr.utils.ts new file mode 100644 index 0000000000..6a40b62608 --- /dev/null +++ b/carbonmark-api/src/utils/ICR/icr.utils.ts @@ -0,0 +1,50 @@ +import fetch from "node-fetch"; +import type { NetworkParam } from "../../../src/models/NetworkParam.model"; +import type { IcrProject } from "../ICR/icr.types"; +import { ICR_API } from "./ICR_API_endpoints"; + +export const convertIcrCountryCodeToName = (code: string) => { + if (!code) return; + const regionNames = new Intl.DisplayNames(["en"], { type: "region" }); + const country = regionNames.of(code); + return country; +}; + +export const fetchAllICRProjects = async ( + network: NetworkParam +): Promise => { + const { ICR_API_URL, ICR_API_KEY } = ICR_API(network); + let allProjects: IcrProject[] = []; + let page = 0; + const limit = 50; + let shouldFetchProjects = true; + + while (shouldFetchProjects) { + const response = await fetch( + ICR_API_URL + `/public/projects/list?page=${page}&limit=${limit}`, + { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${ICR_API_KEY}`, + }, + } + ); + + const data = await response.json(); + + // remove any projects with no associated carbon credits + const filteredProjects: IcrProject[] = data.projects.filter( + (project: IcrProject) => project.carbonCredits.length > 0 + ); + + allProjects = [...allProjects, ...filteredProjects]; + if (filteredProjects.length < limit) { + shouldFetchProjects = false; + break; + } + page++; + } + + return allProjects; +}; diff --git a/carbonmark-api/src/utils/getCategoryFromMethodoloy.ts b/carbonmark-api/src/utils/getCategoryFromMethodoloy.ts new file mode 100644 index 0000000000..d77b93c82a --- /dev/null +++ b/carbonmark-api/src/utils/getCategoryFromMethodoloy.ts @@ -0,0 +1,185 @@ +// import { CategoryName } from "../../../lib/types/carbonmark.types"; +// @todo correct types and import from lib if possible +const getMap = () => { + const methodologyToCategoryMap = new Map(); + + //Renewable Energy + methodologyToCategoryMap.set("AM0103", "Renewable Energy"); + methodologyToCategoryMap.set("ACM0002", "Renewable Energy"); + methodologyToCategoryMap.set("AMS-I.D.", "Renewable Energy"); + methodologyToCategoryMap.set("AMS-I.C.", "Renewable Energy"); + methodologyToCategoryMap.set("ACM0018", "Renewable Energy"); + + //Energy Efficiency + methodologyToCategoryMap.set("AM0038", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0043", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0044", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0046", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0055", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0055", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0056", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0061", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0062", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0067", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0091", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0105", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0106", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0113", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0114", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0115", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0116", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0117", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0118", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0119", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0120", "Energy Efficiency"); + methodologyToCategoryMap.set("AM0121", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0008", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0018", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0019", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0020", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0025", "Energy Efficiency"); + methodologyToCategoryMap.set("VMR0005", "Energy Efficiency"); + methodologyToCategoryMap.set("VMR0006", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0001", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0002", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0008", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0019", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0020", "Energy Efficiency"); + methodologyToCategoryMap.set("VM0018", "Energy Efficiency"); + methodologyToCategoryMap.set("ACM0012", "Energy Efficiency"); + methodologyToCategoryMap.set("AMS-III.Z", "Energy Efficiency"); + methodologyToCategoryMap.set("GS TPDDTEC v 1.", "Energy Efficiency"); + methodologyToCategoryMap.set("AMS-II.G.", "Energy Efficiency"); + + //Agriculture + methodologyToCategoryMap.set("VM0041", "Agriculture"); + methodologyToCategoryMap.set("VM0042", "Agriculture"); + methodologyToCategoryMap.set("VM0017", "Agriculture"); + methodologyToCategoryMap.set("VMR0003", "Agriculture"); + methodologyToCategoryMap.set("AMS-III.AU.", "Agriculture"); + methodologyToCategoryMap.set("AMS-III.BE", "Agriculture"); + methodologyToCategoryMap.set("AMS-III.BF", "Agriculture"); + methodologyToCategoryMap.set("VM0017", "Agriculture"); + methodologyToCategoryMap.set("AMS-III.D.", "Agriculture"); + + //Forestry + methodologyToCategoryMap.set("VM0004", "Forestry"); + methodologyToCategoryMap.set("VM0007", "Forestry"); + methodologyToCategoryMap.set("VM0024", "Forestry"); + methodologyToCategoryMap.set("VM0027", "Forestry"); + methodologyToCategoryMap.set("VM0033", "Forestry"); + methodologyToCategoryMap.set("VM0036", "Forestry"); + methodologyToCategoryMap.set("VM0003", "Forestry"); + methodologyToCategoryMap.set("VM0004", "Forestry"); + methodologyToCategoryMap.set("VM0005", "Forestry"); + methodologyToCategoryMap.set("VM0006", "Forestry"); + methodologyToCategoryMap.set("VM0007", "Forestry"); + methodologyToCategoryMap.set("VM0009", "Forestry"); + methodologyToCategoryMap.set("VM0010", "Forestry"); + methodologyToCategoryMap.set("VM0011", "Forestry"); + methodologyToCategoryMap.set("VM0012", "Forestry"); + methodologyToCategoryMap.set("VM0015", "Forestry"); + methodologyToCategoryMap.set("VM0029", "Forestry"); + methodologyToCategoryMap.set("VM0034", "Forestry"); + methodologyToCategoryMap.set("VM0035", "Forestry"); + methodologyToCategoryMap.set("VM0037", "Forestry"); + methodologyToCategoryMap.set("AR-ACM0003", "Forestry"); + methodologyToCategoryMap.set("AR-AM0014", "Forestry"); + methodologyToCategoryMap.set("AR-AMS0003", "Forestry"); + methodologyToCategoryMap.set("AR-AMS0007", "Forestry"); + methodologyToCategoryMap.set("AR-ACM0001", "Forestry"); + methodologyToCategoryMap.set("AM0014", "Forestry"); + + //Other nature based + methodologyToCategoryMap.set("VM0021", "Other Nature-Based"); + methodologyToCategoryMap.set("VM0026", "Other Nature-Based"); + methodologyToCategoryMap.set("VM0032", "Other Nature-Based"); + methodologyToCategoryMap.set("AM0010", "Other Nature-Based"); + + //Industrial processing + methodologyToCategoryMap.set("AM0048", "Industrial Processing"); + methodologyToCategoryMap.set("AM0050", "Industrial Processing"); + methodologyToCategoryMap.set("AM0059", "Industrial Processing"); + methodologyToCategoryMap.set("AM0092", "Industrial Processing"); + methodologyToCategoryMap.set("AM0095", "Industrial Processing"); + methodologyToCategoryMap.set("AM0096", "Industrial Processing"); + methodologyToCategoryMap.set("AMS-III.M.", "Industrial Processing"); + methodologyToCategoryMap.set("AM0025", "Industrial Processing"); + + //Other + methodologyToCategoryMap.set("AM0052", "Other"); + methodologyToCategoryMap.set("AM0053", "Other"); + methodologyToCategoryMap.set("AM0057", "Other"); + methodologyToCategoryMap.set("AM0058", "Other"); + methodologyToCategoryMap.set("AM0064", "Other"); + methodologyToCategoryMap.set("AM0065", "Other"); + methodologyToCategoryMap.set("AM0066", "Other"); + methodologyToCategoryMap.set("AM0069", "Other"); + methodologyToCategoryMap.set("AM0070", "Other"); + methodologyToCategoryMap.set("AM0070", "Other"); + methodologyToCategoryMap.set("AM0072", "Other"); + methodologyToCategoryMap.set("AM0073", "Other"); + methodologyToCategoryMap.set("AM0074", "Other"); + methodologyToCategoryMap.set("AM0075", "Other"); + methodologyToCategoryMap.set("AM0076", "Other"); + methodologyToCategoryMap.set("AM0077", "Other"); + methodologyToCategoryMap.set("AM0078", "Other"); + methodologyToCategoryMap.set("AM0079", "Other"); + methodologyToCategoryMap.set("AM0080", "Other"); + methodologyToCategoryMap.set("AM0081", "Other"); + methodologyToCategoryMap.set("AM0082", "Other"); + methodologyToCategoryMap.set("AM0083", "Other"); + methodologyToCategoryMap.set("AM0084", "Other"); + methodologyToCategoryMap.set("AM0086", "Other"); + methodologyToCategoryMap.set("AM0088", "Other"); + methodologyToCategoryMap.set("AM0089", "Other"); + methodologyToCategoryMap.set("AM0090", "Other"); + methodologyToCategoryMap.set("AM0093", "Other"); + methodologyToCategoryMap.set("AM0094", "Other"); + methodologyToCategoryMap.set("AM0097", "Other"); + methodologyToCategoryMap.set("AM0098", "Other"); + methodologyToCategoryMap.set("AM0100", "Other"); + methodologyToCategoryMap.set("AM0104", "Other"); + methodologyToCategoryMap.set("AM0107", "Other"); + methodologyToCategoryMap.set("AM0108", "Other"); + methodologyToCategoryMap.set("AM0109", "Other"); + methodologyToCategoryMap.set("AM0110", "Other"); + methodologyToCategoryMap.set("AM0112", "Other"); + methodologyToCategoryMap.set("AM0122", "Other"); + methodologyToCategoryMap.set("VM0013", "Other"); + methodologyToCategoryMap.set("VM0040", "Other"); + methodologyToCategoryMap.set("VMR0004", "Other"); + methodologyToCategoryMap.set("VM0014", "Other"); + methodologyToCategoryMap.set("VM0016", "Other"); + methodologyToCategoryMap.set("VM0023", "Other"); + methodologyToCategoryMap.set("VM0030", "Other"); + methodologyToCategoryMap.set("VM0031", "Other"); + methodologyToCategoryMap.set("VM0040", "Other"); + methodologyToCategoryMap.set("VM0043", "Other"); + methodologyToCategoryMap.set("VM0039", "Other"); + methodologyToCategoryMap.set("VMR0004", "Other"); + methodologyToCategoryMap.set("VMR0001", "Other"); + methodologyToCategoryMap.set("VMR0002", "Other"); + methodologyToCategoryMap.set("ACM0001", "Other"); + methodologyToCategoryMap.set("ACM0006", "Other"); + methodologyToCategoryMap.set("AM0029", "Other"); + methodologyToCategoryMap.set("AM0001", "Other"); + methodologyToCategoryMap.set("AMS-III.G.", "Other"); + methodologyToCategoryMap.set("AM0009", "Other"); + methodologyToCategoryMap.set("AMS-III.H.", "Other"); + + return methodologyToCategoryMap; +}; + +export const getCategoryFromMethodology = (methodology: string): any => { + const methodologyArray = methodology.split(","); // take the first, ignore the rest + const firstMethod = methodologyArray[0].trim(); + + const map = getMap(); + + if (!map) { + throw new Error("Map cannot be null"); + } + + return map.get(firstMethod) || "Other"; // fallback to Other not found, CarbonMark API does the same! +}; diff --git a/carbonmark-api/src/utils/gqlSdk.ts b/carbonmark-api/src/utils/gqlSdk.ts index 2958b88ade..c3621c3f06 100644 --- a/carbonmark-api/src/utils/gqlSdk.ts +++ b/carbonmark-api/src/utils/gqlSdk.ts @@ -8,6 +8,7 @@ import { getSdk as digitalCarbonSdk, Sdk as DigitalCarbonSdk, } from "../.generated/types/digitalCarbon.types"; +import { getSdk as icrSdk, Sdk as IcrSdk } from "../.generated/types/icr.types"; import { getSdk as marketplaceSdk, Sdk as MarketplaceSdk, @@ -30,6 +31,7 @@ export type GQL_SDK = { tokens: TokensSdk; cms: CMSSdk; digital_carbon: DigitalCarbonSdk; + icr: IcrSdk; }; const sdks = { @@ -39,6 +41,7 @@ const sdks = { tokens: tokensSdk, cms: cmsSdk, digital_carbon: digitalCarbonSdk, + icr: icrSdk, }; export const gql_sdk = ( @@ -54,5 +57,6 @@ export const gql_sdk = ( new GraphQLClient(graph_urls.digitalCarbon) ), cms: sdks.cms(new GraphQLClient(SANITY_URLS.cms)), + icr: sdks.icr(new GraphQLClient(graph_urls.icr)), }; }; diff --git a/carbonmark-api/src/utils/helpers/activities.utils.ts b/carbonmark-api/src/utils/helpers/activities.utils.ts index b3b76c06f4..f3bfaaae6a 100644 --- a/carbonmark-api/src/utils/helpers/activities.utils.ts +++ b/carbonmark-api/src/utils/helpers/activities.utils.ts @@ -23,11 +23,18 @@ const mapUserToActivities = async ( previousPrice: activity.previousPrice ? utils.formatUnits(activity.previousPrice, 6) : null, - amount: activity.amount ? utils.formatUnits(activity.amount, 18) : null, + amount: activity.amount + ? activity.project.key.startsWith("ICR") + ? activity.amount + : utils.formatUnits(activity.amount, 18) + : null, previousAmount: activity.previousAmount - ? utils.formatUnits(activity.previousAmount, 18) + ? activity.project.key.startsWith("ICR") + ? activity.amount + : utils.formatUnits(activity.previousAmount, 18) : null, })); + const userIds = new Set(); formattedActivities.forEach((activity) => { if (activity.seller) { diff --git a/carbonmark-api/src/utils/helpers/cms.utils.ts b/carbonmark-api/src/utils/helpers/cms.utils.ts index 531a6df129..3a156363ac 100644 --- a/carbonmark-api/src/utils/helpers/cms.utils.ts +++ b/carbonmark-api/src/utils/helpers/cms.utils.ts @@ -1,19 +1,50 @@ import { compact, merge } from "lodash"; import { filter, pipe } from "lodash/fp"; +import fetch from "node-fetch"; +import { NetworkParam } from "src/models/NetworkParam.model"; import { SetRequired } from "../../../../lib/utils/typescript.utils"; import { GetCmsProjectQuery, ProjectContent, } from "../../.generated/types/cms.types"; +import { convertIcrCountryCodeToName } from "../ICR/icr.utils"; import { arrayToMap } from "../array.utils"; import { extract, notNil, selector } from "../functional.utils"; +import { getCategoryFromMethodology } from "../getCategoryFromMethodoloy"; import { GQL_SDK } from "../gqlSdk"; +import { ICR_API } from "./../../../src/utils/ICR/ICR_API_endpoints"; -type Args = { - registry: string; // e.g VCS - registryProjectId: string; //e.g 1121 +export type ProjectImage = { + asset?: { + url?: string | null; + caption?: string | null; + altText?: string | null; + } | null; }; +type IcrCarbonImage = { + uri: string; + fileName: string; +}; + +type SdkArgs = { + registry: string; + registryProjectId: string; +}; + +type IcrArgs = + | { serialization: string; network: NetworkParam; contractAddress?: never } + | { + contractAddress: string; + vintage?: string; + network: NetworkParam; + serialization?: never; + }; + +export type FetchCarbonProjectMethod = GQL_SDK | string; + +export type FetchCarbonProjectArgs = SdkArgs | IcrArgs; + /** * Generates a unique key for a project using its registry and id. */ @@ -29,30 +60,159 @@ export type CarbonProject = GetCmsProjectQuery["allProject"][number] & { content?: ProjectContent; }; -/** - * Fetches a carbon project based on the provided registry and id. - */ -export const fetchCarbonProject = async (sdk: GQL_SDK, args: Args) => { - const [{ allProject }, { allProjectContent }] = await Promise.all([ - sdk.cms.getCMSProject(args), - sdk.cms.getCMSProjectContent(args), - ]); +// fix return type +export const fetchCarbonProject = async ( + sdk: FetchCarbonProjectMethod, + args: FetchCarbonProjectArgs +) => { + /** @todo all of the below workarounds can be removed once cms is the single source of project truth */ + if ( + ("serialization" in args || "contractAddress" in args) && + typeof sdk === "string" + ) { + let url = ""; + + // when required to fetch by serialization + if ("serialization" in args && typeof sdk === "string") { + url = `${sdk}/public/projects?creditSerialization=${args.serialization}`; + // when required to fetch by contract address + } else if ("contractAddress" in args && typeof sdk === "string") { + url = `${sdk}/public/projects?contractAddress=${args.contractAddress}`; + } + const { ICR_API_KEY } = ICR_API(args.network); - const project = allProject.at(0); - const content = allProjectContent.at(0); - const key = projectKey(args); + try { + const response = await fetch(url, { + method: "GET", + headers: { + "Content-Type": "application/json", + Authorization: `Bearer ${ICR_API_KEY}`, + }, + }); - return { - ...project, - ...content, - key, - }; + const apiData = await response.json(); + if (apiData.statusCode === 404) { + console.info("ICR API returned 404. No Project Found."); + return null; + } + + // make common type to export + const images: ProjectImage[] = + apiData.media?.map((image: IcrCarbonImage) => ({ + asset: { + url: image.uri, + caption: image.fileName, + }, + })) || []; + + const registry = apiData.ghgProgram?.id.toUpperCase() || null; + + // helper function to extract tokenID from vintage + const findTokenIdByVintage = ( + vintage: string | undefined + ): string | null => { + if (!vintage) { + return null; + } + for (const credit of apiData.carbonCredits) { + if (credit.vintage === vintage) { + return credit.tokenId; + } + } + return null; + }; + + // helper function to extract serialization from vintage + const findSerializationByVintage = ( + vintage: string | undefined + ): string | null => { + if (!vintage) { + return null; + } + for (const credit of apiData.carbonCredits) { + if (credit.vintage === vintage) { + return credit.serialization; + } + } + return null; + }; + + // extract the matching tokenID from the vintage in serialization + // @todo can avoid this by keeping project in cms and not having to fetch from ICR + let vintage; + let serialization; + + if (typeof args.serialization === "string") { + vintage = args.serialization.split("-").pop(); + serialization = args.serialization; + } + + if (typeof args.contractAddress === "string") { + vintage = args.vintage; + serialization = findSerializationByVintage(args.vintage); + } + + return { + key: serialization ?? "", + country: convertIcrCountryCodeToName(apiData.countryCode) || null, + description: apiData.shortDescription || null, + name: apiData.fullName || null, + region: apiData.geographicalRegion || null, + registry: registry || null, + url: apiData.website || null, + registryProjectId: apiData.num || null, + id: `${registry}-${apiData.num}` || null, + geolocation: apiData.geoLocation || null, + methodologies: + [ + { + id: apiData?.methodology?.id, + category: getCategoryFromMethodology(apiData?.methodology?.id), + name: apiData.methodology.title, + }, + ] || null, + shortDescription: apiData.shortDescription || null, + longDescription: apiData.description || null, + project: { + registry: registry || null, + registryProjectId: apiData.num || null, + }, + coverImage: apiData.documents?.[0]?.uri || null, + images, + tokenId: findTokenIdByVintage(vintage) || null, + vintage: vintage || null, + }; + } catch (error) { + // catch 403s here for mainnet keys that are not verified + console.error(error); + throw error; + } + // standard cms lookup + } else if ("registry" in args && typeof sdk !== "string") { + const [{ allProject }, { allProjectContent }] = await Promise.all([ + sdk.cms.getCMSProject(args), + sdk.cms.getCMSProjectContent(args), + ]); + + const project = allProject?.at(0); + const content = allProjectContent?.at(0); + const key = projectKey(args); + return { + ...project, + ...content, + key, + }; + } + throw new Error( + "Invalid arguments or SDK type provided to fetchCarbonProject" + ); }; /** * Fetches all carbon projects and their content * @returns {Promise} An array of all fetched projects. */ + export const fetchAllCarbonProjects = async ( sdk: GQL_SDK ): Promise => { diff --git a/carbonmark-api/src/utils/helpers/fetchPoolPricesAndStats.ts b/carbonmark-api/src/utils/helpers/fetchPoolPricesAndStats.ts index 4a65f49b1a..511f3940c1 100644 --- a/carbonmark-api/src/utils/helpers/fetchPoolPricesAndStats.ts +++ b/carbonmark-api/src/utils/helpers/fetchPoolPricesAndStats.ts @@ -9,6 +9,7 @@ type Params = { key: string; // Project key `"VCS-981"` vintage: string; // Vintage string `"2017"` network: NetworkParam; + icrSerialization?: string; }; /** @@ -23,10 +24,12 @@ export const fetchPoolPricesAndStats = async ( if (params.network !== "polygon") { return [[], { totalBridged: 0, totalSupply: 0, totalRetired: 0 }]; } + const [[poolInfoMap, stats], allPoolPrices] = await Promise.all([ fetchProjectPoolInfo(sdk, { projectID: params.key, vintage: Number(params.vintage), + icrSerialization: params.icrSerialization, }), fetchAllPoolPrices(sdk), // fetch the price for all known lps ]); diff --git a/carbonmark-api/src/utils/helpers/fetchProjectPoolInfo.ts b/carbonmark-api/src/utils/helpers/fetchProjectPoolInfo.ts index 39be267efc..d2d8085b97 100644 --- a/carbonmark-api/src/utils/helpers/fetchProjectPoolInfo.ts +++ b/carbonmark-api/src/utils/helpers/fetchProjectPoolInfo.ts @@ -31,6 +31,7 @@ type PoolInfoMap = { type Params = { projectID: string; // Project id `"VCS-981"` vintage: number; // Vintage Int 2017 + icrSerialization?: string; }; /** @@ -81,6 +82,37 @@ type CarbonCredit = { type CarbonCredits = CarbonCredit[]; +/** + * Query the ICR subgraph for supply, stats etc for ICR projects + * @param sdk + * @param serialization + * @returns + */ + +const fetchAndNormalizeICRProjectCredits = async ( + sdk: GQL_SDK, + serialization: string +): Promise => { + const data = await sdk.icr.getExPostInfoViaSerialization({ + serialization: serialization, + }); + + const post = data.exPosts[0]; + + const stats = { + vintage: Number(post.vintage), + currentSupply: ethers.utils.parseUnits(post.supply, 18).toString(), + poolBalances: [], + id: post.id, + crossChainSupply: "0", + bridgeProtocol: "ICR", + bridged: ethers.utils.parseUnits(post.estimatedAmount, 18).toString(), + retired: ethers.utils.parseUnits(post.retiredAmount, 18).toString(), + }; + + return [stats]; +}; + /** * Query the subgraph for a list of the C3Ts and TCO2s that exist for a credit vintage. * @param {Params} params @@ -93,15 +125,24 @@ export const fetchProjectPoolInfo = async ( sdk: GQL_SDK, params: Params ): Promise<[Partial, Stats]> => { - const data = await sdk.digital_carbon.getProjectCredits({ - projectID: params.projectID, - vintage: Number(params.vintage), - }); + let tokens: CarbonCredits = []; + + if (params.icrSerialization) { + const icrData = fetchAndNormalizeICRProjectCredits( + sdk, + params.icrSerialization + ); + tokens = await icrData; + } else { + const data = await sdk.digital_carbon.getProjectCredits({ + projectID: params.projectID, + vintage: Number(params.vintage), + }); + tokens = data?.carbonProjects?.[0]?.carbonCredits || []; + } /** @type {QueryResponse[]} */ - const tokens: CarbonCredits = data?.carbonProjects?.[0]?.carbonCredits || []; - // Graph data is in 18 decimals. All operations are performed in BigNumber before converting to Number at the end const bigNumberStats: BigNumberStats = tokens.reduce( @@ -114,7 +155,6 @@ export const fetchProjectPoolInfo = async ( }), initialStats ); - // project bigNumber stats const stats: Stats = { totalBridged: parseFloat( @@ -127,6 +167,7 @@ export const fetchProjectPoolInfo = async ( ethers.utils.formatUnits(bigNumberStats.totalSupply, 18) ), }; + const poolInfoMap = Object.keys(POOL_INFO).reduce>( (prevMap, poolName) => { const poolAddress = POOL_INFO[poolName].poolAddress; diff --git a/carbonmark-api/src/utils/helpers/utils.ts b/carbonmark-api/src/utils/helpers/utils.ts index ebd270af95..74ba9a121a 100644 --- a/carbonmark-api/src/utils/helpers/utils.ts +++ b/carbonmark-api/src/utils/helpers/utils.ts @@ -9,10 +9,13 @@ import { } from "../../.generated/types/marketplace.types"; import { CarbonOffset } from "../../.generated/types/offsets.types"; +import type { NetworkParam } from "src/models/NetworkParam.model"; +import { fetchIcrData } from "../../../src/routes/projects/get.utils"; import { TOKEN_ADDRESSES } from "../../app.constants"; import { extract, notEmptyOrNil } from "../functional.utils"; import { GQL_SDK } from "../gqlSdk"; import { CarbonProject } from "./cms.utils"; + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions -- unable to type environment variables const ENV = (process.env.VERCEL_ENV ?? "development") as | "development" @@ -22,7 +25,8 @@ const ENV = (process.env.VERCEL_ENV ?? "development") as // combines them, removes duplicates, and returns the result as a sorted array of strings. export async function getAllVintages( sdk: GQL_SDK, - fastify: FastifyInstance + fastify: FastifyInstance, + network: "polygon" | "mumbai" ): Promise { const uniqueValues = new Set(); const cacheKey = `vintages`; @@ -32,14 +36,22 @@ export async function getAllVintages( return cachedResult; } - const [{ projects }, { carbonProjects: digitalCarbonProjects }] = - await Promise.all([ - sdk.marketplace.getVintages(), - sdk.digital_carbon.getDigitalCarbonProjectsVintages(), - ]); + const [ + { projects }, + { carbonProjects: digitalCarbonProjects }, + { IcrVintages }, + ] = await Promise.all([ + sdk.marketplace.getVintages(), + sdk.digital_carbon.getDigitalCarbonProjectsVintages(), + fetchIcrData(network), + ]); /** Handle invalid responses */ - if (!isArray(projects) || !isArray(digitalCarbonProjects)) { + if ( + !isArray(projects) || + !isArray(digitalCarbonProjects) || + !isArray(IcrVintages) + ) { throw new Error("Response from server did not match schema definition"); } @@ -50,6 +62,7 @@ export async function getAllVintages( uniqueValues.add(credit.vintage.toString()); } }); + IcrVintages.forEach((item: string) => uniqueValues.add(item)); }); const result = Array.from(uniqueValues).sort().filter(notEmptyOrNil); @@ -116,7 +129,11 @@ export async function getAllCategories(sdk: GQL_SDK, fastify: FastifyInstance) { return result; } -export async function getAllCountries(sdk: GQL_SDK, fastify: FastifyInstance) { +export async function getAllCountries( + sdk: GQL_SDK, + fastify: FastifyInstance, + network: NetworkParam +) { const cacheKey = `countries`; const cachedResult = await fastify.lcache.get(cacheKey)?.payload; @@ -125,14 +142,22 @@ export async function getAllCountries(sdk: GQL_SDK, fastify: FastifyInstance) { return cachedResult; } - const [{ countries }, { carbonProjects: digitalCarbonProjects }] = - await Promise.all([ - sdk.marketplace.getCountries(), - sdk.digital_carbon.getDigitalCarbonProjectsCountries(), - ]); + const [ + { countries }, + { carbonProjects: digitalCarbonProjects }, + { countryNames }, + ] = await Promise.all([ + sdk.marketplace.getCountries(), + sdk.digital_carbon.getDigitalCarbonProjectsCountries(), + fetchIcrData(network), + ]); /** Handle invalid responses */ - if (!isArray(countries) || !isArray(digitalCarbonProjects)) { + if ( + !isArray(countries) || + !isArray(digitalCarbonProjects) || + !isArray(countryNames) + ) { throw new Error("Response from server did not match schema definition"); } @@ -147,6 +172,7 @@ export async function getAllCountries(sdk: GQL_SDK, fastify: FastifyInstance) { const result: Country[] = fn([ countries?.map(extract("id")), digitalCarbonProjects.map(extract("country")), + countryNames, ]); await fastify.lcache.set(cacheKey, { payload: result }); diff --git a/carbonmark-api/src/utils/marketplace.utils.ts b/carbonmark-api/src/utils/marketplace.utils.ts index 27e687c572..fac4977d05 100644 --- a/carbonmark-api/src/utils/marketplace.utils.ts +++ b/carbonmark-api/src/utils/marketplace.utils.ts @@ -32,13 +32,15 @@ export type GetProjectListing = NonNullable< >[number]; /** Formats a gql.marketplace listing to match Listing.model, and formats integers */ + export const formatListing = (listing: GetProjectListing): ListingModel => { return { ...formatGraphTimestamps(listing), - leftToSell: utils.formatUnits(listing.leftToSell, 18), + + leftToSell: listing.leftToSell, singleUnitPrice: utils.formatUnits(listing.singleUnitPrice, 6), - minFillAmount: utils.formatUnits(listing.minFillAmount, 18), - totalAmountToSell: utils.formatUnits(listing.totalAmountToSell, 18), + minFillAmount: listing.minFillAmount, + totalAmountToSell: listing.totalAmountToSell, expiration: Number(listing.expiration), project: { ...listing.project, diff --git a/carbonmark-api/test/routes/countries/get.test.ts b/carbonmark-api/test/routes/countries/get.test.ts index 6a96eec632..d5bc035737 100644 --- a/carbonmark-api/test/routes/countries/get.test.ts +++ b/carbonmark-api/test/routes/countries/get.test.ts @@ -1,14 +1,31 @@ import { FastifyInstance } from "fastify"; import nock from "nock"; import { GRAPH_URLS } from "../../../src/app.constants"; +import { ICR_API } from "../../../src/utils/ICR/ICR_API_endpoints"; import { build } from "../../helper"; -import { COUNTRIES, DEV_URL, ERROR } from "../../test.constants"; +import { + COUNTRIES, + COUNTRY_CODES, + DEV_URL, + ERROR, + VINTAGES, +} from "../../test.constants"; + +jest.mock("../../../src/utils/ICR/ICR_API_endpoints", () => ({ + ICR_API: () => ({ + ICR_API_URL: "https://api.carbonregistry.com/v0", + }), +})); describe("GET /countries", () => { let fastify: FastifyInstance; + let ICR_API_URL: string; // Setup the server beforeEach(async () => { + const icrApiValues = ICR_API("polygon"); + ICR_API_URL = icrApiValues.ICR_API_URL; + fastify = await build(); nock.cleanAll(); }); @@ -30,6 +47,11 @@ describe("GET /countries", () => { .post("") .reply(200, { data: { carbonProjects: COUNTRIES } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: VINTAGES, + countryCodes: COUNTRY_CODES, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/countries`, @@ -41,7 +63,7 @@ describe("GET /countries", () => { expect(data).toEqual(COUNTRIES); }); - /** An issue with one of the graph APIs */ + // /** An issue with one of the graph APIs */ test("Graph Error", async () => { nock(GRAPH_URLS["polygon"].marketplace) .post("") @@ -51,6 +73,11 @@ describe("GET /countries", () => { nock(GRAPH_URLS["polygon"].digitalCarbon).post("").reply(200, []); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: VINTAGES, + countryCodes: COUNTRY_CODES, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/countries`, @@ -69,6 +96,11 @@ describe("GET /countries", () => { .post("") .reply(200, { data: { carbonProjects: [] } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: [], + countryCodes: [], + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/countries`, @@ -88,6 +120,11 @@ describe("GET /countries", () => { .post("") .reply(200, { data: { carbonProjects: "invalid data" } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: "invalid data", + countryCodes: "invalid data", + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/countries`, diff --git a/carbonmark-api/test/routes/projects/[id]/get.test.ts b/carbonmark-api/test/routes/projects/[id]/get.test.ts index eb007ec3ef..109f0ce849 100644 --- a/carbonmark-api/test/routes/projects/[id]/get.test.ts +++ b/carbonmark-api/test/routes/projects/[id]/get.test.ts @@ -1,11 +1,23 @@ import { FastifyInstance } from "fastify"; import nock from "nock"; +import { NetworkParam } from "src/models/NetworkParam.model"; import { GRAPH_URLS, SANITY_URLS } from "../../../../src/app.constants"; +import { ICR_API } from "../../../../src/utils/ICR/ICR_API_endpoints"; import { fixtures } from "../../../fixtures"; import digitalCarbon from "../../../fixtures/digitalCarbon"; import tokens from "../../../fixtures/tokens"; import { build } from "../../../helper"; -import { DEV_URL } from "../../../test.constants"; +import { DEV_URL, mockICRProject } from "../../../test.constants"; + +jest.mock("../../../../src/utils/ICR/ICR_API_endpoints", () => ({ + ICR_API: (network: NetworkParam) => { + let baseUrl = "https://api.carbonregistry.com/v0"; + if (network === "mumbai") { + baseUrl = "https://gaia-api-dev.mojoflower.io/v0"; + } + return { ICR_API_URL: baseUrl }; + }, +})); const mockCmsProject = fixtures.cms.cmsProject; const mockCmsProjectContent = fixtures.cms.cmsProjectContent; @@ -13,15 +25,24 @@ const mockActivities = fixtures.marketplace.activities; describe("GET /projects/:id", () => { let fastify: FastifyInstance; + let ICR_API_URL: string; + let ICR_API_URL_MUMBAI: string; // Setup the server beforeEach(async () => { + ICR_API_URL = ICR_API("polygon").ICR_API_URL; + ICR_API_URL_MUMBAI = ICR_API("mumbai").ICR_API_URL; try { fastify = await build(); } catch (e) { console.error("/projects/:id get.test.ts setup failed", e); } }); + + afterEach(async () => { + nock.cleanAll(); + }); + test("Returns project from CMS without prices or listings", async () => { nock(SANITY_URLS.cms) .post("") @@ -51,6 +72,19 @@ describe("GET /projects/:id", () => { activities: mockActivities, }, }); + nock(ICR_API_URL) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + // mumbai nocks backup + nock(ICR_API_URL_MUMBAI) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace).post("").reply(200, { + data: {}, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects/VCS-191-2008`, @@ -94,11 +128,25 @@ describe("GET /projects/:id", () => { activities: fixtures.marketplace.activities, }, }); + nock(ICR_API_URL) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + // mumbai nocks backup + nock(ICR_API_URL_MUMBAI) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace).post("").reply(200, { + data: {}, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects/VCS-191-2008?network=polygon`, }); const project = await response.json(); + expect(response.statusCode).toEqual(200); expect(project.prices).toHaveLength(1); expect(project.prices[0].singleUnitBuyPrice).toBe("0.358940"); @@ -125,7 +173,6 @@ describe("GET /projects/:id", () => { carbonProjects: [digitalCarbon.digitalCarbonProject], }, }); - nock(GRAPH_URLS["polygon"].offsets).post("").reply(200, { data: {} }); nock(GRAPH_URLS["polygon"].marketplace).post("").reply(200, { data: {}, }); @@ -136,6 +183,18 @@ describe("GET /projects/:id", () => { activities: fixtures.marketplace.activities, }, }); + nock(ICR_API_URL) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + // // mumbai nocks backup + nock(ICR_API_URL_MUMBAI) + .get("/public/projects") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace).post("").reply(200, { + data: {}, + }); const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects/VCS-981-2017`, diff --git a/carbonmark-api/test/routes/projects/get.test.ts b/carbonmark-api/test/routes/projects/get.test.ts index 08b4a5a8e3..07284f5232 100644 --- a/carbonmark-api/test/routes/projects/get.test.ts +++ b/carbonmark-api/test/routes/projects/get.test.ts @@ -1,13 +1,14 @@ import { FastifyInstance } from "fastify"; import { pick, set } from "lodash"; import nock from "nock"; +import { NetworkParam } from "src/models/NetworkParam.model"; import { GRAPH_URLS, SANITY_URLS } from "../../../src/app.constants"; -import { formatUSDC } from "../../../src/utils/crypto.utils"; +import { ICR_API } from "../../../src/utils/ICR/ICR_API_endpoints"; import { fixtures } from "../../fixtures"; import digitalCarbon from "../../fixtures/digitalCarbon"; import marketplace from "../../fixtures/marketplace"; import { build } from "../../helper"; -import { DEV_URL } from "../../test.constants"; +import { DEV_URL, mockICRProject } from "../../test.constants"; const mockCmsProject = fixtures.cms.carbonProject; const mockCmsProjectContent = fixtures.cms.cmsProjectContent; @@ -90,11 +91,24 @@ jest.mock("../../../src/routes/projects/get.utils", () => { }; }); +jest.mock("../../../src/utils/ICR/ICR_API_endpoints", () => ({ + ICR_API: (network: NetworkParam) => { + let baseUrl = "https://api.carbonregistry.com/v0"; + if (network === "mumbai") { + baseUrl = "https://gaia-api-dev.mojoflower.io/v0"; + } + return { ICR_API_URL: baseUrl }; + }, +})); describe("GET /projects", () => { let fastify: FastifyInstance; + let ICR_API_URL: string; + let ICR_API_URL_MUMBAI: string; // Setup the server beforeEach(async () => { + ICR_API_URL = ICR_API("polygon").ICR_API_URL; + ICR_API_URL_MUMBAI = ICR_API("mumbai").ICR_API_URL; try { fastify = await build(); } catch (e) { @@ -110,7 +124,10 @@ describe("GET /projects", () => { }) .persist(); }); - afterEach(async () => await fastify.close()); + afterEach(async () => { + await fastify.close(); + nock.cleanAll(); + }); // /** The happy path */ test("Returns 200", async () => { @@ -124,10 +141,28 @@ describe("GET /projects", () => { .reply(200, { data: { projects: [marketplace.projectWithListing] }, }); + + nock(ICR_API_URL) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + + // mumbai nocks backup + + nock(ICR_API_URL_MUMBAI) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace) + .post("") + .reply(200, { + data: { projects: [marketplace.projectWithListing] }, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects`, }); + expect(response.statusCode).toEqual(200); }); @@ -141,6 +176,19 @@ describe("GET /projects", () => { .post("") .reply(200, { data: { projects: [] } }); // no marketplace projects + nock(ICR_API_URL) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [] }); + + // mumabi nocks backup + nock(ICR_API_URL_MUMBAI) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [] }); + + nock(GRAPH_URLS["mumbai"].marketplace) + .post("") + .reply(200, { data: { projects: [] } }); // no marketplace projects + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects`, @@ -208,6 +256,20 @@ describe("GET /projects", () => { .post("") .reply(200, { data: { projects: [marketplace.projectWithListing] } }); + nock(ICR_API_URL) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + + // mumabi nocks backup + + nock(ICR_API_URL_MUMBAI) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace) + .post("") + .reply(200, { data: { projects: [marketplace.projectWithListing] } }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects`, @@ -259,45 +321,45 @@ describe("GET /projects", () => { expect(data).toMatchObject(expectedResponse); }); - /** PRICES NOT YET ON SUBGRAPH */ + // // /** PRICES NOT YET ON SUBGRAPH */ - test("Best price is listing price", async () => { - nock(GRAPH_URLS["polygon"].digitalCarbon) - .post("") - .reply(200, { - data: { carbonProjects: [digitalCarbon.digitalCarbonProject] }, - }); + // test("Best price is listing price", async () => { + // nock(GRAPH_URLS["polygon"].digitalCarbon) + // .post("") + // .reply(200, { + // data: { carbonProjects: [digitalCarbon.digitalCarbonProject] }, + // }); - const cheapListing = { - ...marketplace.projectWithListing.listings?.[0], - singleUnitPrice: "111111", // 0.111111 - }; + // const cheapListing = { + // ...marketplace.projectWithListing.listings?.[0], + // singleUnitPrice: "111111", // 0.111111 + // }; - nock(GRAPH_URLS["polygon"].marketplace) - .post("") - .reply(200, { - data: { - projects: [ - { - ...marketplace.projectWithListing, - listings: [cheapListing], - }, - ], - }, - }); // override so listing is cheaper + // nock(GRAPH_URLS["polygon"].marketplace) + // .post("") + // .reply(200, { + // data: { + // projects: [ + // { + // ...marketplace.projectWithListing, + // listings: [cheapListing], + // }, + // ], + // }, + // }); // override so listing is cheaper - const response = await fastify.inject({ - method: "GET", - url: `${DEV_URL}/projects`, - }); - const data = response.json(); - const entryWithListing = data.find( - (entry: any) => entry.listings && entry.listings.length - ); - expect(entryWithListing.price).toStrictEqual( - formatUSDC(cheapListing.singleUnitPrice) - ); - }); + // const response = await fastify.inject({ + // method: "GET", + // url: `${DEV_URL}/projects`, + // }); + // const data = response.json(); + // const entryWithListing = data.find( + // (entry: any) => entry.listings && entry.listings.length + // ); + // expect(entryWithListing.price).toStrictEqual( + // formatUSDC(cheapListing.singleUnitPrice) + // ); + // }); test("Best price is the lowest of 2 pool prices", async () => { nock(GRAPH_URLS["polygon"].digitalCarbon) @@ -311,6 +373,11 @@ describe("GET /projects", () => { ], }, }); + + nock(ICR_API_URL) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + // override so listing is cheaper const project = set( marketplace.projectWithListing, @@ -321,6 +388,16 @@ describe("GET /projects", () => { .post("") .reply(200, { data: { projects: [project] } }); + // mumbai nocks backup + + nock(ICR_API_URL_MUMBAI) + .get("/public/projects/list?page=0&limit=50") + .reply(200, { projects: [mockICRProject] }); + + nock(GRAPH_URLS["mumbai"].marketplace) + .post("") + .reply(200, { data: { projects: [project] } }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/projects`, diff --git a/carbonmark-api/test/routes/users/get.test.ts b/carbonmark-api/test/routes/users/get.test.ts index a81dcc8bce..99dcd2a7ac 100644 --- a/carbonmark-api/test/routes/users/get.test.ts +++ b/carbonmark-api/test/routes/users/get.test.ts @@ -11,6 +11,7 @@ import { EXPECTED_USER_RESPONSE, MOCK_ADDRESS, MOCK_USER_PROFILE, + mockICRHolderResponse, } from "../../test.constants"; import { disableAuth, mockFirebase } from "../../test.utils"; @@ -45,6 +46,26 @@ describe("GET /users/[walletOrHandle]", () => { ], }, }); + + nock(GRAPH_URLS["polygon"].icr) + .post("", (body) => { + return body.query && body.query.includes("getHoldingsByAddress"); + }) + .reply(200, { + mockICRHolderResponse, + }); + + nock(GRAPH_URLS["mumbai"].icr) + .post("", (body) => { + return body.query && body.query.includes("getHoldingsByAddress"); + }) + .reply(200, { + mockICRHolderResponse, + }); + }); + + afterEach(() => { + nock.cleanAll(); }); test("by wallet", async () => { diff --git a/carbonmark-api/test/routes/vintages/get.test.ts b/carbonmark-api/test/routes/vintages/get.test.ts index 0482ff738a..7ab6072f96 100644 --- a/carbonmark-api/test/routes/vintages/get.test.ts +++ b/carbonmark-api/test/routes/vintages/get.test.ts @@ -2,15 +2,27 @@ import { FastifyInstance } from "fastify"; import nock from "nock"; import { aProject } from "../../../src/.generated/mocks/marketplace.mocks"; import { GRAPH_URLS } from "../../../src/app.constants"; +import { ICR_API } from "../../../src/utils/ICR/ICR_API_endpoints"; import { build } from "../../helper"; -import { DEV_URL, ERROR } from "../../test.constants"; +import { COUNTRY_CODES, DEV_URL, ERROR, VINTAGES } from "../../test.constants"; + +jest.mock("../../../src/utils/ICR/ICR_API_endpoints", () => ({ + ICR_API: () => ({ + ICR_API_URL: "https://api.carbonregistry.com/v0", + }), +})); describe("GET /vintages", () => { let fastify: FastifyInstance; + let ICR_API_URL: string; // Setup the server beforeEach(async () => { + const icrApiValues = ICR_API("polygon"); + ICR_API_URL = icrApiValues.ICR_API_URL; + fastify = await build(); + nock.cleanAll(); }); /** A default response for digital-carbon */ @@ -27,6 +39,11 @@ describe("GET /vintages", () => { .post("") .reply(200, { data: { projects: [mock] } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: VINTAGES, + countryCodes: COUNTRY_CODES, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/vintages`, @@ -46,6 +63,11 @@ describe("GET /vintages", () => { errors: [ERROR], }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: VINTAGES, + countryCodes: COUNTRY_CODES, + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/vintages`, @@ -60,6 +82,11 @@ describe("GET /vintages", () => { .post("") .reply(200, { data: { projects: [] } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: [], + countryCodes: [], + }); + const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/vintages`, @@ -75,6 +102,10 @@ describe("GET /vintages", () => { .post("") .reply(200, { data: { projects: "invalid data" } }); + nock(ICR_API_URL).get("/public/projects/filters").reply(200, { + vintages: "invalid data", + countryCodes: "invalid data", + }); const response = await fastify.inject({ method: "GET", url: `${DEV_URL}/vintages`, diff --git a/carbonmark-api/test/test.constants.ts b/carbonmark-api/test/test.constants.ts index 667742e0cf..2b1aafa7b1 100644 --- a/carbonmark-api/test/test.constants.ts +++ b/carbonmark-api/test/test.constants.ts @@ -32,6 +32,24 @@ export const COUNTRIES = [ { id: "A Random Country", }, + { + id: "China", + }, + { + id: "Spain", + }, + { + id: "United Kingdom", + }, + { + id: "Iceland", + }, + { + id: "Ukraine", + }, + { + id: "Vietnam", + }, ]; export const MOCK_USER_PROFILE: UserProfile = { @@ -39,14 +57,397 @@ export const MOCK_USER_PROFILE: UserProfile = { createdAt: new Date("1970-01-01T00:00:00Z").getTime(), description: "Some description", handle: "SomeHandle", - updatedAt: new Date("2023-11-11T15:05:08Z").getTime(), + updatedAt: 1702675170, username: "someusername", profileImgUrl: null, }; +// ICR mocks + +export const COUNTRY_CODES = ["CN", "ES", "GB", "IS", "UA", "VN"]; + +export const VINTAGES = ["2020", "2021", "2022", "2023"]; + +export const mockICRProject = { + acceptedTerms: true, + _id: "9c4e2311-005c-419a-a334-1bc331b137c8", + additionalLevels: [], + areaSpan: [], + carbonCredits: [ + { + serialization: "ICR-GRC-30-5-3-A-0-2023", + tokenId: "1", + ticker: "ICC", + type: "ExPost", + vintage: "2023", + }, + { + serialization: "ICR-GRC-30-5-3-A-0-2024", + tokenId: "2", + ticker: "ICC", + type: "ExPost", + vintage: "2024", + }, + { + serialization: "ICR-GRC-30-5-3-A-0-2025", + tokenId: "3", + ticker: "ICC", + type: "ExPost", + vintage: "2025", + }, + ], + city: null, + projectStatus: { + id: "under development", + title: "under development", + }, + contactPerson: [ + { + email: "bjorn@mojoflower.io", + fullName: "Björn Halldór Helgason", + roles: [], + userRef: { + _id: "afd528c7-012a-4e24-b140-a72f7919eeca", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + { + email: "thor@mojoflower.io", + fullName: "Þórður Ágústsson", + roles: [], + userRef: { + _id: "7b3c4b78-fcbf-4c26-a168-8cbe220da9b3", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + { + email: "bjorn+789@mojoflower.io", + fullName: null, + roles: [], + userRef: { + _id: "6e264b07-e3ed-4d31-a204-6ad651334fcd", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + ], + countryCode: "GR", + createdAt: "2023-03-02T10:14:49.621Z", + creditingPeriodNumYears: 2, + creditingPeriodRenewal: false, + creditingPeriodStartDate: "2023-07-14T00:00:00.000Z", + startDate: "2023-03-07T00:00:00.000Z", + documents: [ + { + _id: "1568", + createdAt: "2023-09-16T22:21:51.665Z", + description: null, + fileName: "receipt-0953e128-faac-4606-87ca-8fbd4ce58d1a (1).pdf", + fileSize: 225317, + fileType: "unknown", + isPublic: true, + mimetype: null, + updatedAt: "2023-09-16T22:21:51.665Z", + fileRef: { + _id: "8428387c-46bc-45d8-8aeb-0ae68cad8cc2", + }, + uri: "https://mojo-development.fra1.digitaloceanspaces.com/users/63ff52d1fcb6fcb31d7e46c4/files/1686913173700-receipt-0953e128-faac-4606-87ca-8fbd4ce58d1a%20%281%29.pdf", + }, + ], + email: null, + estimatedAnnualMitigations: [ + { + date: "Fri, 14 Jul 2023 00:00:00 GMT", + vintage: "2023", + estimatedMitigation: 50000, + }, + { + date: "Sun, 14 Jul 2024 00:00:00 GMT", + vintage: "2024", + estimatedMitigation: 50000, + }, + { + date: "Mon, 14 Jul 2025 00:00:00 GMT", + vintage: "2025", + estimatedMitigation: 50000, + }, + ], + fullName: "A Magnificient Project", + gallery: [ + { + _id: "1910", + createdAt: "2023-09-21T13:45:15.406Z", + description: "Thisimage is HUGE", + fileName: "hugeImageTesting.webp", + fileSize: 747044, + fileType: "image", + isPublic: true, + mimetype: "image/webp", + updatedAt: "2023-09-21T13:45:15.406Z", + fileRef: { + _id: "202e6a48-3d26-4f02-9486-184bd4987f24", + }, + uri: "https://mojo-development.fra1.digitaloceanspaces.com/users/afd528c7-012a-4e24-b140-a72f7919eeca/files/1695303910713-hugeImageTesting.webp", + }, + ], + geographicalRegion: null, + geoLocation: { + lat: 52.5170365, + lng: 13.3888599, + }, + ghgProgram: { + id: "icr", + title: "International Carbon Registry", + content: + "The International Carbon Registry operates an international greenhouse gas program for the registration of climate projects and issuance of high-integrity carbon credits.", + extraTitle: null, + }, + headline: "", + isCriteriaForValidation: true, + isCriteriaForVerification: true, + isDeviatesFromMethodology: false, + isGroupedProject: false, + isHostCountryApproval: false, + isInformationUpdatedRegularly: false, + isInReview: true, + isMethodology: true, + isSpanArea: false, + isTransitioningFromOtherGHGProgram: false, + linkToProject: null, + media: [ + { + _id: "1570", + createdAt: "2023-09-16T22:21:51.665Z", + description: "aaaaaa", + fileName: "001_435_boerderij-image-1543868.jpeg", + fileSize: 2052473, + fileType: "image", + isPublic: true, + mimetype: "image/jpeg", + updatedAt: "2023-09-16T22:21:51.665Z", + fileRef: { + _id: "bdcf7539-2515-4287-86b1-5dad15d94639", + }, + uri: "https://mojo-development.fra1.digitaloceanspaces.com/users/63ff52d1fcb6fcb31d7e46c4/files/1686501415195-001_435_boerderij-image-1543868.jpeg", + }, + { + _id: "1910", + createdAt: "2023-09-21T13:45:15.406Z", + description: "Thisimage is HUGE", + fileName: "hugeImageTesting.webp", + fileSize: 747044, + fileType: "image", + isPublic: true, + mimetype: "image/webp", + updatedAt: "2023-09-21T13:45:15.406Z", + fileRef: { + _id: "202e6a48-3d26-4f02-9486-184bd4987f24", + }, + uri: "https://mojo-development.fra1.digitaloceanspaces.com/users/afd528c7-012a-4e24-b140-a72f7919eeca/files/1695303910713-hugeImageTesting.webp", + }, + ], + methodology: { + id: "AMS-III.AP.", + title: "AMS-III.AP.", + }, + methodologyDeviationDescription: "asdasdasdasd", + mrvCycle: null, + num: 5, + onChainId: + "101505019018752555554820562566524838698013395512834243783522224345889386792767", + otherBenefits: [ + { + title: "SDG 2: No Poverty", + checked: true, + benefitId: 1, + description: "So many nice things", + }, + { + title: "SDG 5: Gender Equality", + checked: true, + benefitId: 4, + description: "You know it man!", + }, + { + title: "SDG 9: Industry, Innovation and Infrastructure", + checked: true, + benefitId: 8, + description: "Skerny berny", + }, + ], + owner: { + fullName: "The Industry Incorporated", + ref: { + type: [], + termsAccepted: true, + _id: "3844ff2e-9a7f-48b4-ab57-b7c02f2dc9dd", + id: "3844ff2e-9a7f-48b4-ab57-b7c02f2dc9dd", + city: "Reykjavik", + website: "carbonics.com", + isPublic: false, + companyLogo: { + uri: "https://mojo-development.fra1.digitaloceanspaces.com/users/63ff52d1fcb6fcb31d7e46c4/files/1686501359525-compLogo.svg", + }, + companyType: "regular", + countryCode: "FI", + fullName: "The Industry Incorporated", + physicalAddress: "Glacier Boulevard 12", + registrationNumber: "", + }, + }, + participants: [ + { + email: "gummi11+65@gmail.com", + fullName: "Guðmundur Sigbergsson", + roles: [], + userRef: { + _id: "418cfb09-f61d-44c9-b7a7-6471065c8c17", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + { + email: "omar@konstant.is", + fullName: "omaroskars", + roles: [], + userRef: { + _id: "0494a023-9ec2-4c75-ba50-8d1c250bfe2f", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + { + email: "thor+44@mojoflower.io", + fullName: "Þórður Ágústsson", + roles: [], + userRef: { + _id: "49225ed5-1a3c-4fad-b324-d3bb39e261a3", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + { + email: "oli+1@mojoflower.io", + fullName: "Oli Torfason", + roles: [], + userRef: { + _id: "e519f50b-c03d-4934-b66f-6354b8a63c7c", + keys: [], + stellarAccounts: { + issuerAccount: {}, + distributionAccount: {}, + }, + }, + }, + ], + projectContracts: [ + { + address: "0xb3eba1a2472d431ad0a34b725118a6c898ce1052", + chainId: "", + projectId: "9c4e2311-005c-419a-a334-1bc331b137c8", + }, + ], + projectType: { + id: "avoidance", + title: "Avoidance / Reduction", + content: + "Avoiding or reducing GHG emissions via direct GHG avoidance/reduction measures.", + extraTitle: null, + }, + sector: { + id: "7", + title: "Transport", + }, + sequestrationPermanenceInYears: null, + shortDescription: "", + state: null, + statusState: "accepted", + streetName: null, + updatedAt: "2023-07-03T08:39:06.934Z", + validationBody: { + fullName: "Skjaldböku Project", + }, + status: "under development", + validationCriteria: [ + { + title: "ISO 14064-2:2019", + checked: true, + criteriaId: 0, + description: "", + }, + { + title: "Forest carbon code", + checked: true, + criteriaId: 3, + description: "", + }, + ], + verificationCriteria: [ + { + title: "ICR requirements v4.0", + checked: true, + criteriaId: 2, + description: "", + }, + { + title: "Applied methodology", + checked: true, + criteriaId: 5, + description: "", + }, + ], + website: "", + zip: null, +}; + +export const mockICRHolderResponse = { + data: { + holder: { + id: "0x1234abcd5678ef9012345678abcd9012ef345678", + exPostAmounts: [ + { + id: "0x1234abcd5678ef9012345678abcd9012ef3456789abcdef1234567890abcdef1234abcd5678ef90", + amount: "100", + updatedAt: 1702675, + retiredAmount: "60", + exPost: { + tokenId: "10", + vintage: "2020", + serialization: "ICR-XYZ-123-45678-90-Q-0-2020", + project: { + id: "0x9abcdef1234567890abcdef1234567890abcdef12", + projectName: "Green Energy Initiative", + }, + }, + }, + ], + }, + }, +}; + export const EXPECTED_USER_RESPONSE = { ...omit(MOCK_USER_PROFILE, ["address", "updatedAt", "createdAt"]), - updatedAt: 1699715108, + updatedAt: 1702675, createdAt: 0, wallet: MOCK_USER_PROFILE.address, listings: [],