You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we wanna change the hooks package configuration we have to edit near-utils.js manually before the package is deployed. And it can't be edited afterward.
The main concern for now is switching between NEAR networks for mainnet and testnet from wherever the hooks are called anywhere from the web.
The near endpoints would still be defined inside the package, the user would just need to choose which network to use, like this
switch(config.network){case'mainnet':
// use mainnet endpointscase'testnet':
// use testnet endpointsdefault:
// use testnet endpoints}
Once the information of the network is there then I agree on something like you linked from Zora, but maybe without taking it too far for now. In the sense that we can listen to network changes in useNearHooks or start with simply passing the network to setupNear. That should be enough, cause then the smart contract calls go to the network you set up in the near.tsx. Does that make sense @achrafismyname ?
Thanks @devey for responding. Yes I got that, but I was thinking about the hooks that doesn't require authentication, specially in the NFTE component. If someone used the NFTE component, he has no way to switch network.
I was going to use useNearHooks for this, but what I didn't like about it is that a Provider is always required, which seemed to me a bit unnecessary in cases where we don't need authentication and default config works for us.
But I guess, it's the only solution because it will solve #102 too .
If we wanna change the hooks package configuration we have to edit near-utils.js manually before the package is deployed. And it can't be edited afterward.
The main concern for now is switching between NEAR networks for
mainnet
andtestnet
from wherever the hooks are called anywhere from the web.The near endpoints would still be defined inside the package, the user would just need to choose which network to use, like this
This is what a solution could be like https://github.com/ourzora/nft-hooks#configuration
The text was updated successfully, but these errors were encountered: