feat(mobile): align mobile app with Bridgelet SDK API surface - #552
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the mobile (Expo) app in line with the actual
bridgelet-sdkAPI surface so it can interoperate with the real backend (previously it targeted endpoints/DTOs that don't exist).Changes
types/api.ts:CreateAccountRequestnow mirrors SDKCreateAccountDto(fundingSource,recovery_address,asset_code/asset_issuer);CreateAccountResponsemirrorsAccountResponseDto(nullableclaimUrl, no bogusclaimToken); added the 8-valueAccountStatusenum.sender/TransferService.ts: create viaPOST /accounts(was non-existent/api/accounts); removed the fabricatedGET /api/assetscall (SDK has no assets endpoint) -> client-side defaults.sender/SenderFlow.tsx: supplyfundingSource/recovery_addressfrom the connected wallet (useMobileWallet); sendasset_code/asset_issuer; guard nullclaimUrl.components/MobileSendFlow.tsx: create claim links via the realPOST /accounts(was non-existentPOST /claims), with 401/429 handling andX-API-Key.hooks/useDeepLinkClaim.ts: validate via SDKPOST /claims/verify(was non-existentGET /claims/{token}/validate), status mapping mirrors the web frontend.claims/service.ts:lookupClaimByTokennow calls the SDK server-side instead of local JWT decode (SDK tokens signpublicKey/type/jti, not account fields).utils/apiClient.ts: attachX-API-Keyheader (SDK uses globalApiKeyAuthGuard)..env.example: addEXPO_PUBLIC_FUNDING_ACCOUNTandEXPO_PUBLIC_API_KEY.Verification
tsc --noEmitpassesjestpasses (8 tests)Notes
/notifications/*and/api/translate/detectstill lack SDK counterparts; both degrade gracefully.ApiKeyAuthGuardcurrently guards/claims/*, contradicting the web frontend's direct-claim model.