Skip to content

Commit

Permalink
fix: rm collateral
Browse files Browse the repository at this point in the history
  • Loading branch information
TTNguyenDev committed Mar 5, 2024
1 parent f840bcf commit aa79952
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 64 deletions.
24 changes: 12 additions & 12 deletions packages/web-app/components/agreement/context/types.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
export interface PositionParams {
status: string;
collateral: string;
status: string;
// collateral: string;
}

export interface ResolverParams {
balance: string;
proof: string[];
balance: string;
proof: string[];
}

export interface UserPosition {
status: string;
deposit: string;
collateral: string;
resolver?: ResolverParams;
status: string;
deposit: string;
// collateral: string;
resolver?: ResolverParams;
}

export interface Token {
name: string;
symbol: string;
decimals: number;
address: string;
name: string;
symbol: string;
decimals: number;
address: string;
}

export type PositionMap = { [address: string]: PositionParams };
Expand Down
37 changes: 18 additions & 19 deletions packages/web-app/lib/subgraph/agreement.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { gql } from "graphql-request";

export interface AgreementData {
agreement: {
id: string;
framework: {
id: string;
};
termsHash: string;
criteria: string;
status: string;
token: string;
metadataURI: string;
createdAt: string;
positions: {
party: string;
collateral: string;
deposit: string;
status: string;
}[];
};
agreement: {
id: string;
framework: {
id: string;
};
termsHash: string;
criteria: string;
status: string;
token: string;
metadataURI: string;
createdAt: string;
positions: {
party: string;
// collateral: string;
deposit: string;
status: string;
}[];
};
}

export const agreementQuery = gql`
Expand All @@ -36,7 +36,6 @@ export const agreementQuery = gql`
createdAt
positions {
party
collateral
deposit
status
}
Expand Down
25 changes: 12 additions & 13 deletions packages/web-app/lib/subgraph/agreements.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import { gql } from "graphql-request";

export interface AgreementPositionsData {
agreementPositions: {
party: string;
collateral: string;
status: string;
agreement: {
id: string;
metadataURI: string;
createdAt: string;
status: string;
token: string;
};
}[];
agreementPositions: {
party: string;
// collateral: string;
status: string;
agreement: {
id: string;
metadataURI: string;
createdAt: string;
status: string;
token: string;
};
}[];
}

export const agreementsPositionsQuery = gql`
query GetUserAgreements($account: Bytes!) {
agreementPositions(where: { party: $account }) {
party
collateral
status
agreement {
id
Expand Down
40 changes: 20 additions & 20 deletions packages/web-app/lib/types.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
export interface AgreementBase {
id: string;
termsHash: string;
metadataURI: string;
status: string;
id: string;
termsHash: string;
metadataURI: string;
status: string;
}

export interface Agreement extends AgreementBase {
title: string;
token: string;
framework: string;
createdAt: string;
termsPrivacy: string;
termsURI?: string;
termsFilename?: string;
title: string;
token: string;
framework: string;
createdAt: string;
termsPrivacy: string;
termsURI?: string;
termsFilename?: string;
}

export interface AgreementPosition {
party: string;
collateral: string;
deposit: string;
status: string;
resolver?: {
balance: string;
proof: string[];
};
party: string;
// collateral: string;
deposit: string;
status: string;
resolver?: {
balance: string;
proof: string[];
};
}

export interface AgreementWithPositions extends Agreement {
positions: AgreementPosition[];
positions: AgreementPosition[];
}

0 comments on commit aa79952

Please sign in to comment.