Skip to main content

IBosonBundleHandler

View Source: contracts/interfaces/handlers/IBosonBundleHandler.sol

↗ Extends: IBosonBundleEvents

IBosonBundleHandler

Handles bundling of offers and twins within the protocol
The ERC-165 identifier for this interface is: 0x7b53dece

Functions

createBundle

Creates a Bundle.
Emits a BundleCreated event if successful.
Reverts if:
- The bundles region of protocol is paused
- Seller does not exist
- Either offerIds member or twinIds member is empty
- Any of the offers belongs to different seller
- Any of the offers does not exist
- Offer exists in a different bundle
- Any of the twins belongs to different seller
- Any of the twins does not exist
- Duplicate twins added in same bundle
- Exchange already exists for the offer id in bundle
- Offers' total quantity is greater than twin supply when token is nonfungible
- Offers' total quantity multiplied by twin amount is greater than twin supply when token is fungible or multitoken

function createBundle(struct BosonTypes.Bundle _bundle) 
external

Arguments

NameTypeDescription
_bundleBosonTypes.Bundlethe fully populated struct with bundle id set to 0x0

getBundle

Gets the details about a given bundle.

function getBundle(uint256 _bundleId) 
external
view
returns(bool exists, BosonTypes.Bundle memory bundle)

Arguments

NameTypeDescription
_bundleIduint256the id of the bundle to check

Returns

NameTypeDescription
existsboolthe bundle was found
bundleBosonTypes.Bundlethe bundle details. See {BosonTypes.Bundle}

getNextBundleId

Gets the next bundle id.Does not increment the counter.

function getNextBundleId() 
external
view
returns(uint256 nextBundleId)

Returns

NameTypeDescription
nextBundleIduint256the next bundle id

getBundleIdByOffer

Gets the bundle id for a given offer id.

function getBundleIdByOffer(uint256 _offerId) 
external
view
returns(bool exists, uint256 bundleId)

Arguments

NameTypeDescription
_offerIduint256the offer id.

Returns

NameTypeDescription
existsboolwhether the bundle id exists
bundleIduint256the bundle id.

getBundleIdByTwin

Gets the bundle id for a given twin id.

function getBundleIdByTwin(uint256 _twinId) 
external
view
returns(bool exists, uint256 bundleId)

Arguments

NameTypeDescription
_twinIduint256the twin id.

Returns

NameTypeDescription
existsboolwhether the bundle id exist
bundleIduint256the bundle id.