Skip to content

Commit

Permalink
Merge pull request #30 from torusresearch/feat/update-deps
Browse files Browse the repository at this point in the history
refactor: update fnd-java & torus-utils deps
  • Loading branch information
chaitanyapotti authored Jul 17, 2024
2 parents cf5e572 + 19b9c68 commit 20e65a4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import org.torusresearch.customauth.types.UserCancelledException;
import org.torusresearch.customauth.utils.Helpers;
import org.torusresearch.fetchnodedetails.types.NodeDetails;
import org.torusresearch.fetchnodedetails.types.TorusNetwork;
import org.torusresearch.fetchnodedetails.types.Web3AuthNetwork;
import org.torusresearch.torusutils.types.TorusPublicKey;
import org.torusresearch.torusutils.types.VerifierArgs;

Expand Down Expand Up @@ -77,7 +77,7 @@ protected void onCreate(Bundle savedInstanceState) {
// DirectSdkArgs args = new DirectSdkArgs("torusapp://org.torusresearch.customauthandroid/redirect", TorusNetwork.TESTNET);

// Option 2. Host redirect.html at your domain and proxy redirect to your app
CustomAuthArgs args = new CustomAuthArgs("https://scripts.toruswallet.io/redirect.html", TorusNetwork.TESTNET, "torusapp://org.torusresearch.customauthandroid/redirect", "YOUR_CLIENT_ID");
CustomAuthArgs args = new CustomAuthArgs("https://scripts.toruswallet.io/redirect.html", Web3AuthNetwork.AQUA, "torusapp://org.torusresearch.customauthandroid/redirect", "YOUR_CLIENT_ID");
// args.setEnableOneKey(true);

// Initialize CustomAuth
Expand Down
4 changes: 2 additions & 2 deletions sdk/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ android {
}

dependencies {
api 'org.torusresearch:fetch-node-details-java:4.1.1'
api 'org.torusresearch:torus-utils-java:3.3.0'
api 'org.torusresearch:fetch-node-details-java:5.0.0'
api 'org.torusresearch:torus-utils-java:3.4.0'
api 'androidx.browser:browser:1.4.0'
api 'org.web3j:crypto:4.8.8-android'
implementation 'com.auth0.android:jwtdecode:2.0.1'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
package org.torusresearch.customauth.types;

import org.torusresearch.fetchnodedetails.types.TorusNetwork;
import org.torusresearch.fetchnodedetails.types.Web3AuthNetwork;

import java.util.HashMap;

public class CustomAuthArgs {

public static HashMap<TorusNetwork, String> SIGNER_MAP = new HashMap<TorusNetwork, String>() {{
put(TorusNetwork.MAINNET, "https://signer.tor.us");
put(TorusNetwork.TESTNET, "https://signer.tor.us");
put(TorusNetwork.CYAN, "https://signer-polygon.tor.us");
put(TorusNetwork.AQUA, "https://signer-polygon.tor.us");
public static HashMap<Web3AuthNetwork, String> SIGNER_MAP = new HashMap<Web3AuthNetwork, String>() {{
put(Web3AuthNetwork.MAINNET, "https://signer.tor.us");
put(Web3AuthNetwork.TESTNET, "https://signer.tor.us");
put(Web3AuthNetwork.CYAN, "https://signer-polygon.tor.us");
put(Web3AuthNetwork.AQUA, "https://signer-polygon.tor.us");
}};


// Android package redirect uri
private final String browserRedirectUri;
private String redirectUri;
private TorusNetwork network;
private Web3AuthNetwork network;
private boolean enableOneKey;
private String networkUrl;

private String clientId;


public CustomAuthArgs(String browserRedirectUri, TorusNetwork network, String _redirectUri, String clientId) {
public CustomAuthArgs(String browserRedirectUri, Web3AuthNetwork network, String _redirectUri, String clientId) {
this.redirectUri = _redirectUri;
this.network = network;
this.browserRedirectUri = browserRedirectUri;
this.clientId = clientId;
}

public CustomAuthArgs(String browserRedirectUri, TorusNetwork network, String clientId) {
public CustomAuthArgs(String browserRedirectUri, Web3AuthNetwork network, String clientId) {
this(browserRedirectUri, network, "", clientId);
}

public CustomAuthArgs(String browserRedirectUri, String clientId) {
this(browserRedirectUri, TorusNetwork.MAINNET, "", clientId);
this(browserRedirectUri, Web3AuthNetwork.MAINNET, "", clientId);
}

public String getRedirectUri() {
Expand All @@ -47,11 +47,11 @@ public void setRedirectUri(String redirectUri) {
this.redirectUri = redirectUri;
}

public TorusNetwork getNetwork() {
public Web3AuthNetwork getNetwork() {
return network;
}

public void setNetwork(TorusNetwork network) {
public void setNetwork(Web3AuthNetwork network) {
this.network = network;
}

Expand Down

0 comments on commit 20e65a4

Please sign in to comment.