Skip to content

Conversation

bluecco
Copy link
Contributor

@bluecco bluecco commented Apr 4, 2025

Issue / feature description

Add connectSilent for StarknetkitConnector

Changes

  • add new method connectSilent that uses silent_mode: true
  • this is used in connect in main.ts only for argent-x to solve an issue discovered on starkgate

Checklist

  • Rebased to the last commit of the target branch (or merged)
  • Code self-reviewed
  • Code self-tested
  • Tests updated (if needed)
  • All tests are passing locally

Please keep your pull request as small as possible. If you need to make multiple changes, please create separate pull requests for each change. Create a draft pull request if you need early feedback. This will mark the pull request as a work in progress and prevent it from being reviewed or merged until you are ready.

Please move drafts to the ready for review (regular PR) when you are ready to start the review process and other developers will pick it up from there.

@bluecco bluecco requested review from Cussone and vladutjs April 4, 2025 11:24
// TODO: Temp method to connect silently, only available with StarknetkitConnector
// it's a copy of the connect method with the silent_mode set to true
// this is done to keep compatibility with starknet-react and solve an issue with a locked ArgentX wallet
async connectSilent(): Promise<ConnectorData> {
Copy link
Member

@Cussone Cussone Apr 4, 2025

Choose a reason for hiding this comment

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

Why not just silent added as an optional argument to the plain connect? I don't think there will be any type issues w snreact

Copy link
Contributor

Choose a reason for hiding this comment

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

that was my initial suggestion as well. do-able?

Copy link
Contributor Author

@bluecco bluecco Apr 4, 2025

Choose a reason for hiding this comment

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

Why not just silent added as an optional argument to the plain connect? I don't think there will be any type issues w snreact

I actually had typescript issues last time we added it (different params in the connect method compared to snreact), that was the reason to do this new method (otherwise they would need to cast as any)

I will try again this afternoon (locally) just to double check

Copy link
Member

Choose a reason for hiding this comment

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

I don't remember having any type issues when I was testing one button connector, and I added showQrOnly or something similar to Argent's mobile connector. It could be that I'm wrong.

@bluecco bluecco merged commit c1edec0 into beta-connect-silent Apr 4, 2025
1 check passed
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.

3 participants