mirror of
https://github.com/luxfi/lux-security-engine.git
synced 2026-10-30 16:20:37 +00:00
29 lines
774 B
JavaScript
29 lines
774 B
JavaScript
import { caseInsensitiveCompare } from "../utils";
|
|
const rules = [
|
|
{
|
|
id: "1139",
|
|
enable: true,
|
|
valueDescription: "Recipient address is unknown",
|
|
valueDefine: {
|
|
type: "boolean",
|
|
},
|
|
defaultThreshold: {
|
|
danger: true,
|
|
},
|
|
customThreshold: {},
|
|
requires: ["common"],
|
|
async getValue(ctx) {
|
|
const { receiverInWallet, from, receiver } = ctx.common;
|
|
if (!receiver)
|
|
return false;
|
|
if (receiverInWallet)
|
|
return false;
|
|
return !caseInsensitiveCompare(from, receiver);
|
|
},
|
|
descriptions: {
|
|
danger: `The recipient address is unknown`,
|
|
},
|
|
},
|
|
];
|
|
export default rules;
|