-
-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #409 from Adamant-im/stage
v2.10.0
- Loading branch information
Showing
60 changed files
with
1,364 additions
and
136 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 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "adamant-im", | ||
"version": "2.9.0", | ||
"version": "2.10.0", | ||
"author": "ADAMANT Foundation <[email protected]>", | ||
"license": "GPLv3", | ||
"description": "Decentralized Messenger", | ||
|
@@ -18,6 +18,8 @@ | |
"postinstall": "electron-builder install-app-deps" | ||
}, | ||
"dependencies": { | ||
"@liskhq/lisk-cryptography": "2.3.0", | ||
"@liskhq/lisk-transactions": "2.3.1", | ||
"@mdi/font": "^5.9.55", | ||
"@stablelib/utf8": "^1.0.0", | ||
"@zxing/library": "0.18.3", | ||
|
@@ -45,6 +47,7 @@ | |
"lodash": "^4.17.20", | ||
"marked": "^1.2.7", | ||
"notifyjs": "^3.0.0", | ||
"pbkdf2": "^3.1.1", | ||
"promise-queue": "^2.2.5", | ||
"qrcode": "^1.4.4", | ||
"qs": "^6.9.6", | ||
|
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 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 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# Not used file | ||
|
||
## Adamant chat | ||
|
||
A chat built with Vuetify. | ||
|
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
/* | ||
Not used file | ||
*/ | ||
|
||
export type Message = { | ||
id: number, | ||
hash?: string, // transactionId for third-party cryptos | ||
|
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 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 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,148 @@ | ||
<template> | ||
<transaction-template | ||
:amount="transaction.amount | currency(crypto)" | ||
:timestamp="transaction.timestamp || NaN" | ||
:id="transaction.hash || '' " | ||
:fee="transaction.fee | currency('LSK')" | ||
:confirmations="confirmations || NaN" | ||
:sender="sender || '' " | ||
:recipient="recipient || '' " | ||
:explorerLink="explorerLink" | ||
:partner="partner || '' " | ||
:status="transaction.status || '' " | ||
:admTx="admTx" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import TransactionTemplate from './TransactionTemplate.vue' | ||
import getExplorerUrl from '../../lib/getExplorerUrl' | ||
import { Cryptos } from '../../lib/constants' | ||
import partnerName from '@/mixins/partnerName' | ||
export default { | ||
mixins: [partnerName], | ||
name: 'lsk-transaction', | ||
props: { | ||
crypto: { | ||
required: true, | ||
type: String | ||
}, | ||
id: { | ||
required: true, | ||
type: String | ||
} | ||
}, | ||
components: { | ||
TransactionTemplate | ||
}, | ||
data () { | ||
return { } | ||
}, | ||
computed: { | ||
cryptoKey () { | ||
return this.crypto.toLowerCase() | ||
}, | ||
transaction () { | ||
return this.$store.getters[`${this.cryptoKey}/transaction`](this.id) || { } | ||
}, | ||
sender () { | ||
return this.transaction.senderId ? this.formatAddress(this.transaction.senderId) : '' | ||
}, | ||
recipient () { | ||
return this.transaction.recipientId ? this.formatAddress(this.transaction.recipientId) : '' | ||
}, | ||
partner () { | ||
if (this.transaction.partner) return this.transaction.partner | ||
const id = this.transaction.senderId !== this.$store.state.lsk.address | ||
? this.transaction.senderId : this.transaction.recipientId | ||
return this.getAdmAddress(id) | ||
}, | ||
explorerLink () { | ||
return getExplorerUrl(Cryptos.LSK, this.id) | ||
}, | ||
confirmations () { | ||
const { height, confirmations } = this.transaction | ||
let result = confirmations | ||
if (height) { | ||
// Calculate actual confirmations count based on the tx block height and the last block height. | ||
const c = this.$store.getters[`${this.cryptoKey}/height`] - height | ||
if (isFinite(c) && c > result) { | ||
result = c | ||
} | ||
} | ||
return result | ||
}, | ||
admTx () { | ||
let admTx = {} | ||
// Bad news, everyone: we'll have to scan the messages | ||
Object.values(this.$store.state.chat.chats).some(chat => { | ||
Object.values(chat.messages).some(msg => { | ||
if (msg.hash && msg.hash === this.id) { | ||
Object.assign(admTx, msg) | ||
} | ||
return !!admTx.id | ||
}) | ||
return !!admTx.id | ||
}) | ||
return admTx | ||
} | ||
}, | ||
methods: { | ||
getAdmAddress (address) { | ||
let admAddress = '' | ||
// First, check the known partners | ||
const partners = this.$store.state.partners.list | ||
Object.keys(partners).some(uid => { | ||
const partner = partners[uid] | ||
if (partner[Cryptos.LSK] === address) { | ||
admAddress = uid | ||
} | ||
return !!admAddress | ||
}) | ||
if (!admAddress) { | ||
// Bad news, everyone: we'll have to scan the messages | ||
Object.values(this.$store.state.chat.chats).some(chat => { | ||
Object.values(chat.messages).some(msg => { | ||
if (msg.hash && msg.hash === this.id) { | ||
admAddress = msg.senderId === this.$store.state.address ? msg.recipientId : msg.senderId | ||
} | ||
return !!admAddress | ||
}) | ||
return !!admAddress | ||
}) | ||
} | ||
return admAddress | ||
}, | ||
formatAddress (address) { | ||
let admAddress = this.getAdmAddress(address) | ||
let name = '' | ||
if (address === this.$store.state.lsk.address) { | ||
name = this.$t('transaction.me') | ||
} else { | ||
name = this.getPartnerName(admAddress) | ||
} | ||
let result = '' | ||
if (name !== '' && name !== undefined) { | ||
result = name + ' (' + (address) + ')' | ||
} else { | ||
result = address | ||
if (admAddress) { | ||
result += ' (' + (admAddress) + ')' | ||
} | ||
} | ||
return result | ||
} | ||
} | ||
} | ||
</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
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 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 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.