Skip to content

Commit

Permalink
Merge pull request #119 from proximax-foundry/develop
Browse files Browse the repository at this point in the history
Release v1.1.6
  • Loading branch information
shinneng authored Sep 27, 2022
2 parents 7eb844d + 07b07b8 commit 351932c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 46 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "explorer",
"version": "1.1.5",
"version": "1.1.6",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
99 changes: 61 additions & 38 deletions src/modules/account/components/MultisigComponent.vue
Original file line number Diff line number Diff line change
@@ -1,60 +1,72 @@
<template>
<div class='p-6 border-2 border-t-0 filter shadow-lg'>
<div class='text-xs font-semibold'>Account Cosignatories</div>
<div class='border p-4 my-3 '>
<div class="flex flex-col gap-2">
<div v-for="(cosigner,index) in cosignerAccountsList" :key="index">
<div class="border w-full rounded-md p-3">
<div class="flex items-center">
<div :id="`cosignerAddress${index}`" :copyValue="cosigner.address" copySubject="Address" class="text-txs font-bold mt-1">
<router-link :to="{ name: 'ViewAccount', params: { accountParam: cosigner.address} }" class="hover:text-blue-primary hover:underline">
{{cosigner.address}}
<div>
<div class="flex text-xs font-semibold border-b-2">
<div class="border-b-2 p-1 mt-3 mb-3 w-18 text-center font-semibold" :class="`${ (currentComponent=='multisig')?'border-blue-500 text-white bg-blue-primary':'cursor-pointer' }`" @click="setCurrentComponent('multisig')">Multisig</div>
<div class="border-b-2 p-1 mt-3 mb-3 w-18 text-center font-semibold" :class="`${ (currentComponent=='scheme')?'border-blue-500 text-white bg-blue-primary':'cursor-pointer' }`" @click="setCurrentComponent('scheme')">Scheme</div>
</div>
<div class="mb-20">
<div v-if="currentComponent=='multisig'">
<div class='p-6 border-2 border-t-0 filter shadow-lg'>
<div class='text-xs font-semibold'>Account Cosignatories</div>
<div class='border p-4 my-3 '>
<div class="flex flex-col gap-2">
<div v-for="(cosigner,index) in cosignerAccountsList" :key="index">
<div class="border w-full rounded-md p-3">
<div class="flex items-center">
<div :id="`cosignerAddress${index}`" :copyValue="cosigner.address" copySubject="Address" class="text-txs font-bold mt-1">
<router-link :to="{ name: 'ViewAccount', params: { accountParam: cosigner.address} }" class="hover:text-blue-primary hover:underline">
{{cosigner.address}}
</router-link>
</div>
<img src="@/assets/img/icon-copy.svg" @click="copy(`cosignerAddress${index}`)" class="ml-2 w-4 h-4 cursor-pointer" />
<router-link :to="{ name: 'ViewAccount', params: { accountParam: cosigner.address} }" class="hover:bg-gray-200 w-7 h-7 ml-auto flex justify-center items-center rounded-full duration-300 transition-all cursor-pointer">
<img src="@/assets/img/chevron_right.svg" class="w-5 h-5">
</router-link>
</div>
<img src="@/assets/img/icon-copy.svg" @click="copy(`cosignerAddress${index}`)" class="ml-2 w-4 h-4 cursor-pointer" />
<router-link :to="{ name: 'ViewAccount', params: { accountParam: cosigner.address} }" class="hover:bg-gray-200 w-7 h-7 ml-auto flex justify-center items-center rounded-full duration-300 transition-all cursor-pointer">
<img src="@/assets/img/chevron_right.svg" class="w-5 h-5">
</router-link>
</div>
</div>
</div>
<div v-if="!cosignerLength" class='text-blue-primary text-xs text-center font-semibold'>Nothing to show.</div>
<div v-if="!cosignerLength" class='text-txs w-9/12 ml-auto mr-auto text-gray-400 mt-1 text-center'>
<span>"{{ prettyAddress }}" does not have any cosignatory accounts.</span>
</div>
</div>
<div v-if="!cosignerLength" class='text-blue-primary text-xs text-center font-semibold'>Nothing to show.</div>
<div v-if="!cosignerLength" class='text-txs w-9/12 ml-auto mr-auto text-gray-400 mt-1 text-center'>
<span>"{{ prettyAddress }}" does not have any cosignatory accounts.</span>
</div>
</div>
<div class="gray-line my-8"></div>
<div class='text-xs font-semibold'>Cosignatory of</div>
<div class='border p-4 mt-3'>
<div class="flex flex-col gap-2">
<div v-for="(multisig,index) in multisigAccountsList" :key="index">
<div class="border w-full rounded-md p-3">
<div class="flex items-center">
<div :id="`multisigAddress${index}`" :copyValue="multisig.address" copySubject="Address" class="text-txs font-bold mt-1">
<router-link :to="{ name: 'ViewAccount', params: { accountParam: multisig.address} }" class="hover:text-blue-primary hover:underline">
{{ multisig.address }}
<div class="gray-line my-8"></div>
<div class='text-xs font-semibold'>Cosignatory of</div>
<div class='border p-4 mt-3'>
<div class="flex flex-col gap-2">
<div v-for="(multisig,index) in multisigAccountsList" :key="index">
<div class="border w-full rounded-md p-3">
<div class="flex items-center">
<div :id="`multisigAddress${index}`" :copyValue="multisig.address" copySubject="Address" class="text-txs font-bold mt-1">
<router-link :to="{ name: 'ViewAccount', params: { accountParam: multisig.address} }" class="hover:text-blue-primary hover:underline">
{{ multisig.address }}
</router-link>
</div>
<img src="@/assets/img/icon-copy.svg" @click="copy(`multisigAddress${index}`)" class="ml-2 w-4 h-4 cursor-pointer" />
<router-link :to="{ name: 'ViewAccount', params: { accountParam: multisig.address} }" class="hover:bg-gray-200 w-7 h-7 ml-auto flex justify-center items-center rounded-full duration-300 transition-all cursor-pointer">
<img src="@/assets/img/chevron_right.svg" class="w-5 h-5">
</router-link>
</div>
<img src="@/assets/img/icon-copy.svg" @click="copy(`multisigAddress${index}`)" class="ml-2 w-4 h-4 cursor-pointer" />
<router-link :to="{ name: 'ViewAccount', params: { accountParam: multisig.address} }" class="hover:bg-gray-200 w-7 h-7 ml-auto flex justify-center items-center rounded-full duration-300 transition-all cursor-pointer">
<img src="@/assets/img/chevron_right.svg" class="w-5 h-5">
</router-link>
</div>
</div>
</div>
<div v-if="!multisigLength" class='text-blue-primary text-xs text-center font-semibold'>Nothing to show.</div>
<div v-if="!multisigLength" class='flex text-txs w-9/12 ml-auto mr-auto text-gray-400 mt-1 justify-center text-center'>
<span>{{ prettyAddress }} is not a cosignatory of any accounts.</span>
</div>
</div>
<div v-if="!multisigLength" class='text-blue-primary text-xs text-center font-semibold'>Nothing to show.</div>
<div v-if="!multisigLength" class='flex text-txs w-9/12 ml-auto mr-auto text-gray-400 mt-1 justify-center text-center'>
<span>{{ prettyAddress }} is not a cosignatory of any accounts.</span>
</div>
</div>
</div>
</div>
<SchemeComponent v-else-if="currentComponent=='scheme'" :accountAddress="address" :accountPublicKey="PublicKey" />
</div>
</div>
</template>

