getumbrel / umbrel-lightning

The official Lightning Node app for Umbrel, powered by LND.

Home Page:https://umbrel.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Action language inconsistency

StevenBlack opened this issue · comments

Is this by design? It seems odd that these are different.

2021-01-26_22-24-19

If you're seeking opinion, I prefer "Send" and "Receive".

Because Bitcoin is the unbank if ever there was.

commented

Send and Receive gets my vote as well as an innocent bystander.

Notes

Documentation and website

There appears to be no screen captures to redo if this is implemented.

There are probably localization side effects.

Source code

The source is rife with withdraw and deposit naming semantics. If I was PM I might be tempted to mod the source as well, to reduce potential future confusion and avert technical debt. The following explores that option.

The following ack statements were run in the root of all the following repos. Only umbrel-dashboard appears affected.

$ ls -l 

umbrel
umbrel-dashboard
umbrel-dev
umbrel-manager
umbrel-middleware
umbrel-os
umbrel-website

Search results — broad overview:

Broad Summary:

$ ack -l deposit
umbrel-dashboard/src/components/BitcoinWallet.vue
umbrel-dashboard/src/store/modules/bitcoin.js

$ ack -l withdraw
umbrel-dashboard/src/components/BitcoinWallet.vue
umbrel-dashboard/src/components/Channels/Manage.vue
umbrel-dashboard/src/store/modules/bitcoin.js
umbrel-dashboard/src/views/Settings.vue

Search results — detailed overview:

deposit

$ ack deposit

