Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add connectAndSignIn to CBWProvider #910

Merged
merged 4 commits into from
Jul 1, 2023
Merged

Conversation

bangtoven
Copy link
Contributor

Summary

How did you test your changes?

Comment on lines +605 to +607
* @param {string} params.nonce - A unique string to prevent replay attacks.
* @param {string} [params.statement] - An optional human-readable ASCII assertion that the user will sign.
* @param {string[]} [params.resources] - An optional list of information the user wishes to have resolved as part of authentication by the relying party.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -596,6 +597,76 @@ export class CoinbaseWalletProvider
return res.result;
}

/**
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshot 2023-06-30 at 3 57 08 PM

Comment on lines +605 to +606
* IMPORTANT: Signature validation is not performed by this method. Users of this method are advised to perform their own signature validation.
* Common web3 frontend libraries such as ethers.js and viem provide the `verifyMessage` utility function that can be used for signature validation.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't seem like there's an existing method to do this.
we have one named ethereumAddressFromSignedMessage, but it's defined on the relay and makes request via WL...
image

@bangtoven bangtoven marked this pull request as ready for review June 30, 2023 23:04
Comment on lines +629 to +631
// NOTE: It was intentionally built by following the pattern of the existing eth_requestAccounts method
// to maintain consistency and avoid introducing a new pattern.
// We acknowledge the need for a better design, and it is planned to address and improve it in a future refactor.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@bangtoven bangtoven requested a review from vishnumad June 30, 2023 23:07
@bangtoven bangtoven enabled auto-merge (squash) June 30, 2023 23:09
Comment on lines +625 to +627
accounts: AddressString[];
message: string;
signature: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to type message and signature as HexString.

@bangtoven bangtoven merged commit 4d3df20 into master Jul 1, 2023
12 checks passed
@bangtoven bangtoven deleted the jungho/connect-and-sign-in branch July 1, 2023 00:06
bangtoven added a commit that referenced this pull request Feb 29, 2024
* add connectAndSignIn

* for testing

* implementation.

* Revert "for testing"

This reverts commit fec69ba.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants