@zubari/sdk 0.1.21 → 0.1.22
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/PayoutsProtocol-BFrXok86.d.ts +181 -0
- package/dist/PayoutsProtocol-Q3wZHcaf.d.mts +181 -0
- package/dist/{WalletManager-wRV8RrnE.d.ts → WalletManager-9bC646Ax.d.ts} +49 -141
- package/dist/{WalletManager-bdFpa_yr.d.mts → WalletManager-B4Ag188W.d.mts} +49 -141
- package/dist/{index-C4wdFOtM.d.mts → index-C4SuAZP4.d.ts} +3 -2
- package/dist/{index-DhluuR9H.d.mts → index-D9vwxETQ.d.mts} +17 -1
- package/dist/{index-DhluuR9H.d.ts → index-D9vwxETQ.d.ts} +17 -1
- package/dist/{index-Cq024jR8.d.ts → index-DkB0ouBN.d.mts} +3 -2
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +22 -57
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -51
- package/dist/index.mjs.map +1 -1
- package/dist/protocols/index.d.mts +149 -171
- package/dist/protocols/index.d.ts +149 -171
- package/dist/protocols/index.js +889 -0
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/index.mjs +889 -1
- package/dist/protocols/index.mjs.map +1 -1
- package/dist/react/index.d.mts +4 -5
- package/dist/react/index.d.ts +4 -5
- package/dist/react/index.js +15 -54
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +9 -48
- package/dist/react/index.mjs.map +1 -1
- package/dist/services/index.d.mts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +16 -12
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs +10 -6
- package/dist/services/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +4 -5
- package/dist/wallet/index.d.ts +4 -5
- package/dist/wallet/index.js +22 -57
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +16 -51
- package/dist/wallet/index.mjs.map +1 -1
- package/package.json +4 -4
|
@@ -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 };
|