fireblocks-sdk-js
fireblocks-sdk-js copied to clipboard
[Bug] getVaultAccountsWithPageInfo not working when namePrefix contains a pound symbol
Describe the bug When calling getVaultAccountsWithPageInfo with a namePrefix that contains a pound symbol (ex. 'Account#'), I am unable to query past the first page of results (i.e the function always returns the same accounts).
const requestFilters: PagedVaultAccountsRequestFilters = {
namePrefix: 'Account#',
orderBy: 'ASC',
limit: 2
};
let vaultAccounts = await this.fireblocks.getVaultAccountsWithPageInfo(requestFilters);
while (vaultAccounts.paging.after) {
console.log(vaultAccounts.accounts); //ALWAYS PRINTS THE SAME 2 ACCOUNTS
requestFilters.after = vaultAccounts.paging.after;
vaultAccounts = await this.fireblocks.getVaultAccountsWithPageInfo(requestFilters);
}
To Reproduce
- Create more than 2 vault accounts that have names that start with 'Account#'
- Run the code above
- Same accounts are printed repeatedly and loop does not exit
Expected behavior After updating the after cursor in the requestFilters object, getVaultAccountsWithPageInfo should return the next 2 accounts and not the initially queried accounts when called. The loop in the code above should exit after moving through the full list of vaults.
Version:
-
fireblocks-sdkversion: 2.1.0 - npm version: 8.11.0
- node version: v16.15.1
Additional context When I remove the pound symbol from namePrefix, the paging seems to work fine.