Skip to content

Commit

Permalink
feat: update ConditionalCommitAuthorizedEventLog
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Oct 19, 2023
1 parent e13a8b3 commit 30a5361
Show file tree
Hide file tree
Showing 3 changed files with 206 additions and 2 deletions.
203 changes: 203 additions & 0 deletions packages/core-sdk/src/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,172 @@ export enum ConditionEntity_OrderBy {
TokenType = "tokenType"
}

export type ConditionalCommitAuthorizedEventLog = {
__typename?: "ConditionalCommitAuthorizedEventLog";
buyerAddress: Scalars["String"];
commitCount: Scalars["BigInt"];
gating: Scalars["Int"];
groupId: Scalars["String"];
hash: Scalars["String"];
id: Scalars["ID"];
maxCommits: Scalars["BigInt"];
offerId: Scalars["String"];
timestamp: Scalars["BigInt"];
tokenId: Scalars["BigInt"];
type: EventType;
};

export type ConditionalCommitAuthorizedEventLog_Filter = {
/** Filter for the block changed event. */
_change_block?: InputMaybe<BlockChangedFilter>;
buyerAddress?: InputMaybe<Scalars["String"]>;
buyerAddress_contains?: InputMaybe<Scalars["String"]>;
buyerAddress_contains_nocase?: InputMaybe<Scalars["String"]>;
buyerAddress_ends_with?: InputMaybe<Scalars["String"]>;
buyerAddress_ends_with_nocase?: InputMaybe<Scalars["String"]>;
buyerAddress_gt?: InputMaybe<Scalars["String"]>;
buyerAddress_gte?: InputMaybe<Scalars["String"]>;
buyerAddress_in?: InputMaybe<Array<Scalars["String"]>>;
buyerAddress_lt?: InputMaybe<Scalars["String"]>;
buyerAddress_lte?: InputMaybe<Scalars["String"]>;
buyerAddress_not?: InputMaybe<Scalars["String"]>;
buyerAddress_not_contains?: InputMaybe<Scalars["String"]>;
buyerAddress_not_contains_nocase?: InputMaybe<Scalars["String"]>;
buyerAddress_not_ends_with?: InputMaybe<Scalars["String"]>;
buyerAddress_not_ends_with_nocase?: InputMaybe<Scalars["String"]>;
buyerAddress_not_in?: InputMaybe<Array<Scalars["String"]>>;
buyerAddress_not_starts_with?: InputMaybe<Scalars["String"]>;
buyerAddress_not_starts_with_nocase?: InputMaybe<Scalars["String"]>;
buyerAddress_starts_with?: InputMaybe<Scalars["String"]>;
buyerAddress_starts_with_nocase?: InputMaybe<Scalars["String"]>;
commitCount?: InputMaybe<Scalars["BigInt"]>;
commitCount_gt?: InputMaybe<Scalars["BigInt"]>;
commitCount_gte?: InputMaybe<Scalars["BigInt"]>;
commitCount_in?: InputMaybe<Array<Scalars["BigInt"]>>;
commitCount_lt?: InputMaybe<Scalars["BigInt"]>;
commitCount_lte?: InputMaybe<Scalars["BigInt"]>;
commitCount_not?: InputMaybe<Scalars["BigInt"]>;
commitCount_not_in?: InputMaybe<Array<Scalars["BigInt"]>>;
gating?: InputMaybe<Scalars["Int"]>;
gating_gt?: InputMaybe<Scalars["Int"]>;
gating_gte?: InputMaybe<Scalars["Int"]>;
gating_in?: InputMaybe<Array<Scalars["Int"]>>;
gating_lt?: InputMaybe<Scalars["Int"]>;
gating_lte?: InputMaybe<Scalars["Int"]>;
gating_not?: InputMaybe<Scalars["Int"]>;
gating_not_in?: InputMaybe<Array<Scalars["Int"]>>;
groupId?: InputMaybe<Scalars["String"]>;
groupId_contains?: InputMaybe<Scalars["String"]>;
groupId_contains_nocase?: InputMaybe<Scalars["String"]>;
groupId_ends_with?: InputMaybe<Scalars["String"]>;
groupId_ends_with_nocase?: InputMaybe<Scalars["String"]>;
groupId_gt?: InputMaybe<Scalars["String"]>;
groupId_gte?: InputMaybe<Scalars["String"]>;
groupId_in?: InputMaybe<Array<Scalars["String"]>>;
groupId_lt?: InputMaybe<Scalars["String"]>;
groupId_lte?: InputMaybe<Scalars["String"]>;
groupId_not?: InputMaybe<Scalars["String"]>;
groupId_not_contains?: InputMaybe<Scalars["String"]>;
groupId_not_contains_nocase?: InputMaybe<Scalars["String"]>;
groupId_not_ends_with?: InputMaybe<Scalars["String"]>;
groupId_not_ends_with_nocase?: InputMaybe<Scalars["String"]>;
groupId_not_in?: InputMaybe<Array<Scalars["String"]>>;
groupId_not_starts_with?: InputMaybe<Scalars["String"]>;
groupId_not_starts_with_nocase?: InputMaybe<Scalars["String"]>;
groupId_starts_with?: InputMaybe<Scalars["String"]>;
groupId_starts_with_nocase?: InputMaybe<Scalars["String"]>;
hash?: InputMaybe<Scalars["String"]>;
hash_contains?: InputMaybe<Scalars["String"]>;
hash_contains_nocase?: InputMaybe<Scalars["String"]>;
hash_ends_with?: InputMaybe<Scalars["String"]>;
hash_ends_with_nocase?: InputMaybe<Scalars["String"]>;
hash_gt?: InputMaybe<Scalars["String"]>;
hash_gte?: InputMaybe<Scalars["String"]>;
hash_in?: InputMaybe<Array<Scalars["String"]>>;
hash_lt?: InputMaybe<Scalars["String"]>;
hash_lte?: InputMaybe<Scalars["String"]>;
hash_not?: InputMaybe<Scalars["String"]>;
hash_not_contains?: InputMaybe<Scalars["String"]>;
hash_not_contains_nocase?: InputMaybe<Scalars["String"]>;
hash_not_ends_with?: InputMaybe<Scalars["String"]>;
hash_not_ends_with_nocase?: InputMaybe<Scalars["String"]>;
hash_not_in?: InputMaybe<Array<Scalars["String"]>>;
hash_not_starts_with?: InputMaybe<Scalars["String"]>;
hash_not_starts_with_nocase?: InputMaybe<Scalars["String"]>;
hash_starts_with?: InputMaybe<Scalars["String"]>;
hash_starts_with_nocase?: InputMaybe<Scalars["String"]>;
id?: InputMaybe<Scalars["ID"]>;
id_gt?: InputMaybe<Scalars["ID"]>;
id_gte?: InputMaybe<Scalars["ID"]>;
id_in?: InputMaybe<Array<Scalars["ID"]>>;
id_lt?: InputMaybe<Scalars["ID"]>;
id_lte?: InputMaybe<Scalars["ID"]>;
id_not?: InputMaybe<Scalars["ID"]>;
id_not_in?: InputMaybe<Array<Scalars["ID"]>>;
maxCommits?: InputMaybe<Scalars["BigInt"]>;
maxCommits_gt?: InputMaybe<Scalars["BigInt"]>;
maxCommits_gte?: InputMaybe<Scalars["BigInt"]>;
maxCommits_in?: InputMaybe<Array<Scalars["BigInt"]>>;
maxCommits_lt?: InputMaybe<Scalars["BigInt"]>;
maxCommits_lte?: InputMaybe<Scalars["BigInt"]>;
maxCommits_not?: InputMaybe<Scalars["BigInt"]>;
maxCommits_not_in?: InputMaybe<Array<Scalars["BigInt"]>>;
offerId?: InputMaybe<Scalars["String"]>;
offerId_contains?: InputMaybe<Scalars["String"]>;
offerId_contains_nocase?: InputMaybe<Scalars["String"]>;
offerId_ends_with?: InputMaybe<Scalars["String"]>;
offerId_ends_with_nocase?: InputMaybe<Scalars["String"]>;
offerId_gt?: InputMaybe<Scalars["String"]>;
offerId_gte?: InputMaybe<Scalars["String"]>;
offerId_in?: InputMaybe<Array<Scalars["String"]>>;
offerId_lt?: InputMaybe<Scalars["String"]>;
offerId_lte?: InputMaybe<Scalars["String"]>;
offerId_not?: InputMaybe<Scalars["String"]>;
offerId_not_contains?: InputMaybe<Scalars["String"]>;
offerId_not_contains_nocase?: InputMaybe<Scalars["String"]>;
offerId_not_ends_with?: InputMaybe<Scalars["String"]>;
offerId_not_ends_with_nocase?: InputMaybe<Scalars["String"]>;
offerId_not_in?: InputMaybe<Array<Scalars["String"]>>;
offerId_not_starts_with?: InputMaybe<Scalars["String"]>;
offerId_not_starts_with_nocase?: InputMaybe<Scalars["String"]>;
offerId_starts_with?: InputMaybe<Scalars["String"]>;
offerId_starts_with_nocase?: InputMaybe<Scalars["String"]>;
timestamp?: InputMaybe<Scalars["BigInt"]>;
timestamp_gt?: InputMaybe<Scalars["BigInt"]>;
timestamp_gte?: InputMaybe<Scalars["BigInt"]>;
timestamp_in?: InputMaybe<Array<Scalars["BigInt"]>>;
timestamp_lt?: InputMaybe<Scalars["BigInt"]>;
timestamp_lte?: InputMaybe<Scalars["BigInt"]>;
timestamp_not?: InputMaybe<Scalars["BigInt"]>;
timestamp_not_in?: InputMaybe<Array<Scalars["BigInt"]>>;
tokenId?: InputMaybe<Scalars["BigInt"]>;
tokenId_gt?: InputMaybe<Scalars["BigInt"]>;
tokenId_gte?: InputMaybe<Scalars["BigInt"]>;
tokenId_in?: InputMaybe<Array<Scalars["BigInt"]>>;
tokenId_lt?: InputMaybe<Scalars["BigInt"]>;
tokenId_lte?: InputMaybe<Scalars["BigInt"]>;
tokenId_not?: InputMaybe<Scalars["BigInt"]>;
tokenId_not_in?: InputMaybe<Array<Scalars["BigInt"]>>;
type?: InputMaybe<EventType>;
type_in?: InputMaybe<Array<EventType>>;
type_not?: InputMaybe<EventType>;
type_not_in?: InputMaybe<Array<EventType>>;
};

