Skip to main content

Klaytn

getKlaytnSignedTransaction

The DCENT Android SDK provides functions for signing transaction of coins.

This function is for:

  • KLAYTN (KLAY)
  • KLAYTN_ERC20 - klaytn token
  • KLAY_BAOBAB (KLAYt)
  • KRC20_BAOBAB

Parameters

ParameterTypeDescription
coinTypeCoinTypeklaytn coin type.
transactionKlaytnTransactionklaytn transaction parameters.

class KlaytnTransaction

NameTypeDescription
hdKeyPathBip44KeyPathsign key path for klaytn transaction
nonceStringaccount nonce for klaytn transaction
toAddrStringaddress to send
amountStringamount of KLAY to send
gasLimitStringgas limit value
gasPriceStringgas price for klaytn transaction
dataStringtransaction data of klaytn transaction
chainIdStringchain id
txTypeKlaytnTxType(optional)Type of klaytn transaction
This can be set using the setOptionAttribute() method. The default is TX_TYPE_LEGACY
fromAddrString(optional)Signer's Address of klaytn transaction
This can be set using the setOptionAttribute() method.
feeRatioint(optional)Fee Ratio of klaytn transaction
This can be set using the setOptionAttribute() method.
tokenNameString(optional)token name of contract for KLAYTN_ERC20 transaction
This can be set using the setTokenAttribute()method.
decimalsString(optional)decimals of contract for KLAYTN_ERC20 transaction
This can be set using the setTokenAttribute()method.
symbolString(optional)symbol of contract for KLAYTN_ERC20 transaction
This can be set using the setTokenAttribute()method.

Returns

String - signed transaction.

Example

KlaytnTransaction klaytnTransanction;
klaytnTransanction = new KlaytnTransaction.Builder()
.keyPath(Bip44KeyPath.valueOf("m/44'/8217'/0'/0/0"))
.nonce("0")
.toAddr("0x732E035fBdb9E5AB5Ef80c08f6aA081d029984dc")
.amount("1000000000000000000")
.gasLimit("25000")
.gasPrice("25000000000")
.data("")
.chainId(1001)
.build();

String response = mDcentmanager.getKlaytnSignedTransaction(CoinType.KLAYTN, klaytnTransanction);