-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added handling for different transactions
- Loading branch information
Showing
9 changed files
with
235 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<!-- | ||
Copyright D3 Ledger, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<template> | ||
<div style="padding: 2rem"> | ||
<div class="row first"> | ||
<span>Time</span> | ||
<span>{{ format(tx[0].time, 'HH:mm:ss MM/DD/YYYY') }} </span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.accountId" | ||
class="row" | ||
> | ||
<span>Sender</span> | ||
<span>{{ tx[0].params.accountId }}</span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.publicKey" | ||
class="row" | ||
> | ||
<span>Public key</span> | ||
<span>{{ tx[0].params.publicKey }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import format from 'date-fns/format' | ||
export default { | ||
props: { | ||
tx: { | ||
type: Array, | ||
required: true, | ||
default: () => [{}] | ||
} | ||
}, | ||
methods: { | ||
format (...args) { | ||
return format(...args) | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<!-- | ||
Copyright D3 Ledger, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<template> | ||
<div style="padding: 2rem"> | ||
<div class="row first"> | ||
<span>Time</span> | ||
<span>{{ format(tx[0].time, 'HH:mm:ss MM/DD/YYYY') }} </span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.accountId" | ||
class="row" | ||
> | ||
<span>Sender</span> | ||
<span>{{ tx[0].params.accountId }}</span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.key && tx[0].params.key.includes('_whitelist')" | ||
class="row" | ||
> | ||
<span v-if="tx[0].params.key.includes('btc')">BTC Address</span> | ||
<span v-if="tx[0].params.key.includes('eth')">ETH Address</span> | ||
<span>{{ getLastAddress(tx[0].params.value) }}</span> | ||
</div> | ||
<div | ||
v-if="tx[0].params.key && tx[0].params.key.includes('email')" | ||
class="row" | ||
> | ||
<span>Email</span> | ||
<span>{{ tx[0].params.value }}</span> | ||
</div> | ||
<div | ||
v-if="tx[0].params.key && tx[0].params.key.includes('notifications')" | ||
class="row" | ||
> | ||
<span>Notifications</span> | ||
<span>{{ tx[0].params.value ? 'ACTIVATE' : 'DIACTIVATE' }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import format from 'date-fns/format' | ||
export default { | ||
props: { | ||
tx: { | ||
type: Array, | ||
required: true, | ||
default: () => [{}] | ||
} | ||
}, | ||
methods: { | ||
format (...args) { | ||
return format(...args) | ||
}, | ||
getLastAddress (value) { | ||
// eslint-disable-next-line | ||
return JSON.parse(value.replace(/\\\"/g, '"')).pop() | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!-- | ||
Copyright D3 Ledger, Inc. All Rights Reserved. | ||
SPDX-License-Identifier: Apache-2.0 | ||
--> | ||
<template> | ||
<div style="padding: 2rem"> | ||
<div class="row first"> | ||
<span>Time</span> | ||
<span>{{ format(tx[0].time, 'HH:mm:ss MM/DD/YYYY') }} </span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.srcAccountId" | ||
class="row" | ||
> | ||
<span>Sender</span> | ||
<span>{{ tx[0].params.srcAccountId }}</span> | ||
</div> | ||
<div | ||
v-if="tx[0].params.destAccountId" | ||
class="row" | ||
> | ||
<span>Receiver</span> | ||
<span>{{ tx[0].params.destAccountId }}</span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="tx[0].params.amount" | ||
class="row" | ||
> | ||
<span>Amount <span v-if="tx[2]">(give)</span></span> | ||
<span>{{ tx[0].params.amount }} {{ getAssetName(tx[0].params.assetId) }}</span> | ||
</div> | ||
<div | ||
v-if="tx[0].params.amount" | ||
class="row" | ||
> | ||
<span>Fee</span> | ||
<span>{{ feeAmount }} {{ getAssetName(tx[0].params.assetId) }}</span> | ||
</div> | ||
<el-divider /> | ||
<div | ||
v-if="total > 0" | ||
class="row last" | ||
> | ||
<span>Total <span v-if="tx[2]">give</span></span> | ||
<span>{{ total }} {{ getAssetName(tx[0].params.assetId) }}</span> | ||
</div> | ||
<div | ||
v-if="tx[2]" | ||
class="row last" | ||
> | ||
<span>Total recieve</span> | ||
<span>{{ tx[2].params.amount }} {{ getAssetName(tx[2].params.assetId) }}</span> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import format from 'date-fns/format' | ||
import BigNumber from 'bignumber.js' | ||
BigNumber.set({ EXPONENTIAL_AT: [-19, 20] }) | ||
export default { | ||
props: { | ||
tx: { | ||
type: Array, | ||
required: true, | ||
default: () => [{}] | ||
} | ||
}, | ||
computed: { | ||
feeAmount () { | ||
return this.tx[1] ? this.tx[1].params.amount : 0 | ||
}, | ||
total () { | ||
return BigNumber(this.tx[0].params.amount || 0).plus(this.feeAmount) | ||
} | ||
}, | ||
methods: { | ||
format (...args) { | ||
return format(...args) | ||
}, | ||
getAssetName (assetId) { | ||
return assetId ? assetId.split('#')[0] : '' | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.