-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathschema.graphql
52 lines (48 loc) · 1.77 KB
/
schema.graphql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Contract used - Debtkernal.sol
# Events used - LogDebtOrderFilled, LogIssuanceCancelled, LogDebtOrderCancelled,
# Contract used - DebtRegistry.sol
# Events used - LogModifyEntryBeneficiary, LogInsertEntry,
type DebtOrder @entity {
id: ID! # agreement ID
principle: BigInt!
principleToken: Bytes!
underwriter: Bytes!
underwriterFee: BigInt!
relayer: Bytes!
relayerFee: BigInt!
issuanceCancelledBy: Bytes # from event LogIssuanceCancelled - which is never called on mainnet or kovan, so far... so right now it is expected to be null
beneficiary: Bytes!
underwriterRiskRating: BigInt!
termsContract: Bytes!
termsContractParameters: Bytes!
# amountRepaid: BigInt # not in use right now, if included it needs addition of U256
collaterals: [Collateral!] @derivedFrom(field: "debtOrder")
repayments: [Repayment!] @derivedFrom(field: "debtOrder")
}
# Contract used - ERC721Collateralizer.sol
# Events used - CollateralLocked, CollateralReturned, CollateralSeized
type Collateral @entity {
id: ID! # agreementID
tokenAddress: Bytes!
amount: BigInt!
status: String!
collateralReturnedTo: Bytes # this either goes to the collateralizer, or the beneficiary. null if it hasn't been returned yet
debtOrder: DebtOrder!
}
# NOTE: Should not be included with entity DebtOrder. This is because a cancelled
# debt order happens before the debt order ever gets accepted, or is ever on chain.
# Contract used - DebtKernal.sol
# Events used - LogDebtOrderCancelled
type CancelledDebtOrder @entity {
id: ID! # debtOrderHash
cancelledBy: Bytes!
}
# Contract used - RepaymentRouter.sol
# Event used - LogRepayment
type Repayment @entity {
id: ID!
payers: [Bytes!]
beneficiaries: [Bytes!]
amounts: [BigInt!]
debtOrder: DebtOrder!
}