Skip to content

Commit e982748

Browse files
committed
feat: a RPC 0.10.0-rc1
1 parent be6b65a commit e982748

File tree

3 files changed

+60
-9
lines changed

3 files changed

+60
-9
lines changed

src/api/components.ts

Lines changed: 55 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,29 @@ export type RESULT_PAGE_REQUEST = {
285285
};
286286

287287
export type EMITTED_EVENT = EVENT & {
288-
block_hash: BLOCK_HASH;
289-
block_number: BLOCK_NUMBER;
288+
/**
289+
* The transaction that emitted the event
290+
*/
290291
transaction_hash: TXN_HASH;
292+
/**
293+
* The index of the transaction in the block by which the event was emitted
294+
* @minimum 0
295+
*/
296+
transaction_index: number;
297+
/**
298+
* The index of the event in the transaction by which it was emitted
299+
* @minimum 0
300+
*/
301+
event_index: number;
302+
/**
303+
* The hash of the block in which the event was emitted
304+
*/
305+
block_hash?: BLOCK_HASH;
306+
/**
307+
* The number of the block in which the event was emitted
308+
* @minimum 0
309+
*/
310+
block_number?: BLOCK_NUMBER;
291311
};
292312

293313
export type EVENT = {
@@ -357,20 +377,51 @@ export type NONCE_UPDATE = {
357377
* The change in state applied in this block
358378
*/
359379
export type STATE_DIFF = {
380+
/**
381+
* The changes in storage per contract address
382+
*/
360383
storage_diffs: CONTRACT_STORAGE_DIFF_ITEM[];
384+
/**
385+
* Deprecated classes declared in this block
386+
*/
361387
deprecated_declared_classes: FELT[];
388+
/**
389+
* New classes declared in this block, with their declared class hash and compiled class hash
390+
*/
362391
declared_classes: NEW_CLASSES[];
392+
/**
393+
* A new contract deployed as part of the state update
394+
*/
363395
deployed_contracts: DEPLOYED_CONTRACT_ITEM[];
396+
/**
397+
* The list of contracts whose class was replaced
398+
*/
364399
replaced_classes: REPLACED_CLASS[];
400+
/**
401+
* The updated nonce per contract address
402+
*/
365403
nonces: NONCE_UPDATE[];
404+
/**
405+
* The list of class hash and the new Blake-migrated compiled class hash pair
406+
*/
407+
migrated_compiled_classes?: {
408+
class_hash: FELT;
409+
compiled_class_hash: FELT;
410+
}[];
366411
};
367412

368413
/**
369414
* Pre-confirmed block state update
370415
*/
371416
export type PRE_CONFIRMED_STATE_UPDATE = {
372-
old_root: FELT;
417+
/**
418+
* The state diff of the pre-confirmed block
419+
*/
373420
state_diff: STATE_DIFF;
421+
/**
422+
* The previous global state root
423+
*/
424+
old_root?: FELT;
374425
block_hash: never; // diverge: this makes it distinct
375426
};
376427

@@ -1258,5 +1309,5 @@ export type TXN_STATUS_RESULT = {
12581309
*/
12591310
export type CONTRACT_STORAGE_KEYS = {
12601311
contract_address: ADDRESS;
1261-
storage_keys: FELT[];
1312+
storage_keys: STORAGE_KEY[];
12621313
};

src/api/errors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface CONTRACT_NOT_FOUND {
2121

2222
export interface ENTRYPOINT_NOT_FOUND {
2323
code: 21;
24-
message: 'Requested entrypoint does not exist in the contract';
24+
message: 'Requested entry point does not exist in the contract';
2525
}
2626

2727
export interface BLOCK_NOT_FOUND {

src/api/methods.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ type ReadMethods = {
219219
block_id: BLOCK_ID;
220220
};
221221
result: FeeEstimate[];
222-
errors: Errors.TRANSACTION_EXECUTION_ERROR | Errors.BLOCK_NOT_FOUND;
222+
errors: Errors.TRANSACTION_EXECUTION_ERROR | Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND;
223223
};
224224

225225
// Estimate the L2 fee of a message sent on L1
@@ -229,7 +229,7 @@ type ReadMethods = {
229229
block_id: BLOCK_ID;
230230
};
231231
result: MessageFeeEstimate;
232-
errors: Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND;
232+
errors: Errors.CONTRACT_ERROR | Errors.BLOCK_NOT_FOUND | Errors.CONTRACT_NOT_FOUND;
233233
};
234234

235235
// Get the most recent accepted block number
@@ -524,7 +524,7 @@ export type WebSocketMethods = {
524524
/**
525525
* starknet_subscriptionNewTransactionReceipts
526526
*/
527-
events: [NewTransactionReceiptsEvent];
527+
events: [NewTransactionReceiptsEvent, ReorgEvent];
528528
};
529529

530530
/**
@@ -547,7 +547,7 @@ export type WebSocketMethods = {
547547
/**
548548
* starknet_subscriptionNewTransaction
549549
*/
550-
events: [NewTransactionEvent];
550+
events: [NewTransactionEvent, ReorgEvent];
551551
};
552552

553553
/**

0 commit comments

Comments
 (0)