( web3: Web3, from: string, to: string, value: number, data: any, operation: number, safeTxGas: string, dataGas: string, gasPrice: string, nonce: string, signatures: any, gasToken: string, refundReceiver: string )
| 122 | } |
| 123 | |
| 124 | export async function executeTransaction( |
| 125 | web3: Web3, |
| 126 | from: string, |
| 127 | to: string, |
| 128 | value: number, |
| 129 | data: any, |
| 130 | operation: number, |
| 131 | safeTxGas: string, |
| 132 | dataGas: string, |
| 133 | gasPrice: string, |
| 134 | nonce: string, |
| 135 | signatures: any, |
| 136 | gasToken: string, |
| 137 | refundReceiver: string |
| 138 | ): Promise<GnosisExecTx> { |
| 139 | let relayServiceURL = await getConstant('relayServiceURL', web3); |
| 140 | const url = `${relayServiceURL}/v1/safes/${from}/transactions/`; |
| 141 | const options = { |
| 142 | method: 'POST', |
| 143 | headers: { |
| 144 | 'Content-Type': 'application/json', //eslint-disable-line @typescript-eslint/naming-convention |
| 145 | }, |
| 146 | body: JSON.stringify({ |
| 147 | to, |
| 148 | value, |
| 149 | data, |
| 150 | operation, |
| 151 | safeTxGas, |
| 152 | baseGas: dataGas, |
| 153 | dataGas, |
| 154 | gasPrice, |
| 155 | nonce, |
| 156 | signatures, |
| 157 | gasToken, |
| 158 | refundReceiver, |
| 159 | }), |
| 160 | }; |
| 161 | let response = await fetch(url, options); |
| 162 | if (!response?.ok) { |
| 163 | throw new Error(await response.text()); |
| 164 | } |
| 165 | return response.json(); |
| 166 | } |
| 167 | |
| 168 | export async function executeSend( |
| 169 | web3: Web3, |
no test coverage detected