Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include Allowances in Graphql schema and query #314

Merged
merged 9 commits into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion packages/deployments/src/fetchRolesMod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,20 @@ const QUERY = `
}
lastUpdate
}
unwrapAdapters(where: {selector: "0x8d80ff0a", adapterAddress: "0x93b7fcbc63ed8a3a24b59e1c3e6649d50b7427c0"}) {
allowances(first: 1000) {
key
refill
maxRefill
period
balance
timestamp
}
unwrapAdapters(
where: {
selector: "0x8d80ff0a",
adapterAddress: "0x93b7fcbc63ed8a3a24b59e1c3e6649d50b7427c0"
}
) {
targetAddress
}
}
Expand Down Expand Up @@ -105,12 +118,22 @@ export interface RoleSummary {
targets: TargetSummary[]
}

export interface Allowance {
key: `0x${string}`
refill: BigInt
maxRefill: BigInt
period: BigInt
balance: BigInt
timestamp: BigInt
}

export interface RolesModifier {
address: `0x${string}`
owner: `0x${string}`
avatar: `0x${string}`
target: `0x${string}`
roles: RoleSummary[]
allowances: Allowance[]
multiSendAddresses: `0x${string}`[]
}

Expand Down
4 changes: 2 additions & 2 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"prettier": "^2.8.8"
},
"dependencies": {
"@graphprotocol/graph-cli": "^0.71.0",
"@graphprotocol/graph-ts": "^0.35.1",
"@graphprotocol/graph-cli": "^0.94.0",
"@graphprotocol/graph-ts": "^0.37.0",
"assemblyscript-json": "^1.1.0"
},
"installConfig": {
Expand Down
1 change: 1 addition & 0 deletions packages/subgraph/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ type RolesModifier @entity {
avatar: Bytes!
target: Bytes!
roles: [Role!]! @derivedFrom(field: "rolesModifier")
allowances: [Allowance!]! @derivedFrom(field: "rolesModifier")
unwrapAdapters: [UnwrapAdapter!]! @derivedFrom(field: "rolesModifier")
}

Expand Down
Loading
Loading