( web3: Web3, from: string, to: string, value: string, data: string, operation: number, gasToken: string )
| 62 | } |
| 63 | |
| 64 | export async function gasEstimate( |
| 65 | web3: Web3, |
| 66 | from: string, |
| 67 | to: string, |
| 68 | value: string, |
| 69 | data: string, |
| 70 | operation: number, |
| 71 | gasToken: string |
| 72 | ): Promise<Estimate> { |
| 73 | let relayServiceURL = await getConstant('relayServiceURL', web3); |
| 74 | let url = `${relayServiceURL}/v2/safes/${from}/transactions/estimate/`; |
| 75 | let options = { |
| 76 | method: 'POST', |
| 77 | headers: { |
| 78 | 'Content-Type': 'application/json', //eslint-disable-line @typescript-eslint/naming-convention |
| 79 | }, |
| 80 | body: JSON.stringify({ |
| 81 | to, |
| 82 | value, |
| 83 | data, |
| 84 | operation, |
| 85 | gasToken, |
| 86 | }), |
| 87 | }; |
| 88 | let response = await fetch(url, options); |
| 89 | if (!response?.ok) { |
| 90 | throw new Error(await response.text()); |
| 91 | } |
| 92 | return await response.json(); |
| 93 | } |
| 94 | |
| 95 | export async function getSendPayload( |
| 96 | web3: Web3, |
no test coverage detected