diff --git a/src/api/bcd.js b/src/api/bcd.js index 789ffd90..1ee156df 100644 --- a/src/api/bcd.js +++ b/src/api/bcd.js @@ -105,21 +105,6 @@ export class BetterCallApi { }) } - getSimilarContracts(network, address, offset = 0) { - let params = {} - if (offset > 0) params.offset = offset; - return getCancellable(this.api, `/contract/${network}/${address}/similar`, { - params: params - }) - .then((res) => { - if (!res) { return res; } - if (res.status != 200) { - throw new RequestFailedError(res); - } - return res.data - }) - } - getContractOperations(network, address, last_id = "", from = 0, to = 0, statuses = [], entrypoints = [], with_storage_diff = true) { let params = {} if (last_id != "") { diff --git a/src/views/contract/SideBar.vue b/src/views/contract/SideBar.vue index 19cc5e1f..46068fbf 100644 --- a/src/views/contract/SideBar.vue +++ b/src/views/contract/SideBar.vue @@ -187,55 +187,6 @@ - - - Similar contracts ({{ contract.similar_count }}) - - - - - - - - - - - Load more - - - - - - - ({ same: [], same_count: 0, - similar: [], - similar_count: 0, - similarLoading: false, sameLoading: false, sameInitialLoadingStatus: DATA_LOADING_STATUSES.NOTHING, - similarInitialLoadingStatus: DATA_LOADING_STATUSES.NOTHING, }), created() { }, @@ -307,9 +254,6 @@ export default { isSameInitialLoading() { return this.sameInitialLoadingStatus === DATA_LOADING_STATUSES.PROGRESS; }, - isSimilarInitialLoading() { - return this.similarInitialLoadingStatus === DATA_LOADING_STATUSES.PROGRESS; - }, isContract() { return this.address.startsWith("KT"); }, @@ -380,28 +324,6 @@ export default { this.sameInitialLoadingStatus = DATA_LOADING_STATUSES.ERROR; }); }, - requestSimilar() { - if (!this.isContract - || this.similarInitialLoadingStatus !== DATA_LOADING_STATUSES.NOTHING - ) return; - - this.similarInitialLoadingStatus = DATA_LOADING_STATUSES.PROGRESS; - this.similar = []; - this.similarCount = 0; - this.api - .getSimilarContracts(this.network, this.address, 0) - .then((res) => { - if (!res) return; - this.similar = res.contracts; - this.similarCount = res.count; - this.similarInitialLoadingStatus = DATA_LOADING_STATUSES.SUCCESS; - }) - .catch((err) => { - this.showError(err); - console.log(err); - this.similarInitialLoadingStatus = DATA_LOADING_STATUSES.ERROR; - }); - }, requestMoreSame() { this.sameLoading = true; this.api @@ -416,20 +338,6 @@ export default { }) .finally(() => (this.sameLoading = false)); }, - requestMoreSimilar() { - this.similarLoading = true; - this.api - .getSimilarContracts(this.network, this.address, this.similar.length) - .then((res) => { - if (!res) return; - this.similar.push(...res.contracts); - }) - .catch((err) => { - this.showError(err); - console.log(err); - }) - .finally(() => (this.similarLoading = false)); - }, onForkClick() { this.$emit("fork", { address: this.address, @@ -440,11 +348,8 @@ export default { watch: { contract(newVal) { this.same_count = newVal.same_count; - this.similar_count = newVal.similar_count; this.sameInitialLoadingStatus = DATA_LOADING_STATUSES.NOTHING; - this.similarInitialLoadingStatus = DATA_LOADING_STATUSES.NOTHING; this.same = []; - this.similar = []; } } };