Skip to content

feat(deposit): default to testnet vault and preflight pause/allowlist - #1363

Merged
greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Adejoke46:fix/issue-1312
Oct 24, 2026
Merged

greatest0fallt1me merged 3 commits into
CalloraOrg:mainfrom
Adejoke46:fix/issue-1312

Conversation

@Adejoke46

Copy link
Copy Markdown
Contributor

Closes #1312

Problem

Deposits were blocked on any deployment without VITE_STELLAR_VAULT_CONTRACT_ID, even though the testnet vault is deployed. When a deposit was possible, a paused vault or an unlisted wallet was only discovered after Freighter had asked for a signature.

Change

  • testnet falls back to the reference vault when the env var is empty. Mainnet and futurenet have no default.
  • resolveVaultConfig (src/services/vaultConfig.ts) is a pure function that returns { contractId, source, error }. It rejects non-contract values using StrKey.isValidContract.
  • preflightVaultDeposit(address) simulates is_paused() and is_authorized_depositor(address) with no signing and no submission.
  • The deposit modal disables Approve with a specific reason when the config is invalid, the vault is paused, or the wallet is not allowlisted. The reason is linked with aria-describedby.
  • If the preflight cannot run, Approve stays enabled and the modal shows "Could not verify vault status".
  • .env.example and docs/Configuration.md describe the testnet default.

Also in this branch

  • 3eeba1b restores baseline types on main. Without it, tsc --noEmit fails on main in catalogApi.ts, mockApis.ts, and ApiDetailPage.tsx.

Not included

  • The billing-page banner for a missing config. Only the modal is gated.
  • Enforcing the contract's minimum deposit in the UI.

Validation

  • npx tsc -p tsconfig.json --noEmit: passed.
  • npm run build: passed.
  • npx vitest run: 153 files, 2295 tests passed.
  • The new tests cover the default and invalid config cases, paused and unlisted states, the unverified fallback, and a check that the preflight never calls sign or send.

Limits

Not run against live testnet RPC. Simulations are mocked in tests. Coverage was not measured.

🤖 Generated with Claude Code

Adejoke46 and others added 3 commits October 23, 2026 07:56
Testnet builds now default to the reference vault when the env var is
empty. The config is validated with StrKey before signing, so an account
address or missing value blocks Approve with a specific reason.

Before the wallet is asked to sign, a read-only simulation checks
is_paused and is_authorized_depositor. A paused vault or an unlisted
wallet disables Approve with the reason linked via aria-describedby. If
the preflight cannot run, Approve stays enabled with a warning.

Closes CalloraOrg#1312

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

# Conflicts:
#	src/App.deposit.test.tsx
#	src/App.tsx
#	src/api/catalogApi.ts
#	src/data/mockApis.ts
#	src/services/walletService.test.ts
@greatest0fallt1me
greatest0fallt1me merged commit b08cc08 into CalloraOrg:main Oct 24, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable testnet vault deposits by default and preflight vault state before signing

2 participants