@axerunners/insight-ui
Version:
An open-source frontend for the Insight API. The Insight API provides you with a convenient, powerful and simple way to query and broadcast data on the Axe network and build your own services with it.
33 lines (30 loc) • 740 B
JavaScript
;
angular.module('insight.address')
.factory('Address',
function ($resource) {
return $resource(window.apiPrefix + '/addr/:addrStr/?noTxList=1', {
addrStr: '@addStr'
}, {
get: {
method: 'GET',
interceptor: {
response: function (res) {
return res.data;
},
responseError: function (res) {
if (res.status === 404) {
return res;
}
}
}
}
});
})
.factory('AddressValidator',
function () {
return {
test: function (addressStr) {
return /^[XxYy][1-9A-Za-z][^OIl]{20,40}/.test(addressStr);
}
};
});