Skip to content

Commit 5a7b685

Browse files
Agilulfo1820claude
andcommitted
fix(choose-name): only sponsor gas for claim, not for unset
ChooseNameSummaryContent set KIT_PAYS_GAS = true unconditionally, which hid the GasFeeSummary chip, forced hasEnoughGasBalance true, disabled the gas-estimation error banner, and bypassed the loading gate on the Confirm button. But the component routes to useUnsetDomain when isUnsetting=true (see the unsetDomainHook / vetDomainHook / veWorldSubdomainHook switch around line 103), and useUnsetDomain does NOT pass the kit-sponsored delegator URL — the unset path still runs through the user-pays generic delegator. Result: the user got the "VeChain pays" UI but the tx still tried to debit their own VTHO. Compute KIT_PAYS_GAS = !isUnsetting so the unset path falls back to the normal fee-token UI / balance check / estimation-error display. All five downstream gates (shouldEstimateGas, disableConfirmButtonDuringEstimation, hasEnoughBalance, GasFeeSummary render, showGasEstimationError) already read KIT_PAYS_GAS and need no additional changes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3401b5b commit 5a7b685

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

packages/vechain-kit/src/components/AccountModal/Contents/ChooseName/ChooseNameSummaryContent.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,13 @@ export const ChooseNameSummaryContent = ({
163163
const [userSelectedGasToken, setUserSelectedGasToken] =
164164
React.useState<GasTokenType | null>(null);
165165

166-
// VeChain pays gas for domain claims via the kit-sponsored delegator
167-
// (see useClaimVetDomain). Skip the gas-token UI and "do you have
168-
// enough VTHO" check so users with no gas tokens can still proceed.
169-
const KIT_PAYS_GAS = true;
166+
// VeChain pays gas for domain CLAIMS via the kit-sponsored delegator
167+
// (see useClaimVetDomain / useClaimVeWorldSubdomain). The unset path
168+
// (useUnsetDomain) is NOT sponsored — the user pays — so we still
169+
// need the gas-token UI and balance check for that case. Drives:
170+
// skip estimation, hide GasFeeSummary, force hasEnoughGasBalance,
171+
// and suppress gas-estimation errors.
172+
const KIT_PAYS_GAS = !isUnsetting;
170173

171174
const shouldEstimateGas =
172175
!KIT_PAYS_GAS &&

0 commit comments

Comments
 (0)