-
Notifications
You must be signed in to change notification settings - Fork 315
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
🚧 WIP [next] feat!: refactor stacks.js #1596
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
d6c09f9
to
4e6c8b3
Compare
BREAKING CHANGE: Convert `version` of PoXAddress from array to number.
4e6c8b3
to
a342cc7
Compare
Any other thoughts on this change? @zone117x
A) Do you think we could remove the package and move its contents to I'm thinking if most people also need to do text<>hex conversion or similar, we might as well do everything in |
Hmm good arguments for both options. I don't really have a strong opinion. Kinda lean towards keeping the |
Splitting this out into separate PRs |
closed in favor of #1622 |
High-level changes:
@stacks/api
package (main way to do networking for users)Refactor 🚂
@stacks/network
packagefetch
functions from network and introduceStacksNodeApi
, which can derive it's URL from a network, but should be treated separately -- more closely mirroring to what's actually happening in the background.{ api: { url: "my-node.com" }, ...}
in the params of most relevant tx functions.@stacks/common
Curious to get feedback 🙏 @hugocaillard @zone117x @rafaelcr
Open Questions:
url
bebaseUrl
,or?nodeUrl
ShouldStacksApi
beStacksNode
orStacksNodeApi
✅I like it short, but "node" could be helpful (even though most users wrap their node with the API). We could also add a "node-only mode" which ensures the requests it's trying to make exist on the v2 rather than extended.Should we move most things intocommon will be non-Stacks things, transactions will be the main package ✅@stacks/transactions
(is there a case for having users import from@stacks/common
for basic interactions or should it stay for helpers used by all@stacks/
packages?)Examples
Diff for most methods
New API class