Skip to content

Commit

Permalink
Merge pull request #420 from alchemyplatform/new_debug_methods
Browse files Browse the repository at this point in the history
add new debug methods
  • Loading branch information
SahilAujla authored Nov 3, 2024
2 parents b69b516 + 4434d5d commit b067e50
Show file tree
Hide file tree
Showing 6 changed files with 288 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/sync-apis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,23 @@ jobs:
working-directory: ./debug
run: rdme openapi debug_traceTransaction.yaml --key=$README_API_KEY --id=6328e63ebd678a000f80aa64

- name: Update Debug API - debug_getRawBlock
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
working-directory: ./debug
run: rdme openapi debug_getRawBlock.yaml --key=$README_API_KEY --id=6727c45d0b681000312040a9

- name: Update Debug API - debug_getRawHeader
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
working-directory: ./debug
run: rdme openapi debug_getRawHeader.yaml --key=$README_API_KEY --id=6727c47509bfa0005102ae37

- name: Update Debug API - debug_getRawReceipts
env:
README_API_KEY: ${{ secrets.README_API_KEY }}
working-directory: ./debug
run: rdme openapi debug_getRawReceipts.yaml --key=$README_API_KEY --id=6727c488a71b2c0071a805d5

# Update Token APIs
- name: Update Token API - alchemy_getTokenAllowance
Expand Down
56 changes: 56 additions & 0 deletions debug/debug_getRawBlock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
openapi: 3.1.0
info:
title: debug_getRawBlock
version: '1.0'
servers:
- url: https://{network}.g.alchemy.com/v2
variables:
network:
enum:
- eth-mainnet
- eth-sepolia
default: eth-mainnet
x-sandbox:
category:
type:
$ref: '../components/sandbox.yaml#/Category'
value: debug
paths:
/{apiKey}:
post:
summary: debug_getRawBlock
description: Returns an RLP-encoded block.
tags: []
parameters:
- name: apiKey
in: path
required: true
schema:
type: string
default: docs-demo
description: |
<style>
.custom-style {
color: #048FF4;
}
</style>
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
requestBody:
content:
application/json:
schema:
$ref: '../evm_body.yaml#/debug_getRawBlock'
x-readme:
explorer-enabled: true
samples-languages:
- curl
- javascript
- python
responses:
'200':
description: 'Returns an RLP-encoded block.'
content:
application/json:
schema:
$ref: '../evm_responses.yaml#/debug_getRawBlock'
operationId: debug-getrawblock
56 changes: 56 additions & 0 deletions debug/debug_getRawHeader.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
openapi: 3.1.0
info:
title: debug_getRawHeader
version: '1.0'
servers:
- url: https://{network}.g.alchemy.com/v2
variables:
network:
enum:
- eth-mainnet
- eth-sepolia
default: eth-mainnet
x-sandbox:
category:
type:
$ref: '../components/sandbox.yaml#/Category'
value: debug
paths:
/{apiKey}:
post:
summary: debug_getRawHeader
description: Returns an RLP-encoded header.
tags: []
parameters:
- name: apiKey
in: path
required: true
schema:
type: string
default: docs-demo
description: |
<style>
.custom-style {
color: #048FF4;
}
</style>
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
requestBody:
content:
application/json:
schema:
$ref: '../evm_body.yaml#/debug_getRawHeader'
x-readme:
explorer-enabled: true
samples-languages:
- curl
- javascript
- python
responses:
'200':
description: 'Returns an RLP-encoded header.'
content:
application/json:
schema:
$ref: '../evm_responses.yaml#/debug_getRawHeader'
operationId: debug-getrawheader
56 changes: 56 additions & 0 deletions debug/debug_getRawReceipts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
openapi: 3.1.0
info:
title: debug_getRawReceipts
version: '1.0'
servers:
- url: https://{network}.g.alchemy.com/v2
variables:
network:
enum:
- eth-mainnet
- eth-sepolia
default: eth-mainnet
x-sandbox:
category:
type:
$ref: '../components/sandbox.yaml#/Category'
value: debug
paths:
/{apiKey}:
post:
summary: debug_getRawReceipts
description: Returns an array of EIP-2718 binary-encoded receipts.
tags: []
parameters:
- name: apiKey
in: path
required: true
schema:
type: string
default: docs-demo
description: |
<style>
.custom-style {
color: #048FF4;
}
</style>
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
requestBody:
content:
application/json:
schema:
$ref: '../evm_body.yaml#/debug_getRawReceipts'
x-readme:
explorer-enabled: true
samples-languages:
- curl
- javascript
- python
responses:
'200':
description: 'Returns an array of EIP-2718 binary-encoded receipts.'
content:
application/json:
schema:
$ref: '../evm_responses.yaml#/debug_getRawReceipts'
operationId: debug-getrawreceipts
59 changes: 59 additions & 0 deletions evm_body.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,57 @@ debug_traceCall:
tracerConfig:
$ref: '#/tracerConfig'

debug_getRawHeader:
allOf:
- $ref: '#/common_request_fields'
- type: object
properties:
method:
$ref: './components/schemas.yaml#/Method'
default: debug_getRawHeader
params:
type: array
description: |
1. `BlockNumberOrTag` - The block number or tag (e.g., `"latest"`, `"earliest"`, or a specific block number like `"0x32026E"`).
minItems: 1
maxItems: 1
items:
$ref: '#/BlockNumberOrTag'

