Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 41252a0

Browse files
authored
Merge pull request #422 from alchemyplatform/getblockwithreceipts
add starknet_getBlockWithReceipts
2 parents e902518 + 373c0a3 commit 41252a0

File tree

3 files changed

+139
-0
lines changed

3 files changed

+139
-0
lines changed

.github/workflows/sync-apis.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,6 +2284,12 @@ jobs:
22842284
working-directory: ./starknet
22852285
run: rdme openapi starknet_addDeclareTransaction.yaml --key=$README_API_KEY --id=64406faac2d7740059213a4f
22862286

2287+
- name: Update Starknet API - starknet_getBlockWithReceipts
2288+
env:
2289+
README_API_KEY: ${{ secrets.README_API_KEY }}
2290+
working-directory: ./starknet
2291+
run: rdme openapi starknet_getBlockWithReceipts.yaml --key=$README_API_KEY --id=6727ed186d9aab001314179d
2292+
22872293
- name: Update Starknet API - starknet_getClassAt
22882294
env:
22892295
README_API_KEY: ${{ secrets.README_API_KEY }}

components/starknet/schemas.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,22 @@ BlockBodyWithTxs:
312312
required:
313313
- transactions
314314

315+
BlockBodyWithReceipts:
316+
type: object
317+
description: Block body with transactions and receipts
318+
properties:
319+
transactions:
320+
type: array
321+
items:
322+
$ref: '#/Txn'
323+
receipts:
324+
type: array
325+
items:
326+
$ref: '#/TxnReceipt'
327+
required:
328+
- transactions
329+
- receipts
330+
315331
BlockHeader:
316332
type: object
317333
properties:
@@ -365,6 +381,18 @@ BlockWithTxs:
365381
- $ref: '#/BlockHeader'
366382
- $ref: '#/BlockBodyWithTxs'
367383

384+
BlockWithReceipts:
385+
title: The block object
386+
allOf:
387+
- type: object
388+
properties:
389+
status:
390+
$ref: '#/BlockStatus'
391+
required:
392+
- status
393+
- $ref: '#/BlockHeader'
394+
- $ref: '#/BlockBodyWithReceipts'
395+
368396
PendingBlockWithTxHashes:
369397
title: Pending block object with tx hashes
370398
description: The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.
@@ -400,6 +428,23 @@ PendingBlockWithTxs:
400428
description: The hash of this block's parent
401429
$ref: '#/BlockHash'
402430

431+
PendingBlockWithReceipts:
432+
description: The dynamic block being constructed by the sequencer. Note that this object will be deprecated upon decentralization.
433+
allOf:
434+
- $ref: '#/BlockBodyWithReceipts'
435+
- type: object
436+
properties:
437+
timestamp:
438+
description: The time in which the block was created, encoded in Unix time
439+
type: integer
440+
minimum: 0
441+
sequencer_address:
442+
description: The StarkNet identity of the sequencer submitting this block
443+
$ref: '#/Felt'
444+
parent_hash:
445+
description: The hash of this block's parent
446+
$ref: '#/BlockHash'
447+
403448
DeployedContractItem:
404449
type: object
405450
properties:
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
openapi: 3.1.0
2+
info:
3+
title: starknet_getBlockWithReceipts
4+
description: Get block information with full transactions and receipts given the block id
5+
version: '1.0'
6+
servers:
7+
- url: 'https://{network}.g.alchemy.com/starknet/version/rpc/{version}/'
8+
variables:
9+
network:
10+
enum:
11+
- starknet-mainnet
12+
- starknet-sepolia
13+
default: starknet-mainnet
14+
version:
15+
enum:
16+
- v0_7
17+
- v0.6
18+
- v0.5
19+
- v0.4
20+
default: v0_7
21+
x-sandbox:
22+
category:
23+
type:
24+
$ref: '../components/sandbox.yaml#/Category'
25+
value: core
26+
paths:
27+
/{apiKey}:
28+
$ref: '#/components/pathItems/path'
29+
components:
30+
pathItems:
31+
path:
32+
post:
33+
operationId: starknet-getBlockWithReceipts
34+
summary: starknet_getBlockWithReceipts
35+
description: Get block information with full transactions and receipts given the block id
36+
parameters:
37+
- name: apiKey
38+
in: path
39+
schema:
40+
type: string
41+
default: docs-demo
42+
description: |
43+
<style>
44+
.custom-style {
45+
color: #048FF4;
46+
}
47+
</style>
48+
For higher throughput, <span class="custom-style"><a href="https://alchemy.com/?a=docs-demo" target="_blank">create your own API key</a></span>
49+
required: true
50+
requestBody:
51+
description: Request Body
52+
content:
53+
application/json:
54+
schema:
55+
allOf:
56+
- $ref: '../evm_body.yaml#/common_request_fields'
57+
- type: object
58+
properties:
59+
method:
60+
$ref: ../components/schemas.yaml#/Method
61+
default: starknet_getBlockWithTxs
62+
params:
63+
type: array
64+
title: block_id
65+
items:
66+
$ref: '../components/starknet/schemas.yaml#/BlockId'
67+
description: The hash of the requested block, or number (height) of the requested block, or a block tag
68+
minItems: 1
69+
maxItems: 1
70+
x-readme:
71+
samples-languages:
72+
- curl
73+
- javascript
74+
- python
75+
responses:
76+
'200':
77+
description: The resulting block information with full transactions
78+
content:
79+
application/json:
80+
schema:
81+
allOf:
82+
- $ref: '../evm_responses.yaml#/common_response_fields'
83+
- type: object
84+
properties:
85+
result:
86+
oneOf:
87+
- $ref: '../components/starknet/schemas.yaml#/BlockWithReceipts'
88+
- $ref: '../components/starknet/schemas.yaml#/PendingBlockWithReceipts'

0 commit comments

Comments
 (0)