This document describes the assumptions the mobile client makes about the PocketPay SDK and Soroban contract readiness, and how vault capabilities are gated.
| Check | Source | Fallback |
|---|---|---|
| Wallet loaded | walletStore.publicKey |
Show "no wallet" unavailable |
| Feature flag | EXPO_PUBLIC_VAULT_ENABLED |
Default true (vault enabled) |
| Contract configured | isVaultConfigured() |
Mock mode (not unavailable) |
The vault capability gate (src/utils/vaultCapabilities.ts) evaluates per-action availability:
| Action | Requires Wallet | Requires Feature | Requires SDK Ready | Fallback |
|---|---|---|---|---|
| Deposit | Yes | Yes | Yes | "Vault feature disabled" |
| Withdraw | Yes | Yes | Yes | "Vault backend not ready" |
| Lock | Yes | Yes | Yes | "No wallet available" |
| Unlock | Yes | Yes | Yes | — |
Each capability returns one of:
{ status: 'supported' }— action is fully available{ status: 'unsupported', reason, detail }— action not available, with user-facing copy{ status: 'loading' }— capability check in progress
interface VaultCapabilityInput {
hasWallet: boolean;
isContractConfigured: boolean;
isFeatureEnabled: boolean;
isSdkReady: boolean;
isLoading: boolean;
}When the PocketPay SDK (pocketpay-sdk) ships a vault readiness API, the mobile client should:
- Call
sdk.vault.isReady()(or equivalent) during app initialization. - Store the result in a dedicated capability store or context.
- Pass it to
evaluateVaultCapabilities()as theisSdkReadyinput. - Add finer-grained checks per action when
sdk.vault.getCapabilities()is available.
interface PocketPaySDK {
vault: {
/** Returns true when the vault contract is deployed and reachable. */
isReady(): Promise<boolean>;
/** Returns the set of vault features currently available. */
getCapabilities(): Promise<VaultCapabilities>;
};
}
interface VaultCapabilities {
deposit: boolean;
withdraw: boolean;
lock: boolean;
unlock: boolean;
}Until this interface is available, the mobile client uses isSdkReady: true as the default.