@zubari/sdk 0.1.27 → 0.1.29

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.mjs CHANGED
@@ -2404,6 +2404,894 @@ var ZubariNFTProtocol = class {
2404
2404
  }
2405
2405
  };
2406
2406
 
2407
+ // src/abi/ZubariMarket.json
2408
+ var ZubariMarket_default = [
2409
+ {
2410
+ inputs: [
2411
+ {
2412
+ internalType: "address",
2413
+ name: "_treasury",
2414
+ type: "address"
2415
+ },
2416
+ {
2417
+ internalType: "uint256",
2418
+ name: "_platformFeeBps",
2419
+ type: "uint256"
2420
+ }
2421
+ ],
2422
+ stateMutability: "nonpayable",
2423
+ type: "constructor"
2424
+ },
2425
+ {
2426
+ inputs: [],
2427
+ name: "EnforcedPause",
2428
+ type: "error"
2429
+ },
2430
+ {
2431
+ inputs: [],
2432
+ name: "ExpectedPause",
2433
+ type: "error"
2434
+ },
2435
+ {
2436
+ inputs: [],
2437
+ name: "InsufficientPayment",
2438
+ type: "error"
2439
+ },
2440
+ {
2441
+ inputs: [],
2442
+ name: "InvalidAddress",
2443
+ type: "error"
2444
+ },
2445
+ {
2446
+ inputs: [],
2447
+ name: "InvalidDuration",
2448
+ type: "error"
2449
+ },
2450
+ {
2451
+ inputs: [],
2452
+ name: "InvalidFee",
2453
+ type: "error"
2454
+ },
2455
+ {
2456
+ inputs: [],
2457
+ name: "InvalidPrice",
2458
+ type: "error"
2459
+ },
2460
+ {
2461
+ inputs: [],
2462
+ name: "ListingExpired",
2463
+ type: "error"
2464
+ },
2465
+ {
2466
+ inputs: [],
2467
+ name: "ListingNotActive",
2468
+ type: "error"
2469
+ },
2470
+ {
2471
+ inputs: [],
2472
+ name: "NotApproved",
2473
+ type: "error"
2474
+ },
2475
+ {
2476
+ inputs: [],
2477
+ name: "NotSeller",
2478
+ type: "error"
2479
+ },
2480
+ {
2481
+ inputs: [],
2482
+ name: "NotTokenOwner",
2483
+ type: "error"
2484
+ },
2485
+ {
2486
+ inputs: [
2487
+ {
2488
+ internalType: "address",
2489
+ name: "owner",
2490
+ type: "address"
2491
+ }
2492
+ ],
2493
+ name: "OwnableInvalidOwner",
2494
+ type: "error"
2495
+ },
2496
+ {
2497
+ inputs: [
2498
+ {
2499
+ internalType: "address",
2500
+ name: "account",
2501
+ type: "address"
2502
+ }
2503
+ ],
2504
+ name: "OwnableUnauthorizedAccount",
2505
+ type: "error"
2506
+ },
2507
+ {
2508
+ inputs: [],
2509
+ name: "ReentrancyGuardReentrantCall",
2510
+ type: "error"
2511
+ },
2512
+ {
2513
+ inputs: [
2514
+ {
2515
+ internalType: "address",
2516
+ name: "token",
2517
+ type: "address"
2518
+ }
2519
+ ],
2520
+ name: "SafeERC20FailedOperation",
2521
+ type: "error"
2522
+ },
2523
+ {
2524
+ inputs: [],
2525
+ name: "TransferFailed",
2526
+ type: "error"
2527
+ },
2528
+ {
2529
+ inputs: [],
2530
+ name: "UnsupportedPaymentToken",
2531
+ type: "error"
2532
+ },
2533
+ {
2534
+ anonymous: false,
2535
+ inputs: [
2536
+ {
2537
+ indexed: true,
2538
+ internalType: "uint256",
2539
+ name: "listingId",
2540
+ type: "uint256"
2541
+ },
2542
+ {
2543
+ indexed: true,
2544
+ internalType: "address",
2545
+ name: "nftContract",
2546
+ type: "address"
2547
+ },
2548
+ {
2549
+ indexed: true,
2550
+ internalType: "uint256",
2551
+ name: "tokenId",
2552
+ type: "uint256"
2553
+ },
2554
+ {
2555
+ indexed: false,
2556
+ internalType: "address",
2557
+ name: "seller",
2558
+ type: "address"
2559
+ },
2560
+ {
2561
+ indexed: false,
2562
+ internalType: "uint256",
2563
+ name: "price",
2564
+ type: "uint256"
2565
+ },
2566
+ {
2567
+ indexed: false,
2568
+ internalType: "address",
2569
+ name: "paymentToken",
2570
+ type: "address"
2571
+ },
2572
+ {
2573
+ indexed: false,
2574
+ internalType: "uint256",
2575
+ name: "expiresAt",
2576
+ type: "uint256"
2577
+ }
2578
+ ],
2579
+ name: "Listed",
2580
+ type: "event"
2581
+ },
2582
+ {
2583
+ anonymous: false,
2584
+ inputs: [
2585
+ {
2586
+ indexed: true,
2587
+ internalType: "uint256",
2588
+ name: "listingId",
2589
+ type: "uint256"
2590
+ }
2591
+ ],
2592
+ name: "ListingCancelled",
2593
+ type: "event"
2594
+ },
2595
+ {
2596
+ anonymous: false,
2597
+ inputs: [
2598
+ {
2599
+ indexed: true,
2600
+ internalType: "uint256",
2601
+ name: "listingId",
2602
+ type: "uint256"
2603
+ },
2604
+ {
2605
+ indexed: false,
2606
+ internalType: "uint256",
2607
+ name: "newPrice",
2608
+ type: "uint256"
2609
+ }
2610
+ ],
2611
+ name: "ListingUpdated",
2612
+ type: "event"
2613
+ },
2614
+ {
2615
+ anonymous: false,
2616
+ inputs: [
2617
+ {
2618
+ indexed: true,
2619
+ internalType: "address",
2620
+ name: "previousOwner",
2621
+ type: "address"
2622
+ },
2623
+ {
2624
+ indexed: true,
2625
+ internalType: "address",
2626
+ name: "newOwner",
2627
+ type: "address"
2628
+ }
2629
+ ],
2630
+ name: "OwnershipTransferred",
2631
+ type: "event"
2632
+ },
2633
+ {
2634
+ anonymous: false,
2635
+ inputs: [
2636
+ {
2637
+ indexed: false,
2638
+ internalType: "address",
2639
+ name: "account",
2640
+ type: "address"
2641
+ }
2642
+ ],
2643
+ name: "Paused",
2644
+ type: "event"
2645
+ },
2646
+ {
2647
+ anonymous: false,
2648
+ inputs: [
2649
+ {
2650
+ indexed: true,
2651
+ internalType: "address",
2652
+ name: "token",
2653
+ type: "address"
2654
+ },
2655
+ {
2656
+ indexed: false,
2657
+ internalType: "bool",
2658
+ name: "supported",
2659
+ type: "bool"
2660
+ }
2661
+ ],
2662
+ name: "PaymentTokenUpdated",
2663
+ type: "event"
2664
+ },
2665
+ {
2666
+ anonymous: false,
2667
+ inputs: [
2668
+ {
2669
+ indexed: true,
2670
+ internalType: "uint256",
2671
+ name: "listingId",
2672
+ type: "uint256"
2673
+ },
2674
+ {
2675
+ indexed: true,
2676
+ internalType: "address",
2677
+ name: "buyer",
2678
+ type: "address"
2679
+ },
2680
+ {
2681
+ indexed: false,
2682
+ internalType: "uint256",
2683
+ name: "price",
2684
+ type: "uint256"
2685
+ },
2686
+ {
2687
+ indexed: false,
2688
+ internalType: "uint256",
2689
+ name: "royaltyAmount",
2690
+ type: "uint256"
2691
+ },
2692
+ {
2693
+ indexed: false,
2694
+ internalType: "uint256",
2695
+ name: "platformFee",
2696
+ type: "uint256"
2697
+ }
2698
+ ],
2699
+ name: "Sale",
2700
+ type: "event"
2701
+ },
2702
+ {
2703
+ anonymous: false,
2704
+ inputs: [
2705
+ {
2706
+ indexed: false,
2707
+ internalType: "address",
2708
+ name: "account",
2709
+ type: "address"
2710
+ }
2711
+ ],
2712
+ name: "Unpaused",
2713
+ type: "event"
2714
+ },
2715
+ {
2716
+ inputs: [
2717
+ {
2718
+ internalType: "uint256",
2719
+ name: "listingId",
2720
+ type: "uint256"
2721
+ }
2722
+ ],
2723
+ name: "buyItem",
2724
+ outputs: [],
2725
+ stateMutability: "payable",
2726
+ type: "function"
2727
+ },
2728
+ {
2729
+ inputs: [
2730
+ {
2731
+ internalType: "uint256",
2732
+ name: "listingId",
2733
+ type: "uint256"
2734
+ }
2735
+ ],
2736
+ name: "cancelListing",
2737
+ outputs: [],
2738
+ stateMutability: "nonpayable",
2739
+ type: "function"
2740
+ },
2741
+ {
2742
+ inputs: [
2743
+ {
2744
+ internalType: "uint256",
2745
+ name: "listingId",
2746
+ type: "uint256"
2747
+ }
2748
+ ],
2749
+ name: "getListing",
2750
+ outputs: [
2751
+ {
2752
+ components: [
2753
+ {
2754
+ internalType: "uint256",
2755
+ name: "listingId",
2756
+ type: "uint256"
2757
+ },
2758
+ {
2759
+ internalType: "address",
2760
+ name: "nftContract",
2761
+ type: "address"
2762
+ },
2763
+ {
2764
+ internalType: "uint256",
2765
+ name: "tokenId",
2766
+ type: "uint256"
2767
+ },
2768
+ {
2769
+ internalType: "address",
2770
+ name: "seller",
2771
+ type: "address"
2772
+ },
2773
+ {
2774
+ internalType: "uint256",
2775
+ name: "price",
2776
+ type: "uint256"
2777
+ },
2778
+ {
2779
+ internalType: "address",
2780
+ name: "paymentToken",
2781
+ type: "address"
2782
+ },
2783
+ {
2784
+ internalType: "uint256",
2785
+ name: "expiresAt",
2786
+ type: "uint256"
2787
+ },
2788
+ {
2789
+ internalType: "bool",
2790
+ name: "isActive",
2791
+ type: "bool"
2792
+ }
2793
+ ],
2794
+ internalType: "struct ZubariMarket.Listing",
2795
+ name: "",
2796
+ type: "tuple"
2797
+ }
2798
+ ],
2799
+ stateMutability: "view",
2800
+ type: "function"
2801
+ },
2802
+ {
2803
+ inputs: [
2804
+ {
2805
+ internalType: "uint256",
2806
+ name: "listingId",
2807
+ type: "uint256"
2808
+ }
2809
+ ],
2810
+ name: "isListingValid",
2811
+ outputs: [
2812
+ {
2813
+ internalType: "bool",
2814
+ name: "",
2815
+ type: "bool"
2816
+ }
2817
+ ],
2818
+ stateMutability: "view",
2819
+ type: "function"
2820
+ },
2821
+ {
2822
+ inputs: [
2823
+ {
2824
+ internalType: "address",
2825
+ name: "nftContract",
2826
+ type: "address"
2827
+ },
2828
+ {
2829
+ internalType: "uint256",
2830
+ name: "tokenId",
2831
+ type: "uint256"
2832
+ },
2833
+ {
2834
+ internalType: "uint256",
2835
+ name: "price",
2836
+ type: "uint256"
2837
+ },
2838
+ {
2839
+ internalType: "address",
2840
+ name: "paymentToken",
2841
+ type: "address"
2842
+ },
2843
+ {
2844
+ internalType: "uint256",
2845
+ name: "duration",
2846
+ type: "uint256"
2847
+ }
2848
+ ],
2849
+ name: "listItem",
2850
+ outputs: [
2851
+ {
2852
+ internalType: "uint256",
2853
+ name: "",
2854
+ type: "uint256"
2855
+ }
2856
+ ],
2857
+ stateMutability: "nonpayable",
2858
+ type: "function"
2859
+ },
2860
+ {
2861
+ inputs: [],
2862
+ name: "listingCounter",
2863
+ outputs: [
2864
+ {
2865
+ internalType: "uint256",
2866
+ name: "",
2867
+ type: "uint256"
2868
+ }
2869
+ ],
2870
+ stateMutability: "view",
2871
+ type: "function"
2872
+ },
2873
+ {
2874
+ inputs: [
2875
+ {
2876
+ internalType: "uint256",
2877
+ name: "",
2878
+ type: "uint256"
2879
+ }
2880
+ ],
2881
+ name: "listings",
2882
+ outputs: [
2883
+ {
2884
+ internalType: "uint256",
2885
+ name: "listingId",
2886
+ type: "uint256"
2887
+ },
2888
+ {
2889
+ internalType: "address",
2890
+ name: "nftContract",
2891
+ type: "address"
2892
+ },
2893
+ {
2894
+ internalType: "uint256",
2895
+ name: "tokenId",
2896
+ type: "uint256"
2897
+ },
2898
+ {
2899
+ internalType: "address",
2900
+ name: "seller",
2901
+ type: "address"
2902
+ },
2903
+ {
2904
+ internalType: "uint256",
2905
+ name: "price",
2906
+ type: "uint256"
2907
+ },
2908
+ {
2909
+ internalType: "address",
2910
+ name: "paymentToken",
2911
+ type: "address"
2912
+ },
2913
+ {
2914
+ internalType: "uint256",
2915
+ name: "expiresAt",
2916
+ type: "uint256"
2917
+ },
2918
+ {
2919
+ internalType: "bool",
2920
+ name: "isActive",
2921
+ type: "bool"
2922
+ }
2923
+ ],
2924
+ stateMutability: "view",
2925
+ type: "function"
2926
+ },
2927
+ {
2928
+ inputs: [],
2929
+ name: "owner",
2930
+ outputs: [
2931
+ {
2932
+ internalType: "address",
2933
+ name: "",
2934
+ type: "address"
2935
+ }
2936
+ ],
2937
+ stateMutability: "view",
2938
+ type: "function"
2939
+ },
2940
+ {
2941
+ inputs: [],
2942
+ name: "pause",
2943
+ outputs: [],
2944
+ stateMutability: "nonpayable",
2945
+ type: "function"
2946
+ },
2947
+ {
2948
+ inputs: [],
2949
+ name: "paused",
2950
+ outputs: [
2951
+ {
2952
+ internalType: "bool",
2953
+ name: "",
2954
+ type: "bool"
2955
+ }
2956
+ ],
2957
+ stateMutability: "view",
2958
+ type: "function"
2959
+ },
2960
+ {
2961
+ inputs: [],
2962
+ name: "platformFeeBps",
2963
+ outputs: [
2964
+ {
2965
+ internalType: "uint256",
2966
+ name: "",
2967
+ type: "uint256"
2968
+ }
2969
+ ],
2970
+ stateMutability: "view",
2971
+ type: "function"
2972
+ },
2973
+ {
2974
+ inputs: [],
2975
+ name: "renounceOwnership",
2976
+ outputs: [],
2977
+ stateMutability: "nonpayable",
2978
+ type: "function"
2979
+ },
2980
+ {
2981
+ inputs: [
2982
+ {
2983
+ internalType: "uint256",
2984
+ name: "_feeBps",
2985
+ type: "uint256"
2986
+ }
2987
+ ],
2988
+ name: "setPlatformFee",
2989
+ outputs: [],
2990
+ stateMutability: "nonpayable",
2991
+ type: "function"
2992
+ },
2993
+ {
2994
+ inputs: [
2995
+ {
2996
+ internalType: "address",
2997
+ name: "token",
2998
+ type: "address"
2999
+ },
3000
+ {
3001
+ internalType: "bool",
3002
+ name: "supported",
3003
+ type: "bool"
3004
+ }
3005
+ ],
3006
+ name: "setSupportedToken",
3007
+ outputs: [],
3008
+ stateMutability: "nonpayable",
3009
+ type: "function"
3010
+ },
3011
+ {
3012
+ inputs: [
3013
+ {
3014
+ internalType: "address",
3015
+ name: "_treasury",
3016
+ type: "address"
3017
+ }
3018
+ ],
3019
+ name: "setTreasury",
3020
+ outputs: [],
3021
+ stateMutability: "nonpayable",
3022
+ type: "function"
3023
+ },
3024
+ {
3025
+ inputs: [
3026
+ {
3027
+ internalType: "address",
3028
+ name: "",
3029
+ type: "address"
3030
+ }
3031
+ ],
3032
+ name: "supportedTokens",
3033
+ outputs: [
3034
+ {
3035
+ internalType: "bool",
3036
+ name: "",
3037
+ type: "bool"
3038
+ }
3039
+ ],
3040
+ stateMutability: "view",
3041
+ type: "function"
3042
+ },
3043
+ {
3044
+ inputs: [
3045
+ {
3046
+ internalType: "address",
3047
+ name: "",
3048
+ type: "address"
3049
+ },
3050
+ {
3051
+ internalType: "uint256",
3052
+ name: "",
3053
+ type: "uint256"
3054
+ }
3055
+ ],
3056
+ name: "tokenListings",
3057
+ outputs: [
3058
+ {
3059
+ internalType: "uint256",
3060
+ name: "",
3061
+ type: "uint256"
3062
+ }
3063
+ ],
3064
+ stateMutability: "view",
3065
+ type: "function"
3066
+ },
3067
+ {
3068
+ inputs: [
3069
+ {
3070
+ internalType: "address",
3071
+ name: "newOwner",
3072
+ type: "address"
3073
+ }
3074
+ ],
3075
+ name: "transferOwnership",
3076
+ outputs: [],
3077
+ stateMutability: "nonpayable",
3078
+ type: "function"
3079
+ },
3080
+ {
3081
+ inputs: [],
3082
+ name: "treasury",
3083
+ outputs: [
3084
+ {
3085
+ internalType: "address",
3086
+ name: "",
3087
+ type: "address"
3088
+ }
3089
+ ],
3090
+ stateMutability: "view",
3091
+ type: "function"
3092
+ },
3093
+ {
3094
+ inputs: [],
3095
+ name: "unpause",
3096
+ outputs: [],
3097
+ stateMutability: "nonpayable",
3098
+ type: "function"
3099
+ },
3100
+ {
3101
+ inputs: [
3102
+ {
3103
+ internalType: "uint256",
3104
+ name: "listingId",
3105
+ type: "uint256"
3106
+ },
3107
+ {
3108
+ internalType: "uint256",
3109
+ name: "newPrice",
3110
+ type: "uint256"
3111
+ }
3112
+ ],
3113
+ name: "updatePrice",
3114
+ outputs: [],
3115
+ stateMutability: "nonpayable",
3116
+ type: "function"
3117
+ }
3118
+ ];
3119
+
3120
+ // src/protocols/MarketProtocol.ts
3121
+ var ZubariMarketProtocol = class {
3122
+ contractAddress;
3123
+ chainId;
3124
+ abi = ZubariMarket_default;
3125
+ constructor(contractAddress, chainId) {
3126
+ this.contractAddress = contractAddress;
3127
+ this.chainId = chainId;
3128
+ }
3129
+ /**
3130
+ * Get the contract ABI
3131
+ */
3132
+ getAbi() {
3133
+ return this.abi;
3134
+ }
3135
+ /**
3136
+ * Get the contract address
3137
+ */
3138
+ getAddress() {
3139
+ return this.contractAddress;
3140
+ }
3141
+ /**
3142
+ * List an NFT for sale
3143
+ * @param params Listing parameters
3144
+ * @param signer Wallet signer with sendTransaction method
3145
+ */
3146
+ async listItem(params, signer) {
3147
+ if (params.price <= 0n) {
3148
+ throw new Error("Price must be greater than 0");
3149
+ }
3150
+ if (params.duration <= 0) {
3151
+ throw new Error("Duration must be greater than 0");
3152
+ }
3153
+ const iface = new (await import('ethers')).Interface(this.abi);
3154
+ const data = iface.encodeFunctionData("listItem", [
3155
+ params.nftContract,
3156
+ params.tokenId,
3157
+ params.price,
3158
+ params.paymentToken,
3159
+ params.duration
3160
+ ]);
3161
+ const result = await signer.sendTransaction({
3162
+ to: this.contractAddress,
3163
+ value: 0n,
3164
+ data
3165
+ });
3166
+ return {
3167
+ hash: result.hash,
3168
+ network: "ethereum",
3169
+ status: "pending"
3170
+ };
3171
+ }
3172
+ /**
3173
+ * Buy an NFT from a listing
3174
+ * @param params Buy parameters
3175
+ * @param signer Wallet signer
3176
+ */
3177
+ async buyItem(params, signer) {
3178
+ const iface = new (await import('ethers')).Interface(this.abi);
3179
+ const data = iface.encodeFunctionData("buyItem", [params.listingId]);
3180
+ const isEthPayment = params.paymentToken === "0x0000000000000000000000000000000000000000";
3181
+ const result = await signer.sendTransaction({
3182
+ to: this.contractAddress,
3183
+ value: isEthPayment ? params.price : 0n,
3184
+ data
3185
+ });
3186
+ return {
3187
+ hash: result.hash,
3188
+ network: "ethereum",
3189
+ status: "pending"
3190
+ };
3191
+ }
3192
+ /**
3193
+ * Cancel a listing
3194
+ * @param listingId The listing ID to cancel
3195
+ * @param signer Wallet signer
3196
+ */
3197
+ async cancelListing(listingId, signer) {
3198
+ const iface = new (await import('ethers')).Interface(this.abi);
3199
+ const data = iface.encodeFunctionData("cancelListing", [listingId]);
3200
+ const result = await signer.sendTransaction({
3201
+ to: this.contractAddress,
3202
+ value: 0n,
3203
+ data
3204
+ });
3205
+ return {
3206
+ hash: result.hash,
3207
+ network: "ethereum",
3208
+ status: "pending"
3209
+ };
3210
+ }
3211
+ /**
3212
+ * Update listing price
3213
+ * @param listingId The listing ID
3214
+ * @param newPrice New price
3215
+ * @param signer Wallet signer
3216
+ */
3217
+ async updatePrice(listingId, newPrice, signer) {
3218
+ if (newPrice <= 0n) {
3219
+ throw new Error("Price must be greater than 0");
3220
+ }
3221
+ const iface = new (await import('ethers')).Interface(this.abi);
3222
+ const data = iface.encodeFunctionData("updatePrice", [listingId, newPrice]);
3223
+ const result = await signer.sendTransaction({
3224
+ to: this.contractAddress,
3225
+ value: 0n,
3226
+ data
3227
+ });
3228
+ return {
3229
+ hash: result.hash,
3230
+ network: "ethereum",
3231
+ status: "pending"
3232
+ };
3233
+ }
3234
+ /**
3235
+ * Get listing details
3236
+ * @param listingId The listing ID
3237
+ * @param provider JSON-RPC provider
3238
+ */
3239
+ async getListing(listingId, provider) {
3240
+ const iface = new (await import('ethers')).Interface(this.abi);
3241
+ const data = iface.encodeFunctionData("getListing", [listingId]);
3242
+ try {
3243
+ const result = await provider.call({
3244
+ to: this.contractAddress,
3245
+ data
3246
+ });
3247
+ const decoded = iface.decodeFunctionResult("getListing", result);
3248
+ const listing = decoded[0];
3249
+ return {
3250
+ listingId,
3251
+ nftContract: listing.nftContract,
3252
+ tokenId: listing.tokenId.toString(),
3253
+ seller: listing.seller,
3254
+ price: listing.price,
3255
+ paymentToken: listing.paymentToken,
3256
+ expiresAt: Number(listing.expiresAt),
3257
+ isActive: listing.isActive
3258
+ };
3259
+ } catch {
3260
+ return null;
3261
+ }
3262
+ }
3263
+ /**
3264
+ * Check if a payment token is supported
3265
+ * @param token Token address
3266
+ * @param provider JSON-RPC provider
3267
+ */
3268
+ async isTokenSupported(token, provider) {
3269
+ const iface = new (await import('ethers')).Interface(this.abi);
3270
+ const data = iface.encodeFunctionData("supportedTokens", [token]);
3271
+ try {
3272
+ const result = await provider.call({
3273
+ to: this.contractAddress,
3274
+ data
3275
+ });
3276
+ const decoded = iface.decodeFunctionResult("supportedTokens", result);
3277
+ return decoded[0];
3278
+ } catch {
3279
+ return false;
3280
+ }
3281
+ }
3282
+ /**
3283
+ * Calculate platform fee for a given price
3284
+ * @param price The sale price
3285
+ */
3286
+ calculateFee(price) {
3287
+ const fee = price * BigInt(PLATFORM_CONFIG.tipFeeBps) / 10000n;
3288
+ return {
3289
+ fee,
3290
+ sellerAmount: price - fee
3291
+ };
3292
+ }
3293
+ };
3294
+
2407
3295
  // src/protocols/TipsProtocol.ts
