
Research
TeamPCP-Linked Supply Chain Attack Hits SAP CAP and Cloud MTA npm Packages
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.
@morpho-labs/gnosis-tx-builder
Advanced tools
Transform an array of transactions into a json for Gnosis Tx-Builder UX
⚡🚀 Transform an array of transactions in a Transaction builder json for the Gnosis UX, based on ethers-js
npm install @morpho-labs/gnosis-tx-builder
yarn add @morpho-labs/gnosis-tx-builder
Generate a Tx builder json file:
import { ZeroAddress, parseEther } from "ethers";
import fs from "fs";
import TxBuilder, {
ParsingError,
ChecksumParsingError,
TransactionParsingError,
} from "@morpho-labs/gnosis-tx-builder";
const safeAddress = "0x12341234123412341234123412341232412341234";
const transactions = [
{
to: ZeroAddress,
value: parseEther("1").toString(),
data: "0x",
},
];
const batchJson = TxBuilder.batch(safeAddress, transactions);
// dump into a file
fs.writeFileSync("batchTx.json", JSON.stringify(batchJson, null, 2));
Now, with the json file, go to the Gnosis dApp, and select Transaction Builder app
And then, drag and drop the batchTx.json file

And tada! 🎉🎉
Parse transactions from a Tx Builder JSON file:
import fs from "fs";
import TxBuilder from "@morpho-labs/gnosis-tx-builder";
// read from a file
const batchJson = fs.readFileSync("batchTx.json");
try {
const batch = TxBuilder.parse(batchJson);
console.log(batch);
/*
[
{
to: "0x000000000000000000000000",
value: "1000000000000000000",
data: "0x",
},
]
*/
} catch (e: ParsingError) {
if (e instanceof ChecksumParsingError) console.debug(e.params); // { code: ErrorCode; expected: string; computed: string }
if (e instanceof TransactionParsingError) console.debug(e.params); // { code: ErrorCode; index: number; parameter?: string }
console.debug(e.params); // { code: ErrorCode }
}
You can import the error codes from the package
import { ErrorCode } from "@morpho-labs/gnosis-tx-builder";
Available codes
export enum ErrorCode {
wrongFormat = "WRONG_FORMAT", //The json file don't match the expected format ({ meta:..., transactions: [...] })
wrongTxFormat = "WRONG_TRANSACTION_FORMAT", //The transaction at index `index` doesn't match the expected format (not an object or parameter `parameter` doesn't have the right type)
invalidChecksum = "INVALID_CHECKSUM", //The computed checksum doesn't match the expected one (the one in the file)
}
FAQs
Transform an array of transactions into a json for Gnosis Tx-Builder UX
The npm package @morpho-labs/gnosis-tx-builder receives a total of 356 weekly downloads. As such, @morpho-labs/gnosis-tx-builder popularity was classified as not popular.
We found that @morpho-labs/gnosis-tx-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.

Research
/Security News
Socket is tracking cloned Open VSX extensions tied to GlassWorm, with several updated from benign-looking sleepers into malware delivery vehicles.