const isSingle = to === undefined
if (typeof from !== 'number') {
throw new Error('Invalid account range start argument', { cause: `${typeof from} ${from}` })
- }
+ }
to ??= from + 1
if (typeof to !== 'number') {
throw new Error('Invalid account range end argument', { cause: `${typeof to} ${to}` })
}
if (from > to) [from as number, to as number] = [to, from]
- if (from < 0 || 0x100000000 < from || to < 0 || 0x100000000 < to) {
+ if (from < 0 || 0xffffffff < from || to < 0 || 0x100000000 < to) {
throw new TypeError('Invalid account range', { cause: `${from}-${to}` })
}
if (to - from > 100) {
\r
/**\r
* Retrieves accounts from a wallet using its child key derivation function.\r
- * Defaults to the first account at index 0. If\r
+ * Defaults to the first account at index 0. If a range is specified, derives\r
+ * from the starting index up to, but not including, the end index.\r
*\r
* Derives a maximum of 1000 accounts per call and will throw an error if\r
* exceeded. This is not a hard limit since the method can be called multiple\r