@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.
@@ -1,5 +1,48 @@
1
- export { Z as ZubariNFTProtocol, c as ZubariPayoutsProtocol, b as ZubariSubscriptionProtocol, a as ZubariTipsProtocol } from '../PayoutsProtocol-Q3wZHcaf.mjs';
2
- import { L as ListingParams, T as TxResult, B as BuyParams, a as Listing } from '../index-D9vwxETQ.mjs';
1
+ import { c as NFTMetadata, L as LazyMintVoucher, b as TxResult, e as ListingParams, d as NFT, B as BuyParams, f as Listing, g as TipData, h as TipResult, i as TipStats, j as SubscriptionPlan, k as Subscription, E as EarningsBreakdown, R as RevenueSplit } from '../index-IPLQBUaD.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
+ }
3
46
 
4
47
  /**
5
48
  * ZubariMarketProtocol - NFT Marketplace operations
@@ -156,4 +199,138 @@ declare class ZubariMarketProtocol {
156
199
  };
157
200
  }
158
201
 
159
- export { ZubariMarketProtocol };
202
+ /**
203
+ * ZubariTipsProtocol - Micropayment tips for creators
204
+ *
205
+ * Handles ETH and ERC-20 token tips with platform fee distribution.
206
+ * Supports gasless tips via ERC-4337 when enabled.
207
+ */
208
+ declare class ZubariTipsProtocol {
209
+ private readonly contractAddress;
210
+ private readonly chainId;
211
+ private readonly gaslessEnabled;
212
+ constructor(contractAddress: string, chainId: number, gaslessEnabled?: boolean);
213
+ /**
214
+ * Send a tip to a creator
215
+ */
216
+ sendTip(tip: TipData): Promise<TipResult>;
217
+ /**
218
+ * Send tips to multiple creators in a single transaction
219
+ */
220
+ sendBatchTips(tips: TipData[]): Promise<TipResult[]>;
221
+ /**
222
+ * Get tips received by an address
223
+ */
224
+ getTipsReceived(address: string): Promise<TipResult[]>;
225
+ /**
226
+ * Get tips sent by an address
227
+ */
228
+ getTipsSent(address: string): Promise<TipResult[]>;
229
+ /**
230
+ * Get tip statistics for a creator
231
+ */
232
+ getCreatorTipStats(creator: string): Promise<TipStats>;
233
+ /**
234
+ * Get platform fee in basis points
235
+ */
236
+ getPlatformFeeBps(): number;
237
+ }
238
+
239
+ /**
240
+ * ZubariSubscriptionProtocol - Recurring subscription payments
241
+ *
242
+ * Handles subscription plan creation, subscription management,
243
+ * and verification of active subscriptions.
244
+ */
245
+ declare class ZubariSubscriptionProtocol {
246
+ private readonly contractAddress;
247
+ private readonly chainId;
248
+ constructor(contractAddress: string, chainId: number);
249
+ /**
250
+ * Create a new subscription plan
251
+ */
252
+ createPlan(plan: SubscriptionPlan): Promise<string>;
253
+ /**
254
+ * Update an existing subscription plan
255
+ */
256
+ updatePlan(planId: string, updates: Partial<SubscriptionPlan>): Promise<TxResult>;
257
+ /**
258
+ * Subscribe to a creator's plan
259
+ */
260
+ subscribe(creator: string, planId: string, months?: number): Promise<Subscription>;
261
+ /**
262
+ * Cancel an active subscription
263
+ */
264
+ cancel(subscriptionId: string): Promise<TxResult>;
265
+ /**
266
+ * Check if an address is subscribed to a creator
267
+ */
268
+ isSubscribed(creator: string, subscriber?: string): Promise<boolean>;
269
+ /**
270
+ * Get active subscriptions for a subscriber
271
+ */
272
+ getActiveSubscriptions(subscriber?: string): Promise<Subscription[]>;
273
+ /**
274
+ * Get all subscribers for a creator
275
+ */
276
+ getSubscribers(creator: string): Promise<Subscription[]>;
277
+ /**
278
+ * Get a specific plan by ID
279
+ */
280
+ getPlan(planId: string): Promise<SubscriptionPlan | null>;
281
+ /**
282
+ * Get all plans for a creator
283
+ */
284
+ getCreatorPlans(creator: string): Promise<SubscriptionPlan[]>;
285
+ /**
286
+ * Generate a unique plan ID
287
+ */
288
+ private generatePlanId;
289
+ }
290
+
291
+ /**
292
+ * ZubariPayoutsProtocol - Creator earnings management
293
+ *
294
+ * Handles earnings tracking, claiming, revenue splits,
295
+ * and conversion to stablecoins.
296
+ */
297
+ declare class ZubariPayoutsProtocol {
298
+ private readonly contractAddress;
299
+ private readonly chainId;
300
+ constructor(contractAddress: string, chainId: number);
301
+ /**
302
+ * Get pending earnings breakdown for the current user
303
+ */
304
+ getPendingEarnings(): Promise<EarningsBreakdown>;
305
+ /**
306
+ * Get historical earnings for a time period
307
+ */
308
+ getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
309
+ /**
310
+ * Claim all pending earnings
311
+ */
312
+ claimEarnings(): Promise<TxResult>;
313
+ /**
314
+ * Claim specific amount of earnings
315
+ */
316
+ claimPartialEarnings(amount: bigint): Promise<TxResult>;
317
+ /**
318
+ * Setup revenue split with collaborators
319
+ * Basis points must sum to 10000 (100%)
320
+ */
321
+ setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
322
+ /**
323
+ * Get current revenue split configuration
324
+ */
325
+ getRevenueSplit(): Promise<RevenueSplit[]>;
326
+ /**
327
+ * Remove revenue split (creator gets 100%)
328
+ */
329
+ removeRevenueSplit(): Promise<TxResult>;
330
+ /**
331
+ * Convert earnings to stablecoin (USDT)
332
+ */
333
+ convertToStable(token: string, amount: bigint): Promise<TxResult>;
334
+ }
335
+
336
+ export { ZubariMarketProtocol, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol };
@@ -1,5 +1,48 @@
1
- export { Z as ZubariNFTProtocol, c as ZubariPayoutsProtocol, b as ZubariSubscriptionProtocol, a as ZubariTipsProtocol } from '../PayoutsProtocol-BFrXok86.js';
2
- import { L as ListingParams, T as TxResult, B as BuyParams, a as Listing } from '../index-D9vwxETQ.js';
1
+ import { c as NFTMetadata, L as LazyMintVoucher, b as TxResult, e as ListingParams, d as NFT, B as BuyParams, f as Listing, g as TipData, h as TipResult, i as TipStats, j as SubscriptionPlan, k as Subscription, E as EarningsBreakdown, R as RevenueSplit } from '../index-IPLQBUaD.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
+ }
3
46
 
