UNPKG

@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.

49 lines (46 loc) 1.21 kB
'use strict'; angular.module('insight.transactions') .factory('Transaction', function ($resource) { return $resource(window.apiPrefix + '/tx/:txId', { txId: '@txId' }, { get: { method: 'GET', interceptor: { response: function (res) { return res.data; }, responseError: function (res) { if (res.status === 404) { return res; } } } } }); }) .factory('TransactionsByBlock', function ($resource) { return $resource(window.apiPrefix + '/txs', { block: '@block' }); }) .factory('TransactionsByAddress', function ($resource) { return $resource(window.apiPrefix + '/txs', { address: '@address' }); }) .factory('Transactions', function ($resource) { return $resource(window.apiPrefix + '/txs'); }) .factory('TransactionHashValidator', function (HashValidator, BlockHashValidator) { return { test: function (txHashStr) { return HashValidator.test64(txHashStr) && !BlockHashValidator.test(txHashStr); } }; });