@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/protocols/index.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// src/config/contracts.ts
|
|
2
2
|
var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
3
3
|
var PLATFORM_CONFIG = {
|
|
4
|
-
// Platform fee in basis points (
|
|
5
|
-
|
|
4
|
+
// Platform fee in basis points (1000 = 10%)
|
|
5
|
+
// Zubari keeps 10%, Creator receives 90%
|
|
6
|
+
platformFeeBps: 1e3,
|
|
7
|
+
// Alias for backward compatibility
|
|
6
8
|
// Maximum royalty in basis points (1000 = 10%)
|
|
7
9
|
maxRoyaltyBps: 1e3,
|
|
8
10
|
// Voucher validity in seconds (30 days)
|
|
@@ -1889,10 +1891,11 @@ var ZubariMarketProtocol = class {
|
|
|
1889
1891
|
}
|
|
1890
1892
|
/**
|
|
1891
1893
|
* Calculate platform fee for a given price
|
|
1894
|
+
* Platform keeps 10%, Creator/Seller receives 90%
|
|
1892
1895
|
* @param price The sale price
|
|
1893
1896
|
*/
|
|
1894
1897
|
calculateFee(price) {
|
|
1895
|
-
const fee = price * BigInt(PLATFORM_CONFIG.
|
|
1898
|
+
const fee = price * BigInt(PLATFORM_CONFIG.platformFeeBps) / 10000n;
|
|
1896
1899
|
return {
|
|
1897
1900
|
fee,
|
|
1898
1901
|
sellerAmount: price - fee
|
|
@@ -2696,9 +2699,10 @@ var ZubariTipsProtocol = class {
|
|
|
2696
2699
|
/**
|
|
2697
2700
|
* Calculate platform fee for a given amount
|
|
2698
2701
|
* @param amount The tip amount
|
|
2699
|
-
* @param feeBps Fee in basis points (default:
|
|
2702
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
2703
|
+
* Platform keeps 10%, Creator receives 90%
|
|
2700
2704
|
*/
|
|
2701
|
-
calculateFee(amount, feeBps =
|
|
2705
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
2702
2706
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
2703
2707
|
return {
|
|
2704
2708
|
fee,
|
|
@@ -3907,9 +3911,10 @@ var ZubariSubscriptionProtocol = class {
|
|
|
3907
3911
|
/**
|
|
3908
3912
|
* Calculate platform fee for a given amount
|
|
3909
3913
|
* @param amount The amount
|
|
3910
|
-
* @param feeBps Fee in basis points
|
|
3914
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
3915
|
+
* Platform keeps 10%, Creator receives 90%
|
|
3911
3916
|
*/
|
|
3912
|
-
calculateFee(amount, feeBps =
|
|
3917
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
3913
3918
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
3914
3919
|
return {
|
|
3915
3920
|
fee,
|