-
Notifications
You must be signed in to change notification settings - Fork 256
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
add feeHistory spec #212
Merged
Merged
add feeHistory spec #212
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -196,6 +196,96 @@ | |
"$ref": "#/components/contentDescriptors/GasPrice" | ||
} | ||
}, | ||
{ | ||
"name": "eth_feeHistory", | ||
"summary": "Transaction fee history", | ||
"description": "Returns base fee per gas and transaction effective priority fee per gas history for the requested block range if available. The range between headBlock-4 and headBlock is guaranteed to be available while retrieving data from the pending block and older history are optional to support. For pre-EIP-1559 blocks the gas prices are returned as rewards and zeroes are returned for the base fee per gas.", | ||
"params": [ | ||
{ | ||
"name": "blockCount", | ||
"description": "Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available.", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/components/schemas/Integer" | ||
} | ||
}, | ||
{ | ||
"name": "newestBlock", | ||
"description": "Highest number block of the requested range.", | ||
"required": true, | ||
"schema": { | ||
"$ref": "#/components/schemas/BlockNumberOrTag" | ||
} | ||
}, | ||
{ | ||
"name": "rewardPercentiles", | ||
"description": "A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.", | ||
"schema": { | ||
"title": "rewardPercentiles", | ||
"type": "array", | ||
"items": { | ||
"title": "rewardPercentile", | ||
"description": "Floating point value between 0 and 100.", | ||
"type": "number" | ||
} | ||
} | ||
} | ||
], | ||
"result": { | ||
"name": "feeHistoryResult", | ||
"description": "Fee history for the returned block range. This can be a subsection of the requested range if not all blocks are available.", | ||
"schema": { | ||
"title": "feeHistoryResults", | ||
"description": "Fee history results", | ||
"type": "object", | ||
"required": [ | ||
"firstBlock", | ||
"baseFeePerGas", | ||
"gasUsedRatio" | ||
], | ||
"properties": { | ||
"oldestBlock": { | ||
"title": "oldestBlock", | ||
"description": "Lowest number block of the returned range.", | ||
"$ref": "#/components/schemas/BlockNumber" | ||
}, | ||
"baseFeePerGas": { | ||
"title": "baseFeePerGasArray", | ||
"description": "An array of block base fees per gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-1559 blocks.", | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/components/schemas/Integer" | ||
} | ||
}, | ||
"gasUsedRatio": { | ||
"title": "gasUsedArray", | ||
"description": "An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit.", | ||
"type": "array", | ||
"items": { | ||
"title": "gasUsedRatio", | ||
"description": "Floating point value between 0 and 1.", | ||
"type": "number" | ||
} | ||
}, | ||
"reward": { | ||
"title": "rewardArray", | ||
"description": "A two-dimensional array of effective priority fees per gas at the requested block percentiles.", | ||
"type": "array", | ||
"items": { | ||
"title": "rewardPercentileArray", | ||
"description": "An array of effective priority fee per gas data points from a single block. All zeroes are returned if the block is empty.", | ||
"type": "array", | ||
"items": { | ||
"title": "rewardPercentile", | ||
"description": "A given percentile sample of effective priority fees per gas from a single block in ascending order, weighted by gas used. Zeroes are returned if the block is empty.", | ||
"$ref": "#/components/schemas/Integer" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"name": "eth_getBalance", | ||
"summary": "Returns Ether balance of a given or account or contract", | ||
|
@@ -1135,6 +1225,17 @@ | |
"pending" | ||
] | ||
}, | ||
"BlockNumberOrTag": { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you just pull this out to be more explicit? |
||
"title": "blockNumberOrTag", | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/components/schemas/BlockNumber" | ||
}, | ||
{ | ||
"$ref": "#/components/schemas/BlockNumberTag" | ||
} | ||
] | ||
}, | ||
"BlockOrNull": { | ||
"title": "blockOrNull", | ||
"oneOf": [ | ||
|
@@ -1881,15 +1982,7 @@ | |
"name": "blockNumber", | ||
"required": true, | ||
"schema": { | ||
"title": "blockNumberOrTag", | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/components/schemas/BlockNumber" | ||
}, | ||
{ | ||
"$ref": "#/components/schemas/BlockNumberTag" | ||
} | ||
] | ||
"$ref": "#/components/schemas/BlockNumberOrTag" | ||
} | ||
}, | ||
"TransactionHash": { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be an integer between 1 and 1024. IMO anything we can encode in the schema, we should.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, I suppose the description is good enough for now. Eventually we'll should encode in the schema though.