From 4b038f0ae0d8df5fa81b532fff0f62670b5a5701 Mon Sep 17 00:00:00 2001 From: teresajiar <109209196+teresajiar@users.noreply.github.com> Date: Sun, 17 Jul 2022 23:49:56 +0100 Subject: [PATCH] Fixing Double to Long conversion for chainId (#76) Fixing Double to Long conversion for chainId --- .../main/kotlin/org/walletconnect/types/TypeMapConversion.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/main/kotlin/org/walletconnect/types/TypeMapConversion.kt b/lib/src/main/kotlin/org/walletconnect/types/TypeMapConversion.kt index 1853f3b..d03308d 100644 --- a/lib/src/main/kotlin/org/walletconnect/types/TypeMapConversion.kt +++ b/lib/src/main/kotlin/org/walletconnect/types/TypeMapConversion.kt @@ -46,7 +46,7 @@ fun Session.SessionParams.intoMap(params: MutableMap = mutableMapO fun Map.extractSessionParams(): Session.SessionParams { val approved = this["approved"] as? Boolean ?: throw IllegalArgumentException("approved missing") - val chainId = this["chainId"] as? Long + val chainId = (this["chainId"] as Double).toLong() val accounts = nullOnThrow { (this["accounts"] as? List<*>)?.toStringList() } return Session.SessionParams(approved, chainId, accounts, nullOnThrow { this.extractPeerData() })