4
47
  /**
5
48
  * ZubariMarketProtocol - NFT Marketplace operations
@@ -156,4 +199,138 @@ declare class ZubariMarketProtocol {
156
199
  };
157
200
  }
158
201
 
159
- export { ZubariMarketProtocol };
202
+ /**
203
+ * ZubariTipsProtocol - Micropayment tips for creators
204
+ *
205
+ * Handles ETH and ERC-20 token tips with platform fee distribution.
206
+ * Supports gasless tips via ERC-4337 when enabled.
207
+ */
208
+ declare class ZubariTipsProtocol {
209
+ private readonly contractAddress;
210
+ private readonly chainId;
211
+ private readonly gaslessEnabled;
212
+ constructor(contractAddress: string, chainId: number, gaslessEnabled?: boolean);
213
+ /**
214
+ * Send a tip to a creator
215
+ */
216
+ sendTip(tip: TipData): Promise<TipResult>;
217
+ /**
218
+ * Send tips to multiple creators in a single transaction
219
+ */
220
+ sendBatchTips(tips: TipData[]): Promise<TipResult[]>;
221
+ /**
222
+ * Get tips received by an address
223
+ */
224
+ getTipsReceived(address: string): Promise<TipResult[]>;
225
+ /**
226
+ * Get tips sent by an address
227
+ */
228
+ getTipsSent(address: string): Promise<TipResult[]>;
229
+ /**
230
+ * Get tip statistics for a creator
231
+ */
232
+ getCreatorTipStats(creator: string): Promise<TipStats>;
233
+ /**
234
+ * Get platform fee in basis points
235
+ */
236
+ getPlatformFeeBps(): number;
237
+ }
238
+
239
+ /**
240
+ * ZubariSubscriptionProtocol - Recurring subscription payments
241
+ *
242
+ * Handles subscription plan creation, subscription management,
243
+ * and verification of active subscriptions.
244
+ */
245
+ declare class ZubariSubscriptionProtocol {
246
+ private readonly contractAddress;
247
+ private readonly chainId;
248
+ constructor(contractAddress: string, chainId: number);
249
+ /**
250
+ * Create a new subscription plan
251
+ */
252
+ createPlan(plan: SubscriptionPlan): Promise<string>;
253
+ /**
254
+ * Update an existing subscription plan
255
+ */
256
+ updatePlan(planId: string, updates: Partial<SubscriptionPlan>): Promise<TxResult>;
257
+ /**
258
+ * Subscribe to a creator's plan
259
+ */
260
+ subscribe(creator: string, planId: string, months?: number): Promise<Subscription>;
261
+ /**
262
+ * Cancel an active subscription
263
+ */
264
+ cancel(subscriptionId: string): Promise<TxResult>;
265
+ /**
266
+ * Check if an address is subscribed to a creator
267
+ */
268
+ isSubscribed(creator: string, subscriber?: string): Promise<boolean>;
269
+ /**
270
+ * Get active subscriptions for a subscriber
271
+ */
272
+ getActiveSubscriptions(subscriber?: string): Promise<Subscription[]>;
273
+ /**
274
+ * Get all subscribers for a creator
275
+ */
276
+ getSubscribers(creator: string): Promise<Subscription[]>;
277
+ /**
278
+ * Get a specific plan by ID
279
+ */
280
+ getPlan(planId: string): Promise<SubscriptionPlan | null>;
281
+ /**
282
+ * Get all plans for a creator
283
+ */
284
+ getCreatorPlans(creator: string): Promise<SubscriptionPlan[]>;
285
+ /**
286
+ * Generate a unique plan ID
287
+ */
288
+ private generatePlanId;
289
+ }
290
+
291
+ /**
292
+ * ZubariPayoutsProtocol - Creator earnings management
293
+ *
294
+ * Handles earnings tracking, claiming, revenue splits,
295
+ * and conversion to stablecoins.
296
+ */
297
+ declare class ZubariPayoutsProtocol {
298
+ private readonly contractAddress;
299
+ private readonly chainId;
300
+ constructor(contractAddress: string, chainId: number);
301
+ /**
302
+ * Get pending earnings breakdown for the current user
303
+ */
304
+ getPendingEarnings(): Promise<EarningsBreakdown>;
305
+ /**
306
+ * Get historical earnings for a time period
307
+ */
308
+ getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
309
+ /**
310
+ * Claim all pending earnings
311
+ */
312
+ claimEarnings(): Promise<TxResult>;
313
+ /**
314
+ * Claim specific amount of earnings
315
+ */
316
+ claimPartialEarnings(amount: bigint): Promise<TxResult>;
317
+ /**
318
+ * Setup revenue split with collaborators
319
+ * Basis points must sum to 10000 (100%)
320
+ */
321
+ setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
322
+ /**
323
+ * Get current revenue split configuration
324
+ */
325
+ getRevenueSplit(): Promise<RevenueSplit[]>;
326
+ /**
327
+ * Remove revenue split (creator gets 100%)
328
+ */
329
+ removeRevenueSplit(): Promise<TxResult>;
330
+ /**
331
+ * Convert earnings to stablecoin (USDT)
332
+ */
333
+ convertToStable(token: string, amount: bigint): Promise<TxResult>;
334
+ }
335
+
336
+ export { ZubariMarketProtocol, ZubariNFTProtocol, ZubariPayoutsProtocol, ZubariSubscriptionProtocol, ZubariTipsProtocol };
@@ -1,6 +1,6 @@
1
- import { N as NetworkType } from '../index-D9vwxETQ.mjs';
2
- import { b as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, W as WalletManager } from '../WalletManager-Cdk81G55.mjs';
3
- export { S as SUPPORTED_CHAINS } from '../WalletManager-Cdk81G55.mjs';
1
+ import { N as NetworkType } from '../index-IPLQBUaD.mjs';
2
+ import { b as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, W as WalletManager } from '../WalletManager-2jAcWdXE.mjs';
3
+ export { S as SUPPORTED_CHAINS } from '../WalletManager-2jAcWdXE.mjs';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
@@ -1,6 +1,6 @@
1
- import { N as NetworkType } from '../index-D9vwxETQ.js';
2
- import { b as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, W as WalletManager } from '../WalletManager-CR1B7vN_.js';
3
- export { S as SUPPORTED_CHAINS } from '../WalletManager-CR1B7vN_.js';
1
+ import { N as NetworkType } from '../index-IPLQBUaD.js';
2
+ import { b as WalletManagerConfig, a as WalletState, C as ChainBalance, M as MultiChainAddresses, W as WalletManager } from '../WalletManager-CO-urS0z.js';
3
+ export { S as SUPPORTED_CHAINS } from '../WalletManager-CO-urS0z.js';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
@@ -1,4 +1,4 @@
1
- import { l as SwapQuote, T as TxResult, N as NetworkType } from '../index-D9vwxETQ.mjs';
1
+ import { l as SwapQuote, b as TxResult, N as NetworkType } from '../index-IPLQBUaD.mjs';
2
2
 
