Теперь Кью работает в режиме чтения

Мы сохранили весь контент, но добавить что-то новое уже нельзя

Что не так с программным кодом на Котлин?

Прикрепляю код запроса для Telegram бота по взаимодействию с блокчейном и токеном Tegro $TGR в сети BEP20
    fun transfer(
        privateKey: ByteArray,
        tokenAddress: String,
        toAddress: String,
        amount: BigInteger,
        block: DefaultBlockParameterName = DefaultBlockParameterName.LATEST
    ): String {
        val credentials = Credentials.create(Numeric.toHexString(privateKey))
        val gasFactor = 1.0.toBigDecimal()
        val gasPrice = (gasPrice().toBigDecimal() * gasFactor).toBigInteger()
        val gas = 21000.toBigInteger()
        val fee = gas * gasPrice


        val function = Function("transfer", listOf<Type<*>>(Address(toAddress), Uint256(amount)), emptyList())

        val rawTransaction = RawTransaction.createTransaction(
            null, gasPrice, fee, tokenAddress,
            BigInteger.ZERO, FunctionEncoder.encode(function)
        )

        val hexValue = Numeric.toHexString(TransactionEncoder.signMessage(rawTransaction, credentials))

        val response = web3j.ethSendRawTransaction(hexValue).send()
        println(response.result)
        return response.result
    }
ПрограммированиеБиткоин+3
  · 171
Я программирую на c++, c#, Lua, java, python. Также занимаюсь белым хакерством сайтов  · 27 июн 2023
Вот ошибки в коде:
Параметр toAddressдолжен быть типа String, а не ByteArray.
Параметр amountдолжен быть типа BigInteger, а не Int.
Переменная functionдолжна быть объявлена ​​как Function4<String, String, BigInteger, List<Type<*»>, а не Function.
Переменная rawTransactionдолжна быть объявлена ​​как RawTransaction, а не RawTransaction.createTransaction().
Переменная hexValueдолжна быть объявлена ​​как String, а не BigInteger.
И исправленный 
fun transfer(
  privateKey: ByteArray,
  toAddress: String,
  amount: BigInteger,
  block: DefaultBlockParameterName = DefaultBlockParameterName.LATEST
): String {
  val credentials = Credentials.create(Numeric.toHexString(privateKey))
  val gasFactor = 1.0.toBigDecimal()
  val gasPrice = (gasPrice().toBigDecimal() * gasFactor).toBigInteger()
  val gas = 21000.toBigInteger()
  val fee = gas * gasPrice
  val function = Function4(
    "transfer",
    listOf(Address(toAddress), Uint256(amount)),
    emptyList()
  )
  val rawTransaction = RawTransaction(
    null,
    gasPrice,
    fee,
    tokenAddress,
    BigInteger.ZERO,
    FunctionEncoder.encode(function)
  )
  val hexValue = Numeric.toHexString(TransactionEncoder.signMessage(rawTransaction, credentials))
  val response = web3j.ethSendRawTransaction(hexValue).send()
  println(response.result)
  return response.result
}