richpartners-telegram-sdk
Version:
richPartners ads telegram
26 lines • 947 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.IpService = void 0;
const index_js_1 = require("../services/index.js");
class IpService {
constructor() {
this.USERINFO_ENDPOINT = "https://eu.convers.link/users/info?callback=userinfo_rp_pu";
this.USERINFO_ENDPOINT_2 = "https://us.convers.link/users/info?callback=userinfo_rp_pu";
this.publisherInfo = { ip: "" };
}
async setIp() {
const src = Math.random() < 0.5 ? this.USERINFO_ENDPOINT : this.USERINFO_ENDPOINT_2;
return new Promise((resolve, reject) => {
window.userinfo_rp_pu = (data) => {
this.publisherInfo.ip = data.ip;
resolve();
};
index_js_1.ResourceLoader.loadJs(src).catch(reject);
});
}
getIp() {
return this.publisherInfo.ip;
}
}
exports.IpService = IpService;
//# sourceMappingURL=IpService.js.map