apibara / starknet-react

A collection of React providers and hooks for StarkNet
https://starknet-react.com
MIT License
369 stars 147 forks source link

fix: [Type] useAccount.address should return an Address type #489

Closed Benjtalkshow closed 2 months ago

Benjtalkshow commented 2 months ago

Closes #452

To address the issue with address formatting in the useAccount hook, I have implemented a new getAddress function. This function ensures that addresses are consistently prefixed with 0x, aligning with the expected Address type.

Benjtalkshow commented 2 months ago

@fracek i have updated my PR

fracek commented 2 months ago

I added a couple more comments. Also run pnpm lint:fix

Benjtalkshow commented 2 months ago

@fracek I have placed the docString close to the function and simplified the code. I also ran pnpm fix:lint

Benjtalkshow commented 2 months ago

@fracek I have placed the docString close to the function and simplified the code. I also ran pnpm fix:lint

Benjtalkshow commented 2 months ago

@fracek I have placed the docString close to the function and simplified the code. I also ran pnpm fix:lint

fracek commented 2 months ago

Looks good now! Once you fix formatting and the CI passes I will merge it.

Benjtalkshow commented 2 months ago

Looks good now! Once you fix formatting and the CI passes I will merge it.

@fracek Please i updated the repo

Benjtalkshow commented 2 months ago

@fracek Please i updated the repo

fracek commented 2 months ago

Looks like the new code caught an issue in the old code! Please fix the test and make sure linting and tests work before pushing.

Benjtalkshow commented 2 months ago

Looks like the new code caught an issue in the old code! Please fix the test and make sure linting and tests work before pushing.

Sir it seems each time I run lint, it adds another issue. How can I avoid this?

fracek commented 2 months ago

Run lint:fix and test locally and fix issues as they come.

fracek commented 2 months ago

Thank you for this!

Benjtalkshow commented 2 months ago

Thank you for this!

You're welcome sir