From dca99732221b2565362c1d552b2ba7d0ec2f117c Mon Sep 17 00:00:00 2001 From: roiLeo Date: Wed, 23 Oct 2024 12:01:49 +0200 Subject: [PATCH 01/40] =?UTF-8?q?=E2=9C=A8=20swap=20page=20landing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/svg/arrows.svg | 19 ++++++++++ components/swap/landing.vue | 68 +++++++++++++++++++++++++++++++++++ locales/en.json | 8 +++++ pages/[prefix]/swap/index.vue | 18 ++++++++++ 4 files changed, 113 insertions(+) create mode 100644 assets/svg/arrows.svg create mode 100644 components/swap/landing.vue create mode 100644 pages/[prefix]/swap/index.vue diff --git a/assets/svg/arrows.svg b/assets/svg/arrows.svg new file mode 100644 index 0000000000..10a3492e44 --- /dev/null +++ b/assets/svg/arrows.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + diff --git a/components/swap/landing.vue b/components/swap/landing.vue new file mode 100644 index 0000000000..4b5802cbe5 --- /dev/null +++ b/components/swap/landing.vue @@ -0,0 +1,68 @@ + + + diff --git a/locales/en.json b/locales/en.json index 61277caac1..a6e83b2fd8 100644 --- a/locales/en.json +++ b/locales/en.json @@ -1787,6 +1787,14 @@ "support": { "tooltip": "Cover costs mean that users help to support initial costs for Koda which stores your JPEG on your behalf." }, + "swap": { + "beginSwap": "Begin Swap offer", + "connectTrader": "Connect with a trader", + "connectTraderInfo": "Enter the wallet address of the trader you want to engage with, and we’ll guide you through the secure process of making a swap offer.", + "landingSubtitle": "Koda Swap facilitates secure and straightforward exchanges of digital assets. Connect directly with traders and confidently navigate your NFT transactions with our reliable platform.", + "landingTitle": "Koda Swap", + "learnMoreAboutSwaps": "Learn more about swaps" + }, "tabs": { "activity": "Activity", "chart": "Chart", diff --git a/pages/[prefix]/swap/index.vue b/pages/[prefix]/swap/index.vue new file mode 100644 index 0000000000..ef7a323847 --- /dev/null +++ b/pages/[prefix]/swap/index.vue @@ -0,0 +1,18 @@ + + + From 2d4c882bfb2dd0ba1ef187abb40c4fd71f8f731e Mon Sep 17 00:00:00 2001 From: roiLeo Date: Wed, 23 Oct 2024 14:24:33 +0200 Subject: [PATCH 02/40] =?UTF-8?q?=E2=9C=A8=20wip:=20swap=20page=20Step=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/swap/DestinationProfile.vue | 45 ++++++++++++++++++++++++++ components/swap/landing.vue | 11 ++++--- pages/[prefix]/swap/[id].vue | 9 ++++++ 3 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 components/swap/DestinationProfile.vue create mode 100644 pages/[prefix]/swap/[id].vue diff --git a/components/swap/DestinationProfile.vue b/components/swap/DestinationProfile.vue new file mode 100644 index 0000000000..d7e3dee3e2 --- /dev/null +++ b/components/swap/DestinationProfile.vue @@ -0,0 +1,45 @@ + + + diff --git a/components/swap/landing.vue b/components/swap/landing.vue index 4b5802cbe5..1648eaafeb 100644 --- a/components/swap/landing.vue +++ b/components/swap/landing.vue @@ -34,7 +34,7 @@

-
+ @@ -60,9 +60,12 @@ diff --git a/pages/[prefix]/swap/[id].vue b/pages/[prefix]/swap/[id].vue new file mode 100644 index 0000000000..5cfb562e5c --- /dev/null +++ b/pages/[prefix]/swap/[id].vue @@ -0,0 +1,9 @@ + + + From ca6665512f52e0be3ec54365dcc52f963416c596 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Thu, 24 Oct 2024 10:57:59 +0200 Subject: [PATCH 03/40] =?UTF-8?q?=E2=9C=A8=20wip:=20swap=20page=20Step=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/swap/DestinationProfile.vue | 23 ++++++++++++++++++----- components/swap/landing.vue | 1 + locales/en.json | 6 +++++- middleware/redirects.global.ts | 3 ++- utils/config/permission.config.ts | 4 ++++ 5 files changed, 30 insertions(+), 7 deletions(-) diff --git a/components/swap/DestinationProfile.vue b/components/swap/DestinationProfile.vue index d7e3dee3e2..3d8b60cd44 100644 --- a/components/swap/DestinationProfile.vue +++ b/components/swap/DestinationProfile.vue @@ -3,17 +3,17 @@

- Select their NFTs for the Swap + {{ $t('swap.selectNft') }}

- Click on any NFT to add it to your swap list. + {{ $t('swap.clickOnNft') }}

- Your Address + {{ $t('swap.yourAddress') }}
@@ -26,14 +26,27 @@
- Counterparty + {{ $t('swap.counterparty') }}
-
+
+
+
+
+
+
+
+
+ Your Swap List +
+
+
+
+
diff --git a/components/swap/landing.vue b/components/swap/landing.vue index 1648eaafeb..23bef6e2cd 100644 --- a/components/swap/landing.vue +++ b/components/swap/landing.vue @@ -40,6 +40,7 @@ placeholder="Enter wallet address" :strict="false" empty-on-error + with-address-check /> { const { urlPrefix } = usePrefix() @@ -51,6 +51,7 @@ export default defineNuxtRouteMiddleware((route) => { }, getPermissionRouteCondition((val: string) => val === `/${urlPrefix.value}/teleport`, teleportVisible), getPermissionRouteCondition((val: string) => val === `/${urlPrefix.value}/transfer`, transferVisible), + getPermissionRouteCondition((val: string) => val === `/${urlPrefix.value}/swap`, swapVisible), getPermissionRouteCondition((val: string) => val === '/migrate', migrateVisible), { cond: (val: string) => val.startsWith('/transfer'), diff --git a/utils/config/permission.config.ts b/utils/config/permission.config.ts index fd048f4660..9be6ce7548 100644 --- a/utils/config/permission.config.ts +++ b/utils/config/permission.config.ts @@ -71,3 +71,7 @@ export const dropsVisible = (prefix: Prefix | string) => { export const explorerVisible = (prefix: Prefix | string): boolean => { return hasExplorer[prefix] ?? true } + +export const swapVisible = (prefix: Prefix | string): boolean => { + return ['ahp', 'ahk'].includes(prefix) +} From 0fe2f3d7516ed5e0b3664abed39a46fb5ad5ddc3 Mon Sep 17 00:00:00 2001 From: roiLeo Date: Thu, 24 Oct 2024 11:22:18 +0200 Subject: [PATCH 04/40] =?UTF-8?q?=E2=9C=A8=20wip:=20swap=20page=20Step=202?= =?UTF-8?q?=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/swap/DestinationProfile.vue | 29 +++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/components/swap/DestinationProfile.vue b/components/swap/DestinationProfile.vue index 3d8b60cd44..1dd5dac2b6 100644 --- a/components/swap/DestinationProfile.vue +++ b/components/swap/DestinationProfile.vue @@ -1,7 +1,7 @@ diff --git a/components/swap/Preview.vue b/components/swap/Preview.vue index 13f888dd76..0e4dafb586 100644 --- a/components/swap/Preview.vue +++ b/components/swap/Preview.vue @@ -64,6 +64,7 @@ size="large" label="Next" variant="primary" + :disabled no-shadow expanded @click="emit('next')" @@ -80,6 +81,7 @@ import { sanitizeIpfsUrl } from '@/utils/ipfs' const emit = defineEmits(['next', 'clear']) const props = defineProps<{ title: string + disabled?: boolean items: any[] }>() diff --git a/components/swap/YourProfile.vue b/components/swap/YourProfile.vue index dd53f07f5e..08991292f4 100644 --- a/components/swap/YourProfile.vue +++ b/components/swap/YourProfile.vue @@ -12,20 +12,30 @@ diff --git a/stores/atomicSwaps.ts b/stores/atomicSwaps.ts index 7a49c6a540..0f82fc5c25 100644 --- a/stores/atomicSwaps.ts +++ b/stores/atomicSwaps.ts @@ -1,26 +1,80 @@ import { defineStore } from 'pinia' +import { computed } from 'vue' + +export type AtomicSwap = { + counterparty: string + offerer: string + offered: SwapItem[] + desired: SwapItem[] + createdAt: number +} & CartItem type SwapItem = { id: string } -type State = { - counterparty?: string - offered: SwapItem[] - desired: SwapItem[] -} +export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { + const { + items, + chain, + count, + itemsInChain, + getItem, + setItem, + removeItem, + clear, + updateItem, + } = useCart() + + const { accountId } = useAuth() + const { urlPrefix } = usePrefix() + const getItems = computed(() => items.value) + const route = useRoute() + + // make a ref + const counterparty = computed(() => route.params.id.toString() as string) + + const lastSwap = computed(() => { + const atomicSwaps = items.value + .filter(item => + item.counterparty === counterparty.value + && item.urlPrefix === urlPrefix.value + && item.offerer === accountId.value, + ).sort((a, b) => b.createdAt - a.createdAt) + return atomicSwaps[0] + }) + + const createSwap = () => { + const newAtomicSwap: AtomicSwap = { + id: window.crypto.randomUUID(), + counterparty: counterparty.value, + offerer: accountId.value, + offered: [], + desired: [], + createdAt: Date.now(), + urlPrefix: urlPrefix.value, + } + + setItem(newAtomicSwap) + + return newAtomicSwap + } -export const useAtomicSwapsStore = defineStore('atomicSwaps', { - state: (): State => ({ - counterparty: undefined, - offered: [], - desired: [], - }), - actions: { - reset() { - this.counterparty = undefined - this.offered = [] - this.desired = [] - }, - }, + return { + // state + items, + // getters + chain, + count, + itemsInChain, + getItems, + // actions + getItem, + lastSwap, + setItem, + updateItem, + removeItem, + clear, + createSwap, + } }) From bc35ebdddd319e60073bff219c9a73e67416d327 Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Wed, 6 Nov 2024 16:52:51 +0500 Subject: [PATCH 09/40] ref(useAtomicSwapAction.ts): cleaner and null check --- components/items/ItemsGrid/useAtomicSwapAction.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/components/items/ItemsGrid/useAtomicSwapAction.ts b/components/items/ItemsGrid/useAtomicSwapAction.ts index 4f98e4c6a3..964c779c97 100644 --- a/components/items/ItemsGrid/useAtomicSwapAction.ts +++ b/components/items/ItemsGrid/useAtomicSwapAction.ts @@ -35,17 +35,15 @@ export default (nft: NFTWithMetadata) => { const isItemSelected = computed(() => items.value?.some(item => item.id === nft.id)) const onAtomicSwapSelect = () => { - if (!itemsKey.value) { + if (!itemsKey.value || !lastSwap.value) { return } - const updatedSwap = lastSwap.value - if (isItemSelected.value) { - updatedSwap[itemsKey.value] = items.value.filter(item => item.id !== nft.id) + lastSwap.value[itemsKey.value] = items.value.filter(item => item.id !== nft.id) } else { - updatedSwap[itemsKey.value].push(nft) + lastSwap.value[itemsKey.value].push(nft) } } From 75041cdd51f6e18856d50745874c3953e812ce2a Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:45:13 +0500 Subject: [PATCH 10/40] add(swaps): add connect wallet button if wallet is not disconnected --- components/swap/banner/accounts.vue | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/components/swap/banner/accounts.vue b/components/swap/banner/accounts.vue index 2203ffdff7..6f13fe7b6c 100644 --- a/components/swap/banner/accounts.vue +++ b/components/swap/banner/accounts.vue @@ -1,10 +1,14 @@ - + @@ -13,5 +14,6 @@ const gridSection = GridSection.PROFILE_GALLERY defineProps<{ query: Record + selectable?: boolean }>() diff --git a/components/swap/YourProfile.vue b/components/swap/YourProfile.vue index 08991292f4..7302e146e4 100644 --- a/components/swap/YourProfile.vue +++ b/components/swap/YourProfile.vue @@ -8,7 +8,10 @@ /> - + @@ -23,7 +27,6 @@ diff --git a/components/swap/review.vue b/components/swap/review.vue index e5bf81fca3..0346b2f5cc 100644 --- a/components/swap/review.vue +++ b/components/swap/review.vue @@ -26,8 +26,13 @@

{{ $t('swap.reviewSelected') }}

+ + -
+
{{ $t('swap.reviewCounterpartyAccept') }}

+ +
@@ -55,5 +65,10 @@ diff --git a/middleware/swap.ts b/middleware/swap.ts new file mode 100644 index 0000000000..fbfc77db0d --- /dev/null +++ b/middleware/swap.ts @@ -0,0 +1,23 @@ +export default defineNuxtRouteMiddleware((to) => { + const { toast } = useToast() + const atomicSwapsStore = useAtomicSwapsStore() + const { lastSwap, counterparty } = storeToRefs(atomicSwapsStore) + + const id = to.params.id?.toString() + + if (!id) { + return navigateTo({ name: 'prefix-swap' }) + } + + counterparty.value = id + + if (to.name === 'prefix-swap-id' && !lastSwap.value) { + atomicSwapsStore.createSwap() + return + } + + if (!lastSwap.value) { + toast('First select the NFTs you want to offer') + return navigateTo({ name: 'prefix-swap-id', params: { id } }) + } +}) diff --git a/pages/[prefix]/swap/[id]/index.vue b/pages/[prefix]/swap/[id]/index.vue index 5cfb562e5c..36e190dc1e 100644 --- a/pages/[prefix]/swap/[id]/index.vue +++ b/pages/[prefix]/swap/[id]/index.vue @@ -5,5 +5,6 @@ diff --git a/pages/[prefix]/swap/[id]/offer.vue b/pages/[prefix]/swap/[id]/offer.vue index 423b8a153d..fec12ce6a8 100644 --- a/pages/[prefix]/swap/[id]/offer.vue +++ b/pages/[prefix]/swap/[id]/offer.vue @@ -5,5 +5,6 @@ diff --git a/pages/[prefix]/swap/[id]/review.vue b/pages/[prefix]/swap/[id]/review.vue index 4c2a4be72a..2802fd2a61 100644 --- a/pages/[prefix]/swap/[id]/review.vue +++ b/pages/[prefix]/swap/[id]/review.vue @@ -5,5 +5,6 @@ diff --git a/stores/atomicSwaps.ts b/stores/atomicSwaps.ts index 0f82fc5c25..63ffa2bbf6 100644 --- a/stores/atomicSwaps.ts +++ b/stores/atomicSwaps.ts @@ -29,10 +29,8 @@ export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { const { accountId } = useAuth() const { urlPrefix } = usePrefix() const getItems = computed(() => items.value) - const route = useRoute() - // make a ref - const counterparty = computed(() => route.params.id.toString() as string) + const counterparty = ref() const lastSwap = computed(() => { const atomicSwaps = items.value @@ -63,6 +61,7 @@ export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { return { // state items, + counterparty, // getters chain, count, From 6e0c279b33830439fe644ea8137d6126260ddb99 Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:28:34 +0500 Subject: [PATCH 12/40] add(swaps): pesist store and step --- .../items/ItemsGrid/useAtomicSwapAction.ts | 21 +++++----- components/swap/DestinationProfile.vue | 13 ++++--- components/swap/YourProfile.vue | 9 +++-- components/swap/review.vue | 6 +-- middleware/swap.ts | 18 +++++++-- stores/atomicSwaps.ts | 39 ++++++++++++++----- 6 files changed, 70 insertions(+), 36 deletions(-) diff --git a/components/items/ItemsGrid/useAtomicSwapAction.ts b/components/items/ItemsGrid/useAtomicSwapAction.ts index 964c779c97..57ef86d707 100644 --- a/components/items/ItemsGrid/useAtomicSwapAction.ts +++ b/components/items/ItemsGrid/useAtomicSwapAction.ts @@ -8,42 +8,41 @@ export const ATOMIC_SWAP_PAGES = [ export default (nft: NFTWithMetadata) => { const route = useRoute() - const { lastSwap } = storeToRefs(useAtomicSwapsStore()) + const { swap, step } = storeToRefs(useAtomicSwapsStore()) const routeName = computed(() => route.name?.toString() as string) const showAtomicSwapAction = computed(() => ATOMIC_SWAP_PAGES.includes(routeName.value)) - const isDesiredSelection = computed(() => routeName.value === 'prefix-swap-id') - const isOfferedSelection = computed(() => routeName.value === 'prefix-swap-id-offer') - const itemsKey = computed(() => { - if (isDesiredSelection.value) { + if (step.value === SwapStep.DESIRED) { return 'desired' } - if (isOfferedSelection.value) { + if (step.value === SwapStep.OFFERED) { return 'offered' } }) const items = computed(() => { - const items = lastSwap.value?.[itemsKey.value || ''] + const items = swap.value?.[itemsKey.value || ''] return items }) - const isItemSelected = computed(() => items.value?.some(item => item.id === nft.id)) + const isItemSelected = computed(() => { + return step.value === SwapStep.REVIEW ? false : items.value?.some(item => item.id === nft.id) + }) const onAtomicSwapSelect = () => { - if (!itemsKey.value || !lastSwap.value) { + if (!itemsKey.value || !swap.value) { return } if (isItemSelected.value) { - lastSwap.value[itemsKey.value] = items.value.filter(item => item.id !== nft.id) + swap.value[itemsKey.value] = items.value.filter(item => item.id !== nft.id) } else { - lastSwap.value[itemsKey.value].push(nft) + swap.value[itemsKey.value].push(nft) } } diff --git a/components/swap/DestinationProfile.vue b/components/swap/DestinationProfile.vue index 6101034598..dbca3c8faf 100644 --- a/components/swap/DestinationProfile.vue +++ b/components/swap/DestinationProfile.vue @@ -15,12 +15,15 @@ @@ -31,7 +34,7 @@ const { accountId } = useAuth() const route = useRoute() const atomicSwapsStore = useAtomicSwapsStore() -const { lastSwap } = storeToRefs(atomicSwapsStore) +const { swap } = storeToRefs(atomicSwapsStore) const query = reactive({ currentOwner_eq: route.params.id, diff --git a/components/swap/YourProfile.vue b/components/swap/YourProfile.vue index 7302e146e4..39d04f4ec2 100644 --- a/components/swap/YourProfile.vue +++ b/components/swap/YourProfile.vue @@ -15,10 +15,11 @@ @@ -27,7 +28,7 @@ diff --git a/middleware/swap.ts b/middleware/swap.ts index fbfc77db0d..64c856a4e9 100644 --- a/middleware/swap.ts +++ b/middleware/swap.ts @@ -1,7 +1,8 @@ export default defineNuxtRouteMiddleware((to) => { const { toast } = useToast() + const { accountId } = useAuth() const atomicSwapsStore = useAtomicSwapsStore() - const { lastSwap, counterparty } = storeToRefs(atomicSwapsStore) + const { swap, counterparty } = storeToRefs(atomicSwapsStore) const id = to.params.id?.toString() @@ -11,12 +12,21 @@ export default defineNuxtRouteMiddleware((to) => { counterparty.value = id - if (to.name === 'prefix-swap-id' && !lastSwap.value) { - atomicSwapsStore.createSwap() + watchEffect(() => { + if (swap.value) { + atomicSwapsStore.updateItem({ + ...swap.value, + creator: accountId.value ? accountId.value : undefined, + }) + } + }) + + if (to.name === 'prefix-swap-id' && !swap.value) { + atomicSwapsStore.createSwap(id) return } - if (!lastSwap.value) { + if (!swap.value) { toast('First select the NFTs you want to offer') return navigateTo({ name: 'prefix-swap-id', params: { id } }) } diff --git a/stores/atomicSwaps.ts b/stores/atomicSwaps.ts index 63ffa2bbf6..c494ecea87 100644 --- a/stores/atomicSwaps.ts +++ b/stores/atomicSwaps.ts @@ -3,16 +3,23 @@ import { computed } from 'vue' export type AtomicSwap = { counterparty: string - offerer: string + creator?: string offered: SwapItem[] desired: SwapItem[] createdAt: number + surcharge: { receive?: string, send?: string } } & CartItem type SwapItem = { id: string } +export enum SwapStep { + DESIRED = 'desired', + OFFERED = 'offered', + REVIEW = 'review', +} + export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { const { items, @@ -30,27 +37,40 @@ export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { const { urlPrefix } = usePrefix() const getItems = computed(() => items.value) + const route = useRoute() + const routeName = computed(() => route.name?.toString()) + + const step = computed(() => { + return routeName.value + ? { + 'prefix-swap-id': SwapStep.DESIRED, + 'prefix-swap-id-offer': SwapStep.OFFERED, + 'prefix-swap-id-review': SwapStep.REVIEW, + }[routeName.value] + : undefined + }) + const counterparty = ref() - const lastSwap = computed(() => { + const swap = computed(() => { const atomicSwaps = items.value .filter(item => item.counterparty === counterparty.value - && item.urlPrefix === urlPrefix.value - && item.offerer === accountId.value, + && item.urlPrefix === urlPrefix.value, ).sort((a, b) => b.createdAt - a.createdAt) return atomicSwaps[0] }) - const createSwap = () => { + const createSwap = (counterparty: string) => { const newAtomicSwap: AtomicSwap = { id: window.crypto.randomUUID(), - counterparty: counterparty.value, - offerer: accountId.value, + counterparty, offered: [], desired: [], createdAt: Date.now(), urlPrefix: urlPrefix.value, + surcharge: {}, + creator: accountId.value ? accountId.value : undefined, } setItem(newAtomicSwap) @@ -67,13 +87,14 @@ export const useAtomicSwapsStore = defineStore('atomicSwaps', () => { count, itemsInChain, getItems, + step, // actions getItem, - lastSwap, + swap, setItem, updateItem, removeItem, clear, createSwap, } -}) +}, { persist: true }) From d0d6ad3493fd8a5b307499df95362a3b50b142e2 Mon Sep 17 00:00:00 2001 From: hassnian <44554284+hassnian@users.noreply.github.com> Date: Sat, 9 Nov 2024 16:21:18 +0500 Subject: [PATCH 13/40] add(swaps): init `createSwap` transaction --- components/items/ItemsGrid/ItemsGridImage.vue | 2 +- .../items/ItemsGrid/useAtomicSwapAction.ts | 8 +- components/offer/OfferExpirationSelector.vue | 13 ++- components/swap/DestinationProfile.vue | 11 ++- components/swap/Preview.vue | 18 +++++ components/swap/YourProfile.vue | 11 ++- components/swap/review.vue | 74 ++++++++++++++++- .../transaction/transactionCreateSwap.ts | 80 +++++++++++++++++++ composables/transaction/transactionOffer.ts | 2 +- composables/transaction/types.ts | 24 ++++++ composables/transaction/utils.ts | 3 + composables/useTransaction.ts | 10 +++ locales/en.json | 4 + stores/atomicSwaps.ts | 12 ++- utils/shoppingActions.ts | 1 + 15 files changed, 257 insertions(+), 16 deletions(-) create mode 100644 composables/transaction/transactionCreateSwap.ts diff --git a/components/items/ItemsGrid/ItemsGridImage.vue b/components/items/ItemsGrid/ItemsGridImage.vue index 070c419f1a..eabddf547d 100644 --- a/components/items/ItemsGrid/ItemsGridImage.vue +++ b/components/items/ItemsGrid/ItemsGridImage.vue @@ -28,7 +28,7 @@ #action >
{ swap.value[itemsKey.value] = items.value.filter(item => item.id !== nft.id) } else { - swap.value[itemsKey.value].push(nft) + swap.value[itemsKey.value].push({ + id: nft.id, + collectionId: nft.collection.id, + sn: nft.sn, + name: nft.name, + meta: nft.meta, + }) } } diff --git a/components/offer/OfferExpirationSelector.vue b/components/offer/OfferExpirationSelector.vue index b644913bd8..0904d3b89f 100644 --- a/components/offer/OfferExpirationSelector.vue +++ b/components/offer/OfferExpirationSelector.vue @@ -3,7 +3,7 @@ v-model="selected" aria-role="list" :triggers="['click']" - position="bottom-left" + :position="position" append-to-body close-menu-on-move class="w-full" @@ -54,9 +54,14 @@ const options = EXPIRATION_DAYS_LIST.map(value => ({ const selectedItem = computed(() => options.find(option => option.value === selected.value)) -const props = defineProps<{ - modelValue?: number -}>() +const props = withDefaults( + defineProps<{ + modelValue?: number + position?: string + }>(), { + position: 'bottom-left', + }, +) const emit = defineEmits(['update:modelValue']) diff --git a/components/swap/DestinationProfile.vue b/components/swap/DestinationProfile.vue index dbca3c8faf..a0af27587a 100644 --- a/components/swap/DestinationProfile.vue +++ b/components/swap/DestinationProfile.vue @@ -1,5 +1,5 @@