Replies: 3 comments 6 replies
-
Related #994 tl;dr: no I opened this a while back as, at least in the use case described in this issue, we came across some difficulties owing to API requests being handled through stacks.js libs. We may well come across similar issues in future. If we do allow users to invoke API requests through stacks.js libs, we must let the consumer configure all properties of the request. So this configuration-passing functionality also needs to be built into the BNS library. Further, it also means that the library determines what http client lib the consumer uses. What if the package consumer want to use a different one? Do they have to bundle the one chosen here anyway? We don't know the environment this is being used, so you're forced to use My suggestion would be to prohibit all transport layer interaction in the BNS library (and most other packages), no http requests or side-effecty behaviour. Instead we could expose methods to help prepare these API requests, but not actually call them within. Can |
Beta Was this translation helpful? Give feedback.
-
Using the node api client library inside stacks.js means that developers can only switch to a different node url if that node runs the stacks api server. This might not be the case. Therefore, I would try to create client libraries with clear requirements on the server. Probably developers run a custom stacks api server specific to their contracts. |
Beta Was this translation helpful? Give feedback.
-
I would agree with @kyranjamie and try to have very clear definitions of what each package does. I think we should generally move away of having "one package to rule them all" for a given category of functionality. The most complex and confusing things about BNS are how to construct the arguments needed for the various contract functions.
To me, these don't seem related to the BNS library at all, but instead these should be exposed via connect and the transactions lib. Perhaps these libraries would implement some BNS-sdk package. |
Beta Was this translation helpful? Give feedback.
-
Right now, the BNS library includes methods to interact with the BNS contract. With the recent addition of BNS API endpoints, there are several new fetching capabilities that are not directly implemented in the BNS contract (and not in the BNS library).
The question is: Should we extend the scope of the BNS library and include new capabilities provided by the API?
I would argue that developers using BNS shouldn't need to worry about the difference between the contract, API, or library. This is an additional burden to the onboarding flow that we can avoid to improve the developer experience. It would be great if the BNS library could be the go-to for all BNS features developers would care about.
In terms of BNS features that developers care about today, there's some signal from current research:
Another thing to note is that Hiro wallets are also not allowing users to register a username during the account creation process. The only registrar currently available is btc.us.
All things considered, I would assume that developers would mainly care about fetching capabilities (eg get username for an account). This would reason them not to use the BNS library and integrate the BNS API endpoints instead. Thus, limiting the impact of the BNS library. If we believe this is OK, and the scope should stay as is, we should explicitly communicate the scope of the library. For instance, BNS JS library for ...
Beta Was this translation helpful? Give feedback.
All reactions