Concatenates this vault list with another vault list and returns a new RaindexVaultsList
Creates a new vault list containing all vaults from both lists. The order is preserved: items from the current list first, then items from the other list.
const combinedVaults = vaultsList1.concat(vaultsList2);
console.log(`Combined ${combinedVaults.items.length} vaults`);
New RaindexVaultsList containing vaults from both lists
Returns only vaults that have a balance greater than zero
const withdrawableVaults = vaultsList.getWithdrawableVaults();
console.log(`${withdrawableVaults.length} vaults can be withdrawn from`);
Array of vaults with non-zero balance
Generates multicall withdraw calldata for all withdrawable vaults
Creates a single transaction that can withdraw from multiple vaults at once, optimizing gas costs and transaction efficiency.
const result = await vaultsList.getWithdrawCalldata();
if (result.error) {
console.error("Error generating calldata:", result.error.readableMsg);
return;
}
const calldata = result.value;
// Use calldata for transaction
Encoded multicall calldata for withdrawing from all vaults
Filters vaults by a list of IDs and returns a new RaindexVaultsList
Creates a new vault list containing only vaults whose IDs match
the provided list of IDs. The original list order is preserved;
the input ids order does not affect the result ordering.
Notes:
ids are ignored (deduplicated).const filteredVaults = vaultsList.pickByIds(['0x123', '0x456']);
console.log(`Filtered to ${filteredVaults.items.length} vaults`);
New RaindexVaultsList containing only vaults with matching IDs
Returns all vaults in the list
Examples