umbrel-dashboard/src/components/BitcoinWallet.vue
463:        <!-- SCREEN/MODE: Show Deposit Address -->
465:          class="wallet-mode mode-deposit"
466:          v-else-if="this.mode === 'deposit'"
467:          key="mode-deposit"
499:            <!-- Deposit Address QR Code -->
502:              :value="depositAddress"
510:              :value="depositAddress"
550:          @click="changeMode('deposit')"
564:          >Deposit
636:      mode: "transactions", //transactions (default mode), deposit, withdraw, review-withdraw, withdrawn
668:      depositAddress: state => state.bitcoin.depositAddress,
716:      //on deposit mode, get new btc address
717:      if (mode === "deposit") {
718:        await this.$store.dispatch("bitcoin/getDepositAddress");
umbrel-dashboard/src/store/modules/bitcoin.js
23:  depositAddress: "",
176:  depositAddress(state, address) {
177:    state.depositAddress = address;
396:  async getDepositAddress({ commit, state }) {
403:        commit("depositAddress", address);
473:          description = "Deposit";

withdraw

$ ack withdraw

1:umbrel-dashboard/src/components/BitcoinWallet.vue:219:        <!-- SCREEN/MODE: Withdraw Screen -->
2:umbrel-dashboard/src/components/BitcoinWallet.vue:222:          v-else-if="mode === 'withdraw'"
3:umbrel-dashboard/src/components/BitcoinWallet.vue:223:          key="mode-withdraw"
4:umbrel-dashboard/src/components/BitcoinWallet.vue:250:                <label class="sr-onlsy" for="input-withdrawal-amount"
5:umbrel-dashboard/src/components/BitcoinWallet.vue:253:                <b-form-checkbox v-model="withdraw.sweep" size="sm" switch>
6:umbrel-dashboard/src/components/BitcoinWallet.vue:259:                  id="input-withdrawal-amount"
7:umbrel-dashboard/src/components/BitcoinWallet.vue:263:                  v-model="withdraw.amountInput"
8:umbrel-dashboard/src/components/BitcoinWallet.vue:265:                  @input="fetchWithdrawalFees"
9:umbrel-dashboard/src/components/BitcoinWallet.vue:267:                  :disabled="withdraw.sweep"
10:umbrel-dashboard/src/components/BitcoinWallet.vue:280:                  :style="{ opacity: withdraw.amount > 0 ? 1 : 0 }"
11:umbrel-dashboard/src/components/BitcoinWallet.vue:281:                  >~ {{ withdraw.amount | satsToUSD }}</small
12:umbrel-dashboard/src/components/BitcoinWallet.vue:286:            <label class="sr-onlsy" for="input-withdrawal-address"
13:umbrel-dashboard/src/components/BitcoinWallet.vue:290:              id="input-withdrawal-address"
14:umbrel-dashboard/src/components/BitcoinWallet.vue:295:              v-model="withdraw.address"
15:umbrel-dashboard/src/components/BitcoinWallet.vue:296:              @input="fetchWithdrawalFees"
16:umbrel-dashboard/src/components/BitcoinWallet.vue:302:              :disabled="!withdraw.amount || !withdraw.address"
17:umbrel-dashboard/src/components/BitcoinWallet.vue:303:              @change="selectWithdrawalFee"
18:umbrel-dashboard/src/components/BitcoinWallet.vue:308:        <!-- SCREEN/MODE: Review Withdrawal -->
19:umbrel-dashboard/src/components/BitcoinWallet.vue:311:          v-else-if="mode === 'review-withdraw'"
20:umbrel-dashboard/src/components/BitcoinWallet.vue:312:          key=" ode-review-withdraw"
21:umbrel-dashboard/src/components/BitcoinWallet.vue:338:              <h3 class="mb-0">{{ withdraw.amount | unit | localize }}</h3>
22:umbrel-dashboard/src/components/BitcoinWallet.vue:343:                >~ {{ withdraw.amount | satsToUSD }}</small
23:umbrel-dashboard/src/components/BitcoinWallet.vue:360:              <b class="d-block mt-3">{{ withdraw.address }}</b>
24:umbrel-dashboard/src/components/BitcoinWallet.vue:364:              v-if="withdraw.selectedFee.type === 'custom'"
25:umbrel-dashboard/src/components/BitcoinWallet.vue:368:                  {{ withdraw.selectedFee.satPerByte }}
26:umbrel-dashboard/src/components/BitcoinWallet.vue:377:                      parseInt(withdraw.selectedFee.satPerByte, 10))
27:umbrel-dashboard/src/components/BitcoinWallet.vue:394:                    fees[withdraw.selectedFee.type]["total"] | unit | localize
28:umbrel-dashboard/src/components/BitcoinWallet.vue:401:                  {{ fees[withdraw.selectedFee.type]["total"] | satsToUSD }}
29:umbrel-dashboard/src/components/BitcoinWallet.vue:415:        <!-- SCREEN/MODE: Successfully Withdrawn -->
30:umbrel-dashboard/src/components/BitcoinWallet.vue:417:          class="wallet-mode mode-withdrawn"
31:umbrel-dashboard/src/components/BitcoinWallet.vue:418:          v-else-if="mode === 'withdrawn'"
32:umbrel-dashboard/src/components/BitcoinWallet.vue:419:          key=" mode-withdrawn"
33:umbrel-dashboard/src/components/BitcoinWallet.vue:450:                Successfully withdrawn
34:umbrel-dashboard/src/components/BitcoinWallet.vue:452:                  {{ withdraw.amount | unit | localize }}
35:umbrel-dashboard/src/components/BitcoinWallet.vue:459:            <input-copy size="sm" :value="withdraw.txHash"></input-copy>
36:umbrel-dashboard/src/components/BitcoinWallet.vue:530:          @click="changeMode('withdraw')"
37:umbrel-dashboard/src/components/BitcoinWallet.vue:544:          >Withdraw
38:umbrel-dashboard/src/components/BitcoinWallet.vue:571:        @click="changeMode('review-withdraw')"
39:umbrel-dashboard/src/components/BitcoinWallet.vue:572:        v-else-if="mode === 'withdraw'"
40:umbrel-dashboard/src/components/BitcoinWallet.vue:574:          !!error || !withdraw.amount || !withdraw.address || withdraw.isTyping
41:umbrel-dashboard/src/components/BitcoinWallet.vue:576:        >Review Withdrawal</b-button
42:umbrel-dashboard/src/components/BitcoinWallet.vue:582:        @click="withdrawBtc"
43:umbrel-dashboard/src/components/BitcoinWallet.vue:583:        :disabled="withdraw.isWithdrawing || !!error"
44:umbrel-dashboard/src/components/BitcoinWallet.vue:584:        v-else-if="mode === 'review-withdraw'"
45:umbrel-dashboard/src/components/BitcoinWallet.vue:587:          this.withdraw.isWithdrawing ? "Withdrawing..." : "Confirm Withdrawal"
46:umbrel-dashboard/src/components/BitcoinWallet.vue:594:        :disabled="withdraw.isWithdrawing"
47:umbrel-dashboard/src/components/BitcoinWallet.vue:595:        v-else-if="mode === 'withdrawn'"
48:umbrel-dashboard/src/components/BitcoinWallet.vue:596:        :href="getTxUrl(withdraw.txHash)"
49:umbrel-dashboard/src/components/BitcoinWallet.vue:636:      mode: "transactions", //transactions (default mode), deposit, withdraw, review-withdraw, withdrawn
50:umbrel-dashboard/src/components/BitcoinWallet.vue:637:      withdraw: {
51:umbrel-dashboard/src/components/BitcoinWallet.vue:639:        amount: "", //withdrawal amount
52:umbrel-dashboard/src/components/BitcoinWallet.vue:640:        address: "", //withdrawal address
53:umbrel-dashboard/src/components/BitcoinWallet.vue:644:        isWithdrawing: false, //awaiting api response for withdrawal request?
54:umbrel-dashboard/src/components/BitcoinWallet.vue:645:        txHash: "", //tx hash of withdrawal tx,
55:umbrel-dashboard/src/components/BitcoinWallet.vue:646:        selectedFee: { type: "normal", satPerByte: 0 } //selected withdrawal fee
56:umbrel-dashboard/src/components/BitcoinWallet.vue:677:      if (this.withdraw.sweep) {
57:umbrel-dashboard/src/components/BitcoinWallet.vue:681:      if (this.withdraw.selectedFee.type !== "custom") {
58:umbrel-dashboard/src/components/BitcoinWallet.vue:684:          this.withdraw.amount -
59:umbrel-dashboard/src/components/BitcoinWallet.vue:685:          this.fees[this.withdraw.selectedFee.type].total;
60:umbrel-dashboard/src/components/BitcoinWallet.vue:690:          this.withdraw.amount -
61:umbrel-dashboard/src/components/BitcoinWallet.vue:693:            parseInt(this.withdraw.selectedFee.satPerByte, 10);
62:umbrel-dashboard/src/components/BitcoinWallet.vue:714:      //change between different modes/screens of the wallet from - transactions (default), withdraw, withdrawan, depsoit
63:umbrel-dashboard/src/components/BitcoinWallet.vue:728:      //in case going back from review withdrawal to edit withdrwal
64:umbrel-dashboard/src/components/BitcoinWallet.vue:729:      if (this.mode === "review-withdraw") {
65:umbrel-dashboard/src/components/BitcoinWallet.vue:732:        this.mode = "withdraw";
66:umbrel-dashboard/src/components/BitcoinWallet.vue:737:      this.withdraw = {
67:umbrel-dashboard/src/components/BitcoinWallet.vue:743:        isWithdrawing: false,
68:umbrel-dashboard/src/components/BitcoinWallet.vue:752:    async fetchWithdrawalFees() {
69:umbrel-dashboard/src/components/BitcoinWallet.vue:753:      if (this.withdraw.feesTimeout) {
70:umbrel-dashboard/src/components/BitcoinWallet.vue:754:        clearTimeout(this.withdraw.feesTimeout);
71:umbrel-dashboard/src/components/BitcoinWallet.vue:756:      this.withdraw.isTyping = true;
72:umbrel-dashboard/src/components/BitcoinWallet.vue:758:      this.withdraw.feesTimeout = setTimeout(async () => {
73:umbrel-dashboard/src/components/BitcoinWallet.vue:760:        if (this.withdraw.amount && this.withdraw.address) {
74:umbrel-dashboard/src/components/BitcoinWallet.vue:762:            address: this.withdraw.address,
75:umbrel-dashboard/src/components/BitcoinWallet.vue:764:            sweep: this.withdraw.sweep
76:umbrel-dashboard/src/components/BitcoinWallet.vue:767:          if (!this.withdraw.sweep) {
77:umbrel-dashboard/src/components/BitcoinWallet.vue:768:            params.amt = this.withdraw.amount;
78:umbrel-dashboard/src/components/BitcoinWallet.vue:776:              this.fees[this.withdraw.selectedFee.type] &&
79:umbrel-dashboard/src/components/BitcoinWallet.vue:777:              this.fees[this.withdraw.selectedFee.type].error.code
80:umbrel-dashboard/src/components/BitcoinWallet.vue:779:              this.error = this.fees[this.withdraw.selectedFee.type].error.text;
81:umbrel-dashboard/src/components/BitcoinWallet.vue:783:            // if (this.withdraw.sweep) {
82:umbrel-dashboard/src/components/BitcoinWallet.vue:789:        this.withdraw.isTyping = false;
83:umbrel-dashboard/src/components/BitcoinWallet.vue:792:    selectWithdrawalFee(fee) {
84:umbrel-dashboard/src/components/BitcoinWallet.vue:793:      this.withdraw.selectedFee = fee;
85:umbrel-dashboard/src/components/BitcoinWallet.vue:795:    async withdrawBtc() {
86:umbrel-dashboard/src/components/BitcoinWallet.vue:797:      this.withdraw.isWithdrawing = true;
87:umbrel-dashboard/src/components/BitcoinWallet.vue:800:        addr: this.withdraw.address,
88:umbrel-dashboard/src/components/BitcoinWallet.vue:801:        amt: this.withdraw.amount,
89:umbrel-dashboard/src/components/BitcoinWallet.vue:802:        satPerByte: parseInt(this.withdraw.selectedFee.satPerByte, 10),
90:umbrel-dashboard/src/components/BitcoinWallet.vue:803:        sendAll: this.withdraw.sweep
91:umbrel-dashboard/src/components/BitcoinWallet.vue:811:        const withdrawTx = res.data;
92:umbrel-dashboard/src/components/BitcoinWallet.vue:812:        this.withdraw.txHash = withdrawTx.txid;
93:umbrel-dashboard/src/components/BitcoinWallet.vue:813:        this.changeMode("withdrawn");
94:umbrel-dashboard/src/components/BitcoinWallet.vue:822:      this.withdraw.isWithdrawing = false;
95:umbrel-dashboard/src/components/BitcoinWallet.vue:826:    "withdraw.amountInput": function(val) {
96:umbrel-dashboard/src/components/BitcoinWallet.vue:828:        this.withdraw.amount = Number(val);
97:umbrel-dashboard/src/components/BitcoinWallet.vue:830:        this.withdraw.amount = btcToSats(val);
98:umbrel-dashboard/src/components/BitcoinWallet.vue:832:      this.fetchWithdrawalFees();
99:umbrel-dashboard/src/components/BitcoinWallet.vue:834:    "withdraw.sweep": async function(val) {
100:umbrel-dashboard/src/components/BitcoinWallet.vue:837:          this.withdraw.amountInput = String(this.confirmedBtcBalance);
101:umbrel-dashboard/src/components/BitcoinWallet.vue:839:          this.withdraw.amountInput = String(
102:umbrel-dashboard/src/components/BitcoinWallet.vue:844:        this.fetchWithdrawalFees();
103:umbrel-dashboard/src/components/BitcoinWallet.vue:849:        this.withdraw.amount = Number(this.withdraw.amountInput);
104:umbrel-dashboard/src/components/BitcoinWallet.vue:851:        this.withdraw.amount = btcToSats(this.withdraw.amountInput);
105:umbrel-dashboard/src/components/BitcoinWallet.vue:853:      this.fetchWithdrawalFees();
106:umbrel-dashboard/src/components/Channels/Manage.vue:109:          <span class="text-muted">Withdrawal Timelock</span>
107:umbrel-dashboard/src/store/modules/bitcoin.js:471:          description = "Withdrawal";
108:umbrel-dashboard/src/views/Settings.vue:203:                  <label class="sr-onlsy" for="input-withdrawal-amount">Current password</label>
109:umbrel-dashboard/src/views/Settings.vue:212:                  <label class="sr-onlsy" for="input-withdrawal-amount">New password</label>
110:umbrel-dashboard/src/views/Settings.vue:221:                  <label class="sr-onlsy" for="input-withdrawal-amount">Confirm new password</label>
111:ratface.txt:49:umbrel-dashboard/src/components/BitcoinWallet.vue:636:      mode: "transactions", //transactions (default mode), deposit, withdraw, review-withdraw, withdrawn
121:umbrel-dashboard/src/components/BitcoinWallet.vue:636:      mode: "transactions", //transactions (default mode), deposit, withdraw, review-withdraw, withdrawn

umbrel-dashboard/src/components/BitcoinWallet.vue
219:        <!-- SCREEN/MODE: Withdraw Screen -->
222:          v-else-if="mode === 'withdraw'"
223:          key="mode-withdraw"
250:                <label class="sr-onlsy" for="input-withdrawal-amount"
253:                <b-form-checkbox v-model="withdraw.sweep" size="sm" switch>
259:                  id="input-withdrawal-amount"
263:                  v-model="withdraw.amountInput"
265:                  @input="fetchWithdrawalFees"
267:                  :disabled="withdraw.sweep"
280:                  :style="{ opacity: withdraw.amount > 0 ? 1 : 0 }"
281:                  >~ {{ withdraw.amount | satsToUSD }}</small
286:            <label class="sr-onlsy" for="input-withdrawal-address"
290:              id="input-withdrawal-address"
295:              v-model="withdraw.address"
296:              @input="fetchWithdrawalFees"
302:              :disabled="!withdraw.amount || !withdraw.address"
303:              @change="selectWithdrawalFee"
308:        <!-- SCREEN/MODE: Review Withdrawal -->
311:          v-else-if="mode === 'review-withdraw'"
312:          key=" ode-review-withdraw"
338:              <h3 class="mb-0">{{ withdraw.amount | unit | localize }}</h3>
343:                >~ {{ withdraw.amount | satsToUSD }}</small
360:              <b class="d-block mt-3">{{ withdraw.address }}</b>
364:              v-if="withdraw.selectedFee.type === 'custom'"
368:                  {{ withdraw.selectedFee.satPerByte }}
377:                      parseInt(withdraw.selectedFee.satPerByte, 10))
394:                    fees[withdraw.selectedFee.type]["total"] | unit | localize
401:                  {{ fees[withdraw.selectedFee.type]["total"] | satsToUSD }}
415:        <!-- SCREEN/MODE: Successfully Withdrawn -->
417:          class="wallet-mode mode-withdrawn"
418:          v-else-if="mode === 'withdrawn'"
419:          key=" mode-withdrawn"
450:                Successfully withdrawn
452:                  {{ withdraw.amount | unit | localize }}
459:            <input-copy size="sm" :value="withdraw.txHash"></input-copy>
530:          @click="changeMode('withdraw')"
544:          >Withdraw
571:        @click="changeMode('review-withdraw')"
572:        v-else-if="mode === 'withdraw'"
574:          !!error || !withdraw.amount || !withdraw.address || withdraw.isTyping
576:        >Review Withdrawal</b-button
582:        @click="withdrawBtc"
583:        :disabled="withdraw.isWithdrawing || !!error"
584:        v-else-if="mode === 'review-withdraw'"
587:          this.withdraw.isWithdrawing ? "Withdrawing..." : "Confirm Withdrawal"
594:        :disabled="withdraw.isWithdrawing"
595:        v-else-if="mode === 'withdrawn'"
596:        :href="getTxUrl(withdraw.txHash)"
636:      mode: "transactions", //transactions (default mode), deposit, withdraw, review-withdraw, withdrawn
637:      withdraw: {
639:        amount: "", //withdrawal amount
640:        address: "", //withdrawal address
644:        isWithdrawing: false, //awaiting api response for withdrawal request?
645:        txHash: "", //tx hash of withdrawal tx,
646:        selectedFee: { type: "normal", satPerByte: 0 } //selected withdrawal fee
677:      if (this.withdraw.sweep) {
681:      if (this.withdraw.selectedFee.type !== "custom") {
684:          this.withdraw.amount -
685:          this.fees[this.withdraw.selectedFee.type].total;
690:          this.withdraw.amount -
693:            parseInt(this.withdraw.selectedFee.satPerByte, 10);
714:      //change between different modes/screens of the wallet from - transactions (default), withdraw, withdrawan, depsoit
728:      //in case going back from review withdrawal to edit withdrwal
729:      if (this.mode === "review-withdraw") {
732:        this.mode = "withdraw";
737:      this.withdraw = {
743:        isWithdrawing: false,
752:    async fetchWithdrawalFees() {
753:      if (this.withdraw.feesTimeout) {
754:        clearTimeout(this.withdraw.feesTimeout);
756:      this.withdraw.isTyping = true;
758:      this.withdraw.feesTimeout = setTimeout(async () => {
760:        if (this.withdraw.amount && this.withdraw.address) {
762:            address: this.withdraw.address,
764:            sweep: this.withdraw.sweep
767:          if (!this.withdraw.sweep) {
768:            params.amt = this.withdraw.amount;
776:              this.fees[this.withdraw.selectedFee.type] &&
777:              this.fees[this.withdraw.selectedFee.type].error.code
779:              this.error = this.fees[this.withdraw.selectedFee.type].error.text;
783:            // if (this.withdraw.sweep) {
789:        this.withdraw.isTyping = false;
792:    selectWithdrawalFee(fee) {
793:      this.withdraw.selectedFee = fee;
795:    async withdrawBtc() {
797:      this.withdraw.isWithdrawing = true;
800:        addr: this.withdraw.address,
801:        amt: this.withdraw.amount,
802:        satPerByte: parseInt(this.withdraw.selectedFee.satPerByte, 10),
803:        sendAll: this.withdraw.sweep
811:        const withdrawTx = res.data;
812:        this.withdraw.txHash = withdrawTx.txid;
813:        this.changeMode("withdrawn");
822:      this.withdraw.isWithdrawing = false;
826:    "withdraw.amountInput": function(val) {
828:        this.withdraw.amount = Number(val);
830:        this.withdraw.amount = btcToSats(val);
832:      this.fetchWithdrawalFees();
834:    "withdraw.sweep": async function(val) {
837:          this.withdraw.amountInput = String(this.confirmedBtcBalance);
839:          this.withdraw.amountInput = String(
844:        this.fetchWithdrawalFees();
849:        this.withdraw.amount = Number(this.withdraw.amountInput);
851:        this.withdraw.amount = btcToSats(this.withdraw.amountInput);
853:      this.fetchWithdrawalFees();

umbrel-dashboard/src/components/Channels/Manage.vue
109:          <span class="text-muted">Withdrawal Timelock</span>

umbrel-dashboard/src/store/modules/bitcoin.js
471:          description = "Withdrawal";

umbrel-dashboard/src/views/Settings.vue
203:                  <label class="sr-onlsy" for="input-withdrawal-amount">Current password</label>
212:                  <label class="sr-onlsy" for="input-withdrawal-amount">New password</label>
221:                  <label class="sr-onlsy" for="input-withdrawal-amount">Confirm new password</label>

My recommendation given the above ⬆️⬆️⬆️: Do only the UI. Leave the source with deposit and withdraw naming semantics.