debug_getRawReceipts:
allOf:
- $ref: '#/common_request_fields'
- type: object
properties:
method:
$ref: './components/schemas.yaml#/Method'
default: debug_getRawReceipts
params:
type: array
description: |
1. `BlockNumberOrTag` - The block number or tag (e.g., `"latest"`, `"earliest"`, or a specific block number like `"0x32026E"`).
minItems: 1
maxItems: 1
items:
$ref: '#/BlockNumberOrTag'

debug_getRawBlock:
allOf:
- $ref: '#/common_request_fields'
- type: object
properties:
method:
$ref: './components/schemas.yaml#/Method'
default: debug_getRawBlock
params:
type: array
description: |
1. `BlockNumberOrTag` - The block number or tag (e.g., `"latest"`, `"earliest"`, or a specific block number like `"0x32026E"`).
minItems: 1
maxItems: 1
items:
$ref: '#/BlockNumberOrTag'

debug_traceBlockByHash:
allOf:
- $ref: '#/common_request_fields'
Expand Down Expand Up @@ -1923,6 +1974,14 @@ BlockNumberOrTagOrHash:
- title: Block Hash
$ref: '#/BlockHashEIP1898'

BlockNumberOrTag:
title: Block Number or Tag
oneOf:
- title: Block Number
$ref: '#/BlockNumber'
- title: Block Tag
$ref: '#/BlockTag'

BlockNumberOrTagOrHash_polygon_zkevm:
title: Block Number, Tag, or Hash
oneOf:
Expand Down
44 changes: 44 additions & 0 deletions evm_responses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,50 @@ debug_traceTransaction:
example:
$ref: ./evm_examples.yaml#/debug_traceTransaction

debug_getRawHeader:
allOf:
- $ref: '#/common_response_fields'
- type: object
properties:
result:
type: string
description: RLP-encoded header as a hexadecimal string.
example:
jsonrpc: "2.0"
id: 1
result: '0xf90236a09f73691f6dabca4f0a99b05d0a701995506aa311dcaa9ce9833d6f4ca474c162a01dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d4934794c6e2459991bfe27cca6d86722f35da23a1e4cb97a078103ea8c47231886481d72ec1afae6eeb06c3773ce24a91323d5c9eed69d4cca0008992da2531db404f07b0871dd620a94ba346963e1b1c6dc7b00748e8593a1ea0b6c3890d9604434fc52f722848c84d1770add20cd75bbc28cdedff42940dbb56b90100200800000400000002000e0000000401000000440100000000c0400600000002000801000000040480020840048000000000400000000000000020004220000011002000000000000204000800000010010002000002000000000040a000000000000400020000010885000000000808000000008800001004002010020300005000000010002110410402000000000000000890000008000000000000000000020040000002000000000000810400000040006000004000004080020000000000000022001000000000000840400000000220250000000000080402000420000418000000000000000400040000004080040010200000000000108020020000808332026e8401c9c380833e3c3c846436f93899d883010b05846765746888676f312e32302e32856c696e7578a0112d8f15793e7df7f8dcdb21c891cff78c0d1839cb5b6dcd06116cdbb99536ae88000000000000000008a0cdb97712af6685bb9650d21d609525913293c48adda7c45990926daada335c9b'

debug_getRawReceipts:
allOf:
- $ref: '#/common_response_fields'
- type: object
properties:
result:
type: array
description: Array of EIP-2718 binary-encoded receipts as hexadecimal strings.
items:
type: string
description: EIP-2718 binary-encoded receipt as a hexadecimal string.
example:
jsonrpc: "2.0"
id: 1
result:
- '0xf901a60182c70eb9010000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000002000000000000000000000008000000000000000000000000000000000040000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000100000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000002000000000100000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000020000000000000000f89df89b947753cfad258efbc52a9a1452e42ffbce9be486cbf863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000000828d0386c1122e565f07dd28c7d1340ed5b3315a000000000000000000000000021849e99c31e3113a489d7eb0fd4d8c0edbe47afa00000000000000000000000000000000000000000000000000000000029b92700'
- '0xf901a70183018e1cb9010000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000002000000000000000000000008000000000000000000000000000000000040000000001000000000000000000000000000000000000000000000000010000000000000000000000000000000008000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000002000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000000020000000000000000f89df89b947753cfad258efbc52a9a1452e42ffbce9be486cbf863a0ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa00000000000000000000000000828d0386c1122e565f07dd28c7d1340ed5b3315a000000000000000000000000069cda9d6cc6ce05982d0b4fdf9480f2991f39b5aa00000000000000000000000000000000000000000000000000000000029b92700'

debug_getRawBlock:
allOf:
- $ref: '#/common_response_fields'
- type: object
properties:
result:
type: string
description: RLP-encoded block as a hexadecimal string.
example:
jsonrpc: "2.0"
id: 1
result: '0xf96096f90236a09f73691f6dabca4f0a99b05d0a701995506aa311dcaa9ce9833d6f...'

debug_traceBlockByHash:
allOf:
- $ref: '#/common_response_fields'
Expand Down

0 comments on commit b067e50

Please sign in to comment.