-
Notifications
You must be signed in to change notification settings - Fork 827
Expand file tree
/
Copy pathinterface.ts
More file actions
705 lines (651 loc) · 24 KB
/
Copy pathinterface.ts
File metadata and controls
705 lines (651 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
import { RPC09, RPC0102, RPC0103 } from '../channel';
import { StarknetChainId } from '../global/constants';
import type {
AccountInvocations,
BigNumberish,
Block,
BlockIdentifier,
Call,
CallContractResponse,
ContractClassResponse,
ContractVersion,
DeclareContractResponse,
DeclareContractTransaction,
DeployAccountContractPayload,
DeployAccountContractTransaction,
DeployContractResponse,
EstimateFeeResponseOverhead,
EstimateFeeResponseBulkOverhead,
GetBlockResponse,
GetTransactionReceiptResponse,
GetTransactionResponse,
Invocation,
InvocationsDetailsWithNonce,
InvokeFunctionResponse,
Nonce,
PreConfirmedBlock,
PreConfirmedStateUpdate,
StateUpdate,
StateUpdateResponse,
getContractVersionOptions,
getEstimateFeeBulkOptions,
getSimulateTransactionOptions,
waitForTransactionOptions,
SimulateTransactionOverheadResponse,
RPC,
ContractClassIdentifier,
Invocations,
Signature,
TypedData,
StorageResponse,
} from '../types';
import { TipAnalysisOptions, TipEstimate } from './modules/tip';
import { RPCSPEC09, RPCSPEC0103 } from '../types/api';
import { RPCResponseParser } from './modules/responseParser';
export abstract class ProviderInterface {
public abstract channel: RPC09.RpcChannel | RPC0102.RpcChannel | RPC0103.RpcChannel;
public abstract responseParser: RPCResponseParser;
/**
* Gets the Starknet chain Id
*
* @returns the chain Id
*/
public abstract getChainId(): Promise<StarknetChainId>;
/**
* Calls a function on the Starknet contract.
*
* @param call transaction to be called
* @param blockIdentifier block identifier
* @returns the result of the function on the smart contract.
*/
public abstract callContract(
call: Call,
blockIdentifier?: BlockIdentifier
): Promise<CallContractResponse>;
/**
* Gets the block information
*
* @returns the block object
*/
public abstract getBlock(): Promise<PreConfirmedBlock>;
public abstract getBlock(blockIdentifier: 'pre_confirmed'): Promise<PreConfirmedBlock>;
public abstract getBlock(blockIdentifier: 'latest'): Promise<Block>;
public abstract getBlock(blockIdentifier: BlockIdentifier): Promise<GetBlockResponse>;
/**
* Gets the contract class of the deployed contract.
*
* @param contractAddress - contract address
* @param blockIdentifier - block identifier
* @returns Contract class of compiled contract
*/
public abstract getClassAt(
contractAddress: BigNumberish,
blockIdentifier?: BlockIdentifier
): Promise<ContractClassResponse>;
/**
* Gets the price of l1 gas in the block
*
* @param blockIdentifier block identifier
* @returns gas price of the block
*/
public abstract getL1GasPrice(blockIdentifier?: BlockIdentifier): Promise<string>;
/**
* Get L1 message hash from L2 transaction hash
* @param {BigNumberish} l2TxHash L2 transaction hash
* @returns {string} Hex string of L1 message hash
* @example
* In Sepolia Testnet :
* ```typescript
* const result = provider.getL1MessageHash('0x28dfc05eb4f261b37ddad451ff22f1d08d4e3c24dc646af0ec69fa20e096819');
* // result = '0x55b3f8b6e607fffd9b4d843dfe8f9b5c05822cd94fcad8797deb01d77805532a'
* ```
*/
public abstract getL1MessageHash(l2TxHash: BigNumberish): Promise<string>;
/**
* Returns the contract class hash in the given block for the contract deployed at the given address
*
* @param contractAddress - contract address
* @param blockIdentifier - block identifier
* @returns Class hash
*/
public abstract getClassHashAt(
contractAddress: BigNumberish,
blockIdentifier?: BlockIdentifier
): Promise<string>;
/**
* Returns the contract class deployed under the given class hash.
*
* @param classHash - class hash
* @returns Contract class of compiled contract
*/
public abstract getClassByHash(classHash: BigNumberish): Promise<ContractClassResponse>;
/**
* Returns the nonce associated with the given address in the given block
*
* @param contractAddress - contract address
* @returns the hex nonce
*/
public abstract getNonceForAddress(
contractAddress: BigNumberish,
blockIdentifier?: BlockIdentifier
): Promise<Nonce>;
/**
* Get the value of the storage (contract's variable) at the given address and key
*
* @param contractAddress
* @param key - from getStorageVarAddress('<STORAGE_VARIABLE_NAME>') (WIP)
* @param blockIdentifier - block identifier
* @returns the value of the storage variable
*/
public abstract getStorageAt(
contractAddress: BigNumberish,
key: BigNumberish,
blockIdentifier?: BlockIdentifier,
responseFlags?: RPCSPEC0103.STORAGE_RESPONSE_FLAG[]
): Promise<StorageResponse>;
/**
* Gets the transaction information from a tx id.
*
* @param transactionHash
* @param options - (optional) additional request options
* - includeProofFacts - include proof facts in the transaction response (RPC 0.10.1+)
* @returns the transaction object \{ transaction_id, status, transaction, block_number?, block_number?, transaction_index?, transaction_failure_reason? \}
*/
public abstract getTransaction(
transactionHash: BigNumberish,
options?: { includeProofFacts?: boolean }
): Promise<GetTransactionResponse>;
/**
* Gets the transaction receipt from a tx hash.
*
* @param transactionHash
* @returns the transaction receipt object
*/
public abstract getTransactionReceipt(
transactionHash: BigNumberish
): Promise<GetTransactionReceiptResponse>;
/**
* Deploys a given compiled Account contract (json) to starknet
*
* @param payload payload to be deployed containing:
* - compiled contract code
* - constructor calldata
* - address salt
* @returns a confirmation of sending a transaction on the starknet contract
*/
public abstract deployAccountContract(
payload: DeployAccountContractPayload,
details: InvocationsDetailsWithNonce
): Promise<DeployContractResponse>;
/**
* Invokes a function on starknet
*
* @param invocation the invocation object containing:
* - contractAddress - the address of the contract
* - entrypoint - (optional) the entrypoint of the contract
* - calldata - (optional, defaults to []) the calldata
* - signature - (optional, defaults to []) the signature
* @param details - optional details containing:
* - nonce - optional nonce
* - version - optional version
* - maxFee - optional maxFee
* @returns response from addTransaction
*/
public abstract invokeFunction(
invocation: Invocation,
details: InvocationsDetailsWithNonce
): Promise<InvokeFunctionResponse>;
/**
* Declares a given compiled contract (json) to starknet
* @param transaction transaction payload to be deployed containing:
* - compiled contract code
* - sender address
* - signature
* @param details Invocation Details containing:
* - nonce
* - optional version
* - optional maxFee
* @returns a confirmation of sending a transaction on the starknet contract
*/
public abstract declareContract(
transaction: DeclareContractTransaction,
details: InvocationsDetailsWithNonce
): Promise<DeclareContractResponse>;
/**
* Estimates the fee for a given INVOKE transaction
*
* @param invocation the invocation object containing:
* - contractAddress - the address of the contract
* - entrypoint - (optional) the entrypoint of the contract
* - calldata - (optional, defaults to []) the calldata
* - signature - (optional, defaults to []) the signature
* @param details - optional details containing:
* - nonce - optional nonce
* - version - optional version
* @param blockIdentifier - (optional) block identifier
* @param skipValidate - (optional) skip cairo __validate__ method
* @returns the estimated fee
* @deprecated Consider using getEstimateFeeBulk for multiple transactions
* @example
* ```typescript
* const feeEstimate = await provider.getInvokeEstimateFee(invocation, details);
* // Equivalent to:
* const [feeEstimate] = await provider.getEstimateFeeBulk([{ type: ETransactionType.INVOKE, ...invocation, ...details }], options);
* ```
* @remarks This method is an alias that calls getEstimateFeeBulk with a single transaction
*/
public abstract getInvokeEstimateFee(
invocation: Invocation,
details: InvocationsDetailsWithNonce,
blockIdentifier?: BlockIdentifier,
skipValidate?: boolean
): Promise<EstimateFeeResponseOverhead>;
/**
* Estimates the fee for a given DECLARE transaction
*
* @param transaction transaction payload to be declared containing:
* - compiled contract code
* - sender address
* - signature - (defaults to []) the signature
* @param details - optional details containing:
* - nonce
* - version - optional version
* - optional maxFee
* @param blockIdentifier - (optional) block identifier
* @param skipValidate - (optional) skip cairo __validate__ method
* @returns the estimated fee
* @deprecated Consider using getEstimateFeeBulk for multiple transactions
* @example
* ```typescript
* const feeEstimate = await provider.getDeclareEstimateFee(transaction, details);
* // Equivalent to:
* const [feeEstimate] = await provider.getEstimateFeeBulk([{ type: ETransactionType.DECLARE, ...transaction, ...details }], options);
* ```
* @remarks This method is an alias that calls getEstimateFeeBulk with a single transaction
*/
public abstract getDeclareEstimateFee(
transaction: DeclareContractTransaction,
details: InvocationsDetailsWithNonce,
blockIdentifier?: BlockIdentifier,
skipValidate?: boolean
): Promise<EstimateFeeResponseOverhead>;
/**
* Estimates the fee for a given DEPLOY_ACCOUNT transaction
*
* @param transaction transaction payload to be deployed containing:
* - classHash
* - constructorCalldata
* - addressSalt
* - signature - (defaults to []) the signature
* @param details - optional details containing:
* - nonce
* - version - optional version
* - optional maxFee
* @param blockIdentifier - (optional) block identifier
* @param skipValidate - (optional) skip cairo __validate__ method
* @returns the estimated fee
* @deprecated Consider using getEstimateFeeBulk for multiple transactions
* @example
* ```typescript
* const feeEstimate = await provider.getDeployAccountEstimateFee(transaction, details);
* // Equivalent to:
* const [feeEstimate] = await provider.getEstimateFeeBulk([{ type: ETransactionType.DEPLOY_ACCOUNT, ...transaction, ...details }], options);
* ```
* @remarks This method is an alias that calls getEstimateFeeBulk with a single transaction
*/
public abstract getDeployAccountEstimateFee(
transaction: DeployAccountContractTransaction,
details: InvocationsDetailsWithNonce,
blockIdentifier?: BlockIdentifier,
skipValidate?: boolean
): Promise<EstimateFeeResponseOverhead>;
/**
* Estimates the fee for a list of INVOKE transaction
*
* @param invocations AccountInvocations - Complete invocations array with account details
* @param options getEstimateFeeBulkOptions
* - (optional) blockIdentifier - BlockIdentifier
* @returns the estimated fee
*/
public abstract getEstimateFeeBulk(
invocations: AccountInvocations,
options?: getEstimateFeeBulkOptions
): Promise<EstimateFeeResponseBulkOverhead>;
/**
* Wait for the transaction to be accepted
* @param txHash - transaction hash
* @param options waitForTransactionOptions
* - (optional) retryInterval: number | undefined;
* - (optional) successStates: TransactionStatus[] | undefined;
* @return GetTransactionReceiptResponse
*/
public abstract waitForTransaction(
txHash: BigNumberish,
options?: waitForTransactionOptions
): Promise<GetTransactionReceiptResponse>;
/**
* Simulates the transaction and returns the transaction trace and estimated fee.
*
* @param invocations AccountInvocations - Complete invocations array with account details
* @param options - getSimulateTransactionOptions
* - (optional) blockIdentifier - block identifier
* - (optional) skipValidate - skip cairo __validate__ method
* - (optional) skipExecute - skip cairo __execute__ method
* - (optional) returnInitialReads - include initial storage reads in the trace response (RPC 0.10.1+)
* @returns an array of transaction trace and estimated fee
*/
public abstract getSimulateTransaction(
invocations: AccountInvocations,
options?: getSimulateTransactionOptions
): Promise<SimulateTransactionOverheadResponse>;
/**
* Gets the state changes in a specific block (result of executing the requested block)
*
* @param blockIdentifier - block identifier
* @returns StateUpdateResponse
*/
public abstract getStateUpdate(
blockIdentifier?: BlockIdentifier,
contractAddresses?: BigNumberish[]
): Promise<StateUpdateResponse>;
/**
* Gets the state changes in a specific block (result of executing the requested block)
* Alternative method name for getStateUpdate with specific overloads
*
* @returns StateUpdateResponse
*/
public abstract getBlockStateUpdate(): Promise<StateUpdate>;
public abstract getBlockStateUpdate(
blockIdentifier: 'pre_confirmed'
): Promise<PreConfirmedStateUpdate>;
public abstract getBlockStateUpdate(blockIdentifier: 'latest'): Promise<StateUpdate>;
public abstract getBlockStateUpdate(
blockIdentifier?: BlockIdentifier
): Promise<StateUpdateResponse>;
/**
* Gets the contract version from the provided address
* @param contractAddress string
* @param classHash undefined
* @param options - getContractVersionOptions
* - (optional) compiler - (default true) extract compiler version using type tactic from abi
* - (optional) blockIdentifier - block identifier
*/
public abstract getContractVersion(
contractAddress: BigNumberish,
classHash?: undefined,
options?: getContractVersionOptions
): Promise<ContractVersion>;
/**
* Gets the contract version from the provided address
* @param contractAddress undefined
* @param classHash
* @param options - getContractVersionOptions
* - (optional) compiler - (default true) extract compiler version using type tactic from abi
* - (optional) blockIdentifier - block identifier
*/
public abstract getContractVersion(
contractAddress: undefined,
classHash: BigNumberish,
options?: getContractVersionOptions
): Promise<ContractVersion>;
// Block utility methods
/**
* Get the most recent accepted block hash and number
* @returns Object containing block hash and number
*/
public abstract getBlockLatestAccepted(): Promise<{ block_hash: string; block_number: number }>;
/**
* Get the most recent accepted block number
* @returns Number of the latest block
*/
public abstract getBlockNumber(): Promise<number>;
/**
* Get block information with transaction hashes
* @param blockIdentifier - block identifier
* @returns Block with transaction hashes
*/
public abstract getBlockWithTxHashes(blockIdentifier?: BlockIdentifier): Promise<any>;
/**
* Get block information with full transactions
* @param blockIdentifier - block identifier
* @param options - (optional) additional request options
* - includeProofFacts - include proof facts in the transaction response (RPC 0.10.1+)
* @returns Block with full transactions
*/
public abstract getBlockWithTxs(
blockIdentifier?: BlockIdentifier,
options?: { includeProofFacts?: boolean }
): Promise<any>;
/**
* Get block information with transaction receipts
* @param blockIdentifier - block identifier
* @param options - (optional) additional request options
* - includeProofFacts - include proof facts in the transaction response (RPC 0.10.1+)
* @returns Block with transaction receipts
*/
public abstract getBlockWithReceipts(
blockIdentifier?: BlockIdentifier,
options?: { includeProofFacts?: boolean }
): Promise<any>;
/**
* Get transaction traces for all transactions in a block
* @param blockIdentifier - block identifier
* @param options - (optional) additional request options
* - returnInitialReads - include initial storage reads in the trace response (RPC 0.10.1+)
* @returns Array of transaction traces
*/
public abstract getBlockTransactionsTraces(
blockIdentifier?: BlockIdentifier,
options?: { returnInitialReads?: boolean }
): Promise<any>;
/**
* Get the number of transactions in a block
* @param blockIdentifier - block identifier
* @returns Transaction count
*/
public abstract getBlockTransactionCount(blockIdentifier?: BlockIdentifier): Promise<number>;
/**
* Pause execution until a specified block is created
* @param blockIdentifier - block number or tag
* @param retryInterval - milliseconds between requests (default: 5000)
* @example
* ```typescript
* await provider.waitForBlock(12345);
* await provider.waitForBlock('latest');
* ```
*/
public abstract waitForBlock(
blockIdentifier?: BlockIdentifier,
retryInterval?: number
): Promise<void>;
// Transaction utility methods
/**
* Gets the transaction information from a tx hash (alias for getTransaction)
* @param txHash - transaction hash
* @param options - (optional) additional request options
* - includeProofFacts - include proof facts in the transaction response (RPC 0.10.1+)
* @returns Transaction information
*/
public abstract getTransactionByHash(
txHash: BigNumberish,
options?: { includeProofFacts?: boolean }
): Promise<GetTransactionResponse>;
/**
* Gets transaction by block identifier and index
* @param blockIdentifier - block identifier
* @param index - transaction index in the block
* @param options - (optional) additional request options
* - includeProofFacts - include proof facts in the transaction response (RPC 0.10.1+)
* @returns Transaction information
*/
public abstract getTransactionByBlockIdAndIndex(
blockIdentifier: BlockIdentifier,
index: number,
options?: { includeProofFacts?: boolean }
): Promise<GetTransactionResponse>;
/**
* Gets the transaction trace
* @param txHash - transaction hash
* @returns Transaction trace
*/
public abstract getTransactionTrace(
txHash: BigNumberish
): Promise<RPCSPEC0103.TRANSACTION_TRACE | RPCSPEC09.TRANSACTION_TRACE>;
/**
* Get the status of a transaction
* @param transactionHash - transaction hash
* @returns Transaction status
*/
public abstract getTransactionStatus(transactionHash: BigNumberish): Promise<any>;
// Provider utility methods
/**
* Direct RPC method call
* @param method - RPC method name
* @param params - method parameters
* @param id - request ID
* @returns RPC response
*/
public abstract fetch(method: string, params?: object, id?: string | number): Promise<any>;
/**
* Read channel spec version
* @returns Spec version string or undefined if not set
*/
public abstract readSpecVersion(): string | undefined;
/**
* Get channel spec version
* @returns Promise resolving to spec version
*/
public abstract getSpecVersion(): Promise<string>;
/**
* Setup channel spec version and return it
* @returns Promise resolving to spec version
*/
public abstract setUpSpecVersion(): Promise<string>;
// Advanced methods
/**
* Get contract class by hash with optional block identifier
* @param classHash - class hash
* @param blockIdentifier - block identifier
* @returns Contract class
*/
public abstract getClass(
classHash: BigNumberish,
blockIdentifier?: BlockIdentifier
): Promise<ContractClassResponse>;
/**
* Estimate the fee for a message from L1
* @param message - L1 message
* @param blockIdentifier - block identifier
* @returns Fee estimate
*/
public abstract estimateMessageFee(
message: RPCSPEC09.L1Message,
blockIdentifier?: BlockIdentifier
): Promise<RPCSPEC0103.FEE_ESTIMATE | RPCSPEC09.MESSAGE_FEE_ESTIMATE>;
/**
* Get node synchronization status
* @returns Sync status or false if not syncing
*/
public abstract getSyncingStats(): Promise<any>;
/**
* Get events matching the given filter
* @param eventFilter - event filter
* @returns Events and pagination info
*/
public abstract getEvents(
eventFilter: RPCSPEC0103.EventFilter | RPCSPEC09.EventFilter
): Promise<RPCSPEC0103.EVENTS_CHUNK | RPCSPEC09.EVENTS_CHUNK>;
/**
* Verify in Starknet a signature of a TypedData object or of a given hash.
* @param {BigNumberish | TypedData} message TypedData object to be verified, or message hash to be verified.
* @param {Signature} signature signature of the message.
* @param {BigNumberish} accountAddress address of the account that has signed the message.
* @param {string} [signatureVerificationFunctionName] if account contract with non standard account verification function name.
* @param [signatureVerificationResponse] if account contract with non standard response of verification function.
* @returns
* ```typescript
* const myTypedMessage: TypedMessage = .... ;
* const messageHash = typedData.getMessageHash(myTypedMessage,accountAddress);
* const sign: WeierstrassSignatureType = ec.starkCurve.sign(messageHash, privateKey);
* const accountAddress = "0x43b7240d227aa2fb8434350b3321c40ac1b88c7067982549e7609870621b535";
* const result1 = await myRpcProvider.verifyMessageInStarknet(myTypedMessage, sign, accountAddress);
* const result2 = await myRpcProvider.verifyMessageInStarknet(messageHash, sign, accountAddress);
* // result1 = result2 = true
* ```
*/
public abstract verifyMessageInStarknet(
message: BigNumberish | TypedData,
signature: Signature,
accountAddress: BigNumberish,
signatureVerificationFunctionName?: string,
signatureVerificationResponse?: {
okResponse: string[];
nokResponse: string[];
error: string[];
}
): Promise<boolean>;
/**
* Test if class is already declared
* @param contractClassIdentifier - contract class identifier
* @param blockIdentifier - block identifier
* @returns true if class is declared
*/
public abstract isClassDeclared(
contractClassIdentifier: ContractClassIdentifier,
blockIdentifier?: BlockIdentifier
): Promise<boolean>;
/**
* Build bulk invocations with auto-detect declared class
* @param invocations - array of invocations
* @returns Prepared invocations
*/
public abstract prepareInvocations(invocations: Invocations): Promise<Invocations>;
/**
* Get L1 messages status for a transaction
* @param transactionHash - L1 transaction hash
* @returns L1 message status
*/
public abstract getL1MessagesStatus(
transactionHash: BigNumberish
): Promise<RPC.RPCSPEC0103.L1L2MessagesStatus | RPC.RPCSPEC09.L1L2MessagesStatus>;
/**
* Get Merkle paths in state tries
* @param classHashes - class hashes
* @param contractAddresses - contract addresses
* @param contractsStorageKeys - storage keys
* @param blockIdentifier - block identifier
* @returns Storage proof
*/
public abstract getStorageProof(
classHashes: BigNumberish[],
contractAddresses: BigNumberish[],
contractsStorageKeys: RPC.CONTRACT_STORAGE_KEYS[],
blockIdentifier?: BlockIdentifier
): Promise<RPC.StorageProof>;
/**
* Get compiled CASM contract class
* @param classHash - class hash
* @returns Compiled CASM contract class
*/
public abstract getCompiledCasm(
classHash: BigNumberish
): Promise<RPC.CASM_COMPILED_CONTRACT_CLASS>;
/**
* Get transaction tip estimation based on network analysis
* @param blockIdentifier - block identifier to analyze from
* @param options - tip analysis options
* @returns Tip estimation with statistics
* @example
* ```typescript
* const tipEstimate = await provider.getEstimateTip('latest', {
* maxBlocks: 10,
* minTxsNecessary: 5
* });
* console.log('Recommended tip:', tipEstimate.recommendedTip);
* ```
*/
public abstract getEstimateTip(
blockIdentifier?: BlockIdentifier,
options?: TipAnalysisOptions
): Promise<TipEstimate>;
}