I'm trying to set up a managedata operation. I added the following to my transaction:

.append_manage_data_op(data_name="Hello", data_value="World")

However, it doesn't go through. Apparently the correct syntax is data_value='Union[Keypair, str]'. So I tried this:

.append_manage_data_op(data_name="Hello", data_value='Union[keypair, "World"]')

But it still doesn't work. Note in the above code 'keypair' is a variable representing 'Keypair.from_secret(my_secret).

What is Union and do I need to replace it with something else to make the transaction go through?

  • When you say "it doesn't go through" can you be more specific? What is the error you see? Jun 22, 2021 at 23:48
  • Traceback (most recent call last): File "C:\Users\me\PycharmProjects\Stellar-SDK\manage_data.py", line 8, in <module> account = Server.load_account(account_id=public_key) TypeError: load_account() missing 1 required positional argument: 'self' Jun 29, 2021 at 1:06
  • I can do "Server.load_account(self=" but I don't know what to put behind the '=' Jun 29, 2021 at 1:07

1 Answer 1


It looks like you need to take a step back and fill in some Python basics before proceeding. Based on the error you posted in the comments, you aren't using the Server class correctly.

You need to create an instance of the Server class and then call the load_account method on that instance. See e.g. the example here from the Python Stellar SDK docs:

server = Server(horizon_url="https://horizon-testnet.stellar.org")
destination = Keypair.random()

source_account = server.load_account(account_id=source.public_key)

To understand the more general concept, check out https://stackoverflow.com/a/625098/143804 for a discussion of self in Python.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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