I'm developing a pagination method, but when the number of tokens pass over the 150, return this error: FunctionCallError(HostError(GasLimitExceeded))
The command that I used: near view nativodeploy.testnet get_ids_onsale '{"tokens":30}' --accountId nativodeploy.testnet
Code: Here I only recover a vector with the Id tokens that I use to initiate the "from_index" in another method
pub fn get_ids_onsale(&self,tokens:u64) -> Vec<u64> {
let mut vectIDs = vec![];
let mut _tokfound =0;
let total = self.get_on_total_toks();
vectIDs.push(0);
for x in 0..total {
if x>= total.clone() {
break;
}
let mut token =self.get_token(x.to_string().clone());
if token.on_sale{
_tokfound+=1;
if _tokfound== tokens {
vectIDs.push( token.token_id.parse::<u64>().unwrap() );
_tokfound=0;
}
}
if( _tokfound == tokens ){break; }
}
vectIDs
}
If I use a call I get this: {"ExecutionError":"Exceeded the prepaid gas."}
Even if I use the --gas=300000000000000, I get this: {"ExecutionError":"Exceeded the maximum amount of gas allowed to burn per contract."}