Skip to content

docs: add missing await to README provider.request() examples#279

Open
golldyck wants to merge 1 commit intobase:masterfrom
golldyck:fix/readme-missing-await
Open

docs: add missing await to README provider.request() examples#279
golldyck wants to merge 1 commit intobase:masterfrom
golldyck:fix/readme-missing-await

Conversation

@golldyck
Copy link
Copy Markdown

Problem

Two quickstart code blocks in README.md (lines 176, 184) and the duplicated block in packages/account-sdk/README.md (lines 81, 89) call provider.request() without await. Per packages/account-sdk/src/core/provider/interface.ts the Provider signature is request(args: RequestArguments): Promise<unknown>, so the examples as written assign a Promise to addresses and the following step indexes it as addresses[0] — which is undefined. The personal_sign call in step 4 is also fire-and-forget.

Fix

Added await to both provider.request() invocations in both READMEs so the quickstart actually works when copied.

Changes

  • README.md — Prefixed await on the eth_requestAccounts call (line 176) and on the personal_sign call (line 184) in the Basic SDK Usage section
  • packages/account-sdk/README.md — Same fix applied to the mirrored quickstart (lines 81, 89)

Testing

  • Verified request is typed as request(args: RequestArguments): Promise<unknown>; in packages/account-sdk/src/core/provider/interface.ts
  • Confirmed without await, addresses[0] in the personal_sign step is undefined
  • Checked no other README code blocks use provider.request without awaiting

Closes #272

Per the Provider interface in core/provider/interface.ts (request returns
Promise<unknown>), the quickstart examples in both READMEs need to await
the call. Without await, 'const addresses = provider.request(...)' binds
a Promise to 'addresses', so the next step's 'addresses[0]' is undefined
and personal_sign fires unawaited.

Closes base#272
@cb-heimdall
Copy link
Copy Markdown
Collaborator

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

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.

Bug: README code examples missing await on provider.request() calls

2 participants