-
Notifications
You must be signed in to change notification settings - Fork 19
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
refactor: integrate FailoverProvider #1263
Conversation
🚅 Previously deployed to Railway in the Drips App project. Environment has been deleted. |
} else if (provider === 'alchemy') { | ||
const alchemyKey = getOptionalEnvVar('ALCHEMY_KEY'); | ||
assert(alchemyKey, 'ALCHEMY_KEY is required'); | ||
rpcUrl = `https://${alchemyNetworkMap[network as keyof typeof alchemyNetworkMap]}.g.alchemy.com/v2/${alchemyKey}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The typecast here could be unsafe if provider
is alchemy
but network
is filecoin-mainnet
. Generally I think typecasting should be avoided unless absolutely necessary. I would assert explicitly here that network
is included in alchemyNetworkMap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh also, i think the entire block would be neater as a switch
statement
.env.template
Outdated
# Optional Infura key. | ||
INFURA_KEY=string | ||
# Optional Alchemy key. | ||
ALCHEMY_KEY=string | ||
# Optional Filecoin key. | ||
FILECOIN_KEY=string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you just add a sentence explaining that values for at least one of the providers are required?
No description provided.