@nevermined-io/sdk - v3.0.44 / NFTServiceAttributes
β’ new NFTServiceAttributes(): NFTServiceAttributes
β’ Optional
amount: bigint
Number of editions
src/models/NFTAttributes.ts:17
β’ Optional
duration: number
If is a subscription this means the number of blocks the subscription last. If 0 means unlimited
src/models/NFTAttributes.ts:32
β’ Optional
isSubscription: boolean
If true means the NFT works as a subscription
src/models/NFTAttributes.ts:27
β’ Optional
maxCreditsToCharge: bigint
The maximum number of credits that can be charged to the subscriber. If not specified, the subscription cost is not capped
src/models/NFTAttributes.ts:44
β’ Optional
minCreditsRequired: bigint
The minimum number of credits that the subscribers needs to hold to access the asset. If not specified, the amount defined in the service agreement or 1 credit will be required
src/models/NFTAttributes.ts:56
β’ Optional
minCreditsToCharge: bigint
The minimum number of credits that will be charged to the subscriber. If not specified, the amount defined in the service agreement or 1 credit will be charged
src/models/NFTAttributes.ts:50
β’ Optional
nftTransfer: boolean
The asset is transferred (true) or minted (false) with Nevermined contracts
src/models/NFTAttributes.ts:22
β’ Optional
tokenId: string
The tokenId of the NFT related with the Service. For example if is a NFT Access service requiring holding a NFT, this is the tokenId of the NFT
src/models/NFTAttributes.ts:38
βͺ Static
defaultValues: Object
Name | Type |
---|---|
amount |
bigint |
duration |
number |
isSubscription |
boolean |
maxCreditsToCharge |
bigint |
minCreditsRequired |
bigint |
minCreditsToCharge |
bigint |
nftTransfer |
boolean |
serviceType |
ServiceType |
tokenId |
string |
src/models/NFTAttributes.ts:58
βΈ configureServicesAttributes(nftAttributes
): Partial
<NFTAttributes
>
Given some partial nft attributes it applies some default validations and pre-configure default values
Name | Type | Description |
---|---|---|
nftAttributes |
Partial <NFTAttributes > |
partial nft attributes |
Partial
<NFTAttributes
>
nft attributes validated and configured
src/models/NFTAttributes.ts:136
βΈ getCreditsToCharge(nftAttributes
, chargeType?
, dynamicAmount?
): undefined
| bigint
Taking into account the nft attributes confifured tt returns the number of credits to be consumed
Name | Type | Default value | Description |
---|---|---|---|
nftAttributes |
NFTServiceAttributes |
undefined |
- |
chargeType |
ChargeType |
ChargeType.Fixed |
- |
dynamicAmount? |
bigint |
undefined |
the dynamic amount of credits asked to be consumed |
undefined
| bigint
amount to consume
src/models/NFTAttributes.ts:81
βΈ getDefaultNFTServiceAttributes(): Required
<NFTServiceAttributes
>
Required
<NFTServiceAttributes
>
src/models/NFTAttributes.ts:70
βΈ isCreditsBalanceEnough(nftAttributes
, creditsBalance
, dynamicAmount?
): boolean
Given some credits balance if checks if thatβs enough to access to a NFT asset
Name | Type | Description |
---|---|---|
nftAttributes |
NFTServiceAttributes |
NFT Attributes metadata |
creditsBalance |
bigint |
balance of credits |
dynamicAmount? |
bigint |
the dynamic amount of credits asked to be burned |
boolean
boolean