[WSAPI-4] Port GraphQL client with fingerprint hardening #3
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feature/WSAPI-4"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Ticket
WSAPI-4 Port GraphQL client with fingerprint hardening
Summary
lib/wealthsimple/client) —query(), retry/backoff,once-only 401 refresh, memoized identity lookup (
getIdentityId()), and the shared Relay-cursorpaginator (
collectPages()). The fingerprint-hardening the ticket describes (consistent User-Agent,persistent cookie jar, Origin/Referer/Accept-Language/sec-fetch-* headers, a single verified
x-ws-profile) was already done in WSAPI-3'slib/wealthsimple/request(wsFetch) — nothing underrequest/changed here.accounts(fetchAllAccountFinancials),credit-card(fetchCreditCardAccount), andactivity(fetchActivityFeedItems), each backed by aGraphQL document transcribed verbatim into
lib/wealthsimple/queries.ts.balancesoperation — per-account security/position quantities and per-account cashbalance, which budget-tracker-api's sync never needed. Its query (
FETCH_ACCOUNT_BALANCES) isws-api-python's
FetchAccountsWithBalance, verified against that project'sget_account_balances()rather than reverse-engineered against the live account.
sec-c-cad/sec-c-usdare Wealthsimple'scash pseudo-securities;
positionsFor()/cashBalanceFor()split real holdings from cash.response-parsing tests per operation, against fixtures reused from budget-tracker-api (four existing
operations) or synthesized from the verified schema (the new balances operation, since no live capture
exists for it).
x-ws-identity-idwas order-dependent across operation modules (now resolved centrally inquery()),a balances bug where cash split across two custodian accounts under-reported (summed instead of
.find()-ed), an overly strict schema that let one odd custodian account fail an entire multi-accountbalances call, a missing empty-id-list guard, deduped a copy-pasted zod schema into
lib/wealthsimple/schema.ts, and added the regression/edge-case test coverage those bugs exposed(empty connections, null/
''quantity rejection, etc).🤖 Generated with Claude Code
https://claude.ai/code/session_01DSc34oDVEBXLz9TJWt26Nn