Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/main/java/com/metamask/dapp/EthereumViewModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class EthereumViewModel @Inject constructor(
Logger.log("Ethereum connection error: ${result.error.message}")
onError(result.error.message)
}
is Result.Success.Item -> {
Logger.log("Ethereum connection result: ${result.value}")
is Result.Success.Items -> {
Logger.log("Ethereum connection result: ${result.value.first()}")
onSuccess()
}
else -> { }
Expand Down
4 changes: 2 additions & 2 deletions metamask-android-sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ android {
targetSdk 33

ext.versionCode = 1
ext.versionName = "0.5.4"
ext.versionName = "0.5.5"

testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
consumerProguardFiles 'consumer-rules.pro'
Expand Down Expand Up @@ -62,7 +62,7 @@ dependencies {

ext {
PUBLISH_GROUP_ID = 'io.metamask.androidsdk'
PUBLISH_VERSION = '0.5.4'
PUBLISH_VERSION = '0.5.5'
PUBLISH_ARTIFACT_ID = 'metamask-android-sdk'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import android.content.pm.PackageManager
import android.os.Build
import android.os.Bundle
import android.os.IBinder
import android.util.Log
import androidx.annotation.RequiresApi
import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import io.metamask.nativesdk.IMessegeService
Expand Down Expand Up @@ -272,14 +270,8 @@ internal class CommunicationClient(context: Context, callback: EthereumEventCall
EthereumMethod.ETH_REQUEST_ACCOUNTS.value -> {
val result = data.optString("result")
val accounts: List<String> = Gson().fromJson(result, object : TypeToken<List<String>>() {}.type)
val account = accounts.getOrNull(0)

if (account != null) {
updateAccount(account)
completeRequest(id, Result.Success.Item(account))
} else {
Logger.error("CommunicationClient:: Request accounts failure: $result")
}
completeRequest(id, Result.Success.Items(accounts))
}
EthereumMethod.ETH_CHAIN_ID.value -> {
val chainId = data.optString("result")
Expand Down Expand Up @@ -345,6 +337,7 @@ internal class CommunicationClient(context: Context, callback: EthereumEventCall
val accountsJson = event.optString("params")
val accounts: List<String> = Gson().fromJson(accountsJson, object : TypeToken<List<String>>() {}.type)
accounts.getOrNull(0)?.let { account ->
Logger.error("CommunicationClient:: Event Updated to account $account")
updateAccount(account)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package io.metamask.androidsdk

object SDKInfo {
const val VERSION = "0.5.4"
const val VERSION = "0.5.5"
const val PLATFORM = "android"
}