@zubari/sdk 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/{TransactionService-8xSEGoWA.d.mts → TransactionService-DURp3bRL.d.ts} +34 -10
  2. package/dist/{TransactionService-CaIcCoqY.d.ts → TransactionService-DuMJmrG3.d.mts} +34 -10
  3. package/dist/{WalletManager-B1qvFF4K.d.mts → WalletManager-D0xMpgfo.d.mts} +133 -50
  4. package/dist/{WalletManager-CCs4Jsv7.d.ts → WalletManager-DsAg7MwL.d.ts} +133 -50
  5. package/dist/{index-Cx389p_j.d.mts → index-DF0Gf8NK.d.mts} +7 -1
  6. package/dist/{index-Cx389p_j.d.ts → index-DF0Gf8NK.d.ts} +7 -1
  7. package/dist/{index-Cqrpp3XA.d.ts → index-N2u4haqL.d.mts} +22 -11
  8. package/dist/{index-BOc9U2TK.d.mts → index-kS-xopkl.d.ts} +22 -11
  9. package/dist/index.d.mts +6 -5
  10. package/dist/index.d.ts +6 -5
  11. package/dist/index.js +3064 -1770
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +3064 -1770
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/protocols/index.d.mts +54 -22
  16. package/dist/protocols/index.d.ts +54 -22
  17. package/dist/protocols/index.js +1008 -76
  18. package/dist/protocols/index.js.map +1 -1
  19. package/dist/protocols/index.mjs +1008 -76
  20. package/dist/protocols/index.mjs.map +1 -1
  21. package/dist/react/index.d.mts +5 -4
  22. package/dist/react/index.d.ts +5 -4
  23. package/dist/react/index.js +884 -884
  24. package/dist/react/index.js.map +1 -1
  25. package/dist/react/index.mjs +884 -884
  26. package/dist/react/index.mjs.map +1 -1
  27. package/dist/services/index.d.mts +2 -2
  28. package/dist/services/index.d.ts +2 -2
  29. package/dist/services/index.js +152 -75
  30. package/dist/services/index.js.map +1 -1
  31. package/dist/services/index.mjs +152 -75
  32. package/dist/services/index.mjs.map +1 -1
  33. package/dist/wallet/index.d.mts +5 -4
  34. package/dist/wallet/index.d.ts +5 -4
  35. package/dist/wallet/index.js +1352 -1105
  36. package/dist/wallet/index.js.map +1 -1
  37. package/dist/wallet/index.mjs +1352 -1105
  38. package/dist/wallet/index.mjs.map +1 -1
  39. package/package.json +9 -6
