( web3: Web3, prepaidCardAddress: string, spendAmount: number, rate: string, action: string, data: string, signatures: Signature[], nonce: string )
| 166 | } |
| 167 | |
| 168 | export async function executeSend( |
| 169 | web3: Web3, |
| 170 | prepaidCardAddress: string, |
| 171 | spendAmount: number, |
| 172 | rate: string, |
| 173 | action: string, |
| 174 | data: string, |
| 175 | signatures: Signature[], |
| 176 | nonce: string |
| 177 | ): Promise<GnosisExecTx> { |
| 178 | let relayServiceURL = await getConstant('relayServiceURL', web3); |
| 179 | const url = `${relayServiceURL}/v1/prepaid-card/${prepaidCardAddress}/send/`; |
| 180 | const options = { |
| 181 | method: 'POST', |
| 182 | headers: { |
| 183 | 'Content-Type': 'application/json', //eslint-disable-line @typescript-eslint/naming-convention |
| 184 | }, |
| 185 | body: JSON.stringify({ |
| 186 | nonce, |
| 187 | payment: spendAmount, |
| 188 | rate, |
| 189 | action, |
| 190 | data, |
| 191 | signatures, |
| 192 | }), |
| 193 | }; |
| 194 | let response = await fetch(url, options); |
| 195 | if (!response?.ok) { |
| 196 | throw new Error(await response.text()); |
| 197 | } |
| 198 | return response.json(); |
| 199 | } |
| 200 | |
| 201 | export function getParamsFromEvent(web3: Web3, txnReceipt: TransactionReceipt, eventAbi: EventABI, address: string) { |
| 202 | let eventParams = txnReceipt.logs |
no test coverage detected