Environment
Defender Relayer
Details
Hi everyone,
I've been facing an issue with sending a transaction using the defender-relay-client
. This code sample was tested previously and worked fine, but now it's failing with the following error:
{
"error": "Request failed with status code 500"
}
My account balance is 0.015 ETH. Here's the payload I'm sending in:
{
"to": "0xeE6fb338E75C43cc9153FF86600700459e9871Da",
"value": 0,
"data": "",
"speed": "average",
"gasLimit": 10000000000000000
}
And here's the calling code to the function in my main index.mjs:
switch (`${event.httpMethod} ${event.path}`) {
case "POST /send":
body = await send(
apiKey,
apiSecret,
JSON.parse(event.body).to,
JSON.parse(event.body).value,
JSON.parse(event.body).data,
JSON.parse(event.body).speed,
JSON.parse(event.body).gasLimit
);
break;
I'm not getting any helpful error messages from Defender. Does anyone have an idea of what the issue might be? Any help would be greatly appreciated. Thanks!
Code to reproduce
// send.mjs
import { Relayer } from "defender-relay-client";
const send = async (apiKey, apiSecret, to, value, data, speed, gasLimit) => {
const relayer = new Relayer({ apiKey, apiSecret });
const tx = await relayer.sendTransaction({
to,
value,
data,
speed,
gasLimit,
});
return tx;
};
export { send };