-
Notifications
You must be signed in to change notification settings - Fork 19
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/browser #54
base: main
Are you sure you want to change the base?
Feat/browser #54
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this change would keep the aw-tool-registry
from having the tool IPFS CIDs when building the monorepo locally if isNode
isn't true
. If so, how were you getting the tool IPFS CIDs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line says if the environment is node, user will be able to build and deploy tools using i.e using. the command pnpm deploy:tools
hitting this command makes list of tools and all tool-registry features available in browser app built over this sdk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lmk if this question is about something else
packages/agent-wallet/package.json
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without these changes were you having trouble using the packages within a browser env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, they were needed to make the SDK build-compatible with browsers, this is because CommonJS modules cannot directly run in browsers. They are designed for Node.js like environments, converting the exports will allow to ship a dual package that supports both ESM and CommonJS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the this.log from this file. These will show up in user applications such as the CLI with no way for the user to silence these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still need to pass debug: true to the constructor to use this, this feature is similar to what we're in contracts sdk
by default, it is set to false
https://github.com/LIT-Protocol/agent-wallet/blob/feat/browser/packages/aw-signer/src/lib/contract.ts#L39
https://github.com/LIT-Protocol/agent-wallet/blob/feat/browser/packages/aw-signer/src/lib/contract.ts#L57
https://github.com/LIT-Protocol/agent-wallet/blob/feat/browser/packages/aw-signer/src/lib/contract.ts#L69
Making SDK workable in both browser and cli environments