BBTiers
Functions
createTiers
Creates a set of tiers
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile to create the tier set in |
prices | uint256[] | The base prices of each tier |
cids | string[] | The CID's of each tier |
deprecated | bool[] | The deprecation state of each tier |
supportedCurrencies | address[] | Contract address of each supported ERC20 token |
priceMultipliers | uint256[] | Price multiplier of each supported ERC20 token |
Return Values
Name | Type | Description |
---|---|---|
tierSetId | uint256 | The ID of the created tier set |
editTiers
Set the values of a set of tiers
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile to edit the tier set in |
tierSetId | uint256 | The ID of the tier set to edit |
prices | uint256[] | New prices of each tier |
cids | string[] | New CID's of each tier |
deprecated | bool[] | New deprecated state of each tier |
setSupportedCurrencies
Set a tier sets supported ERC20 tokens for payment
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile to set the supported currencies in |
tierSetId | uint256 | Tier set ID to set the supported currencies in |
supportedCurrencies | address[] | The ERC20 tokens to support |
priceMultipliers | uint256[] | The price multiplier of each ERC20 token |
getTier
Returns an existing tier
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile that owns the tier |
tierSetId | uint256 | ID of the tier set the tier is in |
tierId | uint256 | ID of the tier to return |
currency | address | ERC20 token contract address to price the tier in |
Return Values
Name | Type | Description |
---|---|---|
cid | string | Returned CID of a tier |
price | uint256 | Returned price of a tier |
deprecated | bool | Returned deprecated state of a tier |
getTierSet
Returns an existing set of tiers
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile that owns the tier set |
tierSetId | uint256 | ID if the tier set to return |
Return Values
Name | Type | Description |
---|---|---|
prices | uint256[] | Returned base price of each tier in a tier set |
cids | string[] | Returned CID of each tier in a tier set |
deprecated | bool[] | Returned deprecated state of each tier in a tier set |
totalTiers
Returns the total number of tiers in a tier set
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile that owns the tier set |
tierSetId | uint256 | ID of the tier set to return the total number of tiers within |
Return Values
Name | Type | Description |
---|---|---|
total | uint256 | Number of total tiers in a tier set |
totalTierSets
Returns the total number of tier sets owned by a profile
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile to return the total number of tier sets |
Return Values
Name | Type | Description |
---|---|---|
total | uint256 | Number of total tier sets in a profile |
getCurrencyMultiplier
Returns the currency multiplier of ERC20 token in a tier set
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile that owns the tier set |
tierSetId | uint256 | ID of the tier set |
currency | address | ERC20 token contract address to return the currency multiplier |
Return Values
Name | Type | Description |
---|---|---|
multiplier | uint256 | Price multiplier of a ERC20 token |
isCurrencySupported
Returns true if a ERC20 token is supported by a tier set
Parameters
Name | Type | Description |
---|---|---|
profileId | uint256 | ID of the profile that owns the tier set |
tierSetId | uint256 | ID of the tier set |
currency | address | ERC20 token contract address to return if it is supported by a tier set |
Return Values
Name | Type | Description |
---|---|---|
supported | bool | Returns true if a ERC20 is supported |
Last updated