Skip to content

Commit

Permalink
Merge pull request #3 from Web3Auth/deps-update
Browse files Browse the repository at this point in the history
refactor: update fnd-java, torus-utils-java and session-manager-andro…
  • Loading branch information
chaitanyapotti authored Jul 8, 2024
2 parents ad9dc05 + c683077 commit 40d992f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 26 deletions.
6 changes: 3 additions & 3 deletions singlefactorauth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'

implementation 'org.web3j:crypto:4.9.5'
implementation 'com.github.torusresearch:torus-utils-java:3.2.1'
implementation 'org.torusresearch:fetch-node-details-java:3.1.0'
implementation 'org.torusresearch:torus-utils-java:3.3.0'
implementation 'org.torusresearch:fetch-node-details-java:4.1.1'
implementation 'com.google.code.gson:gson:2.9.1'
implementation 'org.slf4j:slf4j-simple:2.0.3'
//session-manager-sdk
implementation 'com.github.Web3Auth:session-manager-android:0.0.8'
implementation 'com.github.Web3Auth:session-manager-android:1.3.0'

testImplementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import org.json.JSONObject
import org.torusresearch.fetchnodedetails.FetchNodeDetails
import org.torusresearch.fetchnodedetails.types.NodeDetails
import org.torusresearch.torusutils.TorusUtils
import org.torusresearch.torusutils.helpers.Utils
import org.torusresearch.torusutils.types.RetrieveSharesResponse
import org.torusresearch.torusutils.types.TorusCtorOptions
import org.torusresearch.torusutils.types.TorusPublicKey
Expand All @@ -33,17 +32,7 @@ class SingleFactorAuth(singleFactorAuthArgs: SingleFactorAuthArgs) {
private val gson = GsonBuilder().disableHtmlEscaping().create()

init {
nodeDetailManager = if (Utils.isEmpty(singleFactorAuthArgs.networkUrl)) {
FetchNodeDetails(
singleFactorAuthArgs.getNetwork(),
SingleFactorAuthArgs.CONTRACT_MAP[singleFactorAuthArgs.getNetwork()]
)
} else {
FetchNodeDetails(
singleFactorAuthArgs.networkUrl,
SingleFactorAuthArgs.CONTRACT_MAP[singleFactorAuthArgs.getNetwork()]
)
}
nodeDetailManager = FetchNodeDetails(singleFactorAuthArgs.getNetwork())
val opts = TorusCtorOptions("single-factor-auth-android", singleFactorAuthArgs.clientid)
opts.isEnableOneKey = true
opts.network = singleFactorAuthArgs.getNetwork().toString()
Expand Down Expand Up @@ -101,7 +90,7 @@ class SingleFactorAuth(singleFactorAuthArgs: SingleFactorAuthArgs) {
json.put("privateKey", retrieveSharesResponse.privKey.toString())
json.put("publicAddress", retrieveSharesResponse.ethAddress)
sessionManager.createSession(
json.toString(), sessionTime
json.toString(), sessionTime, true
)
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.web3auth.singlefactorauth.types

import org.torusresearch.fetchnodedetails.FetchNodeDetails
import org.torusresearch.fetchnodedetails.types.TorusNetwork

class SingleFactorAuthArgs(network: TorusNetwork, clientid: String) {
Expand All @@ -22,15 +21,6 @@ class SingleFactorAuthArgs(network: TorusNetwork, clientid: String) {
}

companion object {
var CONTRACT_MAP: HashMap<TorusNetwork?, String?> =
object : HashMap<TorusNetwork?, String?>() {
init {
put(TorusNetwork.MAINNET, FetchNodeDetails.PROXY_ADDRESS_MAINNET)
put(TorusNetwork.TESTNET, FetchNodeDetails.PROXY_ADDRESS_TESTNET)
put(TorusNetwork.CYAN, FetchNodeDetails.PROXY_ADDRESS_CYAN)
put(TorusNetwork.AQUA, FetchNodeDetails.PROXY_ADDRESS_AQUA)
}
}
var SIGNER_MAP: HashMap<TorusNetwork?, String?> = object : HashMap<TorusNetwork?, String?>() {
init {
put(TorusNetwork.MAINNET, "https://signer.tor.us")
Expand Down

0 comments on commit 40d992f

Please sign in to comment.