@zubari/sdk 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -98,7 +98,8 @@ var ZubariNFTProtocol = class {
98
98
  */
99
99
  async createLazyMintVoucher(params, signer) {
100
100
  const { metadata, creatorAddress, price, currency, nonce, watermarking } = params;
101
- if (metadata.royaltyBps > PLATFORM_CONFIG.maxRoyaltyBps) {
101
+ const royaltyBps = metadata.royaltyBps ?? 500;
102
+ if (royaltyBps > PLATFORM_CONFIG.maxRoyaltyBps) {
102
103
  throw new Error(`Royalty cannot exceed ${PLATFORM_CONFIG.maxRoyaltyBps / 100}%`);
103
104
  }
104
105
  if (!price || parseFloat(price) <= 0) {
@@ -118,7 +119,8 @@ var ZubariNFTProtocol = class {
118
119
  uri: metadata.image,
119
120
  // Will be IPFS URI
120
121
  creator: creatorAddress,
121
- royaltyBps: metadata.royaltyBps,
122
+ royaltyBps,
123
+ // Use the validated/defaulted value
122
124
  deadline,
123
125
  price: priceInWei,
124
126
  currency: currencyAddress,
@@ -138,7 +140,8 @@ var ZubariNFTProtocol = class {
138
140
  tokenId,
139
141
  uri: metadata.image,
140
142
  creator: creatorAddress,
141
- royaltyBps: metadata.royaltyBps,
143
+ royaltyBps,
144
+ // Use the validated/defaulted value
142
145
  deadline,
143
146
  signature,
144
147
  price: priceInWei,