question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getAccountDetails returns empty transactions array

See original GitHub issue

Describe the bug getAccountDetails function claims to return transactions but always returns nothing. See https://github.com/near/near-api-js/blob/960b798fe009fe0658637803af9645f550f139cb/src/account.ts#L402

To Reproduce Steps to reproduce the behavior:

  1. Create let account = new Account(account_id);
  2. Call account.getAccountDetails()
  3. Observe the empty transactions in the result

Expected behavior Should remove this field and update comments as it’s confusing

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mehtaphysicalcommented, Mar 16, 2021

@frol Oh i mean typescript generic. So instead of https://github.com/near/near-api-js/blob/master/src/providers/json-rpc-provider.ts#L92 it would look like:

async query<T>(...args: any[]): Promise<T> {
...
}

And there would be response types for each of the query request types like:

interface ContractState {
  key: string;
  value: string;
  proof: string;
}

interface ViewStateResult {
  values: ContractState[];
}

Then it could be used like:

const contractState = provider.query<ViewStateResult>({
    request_type: "view_state",
    finality: "final",
    account_id: "guest-book.testnet",
    prefix_base64: ""
})
0reactions
frolcommented, Mar 16, 2021

Ah, sure! It was a collision in the terminology 😄

I am all for it. Please, go ahead with a PR, I will be happy to review and merge it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Calculate Refund API is returning empty Transactions array
The order that I am trying to refund has a positive-value item and it is NOT refunded yet. Please help check why the...
Read more >
9.3.2. Queries - Hyperledger Iroha documentation
GetAccountAssetTransactions query returns all transactions associated with given account and asset. Note. This query uses pagination for quicker and more ...
Read more >
searchTransactionsCount - Newtek Gateway Help
Like searchTransactions, this method returns TransactionSearchResult. The only difference is that TransactionSearchResult.Transactions is left empty.
Read more >
Stripe API reference – Accounts – curl
The back of a document returned by a file upload with a purpose value of ... Will be an empty array unless an...
Read more >
nordigen-api
Use this step only if you want to specify the length of transaction ... As an array of end user agreement IDs or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found