@@ -1,4 +1,4 @@
1
- import { C as CreateVoucherParams, L as LazyMintVoucher, e as NFTMetadata, c as TxResult, g as ListingParams, f as NFT, B as BuyParams, h as Listing, l as Tip, m as SubscriptionPlan, n as Subscription, E as EarningsBreakdown, s as EarningsResponse, P as PayoutHistoryResponse, t as BreakdownResponse, u as PlatformFeeResponse, v as ClaimResult, R as RevenueSplit } from '../index-Cx389p_j.mjs';
1
+ import { C as CreateVoucherParams, L as LazyMintVoucher, e as NFTMetadata, c as TxResult, g as ListingParams, f as NFT, B as BuyParams, h as Listing, l as Tip, m as SubscriptionPlan, n as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from '../index-DF0Gf8NK.mjs';
2
2
 
3
3
  /**
4
4
  * ZubariNFTProtocol - NFT creation and marketplace operations
@@ -11,8 +11,9 @@ declare class ZubariNFTProtocol {
11
11
  private readonly _marketplaceAddress;
12
12
  private readonly chainId;
13
13
  private readonly network;
14
+ private readonly apiClient;
14
15
  private nonceCounter;
15
- constructor(contractAddress: string, marketplaceAddress: string, chainId: number, network?: 'testnet' | 'mainnet');
16
+ constructor(contractAddress: string, marketplaceAddress: string, chainId: number, network?: 'testnet' | 'mainnet', apiUrl?: string);
16
17
  /**
17
18
  * Convert human-readable price to wei
18
19
  * @param price - Price in human-readable format (e.g., "1.5")
@@ -50,24 +51,30 @@ declare class ZubariNFTProtocol {
50
51
  }): Promise<LazyMintVoucher>;
51
52
  /**
52
53
  * Redeem a lazy mint voucher to mint the NFT on-chain
54
+ * Uses the backend API which handles the on-chain transaction
53
55
  */
54
- redeemVoucher(voucher: LazyMintVoucher, _buyerAddress: string): Promise<TxResult>;
56
+ redeemVoucher(voucher: LazyMintVoucher, buyerAddress: string, nftId: string, authToken: string): Promise<TxResult>;
55
57
  /**
56
- * List an NFT for sale on the marketplace
58
+ * List an NFT for sale on the marketplace via backend API
57
59
  */
58
- listForSale(_params: ListingParams): Promise<TxResult>;
60
+ listForSale(params: ListingParams, authToken: string): Promise<TxResult>;
59
61
  /**
60
- * Buy an NFT from the marketplace
62
+ * Buy an NFT from the marketplace via backend API
61
63
  */
62
- buyNFT(_listingId: string, _price: bigint): Promise<TxResult>;
64
+ buyNFT(listingId: string, price: bigint, buyerAddress: string): Promise<TxResult>;
63
65
  /**
64
66
  * Transfer an NFT to another address
67
+ * Note: This requires direct contract interaction via wallet
65
68
  */
66
- transfer(_tokenId: string, _to: string): Promise<TxResult>;
69
+ transfer(tokenId: string, to: string, from: string, signer: {
70
+ sendTransaction: (tx: object) => Promise<{
71
+ hash: string;
72
+ }>;
73
+ }): Promise<TxResult>;
67
74
  /**
68
- * Get NFTs owned by an address
75
+ * Get NFTs owned by an address via backend API
69
76
  */
70
- getOwnedNFTs(_address: string): Promise<NFT[]>;
77
+ getOwnedNFTs(address: string): Promise<NFT[]>;
71
78
  /**
72
79
  * Generate a random tokenId (32 bytes hex)
73
80
  */
@@ -628,11 +635,13 @@ declare class ZubariPayoutsProtocol {
628
635
  private readonly contractAddress;
629
636
  private readonly chainId;
630
637
  private readonly apiBaseUrl;
638
+ private readonly apiClient;
631
639
  constructor(contractAddress: string, chainId: number, apiBaseUrl?: string);
632
640
  /**
633
- * Get pending earnings breakdown for the current user (on-chain)
641
+ * Get pending earnings breakdown for the current user via API
642
+ * Uses backend API which reads from contract/database
634
643
  */
635
- getPendingEarnings(): Promise<EarningsBreakdown>;
644
+ getPendingEarnings(authToken: string): Promise<EarningsBreakdown>;
636
645
  /**
637
646
  * Get earnings data from API (includes pending, total, breakdown, and recent payouts)
638
647
  * Requires authentication token
@@ -653,9 +662,9 @@ declare class ZubariPayoutsProtocol {
653
662
  */
654
663
  getPlatformFee(): Promise<PlatformFeeResponse>;
655
664
  /**
656
- * Get historical earnings for a time period
665
+ * Get historical earnings for a time period via API
657
666
  */
658
- getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
667
+ getEarningsHistory(authToken: string, period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
659
668
  /**
660
669
  * Claim all pending earnings via API
661
670
  * Requires authentication token and seed phrase
@@ -663,29 +672,52 @@ declare class ZubariPayoutsProtocol {
663
672
  claimEarningsViaApi(authToken: string, seed: string): Promise<ClaimResult>;
664
673
  /**
665
674
  * Claim all pending earnings (direct contract call)
675
+ * Requires a signer with sendTransaction capability
666
676
  */
667
- claimEarnings(): Promise<TxResult>;
677
+ claimEarnings(tokenAddress: string, signer: {
678
+ sendTransaction: (tx: object) => Promise<{
679
+ hash: string;
680
+ }>;
681
+ }): Promise<TxResult>;
668
682
  /**
669
683
  * Claim specific amount of earnings
684
+ * Requires a signer with sendTransaction capability
670
685
  */
671
- claimPartialEarnings(amount: bigint): Promise<TxResult>;
686
+ claimPartialEarnings(tokenAddress: string, amount: bigint, signer: {
687
+ sendTransaction: (tx: object) => Promise<{
688
+ hash: string;
689
+ }>;
690
+ }): Promise<TxResult>;
672
691
  /**
673
692
  * Setup revenue split with collaborators
674
693
  * Basis points must sum to 10000 (100%)
694
+ * Requires a signer with sendTransaction capability
675
695
  */
676
- setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
696
+ setupRevenueSplit(splits: RevenueSplit[], signer: {
697
+ sendTransaction: (tx: object) => Promise<{
698
+ hash: string;
699
+ }>;
700
+ }): Promise<TxResult>;
677
701
  /**
678
- * Get current revenue split configuration
702
+ * Get current revenue split configuration via API
679
703
  */
680
- getRevenueSplit(): Promise<RevenueSplit[]>;
704
+ getRevenueSplit(creatorAddress: string): Promise<RevenueSplit[]>;
681
705
  /**
682
706
  * Remove revenue split (creator gets 100%)
707
+ * Requires a signer with sendTransaction capability
683
708
  */
684
- removeRevenueSplit(): Promise<TxResult>;
709
+ removeRevenueSplit(signer: {
710
+ sendTransaction: (tx: object) => Promise<{
711
+ hash: string;
712
+ }>;
713
+ }): Promise<TxResult>;
685
714
  /**
686
- * Convert earnings to stablecoin (USDT)
715
+ * Convert earnings to stablecoin (USDT) via swap
716
+ * This will be implemented when SwapService is complete
687
717
  */
688
- convertToStable(token: string, amount: bigint): Promise<TxResult>;
718
+ convertToStable(token: string, amount: bigint, swapService?: {
719
+ executeSwap: (params: object) => Promise<TxResult>;
720
+ }): Promise<TxResult>;
689
721
  /**
690
722
  * Get the contract address
691
723
  */
@@ -1,4 +1,4 @@
1
- import { C as CreateVoucherParams, L as LazyMintVoucher, e as NFTMetadata, c as TxResult, g as ListingParams, f as NFT, B as BuyParams, h as Listing, l as Tip, m as SubscriptionPlan, n as Subscription, E as EarningsBreakdown, s as EarningsResponse, P as PayoutHistoryResponse, t as BreakdownResponse, u as PlatformFeeResponse, v as ClaimResult, R as RevenueSplit } from '../index-Cx389p_j.js';
1
+ import { C as CreateVoucherParams, L as LazyMintVoucher, e as NFTMetadata, c as TxResult, g as ListingParams, f as NFT, B as BuyParams, h as Listing, l as Tip, m as SubscriptionPlan, n as Subscription, E as EarningsBreakdown, t as EarningsResponse, P as PayoutHistoryResponse, u as BreakdownResponse, v as PlatformFeeResponse, w as ClaimResult, R as RevenueSplit } from '../index-DF0Gf8NK.js';
2
2
 
3
3
  /**
4
4
  * ZubariNFTProtocol - NFT creation and marketplace operations
@@ -11,8 +11,9 @@ declare class ZubariNFTProtocol {
11
11
  private readonly _marketplaceAddress;
12
12
  private readonly chainId;
13
13
  private readonly network;
14
+ private readonly apiClient;
14
15
  private nonceCounter;
15
- constructor(contractAddress: string, marketplaceAddress: string, chainId: number, network?: 'testnet' | 'mainnet');
16
+ constructor(contractAddress: string, marketplaceAddress: string, chainId: number, network?: 'testnet' | 'mainnet', apiUrl?: string);
16
17
  /**
17
18
  * Convert human-readable price to wei
18
19
  * @param price - Price in human-readable format (e.g., "1.5")
@@ -50,24 +51,30 @@ declare class ZubariNFTProtocol {
50
51
  }): Promise<LazyMintVoucher>;
51
52
  /**
52
53
  * Redeem a lazy mint voucher to mint the NFT on-chain
54
+ * Uses the backend API which handles the on-chain transaction
53
55
  */
54
- redeemVoucher(voucher: LazyMintVoucher, _buyerAddress: string): Promise<TxResult>;
56
+ redeemVoucher(voucher: LazyMintVoucher, buyerAddress: string, nftId: string, authToken: string): Promise<TxResult>;
55
57
  /**
56
- * List an NFT for sale on the marketplace
58
+ * List an NFT for sale on the marketplace via backend API
57
59
  */
58
- listForSale(_params: ListingParams): Promise<TxResult>;
60
+ listForSale(params: ListingParams, authToken: string): Promise<TxResult>;
59
61
  /**
60
- * Buy an NFT from the marketplace
62
+ * Buy an NFT from the marketplace via backend API
61
63
  */
62
- buyNFT(_listingId: string, _price: bigint): Promise<TxResult>;
64
+ buyNFT(listingId: string, price: bigint, buyerAddress: string): Promise<TxResult>;
63
65
  /**
64
66
  * Transfer an NFT to another address
67
+ * Note: This requires direct contract interaction via wallet
65
68
  */
66
- transfer(_tokenId: string, _to: string): Promise<TxResult>;
69
+ transfer(tokenId: string, to: string, from: string, signer: {
70
+ sendTransaction: (tx: object) => Promise<{
71
+ hash: string;
72
+ }>;
73
+ }): Promise<TxResult>;
67
74
  /**
68
- * Get NFTs owned by an address
75
+ * Get NFTs owned by an address via backend API
69
76
  */
70
- getOwnedNFTs(_address: string): Promise<NFT[]>;
77
+ getOwnedNFTs(address: string): Promise<NFT[]>;
71
78
  /**
72
79
  * Generate a random tokenId (32 bytes hex)
73
80
  */
@@ -628,11 +635,13 @@ declare class ZubariPayoutsProtocol {
628
635
  private readonly contractAddress;
629
636
  private readonly chainId;
630
637
  private readonly apiBaseUrl;
638
+ private readonly apiClient;
631
639
  constructor(contractAddress: string, chainId: number, apiBaseUrl?: string);
632
640
  /**
633
- * Get pending earnings breakdown for the current user (on-chain)
641
+ * Get pending earnings breakdown for the current user via API
642
+ * Uses backend API which reads from contract/database
634
643
  */
635
- getPendingEarnings(): Promise<EarningsBreakdown>;
644
+ getPendingEarnings(authToken: string): Promise<EarningsBreakdown>;
636
645
  /**
637
646
  * Get earnings data from API (includes pending, total, breakdown, and recent payouts)
638
647
  * Requires authentication token
@@ -653,9 +662,9 @@ declare class ZubariPayoutsProtocol {
653
662
  */
654
663
  getPlatformFee(): Promise<PlatformFeeResponse>;
655
664
  /**
656
- * Get historical earnings for a time period
665
+ * Get historical earnings for a time period via API
657
666
  */
658
- getEarningsHistory(period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
667
+ getEarningsHistory(authToken: string, period?: 'day' | 'week' | 'month' | 'all'): Promise<EarningsBreakdown[]>;
659
668
  /**
660
669
  * Claim all pending earnings via API
661
670
  * Requires authentication token and seed phrase
@@ -663,29 +672,52 @@ declare class ZubariPayoutsProtocol {
663
672
  claimEarningsViaApi(authToken: string, seed: string): Promise<ClaimResult>;
664
673
  /**
665
674
  * Claim all pending earnings (direct contract call)
675
+ * Requires a signer with sendTransaction capability
666
676
  */
667
- claimEarnings(): Promise<TxResult>;
677
+ claimEarnings(tokenAddress: string, signer: {
678
+ sendTransaction: (tx: object) => Promise<{
679
+ hash: string;
680
+ }>;
681
+ }): Promise<TxResult>;
668
682
  /**
669
683
  * Claim specific amount of earnings
684
+ * Requires a signer with sendTransaction capability
670
685
  */
671
- claimPartialEarnings(amount: bigint): Promise<TxResult>;
686
+ claimPartialEarnings(tokenAddress: string, amount: bigint, signer: {
687
+ sendTransaction: (tx: object) => Promise<{
688
+ hash: string;
689
+ }>;
690
+ }): Promise<TxResult>;
672
691
  /**
673
692
  * Setup revenue split with collaborators
674
693
  * Basis points must sum to 10000 (100%)
694
+ * Requires a signer with sendTransaction capability
675
695
  */
676
- setupRevenueSplit(splits: RevenueSplit[]): Promise<TxResult>;
696
+ setupRevenueSplit(splits: RevenueSplit[], signer: {
697
+ sendTransaction: (tx: object) => Promise<{
698
+ hash: string;
699
+ }>;
700
+ }): Promise<TxResult>;
677
701
  /**
678
- * Get current revenue split configuration
702
+ * Get current revenue split configuration via API
679
703
  */
680
- getRevenueSplit(): Promise<RevenueSplit[]>;
704
+ getRevenueSplit(creatorAddress: string): Promise<RevenueSplit[]>;
681
705
  /**
682
706
  * Remove revenue split (creator gets 100%)
707
+ * Requires a signer with sendTransaction capability
683
708
  */
684
- removeRevenueSplit(): Promise<TxResult>;
709
+ removeRevenueSplit(signer: {
710
+ sendTransaction: (tx: object) => Promise<{
711
+ hash: string;
712
+ }>;
713
+ }): Promise<TxResult>;
685
714
  /**
686
- * Convert earnings to stablecoin (USDT)
715
+ * Convert earnings to stablecoin (USDT) via swap
716
+ * This will be implemented when SwapService is complete
687
717
  */
688
- convertToStable(token: string, amount: bigint): Promise<TxResult>;
718
+ convertToStable(token: string, amount: bigint, swapService?: {
719
+ executeSwap: (params: object) => Promise<TxResult>;
720
+ }): Promise<TxResult>;
689
721
  /**
690
722
  * Get the contract address
691
723
  */