SplinterSheet - API Hotfix V1.02

avatar

SplinterSheet API hotfix code view

German

Aufgrund des heutigen API-Updates musste Rental (out) gefixt werden. Das Problem lag innerhalb der Grenzwerteinstellungen. Früher war es möglich, das Limit auf 5000 zu setzen, jetzt ist es 1000.

English

Due to today's API update, Rental (out) had to be fixed. The problem was within the limit settings. Previously it was possible to set the limit to 5000, now it is set to 1000.

JavaScript
// Looking for a spoiler tag to hide code ;)

/**
 * Executes an API query of the active_rentals,
 * these parameters are required appended to the player name
 * 
 * ToDo: More enties than 1k for each player
 * 
 * https://api2.splinterlands.com/market/active_rentals
 *  ?renter = account   Name of account
 *  &take   = 10        First 10 results
 *  &limit  = 1         Outputs only 1 entry
 *  &skip   = 2         Skips 2 entries
 */
function getRental_OUT(playername) {
  let data =  getData("https://api2.splinterlands.com/market/active_rentals?renter=", playername,"&limit=1000")
  let output = [];
  for(let item of data){
    output = [...output, ...item];
    if(item.length > 999)
      throw new Error("30x01 - more rentals than 1k cards")
  }
  return output;
}



0
0
0.000
0 comments