Skip to content

Commit 6f5c7d6

Browse files
committed
Validate ERC20 token support.(#11)
1 parent 320cc62 commit 6f5c7d6

4 files changed

Lines changed: 19 additions & 1 deletion

File tree

lib/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ afterEvaluate {
7878
from(components["release"])
7979
groupId = "com.github.dora4"
8080
artifactId = "dora-walletconnect-support"
81-
version = "2.1.19"
81+
version = "2.1.20"
8282
}
8383
}
8484
}

lib/src/main/java/dora/pay/DoraFund.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,18 @@ object DoraFund {
112112
*/
113113
private const val STATUS_CODE_ACCESS_KEY_IS_EXPIRED = -7
114114

115+
/**
116+
* Unsupported ERC20 token.
117+
* @since 2.1
118+
*/
119+
private const val STATUS_CODE_UNSUPPORTED_ERC20_TOKEN = -8
120+
121+
/**
122+
* ERC20 token symbol does not match the expected value during validation.
123+
* @since 2.1
124+
*/
125+
private const val STATUS_CODE_TOKEN_SYMBOL_MISMATCH = -9
126+
115127
/**
116128
* VPN notification ID.
117129
* @since 2.0
@@ -867,6 +879,12 @@ object DoraFund {
867879
STATUS_CODE_ACCESS_KEY_IS_EXPIRED -> {
868880
Log.e("sendERC20TransactionRequest", "The access key is expired.")
869881
}
882+
STATUS_CODE_UNSUPPORTED_ERC20_TOKEN -> {
883+
Log.e("sendERC20TransactionRequest", "Unsupported ERC20 token.")
884+
}
885+
STATUS_CODE_TOKEN_SYMBOL_MISMATCH -> {
886+
Log.e("sendERC20TransactionRequest", "ERC20 token symbol does not match.")
887+
}
870888
}
871889
}
872890
}
1.83 KB
Binary file not shown.
1.36 KB
Binary file not shown.

0 commit comments

Comments
 (0)