@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
|
@@ -1,181 +1,159 @@
|
|
|
1
|
-
|
|
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';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* ZubariMarketProtocol - NFT Marketplace operations
|
|
5
6
|
*
|
|
6
|
-
* Handles
|
|
7
|
-
*
|
|
7
|
+
* Handles NFT listings, purchases, and marketplace management
|
|
8
|
+
* with support for ETH and ERC-20 payment tokens.
|
|
8
9
|
*/
|
|
9
|
-
declare class
|
|
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 {
|
|
10
|
+
declare class ZubariMarketProtocol {
|
|
91
11
|
private readonly contractAddress;
|
|
92
12
|
private readonly chainId;
|
|
13
|
+
private readonly abi;
|
|
93
14
|
constructor(contractAddress: string, chainId: number);
|
|
94
15
|
/**
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Get
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
16
|
+
* Get the contract ABI
|
|
17
|
+
*/
|
|
18
|
+
getAbi(): ({
|
|
19
|
+
inputs: {
|
|
20
|
+
internalType: string;
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}[];
|
|
24
|
+
stateMutability: string;
|
|
25
|
+
type: string;
|
|
26
|
+
name?: undefined;
|
|
27
|
+
anonymous?: undefined;
|
|
28
|
+
outputs?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
inputs: {
|
|
31
|
+
internalType: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}[];
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
stateMutability?: undefined;
|
|
38
|
+
anonymous?: undefined;
|
|
39
|
+
outputs?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
anonymous: boolean;
|
|
42
|
+
inputs: {
|
|
43
|
+
indexed: boolean;
|
|
44
|
+
internalType: string;
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
}[];
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
stateMutability?: undefined;
|
|
51
|
+
outputs?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
inputs: {
|
|
54
|
+
internalType: string;
|
|
55
|
+
name: string;
|
|
56
|
+
type: string;
|
|
57
|
+
}[];
|
|
58
|
+
name: string;
|
|
59
|
+
outputs: {
|
|
60
|
+
components: {
|
|
61
|
+
internalType: string;
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}[];
|
|
65
|
+
internalType: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
}[];
|
|
69
|
+
stateMutability: string;
|
|
70
|
+
type: string;
|
|
71
|
+
anonymous?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
inputs: {
|
|
74
|
+
internalType: string;
|
|
75
|
+
name: string;
|
|
76
|
+
type: string;
|
|
77
|
+
}[];
|
|
78
|
+
name: string;
|
|
79
|
+
outputs: {
|
|
80
|
+
internalType: string;
|
|
81
|
+
name: string;
|
|
82
|
+
type: string;
|
|
83
|
+
}[];
|
|
84
|
+
stateMutability: string;
|
|
85
|
+
type: string;
|
|
86
|
+
anonymous?: undefined;
|
|
87
|
+
})[];
|
|
88
|
+
/**
|
|
89
|
+
* Get the contract address
|
|
90
|
+
*/
|
|
91
|
+
getAddress(): string;
|
|
92
|
+
/**
|
|
93
|
+
* List an NFT for sale
|
|
94
|
+
* @param params Listing parameters
|
|
95
|
+
* @param signer Wallet signer with sendTransaction method
|
|
96
|
+
*/
|
|
97
|
+
listItem(params: ListingParams, signer: {
|
|
98
|
+
sendTransaction: (tx: object) => Promise<{
|
|
99
|
+
hash: string;
|
|
100
|
+
}>;
|
|
101
|
+
}): Promise<TxResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Buy an NFT from a listing
|
|
104
|
+
* @param params Buy parameters
|
|
105
|
+
* @param signer Wallet signer
|
|
106
|
+
*/
|
|
107
|
+
buyItem(params: BuyParams, signer: {
|
|
108
|
+
sendTransaction: (tx: object) => Promise<{
|
|
109
|
+
hash: string;
|
|
110
|
+
}>;
|
|
111
|
+
}): Promise<TxResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Cancel a listing
|
|
114
|
+
* @param listingId The listing ID to cancel
|
|
115
|
+
* @param signer Wallet signer
|
|
116
|
+
*/
|
|
117
|
+
cancelListing(listingId: string, signer: {
|
|
118
|
+
sendTransaction: (tx: object) => Promise<{
|
|
119
|
+
hash: string;
|
|
120
|
+
}>;
|
|
121
|
+
}): Promise<TxResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Update listing price
|
|
124
|
+
* @param listingId The listing ID
|
|
125
|
+
* @param newPrice New price
|
|
126
|
+
* @param signer Wallet signer
|
|
127
|
+
*/
|
|
128
|
+
updatePrice(listingId: string, newPrice: bigint, signer: {
|
|
129
|
+
sendTransaction: (tx: object) => Promise<{
|
|
130
|
+
hash: string;
|
|
131
|
+
}>;
|
|
132
|
+
}): Promise<TxResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Get listing details
|
|
135
|
+
* @param listingId The listing ID
|
|
136
|
+
* @param provider JSON-RPC provider
|
|
137
|
+
*/
|
|
138
|
+
getListing(listingId: string, provider: {
|
|
139
|
+
call: (tx: object) => Promise<string>;
|
|
140
|
+
}): Promise<Listing | null>;
|
|
141
|
+
/**
|
|
142
|
+
* Check if a payment token is supported
|
|
143
|
+
* @param token Token address
|
|
144
|
+
* @param provider JSON-RPC provider
|
|
145
|
+
*/
|
|
146
|
+
isTokenSupported(token: string, provider: {
|
|
147
|
+
call: (tx: object) => Promise<string>;
|
|
148
|
+
}): Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* Calculate platform fee for a given price
|
|
151
|
+
* @param price The sale price
|
|
152
|
+
*/
|
|
153
|
+
calculateFee(price: bigint): {
|
|
154
|
+
fee: bigint;
|
|
155
|
+
sellerAmount: bigint;
|
|
156
|
+
};
|
|
179
157
|
}
|
|
180
158
|
|
|
181
|
-
export {
|
|
159
|
+
export { ZubariMarketProtocol };
|
|
@@ -1,181 +1,159 @@
|
|
|
1
|
-
|
|
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';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* ZubariMarketProtocol - NFT Marketplace operations
|
|
5
6
|
*
|
|
6
|
-
* Handles
|
|
7
|
-
*
|
|
7
|
+
* Handles NFT listings, purchases, and marketplace management
|
|
8
|
+
* with support for ETH and ERC-20 payment tokens.
|
|
8
9
|
*/
|
|
9
|
-
declare class
|
|
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 {
|
|
10
|
+
declare class ZubariMarketProtocol {
|
|
91
11
|
private readonly contractAddress;
|
|
92
12
|
private readonly chainId;
|
|
13
|
+
private readonly abi;
|
|
93
14
|
constructor(contractAddress: string, chainId: number);
|
|
94
15
|
/**
|
|
95
|
-
*
|
|
96
|
-
*/
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Get
|
|
169
|
-
*/
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
*
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
16
|
+
* Get the contract ABI
|
|
17
|
+
*/
|
|
18
|
+
getAbi(): ({
|
|
19
|
+
inputs: {
|
|
20
|
+
internalType: string;
|
|
21
|
+
name: string;
|
|
22
|
+
type: string;
|
|
23
|
+
}[];
|
|
24
|
+
stateMutability: string;
|
|
25
|
+
type: string;
|
|
26
|
+
name?: undefined;
|
|
27
|
+
anonymous?: undefined;
|
|
28
|
+
outputs?: undefined;
|
|
29
|
+
} | {
|
|
30
|
+
inputs: {
|
|
31
|
+
internalType: string;
|
|
32
|
+
name: string;
|
|
33
|
+
type: string;
|
|
34
|
+
}[];
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
stateMutability?: undefined;
|
|
38
|
+
anonymous?: undefined;
|
|
39
|
+
outputs?: undefined;
|
|
40
|
+
} | {
|
|
41
|
+
anonymous: boolean;
|
|
42
|
+
inputs: {
|
|
43
|
+
indexed: boolean;
|
|
44
|
+
internalType: string;
|
|
45
|
+
name: string;
|
|
46
|
+
type: string;
|
|
47
|
+
}[];
|
|
48
|
+
name: string;
|
|
49
|
+
type: string;
|
|
50
|
+
stateMutability?: undefined;
|
|
51
|
+
outputs?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
inputs: {
|
|
54
|
+
internalType: string;
|
|
55
|
+
name: string;
|
|
56
|
+
type: string;
|
|
57
|
+
}[];
|
|
58
|
+
name: string;
|
|
59
|
+
outputs: {
|
|
60
|
+
components: {
|
|
61
|
+
internalType: string;
|
|
62
|
+
name: string;
|
|
63
|
+
type: string;
|
|
64
|
+
}[];
|
|
65
|
+
internalType: string;
|
|
66
|
+
name: string;
|
|
67
|
+
type: string;
|
|
68
|
+
}[];
|
|
69
|
+
stateMutability: string;
|
|
70
|
+
type: string;
|
|
71
|
+
anonymous?: undefined;
|
|
72
|
+
} | {
|
|
73
|
+
inputs: {
|
|
74
|
+
internalType: string;
|
|
75
|
+
name: string;
|
|
76
|
+
type: string;
|
|
77
|
+
}[];
|
|
78
|
+
name: string;
|
|
79
|
+
outputs: {
|
|
80
|
+
internalType: string;
|
|
81
|
+
name: string;
|
|
82
|
+
type: string;
|
|
83
|
+
}[];
|
|
84
|
+
stateMutability: string;
|
|
85
|
+
type: string;
|
|
86
|
+
anonymous?: undefined;
|
|
87
|
+
})[];
|
|
88
|
+
/**
|
|
89
|
+
* Get the contract address
|
|
90
|
+
*/
|
|
91
|
+
getAddress(): string;
|
|
92
|
+
/**
|
|
93
|
+
* List an NFT for sale
|
|
94
|
+
* @param params Listing parameters
|
|
95
|
+
* @param signer Wallet signer with sendTransaction method
|
|
96
|
+
*/
|
|
97
|
+
listItem(params: ListingParams, signer: {
|
|
98
|
+
sendTransaction: (tx: object) => Promise<{
|
|
99
|
+
hash: string;
|
|
100
|
+
}>;
|
|
101
|
+
}): Promise<TxResult>;
|
|
102
|
+
/**
|
|
103
|
+
* Buy an NFT from a listing
|
|
104
|
+
* @param params Buy parameters
|
|
105
|
+
* @param signer Wallet signer
|
|
106
|
+
*/
|
|
107
|
+
buyItem(params: BuyParams, signer: {
|
|
108
|
+
sendTransaction: (tx: object) => Promise<{
|
|
109
|
+
hash: string;
|
|
110
|
+
}>;
|
|
111
|
+
}): Promise<TxResult>;
|
|
112
|
+
/**
|
|
113
|
+
* Cancel a listing
|
|
114
|
+
* @param listingId The listing ID to cancel
|
|
115
|
+
* @param signer Wallet signer
|
|
116
|
+
*/
|
|
117
|
+
cancelListing(listingId: string, signer: {
|
|
118
|
+
sendTransaction: (tx: object) => Promise<{
|
|
119
|
+
hash: string;
|
|
120
|
+
}>;
|
|
121
|
+
}): Promise<TxResult>;
|
|
122
|
+
/**
|
|
123
|
+
* Update listing price
|
|
124
|
+
* @param listingId The listing ID
|
|
125
|
+
* @param newPrice New price
|
|
126
|
+
* @param signer Wallet signer
|
|
127
|
+
*/
|
|
128
|
+
updatePrice(listingId: string, newPrice: bigint, signer: {
|
|
129
|
+
sendTransaction: (tx: object) => Promise<{
|
|
130
|
+
hash: string;
|
|
131
|
+
}>;
|
|
132
|
+
}): Promise<TxResult>;
|
|
133
|
+
/**
|
|
134
|
+
* Get listing details
|
|
135
|
+
* @param listingId The listing ID
|
|
136
|
+
* @param provider JSON-RPC provider
|
|
137
|
+
*/
|
|
138
|
+
getListing(listingId: string, provider: {
|
|
139
|
+
call: (tx: object) => Promise<string>;
|
|
140
|
+
}): Promise<Listing | null>;
|
|
141
|
+
/**
|
|
142
|
+
* Check if a payment token is supported
|
|
143
|
+
* @param token Token address
|
|
144
|
+
* @param provider JSON-RPC provider
|
|
145
|
+
*/
|
|
146
|
+
isTokenSupported(token: string, provider: {
|
|
147
|
+
call: (tx: object) => Promise<string>;
|
|
148
|
+
}): Promise<boolean>;
|
|
149
|
+
/**
|
|
150
|
+
* Calculate platform fee for a given price
|
|
151
|
+
* @param price The sale price
|
|
152
|
+
*/
|
|
153
|
+
calculateFee(price: bigint): {
|
|
154
|
+
fee: bigint;
|
|
155
|
+
sellerAmount: bigint;
|
|
156
|
+
};
|
|
179
157
|
}
|
|
180
158
|
|
|
181
|
-
export {
|
|
159
|
+
export { ZubariMarketProtocol };
|