@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.
- package/dist/{TransactionService-8xSEGoWA.d.mts → TransactionService-DURp3bRL.d.ts} +34 -10
- package/dist/{TransactionService-CaIcCoqY.d.ts → TransactionService-DuMJmrG3.d.mts} +34 -10
- package/dist/{WalletManager-B1qvFF4K.d.mts → WalletManager-D0xMpgfo.d.mts} +133 -50
- package/dist/{WalletManager-CCs4Jsv7.d.ts → WalletManager-DsAg7MwL.d.ts} +133 -50
- package/dist/{index-Cx389p_j.d.mts → index-DF0Gf8NK.d.mts} +7 -1
- package/dist/{index-Cx389p_j.d.ts → index-DF0Gf8NK.d.ts} +7 -1
- package/dist/{index-Cqrpp3XA.d.ts → index-N2u4haqL.d.mts} +22 -11
- package/dist/{index-BOc9U2TK.d.mts → index-kS-xopkl.d.ts} +22 -11
- package/dist/index.d.mts +6 -5
- package/dist/index.d.ts +6 -5
- package/dist/index.js +3064 -1770
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3064 -1770
- package/dist/index.mjs.map +1 -1
- package/dist/protocols/index.d.mts +54 -22
- package/dist/protocols/index.d.ts +54 -22
- package/dist/protocols/index.js +1008 -76
- package/dist/protocols/index.js.map +1 -1
- package/dist/protocols/index.mjs +1008 -76
- package/dist/protocols/index.mjs.map +1 -1
- package/dist/react/index.d.mts +5 -4
- package/dist/react/index.d.ts +5 -4
- package/dist/react/index.js +884 -884
- package/dist/react/index.js.map +1 -1
- package/dist/react/index.mjs +884 -884
- package/dist/react/index.mjs.map +1 -1
- package/dist/services/index.d.mts +2 -2
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.js +152 -75
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs +152 -75
- package/dist/services/index.mjs.map +1 -1
- package/dist/wallet/index.d.mts +5 -4
- package/dist/wallet/index.d.ts +5 -4
- package/dist/wallet/index.js +1352 -1105
- package/dist/wallet/index.js.map +1 -1
- package/dist/wallet/index.mjs +1352 -1105
- package/dist/wallet/index.mjs.map +1 -1
- 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,
|
|
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,
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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[]
|
|
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(
|
|
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
|
|
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,
|
|
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,
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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
|
|
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[]
|
|
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(
|
|
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
|
|
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
|
*/
|