File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -101,17 +101,19 @@ export class ERCUtils {
101101 // Private
102102 //
103103
104+ private static privateAxios = axios . create ( )
105+
104106 private static async call ( targetAddress : string , abi : string , values : unknown [ ] ) : Promise < unknown [ ] | null > {
105107 let result : unknown [ ] | null
106108 const itf = new ethers . Interface ( [ abi ] )
107109 const functionData = itf . encodeFunctionData ( abi , values )
108- const url = "api/v1/contracts/call"
110+ const url = axios . defaults . baseURL + "api/v1/contracts/call"
109111 const body : ContractCallRequest = {
110112 data : functionData ,
111113 to : targetAddress ,
112114 }
113115 try {
114- const response = await axios . post < ContractCallResponse > ( url , body )
116+ const response = await ERCUtils . privateAxios . post < ContractCallResponse > ( url , body )
115117 result = itf . decodeFunctionResult ( abi , response . data . result )
116118 } catch ( error ) {
117119 if ( axios . isAxiosError ( error ) && error . status === 400 ) {
You can’t perform that action at this time.
0 commit comments