diff --git a/src/utils/blocktank/index.ts b/src/utils/blocktank/index.ts index df41df57d..e9917a446 100644 --- a/src/utils/blocktank/index.ts +++ b/src/utils/blocktank/index.ts @@ -171,8 +171,8 @@ export const getCJitEntry = async (entryId: string): Promise => { */ export const getOrder = async (orderId: string): Promise> => { try { - const orderState = await bt.getOrder(orderId); - return ok(orderState); + const order = await bt.getOrder(orderId); + return ok(order); } catch (e) { return err(e); } @@ -317,52 +317,44 @@ export const getStateMessage = (order: IBtOrder): string => { const channelState: BtOpenChannelState | undefined = order.channel?.state; switch (orderState) { - case 'expired': + case BtOrderState.EXPIRED: return i18n.t('lightning:order_state.expired'); } switch (paymentState) { - case 'refunded': + case BtPaymentState.REFUNDED: return i18n.t('lightning:order_state.refunded'); } if (channelState) { switch (channelState) { - case 'opening': + case BtOpenChannelState.OPENING: return i18n.t('lightning:order_state.opening'); - case 'open': + case BtOpenChannelState.OPEN: return i18n.t('lightning:order_state.open'); - case 'closed': + case BtOpenChannelState.CLOSED: return i18n.t('lightning:order_state.closed'); } } switch (orderState) { - case 'closed': + case BtOrderState.CLOSED: return i18n.t('lightning:order_state.closed'); - case 'open': + case BtOrderState.OPEN: return i18n.t('lightning:order_state.open'); - case 'created': - return i18n.t('lightning:order_state.awaiting_payment'); } switch (paymentState) { - case 'created': + case BtPaymentState.CREATED: return i18n.t('lightning:order_state.awaiting_payment'); - case 'paid': + case BtPaymentState.PAID: return i18n.t('lightning:order_state.paid'); } switch (orderState) { - case 'closed': - return i18n.t('lightning:order_state.closed'); - case 'open': - return i18n.t('lightning:order_state.open'); - case 'created': + case BtOrderState.CREATED: return i18n.t('lightning:order_state.awaiting_payment'); } - - return 'Unknown state'; }; /** diff --git a/src/utils/i18n/locales/en/wallet.json b/src/utils/i18n/locales/en/wallet.json index 93fa964b0..faab82820 100644 --- a/src/utils/i18n/locales/en/wallet.json +++ b/src/utils/i18n/locales/en/wallet.json @@ -157,7 +157,7 @@ "other": "Other" }, "details_savings_title": "Savings Balance", - "details_savings_subtitle": "On-chain BTC", + "details_savings_subtitle": "BTC", "details_spending_title": "Spending Balance", "details_spending_subtitle": "Instant BTC", "tx_invalid": "Transaction Invalid", diff --git a/src/utils/i18n/locales/ru/wallet.json b/src/utils/i18n/locales/ru/wallet.json index 879406bf1..02839f1d8 100644 --- a/src/utils/i18n/locales/ru/wallet.json +++ b/src/utils/i18n/locales/ru/wallet.json @@ -109,7 +109,7 @@ "other": "Другие" }, "details_savings_title": "Баланс Сбережений", - "details_savings_subtitle": "On-chain BTC", + "details_savings_subtitle": "BTC", "details_spending_title": "Баланс Расходов", "details_spending_subtitle": "Мгновенные BTC", "tx_invalid": "Неверная Транзакция",