From 2bcf08f2736f1a4c73b1e9dd63730377d09273b2 Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Tue, 3 Oct 2023 08:47:27 -0300 Subject: [PATCH] feat: use Alchemy API key for Ethereum main/goerli --- api/defaults.go | 6 ++++++ protocol/requests/create_account.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/api/defaults.go b/api/defaults.go index 67e8bf610..084193c72 100644 --- a/api/defaults.go +++ b/api/defaults.go @@ -138,6 +138,12 @@ func defaultNodeConfig(installationID string, request *requests.CreateAccount) ( nodeConfig.WalletConfig.InfuraAPIKeySecret = request.InfuraSecret } + if request.AlchemyEthereumMainnetToken != "" { + nodeConfig.WalletConfig.AlchemyAPIKeys[mainnetChainID] = request.AlchemyEthereumMainnetToken + } + if request.AlchemyEthereumGoerliToken != "" { + nodeConfig.WalletConfig.AlchemyAPIKeys[goerliChainID] = request.AlchemyEthereumGoerliToken + } if request.AlchemyArbitrumMainnetToken != "" { nodeConfig.WalletConfig.AlchemyAPIKeys[arbitrumChainID] = request.AlchemyArbitrumMainnetToken } diff --git a/protocol/requests/create_account.go b/protocol/requests/create_account.go index 3dcfa69a7..cc5328c3f 100644 --- a/protocol/requests/create_account.go +++ b/protocol/requests/create_account.go @@ -50,6 +50,8 @@ type WalletSecretsConfig struct { // Testing GanacheURL string `json:"ganacheURL"` + AlchemyEthereumMainnetToken string `json:"alchemyEthereumMainnetToken"` + AlchemyEthereumGoerliToken string `json:"alchemyEthereumGoerliToken"` AlchemyArbitrumMainnetToken string `json:"alchemyArbitrumMainnetToken"` AlchemyArbitrumGoerliToken string `json:"alchemyArbitrumGoerliToken"` AlchemyOptimismMainnetToken string `json:"alchemyOptimismMainnetToken"`