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

Updated sendBtcTransaction hub request #85

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
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