@zubari/sdk 0.1.21 → 0.1.23

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.
Files changed (39) hide show
  1. package/dist/PayoutsProtocol-BFrXok86.d.ts +181 -0
  2. package/dist/PayoutsProtocol-Q3wZHcaf.d.mts +181 -0
  3. package/dist/{WalletManager-wRV8RrnE.d.ts → WalletManager-9bC646Ax.d.ts} +49 -141
  4. package/dist/{WalletManager-bdFpa_yr.d.mts → WalletManager-B4Ag188W.d.mts} +49 -141
  5. package/dist/{index-C4wdFOtM.d.mts → index-C4SuAZP4.d.ts} +3 -2
  6. package/dist/{index-DhluuR9H.d.mts → index-D9vwxETQ.d.mts} +17 -1
  7. package/dist/{index-DhluuR9H.d.ts → index-D9vwxETQ.d.ts} +17 -1
  8. package/dist/{index-Cq024jR8.d.ts → index-DkB0ouBN.d.mts} +3 -2
  9. package/dist/index.d.mts +5 -6
  10. package/dist/index.d.ts +5 -6
  11. package/dist/index.js +36 -63
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +30 -57
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/protocols/index.d.mts +149 -171
  16. package/dist/protocols/index.d.ts +149 -171
  17. package/dist/protocols/index.js +889 -0
  18. package/dist/protocols/index.js.map +1 -1
  19. package/dist/protocols/index.mjs +889 -1
  20. package/dist/protocols/index.mjs.map +1 -1
  21. package/dist/react/index.d.mts +4 -5
  22. package/dist/react/index.d.ts +4 -5
  23. package/dist/react/index.js +29 -60
  24. package/dist/react/index.js.map +1 -1
  25. package/dist/react/index.mjs +23 -54
  26. package/dist/react/index.mjs.map +1 -1
  27. package/dist/services/index.d.mts +1 -1
  28. package/dist/services/index.d.ts +1 -1
  29. package/dist/services/index.js +30 -18
  30. package/dist/services/index.js.map +1 -1
  31. package/dist/services/index.mjs +24 -12
  32. package/dist/services/index.mjs.map +1 -1
  33. package/dist/wallet/index.d.mts +4 -5
  34. package/dist/wallet/index.d.ts +4 -5
  35. package/dist/wallet/index.js +36 -63
  36. package/dist/wallet/index.js.map +1 -1
  37. package/dist/wallet/index.mjs +30 -57
  38. package/dist/wallet/index.mjs.map +1 -1
  39. package/package.json +17 -19
