Skip to content

Commit

Permalink
feat(evm_phase_1): Update EVM Node URLs for Staging (#4129)
Browse files Browse the repository at this point in the history
  • Loading branch information
dtverdota-bc committed Nov 21, 2022
1 parent 225cc4f commit b518e93
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app/build.gradle
Expand Up @@ -113,6 +113,7 @@ android {
]
buildConfigField "String", "EXPLORER_URL", "\"${buildProperties.secrets['prodExplorer']}\""
buildConfigField "String", "API_URL", "\"${buildProperties.secrets['prodApiServer']}\""
buildConfigField "String", "EVM_NODE_API_URL", "\"${buildProperties.secrets['evmApiServer']}\""
buildConfigField "String", "EVERYPAY_HOST_URL", "\"${buildProperties.secrets['prodEverypayHost']}\""
buildConfigField "String", "STATUS_API_URL", "\"${buildProperties.secrets['prodApiStatus']}\""
buildConfigField "String", "NABU_WEBSOCKET_URL", "\"${buildProperties.secrets['prodNabuWebsocket']}\""
Expand Down Expand Up @@ -170,6 +171,7 @@ android {
]
buildConfigField "String", "EXPLORER_URL", "\"${buildProperties.secrets['prodExplorer']}\""
buildConfigField "String", "API_URL", "\"${buildProperties.secrets['prodApiServer']}\""
buildConfigField "String", "EVM_NODE_API_URL", "\"${buildProperties.secrets['evmApiServer']}\""
buildConfigField "String", "EVERYPAY_HOST_URL", "\"${buildProperties.secrets['prodEverypayHost']}\""
buildConfigField "String", "STATUS_API_URL", "\"${buildProperties.secrets['prodApiStatus']}\""
buildConfigField "String", "NABU_WEBSOCKET_URL", "\"${buildProperties.secrets['prodNabuWebsocket']}\""
Expand Down Expand Up @@ -228,6 +230,7 @@ android {
]
buildConfigField "String", "EXPLORER_URL", "\"${buildProperties.secrets['stagingExplorer']}\""
buildConfigField "String", "API_URL", "\"${buildProperties.secrets['stagingApiServer']}\""
buildConfigField "String", "EVM_NODE_API_URL", "\"${buildProperties.secrets['evmApiServer']}\""
buildConfigField "String", "EVERYPAY_HOST_URL", "\"${buildProperties.secrets['stagingEverypayHost']}\""
buildConfigField "String", "STATUS_API_URL", "\"${buildProperties.secrets['stagingApiStatus']}\""
buildConfigField "String", "NABU_WEBSOCKET_URL", "\"${buildProperties.secrets['stagingNabuWebsocket']}\""
Expand Down
2 changes: 2 additions & 0 deletions app/secretsDefaults.properties
Expand Up @@ -5,6 +5,8 @@ stagingExplorer=https://blockchain.info/
# API URL
prodApiServer=https://api.blockchain.info/
stagingApiServer=https://api.blockchain.info/
# EVM NODE URL
evmApiServer=https://api.blockchain.info/
# Bitcoin Websocket URL
prodBtcWebsocket=wss://ws.blockchain.info/inv
stagingBtcWebsocket=wss://ws.blockchain.info/inv
Expand Down
Expand Up @@ -18,6 +18,7 @@ val urls = mapOf(
"explorer-api" to BuildConfig.EXPLORER_URL,
"blockchain-api" to BuildConfig.API_URL,
"wallet-pubkey-api" to "${BuildConfig.API_URL}wallet-pubkey/",
"evm-nodes-api" to BuildConfig.EVM_NODE_API_URL,
"unified-activity-ws" to "${BuildConfig.UNIFIED_ACTIVITY_WS_URL}",
"nabu-api" to "${BuildConfig.API_URL}nabu-gateway/",
"wallet-helper-url" to BuildConfig.WALLET_HELPER_URL,
Expand Down
Expand Up @@ -42,6 +42,7 @@ val explorerRetrofit = StringQualifier("explorer")
val everypayRetrofit = StringQualifier("everypay")
val apiRetrofit = StringQualifier("api")
val kotlinXApiRetrofit = StringQualifier("kotlinx-api")
val evmNodesApiRetrofit = StringQualifier("evm-nodes-api")
val kotlinXCoinApiRetrofit = StringQualifier("kotlinx-coin-api")
val serializerExplorerRetrofit = StringQualifier("serializer_explorer")
val gbp = StringQualifier("GBP")
Expand Down
17 changes: 16 additions & 1 deletion wallet/src/main/java/com/blockchain/koin/walletModule.kt
Expand Up @@ -91,10 +91,25 @@ val walletModule = module {
.build()
}

single(evmNodesApiRetrofit) {
val json = Json {
explicitNulls = false
ignoreUnknownKeys = true
isLenient = true
encodeDefaults = true
}
Retrofit.Builder()
.baseUrl(getBaseUrl("evm-nodes-api"))
.client(get())
.addCallAdapterFactory(get<OutcomeCallAdapterFactory>())
.addConverterFactory(json.asConverterFactory("application/json".toMediaType()))
.build()
}

factory {
EthAccountApi(
ethEndpoints = get<Retrofit>(apiRetrofit).create(EthEndpoints::class.java),
ethNodeEndpoints = get<Retrofit>(kotlinXApiRetrofit).create(EthNodeEndpoints::class.java),
ethNodeEndpoints = get<Retrofit>(evmNodesApiRetrofit).create(EthNodeEndpoints::class.java),
apiCode = getProperty("api-code")
)
}
Expand Down

1 comment on commit b518e93

@Ameralameri
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve

Please sign in to comment.