michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
979 stars 252 forks source link

Add NATIVE_DECIMALS & LAMPORTS_PER_SOL constants #433

Closed n3tn1nja closed 3 months ago

n3tn1nja commented 3 months ago

Hello @michaelhly!

I've added the LAMPORTS_PER_SOL and DEFAULT_DECIMALS constants to the library.

Given the popularity of this library and frequent reuse of these in scripts, it seemed beneficial to centralize them to the library to reduce redundancy and potential errors. This change can help make many codebases cleaner and more maintainable.

Thank you for considering this addition!

michaelhly commented 3 months ago

Hi @n3tn1nja. Thanks for the contribution. Would you mind adding these constants to a new constants.py file in the solana directory?

kevinheavey commented 3 months ago

Can we rename DEFAULT_DECIMALS to NATIVE_DECIMALS and put it in src/spl/token/constants.py?

n3tn1nja commented 3 months ago

Hi @n3tn1nja. Thanks for the contribution. Would you mind adding these constants to a new constants.py file in the solana directory?

Happy to help. I have updated the PR; the constants are now in Solana directory.