sardaukai avatar

SplinterSheet - API Hotfix V1.02

sardaukai

Published: 15 May 2022 › Updated: 15 May 2022SplinterSheet - API Hotfix V1.02

SplinterSheet - API Hotfix V1.02

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;
}

Leave SplinterSheet - API Hotfix V1.02 to:

Written by

Read more #deutsch posts


Best Posts From sardaukai

We have not curated any of sardaukai's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From sardaukai