/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/nxt-api@1.2.8-1/nxt-api.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var request,_req=require("request");try{request=require("browser-request")}catch(t){request=_req}var Nxt,Promise=require("bluebird");!function(t){"use strict";t.ErrorCodes={1:"Incorrect request",2:"Blockchain not up to date",3:"Parameter not specified",4:"Incorrect parameter",5:"Unknown object (block, transaction, etc.)",6:"Not enough funds",7:"Not allowed",255:"Internal error"};var e=function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},r=function(){function r(t){if(this.config={},this.request=request,!t)throw new Error("Endpoint must be provided");if(0!==t.indexOf("http"))throw new Error("Endpoint must be set with protocol, either https:// or http://");-1===t.indexOf("/nxt")&&(t+="/nxt"),this.config.url=t,this.config.json=!0}return r.prototype._clean=function(t){Object.getOwnPropertyNames(t).forEach((function(e){void 0!==t[e]&&null!==t[e]||delete t[e]}))},r.prototype._call=function(r,n,o){var s=this,c={};if(!r)throw new TypeError("Must provide a name for _call");return e(c,this.config),"object"==typeof n?e(n,{requestType:r}):n={requestType:r},c.qs=n,this._clean(n),new Promise((function(e,r){s.request.post(c,(function(n,o,s){n?r({errorCode:255,errorDescription:String(n.message?n.message:n)}):"object"==typeof s?s.errorCode?r(s):e(s):r({errorCode:1,errorDescription:t.ErrorCodes[1]})}))})).nodeify(o)},r.prototype.broadcastTransaction=function(t,e){return this._call("broadcastTransaction",t,e)},r.prototype.buyAlias=function(t,e){return this._call("buyAlias",t,e)},r.prototype.calculateFullHash=function(t,e){return this._call("calculateFullHash",t,e)},r.prototype.cancelAskOrder=function(t,e){return this._call("cancelAskOrder",t,e)},r.prototype.cancelBidOrder=function(t,e){return this._call("cancelBidOrder",t,e)},r.prototype.castVote=function(t,e){return this._call("castVote",t,e)},r.prototype.createPoll=function(t,e){return this._call("createPoll",t,e)},r.prototype.decodeHallmark=function(t,e){return this._call("decodeHallmark",t,e)},r.prototype.decodeToken=function(t,e){return this._call("decodeToken",t,e)},r.prototype.decryptFrom=function(t,e){return this._call("decryptFrom",t,e)},r.prototype.dgsDelisting=function(t,e){return this._call("dgsDelisting",t,e)},r.prototype.dgsDelivery=function(t,e){return this._call("dgsDelivery",t,e)},r.prototype.dgsFeedback=function(t,e){return this._call("dgsFeedback",t,e)},r.prototype.dgsListing=function(t,e){return this._call("dgsListing",t,e)},r.prototype.dgsPriceChange=function(t,e){return this._call("dgsPriceChange",t,e)},r.prototype.dgsPurchase=function(t,e){return this._call("dgsPurchase",t,e)},r.prototype.dgsQuantityChange=function(t,e){return this._call("dgsQuantityChange",t,e)},r.prototype.dgsRefund=function(t,e){return this._call("dgsRefund",t,e)},r.prototype.encryptTo=function(t,e){return this._call("encryptTo",t,e)},r.prototype.generateToken=function(t,e){return this._call("generateToken",t,e)},r.prototype.getAccount=function(t,e){return this._call("getAccount",t,e)},r.prototype.getAccountBlockIds=function(t,e){return this._call("getAccountBlockIds",t,e)},r.prototype.getAccountCurrentAskOrderIds=function(t,e){return this._call("getAccountCurrentAskOrderIds",t,e)},r.prototype.getAccountCurrentBidOrderIds=function(t,e){return this._call("getAccountCurrentBidOrderIds",t,e)},r.prototype.getAccountId=function(t,e){return this._call("getAccountId",t,e)},r.prototype.getAccountPublicKey=function(t,e){return this._call("getAccountPublicKey",t,e)},r.prototype.getAccountTransactionIds=function(t,e){return this._call("getAccountTransactionIds",t,e)},r.prototype.getAccountTransactions=function(t,e){return this._call("getAccountTransactions",t,e)},r.prototype.getAlias=function(t,e){return this._call("getAlias",t,e)},r.prototype.getAliases=function(t,e){return this._call("getAliases",t,e)},r.prototype.getAllAssets=function(t,e){return this._call("getAllAssets",t,e)},r.prototype.getAllOpenOrders=function(t,e){return this._call("getAllOpenOrders",t,e)},r.prototype.getAllTrades=function(t,e){return this._call("getAllTrades",t,e)},r.prototype.getAskOrder=function(t,e){return this._call("getAskOrder",t,e)},r.prototype.getAskOrderIds=function(t,e){return this._call("getAskOrderIds",t,e)},r.prototype.getAskOrders=function(t,e){return this._call("getAskOrders",t,e)},r.prototype.getAsset=function(t,e){return this._call("getAsset",t,e)},r.prototype.getAssetIds=function(t,e){return this._call("getAssetIds",t,e)},r.prototype.getAssets=function(t,e){return this._call("getAssets",t,e)},r.prototype.getAssetsByIssuer=function(t,e){return this._call("getAssetsByIssuer",t,e)},r.prototype.getBalance=function(t,e){return this._call("getBalance",t,e)},r.prototype.getBidOrder=function(t,e){return this._call("getBidOrder",t,e)},r.prototype.getBidOrderIds=function(t,e){return this._call("getBidOrderIds",t,e)},r.prototype.getBidOrders=function(t,e){return this._call("getBidOrders",t,e)},r.prototype.getBlock=function(t,e){return this._call("getBlock",t,e)},r.prototype.getBlockId=function(t,e){return this._call("getBlockId",t,e)},r.prototype.getBlockchainStatus=function(t,e){return this._call("getBlockchainStatus",t,e)},r.prototype.getConstants=function(t,e){return this._call("getConstants",t,e)},r.prototype.getDGSGood=function(t,e){return this._call("getDGSGood",t,e)},r.prototype.getDGSGoods=function(t,e){return this._call("getDGSGoods",t,e)},r.prototype.getDGSPendingPurchases=function(t,e){return this._call("getDGSPendingPurchases",t,e)},r.prototype.getDGSPurchase=function(t,e){return this._call("getDGSPurchase",t,e)},r.prototype.getDGSPurchases=function(t,e){return this._call("getDGSPurchases",t,e)},r.prototype.getForging=function(t,e){return this._call("getForging",t,e)},r.prototype.getGuaranteedBalance=function(t,e){return this._call("getGuaranteedBalance",t,e)},r.prototype.getMyInfo=function(t,e){return this._call("getMyInfo",t,e)},r.prototype.getNextBlockGenerators=function(t,e){return this._call("getNextBlockGenerators",t,e)},r.prototype.getPeer=function(t,e){return this._call("getPeer",t,e)},r.prototype.getPeers=function(t,e){return this._call("getPeers",t,e)},r.prototype.getPoll=function(t,e){return this._call("getPoll",t,e)},r.prototype.getPollIds=function(t,e){return this._call("getPollIds",t,e)},r.prototype.getState=function(t,e){return this._call("getState",t,e)},r.prototype.getTime=function(t,e){return this._call("getTime",t,e)},r.prototype.getTrades=function(t,e){return this._call("getTrades",t,e)},r.prototype.getTransaction=function(t,e){return this._call("getTransaction",t,e)},r.prototype.getTransactionBytes=function(t,e){return this._call("getTransactionBytes",t,e)},r.prototype.getUnconfirmedTransactionIds=function(t,e){return this._call("getUnconfirmedTransactionIds",t,e)},r.prototype.getUnconfirmedTransactions=function(t,e){return this._call("getUnconfirmedTransactions",t,e)},r.prototype.issueAsset=function(t,e){return this._call("issueAsset",t,e)},r.prototype.leaseBalance=function(t,e){return this._call("leaseBalance",t,e)},r.prototype.markHost=function(t,e){return this._call("markHost",t,e)},r.prototype.parseTransaction=function(t,e){return this._call("parseTransaction",t,e)},r.prototype.placeAskOrder=function(t,e){return this._call("placeAskOrder",t,e)},r.prototype.placeBidOrder=function(t,e){return this._call("placeBidOrder",t,e)},r.prototype.readMessage=function(t,e){return this._call("readMessage",t,e)},r.prototype.rsConvert=function(t,e){return this._call("rsConvert",t,e)},r.prototype.sellAlias=function(t,e){return this._call("sellAlias",t,e)},r.prototype.sendMessage=function(t,e){return this._call("sendMessage",t,e)},r.prototype.sendMoney=function(t,e){return this._call("sendMoney",t,e)},r.prototype.setAccountInfo=function(t,e){return this._call("setAccountInfo",t,e)},r.prototype.setAlias=function(t,e){return this._call("setAlias",t,e)},r.prototype.signTransaction=function(t,e){return this._call("signTransaction",t,e)},r.prototype.startForging=function(t,e){return this._call("startForging",t,e)},r.prototype.stopForging=function(t,e){return this._call("stopForging",t,e)},r.prototype.transferAsset=function(t,e){return this._call("transferAsset",t,e)},r}();t.API=r}(Nxt||(Nxt={})),module.exports=Nxt;
//# sourceMappingURL=/sm/9915363ad9970e0f02a42fb66fefee34311a5469498035d195cc8b6cdf40762c.map