@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
|
@@ -18,7 +18,8 @@ interface ContractAddresses {
|
|
|
18
18
|
declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
19
19
|
declare const ZUBARI_CONTRACTS: Record<'testnet' | 'mainnet', ContractAddresses>;
|
|
20
20
|
declare const PLATFORM_CONFIG: {
|
|
21
|
-
readonly
|
|
21
|
+
readonly platformFeeBps: 1000;
|
|
22
|
+
readonly tipFeeBps: 1000;
|
|
22
23
|
readonly maxRoyaltyBps: 1000;
|
|
23
24
|
readonly defaultSlippageBps: 50;
|
|
24
25
|
readonly voucherValiditySecs: number;
|
|
@@ -18,7 +18,8 @@ interface ContractAddresses {
|
|
|
18
18
|
declare const ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
19
19
|
declare const ZUBARI_CONTRACTS: Record<'testnet' | 'mainnet', ContractAddresses>;
|
|
20
20
|
declare const PLATFORM_CONFIG: {
|
|
21
|
-
readonly
|
|
21
|
+
readonly platformFeeBps: 1000;
|
|
22
|
+
readonly tipFeeBps: 1000;
|
|
22
23
|
readonly maxRoyaltyBps: 1000;
|
|
23
24
|
readonly defaultSlippageBps: 50;
|
|
24
25
|
readonly voucherValiditySecs: number;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-CRsZrlN0.mjs';
|
|
2
2
|
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-DXt6vihp.mjs';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.mjs';
|
|
4
4
|
export { ZubariMarketProtocol, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol } from './protocols/index.mjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CURRENCY_ADDRESSES, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-
|
|
1
|
+
export { C as CURRENCY_ADDRESSES, N as NFT_VOUCHER_DOMAIN, c as NFT_VOUCHER_TYPES, P as PLATFORM_CONFIG, b as ZERO_ADDRESS, a as ZUBARI_CONTRACTS, Z as ZubariWallet, g as getContractAddresses } from './index-VNzO49qu.js';
|
|
2
2
|
export { D as DERIVATION_PATHS, N as NETWORKS, T as TESTNET_NETWORKS, b as WalletManager, W as WalletManagerConfig, a as WalletState, g as getNetworkConfig } from './WalletManager-CmiNyapl.js';
|
|
3
3
|
export { M as MemoryStorageAdapter, S as SecureStorageAdapter, W as WebEncryptedStorageAdapter, c as createSecureStorage } from './SecureStorage-jO783AhC.js';
|
|
4
4
|
export { ZubariMarketProtocol, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol } from './protocols/index.js';
|
package/dist/index.js
CHANGED
|
@@ -183,8 +183,11 @@ var ZUBARI_CONTRACTS = {
|
|
|
183
183
|
}
|
|
184
184
|
};
|
|
185
185
|
var PLATFORM_CONFIG = {
|
|
186
|
-
// Platform fee in basis points (
|
|
187
|
-
|
|
186
|
+
// Platform fee in basis points (1000 = 10%)
|
|
187
|
+
// Zubari keeps 10%, Creator receives 90%
|
|
188
|
+
platformFeeBps: 1e3,
|
|
189
|
+
tipFeeBps: 1e3,
|
|
190
|
+
// Alias for backward compatibility
|
|
188
191
|
// Maximum royalty in basis points (1000 = 10%)
|
|
189
192
|
maxRoyaltyBps: 1e3,
|
|
190
193
|
// Default slippage tolerance for swaps (50 = 0.5%)
|
|
@@ -4421,10 +4424,11 @@ var ZubariMarketProtocol = class {
|
|
|
4421
4424
|
}
|
|
4422
4425
|
/**
|
|
4423
4426
|
* Calculate platform fee for a given price
|
|
4427
|
+
* Platform keeps 10%, Creator/Seller receives 90%
|
|
4424
4428
|
* @param price The sale price
|
|
4425
4429
|
*/
|
|
4426
4430
|
calculateFee(price) {
|
|
4427
|
-
const fee = price * BigInt(PLATFORM_CONFIG.
|
|
4431
|
+
const fee = price * BigInt(PLATFORM_CONFIG.platformFeeBps) / 10000n;
|
|
4428
4432
|
return {
|
|
4429
4433
|
fee,
|
|
4430
4434
|
sellerAmount: price - fee
|
|
@@ -5228,9 +5232,10 @@ var ZubariTipsProtocol = class {
|
|
|
5228
5232
|
/**
|
|
5229
5233
|
* Calculate platform fee for a given amount
|
|
5230
5234
|
* @param amount The tip amount
|
|
5231
|
-
* @param feeBps Fee in basis points (default:
|
|
5235
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
5236
|
+
* Platform keeps 10%, Creator receives 90%
|
|
5232
5237
|
*/
|
|
5233
|
-
calculateFee(amount, feeBps =
|
|
5238
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
5234
5239
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
5235
5240
|
return {
|
|
5236
5241
|
fee,
|
|
@@ -6439,9 +6444,10 @@ var ZubariSubscriptionProtocol = class {
|
|
|
6439
6444
|
/**
|
|
6440
6445
|
* Calculate platform fee for a given amount
|
|
6441
6446
|
* @param amount The amount
|
|
6442
|
-
* @param feeBps Fee in basis points
|
|
6447
|
+
* @param feeBps Fee in basis points (default: 1000 = 10%)
|
|
6448
|
+
* Platform keeps 10%, Creator receives 90%
|
|
6443
6449
|
*/
|
|
6444
|
-
calculateFee(amount, feeBps =
|
|
6450
|
+
calculateFee(amount, feeBps = 1e3) {
|
|
6445
6451
|
const fee = amount * BigInt(feeBps) / 10000n;
|
|
6446
6452
|
return {
|
|
6447
6453
|
fee,
|