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

feat: offer fees displayed in the modal #11083

Merged
merged 1 commit into from
Oct 7, 2024
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
21 changes: 19 additions & 2 deletions components/offer/MakeOffer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
<MakingOfferSingleItem v-if="offerStore.items.length === 1" />
</div>

<div class="border-t pt-5 pb-4 px-6">
<div
class="flex justify-between text-k-grey border-b-k-shade"
>
<span>{{ $t('offer.offerFees') }}</span>
<span class="ml-2">{{ teleportTransitionTxFees }}</span>
</div>
</div>

<div class="flex justify-between px-6">
<AutoTeleportActionButton
ref="autoTeleportButton"
Expand Down Expand Up @@ -55,7 +64,7 @@ import ModalBody from '@/components/shared/modals/ModalBody.vue'
import { usePreferencesStore } from '@/stores/preferences'
import type { Actions, TokenToOffer } from '@/composables/transaction/types'
import { useMakingOfferStore } from '@/stores/makeOffer'
import { calculateBalance } from '@/utils/format/balance'
import format, { calculateBalance } from '@/utils/format/balance'
import { warningMessage } from '@/utils/notification'
import ModalIdentityItem from '@/components/shared/ModalIdentityItem.vue'
import AutoTeleportActionButton, {
Expand Down Expand Up @@ -87,7 +96,7 @@ const {
const { notification, lastSessionId, updateSession } = useLoadingNotfication()
const { itemsInChain, hasInvalidOfferPrices, count } = storeToRefs(offerStore)

const { decimals } = useChain()
const { decimals, chainSymbol } = useChain()
const { $i18n } = useNuxtApp()
const items = ref<MakingOfferItem[]>([])

Expand All @@ -104,6 +113,14 @@ const getAction = (items: MakingOfferItem[]): Actions => {
}
}

const teleportTransitionTxFees = computed(() =>
format(
(autoTeleportButton.value?.optimalTransition.txFees || 0) + OFFER_MINT_PRICE,
decimals.value,
chainSymbol.value,
),
)

const { action, autoTeleport, autoTeleportButton, autoTeleportLoaded } = useAutoTeleportActionButton({
getActionFn: () => getAction(itemsInChain.value),
})
Expand Down
1 change: 1 addition & 0 deletions locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1485,6 +1485,7 @@
"newOffer": "New Offer",
"offerAccept": "Accepting Offer",
"offerCreation": "Offer Creation",
"offerFees": "Offer Fee",
"offerWithdrawl": "Offer Cancelation",
"typeOffer": "Type An Offer",
"yourOffer": "Your Offer",
Expand Down
Loading