Skip to content

Commit c18f883

Browse files
authored
fix legacy auth call (#687)
1 parent 79f127b commit c18f883

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

android/clientlib-ktx/src/main/java/com/solana/mobilewalletadapter/clientlib/MobileWalletAdapter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class MobileWalletAdapter(
113113
authToken?.let { token ->
114114
reauthorize(identityUri, iconUri, identityName, token)
115115
} ?: run {
116-
authorize(identityUri, iconUri, identityName, RpcCluster.Custom(blockchain.cluster))
116+
authorize(identityUri, iconUri, identityName, blockchain.rpcCluster)
117117
}
118118
}.also {
119119
authToken = it.authToken

android/clientlib-ktx/src/main/java/com/solana/mobilewalletadapter/clientlib/TransactionParams.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ sealed class Blockchain(
2020
) {
2121
val fullName
2222
get() = "$name:$cluster"
23+
24+
@Deprecated(
25+
"RpcCluster is deprecated as of MWA 2.0, this property is preserved for backwards compatibility with legacy endpoints",
26+
level = DeprecationLevel.WARNING
27+
)
28+
val rpcCluster: RpcCluster = when (cluster) {
29+
"mainnet", ProtocolContract.CLUSTER_MAINNET_BETA -> RpcCluster.MainnetBeta
30+
ProtocolContract.CLUSTER_TESTNET -> RpcCluster.Testnet
31+
ProtocolContract.CLUSTER_DEVNET -> RpcCluster.Devnet
32+
else -> RpcCluster.Custom(cluster)
33+
}
2334
}
2435

2536
sealed class Solana {

0 commit comments

Comments
 (0)