{"id":24860769,"url":"https://github.com/gnosisguild/ethers-multisend","last_synced_at":"2025-10-15T07:30:49.854Z","repository":{"id":45295182,"uuid":"409974684","full_name":"gnosisguild/ethers-multisend","owner":"gnosisguild","description":"An npm package for crafting multi-send transaction from a Safe, based on ethers.js","archived":false,"fork":false,"pushed_at":"2024-05-31T12:56:13.000Z","size":274,"stargazers_count":67,"open_issues_count":0,"forks_count":9,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-01-09T07:58:35.323Z","etag":null,"topics":["ethereum","ethersjs","gnosis-safe","typescript","zodiac"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gnosisguild.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-24T13:31:50.000Z","updated_at":"2025-01-06T12:02:22.000Z","dependencies_parsed_at":"2024-03-06T17:22:42.673Z","dependency_job_id":"bcb18ce9-9c5b-404d-b835-67caf5b1f0b6","html_url":"https://github.com/gnosisguild/ethers-multisend","commit_stats":null,"previous_names":["gnosis/ethers-multisend"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnosisguild%2Fethers-multisend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnosisguild%2Fethers-multisend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnosisguild%2Fethers-multisend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnosisguild%2Fethers-multisend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnosisguild","download_url":"https://codeload.github.com/gnosisguild/ethers-multisend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236589219,"owners_count":19173429,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ethereum","ethersjs","gnosis-safe","typescript","zodiac"],"created_at":"2025-01-31T21:48:07.954Z","updated_at":"2025-10-15T07:30:44.484Z","avatar_url":"https://github.com/gnosisguild.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ethers-multisend\n\n[![Build Status](https://github.com/gnosisguild/ethers-multisend/actions/workflows/ci.yml/badge.svg)](https://github.com/gnosisguild/ethers-multisend/actions/workflows/ci.yml)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](https://github.com/gnosisguild/CODE_OF_CONDUCT)\n\nAn npm package for crafting multi-send transaction from a Safe, based on ethers.js v5.\n\n## Features\n\n- Easily encode the most common types of transactions from JSON inputs:\n  - ETH \u0026 ERC20 token transfers\n  - NFT transfers\n  - Contract function calls\n  - Raw transactions\n- Encode a batch of transactions into a single [multi-send call](https://github.com/safe-global/safe-smart-account/blob/main/contracts/libraries/MultiSend.sol).\n\n## What to do with the encoded transaction objects?\n\nThe encode functions produce JavaScript objects that can be used to actually execute the described transactions.\nThere are various ways to do that, using direct calls to your Safe contract, or by relaying it using the infrastructure provided by Safe.\nCheck out the Safe{Core} SDK to learn more: https://github.com/safe-global/safe-core-sdk\n\n## Installation\n\nThis module is distributed via npm. For adding it to your project, run:\n\n```\nnpm install --save ethers-multisend\n```\n\nTo install it using yarn, run:\n\n```\nyarn add ethers-multisend\n```\n\n## API\n\n## encodeSingle\n\n```ts\nencodeSingle(transactionInput: TransactionInput): MetaTransaction\n```\n\nEncodes a single transaction input and turns into an format that is ready for execution.\n\n## encodeMulti\n\n```ts\nencodeMulti(\n  metaTransaction: MetaTransaction[],\n  multiSendContractAddress?: string\n): MetaTransaction\n```\n\nBatches a set of meta transactions into a single multi-send contract call.\n\nYou can optionally provide the `multiSendContractAddress` to use. By default, it will use [MultiSendCallOnly v1.4.1](https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.4.1/multi_send_call_only.json) or [MultiSend v1.4.1](https://github.com/safe-global/safe-deployments/blob/main/src/assets/v1.4.1/multi_send.json) if the batch includes any delegate calls.\n\n## decodeSingle\n\n```ts\ndecodeSingle(\n  metaTransaction: MetaTransaction,\n  provider: Provider,\n  fetchAbi?: (address: string) =\u003e Promise\u003cstring | undefined\u003e,\n  id?: string\n): Promise\u003cTransactionInput\u003e\n```\n\nDecodes a meta transaction and returns a transaction input object of one of the four supported types.\nIt needs an ethers provider instance to fetch decimals for ERC20 token transfers, and a function for fetching the ABI for a contract address.\n\n## decodeMulti\n\n```ts\ndecodeMulti(data: string): MetaTransaction[]\n```\n\nGiven the data string of a multi-send transaction, returns an array of the included meta transactions.\n\n## createTransaction\n\n```ts\ncreateTransaction(type: TransactionType, id?: string): TransactionInput\n```\n\nCreates an empty transaction input of the specified type.\n\n## isValid\n\n```ts\nisValid(transactionInput: TransactionInput): boolean\n```\n\nReturns whether the provided transaction input can be encoded into a meta transaction without errors and has a valid `to` address.\n\n## Types\n\nThe `TransactionInput` type captures the information for any of the four supported transaction types.\n\n```ts\ntype TransactionInput =\n  | CallContractTransactionInput\n  | TransferFundsTransactionInput\n  | TransferCollectibleTransactionInput\n  | RawTransactionInput\n```\n\nThe library's encoding functions return objects of the `MetaTransaction` type, which is a format with an ABI encoded `data` field so it is ready for execution.\n\n```ts\ninterface MetaTransaction {\n  readonly to: string\n  readonly value: string\n  readonly data: string\n  readonly operation?: OperationType\n}\n```\n\nFind the full information about all TypeScript types here: [src/types.ts](src/types.ts)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnosisguild%2Fethers-multisend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnosisguild%2Fethers-multisend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnosisguild%2Fethers-multisend/lists"}