js-stellar-sdk icon indicating copy to clipboard operation
js-stellar-sdk copied to clipboard

Extend AccountCallBuilder to allow fetching account's data without loading account.

Open abuiles opened this issue 5 years ago • 1 comments

Is your feature request related to a problem? Please describe. No

Describe the solution you'd like Extend the AccountCallBuilder to allow loading account data directly, something like

await this.accounts()
  .accountId("GC34GL3X3LTI4QCLLOOXHYUZ7YLY7G7SEPJRKQI5WJKWEB1A9KFCBLIL")
  .data("foo")
  .call();

Will hit the following end-point and return the value https://horizon.stellar.org/accounts/GC34GL3X3LTI4QCLLOOXHYUZ7YLY7G7SEPJRKQI5WJKWEB1A9KFCBLIL/data/foo

Describe alternatives you've considered You can load the account and the lookup the data value:

const account = await this.loadAccount(destination);
account.data_attr["config.memo_required"]

Additional context The Go SDK allows loading data directly, we should have this for feature parity.

abuiles avatar Mar 24 '20 22:03 abuiles

Yes! from another dev asked about streaming account data.

We need to access account data in real-time.

AccountCallBuilder docs lists stream as a function. Is that not operational?

BenRacicot avatar Jun 27 '22 20:06 BenRacicot