Skip to content

Commit

Permalink
updated sendBtcTransaction hub request
Browse files Browse the repository at this point in the history
  • Loading branch information
onmax committed Feb 22, 2022
1 parent dcf2597 commit 3128e12
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/FeeSelector.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default defineComponent({
}
}
context.emit('fee', fee);
context.emit('fee', { fee, delay: delay.value });
});
const speed = computed(() => {
Expand Down
11 changes: 10 additions & 1 deletion src/components/modals/BtcSendModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ export default defineComponent({
} = useBtcLabelsStore();
const { state: network$, isFetchingTxHistory } = useBtcNetworkStore();
const delay = ref(12); // Same value as Fee Selector default value
const recipientWithLabel = ref<{address: string, label: string, type: RecipientType} | null>(null);
function saveRecipientLabel() {
Expand Down Expand Up @@ -344,9 +346,12 @@ export default defineComponent({
amount.value = maxSendableAmount.value;
}
function updateFee(newFeePerByte: number) {
interface FeeSelectorEvent {fee: number; delay: number}
function updateFee({ fee: newFeePerByte, delay: newDelay }: FeeSelectorEvent) {
const isSendingMax = amount.value === maxSendableAmount.value;
feePerByte.value = newFeePerByte;
delay.value = newDelay;
if (isSendingMax) sendMax();
}
Expand Down Expand Up @@ -479,6 +484,10 @@ export default defineComponent({
value: requiredInputs.value.changeAmount,
},
} : {}),
fiatCurrency: fiat$.currency,
fiatRate: exchangeRates.value.btc[fiat$.currency] || 0, // Hub will handle this
delay: delay.value,
feePerByte: feePerByte.value,
});
if (!plainTx) {
Expand Down

0 comments on commit 3128e12

Please sign in to comment.