@@ -676,7 +676,7 @@ object DoraFund {
676676 positiveButton(context.getString(R .string.pay))
677677 positiveListener {
678678 Web3Modal .getAccount()?.let { session ->
679- sendRawTransactionRequest (context, accessKey, secretKey, session.address, account,
679+ sendNativeTransactionRequest (context, accessKey, secretKey, session.address, account,
680680 PayUtils .convertToHexWei(value), gasLimit, gasPrice, " " , " " ,
681681 onSuccess = {
682682 if (it is SentRequestResult .WalletConnect ) {
@@ -686,7 +686,7 @@ object DoraFund {
686686 },
687687 onError = {
688688 ToastUtils .showShort(R .string.payment_failed)
689- Log .e(" sendTransactionRequest " , it.toString())
689+ Log .e(" sendNativeTransactionRequest " , it.toString())
690690 }
691691 )
692692 }
@@ -721,7 +721,7 @@ object DoraFund {
721721 positiveButton(context.getString(R .string.pay))
722722 positiveListener {
723723 Web3Modal .getAccount()?.let { session ->
724- sendRawTransactionRequest (context, accessKey, secretKey, session.address, account,
724+ sendNativeTransactionRequest (context, accessKey, secretKey, session.address, account,
725725 PayUtils .convertToHexWei(value), gasLimit, " " , maxFeePerGas, maxPriorityFeePerGas,
726726 onSuccess = {
727727 if (it is SentRequestResult .WalletConnect ) {
@@ -731,7 +731,7 @@ object DoraFund {
731731 },
732732 onError = {
733733 ToastUtils .showShort(R .string.payment_failed)
734- Log .e(" sendTransactionRequest " , it.toString())
734+ Log .e(" sendNativeTransactionRequest " , it.toString())
735735 }
736736 )
737737 }
@@ -781,7 +781,7 @@ object DoraFund {
781781 secretKey,
782782 session.address,
783783 toAddress,
784- PayUtils .convertToHexWeiABI(amount),
784+ PayUtils .convertToHexWeiABI(amount, token.decimals ),
785785 token.symbol,
786786 token.contractAddress,
787787 gasLimit,
@@ -806,7 +806,7 @@ object DoraFund {
806806 secretKey,
807807 session.address,
808808 toAddress,
809- PayUtils .convertToHexWeiABI(amount),
809+ PayUtils .convertToHexWeiABI(amount, token.decimals ),
810810 token.symbol,
811811 token.contractAddress,
812812 gasLimit,
@@ -837,8 +837,8 @@ object DoraFund {
837837 * @since 2.0
838838 */
839839 @Deprecated(
840- message = " This method is deprecated, use the sendRawTransactionRequest () instead" ,
841- replaceWith = ReplaceWith (" sendRawTransactionRequest (context,accessKey,secretKey," +
840+ message = " This method is deprecated, use the sendNativeTransactionRequest () instead" ,
841+ replaceWith = ReplaceWith (" sendNativeTransactionRequest (context,accessKey,secretKey," +
842842 " from,to,value,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas,onSuccess,onError)" ),
843843 level = DeprecationLevel .WARNING
844844 )
@@ -900,10 +900,10 @@ object DoraFund {
900900 }
901901
902902 /* *
903- * Send raw transaction request.
903+ * Send native transaction request.
904904 * @since 2.1
905905 */
906- private fun sendRawTransactionRequest (
906+ private fun sendNativeTransactionRequest (
907907 context : Context ,
908908 accessKey : String ,
909909 secretKey : String ,
@@ -930,32 +930,32 @@ object DoraFund {
930930 ToastUtils .showShort(" Account is null" )
931931 return
932932 }
933- val status = nativeSendRawTransactionRequest (context, accessKey, secretKey, from, to,
933+ val status = nativeSendNativeTransactionRequest (context, accessKey, secretKey, from, to,
934934 value, gasLimit, gasPrice, maxFeePerGas, maxPriorityFeePerGas, onSuccess, onError)
935935 when (status) {
936936 STATUS_CODE_OK -> {
937- Log .i(" sendTransactionRequest " , " OK." )
937+ Log .i(" sendNativeTransactionRequest " , " OK." )
938938 }
939939 STATUS_CODE_ACCESS_KEY_IS_INVALID -> {
940- Log .e(" sendTransactionRequest " , " The access key is invalid." )
940+ Log .e(" sendNativeTransactionRequest " , " The access key is invalid." )
941941 }
942942 STATUS_CODE_PAYMENT_ERROR -> {
943- Log .e(" sendTransactionRequest " , " Payment error, please try again." )
943+ Log .e(" sendNativeTransactionRequest " , " Payment error, please try again." )
944944 }
945945 STATUS_CODE_SINGLE_TRANSACTION_LIMIT -> {
946- Log .e(" sendTransactionRequest " , " Single transaction limit exceeded." )
946+ Log .e(" sendNativeTransactionRequest " , " Single transaction limit exceeded." )
947947 }
948948 STATUS_CODE_MONTHLY_LIMIT -> {
949- Log .e(" sendTransactionRequest " , " Monthly limit exceeded." )
949+ Log .e(" sendNativeTransactionRequest " , " Monthly limit exceeded." )
950950 }
951951 STATUS_CODE_UNSUPPORTED_CHAIN_ID -> {
952- Log .e(" sendTransactionRequest " , " Unsupported chainId." )
952+ Log .e(" sendNativeTransactionRequest " , " Unsupported chainId." )
953953 }
954954 STATUS_CODE_FAILED_TO_FETCH_TOKEN_PRICE -> {
955- Log .e(" sendTransactionRequest " , " Failed to fetch token price." )
955+ Log .e(" sendNativeTransactionRequest " , " Failed to fetch token price." )
956956 }
957957 STATUS_CODE_ACCESS_KEY_IS_EXPIRED -> {
958- Log .e(" sendTransactionRequest " , " The access key is expired." )
958+ Log .e(" sendNativeTransactionRequest " , " The access key is expired." )
959959 }
960960 }
961961 } catch (e: Exception ) {
@@ -1034,8 +1034,8 @@ object DoraFund {
10341034 * @since 2.0
10351035 */
10361036 @Deprecated(
1037- message = " This method is deprecated, use the nativeSendRawTransactionRequest () instead" ,
1038- replaceWith = ReplaceWith (" nativeSendRawTransactionRequest (context,accessKey," +
1037+ message = " This method is deprecated, use the nativeSendNativeTransactionRequest () instead" ,
1038+ replaceWith = ReplaceWith (" nativeSendNativeTransactionRequest (context,accessKey," +
10391039 " secretKey,from,to,value,gasLimit,gasPrice,maxFeePerGas,maxPriorityFeePerGas," +
10401040 " onSuccess,onError)" ),
10411041 level = DeprecationLevel .WARNING
@@ -1054,10 +1054,10 @@ object DoraFund {
10541054 ): Int
10551055
10561056 /* *
1057- * Native layer handles sending raw transaction requests.
1057+ * Native layer handles sending native transaction requests.
10581058 * @since 2.1
10591059 */
1060- private external fun nativeSendRawTransactionRequest (
1060+ private external fun nativeSendNativeTransactionRequest (
10611061 context : Context ,
10621062 accessKey : String ,
10631063 secretKey : String ,
0 commit comments