File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
1010 CompiledContract ,
1111 DeployContractPayload ,
1212 Endpoints ,
13+ EstimateFeeResponse ,
1314 GetBlockResponse ,
1415 GetCodeResponse ,
1516 GetContractAddressesResponse ,
@@ -153,6 +154,17 @@ export class Provider implements ProviderInterface {
153154 try {
154155 const { data } = await axios . request < Endpoints [ T ] [ 'RESPONSE' ] > ( {
155156 method,
157+ transformResponse :
158+ endpoint === 'estimate_fee'
159+ ? ( res ) : EstimateFeeResponse => {
160+ return parse ( res , ( _ , v ) => {
161+ if ( v && typeof v === 'bigint' ) {
162+ return toBN ( v . toString ( ) ) ;
163+ }
164+ return v ;
165+ } ) ;
166+ }
167+ : axios . defaults . transformResponse ,
156168 url : urljoin ( baseUrl , endpoint , queryString ) ,
157169 data : stringify ( request ) ,
158170 headers,
Original file line number Diff line number Diff line change 1+ import BN from 'bn.js' ;
2+
13import { BlockIdentifier } from '../provider/utils' ;
24import { BigNumberish } from '../utils/number' ;
35import {
@@ -235,7 +237,7 @@ export type TransactionReceiptResponse = {
235237} ;
236238
237239export type EstimateFeeResponse = {
238- amount : number ;
240+ amount : BN ;
239241 unit : string ;
240242} ;
241243
You can’t perform that action at this time.
0 commit comments