<script>
import { watch, ref, computed, getCurrentInstance, toRefs } from "vue";
import SchemeComponent from "@/modules/account/components/SchemeComponent.vue";
import { useToast } from "primevue/usetoast";
import { copyToClipboard } from '@/util/functions';
import { Helper } from '@/util/typeHelper';
Expand All @@ -63,12 +75,17 @@ import { AppState } from '@/state/appState';
export default {
name:"MultisigComponent",
components: {
SchemeComponent
},
props:{
cosignatories: Array,
multisig: Array,
address: String,
PublicKey: String,
},
setup(props){
const currentComponent = ref('multisig');
const toast = useToast();
const prettyAddress = computed(() => {
return Helper.createAddress(props.address).pretty();
Expand Down Expand Up @@ -107,13 +124,19 @@ export default {
toast.add({severity:'info', detail: copySubject + ' copied', group: 'br', life: 3000});
};
const setCurrentComponent = (page) => {
currentComponent.value = page;
}
return{
cosignerLength,
multisigLength,
multisigAccountsList,
cosignerAccountsList,
copy,
prettyAddress,
setCurrentComponent,
currentComponent,
}
}
}
Expand Down
6 changes: 1 addition & 5 deletions src/modules/account/views/ViewAccount.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
<div class="w-18 text-center" :class="`${ (currentComponent=='namespace')?'border-yellow-500 border-b-2':'cursor-pointer' }`" @click="setCurrentComponent('namespace')" v-if="accountNamespaces.length > 0">Namespaces</div>
<div class="w-18 text-center" :class="`${ (currentComponent=='metadata')?'border-yellow-500 border-b-2':'cursor-pointer' }`" @click="setCurrentComponent('metadata')" v-if="accountMetadata.length > 0">Metadata</div>
<div class="w-18 text-center" :class="`${ (currentComponent=='multisig')?'border-yellow-500 border-b-2':'cursor-pointer' }`" @click="setCurrentComponent('multisig')" v-if="multisigLength > 0 || cosignatoriesLength > 0">Multisig</div>
<div class="w-18 text-center" :class="`${ (currentComponent=='scheme')?'border-yellow-500 border-b-2':'cursor-pointer' }`" @click="setCurrentComponent('scheme')" v-if="cosignatoriesLength > 0">Scheme</div>
<div class="w-18 text-center" :class="`${ (currentComponent=='txn')?'border-yellow-500 border-b-2':'cursor-pointer' }`" @click="setCurrentComponent('txn')">Transactions</div>
</div>
<div class="mb-20" v-if="!isFetching">
<AssetComponent :accountAsset="accountAssets" :accountPublicKey="strPublicKey" v-if="currentComponent=='asset'" />
<NamespaceComponent :accountNamespaces="accountNamespaces" v-if="currentComponent=='namespace'" />
<MetadataComponent :accountMetadata="accountMetadata" v-if="currentComponent=='metadata'" />
<MultisigComponent :cosignatories="multisig.cosignatories" :multisig="multisig.multisigAccounts" :address="strAddress" v-else-if="currentComponent=='multisig'" />
<SchemeComponent v-else-if="currentComponent=='scheme'" :accountAddress="strAddress" :accountPublicKey="strPublicKey" />
<MultisigComponent :cosignatories="multisig.cosignatories" :multisig="multisig.multisigAccounts" :address="strAddress" :accountPublicKey="strPublicKey" v-else-if="currentComponent=='multisig'" />
<TransactionComponent v-else-if="currentComponent=='txn'" :accountAddress="strAddress" :accountPublicKey="strPublicKey" />
</div>
</div>
Expand All @@ -33,7 +31,6 @@ import AssetComponent from "@/modules/account/components/AssetComponent.vue";
import NamespaceComponent from "@/modules/account/components/NamespaceComponent.vue";
import MetadataComponent from "@/modules/account/components/MetadataComponent.vue";
import MultisigComponent from "@/modules/account/components/MultisigComponent.vue";
import SchemeComponent from "@/modules/account/components/SchemeComponent.vue";
import TransactionComponent from "@/modules/account/components/TransactionComponent.vue";
import { networkState } from '@/state/networkState';
import { AppState } from '@/state/appState';
Expand All @@ -50,7 +47,6 @@ export default {
NamespaceComponent,
MetadataComponent,
MultisigComponent,
SchemeComponent,
TransactionComponent,
},
props: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
<template #body="{data}">
<div class="text-xs" v-if="data.amountTransfer">{{ Helper.toCurrencyFormat(data.amountTransfer, currencyDivisibility)}}</div>
<div v-if="checkOtherAsset">
<div v-for="(sdaName, index) in displaySDAs(data.sda)" :key="index">{{sdaName.amount}}
<div v-for="(sdaName, index) in displaySDAs(data.sda)" :key="index">{{Helper.toCurrencyFormat(sdaName.amount)}}
</div>
</div>
</template>
Expand Down
8 changes: 7 additions & 1 deletion src/util/blockUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ export class BlockUtils {

let blockInfoByHeight = await AppState.chainAPI.blockAPI.getBlocksByHeightWithLimit(blockHeight,100);
if (blockInfoByHeight.length < 100) {
blockInfo = await AppState.chainAPI.blockAPI.getBlocksByHeightWithLimit(blockHeight - 1000,100);
let getPreviousBlockByHeight = await AppState.chainAPI.blockAPI.getBlocksByHeightWithLimit(blockHeight - blockInfoByHeight.length);
let totalHeight: number = 100 - blockInfoByHeight.length;
let getSlicedBlock: BlockInfo[] = getPreviousBlockByHeight.slice(0, totalHeight);
blockInfo = blockInfoByHeight.concat(getSlicedBlock);
}
else {
blockInfo = blockInfoByHeight;
}
return blockInfo;
}

Expand Down

0 comments on commit 351932c

Please sign in to comment.