Skip to main content

XRPL

getXrpSignedTransaction

This function is for:

  • XRP (XRP) - xrpl
  • XRP_TA - xrp ta
  • XRP_TESTNET (XRPt)
  • XRP_TA_TESTNET

Parameters

ParameterTypeDescription
coinTypeCoinTypexrp coin type.
transactionXrpTransactionxrp transaction parameters.

class XrpTransaction

NameTypeDescription
hdKeyPathBip44KeyPathsign key path for xrp transaction
sourceAddressStringSource address of xrp transaction
Only used in getXrpSignedTransaction()
destinationAddressStringDestination address of xrptransaction
Only used in getXrpSignedTransaction()
amountDropslongAmount to be sent ( Drops unit value)
Only used in getXrpSignedTransaction()
feeDropslongFee of this transaction ( Drops unit value)
Only used in getXrpSignedTransaction()
sequenceintThe sequence number, relative to the initiating account, of xrp transaction
Only used in getXrpSignedTransaction()
destinationTaglongDestination tag of xrp transaction
Only used in getXrpSignedTransaction()
unsignedTxStringEncoded unsigned Transaction value for xrp transaction
Only used in getXRPSignedTransactionWithUnsignedTx()

Returns

String - signed transaction.

Example

XrpTransaction xrpTransaction;

String address = mDcentManager.getAddress(CoinType.RIPPLE, Bip44KeyPath.valueOf("m/44'/144'/0'/0/0")).get("address");
xrpTransaction = new XrpTransaction.Builder()
.keyPath(Bip44KeyPath.valueOf("m/44'/144'/0'/0/0"))
.sourceAddress(address)
.destinationAddress("rsHXBk5vnswg5SZxUQCEPYVnmrd4PaZ7Ah")
.amountDrops(2)
.feeDrops(10)
.sequence(11)
.destinationTag(-1)
.build();

String response = mDcentManager.getXrpSignedTransaction(CoinType.XRP, xrpTransaction);

getXRPSignedTransactionWithUnsignedTx

This function is for:

  • XRP (XRP) - xrpl
  • XRP_TA - xrp ta
  • XRP_TESTNET (XRPt)
  • XRP_TA_TESTNET

Parameters

ParameterTypeDescription
coinTypeCoinTypexrp coin type.
transactionXrpTransactionxrp transaction parameters.

Returns

HashMap<String, String> - signed transaction{sign, pubkey, accountId}.

Example

XrpTransaction xrpTransaction;
xrpTransaction= new XrpTransaction .Builder()
.keyPath(Bip44KeyPath.valueOf("m/44'/144'/0'/0/0"))
.unsignedTx("1200002280000000240238634E2E00000000201B023863E161400000000098968068400000000000000A8114FD970F4612987680F4008BA53ED6FD87BE0DAAF983141DEE2154B117FB47FCF4F19CD983D9FCBB894FF7")
.build();
HashMap<String, String> response = mDcentmanager.getXRPSignedTransactionWithUnsignedTx(CoinType.XRP, xrpTransaction);

String resSign = response.get("sign");
String resPubKey = response.get("pubkey");
String res_accountId = response.get("accountId");