You can use an API like getAccountInfo to fetch only a slice of account data by supplying a dataSlice param. If you want to fetch disjoint slices of account data, you have to make multiple RPC calls.
Originally suggested by @jarry-xiao.
Proposed Solution
Update the dataSlice parameter to take an array of {length: number, offset: number}. Return an array of encoded data slices, in the same order.
Problem
You can use an API like
getAccountInfo
to fetch only a slice of account data by supplying adataSlice
param. If you want to fetch disjoint slices of account data, you have to make multiple RPC calls.Originally suggested by @jarry-xiao.
Proposed Solution
Update the
dataSlice
parameter to take an array of{length: number, offset: number}
. Return an array of encoded data slices, in the same order.Example: