@@ -816,17 +816,30 @@ export class DataLayer {
816
816
chainIds : number [ ] ;
817
817
} ) : Promise < Contribution [ ] > {
818
818
const { address, chainIds } = args ;
819
- const response : { donations : Contribution [ ] } = await request (
820
- this . gsIndexerEndpoint ,
821
- getDonationsByDonorAddress ,
822
- {
823
- address : getAddress ( address ) ,
824
- chainIds,
825
- } ,
826
- ) ;
819
+ let offset = 0 ;
820
+ let hasMore = true ;
821
+ const limit = 200 ;
822
+ let donations : Contribution [ ] = [ ] ;
823
+
824
+ while ( hasMore ) {
825
+ const response : { donations : Contribution [ ] } = await request (
826
+ this . gsIndexerEndpoint ,
827
+ getDonationsByDonorAddress ,
828
+ { address : getAddress ( address ) , chainIds, limit, offset } ,
829
+ ) ;
830
+
831
+ donations = [ ...donations , ...response . donations ] ;
832
+
833
+ // Check if we need to fetch more
834
+ if ( response . donations . length < limit ) {
835
+ hasMore = false ;
836
+ } else {
837
+ offset += limit ;
838
+ }
839
+ }
827
840
828
841
// Filter out invalid donations and map the project metadata from application metadata (solution for canonical projects in indexer v2)
829
- const validDonations = response . donations . reduce < Contribution [ ] > (
842
+ const validDonations = donations . reduce < Contribution [ ] > (
830
843
( validDonations , donation ) => {
831
844
if ( donation . round . strategyName !== "allov2.DirectAllocationStrategy" ) {
832
845
if ( donation . application ?. project ) {
0 commit comments