Merge pull request #128 from utxos-dev/fix/get-wallets-by-tag-url
fix(cardano): correct getWalletsByTag URL path and encode tag
fix(cardano): correct getWalletsByTag URL path and encode tag
The endpoint was hitting `api/project-wallet/{projectId}/cardano/tag/{tag}`,
which does not exist on the server — the route is
`api/project-wallet/{projectId}/tag/{tagstring}`. Every call returned 404
HTML even when matching wallets existed.
Also URL-encode the tag so emails and any tag with special characters
(`@`, `/`, spaces, etc.) round-trip safely through the path segment.
Bumped version to 0.2.3.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
feat: add getProjectWalletsByTag and normalize wallet shape
Main shipped 0.2.1 in #126; this branch's 0.2.1 collides, so bump to 0.2.2. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Add `getProjectWalletsByTag(tag)` on `WalletDeveloperControlled`, consuming the existing `GET /api/project-wallet/:projectId/tag/:tag` endpoint. URL-encodes the tag and rejects empty/whitespace input. - Add `normalizeWalletInfo` helper that maps the backend's flat `Web3ProjectWallet` response (top-level `pubKeyHash`, `stakeCredentialHash`) into the SDK's nested `MultiChainWalletInfo` shape. Apply it in `getProjectWallet` and `getProjectWalletsByTag`, replacing the unsafe `data as MultiChainWalletInfo` casts that previously left `walletInfo.chains.cardano.*` undefined for callers. Spark is intentionally omitted because the backend doesn't persist Spark public keys. - Drop the dead `walletInfo.chains.spark` gate in `getWallet`. Spark wallets are derived entirely from the mnemonic; the gate previously prevented the spark branch from ever running in production. - Update tests to mock the actual flat backend shape and assert the normalized output. 40/40 passing. Bumps version 0.2.0 -> 0.2.1. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>