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(struct BosonTypes.Bundle _bundle)
- getBundle(uint256 _bundleId)
- getNextBundleId()
- getBundleIdByOffer(uint256 _offerId)
- getBundleIdByTwin(uint256 _twinId)
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
Name | Type | Description |
---|---|---|
_bundle | BosonTypes.Bundle | the 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
Name | Type | Description |
---|---|---|
_bundleId | uint256 | the id of the bundle to check |
Returns
Name | Type | Description |
---|---|---|
exists | bool | the bundle was found |
bundle | BosonTypes.Bundle | the bundle details. See {BosonTypes.Bundle} |
getNextBundleId
Gets the next bundle id.Does not increment the counter.
function getNextBundleId()
external
view
returns(uint256 nextBundleId)
Returns
Name | Type | Description |
---|---|---|
nextBundleId | uint256 | the 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
Name | Type | Description |
---|---|---|
_offerId | uint256 | the offer id. |
Returns
Name | Type | Description |
---|---|---|
exists | bool | whether the bundle id exists |
bundleId | uint256 | the bundle id. |
getBundleIdByTwin
Gets the bundle id for a given twin id.
function getBundleIdByTwin(uint256 _twinId)
external
view
returns(bool exists, uint256 bundleId)
Arguments
Name | Type | Description |
---|---|---|
_twinId | uint256 | the twin id. |
Returns
Name | Type | Description |
---|---|---|
exists | bool | whether the bundle id exist |
bundleId | uint256 | the bundle id. |