Add optional chain argument to starknet.id hooks
For a better testnet dapp experience, and to enable access to starknet.id on L3s, it is required to fetch starknet.id from mainnet instead of the connected chain.
Suggestion: Add an optional chainId argument (e.g. SN_MAIN) to useStarkAddress (), useStarkName () and useStarkProfile()
Yes, happy to accept a contribution for this. The hooks should accept a new optional argument chainId?: bigint and use that to lookup which contracts to use.
Hello @fracek I'm open to work on this.
Hey @raizo07 I assigned the issue to you.
Alright, I'm on it.
On Sun, Mar 24, 2024, 7:48 PM Francesco Ceccon @.***> wrote:
Hey @raizo07 https://github.com/raizo07 I assigned the issue to you.
— Reply to this email directly, view it on GitHub https://github.com/apibara/starknet-react/issues/420#issuecomment-2016903572, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATKSYSWV3DTHISDFBL5T77TYZ4NX3AVCNFSM6AAAAABFB7Y4VSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJWHEYDGNJXGI . You are receiving this because you were mentioned.Message ID: @.***>
Hi @fracek based on this documentation chainId is to be a string. "A 0x-prefixed hexadecimal string".
But in the comment above you suggested we use a bigint. Should I proceed with a bigint or a string
Hey, yes starknet-react uses a bigint as chainid because IMHO it works much better than hex-encoded values. To test the hook you can use a chainid from @starknet-react/chains, e.g. mainnet.id.