diff --git a/src/views/components/OperationModal/components/Delegate.vue b/src/views/components/OperationModal/components/Delegate.vue
index 2c4d718a..bc4138c2 100644
--- a/src/views/components/OperationModal/components/Delegate.vue
+++ b/src/views/components/OperationModal/components/Delegate.vue
@@ -11,15 +11,7 @@
rules="required"
name="Delegator"
>
-
@@ -176,7 +168,6 @@ export default {
digits,
length,
alphaDash,
- account: [],
}
},
computed: {
diff --git a/src/views/components/OperationModal/components/GovDeposit.vue b/src/views/components/OperationModal/components/GovDeposit.vue
new file mode 100644
index 00000000..8bdf23eb
--- /dev/null
+++ b/src/views/components/OperationModal/components/GovDeposit.vue
@@ -0,0 +1,194 @@
+
+
+
+
+ {{ proposalId }}. {{ proposalTitle }}
+
+
+
+
+
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+ {{ format(item) }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ printDenom() }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/components/OperationModal/components/IBCTransfer.vue b/src/views/components/OperationModal/components/IBCTransfer.vue
new file mode 100644
index 00000000..99b5d4ea
--- /dev/null
+++ b/src/views/components/OperationModal/components/IBCTransfer.vue
@@ -0,0 +1,307 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -- Please select a token --
+
+
+
+ {{ format(item) }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ printDenom() }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
diff --git a/src/views/components/OperationModal/components/Redelegate.vue b/src/views/components/OperationModal/components/Redelegate.vue
index fd70b536..921636e5 100644
--- a/src/views/components/OperationModal/components/Redelegate.vue
+++ b/src/views/components/OperationModal/components/Redelegate.vue
@@ -68,6 +68,7 @@
:options="valOptions"
:reduce="val => val.value"
placeholder="Select a validator"
+ :selectable="(v) => v.value"
/>
@@ -147,13 +148,7 @@ export default {
toValidator: null,
token: '',
amount: null,
- balance: [],
delegations: [],
- feeDenom: '',
- error: null,
- sequence: 1,
- accountNumber: 0,
- account: [],
required,
password,
@@ -170,9 +165,18 @@ export default {
},
computed: {
valOptions() {
+ let options = []
const vals = this.validators.map(x => ({ value: x.operator_address, label: `${x.description.moniker} (${Number(x.commission.rate) * 100}%)` }))
+ if (vals.length > 0) {
+ options.push({ value: null, label: '=== ACTIVE VALIDATORS ===' })
+ options = options.concat(vals)
+ }
const unbunded = this.unbundValidators.map(x => ({ value: x.operator_address, label: `* ${x.description.moniker} (${Number(x.commission.rate) * 100}%)` }))
- return vals.concat(unbunded)
+ if (unbunded.length > 0) {
+ options.push({ value: null, label: '=== INACTIVE VALIDATORS ===', disabled: true })
+ options = options.concat(unbunded)
+ }
+ return options
},
tokenOptions() {
if (!this.delegations) return []
@@ -198,27 +202,18 @@ export default {
modalTitle: 'Redelegate Token',
historyName: 'redelegate',
})
- this.loadBalance()
+ this.loadData()
},
methods: {
- printDenom() {
- return formatTokenDenom(this.token)
- },
- loadBalance() {
+ loadData() {
this.$http.getValidatorList().then(v => {
this.validators = v
})
this.$http.getValidatorUnbondedList().then(v => {
this.unbundValidators = v
})
- this.$http.getBankBalances(this.address).then(res => {
- if (res && res.length > 0) {
- this.balance = res.reverse()
- }
- })
this.$http.getStakingDelegations(this.address).then(res => {
this.delegations = res.delegation_responses
- console.log(res)
this.delegations.forEach(x => {
if (x.delegation.validator_address === this.validatorAddress) {
this.token = x.balance.denom
@@ -233,7 +228,9 @@ export default {
format(v) {
return formatToken(v)
},
-
+ printDenom() {
+ return formatTokenDenom(this.token)
+ },
},
}
diff --git a/src/views/components/OperationModal/components/Transfer.vue b/src/views/components/OperationModal/components/Transfer.vue
new file mode 100644
index 00000000..53bc5d4c
--- /dev/null
+++ b/src/views/components/OperationModal/components/Transfer.vue
@@ -0,0 +1,204 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+ {{ format(item) }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ {{ printDenom() }}
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
diff --git a/src/views/components/OperationModal/components/Unbond.vue b/src/views/components/OperationModal/components/Unbond.vue
index 76c6b299..2882a100 100644
--- a/src/views/components/OperationModal/components/Unbond.vue
+++ b/src/views/components/OperationModal/components/Unbond.vue
@@ -105,7 +105,6 @@ export default {
vSelect,
BInputGroupAppend,
ValidationProvider,
-
},
props: {
validatorAddress: {
@@ -120,10 +119,8 @@ export default {
data() {
return {
validators: [],
- selectedValidator: this.validatorAddress,
token: '',
amount: null,
- balance: [],
delegations: [],
required,
@@ -167,24 +164,16 @@ export default {
modalTitle: 'Unbond Token',
historyName: 'unbond',
})
- this.loadBalance()
+ this.loadData()
},
methods: {
- printDenom() {
- return formatTokenDenom(this.token)
- },
- loadBalance() {
+ loadData() {
if (this.address) {
this.$http.getValidatorList().then(v => {
this.validators = v
})
}
- this.$http.getBankBalances(this.address).then(res => {
- if (res && res.length > 0) {
- this.balance = res.reverse()
- }
- })
this.$http.getStakingDelegations(this.address).then(res => {
this.delegations = res.delegation_responses
this.delegations.forEach(x => {
@@ -197,7 +186,9 @@ export default {
})
})
},
-
+ printDenom() {
+ return formatTokenDenom(this.token)
+ },
},
}
diff --git a/src/views/components/OperationModal/components/Vote.vue b/src/views/components/OperationModal/components/Vote.vue
new file mode 100644
index 00000000..f25e0029
--- /dev/null
+++ b/src/views/components/OperationModal/components/Vote.vue
@@ -0,0 +1,166 @@
+
+
+
+
+ {{ proposalId }}. {{ proposalTitle }}
+
+
+
+
+
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
+
+ Yes
+
+
+ No
+
+
+ No With Veto
+
+
+ Abstain
+
+
+ {{ errors[0] }}
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/components/OperationModal/components/Withdraw.vue b/src/views/components/OperationModal/components/Withdraw.vue
index f4a2e81d..331748c5 100644
--- a/src/views/components/OperationModal/components/Withdraw.vue
+++ b/src/views/components/OperationModal/components/Withdraw.vue
@@ -7,16 +7,8 @@
label-for="Account"
>
-
-
-
@@ -28,15 +20,8 @@
diff --git a/src/views/components/OperationModal/components/WithdrawCommission.vue b/src/views/components/OperationModal/components/WithdrawCommission.vue
new file mode 100644
index 00000000..487a8a65
--- /dev/null
+++ b/src/views/components/OperationModal/components/WithdrawCommission.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/components/OperationModal/index.vue b/src/views/components/OperationModal/index.vue
index ccb50702..d1a28649 100644
--- a/src/views/components/OperationModal/index.vue
+++ b/src/views/components/OperationModal/index.vue
@@ -4,7 +4,7 @@
centered
size="md"
:title="modalTitle"
- ok-title="Send"
+ :ok-title="actionName"
hide-header-close
scrollable
:ok-disabled="isOwner"
@@ -40,9 +40,11 @@
@@ -155,6 +157,11 @@ import Delegate from './components/Delegate.vue'
import Redelegate from './components/Redelegate.vue'
import Withdraw from './components/Withdraw.vue'
import Unbond from './components/Unbond.vue'
+import Transfer from './components/Transfer.vue'
+import IBCTransfer from './components/IBCTransfer.vue'
+import Vote from './components/Vote.vue'
+import WithdrawCommission from './components/WithdrawCommission.vue'
+import GovDeposit from './components/GovDeposit.vue'
export default {
name: 'DelegateDialogue',
@@ -184,6 +191,11 @@ export default {
Redelegate,
Withdraw,
Unbond,
+ Transfer,
+ IBCTransfer,
+ Vote,
+ WithdrawCommission,
+ GovDeposit,
},
directives: {
Ripple,
@@ -201,12 +213,19 @@ export default {
type: String,
default: null,
},
+ proposalId: {
+ type: Number,
+ default: null,
+ },
+ proposalTitle: {
+ type: String,
+ default: null,
+ },
},
data() {
return {
modalTitle: '',
historyName: '',
- selectedAddress: this.address,
selectedValidator: null,
selectedChain: null,
token: '',
@@ -222,7 +241,8 @@ export default {
wallet: 'ledgerUSB',
gas: '200000',
memo: '',
- blockingMsg: 'No available account found.',
+ blockingMsg: this.address ? 'You are not the owner' : 'No available account found.',
+ actionName: 'Send',
required,
password,
@@ -242,16 +262,27 @@ export default {
if (!this.balance) return []
return this.balance.filter(item => !item.denom.startsWith('ibc'))
},
- isOwner() {
+ accounts() {
const accounts = getLocalAccounts()
const selectedWallet = this.$store.state.chains.defaultWallet
- if (accounts && accounts[selectedWallet]) {
- if (accounts[selectedWallet].address.findIndex(x => x.addr === this.address) > -1) {
+ return accounts[selectedWallet]
+ },
+ isOwner() {
+ if (this.accounts) {
+ if (this.accounts.address.findIndex(x => x.addr === this.selectedAddress) > -1) {
return false
}
}
return true
},
+ selectedAddress() {
+ if (this.address) {
+ return this.address
+ }
+ const chain = this.$store.state.chains.selected.chain_name
+ const selectedAddress = this.accounts.address.find(x => x.chain === chain)
+ return selectedAddress?.addr
+ },
},
methods: {
initialize() {