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

Re-export @wharfkit types #110

Open
djmbritt opened this issue Apr 23, 2024 · 3 comments
Open

Re-export @wharfkit types #110

djmbritt opened this issue Apr 23, 2024 · 3 comments
Labels
discussion more discussion is needed

Comments

@djmbritt
Copy link
Member

djmbritt commented Apr 23, 2024

Currently, a user needs to import these types to get started:

import { Session } from "@wharfkit/session";
import { WalletPluginPrivateKey } from "@wharfkit/wallet-plugin-privatekey";

We should re-export these types from the SDK so that users don't need to install @wharkit/package to get started with the @effectai/sdk

For the user, it would look like:

import { createClient, Session, WalletPluginPrivateKey } from "@effectai/sdk"
@Jeffrieh
Copy link
Contributor

Hi David!

I agree, i think including and exporting the wharfkit session functionality inside of the SDK is a better approach then what we have now, we just have to be a bit careful that the bundle size doesnt increase for people that do not wish to use any session related stuff, e.g. using the sdk to get EFX price or other simple calls. I think wharfkit packages are tree shakable so that should be doable, but let me double check it and i'll report back here.

@Jeffrieh
Copy link
Contributor

Jeffrieh commented May 5, 2024

i re-exported the Session class from @wharfkit/session so that one can be extracted from the @effectai/sdk now. I think re-exporting the wharfkit/wallet-plugin-privatekey doesn't make much sense because its not used inside of the sdk, only for testing purposes, so it should be included into the devDependencies.

I think some further discussion is needed to determine which other wharfkit packages we will include/re-export into the SDK, if any at all, since some of them are very dependent on a specific flow that the user requires. for example, UI based clients need @wharfkit/web-renderer, some need @wharfkit/wallet-plugin-privatekey while others want wallet plugins like @wharfkit/wallet-plugin-anchor etc.

I get that we want to make the initial setup as easy as possible, but we would be making the dependancies and logic inside of the sdk more complicated, perhaps something to tackle for our next release (v.2.1.0)

@Jeffrieh Jeffrieh closed this as completed May 5, 2024
@Jeffrieh Jeffrieh reopened this May 5, 2024
@Jeffrieh Jeffrieh added the discussion more discussion is needed label May 5, 2024
@djmbritt djmbritt reopened this May 10, 2024
@djmbritt
Copy link
Member Author

Good points, I think all the WalletPlugins should be imported by users themselves, except for @wharfkit/wallet-plugin-privatekey.

The initial setup has been cleaned up a lot, and it's a lot easier to hook up the basic variables needed to set up the client.

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

No branches or pull requests

2 participants