Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7,429 changes: 7,429 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

29 changes: 28 additions & 1 deletion src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,33 @@ async function resolveRequset(request, webListData) {
let seed = getSeed(wallet, selectedAccount)

switch (method) {
case "signMessage":
if (!request.params || !request.params.encodedMessage) {
res.result = false
res.message = "Invalid params!"
break
}
request.params.publicKey = seed.keyPair.publicKey
triggerUi(request)
let confirmResult = await getConfirmResult()
if (confirmResult) {
apiAccount.buildFromPrivateKey(seed.keyPair.privateKey)
try {
let bytes = Base58.decode(request.params.encodedMessage)
res.signature = apiAccount.getSignature(bytes)
res.publicKey = seed.keyPair.publicKey
res.encodedMessage = request.params.encodedMessage
} catch (respError) {
res.result = false
res.message = "Invalid message.Message should be encoded in Base58 format."
console.log(respError)
}
} else {
res.result = false
res.message = 'User denied the action'
return res
}
break
case "address":
res.address = seed.address
break
Expand Down Expand Up @@ -323,7 +350,7 @@ async function resolveRequset(request, webListData) {
break
}
triggerUi(request)
let confirmResult = await getConfirmResult()
confirmResult = await getConfirmResult()
let params = request.params
if (confirmResult) {
let tra = new Transaction(networkByte)
Expand Down
6 changes: 5 additions & 1 deletion src/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
<b-dropdown-item v-b-modal.about href="#" class="drop-down"><img class="icon" src="../../static/icons/ic_about.png"><span class="text">About</span></b-dropdown-item>
<b-dropdown-item v-b-modal.settings href="#" class="drop-down"><img class="icon" src="../../static/icons/ic_setting.png"><span class="text">Settings</span></b-dropdown-item>
<b-dropdown-item v-show="isWebListExisted" v-b-modal.webList href="#" class="drop-down"><img class="icon" src="../../static/icons/web.png"><span class="text">Trusted List</span></b-dropdown-item>
<b-dropdown-item v-b-modal.signVerify href="#" class="drop-down"><img class="icon" src="../../static/icons/sign_verify.png"><span class="text">Sign&Verify</span></b-dropdown-item>
<b-dropdown-item @click="logout" class="drop-down"><img class="icon" src="../../static/icons/ic_logout.png"><span class="text">Log Out</span></b-dropdown-item>
</b-nav-item-dropdown>
</b-navbar-nav>
Expand All @@ -96,6 +97,7 @@
:account-name="accountNames[selectedAccount]"></Details>
<Settings></Settings>
<WebList @checkWebList="checkWebList"></WebList>
<SignVerify></SignVerify>
<About></About>
</div>
</template>
Expand All @@ -108,6 +110,7 @@ import AddAccount from './AddAccount.vue'
import { VSYS_PRECISION } from '../js-v-sdk/src/constants'
import Settings from './Settings.vue'
import WebList from './WebList.vue'
import SignVerify from './SignVerify.vue'
import About from './About.vue'
import TokenSelect from "./TokenSelect.vue"
import BigNumber from 'bignumber.js'
Expand Down Expand Up @@ -173,7 +176,8 @@ export default {
TokenSelect,
Settings,
About,
WebList
WebList,
SignVerify
},
methods: {
checkWebList() {
Expand Down
Loading