Skip to content

fix: clear error when teamId is unresolvable with a service API key#23

Merged
wthrajat merged 3 commits into
mainfrom
fix/payments-teamid-service-key-error
Jul 8, 2026
Merged

fix: clear error when teamId is unresolvable with a service API key#23
wthrajat merged 3 commits into
mainfrom
fix/payments-teamid-service-key-error

Conversation

@bufo24

@bufo24 bufo24 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Transactions.send() from a live wallet fell through to a user-scoped GetTeamId query that a service API key cannot run. It now knows whether the user query is available (canResolveTeamId, wired from Boolean(config.apiKey)) and throws a helpful PaymentSendError telling the caller to pass { teamId } — instead of firing a doomed fetch.
  • Tidied the examples' environment/wallet listing: raw JSON.stringify dumps → scannable one-line summaries (name (type) — id, name [asset] — id).

Test plan

  • pnpm build
  • pnpm test — 39 pass incl. new "throws a helpful error when teamId is unresolvable (service API key only)"
  • pnpm format:check
  • Ran examples/receive.ts live — listing + invoice mint both work

🤖 Generated with Claude Code

bufo24 and others added 3 commits July 8, 2026 15:21
…I key

send() from a live wallet fell through to a user-scoped GetTeamId query that a
service API key cannot run. Transactions now knows whether the user query is
available (canResolveTeamId) and throws a helpful PaymentSendError telling the
caller to pass { teamId } instead of firing a doomed fetch.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Replace the raw JSON.stringify dump per environment/wallet with a scannable
one-line summary (name, type/asset, id).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
AbortSignal.timeout timers are unref'd, so on Node 22.x the event loop could
drain before the client's timeout fired — the abort never happened, run() hung,
and the subtest was torn down "still pending". Hold the loop open with a ref'd
timer until the abort fires.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@wthrajat wthrajat merged commit ebb4a0a into main Jul 8, 2026
2 checks passed
@apotdevin apotdevin mentioned this pull request Jul 8, 2026
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.

2 participants