@tetsuo-ai/marketplace-react 0.3.1 → 0.3.2
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/CHANGELOG.md +13 -0
- package/dist/{chunk-FAIRTAIB.js → chunk-2Y6JN2VZ.js} +3 -3
- package/dist/{chunk-FAIRTAIB.js.map → chunk-2Y6JN2VZ.js.map} +1 -1
- package/dist/{chunk-D2TDU3TJ.js → chunk-AKPPKMQ2.js} +3 -3
- package/dist/{chunk-D2TDU3TJ.js.map → chunk-AKPPKMQ2.js.map} +1 -1
- package/dist/{chunk-ECU7HGO3.js → chunk-H6PJIDQR.js} +4 -3
- package/dist/chunk-H6PJIDQR.js.map +1 -0
- package/dist/{chunk-MNJ2EQDJ.js → chunk-ON6XR4XO.js} +3 -3
- package/dist/{chunk-MNJ2EQDJ.js.map → chunk-ON6XR4XO.js.map} +1 -1
- package/dist/{chunk-WJUVTFJ7.js → chunk-ZAMIL27X.js} +4 -4
- package/dist/{chunk-WJUVTFJ7.js.map → chunk-ZAMIL27X.js.map} +1 -1
- package/dist/components/index.cjs +2 -1
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.d.cts +1 -1
- package/dist/components/index.d.ts +1 -1
- package/dist/components/index.js +3 -3
- package/dist/hooks/index.cjs +42 -8
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.cts +6 -8
- package/dist/hooks/index.d.ts +6 -8
- package/dist/hooks/index.js +44 -11
- package/dist/hooks/index.js.map +1 -1
- package/dist/{index-DGq7M4mo.d.ts → index-DQ3Xovkq.d.ts} +8 -1
- package/dist/{index-CrEAPlme.d.cts → index-UxuvIlmD.d.cts} +8 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -8
- package/dist/index.js.map +1 -1
- package/dist/signers/index.cjs +2 -1
- package/dist/signers/index.cjs.map +1 -1
- package/dist/signers/index.js +2 -2
- package/package.json +1 -1
- package/src/hooks/useReferrerEarnings.ts +73 -38
- package/src/provider/AgencProvider.tsx +1 -0
- package/src/strings/index.ts +3 -1
- package/src/types.ts +6 -0
- package/dist/chunk-ECU7HGO3.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as AgentVerificationReader, f as AgentVerificationReaderOptions, g as AgentVerificationResult, h as AgentVerificationRpc, B as Badge, i as BadgeProps, j as BadgeTone, k as Button, l as ButtonProps, m as ButtonVariant, n as COMPONENT_CATALOG, o as ComponentStringId, D as DEFAULT_TRUST_HREF, p as DisputeBanner, q as DisputeBannerProps, E as EN_COMPONENT_STRINGS, H as HireButton, s as HireButtonProps, t as HireCheckoutListing, u as HireCheckoutModal, v as HireCheckoutModalProps, L as ListingCard, w as ListingCardData, x as ListingCardProps, y as ListingGrid, z as ListingGridProps, M as Modal, F as ModalProps, J as ModerationBadge, K as ModerationBadgeProps, N as ModerationState, P as PoweredByAgenC, O as PoweredByAgenCProps, Q as ProviderCard, S as ProviderCardProps, U as ReferrerDisclosure, W as ReferrerDisclosureProps, X as ReviewPanel, Y as ReviewPanelProps, Z as Spinner, _ as SpinnerProps, $ as StateKind, a0 as StateMessage, a1 as StateMessageProps, a5 as TaskTimeline, a6 as TaskTimelineProps, a7 as ThemableProps, a9 as UNVERIFIED, aa as UseAgentVerificationOptions, ab as UseAgentVerificationResult, ac as VerifiedBadge, ad as VerifiedBadgeProps, ae as agentVerificationReaderFromRpc, af as cx, ag as decodeListingCategory, ah as decodeListingName, ai as decodeListingTags, aj as elementClass, ak as evaluateAgentVerification, al as formatPriceSol, am as formatRate, an as formatSol, ao as moderationStateOf, ap as rootClass, ar as tc, as as toHex, at as truncateAddress, au as useAgentVerification, av as useFocusTrap } from '../index-
|
|
1
|
+
export { e as AgentVerificationReader, f as AgentVerificationReaderOptions, g as AgentVerificationResult, h as AgentVerificationRpc, B as Badge, i as BadgeProps, j as BadgeTone, k as Button, l as ButtonProps, m as ButtonVariant, n as COMPONENT_CATALOG, o as ComponentStringId, D as DEFAULT_TRUST_HREF, p as DisputeBanner, q as DisputeBannerProps, E as EN_COMPONENT_STRINGS, H as HireButton, s as HireButtonProps, t as HireCheckoutListing, u as HireCheckoutModal, v as HireCheckoutModalProps, L as ListingCard, w as ListingCardData, x as ListingCardProps, y as ListingGrid, z as ListingGridProps, M as Modal, F as ModalProps, J as ModerationBadge, K as ModerationBadgeProps, N as ModerationState, P as PoweredByAgenC, O as PoweredByAgenCProps, Q as ProviderCard, S as ProviderCardProps, U as ReferrerDisclosure, W as ReferrerDisclosureProps, X as ReviewPanel, Y as ReviewPanelProps, Z as Spinner, _ as SpinnerProps, $ as StateKind, a0 as StateMessage, a1 as StateMessageProps, a5 as TaskTimeline, a6 as TaskTimelineProps, a7 as ThemableProps, a9 as UNVERIFIED, aa as UseAgentVerificationOptions, ab as UseAgentVerificationResult, ac as VerifiedBadge, ad as VerifiedBadgeProps, ae as agentVerificationReaderFromRpc, af as cx, ag as decodeListingCategory, ah as decodeListingName, ai as decodeListingTags, aj as elementClass, ak as evaluateAgentVerification, al as formatPriceSol, am as formatRate, an as formatSol, ao as moderationStateOf, ap as rootClass, ar as tc, as as toHex, at as truncateAddress, au as useAgentVerification, av as useFocusTrap } from '../index-UxuvIlmD.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@tetsuo-ai/marketplace-sdk';
|
|
4
4
|
import '@solana/kit';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { e as AgentVerificationReader, f as AgentVerificationReaderOptions, g as AgentVerificationResult, h as AgentVerificationRpc, B as Badge, i as BadgeProps, j as BadgeTone, k as Button, l as ButtonProps, m as ButtonVariant, n as COMPONENT_CATALOG, o as ComponentStringId, D as DEFAULT_TRUST_HREF, p as DisputeBanner, q as DisputeBannerProps, E as EN_COMPONENT_STRINGS, H as HireButton, s as HireButtonProps, t as HireCheckoutListing, u as HireCheckoutModal, v as HireCheckoutModalProps, L as ListingCard, w as ListingCardData, x as ListingCardProps, y as ListingGrid, z as ListingGridProps, M as Modal, F as ModalProps, J as ModerationBadge, K as ModerationBadgeProps, N as ModerationState, P as PoweredByAgenC, O as PoweredByAgenCProps, Q as ProviderCard, S as ProviderCardProps, U as ReferrerDisclosure, W as ReferrerDisclosureProps, X as ReviewPanel, Y as ReviewPanelProps, Z as Spinner, _ as SpinnerProps, $ as StateKind, a0 as StateMessage, a1 as StateMessageProps, a5 as TaskTimeline, a6 as TaskTimelineProps, a7 as ThemableProps, a9 as UNVERIFIED, aa as UseAgentVerificationOptions, ab as UseAgentVerificationResult, ac as VerifiedBadge, ad as VerifiedBadgeProps, ae as agentVerificationReaderFromRpc, af as cx, ag as decodeListingCategory, ah as decodeListingName, ai as decodeListingTags, aj as elementClass, ak as evaluateAgentVerification, al as formatPriceSol, am as formatRate, an as formatSol, ao as moderationStateOf, ap as rootClass, ar as tc, as as toHex, at as truncateAddress, au as useAgentVerification, av as useFocusTrap } from '../index-
|
|
1
|
+
export { e as AgentVerificationReader, f as AgentVerificationReaderOptions, g as AgentVerificationResult, h as AgentVerificationRpc, B as Badge, i as BadgeProps, j as BadgeTone, k as Button, l as ButtonProps, m as ButtonVariant, n as COMPONENT_CATALOG, o as ComponentStringId, D as DEFAULT_TRUST_HREF, p as DisputeBanner, q as DisputeBannerProps, E as EN_COMPONENT_STRINGS, H as HireButton, s as HireButtonProps, t as HireCheckoutListing, u as HireCheckoutModal, v as HireCheckoutModalProps, L as ListingCard, w as ListingCardData, x as ListingCardProps, y as ListingGrid, z as ListingGridProps, M as Modal, F as ModalProps, J as ModerationBadge, K as ModerationBadgeProps, N as ModerationState, P as PoweredByAgenC, O as PoweredByAgenCProps, Q as ProviderCard, S as ProviderCardProps, U as ReferrerDisclosure, W as ReferrerDisclosureProps, X as ReviewPanel, Y as ReviewPanelProps, Z as Spinner, _ as SpinnerProps, $ as StateKind, a0 as StateMessage, a1 as StateMessageProps, a5 as TaskTimeline, a6 as TaskTimelineProps, a7 as ThemableProps, a9 as UNVERIFIED, aa as UseAgentVerificationOptions, ab as UseAgentVerificationResult, ac as VerifiedBadge, ad as VerifiedBadgeProps, ae as agentVerificationReaderFromRpc, af as cx, ag as decodeListingCategory, ah as decodeListingName, ai as decodeListingTags, aj as elementClass, ak as evaluateAgentVerification, al as formatPriceSol, am as formatRate, an as formatSol, ao as moderationStateOf, ap as rootClass, ar as tc, as as toHex, at as truncateAddress, au as useAgentVerification, av as useFocusTrap } from '../index-DQ3Xovkq.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import '@tetsuo-ai/marketplace-sdk';
|
|
4
4
|
import '@solana/kit';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { Badge, Button, COMPONENT_CATALOG, DEFAULT_TRUST_HREF, DisputeBanner, EN_COMPONENT_STRINGS, HireButton, HireCheckoutModal, ListingCard, ListingGrid, Modal, ModerationBadge, PoweredByAgenC, ProviderCard, ReferrerDisclosure, ReviewPanel, Spinner, StateMessage, TaskTimeline, UNVERIFIED, VerifiedBadge, agentVerificationReaderFromRpc, cx, decodeListingCategory, decodeListingName, decodeListingTags, elementClass, evaluateAgentVerification, formatPriceSol, formatRate, formatSol, moderationStateOf, rootClass, tc, toHex, truncateAddress, useAgentVerification, useFocusTrap } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
3
|
-
import '../chunk-
|
|
1
|
+
export { Badge, Button, COMPONENT_CATALOG, DEFAULT_TRUST_HREF, DisputeBanner, EN_COMPONENT_STRINGS, HireButton, HireCheckoutModal, ListingCard, ListingGrid, Modal, ModerationBadge, PoweredByAgenC, ProviderCard, ReferrerDisclosure, ReviewPanel, Spinner, StateMessage, TaskTimeline, UNVERIFIED, VerifiedBadge, agentVerificationReaderFromRpc, cx, decodeListingCategory, decodeListingName, decodeListingTags, elementClass, evaluateAgentVerification, formatPriceSol, formatRate, formatSol, moderationStateOf, rootClass, tc, toHex, truncateAddress, useAgentVerification, useFocusTrap } from '../chunk-ZAMIL27X.js';
|
|
2
|
+
import '../chunk-2Y6JN2VZ.js';
|
|
3
|
+
import '../chunk-H6PJIDQR.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.cjs
CHANGED
|
@@ -18,7 +18,8 @@ var EN_STRINGS = {
|
|
|
18
18
|
"referrer.invalidFeeBps": "Referrer feeBps must be an integer between {min} and {max} (basis points); got {feeBps}.",
|
|
19
19
|
"referrer.notLive": "Referral fee is not active for this hire.",
|
|
20
20
|
"referrer.notLiveReason": "No referrer is configured for this provider.",
|
|
21
|
-
"referrer.earningsNotLiveReason": "Referral settlement is live, but
|
|
21
|
+
"referrer.earningsNotLiveReason": "Referral settlement is live, but no earnings endpoint is available on this network (configure indexer.baseUrl).",
|
|
22
|
+
"referrer.earningsFetchFailed": "The referrer earnings endpoint could not be read.",
|
|
22
23
|
// Read transport.
|
|
23
24
|
"transport.noReadSource": "No read source is configured. Pass an indexer baseUrl, an rpc/queryTransport, to <AgencProvider> or createReadTransport().",
|
|
24
25
|
// Generic loading / empty / error states (components extend these).
|
|
@@ -807,23 +808,48 @@ function useWalletSigner(options) {
|
|
|
807
808
|
}, [adapter]);
|
|
808
809
|
return { signer, connected, connect };
|
|
809
810
|
}
|
|
810
|
-
var
|
|
811
|
+
var EARNINGS_INDEXER_DEFAULTS = {
|
|
812
|
+
mainnet: "https://api.agenc.ag"
|
|
813
|
+
};
|
|
814
|
+
function resolveEarningsBaseUrl(ctx) {
|
|
815
|
+
return ctx.indexerBaseUrl ?? EARNINGS_INDEXER_DEFAULTS[ctx.network] ?? null;
|
|
816
|
+
}
|
|
811
817
|
function useReferrerEarnings(wallet) {
|
|
812
818
|
const ctx = useAgencContext();
|
|
813
819
|
const capability = ctx.resolveReferrerCapability();
|
|
814
|
-
const
|
|
815
|
-
|
|
820
|
+
const earningsBase = resolveEarningsBaseUrl(ctx);
|
|
821
|
+
const enabled = capability.live && earningsBase !== null && Boolean(wallet);
|
|
822
|
+
const query = reactQuery.useQuery(
|
|
816
823
|
{
|
|
817
824
|
queryKey: queryKeys.referrerEarnings(wallet ? pdaKey(wallet) : ""),
|
|
818
825
|
enabled,
|
|
819
826
|
queryFn: async () => {
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
)
|
|
827
|
+
const url = `${earningsBase}/api/explorer/referrers/${encodeURIComponent(
|
|
828
|
+
String(wallet)
|
|
829
|
+
)}/hires`;
|
|
830
|
+
const response = await fetch(url, {
|
|
831
|
+
headers: { accept: "application/json" }
|
|
832
|
+
});
|
|
833
|
+
if (!response.ok) {
|
|
834
|
+
throw new Error(
|
|
835
|
+
t("referrer.earningsFetchFailed") + ` (HTTP ${response.status})`
|
|
836
|
+
);
|
|
837
|
+
}
|
|
838
|
+
const body = await response.json();
|
|
839
|
+
const hires = (body.hires ?? []).map((h) => ({
|
|
840
|
+
taskPda: String(h.taskPda ?? ""),
|
|
841
|
+
hireRecordPda: String(h.hireRecordPda ?? ""),
|
|
842
|
+
feeLamports: BigInt(h.feeLamports ?? "0"),
|
|
843
|
+
signature: String(h.signature ?? "")
|
|
844
|
+
}));
|
|
845
|
+
return {
|
|
846
|
+
totalLamports: BigInt(body.totalLamports ?? "0"),
|
|
847
|
+
hires
|
|
848
|
+
};
|
|
823
849
|
}
|
|
824
850
|
}
|
|
825
851
|
);
|
|
826
|
-
if (!
|
|
852
|
+
if (!enabled) {
|
|
827
853
|
return {
|
|
828
854
|
live: false,
|
|
829
855
|
totalLamports: 0n,
|
|
@@ -835,6 +861,14 @@ function useReferrerEarnings(wallet) {
|
|
|
835
861
|
}
|
|
836
862
|
};
|
|
837
863
|
}
|
|
864
|
+
return {
|
|
865
|
+
live: true,
|
|
866
|
+
totalLamports: query.data?.totalLamports ?? 0n,
|
|
867
|
+
hires: query.data?.hires ?? [],
|
|
868
|
+
isLoading: query.isLoading,
|
|
869
|
+
error: query.error ?? null,
|
|
870
|
+
refetch: () => void query.refetch()
|
|
871
|
+
};
|
|
838
872
|
}
|
|
839
873
|
|
|
840
874
|
exports.QUERY_KEY_ROOT = QUERY_KEY_ROOT;
|