I am new to stellar. I want to add a data to my stellar account as a key value pair. As in "Name"(Key) - "John"(Value). How can I achieve this?

Pointing me to a sample code would be really helpful. Thank You.

  • I've been asked to do this using "Manage Data" functionality in stellar
    – Ifham Pain
    Apr 5 '19 at 14:06

Check out the Java API documentation. Here's the relevant ManageDataOperation builder.

  • I have tried to read the documentation regarding it. But it is still too complicated for me. An example on how it is done will be really helpful. Like they have on TutorialsPoint relating java
    – Ifham Pain
    Apr 6 '19 at 16:08

I have found the way to do it by re-reading the documents.

What I needed to do was to attach the operation created by using ManageDataOperation.Builder() to the transaction. I have attached the sample code for future references.

ManageDataOperation.Builder manageDataOperation = new ManageDataOperation.Builder("Ownership", bt);

            Transaction tt = new Transaction.Builder(sourceAccount)
                    .addMemo(Memo.text("Test Transaction")).setTimeout(1000)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.