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

feat: WalletAccount non-breaking temp solution #1259

Merged
merged 9 commits into from
Nov 18, 2024

Conversation

tabaktoni
Copy link
Collaborator

Motivation and Resolution

Based on #1245
This should be a temporary fix that can be merged as it should not contain breaking changes.

Checklist:

  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Linked the issues which this PR resolves
  • Documented the changes in code (API docs will be generated automatically)
  • Updated the tests
  • All tests are passing

@PhilippeR26
Copy link
Collaborator

What are the differences with PR1245?

@tabaktoni
Copy link
Collaborator Author

What are the differences with PR1245?

Please check now, I started PR but got pulled on HH

@tabaktoni
Copy link
Collaborator Author

tabaktoni commented Nov 9, 2024

In general, the idea is to have a non-breaking constructor args. So for existing users, this should continue to work as it was before, but now they can also provide an address or use static methods to avoid wallet popup.

@PhilippeR26
Copy link
Collaborator

But we have still something async in the constructor, that is the root cause of PR 1245 creation.

@ivpavici ivpavici requested a review from penovicp November 13, 2024 10:16
@tabaktoni
Copy link
Collaborator Author

The imminent Issue is the wallet popup opening without the option to stop it.
This resolves it without breaking changes so it could be merged asap.

The more proper solution could go into the next mayor versions with breaking changes.

Copy link
Collaborator

@penovicp penovicp left a comment

Choose a reason for hiding this comment

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

Left two suggestions that truncate the new code. Aside from that lgtm.

src/wallet/account.ts Outdated Show resolved Hide resolved
src/wallet/account.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@PhilippeR26 PhilippeR26 left a comment

Choose a reason for hiding this comment

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

I think that this solution is the best compromise, even if we don't solve the initial problem without braking changes.

For Information, OKX wallet team is reporting that they have problems with this subject.
They are waiting a new version with connect.
So, we should go forward on this subject.

tabaktoni and others added 3 commits November 18, 2024 19:37
Comment on lines 69 to 73
if (!address.length) {
requestAccounts(this.walletProvider).then(([accountAddress]) => {
this.address = accountAddress.toLowerCase();
});
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's add a deprecation warning here saying that connect should be use instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

provider: ProviderInterface,
walletProvider: StarknetWalletProvider,
cairoVersion?: CairoVersion,
silentMode: boolean = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like my implementation better. Separating "connect" and "connectSilent" is a better approach imo, then passing a boolean here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK will add connectSilent as alias on fixed connect, I think these best compromise on this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dhruvkelawala
Copy link
Collaborator

If it's based on my PR, I would also suggest changing the base branch to my PR branch and then merge this PR as "Backwards compatibility" or something.

@tabaktoni tabaktoni changed the base branch from develop to feat/improve-wallet-account November 18, 2024 12:14
@tabaktoni
Copy link
Collaborator Author

If it's based on my PR, I would also suggest changing the base branch to my PR branch and then merge this PR as "Backwards compatibility" or something.

I tried but there are conflicts as I changed all ex. connect so it is easier to just merge this.

@tabaktoni tabaktoni changed the base branch from feat/improve-wallet-account to develop November 18, 2024 12:21
@tabaktoni tabaktoni merged commit 84b267c into develop Nov 18, 2024
3 checks passed
github-actions bot pushed a commit that referenced this pull request Nov 18, 2024
# [6.18.0](v6.17.0...v6.18.0) (2024-11-18)

### Features

* WalletAccount non-breaking temp solution ([#1259](#1259)) ([84b267c](84b267c))
Copy link

🎉 This issue has been resolved in version 6.18.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants