@zubari/sdk 0.2.3 → 0.2.5

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,579 +1,303 @@
1
- import { o as SwapQuote, b as TxResult, N as NetworkType } from '../index-Bou-9cAG.mjs';
1
+ export { B as BrowserAddressDerivation, C as BrowserChainAddress, a as BrowserMultiChainAddresses, l as ChainAddress, m as ChainBalance, D as DeriveAddressResponse, c as DeriveAllAddressesResponse, v as FeeEstimate, F as FeeRates, G as GenerateSeedResponse, M as MultiChainAddresses, e as SendTransactionResponse, k as SupportedChain, S as SwapService, u as TransactionHistoryItem, d as TransactionHistoryResponse, s as TransactionParams, t as TransactionResult, p as TransactionService, w as TransactionServiceConfig, f as TransactionStatusResponse, V as ValidateSeedResponse, W as WdkApiClient, b as WdkApiConfig, T as WdkTransactionHistoryItem, n as WdkTransactionResult, Z as ZubariWdkService, o as ZubariWdkServiceConfig, r as createTransactionService, i as createZubariWdkService, q as getTransactionService, g as getWdkApiClient, h as getZubariWdkService, j as isBrowser } from '../TransactionService-8xSEGoWA.mjs';
2
+ import { N as NFTCurrency } from '../index-Cx389p_j.mjs';
2
3
 
3
4
  /**
4
- * SwapService - DEX integration via Velora
5
+ * Zubari API Client
5
6
  *
6
- * Handles token swaps with slippage protection,
7
- * quote fetching, and earnings conversion.
8
- */
9
- declare class SwapService {
10
- private readonly _chainId;
11
- private readonly isTestnet;
12
- constructor(chainId: number, isTestnet?: boolean);
13
- /**
14
- * Get a swap quote
15
- */
16
- getQuote(tokenIn: string, tokenOut: string, amountIn: bigint): Promise<SwapQuote>;
17
- /**
18
- * Execute a swap with slippage protection
19
- */
20
- executeSwap(quote: SwapQuote, slippageToleranceBps?: number): Promise<TxResult>;
21
- /**
22
- * Convert earnings to USDT, keeping some ETH for gas
23
- */
24
- convertEarningsToStable(ethBalance: bigint, reserveForGas?: bigint): Promise<TxResult>;
25
- /**
26
- * Check if a swap route exists
27
- */
28
- hasRoute(tokenIn: string, tokenOut: string): Promise<boolean>;
29
- /**
30
- * Get supported tokens for swapping
31
- */
32
- getSupportedTokens(): Promise<string[]>;
33
- }
34
-
35
- /**
36
- * WDK API Client
37
- *
38
- * Client for calling the backend WDK endpoints to derive addresses
39
- * using Tether WDK (which runs server-side in Node.js).
7
+ * Comprehensive client for interacting with the Zubari backend API.
8
+ * Includes NFT, Marketplace, Tips, and Subscription operations.
40
9
  */
41
10
 
42
- interface WdkApiConfig {
11
+ interface ZubariApiConfig {
43
12
  baseUrl: string;
44
13
  timeout?: number;
14
+ authToken?: string;
45
15
  }
46
- interface DeriveAddressResponse {
47
- success: boolean;
48
- address?: string;
49
- chain?: string;
50
- path?: string;
51
- network?: string;
52
- error?: string;
16
+ interface NFTVoucher {
17
+ tokenId: string;
18
+ uri: string;
19
+ creator: string;
20
+ royaltyBps: number;
21
+ deadline: number;
22
+ signature: string;
23
+ price: string;
24
+ currency: string;
25
+ nonce: number;
26
+ contentHash?: string;
27
+ userId?: string;
28
+ watermarkTimestamp?: number;
29
+ sessionId?: string;
30
+ }
31
+ interface CreateVoucherRequest {
32
+ creatorAddress: string;
33
+ price: string;
34
+ currency: NFTCurrency;
53
35
  }
54
- interface DeriveAllAddressesResponse {
36
+ interface CreateVoucherResponse {
55
37
  success: boolean;
56
- addresses?: {
57
- ethereum: string | null;
58
- bitcoin: string | null;
59
- ton: string | null;
60
- tron: string | null;
61
- solana: string | null;
62
- spark: string | null;
63
- };
64
- network?: string;
38
+ voucher?: NFTVoucher;
39
+ signature?: string;
40
+ nftId?: string;
65
41
  error?: string;
66
42
  }
67
- interface ValidateSeedResponse {
43
+ interface RedeemVoucherRequest {
44
+ buyerAddress: string;
45
+ paymentTxHash?: string;
46
+ }
47
+ interface RedeemVoucherResponse {
68
48
  success: boolean;
69
- isValid?: boolean;
70
- wordCount?: number;
49
+ transactionHash?: string;
50
+ tokenId?: string;
51
+ owner?: string;
52
+ nftId?: string;
71
53
  error?: string;
72
54
  }
73
- interface GenerateSeedResponse {
55
+ interface VoucherStatusResponse {
74
56
  success: boolean;
75
- seed?: string;
76
- wordCount?: number;
57
+ nftId?: string;
58
+ hasVoucher?: boolean;
59
+ isRedeemed?: boolean;
60
+ voucher?: NFTVoucher;
77
61
  error?: string;
78
62
  }
79
- interface TransactionHistoryItem$1 {
80
- hash: string;
81
- from: string;
82
- to: string;
83
- value: string;
84
- timestamp: number;
85
- status: 'confirmed' | 'pending' | 'failed';
86
- blockNumber?: number;
63
+ interface NFTResponse {
64
+ id: string;
65
+ tokenId?: string;
66
+ contractAddress?: string;
67
+ name: string;
68
+ description?: string;
69
+ imageUrl?: string;
70
+ animationUrl?: string;
71
+ externalUrl?: string;
72
+ attributes?: Array<{
73
+ trait_type: string;
74
+ value: string | number;
75
+ }>;
76
+ creatorId: string;
77
+ ownerId: string;
78
+ price?: string;
79
+ currency?: string;
80
+ royaltyBps: number;
81
+ isLazyMinted: boolean;
82
+ isMinted: boolean;
83
+ mintedAt?: string;
84
+ transactionHash?: string;
85
+ createdAt: string;
86
+ updatedAt: string;
87
87
  }
88
- interface TransactionHistoryResponse {
89
- success: boolean;
90
- address?: string;
91
- transactions?: TransactionHistoryItem$1[];
92
- chain?: string;
93
- network?: string;
94
- error?: string;
88
+ interface CreateNFTRequest {
89
+ name: string;
90
+ description?: string;
91
+ price: string;
92
+ currency: NFTCurrency;
93
+ royaltyBps?: number;
94
+ attributes?: Array<{
95
+ trait_type: string;
96
+ value: string | number;
97
+ }>;
98
+ externalUrl?: string;
95
99
  }
96
- interface SendTransactionResponse {
100
+ interface NFTListResponse {
97
101
  success: boolean;
98
- txHash?: string;
99
- from?: string;
100
- to?: string;
101
- amount?: string;
102
- chain?: string;
103
- network?: string;
102
+ nfts?: NFTResponse[];
103
+ pagination?: {
104
+ page: number;
105
+ limit: number;
106
+ total: number;
107
+ pages: number;
108
+ };
104
109
  error?: string;
105
110
  }
106
- interface TransactionStatusResponse {
111
+ interface MarketListing {
112
+ id: string;
113
+ nftId: string;
114
+ nft?: NFTResponse;
115
+ sellerId: string;
116
+ sellerAddress: string;
117
+ price: string;
118
+ currency: string;
119
+ expiresAt: string;
120
+ status: 'ACTIVE' | 'SOLD' | 'CANCELLED' | 'EXPIRED';
121
+ transactionHash?: string;
122
+ createdAt: string;
123
+ updatedAt: string;
124
+ }
125
+ interface ListItemRequest {
126
+ nftId: string;
127
+ price: string;
128
+ currency: NFTCurrency;
129
+ duration?: number;
130
+ }
131
+ interface ListItemResponse {
107
132
  success: boolean;
108
- hash?: string;
109
- status?: 'confirmed' | 'pending' | 'failed';
110
- blockNumber?: number;
111
- confirmations?: number;
112
- timestamp?: number;
113
- from?: string;
114
- to?: string;
115
- value?: string;
116
- fee?: string;
117
- chain?: string;
118
- network?: string;
133
+ listing?: MarketListing;
134
+ transactionHash?: string;
119
135
  error?: string;
120
136
  }
121
- /**
122
- * WDK API Client for server-side Tether WDK integration
123
- */
124
- declare class WdkApiClient {
125
- private config;
126
- constructor(config: WdkApiConfig);
127
- /**
128
- * Generate a new BIP-39 seed phrase using Tether WDK
129
- */
130
- generateSeed(): Promise<GenerateSeedResponse>;
131
- /**
132
- * Validate a BIP-39 seed phrase
133
- */
134
- validateSeed(seed: string): Promise<ValidateSeedResponse>;
135
- /**
136
- * Derive address for a specific chain using Tether WDK
137
- */
138
- deriveAddress(seed: string, chain: NetworkType, network?: 'mainnet' | 'testnet'): Promise<DeriveAddressResponse>;
139
- /**
140
- * Derive addresses for all chains using Tether WDK
141
- */
142
- deriveAllAddresses(seed: string, network?: 'mainnet' | 'testnet'): Promise<DeriveAllAddressesResponse>;
143
- /**
144
- * Send a transaction on a specific chain using Tether WDK
145
- */
146
- sendTransaction(seed: string, chain: NetworkType, to: string, amount: string, network?: 'mainnet' | 'testnet'): Promise<SendTransactionResponse>;
147
- /**
148
- * Get transaction history for an address on a specific chain
149
- * Fetches from blockchain explorers (Etherscan, mempool.space, etc.)
150
- */
151
- getTransactionHistory(seed: string, chain: NetworkType, network?: 'mainnet' | 'testnet', limit?: number): Promise<TransactionHistoryResponse>;
152
- /**
153
- * Get transaction status by hash
154
- * Fetches from blockchain explorers to check confirmation status
155
- */
156
- getTransactionStatus(txHash: string, chain: NetworkType, network?: 'mainnet' | 'testnet'): Promise<TransactionStatusResponse>;
137
+ interface BuyItemRequest {
138
+ listingId: string;
139
+ buyerAddress: string;
157
140
  }
158
- /**
159
- * Get or create the WDK API client instance
160
- */
161
- declare function getWdkApiClient(baseUrl?: string): WdkApiClient;
162
-
163
- /**
164
- * Browser-Compatible Address Derivation
165
- *
166
- * This module provides multi-chain address derivation that works in browser environments.
167
- * It uses the @scure libraries which are pure JS and don't require Node.js polyfills.
168
- *
169
- * Supported chains:
170
- * - Ethereum: ethers.js (BIP-44)
171
- * - Bitcoin: @scure/bip32 + @scure/base (BIP-84 native SegWit)
172
- * - Solana: ed25519-hd-key + tweetnacl (SLIP-0010)
173
- * - TON: ed25519 derivation with TON address format
174
- * - TRON: secp256k1 + base58check
175
- * - Spark: Bitcoin-based with custom derivation
176
- */
177
-
178
- interface ChainAddress$1 {
179
- chain: NetworkType;
180
- address: string;
181
- path: string;
182
- }
183
- interface BrowserMultiChainAddresses {
184
- ethereum: string | null;
185
- bitcoin: string | null;
186
- ton: string | null;
187
- tron: string | null;
188
- solana: string | null;
189
- spark: string | null;
141
+ interface BuyItemResponse {
142
+ success: boolean;
143
+ transactionHash?: string;
144
+ tokenId?: string;
145
+ newOwner?: string;
146
+ error?: string;
190
147
  }
191
- /**
192
- * Derive Ethereum address from seed phrase
193
- */
194
- declare function deriveEthereumAddress(seed: string): string;
195
- /**
196
- * Derive Bitcoin address from seed phrase (BIP-84 native SegWit)
197
- * Uses @scure libraries for browser compatibility
198
- */
199
- declare function deriveBitcoinAddress(seed: string, network?: 'mainnet' | 'testnet'): string;
200
- /**
201
- * Derive Solana address from seed phrase using SLIP-0010 (ed25519)
202
- */
203
- declare function deriveSolanaAddress(seed: string): Promise<string>;
204
- /**
205
- * Derive TON address from seed phrase
206
- * Uses proper BIP-44 derivation path m/44'/607'/0'/0'/0'
207
- */
208
- declare function deriveTonAddress(seed: string): Promise<string>;
209
- /**
210
- * Derive TRON address from seed phrase
211
- * TRON uses secp256k1 like Ethereum but with base58check encoding
212
- * Uses @scure/base for browser compatibility
213
- */
214
- declare function deriveTronAddress(seed: string): string;
215
- /**
216
- * Derive Spark address from seed phrase
217
- * Spark uses its own derivation path and bech32 format
218
- * Uses @scure libraries for browser compatibility
219
- */
220
- declare function deriveSparkAddress(seed: string, network?: 'mainnet' | 'testnet'): string;
221
- /**
222
- * Derive addresses for all supported chains
223
- */
224
- declare function deriveAllAddresses(seed: string, network?: 'mainnet' | 'testnet'): Promise<BrowserMultiChainAddresses>;
225
- /**
226
- * Validate a BIP-39 seed phrase using @scure/bip39
227
- */
228
- declare function isValidSeed(seed: string): boolean;
229
- /**
230
- * Generate a random BIP-39 seed phrase using @scure/bip39
231
- */
232
- declare function generateSeedPhrase(): string;
233
-
234
- type BrowserAddressDerivation_BrowserMultiChainAddresses = BrowserMultiChainAddresses;
235
- declare const BrowserAddressDerivation_deriveAllAddresses: typeof deriveAllAddresses;
236
- declare const BrowserAddressDerivation_deriveBitcoinAddress: typeof deriveBitcoinAddress;
237
- declare const BrowserAddressDerivation_deriveEthereumAddress: typeof deriveEthereumAddress;
238
- declare const BrowserAddressDerivation_deriveSolanaAddress: typeof deriveSolanaAddress;
239
- declare const BrowserAddressDerivation_deriveSparkAddress: typeof deriveSparkAddress;
240
- declare const BrowserAddressDerivation_deriveTonAddress: typeof deriveTonAddress;
241
- declare const BrowserAddressDerivation_deriveTronAddress: typeof deriveTronAddress;
242
- declare const BrowserAddressDerivation_generateSeedPhrase: typeof generateSeedPhrase;
243
- declare const BrowserAddressDerivation_isValidSeed: typeof isValidSeed;
244
- declare namespace BrowserAddressDerivation {
245
- export { type BrowserAddressDerivation_BrowserMultiChainAddresses as BrowserMultiChainAddresses, type ChainAddress$1 as ChainAddress, BrowserAddressDerivation_deriveAllAddresses as deriveAllAddresses, BrowserAddressDerivation_deriveBitcoinAddress as deriveBitcoinAddress, BrowserAddressDerivation_deriveEthereumAddress as deriveEthereumAddress, BrowserAddressDerivation_deriveSolanaAddress as deriveSolanaAddress, BrowserAddressDerivation_deriveSparkAddress as deriveSparkAddress, BrowserAddressDerivation_deriveTonAddress as deriveTonAddress, BrowserAddressDerivation_deriveTronAddress as deriveTronAddress, BrowserAddressDerivation_generateSeedPhrase as generateSeedPhrase, BrowserAddressDerivation_isValidSeed as isValidSeed };
148
+ interface CancelListingRequest {
149
+ listingId: string;
246
150
  }
247
-
248
- /**
249
- * Zubari WDK Service - Unified Multi-Chain Wallet Service
250
- *
251
- * This service provides a unified interface for multi-chain wallet operations
252
- * that works in both browser and Node.js environments.
253
- *
254
- * Strategy:
255
- * - Browser: Uses WdkApiClient to call the backend API (which has Tether WDK)
256
- * - Node.js: Uses WdkService natively (with Tether WDK modules)
257
- *
258
- * The Tether WDK (@tetherto/wdk-*) only works in Node.js environments due to
259
- * native dependencies (Electrum client, gRPC, etc.). For browser environments,
260
- * we route all operations through the backend API.
261
- *
262
- * @see https://docs.wallet.tether.io/
263
- */
264
- type SupportedChain = 'ethereum' | 'bitcoin' | 'ton' | 'tron' | 'solana' | 'spark';
265
- interface ChainAddress {
266
- chain: SupportedChain;
267
- address: string;
268
- path: string;
151
+ interface CancelListingResponse {
152
+ success: boolean;
153
+ transactionHash?: string;
154
+ error?: string;
269
155
  }
270
- interface MultiChainAddresses {
271
- ethereum: string | null;
272
- bitcoin: string | null;
273
- ton: string | null;
274
- tron: string | null;
275
- solana: string | null;
276
- spark: string | null;
156
+ interface UpdatePriceRequest {
157
+ listingId: string;
158
+ newPrice: string;
277
159
  }
278
- interface ChainBalance {
279
- chain: SupportedChain;
280
- address: string;
281
- balance: string;
282
- symbol: string;
160
+ interface UpdatePriceResponse {
161
+ success: boolean;
162
+ listing?: MarketListing;
163
+ transactionHash?: string;
164
+ error?: string;
283
165
  }
284
- interface FeeRates {
285
- slow: string;
286
- normal: string;
287
- fast: string;
166
+ interface ListingsResponse {
167
+ success: boolean;
168
+ listings?: MarketListing[];
169
+ pagination?: {
170
+ page: number;
171
+ limit: number;
172
+ total: number;
173
+ pages: number;
174
+ };
175
+ error?: string;
288
176
  }
289
- interface TransactionResult$1 {
177
+ interface MarketStatsResponse {
290
178
  success: boolean;
291
- txHash?: string;
292
- from?: string;
293
- to?: string;
294
- amount?: string;
295
- chain?: string;
296
- network?: string;
179
+ stats?: {
180
+ totalListings: number;
181
+ activeListings: number;
182
+ totalVolume: string;
183
+ totalSales: number;
184
+ averagePrice: string;
185
+ topSellers: Array<{
186
+ address: string;
187
+ sales: number;
188
+ volume: string;
189
+ }>;
190
+ };
297
191
  error?: string;
298
192
  }
299
- interface ZubariWdkServiceConfig {
300
- /** Network to use (mainnet or testnet) */
301
- network: 'mainnet' | 'testnet';
302
- /** API URL for the Zubari backend (required for browser environments) */
303
- apiUrl?: string;
304
- /** Force using API even in Node.js (useful for testing) */
305
- forceApi?: boolean;
306
- /** Request timeout in milliseconds */
307
- timeout?: number;
193
+ interface NFTFilters {
194
+ creatorId?: string;
195
+ ownerId?: string;
196
+ isLazyMinted?: boolean;
197
+ isMinted?: boolean;
198
+ minPrice?: string;
199
+ maxPrice?: string;
200
+ currency?: NFTCurrency;
201
+ page?: number;
202
+ limit?: number;
203
+ }
204
+ interface ListingFilters {
205
+ sellerId?: string;
206
+ status?: 'ACTIVE' | 'SOLD' | 'CANCELLED' | 'EXPIRED';
207
+ minPrice?: string;
208
+ maxPrice?: string;
209
+ currency?: NFTCurrency;
210
+ sortBy?: 'price' | 'createdAt' | 'expiresAt';
211
+ sortOrder?: 'asc' | 'desc';
212
+ page?: number;
213
+ limit?: number;
308
214
  }
309
215
  /**
310
- * Check if we're running in a browser environment
311
- */
312
- declare function isBrowser(): boolean;
313
- /**
314
- * ZubariWdkService - Unified wallet service for browser and Node.js
315
- *
316
- * This service automatically routes operations to:
317
- * - API backend (browser) - using WdkApiClient
318
- * - Native WDK (Node.js) - using WdkService
319
- * - Browser derivation (fallback) - using BrowserAddressDerivation
216
+ * Zubari API Client for backend integration
320
217
  */
321
- declare class ZubariWdkService {
218
+ declare class ZubariApiClient {
322
219
  private config;
323
- private apiClient;
324
- private nativeWdkService;
325
- private initialized;
326
- private useNativeWdk;
327
- constructor(config?: Partial<ZubariWdkServiceConfig>);
220
+ constructor(config: ZubariApiConfig);
328
221
  /**
329
- * Initialize the service and determine the best strategy
222
+ * Set the authentication token
330
223
  */
331
- initialize(): Promise<void>;
224
+ setAuthToken(token: string): void;
332
225
  /**
333
- * Get the current execution mode
226
+ * Clear the authentication token
334
227
  */
335
- getMode(): 'api' | 'native' | 'browser-fallback';
228
+ clearAuthToken(): void;
336
229
  /**
337
- * Check if running in browser
230
+ * Make an authenticated request to the API
338
231
  */
339
- isBrowserEnvironment(): boolean;
232
+ private request;
340
233
  /**
341
- * Generate a new BIP-39 seed phrase (12 words)
234
+ * Get all NFTs with optional filters
342
235
  */
343
- generateSeed(): Promise<string>;
236
+ getNFTs(filters?: NFTFilters): Promise<NFTListResponse>;
344
237
  /**
345
- * Validate a BIP-39 seed phrase
238
+ * Get a single NFT by ID
346
239
  */
347
- validateSeed(seed: string): Promise<boolean>;
348
- /**
349
- * Derive address for a specific chain using WDK API
350
- *
351
- * For Ethereum, falls back to local derivation if API fails.
352
- * For other chains, WDK API is required - no placeholder fallback.
353
- */
354
- deriveAddress(seed: string, chain: SupportedChain): Promise<ChainAddress>;
355
- /**
356
- * Derive addresses for all supported chains using WDK API
357
- *
358
- * Uses the backend WDK API for real cryptographically valid addresses.
359
- * No placeholder fallback - WDK API is required for multi-chain addresses.
360
- */
361
- deriveAllAddresses(seed: string): Promise<MultiChainAddresses>;
362
- /**
363
- * Get balances for all chains
364
- */
365
- getAllBalances(seed: string): Promise<Record<string, ChainBalance | null>>;
366
- /**
367
- * Get fee rates for a chain
368
- */
369
- getFeeRates(seed: string, chain: SupportedChain): Promise<FeeRates>;
370
- /**
371
- * Estimate transaction fee
372
- */
373
- estimateFee(seed: string, chain: SupportedChain, to: string, amount: string): Promise<{
374
- fee: string;
375
- symbol: string;
240
+ getNFT(nftId: string): Promise<{
241
+ success: boolean;
242
+ nft?: NFTResponse;
243
+ error?: string;
376
244
  }>;
377
245
  /**
378
- * Send a transaction
246
+ * Create a new NFT (lazy minted)
379
247
  */
380
- sendTransaction(seed: string, chain: SupportedChain, to: string, amount: string): Promise<TransactionResult$1>;
381
- /**
382
- * Get the network configuration
383
- */
384
- getNetwork(): 'mainnet' | 'testnet';
385
- /**
386
- * Get API URL
387
- */
388
- getApiUrl(): string;
389
- private getDerivationPath;
390
- private getChainSymbol;
391
- /**
392
- * Derive address using browser-compatible libraries
393
- */
394
- private deriveBrowserAddress;
395
- /**
396
- * Derive all addresses using browser-compatible libraries
397
- */
398
- private deriveAllBrowserAddresses;
399
- }
400
- /**
401
- * Get or create the default ZubariWdkService instance
402
- */
403
- declare function getZubariWdkService(config?: Partial<ZubariWdkServiceConfig>): ZubariWdkService;
404
- /**
405
- * Create a new ZubariWdkService instance
406
- */
407
- declare function createZubariWdkService(config?: Partial<ZubariWdkServiceConfig>): ZubariWdkService;
408
-
409
- /**
410
- * Transaction Service for Zubari SDK
411
- *
412
- * Provides multi-chain transaction capabilities using Tether WDK.
413
- * Supports Ethereum, Bitcoin, Solana, TON, TRON, and Spark (Lightning).
414
- *
415
- * @see https://docs.wallet.tether.io/
416
- */
417
-
418
- /**
419
- * Transaction parameters for sending
420
- */
421
- interface TransactionParams {
422
- /** Recipient address */
423
- to: string;
424
- /** Amount to send (in human-readable format, e.g., "0.1") */
425
- amount: string;
426
- /** Token address (optional, for ERC-20/SPL tokens) */
427
- token?: string;
428
- /** Transaction memo/message (for chains that support it) */
429
- memo?: string;
430
- /** Fee priority: 'slow' | 'medium' | 'fast' */
431
- feePriority?: 'slow' | 'medium' | 'fast';
432
- /** Custom gas limit (EVM chains) */
433
- gasLimit?: string;
434
- /** Custom gas price (EVM chains) */
435
- gasPrice?: string;
436
- }
437
- /**
438
- * Transaction result with detailed information
439
- */
440
- interface TransactionResult {
441
- /** Transaction hash */
442
- hash: string;
443
- /** Network/chain */
444
- network: NetworkType;
445
- /** Transaction status */
446
- status: 'pending' | 'confirmed' | 'failed';
447
- /** Block number (when confirmed) */
448
- blockNumber?: number;
449
- /** Gas used (EVM chains) */
450
- gasUsed?: string;
451
- /** Fee paid */
452
- fee?: string;
453
- /** Explorer URL */
454
- explorerUrl?: string;
455
- /** Error message if failed */
456
- error?: string;
457
- /** Timestamp */
458
- timestamp: number;
459
- }
460
- /**
461
- * Transaction history item
462
- */
463
- interface TransactionHistoryItem {
464
- hash: string;
465
- network: NetworkType;
466
- type: 'send' | 'receive' | 'swap' | 'contract';
467
- from: string;
468
- to: string;
469
- amount: string;
470
- token?: string;
471
- fee?: string;
472
- status: 'pending' | 'confirmed' | 'failed';
473
- timestamp: number;
474
- blockNumber?: number;
475
- }
476
- /**
477
- * Fee estimate for a transaction
478
- */
479
- interface FeeEstimate {
480
- slow: {
481
- fee: string;
482
- estimatedTime: string;
483
- };
484
- medium: {
485
- fee: string;
486
- estimatedTime: string;
487
- };
488
- fast: {
489
- fee: string;
490
- estimatedTime: string;
491
- };
492
- }
493
- /**
494
- * Transaction Service configuration
495
- */
496
- interface TransactionServiceConfig {
497
- network: 'mainnet' | 'testnet';
498
- rpcUrls?: Partial<Record<NetworkType, string>>;
499
- }
500
- /**
501
- * Transaction Service
502
- *
503
- * Provides multi-chain transaction capabilities:
504
- * - Send native tokens (ETH, BTC, SOL, TON, TRX)
505
- * - Send ERC-20/SPL tokens
506
- * - Fee estimation
507
- * - Transaction history
508
- */
509
- declare class TransactionService {
510
- private seed;
511
- private config;
512
- private wallets;
513
- constructor(config?: Partial<TransactionServiceConfig>);
514
- /**
515
- * Ensure WDK modules are loaded
516
- */
517
- private ensureLoaded;
518
- /**
519
- * Get RPC URL for a chain
520
- */
521
- private getRpcUrl;
522
- /**
523
- * Get explorer URL for a transaction
524
- */
525
- getExplorerUrl(chain: NetworkType, txHash: string): string;
248
+ createNFT(data: CreateNFTRequest, image: File | Blob): Promise<{
249
+ success: boolean;
250
+ nft?: NFTResponse;
251
+ error?: string;
252
+ }>;
526
253
  /**
527
- * Initialize the service with a seed phrase
254
+ * Create a voucher for an NFT (EIP-712 signed)
528
255
  */
529
- initialize(seed: string): Promise<void>;
256
+ createVoucher(nftId: string, params: CreateVoucherRequest): Promise<CreateVoucherResponse>;
530
257
  /**
531
- * Check if service is initialized
258
+ * Redeem an NFT voucher (buy/mint)
532
259
  */
533
- isInitialized(): boolean;
260
+ redeemVoucher(nftId: string, params: RedeemVoucherRequest): Promise<RedeemVoucherResponse>;
534
261
  /**
535
- * Get or create wallet instance for a specific chain
262
+ * Get voucher status for an NFT
536
263
  */
537
- private getWallet;
264
+ getVoucherStatus(nftId: string): Promise<VoucherStatusResponse>;
538
265
  /**
539
- * Estimate transaction fee
266
+ * Get all active listings
540
267
  */
541
- estimateFee(chain: NetworkType, params: TransactionParams): Promise<FeeEstimate>;
268
+ getListings(filters?: ListingFilters): Promise<ListingsResponse>;
542
269
  /**
543
- * Send a transaction
270
+ * List an NFT for sale
544
271
  */
545
- send(chain: NetworkType, params: TransactionParams): Promise<TransactionResult>;
272
+ listItem(params: ListItemRequest): Promise<ListItemResponse>;
546
273
  /**
547
- * Get transaction status
274
+ * Buy a listed NFT
548
275
  */
549
- getTransactionStatus(chain: NetworkType, txHash: string): Promise<TransactionResult>;
276
+ buyItem(params: BuyItemRequest): Promise<BuyItemResponse>;
550
277
  /**
551
- * Get transaction history for an address
278
+ * Cancel a listing
552
279
  */
553
- getTransactionHistory(chain: NetworkType, limit?: number): Promise<TransactionHistoryItem[]>;
280
+ cancelListing(params: CancelListingRequest): Promise<CancelListingResponse>;
554
281
  /**
555
- * Get balance for a specific chain
282
+ * Update listing price
556
283
  */
557
- getBalance(chain: NetworkType): Promise<{
558
- balance: string;
559
- balanceUsd: number;
560
- }>;
284
+ updateListingPrice(params: UpdatePriceRequest): Promise<UpdatePriceResponse>;
561
285
  /**
562
- * Get the current network configuration
286
+ * Get current user's listings
563
287
  */
564
- getNetwork(): 'mainnet' | 'testnet';
288
+ getMyListings(filters?: Omit<ListingFilters, 'sellerId'>): Promise<ListingsResponse>;
565
289
  /**
566
- * Clean up and dispose of wallet instances
290
+ * Get marketplace statistics
567
291
  */
568
- dispose(): void;
292
+ getMarketStats(): Promise<MarketStatsResponse>;
569
293
  }
570
294
  /**
571
- * Get or create the Transaction service singleton
295
+ * Get or create the Zubari API client instance
572
296
  */
573
- declare function getTransactionService(config?: Partial<TransactionServiceConfig>): TransactionService;
297
+ declare function getZubariApiClient(config?: Partial<ZubariApiConfig>): ZubariApiClient;
574
298
  /**
575
- * Create a new Transaction service instance (non-singleton)
299
+ * Create a new Zubari API client instance
576
300
  */
577
- declare function createTransactionService(config?: Partial<TransactionServiceConfig>): TransactionService;
301
+ declare function createZubariApiClient(config: ZubariApiConfig): ZubariApiClient;
578
302
 
579
- export { BrowserAddressDerivation, type ChainAddress$1 as BrowserChainAddress, type BrowserMultiChainAddresses, type ChainAddress, type ChainBalance, type DeriveAddressResponse, type DeriveAllAddressesResponse, type FeeEstimate, type FeeRates, type GenerateSeedResponse, type MultiChainAddresses, type SendTransactionResponse, type SupportedChain, SwapService, type TransactionHistoryItem, type TransactionHistoryResponse, type TransactionParams, type TransactionResult, TransactionService, type TransactionServiceConfig, type TransactionStatusResponse, type ValidateSeedResponse, WdkApiClient, type WdkApiConfig, type TransactionHistoryItem$1 as WdkTransactionHistoryItem, type TransactionResult$1 as WdkTransactionResult, ZubariWdkService, type ZubariWdkServiceConfig, createTransactionService, createZubariWdkService, getTransactionService, getWdkApiClient, getZubariWdkService, isBrowser };
303
+ export { type BuyItemRequest, type BuyItemResponse, type CancelListingRequest, type CancelListingResponse, type CreateNFTRequest, type CreateVoucherRequest, type CreateVoucherResponse, type ListItemRequest, type ListItemResponse, type ListingFilters, type ListingsResponse, type MarketListing, type MarketStatsResponse, type NFTFilters, type NFTListResponse, type NFTResponse, type NFTVoucher, type RedeemVoucherRequest, type RedeemVoucherResponse, type UpdatePriceRequest, type UpdatePriceResponse, type VoucherStatusResponse, ZubariApiClient, type ZubariApiConfig, createZubariApiClient, getZubariApiClient };