Validate Transaction
This method analyzes a transaction, checking to see if it will end up sending assets to a malicious address.
validateTransaction
POST
https://api.harpie.io/v2/validateTransaction
Get insights on the safety of a transaction. Addresses with no relevant data default to a recommended action of "ALLOW."
Request Body
apiKey*
String
Your API key. You can find this in your dashboard.
from*
String
The address that the transaction is originating from.
This is the .from
parameter of an Ethereum transaction.
to*
String
The address that the transaction is being sent to.
This is the .to
parameter of an Ethereum transaction.
data*
String
The data being passed along with the transaction.
This is the .data
parameter of an Ethereum transaction. If no data exists, use "0x" by default.
value*
Number
The value being sent along with the transaction.
This is the .value
parameter of an Ethereum transaction
{
summary: string,
isDangerousOperation: boolean, // Returns `true` if the operation is a transfer or approval
recommendedAction: "ALLOW" | "BLOCK",
addressDetails: {
name: string,
isMaliciousAddress: boolean,
isAssociatedWithProtocol: boolean,
tags: {
THEFT: boolean,
CYBERCRIME: boolean,
SANCTIONED: boolean,
BOT: boolean,
WASH_TRADER: boolean,
MIXER: boolean,
NO_DATA: boolean,
}
}
}
Example query:
fetch("https://api.harpie.io/v2/validateTransaction", {
method: "POST",
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
body: JSON.stringify({
apiKey: "{YOUR API KEY HERE}",
to: "0xEea6cEDf9c8a4bD197Ced6F11B254138B388a5f5",
value: 0,
from: "0x84F3Cfa1Ecbf333A3e91C0DAF7415ea0F1bcB701",
data: "0xa9059cbb00000000000000000000000055456cbd1f11298b80a53c896f4b1dc9bc16c731000000000000000000000000000000000000000000000000000de0b6b3a7640000"
})
})
Example response:
{
"summary": "This transaction calls a token approval, which sends assets to a known malicious address. We recommend BLOCKING this transaction.",
"isDangerousOperation": true,
"recommendedAction": "BLOCK",
"addressDetails": {
"name": "Malicious Address",
"isMaliciousAddress": true,
"isAssociatedWithProtocol": false,
"tags": {
"THEFT": true,
"CYBERCRIME": false,
"NO_DATA": false,
"SANCTIONED": false,
"MIXER": false,
"BOT": false,
"WASH_TRADER": false
}
}
}
Last updated