Skip to content

Commit c4f88d2

Browse files
committed
feat: modify defaultChainId value in showWalletUI
Signed-off-by: Gaurav Goel <[email protected]>
1 parent f73c422 commit c4f88d2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

core/src/main/java/com/web3auth/core/Web3Auth.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,10 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
750750
put("network", web3AuthOption.web3AuthNetwork.toString().lowercase(Locale.ROOT))
751751
projectConfigResponse?.chains?.let {
752752
put("chains", gson.toJson(it))
753+
put(
754+
"defaultChainId",
755+
it.firstOrNull()?.chainId ?: web3AuthOption.defaultChainId ?: "0x1"
756+
)
753757
}
754758
put("chainId", web3AuthOption.defaultChainId ?: "0x1")
755759
projectConfigResponse?.embeddedWalletAuth?.let {
@@ -833,6 +837,10 @@ class Web3Auth(web3AuthOptions: Web3AuthOptions, context: Context) : WebViewResu
833837
put("network", web3AuthOption.web3AuthNetwork.toString().lowercase(Locale.ROOT))
834838
projectConfigResponse?.chains?.let {
835839
put("chains", gson.toJson(it))
840+
put(
841+
"defaultChainId",
842+
web3AuthOption.defaultChainId ?: it.firstOrNull()?.chainId ?: "0x1"
843+
)
836844
}
837845
put("chainId", web3AuthOption.defaultChainId ?: "0x1")
838846
projectConfigResponse?.embeddedWalletAuth?.let {

0 commit comments

Comments
 (0)