@zubari/sdk 0.2.0 → 0.2.2

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.
@@ -100,7 +100,8 @@ var ZubariNFTProtocol = class {
100
100
  */
101
101
  async createLazyMintVoucher(params, signer) {
102
102
  const { metadata, creatorAddress, price, currency, nonce, watermarking } = params;
103
- if (metadata.royaltyBps > PLATFORM_CONFIG.maxRoyaltyBps) {
103
+ const royaltyBps = metadata.royaltyBps ?? 500;
104
+ if (royaltyBps > PLATFORM_CONFIG.maxRoyaltyBps) {
104
105
  throw new Error(`Royalty cannot exceed ${PLATFORM_CONFIG.maxRoyaltyBps / 100}%`);
105
106
  }
106
107
  if (!price || parseFloat(price) <= 0) {
@@ -120,7 +121,8 @@ var ZubariNFTProtocol = class {
120
121
  uri: metadata.image,
121
122
  // Will be IPFS URI
122
123
  creator: creatorAddress,
123
- royaltyBps: metadata.royaltyBps,
124
+ royaltyBps,
125
+ // Use the validated/defaulted value
124
126
  deadline,
125
127
  price: priceInWei,
126
128
  currency: currencyAddress,
@@ -140,7 +142,8 @@ var ZubariNFTProtocol = class {
140
142
  tokenId,
141
143
  uri: metadata.image,
142
144
  creator: creatorAddress,
143
- royaltyBps: metadata.royaltyBps,
145
+ royaltyBps,
146
+ // Use the validated/defaulted value
144
147
  deadline,
145
148
  signature,
146
149
  price: priceInWei,