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

[W3M] SDK Interface cleanup #898

Merged
merged 17 commits into from
Jun 12, 2023
Merged

[W3M] SDK Interface cleanup #898

merged 17 commits into from
Jun 12, 2023

Conversation

radeknovis
Copy link
Contributor

No description provided.

@radeknovis radeknovis temporarily deployed to internal June 7, 2023 08:32 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 09:19 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 09:27 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 09:39 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 09:59 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 10:04 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 10:05 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 10:11 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 10:54 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 7, 2023 11:16 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 8, 2023 09:11 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 8, 2023 09:14 — with GitHub Actions Inactive
@radeknovis radeknovis temporarily deployed to internal June 12, 2023 09:35 — with GitHub Actions Inactive

/// For proposing a session to a wallet.
/// Function will propose a session on newly created pairing.
public func createPairingAndConnect() async throws -> WalletConnectURI {
Copy link
Contributor

Choose a reason for hiding this comment

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

would make sense to call the method just connect() with an optional topic?
same as deprecated method of sign client

    public func connect(
        requiredNamespaces: [String: ProposalNamespace],
        optionalNamespaces: [String: ProposalNamespace]? = nil,
        sessionProperties: [String: String]? = nil,
        topic: String? = nil

Copy link
Contributor

Choose a reason for hiding this comment

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

actually would match kotlin's interface too

Comment on lines +54 to +56
public static func set(sessionParams: SessionParams) {
Web3Modal.config.sessionParams = sessionParams
}
Copy link
Contributor

Choose a reason for hiding this comment

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

what the set method is for?
what's the difference between configure()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought this could be used to change sessionParams on fly (e.g. users selects different chain) while configure() is more like a one time initialisation

Copy link
Contributor

Choose a reason for hiding this comment

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

I see, does it work? It’s singletons and config is used on the instantiation, so with the first call only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it works. Config is stored as a static variable, which can be changed only via these 2 methods. I'm calling set() from Dapp

@radeknovis radeknovis temporarily deployed to internal June 12, 2023 12:24 — with GitHub Actions Inactive
@radeknovis radeknovis merged commit f3c5546 into develop Jun 12, 2023
@radeknovis radeknovis deleted the feature/cleanup-api branch June 12, 2023 13:05
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.

2 participants