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

graphql: add withdrawals (EIP-4895) #400

Merged
merged 5 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
107 changes: 107 additions & 0 deletions graphql.json
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,38 @@
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "withdrawalsRoot",
"description": "WithdrawalsRoot is the withdrawals trie root in this block.\nIf withdrawals are unavailable for this block, this field will be null.",
"args": [],
"type": {
"kind": "SCALAR",
"name": "Bytes32",
"ofType": null
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "withdrawals",
"description": "Withdrawals is a list of withdrawals associated with this block. If\nwithdrawals are unavailable for this block, this field will be null.",
"args": [],
"type": {
"kind": "LIST",
"name": null,
"ofType": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "OBJECT",
"name": "Withdrawal",
"ofType": null
}
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
Expand Down Expand Up @@ -2131,6 +2163,81 @@
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "Withdrawal",
"description": "EIP-4895",
"fields": [
{
"name": "index",
"description": "Index is a monotonically increasing identifier issued by consensus layer.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Long",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "validator",
"description": "Validator is index of the validator associated with withdrawal.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Long",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "address",
"description": "Recipient address of the withdrawn amount.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Address",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
},
{
"name": "amount",
"description": "Amount is the withdrawal value in Gwei.",
"args": [],
"type": {
"kind": "NON_NULL",
"name": null,
"ofType": {
"kind": "SCALAR",
"name": "Long",
"ofType": null
}
},
"isDeprecated": false,
"deprecationReason": null
}
],
"inputFields": null,
"interfaces": [],
"enumValues": null,
"possibleTypes": null
},
{
"kind": "OBJECT",
"name": "__Directive",
Expand Down
37 changes: 35 additions & 2 deletions schema.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ type Account {
storage(slot: Bytes32!): Bytes32!
}

"""Address is a 20 byte Ethereum address, represented as 0x-prefixed hexadecimal."""
"""
Address is a 20 byte Ethereum address, represented as 0x-prefixed hexadecimal.
"""
scalar Address

"""
Expand Down Expand Up @@ -185,6 +187,18 @@ type Block {

"""Raw is the RLP encoding of the block."""
raw: Bytes!

"""
WithdrawalsRoot is withdrawals trie root in this block.
If withdrawals are unavailable for this block, this field will be null.
"""
withdrawalsRoot: Bytes32

"""
Withdrawals is a list of withdrawals associated with this block. If
withdrawals are unavailable for this block, this field will be null.
"""
withdrawals: [Withdrawal!]
}

"""
Expand Down Expand Up @@ -220,7 +234,9 @@ An empty byte string is represented as '0x'. Byte strings must have an even numb
"""
scalar Bytes

"""Bytes32 is a 32 byte binary string, represented as 0x-prefixed hexadecimal."""
"""
Bytes32 is a 32 byte binary string, represented as 0x-prefixed hexadecimal.
"""
scalar Bytes32

"""
Expand Down Expand Up @@ -537,3 +553,20 @@ type Transaction {
"""
rawReceipt: Bytes!
}

"""EIP-4895"""
type Withdrawal {
"""
Index is a monotonically increasing identifier issued by consensus layer.
"""
index: Long!

"""Validator is index of the validator associated with withdrawal."""
validator: Long!

"""Recipient address of the withdrawn amount."""
address: Address!

"""Amount is the withdrawal value in Gwei."""
amount: Long!
}