3
3
  /**
4
4
  * SwapService - DEX integration via Velora
@@ -1,4 +1,4 @@
1
- import { l as SwapQuote, T as TxResult, N as NetworkType } from '../index-D9vwxETQ.js';
1
+ import { l as SwapQuote, b as TxResult, N as NetworkType } from '../index-IPLQBUaD.js';
2
2
 
3
3
  /**
4
4
  * SwapService - DEX integration via Velora
@@ -1,6 +1,6 @@
1
- export { Z as ZubariWallet } from '../index-OooXWNfP.mjs';
2
- export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, W as WalletManager, b as WalletManagerConfig, a as WalletState } from '../WalletManager-Cdk81G55.mjs';
3
- import '../index-D9vwxETQ.mjs';
1
+ export { Z as ZubariWallet } from '../index-CUX8jPBi.mjs';
2
+ export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, W as WalletManager, b as WalletManagerConfig, a as WalletState } from '../WalletManager-2jAcWdXE.mjs';
3
+ import '../index-IPLQBUaD.mjs';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
@@ -1,6 +1,6 @@
1
- export { Z as ZubariWallet } from '../index-BztGRtFG.js';
2
- export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, W as WalletManager, b as WalletManagerConfig, a as WalletState } from '../WalletManager-CR1B7vN_.js';
3
- import '../index-D9vwxETQ.js';
1
+ export { Z as ZubariWallet } from '../index-47yJyxgt.js';
2
+ export { C as ChainBalance, M as MultiChainAddresses, S as SUPPORTED_CHAINS, W as WalletManager, b as WalletManagerConfig, a as WalletState } from '../WalletManager-CO-urS0z.js';
3
+ import '../index-IPLQBUaD.js';
4
4
  import 'node_modules/viem/_types/actions/siwe/verifySiweMessage';
5
5
  import 'node_modules/viem/_types/utils/ccip';
6
6
  import 'viem';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zubari/sdk",
3
- "version": "0.1.27",
3
+ "version": "0.1.29",
4
4
  "description": "Multi-chain self-custodial wallet SDK for Web3 creator economy. Supports Ethereum, Bitcoin, TON, TRON, Solana, and Lightning (Spark) from a single BIP-39 seed phrase.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -102,15 +102,11 @@
102
102
  "node": ">=18.0.0"
103
103
  },
104
104
  "dependencies": {
105
- "@noble/hashes": "^1.3.3",
106
105
  "@scure/base": "^2.0.0",
107
106
  "@scure/bip32": "^2.0.1",
108
- "@scure/bip39": "^2.0.1",
109
107
  "bs58": "^6.0.0",
110
108
  "ed25519-hd-key": "^1.3.0",
111
- "ethers": "^6.13.0",
112
- "tweetnacl": "^1.0.3",
113
- "viem": "^2.21.0"
109
+ "tweetnacl": "^1.0.3"
114
110
  },
115
111
  "optionalDependencies": {
116
112
  "@tetherto/wdk": "1.0.0-beta.4",
@@ -135,11 +131,31 @@
135
131
  "typescript": "^5.3.0"
136
132
  },
137
133
  "peerDependencies": {
138
- "react": ">=18.0.0"
134
+ "react": ">=18.0.0",
135
+ "ethers": "^6.0.0",
136
+ "viem": "^2.0.0",
137
+ "@scure/bip39": "^1.2.0 || ^2.0.0",
138
+ "@noble/hashes": "^1.3.0",
139
+ "@noble/curves": "^1.2.0"
139
140
  },
140
141
  "peerDependenciesMeta": {
141
142
  "react": {
142
143
  "optional": true
144
+ },
145
+ "ethers": {
146
+ "optional": true
147
+ },
148
+ "viem": {
149
+ "optional": true
150
+ },
151
+ "@scure/bip39": {
152
+ "optional": true
153
+ },
154
+ "@noble/hashes": {
155
+ "optional": true
156
+ },
157
+ "@noble/curves": {
158
+ "optional": true
143
159
  }
144
160
  }
145
161
  }
@@ -1,181 +0,0 @@
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 };