2408
3296
  var ZubariTipsProtocol = class {
2409
3297
  contractAddress;
@@ -3487,6 +4375,6 @@ function normalizeAddress(address) {
3487
4375
  return address.toLowerCase();
3488
4376
  }
3489
4377
 
3490
- export { BrowserAddressDerivation_exports as BrowserAddressDerivation, DERIVATION_PATHS, KeyManager, MemoryStorageAdapter, NETWORKS, PLATFORM_CONFIG, SwapService, TESTNET_NETWORKS, TransactionService, WalletManager, WdkApiClient, WebEncryptedStorageAdapter, ZUBARI_CONTRACTS, ZubariError, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol, ZubariWallet, ZubariWdkService, createSecureStorage, createTransactionService, createZubariWdkService, formatAddress, formatBalance, getContractAddresses, getNetworkConfig, getTransactionService, getWdkApiClient, getZubariWdkService, isBrowser, isValidAddress, normalizeAddress, useWalletManager };
4378
+ export { BrowserAddressDerivation_exports as BrowserAddressDerivation, DERIVATION_PATHS, KeyManager, MemoryStorageAdapter, NETWORKS, PLATFORM_CONFIG, SwapService, TESTNET_NETWORKS, TransactionService, WalletManager, WdkApiClient, WebEncryptedStorageAdapter, ZUBARI_CONTRACTS, ZubariError, ZubariMarketProtocol, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol, ZubariWallet, ZubariWdkService, createSecureStorage, createTransactionService, createZubariWdkService, formatAddress, formatBalance, getContractAddresses, getNetworkConfig, getTransactionService, getWdkApiClient, getZubariWdkService, isBrowser, isValidAddress, normalizeAddress, useWalletManager };
3491
4379
  //# sourceMappingURL=index.mjs.map
3492
4380
  //# sourceMappingURL=index.mjs.map