docs(readme): fix provider.request usage in Basic SDK Usage - #381
Open
3822802 wants to merge 1 commit into
Open
Conversation
Collaborator
🟡 Heimdall Review Status
|
Two issues in the quickstart snippets:
1. Step 3 assigns provider.request(...) without awaiting it. request()
returns Promise<unknown>, so addresses is a Promise and addresses[0]
in step 4 is undefined.
2. Step 4 calls request('personal_sign', [...]) positionally, but the
provider interface is request(args: RequestArguments) — a single
object with method and optional params.
3822802
force-pushed
the
fix-readme-provider-request
branch
from
August 13, 2026 12:42
73e8e97 to
22986eb
Compare
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
Two issues in the Basic SDK Usage snippets in the README that will not work as written.
1. Missing
await(step 3)request()returnsPromise<unknown>, soaddressesis a Promise, not an array. Step 4 then readsaddresses[0], which isundefined.2. Wrong call signature (step 4)
The provider interface takes a single
RequestArgumentsobject, not positional arguments:Passing
('personal_sign', [...])meansargsis the string'personal_sign'andargs.methodisundefined.This is also inconsistent with step 3 in the same section, which already uses the object form.
Fix
Adds the missing
awaitand switches step 4 to the object form, matching both the type definition and EIP-1193.