From 88489434222e4873818c50a5e5e985466c60d86a Mon Sep 17 00:00:00 2001 From: Dario Gabriel Lipicar Date: Thu, 12 Oct 2023 16:40:13 -0300 Subject: [PATCH] feat: obtain rarible api keys --- api/defaults.go | 8 ++++++++ params/config.go | 12 +++++++----- protocol/requests/create_account.go | 10 ++++++---- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/api/defaults.go b/api/defaults.go index bfd738792..45b4370bf 100644 --- a/api/defaults.go +++ b/api/defaults.go @@ -158,6 +158,14 @@ func defaultNodeConfig(installationID string, request *requests.CreateAccount) ( nodeConfig.WalletConfig.OpenseaAPIKey = request.OpenseaAPIKey } + if request.RaribleMainnetAPIKey != "" { + nodeConfig.WalletConfig.RaribleMainnetAPIKey = request.RaribleMainnetAPIKey + } + + if request.RaribleTestnetAPIKey != "" { + nodeConfig.WalletConfig.RaribleTestnetAPIKey = request.RaribleTestnetAPIKey + } + if request.InfuraToken != "" { nodeConfig.WalletConfig.InfuraAPIKey = request.InfuraToken } diff --git a/params/config.go b/params/config.go index 96a0b6d24..11ccbd330 100644 --- a/params/config.go +++ b/params/config.go @@ -530,11 +530,13 @@ type Network struct { // WalletConfig extra configuration for wallet.Service. type WalletConfig struct { - Enabled bool - OpenseaAPIKey string `json:"OpenseaAPIKey"` - AlchemyAPIKeys map[uint64]string `json:"AlchemyAPIKeys"` - InfuraAPIKey string `json:"InfuraAPIKey"` - InfuraAPIKeySecret string `json:"InfuraAPIKeySecret"` + Enabled bool + OpenseaAPIKey string `json:"OpenseaAPIKey"` + RaribleMainnetAPIKey string `json:"RaribleMainnetAPIKey"` + RaribleTestnetAPIKey string `json:"RaribleTestnetAPIKey"` + AlchemyAPIKeys map[uint64]string `json:"AlchemyAPIKeys"` + InfuraAPIKey string `json:"InfuraAPIKey"` + InfuraAPIKeySecret string `json:"InfuraAPIKeySecret"` } // LocalNotificationsConfig extra configuration for localnotifications.Service. diff --git a/protocol/requests/create_account.go b/protocol/requests/create_account.go index 053fbc857..4066f8ee0 100644 --- a/protocol/requests/create_account.go +++ b/protocol/requests/create_account.go @@ -43,10 +43,12 @@ type CreateAccount struct { } type WalletSecretsConfig struct { - PoktToken string `json:"poktToken"` - InfuraToken string `json:"infuraToken"` - InfuraSecret string `json:"infuraSecret"` - OpenseaAPIKey string `json:"openseaApiKey"` + PoktToken string `json:"poktToken"` + InfuraToken string `json:"infuraToken"` + InfuraSecret string `json:"infuraSecret"` + OpenseaAPIKey string `json:"openseaApiKey"` + RaribleMainnetAPIKey string `json:"raribleMainnetApiKey"` + RaribleTestnetAPIKey string `json:"raribleTestnetApiKey"` // Testing GanacheURL string `json:"ganacheURL"`