@zubari/sdk 0.3.3 → 0.3.4
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.
- package/dist/{index-DwC0brJU.d.mts → index-CRsZrlN0.d.mts} +2 -1
- package/dist/{index-CGsF4p5I.d.ts → index-VNzO49qu.d.ts} +2 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -7
- package/dist/index.mjs.map +1 -1
- package/dist/protocols/index.d.mts +5 -2
- package/dist/protocols/index.d.ts +5 -2
- package/dist/protocols/index.js +12 -7
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/index.mjs +12 -7
- package/dist/protocols/index.mjs.map +1 -1
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +1 -1
- package/dist/wallet/index.d.ts +1 -1
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -181,8 +181,11 @@ var ZUBARI_CONTRACTS = {
|
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
183
|
var PLATFORM_CONFIG = {
|
|
184
|
-
// Platform fee in basis points (
|
|
185
|
-
|
|
184
|
+
// Platform fee in basis points (1000 = 10%)
|
|
185
|
+
// Zubari keeps 10%, Creator receives 90%
|
|
186
|
+
platformFeeBps: 1e3,
|
|
187
|
+
tipFeeBps: 1e3,
|
|
188
|
+
// Alias for backward compatibility
|
|
186
189
|
// Maximum royalty in basis points (1000 = 10%)
|
|
187
190
|
maxRoyaltyBps: 1e3,
|
|
188
191
|
// Default slippage tolerance for swaps (50 = 0.5%)
|
|
@@ -4419,10 +4422,11 @@ var ZubariMarketProtocol = class {
|
|
|
4419
4422
|
}
|
|
4420
4423
|
/**
|
|
4421
4424
|
* Calculate platform fee for a given price
|
|
4425
|
+
* Platform keeps 10%, Creator/Seller receives 90%
|
|
4422
4426
|
* @param price The sale price
|
|
4423
4427
|
*/
|
|
4424
4428
|
calculateFee(price) {
|
|
4425
|
-
const fee = price * BigInt(PLATFORM_CONFIG.
|
|
4429
|
+
const fee = price * BigInt(PLATFORM_CONFIG.platformFeeBps) / 10000n;
|
|
4426
4430
|
return {
|
|
4427
4431
|
fee,
|
|
4428
4432
|
sellerAmount: price - fee
|
|
@@ -5226,9 +5230,10 @@ var ZubariTipsProtocol = class {
|
|
|
5226
5230
|
/**
|
|
5227
5231
|
* Calculate platform fee for a given amount
|
|
5228
5232
|
* @param amount The tip amount
|
|
5229
|
-
* @param feeBps Fee in basis points (default:
|
|
5233
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
5234
|
+
* Platform keeps 10%, Creator receives 90%
|
|
5230
5235
|
*/
|
|
5231
|
-
calculateFee(amount, feeBps =
|
|
5236
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
5232
5237
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
5233
5238
|
return {
|
|
5234
5239
|
fee,
|
|
@@ -6437,9 +6442,10 @@ var ZubariSubscriptionProtocol = class {
|
|
|
6437
6442
|
/**
|
|
6438
6443
|
* Calculate platform fee for a given amount
|
|
6439
6444
|
* @param amount The amount
|
|
6440
|
-
* @param feeBps Fee in basis points
|
|
6445
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
6446
|
+
* Platform keeps 10%, Creator receives 90%
|
|
6441
6447
|
*/
|
|
6442
|
-
calculateFee(amount, feeBps =
|
|
6448
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
6443
6449
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
6444
6450
|
return {
|
|
6445
6451
|
fee,
|