export enum ConditionalCommitAuthorizedEventLog_OrderBy {
BuyerAddress = "buyerAddress",
CommitCount = "commitCount",
Gating = "gating",
GroupId = "groupId",
Hash = "hash",
Id = "id",
MaxCommits = "maxCommits",
OfferId = "offerId",
Timestamp = "timestamp",
TokenId = "tokenId",
Type = "type"
}

export type Dispute = {
__typename?: "Dispute";
buyer: Buyer;
Expand Down Expand Up @@ -1598,6 +1764,7 @@ export enum EventType {
/** ExchangeHandler events */
BuyerCommitted = "BUYER_COMMITTED",
BuyerCreated = "BUYER_CREATED",
ConditionalCommit = "CONDITIONAL_COMMIT",
DisputeDecided = "DISPUTE_DECIDED",
DisputeEscalated = "DISPUTE_ESCALATED",
DisputeExpired = "DISPUTE_EXPIRED",
Expand Down Expand Up @@ -6868,6 +7035,8 @@ export type Query = {
buyers: Array<Buyer>;
conditionEntities: Array<ConditionEntity>;
conditionEntity?: Maybe<ConditionEntity>;
conditionalCommitAuthorizedEventLog?: Maybe<ConditionalCommitAuthorizedEventLog>;
conditionalCommitAuthorizedEventLogs: Array<ConditionalCommitAuthorizedEventLog>;
dispute?: Maybe<Dispute>;
disputeEventLog?: Maybe<DisputeEventLog>;
disputeEventLogs: Array<DisputeEventLog>;
Expand Down Expand Up @@ -7044,6 +7213,22 @@ export type QueryConditionEntityArgs = {
subgraphError?: _SubgraphErrorPolicy_;
};

export type QueryConditionalCommitAuthorizedEventLogArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"];
subgraphError?: _SubgraphErrorPolicy_;
};

export type QueryConditionalCommitAuthorizedEventLogsArgs = {
block?: InputMaybe<Block_Height>;
first?: InputMaybe<Scalars["Int"]>;
orderBy?: InputMaybe<ConditionalCommitAuthorizedEventLog_OrderBy>;
orderDirection?: InputMaybe<OrderDirection>;
skip?: InputMaybe<Scalars["Int"]>;
subgraphError?: _SubgraphErrorPolicy_;
where?: InputMaybe<ConditionalCommitAuthorizedEventLog_Filter>;
};

export type QueryDisputeArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"];
Expand Down Expand Up @@ -8775,6 +8960,8 @@ export type Subscription = {
buyers: Array<Buyer>;
conditionEntities: Array<ConditionEntity>;
conditionEntity?: Maybe<ConditionEntity>;
conditionalCommitAuthorizedEventLog?: Maybe<ConditionalCommitAuthorizedEventLog>;
conditionalCommitAuthorizedEventLogs: Array<ConditionalCommitAuthorizedEventLog>;
dispute?: Maybe<Dispute>;
disputeEventLog?: Maybe<DisputeEventLog>;
disputeEventLogs: Array<DisputeEventLog>;
Expand Down Expand Up @@ -8951,6 +9138,22 @@ export type SubscriptionConditionEntityArgs = {
subgraphError?: _SubgraphErrorPolicy_;
};

export type SubscriptionConditionalCommitAuthorizedEventLogArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"];
subgraphError?: _SubgraphErrorPolicy_;
};

export type SubscriptionConditionalCommitAuthorizedEventLogsArgs = {
block?: InputMaybe<Block_Height>;
first?: InputMaybe<Scalars["Int"]>;
orderBy?: InputMaybe<ConditionalCommitAuthorizedEventLog_OrderBy>;
orderDirection?: InputMaybe<OrderDirection>;
skip?: InputMaybe<Scalars["Int"]>;
subgraphError?: _SubgraphErrorPolicy_;
where?: InputMaybe<ConditionalCommitAuthorizedEventLog_Filter>;
};

export type SubscriptionDisputeArgs = {
block?: InputMaybe<Block_Height>;
id: Scalars["ID"];
Expand Down
3 changes: 2 additions & 1 deletion packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,7 @@ enum EventType {
DISPUTE_DECIDED
ESCALATED_DISPUTE_REFUSED
ESCALATED_DISPUTE_EXPIRED
CONDITIONAL_COMMIT
}

interface EventLog {
Expand Down Expand Up @@ -723,7 +724,7 @@ type ConditionalCommitAuthorizedEventLog @entity {
hash: String!
type: EventType!
timestamp: BigInt!
executedBy: Bytes!
buyerAddress: String!

offerId: String!
groupId: String!
Expand Down
2 changes: 1 addition & 1 deletion packages/subgraph/src/entities/event-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export function saveConditionalCommitAuthorizedEventLog(
eventLog.hash = txHash;
eventLog.type = type;
eventLog.timestamp = timestamp;
eventLog.executedBy = changetype<Bytes>(buyerAddress.toString());
eventLog.buyerAddress = buyerAddress.toString();
eventLog.commitCount = commitCount;
eventLog.maxCommits = maxCommits;
eventLog.gating = gating;
Expand Down

0 comments on commit 30a5361

Please sign in to comment.