The Venn Guard Transaction Validation API enables automatic transaction validation through Venn’s decentralized security network. It accepts standard user transactions and returns a JSON that is ready for upload to any Safe UI.
Copy {
chainId: number,
safeAddress: string,
transactions: [
{
to: string
value: string
data: string
}
]
}
If all of the transactions passed validation, the API will respond with a new Safe Transaction Batch that can be uploaded into any Safe UI.
If one or more of the transactions fail validation, the API will respond with an error.
Copy {
requestId: string,
data: {
version: string,
chainId: string,
createdAt: number,
meta: {
name: string,
description: string,
txBuilderVersion: string,
createdFromSafeAddress: string,
createdFromOwnerAddress: string,
checksum: string
},
transactions: [
// Venn Signature Transaction
{
to: string,
value: string,
data: string
},
// Original User Transactions
{
to: string,
value: string,
data: string
}
]
},
status: string
}
Copy {
requestId: string,
isError: boolean,
message: string,
status: string
}
Copy import axios from "axios";
// Your Safe Address
const SAFE_ADDRESS = "0x..."
// 1st transaction in the batch
const userTransaction1 = {
to: "0x...",
value: "0",
data: "0x...",
safeAddress: SAFE_ADDRESS,
};
// 2nd transaction in the batch
const userTransaction2 = {
to: "0x...",
value: "0",
data: "0x...",
safeAddress: SAFE_ADDRESS,
};
// Validating and signing the transactions with Venn
const response = await axios.post(
"https://operator1-signer.venn.build/batch/sign",
{
transactions [userTransaction1, userTransaction2],
safeAddress: SAFE_ADDRESS
}
);
console.log(response.data):
// Transaction Batch JSON
// {
// ...
// transactions: [
// <Venn's Approving Signature Tx>,
// <User Tx 1>,
// <User Tx 2>,
// ]
// }