@@ -2,21 +2,22 @@ import fetch from 'cross-fetch';
22
33import { StarknetChainId } from '../constants' ;
44import {
5+ Call ,
56 CallContractResponse ,
67 CompiledContract ,
78 DeclareContractPayload ,
89 DeclareContractResponse ,
910 DeployContractPayload ,
1011 DeployContractResponse ,
1112 EstimateFeeResponse ,
12- FunctionCall ,
1313 GetBlockResponse ,
1414 GetTransactionReceiptResponse ,
1515 GetTransactionResponse ,
1616 Invocation ,
1717 InvocationsDetails ,
1818 InvokeFunctionResponse ,
1919 RPC ,
20+ Signature ,
2021} from '../types' ;
2122import { getSelectorFromName } from '../utils/hash' ;
2223import { parse , stringify } from '../utils/json' ;
@@ -135,10 +136,11 @@ export class RPCProvider implements ProviderInterface {
135136 }
136137
137138 public async getEstimateFee (
138- request : FunctionCall ,
139- blockIdentifier : BlockIdentifier = 'pending'
139+ call : Call ,
140+ blockIdentifier : BlockIdentifier = 'pending' ,
141+ _signature : Signature = [ ]
140142 ) : Promise < EstimateFeeResponse > {
141- const parsedCalldata = request . calldata . map ( ( data ) => {
143+ const parsedCalldata = call . calldata ? .map ( ( data ) => {
142144 if ( typeof data === 'string' && isHex ( data as string ) ) {
143145 return data ;
144146 }
@@ -147,8 +149,8 @@ export class RPCProvider implements ProviderInterface {
147149
148150 return this . fetchEndpoint ( 'starknet_estimateFee' , [
149151 {
150- contract_address : request . contractAddress ,
151- entry_point_selector : getSelectorFromName ( request . entryPointSelector ) ,
152+ contract_address : call . contractAddress ,
153+ entry_point_selector : getSelectorFromName ( call . entrypoint ) ,
152154 calldata : parsedCalldata ,
153155 } ,
154156 blockIdentifier ,
@@ -223,10 +225,10 @@ export class RPCProvider implements ProviderInterface {
223225 }
224226
225227 public async callContract (
226- request : FunctionCall ,
228+ call : Call ,
227229 blockIdentifier : BlockIdentifier = 'pending'
228230 ) : Promise < CallContractResponse > {
229- const parsedCalldata = request . calldata . map ( ( data ) => {
231+ const parsedCalldata = call . calldata ? .map ( ( data ) => {
230232 if ( typeof data === 'string' && isHex ( data as string ) ) {
231233 return data ;
232234 }
@@ -235,8 +237,8 @@ export class RPCProvider implements ProviderInterface {
235237
236238 const result = await this . fetchEndpoint ( 'starknet_call' , [
237239 {
238- contract_address : request . contractAddress ,
239- entry_point_selector : getSelectorFromName ( request . entryPointSelector ) ,
240+ contract_address : call . contractAddress ,
241+ entry_point_selector : getSelectorFromName ( call . entrypoint ) ,
240242 calldata : parsedCalldata ,
241243 } ,
242244 blockIdentifier ,
0 commit comments