@yieldfabric/wallet 0.2.5 → 0.2.6
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/index.cjs +745 -773
- package/dist/index.js +104 -132
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Source review requires written authorization; see package LICENSE.md and NOTICE.md.
|
|
6
6
|
* Runtime use requires a separate express license.
|
|
7
7
|
*/
|
|
8
|
-
import
|
|
8
|
+
import React55, { createContext, lazy, useContext, useState, useEffect, useRef, useCallback, useMemo, Suspense, useId, Component } from 'react';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
10
|
import { AvererSdkProvider, useAvererWallet, AvererWebSdk } from '@averer/averer-websdk';
|
|
11
11
|
import sha3, { keccak256 } from 'js-sha3';
|
|
@@ -9985,7 +9985,7 @@ function WizardProvider({
|
|
|
9985
9985
|
const [planSelection, setPlanSelection] = useState(
|
|
9986
9986
|
readOnboardingPlanSelectionHint
|
|
9987
9987
|
);
|
|
9988
|
-
const pendingSponsorshipRef =
|
|
9988
|
+
const pendingSponsorshipRef = React55.useRef(
|
|
9989
9989
|
pendingSponsorship
|
|
9990
9990
|
);
|
|
9991
9991
|
const stageSponsorship = useCallback((groupId, destination) => {
|
|
@@ -11199,8 +11199,8 @@ var DynamicCompleter = ({ sdk, action, onError }) => {
|
|
|
11199
11199
|
const ctx = sdk.useDynamicContext();
|
|
11200
11200
|
const wallet = ctx.primaryWallet;
|
|
11201
11201
|
const dynamicUser = ctx.user;
|
|
11202
|
-
const [done, setDone] =
|
|
11203
|
-
|
|
11202
|
+
const [done, setDone] = React55.useState(false);
|
|
11203
|
+
React55.useEffect(() => {
|
|
11204
11204
|
if (done || !wallet?.address) return;
|
|
11205
11205
|
setDone(true);
|
|
11206
11206
|
(async () => {
|
|
@@ -11625,8 +11625,8 @@ var KycFlow3 = ({ onComplete, onError, instanceId }) => {
|
|
|
11625
11625
|
const settings = config?.kyc.settings[providerId];
|
|
11626
11626
|
const publishableKey = settings?.publishable_key;
|
|
11627
11627
|
const requiredForCompletion = settings?.required_for_completion ?? false;
|
|
11628
|
-
const [stage, setStage] =
|
|
11629
|
-
|
|
11628
|
+
const [stage, setStage] = React55.useState({ kind: "idle" });
|
|
11629
|
+
React55.useEffect(() => {
|
|
11630
11630
|
let cancelled = false;
|
|
11631
11631
|
(async () => {
|
|
11632
11632
|
try {
|
|
@@ -11650,7 +11650,7 @@ var KycFlow3 = ({ onComplete, onError, instanceId }) => {
|
|
|
11650
11650
|
cancelled = true;
|
|
11651
11651
|
};
|
|
11652
11652
|
}, []);
|
|
11653
|
-
|
|
11653
|
+
React55.useEffect(() => {
|
|
11654
11654
|
if (stage.kind !== "pending-poll") return;
|
|
11655
11655
|
let cancelled = false;
|
|
11656
11656
|
const pollOnce = async () => {
|
|
@@ -11902,14 +11902,14 @@ function useIdentityStatusPoll(opts) {
|
|
|
11902
11902
|
provider,
|
|
11903
11903
|
credentialType
|
|
11904
11904
|
} = opts;
|
|
11905
|
-
const [stuckHint, setStuckHint] =
|
|
11906
|
-
const onVerifiedRef =
|
|
11907
|
-
const onRejectedRef =
|
|
11908
|
-
|
|
11905
|
+
const [stuckHint, setStuckHint] = React55.useState(false);
|
|
11906
|
+
const onVerifiedRef = React55.useRef(onVerified);
|
|
11907
|
+
const onRejectedRef = React55.useRef(onRejected);
|
|
11908
|
+
React55.useEffect(() => {
|
|
11909
11909
|
onVerifiedRef.current = onVerified;
|
|
11910
11910
|
onRejectedRef.current = onRejected;
|
|
11911
11911
|
}, [onVerified, onRejected]);
|
|
11912
|
-
|
|
11912
|
+
React55.useEffect(() => {
|
|
11913
11913
|
if (!active) {
|
|
11914
11914
|
setStuckHint(false);
|
|
11915
11915
|
return;
|
|
@@ -12047,12 +12047,12 @@ var KycFlow4 = ({ onComplete, onError, instanceId, subject }) => {
|
|
|
12047
12047
|
const groupId = subject?.kind === "group" ? subject.id : void 0;
|
|
12048
12048
|
const configuredLevel = config?.kyc.settings[providerId]?.level_name?.trim();
|
|
12049
12049
|
const levelName = configuredLevel || "id-and-liveness";
|
|
12050
|
-
const [token, setToken] =
|
|
12051
|
-
const [stage, setStage] =
|
|
12052
|
-
const [attempt, setAttempt] =
|
|
12053
|
-
const submittedRef =
|
|
12054
|
-
const applicantIdRef =
|
|
12055
|
-
|
|
12050
|
+
const [token, setToken] = React55.useState(null);
|
|
12051
|
+
const [stage, setStage] = React55.useState({ kind: "init" });
|
|
12052
|
+
const [attempt, setAttempt] = React55.useState(0);
|
|
12053
|
+
const submittedRef = React55.useRef(false);
|
|
12054
|
+
const applicantIdRef = React55.useRef(void 0);
|
|
12055
|
+
React55.useEffect(() => {
|
|
12056
12056
|
let cancelled = false;
|
|
12057
12057
|
submittedRef.current = false;
|
|
12058
12058
|
(async () => {
|
|
@@ -12367,6 +12367,47 @@ function OnboardingChooseMethod({ chrome } = {}) {
|
|
|
12367
12367
|
/* @__PURE__ */ jsx("p", { className: "text-[10px] text-text-secondary text-center pt-2", children: messages.legal.agreementText })
|
|
12368
12368
|
] }) });
|
|
12369
12369
|
}
|
|
12370
|
+
function FloatField({
|
|
12371
|
+
label,
|
|
12372
|
+
type,
|
|
12373
|
+
value,
|
|
12374
|
+
onChange,
|
|
12375
|
+
autoComplete,
|
|
12376
|
+
required,
|
|
12377
|
+
minLength,
|
|
12378
|
+
maxLength,
|
|
12379
|
+
adornment,
|
|
12380
|
+
disabled
|
|
12381
|
+
}) {
|
|
12382
|
+
const id = useId();
|
|
12383
|
+
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
12384
|
+
/* @__PURE__ */ jsx(
|
|
12385
|
+
"input",
|
|
12386
|
+
{
|
|
12387
|
+
id,
|
|
12388
|
+
type,
|
|
12389
|
+
required,
|
|
12390
|
+
minLength,
|
|
12391
|
+
maxLength,
|
|
12392
|
+
autoComplete,
|
|
12393
|
+
placeholder: " ",
|
|
12394
|
+
value,
|
|
12395
|
+
disabled,
|
|
12396
|
+
onChange: (e) => onChange(e.target.value),
|
|
12397
|
+
className: "\n peer w-full bg-transparent border-0 border-b border-border-default\n rounded-none px-0 pt-4 pb-1.5 text-[14px] text-text-primary\n focus:outline-none focus:border-border-strong transition-colors\n disabled:opacity-60 disabled:cursor-not-allowed\n "
|
|
12398
|
+
}
|
|
12399
|
+
),
|
|
12400
|
+
/* @__PURE__ */ jsx(
|
|
12401
|
+
"label",
|
|
12402
|
+
{
|
|
12403
|
+
htmlFor: id,
|
|
12404
|
+
className: "\n absolute left-0 pointer-events-none transition-all duration-200\n text-[10px] text-text-secondary top-0\n peer-placeholder-shown:text-[13px] peer-placeholder-shown:top-4\n peer-focus:text-[10px] peer-focus:top-0 peer-focus:text-text-secondary\n ",
|
|
12405
|
+
children: label
|
|
12406
|
+
}
|
|
12407
|
+
),
|
|
12408
|
+
adornment && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-4 pointer-events-none", children: adornment })
|
|
12409
|
+
] });
|
|
12410
|
+
}
|
|
12370
12411
|
init_authService();
|
|
12371
12412
|
init_tokenManager();
|
|
12372
12413
|
init_ProviderConfigContext();
|
|
@@ -12604,44 +12645,6 @@ function OnboardingEmailSignup({ chrome } = {}) {
|
|
|
12604
12645
|
] })
|
|
12605
12646
|
] }) });
|
|
12606
12647
|
}
|
|
12607
|
-
function FloatField({
|
|
12608
|
-
label,
|
|
12609
|
-
type,
|
|
12610
|
-
value,
|
|
12611
|
-
onChange,
|
|
12612
|
-
autoComplete,
|
|
12613
|
-
required,
|
|
12614
|
-
minLength,
|
|
12615
|
-
maxLength,
|
|
12616
|
-
adornment,
|
|
12617
|
-
disabled
|
|
12618
|
-
}) {
|
|
12619
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
12620
|
-
/* @__PURE__ */ jsx(
|
|
12621
|
-
"input",
|
|
12622
|
-
{
|
|
12623
|
-
type,
|
|
12624
|
-
required,
|
|
12625
|
-
minLength,
|
|
12626
|
-
maxLength,
|
|
12627
|
-
autoComplete,
|
|
12628
|
-
placeholder: " ",
|
|
12629
|
-
value,
|
|
12630
|
-
disabled,
|
|
12631
|
-
onChange: (e) => onChange(e.target.value),
|
|
12632
|
-
className: "\n peer w-full bg-transparent border-0 border-b border-border-default\n rounded-none px-0 pt-4 pb-1.5 text-[14px] text-text-primary\n focus:outline-none focus:border-border-strong transition-colors\n disabled:opacity-60 disabled:cursor-not-allowed\n "
|
|
12633
|
-
}
|
|
12634
|
-
),
|
|
12635
|
-
/* @__PURE__ */ jsx(
|
|
12636
|
-
"span",
|
|
12637
|
-
{
|
|
12638
|
-
className: "\n absolute left-0 pointer-events-none transition-all duration-200\n text-[10px] text-text-secondary top-0\n peer-placeholder-shown:text-[13px] peer-placeholder-shown:top-4\n peer-focus:text-[10px] peer-focus:top-0 peer-focus:text-text-secondary\n ",
|
|
12639
|
-
children: label
|
|
12640
|
-
}
|
|
12641
|
-
),
|
|
12642
|
-
adornment && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-4 pointer-events-none", children: adornment })
|
|
12643
|
-
] });
|
|
12644
|
-
}
|
|
12645
12648
|
init_authService();
|
|
12646
12649
|
init_onboardingClient();
|
|
12647
12650
|
function EmailVerify({ chrome } = {}) {
|
|
@@ -12802,7 +12805,7 @@ function EmailVerify({ chrome } = {}) {
|
|
|
12802
12805
|
/* @__PURE__ */ jsx(ProgressRail, { phase, verified: !!status?.verified || phase === "success" }),
|
|
12803
12806
|
phase === "loading" && !status ? /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-border-default bg-surface-alt/70 p-4 text-center text-[12px] text-text-secondary", children: "Checking email status..." }) : phase === "success" ? /* @__PURE__ */ jsx(SuccessPanel, { notice }) : status?.is_synthetic ? /* @__PURE__ */ jsxs("form", { onSubmit: submitRealEmail, className: "space-y-4", children: [
|
|
12804
12807
|
/* @__PURE__ */ jsx(
|
|
12805
|
-
|
|
12808
|
+
FloatField,
|
|
12806
12809
|
{
|
|
12807
12810
|
label: "Email",
|
|
12808
12811
|
type: "email",
|
|
@@ -12925,38 +12928,6 @@ function CodeField({
|
|
|
12925
12928
|
}
|
|
12926
12929
|
);
|
|
12927
12930
|
}
|
|
12928
|
-
function FloatField2({
|
|
12929
|
-
label,
|
|
12930
|
-
type,
|
|
12931
|
-
value,
|
|
12932
|
-
onChange,
|
|
12933
|
-
autoComplete,
|
|
12934
|
-
disabled,
|
|
12935
|
-
required
|
|
12936
|
-
}) {
|
|
12937
|
-
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
12938
|
-
/* @__PURE__ */ jsx(
|
|
12939
|
-
"input",
|
|
12940
|
-
{
|
|
12941
|
-
type,
|
|
12942
|
-
required,
|
|
12943
|
-
autoComplete,
|
|
12944
|
-
placeholder: " ",
|
|
12945
|
-
value,
|
|
12946
|
-
disabled,
|
|
12947
|
-
onChange: (e) => onChange(e.target.value),
|
|
12948
|
-
className: "\n peer w-full bg-transparent border-0 border-b border-border-default\n rounded-none px-0 pt-4 pb-1.5 text-[14px] text-text-primary\n focus:outline-none focus:border-border-strong transition-colors\n disabled:opacity-60\n "
|
|
12949
|
-
}
|
|
12950
|
-
),
|
|
12951
|
-
/* @__PURE__ */ jsx(
|
|
12952
|
-
"span",
|
|
12953
|
-
{
|
|
12954
|
-
className: "\n absolute left-0 pointer-events-none transition-all duration-200\n text-[10px] text-text-secondary top-0\n peer-placeholder-shown:text-[13px] peer-placeholder-shown:top-4\n peer-focus:text-[10px] peer-focus:top-0 peer-focus:text-text-secondary\n ",
|
|
12955
|
-
children: label
|
|
12956
|
-
}
|
|
12957
|
-
)
|
|
12958
|
-
] });
|
|
12959
|
-
}
|
|
12960
12931
|
function friendlyEmailError(err, action) {
|
|
12961
12932
|
const message = err instanceof Error ? err.message : String(err);
|
|
12962
12933
|
if (message.includes("email delivery unavailable") || message.includes("503")) {
|
|
@@ -16047,7 +16018,7 @@ function Field({
|
|
|
16047
16018
|
value,
|
|
16048
16019
|
copyable
|
|
16049
16020
|
}) {
|
|
16050
|
-
const [copied, setCopied] =
|
|
16021
|
+
const [copied, setCopied] = React55.useState(false);
|
|
16051
16022
|
return /* @__PURE__ */ jsxs("div", { children: [
|
|
16052
16023
|
/* @__PURE__ */ jsx("p", { className: "text-[10px] uppercase tracking-wider text-text-secondary", children: label }),
|
|
16053
16024
|
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-2", children: [
|
|
@@ -16111,14 +16082,14 @@ var STAGE_COPY = {
|
|
|
16111
16082
|
not_applicable: { title: "Finishing up", body: "" }
|
|
16112
16083
|
};
|
|
16113
16084
|
var AccountOpeningPanel = ({ onContinue, continueLabel = "Continue" }) => {
|
|
16114
|
-
const [status, setStatus] =
|
|
16115
|
-
const [impatient, setImpatient] =
|
|
16116
|
-
const activationStarted =
|
|
16117
|
-
const onContinueRef =
|
|
16118
|
-
|
|
16085
|
+
const [status, setStatus] = React55.useState(null);
|
|
16086
|
+
const [impatient, setImpatient] = React55.useState(false);
|
|
16087
|
+
const activationStarted = React55.useRef(false);
|
|
16088
|
+
const onContinueRef = React55.useRef(onContinue);
|
|
16089
|
+
React55.useEffect(() => {
|
|
16119
16090
|
onContinueRef.current = onContinue;
|
|
16120
16091
|
}, [onContinue]);
|
|
16121
|
-
|
|
16092
|
+
React55.useEffect(() => {
|
|
16122
16093
|
let cancelled = false;
|
|
16123
16094
|
let timer;
|
|
16124
16095
|
const startedAt = Date.now();
|
|
@@ -17456,7 +17427,7 @@ function WizardRouter({
|
|
|
17456
17427
|
identityRequired && primaryKycVerifiesEmail(config)
|
|
17457
17428
|
);
|
|
17458
17429
|
const hostOwnsSponsorshipConsent = sponsorshipConsent === "host";
|
|
17459
|
-
|
|
17430
|
+
React55.useEffect(() => {
|
|
17460
17431
|
if (hostOwnsSponsorshipConsent && pendingSponsorship) {
|
|
17461
17432
|
discardSponsorship();
|
|
17462
17433
|
}
|
|
@@ -17672,7 +17643,7 @@ function builtinProviderDisplayName(id) {
|
|
|
17672
17643
|
}
|
|
17673
17644
|
}
|
|
17674
17645
|
function useProviderDisplayName(config) {
|
|
17675
|
-
return
|
|
17646
|
+
return React55.useCallback(
|
|
17676
17647
|
(id) => {
|
|
17677
17648
|
const labelled = config?.kyc?.settings?.[id]?.label ?? config?.auth?.settings?.[id]?.label;
|
|
17678
17649
|
const trimmed = typeof labelled === "string" ? labelled.trim() : "";
|
|
@@ -18008,7 +17979,7 @@ var OnboardingPolicySection = ({
|
|
|
18008
17979
|
)
|
|
18009
17980
|
] }) }) : /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
18010
17981
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1.5 rounded-lg border border-primary/20 bg-primary/[0.04] px-3.5 py-2.5", children: [
|
|
18011
|
-
journeySteps.map((step, i) => /* @__PURE__ */ jsxs(
|
|
17982
|
+
journeySteps.map((step, i) => /* @__PURE__ */ jsxs(React55.Fragment, { children: [
|
|
18012
17983
|
i > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": true, className: "text-[12px] text-text-muted/60", children: "\u203A" }),
|
|
18013
17984
|
/* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1.5", children: [
|
|
18014
17985
|
/* @__PURE__ */ jsx("span", { className: "flex h-4 w-4 items-center justify-center rounded-full bg-primary/20 text-[9px] font-bold text-primary", children: i + 1 }),
|
|
@@ -21196,11 +21167,11 @@ var SaveButton = ({ onClick, busy, disabled, saved = false, classNames }) => /*
|
|
|
21196
21167
|
);
|
|
21197
21168
|
function useSavedFlash(ms = 1800) {
|
|
21198
21169
|
const [saved, setSaved] = useState(false);
|
|
21199
|
-
const timer =
|
|
21170
|
+
const timer = React55.useRef(null);
|
|
21200
21171
|
useEffect(() => () => {
|
|
21201
21172
|
if (timer.current) clearTimeout(timer.current);
|
|
21202
21173
|
}, []);
|
|
21203
|
-
const flash =
|
|
21174
|
+
const flash = React55.useCallback(() => {
|
|
21204
21175
|
setSaved(true);
|
|
21205
21176
|
if (timer.current) clearTimeout(timer.current);
|
|
21206
21177
|
timer.current = setTimeout(() => setSaved(false), ms);
|
|
@@ -24953,17 +24924,17 @@ function ActiveEnvironmentBadge({
|
|
|
24953
24924
|
configuredTestChains
|
|
24954
24925
|
);
|
|
24955
24926
|
const canChoose = Boolean(activeChainId && options.length > 1);
|
|
24956
|
-
const [busyChainId, setBusyChainId] =
|
|
24957
|
-
const [pendingLiveChainId, setPendingLiveChainId] =
|
|
24958
|
-
const [error, setError] =
|
|
24959
|
-
const switchingRef =
|
|
24960
|
-
const confirmLiveRef =
|
|
24961
|
-
const liveWarningId =
|
|
24927
|
+
const [busyChainId, setBusyChainId] = React55.useState(null);
|
|
24928
|
+
const [pendingLiveChainId, setPendingLiveChainId] = React55.useState(null);
|
|
24929
|
+
const [error, setError] = React55.useState(null);
|
|
24930
|
+
const switchingRef = React55.useRef(false);
|
|
24931
|
+
const confirmLiveRef = React55.useRef(null);
|
|
24932
|
+
const liveWarningId = React55.useId();
|
|
24962
24933
|
const label = modeLabel(environment.mode);
|
|
24963
24934
|
const modeCounts = { test: 0, live: 0, unknown: 0 };
|
|
24964
24935
|
for (const option of options) modeCounts[option.mode] += 1;
|
|
24965
24936
|
const pendingLive = options.find((option) => option.chainId === pendingLiveChainId) ?? null;
|
|
24966
|
-
|
|
24937
|
+
React55.useEffect(() => {
|
|
24967
24938
|
if (pendingLiveChainId) confirmLiveRef.current?.focus();
|
|
24968
24939
|
}, [pendingLiveChainId]);
|
|
24969
24940
|
async function switchTo(option) {
|
|
@@ -25723,7 +25694,7 @@ function WalletMenu({
|
|
|
25723
25694
|
const secondaryItems = items.filter((item) => item.placement === "secondary");
|
|
25724
25695
|
const activeActor = actors.find((actor) => actor.active) ?? actors[0];
|
|
25725
25696
|
const userName = identity.name ?? "You";
|
|
25726
|
-
const renderCard = (cardItems) => /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-[24px] border border-border-light bg-raised shadow-sm", children: cardItems.map((item, index) => /* @__PURE__ */ jsxs(
|
|
25697
|
+
const renderCard = (cardItems) => /* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-[24px] border border-border-light bg-raised shadow-sm", children: cardItems.map((item, index) => /* @__PURE__ */ jsxs(React55.Fragment, { children: [
|
|
25727
25698
|
index > 0 && /* @__PURE__ */ jsx("div", { className: "mx-4 border-t border-border-light" }),
|
|
25728
25699
|
/* @__PURE__ */ jsx(
|
|
25729
25700
|
WalletMenuRow,
|
|
@@ -25973,7 +25944,7 @@ function ActorsPane({
|
|
|
25973
25944
|
error && /* @__PURE__ */ jsx(ErrorBanner, { children: error }),
|
|
25974
25945
|
/* @__PURE__ */ jsx("div", { className: "overflow-hidden rounded-[22px] border border-border-light bg-raised", children: actors.map((actor, index) => {
|
|
25975
25946
|
const ActorIcon = actor.icon;
|
|
25976
|
-
return /* @__PURE__ */ jsxs(
|
|
25947
|
+
return /* @__PURE__ */ jsxs(React55.Fragment, { children: [
|
|
25977
25948
|
index > 0 && /* @__PURE__ */ jsx("div", { className: "mx-4 border-t border-border-light" }),
|
|
25978
25949
|
/* @__PURE__ */ jsxs(
|
|
25979
25950
|
"button",
|
|
@@ -27968,8 +27939,9 @@ var BillingCenter = ({ dense = false }) => {
|
|
|
27968
27939
|
setLoadError(null);
|
|
27969
27940
|
try {
|
|
27970
27941
|
const s = await billingService.getMyBilling();
|
|
27942
|
+
setNotConfigured(s === null);
|
|
27971
27943
|
if (s === null) {
|
|
27972
|
-
|
|
27944
|
+
setSummary(null);
|
|
27973
27945
|
} else {
|
|
27974
27946
|
setSummary(s);
|
|
27975
27947
|
setItems(s.recent_line_items);
|
|
@@ -27983,7 +27955,7 @@ var BillingCenter = ({ dense = false }) => {
|
|
|
27983
27955
|
}, []);
|
|
27984
27956
|
useEffect(() => {
|
|
27985
27957
|
void load();
|
|
27986
|
-
void billingService.getGasPricing().then(setPricing);
|
|
27958
|
+
void billingService.getGasPricing().then(setPricing).catch(() => setPricing(null));
|
|
27987
27959
|
}, [load]);
|
|
27988
27960
|
useEffect(() => {
|
|
27989
27961
|
const reloadAfterCheckout = () => void load();
|
|
@@ -28028,18 +28000,6 @@ var BillingCenter = ({ dense = false }) => {
|
|
|
28028
28000
|
}
|
|
28029
28001
|
}, [load]);
|
|
28030
28002
|
const outerClass = dense ? "px-1 py-2" : "mx-auto max-w-5xl px-4 py-6";
|
|
28031
|
-
if (notConfigured) {
|
|
28032
|
-
return /* @__PURE__ */ jsxs("div", { className: outerClass, children: [
|
|
28033
|
-
!dense && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
28034
|
-
/* @__PURE__ */ jsxs("h1", { className: "text-lg font-semibold text-text-primary max-sm:sr-only", children: [
|
|
28035
|
-
"Usage & billing",
|
|
28036
|
-
!isLiveMode() && paymentsUrlMap() && /* @__PURE__ */ jsx("span", { className: "ml-2 align-middle inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider bg-amber-500/15 text-amber-600 ring-1 ring-amber-500/40", children: "Test mode" })
|
|
28037
|
-
] }),
|
|
28038
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-muted", children: "Metered AI and on-chain usage." })
|
|
28039
|
-
] }),
|
|
28040
|
-
/* @__PURE__ */ jsx("div", { className: `${CARD} px-4 py-10 text-center text-[13px] text-text-muted`, children: "Billing is not enabled on this deployment." })
|
|
28041
|
-
] });
|
|
28042
|
-
}
|
|
28043
28003
|
const totals = summary?.period_totals ?? [];
|
|
28044
28004
|
const payableTotal = totals.reduce((acc, t) => acc + t.amount_usd_micros, 0);
|
|
28045
28005
|
const personalTotal = summary?.spend?.period_usd_micros ?? payableTotal;
|
|
@@ -28115,6 +28075,18 @@ var BillingCenter = ({ dense = false }) => {
|
|
|
28115
28075
|
const creditExhausted = prepaidCreditsEnabled && creditPlanId != null && creditBalanceMicros <= 0;
|
|
28116
28076
|
const creditLow = prepaidCreditsEnabled && creditPlanId != null && creditBalanceMicros > 0 && creditGrantMicros != null && creditBalanceMicros < creditGrantMicros * 0.15;
|
|
28117
28077
|
const recoveryAction = summary ? billingRecoveryAction(summary) : null;
|
|
28078
|
+
if (notConfigured) {
|
|
28079
|
+
return /* @__PURE__ */ jsxs("div", { className: outerClass, children: [
|
|
28080
|
+
!dense && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
28081
|
+
/* @__PURE__ */ jsxs("h1", { className: "text-lg font-semibold text-text-primary max-sm:sr-only", children: [
|
|
28082
|
+
"Usage & billing",
|
|
28083
|
+
!isLiveMode() && paymentsUrlMap() && /* @__PURE__ */ jsx("span", { className: "ml-2 align-middle inline-flex items-center px-2 py-0.5 rounded-full text-[10px] font-semibold uppercase tracking-wider bg-amber-500/15 text-amber-600 ring-1 ring-amber-500/40", children: "Test mode" })
|
|
28084
|
+
] }),
|
|
28085
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-text-muted", children: "Metered AI and on-chain usage." })
|
|
28086
|
+
] }),
|
|
28087
|
+
/* @__PURE__ */ jsx("div", { className: `${CARD} px-4 py-10 text-center text-[13px] text-text-muted`, children: "Billing is not enabled on this deployment." })
|
|
28088
|
+
] });
|
|
28089
|
+
}
|
|
28118
28090
|
return /* @__PURE__ */ jsxs("div", { className: outerClass, children: [
|
|
28119
28091
|
!dense && /* @__PURE__ */ jsxs("div", { className: "mb-4", children: [
|
|
28120
28092
|
/* @__PURE__ */ jsxs("h1", { className: "text-lg font-semibold text-text-primary max-sm:sr-only", children: [
|
|
@@ -29796,25 +29768,25 @@ function BusinessVerificationSection({
|
|
|
29796
29768
|
initialStatus
|
|
29797
29769
|
}) {
|
|
29798
29770
|
const { config } = useProviderConfig();
|
|
29799
|
-
const [status, setStatus] =
|
|
29800
|
-
const [flowInstance, setFlowInstance] =
|
|
29801
|
-
const [error, setError] =
|
|
29802
|
-
const [busy, setBusy] =
|
|
29803
|
-
const kybInstances =
|
|
29771
|
+
const [status, setStatus] = React55.useState(initialStatus ?? "not_required");
|
|
29772
|
+
const [flowInstance, setFlowInstance] = React55.useState(null);
|
|
29773
|
+
const [error, setError] = React55.useState(null);
|
|
29774
|
+
const [busy, setBusy] = React55.useState(false);
|
|
29775
|
+
const kybInstances = React55.useMemo(
|
|
29804
29776
|
() => (config?.kyc.enabled ?? []).filter(
|
|
29805
29777
|
(id) => config?.kyc.settings[id]?.subject === "group"
|
|
29806
29778
|
),
|
|
29807
29779
|
[config]
|
|
29808
29780
|
);
|
|
29809
29781
|
const entityDefault = config?.kyc.entity_default_profile ?? null;
|
|
29810
|
-
const refreshStatus =
|
|
29782
|
+
const refreshStatus = React55.useCallback(async () => {
|
|
29811
29783
|
try {
|
|
29812
29784
|
const s = await getIdentityStatus({ groupId });
|
|
29813
29785
|
setStatus(s.status === "unverified" ? "unverified" : s.status);
|
|
29814
29786
|
} catch {
|
|
29815
29787
|
}
|
|
29816
29788
|
}, [groupId]);
|
|
29817
|
-
|
|
29789
|
+
React55.useEffect(() => {
|
|
29818
29790
|
if (initialStatus !== void 0) setStatus(initialStatus);
|
|
29819
29791
|
}, [initialStatus]);
|
|
29820
29792
|
const startFlow = async (bindFirst) => {
|
|
@@ -31002,7 +30974,7 @@ var IncomingPaymentsInbox = ({
|
|
|
31002
30974
|
...hookOptions
|
|
31003
30975
|
}) => {
|
|
31004
30976
|
const inbox = useIncomingPayments(hookOptions);
|
|
31005
|
-
const allPayments =
|
|
30977
|
+
const allPayments = React55.useMemo(
|
|
31006
30978
|
() => [
|
|
31007
30979
|
...inbox.payments,
|
|
31008
30980
|
...inbox.contracts.flatMap((c) => c.payments ?? [])
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yieldfabric/wallet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "Reusable YieldFabric wallet — login, signing, profile, and key management",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YieldFabric Technologies Ltd",
|
|
@@ -112,6 +112,6 @@
|
|
|
112
112
|
"axios": "1.20.0",
|
|
113
113
|
"uuid": "11.1.1",
|
|
114
114
|
"esbuild": "0.28.1",
|
|
115
|
-
"sharp": "0.35.
|
|
115
|
+
"sharp": "0.35.5"
|
|
116
116
|
}
|
|
117
117
|
}
|