So Basically I'm trying to get Account Information.
Method: Algodv2accountInformation,
returns the AccountInformation type, but after calling .do()
.i.e
Algodv2accountInformation.do()
the return type is a more generic
<Promise<Record<string, any>>
What is the right way to make this api call but have it return right Information.
<AccountInformation>
I just checked their docs, It is confusing as docs says it returns
<AccountInformation>
Here's Link to docs
<AccountInformation> is encapsulating request, not response.
What you can do it leverage class, as it extends Base Class which does takes in Record<string,any> as input.
So the JSON you get from running .do() on .
Could be passed to Account(Record<String, any>) as follows:
And! Voilla! you've got your account model object!
Actually there should be some method .getModel(), I'll create a PR, as this should be part of SDK.