Implement Synth as an exchange rate provider #574
Reference in New Issue
Block a user
Delete Branch "synth-provider"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR is a pared down version of https://github.com/maybe-finance/maybe/pull/561, where we sketched out a multi-provider, multi-concept implementation. Please see the other PR for a detailed explanation.
@@ -0,0 +3,4 @@def initialize(api_key = ENV["SYNTH_API_KEY"])@api_key = api_key || ENV["SYNTH_API_KEY"]endThis looks like we're doubly guarding for the same thing. We're not. But it's an admittedly slightly premature guard.
When we ultimately pass in
ENV["EXCHANGE_RATE_PROVIDER_API_KEY"]— that value might be nil.If we want to both be able to instantiate this without any args (
Provider::Synth.new) and also be able to pass in a possiblynilkey, I think this would be the way to support that.This looks great and I think it's at a perfect starting level of abstraction. Thanks for the collab on this one!