Support new electrum config schemas

Stephen Paul Weber created

For eventual BCH

Change summary

config-schema.dhall | 13 ++++++++++++-
config.dhall.sample |  9 ++++++++-
lib/electrum.rb     |  3 ++-
3 files changed, 22 insertions(+), 3 deletions(-)

Detailed changes

config-schema.dhall 🔗

@@ -17,7 +17,18 @@
 , creds : { account : Text, password : Text, username : Text }
 , direct_sources : List { mapKey : Text, mapValue : Text }
 , direct_targets : List { mapKey : Text, mapValue : Text }
-, electrum : { rpc_password : Text, rpc_uri : Text, rpc_username : Text }
+, electrum :
+    { currency : Text
+    , rpc_password : Text
+    , rpc_uri : Text
+    , rpc_username : Text
+    }
+, electrum_bch :
+    { currency : Text
+    , rpc_password : Text
+    , rpc_uri : Text
+    , rpc_username : Text
+    }
 , electrum_notify_url :
     forall (address : Text) -> forall (customer_id : Text) -> Text
 , interac : Text

config.dhall.sample 🔗

@@ -72,7 +72,14 @@ in
 	electrum = {
 		rpc_uri = "",
 		rpc_username = "",
-		rpc_password = ""
+		rpc_password = "",
+		currency = ""
+	},
+	electrum_bch = {
+		rpc_uri = "",
+		rpc_username = "",
+		rpc_password = "",
+		currency = ""
 	},
 	oxr_app_id = "",
 	activation_amount = 15,

lib/electrum.rb 🔗

@@ -8,10 +8,11 @@ require "json"
 require "securerandom"
 
 class Electrum
-	def initialize(rpc_uri:, rpc_username:, rpc_password:)
+	def initialize(rpc_uri:, rpc_username:, rpc_password:, currency:)
 		@rpc_uri = URI(rpc_uri)
 		@rpc_username = rpc_username
 		@rpc_password = rpc_password
+		@currency = currency
 	end
 
 	def createnewaddress