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

235 transfer memo #241

Merged
merged 2 commits into from
Sep 10, 2018
Merged
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
65 changes: 33 additions & 32 deletions client/components/ConfirmTransactions/ConfirmTransactions.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
<template lang="pug">
#approve_update_portfolio.main_padding

.transaction_info
template(v-if="hasOrders")
p._value(v-for="order in orders")
PlaceOrderInfo(:item="order", :min="true" :fiat-id="fiatId")
p._value
p._value Transaction fee: {{ totalOrderFees.base }} BTS ({{ totalOrderFees.fiat }}$)
.transaction_info
template(v-if="hasOrders")
p._value(v-for="order in orders")
PlaceOrderInfo(:item="order", :min="true" :fiat-id="fiatId")
p._value
p._value Transaction fee: {{ totalOrderFees.base }} BTS ({{ totalOrderFees.fiat }}$)

template(v-if="hasPendingTransfer")
template(v-if="isWithdraw")
p._value(v-if="isWithdraw") Withdraw {{ withdraw.amount}} {{ transfer.asset.symbol }} to {{ withdraw.address }}
p
p._value Withdrawal fee {{ withdraw.fee }} {{ transfer.asset.symbol }}
p._value Transaction fee {{ withdrawFee }} BTS
template(v-else)
p._value Send {{ transfer.realamount }} {{ transfer.asset.symbol }} to {{ transfer.to }}
p
p._value Transaction fee {{ transferFee.base }} BTS ({{ transferFee.fiat }}$)
template(v-if="hasPendingTransfer")
template(v-if="isWithdraw")
p._value(v-if="isWithdraw") Withdraw {{ withdraw.amount}} {{ transfer.asset.symbol }} to {{ withdraw.address }}
p
p._value Withdrawal fee {{ withdraw.fee }} {{ transfer.asset.symbol }}
p._value Transaction fee {{ withdrawFee }} BTS
template(v-else)
p._value Send {{ transfer.realamount }} {{ transfer.asset.symbol }} to {{ transfer.to }}
p
p._value(v-if="transfer.memo") With memo: {{ transfer.memo }}
p._value Transaction fee {{ transferFee.base }} BTS ({{ transferFee.fiat }}$)


TrustyInput(
label="ENTER PIN TO CONFIRM",
v-show="isLocked",
v-model="pin",
inputType="tel")
TrustyInput(
label="ENTER PIN TO CONFIRM",
v-show="isLocked",
v-model="pin",
inputType="tel")

.trusty_inline_buttons._one_button(:class="{'_disabled': pending}")
button(v-show="!pending" @click="confirm") CONFIRM
button(v-show="pending")
Spinner(size="small" :absolute="false")
div Processing...
.trusty_inline_buttons._one_button(:class="{'_disabled': pending}")
button(v-show="!pending" @click="confirm") CONFIRM
button(v-show="pending")
Spinner(size="small" :absolute="false")
div Processing...

</template>

Expand Down Expand Up @@ -79,10 +80,10 @@ export default {
return this.pendingOrders.buyOrders;
},
transfer() {
const { assetId, amount, to } = this.pendingTransfer;
const { assetId, amount, to, memo } = this.pendingTransfer;
const asset = this.getAssetById(assetId);
const realamount = (amount * (10 ** -asset.precision)).toFixed(asset.precision);
return { asset, realamount, to };
return { asset, realamount, to, memo };
},
withdrawFee() {
const fee = this.getMemoFee(this.withdraw.memo);
Expand Down Expand Up @@ -168,7 +169,7 @@ export default {
const params = {
to: this.pendingTransfer.to,
assetId: this.pendingTransfer.assetId,
amount: this.pendingTransfer.amount
amount: this.pendingTransfer.amount,
};

if (this.pendingTransfer.memo) {
Expand Down Expand Up @@ -199,12 +200,12 @@ export default {

<style lang="scss">
p._value {
padding-top: 1vw;
padding-top: 1vw;
}
.trusty_inline_buttons._one_button {
padding-top: 5vw;
padding-top: 5vw;
}
#approve_update_portfolio .transaction_info {
flex-direction: column;
flex-direction: column;
}
</style>
63 changes: 36 additions & 27 deletions client/components/DepositWithdraw/Bitshares/Withdraw.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
<template lang="pug">

.withdraw-transfer-container
p
TrustyInput(
label="enter receiver's address",
v-model="name",
:validate="$v.name.$touch",
inputClass="recepient-input")
.trusty_font_error(v-if="!$v.name.required && this.$v.name.$dirty") Enter account name
.trusty_font_error(v-if="!$v.name.isUnique && !this.$v.$pending && this.$v.name.$dirty") No such user
.trusty_font_error(v-if="!$v.name.notSelf && this.$v.name.$dirty") Can't send to yourself
._yellow.trusty_ps_text
| IMPORTANT: Please send {{ getAssetById(coin).symbol }} only to
br
| BitShares account using this payment method
.trusty_inline_buttons._mob
button(:class="{'_disable': !enableButton }", @click="sendFunds") Confirm
button(@click="$router.replace('/')") Cancel
p.trusty_ps_text
| Payments using BitShares
br
| are done directly at 0.0016$ fixed fee
p
TrustyInput(
label="enter receiver's address",
v-model="name",
:validate="$v.name.$touch",
inputClass="recepient-input")


.trusty_font_error(v-if="!$v.name.required && this.$v.name.$dirty") Enter account name
.trusty_font_error(v-if="!$v.name.isUnique && !this.$v.$pending && this.$v.name.$dirty") No such user
.trusty_font_error(v-if="!$v.name.notSelf && this.$v.name.$dirty") Can't send to yourself
p
TrustyInput(
label="Memo",
v-model="memo",
inputClass="recepient-input")
._yellow.trusty_ps_text
| IMPORTANT: Please send {{ getAssetById(coin).symbol }} only to
br
| BitShares account using this payment method
.trusty_inline_buttons._mob
button(:class="{'_disable': !enableButton }", @click="sendFunds") Confirm
button(@click="$router.replace('/')") Cancel
p.trusty_ps_text
| Payments using BitShares
br
| are done directly at 0.0016$ fixed fee

</template>

Expand All @@ -47,7 +54,8 @@ export default {
},
data() {
return {
name: ''
name: '',
memo: ''
};
},
validations: {
Expand Down Expand Up @@ -84,7 +92,8 @@ export default {
const transaction = {
assetId: this.coin,
amount: this.amount,
to: this.name.toLowerCase()
to: this.name.toLowerCase(),
memo: this.memo
};
this.setTransaction({ transaction });
this.$router.push({ name: 'confirm-transactions' });
Expand All @@ -97,14 +106,14 @@ export default {

<style lang="scss">
button._disable {
pointer-events: none;
opacity: 0.5;
pointer-events: none;
opacity: 0.5;
}

.withdraw-transfer-container {
.recepient-input {
text-transform: lowercase;
}
.recepient-input {
text-transform: lowercase;
}
}
</style>