Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let params = [{ label: "Method", value: displayRequest.method }];
switch (displayRequest.method) {
case "eth_sendTransaction":
case "eth_signTransaction":
params = [
...params,
{ label: "From", value: displayRequest.params[0].from },
{ label: "To", value: displayRequest.params[0].to },
{
label: "Gas Limit",
value: displayRequest.params[0].gas
? convertHexToNumber(displayRequest.params[0].gas)
: displayRequest.params[0].gasLimit
? convertHexToNumber(displayRequest.params[0].gasLimit)
: ""
},
{
label: "Gas Price",
value: convertHexToNumber(displayRequest.params[0].gasPrice)
},
{
label: "Nonce",
value: convertHexToNumber(displayRequest.params[0].nonce)
},
{
label: "Value",
value: convertHexToNumber(displayRequest.params[0].value)
},
{ label: "Data", value: displayRequest.params[0].data }
];
rejectRequest
} = this.props;
let params = [{ label: "Method", value: displayRequest.method }];
switch (displayRequest.method) {
case "eth_sendTransaction":
case "eth_signTransaction":
params = [
...params,
{ label: "From", value: displayRequest.params[0].from },
{ label: "To", value: displayRequest.params[0].to },
{
label: "Gas Limit",
value: displayRequest.params[0].gas
? convertHexToNumber(displayRequest.params[0].gas)
: displayRequest.params[0].gasLimit
? convertHexToNumber(displayRequest.params[0].gasLimit)
: ""
},
{
label: "Gas Price",
value: convertHexToNumber(displayRequest.params[0].gasPrice)
},
{
label: "Nonce",
value: convertHexToNumber(displayRequest.params[0].nonce)
},
{
label: "Value",
value: convertHexToNumber(displayRequest.params[0].value)
},
? convertHexToNumber(displayRequest.params[0].gas)
: displayRequest.params[0].gasLimit
? convertHexToNumber(displayRequest.params[0].gasLimit)
: ""
},
{
label: "Gas Price",
value: convertHexToNumber(displayRequest.params[0].gasPrice)
},
{
label: "Nonce",
value: convertHexToNumber(displayRequest.params[0].nonce)
},
{
label: "Value",
value: convertHexToNumber(displayRequest.params[0].value)
},
{ label: "Data", value: displayRequest.params[0].data }
];
break;
case "eth_sign":
params = [
...params,
{ label: "Address", value: displayRequest.params[0] },
{ label: "Message", value: displayRequest.params[1] }
];
break;
case "personal_sign":
params = [
...params,
{ label: "Address", value: displayRequest.params[1] },
{ label: "To", value: displayRequest.params[0].to },
{
label: "Gas Limit",
value: displayRequest.params[0].gas
? convertHexToNumber(displayRequest.params[0].gas)
: displayRequest.params[0].gasLimit
? convertHexToNumber(displayRequest.params[0].gasLimit)
: ""
},
{
label: "Gas Price",
value: convertHexToNumber(displayRequest.params[0].gasPrice)
},
{
label: "Nonce",
value: convertHexToNumber(displayRequest.params[0].nonce)
},
{
label: "Value",
value: convertHexToNumber(displayRequest.params[0].value)
},
{ label: "Data", value: displayRequest.params[0].data }
];
break;
case "eth_sign":
params = [
...params,
{ label: "Address", value: displayRequest.params[0] },
{ label: "Message", value: displayRequest.params[1] }
];
break;
case "eth_signTransaction":
params = [
...params,
{ label: "From", value: displayRequest.params[0].from },
{ label: "To", value: displayRequest.params[0].to },
{
label: "Gas Limit",
value: displayRequest.params[0].gas
? convertHexToNumber(displayRequest.params[0].gas)
: displayRequest.params[0].gasLimit
? convertHexToNumber(displayRequest.params[0].gasLimit)
: ""
},
{
label: "Gas Price",
value: convertHexToNumber(displayRequest.params[0].gasPrice)
},
{
label: "Nonce",
value: convertHexToNumber(displayRequest.params[0].nonce)
},
{
label: "Value",
value: convertHexToNumber(displayRequest.params[0].value)
},
{ label: "Data", value: displayRequest.params[0].data }
];
break;
case "eth_sign":
params = [
...params,