@@ -0,0 +1,181 @@
1
+ import { d as NFTMetadata, e as LazyMintVoucher, T as TxResult, L as ListingParams, f as NFT, g as TipData, h as TipResult, i as TipStats, j as SubscriptionPlan, k as Subscription, E as EarningsBreakdown, R as RevenueSplit } from './index-D9vwxETQ.js';
2
+
3
+ /**
4
+ * ZubariNFTProtocol - NFT creation and marketplace operations
5
+ *
6
+ * Handles lazy minting via EIP-712 signatures, NFT listing,
7
+ * and marketplace operations on Ethereum network.
8
+ */
9
+ declare class ZubariNFTProtocol {
10
+ private readonly contractAddress;
11
+ private readonly _marketplaceAddress;
12
+ private readonly chainId;
13
+ constructor(contractAddress: string, marketplaceAddress: string, chainId: number);
14
+ /**
15
+ * Create a lazy mint voucher for off-chain NFT creation
16
+ * The voucher can be redeemed on-chain when purchased
17
+ */
18
+ createLazyMintVoucher(metadata: NFTMetadata, creatorAddress: string, signer: {
19
+ signTypedData: (domain: object, types: object, value: object) => Promise<string>;
20
+ }): Promise<LazyMintVoucher>;
21
+ /**
22
+ * Redeem a lazy mint voucher to mint the NFT on-chain
23
+ */
24
+ redeemVoucher(voucher: LazyMintVoucher, _buyerAddress: string): Promise<TxResult>;
25
+ /**
26
+ * List an NFT for sale on the marketplace
27
+ */
28
+ listForSale(_params: ListingParams): Promise<TxResult>;
29
+ /**
30
+ * Buy an NFT from the marketplace
31
+ */
32
+ buyNFT(_listingId: string, _price: bigint): Promise<TxResult>;
33
+ /**
34
+ * Transfer an NFT to another address
35
+ */
36
+ transfer(_tokenId: string, _to: string): Promise<TxResult>;
37
+ /**
38
+ * Get NFTs owned by an address
39
+ */
40
+ getOwnedNFTs(_address: string): Promise<NFT[]>;
41
+ /**
42
+ * Generate a random tokenId (32 bytes hex)
43
+ */
44
+ private generateTokenId;
45
+ }
46
+
47
+ /**
48
+ * ZubariTipsProtocol - Micropayment tips for creators
49
+ *
50
+ * Handles ETH and ERC-20 token tips with platform fee distribution.
51
+ * Supports gasless tips via ERC-4337 when enabled.
52
+ */
53
+ declare class ZubariTipsProtocol {
54
+ private readonly contractAddress;
55
+ private readonly chainId;
56
+ private readonly gaslessEnabled;
57
+ constructor(contractAddress: string, chainId: number, gaslessEnabled?: boolean);
58
+ /**
59
+ * Send a tip to a creator
60
+ */
61
+ sendTip(tip: TipData): Promise<TipResult>;
62
+ /**
63
+ * Send tips to multiple creators in a single transaction
64
+ */
65
+ sendBatchTips(tips: TipData[]): Promise<TipResult[]>;
66
+ /**
67
+ * Get tips received by an address
68
+ */
69
+ getTipsReceived(address: string): Promise<TipResult[]>;
70
+ /**
71
+ * Get tips sent by an address
72
+ */
73
+ getTipsSent(address: string): Promise<TipResult[]>;
74
+ /**
75
+ * Get tip statistics for a creator
76
+ */
77
+ getCreatorTipStats(creator: string): Promise<TipStats>;
78
+ /**
79
+ * Get platform fee in basis points
80
+ */
81
+ getPlatformFeeBps(): number;
82
+ }
83
+
84
+ /**
85
+ * ZubariSubscriptionProtocol - Recurring subscription payments
86
+ *
87
+ * Handles subscription plan creation, subscription management,
88
+ * and verification of active subscriptions.
89
+ */
90
+ declare class ZubariSubscriptionProtocol {
91
+ private readonly contractAddress;
92
+ private readonly chainId;
93
+ constructor(contractAddress: string, chainId: number);
94
+ /**
95
+ * Create a new subscription plan
96
+ */
97
+ createPlan(plan: SubscriptionPlan): Promise<string>;
98
+ /**
99
+ * Update an existing subscription plan
100
+ */
101
+ updatePlan(planId: string, updates: Partial<SubscriptionPlan>): Promise<TxResult>;
102
+ /**
103
+ * Subscribe to a creator's plan
104
+ */
105
+ subscribe(creator: string, planId: string, months?: number): Promise<Subscription>;
106
+ /**
107
+ * Cancel an active subscription
108
+ */
109
+ cancel(subscriptionId: string): Promise<TxResult>;
110
+ /**
111
+ * Check if an address is subscribed to a creator
112
+ */
113
+ isSubscribed(creator: string, subscriber?: string): Promise<boolean>;
114
+ /**
115
+ * Get active subscriptions for a subscriber
116
+ */
117
+ getActiveSubscriptions(subscriber?: string): Promise<Subscription[]>;
118
+ /**
119
+ * Get all subscribers for a creator
120
+ */
121
+ getSubscribers(creator: string): Promise<Subscription[]>;
122
+ /**
123
+ * Get a specific plan by ID
124
+ */
125
+ getPlan(planId: string): Promise<SubscriptionPlan | null>;
126
+ /**
127
+ * Get all plans for a creator
128
+ */
129
+ getCreatorPlans(creator: string): Promise<SubscriptionPlan[]>;
130
+ /**
131
+ * Generate a unique plan ID
132
+ */
133
+ private generatePlanId;
134
+ }
135
+
136
+ /**
137
+ * ZubariPayoutsProtocol - Creator earnings management
138
+ *
139
+ * Handles earnings tracking, claiming, revenue splits,
140
+ * and conversion to stablecoins.
141
+ */
142
+ declare class ZubariPayoutsProtocol {
143
+ private readonly contractAddress;
144
+ private readonly chainId;
145
+ constructor(contractAddress: string, chainId: number);
146
+ /**
147
+ * Get pending earnings breakdown for the current user
148
+ */
149
+ getPendingEarnings(): Promise<EarningsBreakdown>;
150
+ /**
151
+ * Get historical earnings for a time period
152
+ */
153
+ getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
154
+ /**
155
+ * Claim all pending earnings
156
+ */
157
+ claimEarnings(): Promise<TxResult>;
158
+ /**
159
+ * Claim specific amount of earnings
160
+ */
161
+ claimPartialEarnings(amount: bigint): Promise<TxResult>;
162
+ /**
163
+ * Setup revenue split with collaborators
164
+ * Basis points must sum to 10000 (100%)
165
+ */
166
+ setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
167
+ /**
168
+ * Get current revenue split configuration
169
+ */
170
+ getRevenueSplit(): Promise<RevenueSplit[]>;
171
+ /**
172
+ * Remove revenue split (creator gets 100%)
173
+ */
174
+ removeRevenueSplit(): Promise<TxResult>;
175
+ /**
176
+ * Convert earnings to stablecoin (USDT)
177
+ */
178
+ convertToStable(token: string, amount: bigint): Promise<TxResult>;
179
+ }
180
+
181
+ export { ZubariNFTProtocol as Z, ZubariTipsProtocol as a, ZubariSubscriptionProtocol as b, ZubariPayoutsProtocol as c };
@@ -0,0 +1,181 @@
1
+ import { d as NFTMetadata, e as LazyMintVoucher, T as TxResult, L as ListingParams, f as NFT, g as TipData, h as TipResult, i as TipStats, j as SubscriptionPlan, k as Subscription, E as EarningsBreakdown, R as RevenueSplit } from './index-D9vwxETQ.mjs';
2
+
3
+ /**
4
+ * ZubariNFTProtocol - NFT creation and marketplace operations
5
+ *
6
+ * Handles lazy minting via EIP-712 signatures, NFT listing,
7
+ * and marketplace operations on Ethereum network.
8
+ */
9
+ declare class ZubariNFTProtocol {
10
+ private readonly contractAddress;
11
+ private readonly _marketplaceAddress;
12
+ private readonly chainId;
13
+ constructor(contractAddress: string, marketplaceAddress: string, chainId: number);
14
+ /**
15
+ * Create a lazy mint voucher for off-chain NFT creation
16
+ * The voucher can be redeemed on-chain when purchased
17
+ */
18
+ createLazyMintVoucher(metadata: NFTMetadata, creatorAddress: string, signer: {
19
+ signTypedData: (domain: object, types: object, value: object) => Promise<string>;
20
+ }): Promise<LazyMintVoucher>;
21
+ /**
22
+ * Redeem a lazy mint voucher to mint the NFT on-chain
23
+ */
24
+ redeemVoucher(voucher: LazyMintVoucher, _buyerAddress: string): Promise<TxResult>;
25
+ /**
26
+ * List an NFT for sale on the marketplace
27
+ */
28
+ listForSale(_params: ListingParams): Promise<TxResult>;
29
+ /**
30
+ * Buy an NFT from the marketplace
31
+ */
32
+ buyNFT(_listingId: string, _price: bigint): Promise<TxResult>;
33
+ /**
34
+ * Transfer an NFT to another address
35
+ */
36
+ transfer(_tokenId: string, _to: string): Promise<TxResult>;
37
+ /**
38
+ * Get NFTs owned by an address
39
+ */
40
+ getOwnedNFTs(_address: string): Promise<NFT[]>;
41
+ /**
42
+ * Generate a random tokenId (32 bytes hex)
43
+ */
44
+ private generateTokenId;
45
+ }
46
+
47
+ /**
48
+ * ZubariTipsProtocol - Micropayment tips for creators
49
+ *
50
+ * Handles ETH and ERC-20 token tips with platform fee distribution.
51
+ * Supports gasless tips via ERC-4337 when enabled.
52
+ */
53
+ declare class ZubariTipsProtocol {
54
+ private readonly contractAddress;
55
+ private readonly chainId;
56
+ private readonly gaslessEnabled;
57
+ constructor(contractAddress: string, chainId: number, gaslessEnabled?: boolean);
58
+ /**
59
+ * Send a tip to a creator
60
+ */
61
+ sendTip(tip: TipData): Promise<TipResult>;
62
+ /**
63
+ * Send tips to multiple creators in a single transaction
64
+ */
65
+ sendBatchTips(tips: TipData[]): Promise<TipResult[]>;
66
+ /**
67
+ * Get tips received by an address
68
+ */
69
+ getTipsReceived(address: string): Promise<TipResult[]>;
70
+ /**
71
+ * Get tips sent by an address
72
+ */
73
+ getTipsSent(address: string): Promise<TipResult[]>;
74
+ /**
75
+ * Get tip statistics for a creator
76
+ */
77
+ getCreatorTipStats(creator: string): Promise<TipStats>;
78
+ /**
79
+ * Get platform fee in basis points
80
+ */
81
+ getPlatformFeeBps(): number;
82
+ }
83
+
84
+ /**
85
+ * ZubariSubscriptionProtocol - Recurring subscription payments
86
+ *
87
+ * Handles subscription plan creation, subscription management,
88
+ * and verification of active subscriptions.
89
+ */
90
+ declare class ZubariSubscriptionProtocol {
91
+ private readonly contractAddress;
92
+ private readonly chainId;
93
+ constructor(contractAddress: string, chainId: number);
94
+ /**
95
+ * Create a new subscription plan
96
+ */
97
+ createPlan(plan: SubscriptionPlan): Promise<string>;
98
+ /**
99
+ * Update an existing subscription plan
100
+ */
101
+ updatePlan(planId: string, updates: Partial<SubscriptionPlan>): Promise<TxResult>;
102
+ /**
103
+ * Subscribe to a creator's plan
104
+ */
105
+ subscribe(creator: string, planId: string, months?: number): Promise<Subscription>;
106
+ /**
107
+ * Cancel an active subscription
108
+ */
109
+ cancel(subscriptionId: string): Promise<TxResult>;
110
+ /**
111
+ * Check if an address is subscribed to a creator
112
+ */
113
+ isSubscribed(creator: string, subscriber?: string): Promise<boolean>;
114
+ /**
115
+ * Get active subscriptions for a subscriber
116
+ */
117
+ getActiveSubscriptions(subscriber?: string): Promise<Subscription[]>;
118
+ /**
119
+ * Get all subscribers for a creator
120
+ */
121
+ getSubscribers(creator: string): Promise<Subscription[]>;
122
+ /**
123
+ * Get a specific plan by ID
124
+ */
125
+ getPlan(planId: string): Promise<SubscriptionPlan | null>;
126
+ /**
127
+ * Get all plans for a creator
128
+ */
129
+ getCreatorPlans(creator: string): Promise<SubscriptionPlan[]>;
130
+ /**
131
+ * Generate a unique plan ID
132
+ */
133
+ private generatePlanId;
134
+ }
135
+
136
+ /**
137
+ * ZubariPayoutsProtocol - Creator earnings management
138
+ *
139
+ * Handles earnings tracking, claiming, revenue splits,
140
+ * and conversion to stablecoins.
141
+ */
142
+ declare class ZubariPayoutsProtocol {
143
+ private readonly contractAddress;
144
+ private readonly chainId;
145
+ constructor(contractAddress: string, chainId: number);
146
+ /**
147
+ * Get pending earnings breakdown for the current user
148
+ */
149
+ getPendingEarnings(): Promise<EarningsBreakdown>;
150
+ /**
151
+ * Get historical earnings for a time period
152
+ */
153
+ getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
154
+ /**
155
+ * Claim all pending earnings
156
+ */
157
+ claimEarnings(): Promise<TxResult>;
158
+ /**
159
+ * Claim specific amount of earnings
160
+ */
161
+ claimPartialEarnings(amount: bigint): Promise<TxResult>;
162
+ /**
163
+ * Setup revenue split with collaborators
164
+ * Basis points must sum to 10000 (100%)
165
+ */
166
+ setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
167
+ /**
168
+ * Get current revenue split configuration
169
+ */
170
+ getRevenueSplit(): Promise<RevenueSplit[]>;
171
+ /**
172
+ * Remove revenue split (creator gets 100%)
173
+ */
174
+ removeRevenueSplit(): Promise<TxResult>;
175
+ /**
176
+ * Convert earnings to stablecoin (USDT)
177
+ */
178
+ convertToStable(token: string, amount: bigint): Promise<TxResult>;
179
+ }
180
+
181
+ export { ZubariNFTProtocol as Z, ZubariTipsProtocol as a, ZubariSubscriptionProtocol as b, ZubariPayoutsProtocol as c };