Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

see sharedWallet stake info #180

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
1 change: 1 addition & 0 deletions src/common/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default {
ontid: 'ONT ID',
selectWallet: 'Select Wallet to pay for the transaction fee',
commonWallet: 'Individual Wallet',
sharedWallet: 'Shared Wallet',
ledgerWallet: 'Ledger Wallet',
payerPassword: 'Input the password of your selected wallet',
selectCommonWallet: 'Select local individual wallet',
Expand Down
1 change: 1 addition & 0 deletions src/common/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export default {
ontid: 'ONT ID',
selectWallet: '请选择钱包来支付交易费用',
commonWallet: '普通钱包',
sharedWallet: '共享钱包',
ledgerWallet: 'Ledger钱包',
payerPassword: '输入所选钱包的密码',
selectCommonWallet: '选择本地普通钱包',
Expand Down
34 changes: 33 additions & 1 deletion src/renderer/components/Node/NodeAuthorize/StakeHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<p class="font-medium-black">{{$t('nodeStake.selectStakeWallet')}}</p>
<a-radio-group @change="changePayerWallet" v-model="payerWalletType" class="change-payer-radio">
<a-radio value="commonWallet" class="payer-radio-item">{{$t('createIdentity.commonWallet')}}</a-radio>
<a-radio value="sharedWallet" class="payer-radio-item">{{$t('createIdentity.sharedWallet')}}</a-radio>
<a-radio value="ledgerWallet" class="payer-radio-item">{{$t('createIdentity.ledgerWallet')}}</a-radio>

<div v-if="payerWalletType === 'commonWallet'">
Expand All @@ -44,6 +45,13 @@
</a-select>
</div>

<div v-if="payerWalletType === 'sharedWallet'">
<a-select :options="sharedWallet" class="select-wallet" v-model="payerWalletValue"
:placeholder="$t('createIdentity.sharedWallet')"
@change="handleChangePayer">
</a-select>
</div>

<div v-if="payerWalletType === 'ledgerWallet'">

<div class="payer-ledger-status">
Expand Down Expand Up @@ -165,6 +173,17 @@ export default {
});
}
},
sharedWallet: {
get() {
const list = this.$store.state.Wallets.SharedWallet.slice();
return list.map(i => {
return Object.assign({}, i, {
label: i.sharedWalletName + " " + i.sharedWalletAddress,
value: i.sharedWalletAddress
});
});
}
},
},
methods: {
handleRouteBack() {
Expand All @@ -185,19 +204,32 @@ export default {
},
handleChangePayer(value) {
this.payerWallet = this.normalWallet.find((v)=>{return v.address === value})
this.payerWalletValue = this.payerWallet.address
if(this.payerWallet){
this.payerWalletValue = this.payerWallet.address
} else {
// SharedWallet
this.payerWallet = this.sharedWallet.find((v)=>{return v.sharedWalletAddress === value})
this.payerWalletValue = this.payerWallet.sharedWalletAddress
this.payerWallet.address = this.payerWallet.sharedWalletAddress
}
},
handleSearch() {
if(this.payerWalletType === 'commonWallet' && !this.payerWallet) {
this.$message.error(this.$t('nodeStake.selectIndividualWallet'))
return;
}
if(this.payerWalletType === 'sharedWallet' && !this.payerWallet) {
this.$message.error(this.$t('nodeStake.selectIndividualWallet'))
return;
}
if(this.payerWalletType === 'ledgerWallet' && !this.ledgerWallet.address) {
this.$message.error(this.$t('nodeStake.selectLedgerWallet'))
return;
}
if(this.payerWalletType === 'commonWallet' && this.payerWallet){
this.stakeWallet = this.payerWallet
} else if (this.payerWalletType === 'sharedWallet' && this.payerWallet){
this.stakeWallet = this.payerWallet
} else {
this.stakeWallet = this.ledgerWallet
}
Expand Down