Skip to content

Commit a170750

Browse files
committed
chore(query): add v2 graphql schema and query files
1 parent da1991c commit a170750

File tree

3 files changed

+650
-0
lines changed

3 files changed

+650
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# EscrowAccountQuery V2
2+
#
3+
# This query is used to retrieve escrow account information for TAP v2/Horizon.
4+
#
5+
# Input Variables:
6+
# - $indexer (Bytes!): The address of the Indexer whose escrow accounts are being queried.
7+
# - $thawEndTimestamp (BigInt!): A timestamp used to filter signers whose thaw period has ended or is about to end.
8+
#
9+
# Query Logic:
10+
# - Fetches escrow accounts where the `receiver` is the provided $indexer.
11+
# - Returns the following information for each escrow account:
12+
# - `balance`: The current balance of the escrow account.
13+
# - `totalAmountThawing`: The total amount currently thawing in the escrow.
14+
# - Retrieves the payer (was sender in v1) and filters the payer's `signers` based on:
15+
# - `thawEndTimestamp_lte`: Only includes signers whose thaw end timestamp is less than or equal to the provided $thawEndTimestamp.
16+
# - `isAuthorized: true`: Only includes signers that are authorized.
17+
#
18+
# Key differences from v1:
19+
# - Uses Bytes instead of ID for indexer parameter
20+
# - References 'payer' instead of 'sender'
21+
# - Compatible with TAP v2 schema structure
22+
23+
query EscrowAccountQuery($indexer: Bytes!, $thawEndTimestamp: BigInt!) {
24+
escrowAccounts(where: { receiver: $indexer }) {
25+
balance
26+
totalAmountThawing
27+
payer {
28+
id
29+
signers(where: {
30+
thawEndTimestamp_lte: $thawEndTimestamp
31+
isAuthorized: true
32+
}) {
33+
id
34+
}
35+
}
36+
}
37+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
query LatestRavs(
2+
$payer: ID!
3+
$dataService: ID!
4+
$serviceProvider: ID!
5+
$collectionIds: [ID!]!
6+
) {
7+
latestRavs(
8+
where: {
9+
payer: $payer
10+
dataService: $dataService
11+
serviceProvider: $serviceProvider
12+
id_in: $collectionIds
13+
}
14+
) {
15+
id
16+
valueAggregate
17+
timestamp
18+
}
19+
}

0 commit comments

Comments
 (0)