Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement TypeBox for Environment Variable Management #95

Open
wants to merge 2 commits into
base: development
Choose a base branch
from

Conversation

imabutahersiddik
Copy link

This pull request addresses the task of integrating TypeBox for managing environment variables as outlined in issue #88.

Changes Made:

  • Updated Environment Schema: The environment variables are now defined using TypeBox, enhancing type safety and validation. This ensures that the application can better handle configurations.
  • Optional Fields: The NFT_MINTER_PRIVATE_KEY and NFT_CONTRACT_ADDRESS are now optional, allowing for more flexible configuration in different environments.
  • Error Handling: Improved error handling to ensure that appropriate messages are logged when required environment variables are missing.

These changes improve the robustness and maintainability of the codebase by leveraging TypeBox's capabilities for environment variable management.

Resolves #88

This commit modifies the `generateErc721PermitSignature` function to improve the handling of environment variables related to NFT minting. The following changes have been made:

- **Optional Fields**: Updated the environment variable checks to ensure that `NFT_MINTER_PRIVATE_KEY` and `NFT_CONTRACT_ADDRESS` are treated as optional. If these variables are not defined, appropriate error messages are logged, and exceptions are thrown.
  
- **Type Safety**: Introduced a type cast for `contextOrPermitPayload.env` to `Env`, ensuring type safety when accessing environment variables.

- **Error Handling**: Enhanced error handling by providing clear messages for missing required fields, improving debugging and user feedback.

These changes aim to make the permit generation process more robust and flexible, accommodating scenarios where certain environment variables may not be set.
@0x4007
Copy link
Member

0x4007 commented Oct 28, 2024

Please prove it works by posting QA of some sort

Copy link

@luisantoniocrag, this task has been idle for a while. Please provide an update.

1 similar comment
Copy link

@luisantoniocrag, this task has been idle for a while. Please provide an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optional NFT Types
2 participants