Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't see how to "GetData()" on the Managed Data of an Account #35

Closed
MikeFair opened this issue Feb 12, 2017 · 0 comments
Closed

Don't see how to "GetData()" on the Managed Data of an Account #35

MikeFair opened this issue Feb 12, 2017 · 0 comments

Comments

@MikeFair
Copy link

I don't see how to retrieve the values from the Managed Data section of an Account object.

After executing the SetData(key_string, value_bytes) operation on an Account (which succeeds) I expected to see something like Account.GetData(key_string) or Account.ManagedData[key_string] on the object that comes back from Client.LoadAccount(account_id).

The Horizon server includes the values in the data field on the Account's JSON response object.
You can see an example on Account GCORTO4MOGRSOZOVYELTL5SDTZCGLE2YA7YDYV7X5EMDTHARSMEAOZJQ in the Test Network here:
https://www.stellar.org/laboratory/#explorer?resource=accounts&endpoint=single&values=eyJhY2NvdW50X2lkIjoiR0NPUlRPNE1PR1JTT1pPVllFTFRMNVNEVFpDR0xFMllBN1lEWVY3WDVFTURUSEFSU01FQU9aSlEifQ%3D%3D&network=test

Here's a trimmed version of the full response:

{
  "_links": {
 ...
  },
  "id": "GCORTO4MOGRSOZOVYELTL5SDTZCGLE2YA7YDYV7X5EMDTHARSMEAOZJQ",
  "paging_token": "",
  "account_id": "GCORTO4MOGRSOZOVYELTL5SDTZCGLE2YA7YDYV7X5EMDTHARSMEAOZJQ",
  "sequence": "993559079550998",
  "subentry_count": 5,
  "thresholds": {
    "low_threshold": 0,
    "med_threshold": 0,
    "high_threshold": 0
  },
  "flags": {
    "auth_required": false,
    "auth_revocable": false
  },
  "balances": [
...
  ],
  "signers": [
...
  ],
  "data": {
    "..": "R0NCVkwzU1FGRVZLUkxQNkFKNDdVS0tXWUVCWTQ1V0hBSkhDRVpLVldNVEdNQ1Q0SDROS1FZTEg=",
    "SecondString": "R0NCVkwzU1FGRVZLUkxQNkFKNDdVS0tXWUVCWTQ1V0hBSkhDRVpLVldNVEdNQ1Q0SDROS1FZTEg="
  }
}

I also looked at the JavaScript SDK to see if I could figure out the expected pattern but data retrieval Operations seems to be missing from there as well (but perhaps the JSON response object loads more natively in that SDK).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant