Skip to content

Commit 79d1cc4

Browse files
committed
coreKitKey and coreKitEd25519PrivKey added in Web3AuthResponse
1 parent 35c55e4 commit 79d1cc4

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

Assets/Plugins/Web3AuthSDK/Types/Web3AuthOptions.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ public class Web3AuthOptions {
66
public string clientId { get; set; }
77
public Web3Auth.Network network { get; set; }
88
public Uri redirectUrl { get; set; }
9-
public string sdkUrl { get; set; } = "https://sdk.openlogin.com";
9+
public string sdkUrl { get; set; } = getSdkUrl(network);
1010
public WhiteLabelData whiteLabel { get; set; }
1111
public Dictionary<string, LoginConfigItem> loginConfig { get; set; }
12+
public bool? useCoreKitKey { get; set; } = false;
13+
public Web3Auth.ChainNamespace? chainNamespace { get; set; } = Web3Auth.ChainNamespace.EIP155;
14+
15+
public string getSdkUrl(Web3Auth.Network network)
16+
{
17+
string sdkUrl = "";
18+
if (network == Web3Auth.Network.TESTNET)
19+
{
20+
sdkUrl = "https://dev-sdk.openlogin.com";
21+
}
22+
else
23+
{
24+
sdkUrl = "https://sdk.openlogin.com";
25+
}
26+
return sdkUrl;
27+
}
1228
}

Assets/Plugins/Web3AuthSDK/Types/Web3AuthResponse.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@
55
public UserInfo userInfo { get; set; }
66
public string error { get; set; }
77
public string sessionId { get; set; }
8+
public string coreKitKey { get; set; }
9+
public string coreKitEd25519PrivKey { get; set; }
810
}

Assets/Plugins/Web3AuthSDK/Web3Auth.cs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,12 @@ public class Web3Auth: MonoBehaviour
1313
{
1414
public enum Network
1515
{
16-
MAINNET, TESTNET, CYAN
16+
MAINNET, TESTNET, CYAN, AQUA, CELESTE
17+
}
18+
19+
public enum ChainNamespace
20+
{
21+
EIP155, SOLANA
1722
}
1823

1924
private Web3AuthOptions web3AuthOptions;
@@ -411,6 +416,33 @@ private void sessionTimeOutAPI()
411416
}
412417
}
413418

419+
public string getPrivKey()
420+
{
421+
string privKey = "";
422+
if (web3AuthOption.useCoreKitKey == true)
423+
{
424+
privKey = web3AuthResponse.coreKitKey.ToString();
425+
}
426+
else
427+
{
428+
privKey = web3AuthResponse.privKey.ToString();
429+
}
430+
return privKey;
431+
}
432+
433+
public string getEd25519PrivKey()
434+
{
435+
string ed25519Key = "";
436+
if (web3AuthOption.useCoreKitKey == true)
437+
{
438+
ed25519Key = web3AuthResponse.coreKitEd25519PrivKey.ToString();
439+
}
440+
else
441+
{
442+
ed25519Key = web3AuthResponse.ed25519PrivKey.ToString();
443+
}
444+
return ed25519Key;
445+
}
414446

415447
public void Update()
416448
{

0 commit comments

Comments
 (0)