Skip to content

Commit

Permalink
[API] Update subgraph version to include UpdatedExpiration event (#…
Browse files Browse the repository at this point in the history
…2245)

* api: show listings for 90 days after expiration

* api: add back in params.expiresAfter

* api: update subgraph deployment and type generation

* api: fix version

* api: revert default expires after to now

* api: incremented api version

* api: update package-lock version

---------

Co-authored-by: Michael Collins <[email protected]>
  • Loading branch information
psparacino and 0xemc authored Feb 14, 2024
1 parent 5ea32c8 commit fe35a71
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
2 changes: 1 addition & 1 deletion carbonmark-api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klimadao/carbonmark-api",
"version": "6.1.2",
"version": "6.2.0",
"description": "An API for exploring Carbonmark project data, prices and activity.",
"main": "app.ts",
"scripts": {
Expand Down
7 changes: 6 additions & 1 deletion carbonmark-api/src/.generated/mocks/marketplace.mocks.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//@ts-nocheck
import { Activity, Activity_Filter, BlockChangedFilter, Block_Height, Category, Category_Filter, Country, Country_Filter, Listing, Listing_Filter, Project, Project_Filter, Purchase, Purchase_Filter, Query, Subscription, User, User_Filter, _Block_, _Meta_, ActivityType, Activity_OrderBy, Category_OrderBy, Country_OrderBy, Listing_OrderBy, OrderDirection, Project_OrderBy, Purchase_OrderBy, User_OrderBy, _SubgraphErrorPolicy_ } from '../types/marketplace.types';
import { Activity, Activity_Filter, BlockChangedFilter, Block_Height, Category, Category_Filter, Country, Country_Filter, Listing, Listing_Filter, Project, Project_Filter, Purchase, Purchase_Filter, Query, Subscription, User, User_Filter, _Block_, _Meta_, ActivityType, Activity_OrderBy, Category_OrderBy, Country_OrderBy, Listing_OrderBy, OrderDirection, Project_OrderBy, Purchase_OrderBy, TokenStandard, User_OrderBy, _SubgraphErrorPolicy_ } from '../types/marketplace.types';

export const anActivity = (overrides?: Partial<Activity>, _relationshipsToOmit: Set<string> = new Set()): Activity => {
const relationshipsToOmit: Set<string> = new Set(_relationshipsToOmit);
Expand Down Expand Up @@ -312,6 +312,7 @@ export const aListing = (overrides?: Partial<Listing>, _relationshipsToOmit: Set
singleUnitPrice: overrides && overrides.hasOwnProperty('singleUnitPrice') ? overrides.singleUnitPrice! : '100000000000000000000',
tokenAddress: overrides && overrides.hasOwnProperty('tokenAddress') ? overrides.tokenAddress! : 'at',
tokenId: overrides && overrides.hasOwnProperty('tokenId') ? overrides.tokenId! : '100000000000000000000',
tokenStandard: overrides && overrides.hasOwnProperty('tokenStandard') ? overrides.tokenStandard! : TokenStandard.Erc20,
tokenSymbol: overrides && overrides.hasOwnProperty('tokenSymbol') ? overrides.tokenSymbol! : 'assumenda',
totalAmountToSell: overrides && overrides.hasOwnProperty('totalAmountToSell') ? overrides.totalAmountToSell! : '100000000000000000000',
updatedAt: overrides && overrides.hasOwnProperty('updatedAt') ? overrides.updatedAt! : '100000000000000000000',
Expand Down Expand Up @@ -454,6 +455,10 @@ export const aListing_Filter = (overrides?: Partial<Listing_Filter>, _relationsh
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'],
tokenStandard: overrides && overrides.hasOwnProperty('tokenStandard') ? overrides.tokenStandard! : TokenStandard.Erc20,
tokenStandard_in: overrides && overrides.hasOwnProperty('tokenStandard_in') ? overrides.tokenStandard_in! : [TokenStandard.Erc20],
tokenStandard_not: overrides && overrides.hasOwnProperty('tokenStandard_not') ? overrides.tokenStandard_not! : TokenStandard.Erc20,
tokenStandard_not_in: overrides && overrides.hasOwnProperty('tokenStandard_not_in') ? overrides.tokenStandard_not_in! : [TokenStandard.Erc20],
tokenSymbol: overrides && overrides.hasOwnProperty('tokenSymbol') ? overrides.tokenSymbol! : 'sed',
tokenSymbol_contains: overrides && overrides.hasOwnProperty('tokenSymbol_contains') ? overrides.tokenSymbol_contains! : 'quo',
tokenSymbol_contains_nocase: overrides && overrides.hasOwnProperty('tokenSymbol_contains_nocase') ? overrides.tokenSymbol_contains_nocase! : 'quo',
Expand Down
14 changes: 14 additions & 0 deletions carbonmark-api/src/.generated/types/marketplace.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export enum ActivityType {
DeletedListing = 'DeletedListing',
Purchase = 'Purchase',
Sold = 'Sold',
UpdatedExpiration = 'UpdatedExpiration',
UpdatedPrice = 'UpdatedPrice',
UpdatedQuantity = 'UpdatedQuantity'
}
Expand Down Expand Up @@ -237,6 +238,7 @@ export enum Activity_OrderBy {
listing__singleUnitPrice = 'listing__singleUnitPrice',
listing__tokenAddress = 'listing__tokenAddress',
listing__tokenId = 'listing__tokenId',
listing__tokenStandard = 'listing__tokenStandard',
listing__tokenSymbol = 'listing__tokenSymbol',
listing__totalAmountToSell = 'listing__totalAmountToSell',
listing__updatedAt = 'listing__updatedAt',
Expand Down Expand Up @@ -358,6 +360,7 @@ export type Listing = {
singleUnitPrice: Scalars['BigInt'];
tokenAddress: Scalars['Bytes'];
tokenId: Scalars['BigInt'];
tokenStandard: TokenStandard;
tokenSymbol: Scalars['String'];
totalAmountToSell: Scalars['BigInt'];
updatedAt: Maybe<Scalars['BigInt']>;
Expand Down Expand Up @@ -506,6 +509,10 @@ export type Listing_Filter = {
tokenId_lte: InputMaybe<Scalars['BigInt']>;
tokenId_not: InputMaybe<Scalars['BigInt']>;
tokenId_not_in: InputMaybe<Array<Scalars['BigInt']>>;
tokenStandard: InputMaybe<TokenStandard>;
tokenStandard_in: InputMaybe<Array<TokenStandard>>;
tokenStandard_not: InputMaybe<TokenStandard>;
tokenStandard_not_in: InputMaybe<Array<TokenStandard>>;
tokenSymbol: InputMaybe<Scalars['String']>;
tokenSymbol_contains: InputMaybe<Scalars['String']>;
tokenSymbol_contains_nocase: InputMaybe<Scalars['String']>;
Expand Down Expand Up @@ -569,6 +576,7 @@ export enum Listing_OrderBy {
singleUnitPrice = 'singleUnitPrice',
tokenAddress = 'tokenAddress',
tokenId = 'tokenId',
tokenStandard = 'tokenStandard',
tokenSymbol = 'tokenSymbol',
totalAmountToSell = 'totalAmountToSell',
updatedAt = 'updatedAt'
Expand Down Expand Up @@ -903,6 +911,7 @@ export enum Purchase_OrderBy {
listing__singleUnitPrice = 'listing__singleUnitPrice',
listing__tokenAddress = 'listing__tokenAddress',
listing__tokenId = 'listing__tokenId',
listing__tokenStandard = 'listing__tokenStandard',
listing__tokenSymbol = 'listing__tokenSymbol',
listing__totalAmountToSell = 'listing__totalAmountToSell',
listing__updatedAt = 'listing__updatedAt',
Expand Down Expand Up @@ -1214,6 +1223,11 @@ export type SubscriptionUsersArgs = {
where: InputMaybe<User_Filter>;
};

export enum TokenStandard {
ERC20 = 'ERC20',
ERC1155 = 'ERC1155'
}

export type User = {
__typename?: 'User';
activities: Maybe<Array<Activity>>;
Expand Down
4 changes: 2 additions & 2 deletions carbonmark-api/src/app.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ 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}/QmaHkN47zUB3b1xnfeqCwatG5DRtMuitEDf9FdFkq5V3Fr`,
marketplace: `${GRAPH_API_ROOT_ID}/QmT2YkGwTqvek54VsGkfurGLrGGKgkwcK6TLotvkjpF4Mz`,
assets: `${GRAPH_API_ROOT}/cujowolf/klima-refi-current-holdings`,
tokens: `${GRAPH_API_ROOT}/klimadao/klimadao-pairs`,
digitalCarbon: `${GRAPH_API_ROOT}/klimadao/polygon-digital-carbon`,
Expand All @@ -22,7 +22,7 @@ const POLYGON_URLS = {
const MUMBAI_URLS = {
...POLYGON_URLS,
digitalCarbon: `${GRAPH_API_ROOT}/psparacino/digital-carbon`,
marketplace: `${GRAPH_API_ROOT_ID}/QmUUnZTeRnfsJsQaTwLeiHmAQ5xvtk2jBW7VeP3AEW5bnv`,
marketplace: `${GRAPH_API_ROOT_ID}/QmfHDvcgSLfgQVKbWnHEZw8ZCdxuvk3si1KQa66rBzexZp`,
icr: `${GRAPH_API_ROOT}/skjaldbaka17/carbon-registry-test`,
};

Expand Down
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fe35a71

Please sign in to comment.