• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ProjectOpenSea / opensea-js / 18511779834

14 Oct 2025 10:25PM UTC coverage: 49.322% (-0.03%) from 49.356%
18511779834

push

github

web-flow
feat: add bulkTransfer for efficient bulk asset transfers (#1778)

* feat: add bulkTransfer for efficient bulk asset transfers

Add bulkTransfer() method using OpenSea's TransferHelper contract:
- Enables gas-efficient bulk transfer of multiple assets (ERC20, ERC721, ERC1155)
- Supports transfers to different recipients for each asset
- Requires prior approval to OpenSea's conduit (OPENSEA_CONDUIT_KEY_2)
- Uses TransferHelper contract at 0x000000000

Files added:
- TransferHelper ABI (src/abi/TransferHelper.json)
- Unit tests for validation and error cases

Addresses #1312

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: add approval checking to bulkTransfer method

- Add _checkAssetApproval() helper method to verify approvals before transfer
- Check ERC20 allowance, ERC721 approval (isApprovedForAll or getApproved), and ERC1155 isApprovedForAll
- Throw helpful error with list of unapproved assets and instructions for approval
- Add test case for approval error handling
- Fail fast before wasting gas on transaction that will revert

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Add batch approval method for efficient multi-asset approvals

- Add Multicall3 contract integration for batching approvals
- Create batchApproveAssets() method that efficiently handles approvals:
  - Returns early if no approvals needed
  - Sends single transaction for 1 approval
  - Uses Multicall3 to batch 2+ approvals
- Add utility methods for contract initialization:
  - _getTransferHelperContract()
  - _getMulticall3Contract()
- Update bulkTransfer() error message to reference batchApproveAssets()
- Add constants for MULTICALL3_ADDRESS and TRANSFER_HELPER_ADDRESS
- Add Multicall3.json ABI file
- Add unit tests for batchApproveAssets()

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Au... (continued)

140 of 458 branches covered (30.57%)

Branch coverage included in aggregate %.

90 of 181 new or added lines in 5 files covered. (49.72%)

733 of 1312 relevant lines covered (55.87%)

1.93 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.99
/src/utils/utils.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc