Skip to content

Commit 026ecb6

Browse files
authored
fix: update rpc 8.0 (#34)
* feat: update rpc 8.0 * rpc 0.8.1 * chore: desc
1 parent 5093b77 commit 026ecb6

File tree

3 files changed

+15
-16
lines changed

3 files changed

+15
-16
lines changed

src/api/components.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export type SUBSCRIPTION_BLOCK_TAG = 'latest';
145145
* An identifier for this subscription stream used to associate events with this subscription.
146146
* Integer
147147
*/
148-
export type SUBSCRIPTION_ID = number;
148+
export type SUBSCRIPTION_ID = string;
149149
export type NEW_TXN_STATUS = {
150150
transaction_hash: TXN_HASH;
151151
status: TXN_STATUS_RESULT;
@@ -773,31 +773,31 @@ export type FEE_ESTIMATE = {
773773
* The Ethereum gas consumption of the transaction, charged for L1->L2 messages and, depending on the block's DA_MODE, state diffs.
774774
* Prev. name gas_consumed
775775
*/
776-
l1_gas_consumed: FELT;
776+
l1_gas_consumed: number;
777777
/**
778778
* The gas price (in wei or fri, depending on the tx version) that was used in the cost estimation.
779779
* Prev. name gas_price
780780
*/
781-
l1_gas_price: FELT;
781+
l1_gas_price: number;
782782
/**
783783
* The L2 gas consumption of the transaction.
784784
*/
785-
l2_gas_consumed: FELT;
785+
l2_gas_consumed: number;
786786
/**
787787
* The L2 gas price (in wei or fri, depending on the tx version) that was used in the cost estimation.
788788
*/
789-
l2_gas_price: FELT;
789+
l2_gas_price: number;
790790
/**
791791
* The Ethereum data gas consumption of the transaction.
792792
* Prev. name data_gas_consumed
793793
*/
794-
l1_data_gas_consumed: FELT;
794+
l1_data_gas_consumed: number;
795795
/**
796796
* The data gas price (in wei or fri, depending on the tx version) that was used in the cost estimation.
797797
* Prev. name data_gas_price
798798
*/
799-
l1_data_gas_price: FELT;
800-
overall_fee: FELT;
799+
l1_data_gas_price: number;
800+
overall_fee: number;
801801
unit: PRICE_UNIT;
802802
};
803803

src/api/executable.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// * Starknet executables
33
// **********************
44

5-
import type { DEPRECATED_CAIRO_ENTRY_POINT, FELT, NUM_AS_HEX } from './components.js';
5+
import type { FELT, NUM_AS_HEX } from './components.js';
66

77
/**
88
* Starknet get compiled CASM result
@@ -27,7 +27,9 @@ export type CASM_COMPILED_CONTRACT_CLASS = {
2727
bytecode_segment_lengths?: number;
2828
};
2929

30-
export type CASM_ENTRY_POINT = DEPRECATED_CAIRO_ENTRY_POINT & {
30+
export type CASM_ENTRY_POINT = {
31+
offset: number;
32+
selector: FELT;
3133
builtins: string[];
3234
};
3335

src/api/methods.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,7 @@ type ReadMethods = {
205205

206206
/**
207207
* Estimate the fee for Starknet transactions
208-
*
209-
* Estimates the resources required by a given sequence of transactions when applied on a given state.
210-
* If one of the transactions reverts or fails due to any reason (e.g. validation failure or an internal error),
211-
* a TRANSACTION_EXECUTION_ERROR is returned. For v0-2 transactions the estimate is given in wei, and for v3 transactions it is given in fri.
208+
* Estimates the resources required by a given sequence of transactions when applied on a given state. If one of the transactions reverts or fails due to any reason (e.g. validation failure or an internal error), a TRANSACTION_EXECUTION_ERROR is returned.
212209
*/
213210
starknet_estimateFee: {
214211
params: {
@@ -304,7 +301,7 @@ type ReadMethods = {
304301
/**
305302
* The hash of the requested block, or number (height) of the requested block, or a block tag
306303
*/
307-
block_id: BLOCK_ID;
304+
block_id: SUBSCRIPTION_BLOCK_ID;
308305
/**
309306
* a list of the class hashes for which we want to prove membership in the classes trie
310307
*/
@@ -326,7 +323,7 @@ type ReadMethods = {
326323
};
327324

328325
/**
329-
* Get the contract class definition in the given block associated with the given hash
326+
* Get the CASM code resulting from compiling a given class
330327
*/
331328
starknet_getCompiledCasm: {
332329
params: {

0 commit comments

Comments
 (0)