uport-lite
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -181,7 +181,4 @@ (function webpackUniversalModuleDefinition(root, factory) { | ||
const XMLHttpRequest = window.XMLHttpRequest; // eslint-disable-line | ||
/* (ignored) */ | ||
module.exports = XMLHttpRequest; | ||
/***/ }), | ||
@@ -222,3 +219,3 @@ /* 2 */ | ||
const XMLHttpRequest = __webpack_require__(1) | ||
const XMLHttpRequest = window.XMLHttpRequest || __webpack_require__(1).XMLHttpRequest | ||
@@ -307,4 +304,5 @@ const getAttributesData = '0x446d5aa4000000000000000000000000' | ||
/***/ }) | ||
/******/ ]); | ||
}); |
(function(d,a){"object"===typeof exports&&"object"===typeof module?module.exports=a():"function"===typeof define&&define.amd?define("UportLite",[],a):"object"===typeof exports?exports.UportLite=a():d.UportLite=a()})(this,function(){return function(d){function a(c){if(e[c])return e[c].exports;var b=e[c]={i:c,l:!1,exports:{}};d[c].call(b.exports,b,b.exports,a);b.l=!0;return b.exports}var e={};a.m=d;a.c=e;a.i=function(a){return a};a.d=function(c,b,d){a.o(c,b)||Object.defineProperty(c,b,{configurable:!1, | ||
enumerable:!0,get:d})};a.n=function(c){var b=c&&c.__esModule?function(){return c["default"]}:function(){return c};a.d(b,"a",b);return b};a.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};a.p="";return a(a.s=3)}([function(d,a,e){(function(a){var b=a&&a.Buffer?a.Buffer:Uint8Array;d.exports=function(a){function c(a){if(0===a.length)return new b(0);for(var h=[0],g=0;g<a.length;g++){var f=d[a[g]];if(void 0===f)return;for(var c=0;c<h.length;++c)f+=h[c]*k,h[c]=f&255,f>>=8;for(;0<f;)h.push(f& | ||
255),f>>=8}for(g=0;a[g]===q&&g<a.length-1;++g)h.push(0);return b.from(h.reverse())}for(var d={},k=a.length,q=a.charAt(0),l=0;l<a.length;l++){var e=a.charAt(l);if(void 0!==d[e])throw new TypeError(e+" is ambiguous");d[e]=l}return{encode:function(c){if(0===c.length)return"";for(var h=[0],g=0;g<c.length;++g){for(var f=0,b=c[g];f<h.length;++f)b+=h[f]<<8,h[f]=b%k,b=b/k|0;for(;0<b;)h.push(b%k),b=b/k|0}g="";for(f=0;0===c[f]&&f<c.length-1;++f)g+=a[0];for(c=h.length-1;0<=c;--c)g+=a[h[c]];return g},decodeUnsafe:c, | ||
decode:function(a){if(a=c(a))return a;throw Error("Non-base"+k+" character");}}}}).call(a,e(2))},function(d,a){d.exports=window.XMLHttpRequest},function(d,a){a=function(){return this}();try{a=a||Function("return this")()||(0,eval)("this")}catch(e){"object"===typeof window&&(a=window)}d.exports=a},function(d,a,e){function c(a,c){var b=new p,d=a||{};b.onreadystatechange=function(){if(4===b.readyState&&1!==b.timeout)if(200!==b.status)c(Error("[uport-lite] status "+b.status+": "+b.responseText));else try{c(null, | ||
JSON.parse(b.responseText))}catch(m){c(Error("[uport-lite] while parsing data: '"+String(b.responseText)+"', error: "+String(m)))}};d.data?b.open("POST",a.uri):b.open("GET",a.uri);d.accept&&b.setRequestHeader("accept",d.accept);d.data?(b.setRequestHeader("Content-Type","application/json"),b.send(JSON.stringify(d.data))):b.send()}var b=e(0)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),n=e(0)("0123456789abcdef"),p=e(1);d.exports=function(a){function d(a,d){return a?c({uri:m,accept:"application/json", | ||
data:{method:"eth_call",params:[{to:e,data:"0x446d5aa4000000000000000000000000"+a.slice(2)},"latest"],id:1,jsonrpc:"2.0"}},function(a,c){if(a)return d(a);a=c.result.slice(130).slice(0,68);return d(null,b.encode(n.decode(a)))}):d(null)}a=void 0===a?{}:a;var e=a.registryAddress||"0xb9C1598e24650437a3055F7f66AC1820c419a679",l=a.ipfsGw||"https://ipfs.infura.io/ipfs/",m=a.rpcUrl||"https://ropsten.infura.io/uport-lite-library";return function(a,b){return d(a,function(a,d){if(a)return b(a);d&&"0x"!==d?c({uri:""+ | ||
l+d},b):b()})}}}])}); | ||
enumerable:!0,get:d})};a.n=function(c){var b=c&&c.__esModule?function(){return c["default"]}:function(){return c};a.d(b,"a",b);return b};a.o=function(a,b){return Object.prototype.hasOwnProperty.call(a,b)};a.p="";return a(a.s=3)}([function(d,a,e){(function(a){var b=a&&a.Buffer?a.Buffer:Uint8Array;d.exports=function(a){function c(a){if(0===a.length)return new b(0);for(var h=[0],g=0;g<a.length;g++){var f=l[a[g]];if(void 0===f)return;for(var c=0;c<h.length;++c)f+=h[c]*d,h[c]=f&255,f>>=8;for(;0<f;)h.push(f& | ||
255),f>>=8}for(g=0;a[g]===p&&g<a.length-1;++g)h.push(0);return b.from(h.reverse())}for(var l={},d=a.length,p=a.charAt(0),k=0;k<a.length;k++){var e=a.charAt(k);if(void 0!==l[e])throw new TypeError(e+" is ambiguous");l[e]=k}return{encode:function(c){if(0===c.length)return"";for(var h=[0],g=0;g<c.length;++g){for(var f=0,b=c[g];f<h.length;++f)b+=h[f]<<8,h[f]=b%d,b=b/d|0;for(;0<b;)h.push(b%d),b=b/d|0}g="";for(f=0;0===c[f]&&f<c.length-1;++f)g+=a[0];for(c=h.length-1;0<=c;--c)g+=a[h[c]];return g},decodeUnsafe:c, | ||
decode:function(a){if(a=c(a))return a;throw Error("Non-base"+d+" character");}}}}).call(a,e(2))},function(d,a){},function(d,a){a=function(){return this}();try{a=a||Function("return this")()||(0,eval)("this")}catch(e){"object"===typeof window&&(a=window)}d.exports=a},function(d,a,e){function c(a,c){var b=new n,d=a||{};b.onreadystatechange=function(){if(4===b.readyState&&1!==b.timeout)if(200!==b.status)c(Error("[uport-lite] status "+b.status+": "+b.responseText));else try{c(null,JSON.parse(b.responseText))}catch(q){c(Error("[uport-lite] while parsing data: '"+ | ||
String(b.responseText)+"', error: "+String(q)))}};d.data?b.open("POST",a.uri):b.open("GET",a.uri);d.accept&&b.setRequestHeader("accept",d.accept);d.data?(b.setRequestHeader("Content-Type","application/json"),b.send(JSON.stringify(d.data))):b.send()}var b=e(0)("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),m=e(0)("0123456789abcdef"),n=window.XMLHttpRequest||e(1).XMLHttpRequest;d.exports=function(a){function d(a,d){return a?c({uri:l,accept:"application/json",data:{method:"eth_call",params:[{to:e, | ||
data:"0x446d5aa4000000000000000000000000"+a.slice(2)},"latest"],id:1,jsonrpc:"2.0"}},function(a,c){if(a)return d(a);a=c.result.slice(130).slice(0,68);return d(null,b.encode(m.decode(a)))}):d(null)}a=void 0===a?{}:a;var e=a.registryAddress||"0xb9C1598e24650437a3055F7f66AC1820c419a679",k=a.ipfsGw||"https://ipfs.infura.io/ipfs/",l=a.rpcUrl||"https://ropsten.infura.io/uport-lite-library";return function(a,b){return d(a,function(a,d){if(a)return b(a);d&&"0x"!==d?c({uri:""+k+d},b):b()})}}}])}); |
@@ -7,3 +7,3 @@ 'use strict'; | ||
var XMLHttpRequest = require('./lib/XMLHttpRequest'); | ||
var XMLHttpRequest = window.XMLHttpRequest || require('xmlhttprequest').XMLHttpRequest; | ||
@@ -10,0 +10,0 @@ var getAttributesData = '0x446d5aa4000000000000000000000000'; |
{ | ||
"name": "uport-lite", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "Lightweight library for looking up public profiles on uport-registry", | ||
@@ -29,5 +29,3 @@ "main": "lib/index.js", | ||
"browser": { | ||
"xmlhttprequest": false, | ||
"./src/lib/XMLHttpRequest.js": "./src/lib/XMLHttpRequest-browser.js", | ||
"./lib/lib/XMLHttpRequest.js": "./lib/lib/XMLHttpRequest-browser.js" | ||
"xmlhttprequest": false | ||
}, | ||
@@ -34,0 +32,0 @@ "jest": { |
@@ -5,3 +5,3 @@ var BASE58 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz' | ||
const XMLHttpRequest = require('./lib/XMLHttpRequest') | ||
const XMLHttpRequest = window.XMLHttpRequest || require('xmlhttprequest').XMLHttpRequest | ||
@@ -88,2 +88,2 @@ const getAttributesData = '0x446d5aa4000000000000000000000000' | ||
module.exports = UportLite | ||
module.exports = UportLite |
22118