var futapi = require("fut-api");
var apiClient = new futapi([options]);
function twoFactorCodeCb(next){
/* send your authentication code with the "next" method */
next("123456");
}
apiClient.login("username","password","secret", "platform",
twoFactorCodeCb,
function(error,response){
if(error) {
return console.log("Unable to login.");
}
console.log("logged in.");
apiClient.getCredits(function(error, response){ });
});
apiClient.getCredits(function(error, response){ });
apiClient.getPilesize(function(error, response){ });
apiClient.getTradepile(function(error, response){ });
apiClient.relist(function(error, response){ });
apiClient.getWatchlist(function(error, response){ });
apiClient.search({type: "player", lev: "gold", maskedDefId: 183907, pos: "CB" }, function(error, response){ });
filter
searchFilterBase
playerSearchFilter extends searchFilterBase
consumableFilter extends searchFilterBase
positionChangeSearchFilter extends consumableFilter
playerStyleSearchFilter extends consumableFilter
response: -> see tradepile response
apiClient.placeBid(tradeId, coins, function(error, response){ });
apiClient.listItem(itemDataId, startingBid, buyNowPrice, duration, function(error, response){ });
itemDataId: number -> itemData.id
startingBid: number
buyNowPrice: number
duration: number -> seconds -> valid values 3600 = 1h, 10800 = 3h, 21600 = 6h, 43200 = 12h, 86400 = 1d, 259200 = 3d
response:
apiClient.getStatus([tradeIds], function(error, response){ });
apiClient.addToWatchlist(tradeId, function(error){ });
apiClient.removeFromTradepile(tradeId, function(error){ });
apiClient.removeFromWatchlist(tradeId, function(error){ });
apiClient.sendToTradepile(itemDataId, function(error, response){ });
apiClient.sendToClub(itemDataId, function(error, response){ });
apiClient.quickSell(itemDataId, function(error, response){ });
futapi.isPriceValid(coins);
returns true or false
futapi.calculateValidPrice(coins);
returns valid coins amount
futapi.calculateNextLowerPrice(coins);
returns next lower coins after calculating valid price
futapi.calculateNextHigherPrice(coins);
returns next higher coins after calculating valid price